From: John L. <jr...@us...> - 2007-06-25 03:20:18
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv32516/wxLua/docs Modified Files: FAQ.html binding.html changelog.txt wxluaref.html Log Message: Add %gc, %ungc, %gc_this, and %ungc_this for fine tuning of tracking or releasing the garbage collection of userdata objects that become owned or released by something other than wxLua. Added %delete to many more classes using the above tags to control when and if they should be deleted. Index: wxluaref.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxluaref.html,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** wxluaref.html 20 Jun 2007 22:57:34 -0000 1.31 --- wxluaref.html 25 Jun 2007 03:19:38 -0000 1.32 *************** *** 119,127 **** <td>Interchangeable with a numeric indexed lua table <tr> - <td><a href="#wxArrayTreeItemIds">wxArrayTreeItemIds</a> - <td bgcolor=FFAAAA> - <td align="center" bgcolor=AAFFAA>X - <td> - <tr> <td><a href="#wxArrayVideoModes">wxArrayVideoModes</a> <td bgcolor=FFAAAA> --- 119,122 ---- [...5752 lines suppressed...] <br> --- 22839,22843 ---- </font></blockquote><font color=#DD0000><font color=#DD0000><i>%endstruct</i></font></font><font color=#888888><br> <br> ! */</font><br> <br> <br> *************** *** 22763,22767 **** <br> <a href="#wxString">wxString</a> GetLuaTagName(int tag) const<br> ! </font>*/<br> </blockquote><font color=#DD0000><font color=#DD0000><i>%endclass</i></font></font><br> <br> --- 22869,22873 ---- <br> <a href="#wxString">wxString</a> GetLuaTagName(int tag) const<br> ! */</font><br> </blockquote><font color=#DD0000><font color=#DD0000><i>%endclass</i></font></font><br> <br> Index: changelog.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/changelog.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** changelog.txt 16 Jun 2007 06:21:43 -0000 1.37 --- changelog.txt 25 Jun 2007 03:19:38 -0000 1.38 *************** *** 109,112 **** --- 109,116 ---- it always created it's ref data even if it wasn't used. + - Add %gc, %ungc, %gc_this, and %ungc_this tags for fine tuning of tracking + and releasing userdata objects by functions that take ownership of the data + or release it. + version 2.8.0.0 (released 24/12/2006) -------------------------------------------------------------------- Index: binding.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/binding.html,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** binding.html 14 Jun 2007 23:59:42 -0000 1.22 --- binding.html 25 Jun 2007 03:19:38 -0000 1.23 *************** *** 1,10 **** <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html><head> ! <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua Binding HowTo</title> ! <meta content="John Labenski" name="author"></head> ! <body><h2><u>wxLuaBinding - writing and generating the binding files</u> ! </h2><div style="text-align: justify;">The binding generator for wxLua provides information for lua code to [...2351 lines suppressed...] %__WXPM__<br> + %__WXSTUBS__<br> + %__WXXT__<br> + %__WXX11__<br> + %__WXWINE__<br> + %__WXUNIVERSAL__<br> + %__X__<br> + %__WXWINCE__<br> ! ! <br> ! ! </body> ! </html> Index: FAQ.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/FAQ.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FAQ.html 17 Jun 2007 17:17:38 -0000 1.2 --- FAQ.html 25 Jun 2007 03:19:38 -0000 1.3 *************** *** 1,64 **** <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html><head> ! <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua FAQ</title> ! <meta content="John Labenski" name="author"></head> ! <body><h2><u>wxLua FAQ</u></h2> ! <ol> <li><a href="#Why_wxLua">Why wxLua?</a></li> ! <ol> <li><a href="#Whats_best_for_my_needs:_wxLua">What's best for my needs: wxLua, wxPython, wxSomethingElse?</a></li> ! <li><a href="FAQ.html#Can_I_use_wxLua_as_script_interpreter">Can I use wxLua as script interpreter embedded in my own C++ applications?</a></li> ! </ol> <li><a href="#Programming_in_wxLua">Programming ! in wxLua</a></li><ol><li><a href="#wxStrings">wxStrings?</a></li><li><a href="#wxArrayString_and_wxSortedArrayString">wxArrayString and wxSortedArrayString?</a></li><li><a href="#wxArrayInt">wxArrayInt?</a></li><li><a href="#When_and_how_should_you_delete_objects">When and how should you delete() objects?</a></li><li><a href="#Why_do_the_samples_use_the_function">Why do the samples use the function main() is it special to wxLua?</a></li></ol> ! </ol><hr size="2" width="100%"> ! <ol> <li> <h3><a name="Why_wxLua"></a>Why ! wxLua?</h3> </li> <ul> <li>Because the Lua ! language is easy and "fun" to program in. </li> <li>It vaguely looks like BASIC or C which many people are familiar with.</li> ! <li>The code is very readable, almost no special ! notation, gotchas, or oddball constructs that require a large ! shift in thinking from BASIC or C.</li> <li>Size : The Lua interpreter itself is ~100Kb, wxWidgets adds the remaining few Mb.</li> ! <li>Speed : Lua is one of the fastest interpreted languages, see ! the Great Computer Language Shootout.</li> <li>Again, why ! Lua? See <a href="http://www.lua.org/about.html">http://www.lua.org/about.html</a></li></ul><ol><li><h4><a name="Whats_best_for_my_needs:_wxLua"></a>What's best ! for my needs: wxLua, wxPython, wxSomethingElse?</h4></li><ol> ! <ol> </ol></ol><ul><li>It depends: wxPython has a much larger footprint and greater overhead than wxLua, but it does provide more add-ons from the Python standard ! library.</li><li>On the other hand, wxLua is as large as ! the wxWidgets library + ~100Kb for Lua + ~500Kb for the wxLua ! library.</li><li>wxLua can be easily interfaced with C++ code making it a powerful ! extension language, which is exactly the intent of its ! designers.</li><li>In conclusion, if you want to write an entire application in a scripting language and you need things supported by Python which are not present in wxLua out-of-the-box, then you should use wxPython. Instead, if you want to write applications with little overhead or ! extend your C++ applications, go for wxLua.</li></ul><li><h4><a name="Can_I_use_wxLua_as_script_interpreter"></a>Can I ! use wxLua as script interpreter embedded in my own C++ applications?</h4></li><ul><li>Yes! ! That's explained on the wxLua homepage. </li><li>This is one of the strong points of wxLua: it can be a lightweight, fast interpreter to extend ! your application and let the user customize it... </li><li>You may create as ! many wxLua interpreters in a single program as you like.</li> </ul></ol><li><h3><a name="Programming_in_wxLua"></a>Programming in wxLua</h3></li><ol><li><h4><a name="wxStrings"></a>wxStrings?</h4></li><ul><li>wxLua uses Lua strings and so all functions that take or return a wxString take or return a Lua string.</li><li>However, you can also use a wxString is you really want.</li></ul><li><h4><a name="wxArrayString_and_wxSortedArrayString"></a>wxArrayString and wxSortedArrayString?</h4></li><ul><li>All functions that take a wxArrayString or wxSortedArrayString can also take a numerically indexed table of strings.</li><li>Functions that return wxArrayStrings or wxSortedArrayStrings will return a wxArrayString or wxSortedArrayString unless specified otherwise in ! wxluaref.html</li></ul><li><h4><a name="wxArrayInt"></a>wxArrayInt?</h4></li><ul><li>All functions that take a wxArrayInt can also take a numerically indexed table of numbers.</li><li>Functions that return wxArrayInts will return a wxArrayInt unless specified otherwise in wxluaref.html.</li></ul><li><h4><a name="When_and_how_should_you_delete_objects"></a>When and how should you delete() objects?</h4></li><ul><li>You should read the section "C++ Classes ! CLASS_NAME" in the "Programming in wxLua" in the wxlua.html manual.</li><li>In short, all objects that you create that deal with graphics should be ! deleted as soon as they're no longer used. Functions that take a "const ! wxPen& pen" or any wxObject derived class that is passed ! to a function that is const and not a pointer* will make a refed ! copy of them and so you may delete them.</li><li>Use the wxLua added function delete() to delete them.</li><li>Use the function "table = wxlua.GetTrackedUserdata()" to get a table of ! items that are tracked and occasionally print them out while developing ! a program.</li></ul><li><h4><a name="Why_do_the_samples_use_the_function"></a>Why do the samples use the function main() is it special to wxLua?</h4></li><ul><li>There's nothing special about the function main() other than that it's a common name for an entry point into a program.</li><li>It is often helpful and a good idea to encapsulate the program initialization code within a function so that you can use local variables and not pollute the global table with temporary variables ! that won't be needed again.</li><li>Additionally, it allows you to break out of this initialization code at any point by putting <span style="font-style: italic;">"do return end"</span> inside of the function for debugging, as opposed to wrapping parts you don't want using <span style="font-style: italic;">"if false then ... end"</span>.</li></ul></ol><ol><ol> ! </ol></ol><ul> </ul> </ol></body></html> \ No newline at end of file --- 1,322 ---- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html> ! <head> ! ! <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> ! <title>wxLua FAQ</title> ! ! ! <meta content="John Labenski" name="author"> ! ! </head> ! ! <body> ! ! <h2><u>wxLua FAQ</u></h2> ! ! <ol> ! ! <li><a href="#Why_wxLua">Why wxLua?</a></li> ! ! <ol> ! ! <li><a href="#Whats_best_for_my_needs:_wxLua">What's best for my needs: wxLua, wxPython, wxSomethingElse?</a></li> ! ! <li><a href="FAQ.html#Can_I_use_wxLua_as_script_interpreter">Can I use wxLua as script interpreter embedded in my own C++ applications?</a></li> ! ! </ol> ! ! <li><a href="#Programming_in_wxLua">Programming ! in wxLua</a></li> ! ! <ol> ! ! <li><a href="#wxStrings">wxStrings?</a></li> ! ! <li><a href="#wxArrayString_and_wxSortedArrayString">wxArrayString ! and wxSortedArrayString?</a></li> ! ! <li><a href="#wxArrayInt">wxArrayInt?</a></li> ! ! <li><a href="#When_and_how_should_you_delete_objects">When ! and how should you delete() objects?</a></li> ! ! <li><a href="#Why_do_the_samples_use_the_function">Why ! do the samples use the function main() is it special to wxLua?</a></li> ! ! <li><a href="#Why_are_the_error_messages_for_a_class">Why ! are the error messages for class member function calls shifted ! +1?</a></li> ! ! </ol> ! ! </ol> ! ! <hr size="2" width="100%"> ! <ol> ! ! <li> ! <h3><a name="Why_wxLua"></a>Why ! wxLua?</h3> ! ! </li> ! ! <ul> ! ! <li>Because the Lua ! language is easy and "fun" to program in. </li> ! ! <li>It vaguely looks like BASIC or C which many people are familiar with.</li> ! ! <li>The code is very readable, almost no special ! notation, gotchas, or oddball constructs that require a large ! shift in thinking from BASIC or C.</li> ! ! <li>Size : The Lua interpreter itself is ~100Kb, wxWidgets adds the remaining few Mb.</li> ! ! <li>Speed : Lua is one of the fastest interpreted languages, ! see ! the Great Computer Language Shootout.</li> ! ! <li>Again, why ! Lua? See <a href="http://www.lua.org/about.html">http://www.lua.org/about.html</a></li> ! ! </ul> ! ! <ol> ! ! <li> ! <h4><a name="Whats_best_for_my_needs:_wxLua"></a>What's ! best ! for my needs: wxLua, wxPython, wxSomethingElse?</h4> ! ! </li> ! ! <ol> ! ! <ol> ! ! </ol> ! ! </ol> ! ! <ul> ! ! <li>It depends: wxPython has a much larger footprint and greater overhead than wxLua, but it does provide more add-ons from the Python standard ! library.</li> ! ! <li>On the other hand, wxLua is as large as ! the wxWidgets library + ~100Kb for Lua + ~500Kb for the wxLua ! library.</li> ! ! <li>wxLua can be easily interfaced with C++ code making it a powerful ! extension language, which is exactly the intent of its ! designers.</li> ! ! <li>In conclusion, if you want to write an entire application in a scripting language and you need things supported by Python which are not present in wxLua out-of-the-box, then you should use wxPython. Instead, if you want to write applications with little overhead or ! extend your C++ applications, go for wxLua.</li> ! ! </ul> ! ! <li> ! <h4><a name="Can_I_use_wxLua_as_script_interpreter"></a>Can ! I ! use wxLua as script interpreter embedded in my own C++ applications?</h4> ! ! </li> ! ! <ul> ! ! <li>Yes! ! That's explained on the wxLua homepage. </li> ! ! <li>This is one of the strong points of wxLua: it can be a lightweight, fast interpreter to extend ! your application and let the user customize it... </li> ! ! <li>You may create as ! many wxLua interpreters in a single program as you like.</li> ! ! </ul> ! ! </ol> ! ! <li> ! <h3><a name="Programming_in_wxLua"></a>Programming ! in wxLua</h3> ! ! </li> ! ! <ol> ! ! <li> ! <h4><a name="wxStrings"></a>wxStrings?</h4> ! ! </li> ! ! <ul> ! ! <li>wxLua uses Lua strings and so all functions that take ! or return a wxString take or return a Lua string.</li> ! ! <li>However, you can also use a wxString is you really want.</li> ! ! </ul> ! ! <li> ! <h4><a name="wxArrayString_and_wxSortedArrayString"></a>wxArrayString ! and wxSortedArrayString?</h4> ! ! </li> ! ! <ul> ! ! <li>All functions that take a wxArrayString or ! wxSortedArrayString can also take a numerically indexed table of ! strings.</li> ! ! <li>Functions that return wxArrayStrings or wxSortedArrayStrings will return a wxArrayString or wxSortedArrayString unless specified otherwise in ! wxluaref.html</li> ! ! </ul> ! ! <li> ! <h4><a name="wxArrayInt"></a>wxArrayInt?</h4> ! ! </li> ! ! <ul> ! ! <li>All functions that take a wxArrayInt can also take a ! numerically indexed table of numbers.</li> ! ! <li>Functions that return wxArrayInts will return a ! wxArrayInt unless specified otherwise in wxluaref.html.</li> ! ! </ul> ! ! <li> ! <h4><a name="When_and_how_should_you_delete_objects"></a>When ! and how should you delete() objects?</h4> ! ! </li> ! ! <ul> ! ! <li>You should read the section "C++ Classes ! CLASS_NAME" in the "Programming in wxLua" in the wxlua.html manual.</li> ! ! <li>In short, all objects that you create that deal with graphics should be ! delete()ed as soon as they're no longer used. Functions that take a ! "const ! wxPen& pen" or any wxObject derived class ! that are passed ! to a function that is const and not a pointer* will make a ! refed ! copy of them and so you may delete them.</li> ! ! <li>Use the function "table = wxlua.GetTrackedUserdata()" to get a table of ! items that are tracked and occasionally print them out while developing your program.</li> ! ! <li>Class objects that have the <i>%delete</i> ! tag in their declaration (see wxluaref.html) will be automatically ! garbage collected or can be delete()ed with a wxLua added function for ! the class. There are, of course, exceptions and these occur when you ! pass the object to a function with the <i>%ungc</i> tag on ! the parameter you pass the object to. The ungarbage collect tag ! specifies that the object is now owned by something else and you can no ! longer delete it in wxLua.</li> ! ! <li>Bottom line - don't worry about delete()ing anything ! except graphics objects (for MSW really) or classes that specifically ! state (in wxluaref.html) that you should delete() them because the ! garbage collector may not do so soon enough.</li> ! ! </ul> ! ! <li> ! <h4><a name="Why_do_the_samples_use_the_function"></a>Why ! do the samples use the function main() is it special to wxLua?</h4> ! ! </li> ! ! <ul> ! ! <li>There's nothing special about the function main() other ! than that it's a common name for an entry point into a program.</li> ! ! <li>It is often helpful and a good idea to encapsulate the program initialization code within a function so that you can use local variables and not pollute the global table with temporary variables ! that won't be needed again.</li> ! ! <li>Additionally, it allows you to break out of this ! initialization code at any point by putting <span style="font-style: italic;">"do return end"</span> ! inside of the function for debugging, as opposed to wrapping parts you ! don't want using <span style="font-style: italic;">"if ! false then ... end"</span>.</li> ! ! </ul> ! ! <li> ! <h4><a name="Why_are_the_error_messages_for_a_class"></a>Why ! are the error messages for class member function calls shifted ! +1?</h4> ! ! </li> ! ! <ul> ! ! <li>Because the ':' calling convention is syntaxic sugar ! for putting the 'self' as the first parameter.</li> ! ! <li><i>s = wx.wxSize(1, 2); s:Set(3, 4)</i> ! is the same as <i>s.Set(s, 3, 4)</i> and the ! first parameter is always the self, therefore <i>s.Set(s, ! "hello", 4)</i> will give an error that parameter 2 is not a ! number.</li> ! ! <li>Unfortunately there is no way to tell whether the user ! has used the '.' or ':' calling convention and so the error message ! cannot be tailored for both static and nonstatic call member ! functions.</li> ! ! </ul> ! ! </ol> ! ! <ol> ! ! <ol> ! ! </ol> ! ! </ol> ! ! <ul> ! ! </ul> ! ! </ol> ! ! </body> ! </html> |