From: John L. <jr...@us...> - 2007-06-12 00:09:10
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/bindings/wxwidgets Modified Files: data.i override.hpp wx_datatypes.lua wxlua.i Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** wx_datatypes.lua 8 Jun 2007 22:50:08 -0000 1.64 --- wx_datatypes.lua 12 Jun 2007 00:08:36 -0000 1.65 *************** *** 247,255 **** Name = "wxArrayInt", }, - wxArrayInt_FromLuaTable = { - DefType = "special", - IsNumber = true, - Name = "wxArrayInt_FromLuaTable", - }, wxArrayString = { Condition = "wxLUA_USE_wxArrayString", --- 247,250 ---- *************** *** 259,267 **** Name = "wxArrayString", }, - wxArrayString_FromLuaTable = { - DefType = "special", - IsNumber = true, - Name = "wxArrayString_FromLuaTable", - }, wxArrayTreeItemIds = { Condition = "wxLUA_USE_wxTreeCtrl && wxUSE_TREECTRL", --- 254,257 ---- Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxlua.i,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wxlua.i 11 Jun 2007 03:57:59 -0000 1.23 --- wxlua.i 12 Jun 2007 00:08:36 -0000 1.24 *************** *** 42,46 **** %define WXLUAARG_UserData %define WXLUAARG_LuaThread ! %define WXLUAARG_Enum // Is this lua_type() (or in lua type()) considered --- 42,46 ---- %define WXLUAARG_UserData %define WXLUAARG_LuaThread ! %define WXLUAARG_Integer // Is this lua_type() (or in lua type()) considered *************** *** 189,196 **** // %override [any value type] wxLuaObject::GetObject() // C++ Func: bool GetObject() ! // get the object, note C++ returns bool, this "returns" the referenced object void GetObject() const ! // these are used to verify that things are working //bool *GetBoolPtr(); //int *GetIntPtr(); --- 189,196 ---- // %override [any value type] wxLuaObject::GetObject() // C++ Func: bool GetObject() ! // get the object, note C++ returns bool, in lua it "returns" the referenced object void GetObject() const ! // These are not useful in lua //bool *GetBoolPtr(); //int *GetIntPtr(); *************** *** 200,204 **** int GetAllocationFlags() const bool HasAllocationFlag(wxLuaObject_Type flag) ! int SetAllocationFlag(wxLuaObject_Type flag, bool set) %endclass --- 200,204 ---- int GetAllocationFlags() const bool HasAllocationFlag(wxLuaObject_Type flag) ! //int SetAllocationFlag(wxLuaObject_Type flag, bool set) // NOT for use in lua %endclass *************** *** 229,232 **** --- 229,236 ---- //bool OnPrintPage(int pageNum) + // Dummy test function to directly verify that the binding virtual functions really work. + // This base class function appends "-Base" to the val string and returns it. + virtual wxString TestVirtualFunctionBinding(const wxString& val) // { return val + wxT("-Base"); } + %endclass Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/override.hpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** override.hpp 11 Jun 2007 03:57:59 -0000 1.73 --- override.hpp 12 Jun 2007 00:08:36 -0000 1.74 *************** *** 1608,1612 **** evttype_idx = 4; ! if (wxlState.IsEnumerationType(3)) lastId = (wxWindowID)lua_tonumber(L, 3); else --- 1608,1612 ---- evttype_idx = 4; ! if (wxlState.IsIntegerType(3)) lastId = (wxWindowID)lua_tonumber(L, 3); else *************** *** 1617,1621 **** } ! if (wxlState.IsEnumerationType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else --- 1617,1621 ---- } ! if (wxlState.IsIntegerType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else *************** *** 1633,1637 **** evttype_idx = 3; ! if (wxlState.IsEnumerationType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else --- 1633,1637 ---- evttype_idx = 3; ! if (wxlState.IsIntegerType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else *************** *** 1680,1684 **** } ! if (wxlState.IsEnumerationType(evttype_idx)) eventType = (wxEventType)lua_tonumber(L, evttype_idx); else --- 1680,1684 ---- } ! if (wxlState.IsIntegerType(evttype_idx)) eventType = (wxEventType)lua_tonumber(L, evttype_idx); else *************** *** 1722,1726 **** evttype_idx = 4; ! if (wxlState.IsEnumerationType(3)) lastId = (wxWindowID)lua_tonumber(L, 3); else --- 1722,1726 ---- evttype_idx = 4; ! if (wxlState.IsIntegerType(3)) lastId = (wxWindowID)lua_tonumber(L, 3); else *************** *** 1731,1735 **** } ! if (wxlState.IsEnumerationType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else --- 1731,1735 ---- } ! if (wxlState.IsIntegerType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else *************** *** 1746,1750 **** evttype_idx = 3; ! if (wxlState.IsEnumerationType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else --- 1746,1750 ---- evttype_idx = 3; ! if (wxlState.IsIntegerType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else *************** *** 1770,1774 **** } ! if (wxlState.IsEnumerationType(evttype_idx)) eventType = (wxEventType)lua_tonumber(L, evttype_idx); else --- 1770,1774 ---- } ! if (wxlState.IsIntegerType(evttype_idx)) eventType = (wxEventType)lua_tonumber(L, evttype_idx); else *************** *** 1924,1928 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 2 ? (wxPathFormat)wxlState.GetEnumerationType(3) : wxPATH_NATIVE); wxString ext; wxString name; --- 1924,1928 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 2 ? (wxPathFormat)wxlState.GetIntegerType(3) : wxPATH_NATIVE); wxString ext; wxString name; *************** *** 1949,1953 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 2 ? (wxPathFormat)wxlState.GetEnumerationType(3) : wxPATH_NATIVE); wxString ext; wxString name; --- 1949,1953 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 2 ? (wxPathFormat)wxlState.GetIntegerType(3) : wxPATH_NATIVE); wxString ext; wxString name; *************** *** 1976,1980 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlState.GetEnumerationType(3) : wxPATH_NATIVE); // const wxString fullpath const wxString fullpath = wxlState.GetwxStringType(2); --- 1976,1980 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlState.GetIntegerType(3) : wxPATH_NATIVE); // const wxString fullpath const wxString fullpath = wxlState.GetwxStringType(2); *************** *** 2271,2275 **** wxFontEncoding altEncoding; // wxFontEncoding encoding ! wxFontEncoding encoding = (wxFontEncoding)wxlState.GetEnumerationType(2); // get this wxFontMapper *self = (wxFontMapper *)wxlState.GetUserDataType(1, s_wxluatag_wxFontMapper); --- 2271,2275 ---- wxFontEncoding altEncoding; // wxFontEncoding encoding ! wxFontEncoding encoding = (wxFontEncoding)wxlState.GetIntegerType(2); // get this wxFontMapper *self = (wxFontMapper *)wxlState.GetUserDataType(1, s_wxluatag_wxFontMapper); *************** *** 3456,3460 **** lua_gettable(L, -2); if (lua_isnumber(L, -1)) ! kind = (wxItemKind)wxlState.GetEnumerationType(-1); lua_pop(L, 1); --- 3456,3460 ---- lua_gettable(L, -2); if (lua_isnumber(L, -1)) ! kind = (wxItemKind)wxlState.GetIntegerType(-1); lua_pop(L, 1); *************** *** 3537,3541 **** // bool isCheckable = false // This used to be a bool instead of a wxItemKind ! wxItemKind itemkind = (wxItemKind)(argCount >= 5 ? wxlState.GetEnumerationType(5) : wxITEM_NORMAL); // const wxString& help = wxEmptyString wxString help = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); --- 3537,3541 ---- // bool isCheckable = false // This used to be a bool instead of a wxItemKind ! wxItemKind itemkind = (wxItemKind)(argCount >= 5 ? wxlState.GetIntegerType(5) : wxITEM_NORMAL); // const wxString& help = wxEmptyString wxString help = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); Index: data.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/data.i,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** data.i 11 Jun 2007 03:57:58 -0000 1.29 --- data.i 12 Jun 2007 00:08:36 -0000 1.30 *************** *** 326,329 **** --- 326,330 ---- %class %delete %noclassinfo %encapsulate wxSortedArrayString, wxArrayString wxSortedArrayString() + wxSortedArrayString(const wxArrayString& src) // have to have this constructor since they're not derived wxSortedArrayString(const wxSortedArrayString& src) |