You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(191) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(238) |
Dec
(68) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(104) |
Feb
(518) |
Mar
(302) |
Apr
(211) |
May
(311) |
Jun
(55) |
Jul
(6) |
Aug
(35) |
Sep
(76) |
Oct
(50) |
Nov
(37) |
Dec
(340) |
2007 |
Jan
(23) |
Feb
(107) |
Mar
(98) |
Apr
(60) |
May
(136) |
Jun
(371) |
Jul
(175) |
Aug
(74) |
Sep
(3) |
Oct
(2) |
Nov
(53) |
Dec
(129) |
2008 |
Jan
(337) |
Feb
(23) |
Mar
(18) |
Apr
(4) |
May
(3) |
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
(33) |
Nov
|
Dec
(26) |
2009 |
Jan
(4) |
Feb
(1) |
Mar
(15) |
Apr
|
May
(35) |
Jun
(11) |
Jul
|
Aug
|
Sep
(19) |
Oct
(26) |
Nov
(11) |
Dec
(11) |
2010 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
(8) |
Dec
(7) |
2011 |
Jan
|
Feb
|
Mar
(4) |
Apr
(8) |
May
(5) |
Jun
(8) |
Jul
(1) |
Aug
|
Sep
|
Oct
(5) |
Nov
(13) |
Dec
|
From: John L. <jr...@us...> - 2007-06-30 00:12:32
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9448/wxLua/modules/wxbind/src Modified Files: controls.cpp datetime.cpp file.cpp gdi.cpp geometry.cpp grid.cpp image.cpp print.cpp socket.cpp windows.cpp wx_bind.cpp Log Message: Fix for MingW added in wxWidgets bindings for wxDefaultPoint and wxEVT_FILEPICKER/DIRPICKER... Rename the functions to get the type names from wxLua to match closer to the lua type() function, wxlua.i Change op_add_assign to just op_iadd (others as well) = op_assign is now op_set Index: print.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/print.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** print.cpp 18 Jun 2007 21:40:46 -0000 1.48 --- print.cpp 30 Jun 2007 00:12:25 -0000 1.49 *************** *** 1208,1216 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPrintData_op_assign[] = { &s_wxluatag_wxPrintData, &s_wxluatag_wxPrintData, NULL }; ! static int LUACALL wxLua_wxPrintData_op_assign(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxPrintData_op_assign[1] = {{ wxLua_wxPrintData_op_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPrintData_op_assign }}; // %operator void operator=(const wxPrintData& data) ! static int LUACALL wxLua_wxPrintData_op_assign(lua_State *L) { wxLuaState wxlState(L); --- 1208,1216 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPrintData_op_set[] = { &s_wxluatag_wxPrintData, &s_wxluatag_wxPrintData, NULL }; ! static int LUACALL wxLua_wxPrintData_op_set(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxPrintData_op_set[1] = {{ wxLua_wxPrintData_op_set, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPrintData_op_set }}; // %operator void operator=(const wxPrintData& data) ! static int LUACALL wxLua_wxPrintData_op_set(lua_State *L) { wxLuaState wxlState(L); *************** *** 1219,1223 **** // get this wxPrintData * self = (wxPrintData *)wxlState.GetUserDataType(1, s_wxluatag_wxPrintData); ! // call op_assign (*self)=(*data); --- 1219,1223 ---- // get this wxPrintData * self = (wxPrintData *)wxlState.GetUserDataType(1, s_wxluatag_wxPrintData); ! // call op_set (*self)=(*data); *************** *** 1352,1356 **** { "SetQuality", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPrintData_SetQuality, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxPrintData_delete, 1, NULL }, ! { "op_assign", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPrintData_op_assign, 1, NULL }, #if (wxLUA_USE_wxPrint && wxUSE_PRINTING_ARCHITECTURE) --- 1352,1356 ---- { "SetQuality", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPrintData_SetQuality, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxPrintData_delete, 1, NULL }, ! { "op_set", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPrintData_op_set, 1, NULL }, #if (wxLUA_USE_wxPrint && wxUSE_PRINTING_ARCHITECTURE) *************** *** 2894,2902 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPrintDialogData_op_assign[] = { &s_wxluatag_wxPrintDialogData, &s_wxluatag_wxPrintDialogData, NULL }; ! static int LUACALL wxLua_wxPrintDialogData_op_assign(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxPrintDialogData_op_assign[1] = {{ wxLua_wxPrintDialogData_op_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPrintDialogData_op_assign }}; // %operator void operator=(const wxPrintDialogData& data) ! static int LUACALL wxLua_wxPrintDialogData_op_assign(lua_State *L) { wxLuaState wxlState(L); --- 2894,2902 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPrintDialogData_op_set[] = { &s_wxluatag_wxPrintDialogData, &s_wxluatag_wxPrintDialogData, NULL }; ! static int LUACALL wxLua_wxPrintDialogData_op_set(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxPrintDialogData_op_set[1] = {{ wxLua_wxPrintDialogData_op_set, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPrintDialogData_op_set }}; // %operator void operator=(const wxPrintDialogData& data) ! static int LUACALL wxLua_wxPrintDialogData_op_set(lua_State *L) { wxLuaState wxlState(L); *************** *** 2905,2909 **** // get this wxPrintDialogData * self = (wxPrintDialogData *)wxlState.GetUserDataType(1, s_wxluatag_wxPrintDialogData); ! // call op_assign (*self)=(*data); --- 2905,2909 ---- // get this wxPrintDialogData * self = (wxPrintDialogData *)wxlState.GetUserDataType(1, s_wxluatag_wxPrintDialogData); ! // call op_set (*self)=(*data); *************** *** 3027,3031 **** { "SetToPage", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPrintDialogData_SetToPage, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxPrintDialogData_delete, 1, NULL }, ! { "op_assign", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPrintDialogData_op_assign, 1, NULL }, #if (wxLUA_USE_wxPrint && wxUSE_PRINTING_ARCHITECTURE) --- 3027,3031 ---- { "SetToPage", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPrintDialogData_SetToPage, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxPrintDialogData_delete, 1, NULL }, ! { "op_set", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPrintDialogData_op_set, 1, NULL }, #if (wxLUA_USE_wxPrint && wxUSE_PRINTING_ARCHITECTURE) Index: controls.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/controls.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** controls.cpp 25 Jun 2007 03:19:41 -0000 1.73 --- controls.cpp 30 Jun 2007 00:12:22 -0000 1.74 *************** *** 12505,12529 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxTreeItemId_op_assign[] = { &s_wxluatag_wxTreeItemId, &s_wxluatag_wxTreeItemId, NULL }; - static int LUACALL wxLua_wxTreeItemId_op_assign(lua_State *L); - static wxLuaBindCFunc s_wxluafunc_wxLua_wxTreeItemId_op_assign[1] = {{ wxLua_wxTreeItemId_op_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxTreeItemId_op_assign }}; - // %operator wxTreeItemId& operator=(const wxTreeItemId& otherId) - static int LUACALL wxLua_wxTreeItemId_op_assign(lua_State *L) - { - wxLuaState wxlState(L); - wxTreeItemId *returns; - // const wxTreeItemId otherId - const wxTreeItemId * otherId = (const wxTreeItemId *)wxlState.GetUserDataType(2, s_wxluatag_wxTreeItemId); - // get this - wxTreeItemId * self = (wxTreeItemId *)wxlState.GetUserDataType(1, s_wxluatag_wxTreeItemId); - // call op_assign - returns = self; - *returns = ((*self)=(*otherId)); - // push the result datatype - wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxTreeItemId_op_eq[] = { &s_wxluatag_wxTreeItemId, &s_wxluatag_wxTreeItemId, NULL }; static int LUACALL wxLua_wxTreeItemId_op_eq(lua_State *L); --- 12505,12508 ---- *************** *** 12546,12549 **** --- 12525,12549 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxTreeItemId_op_set[] = { &s_wxluatag_wxTreeItemId, &s_wxluatag_wxTreeItemId, NULL }; + static int LUACALL wxLua_wxTreeItemId_op_set(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxTreeItemId_op_set[1] = {{ wxLua_wxTreeItemId_op_set, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxTreeItemId_op_set }}; + // %operator wxTreeItemId& operator=(const wxTreeItemId& otherId) + static int LUACALL wxLua_wxTreeItemId_op_set(lua_State *L) + { + wxLuaState wxlState(L); + wxTreeItemId *returns; + // const wxTreeItemId otherId + const wxTreeItemId * otherId = (const wxTreeItemId *)wxlState.GetUserDataType(2, s_wxluatag_wxTreeItemId); + // get this + wxTreeItemId * self = (wxTreeItemId *)wxlState.GetUserDataType(1, s_wxluatag_wxTreeItemId); + // call op_set + returns = self; + *returns = ((*self)=(*otherId)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); + + return 1; + } + static wxLuaArgTag s_wxluatagArray_wxLua_wxTreeItemId_constructor1[] = { &s_wxluatag_wxTreeItemId, NULL }; static int LUACALL wxLua_wxTreeItemId_constructor1(lua_State *L); *************** *** 12613,12618 **** { "IsOk", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTreeItemId_IsOk, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxTreeItemId_delete, 1, NULL }, - { "op_assign", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTreeItemId_op_assign, 1, NULL }, { "op_eq", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTreeItemId_op_eq, 1, NULL }, #if (wxLUA_USE_wxTreeCtrl && wxUSE_TREECTRL) --- 12613,12618 ---- { "IsOk", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTreeItemId_IsOk, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxTreeItemId_delete, 1, NULL }, { "op_eq", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTreeItemId_op_eq, 1, NULL }, + { "op_set", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTreeItemId_op_set, 1, NULL }, #if (wxLUA_USE_wxTreeCtrl && wxUSE_TREECTRL) Index: grid.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/grid.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** grid.cpp 25 Jun 2007 03:19:44 -0000 1.47 --- grid.cpp 30 Jun 2007 00:12:24 -0000 1.48 *************** *** 3276,3300 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellCoords_op_assign[] = { &s_wxluatag_wxGridCellCoords, &s_wxluatag_wxGridCellCoords, NULL }; - static int LUACALL wxLua_wxGridCellCoords_op_assign(lua_State *L); - static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridCellCoords_op_assign[1] = {{ wxLua_wxGridCellCoords_op_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxGridCellCoords_op_assign }}; - // %operator wxGridCellCoords& operator=( const wxGridCellCoords& other ) - static int LUACALL wxLua_wxGridCellCoords_op_assign(lua_State *L) - { - wxLuaState wxlState(L); - wxGridCellCoords *returns; - // const wxGridCellCoords other - const wxGridCellCoords * other = (const wxGridCellCoords *)wxlState.GetUserDataType(2, s_wxluatag_wxGridCellCoords); - // get this - wxGridCellCoords * self = (wxGridCellCoords *)wxlState.GetUserDataType(1, s_wxluatag_wxGridCellCoords); - // call op_assign - returns = self; - *returns = ((*self)=(*other)); - // push the result datatype - wxlState.PushUserDataType(s_wxluatag_wxGridCellCoords, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellCoords_op_eq[] = { &s_wxluatag_wxGridCellCoords, &s_wxluatag_wxGridCellCoords, NULL }; static int LUACALL wxLua_wxGridCellCoords_op_eq(lua_State *L); --- 3276,3279 ---- *************** *** 3317,3320 **** --- 3296,3320 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellCoords_op_set[] = { &s_wxluatag_wxGridCellCoords, &s_wxluatag_wxGridCellCoords, NULL }; + static int LUACALL wxLua_wxGridCellCoords_op_set(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridCellCoords_op_set[1] = {{ wxLua_wxGridCellCoords_op_set, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxGridCellCoords_op_set }}; + // %operator wxGridCellCoords& operator=( const wxGridCellCoords& other ) + static int LUACALL wxLua_wxGridCellCoords_op_set(lua_State *L) + { + wxLuaState wxlState(L); + wxGridCellCoords *returns; + // const wxGridCellCoords other + const wxGridCellCoords * other = (const wxGridCellCoords *)wxlState.GetUserDataType(2, s_wxluatag_wxGridCellCoords); + // get this + wxGridCellCoords * self = (wxGridCellCoords *)wxlState.GetUserDataType(1, s_wxluatag_wxGridCellCoords); + // call op_set + returns = self; + *returns = ((*self)=(*other)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxGridCellCoords, returns); + + return 1; + } + static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellCoords_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; static int LUACALL wxLua_wxGridCellCoords_constructor(lua_State *L); *************** *** 3353,3358 **** { "SetRow", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxGridCellCoords_SetRow, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxGridCellCoords_delete, 1, NULL }, - { "op_assign", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxGridCellCoords_op_assign, 1, NULL }, { "op_eq", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxGridCellCoords_op_eq, 1, NULL }, { "wxGridCellCoords", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxGridCellCoords_constructor, 1, NULL }, --- 3353,3358 ---- { "SetRow", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxGridCellCoords_SetRow, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxGridCellCoords_delete, 1, NULL }, { "op_eq", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxGridCellCoords_op_eq, 1, NULL }, + { "op_set", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxGridCellCoords_op_set, 1, NULL }, { "wxGridCellCoords", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxGridCellCoords_constructor, 1, NULL }, Index: file.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/file.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** file.cpp 25 Jun 2007 03:19:42 -0000 1.55 --- file.cpp 30 Jun 2007 00:12:23 -0000 1.56 *************** *** 2027,2051 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_op_assign[] = { &s_wxluatag_wxFileName, &s_wxluatag_wxFileName, NULL }; - static int LUACALL wxLua_wxFileName_op_assign(lua_State *L); - static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_op_assign[1] = {{ wxLua_wxFileName_op_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxFileName_op_assign }}; - // %operator wxFileName& operator=(const wxFileName& filename) - static int LUACALL wxLua_wxFileName_op_assign(lua_State *L) - { - wxLuaState wxlState(L); - wxFileName *returns; - // const wxFileName filename - const wxFileName * filename = (const wxFileName *)wxlState.GetUserDataType(2, s_wxluatag_wxFileName); - // get this - wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); - // call op_assign - returns = self; - *returns = ((*self)=(*filename)); - // push the result datatype - wxlState.PushUserDataType(s_wxluatag_wxFileName, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_op_eq[] = { &s_wxluatag_wxFileName, &s_wxluatag_wxFileName, NULL }; static int LUACALL wxLua_wxFileName_op_eq(lua_State *L); --- 2027,2030 ---- *************** *** 2068,2071 **** --- 2047,2071 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_op_set[] = { &s_wxluatag_wxFileName, &s_wxluatag_wxFileName, NULL }; + static int LUACALL wxLua_wxFileName_op_set(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_op_set[1] = {{ wxLua_wxFileName_op_set, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxFileName_op_set }}; + // %operator wxFileName& operator=(const wxFileName& filename) + static int LUACALL wxLua_wxFileName_op_set(lua_State *L) + { + wxLuaState wxlState(L); + wxFileName *returns; + // const wxFileName filename + const wxFileName * filename = (const wxFileName *)wxlState.GetUserDataType(2, s_wxluatag_wxFileName); + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call op_set + returns = self; + *returns = ((*self)=(*filename)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxFileName, returns); + + return 1; + } + static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_constructor4[] = { &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxFileName_constructor4(lua_State *L); *************** *** 2624,2629 **** { "Touch", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxFileName_Touch, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxFileName_delete, 1, NULL }, - { "op_assign", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxFileName_op_assign, 1, NULL }, { "op_eq", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxFileName_op_eq, 1, NULL }, #if (wxLUA_USE_wxFileName) --- 2624,2629 ---- { "Touch", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxFileName_Touch, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxFileName_delete, 1, NULL }, { "op_eq", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxFileName_op_eq, 1, NULL }, + { "op_set", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxFileName_op_set, 1, NULL }, #if (wxLUA_USE_wxFileName) Index: socket.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/socket.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** socket.cpp 25 Jun 2007 03:19:48 -0000 1.47 --- socket.cpp 30 Jun 2007 00:12:25 -0000 1.48 *************** *** 2732,2756 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxURI_op_assign[] = { &s_wxluatag_wxURI, &s_wxluatag_wxURI, NULL }; - static int LUACALL wxLua_wxURI_op_assign(lua_State *L); - static wxLuaBindCFunc s_wxluafunc_wxLua_wxURI_op_assign[1] = {{ wxLua_wxURI_op_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxURI_op_assign }}; - // %operator wxURI& operator = (const wxURI& uri); - static int LUACALL wxLua_wxURI_op_assign(lua_State *L) - { - wxLuaState wxlState(L); - wxURI *returns; - // const wxURI uri - const wxURI * uri = (const wxURI *)wxlState.GetUserDataType(2, s_wxluatag_wxURI); - // get this - wxURI * self = (wxURI *)wxlState.GetUserDataType(1, s_wxluatag_wxURI); - // call op_assign - returns = self; - *returns = ((*self)=(*uri)); - // push the result datatype - wxlState.PushUserDataType(s_wxluatag_wxURI, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxURI_op_eq[] = { &s_wxluatag_wxURI, &s_wxluatag_wxURI, NULL }; static int LUACALL wxLua_wxURI_op_eq(lua_State *L); --- 2732,2735 ---- *************** *** 2773,2776 **** --- 2752,2776 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxURI_op_set[] = { &s_wxluatag_wxURI, &s_wxluatag_wxURI, NULL }; + static int LUACALL wxLua_wxURI_op_set(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxURI_op_set[1] = {{ wxLua_wxURI_op_set, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxURI_op_set }}; + // %operator wxURI& operator = (const wxURI& uri); + static int LUACALL wxLua_wxURI_op_set(lua_State *L) + { + wxLuaState wxlState(L); + wxURI *returns; + // const wxURI uri + const wxURI * uri = (const wxURI *)wxlState.GetUserDataType(2, s_wxluatag_wxURI); + // get this + wxURI * self = (wxURI *)wxlState.GetUserDataType(1, s_wxluatag_wxURI); + // call op_set + returns = self; + *returns = ((*self)=(*uri)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxURI, returns); + + return 1; + } + static wxLuaArgTag s_wxluatagArray_wxLua_wxURI_constructor2[] = { &s_wxluatag_wxURI, NULL }; static int LUACALL wxLua_wxURI_constructor2(lua_State *L); *************** *** 2883,2888 **** { "Unescape", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxURI_Unescape, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxURI_delete, 1, NULL }, - { "op_assign", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxURI_op_assign, 1, NULL }, { "op_eq", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxURI_op_eq, 1, NULL }, #if (wxLUA_USE_wxSocket && wxUSE_SOCKETS) --- 2883,2888 ---- { "Unescape", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxURI_Unescape, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxURI_delete, 1, NULL }, { "op_eq", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxURI_op_eq, 1, NULL }, + { "op_set", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxURI_op_set, 1, NULL }, #if (wxLUA_USE_wxSocket && wxUSE_SOCKETS) Index: datetime.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/datetime.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** datetime.cpp 27 Jun 2007 15:57:14 -0000 1.55 --- datetime.cpp 30 Jun 2007 00:12:22 -0000 1.56 *************** *** 5447,5456 **** { "Description", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Set_Description, 1, NULL }, { "Description", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Get_Description, 1, NULL }, ! { "Get_CanonicalName", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Get_CanonicalName, 1, NULL }, ! { "Get_Description", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Get_Description, 1, NULL }, ! { "Get_Language", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Get_Language, 1, NULL }, #if ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) ! { "Get_LayoutDirection", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Get_LayoutDirection, 1, NULL }, #endif // ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) --- 5447,5456 ---- { "Description", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Set_Description, 1, NULL }, { "Description", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Get_Description, 1, NULL }, ! // %member { "Get_CanonicalName", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Get_CanonicalName, 1, NULL }, ! // %member { "Get_Description", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Get_Description, 1, NULL }, ! // %member { "Get_Language", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Get_Language, 1, NULL }, #if ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) ! // %member { "Get_LayoutDirection", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Get_LayoutDirection, 1, NULL }, #endif // ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) *************** *** 5463,5472 **** #endif // ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) ! { "Set_CanonicalName", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_CanonicalName, 1, NULL }, ! { "Set_Description", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_Description, 1, NULL }, ! { "Set_Language", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_Language, 1, NULL }, #if ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) ! { "Set_LayoutDirection", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_LayoutDirection, 1, NULL }, #endif // ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) --- 5463,5472 ---- #endif // ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) ! // %member { "Set_CanonicalName", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_CanonicalName, 1, NULL }, ! // %member { "Set_Description", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_Description, 1, NULL }, ! // %member { "Set_Language", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_Language, 1, NULL }, #if ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) ! // %member { "Set_LayoutDirection", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_LayoutDirection, 1, NULL }, #endif // ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) Index: windows.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/windows.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** windows.cpp 27 Jun 2007 14:29:54 -0000 1.70 --- windows.cpp 30 Jun 2007 00:12:25 -0000 1.71 *************** *** 150,192 **** #if wxLUA_USE_wxColourPenBrush ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_ColBg[] = { &s_wxluatag_wxVisualAttributes, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_ColBg(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_ColBg[1] = {{ wxLua_wxVisualAttributes_ColBg, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxVisualAttributes_ColBg }}; ! // %rename ColBg wxColour colBg ! static int LUACALL wxLua_wxVisualAttributes_ColBg(lua_State *L) { wxLuaState wxlState(L); - wxColour *returns; // get this ! wxVisualAttributes * self = (wxVisualAttributes *)wxlState.GetUserDataType(1, s_wxluatag_wxVisualAttributes); ! // call colBg ! // allocate a new object using the copy constructor ! returns = new wxColour(self->colBg); ! // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxColour *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxColour, returns); ! return 1; } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_ColFg[] = { &s_wxluatag_wxVisualAttributes, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_ColFg(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_ColFg[1] = {{ wxLua_wxVisualAttributes_ColFg, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxVisualAttributes_ColFg }}; ! // %rename ColFg wxColour colFg ! static int LUACALL wxLua_wxVisualAttributes_ColFg(lua_State *L) { wxLuaState wxlState(L); - wxColour *returns; // get this ! wxVisualAttributes * self = (wxVisualAttributes *)wxlState.GetUserDataType(1, s_wxluatag_wxVisualAttributes); ! // call colFg ! // allocate a new object using the copy constructor ! returns = new wxColour(self->colFg); ! // add the new object to the tracked memory list ! wxlState.AddTrackedObject((wxColour *)returns); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxColour, returns); ! return 1; } --- 150,180 ---- #if wxLUA_USE_wxColourPenBrush ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_Get_colBg[] = { &s_wxluatag_wxVisualAttributes, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_Get_colBg(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_Get_colBg[1] = {{ wxLua_wxVisualAttributes_Get_colBg, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxVisualAttributes_Get_colBg }}; ! // %member wxColour colBg ! static int LUACALL wxLua_wxVisualAttributes_Get_colBg(lua_State *L) { wxLuaState wxlState(L); // get this ! wxVisualAttributes *self = (wxVisualAttributes *) wxlState.GetUserDataType(1, s_wxluatag_wxVisualAttributes); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxColour, &self->colBg); ! // return the number of values return 1; } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_Get_colFg[] = { &s_wxluatag_wxVisualAttributes, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_Get_colFg(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_Get_colFg[1] = {{ wxLua_wxVisualAttributes_Get_colFg, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxVisualAttributes_Get_colFg }}; ! // %member wxColour colFg ! static int LUACALL wxLua_wxVisualAttributes_Get_colFg(lua_State *L) { wxLuaState wxlState(L); // get this ! wxVisualAttributes *self = (wxVisualAttributes *) wxlState.GetUserDataType(1, s_wxluatag_wxVisualAttributes); // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxColour, &self->colFg); ! // return the number of values return 1; } *************** *** 195,203 **** #if wxLUA_USE_wxFont ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_GetFont[] = { &s_wxluatag_wxVisualAttributes, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_GetFont(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_GetFont[1] = {{ wxLua_wxVisualAttributes_GetFont, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxVisualAttributes_GetFont }}; ! // %rename Font %member wxFont font ! static int LUACALL wxLua_wxVisualAttributes_GetFont(lua_State *L) { wxLuaState wxlState(L); --- 183,191 ---- #if wxLUA_USE_wxFont ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_Get_font[] = { &s_wxluatag_wxVisualAttributes, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_Get_font(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_Get_font[1] = {{ wxLua_wxVisualAttributes_Get_font, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxVisualAttributes_Get_font }}; ! // %member wxFont font ! static int LUACALL wxLua_wxVisualAttributes_Get_font(lua_State *L) { wxLuaState wxlState(L); *************** *** 210,218 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_SetFont[] = { &s_wxluatag_wxVisualAttributes, &s_wxluatag_wxFont, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_SetFont(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_SetFont[1] = {{ wxLua_wxVisualAttributes_SetFont, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxVisualAttributes_SetFont }}; ! // %rename Font %member wxFont font ! static int LUACALL wxLua_wxVisualAttributes_SetFont(lua_State *L) { wxLuaState wxlState(L); --- 198,244 ---- } ! #endif // wxLUA_USE_wxFont ! ! #if wxLUA_USE_wxColourPenBrush ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_Set_colBg[] = { &s_wxluatag_wxVisualAttributes, &s_wxluatag_wxColour, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_Set_colBg(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_Set_colBg[1] = {{ wxLua_wxVisualAttributes_Set_colBg, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxVisualAttributes_Set_colBg }}; ! // %member wxColour colBg ! static int LUACALL wxLua_wxVisualAttributes_Set_colBg(lua_State *L) ! { ! wxLuaState wxlState(L); ! // get the data type value ! wxColour* val = (wxColour*)wxlState.GetUserDataType(2, s_wxluatag_wxColour); ! // get this ! wxVisualAttributes *self = (wxVisualAttributes *)wxlState.GetUserDataType(1, s_wxluatag_wxVisualAttributes); ! self->colBg = *val; ! // return the number of values ! return 0; ! } ! ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_Set_colFg[] = { &s_wxluatag_wxVisualAttributes, &s_wxluatag_wxColour, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_Set_colFg(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_Set_colFg[1] = {{ wxLua_wxVisualAttributes_Set_colFg, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxVisualAttributes_Set_colFg }}; ! // %member wxColour colFg ! static int LUACALL wxLua_wxVisualAttributes_Set_colFg(lua_State *L) ! { ! wxLuaState wxlState(L); ! // get the data type value ! wxColour* val = (wxColour*)wxlState.GetUserDataType(2, s_wxluatag_wxColour); ! // get this ! wxVisualAttributes *self = (wxVisualAttributes *)wxlState.GetUserDataType(1, s_wxluatag_wxVisualAttributes); ! self->colFg = *val; ! // return the number of values ! return 0; ! } ! ! #endif // wxLUA_USE_wxColourPenBrush ! ! #if wxLUA_USE_wxFont ! static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_Set_font[] = { &s_wxluatag_wxVisualAttributes, &s_wxluatag_wxFont, NULL }; ! static int LUACALL wxLua_wxVisualAttributes_Set_font(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxVisualAttributes_Set_font[1] = {{ wxLua_wxVisualAttributes_Set_font, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxVisualAttributes_Set_font }}; ! // %member wxFont font ! static int LUACALL wxLua_wxVisualAttributes_Set_font(lua_State *L) { wxLuaState wxlState(L); *************** *** 228,231 **** --- 254,260 ---- #endif // wxLUA_USE_wxFont + #if wxLUA_USE_wxColourPenBrush + #endif // wxLUA_USE_wxColourPenBrush + static wxLuaArgTag s_wxluatagArray_wxLua_wxVisualAttributes_delete[] = { &s_wxluatag_wxVisualAttributes, NULL }; static int LUACALL wxLua_wxVisualAttributes_delete(lua_State *L); *************** *** 253,270 **** wxLuaBindMethod wxVisualAttributes_methods[] = { #if wxLUA_USE_wxColourPenBrush ! { "ColBg", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_ColBg, 1, NULL }, ! { "ColFg", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_ColFg, 1, NULL }, #endif // wxLUA_USE_wxColourPenBrush #if wxLUA_USE_wxFont ! { "GetFont", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_GetFont, 1, NULL }, ! { "SetFont", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_SetFont, 1, NULL }, #endif // wxLUA_USE_wxFont { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxVisualAttributes_delete, 1, NULL }, #if wxLUA_USE_wxFont ! { "font", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxVisualAttributes_SetFont, 1, NULL }, ! { "font", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxVisualAttributes_GetFont, 1, NULL }, #endif // wxLUA_USE_wxFont --- 282,314 ---- wxLuaBindMethod wxVisualAttributes_methods[] = { #if wxLUA_USE_wxColourPenBrush ! // %member { "Get_colBg", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_Get_colBg, 1, NULL }, ! // %member { "Get_colFg", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_Get_colFg, 1, NULL }, #endif // wxLUA_USE_wxColourPenBrush #if wxLUA_USE_wxFont ! // %member { "Get_font", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_Get_font, 1, NULL }, #endif // wxLUA_USE_wxFont + #if wxLUA_USE_wxColourPenBrush + // %member { "Set_colBg", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_Set_colBg, 1, NULL }, + // %member { "Set_colFg", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_Set_colFg, 1, NULL }, + #endif // wxLUA_USE_wxColourPenBrush + + #if wxLUA_USE_wxFont + // %member { "Set_font", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxVisualAttributes_Set_font, 1, NULL }, + #endif // wxLUA_USE_wxFont + + #if wxLUA_USE_wxColourPenBrush + { "colBg", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxVisualAttributes_Set_colBg, 1, NULL }, + { "colBg", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxVisualAttributes_Get_colBg, 1, NULL }, + { "colFg", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxVisualAttributes_Set_colFg, 1, NULL }, + { "colFg", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxVisualAttributes_Get_colFg, 1, NULL }, + #endif // wxLUA_USE_wxColourPenBrush + { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxVisualAttributes_delete, 1, NULL }, #if wxLUA_USE_wxFont ! { "font", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxVisualAttributes_Set_font, 1, NULL }, ! { "font", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxVisualAttributes_Get_font, 1, NULL }, #endif // wxLUA_USE_wxFont Index: image.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/image.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** image.cpp 25 Jun 2007 03:19:44 -0000 1.50 --- image.cpp 30 Jun 2007 00:12:25 -0000 1.51 *************** *** 1734,1742 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_op_assign[] = { &s_wxluatag_wxImage, &s_wxluatag_wxImage, NULL }; ! static int LUACALL wxLua_wxImage_op_assign(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImage_op_assign[1] = {{ wxLua_wxImage_op_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxImage_op_assign }}; // %operator wxImage& operator=(const wxImage& image) ! static int LUACALL wxLua_wxImage_op_assign(lua_State *L) { wxLuaState wxlState(L); --- 1734,1742 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImage_op_set[] = { &s_wxluatag_wxImage, &s_wxluatag_wxImage, NULL }; ! static int LUACALL wxLua_wxImage_op_set(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImage_op_set[1] = {{ wxLua_wxImage_op_set, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxImage_op_set }}; // %operator wxImage& operator=(const wxImage& image) ! static int LUACALL wxLua_wxImage_op_set(lua_State *L) { wxLuaState wxlState(L); *************** *** 1746,1750 **** // get this wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); ! // call op_assign returns = self; *returns = ((*self)=(*image)); --- 1746,1750 ---- // get this wxImage * self = (wxImage *)wxlState.GetUserDataType(1, s_wxluatag_wxImage); ! // call op_set returns = self; *returns = ((*self)=(*image)); *************** *** 2265,2269 **** { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxImage_delete, 1, NULL }, ! { "op_assign", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImage_op_assign, 1, NULL }, #if ((wxLUA_USE_wxBitmap) && (wxLUA_USE_wxImage && wxUSE_IMAGE))||(wxLUA_USE_wxImage && wxUSE_IMAGE) --- 2265,2269 ---- { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxImage_delete, 1, NULL }, ! { "op_set", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImage_op_set, 1, NULL }, #if ((wxLUA_USE_wxBitmap) && (wxLUA_USE_wxImage && wxUSE_IMAGE))||(wxLUA_USE_wxImage && wxUSE_IMAGE) *************** *** 2287,2295 **** int s_wxluatag_wxImageHistogramEntry = -1; ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogramEntry_GetIndex[] = { &s_wxluatag_wxImageHistogramEntry, NULL }; ! static int LUACALL wxLua_wxImageHistogramEntry_GetIndex(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImageHistogramEntry_GetIndex[1] = {{ wxLua_wxImageHistogramEntry_GetIndex, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxImageHistogramEntry_GetIndex }}; ! // %rename Index %member unsigned long index // GetIndex() only, SetIndex(idx) is not allowed ! static int LUACALL wxLua_wxImageHistogramEntry_GetIndex(lua_State *L) { wxLuaState wxlState(L); --- 2287,2295 ---- int s_wxluatag_wxImageHistogramEntry = -1; ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogramEntry_Get_index[] = { &s_wxluatag_wxImageHistogramEntry, NULL }; ! static int LUACALL wxLua_wxImageHistogramEntry_Get_index(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImageHistogramEntry_Get_index[1] = {{ wxLua_wxImageHistogramEntry_Get_index, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxImageHistogramEntry_Get_index }}; ! // %member unsigned long index // GetIndex() only, SetIndex(idx) is not allowed ! static int LUACALL wxLua_wxImageHistogramEntry_Get_index(lua_State *L) { wxLuaState wxlState(L); *************** *** 2302,2310 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogramEntry_GetValue[] = { &s_wxluatag_wxImageHistogramEntry, NULL }; ! static int LUACALL wxLua_wxImageHistogramEntry_GetValue(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImageHistogramEntry_GetValue[1] = {{ wxLua_wxImageHistogramEntry_GetValue, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxImageHistogramEntry_GetValue }}; ! // %rename Value %member unsigned long value // GetValue() and SetValue(val) ! static int LUACALL wxLua_wxImageHistogramEntry_GetValue(lua_State *L) { wxLuaState wxlState(L); --- 2302,2310 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogramEntry_Get_value[] = { &s_wxluatag_wxImageHistogramEntry, NULL }; ! static int LUACALL wxLua_wxImageHistogramEntry_Get_value(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImageHistogramEntry_Get_value[1] = {{ wxLua_wxImageHistogramEntry_Get_value, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxImageHistogramEntry_Get_value }}; ! // %member unsigned long value // GetValue() and SetValue(val) ! static int LUACALL wxLua_wxImageHistogramEntry_Get_value(lua_State *L) { wxLuaState wxlState(L); *************** *** 2317,2325 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogramEntry_SetIndex[] = { &s_wxluatag_wxImageHistogramEntry, &s_wxluaarg_Number, NULL }; ! static int LUACALL wxLua_wxImageHistogramEntry_SetIndex(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImageHistogramEntry_SetIndex[1] = {{ wxLua_wxImageHistogramEntry_SetIndex, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxImageHistogramEntry_SetIndex }}; ! // %rename Index %member unsigned long index // GetIndex() only, SetIndex(idx) is not allowed ! static int LUACALL wxLua_wxImageHistogramEntry_SetIndex(lua_State *L) { wxLuaState wxlState(L); --- 2317,2325 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogramEntry_Set_index[] = { &s_wxluatag_wxImageHistogramEntry, &s_wxluaarg_Number, NULL }; ! static int LUACALL wxLua_wxImageHistogramEntry_Set_index(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImageHistogramEntry_Set_index[1] = {{ wxLua_wxImageHistogramEntry_Set_index, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxImageHistogramEntry_Set_index }}; ! // %member unsigned long index // GetIndex() only, SetIndex(idx) is not allowed ! static int LUACALL wxLua_wxImageHistogramEntry_Set_index(lua_State *L) { wxLuaState wxlState(L); *************** *** 2333,2341 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogramEntry_SetValue[] = { &s_wxluatag_wxImageHistogramEntry, &s_wxluaarg_Number, NULL }; ! static int LUACALL wxLua_wxImageHistogramEntry_SetValue(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImageHistogramEntry_SetValue[1] = {{ wxLua_wxImageHistogramEntry_SetValue, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxImageHistogramEntry_SetValue }}; ! // %rename Value %member unsigned long value // GetValue() and SetValue(val) ! static int LUACALL wxLua_wxImageHistogramEntry_SetValue(lua_State *L) { wxLuaState wxlState(L); --- 2333,2341 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxImageHistogramEntry_Set_value[] = { &s_wxluatag_wxImageHistogramEntry, &s_wxluaarg_Number, NULL }; ! static int LUACALL wxLua_wxImageHistogramEntry_Set_value(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxImageHistogramEntry_Set_value[1] = {{ wxLua_wxImageHistogramEntry_Set_value, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxImageHistogramEntry_Set_value }}; ! // %member unsigned long value // GetValue() and SetValue(val) ! static int LUACALL wxLua_wxImageHistogramEntry_Set_value(lua_State *L) { wxLuaState wxlState(L); *************** *** 2388,2400 **** // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxImageHistogramEntry_methods[] = { ! { "GetIndex", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogramEntry_GetIndex, 1, NULL }, ! { "GetValue", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogramEntry_GetValue, 1, NULL }, ! { "SetIndex", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogramEntry_SetIndex, 1, NULL }, ! { "SetValue", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogramEntry_SetValue, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxImageHistogramEntry_delete, 1, NULL }, ! { "index", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxImageHistogramEntry_SetIndex, 1, NULL }, ! { "index", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxImageHistogramEntry_GetIndex, 1, NULL }, ! { "value", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxImageHistogramEntry_SetValue, 1, NULL }, ! { "value", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxImageHistogramEntry_GetValue, 1, NULL }, { "wxImageHistogramEntry", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxImageHistogramEntry_constructor, 1, NULL }, --- 2388,2400 ---- // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxImageHistogramEntry_methods[] = { ! // %member { "Get_index", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogramEntry_Get_index, 1, NULL }, ! // %member { "Get_value", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogramEntry_Get_value, 1, NULL }, ! // %member { "Set_index", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogramEntry_Set_index, 1, NULL }, ! // %member { "Set_value", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogramEntry_Set_value, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxImageHistogramEntry_delete, 1, NULL }, ! { "index", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxImageHistogramEntry_Set_index, 1, NULL }, ! { "index", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxImageHistogramEntry_Get_index, 1, NULL }, ! { "value", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxImageHistogramEntry_Set_value, 1, NULL }, ! { "value", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxImageHistogramEntry_Get_value, 1, NULL }, { "wxImageHistogramEntry", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxImageHistogramEntry_constructor, 1, NULL }, *************** *** 2549,2556 **** // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxImageHistogram_iterator_methods[] = { ! { "Get_first", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogram_iterator_Get_first, 1, NULL }, ! { "Get_second", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogram_iterator_Get_second, 1, NULL }, ! { "Set_first", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogram_iterator_Set_first, 1, NULL }, ! { "Set_second", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogram_iterator_Set_second, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxImageHistogram_iterator_delete, 1, NULL }, { "first", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxImageHistogram_iterator_Set_first, 1, NULL }, --- 2549,2556 ---- // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxImageHistogram_iterator_methods[] = { ! // %member { "Get_first", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogram_iterator_Get_first, 1, NULL }, ! // %member { "Get_second", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogram_iterator_Get_second, 1, NULL }, ! // %member { "Set_first", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogram_iterator_Set_first, 1, NULL }, ! // %member { "Set_second", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxImageHistogram_iterator_Set_second, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxImageHistogram_iterator_delete, 1, NULL }, { "first", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxImageHistogram_iterator_Set_first, 1, NULL }, Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** wx_bind.cpp 27 Jun 2007 19:56:30 -0000 1.123 --- wx_bind.cpp 30 Jun 2007 00:12:25 -0000 1.124 *************** *** 63,70 **** #if defined(__MINGW32__) || defined(__GNUWIN32__) // FIX: "internal compiler error: output_operand: invalid expression as operand" ! const wxPoint wxLua_wxDefaultPositionHack = wxDefaultPosition; ! const wxSize wxLua_wxDefaultSizeHack = wxDefaultSize; ! #define wxDefaultPosition wxLua_wxDefaultPositionHack ! #define wxDefaultSize wxLua_wxDefaultSizeHack #endif //__MINGW32__ --- 63,76 ---- #if defined(__MINGW32__) || defined(__GNUWIN32__) // FIX: "internal compiler error: output_operand: invalid expression as operand" ! // We set their value again later since some compilers (gcc) won't set their value yet ! static wxPoint wxLua_wxDefaultPosition = wxDefaultPosition; ! static wxSize wxLua_wxDefaultSize = wxDefaultSize; ! static wxEventType wxLua_wxEVT_COMMAND_DIRPICKER_CHANGED = wxEVT_COMMAND_DIRPICKER_CHANGED; ! static wxEventType wxLua_wxEVT_COMMAND_FILEPICKER_CHANGED = wxEVT_COMMAND_FILEPICKER_CHANGED; ! ! #define wxDefaultPosition wxLua_wxDefaultPosition ! #define wxDefaultSize wxLua_wxDefaultSize ! #define wxEVT_COMMAND_DIRPICKER_CHANGED wxLua_wxEVT_COMMAND_DIRPICKER_CHANGED ! #define wxEVT_COMMAND_FILEPICKER_CHANGED wxLua_wxEVT_COMMAND_FILEPICKER_CHANGED #endif //__MINGW32__ *************** *** 1311,1314 **** --- 1317,1324 ---- #endif // wxLUA_USE_wxPrint && wxUSE_PRINTING_ARCHITECTURE + #if wxLUA_USE_wxPointSizeRect + { "wxDefaultCoord", wxDefaultCoord }, + #endif // wxLUA_USE_wxPointSizeRect + #if wxLUA_USE_wxDragDrop && wxUSE_DRAG_AND_DROP { "wxDragCancel", wxDragCancel }, *************** *** 1649,1652 **** --- 1659,1666 ---- #endif // (defined(wxHAS_NATIVE_RENDERER)) && (wxLUA_USE_wxRenderer) + #if (wxLUA_USE_wxRegion) && (defined (wxHAS_REGION_COMBINE )) + { "wxHAS_REGION_COMBINE", 1 }, + #endif // (wxLUA_USE_wxRegion) && (defined (wxHAS_REGION_COMBINE )) + #if wxLUA_USE_wxRenderer { "wxHDR_SORT_ICON_DOWN", wxHDR_SORT_ICON_DOWN }, *************** *** 2947,2950 **** --- 2961,2972 ---- #endif // wxLUA_USE_wxRegEx && wxUSE_REGEX + #if (wxLUA_USE_wxRegion) && (defined (wxHAS_REGION_COMBINE )) + { "wxRGN_AND", wxRGN_AND }, + { "wxRGN_COPY", wxRGN_COPY }, + { "wxRGN_DIFF", wxRGN_DIFF }, + { "wxRGN_OR", wxRGN_OR }, + { "wxRGN_XOR", wxRGN_XOR }, + #endif // (wxLUA_USE_wxRegion) && (defined (wxHAS_REGION_COMBINE )) + { "wxRIGHT", wxRIGHT }, *************** *** 8199,8202 **** --- 8221,8235 ---- void wxLuaBinding_wx::PreRegister(const wxLuaState& wxlState, bool registerTypes, int luaTable) { + #if defined(__MINGW32__) || defined(__GNUWIN32__) + #undef wxDefaultPosition + #undef wxDefaultSize + #undef wxEVT_COMMAND_DIRPICKER_CHANGED + #undef wxEVT_COMMAND_FILEPICKER_CHANGED + wxLua_wxDefaultPosition = wxDefaultPosition; + wxLua_wxDefaultSize = wxDefaultSize; + wxLua_wxEVT_COMMAND_DIRPICKER_CHANGED = wxEVT_COMMAND_DIRPICKER_CHANGED; + wxLua_wxEVT_COMMAND_FILEPICKER_CHANGED = wxEVT_COMMAND_FILEPICKER_CHANGED; + #endif //__MINGW32__ + // ugly hack for wxWidgets >2.7 change to use wxStockGDI::GetXXX if (wxLua_wxBLACK == NULL) Index: gdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/gdi.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** gdi.cpp 27 Jun 2007 14:29:54 -0000 1.81 --- gdi.cpp 30 Jun 2007 00:12:23 -0000 1.82 *************** *** 38,42 **** static int LUACALL wxLua_wxPoint_GetX(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint_GetX[1] = {{ wxLua_wxPoint_GetX, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxPoint_GetX }}; ! // %rename X %member int x // GetX() and SetX(int x) static int LUACALL wxLua_wxPoint_GetX(lua_State *L) { --- 38,42 ---- static int LUACALL wxLua_wxPoint_GetX(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint_GetX[1] = {{ wxLua_wxPoint_GetX, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxPoint_GetX }}; ! // %rename X %member_func int x // GetX() and SetX(int x) static int LUACALL wxLua_wxPoint_GetX(lua_State *L) [...1693 lines suppressed...] #if (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) ! // %member { "Set_m_selectionColour", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_selectionColour, 1, NULL }, #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) *************** *** 16292,16297 **** // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxRendererVersion_methods[] = { ! { "Get_age", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxRendererVersion_Get_age, 1, NULL }, ! { "Get_version", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxRendererVersion_Get_version, 1, NULL }, { "IsCompatible", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxRendererVersion_IsCompatible, 1, NULL }, { "age", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxRendererVersion_Get_age, 1, NULL }, --- 17176,17181 ---- // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxRendererVersion_methods[] = { ! // %member { "Get_age", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxRendererVersion_Get_age, 1, NULL }, ! // %member { "Get_version", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxRendererVersion_Get_version, 1, NULL }, { "IsCompatible", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxRendererVersion_IsCompatible, 1, NULL }, { "age", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxRendererVersion_Get_age, 1, NULL }, Index: geometry.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/geometry.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** geometry.cpp 17 Jun 2007 18:36:20 -0000 1.34 --- geometry.cpp 30 Jun 2007 00:12:24 -0000 1.35 *************** *** 154,158 **** static int LUACALL wxLua_wxPoint2DInt_GetX(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_GetX[1] = {{ wxLua_wxPoint2DInt_GetX, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxPoint2DInt_GetX }}; ! // %rename X %member wxInt32 m_x static int LUACALL wxLua_wxPoint2DInt_GetX(lua_State *L) { --- 154,158 ---- static int LUACALL wxLua_wxPoint2DInt_GetX(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_GetX[1] = {{ wxLua_wxPoint2DInt_GetX, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxPoint2DInt_GetX }}; ! // %rename X %member_func wxInt32 m_x static int LUACALL wxLua_wxPoint2DInt_GetX(lua_State *L) { *************** *** 169,173 **** static int LUACALL wxLua_wxPoint2DInt_GetY(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_GetY[1] = {{ wxLua_wxPoint2DInt_GetY, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxPoint2DInt_GetY }}; ! // %rename Y %member wxInt32 m_y static int LUACALL wxLua_wxPoint2DInt_GetY(lua_State *L) { --- 169,173 ---- static int LUACALL wxLua_wxPoint2DInt_GetY(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_GetY[1] = {{ wxLua_wxPoint2DInt_GetY, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxPoint2DInt_GetY }}; ! // %rename Y %member_func wxInt32 m_y static int LUACALL wxLua_wxPoint2DInt_GetY(lua_State *L) { *************** *** 233,237 **** static int LUACALL wxLua_wxPoint2DInt_SetX(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_SetX[1] = {{ wxLua_wxPoint2DInt_SetX, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPoint2DInt_SetX }}; ! // %rename X %member wxInt32 m_x static int LUACALL wxLua_wxPoint2DInt_SetX(lua_State *L) { --- 233,237 ---- static int LUACALL wxLua_wxPoint2DInt_SetX(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_SetX[1] = {{ wxLua_wxPoint2DInt_SetX, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPoint2DInt_SetX }}; ! // %rename X %member_func wxInt32 m_x static int LUACALL wxLua_wxPoint2DInt_SetX(lua_State *L) { *************** *** 249,253 **** static int LUACALL wxLua_wxPoint2DInt_SetY(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_SetY[1] = {{ wxLua_wxPoint2DInt_SetY, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPoint2DInt_SetY }}; ! // %rename Y %member wxInt32 m_y static int LUACALL wxLua_wxPoint2DInt_SetY(lua_State *L) { --- 249,253 ---- static int LUACALL wxLua_wxPoint2DInt_SetY(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_SetY[1] = {{ wxLua_wxPoint2DInt_SetY, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPoint2DInt_SetY }}; ! // %rename Y %member_func wxInt32 m_y static int LUACALL wxLua_wxPoint2DInt_SetY(lua_State *L) { *************** *** 278,307 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPoint2DInt_op_add_assign[] = { &s_wxluatag_wxPoint2DInt, &s_wxluatag_wxPoint2DInt, NULL }; ! static int LUACALL wxLua_wxPoint2DInt_op_add_assign(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_op_add_assign[1] = {{ wxLua_wxPoint2DInt_op_add_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPoint2DInt_op_add_assign }}; ! // %operator wxPoint2DInt& operator+=(const wxPoint2DInt& pt) ! static int LUACALL wxLua_wxPoint2DInt_op_add_assign(lua_State *L) { wxLuaState wxlState(L); ! wxPoint2DInt *returns; // const wxPoint2DInt pt const wxPoint2DInt * pt = (const wxPoint2DInt *)wxlState.GetUserDataType(2, s_wxluatag_wxPoint2DInt); // get this wxPoint2DInt * self = (wxPoint2DInt *)wxlState.GetUserDataType(1, s_wxluatag_wxPoint2DInt); ! // call op_add_assign ! returns = self; ! *returns = ((*self)+=(*pt)); ! // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxPoint2DInt, returns); return 1; } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPoint2DInt_op_assign[] = { &s_wxluatag_wxPoint2DInt, &s_wxluatag_wxPoint2DInt, NULL }; ! static int LUACALL wxLua_wxPoint2DInt_op_assign(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_op_assign[1] = {{ wxLua_wxPoint2DInt_op_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPoint2DInt_op_assign }}; ! // %operator wxPoint2DInt& operator=(const wxPoint2DInt& pt) ! static int LUACALL wxLua_wxPoint2DInt_op_assign(lua_State *L) { wxLuaState wxlState(L); --- 278,306 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPoint2DInt_op_eq[] = { &s_wxluatag_wxPoint2DInt, &s_wxluatag_wxPoint2DInt, NULL }; ! static int LUACALL wxLua_wxPoint2DInt_op_eq(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_op_eq[1] = {{ wxLua_wxPoint2DInt_op_eq, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPoint2DInt_op_eq }}; ! // %operator bool operator==(const wxPoint2DInt& pt) const ! static int LUACALL wxLua_wxPoint2DInt_op_eq(lua_State *L) { wxLuaState wxlState(L); ! bool returns; // const wxPoint2DInt pt const wxPoint2DInt * pt = (const wxPoint2DInt *)wxlState.GetUserDataType(2, s_wxluatag_wxPoint2DInt); // get this wxPoint2DInt * self = (wxPoint2DInt *)wxlState.GetUserDataType(1, s_wxluatag_wxPoint2DInt); ! // call op_eq ! returns = ((*self)==(*pt)); ! // push the result flag ! lua_pushboolean(L, returns); return 1; } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPoint2DInt_op_iadd[] = { &s_wxluatag_wxPoint2DInt, &s_wxluatag_wxPoint2DInt, NULL }; ! static int LUACALL wxLua_wxPoint2DInt_op_iadd(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_op_iadd[1] = {{ wxLua_wxPoint2DInt_op_iadd, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPoint2DInt_op_iadd }}; ! // %operator wxPoint2DInt& operator+=(const wxPoint2DInt& pt) ! static int LUACALL wxLua_wxPoint2DInt_op_iadd(lua_State *L) { wxLuaState wxlState(L); *************** *** 311,317 **** // get this wxPoint2DInt * self = (wxPoint2DInt *)wxlState.GetUserDataType(1, s_wxluatag_wxPoint2DInt); ! // call op_assign returns = self; ! *returns = ((*self)=(*pt)); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxPoint2DInt, returns); --- 310,316 ---- // get this wxPoint2DInt * self = (wxPoint2DInt *)wxlState.GetUserDataType(1, s_wxluatag_wxPoint2DInt); ! // call op_iadd returns = self; ! *returns = ((*self)+=(*pt)); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxPoint2DInt, returns); *************** *** 320,328 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPoint2DInt_op_div_assign[] = { &s_wxluatag_wxPoint2DInt, &s_wxluatag_wxPoint2DInt, NULL }; ! static int LUACALL wxLua_wxPoint2DInt_op_div_assign(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxPoint2DInt_op_div_assign[1] = {{ wxLua_wxPoint2DInt_op_div_assign, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPoint2DInt_op... [truncated message content] |
From: John L. <jr...@us...> - 2007-06-30 00:12:32
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9448/wxLua/modules/wxluadebug/src Modified Files: wxlstack.cpp Log Message: Fix for MingW added in wxWidgets bindings for wxDefaultPoint and wxEVT_FILEPICKER/DIRPICKER... Rename the functions to get the type names from wxLua to match closer to the lua type() function, wxlua.i Change op_add_assign to just op_iadd (others as well) = op_assign is now op_set Index: wxlstack.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxlstack.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxlstack.cpp 28 Jun 2007 22:45:57 -0000 1.10 --- wxlstack.cpp 30 Jun 2007 00:12:26 -0000 1.11 *************** *** 462,467 **** wxLuaStackListData* stkListData = new wxLuaStackListData(n, debugData); info.SetData(stkListData); // we must delete this - int img = SetupListItem(item, info); if ((img == IMG_TABLE) || (img == IMG_TABLE_OPEN)) { --- 462,467 ---- wxLuaStackListData* stkListData = new wxLuaStackListData(n, debugData); info.SetData(stkListData); // we must delete this int img = SetupListItem(item, info); + if ((img == IMG_TABLE) || (img == IMG_TABLE_OPEN)) { *************** *** 784,791 **** if (!debugItem->GetFlagBit(WXLUA_DEBUGITEM_EXPANDED)) { ! ExpandItem(event.GetIndex()); ! // Hack for WXLUA_STACK_MSWTREE, need children to expand ! if (stkListData->m_treeId && !m_treeCtrl->IsExpanded(stkListData->m_treeId)) ! m_treeCtrl->Expand(stkListData->m_treeId); } else --- 784,793 ---- if (!debugItem->GetFlagBit(WXLUA_DEBUGITEM_EXPANDED)) { ! if (ExpandItem(event.GetIndex())) ! { ! // Hack for WXLUA_STACK_MSWTREE, need children to expand ! if (stkListData->m_treeId && !m_treeCtrl->IsExpanded(stkListData->m_treeId)) ! m_treeCtrl->Expand(stkListData->m_treeId); ! } } else *************** *** 829,833 **** // Check and block linked tables already shown, select it and return ! if (debugItem->GetType() == wxT("Table")) { wxString val = debugItem->GetValue(); --- 831,835 ---- // Check and block linked tables already shown, select it and return ! if (debugItem->GetType() == wxT("table")) { wxString val = debugItem->GetValue(); |
From: John L. <jr...@us...> - 2007-06-30 00:12:32
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9448/wxLua/samples Modified Files: bindings.wx.lua controls.wx.lua unittest.wx.lua Log Message: Fix for MingW added in wxWidgets bindings for wxDefaultPoint and wxEVT_FILEPICKER/DIRPICKER... Rename the functions to get the type names from wxLua to match closer to the lua type() function, wxlua.i Change op_add_assign to just op_iadd (others as well) = op_assign is now op_set Index: controls.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/controls.wx.lua,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** controls.wx.lua 28 Jun 2007 03:15:34 -0000 1.10 --- controls.wx.lua 30 Jun 2007 00:12:27 -0000 1.11 *************** *** 89,104 **** -- --------------------------------------------------------------------------- -- Turn the array from the binding into a lookup table by event type wxEVT_List = {} ! wxEVT_Array = wx.wxLuaBinding_wx.GetEventArray wxEVT_TableByType = {} for i = 1, #wxEVT_Array do wxEVT_TableByType[wxEVT_Array[i].eventType] = wxEVT_Array[i] ! table.insert(wxEVT_List, {wxlua.wxlua_typename(wxEVT_Array[i].class_tag), wxEVT_Array[i].name}) end table.sort(wxEVT_List, function(t1, t2) return t1[1] > t2[1] end) -- Turn the array from the binding into a lookup table by class name ! wxCLASS_Array = wx.wxLuaBinding_wx.GetClassArray wxCLASS_TableByName = {} for i = 1, #wxCLASS_Array do --- 89,117 ---- -- --------------------------------------------------------------------------- + wxLuaBinding_wx = nil + + do + local bindTable = wxlua.GetBindings() + for n = 1, #bindTable do + if bindTable[n].name == "wx" then + wxLuaBinding_wx = bindTable[n].binding + break + end + end + end + + -- Turn the array from the binding into a lookup table by event type wxEVT_List = {} ! wxEVT_Array = wxLuaBinding_wx.GetEventArray wxEVT_TableByType = {} for i = 1, #wxEVT_Array do wxEVT_TableByType[wxEVT_Array[i].eventType] = wxEVT_Array[i] ! table.insert(wxEVT_List, {wxlua.typename(wxEVT_Array[i].class_tag), wxEVT_Array[i].name}) end table.sort(wxEVT_List, function(t1, t2) return t1[1] > t2[1] end) -- Turn the array from the binding into a lookup table by class name ! wxCLASS_Array = wxLuaBinding_wx.GetClassArray wxCLASS_TableByName = {} for i = 1, #wxCLASS_Array do *************** *** 246,251 **** local s = funcTable[n].."=" ! local typ = wxlua.wxlua_type(v) ! local typ_name = wxlua.wxlua_typename(typ) if typ == wxlua.WXLUAARG_String then --- 259,263 ---- local s = funcTable[n].."=" ! local typ_name, typ = wxlua.type(v) if typ == wxlua.WXLUAARG_String then *************** *** 284,288 **** --v:delete() -- If we haven't handled it yet, we probably should ! print("Unhandled wxLua data type in FuncsToString from ", wxlua.wxlua_typename(wxlua.wxlua_type(event)), typ_name) end --- 296,300 ---- --v:delete() -- If we haven't handled it yet, we probably should ! print("Unhandled wxLua data type in FuncsToString from ", wxlua.type(event), typ_name) end *************** *** 299,303 **** function OnEvent(event) local skip = true ! local evtClassName = wxlua.wxlua_typename(wxEVT_TableByType[event:GetEventType()].class_tag) local evtTypeStr = wxEVT_TableByType[event:GetEventType()].name --- 311,315 ---- function OnEvent(event) local skip = true ! local evtClassName = wxlua.typename(wxEVT_TableByType[event:GetEventType()].class_tag) local evtTypeStr = wxEVT_TableByType[event:GetEventType()].name *************** *** 377,381 **** end ! local flexSizer = wx.wxFlexGridSizer(20, 2, 5, 5) flexSizer:AddGrowableCol(1) --- 389,393 ---- end ! local flexSizer = wx.wxFlexGridSizer(50, 2, 5, 5) flexSizer:AddGrowableCol(1) Index: bindings.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/bindings.wx.lua,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** bindings.wx.lua 28 Jun 2007 21:52:57 -0000 1.13 --- bindings.wx.lua 30 Jun 2007 00:12:27 -0000 1.14 *************** *** 313,317 **** for j = 1, #args_table do ! local s = wxlua.wxlua_typename(args_table[j]) -- The first arg for a class member function is the self --- 313,317 ---- for j = 1, #args_table do ! local s = wxlua.typename(args_table[j]) -- The first arg for a class member function is the self *************** *** 518,522 **** -- Add the class tag name for the event for i = 2, #t do ! t[i][3] = wxlua.wxlua_typename(t[i][3]).." ("..t[i][3]..")" -- if t[i-1][2] == t[i][2] then t[i].color = wx.wxRED end -- see if there's dups, there's a couple, but they're right end --- 518,522 ---- -- Add the class tag name for the event for i = 2, #t do ! t[i][3] = wxlua.typename(t[i][3]).." ("..t[i][3]..")" -- if t[i-1][2] == t[i][2] then t[i].color = wx.wxRED end -- see if there's dups, there's a couple, but they're right end *************** *** 534,538 **** -- Add the class tag name for the user data for i = 2, #t do ! t[i][3] = wxlua.wxlua_typename(t[i][3]).." ("..t[i][3]..")" end --- 534,538 ---- -- Add the class tag name for the user data for i = 2, #t do ! t[i][3] = wxlua.typename(t[i][3]).." ("..t[i][3]..")" end *************** *** 896,900 **** for j = 1, #lua_types do local ltype = wxlua[lua_types[j]] ! local ok = wxlua.wxlua_iswxluatype(ltype, wxltype) table.insert(item, tostr[ok]) end --- 896,900 ---- for j = 1, #lua_types do local ltype = wxlua[lua_types[j]] ! local ok = wxlua.iswxluatype(ltype, wxltype) table.insert(item, tostr[ok]) end Index: unittest.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/unittest.wx.lua,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** unittest.wx.lua 18 Jun 2007 18:37:47 -0000 1.14 --- unittest.wx.lua 30 Jun 2007 00:12:27 -0000 1.15 *************** *** 159,162 **** --- 159,186 ---- -- --------------------------------------------------------------------------- + print("\nTest some %operator binding class functions.\n") + -- --------------------------------------------------------------------------- + + a = wx.wxPoint(1, 2) + b = wx.wxPoint(1, 2) + c = wx.wxPoint(2, 4) + PrintOk(a:op_eq(b), "%operator wxPoint& operator==(const wxPoint& p) const") + PrintOk(a:op_eq(a), "%operator wxPoint& operator==(const wxPoint& p) const") + PrintOk(not a:op_ne(b), "%operator wxPoint& operator!=(const wxPoint& p) const") + PrintOk(a:op_ne(c), "%operator wxPoint& operator!=(const wxPoint& p) const") + + d = a:op_add(b) + PrintOk(d:op_eq(c), "%operator wxPoint operator+(const wxPoint& p) const") + d:op_set(a); d:op_iadd(a) + PrintOk(d:op_eq(c), "%operator wxPoint& operator+=(const wxPoint& p)") + d:op_set(a); d = d:op_neg() + PrintOk(d:op_eq(wx.wxPoint(-1, -2)), "%operator wxPoint& operator-()") + + d = a:op_add(wx.wxSize(1,2)) + PrintOk(d:op_eq(c), "%operator wxPoint operator+(const wxSize& p) const") + d:op_set(a); d:op_iadd(wx.wxSize(1,2)) + PrintOk(d:op_eq(c), "%operator wxPoint& operator+=(const wxSize& p)") + + -- --------------------------------------------------------------------------- print("\nTest some binding class functions.\n") -- --------------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2007-06-30 00:12:32
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9448/wxLua/modules/wxlua/src Modified Files: wxlua_bind.cpp Log Message: Fix for MingW added in wxWidgets bindings for wxDefaultPoint and wxEVT_FILEPICKER/DIRPICKER... Rename the functions to get the type names from wxLua to match closer to the lua type() function, wxlua.i Change op_add_assign to just op_iadd (others as well) = op_assign is now op_set Index: wxlua_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlua_bind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxlua_bind.cpp 28 Jun 2007 21:52:57 -0000 1.5 --- wxlua_bind.cpp 30 Jun 2007 00:12:26 -0000 1.6 *************** *** 839,845 **** static wxLuaBindCFunc s_wxluafunc_wxLua_function_GetTrackedWindows[1] = {{ wxLua_function_GetTrackedWindows, WXLUAMETHOD_CFUNCTION, 0, 0, s_wxluaargArray_None }}; ! static wxLuaArgTag s_wxluatagArray_wxLua_function_wxlua_iswxluatype[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; ! // %function int wxlua_iswxluatype(int luatype, int wxluaarg_tag) ! static int LUACALL wxLua_function_wxlua_iswxluatype(lua_State *L) { int returns; --- 839,845 ---- static wxLuaBindCFunc s_wxluafunc_wxLua_function_GetTrackedWindows[1] = {{ wxLua_function_GetTrackedWindows, WXLUAMETHOD_CFUNCTION, 0, 0, s_wxluaargArray_None }}; ! static wxLuaArgTag s_wxluatagArray_wxLua_function_iswxluatype[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; ! // %rename iswxluatype %function int wxlua_iswxluatype(int luatype, int wxluaarg_tag) ! static int LUACALL wxLua_function_iswxluatype(lua_State *L) { int returns; *************** *** 855,887 **** return 1; } ! static wxLuaBindCFunc s_wxluafunc_wxLua_function_wxlua_iswxluatype[1] = {{ wxLua_function_wxlua_iswxluatype, WXLUAMETHOD_CFUNCTION, 2, 2, s_wxluatagArray_wxLua_function_wxlua_iswxluatype }}; ! static wxLuaArgTag s_wxluatagArray_wxLua_function_wxlua_type[] = { &s_wxluaarg_LightUserData, NULL }; ! // %override wxLua_function_wxlua_type ! // %function int wxlua_wxluatype(int wxluaarg_tag) ! static int LUACALL wxLua_function_wxlua_type(lua_State *L) { wxLuaState wxlState(L); ! wxString returns; ! // int wxluaarg_tag ! int wxluaarg_tag = wxlua_ttag(L, 1); if (wxluaarg_tag == WXLUA_NOTAG) - { - int ltype = lua_type(L, 1); wxluaarg_tag = wxlua_getwxluatype(ltype); - } ! // push the result number lua_pushnumber(L, wxluaarg_tag); ! return 1; } ! static wxLuaBindCFunc s_wxluafunc_wxLua_function_wxlua_type[1] = {{ wxLua_function_wxlua_type, WXLUAMETHOD_CFUNCTION, 1, 1, s_wxluatagArray_wxLua_function_wxlua_type }}; ! static wxLuaArgTag s_wxluatagArray_wxLua_function_wxlua_typename[] = { &s_wxluaarg_Number, NULL }; ! // %override wxLua_function_wxlua_typename ! // %function wxString wxlua_getwxluatypename(int wxluaarg_tag) ! static int LUACALL wxLua_function_wxlua_typename(lua_State *L) { wxLuaState wxlState(L); --- 855,898 ---- return 1; } ! static wxLuaBindCFunc s_wxluafunc_wxLua_function_iswxluatype[1] = {{ wxLua_function_iswxluatype, WXLUAMETHOD_CFUNCTION, 2, 2, s_wxluatagArray_wxLua_function_iswxluatype }}; ! static wxLuaArgTag s_wxluatagArray_wxLua_function_type[] = { &s_wxluaarg_LightUserData, NULL }; ! // %override wxLua_function_type ! // %function int type(int wxluaarg_tag) ! static int LUACALL wxLua_function_type(lua_State *L) { wxLuaState wxlState(L); ! ! int ltype = lua_type(L, 1); ! const char* ltypename = lua_typename(L, ltype); ! ! int wxluaarg_tag = WXLUA_NOTAG; ! ! // this may a wxLua data ! if (ltype == LUA_TUSERDATA) ! wxluaarg_tag = wxlua_ttag(L, 1); ! ! // I guess it wasn't or isn't a userdata if (wxluaarg_tag == WXLUA_NOTAG) wxluaarg_tag = wxlua_getwxluatype(ltype); ! wxString tagName = wxlState.GetLuaTagName(wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); ! ! // push the results ! lua_pushstring(L, wx2lua(tagName)); lua_pushnumber(L, wxluaarg_tag); ! lua_pushstring(L, ltypename); ! lua_pushnumber(L, ltype); ! ! return 4; } ! static wxLuaBindCFunc s_wxluafunc_wxLua_function_type[1] = {{ wxLua_function_type, WXLUAMETHOD_CFUNCTION, 1, 1, s_wxluatagArray_wxLua_function_type }}; ! static wxLuaArgTag s_wxluatagArray_wxLua_function_typename[] = { &s_wxluaarg_Number, NULL }; ! // %override wxLua_function_typename ! // %function wxString typename(int wxluaarg_tag) ! static int LUACALL wxLua_function_typename(lua_State *L) { wxLuaState wxlState(L); *************** *** 897,901 **** } ! static wxLuaBindCFunc s_wxluafunc_wxLua_function_wxlua_typename[1] = {{ wxLua_function_wxlua_typename, WXLUAMETHOD_CFUNCTION, 1, 1, s_wxluatagArray_wxLua_function_wxlua_typename }}; // --------------------------------------------------------------------------- --- 908,912 ---- } ! static wxLuaBindCFunc s_wxluafunc_wxLua_function_typename[1] = {{ wxLua_function_typename, WXLUAMETHOD_CFUNCTION, 1, 1, s_wxluatagArray_wxLua_function_typename }}; // --------------------------------------------------------------------------- *************** *** 913,919 **** { "GetTrackedUserData", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_GetTrackedUserData, 1, NULL }, { "GetTrackedWindows", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_GetTrackedWindows, 1, NULL }, ! { "wxlua_iswxluatype", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_wxlua_iswxluatype, 1, NULL }, ! { "wxlua_type", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_wxlua_type, 1, NULL }, ! { "wxlua_typename", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_wxlua_typename, 1, NULL }, { 0, 0, 0, 0 }, --- 924,930 ---- { "GetTrackedUserData", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_GetTrackedUserData, 1, NULL }, { "GetTrackedWindows", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_GetTrackedWindows, 1, NULL }, ! { "iswxluatype", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_iswxluatype, 1, NULL }, ! { "type", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_type, 1, NULL }, ! { "typename", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_typename, 1, NULL }, { 0, 0, 0, 0 }, |
From: John L. <jr...@us...> - 2007-06-28 22:46:01
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6193/wxLua/modules/wxlua/include Modified Files: wxlstate.h Log Message: Add a lua reg table to track ALL items pushed into lua, for debugging Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** wxlstate.h 25 Jun 2007 23:04:00 -0000 1.84 --- wxlstate.h 28 Jun 2007 22:45:57 -0000 1.85 *************** *** 97,103 **** #define WXLUA_LREG_DERIVED_METHODS 3 #define WXLUA_LREG_WXLUASTATEREFDATA 4 ! #define WXLUA_LREG_CALLBASECLASSFUNC 5 ! #define WXLUA_METATABLE_TAG 6 ! #define WXLUA_METATABLE_CLASS 7 // Light user data used as keys in the lua registry table for wxLua items. --- 97,104 ---- #define WXLUA_LREG_DERIVED_METHODS 3 #define WXLUA_LREG_WXLUASTATEREFDATA 4 ! #define WXLUA_LREG_OBJECTS 5 ! #define WXLUA_LREG_CALLBASECLASSFUNC 6 ! #define WXLUA_METATABLE_TAG 7 ! #define WXLUA_METATABLE_CLASS 8 // Light user data used as keys in the lua registry table for wxLua items. *************** *** 107,110 **** --- 108,112 ---- extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_derivedmethods_key; // WXLUA_LREG_DERIVED_METHODS extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_wxluastaterefdata_key; // WXLUA_LREG_WXLUASTATEREFDATA + extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_objects_key; // WXLUA_LREG_OBJECTS extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_callbaseclassfunc_key; // WXLUA_LREG_CALLBASECLASSFUNC *************** *** 127,130 **** --- 129,135 ---- // wxLuaStateRefData for this lua_State. #define wxlua_pushkey_wxLuaStateRefData(L) lua_pushlightuserdata(L, &wxlua_lreg_wxluastaterefdata_key) + // Push a key that is an index of the LUA_REGISTRYINDEX table that is table of all + // objects that we've pushed into lua using [lightuserdata] = tag + #define wxlua_pushkey_wxLuaObjects(L) lua_pushlightuserdata(L, &wxlua_lreg_objects_key) // Push a key that is an index of the LUA_REGISTRYINDEX table that is boolean value // of whether the lua code has prepended a '_' to indicate they want the base class function called. |
From: John L. <jr...@us...> - 2007-06-28 22:46:00
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6193/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlstate.cpp Log Message: Add a lua reg table to track ALL items pushed into lua, for debugging Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** wxlstate.cpp 25 Jun 2007 23:04:02 -0000 1.118 --- wxlstate.cpp 28 Jun 2007 22:45:57 -0000 1.119 *************** *** 44,47 **** --- 44,48 ---- int wxlua_lreg_derivedmethods_key = WXLUA_LREG_DERIVED_METHODS; int wxlua_lreg_wxluastaterefdata_key = WXLUA_LREG_WXLUASTATEREFDATA; + int wxlua_lreg_objects_key = WXLUA_LREG_OBJECTS; int wxlua_lreg_callbaseclassfunc_key = WXLUA_LREG_CALLBASECLASSFUNC; *************** *** 351,358 **** { // pop the table and set it as the metatable for the newuserdata ! if (lua_setmetatable(L, -2) == 0) ! wxlua_terror(L, "wxLua: Unable to set metatable in tpushusertag."); ! else return true; } } --- 352,369 ---- { // pop the table and set it as the metatable for the newuserdata ! if (lua_setmetatable(L, -2) != 0) ! { ! wxlua_pushkey_wxLuaObjects(L); ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the obj table) ! ! lua_pushlightuserdata(L, (void*)u); ! lua_pushnumber(L, tag); // t["lightuserdata ptr"] = tag ! lua_rawset(L, -3); ! lua_pop(L, 1); ! return true; + } + else + wxlua_terror(L, "wxLua: Unable to set metatable in tpushusertag."); } } *************** *** 1929,1932 **** --- 1940,1948 ---- lua_rawset( L, LUA_REGISTRYINDEX ); // set the value + // Create a table for all userdata that we've pushed into lua + wxlua_pushkey_wxLuaObjects(L); + lua_newtable(L); + lua_rawset( L, LUA_REGISTRYINDEX ); // set the value + // Register bindings wxLuaBindingList::compatibility_iterator node = M_WXLSTATEDATA->m_wxlStateData->m_bindingList.GetFirst(); Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** wxlbind.cpp 28 Jun 2007 21:52:56 -0000 1.82 --- wxlbind.cpp 28 Jun 2007 22:45:57 -0000 1.83 *************** *** 253,256 **** --- 253,263 ---- wxCHECK_MSG(key != 0, 0, wxT("NULL user data in wxluabind_gc_wxLuaBindClass")); + wxlua_pushkey_wxLuaObjects(L); + lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the classes table) + lua_pushlightuserdata(L, (void*)key); + lua_pushnil(L); // t["lightuserdata ptr"] = nil to remove it + lua_rawset(L, -3); + lua_pop(L, 1); + wxlState.RemoveTrackedObject(key, true); wxlua_removederivedmethod(L, key); |
From: John L. <jr...@us...> - 2007-06-28 22:46:00
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6193/wxLua/modules/wxluadebug/src Modified Files: wxldebug.cpp wxlstack.cpp Log Message: Add a lua reg table to track ALL items pushed into lua, for debugging Index: wxlstack.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxlstack.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wxlstack.cpp 19 Jun 2007 13:58:16 -0000 1.9 --- wxlstack.cpp 28 Jun 2007 22:45:57 -0000 1.10 *************** *** 111,116 **** // ----------------------------------------------------------------------- ! m_typeColours[IMG_UNKNOWN] = wxColour(wxT("TURQUOISE")); ! m_typeColours[IMG_NONE] = wxColour(wxT("TURQUOISE")); m_typeColours[IMG_NIL] = wxColour(wxT("BLACK")); m_typeColours[IMG_BOOLEAN] = wxColour(wxT("FIREBRICK")); --- 111,116 ---- // ----------------------------------------------------------------------- ! m_typeColours[IMG_UNKNOWN] = wxColour(wxT("DARK TURQUOISE")); ! m_typeColours[IMG_NONE] = wxColour(wxT("DARK TURQUOISE")); m_typeColours[IMG_NIL] = wxColour(wxT("BLACK")); m_typeColours[IMG_BOOLEAN] = wxColour(wxT("FIREBRICK")); Index: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wxldebug.cpp 25 Jun 2007 23:04:02 -0000 1.37 --- wxldebug.cpp 28 Jun 2007 22:45:57 -0000 1.38 *************** *** 283,286 **** --- 283,291 ---- int nTop = lua_gettop(L); + wxlua_pushkey_wxLuaObjects(L); + lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the obj table) + bool is_lreg_objTable = (lua_equal(L, -1, -2) != 0); + lua_pop(L, 1); + // start iterating lua_pushnil(L); *************** *** 292,295 **** --- 297,307 ---- GetTypeValue(wxlState, -1, type, value, &flag_type); + if (is_lreg_objTable) + { + long tag = -1; + if (value.BeforeFirst(wxT(' ')).ToLong(&tag)) + value = value.BeforeFirst(wxT(' ')) + wxT(" (") + wxlState.GetLuaTagName(tag) + wxT(")"); + } + //wxPrintf(wxT("wxLuaDebugData::EnumerateTable %d type='%s' key='%s' val='%s'\n"), count, type.c_str(), name.c_str(), value.c_str()); *************** *** 458,461 **** --- 470,475 ---- else if (udata == &wxlua_lreg_wxluastaterefdata_key) s += wxT(" - wxLuaStateRefData"); + else if (udata == &wxlua_lreg_objects_key) + s += wxT(" - wxLua Pushed Userdata"); else if (udata == &wxlua_lreg_callbaseclassfunc_key) s += wxT(" - CallBaseClassFunc"); |
From: John L. <jr...@us...> - 2007-06-28 21:53:01
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19412/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlua_bind.cpp Log Message: Moved the bindings function for introspection in lua into the override.hpp file for the wxlua bindings. Add function wxlua.GetBindings() instead of install wxLuaBinding_XXX per binding. Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** wxlbind.cpp 25 Jun 2007 23:04:02 -0000 1.81 --- wxlbind.cpp 28 Jun 2007 21:52:56 -0000 1.82 *************** *** 25,31 **** WX_DEFINE_LIST(wxLuaBindingList); - int LUACALL wxluabind_wxLuaBinding_index(lua_State* L); - - wxLuaArgTag s_wxluaargArray_None[1] = {0}; wxLuaBindDefine s_wxluadefineArray_None[1] = {{0, 0}}; --- 25,28 ---- *************** *** 677,697 **** PostRegister(wxlState, registerTypes, tableOffset); - // Push function to access the binding info - lua_pushstring(L, wx2lua(wxT("wxLuaBinding_") + m_bindingName)); - const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); - *ptr = this; - lua_newtable(L); - lua_pushstring(L, "__index"); - lua_pushlightuserdata(L, this); // push tag to recognize table call - lua_pushcclosure(L, wxluabind_wxLuaBinding_index, 1); // push func with tag as upvalue - lua_rawset(L, -3); - - //lua_pushstring(L, "__metatable"); - //lua_pushstring(L, "Metatable is not accessible"); - //lua_rawset(L, -3); - - lua_setmetatable(L, -2); - lua_rawset(L, -3); - m_bindings_registered = true; --- 674,677 ---- *************** *** 1152,1697 **** } - //----------------------------------------------------------------------------- - // wxluabind_wxLuaBindCFunc_index - //----------------------------------------------------------------------------- - int LUACALL wxluabind_wxLuaBindClass_index(lua_State* L); - - int LUACALL wxluabind_wxLuaBindCFunc_index(lua_State* L) - { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - - void **ptr = (void **)lua_touserdata(L, 1); - wxLuaBindCFunc* wxlCFunc= (wxLuaBindCFunc*)*ptr; - wxLuaBinding *wxlBinding = (wxLuaBinding *)lua_touserdata(L, lua_upvalueindex(1)); - - int idx_type = lua_type(L, 2); - - if (idx_type == LUA_TSTRING) - { - const char* idx_str = lua_tostring(L, 2); - - if (strcmp(idx_str, "func") == 0) - { - lua_pushcfunction(L, wxlCFunc->func); - return 1; - } - else if (strcmp(idx_str, "type") == 0) - { - lua_pushnumber(L, wxlCFunc->type); - return 1; - } - else if (strcmp(idx_str, "minargs") == 0) - { - lua_pushnumber(L, wxlCFunc->minargs); - return 1; - } - else if (strcmp(idx_str, "maxargs") == 0) - { - lua_pushnumber(L, wxlCFunc->maxargs); - return 1; - } - else if (strcmp(idx_str, "argtags") == 0) - { - size_t idx, count = wxlCFunc->maxargs; - lua_createtable(L, count, 0); - - // check for terminating null argtag - for (idx = 0; (idx < count) && wxlCFunc->argtags[idx]; ++idx) - { - lua_pushnumber(L, *wxlCFunc->argtags[idx]); - lua_rawseti(L, -2, idx + 1); - } - - return 1; - } - else if (strcmp(idx_str, "class") == 0) - { - const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlCFunc); - if (c != NULL) - { - const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); - *ptr = c; - lua_newtable(L); - lua_pushstring(L, "__index"); - lua_pushlightuserdata(L, wxlBinding); - lua_pushcclosure(L, wxluabind_wxLuaBindClass_index, 1); // push func with tag as upvalue - lua_rawset(L, -3); - lua_setmetatable(L, -2); - - return 1; - } - } - else if (strcmp(idx_str, "class_name") == 0) - { - const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlCFunc); - if (c != NULL) - { - lua_pushstring(L, c->name); - return 1; - } - } - } - - return 0; - } - - //----------------------------------------------------------------------------- - // wxluabind_wxLuaBindMethod_index - //----------------------------------------------------------------------------- - - int LUACALL wxluabind_wxLuaBindMethod_index(lua_State* L) - { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - - void **ptr = (void **)lua_touserdata(L, 1); - wxLuaBindMethod* wxlMethod = (wxLuaBindMethod*)*ptr; - wxLuaBinding *wxlBinding = (wxLuaBinding *)lua_touserdata(L, lua_upvalueindex(1)); - - int idx_type = lua_type(L, 2); - - if (idx_type == LUA_TSTRING) - { - const char* idx_str = lua_tostring(L, 2); - - if (strcmp(idx_str, "name") == 0) - { - lua_pushstring(L, wxlMethod->name); - return 1; - } - else if (strcmp(idx_str, "type") == 0) - { - lua_pushnumber(L, wxlMethod->type); - return 1; - } - else if (strcmp(idx_str, "funcs") == 0) - { - wxLuaBindCFunc* wxlCFunc = wxlMethod->funcs; - size_t idx, count = wxlMethod->funcs_n; - lua_createtable(L, count, 0); - - for (idx = 0; idx < count; ++idx, ++wxlCFunc) - { - const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); - *ptr = wxlCFunc; - lua_newtable(L); - lua_pushstring(L, "__index"); - lua_pushlightuserdata(L, wxlBinding); - lua_pushcclosure(L, wxluabind_wxLuaBindCFunc_index, 1); // push func with tag as upvalue - lua_rawset(L, -3); - lua_setmetatable(L, -2); - - lua_rawseti(L, -2, idx + 1); - } - - return 1; - } - else if (strcmp(idx_str, "funcs_n") == 0) - { - lua_pushnumber(L, wxlMethod->funcs_n); - return 1; - } - else if (strcmp(idx_str, "basemethod") == 0) - { - if (wxlMethod->basemethod) - { - const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); - *ptr = wxlMethod->basemethod; - lua_newtable(L); - lua_pushstring(L, "__index"); - lua_pushlightuserdata(L, wxlBinding); - lua_pushcclosure(L, wxluabind_wxLuaBindMethod_index, 1); // push func with tag as upvalue - lua_rawset(L, -3); - lua_setmetatable(L, -2); - - return 1; - } - - return 0; - } - else if (strcmp(idx_str, "class") == 0) - { - const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlMethod); - if (c != NULL) - { - const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); - *ptr = c; - lua_newtable(L); - lua_pushstring(L, "__index"); - lua_pushlightuserdata(L, wxlBinding); - lua_pushcclosure(L, wxluabind_wxLuaBindClass_index, 1); // push func with tag as upvalue - lua_rawset(L, -3); - lua_setmetatable(L, -2); - - return 1; - } - } - else if (strcmp(idx_str, "class_name") == 0) - { - const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlMethod); - if (c != NULL) - { - lua_pushstring(L, c->name); - return 1; - } - } - } - - return 0; - } - - //----------------------------------------------------------------------------- - // wxluabind_wxLuaBindClass_index - //----------------------------------------------------------------------------- - - int LUACALL wxluabind_wxLuaBindClass_index(lua_State* L) - { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - - void **ptr = (void **)lua_touserdata(L, 1); - wxLuaBindClass* wxlClass = (wxLuaBindClass*)*ptr; - wxLuaBinding *wxlBinding = (wxLuaBinding *)lua_touserdata(L, lua_upvalueindex(1)); - - int idx_type = lua_type(L, 2); - - if (idx_type == LUA_TSTRING) - { - const char* idx_str = lua_tostring(L, 2); - - if (strcmp(idx_str, "name") == 0) - { - lua_pushstring(L, wxlClass->name); - return 1; - } - else if (strcmp(idx_str, "methods") == 0) - { - if (wxlClass->methods_n > 0) - { - wxLuaBindMethod* wxlMethod = wxlClass->methods; - size_t idx, count = wxlClass->methods_n; - lua_createtable(L, count, 0); - - for (idx = 0; idx < count; ++idx, ++wxlMethod) - { - // Force the baseclass methods to be found - //wxLuaBinding::GetClassMethod(wxlClass, wxlMethod->name, true); FIXME - - // Create table { wxLuaBindClass userdata } - const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); - *ptr = wxlMethod; - lua_newtable(L); - lua_pushstring(L, "__index"); - lua_pushlightuserdata(L, wxlBinding); - lua_pushcclosure(L, wxluabind_wxLuaBindMethod_index, 1); // push func with tag as upvalue - lua_rawset(L, -3); - lua_setmetatable(L, -2); - - lua_rawseti(L, -2, idx + 1); - } - - lua_pushstring(L, "wxLuaBindClass"); // so we know where this came from - lua_pushvalue(L, 1); - lua_rawset(L, -3); - - return 1; - } - - return 0; - } - else if (strcmp(idx_str, "methods_n") == 0) - { - lua_pushnumber(L, wxlClass->methods_n); - return 1; - } - else if (strcmp(idx_str, "classInfo") == 0) - { - if (wxlClass->classInfo) - { - const wxLuaBindClass* classInfoClass = wxlState.GetLuaClass("wxClassInfo"); - if (classInfoClass) - { - wxlState.PushUserDataType(*classInfoClass->class_tag, wxlClass->classInfo); - return 1; - } - } - - return 0; - } - else if (strcmp(idx_str, "class_tag") == 0) - { - lua_pushnumber(L, *wxlClass->class_tag); - return 1; - } - else if (strcmp(idx_str, "baseclassName") == 0) - { - lua_pushstring(L, wxlClass->baseclassName); - return 1; - } - else if (strcmp(idx_str, "baseclass") == 0) - { - if (wxlClass->baseclass) - { - const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); - *ptr = wxlClass->baseclass; - lua_newtable(L); - lua_pushstring(L, "__index"); - lua_pushlightuserdata(L, wxlBinding); - lua_pushcclosure(L, wxluabind_wxLuaBindClass_index, 1); // push func with tag as upvalue - lua_rawset(L, -3); - lua_setmetatable(L, -2); - - return 1; - } - - return 0; - } - else if (strcmp(idx_str, "enums") == 0) - { - if (wxlClass->enums_n > 0) - { - wxLuaBindDefine* wxlDefine = wxlClass->enums; - size_t idx, count = wxlClass->enums_n; - lua_createtable(L, count, 0); - - for (idx = 0; idx < count; ++idx, ++wxlDefine) - { - // Create table { name, value } - lua_createtable(L, 0, 2); - lua_pushstring(L, "name"); - lua_pushstring(L, wxlDefine->name); - lua_rawset(L, -3); - lua_pushstring(L, "value"); - lua_pushnumber(L, wxlDefine->value); - lua_rawset(L, -3); - - lua_rawseti(L, -2, idx + 1); - } - - lua_pushstring(L, "wxLuaBindClass"); // so we know where this came from - lua_pushvalue(L, 1); - lua_rawset(L, -3); - - return 1; - } - - return 0; - } - else if (strcmp(idx_str, "enums_n") == 0) - { - lua_pushnumber(L, wxlClass->enums_n); - return 1; - } - } - - return 0; - } - - //----------------------------------------------------------------------------- - // wxluabind_wxLuaBinding_index - //----------------------------------------------------------------------------- - - int LUACALL wxluabind_wxLuaBinding_index(lua_State* L) - { - wxLuaState wxlState(L); - wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - - void **ptr = (void **)lua_touserdata(L, 1); - wxLuaBinding* wxlBinding = (wxLuaBinding*)*ptr; - - int idx_type = lua_type(L, 2); - - if (idx_type == LUA_TSTRING) - { - const char* idx_str = lua_tostring(L, 2); - - if (strcmp(idx_str, "GetBindingName") == 0) - { - lua_pushstring(L, wx2lua(wxlBinding->GetBindingName())); - return 1; - } - else if (strcmp(idx_str, "GetLuaNamespace") == 0) - { - lua_pushstring(L, wx2lua(wxlBinding->GetLuaNamespace())); - return 1; - } - else if (strcmp(idx_str, "GetClassCount") == 0) - { - lua_pushnumber(L, wxlBinding->GetClassCount()); - return 1; - } - else if (strcmp(idx_str, "GetDefineCount") == 0) - { - lua_pushnumber(L, wxlBinding->GetDefineCount()); - return 1; - } - else if (strcmp(idx_str, "GetStringCount") == 0) - { - lua_pushnumber(L, wxlBinding->GetStringCount()); - return 1; - } - else if (strcmp(idx_str, "GetEventCount") == 0) - { - lua_pushnumber(L, wxlBinding->GetEventCount()); - return 1; - } - else if (strcmp(idx_str, "GetObjectCount") == 0) - { - lua_pushnumber(L, wxlBinding->GetObjectCount()); - return 1; - } - else if (strcmp(idx_str, "GetFunctionCount") == 0) - { - lua_pushnumber(L, wxlBinding->GetFunctionCount()); - return 1; - } - else if (strcmp(idx_str, "GetClassArray") == 0) - { - wxLuaBindClass* wxlClass = wxlBinding->GetClassArray(); - size_t idx, count = wxlBinding->GetClassCount(); - lua_createtable(L, count, 0); - - for (idx = 0; idx < count; ++idx, ++wxlClass) - { - // Create table { wxLuaBindClass userdata } - const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); - *ptr = wxlClass; - lua_newtable(L); - lua_pushstring(L, "__index"); - lua_pushlightuserdata(L, wxlBinding); - lua_pushcclosure(L, wxluabind_wxLuaBindClass_index, 1); // push func with tag as upvalue - lua_rawset(L, -3); - lua_setmetatable(L, -2); - - lua_rawseti(L, -2, idx + 1); - } - - return 1; - } - else if (strcmp(idx_str, "GetFunctionArray") == 0) - { - wxLuaBindMethod* wxlMethod = wxlBinding->GetFunctionArray(); - size_t idx, count = wxlBinding->GetFunctionCount(); - lua_createtable(L, count, 0); - - for (idx = 0; idx < count; ++idx, ++wxlMethod) - { - // Create table { wxLuaBindClass userdata } - const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); - *ptr = wxlMethod; - lua_newtable(L); - lua_pushstring(L, "__index"); - lua_pushlightuserdata(L, wxlBinding); - lua_pushcclosure(L, wxluabind_wxLuaBindMethod_index, 1); // push func with tag as upvalue - lua_rawset(L, -3); - lua_setmetatable(L, -2); - - lua_rawseti(L, -2, idx + 1); - } - - return 1; - } - else if (strcmp(idx_str, "GetDefineArray") == 0) - { - wxLuaBindDefine* wxlDefine = wxlBinding->GetDefineArray(); - size_t idx, count = wxlBinding->GetDefineCount(); - lua_createtable(L, count, 0); - - for (idx = 0; idx < count; ++idx, ++wxlDefine) - { - // Create table { name, value } - lua_createtable(L, 0, 2); - lua_pushstring(L, "name"); - lua_pushstring(L, wxlDefine->name); - lua_rawset(L, -3); - lua_pushstring(L, "value"); - lua_pushnumber(L, wxlDefine->value); - lua_rawset(L, -3); - - lua_rawseti(L, -2, idx + 1); - } - - return 1; - } - else if (strcmp(idx_str, "GetStringArray") == 0) - { - wxLuaBindString* wxlString = wxlBinding->GetStringArray(); - size_t idx, count = wxlBinding->GetStringCount(); - lua_createtable(L, count, 0); - - for (idx = 0; idx < count; ++idx, ++wxlString) - { - // Create table { name, value } - lua_createtable(L, 0, 2); - lua_pushstring(L, "name"); - lua_pushstring(L, wxlString->name); - lua_rawset(L, -3); - lua_pushstring(L, "value"); - lua_pushstring(L, wx2lua(wxlString->value)); - lua_rawset(L, -3); - - lua_rawseti(L, -2, idx + 1); - } - - return 1; - } - else if (strcmp(idx_str, "GetEventArray") == 0) - { - wxLuaBindEvent* wxlEvent = wxlBinding->GetEventArray(); - size_t idx, count = wxlBinding->GetEventCount(); - lua_createtable(L, count, 0); - - for (idx = 0; idx < count; ++idx, ++wxlEvent) - { - // Create table { name, eventType, class_tag } - lua_createtable(L, 0, 3); - lua_pushstring(L, "name"); - lua_pushstring(L, wxlEvent->name); - lua_rawset(L, -3); - lua_pushstring(L, "eventType"); - lua_pushnumber(L, *wxlEvent->eventType); - lua_rawset(L, -3); - lua_pushstring(L, "class_tag"); - lua_pushnumber(L, *wxlEvent->class_tag); - lua_rawset(L, -3); - - lua_rawseti(L, -2, idx + 1); - } - - return 1; - } - else if (strcmp(idx_str, "GetObjectArray") == 0) - { - wxLuaBindObject* wxlObject = wxlBinding->GetObjectArray(); - size_t idx, count = wxlBinding->GetObjectCount(); - lua_createtable(L, count, 0); - - for (idx = 0; idx < count; ++idx, ++wxlObject) - { - // Create table { name, object, class_tag } - lua_createtable(L, 0, 3); - lua_pushstring(L, "name"); - lua_pushstring(L, wxlObject->name); - lua_rawset(L, -3); - - lua_pushstring(L, "object"); - if (wxlObject->objPtr != 0) - wxlState.tpushusertag(wxlObject->objPtr, *wxlObject->class_tag); - else - wxlState.tpushusertag(*wxlObject->pObjPtr, *wxlObject->class_tag); - lua_rawset(L, -3); - - lua_pushstring(L, "class_tag"); - lua_pushnumber(L, *wxlObject->class_tag); - lua_rawset(L, -3); - - lua_rawseti(L, -2, idx + 1); - } - - return 1; - } - } - - return 0; - } --- 1132,1133 ---- Index: wxlua_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlua_bind.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxlua_bind.cpp 16 Jun 2007 06:21:46 -0000 1.4 --- wxlua_bind.cpp 28 Jun 2007 21:52:57 -0000 1.5 *************** *** 150,153 **** --- 150,750 ---- static wxLuaBindCFunc s_wxluafunc_wxLua_function_CompileLuaScript[1] = {{ wxLua_function_CompileLuaScript, WXLUAMETHOD_CFUNCTION, 2, 2, s_wxluatagArray_wxLua_function_CompileLuaScript }}; + // %override wxLua_function_GetBindings + + int LUACALL wxluabind_wxLuaBinding__index(lua_State* L); + + // %function LuaTable GetBindings() + static int LUACALL wxLua_function_GetBindings(lua_State *L) + { + wxLuaState wxlState(L); + lua_newtable(L); // the table that we return + + int idx = 1; + wxLuaBindingList::compatibility_iterator node; + for (node = wxlState.GetLuaBindingList()->GetFirst(); node; node = node->GetNext(), idx++) + { + wxLuaBinding* binding = node->GetData(); + + lua_createtable(L, 3, 0); // sub table item for each binding + + lua_pushstring(L, "name"); + lua_pushstring(L, wx2lua(binding->GetBindingName())); + lua_rawset(L, -3); + + lua_pushstring(L, "namespace"); + lua_pushstring(L, wx2lua(binding->GetLuaNamespace())); + lua_rawset(L, -3); + + // Push function to access the binding info + lua_pushstring(L, "binding"); + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = binding; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, binding); // push tag to recognize table call + lua_pushcclosure(L, wxluabind_wxLuaBinding__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + + //lua_pushstring(L, "__metatable"); + //lua_pushstring(L, "Metatable is not accessible"); + //lua_rawset(L, -3); + + lua_setmetatable(L, -2); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx); + } + + return 1; + } + + //----------------------------------------------------------------------------- + // wxluabind_wxLuaBindCFunc__index + //----------------------------------------------------------------------------- + int LUACALL wxluabind_wxLuaBindClass__index(lua_State* L); + + int LUACALL wxluabind_wxLuaBindCFunc__index(lua_State* L) + { + wxLuaState wxlState(L); + wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); + + void **ptr = (void **)lua_touserdata(L, 1); + wxLuaBindCFunc* wxlCFunc= (wxLuaBindCFunc*)*ptr; + wxLuaBinding *wxlBinding = (wxLuaBinding *)lua_touserdata(L, lua_upvalueindex(1)); + + int idx_type = lua_type(L, 2); + + if (idx_type == LUA_TSTRING) + { + const char* idx_str = lua_tostring(L, 2); + + if (strcmp(idx_str, "func") == 0) + { + lua_pushcfunction(L, wxlCFunc->func); + return 1; + } + else if (strcmp(idx_str, "type") == 0) + { + lua_pushnumber(L, wxlCFunc->type); + return 1; + } + else if (strcmp(idx_str, "minargs") == 0) + { + lua_pushnumber(L, wxlCFunc->minargs); + return 1; + } + else if (strcmp(idx_str, "maxargs") == 0) + { + lua_pushnumber(L, wxlCFunc->maxargs); + return 1; + } + else if (strcmp(idx_str, "argtags") == 0) + { + size_t idx, count = wxlCFunc->maxargs; + lua_createtable(L, count, 0); + + // check for terminating null argtag + for (idx = 0; (idx < count) && wxlCFunc->argtags[idx]; ++idx) + { + lua_pushnumber(L, *wxlCFunc->argtags[idx]); + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "class") == 0) + { + const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlCFunc); + if (c != NULL) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = c; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindClass__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + return 1; + } + } + else if (strcmp(idx_str, "class_name") == 0) + { + const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlCFunc); + if (c != NULL) + { + lua_pushstring(L, c->name); + return 1; + } + } + } + + return 0; + } + + //----------------------------------------------------------------------------- + // wxluabind_wxLuaBindMethod__index + //----------------------------------------------------------------------------- + + int LUACALL wxluabind_wxLuaBindMethod__index(lua_State* L) + { + wxLuaState wxlState(L); + wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); + + void **ptr = (void **)lua_touserdata(L, 1); + wxLuaBindMethod* wxlMethod = (wxLuaBindMethod*)*ptr; + wxLuaBinding *wxlBinding = (wxLuaBinding *)lua_touserdata(L, lua_upvalueindex(1)); + + int idx_type = lua_type(L, 2); + + if (idx_type == LUA_TSTRING) + { + const char* idx_str = lua_tostring(L, 2); + + if (strcmp(idx_str, "name") == 0) + { + lua_pushstring(L, wxlMethod->name); + return 1; + } + else if (strcmp(idx_str, "type") == 0) + { + lua_pushnumber(L, wxlMethod->type); + return 1; + } + else if (strcmp(idx_str, "funcs") == 0) + { + wxLuaBindCFunc* wxlCFunc = wxlMethod->funcs; + size_t idx, count = wxlMethod->funcs_n; + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlCFunc) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlCFunc; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindCFunc__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "funcs_n") == 0) + { + lua_pushnumber(L, wxlMethod->funcs_n); + return 1; + } + else if (strcmp(idx_str, "basemethod") == 0) + { + if (wxlMethod->basemethod) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlMethod->basemethod; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindMethod__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + return 1; + } + + return 0; + } + else if (strcmp(idx_str, "class") == 0) + { + const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlMethod); + if (c != NULL) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = c; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindClass__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + return 1; + } + } + else if (strcmp(idx_str, "class_name") == 0) + { + const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlMethod); + if (c != NULL) + { + lua_pushstring(L, c->name); + return 1; + } + } + } + + return 0; + } + + //----------------------------------------------------------------------------- + // wxluabind_wxLuaBindClass__index + //----------------------------------------------------------------------------- + + int LUACALL wxluabind_wxLuaBindClass__index(lua_State* L) + { + wxLuaState wxlState(L); + wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); + + void **ptr = (void **)lua_touserdata(L, 1); + wxLuaBindClass* wxlClass = (wxLuaBindClass*)*ptr; + wxLuaBinding *wxlBinding = (wxLuaBinding *)lua_touserdata(L, lua_upvalueindex(1)); + + int idx_type = lua_type(L, 2); + + if (idx_type == LUA_TSTRING) + { + const char* idx_str = lua_tostring(L, 2); + + if (strcmp(idx_str, "name") == 0) + { + lua_pushstring(L, wxlClass->name); + return 1; + } + else if (strcmp(idx_str, "methods") == 0) + { + if (wxlClass->methods_n > 0) + { + wxLuaBindMethod* wxlMethod = wxlClass->methods; + size_t idx, count = wxlClass->methods_n; + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlMethod) + { + // Force the baseclass methods to be found + //wxLuaBinding::GetClassMethod(wxlClass, wxlMethod->name, true); FIXME + + // Create table { wxLuaBindClass userdata } + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlMethod; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindMethod__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + lua_rawseti(L, -2, idx + 1); + } + + lua_pushstring(L, "wxLuaBindClass"); // so we know where this came from + lua_pushvalue(L, 1); + lua_rawset(L, -3); + + return 1; + } + + return 0; + } + else if (strcmp(idx_str, "methods_n") == 0) + { + lua_pushnumber(L, wxlClass->methods_n); + return 1; + } + else if (strcmp(idx_str, "classInfo") == 0) + { + if (wxlClass->classInfo) + { + const wxLuaBindClass* classInfoClass = wxlState.GetLuaClass("wxClassInfo"); + if (classInfoClass) + { + wxlState.PushUserDataType(*classInfoClass->class_tag, wxlClass->classInfo); + return 1; + } + } + + return 0; + } + else if (strcmp(idx_str, "class_tag") == 0) + { + lua_pushnumber(L, *wxlClass->class_tag); + return 1; + } + else if (strcmp(idx_str, "baseclassName") == 0) + { + lua_pushstring(L, wxlClass->baseclassName); + return 1; + } + else if (strcmp(idx_str, "baseclass") == 0) + { + if (wxlClass->baseclass) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlClass->baseclass; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindClass__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + return 1; + } + + return 0; + } + else if (strcmp(idx_str, "enums") == 0) + { + if (wxlClass->enums_n > 0) + { + wxLuaBindDefine* wxlDefine = wxlClass->enums; + size_t idx, count = wxlClass->enums_n; + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlDefine) + { + // Create table { name, value } + lua_createtable(L, 0, 2); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlDefine->name); + lua_rawset(L, -3); + lua_pushstring(L, "value"); + lua_pushnumber(L, wxlDefine->value); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + lua_pushstring(L, "wxLuaBindClass"); // so we know where this came from + lua_pushvalue(L, 1); + lua_rawset(L, -3); + + return 1; + } + + return 0; + } + else if (strcmp(idx_str, "enums_n") == 0) + { + lua_pushnumber(L, wxlClass->enums_n); + return 1; + } + } + + return 0; + } + + //----------------------------------------------------------------------------- + // wxluabind_wxLuaBinding__index + //----------------------------------------------------------------------------- + + int LUACALL wxluabind_wxLuaBinding__index(lua_State* L) + { + wxLuaState wxlState(L); + wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); + + void **ptr = (void **)lua_touserdata(L, 1); + wxLuaBinding* wxlBinding = (wxLuaBinding*)*ptr; + + int idx_type = lua_type(L, 2); + + if (idx_type == LUA_TSTRING) + { + const char* idx_str = lua_tostring(L, 2); + + if (strcmp(idx_str, "GetBindingName") == 0) + { + lua_pushstring(L, wx2lua(wxlBinding->GetBindingName())); + return 1; + } + else if (strcmp(idx_str, "GetLuaNamespace") == 0) + { + lua_pushstring(L, wx2lua(wxlBinding->GetLuaNamespace())); + return 1; + } + else if (strcmp(idx_str, "GetClassCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetClassCount()); + return 1; + } + else if (strcmp(idx_str, "GetDefineCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetDefineCount()); + return 1; + } + else if (strcmp(idx_str, "GetStringCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetStringCount()); + return 1; + } + else if (strcmp(idx_str, "GetEventCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetEventCount()); + return 1; + } + else if (strcmp(idx_str, "GetObjectCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetObjectCount()); + return 1; + } + else if (strcmp(idx_str, "GetFunctionCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetFunctionCount()); + return 1; + } + else if (strcmp(idx_str, "GetClassArray") == 0) + { + wxLuaBindClass* wxlClass = wxlBinding->GetClassArray(); + size_t idx, count = wxlBinding->GetClassCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlClass) + { + // Create table { wxLuaBindClass userdata } + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlClass; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindClass__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetFunctionArray") == 0) + { + wxLuaBindMethod* wxlMethod = wxlBinding->GetFunctionArray(); + size_t idx, count = wxlBinding->GetFunctionCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlMethod) + { + // Create table { wxLuaBindClass userdata } + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlMethod; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindMethod__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetDefineArray") == 0) + { + wxLuaBindDefine* wxlDefine = wxlBinding->GetDefineArray(); + size_t idx, count = wxlBinding->GetDefineCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlDefine) + { + // Create table { name, value } + lua_createtable(L, 0, 2); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlDefine->name); + lua_rawset(L, -3); + lua_pushstring(L, "value"); + lua_pushnumber(L, wxlDefine->value); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetStringArray") == 0) + { + wxLuaBindString* wxlString = wxlBinding->GetStringArray(); + size_t idx, count = wxlBinding->GetStringCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlString) + { + // Create table { name, value } + lua_createtable(L, 0, 2); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlString->name); + lua_rawset(L, -3); + lua_pushstring(L, "value"); + lua_pushstring(L, wx2lua(wxlString->value)); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetEventArray") == 0) + { + wxLuaBindEvent* wxlEvent = wxlBinding->GetEventArray(); + size_t idx, count = wxlBinding->GetEventCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlEvent) + { + // Create table { name, eventType, class_tag } + lua_createtable(L, 0, 3); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlEvent->name); + lua_rawset(L, -3); + lua_pushstring(L, "eventType"); + lua_pushnumber(L, *wxlEvent->eventType); + lua_rawset(L, -3); + lua_pushstring(L, "class_tag"); + lua_pushnumber(L, *wxlEvent->class_tag); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetObjectArray") == 0) + { + wxLuaBindObject* wxlObject = wxlBinding->GetObjectArray(); + size_t idx, count = wxlBinding->GetObjectCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlObject) + { + // Create table { name, object, class_tag } + lua_createtable(L, 0, 3); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlObject->name); + lua_rawset(L, -3); + + lua_pushstring(L, "object"); + if (wxlObject->objPtr != 0) + wxlState.tpushusertag(wxlObject->objPtr, *wxlObject->class_tag); + else + wxlState.tpushusertag(*wxlObject->pObjPtr, *wxlObject->class_tag); + lua_rawset(L, -3); + + lua_pushstring(L, "class_tag"); + lua_pushnumber(L, *wxlObject->class_tag); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + } + + return 0; + } + + + static wxLuaBindCFunc s_wxluafunc_wxLua_function_GetBindings[1] = {{ wxLua_function_GetBindings, WXLUAMETHOD_CFUNCTION, 0, 0, s_wxluaargArray_None }}; + // %override wxLua_function_GetTrackedEventCallbacks // %function LuaTable GetTrackedEventCallbacks() *************** *** 311,314 **** --- 908,912 ---- { { "CompileLuaScript", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_CompileLuaScript, 1, NULL }, + { "GetBindings", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_GetBindings, 1, NULL }, { "GetTrackedEventCallbacks", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_GetTrackedEventCallbacks, 1, NULL }, { "GetTrackedTopLevelWindows", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_GetTrackedTopLevelWindows, 1, NULL }, |
From: John L. <jr...@us...> - 2007-06-28 21:53:00
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19412/wxLua/samples Modified Files: bindings.wx.lua Log Message: Moved the bindings function for introspection in lua into the override.hpp file for the wxlua bindings. Add function wxlua.GetBindings() instead of install wxLuaBinding_XXX per binding. Index: bindings.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/bindings.wx.lua,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** bindings.wx.lua 27 Jun 2007 19:56:30 -0000 1.12 --- bindings.wx.lua 28 Jun 2007 21:52:57 -0000 1.13 *************** *** 106,110 **** -- Call DumpBindingInfo(...) on the binding you want to show ! --DumpBindingInfo(wx.wxLuaBinding_wx) -- ---------------------------------------------------------------------------- --- 106,110 ---- -- Call DumpBindingInfo(...) on the binding you want to show ! --DumpBindingInfo(wxlua.GetBindings()[1]) -- ---------------------------------------------------------------------------- *************** *** 146,150 **** -- ["list_item"] = last selected list item or nil if not set ! bindingList = {} -- Table of {"name space", "wxLuaBinding_XXX function"} -- ---------------------------------------------------------------------------- --- 146,150 ---- -- ["list_item"] = last selected list item or nil if not set ! bindingList = wxlua.GetBindings() -- Table of {"name", "namespace", "wxLuaBinding function"} -- ---------------------------------------------------------------------------- *************** *** 155,173 **** -- ---------------------------------------------------------------------------- - -- Find the bindings installed into wxLua, tables that might have wxLuaBinding_ - -- ---------------------------------------------------------------------------- - wxlua_tables = { "wxlua", "wx", "wxstc" } - - for i = 1, #wxlua_tables do - if _G[wxlua_tables[i]] then - for k, v in pairs(_G[wxlua_tables[i]]) do - if string.find(k, "wxLuaBinding_", 1, 1) then - table.insert(bindingList, {wxlua_tables[i], k}) - end - end - end - end - - -- ---------------------------------------------------------------------------- -- Save the current listctrl settings into the listColWidths table -- ---------------------------------------------------------------------------- --- 155,158 ---- *************** *** 763,769 **** GotoBindingLevel(listCtrl, list_level) else ! local binding = _G ! binding = binding[listData[1][data_index][2]] ! binding = binding[listData[1][data_index][1]] listData[2] = { --- 748,752 ---- GotoBindingLevel(listCtrl, list_level) else ! local binding = data[data_index].binding listData[2] = { *************** *** 973,980 **** for b = 1, #bindingList do ! local binding = _G ! for i = 1, #bindingList[b] do ! binding = binding[bindingList[b][i]] ! end local classTable = binding.GetClassArray --- 956,960 ---- for b = 1, #bindingList do ! local binding = bindingList[b].binding local classTable = binding.GetClassArray *************** *** 1071,1078 **** for b = 1, #bindingList do ! local binding = _G ! for i = 1, #bindingList[b] do ! binding = binding[bindingList[b][i]] ! end local classTable = binding.GetClassArray --- 1051,1055 ---- for b = 1, #bindingList do ! local binding = bindingList[b].binding local classTable = binding.GetClassArray *************** *** 1165,1172 **** for b = 1, #bindingList do ! local binding = _G ! for i = 1, #bindingList[b] do ! binding = binding[bindingList[b][i]] ! end local classTable = binding.GetClassArray --- 1142,1146 ---- for b = 1, #bindingList do ! local binding = bindingList[b].binding local classTable = binding.GetClassArray *************** *** 1327,1331 **** -- Add the binding that are installed {"wxLuaBinding_wx", "wx", ["icon"] = list_images.folder }, for i = 1, #bindingList do ! table.insert(listData[1], {bindingList[i][2], bindingList[i][1], ["icon"] = list_images.folder }) end --- 1301,1305 ---- -- Add the binding that are installed {"wxLuaBinding_wx", "wx", ["icon"] = list_images.folder }, for i = 1, #bindingList do ! table.insert(listData[1], { "Binding Name : "..bindingList[i].name, "Namespace : "..bindingList[i].namespace, ["icon"] = list_images.folder, ["binding"] = bindingList[i].binding }) end |
From: John L. <jr...@us...> - 2007-06-28 21:53:00
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19412/wxLua/bindings/wxlua Modified Files: override.hpp wxlua.i Log Message: Moved the bindings function for introspection in lua into the override.hpp file for the wxlua bindings. Add function wxlua.GetBindings() instead of install wxLuaBinding_XXX per binding. Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/wxlua.i,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxlua.i 17 Jun 2007 17:17:36 -0000 1.4 --- wxlua.i 28 Jun 2007 21:52:55 -0000 1.5 *************** *** 100,116 **** // --------------------------------------------------------------------------- ! // wxLuaBinding - This is NOT wrapped, but implemented in wxlbind.cpp // These items follow the structure below and ALL items are called as if they // were table members. ! // Example : wxLuaBinding_wx.GetClassCount ! // Example : print(wxLuaBinding_wx.GetClassArray[1].methods[1].name) // Note: Use only '.' and NO () to make it a function call, also check to see ! // if the item exists first (unlike the example above)! // Please see the bindings.wx.lua sample program for usage. /* ! %class wxLuaBinding_XXX - where XXX is the name of the binding // No constructor as this is read only --- 100,124 ---- // --------------------------------------------------------------------------- ! // wxLuaBinding - These are not wrapped in the standard way, but coded by hand ! // for size. // These items follow the structure below and ALL items are called as if they // were table members. ! // Example : print(wxlua.GetBindings()[1].binding.GetClassCount) ! // Example : print(wxlua.GetBindings()[1].binding.GetClassArray[1].methods[1].name) // Note: Use only '.' and NO () to make it a function call, also check to see ! // if the item exists first (unlike the example above)! ! // Also, you probably want to store the returned tables and get the values from ! // them instead of getting the whole table every time from wxlua.GetBindings()... // Please see the bindings.wx.lua sample program for usage. + // Entry point to get the objects below. + // returns an array of tables for each installed binding + // { ["name"]=GetBindingName, ["namespace"]=GetLuaNamespace, ["binding"]=wxLuaBinding* } + %function LuaTable GetBindings() + /* ! %class wxLuaBinding // No constructor as this is read only Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/override.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** override.hpp 16 Jun 2007 06:21:42 -0000 1.3 --- override.hpp 28 Jun 2007 21:52:55 -0000 1.4 *************** *** 158,161 **** --- 158,764 ---- %end + // =========================================================================== + // =========================================================================== + + %override wxLua_function_GetBindings + + int LUACALL wxluabind_wxLuaBinding__index(lua_State* L); + + // %function LuaTable GetBindings() + static int LUACALL wxLua_function_GetBindings(lua_State *L) + { + wxLuaState wxlState(L); + lua_newtable(L); // the table that we return + + int idx = 1; + wxLuaBindingList::compatibility_iterator node; + for (node = wxlState.GetLuaBindingList()->GetFirst(); node; node = node->GetNext(), idx++) + { + wxLuaBinding* binding = node->GetData(); + + lua_createtable(L, 3, 0); // sub table item for each binding + + lua_pushstring(L, "name"); + lua_pushstring(L, wx2lua(binding->GetBindingName())); + lua_rawset(L, -3); + + lua_pushstring(L, "namespace"); + lua_pushstring(L, wx2lua(binding->GetLuaNamespace())); + lua_rawset(L, -3); + + // Push function to access the binding info + lua_pushstring(L, "binding"); + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = binding; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, binding); // push tag to recognize table call + lua_pushcclosure(L, wxluabind_wxLuaBinding__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + + //lua_pushstring(L, "__metatable"); + //lua_pushstring(L, "Metatable is not accessible"); + //lua_rawset(L, -3); + + lua_setmetatable(L, -2); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx); + } + + return 1; + } + + //----------------------------------------------------------------------------- + // wxluabind_wxLuaBindCFunc__index + //----------------------------------------------------------------------------- + int LUACALL wxluabind_wxLuaBindClass__index(lua_State* L); + + int LUACALL wxluabind_wxLuaBindCFunc__index(lua_State* L) + { + wxLuaState wxlState(L); + wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); + + void **ptr = (void **)lua_touserdata(L, 1); + wxLuaBindCFunc* wxlCFunc= (wxLuaBindCFunc*)*ptr; + wxLuaBinding *wxlBinding = (wxLuaBinding *)lua_touserdata(L, lua_upvalueindex(1)); + + int idx_type = lua_type(L, 2); + + if (idx_type == LUA_TSTRING) + { + const char* idx_str = lua_tostring(L, 2); + + if (strcmp(idx_str, "func") == 0) + { + lua_pushcfunction(L, wxlCFunc->func); + return 1; + } + else if (strcmp(idx_str, "type") == 0) + { + lua_pushnumber(L, wxlCFunc->type); + return 1; + } + else if (strcmp(idx_str, "minargs") == 0) + { + lua_pushnumber(L, wxlCFunc->minargs); + return 1; + } + else if (strcmp(idx_str, "maxargs") == 0) + { + lua_pushnumber(L, wxlCFunc->maxargs); + return 1; + } + else if (strcmp(idx_str, "argtags") == 0) + { + size_t idx, count = wxlCFunc->maxargs; + lua_createtable(L, count, 0); + + // check for terminating null argtag + for (idx = 0; (idx < count) && wxlCFunc->argtags[idx]; ++idx) + { + lua_pushnumber(L, *wxlCFunc->argtags[idx]); + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "class") == 0) + { + const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlCFunc); + if (c != NULL) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = c; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindClass__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + return 1; + } + } + else if (strcmp(idx_str, "class_name") == 0) + { + const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlCFunc); + if (c != NULL) + { + lua_pushstring(L, c->name); + return 1; + } + } + } + + return 0; + } + + //----------------------------------------------------------------------------- + // wxluabind_wxLuaBindMethod__index + //----------------------------------------------------------------------------- + + int LUACALL wxluabind_wxLuaBindMethod__index(lua_State* L) + { + wxLuaState wxlState(L); + wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); + + void **ptr = (void **)lua_touserdata(L, 1); + wxLuaBindMethod* wxlMethod = (wxLuaBindMethod*)*ptr; + wxLuaBinding *wxlBinding = (wxLuaBinding *)lua_touserdata(L, lua_upvalueindex(1)); + + int idx_type = lua_type(L, 2); + + if (idx_type == LUA_TSTRING) + { + const char* idx_str = lua_tostring(L, 2); + + if (strcmp(idx_str, "name") == 0) + { + lua_pushstring(L, wxlMethod->name); + return 1; + } + else if (strcmp(idx_str, "type") == 0) + { + lua_pushnumber(L, wxlMethod->type); + return 1; + } + else if (strcmp(idx_str, "funcs") == 0) + { + wxLuaBindCFunc* wxlCFunc = wxlMethod->funcs; + size_t idx, count = wxlMethod->funcs_n; + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlCFunc) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlCFunc; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindCFunc__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "funcs_n") == 0) + { + lua_pushnumber(L, wxlMethod->funcs_n); + return 1; + } + else if (strcmp(idx_str, "basemethod") == 0) + { + if (wxlMethod->basemethod) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlMethod->basemethod; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindMethod__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + return 1; + } + + return 0; + } + else if (strcmp(idx_str, "class") == 0) + { + const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlMethod); + if (c != NULL) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = c; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindClass__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + return 1; + } + } + else if (strcmp(idx_str, "class_name") == 0) + { + const wxLuaBindClass* c = wxlBinding->GetLuaClass(wxlMethod); + if (c != NULL) + { + lua_pushstring(L, c->name); + return 1; + } + } + } + + return 0; + } + + //----------------------------------------------------------------------------- + // wxluabind_wxLuaBindClass__index + //----------------------------------------------------------------------------- + + int LUACALL wxluabind_wxLuaBindClass__index(lua_State* L) + { + wxLuaState wxlState(L); + wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); + + void **ptr = (void **)lua_touserdata(L, 1); + wxLuaBindClass* wxlClass = (wxLuaBindClass*)*ptr; + wxLuaBinding *wxlBinding = (wxLuaBinding *)lua_touserdata(L, lua_upvalueindex(1)); + + int idx_type = lua_type(L, 2); + + if (idx_type == LUA_TSTRING) + { + const char* idx_str = lua_tostring(L, 2); + + if (strcmp(idx_str, "name") == 0) + { + lua_pushstring(L, wxlClass->name); + return 1; + } + else if (strcmp(idx_str, "methods") == 0) + { + if (wxlClass->methods_n > 0) + { + wxLuaBindMethod* wxlMethod = wxlClass->methods; + size_t idx, count = wxlClass->methods_n; + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlMethod) + { + // Force the baseclass methods to be found + //wxLuaBinding::GetClassMethod(wxlClass, wxlMethod->name, true); FIXME + + // Create table { wxLuaBindClass userdata } + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlMethod; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindMethod__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + lua_rawseti(L, -2, idx + 1); + } + + lua_pushstring(L, "wxLuaBindClass"); // so we know where this came from + lua_pushvalue(L, 1); + lua_rawset(L, -3); + + return 1; + } + + return 0; + } + else if (strcmp(idx_str, "methods_n") == 0) + { + lua_pushnumber(L, wxlClass->methods_n); + return 1; + } + else if (strcmp(idx_str, "classInfo") == 0) + { + if (wxlClass->classInfo) + { + const wxLuaBindClass* classInfoClass = wxlState.GetLuaClass("wxClassInfo"); + if (classInfoClass) + { + wxlState.PushUserDataType(*classInfoClass->class_tag, wxlClass->classInfo); + return 1; + } + } + + return 0; + } + else if (strcmp(idx_str, "class_tag") == 0) + { + lua_pushnumber(L, *wxlClass->class_tag); + return 1; + } + else if (strcmp(idx_str, "baseclassName") == 0) + { + lua_pushstring(L, wxlClass->baseclassName); + return 1; + } + else if (strcmp(idx_str, "baseclass") == 0) + { + if (wxlClass->baseclass) + { + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlClass->baseclass; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindClass__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + return 1; + } + + return 0; + } + else if (strcmp(idx_str, "enums") == 0) + { + if (wxlClass->enums_n > 0) + { + wxLuaBindDefine* wxlDefine = wxlClass->enums; + size_t idx, count = wxlClass->enums_n; + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlDefine) + { + // Create table { name, value } + lua_createtable(L, 0, 2); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlDefine->name); + lua_rawset(L, -3); + lua_pushstring(L, "value"); + lua_pushnumber(L, wxlDefine->value); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + lua_pushstring(L, "wxLuaBindClass"); // so we know where this came from + lua_pushvalue(L, 1); + lua_rawset(L, -3); + + return 1; + } + + return 0; + } + else if (strcmp(idx_str, "enums_n") == 0) + { + lua_pushnumber(L, wxlClass->enums_n); + return 1; + } + } + + return 0; + } + + //----------------------------------------------------------------------------- + // wxluabind_wxLuaBinding__index + //----------------------------------------------------------------------------- + + int LUACALL wxluabind_wxLuaBinding__index(lua_State* L) + { + wxLuaState wxlState(L); + wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); + + void **ptr = (void **)lua_touserdata(L, 1); + wxLuaBinding* wxlBinding = (wxLuaBinding*)*ptr; + + int idx_type = lua_type(L, 2); + + if (idx_type == LUA_TSTRING) + { + const char* idx_str = lua_tostring(L, 2); + + if (strcmp(idx_str, "GetBindingName") == 0) + { + lua_pushstring(L, wx2lua(wxlBinding->GetBindingName())); + return 1; + } + else if (strcmp(idx_str, "GetLuaNamespace") == 0) + { + lua_pushstring(L, wx2lua(wxlBinding->GetLuaNamespace())); + return 1; + } + else if (strcmp(idx_str, "GetClassCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetClassCount()); + return 1; + } + else if (strcmp(idx_str, "GetDefineCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetDefineCount()); + return 1; + } + else if (strcmp(idx_str, "GetStringCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetStringCount()); + return 1; + } + else if (strcmp(idx_str, "GetEventCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetEventCount()); + return 1; + } + else if (strcmp(idx_str, "GetObjectCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetObjectCount()); + return 1; + } + else if (strcmp(idx_str, "GetFunctionCount") == 0) + { + lua_pushnumber(L, wxlBinding->GetFunctionCount()); + return 1; + } + else if (strcmp(idx_str, "GetClassArray") == 0) + { + wxLuaBindClass* wxlClass = wxlBinding->GetClassArray(); + size_t idx, count = wxlBinding->GetClassCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlClass) + { + // Create table { wxLuaBindClass userdata } + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlClass; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindClass__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetFunctionArray") == 0) + { + wxLuaBindMethod* wxlMethod = wxlBinding->GetFunctionArray(); + size_t idx, count = wxlBinding->GetFunctionCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlMethod) + { + // Create table { wxLuaBindClass userdata } + const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); + *ptr = wxlMethod; + lua_newtable(L); + lua_pushstring(L, "__index"); + lua_pushlightuserdata(L, wxlBinding); + lua_pushcclosure(L, wxluabind_wxLuaBindMethod__index, 1); // push func with tag as upvalue + lua_rawset(L, -3); + lua_setmetatable(L, -2); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetDefineArray") == 0) + { + wxLuaBindDefine* wxlDefine = wxlBinding->GetDefineArray(); + size_t idx, count = wxlBinding->GetDefineCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlDefine) + { + // Create table { name, value } + lua_createtable(L, 0, 2); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlDefine->name); + lua_rawset(L, -3); + lua_pushstring(L, "value"); + lua_pushnumber(L, wxlDefine->value); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetStringArray") == 0) + { + wxLuaBindString* wxlString = wxlBinding->GetStringArray(); + size_t idx, count = wxlBinding->GetStringCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlString) + { + // Create table { name, value } + lua_createtable(L, 0, 2); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlString->name); + lua_rawset(L, -3); + lua_pushstring(L, "value"); + lua_pushstring(L, wx2lua(wxlString->value)); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetEventArray") == 0) + { + wxLuaBindEvent* wxlEvent = wxlBinding->GetEventArray(); + size_t idx, count = wxlBinding->GetEventCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlEvent) + { + // Create table { name, eventType, class_tag } + lua_createtable(L, 0, 3); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlEvent->name); + lua_rawset(L, -3); + lua_pushstring(L, "eventType"); + lua_pushnumber(L, *wxlEvent->eventType); + lua_rawset(L, -3); + lua_pushstring(L, "class_tag"); + lua_pushnumber(L, *wxlEvent->class_tag); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + else if (strcmp(idx_str, "GetObjectArray") == 0) + { + wxLuaBindObject* wxlObject = wxlBinding->GetObjectArray(); + size_t idx, count = wxlBinding->GetObjectCount(); + lua_createtable(L, count, 0); + + for (idx = 0; idx < count; ++idx, ++wxlObject) + { + // Create table { name, object, class_tag } + lua_createtable(L, 0, 3); + lua_pushstring(L, "name"); + lua_pushstring(L, wxlObject->name); + lua_rawset(L, -3); + + lua_pushstring(L, "object"); + if (wxlObject->objPtr != 0) + wxlState.tpushusertag(wxlObject->objPtr, *wxlObject->class_tag); + else + wxlState.tpushusertag(*wxlObject->pObjPtr, *wxlObject->class_tag); + lua_rawset(L, -3); + + lua_pushstring(L, "class_tag"); + lua_pushnumber(L, *wxlObject->class_tag); + lua_rawset(L, -3); + + lua_rawseti(L, -2, idx + 1); + } + + return 1; + } + } + + return 0; + } + + %end + + + // =========================================================================== + // =========================================================================== + %override wxLua_wxLuaObject_constructor // wxLuaObject(void *object) |
From: John L. <jr...@us...> - 2007-06-28 21:53:00
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19412/wxLua/docs Modified Files: wxluaref.html Log Message: Moved the bindings function for introspection in lua into the override.hpp file for the wxlua bindings. Add function wxlua.GetBindings() instead of install wxLuaBinding_XXX per binding. Index: wxluaref.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxluaref.html,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wxluaref.html 27 Jun 2007 19:56:28 -0000 1.36 --- wxluaref.html 28 Jun 2007 21:52:56 -0000 1.37 *************** *** 23255,23271 **** <br> <font color=#009900>// ---------------------------------------------------------------------------</font><br> ! <font color=#009900>// wxLuaBinding - This is NOT wrapped, but implemented in wxlbind.cpp</font><br> <br> <font color=#009900>// These items follow the structure below and ALL items are called as if they</font><br> <font color=#009900>// were table members.</font><br> ! <font color=#009900>// Example : wxLuaBinding_wx.GetClassCount</font><br> ! <font color=#009900>// Example : print(wxLuaBinding_wx.GetClassArray[1].methods[1].name)</font><br> <font color=#009900>// Note: Use only '.' and NO () to make it a function call, also check to see</font><br> ! <font color=#009900>// if the item exists first (unlike the example above)!</font><br> <font color=#009900>// Please see the bindings.wx.lua sample program for usage.</font><br> <br> <font color=#888888>/*<br> <br> ! <b><font size=+1 color=#DD0000><i>%class</i> wxLuaBinding_XXX - where XXX is the name of the <a name="binding">binding</a></font></b></font> <blockquote><font color=#888888> <font color=#009900>// No constructor as this is read only</font><br> --- 23255,23279 ---- <br> <font color=#009900>// ---------------------------------------------------------------------------</font><br> ! <font color=#009900>// wxLuaBinding - These are not wrapped in the standard way, but coded by hand</font><br> ! <font color=#009900>// for size.</font><br> <br> <font color=#009900>// These items follow the structure below and ALL items are called as if they</font><br> <font color=#009900>// were table members.</font><br> ! <font color=#009900>// Example : print(wxlua.GetBindings()[1].binding.GetClassCount)</font><br> ! <font color=#009900>// Example : print(wxlua.GetBindings()[1].binding.GetClassArray[1].methods[1].name)</font><br> <font color=#009900>// Note: Use only '.' and NO () to make it a function call, also check to see</font><br> ! <font color=#009900>// if the item exists first (unlike the example above)!</font><br> ! <font color=#009900>// Also, you probably want to store the returned tables and get the values from</font><br> ! <font color=#009900>// them instead of getting the whole table every time from wxlua.GetBindings()...</font><br> <font color=#009900>// Please see the bindings.wx.lua sample program for usage.</font><br> <br> + <font color=#009900>// Entry point to get the objects below.</font><br> + <font color=#009900>// returns an array of tables for each installed binding</font><br> + <font color=#009900>// { ["name"]=GetBindingName, ["namespace"]=GetLuaNamespace, ["binding"]=wxLuaBinding* }</font><br> + <font color=#AA0000><i>%function</i> LuaTable GetBindings()</font><br> + <br> <font color=#888888>/*<br> <br> ! <b><font size=+1 color=#DD0000><i>%class</i> <a name="wxLuaBinding">wxLuaBinding</a></font></b></font> <blockquote><font color=#888888> <font color=#009900>// No constructor as this is read only</font><br> |
From: John L. <jr...@us...> - 2007-06-28 21:53:00
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19412/wxLua/modules/wxbind/src Modified Files: help.cpp Log Message: Moved the bindings function for introspection in lua into the override.hpp file for the wxlua bindings. Add function wxlua.GetBindings() instead of install wxLuaBinding_XXX per binding. Index: help.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/help.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** help.cpp 25 Jun 2007 03:19:44 -0000 1.44 --- help.cpp 28 Jun 2007 21:52:56 -0000 1.45 *************** *** 1438,1468 **** - #if (wxLUA_USE_wxHelpController && wxUSE_HELP) && ((wxLUA_USE_wxHelpController && wxUSE_HELP) && (wxLUA_USE_wxHtmlHelpController && wxUSE_WXHTML_HELP)) - static wxLuaArgTag s_wxluatagArray_wxLua_wxHtmlHelpController_KeywordSearch[] = { &s_wxluatag_wxHtmlHelpController, &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; - static int LUACALL wxLua_wxHtmlHelpController_KeywordSearch(lua_State *L); - static wxLuaBindCFunc s_wxluafunc_wxLua_wxHtmlHelpController_KeywordSearch[1] = {{ wxLua_wxHtmlHelpController_KeywordSearch, WXLUAMETHOD_METHOD, 2, 3, s_wxluatagArray_wxLua_wxHtmlHelpController_KeywordSearch }}; - // bool KeywordSearch(const wxString& keyword, wxHelpSearchMode mode = wxHELP_SEARCH_ALL) - static int LUACALL wxLua_wxHtmlHelpController_KeywordSearch(lua_State *L) - { - wxLuaState wxlState(L); - bool returns; - // get number of arguments - int argCount = lua_gettop(L); - // wxHelpSearchMode mode = wxHELP_SEARCH_ALL - wxHelpSearchMode mode = (argCount >= 3 ? (wxHelpSearchMode)wxlua_getintegertype(L, 3) : wxHELP_SEARCH_ALL); - // const wxString keyword - const wxString keyword = wxlState.GetwxStringType(2); - // get this - wxHtmlHelpController * self = (wxHtmlHelpController *)wxlState.GetUserDataType(1, s_wxluatag_wxHtmlHelpController); - // call KeywordSearch - returns = (self->KeywordSearch(keyword, mode)); - // push the result flag - lua_pushboolean(L, returns); - - return 1; - } - - #endif // (wxLUA_USE_wxHelpController && wxUSE_HELP) && ((wxLUA_USE_wxHelpController && wxUSE_HELP) && (wxLUA_USE_wxHtmlHelpController && wxUSE_WXHTML_HELP)) - #if (wxLUA_USE_wxConfig && wxUSE_CONFIG) && ((wxLUA_USE_wxHelpController && wxUSE_HELP) && (wxLUA_USE_wxHtmlHelpController && wxUSE_WXHTML_HELP)) static wxLuaArgTag s_wxluatagArray_wxLua_wxHtmlHelpController_ReadCustomization[] = { &s_wxluatag_wxHtmlHelpController, &s_wxluatag_wxConfigBase, &s_wxluaarg_String, NULL }; --- 1438,1441 ---- *************** *** 1666,1673 **** { "DisplayIndex", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxHtmlHelpController_DisplayIndex, 1, NULL }, - #if (wxLUA_USE_wxHelpController && wxUSE_HELP) && ((wxLUA_USE_wxHelpController && wxUSE_HELP) && (wxLUA_USE_wxHtmlHelpController && wxUSE_WXHTML_HELP)) - { "KeywordSearch", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxHtmlHelpController_KeywordSearch, 1, NULL }, - #endif // (wxLUA_USE_wxHelpController && wxUSE_HELP) && ((wxLUA_USE_wxHelpController && wxUSE_HELP) && (wxLUA_USE_wxHtmlHelpController && wxUSE_WXHTML_HELP)) - #if (wxLUA_USE_wxConfig && wxUSE_CONFIG) && ((wxLUA_USE_wxHelpController && wxUSE_HELP) && (wxLUA_USE_wxHtmlHelpController && wxUSE_WXHTML_HELP)) { "ReadCustomization", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxHtmlHelpController_ReadCustomization, 1, NULL }, --- 1639,1642 ---- |
From: John L. <jr...@us...> - 2007-06-28 03:15:50
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15966/wxLua/samples Modified Files: controls.wx.lua Log Message: A little cleanup Index: controls.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/controls.wx.lua,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** controls.wx.lua 25 Jun 2007 19:44:56 -0000 1.9 --- controls.wx.lua 28 Jun 2007 03:15:34 -0000 1.10 *************** *** 1,5 **** ----------------------------------------------------------------------------- ! -- Name: picker.wx.lua ! -- Purpose: Picker wxLua sample -- Author: John Labenski -- Modified by: --- 1,5 ---- ----------------------------------------------------------------------------- ! -- Name: controls.wx.lua ! -- Purpose: Controls wxLua sample -- Author: John Labenski -- Modified by: *************** *** 136,140 **** skipEVTs = { ! ["wxEVT_PAINT"] = true, -- controls don't redraw if we connect to this in MSW, even if we Skip() it } --- 136,140 ---- skipEVTs = { ! ["wxEVT_PAINT"] = true, -- controls don't redraw if we connect to this in MSW, even if we Skip() it } *************** *** 298,301 **** --- 298,302 ---- function OnEvent(event) + local skip = true local evtClassName = wxlua.wxlua_typename(wxEVT_TableByType[event:GetEventType()].class_tag) local evtTypeStr = wxEVT_TableByType[event:GetEventType()].name *************** *** 311,315 **** -- during shutdown, we nil textCtrl since events are sent and we don't want them anymore if (not textCtrl) or ignoreEVTs[evtTypeStr] or ignoreControls[event:GetId()] then ! event:Skip() return end --- 312,316 ---- -- during shutdown, we nil textCtrl since events are sent and we don't want them anymore if (not textCtrl) or ignoreEVTs[evtTypeStr] or ignoreControls[event:GetId()] then ! event:Skip(skip) return end *************** *** 347,351 **** textCtrl:AppendText(s.."\n\n") ! event:Skip() end --- 348,352 ---- textCtrl:AppendText(s.."\n\n") ! event:Skip(skip) end *************** *** 386,390 **** local function ConnectEvents(control) -- Note this is the same as doing this, but we connect all of them ! -- scrollWin:Connect(wx.wxID_ANY, wx.wxEVT_COMMAND_BUTTON_CLICKED, OnCommandEvent) for i = 1, #wxEVT_Array do --- 387,391 ---- local function ConnectEvents(control) -- Note this is the same as doing this, but we connect all of them ! -- win:Connect(wx.wxID_ANY, wx.wxEVT_COMMAND_BUTTON_CLICKED, OnCommandEvent) for i = 1, #wxEVT_Array do *************** *** 871,877 **** imageList:delete() if taskbarIcon then ! if taskbarIcon:IsIconInstalled() then ! taskbarIcon:RemoveIcon() ! end taskbarIcon:delete() -- must delete() it for program to exit in MSW --- 872,878 ---- imageList:delete() if taskbarIcon then ! --if taskbarIcon:IsIconInstalled() then ! -- taskbarIcon:RemoveIcon() ! --end taskbarIcon:delete() -- must delete() it for program to exit in MSW |
From: John L. <jr...@us...> - 2007-06-27 19:57:05
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/bindings Modified Files: genidocs_rules.lua genwxbind.lua Log Message: Add wxDynamicLibrary and friends to bindings Index: genidocs_rules.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genidocs_rules.lua,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** genidocs_rules.lua 19 Jun 2007 22:26:45 -0000 1.3 --- genidocs_rules.lua 27 Jun 2007 19:56:27 -0000 1.4 *************** *** 104,107 **** --- 104,108 ---- ["wxCSConv"] = "Lua uses ANSI 8-bit strings", ["wxDirTraverser"] = "Use wxDir::GetFirst() and GetNext()", + ["wxDllLoader"] = "Deprecated since version 2.4, see wxDynamicLibrary", ["wxEncodingConverter"] = "Lua uses ANSI 8-bit strings", ["wxHashMap"] = "Lua tables are hash tables", Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** genwxbind.lua 27 Jun 2007 14:29:54 -0000 1.137 --- genwxbind.lua 27 Jun 2007 19:56:27 -0000 1.138 *************** *** 954,957 **** --- 954,958 ---- preprocConditionTable["wxLUA_USE_wxDisplay"] = "wxLUA_USE_wxDisplay" preprocConditionTable["wxLUA_USE_wxDragDrop"] = "wxLUA_USE_wxDragDrop" + preprocConditionTable["wxLUA_USE_wxDynamicLibrary"] = "wxLUA_USE_wxDynamicLibrary" preprocConditionTable["wxLUA_USE_wxFile"] = "wxLUA_USE_wxFile" preprocConditionTable["wxLUA_USE_wxFileDialog"] = "wxLUA_USE_wxFileDialog" |
From: John L. <jr...@us...> - 2007-06-27 19:57:02
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/bindings/wxwidgets Modified Files: appframe.i help.i wx_datatypes.lua Log Message: Add wxDynamicLibrary and friends to bindings Index: help.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/help.i,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** help.i 25 Jun 2007 03:19:37 -0000 1.21 --- help.i 27 Jun 2007 19:56:28 -0000 1.22 *************** *** 272,276 **** //void DisplayContents() - see wxHelpControllerBase void DisplayIndex() ! bool KeywordSearch(const wxString& keyword, wxHelpSearchMode mode = wxHELP_SEARCH_ALL) void ReadCustomization(wxConfigBase* cfg, wxString path = "") void SetTempDir(const wxString& path) --- 272,276 ---- //void DisplayContents() - see wxHelpControllerBase void DisplayIndex() ! // bool KeywordSearch(const wxString& keyword, wxHelpSearchMode mode = wxHELP_SEARCH_ALL) // see base void ReadCustomization(wxConfigBase* cfg, wxString path = "") void SetTempDir(const wxString& path) Index: appframe.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/appframe.i,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** appframe.i 26 Jun 2007 03:22:04 -0000 1.44 --- appframe.i 27 Jun 2007 19:56:28 -0000 1.45 *************** *** 900,901 **** --- 900,1049 ---- //bool operator!=(const wxPlatformInfo &t) const %endclass + + + // --------------------------------------------------------------------------- + // wxDynamicLibrary - No a lot you can do with this, but it might make + // testing or debugging a C++ program easier to test thing + // out in wxLua first. + + %if // wxLUA_USE_wxDynamicLibrary && wxUSE_DYNLIB_CLASS + + %include "wx/dynlib.h" + + %enum wxDLFlags + wxDL_LAZY // resolve undefined symbols at first use + // (only works on some Unix versions) + wxDL_NOW // resolve undefined symbols on load + // (default, always the case under Win32) + wxDL_GLOBAL // export extern symbols to subsequently + // loaded libs. + wxDL_VERBATIM // attempt to load the supplied library + // name without appending the usual dll + // filename extension. + wxDL_NOSHARE // load new DLL, don't reuse already loaded + // (only for wxPluginManager) + + wxDL_DEFAULT // = wxDL_NOW // default flags correspond to Win32 + %endenum + + %enum wxDynamicLibraryCategory + wxDL_LIBRARY, // standard library + wxDL_MODULE // loadable module/plugin + %endenum + + %enum wxPluginCategory + wxDL_PLUGIN_GUI, // plugin that uses GUI classes + wxDL_PLUGIN_BASE // wxBase-only plugin + %endenum + + + %class %delete %noclassinfo %encapsulate wxDynamicLibraryDetails + // ctor, normally never used as these objects are only created by + // wxDynamicLibrary::ListLoaded() + //wxDynamicLibraryDetails() { m_address = NULL; m_length = 0; } + + wxString GetName() const // get the (base) name + wxString GetPath() const // get the full path of this object + + // get the load address and the extent, return true if this information is available + //bool GetAddress(void **addr, size_t *len) const + + wxString GetVersion() const // return the version of the DLL (may be empty if no version info) + %endclass + + %class %delete %noclassinfo %encapsulate wxDynamicLibraryDetailsArray + //wxDynamicLibraryDetailsArray() // Get this from wxDynamicLibrary::ListLoaded + + int GetCount() const + wxDynamicLibraryDetails Item( int n ) + %endclass + + + %class %delete %noclassinfo %encapsulate wxDynamicLibrary + wxDynamicLibrary() + wxDynamicLibrary(const wxString& libname, int flags = wxDL_DEFAULT) + + // return a valid handle for the main program itself or NULL if back + // linking is not supported by the current platform (e.g. Win32) + //static wxDllType GetProgramHandle(); + + // return the platform standard DLL extension (with leading dot) + //static const wxChar *GetDllExt() + static wxString GetDllExt() + + // return true if the library was loaded successfully + bool IsLoaded() const + + // load the library with the given name (full or not), return true if ok + bool Load(const wxString& libname, int flags = wxDL_DEFAULT); + + // raw function for loading dynamic libs: always behaves as if + // wxDL_VERBATIM were specified and doesn't log error message if the + // library couldn't be loaded but simply returns NULL + //static wxDllType RawLoad(const wxString& libname, int flags = wxDL_DEFAULT); + + // detach the library object from its handle, i.e. prevent the object from + // unloading the library in its dtor -- the caller is now responsible for doing this + //wxDllType Detach() + + // unload the given library handle (presumably returned by Detach() before) + //static void Unload(wxDllType handle); + + // unload the library, also done automatically in dtor + void Unload() + + // Return the raw handle from dlopen and friends. + //wxDllType GetLibHandle() const { return m_handle; } + + // check if the given symbol is present in the library, useful to verify if + // a loadable module is our plugin, for example, without provoking error + // messages from GetSymbol() + bool HasSymbol(const wxString& name) const + + // resolve a symbol in a loaded DLL, such as a variable or function name. + // 'name' is the (possibly mangled) name of the symbol. (use extern "C" to + // export unmangled names) + // Since it is perfectly valid for the returned symbol to actually be NULL, + // that is not always indication of an error. Pass and test the parameter + // 'success' for a true indication of success or failure to load the symbol. + // Returns a pointer to the symbol on success, or NULL if an error occurred + // or the symbol wasn't found. + //void *GetSymbol(const wxString& name, bool *success = NULL) const; + + // low-level version of GetSymbol() + //static void *RawGetSymbol(wxDllType handle, const wxString& name); + //void *RawGetSymbol(const wxString& name) const + + //#ifdef __WXMSW__ + // this function is useful for loading functions from the standard Windows + // DLLs: such functions have an 'A' (in ANSI build) or 'W' (in Unicode, or + // wide character build) suffix if they take string parameters + //static void *RawGetSymbolAorW(wxDllType handle, const wxString& name) + //void *GetSymbolAorW(const wxString& name) const + //#endif // __WXMSW__ + + // return all modules/shared libraries in the address space of this process + // returns an empty array if not implemented or an error occurred + static wxDynamicLibraryDetailsArray ListLoaded(); + + // return platform-specific name of dynamic library with proper extension + // and prefix (e.g. "foo.dll" on Windows or "libfoo.so" on Linux) + static wxString CanonicalizeName(const wxString& name, wxDynamicLibraryCategory cat = wxDL_LIBRARY); + + // return name of wxWidgets plugin (adds compiler and version info + // to the filename): + static wxString CanonicalizePluginName(const wxString& name, wxPluginCategory cat = wxDL_PLUGIN_GUI); + + // return plugin directory on platforms where it makes sense and empty string on others: + static wxString GetPluginsDirectory() + %endclass + + + // --------------------------------------------------------------------------- + // wxPluginLibrary - You cannot use this within wxLua + + // --------------------------------------------------------------------------- + // wxPluginManager - You cannot use this within wxLua + + + %endif // wxLUA_USE_wxDynamicLibrary && wxUSE_DYNLIB_CLASS \ No newline at end of file Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** wx_datatypes.lua 27 Jun 2007 03:11:27 -0000 1.79 --- wx_datatypes.lua 27 Jun 2007 19:56:28 -0000 1.80 *************** *** 783,786 **** --- 783,791 ---- Name = "wxDCClipper", }, + wxDLFlags = { + DefType = "enum", + IsNumber = true, + Name = "wxDLFlags", + }, wxDataFormat = { Condition = "wxLUA_USE_wxDataObject && wxUSE_DATAOBJ", *************** *** 1050,1053 **** --- 1055,1081 ---- Name = "wxDuplexMode", }, + wxDynamicLibrary = { + DefType = "class", + Encapsulate = true, + IsNumber = false, + Name = "wxDynamicLibrary", + }, + wxDynamicLibraryCategory = { + DefType = "enum", + IsNumber = true, + Name = "wxDynamicLibraryCategory", + }, + wxDynamicLibraryDetails = { + DefType = "class", + Encapsulate = true, + IsNumber = false, + Name = "wxDynamicLibraryDetails", + }, + wxDynamicLibraryDetailsArray = { + DefType = "class", + Encapsulate = true, + IsNumber = false, + Name = "wxDynamicLibraryDetailsArray", + }, wxEOL = { Condition = "wxUSE_STREAMS", *************** *** 2744,2747 **** --- 2772,2780 ---- Name = "wxPlatformInfo", }, + wxPluginCategory = { + DefType = "enum", + IsNumber = true, + Name = "wxPluginCategory", + }, wxPoint = { Condition = "wxLUA_USE_wxPointSizeRect", *************** *** 4136,4139 **** --- 4169,4173 ---- wxLUA_USE_wxDisplay = "wxLUA_USE_wxDisplay", wxLUA_USE_wxDragDrop = "wxLUA_USE_wxDragDrop", + wxLUA_USE_wxDynamicLibrary = "wxLUA_USE_wxDynamicLibrary", wxLUA_USE_wxFile = "wxLUA_USE_wxFile", wxLUA_USE_wxFileDialog = "wxLUA_USE_wxFileDialog", |
From: John L. <jr...@us...> - 2007-06-27 19:57:01
|
Update of /cvsroot/wxlua/wxLua/bindings/wxstc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/bindings/wxstc Modified Files: wxstc_datatypes.lua Log Message: Add wxDynamicLibrary and friends to bindings Index: wxstc_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxstc/wxstc_datatypes.lua,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** wxstc_datatypes.lua 27 Jun 2007 03:11:27 -0000 1.69 --- wxstc_datatypes.lua 27 Jun 2007 19:56:28 -0000 1.70 *************** *** 783,786 **** --- 783,791 ---- Name = "wxDCClipper", }, + wxDLFlags = { + DefType = "enum", + IsNumber = true, + Name = "wxDLFlags", + }, wxDataFormat = { Condition = "wxLUA_USE_wxDataObject && wxUSE_DATAOBJ", *************** *** 1050,1053 **** --- 1055,1081 ---- Name = "wxDuplexMode", }, + wxDynamicLibrary = { + DefType = "class", + Encapsulate = true, + IsNumber = false, + Name = "wxDynamicLibrary", + }, + wxDynamicLibraryCategory = { + DefType = "enum", + IsNumber = true, + Name = "wxDynamicLibraryCategory", + }, + wxDynamicLibraryDetails = { + DefType = "class", + Encapsulate = true, + IsNumber = false, + Name = "wxDynamicLibraryDetails", + }, + wxDynamicLibraryDetailsArray = { + DefType = "class", + Encapsulate = true, + IsNumber = false, + Name = "wxDynamicLibraryDetailsArray", + }, wxEOL = { Condition = "wxUSE_STREAMS", *************** *** 2744,2747 **** --- 2772,2780 ---- Name = "wxPlatformInfo", }, + wxPluginCategory = { + DefType = "enum", + IsNumber = true, + Name = "wxPluginCategory", + }, wxPoint = { Condition = "wxLUA_USE_wxPointSizeRect", *************** *** 4147,4150 **** --- 4180,4184 ---- wxLUA_USE_wxDisplay = "wxLUA_USE_wxDisplay", wxLUA_USE_wxDragDrop = "wxLUA_USE_wxDragDrop", + wxLUA_USE_wxDynamicLibrary = "wxLUA_USE_wxDynamicLibrary", wxLUA_USE_wxFile = "wxLUA_USE_wxFile", wxLUA_USE_wxFileDialog = "wxLUA_USE_wxFileDialog", |
From: John L. <jr...@us...> - 2007-06-27 19:56:33
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/modules/wxbind/src Modified Files: appframe.cpp wx_bind.cpp Log Message: Add wxDynamicLibrary and friends to bindings Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** wx_bind.cpp 27 Jun 2007 15:57:14 -0000 1.122 --- wx_bind.cpp 27 Jun 2007 19:56:30 -0000 1.123 *************** *** 1269,1272 **** --- 1269,1283 ---- #endif // wxLUA_USE_wxDir + { "wxDL_DEFAULT", wxDL_DEFAULT }, + { "wxDL_GLOBAL", wxDL_GLOBAL }, + { "wxDL_LAZY", wxDL_LAZY }, + { "wxDL_LIBRARY", wxDL_LIBRARY }, + { "wxDL_MODULE", wxDL_MODULE }, + { "wxDL_NOSHARE", wxDL_NOSHARE }, + { "wxDL_NOW", wxDL_NOW }, + { "wxDL_PLUGIN_BASE", wxDL_PLUGIN_BASE }, + { "wxDL_PLUGIN_GUI", wxDL_PLUGIN_GUI }, + { "wxDL_VERBATIM", wxDL_VERBATIM }, + #if wxLUA_USE_MDI && wxUSE_MDI && wxUSE_DOC_VIEW_ARCHITECTURE { "wxDOC_NEW", wxDOC_NEW }, *************** *** 7201,7204 **** --- 7212,7218 ---- #endif // wxLUA_USE_wxDragDrop && wxUSE_DRAG_AND_DROP + { "wxDynamicLibrary", wxDynamicLibrary_methods, wxDynamicLibrary_methodCount, NULL, &s_wxluatag_wxDynamicLibrary, NULL, NULL ,s_wxluadefineArray_None, 0, }, + { "wxDynamicLibraryDetails", wxDynamicLibraryDetails_methods, wxDynamicLibraryDetails_methodCount, NULL, &s_wxluatag_wxDynamicLibraryDetails, NULL, NULL ,s_wxluadefineArray_None, 0, }, + { "wxDynamicLibraryDetailsArray", wxDynamicLibraryDetailsArray_methods, wxDynamicLibraryDetailsArray_methodCount, NULL, &s_wxluatag_wxDynamicLibraryDetailsArray, NULL, NULL ,s_wxluadefineArray_None, 0, }, { "wxEffects", wxEffects_methods, wxEffects_methodCount, CLASSINFO(wxEffects), &s_wxluatag_wxEffects, "wxObject", NULL ,s_wxluadefineArray_None, 0, }, { "wxEraseEvent", wxEraseEvent_methods, wxEraseEvent_methodCount, CLASSINFO(wxEraseEvent), &s_wxluatag_wxEraseEvent, "wxEvent", NULL ,s_wxluadefineArray_None, 0, }, *************** *** 8304,8307 **** --- 8318,8324 ---- #endif // (wxLUA_USE_wxSizer) && (wxCHECK_VERSION(2,8,0)) + wxLUA_IMPLEMENT_ENCAPSULATION(wxDynamicLibrary, wxDynamicLibrary) + wxLUA_IMPLEMENT_ENCAPSULATION(wxDynamicLibraryDetails, wxDynamicLibraryDetails) + wxLUA_IMPLEMENT_ENCAPSULATION(wxDynamicLibraryDetailsArray, wxDynamicLibraryDetailsArray) wxLUA_IMPLEMENT_ENCAPSULATION(wxFileType, wxFileType) wxLUA_IMPLEMENT_ENCAPSULATION(wxFileType::MessageParameters, wxFileType_MessageParameters) Index: appframe.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/appframe.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** appframe.cpp 26 Jun 2007 03:22:05 -0000 1.62 --- appframe.cpp 27 Jun 2007 19:56:30 -0000 1.63 *************** *** 5215,5216 **** --- 5215,5660 ---- + // --------------------------------------------------------------------------- + // Bind class wxDynamicLibraryDetails + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxDynamicLibraryDetails' + int s_wxluatag_wxDynamicLibraryDetails = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetName[] = { &s_wxluatag_wxDynamicLibraryDetails, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetails_GetName(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetName[1] = {{ wxLua_wxDynamicLibraryDetails_GetName, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetName }}; + // wxString GetName() const // get the (base) name + static int LUACALL wxLua_wxDynamicLibraryDetails_GetName(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxDynamicLibraryDetails * self = (wxDynamicLibraryDetails *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetails); + // call GetName + returns = (self->GetName()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetPath[] = { &s_wxluatag_wxDynamicLibraryDetails, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetails_GetPath(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetPath[1] = {{ wxLua_wxDynamicLibraryDetails_GetPath, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetPath }}; + // wxString GetPath() const // get the full path of this object + static int LUACALL wxLua_wxDynamicLibraryDetails_GetPath(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxDynamicLibraryDetails * self = (wxDynamicLibraryDetails *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetails); + // call GetPath + returns = (self->GetPath()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetVersion[] = { &s_wxluatag_wxDynamicLibraryDetails, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetails_GetVersion(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetVersion[1] = {{ wxLua_wxDynamicLibraryDetails_GetVersion, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetails_GetVersion }}; + // wxString GetVersion() const // return the version of the DLL (may be empty if no version info) + static int LUACALL wxLua_wxDynamicLibraryDetails_GetVersion(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxDynamicLibraryDetails * self = (wxDynamicLibraryDetails *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetails); + // call GetVersion + returns = (self->GetVersion()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetails_delete[] = { &s_wxluatag_wxDynamicLibraryDetails, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetails_delete(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetails_delete[1] = {{ wxLua_wxDynamicLibraryDetails_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetails_delete }}; + static int LUACALL wxLua_wxDynamicLibraryDetails_delete(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibraryDetails * self = (wxDynamicLibraryDetails *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetails); + // if removed from tracked mem list, reset the tag so that gc() is not called on this object. + if ((self != NULL) && wxlState.RemoveTrackedObject(self)) + { + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxDynamicLibraryDetails_methods[] = { + { "GetName", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetName, 1, NULL }, + { "GetPath", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetPath, 1, NULL }, + { "GetVersion", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetails_GetVersion, 1, NULL }, + { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxDynamicLibraryDetails_delete, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxDynamicLibraryDetails_methodCount = sizeof(wxDynamicLibraryDetails_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxDynamicLibraryDetailsArray + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxDynamicLibraryDetailsArray' + int s_wxluatag_wxDynamicLibraryDetailsArray = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_GetCount[] = { &s_wxluatag_wxDynamicLibraryDetailsArray, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_GetCount(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_GetCount[1] = {{ wxLua_wxDynamicLibraryDetailsArray_GetCount, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_GetCount }}; + // int GetCount() const + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_GetCount(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // get this + wxDynamicLibraryDetailsArray * self = (wxDynamicLibraryDetailsArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetailsArray); + // call GetCount + returns = (self->GetCount()); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_Item[] = { &s_wxluatag_wxDynamicLibraryDetailsArray, &s_wxluaarg_Number, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_Item(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_Item[1] = {{ wxLua_wxDynamicLibraryDetailsArray_Item, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_Item }}; + // wxDynamicLibraryDetails Item( int n ) + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_Item(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibraryDetails *returns; + // int n + int n = (int)wxlua_getnumbertype(L, 2); + // get this + wxDynamicLibraryDetailsArray * self = (wxDynamicLibraryDetailsArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetailsArray); + // call Item + // allocate a new object using the copy constructor + returns = new wxDynamicLibraryDetails(self->Item(n)); + // add the new object to the tracked memory list + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxDynamicLibraryDetails((wxDynamicLibraryDetails *)returns)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxDynamicLibraryDetails, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_delete[] = { &s_wxluatag_wxDynamicLibraryDetailsArray, NULL }; + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_delete(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_delete[1] = {{ wxLua_wxDynamicLibraryDetailsArray_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibraryDetailsArray_delete }}; + static int LUACALL wxLua_wxDynamicLibraryDetailsArray_delete(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibraryDetailsArray * self = (wxDynamicLibraryDetailsArray *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibraryDetailsArray); + // if removed from tracked mem list, reset the tag so that gc() is not called on this object. + if ((self != NULL) && wxlState.RemoveTrackedObject(self)) + { + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxDynamicLibraryDetailsArray_methods[] = { + { "GetCount", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_GetCount, 1, NULL }, + { "Item", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_Item, 1, NULL }, + { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxDynamicLibraryDetailsArray_delete, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxDynamicLibraryDetailsArray_methodCount = sizeof(wxDynamicLibraryDetailsArray_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxDynamicLibrary + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxDynamicLibrary' + int s_wxluatag_wxDynamicLibrary = -1; + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_CanonicalizeName[] = { &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_CanonicalizeName(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_CanonicalizeName[1] = {{ wxLua_wxDynamicLibrary_CanonicalizeName, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 1, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_CanonicalizeName }}; + // static wxString CanonicalizeName(const wxString& name, wxDynamicLibraryCategory cat = wxDL_LIBRARY); + static int LUACALL wxLua_wxDynamicLibrary_CanonicalizeName(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxDynamicLibraryCategory cat = wxDL_LIBRARY + wxDynamicLibraryCategory cat = (argCount >= 2 ? (wxDynamicLibraryCategory)wxlua_getintegertype(L, 2) : wxDL_LIBRARY); + // const wxString name + const wxString name = wxlState.GetwxStringType(1); + // call CanonicalizeName + returns = (wxDynamicLibrary::CanonicalizeName(name, cat)); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_CanonicalizePluginName[] = { &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_CanonicalizePluginName(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_CanonicalizePluginName[1] = {{ wxLua_wxDynamicLibrary_CanonicalizePluginName, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 1, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_CanonicalizePluginName }}; + // static wxString CanonicalizePluginName(const wxString& name, wxPluginCategory cat = wxDL_PLUGIN_GUI); + static int LUACALL wxLua_wxDynamicLibrary_CanonicalizePluginName(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxPluginCategory cat = wxDL_PLUGIN_GUI + wxPluginCategory cat = (argCount >= 2 ? (wxPluginCategory)wxlua_getintegertype(L, 2) : wxDL_PLUGIN_GUI); + // const wxString name + const wxString name = wxlState.GetwxStringType(1); + // call CanonicalizePluginName + returns = (wxDynamicLibrary::CanonicalizePluginName(name, cat)); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static int LUACALL wxLua_wxDynamicLibrary_GetDllExt(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_GetDllExt[1] = {{ wxLua_wxDynamicLibrary_GetDllExt, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 0, s_wxluaargArray_None }}; + // static wxString GetDllExt() + static int LUACALL wxLua_wxDynamicLibrary_GetDllExt(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // call GetDllExt + returns = (wxDynamicLibrary::GetDllExt()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static int LUACALL wxLua_wxDynamicLibrary_GetPluginsDirectory(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_GetPluginsDirectory[1] = {{ wxLua_wxDynamicLibrary_GetPluginsDirectory, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 0, s_wxluaargArray_None }}; + // static wxString GetPluginsDirectory() + static int LUACALL wxLua_wxDynamicLibrary_GetPluginsDirectory(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // call GetPluginsDirectory + returns = (wxDynamicLibrary::GetPluginsDirectory()); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_HasSymbol[] = { &s_wxluatag_wxDynamicLibrary, &s_wxluaarg_String, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_HasSymbol(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_HasSymbol[1] = {{ wxLua_wxDynamicLibrary_HasSymbol, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_HasSymbol }}; + // bool HasSymbol(const wxString& name) const + static int LUACALL wxLua_wxDynamicLibrary_HasSymbol(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString name + const wxString name = wxlState.GetwxStringType(2); + // get this + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // call HasSymbol + returns = (self->HasSymbol(name)); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_IsLoaded[] = { &s_wxluatag_wxDynamicLibrary, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_IsLoaded(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_IsLoaded[1] = {{ wxLua_wxDynamicLibrary_IsLoaded, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibrary_IsLoaded }}; + // bool IsLoaded() const + static int LUACALL wxLua_wxDynamicLibrary_IsLoaded(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // call IsLoaded + returns = (self->IsLoaded()); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static int LUACALL wxLua_wxDynamicLibrary_ListLoaded(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_ListLoaded[1] = {{ wxLua_wxDynamicLibrary_ListLoaded, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 0, s_wxluaargArray_None }}; + // static wxDynamicLibraryDetailsArray ListLoaded(); + static int LUACALL wxLua_wxDynamicLibrary_ListLoaded(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibraryDetailsArray *returns; + // call ListLoaded + // allocate a new object using the copy constructor + returns = new wxDynamicLibraryDetailsArray(wxDynamicLibrary::ListLoaded()); + // add the new object to the tracked memory list + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxDynamicLibraryDetailsArray((wxDynamicLibraryDetailsArray *)returns)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxDynamicLibraryDetailsArray, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_Load[] = { &s_wxluatag_wxDynamicLibrary, &s_wxluaarg_String, &s_wxluaarg_Number, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_Load(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_Load[1] = {{ wxLua_wxDynamicLibrary_Load, WXLUAMETHOD_METHOD, 2, 3, s_wxluatagArray_wxLua_wxDynamicLibrary_Load }}; + // bool Load(const wxString& libname, int flags = wxDL_DEFAULT); + static int LUACALL wxLua_wxDynamicLibrary_Load(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // int flags = wxDL_DEFAULT + int flags = (argCount >= 3 ? (int)wxlua_getnumbertype(L, 3) : wxDL_DEFAULT); + // const wxString libname + const wxString libname = wxlState.GetwxStringType(2); + // get this + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // call Load + returns = (self->Load(libname, flags)); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_Unload[] = { &s_wxluatag_wxDynamicLibrary, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_Unload(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_Unload[1] = {{ wxLua_wxDynamicLibrary_Unload, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibrary_Unload }}; + // void Unload() + static int LUACALL wxLua_wxDynamicLibrary_Unload(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // call Unload + self->Unload(); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_delete[] = { &s_wxluatag_wxDynamicLibrary, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_delete(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_delete[1] = {{ wxLua_wxDynamicLibrary_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDynamicLibrary_delete }}; + static int LUACALL wxLua_wxDynamicLibrary_delete(lua_State *L) + { + wxLuaState wxlState(L); + wxDynamicLibrary * self = (wxDynamicLibrary *)wxlState.GetUserDataType(1, s_wxluatag_wxDynamicLibrary); + // if removed from tracked mem list, reset the tag so that gc() is not called on this object. + if ((self != NULL) && wxlState.RemoveTrackedObject(self)) + { + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + static int LUACALL wxLua_wxDynamicLibrary_constructor(lua_State *L); + // static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_constructor[1] = {{ wxLua_wxDynamicLibrary_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }}; + // wxDynamicLibrary() + static int LUACALL wxLua_wxDynamicLibrary_constructor(lua_State *L) + { + wxluabind_removetableforcall(L); + wxLuaState wxlState(L); + wxDynamicLibrary *returns; + // call constructor + returns = new wxDynamicLibrary(); + // add to tracked memory list + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxDynamicLibrary((wxDynamicLibrary *)returns)); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxDynamicLibrary, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxDynamicLibrary_constructor1[] = { &s_wxluaarg_String, &s_wxluaarg_Number, NULL }; + static int LUACALL wxLua_wxDynamicLibrary_constructor1(lua_State *L); + // static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_constructor1[1] = {{ wxLua_wxDynamicLibrary_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_constructor1 }}; + // wxDynamicLibrary(const wxString& libname, int flags = wxDL_DEFAULT) + static int LUACALL wxLua_wxDynamicLibrary_constructor1(lua_State *L) + { + wxluabind_removetableforcall(L); + wxLuaState wxlState(L); + wxDynamicLibrary *returns; + // get number of arguments + int argCount = lua_gettop(L); + // int flags = wxDL_DEFAULT + int flags = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxDL_DEFAULT); + // const wxString libname + const wxString libname = wxlState.GetwxStringType(1); + // call constructor + returns = new wxDynamicLibrary(libname, flags); + // add to tracked memory list + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxDynamicLibrary((wxDynamicLibrary *)returns)); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxDynamicLibrary, returns); + + return 1; + } + + + + static int LUACALL wxLua_wxDynamicLibrary_constructor_overload(lua_State *L); + // function overload table + static wxLuaBindCFunc s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload[] = + { + { wxLua_wxDynamicLibrary_constructor_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 0, 2, s_wxluaargArray_None }, + { wxLua_wxDynamicLibrary_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }, + { wxLua_wxDynamicLibrary_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxDynamicLibrary_constructor1 }, + }; + static int s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload_count = sizeof(s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload)/sizeof(wxLuaBindCFunc); + // Overloaded function for wxDynamicLibrary::wxDynamicLibrary + static int LUACALL wxLua_wxDynamicLibrary_constructor_overload(lua_State *L) + { + wxLuaState wxlState(L); + static wxLuaBindMethod overload_method = + { "wxDynamicLibrary", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload, s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload_count, 0 }; + return wxlState.CallOverloadedFunction(&overload_method); + } + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxDynamicLibrary_methods[] = { + { "CanonicalizeName", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_CanonicalizeName, 1, NULL }, + { "CanonicalizePluginName", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_CanonicalizePluginName, 1, NULL }, + { "GetDllExt", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_GetDllExt, 1, NULL }, + { "GetPluginsDirectory", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_GetPluginsDirectory, 1, NULL }, + { "HasSymbol", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibrary_HasSymbol, 1, NULL }, + { "IsLoaded", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibrary_IsLoaded, 1, NULL }, + { "ListLoaded", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxDynamicLibrary_ListLoaded, 1, NULL }, + { "Load", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibrary_Load, 1, NULL }, + { "Unload", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxDynamicLibrary_Unload, 1, NULL }, + { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxDynamicLibrary_delete, 1, NULL }, + + { "wxDynamicLibrary", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload, s_wxluafunc_wxLua_wxDynamicLibrary_constructor_overload_count, 0 }, + + { 0, 0, 0, 0 }, + }; + + int wxDynamicLibrary_methodCount = sizeof(wxDynamicLibrary_methods)/sizeof(wxLuaBindMethod) - 1; + + |
From: John L. <jr...@us...> - 2007-06-27 19:56:33
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/samples Modified Files: bindings.wx.lua Log Message: Add wxDynamicLibrary and friends to bindings Index: bindings.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/bindings.wx.lua,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** bindings.wx.lua 18 Jun 2007 21:40:53 -0000 1.11 --- bindings.wx.lua 27 Jun 2007 19:56:30 -0000 1.12 *************** *** 990,994 **** -- check for mistakes in the bindings if (not c.classInfo) and wx.wxClassInfo.FindClass(c.name) then ! print(c.name.." is missing it's wxClassInfo.") end --- 990,994 ---- -- check for mistakes in the bindings if (not c.classInfo) and wx.wxClassInfo.FindClass(c.name) then ! print(c.name.." is missing it's wxClassInfo, please report this.") end *************** *** 998,1002 **** -- check for mistakes in the bindings if (not bc.classInfo) and wx.wxClassInfo.FindClass(bc.name) then ! print(bc.name.." is missing it's wxClassInfo.") end --- 998,1002 ---- -- check for mistakes in the bindings if (not bc.classInfo) and wx.wxClassInfo.FindClass(bc.name) then ! print(bc.name.." is missing it's wxClassInfo, please report this.") end *************** *** 1032,1036 **** end ! if ci:GetBaseClass2() then print(ci:GetClassName(), "Has two bases!") end ci = ci:GetBaseClass1() -- FIXME handle two base classes, maybe? end --- 1032,1036 ---- end ! --if ci:GetBaseClass2() then print(ci:GetClassName(), "Has two bases!") end ci = ci:GetBaseClass1() -- FIXME handle two base classes, maybe? end |
From: John L. <jr...@us...> - 2007-06-27 19:56:32
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/modules/wxbind/include Modified Files: wxbind.h Log Message: Add wxDynamicLibrary and friends to bindings Index: wxbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxbind.h,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** wxbind.h 27 Jun 2007 03:11:28 -0000 1.84 --- wxbind.h 27 Jun 2007 19:56:28 -0000 1.85 *************** *** 203,206 **** --- 203,207 ---- #include "wx/control.h" #include "wx/defs.h" + #include "wx/dynlib.h" #include "wx/effects.h" #include "wx/event.h" *************** *** 1153,1156 **** --- 1154,1166 ---- extern WXDLLIMPEXP_WXBIND wxLuaBindMethod wxDisplayChangedEvent_methods[]; extern WXDLLIMPEXP_DATA_WXBIND(int) wxDisplayChangedEvent_methodCount; + extern WXDLLIMPEXP_DATA_WXBIND(int) s_wxluatag_wxDynamicLibrary; + extern WXDLLIMPEXP_WXBIND wxLuaBindMethod wxDynamicLibrary_methods[]; + extern WXDLLIMPEXP_DATA_WXBIND(int) wxDynamicLibrary_methodCount; + extern WXDLLIMPEXP_DATA_WXBIND(int) s_wxluatag_wxDynamicLibraryDetails; + extern WXDLLIMPEXP_WXBIND wxLuaBindMethod wxDynamicLibraryDetails_methods[]; + extern WXDLLIMPEXP_DATA_WXBIND(int) wxDynamicLibraryDetails_methodCount; + extern WXDLLIMPEXP_DATA_WXBIND(int) s_wxluatag_wxDynamicLibraryDetailsArray; + extern WXDLLIMPEXP_WXBIND wxLuaBindMethod wxDynamicLibraryDetailsArray_methods[]; + extern WXDLLIMPEXP_DATA_WXBIND(int) wxDynamicLibraryDetailsArray_methodCount; extern WXDLLIMPEXP_DATA_WXBIND(int) s_wxluatag_wxEffects; extern WXDLLIMPEXP_WXBIND wxLuaBindMethod wxEffects_methods[]; *************** *** 2691,2694 **** --- 2701,2707 ---- #endif // (wxLUA_USE_wxSizer) && (wxCHECK_VERSION(2,8,0)) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_WXBIND, wxDynamicLibrary, wxDynamicLibrary) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_WXBIND, wxDynamicLibraryDetails, wxDynamicLibraryDetails) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_WXBIND, wxDynamicLibraryDetailsArray, wxDynamicLibraryDetailsArray) wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_WXBIND, wxFileType, wxFileType) wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_WXBIND, wxFileType::MessageParameters, wxFileType_MessageParameters) |
From: John L. <jr...@us...> - 2007-06-27 19:56:32
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/docs Modified Files: wxluaref.html Log Message: Add wxDynamicLibrary and friends to bindings Index: wxluaref.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxluaref.html,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wxluaref.html 27 Jun 2007 03:11:27 -0000 1.35 --- wxluaref.html 27 Jun 2007 19:56:28 -0000 1.36 *************** *** 832,836 **** <td align="center" bgcolor=AAFFAA>X <td bgcolor=FFAAAA> ! <td> <tr> <td><a href="#wxDocChildFrame">wxDocChildFrame</a> --- 832,836 ---- <td align="center" bgcolor=AAFFAA>X <td bgcolor=FFAAAA> ! <td>Deprecated since version 2.4, see wxDynamicLibrary <tr> <td><a href="#wxDocChildFrame">wxDocChildFrame</a> *************** *** 889,900 **** <td> <tr> ! <td>wxDynamicLibrary <td align="center" bgcolor=AAFFAA>X - <td bgcolor=FFAAAA> <td> <tr> ! <td>wxDynamicLibraryDetails <td align="center" bgcolor=AAFFAA>X <td bgcolor=FFAAAA> <td> <tr> --- 889,905 ---- <td> <tr> ! <td><a href="#wxDynamicLibrary">wxDynamicLibrary</a> ! <td align="center" bgcolor=AAFFAA>X <td align="center" bgcolor=AAFFAA>X <td> <tr> ! <td><a href="#wxDynamicLibraryDetails">wxDynamicLibraryDetails</a> ! <td align="center" bgcolor=AAFFAA>X <td align="center" bgcolor=AAFFAA>X + <td> + <tr> + <td><a href="#wxDynamicLibraryDetailsArray">wxDynamicLibraryDetailsArray</a> <td bgcolor=FFAAAA> + <td align="center" bgcolor=AAFFAA>X <td> <tr> *************** *** 3279,3282 **** --- 3284,3288 ---- <a href="#wxCheckBoxState">wxCheckBoxState</a><br> <a href="#wxConfigBase::EntryType">wxConfigBase::EntryType</a><br> + <a href="#wxDLFlags">wxDLFlags</a><br> <a href="#wxDataFormatId">wxDataFormatId</a><br> <a href="#wxDataObject::Direction">wxDataObject::Direction</a><br> *************** *** 3289,3292 **** --- 3295,3299 ---- <a href="#wxDragResult">wxDragResult</a><br> <a href="#wxDuplexMode">wxDuplexMode</a><br> + <a href="#wxDynamicLibraryCategory">wxDynamicLibraryCategory</a><br> <a href="#wxEOL">wxEOL</a><br> <a href="#wxEdge">wxEdge</a><br> *************** *** 3336,3339 **** --- 3343,3347 ---- <a href="#wxPathFormat">wxPathFormat</a><br> <a href="#wxPathNormalize">wxPathNormalize</a><br> + <a href="#wxPluginCategory">wxPluginCategory</a><br> <a href="#wxPortId">wxPortId</a><br> <a href="#wxPowerType">wxPowerType</a><br> *************** *** 4386,4389 **** --- 4394,4554 ---- <font color=#009900>//bool operator!=(const <a href="#wxPlatformInfo">wxPlatformInfo</a> &t) const</font><br> </blockquote><font color=#DD0000><font color=#DD0000><i>%endclass</i></font></font><br> + <br> + <br> + <font color=#009900>// ---------------------------------------------------------------------------</font><br> + <font color=#009900>// <a href="#wxDynamicLibrary">wxDynamicLibrary</a> - No a lot you can do with this, but it might make</font><br> + <font color=#009900>// testing or debugging a C++ program easier to test thing</font><br> + <font color=#009900>// out in wxLua first.</font><br> + <br> + <i>%if</i> <font color=#009900>// wxLUA_USE_wxDynamicLibrary && wxUSE_DYNLIB_CLASS</font><br> + <br> + <i>%include</i> "wx/dynlib.h"<br> + <br> + <b><font size=+1 color=#0066CC><i>%enum</i> <a name="wxDLFlags">wxDLFlags</a></font></b> + <blockquote><font color=#0066CC> + wxDL_LAZY <font color=#009900>// resolve undefined symbols at first use</font><br> + <font color=#009900>// (only works on some Unix versions)</font><br> + wxDL_NOW <font color=#009900>// resolve undefined symbols on load</font><br> + <font color=#009900>// (default, always the case under Win32)</font><br> + wxDL_GLOBAL <font color=#009900>// export extern symbols to subsequently</font><br> + <font color=#009900>// loaded libs.</font><br> + wxDL_VERBATIM <font color=#009900>// attempt to load the supplied library</font><br> + <font color=#009900>// name without appending the usual dll</font><br> + <font color=#009900>// filename extension.</font><br> + wxDL_NOSHARE <font color=#009900>// load new DLL, don't reuse already loaded</font><br> + <font color=#009900>// (only for wxPluginManager)</font><br> + <br> + wxDL_DEFAULT <font color=#009900>// = wxDL_NOW // default flags correspond to Win32</font><br> + </font> + </blockquote><font color=#0066CC><i>%endenum</i></font><br> + <br> + <b><font size=+1 color=#0066CC><i>%enum</i> <a name="wxDynamicLibraryCategory">wxDynamicLibraryCategory</a></font></b> + <blockquote><font color=#0066CC> + wxDL_LIBRARY, <font color=#009900>// standard library</font><br> + wxDL_MODULE <font color=#009900>// loadable module/plugin</font><br> + </font> + </blockquote><font color=#0066CC><i>%endenum</i></font><br> + <br> + <b><font size=+1 color=#0066CC><i>%enum</i> <a name="wxPluginCategory">wxPluginCategory</a></font></b> + <blockquote><font color=#0066CC> + wxDL_PLUGIN_GUI, <font color=#009900>// plugin that uses GUI classes</font><br> + wxDL_PLUGIN_BASE <font color=#009900>// wxBase-only plugin</font><br> + </font> + </blockquote><font color=#0066CC><i>%endenum</i></font><br> + <br> + <br> + <b><font size=+1 color=#DD0000><i>%class</i> <i>%delete</i> <i>%noclassinfo</i> <i>%encapsulate</i> <a name="wxDynamicLibraryDetails">wxDynamicLibraryDetails</a></font></b> + <blockquote> + <font color=#009900>// ctor, normally never used as these objects are only created by</font><br> + <font color=#009900>// wxDynamicLibrary::ListLoaded()</font><br> + <font color=#009900>//<a href="#wxDynamicLibraryDetails">wxDynamicLibraryDetails</a>() { m_address = NULL; m_length = 0; }</font><br> + <br> + <a href="#wxString">wxString</a> GetName() const <font color=#009900>// get the (base) name</font><br> + <a href="#wxString">wxString</a> GetPath() const <font color=#009900>// get the full path of this object</font><br> + <br> + <font color=#009900>// get the load address and the extent, return true if this information is available</font><br> + <font color=#009900>//bool GetAddress(void **addr, size_t *len) const</font><br> + <br> + <a href="#wxString">wxString</a> GetVersion() const <font color=#009900>// return the version of the DLL (may be empty if no version info)</font><br> + </blockquote><font color=#DD0000><font color=#DD0000><i>%endclass</i></font></font><br> + <br> + <b><font size=+1 color=#DD0000><i>%class</i> <i>%delete</i> <i>%noclassinfo</i> <i>%encapsulate</i> <a name="wxDynamicLibraryDetailsArray">wxDynamicLibraryDetailsArray</a></font></b> + <blockquote> + <font color=#009900>//<a href="#wxDynamicLibraryDetailsArray">wxDynamicLibraryDetailsArray</a>() // Get this from wxDynamicLibrary::ListLoaded</font><br> + <br> + int GetCount() const<br> + <a href="#wxDynamicLibraryDetails">wxDynamicLibraryDetails</a> Item( int n )<br> + </blockquote><font color=#DD0000><font color=#DD0000><i>%endclass</i></font></font><br> + <br> + <br> + <b><font size=+1 color=#DD0000><i>%class</i> <i>%delete</i> <i>%noclassinfo</i> <i>%encapsulate</i> <a name="wxDynamicLibrary">wxDynamicLibrary</a></font></b> + <blockquote> + <a href="#wxDynamicLibrary">wxDynamicLibrary</a>()<br> + <a href="#wxDynamicLibrary">wxDynamicLibrary</a>(const <a href="#wxString">wxString</a>& libname, int flags = wxDL_DEFAULT)<br> + <br> + <font color=#009900>// return a valid handle for the main program itself or NULL if back</font><br> + <font color=#009900>// linking is not supported by the current platform (e.g. Win32)</font><br> + <font color=#009900>//static wxDllType GetProgramHandle();</font><br> + <br> + <font color=#009900>// return the platform standard DLL extension (with leading dot)</font><br> + <font color=#009900>//static const wxChar *GetDllExt()</font><br> + static <a href="#wxString">wxString</a> GetDllExt()<br> + <br> + <font color=#009900>// return true if the library was loaded successfully</font><br> + bool IsLoaded() const<br> + <br> + <font color=#009900>// load the library with the given name (full or not), return true if ok</font><br> + bool Load(const <a href="#wxString">wxString</a>& libname, int flags = wxDL_DEFAULT);<br> + <br> + <font color=#009900>// raw function for loading dynamic libs: always behaves as if</font><br> + <font color=#009900>// wxDL_VERBATIM were specified and doesn't log error message if the</font><br> + <font color=#009900>// library couldn't be loaded but simply returns NULL</font><br> + <font color=#009900>//static wxDllType RawLoad(const <a href="#wxString">wxString</a>& libname, int flags = wxDL_DEFAULT);</font><br> + <br> + <font color=#009900>// detach the library object from its handle, i.e. prevent the object from</font><br> + <font color=#009900>// unloading the library in its dtor -- the caller is now responsible for doing this</font><br> + <font color=#009900>//wxDllType Detach()</font><br> + <br> + <font color=#009900>// unload the given library handle (presumably returned by Detach() before)</font><br> + <font color=#009900>//static void Unload(wxDllType handle);</font><br> + <br> + <font color=#009900>// unload the library, also done automatically in dtor</font><br> + void Unload()<br> + <br> + <font color=#009900>// Return the raw handle from dlopen and friends.</font><br> + <font color=#009900>//wxDllType GetLibHandle() const { return m_handle; }</font><br> + <br> + <font color=#009900>// check if the given symbol is present in the library, useful to verify if</font><br> + <font color=#009900>// a loadable module is our plugin, for example, without provoking error</font><br> + <font color=#009900>// messages from GetSymbol()</font><br> + bool HasSymbol(const <a href="#wxString">wxString</a>& name) const<br> + <br> + <font color=#009900>// resolve a symbol in a loaded DLL, such as a variable or function name.</font><br> + <font color=#009900>// 'name' is the (possibly mangled) name of the symbol. (use extern "C" to</font><br> + <font color=#009900>// export unmangled names)</font><br> + <font color=#009900>// Since it is perfectly valid for the returned symbol to actually be NULL,</font><br> + <font color=#009900>// that is not always indication of an error. Pass and test the parameter</font><br> + <font color=#009900>// 'success' for a true indication of success or failure to load the symbol.</font><br> + <font color=#009900>// Returns a pointer to the symbol on success, or NULL if an error occurred</font><br> + <font color=#009900>// or the symbol wasn't found.</font><br> + <font color=#009900>//void *GetSymbol(const <a href="#wxString">wxString</a>& name, bool *success = NULL) const;</font><br> + <br> + <font color=#009900>// low-level version of GetSymbol()</font><br> + <font color=#009900>//static void *RawGetSymbol(wxDllType handle, const <a href="#wxString">wxString</a>& name);</font><br> + <font color=#009900>//void *RawGetSymbol(const <a href="#wxString">wxString</a>& name) const</font><br> + <br> + <font color=#009900>//#ifdef __WXMSW__</font><br> + <font color=#009900>// this function is useful for loading functions from the standard Windows</font><br> + <font color=#009900>// DLLs: such functions have an 'A' (in ANSI build) or 'W' (in Unicode, or</font><br> + <font color=#009900>// wide character build) suffix if they take string parameters</font><br> + <font color=#009900>//static void *RawGetSymbolAorW(wxDllType handle, const <a href="#wxString">wxString</a>& name)</font><br> + <font color=#009900>//void *GetSymbolAorW(const <a href="#wxString">wxString</a>& name) const</font><br> + <font color=#009900>//#endif // __WXMSW__</font><br> + <br> + <font color=#009900>// return all modules/shared libraries in the address space of this process</font><br> + <font color=#009900>// returns an empty array if not implemented or an error occurred</font><br> + static <a href="#wxDynamicLibraryDetailsArray">wxDynamicLibraryDetailsArray</a> ListLoaded();<br> + <br> + <font color=#009900>// return platform-specific name of dynamic library with proper extension</font><br> + <font color=#009900>// and prefix (e.g. "foo.dll" on Windows or "libfoo.so" on Linux)</font><br> + static <a href="#wxString">wxString</a> CanonicalizeName(const <a href="#wxString">wxString</a>& name, <a href="#wxDynamicLibraryCategory">wxDynamicLibraryCategory</a> cat = wxDL_LIBRARY);<br> + <br> + <font color=#009900>// return name of wxWidgets plugin (adds compiler and version info</font><br> + <font color=#009900>// to the filename):</font><br> + static <a href="#wxString">wxString</a> CanonicalizePluginName(const <a href="#wxString">wxString</a>& name, <a href="#wxPluginCategory">wxPluginCategory</a> cat = wxDL_PLUGIN_GUI);<br> + <br> + <font color=#009900>// return plugin directory on platforms where it makes sense and empty string on others:</font><br> + static <a href="#wxString">wxString</a> GetPluginsDirectory()<br> + </blockquote><font color=#DD0000><font color=#DD0000><i>%endclass</i></font></font><br> + <br> + <br> + <font color=#009900>// ---------------------------------------------------------------------------</font><br> + <font color=#009900>// wxPluginLibrary - You cannot use this within wxLua</font><br> + <br> + <font color=#009900>// ---------------------------------------------------------------------------</font><br> + <font color=#009900>// wxPluginManager - You cannot use this within wxLua</font><br> + <br> + <br> + <i>%endif</i> <font color=#009900>// wxLUA_USE_wxDynamicLibrary && wxUSE_DYNLIB_CLASS</font><br> <br><HR> *************** *** 7826,7832 **** <font color=#009900>// domains are searched in the last to first order, i.e. catalogs</font><br> <font color=#009900>// added later override those added before.</font><br> ! virtual <a href="#wxString">wxString</a> GetString(const <a href="#wxString">wxString</a>& szOrigString, const <a href="#wxString">wxString</a>& szDomain = "") const;<br> <font color=#009900>// plural form version of the same:</font><br> ! virtual <a href="#wxString">wxString</a> GetString(const <a href="#wxString">wxString</a>& szOrigString, const <a href="#wxString">wxString</a>& szOrigString2, size_t n, const <a href="#wxString">wxString</a>& szDomain = "") const;<br> <br> <font color=#009900>// Returns the current short name for the locale</font><br> --- 7991,7997 ---- <font color=#009900>// domains are searched in the last to first order, i.e. catalogs</font><br> <font color=#009900>// added later override those added before.</font><br> ! virtual <a href="#wxString">wxString</a> GetString(const <a href="#wxString">wxString</a>& szOrigString, const wxChar* szDomain = NULL) const;<br> <font color=#009900>// plural form version of the same:</font><br> ! virtual <a href="#wxString">wxString</a> GetString(const <a href="#wxString">wxString</a>& szOrigString, const <a href="#wxString">wxString</a>& szOrigString2, size_t n, const wxChar* szDomain = NULL) const;<br> <br> <font color=#009900>// Returns the current short name for the locale</font><br> *************** *** 8584,8588 **** <font color=#009900>// <i>%function</i> wxTipProvider* wxCreateFileTipProvider(const <a href="#wxString">wxString</a>& filename, size_t currentTip)</font><br> <br> ! <font color=#006666><i>%define_string</i> wxDirSelectorPromptStr</font><br> <font color=#AA0000><i>%function</i> <a href="#wxString">wxString</a> wxDirSelector(const <a href="#wxString">wxString</a>& message = wxDirSelectorPromptStr, const <a href="#wxString">wxString</a>& default_path = "", long style = wxDD_DEFAULT_STYLE, const <a href="#wxPoint">wxPoint</a>& pos = wxDefaultPosition, <a href="#wxWindow">wxWindow</a> *parent = NULL)</font><br> <font color=#AA0000><i>%function</i> <a href="#wxString">wxString</a> wxFileSelector(const <a href="#wxString">wxString</a>& message, const <a href="#wxString">wxString</a>& default_path = "", const <a href="#wxString">wxString</a>& default_filename = "", const <a href="#wxString">wxString</a>& default_extension = "", const <a href="#wxString">wxString</a>& wildcard = "*.*", int flags = 0, <a href="#wxWindow">wxWindow</a> *parent = NULL, int x = -1, int y = -1)</font><br> --- 8749,8753 ---- <font color=#009900>// <i>%function</i> wxTipProvider* wxCreateFileTipProvider(const <a href="#wxString">wxString</a>& filename, size_t currentTip)</font><br> <br> ! <font color=#006666><i>%define_string</i> wxDirSelectorPromptStr wxT("Select a directory")</font><br> <font color=#AA0000><i>%function</i> <a href="#wxString">wxString</a> wxDirSelector(const <a href="#wxString">wxString</a>& message = wxDirSelectorPromptStr, const <a href="#wxString">wxString</a>& default_path = "", long style = wxDD_DEFAULT_STYLE, const <a href="#wxPoint">wxPoint</a>& pos = wxDefaultPosition, <a href="#wxWindow">wxWindow</a> *parent = NULL)</font><br> <font color=#AA0000><i>%function</i> <a href="#wxString">wxString</a> wxFileSelector(const <a href="#wxString">wxString</a>& message, const <a href="#wxString">wxString</a>& default_path = "", const <a href="#wxString">wxString</a>& default_filename = "", const <a href="#wxString">wxString</a>& default_extension = "", const <a href="#wxString">wxString</a>& wildcard = "*.*", int flags = 0, <a href="#wxWindow">wxWindow</a> *parent = NULL, int x = -1, int y = -1)</font><br> *************** *** 8768,8772 **** <i>%include</i> "wx/filedlg.h"<br> <br> ! <font color=#006666><i>%define_string</i> wxFileSelectorPromptStr</font><br> <font color=#006666><i>%define_string</i> wxFileSelectorDefaultWildcardStr</font><br> <br> --- 8933,8937 ---- <i>%include</i> "wx/filedlg.h"<br> <br> ! <font color=#006666><i>%define_string</i> wxFileSelectorPromptStr wxT("Select a file")</font><br> <font color=#006666><i>%define_string</i> wxFileSelectorDefaultWildcardStr</font><br> <br> *************** *** 14337,14341 **** <font color=#009900>//void DisplayContents() - see <a href="#wxHelpControllerBase">wxHelpControllerBase</a></font><br> void DisplayIndex()<br> ! bool KeywordSearch(const <a href="#wxString">wxString</a>& keyword, <a href="#wxHelpSearchMode">wxHelpSearchMode</a> mode = wxHELP_SEARCH_ALL)<br> void ReadCustomization(<a href="#wxConfigBase">wxConfigBase</a>* cfg, <a href="#wxString">wxString</a> path = "")<br> void SetTempDir(const <a href="#wxString">wxString</a>& path)<br> --- 14502,14506 ---- <font color=#009900>//void DisplayContents() - see <a href="#wxHelpControllerBase">wxHelpControllerBase</a></font><br> void DisplayIndex()<br> ! <font color=#009900>// bool KeywordSearch(const <a href="#wxString">wxString</a>& keyword, <a href="#wxHelpSearchMode">wxHelpSearchMode</a> mode = wxHELP_SEARCH_ALL) // see base</font><br> void ReadCustomization(<a href="#wxConfigBase">wxConfigBase</a>* cfg, <a href="#wxString">wxString</a> path = "")<br> void SetTempDir(const <a href="#wxString">wxString</a>& path)<br> |
From: John L. <jr...@us...> - 2007-06-27 19:56:32
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/setup In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18874/wxLua/modules/wxbind/setup Modified Files: wxluasetup.h Log Message: Add wxDynamicLibrary and friends to bindings Index: wxluasetup.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/setup/wxluasetup.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wxluasetup.h 27 Jun 2007 03:11:28 -0000 1.16 --- wxluasetup.h 27 Jun 2007 19:56:29 -0000 1.17 *************** *** 50,53 **** --- 50,54 ---- #define wxLUA_USE_wxDisplay 1 #define wxLUA_USE_wxDragDrop 1 + #define wxLUA_USE_wxDynamicLibrary 1 #define wxLUA_USE_wxFile 1 #define wxLUA_USE_wxFileDialog 1 |
From: John L. <jr...@us...> - 2007-06-27 15:57:23
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21869/wxLua/bindings/wxwidgets Modified Files: datetime.i dialogs.i Log Message: Replace wxDirSelectorPromptStr, wxFileSelectorPromptStr with wxT("value") for MingW 3.4.5 Fix wxLocale::GetString to use const wxChar* instead of wxString since MingW 3.4.5 doesn't that that an emptystring evalues to NULL Index: datetime.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/datetime.i,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** datetime.i 27 Jun 2007 03:11:27 -0000 1.37 --- datetime.i 27 Jun 2007 15:57:13 -0000 1.38 *************** *** 895,901 **** // domains are searched in the last to first order, i.e. catalogs // added later override those added before. ! virtual wxString GetString(const wxString& szOrigString, const wxString& szDomain = "") const; // plural form version of the same: ! virtual wxString GetString(const wxString& szOrigString, const wxString& szOrigString2, size_t n, const wxString& szDomain = "") const; // Returns the current short name for the locale --- 895,901 ---- // domains are searched in the last to first order, i.e. catalogs // added later override those added before. ! virtual wxString GetString(const wxString& szOrigString, const wxChar* szDomain = NULL) const; // plural form version of the same: ! virtual wxString GetString(const wxString& szOrigString, const wxString& szOrigString2, size_t n, const wxChar* szDomain = NULL) const; // Returns the current short name for the locale Index: dialogs.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/dialogs.i,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** dialogs.i 25 Jun 2007 03:19:37 -0000 1.37 --- dialogs.i 27 Jun 2007 15:57:13 -0000 1.38 *************** *** 52,56 **** // %function wxTipProvider* wxCreateFileTipProvider(const wxString& filename, size_t currentTip) ! %define_string wxDirSelectorPromptStr %function wxString wxDirSelector(const wxString& message = wxDirSelectorPromptStr, const wxString& default_path = "", long style = wxDD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, wxWindow *parent = NULL) %function wxString wxFileSelector(const wxString& message, const wxString& default_path = "", const wxString& default_filename = "", const wxString& default_extension = "", const wxString& wildcard = "*.*", int flags = 0, wxWindow *parent = NULL, int x = -1, int y = -1) --- 52,56 ---- // %function wxTipProvider* wxCreateFileTipProvider(const wxString& filename, size_t currentTip) ! %define_string wxDirSelectorPromptStr wxT("Select a directory") %function wxString wxDirSelector(const wxString& message = wxDirSelectorPromptStr, const wxString& default_path = "", long style = wxDD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, wxWindow *parent = NULL) %function wxString wxFileSelector(const wxString& message, const wxString& default_path = "", const wxString& default_filename = "", const wxString& default_extension = "", const wxString& wildcard = "*.*", int flags = 0, wxWindow *parent = NULL, int x = -1, int y = -1) *************** *** 232,236 **** %include "wx/filedlg.h" ! %define_string wxFileSelectorPromptStr %define_string wxFileSelectorDefaultWildcardStr --- 232,236 ---- %include "wx/filedlg.h" ! %define_string wxFileSelectorPromptStr wxT("Select a file") %define_string wxFileSelectorDefaultWildcardStr |
From: John L. <jr...@us...> - 2007-06-27 15:57:19
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21869/wxLua/modules/wxbind/src Modified Files: datetime.cpp wx_bind.cpp Log Message: Replace wxDirSelectorPromptStr, wxFileSelectorPromptStr with wxT("value") for MingW 3.4.5 Fix wxLocale::GetString to use const wxChar* instead of wxString since MingW 3.4.5 doesn't that that an emptystring evalues to NULL Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** wx_bind.cpp 27 Jun 2007 03:11:29 -0000 1.121 --- wx_bind.cpp 27 Jun 2007 15:57:14 -0000 1.122 *************** *** 3701,3705 **** #endif // wxLUA_USE_wxGenericDirCtrl && wxUSE_DIRDLG ! { "wxDirSelectorPromptStr", wxDirSelectorPromptStr }, { "wxFILE_SEP_DSK", wxT(":") }, { "wxFILE_SEP_EXT", wxT(".") }, --- 3701,3705 ---- #endif // wxLUA_USE_wxGenericDirCtrl && wxUSE_DIRDLG ! { "wxDirSelectorPromptStr", wxT("Select a directory") }, { "wxFILE_SEP_DSK", wxT(":") }, { "wxFILE_SEP_EXT", wxT(".") }, *************** *** 3712,3716 **** #if wxLUA_USE_wxFileDialog && wxUSE_FILEDLG { "wxFileSelectorDefaultWildcardStr", wxFileSelectorDefaultWildcardStr }, ! { "wxFileSelectorPromptStr", wxFileSelectorPromptStr }, #endif // wxLUA_USE_wxFileDialog && wxUSE_FILEDLG --- 3712,3716 ---- #if wxLUA_USE_wxFileDialog && wxUSE_FILEDLG { "wxFileSelectorDefaultWildcardStr", wxFileSelectorDefaultWildcardStr }, ! { "wxFileSelectorPromptStr", wxT("Select a file") }, #endif // wxLUA_USE_wxFileDialog && wxUSE_FILEDLG Index: datetime.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/datetime.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** datetime.cpp 27 Jun 2007 14:29:54 -0000 1.54 --- datetime.cpp 27 Jun 2007 15:57:14 -0000 1.55 *************** *** 5737,5741 **** static int LUACALL wxLua_wxLocale_GetString1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_GetString1[1] = {{ wxLua_wxLocale_GetString1, WXLUAMETHOD_METHOD, 4, 5, s_wxluatagArray_wxLua_wxLocale_GetString1 }}; ! // virtual wxString GetString(const wxString& szOrigString, const wxString& szOrigString2, size_t n, const wxString& szDomain = "") const; static int LUACALL wxLua_wxLocale_GetString1(lua_State *L) { --- 5737,5741 ---- static int LUACALL wxLua_wxLocale_GetString1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_GetString1[1] = {{ wxLua_wxLocale_GetString1, WXLUAMETHOD_METHOD, 4, 5, s_wxluatagArray_wxLua_wxLocale_GetString1 }}; ! // virtual wxString GetString(const wxString& szOrigString, const wxString& szOrigString2, size_t n, const wxChar* szDomain = NULL) const; static int LUACALL wxLua_wxLocale_GetString1(lua_State *L) { *************** *** 5744,5749 **** // get number of arguments int argCount = lua_gettop(L); ! // const wxString szDomain = "" ! const wxString szDomain = (argCount >= 5 ? wxlState.GetwxStringType(5) : wxString(wxEmptyString)); // size_t n size_t n = (size_t)wxlua_getnumbertype(L, 4); --- 5744,5749 ---- // get number of arguments int argCount = lua_gettop(L); ! // const wxChar szDomain = NULL ! wxString szDomain = (argCount >= 5 ? wxlState.GetwxStringType(5) : wxString(wxEmptyString)); // size_t n size_t n = (size_t)wxlua_getnumbertype(L, 4); *************** *** 5755,5759 **** wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); // call GetString ! returns = (self->GetString(szOrigString, szOrigString2, n, szDomain)); // push the result string wxlState.lua_PushString(returns); --- 5755,5759 ---- wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); // call GetString ! returns = (self->GetString(szOrigString, szOrigString2, n, szDomain.IsEmpty() ? NULL : szDomain.c_str())); // push the result string wxlState.lua_PushString(returns); *************** *** 5765,5769 **** static int LUACALL wxLua_wxLocale_GetString(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_GetString[1] = {{ wxLua_wxLocale_GetString, WXLUAMETHOD_METHOD, 2, 3, s_wxluatagArray_wxLua_wxLocale_GetString }}; ! // virtual wxString GetString(const wxString& szOrigString, const wxString& szDomain = "") const; static int LUACALL wxLua_wxLocale_GetString(lua_State *L) { --- 5765,5769 ---- static int LUACALL wxLua_wxLocale_GetString(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxLocale_GetString[1] = {{ wxLua_wxLocale_GetString, WXLUAMETHOD_METHOD, 2, 3, s_wxluatagArray_wxLua_wxLocale_GetString }}; ! // virtual wxString GetString(const wxString& szOrigString, const wxChar* szDomain = NULL) const; static int LUACALL wxLua_wxLocale_GetString(lua_State *L) { *************** *** 5772,5777 **** // get number of arguments int argCount = lua_gettop(L); ! // const wxString szDomain = "" ! const wxString szDomain = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // const wxString szOrigString const wxString szOrigString = wxlState.GetwxStringType(2); --- 5772,5777 ---- // get number of arguments int argCount = lua_gettop(L); ! // const wxChar szDomain = NULL ! wxString szDomain = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // const wxString szOrigString const wxString szOrigString = wxlState.GetwxStringType(2); *************** *** 5779,5783 **** wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); // call GetString ! returns = (self->GetString(szOrigString, szDomain)); // push the result string wxlState.lua_PushString(returns); --- 5779,5783 ---- wxLocale * self = (wxLocale *)wxlState.GetUserDataType(1, s_wxluatag_wxLocale); // call GetString ! returns = (self->GetString(szOrigString, szDomain.IsEmpty() ? NULL : szDomain.c_str())); // push the result string wxlState.lua_PushString(returns); |
From: John L. <jr...@us...> - 2007-06-27 14:29:59
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18369/wxLua/modules/wxbind/src Modified Files: datetime.cpp gdi.cpp windows.cpp Log Message: Fix extra #endif statements from %member tags Index: windows.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/windows.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** windows.cpp 26 Jun 2007 03:22:07 -0000 1.69 --- windows.cpp 27 Jun 2007 14:29:54 -0000 1.70 *************** *** 265,272 **** #if wxLUA_USE_wxFont - { "font", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxVisualAttributes_GetFont, 1, NULL }, - #elif 1 { "font", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxVisualAttributes_SetFont, 1, NULL }, ! #endif // 1 { 0, 0, 0, 0 }, }; --- 265,272 ---- #if wxLUA_USE_wxFont { "font", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxVisualAttributes_SetFont, 1, NULL }, ! { "font", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxVisualAttributes_GetFont, 1, NULL }, ! #endif // wxLUA_USE_wxFont ! { 0, 0, 0, 0 }, }; Index: gdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/gdi.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** gdi.cpp 27 Jun 2007 03:11:29 -0000 1.80 --- gdi.cpp 27 Jun 2007 14:29:54 -0000 1.81 *************** *** 16071,16079 **** #endif // (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxRenderer) - #if (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) - #if (wxLUA_USE_wxFont) && (wxLUA_USE_wxRenderer) #endif // (wxLUA_USE_wxFont) && (wxLUA_USE_wxRenderer) --- 16071,16077 ---- *************** *** 16152,16157 **** { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxHeaderButtonParams_delete, 1, NULL }, - { "m_arrowColour", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_arrowColour, 1, NULL }, { "m_arrowColour", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_arrowColour, 1, NULL }, #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) --- 16150,16156 ---- { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxHeaderButtonParams_delete, 1, NULL }, + #if (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) + { "m_arrowColour", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_arrowColour, 1, NULL }, { "m_arrowColour", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_arrowColour, 1, NULL }, #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) *************** *** 16159,16174 **** { "m_labelAlignment", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelAlignment, 1, NULL }, { "m_labelAlignment", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelAlignment, 1, NULL }, - { "m_labelBitmap", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelBitmap, 1, NULL }, { "m_labelBitmap", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelBitmap, 1, NULL }, #endif // (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxRenderer) { "m_labelColour", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelColour, 1, NULL }, - { "m_labelColour", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelColour, 1, NULL }, #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) { "m_labelFont", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelFont, 1, NULL }, - { "m_labelFont", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelFont, 1, NULL }, #endif // (wxLUA_USE_wxFont) && (wxLUA_USE_wxRenderer) --- 16158,16174 ---- { "m_labelAlignment", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelAlignment, 1, NULL }, { "m_labelAlignment", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelAlignment, 1, NULL }, + #if (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxRenderer) + { "m_labelBitmap", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelBitmap, 1, NULL }, { "m_labelBitmap", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelBitmap, 1, NULL }, #endif // (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxRenderer) + #if (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) { "m_labelColour", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelColour, 1, NULL }, { "m_labelColour", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelColour, 1, NULL }, #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) + #if (wxLUA_USE_wxFont) && (wxLUA_USE_wxRenderer) { "m_labelFont", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelFont, 1, NULL }, { "m_labelFont", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelFont, 1, NULL }, #endif // (wxLUA_USE_wxFont) && (wxLUA_USE_wxRenderer) *************** *** 16176,16181 **** { "m_labelText", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelText, 1, NULL }, { "m_labelText", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelText, 1, NULL }, - { "m_selectionColour", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_selectionColour, 1, NULL }, { "m_selectionColour", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_selectionColour, 1, NULL }, #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) --- 16176,16182 ---- { "m_labelText", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_labelText, 1, NULL }, { "m_labelText", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_labelText, 1, NULL }, + #if (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) + { "m_selectionColour", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Set_m_selectionColour, 1, NULL }, { "m_selectionColour", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxHeaderButtonParams_Get_m_selectionColour, 1, NULL }, #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxRenderer) Index: datetime.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/datetime.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** datetime.cpp 27 Jun 2007 03:11:28 -0000 1.53 --- datetime.cpp 27 Jun 2007 14:29:54 -0000 1.54 *************** *** 5333,5339 **** - #if (wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL) - #endif // (wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL) - #if ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) #endif // ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) --- 5333,5336 ---- *************** *** 5461,5469 **** { "Language", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Get_Language, 1, NULL }, ! #if (wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL) { "LayoutDirection", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Set_LayoutDirection, 1, NULL }, - #elif ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) { "LayoutDirection", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Get_LayoutDirection, 1, NULL }, #endif // ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) { "Set_CanonicalName", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_CanonicalName, 1, NULL }, { "Set_Description", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_Description, 1, NULL }, --- 5458,5466 ---- { "Language", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Get_Language, 1, NULL }, ! #if ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) { "LayoutDirection", WXLUAMETHOD_SETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Set_LayoutDirection, 1, NULL }, { "LayoutDirection", WXLUAMETHOD_GETPROP, s_wxluafunc_wxLua_wxLanguageInfo_Get_LayoutDirection, 1, NULL }, #endif // ((wxLUA_USE_wxDC) && (wxCHECK_VERSION(2,8,0))) && ((wxCHECK_VERSION(2,8,0)) && (wxUSE_INTL)) + { "Set_CanonicalName", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_CanonicalName, 1, NULL }, { "Set_Description", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLanguageInfo_Set_Description, 1, NULL }, |
From: John L. <jr...@us...> - 2007-06-27 14:29:58
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18369/wxLua/bindings Modified Files: genwxbind.lua Log Message: Fix extra #endif statements from %member tags Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** genwxbind.lua 27 Jun 2007 03:11:26 -0000 1.136 --- genwxbind.lua 27 Jun 2007 14:29:54 -0000 1.137 *************** *** 2876,2880 **** FuncType = "WXLUAMETHOD_SETPROP", Map = " { \""..member.Name.."\", WXLUAMETHOD_SETPROP, "..funcMapName..", 1, NULL },\n", ! Condition = fullcondition } --- 2876,2880 ---- FuncType = "WXLUAMETHOD_SETPROP", Map = " { \""..member.Name.."\", WXLUAMETHOD_SETPROP, "..funcMapName..", 1, NULL },\n", ! Condition = membercondition } |