From: John L. <jr...@us...> - 2007-06-26 16:15:52
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27934/wxLua/modules/wxbind/src Modified Files: datetime.cpp Log Message: Added wxLocale::Init functions for debugging problems Index: datetime.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/datetime.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** datetime.cpp 26 Jun 2007 03:22:06 -0000 1.51 --- datetime.cpp 26 Jun 2007 16:15:48 -0000 1.52 *************** *** 5816,5819 **** --- 5816,5873 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_Init1[] = { &s_wxluatag_wxLocale, &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; + static int LUACALL wxLua_wxLocale_Init1(lua_State *L); + // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_Init1[1] = {{ wxLua_wxLocale_Init1, WXLUAMETHOD_METHOD, 1, 3, s_wxluatagArray_wxLua_wxLocale_Init1 }}; + // bool Init(int language = wxLANGUAGE_DEFAULT, int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING); + static int LUACALL wxLua_wxLocale_Init1(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING + int flags = (argCount >= 3 ? (int)wxlua_getnumbertype(L, 3) : wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING); + // int language = wxLANGUAGE_DEFAULT + int language = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxLANGUAGE_DEFAULT); + // get this + wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); + // call Init + returns = (self->Init(language, flags)); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_Init[] = { &s_wxluatag_wxLocale, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, NULL }; + static int LUACALL wxLua_wxLocale_Init(lua_State *L); + // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_Init[1] = {{ wxLua_wxLocale_Init, WXLUAMETHOD_METHOD, 2, 6, s_wxluatagArray_wxLua_wxLocale_Init }}; + // bool Init(const wxString &szName, const wxString &szShort = "", const wxString &szLocale = "", bool bLoadDefault = true, bool bConvertEncoding = false) + static int LUACALL wxLua_wxLocale_Init(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // bool bConvertEncoding = false + bool bConvertEncoding = (argCount >= 6 ? wxlua_getbooleantype(L, 6) : false); + // bool bLoadDefault = true + bool bLoadDefault = (argCount >= 5 ? wxlua_getbooleantype(L, 5) : true); + // const wxString szLocale = "" + const wxString szLocale = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); + // const wxString szShort = "" + const wxString szShort = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); + // const wxString szName + const wxString szName = wxlState.GetwxStringType(2); + // get this + wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); + // call Init + returns = (self->Init(szName, szShort, szLocale, bLoadDefault, bConvertEncoding)); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + #if (wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL) *************** *** 5891,5899 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_constructor1[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; ! static int LUACALL wxLua_wxLocale_constructor1(lua_State *L); ! // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_constructor1[1] = {{ wxLua_wxLocale_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxLocale_constructor1 }}; // wxLocale(int language, int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING) ! static int LUACALL wxLua_wxLocale_constructor1(lua_State *L) { wxluabind_removetableforcall(L); --- 5945,5953 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_constructor2[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; ! static int LUACALL wxLua_wxLocale_constructor2(lua_State *L); ! // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_constructor2[1] = {{ wxLua_wxLocale_constructor2, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxLocale_constructor2 }}; // wxLocale(int language, int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING) ! static int LUACALL wxLua_wxLocale_constructor2(lua_State *L) { wxluabind_removetableforcall(L); *************** *** 5916,5924 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_constructor[] = { &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, NULL }; ! static int LUACALL wxLua_wxLocale_constructor(lua_State *L); ! // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_constructor[1] = {{ wxLua_wxLocale_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 5, s_wxluatagArray_wxLua_wxLocale_constructor }}; // wxLocale(const wxString& szName, const wxString& szShort = "", const wxString& szLocale = "", bool bLoadDefault = true, bool bConvertEncoding = false) ! static int LUACALL wxLua_wxLocale_constructor(lua_State *L) { wxluabind_removetableforcall(L); --- 5970,5978 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_constructor1[] = { &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, NULL }; ! static int LUACALL wxLua_wxLocale_constructor1(lua_State *L); ! // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_constructor1[1] = {{ wxLua_wxLocale_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 5, s_wxluatagArray_wxLua_wxLocale_constructor1 }}; // wxLocale(const wxString& szName, const wxString& szShort = "", const wxString& szLocale = "", bool bLoadDefault = true, bool bConvertEncoding = false) ! static int LUACALL wxLua_wxLocale_constructor1(lua_State *L) { wxluabind_removetableforcall(L); *************** *** 5947,5950 **** --- 6001,6022 ---- } + static int LUACALL wxLua_wxLocale_constructor(lua_State *L); + // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_constructor[1] = {{ wxLua_wxLocale_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }}; + // wxLocale() + static int LUACALL wxLua_wxLocale_constructor(lua_State *L) + { + wxluabind_removetableforcall(L); + wxLuaState wxlState(L); + wxLocale *returns; + // call constructor + returns = new wxLocale(); + // add to tracked memory list + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxLocale((wxLocale *)returns)); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxLocale, returns); + + return 1; + } + *************** *** 5985,5995 **** return wxlState.CallOverloadedFunction(&overload_method); } static int LUACALL wxLua_wxLocale_constructor_overload(lua_State *L); // function overload table static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_constructor_overload[] = { ! { wxLua_wxLocale_constructor_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 1, 5, s_wxluaargArray_None }, ! { wxLua_wxLocale_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxLocale_constructor1 }, ! { wxLua_wxLocale_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 5, s_wxluatagArray_wxLua_wxLocale_constructor }, }; static int s_wxluafunc_wxLua_wxLocale_constructor_overload_count = sizeof(s_wxluafunc_wxLua_wxLocale_constructor_overload)/sizeof(wxLuaBindCFunc); --- 6057,6085 ---- return wxlState.CallOverloadedFunction(&overload_method); } + static int LUACALL wxLua_wxLocale_Init_overload(lua_State *L); + // function overload table + static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_Init_overload[] = + { + { wxLua_wxLocale_Init_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 1, 6, s_wxluaargArray_None }, + { wxLua_wxLocale_Init1, WXLUAMETHOD_METHOD, 1, 3, s_wxluatagArray_wxLua_wxLocale_Init1 }, + { wxLua_wxLocale_Init, WXLUAMETHOD_METHOD, 2, 6, s_wxluatagArray_wxLua_wxLocale_Init }, + }; + static int s_wxluafunc_wxLua_wxLocale_Init_overload_count = sizeof(s_wxluafunc_wxLua_wxLocale_Init_overload)/sizeof(wxLuaBindCFunc); + // Overloaded function for wxLocale::Init + static int LUACALL wxLua_wxLocale_Init_overload(lua_State *L) + { + wxLuaState wxlState(L); + static wxLuaBindMethod overload_method = + { "Init", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLocale_Init_overload, s_wxluafunc_wxLua_wxLocale_Init_overload_count, 0 }; + return wxlState.CallOverloadedFunction(&overload_method); + } static int LUACALL wxLua_wxLocale_constructor_overload(lua_State *L); // function overload table static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_constructor_overload[] = { ! { wxLua_wxLocale_constructor_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 0, 5, s_wxluaargArray_None }, ! { wxLua_wxLocale_constructor2, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxLocale_constructor2 }, ! { wxLua_wxLocale_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 5, s_wxluatagArray_wxLua_wxLocale_constructor1 }, ! { wxLua_wxLocale_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }, }; static int s_wxluafunc_wxLua_wxLocale_constructor_overload_count = sizeof(s_wxluafunc_wxLua_wxLocale_constructor_overload)/sizeof(wxLuaBindCFunc); *************** *** 6035,6038 **** --- 6125,6132 ---- { "GetSystemLanguage", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxLocale_GetSystemLanguage, 1, NULL }, + #if (wxUSE_INTL) + { "Init", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLocale_Init_overload, s_wxluafunc_wxLua_wxLocale_Init_overload_count, 0 }, + #endif // (wxUSE_INTL) + #if (wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL) { "IsAvailable", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxLocale_IsAvailable, 1, NULL }, |