From: John L. <jr...@us...> - 2009-09-25 18:48:12
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3461/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxldefs.h wxlstate.h wxlua_bind.h Log Message: Fix multiple inheritance by adding the offset to the vtable for base classes that are second or higher. Index: wxldefs.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxldefs.h,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wxldefs.h 19 May 2009 03:20:53 -0000 1.47 --- wxldefs.h 25 Sep 2009 18:47:58 -0000 1.48 *************** *** 65,69 **** //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 27 // ---------------------------------------------------------------------------- --- 65,69 ---- //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 28 // ---------------------------------------------------------------------------- Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** wxlbind.h 19 May 2009 03:20:53 -0000 1.87 --- wxlbind.h 25 Sep 2009 18:47:58 -0000 1.88 *************** *** 79,82 **** --- 79,83 ---- // Lua types. The binding generator uses these and generates new ones for // classes and structs as specified in the bindings. + extern WXDLLIMPEXP_DATA_WXLUA(int) wxluatype_TUNKNOWN; extern WXDLLIMPEXP_DATA_WXLUA(int) wxluatype_TNONE; extern WXDLLIMPEXP_DATA_WXLUA(int) wxluatype_TNIL; *************** *** 98,102 **** extern WXDLLIMPEXP_DATA_WXLUA(wxLuaBindClass) wxLuaBindClass_NULL; // for NULL pointer ! // Copies of wxLua types that are used very often. // Note that we do not use the original since we may not be linked // to the binding library that defines them. --- 99,103 ---- extern WXDLLIMPEXP_DATA_WXLUA(wxLuaBindClass) wxLuaBindClass_NULL; // for NULL pointer ! // Copies of wxLua types that are used very often, point to wxluatype_TUNKNOWN if unset. // Note that we do not use the original since we may not be linked // to the binding library that defines them. *************** *** 153,157 **** int method_type; // enum wxLuaMethod_Type flags for this function int minargs; // Min number of required args ! int maxargs; // Max number of args allowed wxLuaArgType* argtypes; // Array of wxLua types representing each argument, NULL terminated. }; --- 154,158 ---- int method_type; // enum wxLuaMethod_Type flags for this function int minargs; // Min number of required args ! int maxargs; // Max number of args allowed, equal to length of argtypes array wxLuaArgType* argtypes; // Array of wxLua types representing each argument, NULL terminated. }; *************** *** 182,187 **** }; - extern WXDLLIMPEXP_DATA_WXLUA(wxLuaBindNumber) g_wxluanumberArray_None[1]; // = {{0,0}} - // ---------------------------------------------------------------------------- // wxLuaBindString - Defines a wxWidgets wxChar* string for wxLua --- 183,186 ---- *************** *** 240,243 **** --- 239,248 ---- // library or module with the base class is not loaded. + wxLuaArgType* baseclass_wxluatypes; // NULL terminated array of wxLua types for the base classes + // that are from second or higher base classes + int* baseclass_vtable_offsets; // Array of pointer offsets of the second or higher + // base classes from the root class. + // See note above wxluaT_getuserdatatype() + wxLuaBindNumber* enums; // Class member enums or NULL if none int enums_n; // number of enums Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** wxlstate.h 19 May 2009 03:20:53 -0000 1.124 --- wxlstate.h 25 Sep 2009 18:47:58 -0000 1.125 *************** *** 441,449 **** // Is a class with the wxl_type equal to or derived from a class with the base_wxl_type. ! // 0 means same class, +1 means base is parent, +2 base is grandparent, ... // returns -1 if the wxLua type is not derived from the base type. ! WXDLLIMPEXP_WXLUA int LUACALL wxluaT_isderivedtype(lua_State* L, int wxl_type, int base_wxl_type); // Same as above, but works directly with the wxLuaBindClasses. ! WXDLLIMPEXP_WXLUA int LUACALL wxluaT_isderivedclass(const wxLuaBindClass* wxlClass, const wxLuaBindClass* base_wxlClass); // Verify if the luatype = lua_type(L, stack_idx) is valid for the // wxl_type which is one of the predefined WXLUA_TXXX or s_wxluaarg_XXX types. --- 441,453 ---- // Is a class with the wxl_type equal to or derived from a class with the base_wxl_type. ! // Optional input baseclass_n is set to the highest multiple baseclass level, where ! // 0 means that inheritance from wxl_type to base_wxl_type is always the first ! // base class, a 1 or higher means that wxl_type is derived from the second or higher ! // base class somewhere along the inheritance chain. ! // return of 0 means same class, +1 means base is parent, +2 base is grandparent, ... // returns -1 if the wxLua type is not derived from the base type. ! WXDLLIMPEXP_WXLUA int LUACALL wxluaT_isderivedtype(lua_State* L, int wxl_type, int base_wxl_type, int* baseclass_n = NULL); // Same as above, but works directly with the wxLuaBindClasses. ! WXDLLIMPEXP_WXLUA int LUACALL wxluaT_isderivedclass(const wxLuaBindClass* wxlClass, const wxLuaBindClass* base_wxlClass, int* baseclass_n = NULL); // Verify if the luatype = lua_type(L, stack_idx) is valid for the // wxl_type which is one of the predefined WXLUA_TXXX or s_wxluaarg_XXX types. *************** *** 910,914 **** const wxLuaBindClass* GetBindClass(const wxLuaBindCFunc* wxlCFunc) const; // See wxluaT_isderivedtype(). ! int IsDerivedType(int wxl_type, int base_wxl_type) const; // Get wxLuaBindEvent for given wxEventType (wxEvent::GetEventType()) by finding // the matching wxLuaBindEvent::eventType. --- 914,918 ---- const wxLuaBindClass* GetBindClass(const wxLuaBindCFunc* wxlCFunc) const; // See wxluaT_isderivedtype(). ! int IsDerivedType(int wxl_type, int base_wxl_type, int* baseclass_n) const; // Get wxLuaBindEvent for given wxEventType (wxEvent::GetEventType()) by finding // the matching wxLuaBindEvent::eventType. Index: wxlua_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlua_bind.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wxlua_bind.h 19 May 2009 03:20:53 -0000 1.18 --- wxlua_bind.h 25 Sep 2009 18:47:58 -0000 1.19 *************** *** 17,23 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 27 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 27 // --------------------------------------------------------------------------- --- 17,23 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 28 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 28 // --------------------------------------------------------------------------- |