From: John L. <jr...@us...> - 2006-12-19 06:18:08
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15689/wxLua/modules/wxbind/src Modified Files: appframe.cpp gdi.cpp wx_bind.cpp Log Message: update wxluaref.html add wxIconBundle Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** wx_bind.cpp 17 Dec 2006 07:47:16 -0000 1.70 --- wx_bind.cpp 19 Dec 2006 06:18:03 -0000 1.71 *************** *** 5944,5947 **** --- 5944,5948 ---- #if wxLUA_USE_wxIcon { "wxIcon", wxIcon_methods, wxIcon_methodCount, -1, CLASSINFO(wxIcon), &s_wxluatag_wxIcon, "wxGDIObject" }, + { "wxIconBundle", wxIconBundle_methods, wxIconBundle_methodCount, -1, NULL, &s_wxluatag_wxIconBundle, NULL }, #endif // wxLUA_USE_wxIcon *************** *** 6616,6619 **** --- 6617,6625 ---- + #if wxLUA_USE_wxIcon + wxLUA_IMPLEMENT_ENCAPSULATION(wxIconBundle, wxIconBundle) + #endif // wxLUA_USE_wxIcon + + #if wxLUA_USE_wxPointSizeRect wxLUA_IMPLEMENT_ENCAPSULATION(wxPoint, wxPoint) Index: gdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/gdi.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** gdi.cpp 17 Dec 2006 07:47:15 -0000 1.39 --- gdi.cpp 19 Dec 2006 06:18:02 -0000 1.40 *************** *** 5514,5517 **** --- 5514,5698 ---- + #if wxLUA_USE_wxIcon + // ------------------------------------------------------------------------------------------------- + // Bind class wxIconBundle + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxIconBundle' + int s_wxluatag_wxIconBundle = -1; + + + #if (wxLUA_USE_wxIcon) && (wxLUA_USE_wxPointSizeRect) + static wxLuaArgTag s_wxluatagArray_wxLua_wxIconBundle_GetIcon[] = { &s_wxluatag_wxSize, 0 }; + // const wxIcon& GetIcon( const wxSize& size ) const; + static int LUACALL wxLua_wxIconBundle_GetIcon(lua_State *L) + { + wxLuaState wxlState(L); + const wxIcon *returns; + // const wxSize size + const wxSize * size = (const wxSize *)wxlState.GetUserDataType(2, s_wxluatag_wxSize); + // get this + wxIconBundle * self = (wxIconBundle *)wxlState.GetUserDataType(1, s_wxluatag_wxIconBundle); + // call GetIcon + returns = &self->GetIcon(*size); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxIcon, returns); + + return 1; + } + + #endif // (wxLUA_USE_wxIcon) && (wxLUA_USE_wxPointSizeRect) + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDefaultIconBundle_constructor[] = { 0 }; + // %constructor wxDefaultIconBundle() + static int LUACALL wxLua_wxDefaultIconBundle_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxIconBundle *returns; + // call constructor + returns = new wxIconBundle(); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxIconBundle *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxIconBundle, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxIconBundle_constructor[] = { &s_wxluatag_wxIcon, 0 }; + // wxIconBundle( const wxIcon& icon ) + static int LUACALL wxLua_wxIconBundle_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxIconBundle *returns; + // const wxIcon icon + const wxIcon * icon = (const wxIcon *)wxlState.GetUserDataType(1, s_wxluatag_wxIcon); + // call constructor + returns = new wxIconBundle(*icon); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxIconBundle *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxIconBundle, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxIconBundleCopy_constructor[] = { &s_wxluatag_wxIconBundle, 0 }; + // %constructor wxIconBundleCopy( const wxIconBundle& ic ) + static int LUACALL wxLua_wxIconBundleCopy_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxIconBundle *returns; + // const wxIconBundle ic + const wxIconBundle * ic = (const wxIconBundle *)wxlState.GetUserDataType(1, s_wxluatag_wxIconBundle); + // call constructor + returns = new wxIconBundle(*ic); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxIconBundle *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxIconBundle, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxIconBundle_AddIcon1[] = { &s_wxluaarg_String, &s_wxluaarg_Number, 0 }; + // %overload void AddIcon( const wxString& file, long type ) + static int LUACALL wxLua_wxIconBundle_AddIcon1(lua_State *L) + { + wxLuaState wxlState(L); + // long type + long type = (long)wxlState.GetNumberType(3); + // const wxString file + const wxString file = lua2wx(wxlState.GetStringType(2)); + // get this + wxIconBundle * self = (wxIconBundle *)wxlState.GetUserDataType(1, s_wxluatag_wxIconBundle); + // call AddIcon + self->AddIcon(file, type); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxIconBundle_AddIcon2[] = { &s_wxluatag_wxIcon, 0 }; + // %overload void AddIcon( const wxIcon& icon ); + static int LUACALL wxLua_wxIconBundle_AddIcon2(lua_State *L) + { + wxLuaState wxlState(L); + // const wxIcon icon + const wxIcon * icon = (const wxIcon *)wxlState.GetUserDataType(2, s_wxluatag_wxIcon); + // get this + wxIconBundle * self = (wxIconBundle *)wxlState.GetUserDataType(1, s_wxluatag_wxIconBundle); + // call AddIcon + self->AddIcon(*icon); + + return 0; + } + + static int LUACALL wxLua_wxIconBundle_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxIconBundle * self = (wxIconBundle *)wxlState.GetUserDataType(1, s_wxluatag_wxIconBundle); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedObject(self); + return 0; + } + + static int LUACALL wxLua_wxIconBundle_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxIconBundle * self = (wxIconBundle *)wxlState.GetUserDataType(1, s_wxluatag_wxIconBundle); + // remove from tracked memory list + if (self != 0) + if (wxlState.RemoveTrackedObject(self)) + { // if removed, reset the tag so that gc() is not called on this object. + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + + + // Overloaded function bindings + + #if (wxLUA_USE_wxIcon) + // Overloaded functions for wxLua_wxIconBundle_AddIcon + static int LUACALL wxLua_wxIconBundle_AddIcon(lua_State *L) + { + // function overload table + static WXLUAMETHOD overloaded_methods[] = + { + { LuaMethod, "AddIcon", wxLua_wxIconBundle_AddIcon1, 2, 2, s_wxluatagArray_wxLua_wxIconBundle_AddIcon1 }, + { LuaMethod, "AddIcon", wxLua_wxIconBundle_AddIcon2, 1, 1, s_wxluatagArray_wxLua_wxIconBundle_AddIcon2 }, + }; + static int overloaded_methodCount = sizeof(overloaded_methods)/sizeof(overloaded_methods[0]); + wxLuaState wxlState(L); + return wxlState.CallOverloadedFunction(overloaded_methods, overloaded_methodCount); + } + #endif // (wxLUA_USE_wxIcon) + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxIconBundle_methods[] = { + + #if (wxLUA_USE_wxIcon) && (wxLUA_USE_wxPointSizeRect) + { LuaMethod, "GetIcon", wxLua_wxIconBundle_GetIcon, 1, 1, s_wxluatagArray_wxLua_wxIconBundle_GetIcon }, + #endif // (wxLUA_USE_wxIcon) && (wxLUA_USE_wxPointSizeRect) + + { LuaConstructor, "wxDefaultIconBundle", wxLua_wxDefaultIconBundle_constructor, 0, 0, s_wxluatagArray_wxLua_wxDefaultIconBundle_constructor }, + { LuaConstructor, "wxIconBundle", wxLua_wxIconBundle_constructor, 1, 1, s_wxluatagArray_wxLua_wxIconBundle_constructor }, + { LuaConstructor, "wxIconBundleCopy", wxLua_wxIconBundleCopy_constructor, 1, 1, s_wxluatagArray_wxLua_wxIconBundleCopy_constructor }, + { LuaMethod, "AddIcon", wxLua_wxIconBundle_AddIcon, 2, 2, s_wxluatagArray_wxLua_wxIconBundle_AddIcon1 }, + { LuaMethod, "AddIcon", wxLua_wxIconBundle_AddIcon, 1, 1, s_wxluatagArray_wxLua_wxIconBundle_AddIcon2 }, + { LuaDelete, "wxIconBundle", wxLua_wxIconBundle_destructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Delete", wxLua_wxIconBundle_Delete, 0, 0, s_wxluaargArray_None }, + }; + + int wxIconBundle_methodCount = sizeof(wxIconBundle_methods)/sizeof(wxIconBundle_methods[0]); + #endif // wxLUA_USE_wxIcon + + #if (defined(__WXMSW__)) && (wxLUA_USE_wxBitmap) // ------------------------------------------------------------------------------------------------- Index: appframe.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/appframe.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** appframe.cpp 17 Dec 2006 07:47:14 -0000 1.28 --- appframe.cpp 19 Dec 2006 06:18:02 -0000 1.29 *************** *** 513,516 **** --- 513,531 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxTopLevelWindow_SetIcons[] = { &s_wxluatag_wxIconBundle, 0 }; + // void SetIcons(const wxIconBundle& icons) + static int LUACALL wxLua_wxTopLevelWindow_SetIcons(lua_State *L) + { + wxLuaState wxlState(L); + // const wxIconBundle icons + const wxIconBundle * icons = (const wxIconBundle *)wxlState.GetUserDataType(2, s_wxluatag_wxIconBundle); + // get this + wxTopLevelWindow * self = (wxTopLevelWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxTopLevelWindow); + // call SetIcons + self->SetIcons(*icons); + + return 0; + } + #endif // (wxLUA_USE_wxIcon) && (wxLUA_USE_wxFrame || wxLUA_USE_wxDialog) *************** *** 711,714 **** --- 726,730 ---- { LuaMethod, "GetIcon", wxLua_wxTopLevelWindow_GetIcon, 0, 0, s_wxluatagArray_wxLua_wxTopLevelWindow_GetIcon }, { LuaMethod, "SetIcon", wxLua_wxTopLevelWindow_SetIcon, 1, 1, s_wxluatagArray_wxLua_wxTopLevelWindow_SetIcon }, + { LuaMethod, "SetIcons", wxLua_wxTopLevelWindow_SetIcons, 1, 1, s_wxluatagArray_wxLua_wxTopLevelWindow_SetIcons }, #endif // (wxLUA_USE_wxIcon) && (wxLUA_USE_wxFrame || wxLUA_USE_wxDialog) |