From: John L. <jr...@us...> - 2007-05-03 21:05:42
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12878/docs Modified Files: binding.html wxlua.html Log Message: update docs and cleanup Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wxlua.html 1 May 2007 14:23:35 -0000 1.16 --- wxlua.html 3 May 2007 21:05:34 -0000 1.17 *************** *** 6,10 **** Documentation</u></h2> <a href="http://wxlua.sourceforge.net">wxLua</a> is ! a <a href="http://www.lua.org">lua</a> scripting language wrapper around the <a href="http://www.wxwidgets.org">wxWidgets</a> cross-platform GUI library. It consists of two IDE type editors that --- 6,11 ---- Documentation</u></h2> <a href="http://wxlua.sourceforge.net">wxLua</a> is ! a <a href="http://www.lua.org">Lua</a> ! scripting language wrapper around the <a href="http://www.wxwidgets.org">wxWidgets</a> cross-platform GUI library. It consists of two IDE type editors that *************** *** 13,34 **** running standalone wxLua ! scripts (wxLuaFreeze), a lua module to load using "require", and a library for extending C++ programs with a fast, small, fully ! embeddable scripting language.<br><h3>References:</h3> ! <a href="http://wxlua.sourceforge.net">http://wxlua.sourceforge.net</a><br> ! <a href="http://www.lua.org">http://www.lua.org</a><br> ! <a href="http://www.wxwidgets.org">http://www.wxwidgets.org</a><br><h2 style="text-decoration: underline;">Contents</h2><ol><li><a href="#The_wxLua_big_picture">The ! wxLua "big picture"</a></li><li><a href="#Version_Information">Version Information</a></li><li><a href="#wxLua_Requirements">Requirements</a></li><li><a href="#Introduction_to_Lua_very_brief">Introduction to Lua ! (very brief)</a></li><li><a href="#wxLua_Programming_in_Lua">Programming in wxLua</a></li><li><a href="#wxLua_Samples">wxLua Samples and How to Run Them</a></li><ol><li><a href="#How_to_run_the_samples">How to Run the Samples</a></li><li><a href="#Provided_samples">Provided Samples</a></li></ol><li><a href="#wxLua_Applications">wxLua Applications</a></li><ol><li><a href="#wxLua">wxLua</a></li><li><a href="#wxLuaFreeze">wxLuaFreeze</a></li><li><a href="#wxLuaEdit">wxLuaEdit</a></li></ol><li><a href="#wxLua_Utils">wxLua Utils</a></li><ol><li><a href="#bin2c.lua">bin2c.lua</a></li><li><a href="#wrapmodule.wx.lua">wrapmodule.wx.lua</a></li></ol><li><a href="#wxLua_Sourcecode_Modules">wxLua Sourcecode Modules</a></li><li><a href="#wxLua_Programming_in_C">wxLua C++ Programming Guide</a></li></ol><h2><a name="The_wxLua_big_picture"></a> ! <u>The wxLua "big picture"</u></h2> Lua is a small scripting language written in ANSI C that can load and run ! interpreted scripts as either files or strings. The language itself is ! very dynamic and contains a limited number of data types, mainly ! numbers, strings, and tables. Perhaps the most powerful feature of the ! lua language is that the tables can be used as either arrays or as ! hashtables that can cross-reference numbers, strings, functions, and/or subtables.<br> <br>wxLua adds to this small and elegant language the power of --- 14,33 ---- running standalone wxLua ! scripts (wxLuaFreeze), a lua module to load using "require" when using ! the standard lua executable, and a library for extending C++ programs with a fast, small, fully ! embeddable scripting language.<br><br> Lua is a small scripting language written in ANSI C that can load and run ! interpreted scripts as either files or strings. The Lua language is ! fast, dynamic, and easy to learn. Lua contains a limited ! number of data types, ! mainly numbers, strings, 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> <br>wxLua adds to this small and elegant language the power of *************** *** 38,48 **** manipulation, sockets, displaying HTML, and printing to name a few. There is no special initialization required in lua and you can use as ! much or as little of wxWidgets as you like. ! <h2><a name="Version_Information"></a><u>Version Information</u></h2> ! <ul> <li>Lua 5.1.2</li> <ul> <li>wxLua uses an unmodified copy of Lua 5.1.2</li> <li>Any program that works using the official ! release of lua will work in wxLua.</li> </ul> <li>wxWidgets 2.8.3 (>= 2.6.3)</li> <ul> <li>The interface files have #ifdefs for 2.4, but --- 37,58 ---- manipulation, sockets, displaying HTML, and printing to name a few. There is no special initialization required in lua and you can use as ! much or as little of wxWidgets as you like.<br><h3>References:</h3> ! <a href="http://wxlua.sourceforge.net">http://wxlua.sourceforge.net</a> ! : wxLua website<br> ! <a href="http://www.lua.org">http://www.lua.org</a> ! : Lua website<br> ! <a href="http://www.wxwidgets.org">http://www.wxwidgets.org</a> ! : wxWidgets website<br> ! wxl...@li... : User and developer mailing list<br><h2 style="text-decoration: underline;">Contents</h2><ol><li><a href="#Version_Information">Version Information</a></li><li><a href="#wxLua_Requirements">Requirements</a></li><li><a href="#Introduction_to_Lua_very_brief">Introduction to Lua ! (very brief)</a></li><li><a href="#wxLua_Programming_in_Lua">Programming in wxLua</a></li><li><a href="#wxLua_Samples">wxLua Samples and How to Run Them</a></li><ol><li><a href="#How_to_run_the_samples">How to Run the Samples</a></li><li><a href="#Provided_samples">Provided Samples</a></li></ol><li><a href="#wxLua_Applications">wxLua Applications</a></li><ol><li><a href="#wxLua">wxLua</a></li><li><a href="#wxLuaFreeze">wxLuaFreeze</a></li><li><a href="#wxLuaEdit">wxLuaEdit</a></li></ol><li><a href="#wxLua_Utils">wxLua Utils</a></li><ol><li><a href="#bin2c.lua">bin2c.lua</a></li><li><a href="#wrapmodule.wx.lua">wrapmodule.wx.lua</a></li></ol><li><a href="#wxLua_Sourcecode_Modules">wxLua Sourcecode Modules</a></li><li><a href="#wxLua_Programming_in_C">wxLua C++ Programming Guide</a><br></li></ol><h2><a name="Version_Information"></a><u>Version Information</u></h2> ! <ul> <li>The wxLua ! version number is set to the stable version of ! wxWidgets that it has been updated to. It should also compile with ! newer versions of wxWidgets as well as older ones.</li><li>Lua ! 5.1.2</li> <ul> <li>wxLua uses an unmodified copy of Lua 5.1.2</li> <li>Any program that works using the official ! release of Lua will work in wxLua.</li> </ul> <li>wxWidgets 2.8.3 (>= 2.6.3)</li> <ul> <li>The interface files have #ifdefs for 2.4, but *************** *** 51,63 **** take advantage of the fixes and additions to newer versions of wxWidgets. With a little work you may be able to resurrect it to ! work. </li> <li>Note for wxWidgets < 2.9 : wxLua makes use of the wxStyledTextCtrl contrib library in wxWidgets/contrib/src/stc. You need to have compiled this into a library if you want to compile the wxLua apps. In wxWidgets >= ! 2.9 the wxStyledTextCtrl is now part of the main library.</li> </ul> ! <li>wxLua ! version number is set to the stable version of ! wxWidgets that it has been updated to. It should also compile with ! newer versions of wxWidgets as well as older ones. </li> </ul><h2><a name="wxLua_Requirements"></a><u>Requirements</u></h2> An end user of wxLua can use the binary packages of wxLua and --- 61,73 ---- take advantage of the fixes and additions to newer versions of wxWidgets. With a little work you may be able to resurrect it to ! work with wxWidgets 2.4. </li> <li>Note for wxWidgets ! < 2.9 : wxLua makes use of the wxStyledTextCtrl contrib library in wxWidgets/contrib/src/stc. You need to have compiled this into a library if you want to compile the wxLua apps. In wxWidgets >= ! 2.9 the wxStyledTextCtrl is now part of the main library.</li><li>The ! wxLua library links to these wxWidgets libs: stc, xrc, html, media, ! adv, net, xml, core, base, tiff, jpeg, png, zlib, regex, expat.</li><li>See ! install.html for more information.</li></ul> </ul><h2><a name="wxLua_Requirements"></a><u>Requirements</u></h2> An end user of wxLua can use the binary packages of wxLua and *************** *** 540,544 **** </ul></ul><h2><a name="wxLua_Samples"></a><u><u>wxLua Samples and How to Run Them</u></u></h2> ! There are a number of sample programs in the <i>samples</i> directory. These programs demonstrate how to write simple programs and try to show how to use some of the many classes of wxWidgets. They are --- 550,554 ---- </ul></ul><h2><a name="wxLua_Samples"></a><u><u>wxLua Samples and How to Run Them</u></u></h2> ! There are a number of sample programs in the <i style="font-style: italic;">wxLua/samples</i> directory. These programs demonstrate how to write simple programs and try to show how to use some of the many classes of wxWidgets. They are *************** *** 568,572 **** sample.wx.lua</span></li><li>Open the program in <span style="font-weight: bold;">wxlua.exe</span> and choose the menu item Run.</li><li>Open the program in <span style="font-weight: bold;">wxluaedit.exe</span> and ! press the |> play 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 --- 578,583 ---- sample.wx.lua</span></li><li>Open the program in <span style="font-weight: bold;">wxlua.exe</span> and choose the menu item Run.</li><li>Open the program in <span style="font-weight: bold;">wxluaedit.exe</span> and ! select the menu item wxLua->Run or press the toolbar "play" ! 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 *************** *** 608,612 **** function when wxLua is compiled as a shared library. Run this program using the lua executable and not wxLua or wxLuaFreeze since the wxLua ! library is loaded at run-time. See also <a href="#wrapmodule.wx.lua">wrapmodule.wx.lua</a> for more information about loading lua modules.</li></ul><li><b>mdi.wx.lua</b></li> <ul><li>Shows the MDI classes, wxMDIParentFrame and wxMDIChildFrame.</li> --- 619,624 ---- function when wxLua is compiled as a shared library. Run this program using the lua executable and not wxLua or wxLuaFreeze since the wxLua ! library is loaded at run-time. See also <a href="#wrapmodule.wx.lua">wrapmodule.wx.lua</a> ! for more information about loading lua modules.</li></ul><li><b>mdi.wx.lua</b></li> <ul><li>Shows the MDI classes, wxMDIParentFrame and wxMDIChildFrame.</li> *************** *** 642,646 **** </ul></ul><h2><a name="wxLua_Applications"></a><u>wxLua Applications</u></h2> ! The applications that wxLua provides are in the apps directory. These are C++ programs that are compiled against the wxWidgets library and the wxWidgets wxStyledTextCtrl library. <br> --- 654,659 ---- </ul></ul><h2><a name="wxLua_Applications"></a><u>wxLua Applications</u></h2> ! The applications that wxLua provides are in the <span style="font-style: italic;">wxLua/apps</span> ! directory. These are C++ programs that are compiled against the wxWidgets library and the wxWidgets wxStyledTextCtrl library. <br> *************** *** 785,789 **** </ul><h2><a name="wxLua_Utils"></a><u>wxLua Utils</u></h2> ! Utility programs for wxLua are located in the <i>util</i> directory. <ul> <li><h3><a name="bin2c.lua"></a>bin2c.lua</h3></li> --- 798,802 ---- </ul><h2><a name="wxLua_Utils"></a><u>wxLua Utils</u></h2> ! Utility programs for wxLua are located in the <i>wxLua/util</i> directory. <ul> <li><h3><a name="bin2c.lua"></a>bin2c.lua</h3></li> *************** *** 822,828 **** source code of lua itself. It is the original ! source for the version, with some of the header files copied to the ! include directory for the installation routines. </li> </ul> ! <li><b>wxbind</b></li> <ul> <li>The output of the interface files in <i>wxLua/bindings/wxwidgets</i> are generated in this directory. They are the wrappers to the wxWidgets --- 835,844 ---- source code of lua itself. It is the original ! unmodified source for the version, with some of the header files copied ! to the ! include directory for the installation routines. Patches released for ! the version are applied as they come out, see <span style="font-style: italic;">wxLua/docs/changelog.txt</span>. ! </li> </ul><li><b>wxbind</b></li> <ul> ! <li>The output of the interface files in <i>wxLua/bindings/wxwidgets</i> are generated in this directory. They are the wrappers to the wxWidgets *************** *** 861,871 **** the wxlua app.</li> <li>This lib depends on the wxluadebug lib.</li> </ul> ! </ul><h2><a name="wxLua_Programming_in_C"></a><u>wxLua C++ <u>Programming Guide</u></u></h2> The documentation for the wxLua library is in the header files and descriptions are given for each function, enum, etc. Please read through them to get a feel for ! what functions wxLua provides, but note that most of them are for ! internal use and are not generally useful. Below is just a quick synopsis of wxLua for C++ programmers.<br> <br>Lua uses char strings while wxWidgets uses the wxString class --- 877,887 ---- the wxlua app.</li> <li>This lib depends on the wxluadebug lib.</li> </ul> ! </ul><h2><a name="wxLua_Programming_in_C"></a><u>wxLua ! C++ <u>Programming Guide</u></u></h2> The documentation for the wxLua library is in the header files and descriptions are given for each function, enum, etc. Please read through them to get a feel for ! what functions wxLua provides. Below is a quick synopsis of wxLua for C++ programmers.<br> <br>Lua uses char strings while wxWidgets uses the wxString class *************** *** 881,885 **** wxLuaState derived from the wxWidget's wxObject class. The wxLuaState class ! contains as a member of it's ref data the 'C' lua_State which is the heart of lua. Since the class is ref counted, it should be passed as <i>const wxLuaState&</i> and can be used in much --- 897,902 ---- wxLuaState derived from the wxWidget's wxObject class. The wxLuaState class ! contains as a member of it's ref data the 'C' lua_State struct which is ! the heart of lua. Since the class is ref counted, it should be passed as <i>const wxLuaState&</i> and can be used in much *************** *** 909,934 **** easier to find in an editor. If you want the greatest performance just use wxLuaState::GetLuaState() and directly manipulate the ! returned lua_State. <br> <br>It is instructive to follow the creation of the wxLuaState by looking at bool wxLuaState::Create(wxEvtHandler *handler, wxWindowID id) in ! <i>wxLua/modules/wxlua/src/wxlstate.cpp</i>. The lua_State is created using ! lua_open() and then the lua libraries are loaded, base, table, string, ! math, and so on. The C lua_State is added to a hash table to allow looking up the owner wxLuaStateRefData when lua calls the C wxLua ! functions. A wxLua registry is created in lua's registry table. We ! register a print function to get the output of lua print() statements to send messages as wxLuaEvents, see ! wxEVT_LUA_PRINT. Finally the bindings are registered using ! derived versions of the wxLuaBinding class by iterating ! through the wxLuaBinding::GetBindingList() which has been filled by ! calling the wxLuaBinding_XXX_init() functions, see above about the ! wxbind module. 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 lua tag and if ! you change the bindings and create a new wxLuaState any previously ! created wxLuaStates will lookup classes using the wrong tags.<br> ! <br><b>Creating a wxLuaState</b><br> <ul> <li>wxLuaState(bool create = false)</li> <ul> <li>If create is false, default constructor, you must call --- 926,980 ---- easier to find in an editor. If you want the greatest performance just use wxLuaState::GetLuaState() and directly manipulate the ! returned pointer to the lua_State. <br> <br>It is instructive to follow the creation of the wxLuaState by looking at bool wxLuaState::Create(wxEvtHandler *handler, wxWindowID id) in ! <i>wxLua/modules/wxlua/src/wxlstate.cpp</i>.<br><ol><li>The ! wxObject::m_refData is created as a new wxLuaStateRefData(). This ref ! data class contains a pointer to the lua_State struct and to a shared ! wxLuaStateData class that is also created. If a lua program running in ! this wxLuaState creates coroutines, each will ! have their own wxLuaStateRefData and associated lua_State, but they ! will all share the same wxLuaStateData class. </li><li>The ! lua_State is created using ! lua_open() and then the standard lua libraries are loaded, base, table, ! string, ! math, and so on using luaL_openlibs(L). The C lua_State is added to a ! hash table to allow looking up the owner wxLuaStateRefData when lua calls the C wxLua ! binding functions with the lua_State as the only parameter. The ! wxLuaStateRefData is also pushed into the ! LUA_REGISTRYINDEX table as a lightuserdata using the ! "__wxLuaStateRefData key" as a secondary means to find the wxLuaState ! "owner" of the lua_State.</li><li>A wxLua registry is ! created in lua's LUA_REGISTRYINDEX table with the ! "wxLuaReferences" key. Items in this table are unique integer keys used ! to identify the wxWidgets (or other) classes used as userdata ! in wxLua. It is also used to store references to data that is not to be ! garbage collected until the reference is released.</li><li>We ! register a print() function for lua to get the output of lua print() statements to send messages as wxLuaEvents, see ! wxEVT_LUA_PRINT. </li><li>The bindings are ! registered by calling wxLuaState::RegisterBindings(true). </li><ul><li>Each ! binding that is loaded is a copy of derived wxLuaBinding ! classes that are installed when the wxLuaBinding_XXX_init() functions ! are called when the application is initialized (see above about the ! wxbind module). </li><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 lua tag 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 ! tags.</li></ul><li>Each binding has ! wxLuaBinding::RegisterBinding(...) called for it.</li><ul><li>wxLuaBinding::RegisterFunctions(...) ! is called </li><li>A "namespace" table in lua (eg. wx) is ! created if necessary and a tag in the wxLuaRegistry is associated with ! it.</li><li>wxLuaBinding::RegisterGeneratedClasses() is ! called to actually push the bindings into lua.</li></ul><li>At ! the end of creation a wxLuaEvent is sent with the wxEVT_LUA_CREATION ! event type.</li></ol><b>Functions to ! Create a wxLuaState</b><br> <ul> <li>wxLuaState(bool create = false)</li> <ul> <li>If create is false, default constructor, you must call *************** *** 971,974 **** things up for wxLua first.</li> <li>Returns lua's error code LUA_ERRXXX or 0 on sucess</li> </ul> <li>The ! other functions are documented in wxlstate.h.</li> </ul></body></html> \ No newline at end of file --- 1017,1020 ---- things up for wxLua first.</li> <li>Returns lua's error code LUA_ERRXXX or 0 on sucess</li> </ul> <li>The ! other functions 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 Index: binding.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/binding.html,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** binding.html 9 Mar 2007 00:16:18 -0000 1.15 --- binding.html 3 May 2007 21:05:33 -0000 1.16 *************** *** 1,38 **** <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html> ! <head> ! ! ! ! <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> ! ! ! [...2418 lines suppressed...] %__WXMOTIF20__<br> %__WXMAC__<br> %__WXMAC_CLASSIC__<br> %__WXMAC_CARBON__<br> %__WXMAC_OSX__<br> %__WXMGL__<br> %__WXMSW__<br> %__WXOS2__<br> %__WXOSX__<br> %__WXPALMOS__<br> %__WXPM__<br> %__WXSTUBS__<br> %__WXXT__<br> %__WXX11__<br> %__WXWINE__<br> %__WXUNIVERSAL__<br> %__X__<br> %__WXWINCE__<br> ! <br></body></html> \ No newline at end of file |