From: John L. <jr...@us...> - 2006-11-02 23:38:19
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27364/wxLua/modules/wxbind/src Modified Files: datetime.cpp gdi.cpp image.cpp windows.cpp wx_bind.cpp Log Message: Added wxDisplay and friends Added more wxDateTimeXXX classes update to compile in wxWidgets 2.7.2 Index: windows.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/windows.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** windows.cpp 23 Aug 2006 04:57:52 -0000 1.26 --- windows.cpp 2 Nov 2006 23:38:09 -0000 1.27 *************** *** 342,345 **** --- 342,367 ---- + #if (!wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxPointSizeRect) + // !%wxchkver27 wxSize GetAdjustedBestSize() const + static int LUACALL wxLua_wxWindow_GetAdjustedBestSize(lua_State *L) + { + wxLuaState wxlState(L); + wxSize *returns; + // get this + wxWindow * self = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call GetAdjustedBestSize + // allocate a new object using the copy constructor + returns = new wxSize(self->GetAdjustedBestSize()); + // add the new object to the tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxSize *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxSize, returns); + + return 1; + } + + #endif // (!wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxPointSizeRect) + + #if (wxLUA_USE_wxLayoutConstraints && (!wxCHECK_VERSION(2,6,0))) && (!wxCHECK_VERSION(2,6,0)) // !%wxchkver26 wxLayoutConstraints* GetConstraints() const // deprecated use sizers *************** *** 2554,2575 **** } - // wxSize GetAdjustedBestSize() const - static int LUACALL wxLua_wxWindow_GetAdjustedBestSize(lua_State *L) - { - wxLuaState wxlState(L); - wxSize *returns; - // get this - wxWindow * self = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); - // call GetAdjustedBestSize - // allocate a new object using the copy constructor - returns = new wxSize(self->GetAdjustedBestSize()); - // add the new object to the tracked memory list - wxLua_AddToTrackedMemoryList(wxlState, (wxSize *)returns); - // push the result datatype - wxlState.PushUserDataType(s_wxluatag_wxSize, returns); - - return 1; - } - // wxSize GetBestFittingSize() const static int LUACALL wxLua_wxWindow_GetBestFittingSize(lua_State *L) --- 2576,2579 ---- *************** *** 3459,3462 **** --- 3463,3471 ---- + #if (!wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxPointSizeRect) + { LuaMethod, "GetAdjustedBestSize", wxLua_wxWindow_GetAdjustedBestSize, 0, 0, { 0 } }, + #endif // (!wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxPointSizeRect) + + #if (wxLUA_USE_wxLayoutConstraints && (!wxCHECK_VERSION(2,6,0))) && (!wxCHECK_VERSION(2,6,0)) { LuaMethod, "GetConstraints", wxLua_wxWindow_GetConstraints, 0, 0, { 0 } }, *************** *** 3674,3678 **** { LuaMethod, "ConvertPixelsToDialogPoint", wxLua_wxWindow_ConvertPixelsToDialogPoint, 1, 1, { &s_wxluatag_wxPoint, 0 } }, { LuaMethod, "ConvertPixelsToDialogSize", wxLua_wxWindow_ConvertPixelsToDialogSize, 1, 1, { &s_wxluatag_wxSize, 0 } }, - { LuaMethod, "GetAdjustedBestSize", wxLua_wxWindow_GetAdjustedBestSize, 0, 0, { 0 } }, { LuaMethod, "GetBestFittingSize", wxLua_wxWindow_GetBestFittingSize, 0, 0, { 0 } }, { LuaMethod, "GetBestSize", wxLua_wxWindow_GetBestSize, 0, 0, { 0 } }, --- 3683,3686 ---- Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** wx_bind.cpp 1 Nov 2006 23:44:47 -0000 1.58 --- wx_bind.cpp 2 Nov 2006 23:38:09 -0000 1.59 *************** *** 2774,2777 **** --- 2774,2781 ---- #endif // wxLUA_USE_wxDateTime + #if wxLUA_USE_wxDisplay && wxUSE_DISPLAY + { &wxDefaultVideoMode, 0, "wxDefaultVideoMode", &s_wxluatag_wxVideoMode }, + #endif // wxLUA_USE_wxDisplay && wxUSE_DISPLAY + #if wxLUA_USE_wxFont { &wxNullFont, 0, "wxNullFont", &s_wxluatag_wxFont }, *************** *** 3003,3006 **** --- 3007,3048 ---- #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxSystemSettings) + #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxDateTimeHolidayAuthority) + + // %static size_t GetHolidaysInRange(const wxDateTime& dtStart, const wxDateTime& dtEnd, wxDateTimeArray& holidays) + static int LUACALL wxLua_wxDateTimeHolidayAuthority_GetHolidaysInRange(lua_State *L) + { + wxLuaState wxlState(L); + size_t returns; + // wxDateTimeArray holidays + wxDateTimeArray * holidays = (wxDateTimeArray *)wxlState.GetUserDataType(3, s_wxluatag_wxDateTimeArray); + // const wxDateTime dtEnd + const wxDateTime * dtEnd = (const wxDateTime *)wxlState.GetUserDataType(2, s_wxluatag_wxDateTime); + // const wxDateTime dtStart + const wxDateTime * dtStart = (const wxDateTime *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTime); + // call GetHolidaysInRange + returns = wxDateTimeHolidayAuthority::GetHolidaysInRange(*dtStart, *dtEnd, *holidays); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // %static bool IsHoliday(const wxDateTime& dt) + static int LUACALL wxLua_wxDateTimeHolidayAuthority_IsHoliday(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxDateTime dt + const wxDateTime * dt = (const wxDateTime *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTime); + // call IsHoliday + returns = wxDateTimeHolidayAuthority::IsHoliday(*dt); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif // (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxDateTimeHolidayAuthority) + #if (wxLUA_USE_wxFont) && (wxLUA_USE_wxSystemSettings) *************** *** 3071,3074 **** --- 3113,3135 ---- #endif // (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxArtProvider) + #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxDisplay && wxUSE_DISPLAY) + + // %static int GetFromPoint(const wxPoint& pt) + static int LUACALL wxLua_wxDisplay_GetFromPoint(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // const wxPoint pt + const wxPoint * pt = (const wxPoint *)wxlState.GetUserDataType(1, s_wxluatag_wxPoint); + // call GetFromPoint + returns = wxDisplay::GetFromPoint(*pt); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + #endif // (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxDisplay && wxUSE_DISPLAY) + #if (wxLUA_USE_wxProcess) && (!wxCHECK_VERSION(2,6,0)) *************** *** 4619,4622 **** --- 4680,4741 ---- #endif // wxLUA_USE_wxDateTime + #if wxLUA_USE_wxDateTimeHolidayAuthority + + // %static void AddAuthority(wxDateTimeHolidayAuthority *auth) + static int LUACALL wxLua_wxDateTimeHolidayAuthority_AddAuthority(lua_State *L) + { + wxLuaState wxlState(L); + // wxDateTimeHolidayAuthority auth + wxDateTimeHolidayAuthority * auth = (wxDateTimeHolidayAuthority *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeHolidayAuthority); + // call AddAuthority + wxDateTimeHolidayAuthority::AddAuthority(auth); + + return 0; + } + + // %static void ClearAllAuthorities() + static int LUACALL wxLua_wxDateTimeHolidayAuthority_ClearAllAuthorities(lua_State *L) + { + wxLuaState wxlState(L); + // call ClearAllAuthorities + wxDateTimeHolidayAuthority::ClearAllAuthorities(); + + return 0; + } + + #endif // wxLUA_USE_wxDateTimeHolidayAuthority + + #if wxLUA_USE_wxDisplay && wxUSE_DISPLAY + + // %static size_t GetCount() + static int LUACALL wxLua_wxDisplay_GetCount(lua_State *L) + { + wxLuaState wxlState(L); + size_t returns; + // call GetCount + returns = wxDisplay::GetCount(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // %static int GetFromWindow(wxWindow* win) + static int LUACALL wxLua_wxDisplay_GetFromWindow(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // wxWindow win + wxWindow * win = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call GetFromWindow + returns = wxDisplay::GetFromWindow(win); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + #endif // wxLUA_USE_wxDisplay && wxUSE_DISPLAY + #if wxLUA_USE_wxDragDrop *************** *** 4938,4941 **** --- 5057,5066 ---- + #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxDateTimeHolidayAuthority) + { LuaGlobal, "wxDateTimeHolidayAuthority_GetHolidaysInRange", wxLua_wxDateTimeHolidayAuthority_GetHolidaysInRange, 3, 3, { &s_wxluatag_wxDateTime, &s_wxluatag_wxDateTime, &s_wxluatag_wxDateTimeArray, 0 } }, + { LuaGlobal, "wxDateTimeHolidayAuthority_IsHoliday", wxLua_wxDateTimeHolidayAuthority_IsHoliday, 1, 1, { &s_wxluatag_wxDateTime, 0 } }, + #endif // (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxDateTimeHolidayAuthority) + + #if (wxLUA_USE_wxFont) && (wxLUA_USE_wxSystemSettings) { LuaGlobal, "wxSystemSettings_GetFont", wxLua_wxSystemSettings_GetFont, 1, 1, { &s_wxluaarg_Enumeration, 0 } }, *************** *** 4953,4956 **** --- 5078,5086 ---- + #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxDisplay && wxUSE_DISPLAY) + { LuaGlobal, "wxDisplay_GetFromPoint", wxLua_wxDisplay_GetFromPoint, 1, 1, { &s_wxluatag_wxPoint, 0 } }, + #endif // (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxDisplay && wxUSE_DISPLAY) + + #if (wxLUA_USE_wxProcess) && (!wxCHECK_VERSION(2,6,0)) { LuaGlobal, "wxExecute", wxLua_function_wxExecute, 3, 1, { &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluatag_wxProcess, 0 } }, *************** *** 5095,5098 **** --- 5225,5240 ---- + #if wxLUA_USE_wxDateTimeHolidayAuthority + { LuaGlobal, "wxDateTimeHolidayAuthority_AddAuthority", wxLua_wxDateTimeHolidayAuthority_AddAuthority, 1, 1, { &s_wxluatag_wxDateTimeHolidayAuthority, 0 } }, + { LuaGlobal, "wxDateTimeHolidayAuthority_ClearAllAuthorities", wxLua_wxDateTimeHolidayAuthority_ClearAllAuthorities, 0, 0, { 0 } }, + #endif // wxLUA_USE_wxDateTimeHolidayAuthority + + + #if wxLUA_USE_wxDisplay && wxUSE_DISPLAY + { LuaGlobal, "wxDisplay_GetCount", wxLua_wxDisplay_GetCount, 0, 0, { 0 } }, + { LuaGlobal, "wxDisplay_GetFromWindow", wxLua_wxDisplay_GetFromWindow, 1, 1, { &s_wxluatag_wxWindow, 0 } }, + #endif // wxLUA_USE_wxDisplay && wxUSE_DISPLAY + + #if wxLUA_USE_wxDragDrop { LuaGlobal, "wxIsDragResultOk", wxLua_function_wxIsDragResultOk, 1, 1, { &s_wxluaarg_Enumeration, 0 } }, *************** *** 5526,5529 **** --- 5668,5672 ---- { "wxClientDC", wxClientDC_methods, wxClientDC_methodCount, -1, CLASSINFO(wxClientDC), &s_wxluatag_wxClientDC, "wxWindowDC" }, { "wxDC", wxDC_methods, wxDC_methodCount, -1, CLASSINFO(wxDC), &s_wxluatag_wxDC, "wxObject" }, + { "wxDCClipper", wxDCClipper_methods, wxDCClipper_methodCount, -1, NULL, &s_wxluatag_wxDCClipper, NULL }, { "wxMemoryDC", wxMemoryDC_methods, wxMemoryDC_methodCount, -1, CLASSINFO(wxMemoryDC), &s_wxluatag_wxMemoryDC, "wxDC" }, { "wxMirrorDC", wxMirrorDC_methods, wxMirrorDC_methodCount, -1, CLASSINFO(wxMirrorDC), &s_wxluatag_wxMirrorDC, "wxDC" }, *************** *** 5557,5563 **** --- 5700,5713 ---- #if wxLUA_USE_wxDateTime { "wxDateTime", wxDateTime_methods, wxDateTime_methodCount, -1, NULL, &s_wxluatag_wxDateTime, NULL }, + { "wxDateTimeArray", wxDateTimeArray_methods, wxDateTimeArray_methodCount, -1, NULL, &s_wxluatag_wxDateTimeArray, NULL }, #endif // wxLUA_USE_wxDateTime + #if wxLUA_USE_wxDateTimeHolidayAuthority + { "wxDateTimeHolidayAuthority", wxDateTimeHolidayAuthority_methods, wxDateTimeHolidayAuthority_methodCount, -1, NULL, &s_wxluatag_wxDateTimeHolidayAuthority, NULL }, + { "wxDateTimeWorkDays", wxDateTimeWorkDays_methods, wxDateTimeWorkDays_methodCount, -1, NULL, &s_wxluatag_wxDateTimeWorkDays, "wxDateTimeHolidayAuthority" }, + #endif // wxLUA_USE_wxDateTimeHolidayAuthority + + #if wxLUA_USE_wxDialog { "wxDialog", wxDialog_methods, wxDialog_methodCount, -1, CLASSINFO(wxDialog), &s_wxluatag_wxDialog, "wxTopLevelWindow" }, *************** *** 5575,5578 **** --- 5725,5735 ---- + #if wxLUA_USE_wxDisplay && wxUSE_DISPLAY + { "wxArrayVideoModes", wxArrayVideoModes_methods, wxArrayVideoModes_methodCount, -1, NULL, &s_wxluatag_wxArrayVideoModes, NULL }, + { "wxDisplay", wxDisplay_methods, wxDisplay_methodCount, -1, NULL, &s_wxluatag_wxDisplay, NULL }, + { "wxVideoMode", wxVideoMode_methods, wxVideoMode_methodCount, -1, NULL, &s_wxluatag_wxVideoMode, NULL }, + #endif // wxLUA_USE_wxDisplay && wxUSE_DISPLAY + + #if wxLUA_USE_wxDragDrop { "wxDropFilesEvent", wxDropFilesEvent_methods, wxDropFilesEvent_methodCount, -1, CLASSINFO(wxDropFilesEvent), &s_wxluatag_wxDropFilesEvent, "wxEvent" }, *************** *** 6287,6290 **** --- 6444,6452 ---- + #if wxLUA_USE_wxDC + wxLUA_IMPLEMENT_ENCAPSULATION(wxDCClipper, wxDCClipper) + #endif // wxLUA_USE_wxDC + + #if wxLUA_USE_wxDataObject wxLUA_IMPLEMENT_ENCAPSULATION(wxBitmapDataObject, wxBitmapDataObject) *************** *** 6304,6310 **** --- 6466,6479 ---- #if wxLUA_USE_wxDateTime wxLUA_IMPLEMENT_ENCAPSULATION(wxDateTime, wxDateTime) + wxLUA_IMPLEMENT_ENCAPSULATION(wxDateTimeArray, wxDateTimeArray) #endif // wxLUA_USE_wxDateTime + #if wxLUA_USE_wxDateTimeHolidayAuthority + wxLUA_IMPLEMENT_ENCAPSULATION(wxDateTimeHolidayAuthority, wxDateTimeHolidayAuthority) + wxLUA_IMPLEMENT_ENCAPSULATION(wxDateTimeWorkDays, wxDateTimeWorkDays) + #endif // wxLUA_USE_wxDateTimeHolidayAuthority + + #if wxLUA_USE_wxDir wxLUA_IMPLEMENT_ENCAPSULATION(wxDir, wxDir) *************** *** 6312,6315 **** --- 6481,6491 ---- + #if wxLUA_USE_wxDisplay && wxUSE_DISPLAY + wxLUA_IMPLEMENT_ENCAPSULATION(wxArrayVideoModes, wxArrayVideoModes) + wxLUA_IMPLEMENT_ENCAPSULATION(wxDisplay, wxDisplay) + wxLUA_IMPLEMENT_ENCAPSULATION(wxVideoMode, wxVideoMode) + #endif // wxLUA_USE_wxDisplay && wxUSE_DISPLAY + + #if wxLUA_USE_wxDragDrop wxLUA_IMPLEMENT_ENCAPSULATION(wxDropSource, wxDropSource) Index: image.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/image.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** image.cpp 9 Jun 2006 22:51:32 -0000 1.16 --- image.cpp 2 Nov 2006 23:38:09 -0000 1.17 *************** *** 1398,1418 **** } - // %operator bool operator==(const wxImage& image) const - static int LUACALL wxLua_wxImage_op_eq(lua_State *L) - { - wxLuaState wxlState(L); - bool returns; - // const wxImage image - const wxImage * image = (const wxImage *)wxlState.GetUserDataType(2, s_wxluatag_wxImage); - // get this - wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); - // call op_eq - returns = (*self)==(*image); - // push the result flag - lua_pushboolean(L, returns); - - return 1; - } - static int LUACALL wxLua_wxImage_destructor(lua_State *L) { --- 1398,1401 ---- *************** *** 1543,1547 **** { LuaMethod, "SetRGB", wxLua_wxImage_SetRGB, 5, 5, { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 } }, { LuaMethod, "op_assign", wxLua_wxImage_op_assign, 1, 1, { &s_wxluatag_wxImage, 0 } }, - { LuaMethod, "op_eq", wxLua_wxImage_op_eq, 1, 1, { &s_wxluatag_wxImage, 0 } }, { LuaDelete, "wxImage", wxLua_wxImage_destructor, 0, 0, {0} }, { LuaMethod, "Delete", wxLua_wxImage_Delete, 0, 0, {0} }, --- 1526,1529 ---- Index: datetime.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/datetime.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** datetime.cpp 1 Nov 2006 23:44:47 -0000 1.18 --- datetime.cpp 2 Nov 2006 23:38:09 -0000 1.19 *************** *** 1497,1500 **** --- 1497,1786 ---- + #if wxLUA_USE_wxDateTime + // ------------------------------------------------------------------------------------------------- + // Bind class wxDateTimeArray + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxDateTimeArray' + int s_wxluatag_wxDateTimeArray = -1; + + // %overload wxDateTimeArray() + static int LUACALL wxLua_wxDateTimeArray_constructor1(lua_State *L) + { + wxLuaState wxlState(L); + wxDateTimeArray *returns; + // call constructor + returns = new wxDateTimeArray(); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxDateTimeArray *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxDateTimeArray, returns); + + return 1; + } + + // %overload %constructor wxDateTimeArrayCopy(const wxDateTimeArray& array) + static int LUACALL wxLua_wxDateTimeArrayCopy_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxDateTimeArray *returns; + // const wxDateTimeArray array + const wxDateTimeArray * array = (const wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call constructor + returns = new wxDateTimeArray(*array); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxDateTimeArray *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxDateTimeArray, returns); + + return 1; + } + + // void Add(const wxDateTime& dateTime, size_t copies = 1) + static int LUACALL wxLua_wxDateTimeArray_Add(lua_State *L) + { + wxLuaState wxlState(L); + // get number of arguments + int argCount = lua_gettop(L); + // size_t copies = 1 + size_t copies = (argCount >= 3 ? (size_t)wxlState.GetNumberType(3) : 1); + // const wxDateTime dateTime + const wxDateTime * dateTime = (const wxDateTime *)wxlState.GetUserDataType(2, s_wxluatag_wxDateTime); + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call Add + self->Add(*dateTime, copies); + + return 0; + } + + // void Alloc(size_t nCount) + static int LUACALL wxLua_wxDateTimeArray_Alloc(lua_State *L) + { + wxLuaState wxlState(L); + // size_t nCount + size_t nCount = (size_t)wxlState.GetNumberType(2); + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call Alloc + self->Alloc(nCount); + + return 0; + } + + // void Clear() + static int LUACALL wxLua_wxDateTimeArray_Clear(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call Clear + self->Clear(); + + return 0; + } + + // void Empty() + static int LUACALL wxLua_wxDateTimeArray_Empty(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call Empty + self->Empty(); + + return 0; + } + + // int GetCount() const + static int LUACALL wxLua_wxDateTimeArray_GetCount(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call GetCount + returns = self->GetCount(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // void Insert(const wxDateTime& dt, int nIndex, size_t copies = 1) + static int LUACALL wxLua_wxDateTimeArray_Insert(lua_State *L) + { + wxLuaState wxlState(L); + // get number of arguments + int argCount = lua_gettop(L); + // size_t copies = 1 + size_t copies = (argCount >= 4 ? (size_t)wxlState.GetNumberType(4) : 1); + // int nIndex + int nIndex = (int)wxlState.GetNumberType(3); + // const wxDateTime dt + const wxDateTime * dt = (const wxDateTime *)wxlState.GetUserDataType(2, s_wxluatag_wxDateTime); + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call Insert + self->Insert(*dt, nIndex, copies); + + return 0; + } + + // bool IsEmpty() + static int LUACALL wxLua_wxDateTimeArray_IsEmpty(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call IsEmpty + returns = self->IsEmpty(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // wxDateTime Item(size_t nIndex) const + static int LUACALL wxLua_wxDateTimeArray_Item(lua_State *L) + { + wxLuaState wxlState(L); + wxDateTime *returns; + // size_t nIndex + size_t nIndex = (size_t)wxlState.GetNumberType(2); + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call Item + // allocate a new object using the copy constructor + returns = new wxDateTime(self->Item(nIndex)); + // add the new object to the tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxDateTime *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxDateTime, returns); + + return 1; + } + + // wxDateTime Last() + static int LUACALL wxLua_wxDateTimeArray_Last(lua_State *L) + { + wxLuaState wxlState(L); + wxDateTime *returns; + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call Last + // allocate a new object using the copy constructor + returns = new wxDateTime(self->Last()); + // add the new object to the tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxDateTime *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxDateTime, returns); + + return 1; + } + + // void RemoveAt(size_t nIndex, size_t count = 1) + static int LUACALL wxLua_wxDateTimeArray_RemoveAt(lua_State *L) + { + wxLuaState wxlState(L); + // get number of arguments + int argCount = lua_gettop(L); + // size_t count = 1 + size_t count = (argCount >= 3 ? (size_t)wxlState.GetNumberType(3) : 1); + // size_t nIndex + size_t nIndex = (size_t)wxlState.GetNumberType(2); + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call RemoveAt + self->RemoveAt(nIndex, count); + + return 0; + } + + // void Shrink() + static int LUACALL wxLua_wxDateTimeArray_Shrink(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // call Shrink + self->Shrink(); + + return 0; + } + + static int LUACALL wxLua_wxDateTimeArray_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + + static int LUACALL wxLua_wxDateTimeArray_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxDateTimeArray * self = (wxDateTimeArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDateTimeArray); + // remove from tracked memory list + if (self != 0) + if (wxlState.RemoveTrackedMemory(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_wxDateTime) + // Overloaded functions for wxLua_wxDateTimeArray_constructor + static int LUACALL wxLua_wxDateTimeArray_constructor(lua_State *L) + { + // function overload table + static WXLUAMETHOD overloaded_methods[] = + { + { LuaConstructor, "wxDateTimeArray", wxLua_wxDateTimeArray_constructor1, 0, 0, { 0 } }, + { LuaConstructor, "wxDateTimeArrayCopy", wxLua_wxDateTimeArrayCopy_constructor, 1, 1, { &s_wxluatag_wxDateTimeArray, 0 } }, + }; + static int overloaded_methodCount = sizeof(overloaded_methods)/sizeof(overloaded_methods[0]); + wxLuaState wxlState(L); + return wxlState.CallOverloadedFunction(overloaded_methods, overloaded_methodCount); + } + #endif // (wxLUA_USE_wxDateTime) + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxDateTimeArray_methods[] = { + { LuaConstructor, "wxDateTimeArray", wxLua_wxDateTimeArray_constructor, 0, 0, { 0 } }, + { LuaConstructor, "wxDateTimeArrayCopy", wxLua_wxDateTimeArrayCopy_constructor, 1, 1, { &s_wxluatag_wxDateTimeArray, 0 } }, + { LuaMethod, "Add", wxLua_wxDateTimeArray_Add, 2, 1, { &s_wxluatag_wxDateTime, &s_wxluaarg_Number, 0 } }, + { LuaMethod, "Alloc", wxLua_wxDateTimeArray_Alloc, 1, 1, { &s_wxluaarg_Number, 0 } }, + { LuaMethod, "Clear", wxLua_wxDateTimeArray_Clear, 0, 0, { 0 } }, + { LuaMethod, "Empty", wxLua_wxDateTimeArray_Empty, 0, 0, { 0 } }, + { LuaMethod, "GetCount", wxLua_wxDateTimeArray_GetCount, 0, 0, { 0 } }, + { LuaMethod, "Insert", wxLua_wxDateTimeArray_Insert, 3, 2, { &s_wxluatag_wxDateTime, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 } }, + { LuaMethod, "IsEmpty", wxLua_wxDateTimeArray_IsEmpty, 0, 0, { 0 } }, + { LuaMethod, "Item", wxLua_wxDateTimeArray_Item, 1, 1, { &s_wxluaarg_Number, 0 } }, + { LuaMethod, "Last", wxLua_wxDateTimeArray_Last, 0, 0, { 0 } }, + { LuaMethod, "RemoveAt", wxLua_wxDateTimeArray_RemoveAt, 2, 1, { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 } }, + { LuaMethod, "Shrink", wxLua_wxDateTimeArray_Shrink, 0, 0, { 0 } }, + { LuaDelete, "wxDateTimeArray", wxLua_wxDateTimeArray_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxDateTimeArray_Delete, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxDateTimeArray_methods = s_wxDateTimeArray_methods; + int wxDateTimeArray_methodCount = sizeof(s_wxDateTimeArray_methods)/sizeof(s_wxDateTimeArray_methods[0]); + #endif // wxLUA_USE_wxDateTime + + #if wxLUA_USE_wxTimeSpan // ------------------------------------------------------------------------------------------------- *************** *** 2571,2574 **** --- 2857,2998 ---- + #if wxLUA_USE_wxDateTimeHolidayAuthority + // ------------------------------------------------------------------------------------------------- + // Bind class wxDateTimeHolidayAuthority + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxDateTimeHolidayAuthority' + int s_wxluatag_wxDateTimeHolidayAuthority = -1; + + + #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxDateTimeHolidayAuthority) + // %static bool IsHoliday(const wxDateTime& dt) + static int LUACALL wxLua_wxDateTimeHolidayAuthority_IsHoliday(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxDateTime dt + const wxDateTime * dt = (const wxDateTime *)wxlState.GetUserDataType(2, s_wxluatag_wxDateTime); + // call IsHoliday + returns = wxDateTimeHolidayAuthority::IsHoliday(*dt); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // %static size_t GetHolidaysInRange(const wxDateTime& dtStart, const wxDateTime& dtEnd, wxDateTimeArray& holidays) + static int LUACALL wxLua_wxDateTimeHolidayAuthority_GetHolidaysInRange(lua_State *L) + { + wxLuaState wxlState(L); + size_t returns; + // wxDateTimeArray holidays + wxDateTimeArray * holidays = (wxDateTimeArray *)wxlState.GetUserDataType(4, s_wxluatag_wxDateTimeArray); + // const wxDateTime dtEnd + const wxDateTime * dtEnd = (const wxDateTime *)wxlState.GetUserDataType(3, s_wxluatag_wxDateTime); + // const wxDateTime dtStart + const wxDateTime * dtStart = (const wxDateTime *)wxlState.GetUserDataType(2, s_wxluatag_wxDateTime); + // call GetHolidaysInRange + returns = wxDateTimeHolidayAuthority::GetHolidaysInRange(*dtStart, *dtEnd, *holidays); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + #endif // (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxDateTimeHolidayAuthority) + + // %static void ClearAllAuthorities() + static int LUACALL wxLua_wxDateTimeHolidayAuthority_ClearAllAuthorities(lua_State *L) + { + wxLuaState wxlState(L); + // call ClearAllAuthorities + wxDateTimeHolidayAuthority::ClearAllAuthorities(); + + return 0; + } + + // %static void AddAuthority(wxDateTimeHolidayAuthority *auth) + static int LUACALL wxLua_wxDateTimeHolidayAuthority_AddAuthority(lua_State *L) + { + wxLuaState wxlState(L); + // wxDateTimeHolidayAuthority auth + wxDateTimeHolidayAuthority * auth = (wxDateTimeHolidayAuthority *)wxlState.GetUserDataType(2, s_wxluatag_wxDateTimeHolidayAuthority); + // call AddAuthority + wxDateTimeHolidayAuthority::AddAuthority(auth); + + return 0; + } + + static int LUACALL wxLua_wxDateTimeHolidayAuthority_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxDateTimeHolidayAuthority_methods[] = { + + #if (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxDateTimeHolidayAuthority) + { LuaMethod, "IsHoliday", wxLua_wxDateTimeHolidayAuthority_IsHoliday, 1, 1, { &s_wxluatag_wxDateTime, 0 } }, + { LuaMethod, "GetHolidaysInRange", wxLua_wxDateTimeHolidayAuthority_GetHolidaysInRange, 3, 3, { &s_wxluatag_wxDateTime, &s_wxluatag_wxDateTime, &s_wxluatag_wxDateTimeArray, 0 } }, + #endif // (wxLUA_USE_wxDateTime) && (wxLUA_USE_wxDateTimeHolidayAuthority) + + { LuaMethod, "ClearAllAuthorities", wxLua_wxDateTimeHolidayAuthority_ClearAllAuthorities, 0, 0, { 0 } }, + { LuaMethod, "AddAuthority", wxLua_wxDateTimeHolidayAuthority_AddAuthority, 1, 1, { &s_wxluatag_wxDateTimeHolidayAuthority, 0 } }, + { LuaDelete, "wxDateTimeHolidayAuthority", wxLua_wxDateTimeHolidayAuthority_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxDateTimeHolidayAuthority_methods = s_wxDateTimeHolidayAuthority_methods; + int wxDateTimeHolidayAuthority_methodCount = sizeof(s_wxDateTimeHolidayAuthority_methods)/sizeof(s_wxDateTimeHolidayAuthority_methods[0]); + #endif // wxLUA_USE_wxDateTimeHolidayAuthority + + + #if wxLUA_USE_wxDateTimeHolidayAuthority + // ------------------------------------------------------------------------------------------------- + // Bind class wxDateTimeWorkDays + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxDateTimeWorkDays' + int s_wxluatag_wxDateTimeWorkDays = -1; + + // wxDateTimeWorkDays() + static int LUACALL wxLua_wxDateTimeWorkDays_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxDateTimeWorkDays *returns; + // call constructor + returns = new wxDateTimeWorkDays(); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxDateTimeWorkDays, returns); + + return 1; + } + + static int LUACALL wxLua_wxDateTimeWorkDays_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxDateTimeWorkDays_methods[] = { + { LuaConstructor, "wxDateTimeWorkDays", wxLua_wxDateTimeWorkDays_constructor, 0, 0, { 0 } }, + { LuaDelete, "wxDateTimeWorkDays", wxLua_wxDateTimeWorkDays_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxDateTimeWorkDays_methods = s_wxDateTimeWorkDays_methods; + int wxDateTimeWorkDays_methodCount = sizeof(s_wxDateTimeWorkDays_methods)/sizeof(s_wxDateTimeWorkDays_methods[0]); + #endif // wxLUA_USE_wxDateTimeHolidayAuthority + + #if wxLUA_USE_wxTimer // ------------------------------------------------------------------------------------------------- Index: gdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/gdi.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** gdi.cpp 11 Oct 2006 03:24:02 -0000 1.31 --- gdi.cpp 2 Nov 2006 23:38:09 -0000 1.32 *************** *** 767,770 **** --- 767,854 ---- int s_wxluatag_wxRect = -1; + + #if (!wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxPointSizeRect) + // !%wxchkver27 bool Inside(wxCoord cx, wxCoord cy) + static int LUACALL wxLua_wxRect_Inside(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; [...1139 lines suppressed...] + { LuaMethod, "GetClientArea", wxLua_wxDisplay_GetClientArea, 0, 0, { 0 } }, + #endif // (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxDisplay && wxUSE_DISPLAY) + + { LuaConstructor, "wxDisplay", wxLua_wxDisplay_constructor, 1, 0, { &s_wxluaarg_Number, 0 } }, + { LuaMethod, "ChangeMode", wxLua_wxDisplay_ChangeMode, 1, 0, { &s_wxluatag_wxVideoMode, 0 } }, + { LuaMethod, "GetCount", wxLua_wxDisplay_GetCount, 0, 0, { 0 } }, + { LuaMethod, "GetCurrentMode", wxLua_wxDisplay_GetCurrentMode, 0, 0, { 0 } }, + { LuaMethod, "GetFromWindow", wxLua_wxDisplay_GetFromWindow, 1, 1, { &s_wxluatag_wxWindow, 0 } }, + { LuaMethod, "GetModes", wxLua_wxDisplay_GetModes, 1, 0, { &s_wxluatag_wxVideoMode, 0 } }, + { LuaMethod, "GetName", wxLua_wxDisplay_GetName, 0, 0, { 0 } }, + { LuaMethod, "IsOk", wxLua_wxDisplay_IsOk, 0, 0, { 0 } }, + { LuaMethod, "IsPrimary", wxLua_wxDisplay_IsPrimary, 0, 0, { 0 } }, + { LuaDelete, "wxDisplay", wxLua_wxDisplay_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxDisplay_methods = s_wxDisplay_methods; + int wxDisplay_methodCount = sizeof(s_wxDisplay_methods)/sizeof(s_wxDisplay_methods[0]); + #endif // wxLUA_USE_wxDisplay && wxUSE_DISPLAY + |