Browse Source

Removed the documentation at the top of the files for all of the types implemented in Lua.

The documentation will be presented in a more readable format on the libRocket website.

Added Document and ElementText as types that Element can be casted to from the Element.As table
Nate Starkey 13 years ago
parent
commit
2d4824eb29

+ 0 - 13
Source/Controls/Lua/DataFormatter.h

@@ -27,20 +27,7 @@
  
 #ifndef ROCKETCONTROLSLUADATAFORMATTER_H
 #define ROCKETCONTROLSLUADATAFORMATTER_H
-/*
-    This defines the DataFormatter type in the Lua global namespace
-
-    The usage is to create a new DataFormatter, and set the FormatData variable on it to a function, where you return a rml string that will
-    be the formatted data
-
-    //method
-    --this method is NOT called from any particular instance, use it as from the type
-    DataFormatter DataFormatter.new([string name[, function FormatData]]) --both are optional, but if you pass in a function, you must also pass in a name first
 
-    //setter
-    --this is called from a specific instance (one returned from DataFormatter.new)
-    DataFormatter.FormatData = function( {key=int,value=string} ) --where indexes are sequential, like an array of strings
-*/
 
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>

+ 0 - 16
Source/Controls/Lua/DataSource.h

@@ -28,22 +28,6 @@
 #ifndef ROCKETCONTROLSLUADATASOURCE_H
 #define ROCKETCONTROLSLUADATASOURCE_H
 
-/*
-    This defines the DataSource type in the Lua global namespace
-    
-    //methods
-    noreturn DataSource:NotifyRowAdd(string tablename, int firstadded, int numadded)
-    noreturn DataSource:NotifyRemove(string tablename, int firstremoved, int numremoved)
-    noreturn DataSource:NotifyRowChange(string tablename, int firstchanged, int numchanged)
-    noreturn DataSource:NotifyRowChange(string tablename) --the same as above, but for all rows
-    
-    when you get an instance of this, you MUST set two functions:
-    DataSource.GetNumRows = function(tablename) ....... end --returns an int
-    DataSource.GetRow = function(tablename,index,columns) ......end
-    --where columns is a numerically indexed table of strings, and the function needs to
-    --return a table of numerically indexed strings
-*/
-
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>
 #include "LuaDataSource.h"

+ 0 - 12
Source/Controls/Lua/ElementDataGrid.h

@@ -27,19 +27,7 @@
  
 #ifndef ROCKETCONTROLSLUAELEMENTDATAGRID_H
 #define ROCKETCONTROLSLUAELEMENTDATAGRID_H
-/*
-    This defines the ElementDataGrid type in the Lua global namespace
-    
-    inherits from Element
-
-    //methods
-    noreturn ElementDataGrid:AddColumn(string fields, string formatter, float initial_width, string header_rml)
-    noreturn ElementDataGrid:SetDataSource(string data_source_name)
 
-    //getter
-    {}key=int,value=ElementDataGridRow ElementDataGrid.rows
-    --it returns a table, so you can acess it just like any other table. 
-*/
 
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>

+ 0 - 16
Source/Controls/Lua/ElementDataGridRow.h

@@ -27,23 +27,7 @@
  
 #ifndef ROCKETCONTROLSLUAELEMENTDATAGRIDROW_H
 #define ROCKETCONTROLSLUAELEMENTDATAGRIDROW_H
-/*
-    This defines the ElementDataGridRow type in the Lua global namespace
-
-    inherits from Element
-
-    no methods
-
-    //getters
-    bool ElementDataGridRow.row_expanded
-    int ElementDataGridRow.parent_relative_index
-    int ElementDataGridRow.table_relative_index
-    ElementDataGridRow ElementDataGridRow.parent_row
-    ElementDataGrid ElementDataGridRow.parent_grid
 
-    //setter
-    ElementDataGridRow.row_expanded = bool
-*/
 
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>

+ 0 - 8
Source/Controls/Lua/ElementForm.h

@@ -27,14 +27,6 @@
  
 #ifndef ROCKETCONTROLSLUAELEMENTFORM_H
 #define ROCKETCONTROLSLUAELEMENTFORM_H
-/*
-    This defines the ElementForm type in the Lua global namespace
-
-    methods:
-    ElementForm:Submit(string name,string value)
-
-    for everything else, see the documentation for "Element"
-*/
 
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>

+ 0 - 8
Source/Controls/Lua/ElementFormControl.h

@@ -27,15 +27,7 @@
  
 #ifndef ROCKETCONTROLSLUAELEMENTFORMCONTROL_H
 #define ROCKETCONTROLSLUAELEMENTFORMCONTROL_H
-/*
-    This defines the ElementFormControl type in the Lua global namespace
-
-    it has no methods, and all of the attributes are read and write
 
-    bool    ElementFormControl.disabled
-    string  ElementFormControl.name
-    string  ElementFormControl.value
-*/
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Controls/ElementFormControl.h>

+ 0 - 10
Source/Controls/Lua/ElementFormControlDataSelect.h

@@ -27,16 +27,6 @@
  
 #ifndef ROCKETCONTROLSLUAELEMENTFORMCONTROLDATASELECT_H
 #define ROCKETCONTROLSLUAELEMENTFORMCONTROLDATASELECT_H
-/*
-    This defines the ElementFormControlDataSelect type in the Lua global namespace. I think it is the longest
-    type name.
-
-    It inherits from ElementFormControlSelect, which inherits from ElementFormControl, which inherits from Element
-
-    //method
-    noreturn ElementFormControlDataSelect:SetDataSource(string source)
-*/
-
 
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>

+ 0 - 13
Source/Controls/Lua/ElementFormControlInput.h

@@ -27,20 +27,7 @@
  
 #ifndef ROCKETCONTROLSLUAELEMENTFORMCONTROLINPUT_H
 #define ROCKETCONTROLSLUAELEMENTFORMCONTROLINPUT_H
-/*
-    This defines the type ElementFormControlInput in the Lua globla namespace, refered to in this documentation by EFCInput
-
-    It inherits from ELementFormControl which inherits from Element
 
-    all of the properties are read and write
-    bool EFCInput.checked
-    int EFCInput.maxlength
-    int EFCInput.size
-    int EFCInput.max
-    int EFCInput.min
-    int EFCInput.step
-    
-*/
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Controls/ElementFormControlInput.h>

+ 0 - 19
Source/Controls/Lua/ElementFormControlSelect.h

@@ -28,25 +28,6 @@
 #ifndef ROCKETCONTROLSLUAELEMENTFORMCONTROLSELECT_H
 #define ROCKETCONTROLSLUAELEMENTFORMCONTROLSELECT_H
 
-/*
-    This defines the ElementFormControlSelect type in the Lua global namespace, for this documentation will be
-    named EFCSelect
-
-    It has one extra method than the Python api, which is GetOption
-
-    //methods
-    int EFCSelect:Add(string rml, string value, [int before]) --where 'before' is optional, and is an index
-    noreturn EFCSelect:Remove(int index)
-    {"element"=Element,"value"=string} EFCSelect:GetOption(int index) --this is a more efficient way to get an option if you know the index beforehand
-
-    //getters
-    {[int index]={"element"=Element,"value"=string}} EFCSelect.options --used to access options as a Lua table. Comparatively expensive operation, use GetOption when 
-                                                                       --you only need one option and you know the index
-    int EFCSelect.selection
-
-    //setter
-    EFCSelect.selection = int
-*/
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Controls/ElementFormControlSelect.h>

+ 0 - 10
Source/Controls/Lua/ElementFormControlTextArea.h

@@ -27,17 +27,7 @@
  
 #ifndef ROCKETCONTROLSLUAELEMENTFORMCONTROLTEXTAREA_H
 #define ROCKETCONTROLSLUAELEMENTFORMCONTROLTEXTAREA_H
-/*
-    This defines the ElementFormControlTextArea type in the Lua global namespace, refered in this documentation by EFCTextArea
-
-    It inherits from ElementFormControl,which inherits from Element
 
-    All properties are read/write
-    int EFCTextArea.cols
-    int EFCTextArea.maxlength
-    int EFCTextArea.rows
-    bool EFCTextArea.wordwrap
-*/
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Controls/ElementFormControlTextArea.h>

+ 0 - 16
Source/Controls/Lua/ElementTabSet.h

@@ -27,22 +27,6 @@
  
 #ifndef ROCKETCONTROLSLUAELEMENTTABSET_H
 #define ROCKETCONTROLSLUAELEMENTTABSET_H
-/*
-    This defines the ElementTabSet type in the Lua global namespace
-
-    It inherits from Element
-
-    //methods:
-    noreturn ElementTabSet:SetPanel(int index, string rml)
-    noreturn ElementTabSet:SetTab(int index, string rml)
-
-    //getters
-    int ElementTabSet.active_tab
-    int ElementTabSet.num_tabs
-
-    //setter
-    ElementTabSet.active_tab = int
-*/
 
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>

+ 1 - 14
Source/Controls/Lua/SelectOptionsProxy.h

@@ -27,20 +27,7 @@
  
 #ifndef ROCKETCONTROLSLUASELECTOPTIONSPROXY_H
 #define ROCKETCONTROLSLUASELECTOPTIONSPROXY_H
-/*
-    Proxy table for ElementFormControlSelect.options
-    read-only, key must be a number
-    Each object in this proxy is a table with two items:
-    Element element and String value
-    Usage:
-    ElementFormControlSelect.options[2].element or ElementFormControlSelect.options[2].value
-    OR, as usual you can store the object in a variable like
-    local opt = ElementFormControlSelect.options
-    opt[2].element or opt[2].value
-    and you can store the returned table as a variable, of course
-    local item = opt[2]
-    item.element or item.value
-*/
+
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Controls/ElementFormControlSelect.h>

+ 0 - 25
Source/Core/Lua/Colourb.h

@@ -27,31 +27,6 @@
  
 #ifndef ROCKETCORELUACOLOURB_H
 #define ROCKETCORELUACOLOURB_H
-/*
-    Declares Colourb in the Lua global namespace. It implements the below (examples using Lua syntax) :
-
-    Colourb.new(int red,int green,int blue,int alpha) creates a new Colourf (values must be bounded between 0 and 255 inclusive), 
-    and gets deleted when Lua garbage collects
-    
-    everything after this will assume that you have a local variable named 'col', declared something similar to
-    local col = Colourb.new(0,15,3,255)
-
-    operators (the types that it can operate on are on the right):
-    col == Colourb
-    col + Colourb
-    col * float
-
-    no methods
-
-    get and set attributes:
-    col.red
-    col.green
-    col.blue
-    col.alpha
-
-    get attributes:
-    local red,green,blue,alpha = col.rgba    
-*/
 
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>

+ 0 - 23
Source/Core/Lua/Colourf.h

@@ -27,29 +27,6 @@
  
 #ifndef ROCKETCORELUACOLOURF_H
 #define ROCKETCORELUACOLOURF_H
-/*
-    Declares Colourf in the Lua global namespace. It implements the below (examples using Lua syntax) :
-
-    Colourf.new(float red,float green,float blue,float alpha) creates a new Colourf (values must be bounded between 0 and 1 inclusive), 
-    and gets deleted when Lua garbage collects
-    
-    everything after this will assume that you have a local variable named 'col', declared something similar to
-    local col = Colourf.new(0.1,0.5,0.25,1.0)
-
-    operators (the types that it can operate on are on the right):
-    col == Colourf
-
-    no methods
-
-    get and set attributes:
-    col.red
-    col.green
-    col.blue
-    col.alpha
-
-    get attributes:
-    local red,green,blue,alpha = col.rgba    
-*/
 
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>

+ 0 - 36
Source/Core/Lua/Context.h

@@ -27,43 +27,7 @@
  
 #ifndef ROCKETCORELUACONTEXT_H
 #define ROCKETCORELUACONTEXT_H
-/*
-    This defines a Context type in the Lua global namespace
-
-    //methods
-    noreturn Context:AddEventListener(string event, function | string listener, [Element element, bool capture]) --see note at the bottom
-    noreturn Context:AddMouseCursor(Document cursor_document)
-    Document Context:CreateDocument([string tag]) --tag defaults to "body"
-    Document Context:LoadDocument(string path)
-    Document Context:LoadMouseCursor(string path)
-    bool Context:Render()
-    noreturn Context:ShowMouseCursor(bool show)
-    noreturn Context:UnloadAllDocuments()
-    noreturn Context:UnloadAllMouseCursors()
-    noreturn Context:UnloadDocument(Document doc)
-    noreturn Context:UnloadMouseCursor(string name)
-    bool Context:Update()
-
-    //getters
-    Vector2i Context.dimensions
-    {} where key=string id,value=Document Context.documents
-    Element Context.focus_element
-    Element Context.hover_element
-    string Context.name
-    Element Context.root_element
-
-    //setters
-    Context.dimensions = Vector2i
-
-	--note 1
-	--[[
-	Context:AddEventListener has 2 'unusuals'. The first is that the 2nd argument can be either a string or a function;
-	see footnote 1 in Element.h for more info
-	The second is the optional parameters. If you pass in an element (anything not nil), then it will actually call 
-	element->AddEventListener and will call context->AddEventListener otherwise. capture will default to false
-	]]
 
-*/
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Context.h>

+ 1 - 4
Source/Core/Lua/ContextDocumentsProxy.h

@@ -27,10 +27,7 @@
  
 #ifndef ROCKETCORELUACONTEXTDOCUMENTSPROXY_H
 #define ROCKETCORELUACONTEXTDOCUMENTSPROXY_H
-/*
-    A proxy table with key of string and int and a value of Document
-    Read only
-*/
+
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Context.h>

+ 2 - 0
Source/Core/Lua/Document.cpp

@@ -30,6 +30,7 @@
 #include <Rocket/Core/ElementDocument.h>
 #include <Rocket/Core/Context.h>
 #include "Element.h"
+#include <Rocket/Core/Lua/Utilities.h>
 
 namespace Rocket {
 namespace Core {
@@ -40,6 +41,7 @@ template<> void ExtraInit<Document>(lua_State* L, int metatable_index)
     //we will inherit from Element
     ExtraInit<Element>(L,metatable_index);
     LuaType<Element>::_regfunctions(L,metatable_index,metatable_index - 1);
+    AddTypeToElementAsTable<Document>(L);
 }
 
 //methods

+ 0 - 22
Source/Core/Lua/Document.h

@@ -27,29 +27,7 @@
  
 #ifndef ROCKETCORELUADOCUMENT_H
 #define ROCKETCORELUADOCUMENT_H
-/*
-    This defines the Document type in the Lua global namespace
-
-    It inherits from Element, so check the documentation for Element.h to
-    see what other functions you can call from a Document object. Document
-    specific things are below
-
-    //methods
-    noreturn Document:PullToFront()
-    noreturn Document:PushToBack()
-    noreturn Document:Show(int flag)
-    noreturn Document:Hide()
-    noreturn Document:Close()
-    Element Document:CreateElement(string tag)
-    ElementText Document:CreateTextNode(string text)
-    
-    //getters
-    string Document.title
-    Context Document.context
 
-    //setter
-    Document.title = string
-*/
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/ElementDocument.h>

+ 0 - 89
Source/Core/Lua/Element.h

@@ -27,96 +27,7 @@
  
 #ifndef ROCKETCORELUAELEMENT_H
 #define ROCKETCORELUAELEMENT_H
-/*
-    This defines the Element type in the Lua global namespace
-
-    A few classes "inherit" from Element, such as Document. Document will call
-    LuaType<Element>::_regfunctions to put all of these functions in its own table, and
-    will be used with the same syntax except it will be from a Document object. It isn't true
-    inheritance, but it is a fair enough emulation. Any functions in the child class that have
-    the same name as the function in Element will overwrite the one in Element.
-
-    Here, I will be showing usage of the API, and it will show the type names rather than the regular
-    local var = foo that is Lua. If you need info on the purpose of the functions, see the python docs
-    
-    //methods that need to be called from an Element object using the colon syntax
-    noreturn Element:AddEventListener(string event, ? see footnote 1, [bool capture])
-    noreturn Element:AppendChild(Element child)
-    noreturn Element:Blur()
-    noreturn Element:Click()
-    noreturn Element:DispatchEvent(string event, {} params) --in params, keys have to be a string and value can be number,bool,string,userdata,lightuserdata
-    noreturn Element:Focus()
-    [int,float,Colourb,Colourf,string,Vector2f,lightuserdata] Element:GetAttribute(string name) --will return one of those types
-    Element Element:GetElementById(string id)
-    {}of elements Element:GetElementsByTagName(string tag)
-    bool Element:HasAttribute(string name)
-    bool Element:HasChildNodes()
-    noreturn Element:InsertBefore(Element child,Element adjacent)
-    bool Element:IsClassSet(string name)
-    noreturn Element:RemoveAttribute(string name)
-    bool Element:RemoveChild(Element child)
-    bool Element:ReplaceChild(Element inserted,Element replaced)
-    noreturn Element:ScrollIntoView(bool align_with_top)
-    noreturn Element:SetAttribute(string name,string value)
-    noreturn Element:SetClass(string name, bool activate)
-    %type% Element.As.%type%(Element obj) --see footnote 2
-    Element Element.new(string tag) --Do not use unless inside an ElementInstancer function.
-
-
-    //getters accessed by the period syntax from an element object
-    --for attributes, if you save it to a local/global variable and try to modify that variable,
-    --your changes will not be saved. You will have to use Element:SetAttribute
-    {} of [key=string,value=int,float,Colourb,Colourf,string,Vector2f,lightuserdata] Element.attributes
-    {} of Element Element.child_nodes
-    string Element.class_name
-    float Element.client_left
-    float Element.client_height
-    float Element.client_top
-    float Element.client_width
-    Element Element.first_child
-    string Element.id
-    string Element.inner_rml
-    Element Element.last_child
-    Element Element.next_sibling
-    float Element.offset_height
-    float Element.offset_left
-    Element Element.offset_parent
-    float Element.offset_top
-    float Element.offset_width
-    Document Element.owner_document
-    Element Element.parent_nod
-    Element Element.previous_sibling
-    float Element.scroll_height
-    float Element.scroll_left
-    float Element.scroll_top
-    float Element.scroll_width
-    ElementStyle Element.style --see ElementStyle.h documentation
-    string Element.tag_name
-
-    //setters to be used with a dot syntax on an Element object
-    Element.class_name = string
-    Element.id = string
-    Element.inner_rml = string
-    Element.scroll_left = float
-    Element.scroll_top = float  
-
-
-    footnote 1: for Element:AddEventListener(string,?,bool)
-    The ? can be either a string or a function. 
-    In the string, you can be guaranteed that you will have the
-    named variables 'event','element','document' available to you, and they mean the same as if you were to put
-    the string as onclick="string" in a .rml file.
-    If you give it a function, the function will be called every time that C++ EventListener::ProcessEvent would
-    would be called. In this case, it will call the function, and you can decide the name of the parameters, however
-    it is in a specific order. The order is event,element,document. So:
-    function foo(l,q,e) end element:AddEventListener("click",foo,true) is the correct syntax, and puts l=event,q=element,e=document
-    They are terrible names, but it is to make a point.
-
 
-    footnote 2: For Element.As     used for casting an Element object to a more derived class.
-    If you are using RocketControls, it will be filled with those types. For instance, you would say
-    local input_element = Element.As.ElementFormControlInput(element) --where element is an Element object
-*/
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Element.h>

+ 1 - 4
Source/Core/Lua/ElementAttributesProxy.h

@@ -27,10 +27,7 @@
  
 #ifndef ROCKETCORELUAELEMENTATTRIBUTESPROXY_H
 #define ROCKETCORELUAELEMENTATTRIBUTESPROXY_H
-/*
-    Proxy table for Element.attribues
-    read-only Dictionary
-*/
+
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Element.h>

+ 0 - 6
Source/Core/Lua/ElementChildNodesProxy.h

@@ -29,12 +29,6 @@
 #ifndef ROCKETCORELUAELEMENTCHILDNODESPROXY_H
 #define ROCKETCORELUAELEMENTCHILDNODESPROXY_H
 
-/*
-    This is the object that gets returned from Element.child_nodes, so that the table is not
-    built every single time the function is called.
-    Read-only
-*/
-
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Element.h>

+ 0 - 12
Source/Core/Lua/ElementInstancer.h

@@ -28,18 +28,6 @@
 #ifndef ROCKETCORELUAELEMENTINSTANCER_H
 #define ROCKETCORELUAELEMENTINSTANCER_H
 
-/*
-    This defines the ElementInstancer type in the Lua global namespace. It is reference counted.
-
-    To use this, you will want to call ElementInstancer.new to get an object, and call rocket.RegisterTag to tell Rocket to use the 
-    instancer for that tag.
-
-    ElementInstancer ElementInstancer.new([function InstanceElement]) --argument is optional, and new is not called from a specific object
-
-    //setter
-    ElementInstancer.InstanceElement = function(string tag) return Element end --gets called when the factory sees the tag being instanced
-*/
-
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include "LuaElementInstancer.h"

+ 0 - 39
Source/Core/Lua/ElementStyle.h

@@ -27,46 +27,7 @@
  
 #ifndef ROCKETCORELUAELEMENTSTYLE_H
 #define ROCKETCORELUAELEMENTSTYLE_H
-/*
-    This is the definition of an ElementStyle Lua object
-
-    This object is returned when you have an element, and access Element.style
-    You can access it like a regular table, with the exception of iterating
-    over the properties.
-
-    A few peculiarities/rules:
-    You are unable to create an instance of this object, only use one returned by
-    the "style" value of an 'Element' item. Of course, you can store the object in
-    a local variable in Lua and still have everything be valid
-
-    When setting a property of a style, both the key and value need to be strings
-    --Examples assume "e" is an element object
-    e.style["width"] = "40px"
-    e.style.width = "40px"  --does the same as above
-
-
-    When getting a property of a style, it spits out exactly what you put in.
-    If you used the above width setting to "40px" then
-    --Examples assume "e" is an element object
-    local w = e.style["width"] --or e.style.width
-    w would be "40px"
-
 
-    If you need to iterate over the values, you'll have to call style:GetTable() 
-    Because of the way that I made the object, the following will not work
-    for k,v in pairs(element.style) do --assumes "element" is an element object
-        print(k .. " " ..v)
-    end
-    This is because I don't actually have any properties stored in the Lua table
-    To do it, you'd have to say
-    local properties = element.style:GetTable() --assumes "element" is an element object
-    for k,v in pairs(properties) do
-        print(k .. " " .. v)
-    end
-    However, the table returned from style:GetTable() is read only. Whatever changes you
-    make to that table will not be saved to the 'style' object. To do that, just do whatever
-    operation you were going to on the table before, but do it on the 'style' object instead.
-*/
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>
 #include <ElementStyle.h>

+ 2 - 0
Source/Core/Lua/ElementText.cpp

@@ -28,6 +28,7 @@
 #include "precompiled.h"
 #include "ElementText.h"
 #include "Element.h"
+#include <Rocket/Core/Lua/Utilities.h>
 
 namespace Rocket {
 namespace Core {
@@ -37,6 +38,7 @@ template<> void ExtraInit<ElementText>(lua_State* L, int metatable_index)
     //inherit from Element
     ExtraInit<Element>(L,metatable_index);
     LuaType<Element>::_regfunctions(L,metatable_index,metatable_index-1);
+    AddTypeToElementAsTable<ElementText>(L);
 }
 
 int ElementTextGetAttrtext(lua_State* L)

+ 0 - 10
Source/Core/Lua/ElementText.h

@@ -27,16 +27,6 @@
  
 #ifndef ROCKETCORELUAELEMENTTEXT_H
 #define ROCKETCORELUAELEMENTTEXT_H
-/*
-    This defines the ElementText type in the Lua global namespace
-    no methods
-
-    getter:
-    string ElementText.text
-
-    setter:
-    ElementText.text = string
-*/
 
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>

+ 0 - 14
Source/Core/Lua/Event.h

@@ -27,20 +27,6 @@
  
 #ifndef ROCKETCORELUAEVENT_H
 #define ROCKETCORELUAEVENT_H
-/*
-    This defines an Event type name in the global Lua namespace
-
-    Generally, you won't create an event yourself, just receive it.
-
-    //method
-    noreturn Event:StopPropagation()
-    
-    //getters
-    Element Event.current_element
-    string Event.type
-    Element Event.target_element
-    {}key=string,value=int,float,Colourb/f,string,Vector2f,userdata Event.parameters
-*/
 
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>

+ 1 - 4
Source/Core/Lua/EventParametersProxy.h

@@ -27,10 +27,7 @@
  
 #ifndef ROCKETCORELUAEVENTPARAMETERSPROXY_H
 #define ROCKETCORELUAEVENTPARAMETERSPROXY_H
-/*
-    Proxy table for Event.parameters
-    read-only Dictionary
-*/
+
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Event.h>

+ 0 - 15
Source/Core/Lua/Log.h

@@ -28,21 +28,6 @@
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>
 
-/*
-    Declares "Log" in the global Lua namespace.
-
-    //method, not called from a "Log" object, just from the Log table
-    Log.Message(logtype type, string message)
-
-    where logtype is defined in Log.logtype, and can be:
-    logtype.always
-    logtype.error
-    logtype.warning
-    logtype.info
-    logtype.debug
-    and they have the same value as the C++ Log::Type of the same name
-*/
-
 namespace Rocket {
 namespace Core {
 namespace Lua {

+ 0 - 15
Source/Core/Lua/Rocket.h

@@ -28,21 +28,6 @@
 #ifndef ROCKETCORELUAROCKET_H
 #define ROCKETCORELUAROCKET_H
 
-/*
-    This declares rocket in the global Lua namespace
-
-    It is not exactly type, but it is a table, and does have some methods and attributes
-    
-    methods: 
-    rocket.CreateContext(string name, Vector2i dimensions)
-    rocket.LoadFontFace(string font_path)
-    rocket.RegisterTag(string tag, ElementInstancer instancer)
-    
-    getters:
-    rocket.contexts  returns a table of contexts, which are indexed by number AND string, so there are two copies of each context in the table
-
-*/
-
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Lua/lua.hpp>
 

+ 0 - 26
Source/Core/Lua/Vector2f.h

@@ -27,33 +27,7 @@
  
 #ifndef ROCKETCORELUAVECTOR2F_H
 #define ROCKETCORELUAVECTOR2F_H
-/*
-    Declares Vector2f in the Lua global namespace. It implements the below (examples using Lua syntax) :
-
-    Vector2f.new(float,float) creates a new Vector2f, and gets deleted when Lua garbage collects
-    
-    everything after this will assume that you have a local variable named 'vect', declared something similar to
-    local vect = Vector2f.new(3.5,2.3)
-    operators (the types that it can operate on are on the right):
-    vect * float
-    vect / float
-    vect + Vector2f
-    vect - Vector2f
-    vect == Vector2f
-
-    methods:
-    float var = vect:DotProduct(Vector2f)
-    Vector2f var = vect:Normalise()
-    Vector2f var = vect:Rotate(float)
-
-    get and set attributes:
-    vect.x
-    vect.y
-    
-    get attributes:
-    vect.magnitude
 
-*/
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Types.h>

+ 0 - 19
Source/Core/Lua/Vector2i.h

@@ -27,26 +27,7 @@
  
 #ifndef ROCKETCORELUAVECTOR2I_H
 #define ROCKETCORELUAVECTOR2I_H
-/*
-    Declares Vector2i in the Lua global namespace. It implements the below (examples using Lua syntax) :
-
-    Vector2i(int,int) creates a new Vector2i, and gets deleted when Lua garbage collects
-    
-    everything after this will assume that you have a local variable named 'vect', declared something similar to
-    local vect = Vector2i.new(50,90)
-    operators (the types that it can operate on are on the right):
-    vect * int
-    vect / int
-    vect + Vector2i
-    vect - Vector2i
-    vect == Vector2i
-
-    no methods
 
-    get and set attributes:
-    vect.x
-    vect.y
-*/
 #include <Rocket/Core/Lua/lua.hpp>
 #include <Rocket/Core/Lua/LuaType.h>
 #include <Rocket/Core/Types.h>