Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18915/wxLua/modules/wxbind/src Modified Files: appframe.cpp controls.cpp data.cpp datetime.cpp file.cpp gdi.cpp image.cpp windows.cpp wx_bind.cpp Log Message: more updates to wxWidgets 2.8 using headers (up to longlong.h) Index: controls.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/controls.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** controls.cpp 12 Mar 2007 23:12:34 -0000 1.47 --- controls.cpp 13 Mar 2007 23:01:54 -0000 1.48 *************** *** 2281,2284 **** --- 2281,2306 ---- #endif // ((wxLUA_USE_wxListBox && wxUSE_LISTBOX) && (wxLUA_USE_wxValidator && wxUSE_VALIDATORS)) && (wxLUA_USE_wxPointSizeRect) + + #if (wxLUA_USE_wxPointSizeRect) && ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxListBox && wxUSE_LISTBOX)) + static wxLuaArgTag s_wxluatagArray_wxLua_wxListBox_HitTest[] = { &s_wxluatag_wxPoint, 0 }; + // %wxchkver_2_8 int HitTest(const wxPoint& point) const + static int LUACALL wxLua_wxListBox_HitTest(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // const wxPoint point + const wxPoint * point = (const wxPoint *)wxlState.GetUserDataType(2, s_wxluatag_wxPoint); + // get this + wxListBox * self = (wxListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxListBox); + // call HitTest + returns = self->HitTest(*point); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + #endif // (wxLUA_USE_wxPointSizeRect) && ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxListBox && wxUSE_LISTBOX)) + // %constructor wxListBoxDefault() static int LUACALL wxLua_wxListBoxDefault_constructor(lua_State *L) *************** *** 2450,2453 **** --- 2472,2480 ---- #endif // ((wxLUA_USE_wxListBox && wxUSE_LISTBOX) && (wxLUA_USE_wxValidator && wxUSE_VALIDATORS)) && (wxLUA_USE_wxPointSizeRect) + + #if (wxLUA_USE_wxPointSizeRect) && ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxListBox && wxUSE_LISTBOX)) + { LuaMethod, "HitTest", wxLua_wxListBox_HitTest, 1, 1, s_wxluatagArray_wxLua_wxListBox_HitTest }, + #endif // (wxLUA_USE_wxPointSizeRect) && ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxListBox && wxUSE_LISTBOX)) + { LuaConstructor, "wxListBoxDefault", wxLua_wxListBoxDefault_constructor, 0, 0, s_wxluaargArray_None }, { LuaMethod, "Deselect", wxLua_wxListBox_Deselect, 1, 1, s_wxluatagArray_wxLua_wxListBox_Deselect }, *************** *** 4009,4012 **** --- 4036,4058 ---- + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL) + static wxLuaArgTag s_wxluatagArray_wxLua_wxListItemAttr_AssignFrom[] = { &s_wxluatag_wxListItemAttr, 0 }; + // %wxchkver_2_8 void AssignFrom(const wxListItemAttr& source) + static int LUACALL wxLua_wxListItemAttr_AssignFrom(lua_State *L) + { + wxLuaState wxlState(L); + // const wxListItemAttr source + const wxListItemAttr * source = (const wxListItemAttr *)wxlState.GetUserDataType(2, s_wxluatag_wxListItemAttr); + // get this + wxListItemAttr * self = (wxListItemAttr *)wxlState.GetUserDataType(1, s_wxluatag_wxListItemAttr); + // call AssignFrom + self->AssignFrom(*source); + + return 0; + } + + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL) + + #if ((wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxFont)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL) static wxLuaArgTag s_wxluatagArray_wxLua_wxListItemAttr_constructor[] = { &s_wxluatag_wxColour, &s_wxluatag_wxColour, &s_wxluatag_wxFont, 0 }; *************** *** 4218,4221 **** --- 4264,4272 ---- WXLUAMETHOD wxListItemAttr_methods[] = { + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL) + { LuaMethod, "AssignFrom", wxLua_wxListItemAttr_AssignFrom, 1, 1, s_wxluatagArray_wxLua_wxListItemAttr_AssignFrom }, + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL) + + #if ((wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxFont)) && (wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL) { LuaConstructor, "wxListItemAttr", wxLua_wxListItemAttr_constructor, 3, 0, s_wxluatagArray_wxLua_wxListItemAttr_constructor }, Index: data.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/data.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** data.cpp 9 Mar 2007 06:10:18 -0000 1.37 --- data.cpp 13 Mar 2007 23:01:55 -0000 1.38 *************** *** 2458,2459 **** --- 2458,2777 ---- #endif // wxLUA_USE_wxArrayString + + #if wxUSE_LONGLONG + // --------------------------------------------------------------------------- + // Bind class wxLongLong + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxLongLong' + int s_wxluatag_wxLongLong = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLongLong_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // wxLongLong(long hi = 0, unsigned long lo = 0) + static int LUACALL wxLua_wxLongLong_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxLongLong *returns; + // get number of arguments + int argCount = lua_gettop(L); + // unsigned long lo = 0 + unsigned long lo = (argCount >= 2 ? (long)wxlState.GetNumberType(2) : 0); + // long hi = 0 + long hi = (argCount >= 1 ? (long)wxlState.GetNumberType(1) : 0); + // call constructor + returns = new wxLongLong(hi, lo); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxLongLong *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxLongLong, returns); + + return 1; + } + + // wxLongLong Abs() const + static int LUACALL wxLua_wxLongLong_Abs(lua_State *L) + { + wxLuaState wxlState(L); + wxLongLong *returns; + // get this + wxLongLong * self = (wxLongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxLongLong); + // call Abs + // allocate a new object using the copy constructor + returns = new wxLongLong(self->Abs()); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxLongLong *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxLongLong, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLongLong_Assign[] = { &s_wxluaarg_Number, 0 }; + // wxLongLong& Assign(double d) + static int LUACALL wxLua_wxLongLong_Assign(lua_State *L) + { + wxLuaState wxlState(L); + wxLongLong *returns; + // double d + double d = (double)wxlState.GetNumberType(2); + // get this + wxLongLong * self = (wxLongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxLongLong); + // call Assign + returns = &self->Assign(d); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxLongLong, returns); + + return 1; + } + + // long GetHi() const + static int LUACALL wxLua_wxLongLong_GetHi(lua_State *L) + { + wxLuaState wxlState(L); + long returns; + // get this + wxLongLong * self = (wxLongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxLongLong); + // call GetHi + returns = self->GetHi(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // unsigned long GetLo() const + static int LUACALL wxLua_wxLongLong_GetLo(lua_State *L) + { + wxLuaState wxlState(L); + unsigned long returns; + // get this + wxLongLong * self = (wxLongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxLongLong); + // call GetLo + returns = self->GetLo(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // double ToDouble() const + static int LUACALL wxLua_wxLongLong_ToDouble(lua_State *L) + { + wxLuaState wxlState(L); + double returns; + // get this + wxLongLong * self = (wxLongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxLongLong); + // call ToDouble + returns = self->ToDouble(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // long ToLong() const + static int LUACALL wxLua_wxLongLong_ToLong(lua_State *L) + { + wxLuaState wxlState(L); + long returns; + // get this + wxLongLong * self = (wxLongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxLongLong); + // call ToLong + returns = self->ToLong(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // wxString ToString() const + static int LUACALL wxLua_wxLongLong_ToString(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxLongLong * self = (wxLongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxLongLong); + // call ToString + returns = self->ToString(); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static int LUACALL wxLua_wxLongLong_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxLongLong * self = (wxLongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxLongLong); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedObject(self); + return 0; + } + + static int LUACALL wxLua_wxLongLong_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxLongLong * self = (wxLongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxLongLong); + // 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; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxLongLong_methods[] = { + { LuaConstructor, "wxLongLong", wxLua_wxLongLong_constructor, 2, 0, s_wxluatagArray_wxLua_wxLongLong_constructor }, + { LuaMethod, "Abs", wxLua_wxLongLong_Abs, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Assign", wxLua_wxLongLong_Assign, 1, 1, s_wxluatagArray_wxLua_wxLongLong_Assign }, + { LuaMethod, "GetHi", wxLua_wxLongLong_GetHi, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetLo", wxLua_wxLongLong_GetLo, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "ToDouble", wxLua_wxLongLong_ToDouble, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "ToLong", wxLua_wxLongLong_ToLong, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "ToString", wxLua_wxLongLong_ToString, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxLongLong", wxLua_wxLongLong_destructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Delete", wxLua_wxLongLong_Delete, 0, 0, s_wxluaargArray_None }, + }; + + int wxLongLong_methodCount = sizeof(wxLongLong_methods)/sizeof(wxLongLong_methods[0]); + #endif // wxUSE_LONGLONG + + + #if wxUSE_LONGLONG + // --------------------------------------------------------------------------- + // Bind class wxULongLong + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxULongLong' + int s_wxluatag_wxULongLong = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxULongLong_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // wxULongLong(unsigned long hi = 0, unsigned long lo = 0) + static int LUACALL wxLua_wxULongLong_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxULongLong *returns; + // get number of arguments + int argCount = lua_gettop(L); + // unsigned long lo = 0 + unsigned long lo = (argCount >= 2 ? (long)wxlState.GetNumberType(2) : 0); + // unsigned long hi = 0 + unsigned long hi = (argCount >= 1 ? (long)wxlState.GetNumberType(1) : 0); + // call constructor + returns = new wxULongLong(hi, lo); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxULongLong *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxULongLong, returns); + + return 1; + } + + // unsigned long GetHi() const + static int LUACALL wxLua_wxULongLong_GetHi(lua_State *L) + { + wxLuaState wxlState(L); + unsigned long returns; + // get this + wxULongLong * self = (wxULongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxULongLong); + // call GetHi + returns = self->GetHi(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // unsigned long GetLo() const + static int LUACALL wxLua_wxULongLong_GetLo(lua_State *L) + { + wxLuaState wxlState(L); + unsigned long returns; + // get this + wxULongLong * self = (wxULongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxULongLong); + // call GetLo + returns = self->GetLo(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // long ToULong() const + static int LUACALL wxLua_wxULongLong_ToULong(lua_State *L) + { + wxLuaState wxlState(L); + long returns; + // get this + wxULongLong * self = (wxULongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxULongLong); + // call ToULong + returns = self->ToULong(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // wxString ToString() const + static int LUACALL wxLua_wxULongLong_ToString(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxULongLong * self = (wxULongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxULongLong); + // call ToString + returns = self->ToString(); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static int LUACALL wxLua_wxULongLong_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxULongLong * self = (wxULongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxULongLong); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedObject(self); + return 0; + } + + static int LUACALL wxLua_wxULongLong_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxULongLong * self = (wxULongLong *)wxlState.GetUserDataType(1, s_wxluatag_wxULongLong); + // 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; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxULongLong_methods[] = { + { LuaConstructor, "wxULongLong", wxLua_wxULongLong_constructor, 2, 0, s_wxluatagArray_wxLua_wxULongLong_constructor }, + { LuaMethod, "GetHi", wxLua_wxULongLong_GetHi, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetLo", wxLua_wxULongLong_GetLo, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "ToULong", wxLua_wxULongLong_ToULong, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "ToString", wxLua_wxULongLong_ToString, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxULongLong", wxLua_wxULongLong_destructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Delete", wxLua_wxULongLong_Delete, 0, 0, s_wxluaargArray_None }, + }; + + int wxULongLong_methodCount = sizeof(wxULongLong_methods)/sizeof(wxULongLong_methods[0]); + #endif // wxUSE_LONGLONG + Index: file.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/file.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** file.cpp 12 Mar 2007 23:12:35 -0000 1.36 --- file.cpp 13 Mar 2007 23:01:56 -0000 1.37 *************** *** 273,276 **** --- 273,298 ---- + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName)) && (wxUSE_LONGLONG) + // %wxchkver_2_8 wxULongLong GetSize() const + static int LUACALL wxLua_wxFileName_GetSize(lua_State *L) + { + wxLuaState wxlState(L); + wxULongLong *returns; + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call GetSize + // allocate a new object using the copy constructor + returns = new wxULongLong(self->GetSize()); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxULongLong *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxULongLong, returns); + + return 1; + } + + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName)) && (wxUSE_LONGLONG) + + #if (wxCHECK_VERSION(2,8,0) && (wxUSE_FILE || wxUSE_FFILE )) && (wxLUA_USE_wxFileName) static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_AssignTempFileNameGetName[] = { &s_wxluaarg_String, 0 }; *************** *** 1840,1843 **** --- 1862,1870 ---- + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName)) && (wxUSE_LONGLONG) + { LuaMethod, "GetSize", wxLua_wxFileName_GetSize, 0, 0, s_wxluaargArray_None }, + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName)) && (wxUSE_LONGLONG) + + #if (wxCHECK_VERSION(2,8,0) && (wxUSE_FILE || wxUSE_FFILE )) && (wxLUA_USE_wxFileName) { LuaMethod, "AssignTempFileNameGetName", wxLua_wxFileName_AssignTempFileNameGetName, 1, 1, s_wxluatagArray_wxLua_wxFileName_AssignTempFileNameGetName }, *************** *** 2615,2618 **** --- 2642,2668 ---- + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDir)) && (wxUSE_LONGLONG) + static wxLuaArgTag s_wxluatagArray_wxLua_wxDir_GetTotalSize[] = { &s_wxluaarg_String, 0 }; + // %wxchkver_2_8 static wxULongLong GetTotalSize(const wxString &dir) //, wxArrayString *filesSkipped = NULL) FIXME override + static int LUACALL wxLua_wxDir_GetTotalSize(lua_State *L) + { + wxLuaState wxlState(L); + wxULongLong *returns; + // const wxString dir + const wxString dir = wxlState.GetwxStringType(2); + // call GetTotalSize + // allocate a new object using the copy constructor + returns = new wxULongLong(wxDir::GetTotalSize(dir)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxULongLong *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxULongLong, returns); + + return 1; + } + + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDir)) && (wxUSE_LONGLONG) + + #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDir) static wxLuaArgTag s_wxluatagArray_wxLua_wxDir_FindFirst[] = { &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Number, 0 }; *************** *** 2883,2886 **** --- 2933,2941 ---- WXLUAMETHOD wxDir_methods[] = { + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDir)) && (wxUSE_LONGLONG) + { LuaMethod, "GetTotalSize", wxLua_wxDir_GetTotalSize, 1, 1, s_wxluatagArray_wxLua_wxDir_GetTotalSize }, + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDir)) && (wxUSE_LONGLONG) + + #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDir) { LuaMethod, "FindFirst", wxLua_wxDir_FindFirst, 3, 2, s_wxluatagArray_wxLua_wxDir_FindFirst }, Index: appframe.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/appframe.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** appframe.cpp 9 Mar 2007 00:15:13 -0000 1.37 --- appframe.cpp 13 Mar 2007 23:01:54 -0000 1.38 *************** *** 27,30 **** --- 27,680 ---- + #if wxUSE_LOG + // --------------------------------------------------------------------------- + // Bind class wxLog + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxLog' + int s_wxluatag_wxLog = -1; + + + #if (wxCHECK_VERSION(2,8,0)) && (wxUSE_LOG) + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_SetRepetitionCounting[] = { &s_wxluaarg_Boolean, 0 }; + // %wxchkver_2_8 static void SetRepetitionCounting(bool bRepetCounting = true) + static int LUACALL wxLua_wxLog_SetRepetitionCounting(lua_State *L) + { + wxLuaState wxlState(L); + // get number of arguments + int argCount = lua_gettop(L); + // bool bRepetCounting = true + bool bRepetCounting = (argCount >= 2 ? wxlState.GetBooleanType(2) : true); + // call SetRepetitionCounting + wxLog::SetRepetitionCounting(bRepetCounting); + + return 0; + } + + // %wxchkver_2_8 static bool GetRepetitionCounting() + static int LUACALL wxLua_wxLog_GetRepetitionCounting(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // call GetRepetitionCounting + returns = wxLog::GetRepetitionCounting(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif // (wxCHECK_VERSION(2,8,0)) && (wxUSE_LOG) + + + #if (wxUSE_LOG) && (wxLUA_USE_wxArrayString) + // static const wxArrayString GetTraceMasks() + static int LUACALL wxLua_wxLog_GetTraceMasks(lua_State *L) + { + wxLuaState wxlState(L); + const wxArrayString *returns; + // call GetTraceMasks + // allocate a new object using the copy constructor + returns = new wxArrayString(wxLog::GetTraceMasks()); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxArrayString *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxArrayString, returns); + + return 1; + } + + #endif // (wxUSE_LOG) && (wxLUA_USE_wxArrayString) + + // wxLog() + static int LUACALL wxLua_wxLog_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxLog *returns; + // call constructor + returns = new wxLog(); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxLog, returns); + + return 1; + } + + // static bool IsEnabled() + static int LUACALL wxLua_wxLog_IsEnabled(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // call IsEnabled + returns = wxLog::IsEnabled(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_EnableLogging[] = { &s_wxluaarg_Boolean, 0 }; + // static bool EnableLogging(bool doIt = true) + static int LUACALL wxLua_wxLog_EnableLogging(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // bool doIt = true + bool doIt = (argCount >= 2 ? wxlState.GetBooleanType(2) : true); + // call EnableLogging + returns = wxLog::EnableLogging(doIt); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // virtual void Flush() + static int LUACALL wxLua_wxLog_Flush(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxLog * self = (wxLog *)wxlState.GetUserDataType(1, s_wxluatag_wxLog); + // call Flush + self->Flush(); + + return 0; + } + + // static void FlushActive() + static int LUACALL wxLua_wxLog_FlushActive(lua_State *L) + { + wxLuaState wxlState(L); + // call FlushActive + wxLog::FlushActive(); + + return 0; + } + + // static wxLog *GetActiveTarget() + static int LUACALL wxLua_wxLog_GetActiveTarget(lua_State *L) + { + wxLuaState wxlState(L); + wxLog *returns; + // call GetActiveTarget + returns = (wxLog *)wxLog::GetActiveTarget(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxLog, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_SetActiveTarget[] = { &s_wxluatag_wxLog, 0 }; + // static wxLog *SetActiveTarget(wxLog *pLogger) + static int LUACALL wxLua_wxLog_SetActiveTarget(lua_State *L) + { + wxLuaState wxlState(L); + wxLog *returns; + // wxLog pLogger + wxLog * pLogger = (wxLog *)wxlState.GetUserDataType(2, s_wxluatag_wxLog); + // call SetActiveTarget + returns = (wxLog *)wxLog::SetActiveTarget(pLogger); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxLog, returns); + + return 1; + } + + // static void Suspend() + static int LUACALL wxLua_wxLog_Suspend(lua_State *L) + { + wxLuaState wxlState(L); + // call Suspend + wxLog::Suspend(); + + return 0; + } + + // static void Resume() + static int LUACALL wxLua_wxLog_Resume(lua_State *L) + { + wxLuaState wxlState(L); + // call Resume + wxLog::Resume(); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_SetVerbose[] = { &s_wxluaarg_Boolean, 0 }; + // static void SetVerbose(bool bVerbose = true) + static int LUACALL wxLua_wxLog_SetVerbose(lua_State *L) + { + wxLuaState wxlState(L); + // get number of arguments + int argCount = lua_gettop(L); + // bool bVerbose = true + bool bVerbose = (argCount >= 2 ? wxlState.GetBooleanType(2) : true); + // call SetVerbose + wxLog::SetVerbose(bVerbose); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_SetLogLevel[] = { &s_wxluaarg_Number, 0 }; + // static void SetLogLevel(wxLogLevel logLevel) + static int LUACALL wxLua_wxLog_SetLogLevel(lua_State *L) + { + wxLuaState wxlState(L); + // wxLogLevel logLevel + wxLogLevel logLevel = (wxLogLevel)wxlState.GetNumberType(2); + // call SetLogLevel + wxLog::SetLogLevel(logLevel); + + return 0; + } + + // static void DontCreateOnDemand() + static int LUACALL wxLua_wxLog_DontCreateOnDemand(lua_State *L) + { + wxLuaState wxlState(L); + // call DontCreateOnDemand + wxLog::DontCreateOnDemand(); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_SetTraceMask[] = { &s_wxluaarg_Number, 0 }; + // static void SetTraceMask(wxTraceMask ulMask) + static int LUACALL wxLua_wxLog_SetTraceMask(lua_State *L) + { + wxLuaState wxlState(L); + // wxTraceMask ulMask + wxTraceMask ulMask = (wxTraceMask)wxlState.GetNumberType(2); + // call SetTraceMask + wxLog::SetTraceMask(ulMask); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_AddTraceMask[] = { &s_wxluaarg_String, 0 }; + // static void AddTraceMask(const wxString& str) + static int LUACALL wxLua_wxLog_AddTraceMask(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString str + const wxString str = wxlState.GetwxStringType(2); + // call AddTraceMask + wxLog::AddTraceMask(str); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_RemoveTraceMask[] = { &s_wxluaarg_String, 0 }; + // static void RemoveTraceMask(const wxString& str) + static int LUACALL wxLua_wxLog_RemoveTraceMask(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString str + const wxString str = wxlState.GetwxStringType(2); + // call RemoveTraceMask + wxLog::RemoveTraceMask(str); + + return 0; + } + + // static void ClearTraceMasks() + static int LUACALL wxLua_wxLog_ClearTraceMasks(lua_State *L) + { + wxLuaState wxlState(L); + // call ClearTraceMasks + wxLog::ClearTraceMasks(); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_SetTimestamp[] = { &s_wxluaarg_String, 0 }; + // static void SetTimestamp(const wxString& ts) + static int LUACALL wxLua_wxLog_SetTimestamp(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString ts + const wxString ts = wxlState.GetwxStringType(2); + // call SetTimestamp + wxLog::SetTimestamp(ts); + + return 0; + } + + // static bool GetVerbose() + static int LUACALL wxLua_wxLog_GetVerbose(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // call GetVerbose + returns = wxLog::GetVerbose(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // static wxTraceMask GetTraceMask() + static int LUACALL wxLua_wxLog_GetTraceMask(lua_State *L) + { + wxLuaState wxlState(L); + wxTraceMask returns; + // call GetTraceMask + returns = wxLog::GetTraceMask(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLog_IsAllowedTraceMask[] = { &s_wxluaarg_String, 0 }; + // static bool IsAllowedTraceMask(const wxString& mask) + static int LUACALL wxLua_wxLog_IsAllowedTraceMask(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString mask + const wxString mask = wxlState.GetwxStringType(2); + // call IsAllowedTraceMask + returns = wxLog::IsAllowedTraceMask(mask); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // static wxLogLevel GetLogLevel() + static int LUACALL wxLua_wxLog_GetLogLevel(lua_State *L) + { + wxLuaState wxlState(L); + wxLogLevel returns; + // call GetLogLevel + returns = wxLog::GetLogLevel(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // static wxString GetTimestamp() + static int LUACALL wxLua_wxLog_GetTimestamp(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // call GetTimestamp + returns = wxLog::GetTimestamp(); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static int LUACALL wxLua_wxLog_destructor(lua_State *) + { + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxLog_methods[] = { + + #if (wxCHECK_VERSION(2,8,0)) && (wxUSE_LOG) + { LuaMethod, "SetRepetitionCounting", wxLua_wxLog_SetRepetitionCounting, 1, 0, s_wxluatagArray_wxLua_wxLog_SetRepetitionCounting }, + { LuaMethod, "GetRepetitionCounting", wxLua_wxLog_GetRepetitionCounting, 0, 0, s_wxluaargArray_None }, + #endif // (wxCHECK_VERSION(2,8,0)) && (wxUSE_LOG) + + + #if (wxUSE_LOG) && (wxLUA_USE_wxArrayString) + { LuaMethod, "GetTraceMasks", wxLua_wxLog_GetTraceMasks, 0, 0, s_wxluaargArray_None }, + #endif // (wxUSE_LOG) && (wxLUA_USE_wxArrayString) + + { LuaConstructor, "wxLog", wxLua_wxLog_constructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "IsEnabled", wxLua_wxLog_IsEnabled, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "EnableLogging", wxLua_wxLog_EnableLogging, 1, 0, s_wxluatagArray_wxLua_wxLog_EnableLogging }, + { LuaMethod, "Flush", wxLua_wxLog_Flush, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "FlushActive", wxLua_wxLog_FlushActive, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetActiveTarget", wxLua_wxLog_GetActiveTarget, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "SetActiveTarget", wxLua_wxLog_SetActiveTarget, 1, 1, s_wxluatagArray_wxLua_wxLog_SetActiveTarget }, + { LuaMethod, "Suspend", wxLua_wxLog_Suspend, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Resume", wxLua_wxLog_Resume, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "SetVerbose", wxLua_wxLog_SetVerbose, 1, 0, s_wxluatagArray_wxLua_wxLog_SetVerbose }, + { LuaMethod, "SetLogLevel", wxLua_wxLog_SetLogLevel, 1, 1, s_wxluatagArray_wxLua_wxLog_SetLogLevel }, + { LuaMethod, "DontCreateOnDemand", wxLua_wxLog_DontCreateOnDemand, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "SetTraceMask", wxLua_wxLog_SetTraceMask, 1, 1, s_wxluatagArray_wxLua_wxLog_SetTraceMask }, + { LuaMethod, "AddTraceMask", wxLua_wxLog_AddTraceMask, 1, 1, s_wxluatagArray_wxLua_wxLog_AddTraceMask }, + { LuaMethod, "RemoveTraceMask", wxLua_wxLog_RemoveTraceMask, 1, 1, s_wxluatagArray_wxLua_wxLog_RemoveTraceMask }, + { LuaMethod, "ClearTraceMasks", wxLua_wxLog_ClearTraceMasks, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "SetTimestamp", wxLua_wxLog_SetTimestamp, 1, 1, s_wxluatagArray_wxLua_wxLog_SetTimestamp }, + { LuaMethod, "GetVerbose", wxLua_wxLog_GetVerbose, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetTraceMask", wxLua_wxLog_GetTraceMask, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "IsAllowedTraceMask", wxLua_wxLog_IsAllowedTraceMask, 1, 1, s_wxluatagArray_wxLua_wxLog_IsAllowedTraceMask }, + { LuaMethod, "GetLogLevel", wxLua_wxLog_GetLogLevel, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetTimestamp", wxLua_wxLog_GetTimestamp, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxLog", wxLua_wxLog_destructor, 0, 0, s_wxluaargArray_None }, + }; + + int wxLog_methodCount = sizeof(wxLog_methods)/sizeof(wxLog_methods[0]); + #endif // wxUSE_LOG + + + #if wxUSE_LOG + // --------------------------------------------------------------------------- + // Bind class wxLogBuffer + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxLogBuffer' + int s_wxluatag_wxLogBuffer = -1; + + // wxLogBuffer() + static int LUACALL wxLua_wxLogBuffer_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxLogBuffer *returns; + // call constructor + returns = new wxLogBuffer(); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxLogBuffer, returns); + + return 1; + } + + // const wxString& GetBuffer() const // get the string contents with all messages logged + static int LUACALL wxLua_wxLogBuffer_GetBuffer(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxLogBuffer * self = (wxLogBuffer *)wxlState.GetUserDataType(1, s_wxluatag_wxLogBuffer); + // call GetBuffer + returns = self->GetBuffer(); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static int LUACALL wxLua_wxLogBuffer_destructor(lua_State *) + { + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxLogBuffer_methods[] = { + { LuaConstructor, "wxLogBuffer", wxLua_wxLogBuffer_constructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetBuffer", wxLua_wxLogBuffer_GetBuffer, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxLogBuffer", wxLua_wxLogBuffer_destructor, 0, 0, s_wxluaargArray_None }, + }; + + int wxLogBuffer_methodCount = sizeof(wxLogBuffer_methods)/sizeof(wxLogBuffer_methods[0]); + #endif // wxUSE_LOG + + + #if wxUSE_LOG + // --------------------------------------------------------------------------- + // Bind class wxLogChain + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxLogChain' + int s_wxluatag_wxLogChain = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLogChain_constructor[] = { &s_wxluatag_wxLog, 0 }; + // wxLogChain(wxLog *logger) + static int LUACALL wxLua_wxLogChain_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxLogChain *returns; + // wxLog logger + wxLog * logger = (wxLog *)wxlState.GetUserDataType(1, s_wxluatag_wxLog); + // call constructor + returns = new wxLogChain(logger); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxLogChain, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLogChain_SetLog[] = { &s_wxluatag_wxLog, 0 }; + // void SetLog(wxLog *logger) // change the new log target + static int LUACALL wxLua_wxLogChain_SetLog(lua_State *L) + { + wxLuaState wxlState(L); + // wxLog logger + wxLog * logger = (wxLog *)wxlState.GetUserDataType(2, s_wxluatag_wxLog); + // get this + wxLogChain * self = (wxLogChain *)wxlState.GetUserDataType(1, s_wxluatag_wxLogChain); + // call SetLog + self->SetLog(logger); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLogChain_PassMessages[] = { &s_wxluaarg_Boolean, 0 }; + // void PassMessages(bool bDoPass) + static int LUACALL wxLua_wxLogChain_PassMessages(lua_State *L) + { + wxLuaState wxlState(L); + // bool bDoPass + bool bDoPass = wxlState.GetBooleanType(2); + // get this + wxLogChain * self = (wxLogChain *)wxlState.GetUserDataType(1, s_wxluatag_wxLogChain); + // call PassMessages + self->PassMessages(bDoPass); + + return 0; + } + + // bool IsPassingMessages() const + static int LUACALL wxLua_wxLogChain_IsPassingMessages(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxLogChain * self = (wxLogChain *)wxlState.GetUserDataType(1, s_wxluatag_wxLogChain); + // call IsPassingMessages + returns = self->IsPassingMessages(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // wxLog *GetOldLog() const + static int LUACALL wxLua_wxLogChain_GetOldLog(lua_State *L) + { + wxLuaState wxlState(L); + wxLog *returns; + // get this + wxLogChain * self = (wxLogChain *)wxlState.GetUserDataType(1, s_wxluatag_wxLogChain); + // call GetOldLog + returns = (wxLog *)self->GetOldLog(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxLog, returns); + + return 1; + } + + static int LUACALL wxLua_wxLogChain_destructor(lua_State *) + { + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxLogChain_methods[] = { + { LuaConstructor, "wxLogChain", wxLua_wxLogChain_constructor, 1, 1, s_wxluatagArray_wxLua_wxLogChain_constructor }, + { LuaMethod, "SetLog", wxLua_wxLogChain_SetLog, 1, 1, s_wxluatagArray_wxLua_wxLogChain_SetLog }, + { LuaMethod, "PassMessages", wxLua_wxLogChain_PassMessages, 1, 1, s_wxluatagArray_wxLua_wxLogChain_PassMessages }, + { LuaMethod, "IsPassingMessages", wxLua_wxLogChain_IsPassingMessages, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetOldLog", wxLua_wxLogChain_GetOldLog, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxLogChain", wxLua_wxLogChain_destructor, 0, 0, s_wxluaargArray_None }, + }; + + int wxLogChain_methodCount = sizeof(wxLogChain_methods)/sizeof(wxLogChain_methods[0]); + #endif // wxUSE_LOG + + + #if wxUSE_LOG + // --------------------------------------------------------------------------- + // Bind class wxLogPassThrough + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxLogPassThrough' + int s_wxluatag_wxLogPassThrough = -1; + + // wxLogPassThrough() + static int LUACALL wxLua_wxLogPassThrough_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxLogPassThrough *returns; + // call constructor + returns = new wxLogPassThrough(); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxLogPassThrough, returns); + + return 1; + } + + static int LUACALL wxLua_wxLogPassThrough_destructor(lua_State *) + { + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxLogPassThrough_methods[] = { + { LuaConstructor, "wxLogPassThrough", wxLua_wxLogPassThrough_constructor, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxLogPassThrough", wxLua_wxLogPassThrough_destructor, 0, 0, s_wxluaargArray_None }, + }; + + int wxLogPassThrough_methodCount = sizeof(wxLogPassThrough_methods)/sizeof(wxLogPassThrough_methods[0]); + #endif // wxUSE_LOG + + + #if wxUSE_LOG + // --------------------------------------------------------------------------- + // Bind class wxLogNull + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxLogNull' + int s_wxluatag_wxLogNull = -1; + + // wxLogNull() + static int LUACALL wxLua_wxLogNull_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxLogNull *returns; + // call constructor + returns = new wxLogNull(); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxLogNull *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxLogNull, returns); + + return 1; + } + + static int LUACALL wxLua_wxLogNull_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxLogNull * self = (wxLogNull *)wxlState.GetUserDataType(1, s_wxluatag_wxLogNull); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedObject(self); + return 0; + } + + static int LUACALL wxLua_wxLogNull_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxLogNull * self = (wxLogNull *)wxlState.GetUserDataType(1, s_wxluatag_wxLogNull); + // 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; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxLogNull_methods[] = { + { LuaConstructor, "wxLogNull", wxLua_wxLogNull_constructor, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxLogNull", wxLua_wxLogNull_destructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Delete", wxLua_wxLogNull_Delete, 0, 0, s_wxluaargArray_None }, + }; + + int wxLogNull_methodCount = sizeof(wxLogNull_methods)/sizeof(wxLogNull_methods[0]); + #endif // wxUSE_LOG + + #if wxLUA_USE_wxApp // --------------------------------------------------------------------------- Index: datetime.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/datetime.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** datetime.cpp 9 Mar 2007 00:15:14 -0000 1.30 --- datetime.cpp 13 Mar 2007 23:01:55 -0000 1.31 *************** *** 1843,1846 **** --- 1843,1904 ---- int s_wxluatag_wxTimeSpan = -1; + + #if (wxLUA_USE_wxTimeSpan && wxUSE_DATETIME) && (wxUSE_LONGLONG) + // wxLongLong GetMilliseconds() const + static int LUACALL wxLua_wxTimeSpan_GetMilliseconds(lua_State *L) + { + wxLuaState wxlState(L); + wxLongLong *returns; + // get this + wxTimeSpan * self = (wxTimeSpan *)wxlState.GetUserDataType(1, s_wxluatag_wxTimeSpan); + // call GetMilliseconds + // allocate a new object using the copy constructor + returns = new wxLongLong(self->GetMilliseconds()); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxLongLong *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxLongLong, returns); + + return 1; + } + + // wxLongLong GetSeconds() const + static int LUACALL wxLua_wxTimeSpan_GetSeconds(lua_State *L) + { + wxLuaState wxlState(L); + wxLongLong *returns; + // get this + wxTimeSpan * self = (wxTimeSpan *)wxlState.GetUserDataType(1, s_wxluatag_wxTimeSpan); + // call GetSeconds + // allocate a new object using the copy constructor + returns = new wxLongLong(self->GetSeconds()); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxLongLong *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxLongLong, returns); + + return 1; + } + + // wxLongLong GetValue() const + static int LUACALL wxLua_wxTimeSpan_GetValue(lua_State *L) + { + wxLuaState wxlState(L); + wxLongLong *returns; + // get this + wxTimeSpan * self = (wxTimeSpan *)wxlState.GetUserDataType(1, s_wxluatag_wxTimeSpan); + // call GetValue + // allocate a new object using the copy constructor + returns = new wxLongLong(self->GetValue()); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxLongLong *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxLongLong, returns); + + return 1; + } + + #endif // (wxLUA_USE_wxTimeSpan && wxUSE_DATETIME) && (wxUSE_LONGLONG) + // wxTimeSpan() static int LUACALL wxLua_wxTimeSpan_constructor(lua_State *L) *************** *** 2381,2384 **** --- 2439,2449 ---- // Map Lua Class Methods to C Binding Functions WXLUAMETHOD wxTimeSpan_methods[] = { + + #if (wxLUA_USE_wxTimeSpan && wxUSE_DATETIME) && (wxUSE_LONGLONG) + { LuaMethod, "GetMilliseconds", wxLua_wxTimeSpan_GetMilliseconds, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetSeconds", wxLua_wxTimeSpan_GetSeconds, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetValue", wxLua_wxTimeSpan_GetValue, 0, 0, s_wxluaargArray_None }, + #endif // (wxLUA_USE_wxTimeSpan && wxUSE_DATETIME) && (wxUSE_LONGLONG) + { LuaConstructor, "wxTimeSpan", wxLua_wxTimeSpan_constructor, 0, 0, s_wxluaargArray_None }, { LuaConstructor, "wxTimeSpanHMS", wxLua_wxTimeSpanHMS_constructor, 4, 1, s_wxluatagArray_wxLua_wxTimeSpanHMS_constructor }, *************** *** 4600,4601 **** --- 4665,5289 ---- #endif // wxLUA_USE_wxDatePickerCtrl && wxUSE_DATEPICKCTRL + + #if wxUSE_INTL + // --------------------------------------------------------------------------- + // Bind struct wxLanguageInfo + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxLanguageInfo' + int s_wxluatag_wxLanguageInfo = -1; + + + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDC)) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) + // %wxchkver_2_8 %member wxLayoutDirection LayoutDirection; + static int LUACALL wxLua_wxLanguageInfo_Get_LayoutDirection(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxLanguageInfo *self = (wxLanguageInfo *) wxlState.GetUserDataType(1, s_wxluatag_wxLanguageInfo); + // push the result number + lua_pushnumber(L, self->LayoutDirection); + // return the number of parameters + return 1; + } + + // %wxchkver_2_8 %member wxLayoutDirection LayoutDirection; + static int LUACALL wxLua_wxLanguageInfo_Set_LayoutDirection(lua_State *L) + { + wxLuaState wxlState(L); + // get the number value + wxLayoutDirection val = (wxLayoutDirection)wxlState.GetEnumerationType(2); + // get this + wxLanguageInfo *self = (wxLanguageInfo *)wxlState.GetUserDataType(1, s_wxluatag_wxLanguageInfo); + self->LayoutDirection = val; + // return the number of parameters + return 0; + } + + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDC)) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) + + // %member int Language; // wxLanguage id + static int LUACALL wxLua_wxLanguageInfo_Get_Language(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxLanguageInfo *self = (wxLanguageInfo *) wxlState.GetUserDataType(1, s_wxluatag_wxLanguageInfo); + // push the result number + lua_pushnumber(L, self->Language); + // return the number of parameters + return 1; + } + + // %member int Language; // wxLanguage id + static int LUACALL wxLua_wxLanguageInfo_Set_Language(lua_State *L) + { + wxLuaState wxlState(L); + // get the number value + int val = (int)wxlState.GetNumberType(2); + // get this + wxLanguageInfo *self = (wxLanguageInfo *)wxlState.GetUserDataType(1, s_wxluatag_wxLanguageInfo); + self->Language = val; + // return the number of parameters + return 0; + } + + // %member wxString CanonicalName; // Canonical name, e.g. fr_FR + static int LUACALL wxLua_wxLanguageInfo_Get_CanonicalName(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxLanguageInfo *self = (wxLanguageInfo *) wxlState.GetUserDataType(1, s_wxluatag_wxLanguageInfo); + // push the result string + wxlState.lua_PushString(self->CanonicalName); + // return the number of parameters + return 1; + } + + // %member wxString CanonicalName; // Canonical name, e.g. fr_FR + static int LUACALL wxLua_wxLanguageInfo_Set_CanonicalName(lua_State *L) + { + wxLuaState wxlState(L); + // get the string value + wxString val = wxlState.GetwxStringType(2); + // get this + wxLanguageInfo *self = (wxLanguageInfo *)wxlState.GetUserDataType(1, s_wxluatag_wxLanguageInfo); + self->CanonicalName = val; + // return the number of parameters + return 0; + } + + // %member wxString Description; // human-readable name of the language + static int LUACALL wxLua_wxLanguageInfo_Get_Description(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxLanguageInfo *self = (wxLanguageInfo *) wxlState.GetUserDataType(1, s_wxluatag_wxLanguageInfo); + // push the result string + wxlState.lua_PushString(self->Description); + // return the number of parameters + return 1; + } + + // %member wxString Description; // human-readable name of the language + static int LUACALL wxLua_wxLanguageInfo_Set_Description(lua_State *L) + { + wxLuaState wxlState(L); + // get the string value + wxString val = wxlState.GetwxStringType(2); + // get this + wxLanguageInfo *self = (wxLanguageInfo *)wxlState.GetUserDataType(1, s_wxluatag_wxLanguageInfo); + self->Description = val; + // return the number of parameters + return 0; + } + + static int LUACALL wxLua_wxLanguageInfo_destructor(lua_State *) + { + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxLanguageInfo_methods[] = { + + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDC)) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) + { LuaMethod, "Get_LayoutDirection", wxLua_wxLanguageInfo_Get_LayoutDirection, 0, 0, s_wxluaargArray_None }, + { LuaGetProp, "LayoutDirection", wxLua_wxLanguageInfo_Get_LayoutDirection, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Set_LayoutDirection", wxLua_wxLanguageInfo_Set_LayoutDirection, 0, 0, s_wxluaargArray_None }, + { LuaSetProp, "LayoutDirection", wxLua_wxLanguageInfo_Set_LayoutDirection, 0, 0, s_wxluaargArray_None }, + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxDC)) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) + + { LuaMethod, "Get_Language", wxLua_wxLanguageInfo_Get_Language, 0, 0, s_wxluaargArray_None }, + { LuaGetProp, "Language", wxLua_wxLanguageInfo_Get_Language, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Set_Language", wxLua_wxLanguageInfo_Set_Language, 0, 0, s_wxluaargArray_None }, + { LuaSetProp, "Language", wxLua_wxLanguageInfo_Set_Language, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Get_CanonicalName", wxLua_wxLanguageInfo_Get_CanonicalName, 0, 0, s_wxluaargArray_None }, + { LuaGetProp, "CanonicalName", wxLua_wxLanguageInfo_Get_CanonicalName, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Set_CanonicalName", wxLua_wxLanguageInfo_Set_CanonicalName, 0, 0, s_wxluaargArray_None }, + { LuaSetProp, "CanonicalName", wxLua_wxLanguageInfo_Set_CanonicalName, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Get_Description", wxLua_wxLanguageInfo_Get_Description, 0, 0, s_wxluaargArray_None }, + { LuaGetProp, "Description", wxLua_wxLanguageInfo_Get_Description, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Set_Description", wxLua_wxLanguageInfo_Set_Description, 0, 0, s_wxluaargArray_None }, + { LuaSetProp, "Description", wxLua_wxLanguageInfo_Set_Description, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxLanguageInfo", wxLua_wxLanguageInfo_destructor, 0, 0, s_wxluaargArray_None }, + }; + + int wxLanguageInfo_methodCount = sizeof(wxLanguageInfo_methods)/sizeof(wxLanguageInfo_methods[0]); + #endif // wxUSE_INTL + + + #if wxUSE_INTL + // --------------------------------------------------------------------------- + // Bind class wxLocale + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxLocale' + int s_wxluatag_wxLocale = -1; + + + #if (wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL) + static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_IsAvailable[] = { &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 static bool IsAvailable(int lang); + static int LUACALL wxLua_wxLocale_IsAvailable(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // int lang + int lang = (int)wxlState.GetNumberType(2); + // call IsAvailable + returns = wxLocale::IsAvailable(lang); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif // (wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL) + + + #if (wxUSE_INTL) && (wxLUA_USE_wxFont) + // static wxFontEncoding GetSystemEncoding(); + static int LUACALL wxLua_wxLocale_GetSystemEncoding(lua_State *L) + { + wxLuaState wxlState(L); + wxFontEncoding returns; + // call GetSystemEncoding + returns = wxLocale::GetSystemEncoding(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + #endif // (wxUSE_INTL) && (wxLUA_USE_wxFont) + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_constructor[] = { &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, 0 }; + // 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) + { + wxLuaState wxlState(L); + wxLocale *returns; + // get number of arguments + int argCount = lua_gettop(L); + // bool bConvertEncoding = false + bool bConvertEncoding = (argCount >= 5 ? wxlState.GetBooleanType(5) : false); + // bool bLoadDefault = true + bool bLoadDefault = (argCount >= 4 ? wxlState.GetBooleanType(4) : true); + // const wxString szLocale = "" + const wxString szLocale = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); + // const wxString szShort = "" + const wxString szShort = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxEmptyString)); + // const wxString szName + const wxString szName = wxlState.GetwxStringType(1); + // call constructor + returns = new wxLocale(szName, szShort, szLocale, bLoadDefault, bConvertEncoding); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxLocale, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLocaleFromLanguage_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // %constructor wxLocaleFromLanguage(int language, int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING) + static int LUACALL wxLua_wxLocaleFromLanguage_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxLocale *returns; + // get number of arguments + int argCount = lua_gettop(L); + // int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING + int flags = (argCount >= 2 ? (int)wxlState.GetNumberType(2) : wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING); + // int language + int language = (int)wxlState.GetNumberType(1); + // call constructor + returns = new wxLocale(language, flags); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxLocale, returns); + + return 1; + } + + // static int GetSystemLanguage() + static int LUACALL wxLua_wxLocale_GetSystemLanguage(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // call GetSystemLanguage + returns = wxLocale::GetSystemLanguage(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // static wxString GetSystemEncodingName(); + static int LUACALL wxLua_wxLocale_GetSystemEncodingName(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // call GetSystemEncodingName + returns = wxLocale::GetSystemEncodingName(); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_GetInfo[] = { &s_wxluaarg_Enumeration, &s_wxluaarg_Enumeration, 0 }; + // static wxString GetInfo(wxLocaleInfo index, wxLocaleCategory cat); + static int LUACALL wxLua_wxLocale_GetInfo(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // wxLocaleCategory cat + wxLocaleCategory cat = (wxLocaleCategory)wxlState.GetEnumerationType(3); + // wxLocaleInfo index + wxLocaleInfo index = (wxLocaleInfo)wxlState.GetEnumerationType(2); + // call GetInfo + returns = wxLocale::GetInfo(index, cat); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + // bool IsOk() const + static int LUACALL wxLua_wxLocale_IsOk(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); + // call IsOk + returns = self->IsOk(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // wxString GetLocale() const + static int LUACALL wxLua_wxLocale_GetLocale(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); + // call GetLocale + returns = self->GetLocale(); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + // int GetLanguage() const + static int LUACALL wxLua_wxLocale_GetLanguage(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // get this + wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); + // call GetLanguage + returns = self->GetLanguage(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // wxString GetSysName() const; + static int LUACALL wxLua_wxLocale_GetSysName(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); + // call GetSysName + returns = self->GetSysName(); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + // wxString GetCanonicalName() const + static int LUACALL wxLua_wxLocale_GetCanonicalName(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); + // call GetCanonicalName + returns = self->GetCanonicalName(); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_AddCatalogLookupPathPrefix[] = { &s_wxluaarg_String, 0 }; + // static void AddCatalogLookupPathPrefix(const wxString& prefix); + static int LUACALL wxLua_wxLocale_AddCatalogLookupPathPrefix(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString prefix + const wxString prefix = wxlState.GetwxStringType(2); + // call AddCatalogLookupPathPrefix + wxLocale::AddCatalogLookupPathPrefix(prefix); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_AddCatalog[] = { &s_wxluaarg_String, 0 }; + // bool AddCatalog(const wxString& szDomain); + static int LUACALL wxLua_wxLocale_AddCatalog(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString szDomain + const wxString szDomain = wxlState.GetwxStringType(2); + // get this + wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); + // call AddCatalog + returns = self->AddCatalog(szDomain); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxLocale_AddCatalogLanguage[] = { &s_wxluaarg_String, &s_wxluaarg_Enumeration, &s_wxluaarg_String, 0 }; + // %rename AddCatalogLanguage bool AddCatalog(const wxString& szDomain, wxLanguage msgIdLanguage, const wxString& msgIdCharset); + static int LUACALL wxLua_wxLocale_AddCatalogLanguage(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString msgIdCharset + const wxString msgIdCharset = wxlState.GetwxStringType(4); + // wxLanguage msgIdLanguage + wxLanguage msgIdLanguage = (wxLanguage)wxlState.GetEnumerationType(3); + // const wxString szDomain + const wxString szDomain = wxlState.GetwxStringType(2); + // ge... [truncated message content] |