From: John L. <jr...@us...> - 2009-05-19 03:21:09
|
Update of /cvsroot/wxlua/wxLua/docs In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15045/wxLua/docs Modified Files: binding.html install.html wxlua.html Log Message: Do not export parts of the bindings that are only used internally. Declare them as extern within the cpp file of the binding. Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** wxlua.html 27 Oct 2008 02:27:19 -0000 1.40 --- wxlua.html 19 May 2009 03:20:53 -0000 1.41 *************** *** 1779,1783 **** wxLua program will display a console window to 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] --- 1779,1783 ---- wxLua program will display a console window to 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] *************** *** 1942,1946 **** "modulename/include/filename.h"</i>.<br> <ul> ! <li><b>lua</b></li> <ul> <li>The --- 1942,1946 ---- "modulename/include/filename.h"</i>.<br> <ul> ! <li><b>Lua</b></li> <ul> <li>The Index: install.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/install.html,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** install.html 11 Jan 2008 23:39:05 -0000 1.13 --- install.html 19 May 2009 03:20:53 -0000 1.14 *************** *** 10,14 **** <br> This document describes how to build wxLua for use as an ! interpreter of lua scripts and for embedding wxLua in a C++ project. You can build wxLua on many platforms with a variety of compilers. All the build settings and platforms that are supported by wxWidgets are --- 10,14 ---- <br> This document describes how to build wxLua for use as an ! interpreter of Lua scripts and for embedding wxLua in a C++ project. You can build wxLua on many platforms with a variety of compilers. All the build settings and platforms that are supported by wxWidgets are *************** *** 58,62 **** If you want to use wxLuaApp to write your applications in Lua using wxWidgets library then you are mainly interested in the <span style="font-weight: bold;">applications</span> ! (basically code editors with integrated lua interpreter). If you want to integrate wxLua in your C++ project, then you are mainly interested in the <span style="font-weight: bold;">modules</span>, --- 58,62 ---- If you want to use wxLuaApp to write your applications in Lua using wxWidgets library then you are mainly interested in the <span style="font-weight: bold;">applications</span> ! (basically code editors with integrated Lua interpreter). If you want to integrate wxLua in your C++ project, then you are mainly interested in the <span style="font-weight: bold;">modules</span>, *************** *** 104,108 **** <li> <p><span style="font-style: italic;">wxLua/modules/wxluadebug</span> ! - Helpful classes for debugging lua, wxLuaCheckStack and wxLuaStackDialog.</p> </li> --- 104,108 ---- <li> <p><span style="font-style: italic;">wxLua/modules/wxluadebug</span> ! - Helpful classes for debugging Lua, wxLuaCheckStack and wxLuaStackDialog.</p> </li> *************** *** 506,510 **** in their own project. This means that you can write scripts to make your code simpler, load and run files on the fly, and ! allow users to more easily customize your program with their own lua scripts.<br> <br> --- 506,510 ---- in their own project. This means that you can write scripts to make your code simpler, load and run files on the fly, and ! allow users to more easily customize your program with their own Lua scripts.<br> <br> *************** *** 516,523 **** at a <span style="font-style: italic;">minimum</span>. With these two libraries you have the ability to start an interpreter ! and run straight lua code in it using the wxLuaState class.<br> <br> To get the ability to create wxWidgets objects and use the ! functionality of wxWidgets in lua you will also need to build and link to the libraries in <span style="font-family: monospace;">modules/wxbind</span>. The bindings in <span style="font-family: monospace;">modules/wxbind</span> --- 516,523 ---- at a <span style="font-style: italic;">minimum</span>. With these two libraries you have the ability to start an interpreter ! and run straight Lua code in it using the wxLuaState class.<br> <br> To get the ability to create wxWidgets objects and use the ! functionality of wxWidgets in Lua you will also need to build and link to the libraries in <span style="font-family: monospace;">modules/wxbind</span>. The bindings in <span style="font-family: monospace;">modules/wxbind</span> Index: binding.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/binding.html,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** binding.html 25 Oct 2008 05:18:56 -0000 1.30 --- binding.html 19 May 2009 03:20:53 -0000 1.31 *************** *** 8,17 **** generator for wxLua provides information for Lua code to ! interface to a C/C++ API. The C/C++ objects are created in lua as userdata and manipulated using the same functional semantics as you would in C/C++. The <span style="font-weight: bold;">wxlua.html</span> wxLua documentation describes in detail how the object ! will be named and where it will be placed in lua.<br> <br>Binding files are provided for the <b>wxWidgets</b> cross --- 8,17 ---- generator for wxLua provides information for Lua code to ! interface to a C/C++ API. The C/C++ objects are created in Lua as userdata and manipulated using the same functional semantics as you would in C/C++. The <span style="font-weight: bold;">wxlua.html</span> wxLua documentation describes in detail how the object ! will be named and where it will be placed in Lua.<br> <br>Binding files are provided for the <b>wxWidgets</b> cross *************** *** 29,33 **** <i>bindings/genwxbind.lua</i> parses ! and turns into C functions that are imported into lua by an automatically generated <i>wxLuaBinding</i> derived class. The whole process of generation is --- 29,33 ---- <i>bindings/genwxbind.lua</i> parses ! and turns into C functions that are imported into Lua by an automatically generated <i>wxLuaBinding</i> derived class. The whole process of generation is *************** *** 75,79 **** copy an existing one to use as a starting point for your own.</li> <li style="text-align: justify;">The rules files are ! actual lua programs that <i>genwxbind.lua</i> runs before processing the interface files, but after it has created various structures used for parsing allowing for --- 75,79 ---- copy an existing one to use as a starting point for your own.</li> <li style="text-align: justify;">The rules files are ! actual Lua programs that <i>genwxbind.lua</i> runs before processing the interface files, but after it has created various structures used for parsing allowing for *************** *** 140,144 **** style input parameters)</li> <li>// %override [type1 output_name1, type2 output_name2] ! ClassName::FuncName(reworked C++ style input parameters that the lua function actually takes)</li> </ul> <li>In order for the %overload functionality to work and to get --- 140,144 ---- style input parameters)</li> <li>// %override [type1 output_name1, type2 output_name2] ! ClassName::FuncName(reworked C++ style input parameters that the Lua function actually takes)</li> </ul> <li>In order for the %overload functionality to work and to get *************** *** 151,155 **** expects to get, and the third line is the correct calling semantics for the %overridden function.</li> <ul> <li>// ! %override void wxFrame::SetStatusWidths(lua table with number indexes and values)</li> <li>// C++ Func: virtual void --- 151,155 ---- expects to get, and the third line is the correct calling semantics for the %overridden function.</li> <ul> <li>// ! %override void wxFrame::SetStatusWidths(Lua table with number indexes and values)</li> <li>// C++ Func: virtual void *************** *** 191,195 **** through the wxLuaBindClass struct and when the binding is initialized will ! contain the tag index that lua assigns to the class for the userdata.</li> <li>The C functions, <i>int ClassMethodFunction(lua_State* L)</i>, that are called for the --- 191,195 ---- through the wxLuaBindClass struct and when the binding is initialized will ! contain the tag index that Lua assigns to the class for the userdata.</li> <li>The C functions, <i>int ClassMethodFunction(lua_State* L)</i>, that are called for the *************** *** 201,216 **** struct that contains all the wxEventType ! values and their associated wxEvent classes to push into the lua binding table.</li> <li>A wxLuaBindDefine struct that contains all the numerical ! values to push into the lua binding table.</li> <li>A wxLuaBindString struct that contains all the strings to ! push into the lua binding table.</li> <li>A wxLuaBindObject struct that contains all the objects to ! push as userdata into the lua binding table.</li> <li>A wxLuaBindMethod struct that contains all the global C ! functions to push into the lua binding table.</li> <li>A wxLuaBindClass struct that contains the class names, all --- 201,216 ---- struct that contains all the wxEventType ! values and their associated wxEvent classes to push into the Lua binding table.</li> <li>A wxLuaBindDefine struct that contains all the numerical ! values to push into the Lua binding table.</li> <li>A wxLuaBindString struct that contains all the strings to ! push into the Lua binding table.</li> <li>A wxLuaBindObject struct that contains all the objects to ! push as userdata into the Lua binding table.</li> <li>A wxLuaBindMethod struct that contains all the global C ! functions to push into the Lua binding table.</li> <li>A wxLuaBindClass struct that contains the class names, all *************** *** 219,223 **** tags.</li> <li>A wxLuaBinding derived class that actually pushes the ! bindings into lua.</li> </ul> </ul><h2><a name="Binding_C_Virtual_Functions"></a><u>Binding C++ Virtual Functions</u></h2> --- 219,223 ---- tags.</li> <li>A wxLuaBinding derived class that actually pushes the ! bindings into Lua.</li> </ul> </ul><h2><a name="Binding_C_Virtual_Functions"></a><u>Binding C++ Virtual Functions</u></h2> *************** *** 237,243 **** should review it before reading further. You will also need to look ! at <i>samples/printing.wx.lua</i> to see the lua code that overrides the function and <span style="font-style: italic;">modules/wxlua/src/wxlbind.cpp</span> ! for the metatable functions lua uses to handle a call to a function. <br> Below is a list of the function calls for wxPrintout::OnBeginDocument and notes about how it all --- 237,243 ---- should review it before reading further. You will also need to look ! at <i>samples/printing.wx.lua</i> to see the Lua code that overrides the function and <span style="font-style: italic;">modules/wxlua/src/wxlbind.cpp</span> ! for the metatable functions Lua uses to handle a call to a function. <br> Below is a list of the function calls for wxPrintout::OnBeginDocument and notes about how it all *************** *** 245,249 **** <ol> <li>Create a userdata wxLuaPrintout in Lua, replace the ! function OnBeginDocument with our own one in lua, and begin the printing process, perhaps doing a print preview? The code for this is in the <i>printing.wx.lua</i> sample.</li> --- 245,249 ---- <ol> <li>Create a userdata wxLuaPrintout in Lua, replace the ! function OnBeginDocument with our own one in Lua, and begin the printing process, perhaps doing a print preview? The code for this is in the <i>printing.wx.lua</i> sample.</li> *************** *** 289,296 **** is called. This is the function that handles all function calls for wxLua userdata objects that does a lookup to see if the ! function exists and pushes it onto the stack for lua to call <b>after</b> this function has returned. </li> <li>This is why we set a variable using ! wxLuaState::Set/GetCallBaseClassFunction() to remember if the lua function was called with a preceding "_". </li> <li>The reason why we need to reset the --- 289,296 ---- is called. This is the function that handles all function calls for wxLua userdata objects that does a lookup to see if the ! function exists and pushes it onto the stack for Lua to call <b>after</b> this function has returned. </li> <li>This is why we set a variable using ! wxLuaState::Set/GetCallBaseClassFunction() to remember if the Lua function was called with a preceding "_". </li> <li>The reason why we need to reset the *************** *** 300,307 **** and so calls to functions like wxLuaPrintout::OnPrintPage(...) fail since they are directed to call the base class function and not our ! derived lua functions.</li> </ul> </ol>To summarize, here's the function calls and where in each function wxLuaPrintout::OnBeginDocument is when you override ! the function in lua.<br> <ol> <li>wxWidgets calls wxLuaPrintout::OnBeginDocument(...) in C++</li> <li>wxLuaPrintout::OnBeginDocument(...) --- 300,307 ---- and so calls to functions like wxLuaPrintout::OnPrintPage(...) fail since they are directed to call the base class function and not our ! derived Lua functions.</li> </ul> </ol>To summarize, here's the function calls and where in each function wxLuaPrintout::OnBeginDocument is when you override ! the function in Lua.<br> <ol> <li>wxWidgets calls wxLuaPrintout::OnBeginDocument(...) in C++</li> <li>wxLuaPrintout::OnBeginDocument(...) *************** *** 313,317 **** userdata, the flag wxLuaState::GetCallBaseClassFunction is set to true, and the C function wxLua_wxPrintout_OnBeginDocument (in <i>modules/wxbind/src/wxcore_print.cpp</i>) ! is run by lua which calls back to wxLuaPrintout::OnBeginDocument(...).</li> <li>We enter wxLuaPrintout::OnBeginDocument(...) a second time, the first time through is still stalled at wxLuaState::LuaCall() --- 313,317 ---- userdata, the flag wxLuaState::GetCallBaseClassFunction is set to true, and the C function wxLua_wxPrintout_OnBeginDocument (in <i>modules/wxbind/src/wxcore_print.cpp</i>) ! is run by Lua which calls back to wxLuaPrintout::OnBeginDocument(...).</li> <li>We enter wxLuaPrintout::OnBeginDocument(...) a second time, the first time through is still stalled at wxLuaState::LuaCall() *************** *** 331,335 **** wxArrayString& choices or wxArrayString choices</b></li> <ul> <li>The ! binding generator will read from lua either a wxArrayString or a a numerically indexed table of strings for that parameter and convert them into a --- 331,335 ---- wxArrayString& choices or wxArrayString choices</b></li> <ul> <li>The ! binding generator will read from Lua either a wxArrayString or a a numerically indexed table of strings for that parameter and convert them into a *************** *** 342,346 **** wxArrayInt& choices or wxArrayInt choices</b></li> <ul> <li>The ! binding generator will read from lua a wxArrayInt or a numerically indexed table of integers for that parameter and convert --- 342,346 ---- wxArrayInt& choices or wxArrayInt choices</b></li> <ul> <li>The ! binding generator will read from Lua a wxArrayInt or a numerically indexed table of integers for that parameter and convert *************** *** 354,358 **** modify the wxArrayInt that's passed to it.</li> </ul> <li style="font-weight: bold;">IntArray_FromLuaTable</li> <ul> <li>The ! binding generator will read from lua a numerically indexed table of integers and create two parameters (int count, int* array) to pass --- 354,358 ---- modify the wxArrayInt that's passed to it.</li> </ul> <li style="font-weight: bold;">IntArray_FromLuaTable</li> <ul> <li>The ! binding generator will read from Lua a numerically indexed table of integers and create two parameters (int count, int* array) to pass *************** *** 381,385 **** DO NOT EVER TRY TO CAST IT, ACCESS IT, OR DELETE IT. This tag will allow ! the lua code to put a number (perhaps a table index) as the void* pointer. </li> <li>See Get/SetClientData() functions in --- 381,385 ---- DO NOT EVER TRY TO CAST IT, ACCESS IT, OR DELETE IT. This tag will allow ! the Lua code to put a number (perhaps a table index) as the void* pointer. </li> <li>See Get/SetClientData() functions in *************** *** 433,445 **** use %class ... ns::ClassName and the constructor must also be ns::ClassName. The generator will change the "::" to "_" however for ! useage in lua. </li> <li><i><b>%delete</b></i> is for classes that you ! want the lua garbage collector to delete when the variable goes out of scope. </li> <ul> <li>For example, a wxPoint should be deleted when there are no longer any references to it, but wxWindows are typically attached to a parent and the parent wxWindow should delete its children, ! not lua.</li> <li>Classes, like the simple wxPoint or ref counted wxObject classes like wxPen, can use the '=' operator to make a copy of the --- 433,445 ---- use %class ... ns::ClassName and the constructor must also be ns::ClassName. The generator will change the "::" to "_" however for ! useage in Lua. </li> <li><i><b>%delete</b></i> is for classes that you ! want the Lua garbage collector to delete when the variable goes out of scope. </li> <ul> <li>For example, a wxPoint should be deleted when there are no longer any references to it, but wxWindows are typically attached to a parent and the parent wxWindow should delete its children, ! not Lua.</li> <li>Classes, like the simple wxPoint or ref counted wxObject classes like wxPen, can use the '=' operator to make a copy of the *************** *** 477,481 **** parameter <i>[Value]</i> can be the actual numerical value to use. ! This if useful when you want lua to know about a preprocessor directive such as, <i>"#define A_DEFINE"</i> that doesn't have a value itself. In this case assign it to be 1 using <i>"%define --- 477,481 ---- parameter <i>[Value]</i> can be the actual numerical value to use. ! This if useful when you want Lua to know about a preprocessor directive such as, <i>"#define A_DEFINE"</i> that doesn't have a value itself. In this case assign it to be 1 using <i>"%define *************** *** 490,494 **** be used inside of the %class tag for the wxEvent derived class it corresponds to so the event's methods can be ! known to lua and the generator can assign the correct class type to it. </li> <li>An example of this is in the wxCommandEvent interface in <i>bindings/wxwidgets/event.i</i>, <i>"%define --- 490,494 ---- be used inside of the %class tag for the wxEvent derived class it corresponds to so the event's methods can be ! known to Lua and the generator can assign the correct class type to it. </li> <li>An example of this is in the wxCommandEvent interface in <i>bindings/wxwidgets/event.i</i>, <i>"%define *************** *** 500,504 **** be used inside the corresponding <i>%class</i> tag so ! that the object's class methods can be known to lua and the generator can assign the correct class type to it.</li> <li>An example of this is in the --- 500,504 ---- be used inside the corresponding <i>%class</i> tag so ! that the object's class methods can be known to Lua and the generator can assign the correct class type to it.</li> <li>An example of this is in the *************** *** 515,519 **** be used inside the corresponding <i>%class</i> tag so ! that the pointer's methods can be known to lua and the generator can assign the correct class type to it.</li> <li>An example of this is --- 515,519 ---- be used inside the corresponding <i>%class</i> tag so ! that the pointer's methods can be known to Lua and the generator can assign the correct class type to it.</li> <li>An example of this is *************** *** 567,571 **** passed to the function or return value should be garbage collected or able to be delete()ed by ! the lua program.</li> <li>This is for C++ functions that when passed a userdata object will 'release' it from being deleted --- 567,571 ---- passed to the function or return value should be garbage collected or able to be delete()ed by ! the Lua program.</li> <li>This is for C++ functions that when passed a userdata object will 'release' it from being deleted *************** *** 591,598 **** tag.</li> <li>Declares that after calling this function the object itself ! (not return value) should be garbage collected by lua.</li> <li>This is for functions that when called will release the object from being deleted by something else and therefore it should be ! deleted in wxLua by either the garbage collector or when a lua program calls the delete() function on it.</li> <li>You should verify that the generated code is appropriate as --- 591,598 ---- tag.</li> <li>Declares that after calling this function the object itself ! (not return value) should be garbage collected by Lua.</li> <li>This is for functions that when called will release the object from being deleted by something else and therefore it should be ! deleted in wxLua by either the garbage collector or when a Lua program calls the delete() function on it.</li> <li>You should verify that the generated code is appropriate as *************** *** 657,665 **** declared operators use the semantics given below.</li> <li>The reason that the ! operators are not overridden in lua using the metatable is that ! lua only defines a limited set of operators. Having some operators overridden and some not is probably more confusing that not overriding ! any. Secondly, by leaving the lua operators alone the = and == operators (for example) can be useful as userdata pointer assignment and pointer comparisons respectively. This is --- 657,665 ---- declared operators use the semantics given below.</li> <li>The reason that the ! operators are not overridden in Lua using the metatable is that ! Lua only defines a limited set of operators. Having some operators overridden and some not is probably more confusing that not overriding ! any. Secondly, by leaving the Lua operators alone the = and == operators (for example) can be useful as userdata pointer assignment and pointer comparisons respectively. This is *************** *** 712,716 **** verbatim into the binding code. </li> <li>This is necessary for functions that take ! pointers or references and return values though them. Since lua cannot have values passed by reference the only solution is to return multiple values. </li> <li>See the function --- 712,716 ---- verbatim into the binding code. </li> <li>This is necessary for functions that take ! pointers or references and return values though them. Since Lua cannot have values passed by reference the only solution is to return multiple values. </li> <li>See the function *************** *** 764,777 **** which can be accessed in ! lua as NEW_FUNC_NAME() though it's accessed in C using FUNC_NAME().</li> <li>This can be necessary when there are two overloaded C functions that are hard or impossible to distinguish between ! the two and so it is necessary to rename them for the lua script to access them correctly.</li> <li>An example of when this is necessary is</li> <ul> <li>wxSize wxWindow::GetClientSize()</li> <li>void wxWindow::GetClientSize(int* width, int* height)</li> <li>Since ! lua cannot pass the int *width and *height by reference, we change the function to have this signature.</li> <ul> <li>[int width, int height] = wxWindow::GetClientSize()</li> --- 764,777 ---- which can be accessed in ! Lua as NEW_FUNC_NAME() though it's accessed in C using FUNC_NAME().</li> <li>This can be necessary when there are two overloaded C functions that are hard or impossible to distinguish between ! the two and so it is necessary to rename them for the Lua script to access them correctly.</li> <li>An example of when this is necessary is</li> <ul> <li>wxSize wxWindow::GetClientSize()</li> <li>void wxWindow::GetClientSize(int* width, int* height)</li> <li>Since ! Lua cannot pass the int *width and *height by reference, we change the function to have this signature.</li> <ul> <li>[int width, int height] = wxWindow::GetClientSize()</li> *************** *** 800,804 **** return value only.</li> <li>Declares that the parameter passed to the function or return value should not be ! garbage collected or able to be delete()ed by the lua program.</li> <li>This is for functions that when passed a userdata object will take --- 800,804 ---- return value only.</li> <li>Declares that the parameter passed to the function or return value should not be ! garbage collected or able to be delete()ed by the Lua program.</li> <li>This is for functions that when passed a userdata object will take *************** *** 818,822 **** tag.</li> <li>Declares that after calling this function the object itself ! (not return value) will not be garbage collected by lua.</li> <li>See also <i>%gc_this</i>.</li> </ul><b><i>%wxchkver_X_Y_Z</i></b><br> --- 818,822 ---- tag.</li> <li>Declares that after calling this function the object itself ! (not return value) will not be garbage collected by Lua.</li> <li>See also <i>%gc_this</i>.</li> </ul><b><i>%wxchkver_X_Y_Z</i></b><br> |