From: John L. <jr...@us...> - 2008-01-24 04:54:00
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12538/wxLua/docs Modified Files: wxlua.html wxluaref.html Log Message: Update docs for changes in wxLua C++ api Index: wxluaref.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxluaref.html,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wxluaref.html 20 Jan 2008 19:23:01 -0000 1.47 --- wxluaref.html 24 Jan 2008 04:53:48 -0000 1.48 *************** *** 6815,6820 **** <font color=#009900>// bool Initialized() obsolete in wxWidgets</font><br> <br> ! <font color=#BB0055> <font color=#009900>// <i>%override</i> int wxApp::MainLoop() : Only calls it if !wxLuaState::sm_wxAppMainLoop_will_run, returns 0 if it is true.</font></font><br> <font color=#009900>// C++ Func: int MainLoop()</font><br> int MainLoop()<br> <br> --- 6815,6821 ---- <font color=#009900>// bool Initialized() obsolete in wxWidgets</font><br> <br> ! <font color=#BB0055> <font color=#009900>// <i>%override</i> int wxApp::MainLoop()</font></font><br> <font color=#009900>// C++ Func: int MainLoop()</font><br> + <font color=#009900>// Only calls it if (!IsMainLoopRuinning() && !wxLuaState::sm_wxAppMainLoop_will_run), returns 0 if not called.</font><br> int MainLoop()<br> <br> *************** *** 12067,12073 **** --- 12068,12079 ---- <a href="#wxBitmap">wxBitmap</a>(const <a href="#wxImage">wxImage</a> &image, int depth = -1)<br> <br> + <font color=#BB0055> <font color=#009900>// <i>%override</i> <a href="#wxBitmap">wxBitmap</a>(lua string, int width, int height, int depth)</font></font><br> <font color=#009900>// C++ Func: <a href="#wxBitmap">wxBitmap</a>(const char bits[], int width, int height, int depth = 1)</font><br> <font color=#009900>// Creates a bitmap from an array of bits in the form of a Lua string.</font><br> <font color=#BB0055> <i>%override_name</i> wxLua_wxBitmapFromBits_constructor <a href="#wxBitmap">wxBitmap</a>(const char* mono_bits, int width, int height, int depth <font color=#888888>/* = 1 */</font>);</font><br> + <font color=#BB0055> <font color=#009900>// <i>%override</i> <a href="#wxBitmap">wxBitmap</a>(LuaTable charTable, int width, int height, int depth)</font></font><br> + <font color=#009900>// C++ Func: <a href="#wxBitmap">wxBitmap</a>(const char bits[], int width, int height, int depth = 1)</font><br> + <font color=#009900>// Creates a bitmap from an array of chars in a Lua table.</font><br> + <font color=#BB0055> <i>%override_name</i> wxLua_wxBitmapFromBitTable_constructor <a href="#wxBitmap">wxBitmap</a>(LuaTable charTable, int width, int height, int depth <font color=#888888>/* = 1 */</font>);</font><br> <br> <font color=#BB0055> <font color=#009900>// <i>%override</i> <a href="#wxBitmap">wxBitmap</a>(LuaTable stringTable where each index is a row in the image)</font></font><br> *************** *** 24545,24548 **** --- 24551,24557 ---- <font color=#006666><i>%define</i> WXLUA_TINTEGER</font><br> <font color=#006666><i>%define</i> WXLUA_TCFUNCTION</font><br> + <font color=#006666><i>%define</i> WXLUA_TNULL</font><br> + <br> + <font color=#006666><i>%define</i> WXLUA_T_MAX</font><br> <br> <font color=#006666><i>%define</i> LUA_TNONE <font color=#009900>// (-1)</font></font><br> Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wxlua.html 18 Jan 2008 06:00:09 -0000 1.36 --- wxlua.html 24 Jan 2008 04:53:47 -0000 1.37 *************** *** 3,8 **** <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua Documentation</title> ! <meta content="John Labenski" name="author"> ! </head> <body> <h2><u>wxLua --- 3,7 ---- <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua Documentation</title> ! <meta content="John Labenski" name="author"></head> <body> <h2><u>wxLua *************** *** 17,21 **** running standalone wxLua ! scripts (wxLuaFreeze), a Lua module to load using "require" when using the standard Lua executable, and a library for --- 16,20 ---- running standalone wxLua ! scripts (wxLuaFreeze), a Lua module to load using <i>require("wx")</i> when using the standard Lua executable, and a library for *************** *** 29,37 **** fast, dynamic, and easy to learn. Lua contains a limited number of data types, ! mainly numbers, strings, functions, and tables. Perhaps the most powerful feature of the Lua language is that the tables can be used as either arrays ! or hashtables that can cross-reference numbers, strings, functions, and/or subtables.<br> --- 28,36 ---- fast, dynamic, and easy to learn. Lua contains a limited number of data types, ! mainly numbers, strings, functions, tables, and userdata. Perhaps the most powerful feature of the Lua language is that the tables can be used as either arrays ! or hash tables that can cross-reference numbers, strings, functions, and/or subtables.<br> *************** *** 397,401 **** <ul> <li>Note that the table is not returned, but modified ! inplace, also note that we can use table.insert() to append to a table instead of the above method.</li> --- 396,400 ---- <ul> <li>Note that the table is not returned, but modified ! in place, also note that we can use table.insert() to append to a table instead of the above method.</li> *************** *** 555,559 **** can be used as containers for input values to functions using the unpack(table, [i, [, j]]) function. This is useful for creating complex ! inputs to a function or storing them for resuse.</li> <ul> <li><span style="font-style: italic;">print(string.find(unpack({"Hello", --- 554,558 ---- can be used as containers for input values to functions using the unpack(table, [i, [, j]]) function. This is useful for creating complex ! inputs to a function or storing them for reuse.</li> <ul> <li><span style="font-style: italic;">print(string.find(unpack({"Hello", *************** *** 696,700 **** "string"). Functions that return wxStrings convert the value into a Lua string for convenience. The conversion from ! the Lua ANSI C 8-bit char* string to a wxString (which may be a unicode wchar* string) is done internally.<br> <br> --- 695,699 ---- "string"). Functions that return wxStrings convert the value into a Lua string for convenience. The conversion from ! the Lua ANSI C 8-bit char* string to a wxString (which may be a Unicode wchar* string) is done internally.<br> <br> *************** *** 720,731 **** arr" you must provide a wxArrayInt userdata since the C++ function will most likely modify the wxArrayInt that's passed to it. ! <ul> ! <li>Location of the wxWidgets objects declared in a ! C++ header files in the <i><b>wx</b></i> Lua ! table</li> ! <ul> <li><b>#define ! NUMBER_DEFINE VALUE</b> </li> ! <ul> <li>All #defined numerical values are available as <i>wx.NUMBER_DEFINE</i></li> --- 719,729 ---- arr" you must provide a wxArrayInt userdata since the C++ function will most likely modify the wxArrayInt that's passed to it. ! <br><br><b>Location of the wxWidgets objects declared in a ! C++ header files in the <i>wx</i> Lua ! table</b><ul> <li><b>#define ! NUMBER_DEFINE VALUE</b> </li><ul> ! ! <li>All #defined numerical values are available as <i>wx.NUMBER_DEFINE</i></li> *************** *** 736,743 **** tag<br> </li> ! </ul> ! <li><b>[int, ! double, etc] NUMBER_VARIABLE;</b></li> ! <ul> <li>All global numerical variables are available as <i>wx.NUMBER_VARIABLE</i></li> --- 734,741 ---- tag<br> </li> ! ! </ul><li><b>[int, ! double, etc] NUMBER_VARIABLE;</b></li><ul> ! <li>All global numerical variables are available as <i>wx.NUMBER_VARIABLE</i></li> *************** *** 747,754 **** in the bindings using the <i>%define</i> tag</li> ! </ul> ! <li><b>enum ENUM_NAMESPACE [or ! CLASSNAME::ENUM_NAMESPACE] { ENUM_NAME }</b></li> ! <ul> <li>All global enums, named or not, are available as <i>wx.ENUM_NAME</i></li> <ul> --- 745,752 ---- in the bindings using the <i>%define</i> tag</li> ! ! </ul><li><b>enum ENUM_NAMESPACE [or ! CLASSNAME::ENUM_NAMESPACE] { ENUM_NAME }</b></li><ul> ! <li>All global enums, named or not, are available as <i>wx.ENUM_NAME</i></li> <ul> *************** *** 765,777 **** <li>This follows the C++ semantics that you do not have to ! specify the name of an enum, but you do have to use it's scope if it is a class member.</li> <li>Declared in the bindings using the <i>%enum</i> tag</li> ! </ul> ! <li><b>#define ! STRING_DEFINE wxT("String Value")</b></li> ! <ul> <li>All #defined string values are available as <i>wx.STRING_DEFINE</i></li> --- 763,775 ---- <li>This follows the C++ semantics that you do not have to ! specify the name of an enum, but you do have to use its scope if it is a class member.</li> <li>Declared in the bindings using the <i>%enum</i> tag</li> ! ! </ul><li><b>#define ! STRING_DEFINE wxT("String Value")</b></li><ul> ! <li>All #defined string values are available as <i>wx.STRING_DEFINE</i></li> *************** *** 781,788 **** <li>Declared in the bindings using the <i>%define_string</i> tag</li> ! </ul> ! <li><b>const wxChar* ! STRING_VARIABLE;</b></li> ! <ul> <li>All global string variables are available as <i>wx.STRING_VARIABLE</i></li> --- 779,786 ---- <li>Declared in the bindings using the <i>%define_string</i> tag</li> ! ! </ul><li><b>const wxChar* ! STRING_VARIABLE;</b></li><ul> ! <li>All global string variables are available as <i>wx.STRING_VARIABLE</i></li> *************** *** 791,798 **** bindings using the <i>%define_string</i> tag</li> ! </ul> ! <li><b>wxEVT_XXX ! for wxEvtHandler::Connect()</b></li> ! <ul> <li>All <i>wxEVT_XXX</i> wxEventTypes (an integer) are --- 789,796 ---- bindings using the <i>%define_string</i> tag</li> ! ! </ul><li><b>wxEVT_XXX ! for wxEvtHandler::Connect()</b></li><ul> ! <li>All <i>wxEVT_XXX</i> wxEventTypes (an integer) are *************** *** 843,847 **** and then call <span style="font-style: italic;">dc:delete()</span> at the end of the function because the paint event clears the ! "dirty" region to repaint and if it's not cleared another paint event will be sent... and so on.</li> </ul> --- 841,845 ---- and then call <span style="font-style: italic;">dc:delete()</span> at the end of the function because the paint event clears the ! "dirty" region to repaint and if it is not cleared another paint event will be sent... and so on.</li> </ul> *************** *** 851,858 **** bindings using the <i>%define_event</i> tag</li> ! </ul> ! <li><b>Objects ! of classes or structs OBJECT_NAME</b></li> ! <ul> <li>All global objects that are classes or structs are --- 849,856 ---- bindings using the <i>%define_event</i> tag</li> ! ! </ul><li><b>Objects ! of classes or structs OBJECT_NAME</b></li><ul> ! <li>All global objects that are classes or structs are *************** *** 866,873 **** <li>Declared in the bindings using the <i>%define_object</i> tag</li> ! </ul> ! <li><b>Pointers to ! classes or structs POINTER_NAME</b></li> ! <ul> <li>All global pointers that are classes or structs are --- 864,871 ---- <li>Declared in the bindings using the <i>%define_object</i> tag</li> ! ! </ul><li><b>Pointers to ! classes or structs POINTER_NAME</b></li><ul> ! <li>All global pointers that are classes or structs are *************** *** 881,890 **** <li>Declared in the bindings using the <i>%define_object</i> tag</li> ! </ul> ! <li><b>Global<i> </i>C style functions ! VAR_TYPE FUNCTION_NAME(int a, const wxString& str)</b></li> ! <ul> <li>All global C style functions are available as <i>wx.FUNCTION_NAME(1, "Hello")</i></li> --- 879,888 ---- <li>Declared in the bindings using the <i>%define_object</i> tag</li> ! ! </ul><li><b>Global<i> </i>C style functions ! VAR_TYPE FUNCTION_NAME(int a, const wxString& str)</b></li><ul> ! <li>All global C style functions are available as <i>wx.FUNCTION_NAME(1, "Hello")</i></li> *************** *** 897,909 **** <li>Declared in the bindings using the <i>%function</i> tag</li> ! </ul> ! <li><b>C++ Classes ! CLASS_NAME</b></li> ! <ul> <li>All C++ classes are available as <i>wx.CLASS_NAME</i>, however in order to use one you must call one of the constructors first ! or get the class as a return value from another function call.</li> ! <ul> <li>Example : <i>"pt = wx.wxPoint(1, 2); pt2 = wx.wxPoint(pt)"</i>.</li> --- 895,907 ---- <li>Declared in the bindings using the <i>%function</i> tag</li> ! ! </ul><li><b>C++ Classes ! CLASS_NAME</b></li><ul> <li>All C++ classes are available as <i>wx.CLASS_NAME</i>, however in order to use one you must call one of the constructors first ! or get the class as a return value from another function call.</li><ul> ! ! <li>Example : <i>"pt = wx.wxPoint(1, 2); pt2 = wx.wxPoint(pt)"</i>.</li> *************** *** 925,933 **** constructor function itself you can use <i>wx.CLASS_NAME.new(...)</i> which is the constructor exposed as a Cfunction.</li> ! </ul> ! <li>The C++ class objects are pushed into Lua as a userdata wrapping a void* ! pointer to the C++ object.</li> ! <ul> <li>A special metatable is set on the userdata with these entries :</li> --- 923,931 ---- constructor function itself you can use <i>wx.CLASS_NAME.new(...)</i> which is the constructor exposed as a Cfunction.</li> ! ! </ul><li>The C++ class objects are pushed into Lua as a userdata wrapping a void* ! pointer to the C++ object.</li><ul> ! <li>A special metatable is set on the userdata with these entries :</li> *************** *** 950,961 **** used so wxLua can delete the C++ object if appropriate. </li> </ul> ! </ul> ! <li>Declared in the bindings using the <i>%class</i> ! tag</li> ! <li><span style="font-weight: bold;">Deleting class userdata</span> can be done using the wxLua added class ! member function delete().</li> ! <ul> <li>All classes that have the %delete binding tag will be eventually garbage collected --- 948,959 ---- used so wxLua can delete the C++ object if appropriate. </li> </ul> ! ! </ul><li>Declared in the bindings using the <i>%class</i> ! tag</li><li><span style="font-weight: bold;">Deleting class userdata</span> can be done using the wxLua added class ! member function delete().</li><ul> ! ! <li>All classes that have the %delete binding tag will be eventually garbage collected *************** *** 974,978 **** <li>This is really a MS Windows problem, in Win95 based systems the number that ! you could create was severly limited, but even in NT systems (XP) you will have problems if you've created hundreds of them. One visible sign that something is wrong is when controls, like menus, stop redrawing --- 972,976 ---- <li>This is really a MS Windows problem, in Win95 based systems the number that ! you could create was severely limited, but even in NT systems (XP, Vista) you will have problems if you've created hundreds of them. One visible sign that something is wrong is when controls, like menus, stop redrawing *************** *** 984,988 **** <li>Additionally, since the Lua userdata that wxLua pushes into Lua only store a void* ! pointer to the C++ classes, Lua only thinks they are of size void* which are on 32bit x86 machines only 8 bytes. --- 982,986 ---- <li>Additionally, since the Lua userdata that wxLua pushes into Lua only store a void* ! pointer to the C++ class object, Lua only thinks they are of size void* which are on 32bit x86 machines only 8 bytes. *************** *** 1004,1008 **** so they will collect until Lua runs its garbage collector.</li> <li>You can force garbage collection using <i>"collectgarbage("collect")"</i> ! in Lua, but this may cause pauses in your program's execution.</li> </ul> <li>This --- 1002,1009 ---- so they will collect until Lua runs its garbage collector.</li> <li>You can force garbage collection using <i>"collectgarbage("collect")"</i> ! in Lua, but this may cause pauses in your program's execution. It is a ! good idea to collect all the garbage at the end of your initialization ! function to at least start out with a clean slate since program ! startup time is usually not a concern.</li> </ul> <li>This *************** *** 1010,1015 **** <ul> <li style="font-weight: bold;">Must delete : ! wxDC, wxPaintDC any ! and ALL classed derived from a wxDC</li> <li><span style="font-weight: bold;">Must delete if > 50 : --- 1011,1015 ---- <ul> <li style="font-weight: bold;">Must delete : ! wxDC, wxPaintDC, and ALL classed derived from wxDC</li> <li><span style="font-weight: bold;">Must delete if > 50 : *************** *** 1036,1050 **** </ul> <li>How to tell how ! many userdata objects you currenty have? </li> <ul> <li>Call ! the function wxlua.LuaStackDialog() when you run you program using ! "wxlua.exe program.lua" or in wxLuaEdit.exe.</li> ! <li>This ! function requires that wxLuaDebug C++ library to be compiled with it so ! it does not work with wxLuaFreeze.exe.</li> ! </ul> </ul> ! <li><b>Member functions</b> of the class are called using the colon ':' convention and NOT the period --- 1036,1049 ---- </ul> <li>How to tell how ! many userdata objects you currently have?</li><ul><li>Print the output of <b><i>wxlua.GetGCUserdataInfo(true)</i></b> to show what objects will be garbage collected when their reference count goes to 0 and the Lua garbage collector runs.</li><li>Print the output of <i><b>wxlua.GetTrackedObjectInfo(true)</b></i> to get class objects that wxLua has pushed into Lua that may or may not be garbage collected.</li></ul> <ul> + <li>Call ! the function <b><i>wxlua.LuaStackDialog()</i></b> when you run ! your program and examine the items in the Lua LUA_REGISTRYINDEX table. ! Expand "wxLua objects pushed" and "wxLua gc objects to delete" tables.<br></li> </ul> ! ! </ul><li><b>Member functions</b> of the class are called using the colon ':' convention and NOT the period *************** *** 1059,1064 **** and <span style="font-weight: bold;">static</span> functions, please see the sections below about why they only use the ! '.' convention.</li> ! <ul> <li>Example : <i>"size = wx.wxSize(1, 2); size:SetWidth(10); size.SetHeight(size, 11); --- 1058,1063 ---- and <span style="font-weight: bold;">static</span> functions, please see the sections below about why they only use the ! '.' convention.</li><ul> ! <li>Example : <i>"size = wx.wxSize(1, 2); size:SetWidth(10); size.SetHeight(size, 11); *************** *** 1071,1080 **** original function. This is only done for special cases that would be awkward, if not impossible, to wrap otherwise.</li> ! </ul> ! <li><b>Property functions</b> allow you to read and/or write values to a class using the '.' convention and ! a shortened name.</li> ! <ul> <li>These are generated on the fly when the function --- 1070,1079 ---- original function. This is only done for special cases that would be awkward, if not impossible, to wrap otherwise.</li> ! ! </ul><li><b>Property functions</b> allow you to read and/or write values to a class using the '.' convention and ! a shortened name.</li><ul> ! <li>These are generated on the fly when the function *************** *** 1095,1100 **** a function using "()", but rather like accessing a table member, without the "()".</li> ! </ul> ! <ul> <li>Example : <i>"rect --- 1094,1099 ---- a function using "()", but rather like accessing a table member, without the "()".</li> ! ! <li>Example : <i>"rect *************** *** 1145,1157 **** necessary? Confusing? Useful? I'd stick with the Get/Set functions. - JL</li> ! </ul> ! <li><b>Member variables </b>allow you ! to read and/or write to member variables of a class.</li> ! <ul> <li>Declared in the interface files using the <i>%member</i> or <i>%member_func</i> tag.</li> ! </ul> ! <ul> <li>Example : In the interface file <i>gdi.i</i> --- 1144,1156 ---- necessary? Confusing? Useful? I'd stick with the Get/Set functions. - JL</li> ! ! </ul><li><b>Member variables </b>allow you ! to read and/or write to member variables of a class.</li><ul> ! <li>Declared in the interface files using the <i>%member</i> or <i>%member_func</i> tag.</li> ! ! <li>Example : In the interface file <i>gdi.i</i> *************** *** 1178,1189 **** only through the properties. </li> <li>If the member ! variable is conststant (const) the variable is read-only and you cannot set it's value.</li> ! </ul> ! <li><b>Static functions</b> are part of the table that holds the class and can be called with or without a class ! instance (a userdata).</li> ! <ul> <li>Example : <i>f = --- 1177,1188 ---- only through the properties. </li> <li>If the member ! variable is constant (const) the variable is read-only and you cannot set it's value.</li> ! ! </ul><li><b>Static functions</b> are part of the table that holds the class and can be called with or without a class ! instance (a userdata).</li><ul> ! <li>Example : <i>f = *************** *** 1199,1217 **** made to work reliably when you don't want or need the self pushed onto the stack. </li> ! </ul> ! <li><b>Enum members</b> are also part of the table that holds the class and are used by accessing the class table ! itself.</li> ! <ul> <li>Example : <i>"enum wxFTP::TransferMode { ASCII, ... }"</i> is accessible as <i>wx.wxFTP.ASCII</i></li> ! </ul> ! <li><b>Operator functions</b> allow you to use ! C++ operators in Lua. </li> ! <ul> <li>Lua has a limited set of operators, see the Lua --- 1198,1216 ---- made to work reliably when you don't want or need the self pushed onto the stack. </li> ! ! </ul><li><b>Enum members</b> are also part of the table that holds the class and are used by accessing the class table ! itself.</li><ul> ! <li>Example : <i>"enum wxFTP::TransferMode { ASCII, ... }"</i> is accessible as <i>wx.wxFTP.ASCII</i></li> ! ! </ul><li><b>Operator functions</b> allow you to use ! C++ operators in Lua. </li><ul> ! <li>Lua has a limited set of operators, see the Lua *************** *** 1236,1241 **** using the <i>%operator</i> tag.</li> ! </ul> ! <ul> <li><br> </li> --- 1235,1240 ---- using the <i>%operator</i> tag.</li> ! ! <li><br> </li> *************** *** 1282,1287 **** (unary)" = "op_neg"</li> <li></li> ! </ul> ! <ul> <li>"=" = op_set</li> <li>"+" = "op_add"<br> --- 1281,1286 ---- (unary)" = "op_neg"</li> <li></li> ! ! <li>"=" = op_set</li> <li>"+" = "op_add"<br> *************** *** 1340,1346 **** test if pt2 has changed, it hasn't, and the test to see if they're still equal and as expected, they're not.</li> ! </ul> ! <li style="font-weight: bold;">Virtual functions</li> ! <ul> <li>You cannot --- 1339,1345 ---- test if pt2 has changed, it hasn't, and the test to see if they're still equal and as expected, they're not.</li> ! ! </ul><li style="font-weight: bold;">Virtual functions</li><ul> ! <li>You cannot *************** *** 1369,1376 **** already been added is that there is a price to pay in terms of binding size and speed.</li> ! </ul> ! <li><span style="font-weight: bold;">Overriding ! member functions</span> with Lua functions</li> ! <ul> <li>You may override class member functions for a wxLua userdata and still be --- 1368,1375 ---- already been added is that there is a price to pay in terms of binding size and speed.</li> ! ! </ul><li><span style="font-weight: bold;">Overriding ! member functions</span> with Lua functions</li><ul> ! <li>You may override class member functions for a wxLua userdata and still be *************** *** 1391,1398 **** since otherwise you'll get recursion. </li> ! </ul> ! <li><b>Extending ! classes</b> </li> ! <ul> <li>You may add your --- 1390,1396 ---- since otherwise you'll get recursion. </li> ! ! </ul><li><b>Extending ! classes</b> </li><ul> <li>You may add your *************** *** 1401,1416 **** if you would like to keep functions that act on a particular class with it rather than having global functions that take that class as a ! parameter.</li> ! <li>Example : <i>"r = wx.wxRect(1,2,3,4); r.PrintXY = function(self) print(self:GetX(), self:GetY()) end; r:PrintXY()"</i> adds the function PrintXY() to the wxRect instance r. The userdata, class instance, r is passed to the Lua function as the parameter "self" which is pushed onto ! the stack when the PrintXY() function is called with the ":" notation.</li> ! <li>Note that the above example is the same as <i>"</i><i>r = wx.wxRect(1,2,3,4); </i><i>function wxRect_PrintXY(r) ! print(r:GetX(), r:GetY()) end; wxRect_PrintXY(r)"</i>.</li> ! <li>You may also create the Lua function beforehand and then assign it to the rect object. <i>"function --- 1399,1411 ---- if you would like to keep functions that act on a particular class with it rather than having global functions that take that class as a ! parameter.</li><li>Example : <i>"r = wx.wxRect(1,2,3,4); r.PrintXY = function(self) print(self:GetX(), self:GetY()) end; r:PrintXY()"</i> adds the function PrintXY() to the wxRect instance r. The userdata, class instance, r is passed to the Lua function as the parameter "self" which is pushed onto ! the stack when the PrintXY() function is called with the ":" notation.</li><li>Note that the above example is the same as <i>"</i><i>r = wx.wxRect(1,2,3,4); </i><i>function wxRect_PrintXY(r) ! print(r:GetX(), r:GetY()) end; wxRect_PrintXY(r)"</i>.</li><li>You may also create the Lua function beforehand and then assign it to the rect object. <i>"function *************** *** 1419,1423 **** You can see that using this idea you can write a Lua function that creates a new wxRect, sets your extra functions ! for it, and returns it for use.</li> <ul> </ul> --- 1414,1422 ---- You can see that using this idea you can write a Lua function that creates a new wxRect, sets your extra functions ! for it, and returns it for use.</li><ul> ! ! ! ! <ul> </ul> *************** *** 1448,1454 **** <br> Why are the samples named <span style="font-style: italic;">sample.wx.lua</span>? ! To allow them to be colorized correctly in syntax hilighting editors, yet denote to people that they are for wxLua and must ! be run using a wxLua exectuable or the wxLua module. <br> <h3><a name="How_to_run_the_samples"></a>How to Run the --- 1447,1453 ---- <br> Why are the samples named <span style="font-style: italic;">sample.wx.lua</span>? ! To allow them to be colorized correctly in syntax highlighting editors, yet denote to people that they are for wxLua and must ! be run using a wxLua executable or the wxLua module. <br> <h3><a name="How_to_run_the_samples"></a>How to Run the *************** *** 1474,1485 **** button to run it.</li> <li>Use ! wxLua as a Lua module (using require), run <span style="font-weight: bold; font-style: italic;">$lua.exe ! ../utils/wrapmodule/wrapmodule.wx.lua sample.wx.lua</span></li> <ul> ! <li>Note ! that <span style="font-weight: bold;">wrapmodule.wx.lua</span> ! is in the <span style="font-style: italic;">utils/wrapmodule</span> ! directory so you may have to specify a different path depending on ! where you are running lua.exe from. For more information see <a href="#wrapmodule.wx.lua">wrapmodule.wx.lua</a>. </li> </ul> </ul> --- 1473,1479 ---- button to run it.</li> <li>Use ! wxLua as a Lua module (using the function require), run <span style="font-weight: bold; font-style: italic;">$lua.exe sample.wx.lua</span></li> <ul> ! <li>In order to use wxLua as a module the Lua code must have <i>require("wx")</i> to load the wxLua bindings in the beginning and <i>wx.wxGetApp():MainLoop()</i> at the end to start the wxWidgets event loop.</li><li>You may need to adjust the <i>package.cpath</i> variable to have it point to the correct location of the wx.so or wx.dll shared library for require("wx") to load.</li> </ul> </ul> *************** *** 1493,1497 **** <li>Lets you explore the C++ binding structs from within Lua ! using a wxListCtrl. This is the raw data that is used to push the bindings into Lua when a wxLuaState is created.</li> <li>Take --- 1487,1491 ---- <li>Lets you explore the C++ binding structs from within Lua ! using a wxListCtrl. This program shows the raw data that is used to push the bindings into Lua when a wxLuaState is created.</li> <li>Take *************** *** 1770,1774 **** display print statements, run the string "a = 12; b = 3", then run myprogram.lua and push into lua a table named 'arg' with the ! indicies </li> <li>[-5] = 'd:\wxLua\bin\wxlua.exe', [-4] = '-c', [-3] --- 1764,1768 ---- display print statements, run the string "a = 12; b = 3", then run myprogram.lua and push into lua a table named 'arg' with the ! indices </li> <li>[-5] = 'd:\wxLua\bin\wxlua.exe', [-4] = '-c', [-3] *************** *** 1906,1910 **** necessary) for your paths.</li> <li>The list of paths is a ! semicolon separated list of paths to <span style="font-weight: bold;">?.so</span> (for unix type shared libraries) and <span style="font-weight: bold;">?.dll</span> (for MSW) .</li> --- 1900,1904 ---- necessary) for your paths.</li> <li>The list of paths is a ! semicolon separated list of paths to <span style="font-weight: bold;">?.so</span> (for Unix type shared libraries) and <span style="font-weight: bold;">?.dll</span> (for MSW) .</li> *************** *** 1913,1917 **** <li>You might ! as well include paths to both unix and MSW libraries so that the script can be run on either platform without modification since typically only the libraries that work on any given platform will be installed.</li> --- 1907,1911 ---- <li>You might ! as well include paths to both unfix and MSW libraries so that the script can be run on either platform without modification since typically only the libraries that work on any given platform will be installed.</li> *************** *** 1967,1973 **** throw out the whole library when linking unless you explicitly use something in it. Replace the XXX with the name of the library you want ! installed, see modules/wxbind/include/wxbinddefs.h for a list of them ! and some helpful macros to make it easy to install a standard set of ! them or all of them. </li> <li>Compilation of this module generates a number of --- 1961,1966 ---- throw out the whole library when linking unless you explicitly use something in it. Replace the XXX with the name of the library you want ! installed, see modules/wxbind/include/wxbinddefs.h for a list of them.</li><li>You should preferably use the macros in modules/wxbind/include/wxbinddefs.h to make it easy to install a standard set of ! them or all of them. They do some simple checks to determine if the binding will be available based on the wxWidgets wxUSE_XXX directives.</li> <li>Compilation of this module generates a number of *************** *** 2072,2078 **** The wxLuaState contains all of the Lua 'C' functions, such as lua_gettop(lua_State* L), but as member functions named lua_GetTop() ! which use the internal lua_State and check for it's validity before use ! when ! compiled in debug mode. The functions are capitalized to make them easier to find in an editor. If you want the greatest performance just use wxLuaState::GetLuaState() and directly manipulate the --- 2065,2069 ---- The wxLuaState contains all of the Lua 'C' functions, such as lua_gettop(lua_State* L), but as member functions named lua_GetTop() ! which use the internal lua_State and check for it's validity before use. The functions are capitalized to make them easier to find in an editor. If you want the greatest performance just use wxLuaState::GetLuaState() and directly manipulate the *************** *** 2095,2098 **** --- 2086,2090 ---- setting up the lua_State.</li> <ol> + <li>The wxObject::m_refData is created as a new wxLuaStateRefData(). This ref *************** *** 2103,2112 **** will all share the same wxLuaStateData class.</li> <li>The - wxLuaStateData constructor makes a copy of the static binding list, - wxLuaBinding::GetBindingList(), using wxLuaBinding::Clone() - function so that the member variables of the wxLuaBindings are - independent for each wxLuaState, however the binding data structs are - not since they are too large to make full copies of them.</li> - <li>The C lua_State is added to a hash table to allow --- 2095,2098 ---- *************** *** 2137,2158 **** <ul> </ul> <ul> <li>Each ! binding that is loaded are copies of derived wxLuaBinding ! classes that are installed into a wxList when the wxLuaBinding_XXX_init() functions ! are called when the application is initialized (see above about the ! wxbind module).</li> ! </ul> ! <ul> ! <li>YOU ! MUST ALWAYS KEEP THE ! SAME BINDINGS AND KEEP THEM IN ! THE SAME ORDER THROUGHOUT THE LIFE OF YOUR WXLUASTATES. This is because ! there is only one global int for each wxLua type and if ! you change the bindings (or their order) and create a new wxLuaState ! any previously ! created wxLuaStates will lookup classes using the wrong overwritten ! type.</li> </ul> <ol> --- 2123,2138 ---- <ul> </ul> + <ul> <li>Each ! binding that is loaded are derived wxLuaBinding ! classes whose member data variables point to structs in each binding. A ! single static instance of each binding class are installed ! into a wxList when the wxLuaBinding_XXX_init() functions ! are called. The reason behind the need for running the init function ! from the binding libraries is to stop certain compilers from throwing ! out the whole binding library, which happens even if the binding was ! added to the list from within the library.</li> </ul> <ol> *************** *** 2192,2196 **** considerable amount of the total time of a function call.<br> <br> ! <pre>// Light userdata used as keys in the Lua LUA_REGISTRYINDEX table for wxLua items.<br>// Note that even though these keys have values, they're not used, just the memory address.<br><br>// The key in the LUA_REGISTRYINDEX table that is a table indexed<br>// on the wxLua types where each item is a userdata metatable for a C++ class.<br>// Note: The wxLua types WXLUA_TXXX that correspond to the Lua LUA_TXXX types<br>// are not stored in this table since they do not use our metatables.<br>// The keys in this table are all > 1.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_types_key][wxLua type number] = { metatable for a C++ class }<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_types_key;<br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table<br>// with references to Lua objects we want to keep a handle to. The object could be<br>// anything, a table, function, number, string, userdata...<br>// LUA_REGISTRYINDEX[&wxlua_lreg_refs_key][ref number] = Lua object<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_refs_key;<br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table<br>// with references to objects the wxLuaDebugData wants to keep a handle to. It<br>// stores their value for faster lookup. It is used only for the wxLuaDebugData.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][ref number] = Lua object<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_debug_refs_key;<br>// The key that in the LUA_REGISTRYINDEX table that is a table of<br>// C++ classname keys and lightuserdata pointers to the associated wxLuaBindClass.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][wxLuaBindClass.name] = lightuserdata(&wxLuaBindClass)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_classes_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table<br>// of Lua functions assigned to wxLua userdata programatically in Lua.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_derivedmethods_key][lightuserdata(obj_ptr)] =<br>// {["derived func/value name"] = wxLuaObject(Lua function/value), ...}<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_derivedmethods_key;<br>// The key in the LUA_REGISTRYINDEX table who's value is a lightuserdata<br>// of the wxLuaState for this lua_State.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluastate_key] = lightuserdata(&wxLuaState)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluastate_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// objects that we've pushed into Lua using wxluaT_pushuserdatatype().<br>// Note: A single object like a wxWindow may be pushed with multiple wxLua types.<br>// e.g. wxWindow* w = wx.wxWindow() retrieve the window later from wxObject* wxEvent:GetEventObject()<br>// LUA_REGISTRYINDEX[&wxlua_lreg_weakobjects_key][lightuserdata(obj_ptr)] =<br>// { wxLua type1 = weak fulluserdata, wxLua type2 = weak fulluserdata... }<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_weakobjects_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// objects tracked using wxluaO_addgcobject() to delete them when done.<br>// Note that non wxObject classes use wxLUA_DECLARE_ENCAPSULATION so<br>// the key is the object pointer and the value is the wxObject encapsulation.<br>// Both the key and the value are the same if not encapsulated .<br>// LUA_REGISTRYINDEX[&wxlua_lreg_gcobjects_key][lightuserdata(obj_ptr)] =<br>// lightuserdata(wxObject derived class)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_gcobjects_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// wxLuaEventCallbacks that we've created.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_evtcallbacks_key][lightuserdata(&wxLuaEventCallback)] =<br>// lightuserdata(&wxEvtHandler)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_evtcallbacks_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// wxLuaWinDestroyCallbacks that we've created.<br>// Two key/value pairs are created for fast lookup.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_windestroycallbacks_key][lightuserdata(&wxLuaWinDestroyCallback)] = 1<br>// LUA_REGISTRYINDEX[&wxlua_lreg_windestroycallbacks_key][lightuserdata(&wxWindow)] =<br>// lightuserdata(wxLuaWinDestroyCallback)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_windestroycallbacks_key;<br>// The key in the LUA_REGISTRYINDEX table that is table of all<br>// top level wxWindows that we've created and need to destroy when closed.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_topwindows_key][lightuserdata(&wxWindow)] = 1<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_topwindows_key;<br>// The key in the LUA_REGISTRYINDEX table that has a boolean value<br>// of whether the Lua code has prepended a '_' to function name to indicate<br>// that they want the base class function called.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_callbaseclassfunc_key] = true/false<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_callbaseclassfunc_key;<br>// The key in the LUA_REGISTRYINDEX table that has a wxEventType (integer) value<br>// of the current wxEvent is that is being run or wxEVT_NULL if not in an event.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxeventtype_key] = wxEventType (wxEVT_NULL)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxeventtype_key;<br>// The key in the LUA_REGISTRYINDEX table that has a wxLuaDebugHookData<br>// lightuserdata value for the wxLuaState.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluadebughookdata_key] = lightuserdata(&wxLuaDebugHookData)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluadebughookdata_key;<br>// The key in the LUA_REGISTRYINDEX table that is a weak keyed table of<br>// the tables wxLua pushed into the registry with their keys as values.<br>// This is used by the wxLuaDebugData to know if the table is one of the wxLua<br>// registry tables for better wxLuaStackDialog performance.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_regtable_key][weak {wxlua_lreg_XXX_key table}] =<br>// lightuserdata(&wxlua_lreg_XXX_key)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_regtable_key;<br><br>// Light userdata used as keys in the metatables created for the class userdata objects.<br>// Note that even though these keys have values, they're not used, just the memory address.<br><br>// wxLua userdata metatable structure:<br>// {<br>// lightuserdata(&wxlua_metatable_type_key) = wxLua type number in wxlua_lreg_types_key table<br>// lightuserdata(&wxlua_metatable_wxluabindclass_key) = lightuserdata(&wxLuaBindClass)<br>// __gc = function(wxlua_wxLuaBindClass__gc)<br>// __index = function(wxlua_wxLuaBindClass__index)<br>// __newindex = function(wxlua_wxLuaBindClass__newindex)<br>// __tostring = function(wxlua_wxLuaBindClass__tostring)<br>// }<br><br>// The key of a metatable used for wxLua userdata that is the wxLua type number in the<br>// wxlua_lreg_types_key table this metatable is for.<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_metatable_type_key;<br>// The key of a metatable used for wxLua userdata that stores a lightuserdata<br>// of the wxLuaBindClass struct for this class.<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_metatable_wxluabindclass_key;<br></pre> <h3><a name="Functions_to_Create_a_wxLuaState"></a>Functions to --- 2172,2176 ---- considerable amount of the total time of a function call.<br> <br> ! <pre>// ----------------------------------------------------------------------------<br>// Special keys used by wxLua in the LUA_REGISTRYINDEX table.<br>//<br>// Note: We do not push a human readable string for these because Lua always<br>// makes a copy and hashes the string, this takes a considerable amount of<br>// time when benchmarked using valgrind.<br>// ----------------------------------------------------------------------------<br><br>// Light userdata used as keys in the Lua LUA_REGISTRYINDEX table for wxLua.<br>// Note that even though these keys have values, they're not used, just the memory address.<br><br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table indexed<br>// on the wxLua types where each item is a userdata metatable for a C++ class.<br>// Note: The wxLua types WXLUA_TXXX that correspond to the Lua LUA_TXXX types<br>// are not stored in this table since they do not use our metatables.<br>// The keys in this table are all > 1. They values are either tables or 0<br>// if the wxLuaBinding containing the wxLua type was not registered.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_types_key][wxLua type number] = { metatable for a C++ class }<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_types_key;<br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table<br>// with references to Lua objects we want to keep a handle to. The object could be<br>// anything, a table, function, number, string, userdata...<br>// LUA_REGISTRYINDEX[&wxlua_lreg_refs_key][ref number] = Lua object<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_refs_key;<br>// The key in the LUA_REGISTRYINDEX table that is a numerically keyed table<br>// with references to objects the wxLuaDebugData wants to keep a handle to by<br>// storing their value for lookup. It is used only for the wxLuaDebugData.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][ref number] = Lua object<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_debug_refs_key;<br>// The key that in the LUA_REGISTRYINDEX table that is a lookup table of string<br>// C++ classname keys and lightuserdata pointers to the associated wxLuaBindClass struct.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_debug_refs_key][wxLuaBindClass.name] = lightuserdata(&wxLuaBindClass)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_classes_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table<br>// of Lua objects/functions assigned to wxLua userdata programatically in Lua.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_derivedmethods_key][lightuserdata(obj_ptr)] =<br>// {["derived func/value name"] = wxLuaObject(Lua function/value), ...}<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_derivedmethods_key;<br>// The key in the LUA_REGISTRYINDEX table who's value is a lightuserdata<br>// of the wxLuaState for this lua_State.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluastate_key] = lightuserdata(&wxLuaState)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluastate_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of lightuserdata<br>// wxLuaBindings and the ref to the Lua table they were installed into.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluabindings_key] = {lightuserdata(&wxLuaBinding) = wxlua_lreg_refs_key ref#, ...}<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluabindings_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of all<br>// objects that we've pushed into Lua using wxluaT_pushuserdatatype().<br>// Note: A single object like a wxWindow may be pushed with multiple wxLua types.<br>// e.g. wxWindow* w = wx.wxWindow() retrieve the window later from wxObject* wxEvent:GetEventObject()<br>// LUA_REGISTRYINDEX[&wxlua_lreg_weakobjects_key][lightuserdata(obj_ptr)] =<br>// { wxLua type1 = weak fulluserdata, wxLua type2 = weak fulluserdata... }<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_weakobjects_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of all<br>// objects to delete that were added using wxluaO_addgcobject().<br>// Note that non wxObject classes use wxLUA_DECLARE_ENCAPSULATION so<br>// the key is the object pointer and the value is the wxObject encapsulation.<br>// Both the key and the value are the same if not encapsulated.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_gcobjects_key][lightuserdata(obj_ptr)] =<br>// lightuserdata(wxObject derived class)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_gcobjects_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of all<br>// wxLuaEventCallbacks that we've created.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_evtcallbacks_key][lightuserdata(&wxLuaEventCallback)] =<br>// lightuserdata(&wxEvtHandler)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_evtcallbacks_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of wxWindow keys and<br>// wxLuaWinDestroyCallback values that we've created.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_windestroycallbacks_key][lightuserdata(&wxWindow)] =<br>// lightuserdata(wxLuaWinDestroyCallback)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_windestroycallbacks_key;<br>// The key in the LUA_REGISTRYINDEX table that is a table of all<br>// top level wxWindows that we've created and need to destroy when closed.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_topwindows_key][lightuserdata(&wxWindow)] = 1<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_topwindows_key;<br>// The key in the LUA_REGISTRYINDEX table that has a boolean value<br>// of whether the Lua code has prepended a '_' to function name to indicate<br>// that they want the base class function called.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_callbaseclassfunc_key] = true/false<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_callbaseclassfunc_key;<br>// The key in the LUA_REGISTRYINDEX table that has a wxEventType (integer) value<br>// of the current wxEvent is that is being run or wxEVT_NULL if not in an event.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxeventtype_key] = wxEventType (wxEVT_NULL)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxeventtype_key;<br>// The key in the LUA_REGISTRYINDEX table that has a wxLuaStateData class<br>// lightuserdata value for the wxLuaState.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_wxluastatedata_key] = lightuserdata(&wxLuaStateData)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluastatedata_key;<br>// The key in the LUA_REGISTRYINDEX table that is a weak keyed table of<br>// the tables wxLua pushed into the registry with their keys as values.<br>// This is used by the wxLuaDebugData to know if the table is one of the wxLua<br>// registry tables for better wxLuaStackDialog performance.<br>// LUA_REGISTRYINDEX[&wxlua_lreg_regtable_key][weak {wxlua_lreg_XXX_key table}] =<br>// lightuserdata(&wxlua_lreg_XXX_key)<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_regtable_key;<br><br>// Light userdata used as keys in the metatables created for the class userdata objects.<br>// Note that even though these keys have values, they're not used, just the memory address.<br><br>// wxLua userdata metatable structure:<br>// {<br>// lightuserdata(&wxlua_metatable_type_key) = wxLua type number in wxlua_lreg_types_key table<br>// lightuserdata(&wxlua_metatable_wxluabindclass_key) = lightuserdata(&wxLuaBindClass)<br>// __gc = function(wxlua_wxLuaBindClass__gc)<br>// __index = function(wxlua_wxLuaBindClass__index)<br>// __newindex = function(wxlua_wxLuaBindClass__newindex)<br>// __tostring = function(wxlua_wxLuaBindClass__tostring)<br>// }<br><br>// The key of a metatable used for wxLua userdata that is the wxLua type number in the<br>// wxlua_lreg_types_key table this metatable is for.<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_metatable_type_key;<br>// The key of a metatable used for wxLua userdata that stores a lightuserdata<br>// of the wxLuaBindClass struct for this class.<br>extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_metatable_wxluabindclass_key;<br><br></pre> <h3><a name="Functions_to_Create_a_wxLuaState"></a>Functions to *************** *** 2214,2230 **** get and handle the wxLuaEvents, see also Get/SetEventHandler().</li> </ul> ! <li>wxLuaState(lua_State* L, wxLuaState_Type type = ! WXLUASTATE_ATTACH)</li> <ul> ! <li>type = ! WXLUASTATE_ATTACH means that the lua_State must already have been created using a wxLuaState and so this new wxLuaState will merely attach to the corresponding ref data.</li> <li>type ! = WXLUASTATE_SETSTATE means that this new lua_State ! that you have created will have the wxLua bindings pushed into it and then be ready for running wxLua programs. The wxLuaState will not close the lua_State, but will remove itself from Lua and do cleanup when ! there are no more instances of them.</li> </ul> </ul> --- 2194,2208 ---- get and handle the wxLuaEvents, see also Get/SetEventHandler().</li> </ul> ! <li>wxLuaState(lua_State* L, wxLuaState_Type type = wxLUASTATE_GETSTATE)</li> <ul> ! <li>type = wxLUASTATE_GETSTATE means that the lua_State must already have been created using a wxLuaState and so this new wxLuaState will merely attach to the corresponding ref data.</li> <li>type ! = wxLUASTATE_SETSTATE means that this new lua_State ! that you have created will have the wxLua bindings pushed into it if wxLUASTATE_OPENBINDINGS is set and then be ready for running wxLua programs. The wxLuaState will not close the lua_State, but will remove itself from Lua and do cleanup when ! there are no more instances of them if wxLUASTATE_STATICSTATE is set.</li> </ul> </ul> *************** *** 2275,2277 **** other functions which are documented in <span style="font-style: italic;">wxLua/modules/wxlua/include/wxlstate.h</span>.</li> </ul> ! </body></html> --- 2253,2255 ---- other functions which are documented in <span style="font-style: italic;">wxLua/modules/wxlua/include/wxlstate.h</span>.</li> </ul> ! </body></html> \ No newline at end of file |