From: John L. <jr...@us...> - 2007-09-04 22:21:15
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19898/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxlstate.h Log Message: Some comment cleanup Document wxLuaState creation a little better Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** wxlbind.h 7 Aug 2007 20:23:25 -0000 1.60 --- wxlbind.h 4 Sep 2007 22:21:10 -0000 1.61 *************** *** 61,64 **** --- 61,67 ---- #define WXLUAARG_Integer -11 + // Variables used in the wxLuaArgTag member of the wxLuaBindCFunc for + // common types. The binding generator will use these and generate others + // as specified in the bindings. extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_None; extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Nil; *************** *** 74,83 **** // copies of wxlua arg tags for binding types that are used very often ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxLuaFunction; // The Lua tag for wxLuaFunctions. ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_NULL; // The Lua tag for NULL pointer ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxEvent; // The Lua tag for wxEvents ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxWindow; // The Lua tag for wxWindows ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxString; // The Lua tag for wxStrings typedef int* wxLuaArgTag; // address of class tag (a pointer to it) --- 77,89 ---- // copies of wxlua arg tags for binding types that are used very often ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxLuaFunction; // The Lua tag for wxLuaFunctions ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_NULL; // The Lua tag for NULL pointer ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxEvent; // The Lua tag for wxEvents ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxWindow; // The Lua tag for wxWindows ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxString; // The Lua tag for wxStrings + // ---------------------------------------------------------------------------- + // wxLuaBindCFunc and friends - Defines a single C func for a LUA method + // ---------------------------------------------------------------------------- typedef int* wxLuaArgTag; // address of class tag (a pointer to it) *************** *** 108,112 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindCFunc // defines a single C func for a LUA method { lua_CFunction func; // C function that implements the method or property --- 114,118 ---- }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindCFunc { lua_CFunction func; // C function that implements the method or property *************** *** 120,124 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindMethod // defines a LUA method or property { const char *name; // name of the method or property --- 126,134 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindMethod - Defines a LUA method or property ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindMethod { const char *name; // name of the method or property *************** *** 131,135 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindDefine // defines a numeric define for wxLua { const char *name; // name --- 141,149 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindDefine - Defines a numeric define for wxLua ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindDefine { const char *name; // name *************** *** 139,143 **** extern WXDLLIMPEXP_DATA_WXLUA(wxLuaBindDefine) s_wxluadefineArray_None[1]; // = {{0,0}} ! struct WXDLLIMPEXP_WXLUA wxLuaBindString // defines a wxWidgets string for wxLua { const char *name; // name --- 153,161 ---- extern WXDLLIMPEXP_DATA_WXLUA(wxLuaBindDefine) s_wxluadefineArray_None[1]; // = {{0,0}} ! // ---------------------------------------------------------------------------- ! // wxLuaBindString - Defines a wxWidgets wxString for wxLua ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindString { const char *name; // name *************** *** 145,149 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindEvent // defines a wxWidgets Event for wxLua { const char *name; // name of the event, e.g. "wxEVT_COMMAND_MENU_SELECTED" --- 163,171 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindEvent - Defines a wxWidgets wxEvent for wxLua ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindEvent { const char *name; // name of the event, e.g. "wxEVT_COMMAND_MENU_SELECTED" *************** *** 152,156 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindObject // Defines an object or pointer for wxLua { const char *name; // the name of the object or pointer --- 174,182 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindEvent - Defines an object or pointer for wxLua ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindObject { const char *name; // the name of the object or pointer *************** *** 160,164 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindClass // defines a LUA C++ class interface { const char *name; // name of the class --- 186,194 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindClass - Defines a LUA C++ class interface ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindClass { const char *name; // name of the class Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** wxlstate.h 10 Aug 2007 21:23:39 -0000 1.93 --- wxlstate.h 4 Sep 2007 22:21:10 -0000 1.94 *************** *** 72,76 **** // // Note we do not push a human readable string for these because Lua always makes ! // a copy of the string and the copying takes a considerable amount of time // when benchmarked using valgrind. // ---------------------------------------------------------------------------- --- 72,76 ---- // // Note we do not push a human readable string for these because Lua always makes ! // a copy and hashes the string, this takes a considerable amount of time // when benchmarked using valgrind. // ---------------------------------------------------------------------------- *************** *** 449,453 **** // ----------------------------------------------------------------------- ! // Destroy the refed data (only closes Lua if this is the last refed state) // Note: if you have a top level window (wxFrame) open in Lua and exit the // C++ program your program will seem to "hang" because wxApp doesn't --- 449,455 ---- // ----------------------------------------------------------------------- ! // Destroy the refed data, use this instead of wxObject::UnRef(). ! // Only calls lua_close(L) if this is the last refed state and this was ! // created without the wxLUASTATE_STATICSTATE flag. // Note: if you have a top level window (wxFrame) open in Lua and exit the // C++ program your program will seem to "hang" because wxApp doesn't *************** *** 459,462 **** --- 461,466 ---- // Close the lua_State and if 'force' close all attached wxWindows // if !force then popup a dialog to ask if windows should be destroyed. + // Only calls lua_close(L) if this is the last refed state and this was + // created without the wxLUASTATE_STATICSTATE flag. bool CloseLuaState(bool force); // Are we currently being closed, the garbage collector is running, but *************** *** 519,523 **** // Try to compile the Lua program. Creates new lua_State to test for syntax ! // errors and sends error events. See LuaError() for errMsg and line_num. int CompileString(const wxString &script, const wxString& name = wxEmptyString, wxString* errMsg_ = NULL, int* line_num = NULL); --- 523,527 ---- // Try to compile the Lua program. Creates new lua_State to test for syntax ! // errors and sends error events. See wxLuaState::LuaError() for errMsg and line_num. int CompileString(const wxString &script, const wxString& name = wxEmptyString, wxString* errMsg_ = NULL, int* line_num = NULL); *************** *** 525,529 **** wxString* errMsg_ = NULL, int* line_num = NULL); ! // checks the status with CheckRunError and tries to get Lua's error string // from the top of the stack and sends a wxEVT_LUA_ERROR. // If the lua_State is NULL then use the internal one from this class. --- 529,533 ---- wxString* errMsg_ = NULL, int* line_num = NULL); ! // Checks the status with CheckRunError() and tries to get Lua's error string // from the top of the stack and sends a wxEVT_LUA_ERROR. // If the lua_State is NULL then use the internal one from this class. *************** *** 605,611 **** const wxLuaBindEvent* GetLuaEvent(wxEventType eventType) const; ! // Get the binding list used to initialize this class ! // you may add or remove bindings before creation, but not that ! // all wxLuaStates must have the same bindings in the same order! wxLuaBindingList* GetLuaBindingList() const; --- 609,616 ---- const wxLuaBindEvent* GetLuaEvent(wxEventType eventType) const; ! // Get the wxLuaBinding list of classes/objects installed into Lua. ! // You may add or remove bindings before the creation of any wxLuaStates ! // or once they have all been Destroy()ed. However, while any wxLuaStates ! // are created they must have the same bindings in the same order! wxLuaBindingList* GetLuaBindingList() const; |