From: John L. <jr...@us...> - 2006-05-17 22:47:19
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27493/wxLua/docs Modified Files: binding.html Log Message: change enum wxClass::XXX to be accessed as wxClass_XXX added %staticonly keyword for classes that only have static members Index: binding.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/binding.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** binding.html 3 May 2006 22:52:17 -0000 1.9 --- binding.html 17 May 2006 22:47:09 -0000 1.10 *************** *** 20,24 **** <div style="text-align: justify;"> The bindings for wxLua provide information for lua code to interface ! with a C/C++ API. C/C++ objects can be created in lua as userdata and manipulated using the same functional semantics as you would in C/C++. <br> --- 20,24 ---- <div style="text-align: justify;"> The bindings for wxLua provide information for lua code to interface ! with 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++. <br> *************** *** 61,65 **** </div> - <br> <h2><u>Binding File Descriptions</u></h2> --- 61,64 ---- *************** *** 100,104 **** Constructs" below.</li> ! <li style="text-align: justify;">In wxLua the structure tries to follow the wxWidgets documentation, typically alphabetical.</li> --- 99,103 ---- Constructs" below.</li> ! <li style="text-align: justify;">In wxLua, the structure tries to follow the wxWidgets documentation, typically alphabetical.</li> *************** *** 106,110 **** <li style="text-align: justify;">Class constructors ! first, class member functions, operators, %members, %properties.</li> --- 105,109 ---- <li style="text-align: justify;">Class constructors ! first, class member functions, %operators, %members, %properties.</li> *************** *** 175,178 **** --- 174,197 ---- </ul> + <li>In order for the %overload functionality to work and to get + the proper signatures; the function parameters in the .i file should + match the actual parameters that the %override code implements. In the + interface files for wxLua always have these three lines, where the + first line is for documentation purposes only, the second line is the + original function call for reference purposes to compare what wxWidgets + expects to to get, and the third line is correct calling semantics for + the %overridden function.</li> + + <ul> + + <li>// %override void wxFrame::SetStatusWidths(lua table with + number indexes and values)</li> + + <li>//virtual void SetStatusWidths(int n, int *widths)</li> + + <li>virtual void SetStatusWidths(LuaTable intTable)</li> + + </ul> + </ul> *************** *** 186,189 **** --- 205,209 ---- <li><i><b>const wxArrayString_FromLuaTable& + choices </b>or just</i><i><b>wxArrayString_FromLuaTable choices</b></i></li> *************** *** 197,200 **** --- 217,248 ---- </ul> + <li><i><b>const wxArrayInt_FromLuaTable& + choices </b>or just</i><i><b>wxArrayInt_FromLuaTable + choices</b></i></li> + + <ul> + + <li>The binding generator will read from lua a + table of ints for that parameter and convert them into a + wxArrayInt for the C++ + function.</li> + + </ul> + + <li><i><b>LuaTable tableName</b></i></li> + + <ul> + + <li>The "datatype" LuaTable does not actually exist, but is + used exclusively for %overridden functions in the .i interface files. + It directs the binding generator to expect a lua table for that + parameter. Note that you absolutely must have overrriden this function + as the code it generates will generate errors.</li> + + <li>This is useful for functions like + wxFrame::SetStatusWidths as shown above.</li> + + </ul> + </ul> *************** *** 208,212 **** <ul> ! <li>This tag is ignored since it's mostly for C++ member function calls inside other const member functions or when a variable is passed as const to a function which cannot be specified in --- 256,260 ---- <ul> ! <li>This tag is ignored since it's mostly for C++ member function calls inside other const member functions or when a variable is passed as const to a function which cannot be specified in *************** *** 229,234 **** <ul> ! <li>Example : In the %class wxFileName the function ! <i>"static wxFileName DirName(const wxString& dir)"</i></li> --- 277,282 ---- <ul> ! <li>Example : In the %class wxFileName the function <i>"static ! wxFileName DirName(const wxString& dir)"</i></li> *************** *** 240,243 **** --- 288,300 ---- </ul> + <li>For many classes it is not necessary to specify the full + %static capability, as it generates more binding code. + Oftentimes the user will probably have already created the + object for some other purpose or the object is small and creating a + dummy object just to run the static function would + not be a problem.<br> + + </li> + </ul> *************** *** 297,301 **** derived classes. <br> ! <i><b>%encapsulate</b></i> is for all classes that are not wxObject derived to aid in deleting them.<br> --- 354,359 ---- derived classes. <br> ! <i><b>%encapsulate</b></i> is for <b>all</b> ! classes that are not wxObject derived to aid in deleting them.<br> *************** *** 382,386 **** Note: Why not use wxString? You can't get the data from a wxString if you need to convert from Unicode ! and VC has problems having a wxString as a member of a struct.<br> <br> --- 440,444 ---- Note: Why not use wxString? You can't get the data from a wxString if you need to convert from Unicode ! and VC has problems having the class wxString as a member of a struct.<br> <br> *************** *** 431,440 **** </b><b><i>%include "headerfile.h"</i><br> ! </b>Include a header file by generating the C code <i>#include "headerfile.h"</i>. <br> <b><br> ! </b><b><i>%includefile interfacefile.i</i><br> </b>Includes another wrapper file --- 489,499 ---- </b><b><i>%include "headerfile.h"</i><br> ! </b>Include a C/C++ header file by generating the C code <i>#include "headerfile.h"</i>. <br> <b><br> ! </b><b><i>%includefile interfacefile.i - DEPRECATED ! and probably does not work</i><br> </b>Includes another wrapper file *************** *** 636,645 **** is a static function and moreover that a global function named <i>ClassName_ClassMemberFunction(...)</i> should be created as well. The function can be accessed as <i>wx.ClassName_ClassMemberFunction</i> ! and as <i>classInstance:ClassName_ClassMemberFunction</i>. Note that just using "static" without the % creates the latter function that requires an instance of the class to call. An example of when it doesn't make sense to create the two <i>%static</i> methods is for classes like wxFileName. wxFileName has a small ! memory footprint it's better to just create an instance of it temporarily to call the statiic functions rather than bloat the bindings with unnecessary global functions.<br> --- 695,704 ---- is a static function and moreover that a global function named <i>ClassName_ClassMemberFunction(...)</i> should be created as well. The function can be accessed as <i>wx.ClassName_ClassMemberFunction</i> ! and as <i>classInstance:ClassMemberFunction</i>. Note that just using "static" without the % creates the latter function that requires an instance of the class to call. An example of when it doesn't make sense to create the two <i>%static</i> methods is for classes like wxFileName. wxFileName has a small ! memory footprint so it's better to just create an instance of it temporarily to call the statiic functions rather than bloat the bindings with unnecessary global functions.<br> *************** *** 647,650 **** --- 706,721 ---- <br> + <i><b>%staticonly var_type ClassMemberFunction(...)</b></i><br> + + Declare to the binding generator that the <i>ClassMemberFunction</i> + is a static function and that ONLY a global function named <i>ClassName_ClassMemberFunction(...)</i> + should be created. This means that the you will be unable to access the + function as <i>classInstance:ClassMemberFunction</i>. + This is rarely useful, but some wxWidgets classes such as wxSystemInfo, + wxSystemSettings, and others only have static member functions + and so you never actually create an instance of the class, even in C++.<br> + + <br> + <i><b>%typedef UNKNOWN_CLASS KNOWN_CLASS</b></i><br> |