From: John L. <jr...@us...> - 2007-06-12 05:03:21
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22549/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxldefs.h wxlstate.h Log Message: Add ability to do profiling in GCC using Makefiles Add InitBinding function to wxLuaBinding to presort items Test code for sorted wxLuaMethods, doesn't seem to be any faster though. Index: wxldefs.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxldefs.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wxldefs.h 12 Jun 2007 00:08:42 -0000 1.22 --- wxldefs.h 12 Jun 2007 05:03:17 -0000 1.23 *************** *** 67,71 **** //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 10 // ---------------------------------------------------------------------------- --- 67,71 ---- //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 11 // ---------------------------------------------------------------------------- Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** wxlbind.h 12 Jun 2007 00:08:42 -0000 1.48 --- wxlbind.h 12 Jun 2007 05:03:17 -0000 1.49 *************** *** 225,229 **** // Call GetObject() so that it's on the stack then try to get the value of // the object as the specified type and set the member variable equal to it ! // and return a pointer to member variable to a function that wants // a pointer to read/write from/to. bool *GetBoolPtr(); --- 225,229 ---- // Call GetObject() so that it's on the stack then try to get the value of // the object as the specified type and set the member variable equal to it ! // and return a pointer to member variable to a function that wants // a pointer to read/write from/to. bool *GetBoolPtr(); *************** *** 339,343 **** virtual void RegisterBinding(const wxLuaState& wxlState, bool registerTypes); // Unbinds C Functions/Defines/Object/Events by clearing namespace Lua table ! virtual void UnRegisterBinding(lua_State* L); // ----------------------------------------------------------------------- --- 339,343 ---- virtual void RegisterBinding(const wxLuaState& wxlState, bool registerTypes); // Unbinds C Functions/Defines/Object/Events by clearing namespace Lua table ! virtual void UnRegisterBinding(const wxLuaState& wxlState); // ----------------------------------------------------------------------- *************** *** 397,401 **** // Lookup a lua method or get property called methodName in the wxLuaBindClass array wxlClass. ! // Ensure that the lookup is of WXLUAMETHOD_METHOD|WXLUAMETHOD_GETPROP type. // If the lua method cannot be found on the current class recurse through base classes // Return a pointer to the wxLuaBindMethod that corresponds to the method name, --- 397,401 ---- // Lookup a lua method or get property called methodName in the wxLuaBindClass array wxlClass. ! // Ensure that the lookup is of WXLUAMETHOD_METHOD|WXLUAMETHOD_GETPROP type. // If the lua method cannot be found on the current class recurse through base classes // Return a pointer to the wxLuaBindMethod that corresponds to the method name, *************** *** 403,407 **** static wxLuaBindMethod* GetClassMethod(const wxLuaBindClass *wxlClass, const char *methodName, bool search_baseclasses = true); // Lookup a lua property function named propName in the wxLuaBindClass wxlClass ! // Ensure that the lookup is of WXLUAMETHOD_GETPROP|WXLUAMETHOD_SETPROP type. // If the lua property cannot be found on the current class recurse through base classes // Return a pointer to the wxLuaBindMethod that corresponds to the property name, --- 403,407 ---- static wxLuaBindMethod* GetClassMethod(const wxLuaBindClass *wxlClass, const char *methodName, bool search_baseclasses = true); // Lookup a lua property function named propName in the wxLuaBindClass wxlClass ! // Ensure that the lookup is of WXLUAMETHOD_GETPROP|WXLUAMETHOD_SETPROP type. // If the lua property cannot be found on the current class recurse through base classes // Return a pointer to the wxLuaBindMethod that corresponds to the property name, *************** *** 417,420 **** --- 417,423 ---- protected: + void InitBinding(); // must called after subclassed version is created + // to sort the bindings appropriately + // Registers binding, returns lua table reference to binding virtual int LUACALL RegisterFunctions(const wxLuaState& wxlState, bool registerTypes); Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** wxlstate.h 12 Jun 2007 00:08:42 -0000 1.76 --- wxlstate.h 12 Jun 2007 05:03:17 -0000 1.77 *************** *** 132,136 **** // Push the errorMsg on the stack and call lua_error WXDLLIMPEXP_WXLUA void LUACALL wxlua_terror(lua_State* L, const char* errorMsg); ! wxLUA_UNICODE_ONLY(WXDLLIMPEXP_WXLUA void LUACALL wxlua_terror(lua_State* L, const wxString& errorMsg) { wxlua_terror(L, wx2lua(errorMsg)); }) // Push the object u onto the top of the stack wrapped in a newuserdata // with it's metatable set to the table from tget(tag). Returns true if the --- 132,136 ---- // Push the errorMsg on the stack and call lua_error WXDLLIMPEXP_WXLUA void LUACALL wxlua_terror(lua_State* L, const char* errorMsg); ! wxLUA_UNICODE_ONLY(inline WXDLLIMPEXP_WXLUA void LUACALL wxlua_terror(lua_State* L, const wxString& errorMsg) { wxlua_terror(L, wx2lua(errorMsg)); }) // Push the object u onto the top of the stack wrapped in a newuserdata // with it's metatable set to the table from tget(tag). Returns true if the *************** *** 184,188 **** // and wxlua_getluatype() since it allows a small amount of coersion between types. // It also doesn't account for the automatic conversion of certain lua types ! // to wxluatypes, (wxString, wxArrayString, wxArrayInt) // see wxLuaState::IswxLuaType which is more complete. WXDLLIMPEXP_WXLUA int LUACALL wxlua_iswxluatype(int luatype, int wxluaarg_tag); --- 184,188 ---- // and wxlua_getluatype() since it allows a small amount of coersion between types. // It also doesn't account for the automatic conversion of certain lua types ! // to wxluatypes, (wxString, wxArrayString, wxArrayInt) // see wxLuaState::IswxLuaType which is more complete. WXDLLIMPEXP_WXLUA int LUACALL wxlua_iswxluatype(int luatype, int wxluaarg_tag); *************** *** 198,202 **** // Is this data a userdata object that wxLua has pushed into lua? ! // This should be the same as // (lua_isuserdata(L, stack_idx) && !lua_islightuserdata(L, stack_idx)) #define wxlua_iswxuserdata(L, stack_idx) (lua_type((L), (stack_idx)) == LUA_TUSERDATA) --- 198,202 ---- // Is this data a userdata object that wxLua has pushed into lua? ! // This should be the same as // (lua_isuserdata(L, stack_idx) && !lua_islightuserdata(L, stack_idx)) #define wxlua_iswxuserdata(L, stack_idx) (lua_type((L), (stack_idx)) == LUA_TUSERDATA) *************** *** 217,221 **** // wxlua_terror with a message that's appropriate for stack_idx to be a // parameter to a function call. (These are used in the bindings) ! // Note: The function wxLuaState::GetwxStringType does automatic conversion // of both a lua string and a userdata wxString to a wxString. WXDLLIMPEXP_WXLUA const char* LUACALL wxlua_getstringtype(lua_State* L, int stack_idx); --- 217,221 ---- // wxlua_terror with a message that's appropriate for stack_idx to be a // parameter to a function call. (These are used in the bindings) ! // Note: The function wxLuaState::GetwxStringType does automatic conversion // of both a lua string and a userdata wxString to a wxString. WXDLLIMPEXP_WXLUA const char* LUACALL wxlua_getstringtype(lua_State* L, int stack_idx); *************** *** 232,236 **** // Convert the table at stack index to a "new" array of const char* strings. // Return a pointer to the array of strings. You need to delete the array, but not ! // the individual strings since lua should still have them during the life of the // returned array, if not you will need to copy them. // returns the number of character strings in the array in count. --- 232,236 ---- // Convert the table at stack index to a "new" array of const char* strings. // Return a pointer to the array of strings. You need to delete the array, but not ! // the individual strings since lua should still have them during the life of the // returned array, if not you will need to copy them. // returns the number of character strings in the array in count. *************** *** 585,589 **** // delete all stray wxWindow derived classes that have been destroyed ! // by wxWidgets (eg. a child window) // This function does not need to be called ever, for debugging perhaps? void GarbageCollectWindows(bool closeWindows); --- 585,589 ---- // delete all stray wxWindow derived classes that have been destroyed ! // by wxWidgets (eg. a child window) // This function does not need to be called ever, for debugging perhaps? void GarbageCollectWindows(bool closeWindows); *************** *** 734,738 **** // userdata and the new wxLuaObject wraps the lua function or value // which will be deleted by this. ! // The derived methods are stored in the "wxLuaDerivedMethods" table in the // lua registry table. bool SetDerivedMethod(void *pObject, const char *method_name, wxLuaObject* wxlObj); --- 734,738 ---- // userdata and the new wxLuaObject wraps the lua function or value // which will be deleted by this. ! // The derived methods are stored in the "wxLuaDerivedMethods" table in the // lua registry table. bool SetDerivedMethod(void *pObject, const char *method_name, wxLuaObject* wxlObj); *************** *** 746,750 **** // Find a derived method given an object and and a method name. // If the method can be found, return the valid wxLuaState it belongs to. ! // This function can be used for classes that implement virtual functions to // try to find a wxLuaState that may have overridden the function to call it. // It is probably easier to merely make a wxLuaState a class member for --- 746,750 ---- // Find a derived method given an object and and a method name. // If the method can be found, return the valid wxLuaState it belongs to. ! // This function can be used for classes that implement virtual functions to // try to find a wxLuaState that may have overridden the function to call it. // It is probably easier to merely make a wxLuaState a class member for |