From: John L. <jr...@us...> - 2007-03-13 05:01:07
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2508/wxLua/modules/wxbind/src Modified Files: image.cpp wx_bind.cpp Log Message: update image.i to wxWidgets 2.8 using headers Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** wx_bind.cpp 12 Mar 2007 23:12:37 -0000 1.85 --- wx_bind.cpp 13 Mar 2007 05:01:02 -0000 1.86 *************** *** 531,535 **** { "wxCLIP_CHILDREN", wxCLIP_CHILDREN }, { "wxCOLOURED", wxCOLOURED }, - { "wxDD_NEW_DIR_BUTTON", wxDD_NEW_DIR_BUTTON }, { "wxDOUBLE_BORDER", wxDOUBLE_BORDER }, { "wxEQUIV", wxEQUIV }, --- 531,534 ---- *************** *** 1742,1747 **** { "wxIDLE_PROCESS_ALL", wxIDLE_PROCESS_ALL }, { "wxIDLE_PROCESS_SPECIFIED", wxIDLE_PROCESS_SPECIFIED }, - { "wxIMAGE_RESOLUTION_CM", wxIMAGE_RESOLUTION_CM }, - { "wxIMAGE_RESOLUTION_INCHES", wxIMAGE_RESOLUTION_INCHES }, { "wxLEFT", wxLEFT }, { "wxLUAOBJECT_ARRAYINT", wxLUAOBJECT_ARRAYINT }, --- 1741,1744 ---- *************** *** 2290,2293 **** --- 2287,2294 ---- { "wxBMP_8BPP_PALETTE", wxBMP_8BPP_PALETTE }, { "wxBMP_8BPP_RED", wxBMP_8BPP_RED }, + { "wxIMAGE_QUALITY_HIGH", wxIMAGE_QUALITY_HIGH }, + { "wxIMAGE_QUALITY_NORMAL", wxIMAGE_QUALITY_NORMAL }, + { "wxIMAGE_RESOLUTION_CM", wxIMAGE_RESOLUTION_CM }, + { "wxIMAGE_RESOLUTION_INCHES", wxIMAGE_RESOLUTION_INCHES }, #endif // wxLUA_USE_wxImage && wxUSE_IMAGE *************** *** 2804,2807 **** --- 2805,2813 ---- #endif // (wxCHECK_VERSION(2,6,0)) && (wxLUA_USE_wxImage && wxUSE_IMAGE) + #if (wxUSE_LIBPNG) && (wxLUA_USE_wxImage && wxUSE_IMAGE) + { "wxIMAGE_OPTION_PNG_BITDEPTH", wxIMAGE_OPTION_PNG_BITDEPTH }, + { "wxIMAGE_OPTION_PNG_FORMAT", wxIMAGE_OPTION_PNG_FORMAT }, + #endif // (wxUSE_LIBPNG) && (wxLUA_USE_wxImage && wxUSE_IMAGE) + #if (wxUSE_LIBTIFF) && (wxLUA_USE_wxImage && wxUSE_IMAGE) { "wxIMAGE_OPTION_BITSPERSAMPLE", _T("BitsPerSample") }, *************** *** 6735,6738 **** --- 6741,6747 ---- { "wxImage", wxImage_methods, wxImage_methodCount, CLASSINFO(wxImage), &s_wxluatag_wxImage, "wxObject", NULL }, { "wxImageHandler", wxImageHandler_methods, wxImageHandler_methodCount, CLASSINFO(wxImageHandler), &s_wxluatag_wxImageHandler, "wxObject", NULL }, + { "wxImageHistogram", wxImageHistogram_methods, wxImageHistogram_methodCount, NULL, &s_wxluatag_wxImageHistogram, NULL, NULL }, + { "wxImageHistogram_iterator", wxImageHistogram_iterator_methods, wxImageHistogram_iterator_methodCount, NULL, &s_wxluatag_wxImageHistogram_iterator, NULL, NULL }, + { "wxImageHistogramEntry", wxImageHistogramEntry_methods, wxImageHistogramEntry_methodCount, NULL, &s_wxluatag_wxImageHistogramEntry, NULL, NULL }, { "wxXPMHandler", wxXPMHandler_methods, wxXPMHandler_methodCount, CLASSINFO(wxXPMHandler), &s_wxluatag_wxXPMHandler, "wxImageHandler", NULL }, #endif // wxLUA_USE_wxImage && wxUSE_IMAGE *************** *** 7434,7437 **** --- 7443,7453 ---- + #if wxLUA_USE_wxImage && wxUSE_IMAGE + wxLUA_IMPLEMENT_ENCAPSULATION(wxImageHistogram, wxImageHistogram) + wxLUA_IMPLEMENT_ENCAPSULATION(wxImageHistogram::iterator, wxImageHistogram_iterator) + wxLUA_IMPLEMENT_ENCAPSULATION(wxImageHistogramEntry, wxImageHistogramEntry) + #endif // wxLUA_USE_wxImage && wxUSE_IMAGE + + #if wxLUA_USE_wxListCtrl && wxUSE_LISTCTRL wxLUA_IMPLEMENT_ENCAPSULATION(wxListItemAttr, wxListItemAttr) Index: image.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/image.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** image.cpp 9 Mar 2007 00:15:16 -0000 1.29 --- image.cpp 13 Mar 2007 05:01:02 -0000 1.30 *************** *** 36,39 **** --- 36,230 ---- + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxImage && wxUSE_IMAGE)) && (wxLUA_USE_wxImage && wxUSE_IMAGE) + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_Blur[] = { &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 wxImage Blur(int radius) + static int LUACALL wxLua_wxImage_Blur(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // int radius + int radius = (int)wxlState.GetNumberType(2); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call Blur + // allocate a new object using the copy constructor + returns = new wxImage(self->Blur(radius)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImage *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_BlurHorizontal[] = { &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 wxImage BlurHorizontal(int radius) + static int LUACALL wxLua_wxImage_BlurHorizontal(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // int radius + int radius = (int)wxlState.GetNumberType(2); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call BlurHorizontal + // allocate a new object using the copy constructor + returns = new wxImage(self->BlurHorizontal(radius)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImage *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_BlurVertical[] = { &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 wxImage BlurVertical(int radius) + static int LUACALL wxLua_wxImage_BlurVertical(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // int radius + int radius = (int)wxlState.GetNumberType(2); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call BlurVertical + // allocate a new object using the copy constructor + returns = new wxImage(self->BlurVertical(radius)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImage *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_ConvertToGreyscale[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 wxImage ConvertToGreyscale( double lr = 0.299, double lg = 0.587, double lb = 0.114 ) const + static int LUACALL wxLua_wxImage_ConvertToGreyscale(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // get number of arguments + int argCount = lua_gettop(L); + // double lb = 0.114 + double lb = (argCount >= 4 ? (double)wxlState.GetNumberType(4) : 0.114); + // double lg = 0.587 + double lg = (argCount >= 3 ? (double)wxlState.GetNumberType(3) : 0.587); + // double lr = 0.299 + double lr = (argCount >= 2 ? (double)wxlState.GetNumberType(2) : 0.299); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call ConvertToGreyscale + // allocate a new object using the copy constructor + returns = new wxImage(self->ConvertToGreyscale(lr, lg, lb)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImage *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_ResampleBox[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 wxImage ResampleBox(int width, int height) const + static int LUACALL wxLua_wxImage_ResampleBox(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // int height + int height = (int)wxlState.GetNumberType(3); + // int width + int width = (int)wxlState.GetNumberType(2); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call ResampleBox + // allocate a new object using the copy constructor + returns = new wxImage(self->ResampleBox(width, height)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImage *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_ResampleBicubic[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 wxImage ResampleBicubic(int width, int height) const + static int LUACALL wxLua_wxImage_ResampleBicubic(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // int height + int height = (int)wxlState.GetNumberType(3); + // int width + int width = (int)wxlState.GetNumberType(2); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call ResampleBicubic + // allocate a new object using the copy constructor + returns = new wxImage(self->ResampleBicubic(width, height)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImage *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_Rescale[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 wxImage& Rescale( int width, int height, int quality = wxIMAGE_QUALITY_NORMAL ) + static int LUACALL wxLua_wxImage_Rescale(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // get number of arguments + int argCount = lua_gettop(L); + // int quality = wxIMAGE_QUALITY_NORMAL + int quality = (argCount >= 4 ? (int)wxlState.GetNumberType(4) : wxIMAGE_QUALITY_NORMAL); + // int height + int height = (int)wxlState.GetNumberType(3); + // int width + int width = (int)wxlState.GetNumberType(2); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call Rescale + returns = &self->Rescale(width, height, quality); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_Scale[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 wxImage Scale( int width, int height, int quality = wxIMAGE_QUALITY_NORMAL ) const + static int LUACALL wxLua_wxImage_Scale(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // get number of arguments + int argCount = lua_gettop(L); + // int quality = wxIMAGE_QUALITY_NORMAL + int quality = (argCount >= 4 ? (int)wxlState.GetNumberType(4) : wxIMAGE_QUALITY_NORMAL); + // int height + int height = (int)wxlState.GetNumberType(3); + // int width + int width = (int)wxlState.GetNumberType(2); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call Scale + // allocate a new object using the copy constructor + returns = new wxImage(self->Scale(width, height, quality)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImage *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxImage && wxUSE_IMAGE)) && (wxLUA_USE_wxImage && wxUSE_IMAGE) + + #if (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxImage && wxUSE_IMAGE) static wxLuaArgTag s_wxluatagArray_wxLua_wxImageFromBitmap_constructor[] = { &s_wxluatag_wxBitmap, 0 }; *************** *** 59,62 **** --- 250,300 ---- + #if (wxLUA_USE_wxImage && wxUSE_IMAGE) && ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxImage && wxUSE_IMAGE)) + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_Rescale[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // !%wxchkver_2_8 wxImage& Rescale(int width, int height) + static int LUACALL wxLua_wxImage_Rescale(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // int height + int height = (int)wxlState.GetNumberType(3); + // int width + int width = (int)wxlState.GetNumberType(2); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call Rescale + returns = &self->Rescale(width, height); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_Scale[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // !%wxchkver_2_8 wxImage Scale(int width, int height) const + static int LUACALL wxLua_wxImage_Scale(lua_State *L) + { + wxLuaState wxlState(L); + wxImage *returns; + // int height + int height = (int)wxlState.GetNumberType(3); + // int width + int width = (int)wxlState.GetNumberType(2); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call Scale + // allocate a new object using the copy constructor + returns = new wxImage(self->Scale(width, height)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImage *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImage, returns); + + return 1; + } + + #endif // (wxLUA_USE_wxImage && wxUSE_IMAGE) && ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxImage && wxUSE_IMAGE)) + + #if (wxLUA_USE_wxList) && (wxLUA_USE_wxImage && wxUSE_IMAGE) // static wxList& GetHandlers() *************** *** 423,426 **** --- 661,682 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_ComputeHistogram[] = { &s_wxluatag_wxImageHistogram, 0 }; + // unsigned long ComputeHistogram(wxImageHistogram& histogram) const + static int LUACALL wxLua_wxImage_ComputeHistogram(lua_State *L) + { + wxLuaState wxlState(L); + unsigned long returns; + // wxImageHistogram histogram + wxImageHistogram * histogram = (wxImageHistogram *)wxlState.GetUserDataType(2, s_wxluatag_wxImageHistogram); + // get this + wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); + // call ComputeHistogram + returns = self->ComputeHistogram(*histogram); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_ConvertToMono[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; // wxImage ConvertToMono(unsigned char r, unsigned char g, unsigned char b) const *************** *** 1115,1138 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_Rescale[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; - // wxImage& Rescale(int width, int height) - static int LUACALL wxLua_wxImage_Rescale(lua_State *L) - { - wxLuaState wxlState(L); - wxImage *returns; - // int height - int height = (int)wxlState.GetNumberType(3); - // int width - int width = (int)wxlState.GetNumberType(2); - // get this - wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); - // call Rescale - returns = &self->Rescale(width, height); - // push the result datatype - wxlState.PushUserDataType(s_wxluatag_wxImage, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_RotateHue[] = { &s_wxluaarg_Number, 0 }; // void RotateHue(double angle) --- 1371,1374 ---- *************** *** 1229,1255 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_Scale[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; - // wxImage Scale(int width, int height) const - static int LUACALL wxLua_wxImage_Scale(lua_State *L) - { - wxLuaState wxlState(L); - wxImage *returns; - // int height - int height = (int)wxlState.GetNumberType(3); - // int width - int width = (int)wxlState.GetNumberType(2); - // get this - wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); - // call Scale - // allocate a new object using the copy constructor - returns = new wxImage(self->Scale(width, height)); - // add the new object to the tracked memory list - wxLua_AddTrackedObject(wxlState, (wxImage *)returns); - // push the result datatype - wxlState.PushUserDataType(s_wxluatag_wxImage, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_SetAlpha[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; // void SetAlpha(int x, int y, unsigned char alpha) --- 1465,1468 ---- *************** *** 1480,1483 **** --- 1693,1708 ---- WXLUAMETHOD wxImage_methods[] = { + #if ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxImage && wxUSE_IMAGE)) && (wxLUA_USE_wxImage && wxUSE_IMAGE) + { LuaMethod, "Blur", wxLua_wxImage_Blur, 1, 1, s_wxluatagArray_wxLua_wxImage_Blur }, + { LuaMethod, "BlurHorizontal", wxLua_wxImage_BlurHorizontal, 1, 1, s_wxluatagArray_wxLua_wxImage_BlurHorizontal }, + { LuaMethod, "BlurVertical", wxLua_wxImage_BlurVertical, 1, 1, s_wxluatagArray_wxLua_wxImage_BlurVertical }, + { LuaMethod, "ConvertToGreyscale", wxLua_wxImage_ConvertToGreyscale, 3, 0, s_wxluatagArray_wxLua_wxImage_ConvertToGreyscale }, + { LuaMethod, "ResampleBox", wxLua_wxImage_ResampleBox, 2, 2, s_wxluatagArray_wxLua_wxImage_ResampleBox }, + { LuaMethod, "ResampleBicubic", wxLua_wxImage_ResampleBicubic, 2, 2, s_wxluatagArray_wxLua_wxImage_ResampleBicubic }, + { LuaMethod, "Rescale", wxLua_wxImage_Rescale, 3, 2, s_wxluatagArray_wxLua_wxImage_Rescale }, + { LuaMethod, "Scale", wxLua_wxImage_Scale, 3, 2, s_wxluatagArray_wxLua_wxImage_Scale }, + #endif // ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxImage && wxUSE_IMAGE)) && (wxLUA_USE_wxImage && wxUSE_IMAGE) + + #if (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxImage && wxUSE_IMAGE) { LuaConstructor, "wxImageFromBitmap", wxLua_wxImageFromBitmap_constructor, 1, 1, s_wxluatagArray_wxLua_wxImageFromBitmap_constructor }, *************** *** 1485,1488 **** --- 1710,1719 ---- + #if (wxLUA_USE_wxImage && wxUSE_IMAGE) && ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxImage && wxUSE_IMAGE)) + { LuaMethod, "Rescale", wxLua_wxImage_Rescale, 2, 2, s_wxluatagArray_wxLua_wxImage_Rescale }, + { LuaMethod, "Scale", wxLua_wxImage_Scale, 2, 2, s_wxluatagArray_wxLua_wxImage_Scale }, + #endif // (wxLUA_USE_wxImage && wxUSE_IMAGE) && ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxImage && wxUSE_IMAGE)) + + #if (wxLUA_USE_wxList) && (wxLUA_USE_wxImage && wxUSE_IMAGE) { LuaMethod, "GetHandlers", wxLua_wxImage_GetHandlers, 0, 0, s_wxluaargArray_None }, *************** *** 1517,1520 **** --- 1748,1752 ---- { LuaMethod, "AddHandler", wxLua_wxImage_AddHandler, 1, 1, s_wxluatagArray_wxLua_wxImage_AddHandler }, { LuaMethod, "CleanUpHandlers", wxLua_wxImage_CleanUpHandlers, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "ComputeHistogram", wxLua_wxImage_ComputeHistogram, 1, 1, s_wxluatagArray_wxLua_wxImage_ComputeHistogram }, { LuaMethod, "ConvertToMono", wxLua_wxImage_ConvertToMono, 3, 3, s_wxluatagArray_wxLua_wxImage_ConvertToMono }, { LuaMethod, "Copy", wxLua_wxImage_Copy, 0, 0, s_wxluaargArray_None }, *************** *** 1555,1559 **** { LuaMethod, "Mirror", wxLua_wxImage_Mirror, 1, 0, s_wxluatagArray_wxLua_wxImage_Mirror }, { LuaMethod, "Replace", wxLua_wxImage_Replace, 6, 6, s_wxluatagArray_wxLua_wxImage_Replace }, - { LuaMethod, "Rescale", wxLua_wxImage_Rescale, 2, 2, s_wxluatagArray_wxLua_wxImage_Rescale }, { LuaMethod, "RotateHue", wxLua_wxImage_RotateHue, 1, 1, s_wxluatagArray_wxLua_wxImage_RotateHue }, { LuaMethod, "Rotate90", wxLua_wxImage_Rotate90, 1, 0, s_wxluatagArray_wxLua_wxImage_Rotate90 }, --- 1787,1790 ---- *************** *** 1561,1565 **** { LuaMethod, "SaveFileType", wxLua_wxImage_SaveFileType, 1, 1, s_wxluatagArray_wxLua_wxImage_SaveFileType }, { LuaMethod, "SaveMimeFile", wxLua_wxImage_SaveMimeFile, 2, 2, s_wxluatagArray_wxLua_wxImage_SaveMimeFile }, - { LuaMethod, "Scale", wxLua_wxImage_Scale, 2, 2, s_wxluatagArray_wxLua_wxImage_Scale }, { LuaMethod, "SetAlpha", wxLua_wxImage_SetAlpha, 3, 3, s_wxluatagArray_wxLua_wxImage_SetAlpha }, { LuaMethod, "SetAlphaData", wxLua_wxImage_SetAlphaData, 2, 0, s_wxluatagArray_wxLua_wxImage_SetAlphaData }, --- 1792,1795 ---- *************** *** 1582,1585 **** --- 1812,2235 ---- #if wxLUA_USE_wxImage && wxUSE_IMAGE // --------------------------------------------------------------------------- + // Bind class wxImageHistogramEntry + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxImageHistogramEntry' + int s_wxluatag_wxImageHistogramEntry = -1; + + // wxImageHistogramEntry() + static int LUACALL wxLua_wxImageHistogramEntry_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxImageHistogramEntry *returns; + // call constructor + returns = new wxImageHistogramEntry(); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxImageHistogramEntry, returns); + + return 1; + } + + // %rename Index %member unsigned long index // GetIndex() and SetIndex(idx) + static int LUACALL wxLua_wxImageHistogramEntry_GetIndex(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxImageHistogramEntry *self = (wxImageHistogramEntry *) wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogramEntry); + // push the result number + lua_pushnumber(L, self->index); + // return the number of parameters + return 1; + } + + // %rename Index %member unsigned long index // GetIndex() and SetIndex(idx) + static int LUACALL wxLua_wxImageHistogramEntry_SetIndex(lua_State *L) + { + wxLuaState wxlState(L); + // get the number value + long val = (long)wxlState.GetNumberType(2); + // get this + wxImageHistogramEntry *self = (wxImageHistogramEntry *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogramEntry); + self->index = val; + // return the number of parameters + return 0; + } + + // %rename Value %member unsigned long value // GetValue() and SetValue(val) + static int LUACALL wxLua_wxImageHistogramEntry_GetValue(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxImageHistogramEntry *self = (wxImageHistogramEntry *) wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogramEntry); + // push the result number + lua_pushnumber(L, self->value); + // return the number of parameters + return 1; + } + + // %rename Value %member unsigned long value // GetValue() and SetValue(val) + static int LUACALL wxLua_wxImageHistogramEntry_SetValue(lua_State *L) + { + wxLuaState wxlState(L); + // get the number value + long val = (long)wxlState.GetNumberType(2); + // get this + wxImageHistogramEntry *self = (wxImageHistogramEntry *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogramEntry); + self->value = val; + // return the number of parameters + return 0; + } + + static int LUACALL wxLua_wxImageHistogramEntry_destructor(lua_State *) + { + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxImageHistogramEntry_methods[] = { + { LuaConstructor, "wxImageHistogramEntry", wxLua_wxImageHistogramEntry_constructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetIndex", wxLua_wxImageHistogramEntry_GetIndex, 0, 0, s_wxluaargArray_None }, + { LuaGetProp, "index", wxLua_wxImageHistogramEntry_GetIndex, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "SetIndex", wxLua_wxImageHistogramEntry_SetIndex, 0, 0, s_wxluaargArray_None }, + { LuaSetProp, "index", wxLua_wxImageHistogramEntry_SetIndex, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetValue", wxLua_wxImageHistogramEntry_GetValue, 0, 0, s_wxluaargArray_None }, + { LuaGetProp, "value", wxLua_wxImageHistogramEntry_GetValue, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "SetValue", wxLua_wxImageHistogramEntry_SetValue, 0, 0, s_wxluaargArray_None }, + { LuaSetProp, "value", wxLua_wxImageHistogramEntry_SetValue, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxImageHistogramEntry", wxLua_wxImageHistogramEntry_destructor, 0, 0, s_wxluaargArray_None }, + }; + + int wxImageHistogramEntry_methodCount = sizeof(wxImageHistogramEntry_methods)/sizeof(wxImageHistogramEntry_methods[0]); + #endif // wxLUA_USE_wxImage && wxUSE_IMAGE + + + #if wxLUA_USE_wxImage && wxUSE_IMAGE + // --------------------------------------------------------------------------- + // Bind class wxImageHistogram::iterator + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxImageHistogram::iterator' + int s_wxluatag_wxImageHistogram_iterator = -1; + + // %override wxLua_wxImageHistogram_iterator_Get_first + // %member long first + static int LUACALL wxLua_wxImageHistogram_iterator_Get_first(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxImageHistogram::iterator *self = (wxImageHistogram::iterator *) wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram_iterator); + // push the result number + lua_pushnumber(L, (*self)->first); // *** need to cast self to object from pointer + // return the number of parameters + return 1; + } + + // %override wxLua_wxImageHistogram_iterator_Set_first + // %member long first + static int LUACALL wxLua_wxImageHistogram_iterator_Set_first(lua_State *L) + { + wxLuaState wxlState(L); + // get the number value + long val = (long)wxlState.GetNumberType(2); + // get this + wxImageHistogram::iterator *self = (wxImageHistogram::iterator *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram_iterator); + (*self)->first = val; // *** need to cast self to object from pointer + // return the number of parameters + return 0; + } + + // %override wxLua_wxImageHistogram_iterator_Get_second + // %member wxImageHistogramEntry second + static int LUACALL wxLua_wxImageHistogram_iterator_Get_second(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxImageHistogram::iterator *self = (wxImageHistogram::iterator *) wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram_iterator); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImageHistogramEntry, &(*self)->second); // *** need to cast self to object from pointer + // return the number of parameters + return 1; + } + + // %override wxLua_wxImageHistogram_iterator_Set_second + // %member wxImageHistogramEntry second + static int LUACALL wxLua_wxImageHistogram_iterator_Set_second(lua_State *L) + { + wxLuaState wxlState(L); + // get the data type value + wxImageHistogramEntry* val = (wxImageHistogramEntry*)wxlState.GetUserDataType(2, s_wxluatag_wxImageHistogramEntry); + // get this + wxImageHistogram::iterator *self = (wxImageHistogram::iterator *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram_iterator); + (*self)->second = *val; // *** need to cast self to object from pointer + // return the number of parameters + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogram_iterator_op_eq[] = { &s_wxluatag_wxImageHistogram_iterator, 0 }; + // %operator bool operator==(const wxImageHistogram::iterator& other) const + static int LUACALL wxLua_wxImageHistogram_iterator_op_eq(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxImageHistogram::iterator other + const wxImageHistogram::iterator * other = (const wxImageHistogram::iterator *)wxlState.GetUserDataType(2, s_wxluatag_wxImageHistogram_iterator); + // get this + wxImageHistogram::iterator * self = (wxImageHistogram::iterator *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram_iterator); + // call op_eq + returns = (*self)==(*other); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // %operator wxImageHistogram::iterator& operator++() + static int LUACALL wxLua_wxImageHistogram_iterator_op_inc(lua_State *L) + { + wxLuaState wxlState(L); + wxImageHistogram::iterator *returns; + // get this + wxImageHistogram::iterator * self = (wxImageHistogram::iterator *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram_iterator); + // call op_inc + returns = self; + *returns = (++(*self)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImageHistogram_iterator, returns); + + return 1; + } + + static int LUACALL wxLua_wxImageHistogram_iterator_destructor(lua_State *) + { + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxImageHistogram_iterator_methods[] = { + { LuaMethod, "Get_first", wxLua_wxImageHistogram_iterator_Get_first, 0, 0, s_wxluaargArray_None }, + { LuaGetProp, "first", wxLua_wxImageHistogram_iterator_Get_first, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Set_first", wxLua_wxImageHistogram_iterator_Set_first, 0, 0, s_wxluaargArray_None }, + { LuaSetProp, "first", wxLua_wxImageHistogram_iterator_Set_first, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Get_second", wxLua_wxImageHistogram_iterator_Get_second, 0, 0, s_wxluaargArray_None }, + { LuaGetProp, "second", wxLua_wxImageHistogram_iterator_Get_second, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Set_second", wxLua_wxImageHistogram_iterator_Set_second, 0, 0, s_wxluaargArray_None }, + { LuaSetProp, "second", wxLua_wxImageHistogram_iterator_Set_second, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "op_eq", wxLua_wxImageHistogram_iterator_op_eq, 1, 1, s_wxluatagArray_wxLua_wxImageHistogram_iterator_op_eq }, + { LuaMethod, "op_inc", wxLua_wxImageHistogram_iterator_op_inc, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxImageHistogram_iterator", wxLua_wxImageHistogram_iterator_destructor, 0, 0, s_wxluaargArray_None }, + }; + + int wxImageHistogram_iterator_methodCount = sizeof(wxImageHistogram_iterator_methods)/sizeof(wxImageHistogram_iterator_methods[0]); + #endif // wxLUA_USE_wxImage && wxUSE_IMAGE + + + #if wxLUA_USE_wxImage && wxUSE_IMAGE + // --------------------------------------------------------------------------- + // Bind class wxImageHistogram + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxImageHistogram' + int s_wxluatag_wxImageHistogram = -1; + + // wxImageHistogram() + static int LUACALL wxLua_wxImageHistogram_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxImageHistogram *returns; + // call constructor + returns = new wxImageHistogram(); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxImageHistogram, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogram_MakeKey[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 }; + // static unsigned long MakeKey(unsigned char r, unsigned char g, unsigned char b) + static int LUACALL wxLua_wxImageHistogram_MakeKey(lua_State *L) + { + wxLuaState wxlState(L); + unsigned long returns; + // unsigned char b + unsigned char b = (char)wxlState.GetNumberType(4); + // unsigned char g + unsigned char g = (char)wxlState.GetNumberType(3); + // unsigned char r + unsigned char r = (char)wxlState.GetNumberType(2); + // call MakeKey + returns = wxImageHistogram::MakeKey(r, g, b); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // const wxImageHistogram::iterator begin() const + static int LUACALL wxLua_wxImageHistogram_begin(lua_State *L) + { + wxLuaState wxlState(L); + const wxImageHistogram::iterator *returns; + // get this + wxImageHistogram * self = (wxImageHistogram *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram); + // call begin + // allocate a new object using the copy constructor + returns = new wxImageHistogram::iterator(self->begin()); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImageHistogram::iterator *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImageHistogram_iterator, returns); + + return 1; + } + + // void clear() + static int LUACALL wxLua_wxImageHistogram_clear(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxImageHistogram * self = (wxImageHistogram *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram); + // call clear + self->clear(); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogram_count[] = { &s_wxluaarg_Number, 0 }; + // size_t count(long key) const + static int LUACALL wxLua_wxImageHistogram_count(lua_State *L) + { + wxLuaState wxlState(L); + size_t returns; + // long key + long key = (long)wxlState.GetNumberType(2); + // get this + wxImageHistogram * self = (wxImageHistogram *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram); + // call count + returns = self->count(key); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // bool empty() const + static int LUACALL wxLua_wxImageHistogram_empty(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxImageHistogram * self = (wxImageHistogram *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram); + // call empty + returns = self->empty(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // const wxImageHistogram::iterator end() const + static int LUACALL wxLua_wxImageHistogram_end(lua_State *L) + { + wxLuaState wxlState(L); + const wxImageHistogram::iterator *returns; + // get this + wxImageHistogram * self = (wxImageHistogram *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram); + // call end + // allocate a new object using the copy constructor + returns = new wxImageHistogram::iterator(self->end()); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImageHistogram::iterator *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImageHistogram_iterator, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogram_erase[] = { &s_wxluaarg_Number, 0 }; + // size_t erase(long key) + static int LUACALL wxLua_wxImageHistogram_erase(lua_State *L) + { + wxLuaState wxlState(L); + size_t returns; + // long key + long key = (long)wxlState.GetNumberType(2); + // get this + wxImageHistogram * self = (wxImageHistogram *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram); + // call erase + returns = self->erase(key); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogram_find[] = { &s_wxluaarg_Number, 0 }; + // wxImageHistogram::iterator find(long key) + static int LUACALL wxLua_wxImageHistogram_find(lua_State *L) + { + wxLuaState wxlState(L); + wxImageHistogram::iterator *returns; + // long key + long key = (long)wxlState.GetNumberType(2); + // get this + wxImageHistogram * self = (wxImageHistogram *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram); + // call find + // allocate a new object using the copy constructor + returns = new wxImageHistogram::iterator(self->find(key)); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxImageHistogram::iterator *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxImageHistogram_iterator, returns); + + return 1; + } + + // size_t size() const + static int LUACALL wxLua_wxImageHistogram_size(lua_State *L) + { + wxLuaState wxlState(L); + size_t returns; + // get this + wxImageHistogram * self = (wxImageHistogram *)wxlState.GetUserDataType(1, s_wxluatag_wxImageHistogram); + // call size + returns = self->size(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static int LUACALL wxLua_wxImageHistogram_destructor(lua_State *) + { + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxImageHistogram_methods[] = { + { LuaConstructor, "wxImageHistogram", wxLua_wxImageHistogram_constructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "MakeKey", wxLua_wxImageHistogram_MakeKey, 3, 3, s_wxluatagArray_wxLua_wxImageHistogram_MakeKey }, + { LuaMethod, "begin", wxLua_wxImageHistogram_begin, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "clear", wxLua_wxImageHistogram_clear, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "count", wxLua_wxImageHistogram_count, 1, 1, s_wxluatagArray_wxLua_wxImageHistogram_count }, + { LuaMethod, "empty", wxLua_wxImageHistogram_empty, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "end", wxLua_wxImageHistogram_end, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "erase", wxLua_wxImageHistogram_erase, 1, 1, s_wxluatagArray_wxLua_wxImageHistogram_erase }, + { LuaMethod, "find", wxLua_wxImageHistogram_find, 1, 1, s_wxluatagArray_wxLua_wxImageHistogram_find }, + { LuaMethod, "size", wxLua_wxImageHistogram_size, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxImageHistogram", wxLua_wxImageHistogram_destructor, 0, 0, s_wxluaargArray_None }, + }; + + int wxImageHistogram_methodCount = sizeof(wxImageHistogram_methods)/sizeof(wxImageHistogram_methods[0]); + #endif // wxLUA_USE_wxImage && wxUSE_IMAGE + + + #if wxLUA_USE_wxImage && wxUSE_IMAGE + // --------------------------------------------------------------------------- // Bind class wxImageHandler // --------------------------------------------------------------------------- |