From: John L. <jr...@us...> - 2007-06-27 19:56:33
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/modules/wxbind/src Modified Files: appframe.cpp wx_bind.cpp Log Message: Add wxDynamicLibrary and friends to bindings Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** wx_bind.cpp 27 Jun 2007 15:57:14 -0000 1.122 --- wx_bind.cpp 27 Jun 2007 19:56:30 -0000 1.123 *************** *** 1269,1272 **** --- 1269,1283 ---- #endif // wxLUA_USE_wxDir + { "wxDL_DEFAULT", wxDL_DEFAULT }, + { "wxDL_GLOBAL", wxDL_GLOBAL }, + { "wxDL_LAZY", wxDL_LAZY }, + { "wxDL_LIBRARY", wxDL_LIBRARY }, + { "wxDL_MODULE", wxDL_MODULE }, + { "wxDL_NOSHARE", wxDL_NOSHARE }, + { "wxDL_NOW", wxDL_NOW }, + { "wxDL_PLUGIN_BASE", wxDL_PLUGIN_BASE }, + { "wxDL_PLUGIN_GUI", wxDL_PLUGIN_GUI }, + { "wxDL_VERBATIM", wxDL_VERBATIM }, + #if wxLUA_USE_MDI && wxUSE_MDI && wxUSE_DOC_VIEW_ARCHITECTURE { "wxDOC_NEW", wxDOC_NEW }, *************** *** 7201,7204 **** --- 7212,7218 ---- #endif // wxLUA_USE_wxDragDrop && wxUSE_DRAG_AND_DROP + { "wxDynamicLibrary", wxDynamicLibrary_methods, wxDynamicLibrary_methodCount, NULL, &s_wxluatag_wxDynamicLibrary, NULL, NULL ,s_wxluadefineArray_None, 0, }, + { "wxDynamicLibraryDetails", wxDynamicLibraryDetails_methods, wxDynamicLibraryDetails_methodCount, NULL, &s_wxluatag_wxDynamicLibraryDetails, NULL, NULL ,s_wxluadefineArray_None, 0, }, + { "wxDynamicLibraryDetailsArray", wxDynamicLibraryDetailsArray_methods, wxDynamicLibraryDetailsArray_methodCount, NULL, &s_wxluatag_wxDynamicLibraryDetailsArray, NULL, NULL ,s_wxluadefineArray_None, 0, }, { "wxEffects", wxEffects_methods, wxEffects_methodCount, CLASSINFO(wxEffects), &s_wxluatag_wxEffects, "wxObject", NULL ,s_wxluadefineArray_None, 0, }, { "wxEraseEvent", wxEraseEvent_methods, wxEraseEvent_methodCount, CLASSINFO(wxEraseEvent), &s_wxluatag_wxEraseEvent, "wxEvent", NULL ,s_wxluadefineArray_None, 0, }, *************** *** 8304,8307 **** --- 8318,8324 ---- #endif // (wxLUA_USE_wxSizer) && (wxCHECK_VERSION(2,8,0)) + wxLUA_IMPLEMENT_ENCAPSULATION(wxDynamicLibrary, wxDynamicLibrary) + wxLUA_IMPLEMENT_ENCAPSULATION(wxDynamicLibraryDetails, wxDynamicLibraryDetails) + wxLUA_IMPLEMENT_ENCAPSULATION(wxDynamicLibraryDetailsArray, wxDynamicLibraryDetailsArray) wxLUA_IMPLEMENT_ENCAPSULATION(wxFileType, wxFileType) wxLUA_IMPLEMENT_ENCAPSULATION(wxFileType::MessageParameters, wxFileType_MessageParameters) Index: appframe.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/appframe.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** appframe.cpp 26 Jun 2007 03:22:05 -0000 1.62 --- appframe.cpp 27 Jun 2007 19:56:30 -0000 1.63 *************** *** 5215,5216 **** --- 5215,5660 ---- + // --------------------------------------------------------------------------- + // Bind class wxDynamicLibraryDetails + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxDynamicLibraryDetails' + int s_wxluatag_wxDynamicLibraryDetails = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetName[] = { &s_wxluatag_wxDynamicLibraryDetails, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetails_GetName(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetName[1] = {{ wxLua_wxDynamicLibraryDetails_GetName, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetName }}; + // wxString GetName() const // get the (base) name + static int LUACALL wxLua_wxDynamicLibraryDetails_GetName(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxDynamicLibraryDetails * self = (wxDynamicLibraryDetails *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetails); + // call GetName + returns = (self->GetName()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetPath[] = { &s_wxluatag_wxDynamicLibraryDetails, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetails_GetPath(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetPath[1] = {{ wxLua_wxDynamicLibraryDetails_GetPath, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetPath }}; + // wxString GetPath() const // get the full path of this object + static int LUACALL wxLua_wxDynamicLibraryDetails_GetPath(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxDynamicLibraryDetails * self = (wxDynamicLibraryDetails *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetails); + // call GetPath + returns = (self->GetPath()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetVersion[] = { &s_wxluatag_wxDynamicLibraryDetails, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetails_GetVersion(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetVersion[1] = {{ wxLua_wxDynamicLibraryDetails_GetVersion, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetVersion }}; + // wxString GetVersion() const // return the version of the DLL (may be empty if no version info) + static int LUACALL wxLua_wxDynamicLibraryDetails_GetVersion(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxDynamicLibraryDetails * self = (wxDynamicLibraryDetails *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetails); + // call GetVersion + returns = (self->GetVersion()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetails_delete[] = { &s_wxluatag_wxDynamicLibraryDetails, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetails_delete(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetails_delete[1] = {{ wxLua_wxDynamicLibraryDetails_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetails_delete }}; + static int LUACALL wxLua_wxDynamicLibraryDetails_delete(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibraryDetails * self = (wxDynamicLibraryDetails *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetails); + // if removed from tracked mem list, reset the tag so that gc() is not called on this object. + if ((self != NULL) && wxlState.RemoveTrackedObject(self)) + { + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxDynamicLibraryDetails_methods[] = { + { "GetName", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetName, 1, NULL }, + { "GetPath", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetPath, 1, NULL }, + { "GetVersion", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetVersion, 1, NULL }, + { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxDynamicLibraryDetails_delete, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxDynamicLibraryDetails_methodCount = sizeof(wxDynamicLibraryDetails_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxDynamicLibraryDetailsArray + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxDynamicLibraryDetailsArray' + int s_wxluatag_wxDynamicLibraryDetailsArray = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_GetCount[] = { &s_wxluatag_wxDynamicLibraryDetailsArray, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_GetCount(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_GetCount[1] = {{ wxLua_wxDynamicLibraryDetailsArray_GetCount, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_GetCount }}; + // int GetCount() const + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_GetCount(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // get this + wxDynamicLibraryDetailsArray * self = (wxDynamicLibraryDetailsArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetailsArray); + // call GetCount + returns = (self->GetCount()); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_Item[] = { &s_wxluatag_wxDynamicLibraryDetailsArray, &s_wxluaarg_Number, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_Item(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_Item[1] = {{ wxLua_wxDynamicLibraryDetailsArray_Item, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_Item }}; + // wxDynamicLibraryDetails Item( int n ) + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_Item(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibraryDetails *returns; + // int n + int n = (int)wxlua_getnumbertype(L, 2); + // get this + wxDynamicLibraryDetailsArray * self = (wxDynamicLibraryDetailsArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetailsArray); + // call Item + // allocate a new object using the copy constructor + returns = new wxDynamicLibraryDetails(self->Item(n)); + // add the new object to the tracked memory list + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxDynamicLibraryDetails((wxDynamicLibraryDetails *)returns)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxDynamicLibraryDetails, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_delete[] = { &s_wxluatag_wxDynamicLibraryDetailsArray, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_delete(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_delete[1] = {{ wxLua_wxDynamicLibraryDetailsArray_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_delete }}; + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_delete(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibraryDetailsArray * self = (wxDynamicLibraryDetailsArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetailsArray); + // if removed from tracked mem list, reset the tag so that gc() is not called on this object. + if ((self != NULL) && wxlState.RemoveTrackedObject(self)) + { + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxDynamicLibraryDetailsArray_methods[] = { + { "GetCount", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_GetCount, 1, NULL }, + { "Item", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_Item, 1, NULL }, + { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_delete, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxDynamicLibraryDetailsArray_methodCount = sizeof(wxDynamicLibraryDetailsArray_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxDynamicLibrary + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxDynamicLibrary' + int s_wxluatag_wxDynamicLibrary = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_CanonicalizeName[] = { &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_CanonicalizeName(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_CanonicalizeName[1] = {{ wxLua_wxDynamicLibrary_CanonicalizeName, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 1, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_CanonicalizeName }}; + // static wxString CanonicalizeName(const wxString& name, wxDynamicLibraryCategory cat = wxDL_LIBRARY); + static int LUACALL wxLua_wxDynamicLibrary_CanonicalizeName(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxDynamicLibraryCategory cat = wxDL_LIBRARY + wxDynamicLibraryCategory cat = (argCount >= 2 ? (wxDynamicLibraryCategory)wxlua_getintegertype(L, 2) : wxDL_LIBRARY); + // const wxString name + const wxString name = wxlState.GetwxStringType(1); + // call CanonicalizeName + returns = (wxDynamicLibrary::CanonicalizeName(name, cat)); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_CanonicalizePluginName[] = { &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_CanonicalizePluginName(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_CanonicalizePluginName[1] = {{ wxLua_wxDynamicLibrary_CanonicalizePluginName, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 1, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_CanonicalizePluginName }}; + // static wxString CanonicalizePluginName(const wxString& name, wxPluginCategory cat = wxDL_PLUGIN_GUI); + static int LUACALL wxLua_wxDynamicLibrary_CanonicalizePluginName(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxPluginCategory cat = wxDL_PLUGIN_GUI + wxPluginCategory cat = (argCount >= 2 ? (wxPluginCategory)wxlua_getintegertype(L, 2) : wxDL_PLUGIN_GUI); + // const wxString name + const wxString name = wxlState.GetwxStringType(1); + // call CanonicalizePluginName + returns = (wxDynamicLibrary::CanonicalizePluginName(name, cat)); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static int LUACALL wxLua_wxDynamicLibrary_GetDllExt(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_GetDllExt[1] = {{ wxLua_wxDynamicLibrary_GetDllExt, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 0, s_wxluaargArray_None }}; + // static wxString GetDllExt() + static int LUACALL wxLua_wxDynamicLibrary_GetDllExt(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // call GetDllExt + returns = (wxDynamicLibrary::GetDllExt()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static int LUACALL wxLua_wxDynamicLibrary_GetPluginsDirectory(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_GetPluginsDirectory[1] = {{ wxLua_wxDynamicLibrary_GetPluginsDirectory, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 0, s_wxluaargArray_None }}; + // static wxString GetPluginsDirectory() + static int LUACALL wxLua_wxDynamicLibrary_GetPluginsDirectory(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // call GetPluginsDirectory + returns = (wxDynamicLibrary::GetPluginsDirectory()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_HasSymbol[] = { &s_wxluatag_wxDynamicLibrary, &s_wxluaarg_String, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_HasSymbol(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_HasSymbol[1] = {{ wxLua_wxDynamicLibrary_HasSymbol, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_HasSymbol }}; + // bool HasSymbol(const wxString& name) const + static int LUACALL wxLua_wxDynamicLibrary_HasSymbol(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString name + const wxString name = wxlState.GetwxStringType(2); + // get this + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // call HasSymbol + returns = (self->HasSymbol(name)); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_IsLoaded[] = { &s_wxluatag_wxDynamicLibrary, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_IsLoaded(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_IsLoaded[1] = {{ wxLua_wxDynamicLibrary_IsLoaded, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibrary_IsLoaded }}; + // bool IsLoaded() const + static int LUACALL wxLua_wxDynamicLibrary_IsLoaded(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // call IsLoaded + returns = (self->IsLoaded()); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static int LUACALL wxLua_wxDynamicLibrary_ListLoaded(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_ListLoaded[1] = {{ wxLua_wxDynamicLibrary_ListLoaded, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 0, s_wxluaargArray_None }}; + // static wxDynamicLibraryDetailsArray ListLoaded(); + static int LUACALL wxLua_wxDynamicLibrary_ListLoaded(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibraryDetailsArray *returns; + // call ListLoaded + // allocate a new object using the copy constructor + returns = new wxDynamicLibraryDetailsArray(wxDynamicLibrary::ListLoaded()); + // add the new object to the tracked memory list + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxDynamicLibraryDetailsArray((wxDynamicLibraryDetailsArray *)returns)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxDynamicLibraryDetailsArray, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_Load[] = { &s_wxluatag_wxDynamicLibrary, &s_wxluaarg_String, &s_wxluaarg_Number, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_Load(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_Load[1] = {{ wxLua_wxDynamicLibrary_Load, WXLUAMETHOD_METHOD, 2, 3, s_wxluatagArray_wxLua_wxDynamicLibrary_Load }}; + // bool Load(const wxString& libname, int flags = wxDL_DEFAULT); + static int LUACALL wxLua_wxDynamicLibrary_Load(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // int flags = wxDL_DEFAULT + int flags = (argCount >= 3 ? (int)wxlua_getnumbertype(L, 3) : wxDL_DEFAULT); + // const wxString libname + const wxString libname = wxlState.GetwxStringType(2); + // get this + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // call Load + returns = (self->Load(libname, flags)); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_Unload[] = { &s_wxluatag_wxDynamicLibrary, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_Unload(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_Unload[1] = {{ wxLua_wxDynamicLibrary_Unload, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibrary_Unload }}; + // void Unload() + static int LUACALL wxLua_wxDynamicLibrary_Unload(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // call Unload + self->Unload(); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_delete[] = { &s_wxluatag_wxDynamicLibrary, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_delete(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_delete[1] = {{ wxLua_wxDynamicLibrary_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibrary_delete }}; + static int LUACALL wxLua_wxDynamicLibrary_delete(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // if removed from tracked mem list, reset the tag so that gc() is not called on this object. + if ((self != NULL) && wxlState.RemoveTrackedObject(self)) + { + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + static int LUACALL wxLua_wxDynamicLibrary_constructor(lua_State *L); + // static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_constructor[1] = {{ wxLua_wxDynamicLibrary_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }}; + // wxDynamicLibrary() + static int LUACALL wxLua_wxDynamicLibrary_constructor(lua_State *L) + { + wxluabind_removetableforcall(L); + wxLuaState wxlState(L); + wxDynamicLibrary *returns; + // call constructor + returns = new wxDynamicLibrary(); + // add to tracked memory list + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxDynamicLibrary((wxDynamicLibrary *)returns)); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxDynamicLibrary, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_constructor1[] = { &s_wxluaarg_String, &s_wxluaarg_Number, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_constructor1(lua_State *L); + // static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_constructor1[1] = {{ wxLua_wxDynamicLibrary_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_constructor1 }}; + // wxDynamicLibrary(const wxString& libname, int flags = wxDL_DEFAULT) + static int LUACALL wxLua_wxDynamicLibrary_constructor1(lua_State *L) + { + wxluabind_removetableforcall(L); + wxLuaState wxlState(L); + wxDynamicLibrary *returns; + // get number of arguments + int argCount = lua_gettop(L); + // int flags = wxDL_DEFAULT + int flags = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxDL_DEFAULT); + // const wxString libname + const wxString libname = wxlState.GetwxStringType(1); + // call constructor + returns = new wxDynamicLibrary(libname, flags); + // add to tracked memory list + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxDynamicLibrary((wxDynamicLibrary *)returns)); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxDynamicLibrary, returns); + + return 1; + } + + + + static int LUACALL wxLua_wxDynamicLibrary_constructor_overload(lua_State *L); + // function overload table + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload[] = + { + { wxLua_wxDynamicLibrary_constructor_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 0, 2, s_wxluaargArray_None }, + { wxLua_wxDynamicLibrary_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }, + { wxLua_wxDynamicLibrary_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_constructor1 }, + }; + static int s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload_count = sizeof(s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload)/sizeof(wxLuaBindCFunc); + // Overloaded function for wxDynamicLibrary::wxDynamicLibrary + static int LUACALL wxLua_wxDynamicLibrary_constructor_overload(lua_State *L) + { + wxLuaState wxlState(L); + static wxLuaBindMethod overload_method = + { "wxDynamicLibrary", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload, s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload_count, 0 }; + return wxlState.CallOverloadedFunction(&overload_method); + } + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxDynamicLibrary_methods[] = { + { "CanonicalizeName", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_CanonicalizeName, 1, NULL }, + { "CanonicalizePluginName", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_CanonicalizePluginName, 1, NULL }, + { "GetDllExt", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_GetDllExt, 1, NULL }, + { "GetPluginsDirectory", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_GetPluginsDirectory, 1, NULL }, + { "HasSymbol", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibrary_HasSymbol, 1, NULL }, + { "IsLoaded", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibrary_IsLoaded, 1, NULL }, + { "ListLoaded", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_ListLoaded, 1, NULL }, + { "Load", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibrary_Load, 1, NULL }, + { "Unload", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibrary_Unload, 1, NULL }, + { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxDynamicLibrary_delete, 1, NULL }, + + { "wxDynamicLibrary", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload, s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload_count, 0 }, + + { 0, 0, 0, 0 }, + }; + + int wxDynamicLibrary_methodCount = sizeof(wxDynamicLibrary_methods)/sizeof(wxLuaBindMethod) - 1; + + |