Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12976/wxLua/modules/wxbind/src Modified Files: wxadv_adv.cpp wxadv_bind.cpp wxadv_grid.cpp wxaui_aui.cpp wxbase_base.cpp wxbase_bind.cpp wxbase_config.cpp wxbase_data.cpp wxbase_datetime.cpp wxbase_file.cpp wxcore_appframe.cpp wxcore_bind.cpp wxcore_clipdrag.cpp wxcore_controls.cpp wxcore_core.cpp wxcore_defsutils.cpp wxcore_dialogs.cpp wxcore_event.cpp wxcore_gdi.cpp wxcore_geometry.cpp wxcore_help.cpp wxcore_image.cpp wxcore_mdi.cpp wxcore_menutool.cpp wxcore_picker.cpp wxcore_print.cpp wxcore_sizer.cpp wxcore_windows.cpp wxgl_gl.cpp wxhtml_html.cpp wxmedia_media.cpp wxnet_net.cpp wxstc_stc.cpp wxxml_xml.cpp wxxrc_xrc.cpp Log Message: Too many changes to list... A large portion of the internal workings of the wxLuaState have been rewritten. All of the data that was stored in wxLuaStateData that might be needed by a function taking a lua_State* is now in the LUA_REGISTRYINDEX. C functions have been added to access these values. The generated bindings no longer need to have "wxLuaState wxlState(L);" since everything can be done with the C functions. The result is that wxLua should be faster. Index: wxnet_net.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxnet_net.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxnet_net.cpp 1 Aug 2007 19:15:37 -0000 1.3 --- wxnet_net.cpp 7 Dec 2007 02:13:14 -0000 1.4 *************** *** 35,41 **** static int LUACALL wxLua_wxSocketBase_Close(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxSocketBase * self = (wxSocketBase *)wxlState.GetUserDataType(1, s_wxluatag_wxSocketBase); // call Close self->Close(); --- 35,40 ---- static int LUACALL wxLua_wxSocketBase_Close(lua_State *L) { [...3024 lines suppressed...] return 1; *************** *** 3096,3103 **** static int LUACALL wxLua_wxURL_constructor_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "wxURL", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxURL_constructor_overload, s_wxluafunc_wxLua_wxURL_constructor_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } #endif // (((wxLUA_USE_wxSocket && wxUSE_SOCKETS) && (wxUSE_URL)) && (wxLUA_USE_wxSocket && wxUSE_SOCKETS))||((wxLUA_USE_wxSocket && wxUSE_SOCKETS) && (wxUSE_URL)) --- 2959,2965 ---- static int LUACALL wxLua_wxURL_constructor_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "wxURL", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxURL_constructor_overload, s_wxluafunc_wxLua_wxURL_constructor_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } #endif // (((wxLUA_USE_wxSocket && wxUSE_SOCKETS) && (wxUSE_URL)) && (wxLUA_USE_wxSocket && wxUSE_SOCKETS))||((wxLUA_USE_wxSocket && wxUSE_SOCKETS) && (wxUSE_URL)) Index: wxstc_stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxstc_stc.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxstc_stc.cpp 17 Nov 2007 00:15:00 -0000 1.4 --- wxstc_stc.cpp 7 Dec 2007 02:13:14 -0000 1.5 *************** *** 33,41 **** static int LUACALL wxLua_wxStyledTextCtrl_AddRefDocument(lua_State *L) { - wxLuaState wxlState(L); // void docPointer ! void * docPointer = (void *)wxlState.wxlua_ToUserdata(2); // get this ! wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextCtrl); // call AddRefDocument self->AddRefDocument(docPointer); --- 33,40 ---- [...9582 lines suppressed...] wxStyledTextEvent *returns; // get number of arguments --- 8861,8864 ---- *************** *** 9361,9367 **** returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxStyledTextEvent, returns); return 1; --- 8871,8877 ---- returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxStyledTextEvent, returns); return 1; Index: wxxrc_xrc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxrc_xrc.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxxrc_xrc.cpp 1 Aug 2007 19:15:37 -0000 1.3 --- wxxrc_xrc.cpp 7 Dec 2007 02:13:14 -0000 1.4 *************** *** 35,50 **** static int LUACALL wxLua_wxXmlResource_AttachUnknownControl(lua_State *L) { - wxLuaState wxlState(L); bool returns; // get number of arguments int argCount = lua_gettop(L); // wxWindow parent = NULL ! wxWindow * parent = (argCount >= 4 ? (wxWindow *)wxlState.GetUserDataType(4, s_wxluatag_wxWindow) : NULL); // wxWindow control ! wxWindow * control = (wxWindow *)wxlState.GetUserDataType(3, s_wxluatag_wxWindow); // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call AttachUnknownControl returns = (self->AttachUnknownControl(name, control, parent)); --- 35,49 ---- static int LUACALL wxLua_wxXmlResource_AttachUnknownControl(lua_State *L) { bool returns; // get number of arguments int argCount = lua_gettop(L); // wxWindow parent = NULL ! wxWindow * parent = (argCount >= 4 ? (wxWindow *)wxluaT_getuserdatatype(L, 4, s_wxluatag_wxWindow) : NULL); // wxWindow control ! wxWindow * control = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call AttachUnknownControl returns = (self->AttachUnknownControl(name, control, parent)); *************** *** 61,67 **** static int LUACALL wxLua_wxXmlResource_ClearHandlers(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call ClearHandlers self->ClearHandlers(); --- 60,65 ---- static int LUACALL wxLua_wxXmlResource_ClearHandlers(lua_State *L) { // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call ClearHandlers self->ClearHandlers(); *************** *** 76,80 **** static int LUACALL wxLua_wxXmlResource_CompareVersion(lua_State *L) { - wxLuaState wxlState(L); int returns; // int revision --- 74,77 ---- *************** *** 87,91 **** int major = (int)wxlua_getnumbertype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call CompareVersion returns = (self->CompareVersion(major, minor, release, revision)); --- 84,88 ---- int major = (int)wxlua_getnumbertype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call CompareVersion returns = (self->CompareVersion(major, minor, release, revision)); *************** *** 101,110 **** static int LUACALL wxLua_wxXmlResource_Get(lua_State *L) { - wxLuaState wxlState(L); wxXmlResource *returns; // call Get returns = (wxXmlResource *)wxXmlResource::Get(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); return 1; --- 98,106 ---- static int LUACALL wxLua_wxXmlResource_Get(lua_State *L) { wxXmlResource *returns; // call Get returns = (wxXmlResource *)wxXmlResource::Get(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); return 1; *************** *** 117,124 **** static int LUACALL wxLua_wxXmlResource_GetFlags(lua_State *L) { - wxLuaState wxlState(L); int returns; // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call GetFlags returns = (self->GetFlags()); --- 113,119 ---- static int LUACALL wxLua_wxXmlResource_GetFlags(lua_State *L) { int returns; // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call GetFlags returns = (self->GetFlags()); *************** *** 135,142 **** static int LUACALL wxLua_wxXmlResource_GetVersion(lua_State *L) { - wxLuaState wxlState(L); long returns; // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call GetVersion returns = (self->GetVersion()); --- 130,136 ---- static int LUACALL wxLua_wxXmlResource_GetVersion(lua_State *L) { long returns; // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call GetVersion returns = (self->GetVersion()); *************** *** 153,157 **** static int LUACALL wxLua_wxXmlResource_GetXRCID(lua_State *L) { - wxLuaState wxlState(L); int returns; // get number of arguments --- 147,150 ---- *************** *** 160,164 **** int value_if_not_found = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxID_NONE); // const wxString stringID ! const wxString stringID = wxlState.GetwxStringType(1); // call GetXRCID returns = (wxXmlResource::GetXRCID(stringID, value_if_not_found)); --- 153,157 ---- int value_if_not_found = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxID_NONE); // const wxString stringID ! const wxString stringID = wxlua_getwxstringtype(L, 1); // call GetXRCID returns = (wxXmlResource::GetXRCID(stringID, value_if_not_found)); *************** *** 175,181 **** static int LUACALL wxLua_wxXmlResource_InitAllHandlers(lua_State *L) { - wxLuaState wxlState(L); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call InitAllHandlers self->InitAllHandlers(); --- 168,173 ---- static int LUACALL wxLua_wxXmlResource_InitAllHandlers(lua_State *L) { // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call InitAllHandlers self->InitAllHandlers(); *************** *** 190,199 **** static int LUACALL wxLua_wxXmlResource_Load(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString filemask ! const wxString filemask = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call Load returns = (self->Load(filemask)); --- 182,190 ---- static int LUACALL wxLua_wxXmlResource_Load(lua_State *L) { bool returns; // const wxString filemask ! const wxString filemask = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call Load returns = (self->Load(filemask)); *************** *** 212,228 **** static int LUACALL wxLua_wxXmlResource_LoadBitmap(lua_State *L) { - wxLuaState wxlState(L); wxBitmap *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadBitmap // allocate a new object using the copy constructor returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxBitmap *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); return 1; --- 203,218 ---- static int LUACALL wxLua_wxXmlResource_LoadBitmap(lua_State *L) { wxBitmap *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadBitmap // allocate a new object using the copy constructor returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxBitmap *)returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxBitmap, returns); return 1; *************** *** 238,251 **** static int LUACALL wxLua_wxXmlResource_LoadDialog1(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(3, s_wxluatag_wxWindow); // wxDialog dlg ! wxDialog * dlg = (wxDialog *)wxlState.GetUserDataType(2, s_wxluatag_wxDialog); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadDialog returns = (self->LoadDialog(dlg, parent, name)); --- 228,240 ---- static int LUACALL wxLua_wxXmlResource_LoadDialog1(lua_State *L) { bool returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // wxDialog dlg ! wxDialog * dlg = (wxDialog *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDialog); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadDialog returns = (self->LoadDialog(dlg, parent, name)); *************** *** 262,277 **** static int LUACALL wxLua_wxXmlResource_LoadDialog(lua_State *L) { - wxLuaState wxlState(L); wxDialog *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadDialog returns = (wxDialog *)self->LoadDialog(parent, name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxDialog, returns); return 1; --- 251,265 ---- static int LUACALL wxLua_wxXmlResource_LoadDialog(lua_State *L) { wxDialog *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadDialog returns = (wxDialog *)self->LoadDialog(parent, name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxDialog, returns); return 1; *************** *** 287,300 **** static int LUACALL wxLua_wxXmlResource_LoadFrame(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(3, s_wxluatag_wxWindow); // wxFrame frame ! wxFrame * frame = (wxFrame *)wxlState.GetUserDataType(2, s_wxluatag_wxFrame); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadFrame returns = (self->LoadFrame(frame, parent, name)); --- 275,287 ---- static int LUACALL wxLua_wxXmlResource_LoadFrame(lua_State *L) { bool returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // wxFrame frame ! wxFrame * frame = (wxFrame *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxFrame); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadFrame returns = (self->LoadFrame(frame, parent, name)); *************** *** 314,330 **** static int LUACALL wxLua_wxXmlResource_LoadIcon(lua_State *L) { - wxLuaState wxlState(L); wxIcon *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadIcon // allocate a new object using the copy constructor returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxIcon *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxIcon, returns); return 1; --- 301,316 ---- static int LUACALL wxLua_wxXmlResource_LoadIcon(lua_State *L) { wxIcon *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadIcon // allocate a new object using the copy constructor returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxIcon *)returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxIcon, returns); return 1; *************** *** 340,353 **** static int LUACALL wxLua_wxXmlResource_LoadMenu(lua_State *L) { - wxLuaState wxlState(L); wxMenu *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadMenu returns = (wxMenu *)self->LoadMenu(name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxMenu, returns); return 1; --- 326,338 ---- static int LUACALL wxLua_wxXmlResource_LoadMenu(lua_State *L) { wxMenu *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenu returns = (wxMenu *)self->LoadMenu(name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxMenu, returns); return 1; *************** *** 360,373 **** static int LUACALL wxLua_wxXmlResource_LoadMenuBar1(lua_State *L) { - wxLuaState wxlState(L); wxMenuBar *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadMenuBar returns = (wxMenuBar *)self->LoadMenuBar(name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxMenuBar, returns); return 1; --- 345,357 ---- static int LUACALL wxLua_wxXmlResource_LoadMenuBar1(lua_State *L) { wxMenuBar *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenuBar returns = (wxMenuBar *)self->LoadMenuBar(name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxMenuBar, returns); return 1; *************** *** 380,395 **** static int LUACALL wxLua_wxXmlResource_LoadMenuBar(lua_State *L) { - wxLuaState wxlState(L); wxMenuBar *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadMenuBar returns = (wxMenuBar *)self->LoadMenuBar(parent, name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxMenuBar, returns); return 1; --- 364,378 ---- static int LUACALL wxLua_wxXmlResource_LoadMenuBar(lua_State *L) { wxMenuBar *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadMenuBar returns = (wxMenuBar *)self->LoadMenuBar(parent, name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxMenuBar, returns); return 1; *************** *** 404,417 **** static int LUACALL wxLua_wxXmlResource_LoadPanel1(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(3, s_wxluatag_wxWindow); // wxPanel panel ! wxPanel * panel = (wxPanel *)wxlState.GetUserDataType(2, s_wxluatag_wxPanel); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadPanel returns = (self->LoadPanel(panel, parent, name)); --- 387,399 ---- static int LUACALL wxLua_wxXmlResource_LoadPanel1(lua_State *L) { bool returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 4); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 3, s_wxluatag_wxWindow); // wxPanel panel ! wxPanel * panel = (wxPanel *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxPanel); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadPanel returns = (self->LoadPanel(panel, parent, name)); *************** *** 428,443 **** static int LUACALL wxLua_wxXmlResource_LoadPanel(lua_State *L) { - wxLuaState wxlState(L); wxPanel *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadPanel returns = (wxPanel *)self->LoadPanel(parent, name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxPanel, returns); return 1; --- 410,424 ---- static int LUACALL wxLua_wxXmlResource_LoadPanel(lua_State *L) { wxPanel *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadPanel returns = (wxPanel *)self->LoadPanel(parent, name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxPanel, returns); return 1; *************** *** 452,467 **** static int LUACALL wxLua_wxXmlResource_LoadToolBar(lua_State *L) { - wxLuaState wxlState(L); wxToolBar *returns; // const wxString name ! const wxString name = wxlState.GetwxStringType(3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call LoadToolBar returns = (wxToolBar *)self->LoadToolBar(parent, name); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxToolBar, returns); return 1; --- 433,447 ---- static int LUACALL wxLua_wxXmlResource_LoadToolBar(lua_State *L) { wxToolBar *returns; // const wxString name ! const wxString name = wxlua_getwxstringtype(L, 3); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call LoadToolBar returns = (wxToolBar *)self->LoadToolBar(parent, name); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxToolBar, returns); return 1; *************** *** 476,489 **** static int LUACALL wxLua_wxXmlResource_Set(lua_State *L) { - wxLuaState wxlState(L); wxXmlResource *returns; // wxXmlResource res ! wxXmlResource * res = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); ! if (wxlState.IsTrackedObject(res)) wxlState.RemoveTrackedObject(res, wxLuaState::UNDELETE_OBJECT); // call Set returns = (wxXmlResource *)wxXmlResource::Set(res); ! if (!wxlState.IsTrackedObject(returns)) wxlState.AddTrackedObject(returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); return 1; --- 456,468 ---- static int LUACALL wxLua_wxXmlResource_Set(lua_State *L) { wxXmlResource *returns; // wxXmlResource res ! wxXmlResource * res = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); ! if (wxluaO_istrackedobject(L, res)) wxluaO_removetrackedobject(L, res, wxLUA_UNDELETE_OBJECT); // call Set returns = (wxXmlResource *)wxXmlResource::Set(res); ! if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); return 1; *************** *** 496,504 **** static int LUACALL wxLua_wxXmlResource_SetDomain(lua_State *L) { - wxLuaState wxlState(L); // const wxString domain ! const wxString domain = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call SetDomain self->SetDomain(domain); --- 475,482 ---- static int LUACALL wxLua_wxXmlResource_SetDomain(lua_State *L) { // const wxString domain ! const wxString domain = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call SetDomain self->SetDomain(domain); *************** *** 513,521 **** static int LUACALL wxLua_wxXmlResource_SetFlags(lua_State *L) { - wxLuaState wxlState(L); // int flags int flags = (int)wxlua_getnumbertype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call SetFlags self->SetFlags(flags); --- 491,498 ---- static int LUACALL wxLua_wxXmlResource_SetFlags(lua_State *L) { // int flags int flags = (int)wxlua_getnumbertype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call SetFlags self->SetFlags(flags); *************** *** 530,539 **** static int LUACALL wxLua_wxXmlResource_Unload(lua_State *L) { - wxLuaState wxlState(L); bool returns; // const wxString filename ! const wxString filename = wxlState.GetwxStringType(2); // get this ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // call Unload returns = (self->Unload(filename)); --- 507,515 ---- static int LUACALL wxLua_wxXmlResource_Unload(lua_State *L) { bool returns; // const wxString filename ! const wxString filename = wxlua_getwxstringtype(L, 2); // get this ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // call Unload returns = (self->Unload(filename)); *************** *** 549,556 **** static int LUACALL wxLua_wxXmlResource_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxXmlResource * self = (wxXmlResource *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlResource); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 525,531 ---- static int LUACALL wxLua_wxXmlResource_delete(lua_State *L) { ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 567,586 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxXRC_USE_LOCALE); // const wxString filemask ! const wxString filemask = wxlState.GetwxStringType(1); // call constructor returns = new wxXmlResource(filemask, flags, domain); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); return 1; --- 542,560 ---- { wxluabind_removetableforcall(L); wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 3 ? wxlua_getwxstringtype(L, 3) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxXRC_USE_LOCALE); // const wxString filemask ! const wxString filemask = wxlua_getwxstringtype(L, 1); // call constructor returns = new wxXmlResource(filemask, flags, domain); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); return 1; *************** *** 594,603 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxXRC_USE_LOCALE); --- 568,576 ---- { wxluabind_removetableforcall(L); wxXmlResource *returns; // get number of arguments int argCount = lua_gettop(L); // const wxString domain = "" ! const wxString domain = (argCount >= 2 ? wxlua_getwxstringtype(L, 2) : wxString(wxEmptyString)); // int flags = wxXRC_USE_LOCALE int flags = (argCount >= 1 ? (int)wxlua_getnumbertype(L, 1) : wxXRC_USE_LOCALE); *************** *** 605,611 **** returns = new wxXmlResource(flags, domain); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); return 1; --- 578,584 ---- returns = new wxXmlResource(flags, domain); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); return 1; *************** *** 634,641 **** static int LUACALL wxLua_wxXmlResource_LoadDialog_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "LoadDialog", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadDialog_overload, s_wxluafunc_wxLua_wxXmlResource_LoadDialog_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } #endif // ((wxLUA_USE_wxDialog) && (wxLUA_USE_wxXRC && wxUSE_XRC)) --- 607,613 ---- static int LUACALL wxLua_wxXmlResource_LoadDialog_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "LoadDialog", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadDialog_overload, s_wxluafunc_wxLua_wxXmlResource_LoadDialog_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } #endif // ((wxLUA_USE_wxDialog) && (wxLUA_USE_wxXRC && wxUSE_XRC)) *************** *** 660,667 **** static int LUACALL wxLua_wxXmlResource_LoadMenuBar_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "LoadMenuBar", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadMenuBar_overload, s_wxluafunc_wxLua_wxXmlResource_LoadMenuBar_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } #endif // ((wxLUA_USE_wxMenu && wxUSE_MENUS) && (wxLUA_USE_wxXRC && wxUSE_XRC)) --- 632,638 ---- static int LUACALL wxLua_wxXmlResource_LoadMenuBar_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "LoadMenuBar", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadMenuBar_overload, s_wxluafunc_wxLua_wxXmlResource_LoadMenuBar_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } #endif // ((wxLUA_USE_wxMenu && wxUSE_MENUS) && (wxLUA_USE_wxXRC && wxUSE_XRC)) *************** *** 680,687 **** static int LUACALL wxLua_wxXmlResource_LoadPanel_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "LoadPanel", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadPanel_overload, s_wxluafunc_wxLua_wxXmlResource_LoadPanel_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } static int LUACALL wxLua_wxXmlResource_constructor_overload(lua_State *L); --- 651,657 ---- static int LUACALL wxLua_wxXmlResource_LoadPanel_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "LoadPanel", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxXmlResource_LoadPanel_overload, s_wxluafunc_wxLua_wxXmlResource_LoadPanel_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } static int LUACALL wxLua_wxXmlResource_constructor_overload(lua_State *L); *************** *** 697,704 **** static int LUACALL wxLua_wxXmlResource_constructor_overload(lua_State *L) { - wxLuaState wxlState(L); static wxLuaBindMethod overload_method = { "wxXmlResource", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxXmlResource_constructor_overload, s_wxluafunc_wxLua_wxXmlResource_constructor_overload_count, 0 }; ! return wxlState.CallOverloadedFunction(&overload_method); } #endif // (wxLUA_USE_wxXRC && wxUSE_XRC) --- 667,673 ---- static int LUACALL wxLua_wxXmlResource_constructor_overload(lua_State *L) { static wxLuaBindMethod overload_method = { "wxXmlResource", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxXmlResource_constructor_overload, s_wxluafunc_wxLua_wxXmlResource_constructor_overload_count, 0 }; ! return wxlua_CallOverloadedFunction(L, &overload_method); } #endif // (wxLUA_USE_wxXRC && wxUSE_XRC) Index: wxcore_core.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_core.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxcore_core.cpp 1 Aug 2007 19:15:35 -0000 1.3 --- wxcore_core.cpp 7 Dec 2007 02:13:12 -0000 1.4 *************** *** 40,47 **** static int LUACALL wxLua_wxLogGui_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxLogGui * self = (wxLogGui *)wxlState.GetUserDataType(1, s_wxluatag_wxLogGui); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 40,46 ---- static int LUACALL wxLua_wxLogGui_delete(lua_State *L) { ! wxLogGui * self = (wxLogGui *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogGui); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 57,68 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxLogGui *returns; // call constructor returns = new wxLogGui(); // add to tracked memory list ! wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxLogGui((wxLogGui *)returns)); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLogGui, returns); return 1; --- 56,66 ---- { wxluabind_removetableforcall(L); wxLogGui *returns; // call constructor returns = new wxLogGui(); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxLogGui((wxLogGui *)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxLogGui, returns); return 1; *************** *** 98,105 **** static int LUACALL wxLua_wxLogTextCtrl_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxLogTextCtrl * self = (wxLogTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxLogTextCtrl); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 96,102 ---- static int LUACALL wxLua_wxLogTextCtrl_delete(lua_State *L) { ! wxLogTextCtrl * self = (wxLogTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogTextCtrl); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 118,131 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxLogTextCtrl *returns; // wxTextCtrl textCtrl ! wxTextCtrl * textCtrl = (wxTextCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxTextCtrl); // call constructor returns = new wxLogTextCtrl(textCtrl); // add to tracked memory list ! wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxLogTextCtrl((wxLogTextCtrl *)returns)); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLogTextCtrl, returns); return 1; --- 115,127 ---- { wxluabind_removetableforcall(L); wxLogTextCtrl *returns; // wxTextCtrl textCtrl ! wxTextCtrl * textCtrl = (wxTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextCtrl); // call constructor returns = new wxLogTextCtrl(textCtrl); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxLogTextCtrl((wxLogTextCtrl *)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxLogTextCtrl, returns); return 1; *************** *** 167,178 **** static int LUACALL wxLua_wxLogWindow_GetFrame(lua_State *L) { - wxLuaState wxlState(L); wxFrame *returns; // get this ! wxLogWindow * self = (wxLogWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxLogWindow); // call GetFrame returns = (wxFrame *)self->GetFrame(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxFrame, returns); return 1; --- 163,173 ---- static int LUACALL wxLua_wxLogWindow_GetFrame(lua_State *L) { wxFrame *returns; // get this ! wxLogWindow * self = (wxLogWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogWindow); // call GetFrame returns = (wxFrame *)self->GetFrame(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxFrame, returns); return 1; *************** *** 187,191 **** static int LUACALL wxLua_wxLogWindow_Show(lua_State *L) { - wxLuaState wxlState(L); // get number of arguments int argCount = lua_gettop(L); --- 182,185 ---- *************** *** 193,197 **** bool show = (argCount >= 2 ? wxlua_getbooleantype(L, 2) : true); // get this ! wxLogWindow * self = (wxLogWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxLogWindow); // call Show self->Show(show); --- 187,191 ---- bool show = (argCount >= 2 ? wxlua_getbooleantype(L, 2) : true); // get this ! wxLogWindow * self = (wxLogWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogWindow); // call Show self->Show(show); *************** *** 205,212 **** static int LUACALL wxLua_wxLogWindow_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxLogWindow * self = (wxLogWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxLogWindow); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 199,205 ---- static int LUACALL wxLua_wxLogWindow_delete(lua_State *L) { ! wxLogWindow * self = (wxLogWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogWindow); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 223,227 **** { wxluabind_removetableforcall(L); - wxLuaState wxlState(L); wxLogWindow *returns; // get number of arguments --- 216,219 ---- *************** *** 232,244 **** bool bShow = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : true); // const wxString szTitle ! const wxString szTitle = wxlState.GetwxStringType(2); // wxWindow pParent ! wxWindow * pParent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); // call constructor returns = new wxLogWindow(pParent, szTitle, bShow, bPassToOld); // add to tracked memory list ! wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxLogWindow((wxLogWindow *)returns)); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxLogWindow, returns); return 1; --- 224,236 ---- bool bShow = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : true); // const wxString szTitle ! const wxString szTitle = wxlua_getwxstringtype(L, 2); // wxWindow pParent ! wxWindow * pParent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor returns = new wxLogWindow(pParent, szTitle, bShow, bPassToOld); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxLogWindow((wxLogWindow *)returns)); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxLogWindow, returns); return 1; *************** *** 281,285 **** static int LUACALL wxLua_wxSystemSettings_GetColour(lua_State *L) { - wxLuaState wxlState(L); wxColour *returns; // wxSystemColour index --- 273,276 ---- *************** *** 289,295 **** returns = new wxColour(wxSystemSettings::GetColour(index)); // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxColour *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxColour, returns); return 1; --- 280,286 ---- returns = new wxColour(wxSystemSettings::GetColour(index)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxColour *)returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); return 1; *************** *** 305,309 **** static int LUACALL wxLua_wxSystemSettings_GetFont(lua_State *L) { - wxLuaState wxlState(L); wxFont *returns; // wxSystemFont index --- 296,299 ---- *************** *** 313,319 **** returns = new wxFont(wxSystemSettings::GetFont(index)); // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxFont *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxFont, returns); return 1; --- 303,309 ---- returns = new wxFont(wxSystemSettings::GetFont(index)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxFont *)returns); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxFont, returns); return 1; *************** *** 328,337 **** static int LUACALL wxLua_wxSystemSettings_GetMetric(lua_State *L) { - wxLuaState wxlState(L); int returns; // get number of arguments int argCount = lua_gettop(L); // wxWindow win = NULL ! wxWindow * win = (argCount >= 2 ? (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow) : NULL); // wxSystemMetric index wxSystemMetric index = (wxSystemMetric)wxlua_getintegertype(L, 1); --- 318,326 ---- static int LUACALL wxLua_wxSystemSettings_GetMetric(lua_State *L) { int returns; // get number of arguments int argCount = lua_gettop(L); // wxWindow win = NULL ! wxWindow * win = (argCount >= 2 ? (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow) : NULL); // wxSystemMetric index wxSystemMetric index = (wxSystemMetric)wxlua_getintegertype(L, 1); *************** *** 429,440 **** static int LUACALL wxLua_wxValidator_GetWindow(lua_State *L) { - wxLuaState wxlState(L); wxWindow *returns; // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call GetWindow returns = (wxWindow *)self->GetWindow(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxWindow, returns); return 1; --- 418,428 ---- static int LUACALL wxLua_wxValidator_GetWindow(lua_State *L) { wxWindow *returns; // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call GetWindow returns = (wxWindow *)self->GetWindow(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxWindow, returns); return 1; *************** *** 477,485 **** static int LUACALL wxLua_wxValidator_SetWindow(lua_State *L) { - wxLuaState wxlState(L); // wxWindow window ! wxWindow * window = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call SetWindow self->SetWindow(window); --- 465,472 ---- static int LUACALL wxLua_wxValidator_SetWindow(lua_State *L) { // wxWindow window ! wxWindow * window = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call SetWindow self->SetWindow(window); *************** *** 494,501 **** static int LUACALL wxLua_wxValidator_TransferFromWindow(lua_State *L) { - wxLuaState wxlState(L); bool returns; // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call TransferFromWindow returns = (self->TransferFromWindow()); --- 481,487 ---- static int LUACALL wxLua_wxValidator_TransferFromWindow(lua_State *L) { bool returns; // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call TransferFromWindow returns = (self->TransferFromWindow()); *************** *** 512,519 **** static int LUACALL wxLua_wxValidator_TransferToWindow(lua_State *L) { - wxLuaState wxlState(L); bool returns; // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call TransferToWindow returns = (self->TransferToWindow()); --- 498,504 ---- static int LUACALL wxLua_wxValidator_TransferToWindow(lua_State *L) { bool returns; // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call TransferToWindow returns = (self->TransferToWindow()); *************** *** 530,539 **** static int LUACALL wxLua_wxValidator_Validate(lua_State *L) { - wxLuaState wxlState(L); bool returns; // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); // get this ! wxValidator * self = (wxValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxValidator); // call Validate returns = (self->Validate(parent)); --- 515,523 ---- static int LUACALL wxLua_wxValidator_Validate(lua_State *L) { bool returns; // wxWindow parent ! wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxWindow); // get this ! wxValidator * self = (wxValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxValidator); // call Validate returns = (self->Validate(parent)); *************** *** 580,591 **** static int LUACALL wxLua_wxTextValidator_GetExcludes(lua_State *L) { - wxLuaState wxlState(L); wxArrayString *returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call GetExcludes returns = &self->GetExcludes(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxArrayString, returns); return 1; --- 564,574 ---- static int LUACALL wxLua_wxTextValidator_GetExcludes(lua_State *L) { wxArrayString *returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call GetExcludes returns = &self->GetExcludes(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxArrayString, returns); return 1; *************** *** 598,609 **** static int LUACALL wxLua_wxTextValidator_GetIncludes(lua_State *L) { - wxLuaState wxlState(L); wxArrayString *returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call GetIncludes returns = &self->GetIncludes(); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxArrayString, returns); return 1; --- 581,591 ---- static int LUACALL wxLua_wxTextValidator_GetIncludes(lua_State *L) { wxArrayString *returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call GetIncludes returns = &self->GetIncludes(); // push the result datatype ! wxluaT_pushuserdatatype(L, s_wxluatag_wxArrayString, returns); return 1; *************** *** 618,625 **** static int LUACALL wxLua_wxTextValidator_GetStyle(lua_State *L) { - wxLuaState wxlState(L); long returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call GetStyle returns = (self->GetStyle()); --- 600,606 ---- static int LUACALL wxLua_wxTextValidator_GetStyle(lua_State *L) { long returns; // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call GetStyle returns = (self->GetStyle()); *************** *** 638,646 **** static int LUACALL wxLua_wxTextValidator_SetExcludes(lua_State *L) { - wxLuaState wxlState(L); // const wxArrayString excludes ! wxArrayString excludes = wxArrayString(); wxlState.GetwxArrayString(2, excludes); // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetExcludes self->SetExcludes(excludes); --- 619,626 ---- static int LUACALL wxLua_wxTextValidator_SetExcludes(lua_State *L) { // const wxArrayString excludes ! wxLuaSmartwxArrayString excludes = wxlua_getwxArrayString(L, 2); // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call SetExcludes self->SetExcludes(excludes); *************** *** 655,663 **** static int LUACALL wxLua_wxTextValidator_SetIncludes(lua_State *L) { - wxLuaState wxlState(L); // const wxArrayString includes ! wxArrayString includes = wxArrayString(); wxlState.GetwxArrayString(2, includes); // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetIncludes self->SetIncludes(includes); --- 635,642 ---- static int LUACALL wxLua_wxTextValidator_SetIncludes(lua_State *L) { // const wxArrayString includes ! wxLuaSmartwxArrayString includes = wxlua_getwxArrayString(L, 2); // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call SetIncludes self->SetIncludes(includes); *************** *** 674,682 **** static int LUACALL wxLua_wxTextValidator_SetStyle(lua_State *L) { - wxLuaState wxlState(L); // long style long style = (long)wxlua_getnumbertype(L, 2); // get this ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetStyle self->SetStyle(style); --- 653,660 ---- static int LUACALL wxLua_wxTextValidator_SetStyle(lua_State *L) { // long style long style = (long)wxlua_getnumbertype(L, 2); // get this ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // call SetStyle self->SetStyle(style); *************** *** 690,697 **** static int LUACALL wxLua_wxTextValidator_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 668,674 ---- static int LUACALL wxLua_wxTextValidator_delete(lua_State *L) { ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 709,723 **** { wxluabind_removetableforcall(L); ! wxLuaState wxlState(L); wxTextValidator *returns; // get number of arguments int argCount = lua_gettop(L); // long style = wxFILTER_NONE ! long style = (argCount >= 1 ? (long)wxlState.GetNumberType(1) : wxFILTER_NONE); // call constructor if (argCount >= 2) { ! wxLuaObject *valPtr = (wxLuaObject *)wxlState.GetUserDataType(2, s_wxluatag_wxLuaObject); returns = new wxTextValidator(style, valPtr->GetStringPtr()); } --- 686,700 ---- { wxluabind_removetableforcall(L); ! wxTextValidator *returns; // get number of arguments int argCount = lua_gettop(L); // long style = wxFILTER_NONE ! long style = (argCount >= 1 ? (long)wxlua_getintegertype(L, 1) : wxFILTER_NONE); // call constructor if (argCount >= 2) { ! wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxLuaObject); returns = new wxTextValidator(style, valPtr->GetStringPtr()); } *************** *** 726,730 **** // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxTextValidator, returns); // return the number of parameters return 1; --- 703,707 ---- // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxTextValidator, returns); // return the number of parameters return 1; *************** *** 774,781 **** static int LUACALL wxLua_wxGenericValidator_delete(lua_State *L) { ! wxLuaState wxlState(L); ! wxGenericValidator * self = (wxGenericValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericValidator); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxlState.RemoveTrackedObject(self, wxLuaState::DELETE_CLEAR_OBJECT)) { lua_pushnil(L); --- 751,757 ---- static int LUACALL wxLua_wxGenericValidator_delete(lua_State *L) { ! wxGenericValidator * self = (wxGenericValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGenericValidator); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) { lua_pushnil(L); *************** *** 793,806 **** { wxluabind_removetableforcall(L); ! wxLuaState wxlState(L); wxGenericValidator *returns; // wxLuaObject *valPtr ! wxLuaObject *valPtr = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call constructor returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); // return the number of parameters return 1; --- 769,782 ---- { wxluabind_removetableforcall(L); ! wxGenericValidator *returns; // wxLuaObject *valPtr ! wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); // call constructor returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer ! wxluaT_pushuserdatatype(L, s_wxluatag_wxGeneri... [truncated message content] |