From: John L. <jr...@us...> - 2007-03-09 06:10:50
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16936/wxLua/bindings/wxwidgets Modified Files: config.i controls.i event.i override.hpp windows.i wx_datatypes.lua Log Message: update to wxWidgets 2.8 using C++ headers Make wxConfig::Read return [bool, value] not the other way around Index: config.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/config.i,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** config.i 9 Mar 2007 00:15:12 -0000 1.16 --- config.i 9 Mar 2007 06:10:15 -0000 1.17 *************** *** 24,28 **** wxCONFIG_USE_RELATIVE_PATH wxCONFIG_USE_NO_ESCAPE_CHARACTERS ! %wxchkver_2_8 wxCONFIG_USE_SUBDIR %endenum --- 24,28 ---- wxCONFIG_USE_RELATIVE_PATH wxCONFIG_USE_NO_ESCAPE_CHARACTERS ! %wxchkver_2_8_1 wxCONFIG_USE_SUBDIR %endenum *************** *** 82,92 **** // Note: wxConfigBase::Read naming convention is same as wxPython, int is long, float is double ! // %override [string, bool] wxConfigBase::Read(const wxString& key, const wxString& defaultVal = "") //bool Read(const wxString& key, wxString* str, const wxString& defaultVal = "") const bool Read(const wxString& key, const wxString& defaultVal = "") const ! // %override [int, bool] wxConfigBase::ReadInt(const wxString& key, long defaultVal = 0) //%rename ReadInt bool Read(const wxString& key, long* l, long defaultVal = 0) const %rename ReadInt bool Read(const wxString& key, long defaultVal = 0) const ! // %override [double, bool] wxConfigBase::ReadFloat(const wxString& key, double defaultVal = 0) //%rename ReadFloat bool Read(const wxString& key, double* d, double defaultVal = 0) const %rename ReadFloat bool Read(const wxString& key, double defaultVal = 0) const --- 82,92 ---- // Note: wxConfigBase::Read naming convention is same as wxPython, int is long, float is double ! // %override [bool, string] wxConfigBase::Read(const wxString& key, const wxString& defaultVal = "") //bool Read(const wxString& key, wxString* str, const wxString& defaultVal = "") const bool Read(const wxString& key, const wxString& defaultVal = "") const ! // %override [bool, int] wxConfigBase::ReadInt(const wxString& key, long defaultVal = 0) //%rename ReadInt bool Read(const wxString& key, long* l, long defaultVal = 0) const %rename ReadInt bool Read(const wxString& key, long defaultVal = 0) const ! // %override [bool, double] wxConfigBase::ReadFloat(const wxString& key, double defaultVal = 0) //%rename ReadFloat bool Read(const wxString& key, double* d, double defaultVal = 0) const %rename ReadFloat bool Read(const wxString& key, double defaultVal = 0) const Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** wx_datatypes.lua 9 Mar 2007 00:15:12 -0000 1.52 --- wx_datatypes.lua 9 Mar 2007 06:10:16 -0000 1.53 *************** *** 77,80 **** --- 77,85 ---- Name = "PVOID", }, + Propagation_state = { + DefType = "enum", + IsNumber = true, + Name = "Propagation_state", + }, WXTYPE = { DefType = "number", *************** *** 2471,2474 **** --- 2476,2489 ---- Name = "wxProgressDialog", }, + wxPropagateOnce = { + DefType = "class", + IsNumber = false, + Name = "wxPropagateOnce", + }, + wxPropagationDisabler = { + DefType = "class", + IsNumber = false, + Name = "wxPropagationDisabler", + }, wxProtocol = { BaseClass = "wxSocketClient", *************** *** 3467,3470 **** --- 3482,3486 ---- ["%wxchkver_2_7"] = "wxCHECK_VERSION(2,7,0)", ["%wxchkver_2_8"] = "wxCHECK_VERSION(2,8,0)", + ["%wxchkver_2_8_1"] = "wxCHECK_VERSION(2,8,1)", ["%wxcompat_2_4"] = "(defined(WXWIN_COMPATIBILITY_2_4) && WXWIN_COMPATIBILITY_2_4)", ["%wxcompat_2_6"] = "(defined(WXWIN_COMPATIBILITY_2_6) && WXWIN_COMPATIBILITY_2_6)", Index: windows.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/windows.i,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** windows.i 9 Mar 2007 00:15:12 -0000 1.29 --- windows.i 9 Mar 2007 06:10:16 -0000 1.30 *************** *** 8,11 **** --- 8,14 ---- // ============================================================================ + + %wxchkver_2_8 %function wxWindow* wxFindFocusDescendant(wxWindow* ancestor) + //----------------------------------------------------------------------------- // wxWindowDisabler Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/override.hpp,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** override.hpp 2 Mar 2007 05:44:22 -0000 1.61 --- override.hpp 9 Mar 2007 06:10:15 -0000 1.62 *************** *** 474,481 **** // call Read bool ret = self->Read(key, &returns, defaultVal); - // push the result number - wxlState.lua_PushString(returns); // push the result bool lua_pushboolean(L, ret); // return the number of parameters return 2; --- 474,481 ---- // call Read bool ret = self->Read(key, &returns, defaultVal); // push the result bool lua_pushboolean(L, ret); + // push the result string + wxlState.lua_PushString(returns); // return the number of parameters return 2; *************** *** 499,506 **** // call Read bool ret = self->Read(key, &returns, defaultVal); - // push the result number - lua_pushnumber(L, returns); // push the result bool lua_pushboolean(L, ret); // return the number of parameters return 2; --- 499,506 ---- // call Read bool ret = self->Read(key, &returns, defaultVal); // push the result bool lua_pushboolean(L, ret); + // push the result number + lua_pushnumber(L, returns); // return the number of parameters return 2; *************** *** 524,531 **** // call Read bool ret = self->Read(key, &returns, defaultVal); - // push the result number - lua_pushnumber(L, returns); // push the result bool lua_pushboolean(L, ret); // return the number of parameters return 2; --- 524,531 ---- // call Read bool ret = self->Read(key, &returns, defaultVal); // push the result bool lua_pushboolean(L, ret); + // push the result number + lua_pushnumber(L, returns); // return the number of parameters return 2; *************** *** 637,660 **** // ---------------------------------------------------------------------------- - - %override wxLua_wxControlWithItems_GetStringClientObject - // %rename GetStringClientObject wxStringClientData* GetClientObject(int n) const - static int LUACALL wxLua_wxControlWithItems_GetStringClientObject(lua_State *L) - { - wxLuaState wxlState(L); - wxStringClientData *returns; - // int n - int n = (int)wxlState.GetNumberType(2); - // get this - wxControlWithItems * self = (wxControlWithItems *)wxlState.GetUserDataType(1, s_wxluatag_wxControlWithItems); - // call GetClientObject - returns = (wxStringClientData*)self->GetClientObject(n); - // push the result datatype - wxlState.PushUserDataType(s_wxluatag_wxStringClientData, returns); - - return 1; - } - %end - %override wxLua_wxListBox_GetSelections // int GetSelections(wxArrayInt& selections) const --- 637,640 ---- *************** *** 703,720 **** %override wxLua_wxListCtrl_SortItems ! static int wxLua_LCF_tag = -1; ! static wxLuaState wxLua_LCF_wxlState; int wxCALLBACK wxLua_ListCompareFunction(long item1, long item2, long sortData) { ! lua_State *L = wxLua_LCF_wxlState.GetLuaState(); ! lua_rawgeti(L, LUA_REGISTRYINDEX, wxLua_LCF_tag); lua_pushnumber(L, item1); lua_pushnumber(L, item2); ! lua_pushnumber(L, sortData); ! wxLua_LCF_wxlState.LuaCall(3, 1); ! int returns = (int)wxLua_LCF_wxlState.GetNumberType(1); ! return returns; } --- 683,706 ---- %override wxLua_wxListCtrl_SortItems ! ! struct wxLua_LCF_data // wrap up the wxLuaState, lua_tag, and the compare data ! { ! wxLuaState* wxlState; ! int lua_tag; ! long data; ! }; int wxCALLBACK wxLua_ListCompareFunction(long item1, long item2, long sortData) { ! wxLua_LCF_data* LCF_data = (wxLua_LCF_data*)sortData; ! ! lua_State *L = LCF_data->wxlState->GetLuaState(); ! lua_rawgeti(L, LUA_REGISTRYINDEX, LCF_data->lua_tag); lua_pushnumber(L, item1); lua_pushnumber(L, item2); ! lua_pushnumber(L, LCF_data->data); ! LCF_data->wxlState->LuaCall(3, 1); ! return (int)LCF_data->wxlState->GetNumberType(1); } *************** *** 723,730 **** { wxLuaState wxlState(L); - wxLua_LCF_wxlState = wxlState; long returns; // long data long data = (long)wxlState.GetNumberType(3); // get this wxListCtrl *self = (wxListCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxListCtrl); --- 709,716 ---- { wxLuaState wxlState(L); long returns; // long data long data = (long)wxlState.GetNumberType(3); + wxLua_LCF_data LCF_data = { &wxlState, -1, data }; // get this wxListCtrl *self = (wxListCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxListCtrl); *************** *** 733,745 **** // lua sort function, was index 2 is now index 1 if (lua_isfunction (L, 1)) ! wxLua_LCF_tag = luaL_ref(L, LUA_REGISTRYINDEX); // pops it from stack else ! wxlState.terror(wxString::Format(_("wxLua: Expected lua function for parameter %d, but got '%s'."), 2, wxlState.lua_TypeNameIndex(1).c_str())); // call SortItems ! returns = self->SortItems(wxLua_ListCompareFunction, data); ! wxLua_LCF_wxlState.Destroy(); ! wxLua_LCF_tag = -1; // push the result number lua_pushnumber(L, returns); --- 719,729 ---- // lua sort function, was index 2 is now index 1 if (lua_isfunction (L, 1)) ! LCF_data.lua_tag = luaL_ref(L, LUA_REGISTRYINDEX); // pops it from stack else ! wxlState.terror(wxString::Format(_("wxLua: Expected lua function(long item1, long item2, long data) for parameter %d, but got '%s'."), 2, wxlState.lua_TypeNameIndex(1).c_str())); // call SortItems ! returns = self->SortItems(wxLua_ListCompareFunction, (long)&LCF_data); // push the result number lua_pushnumber(L, returns); *************** *** 1071,1075 **** } - private: wxString valString; }; --- 1055,1058 ---- Index: controls.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/controls.i,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** controls.i 9 Mar 2007 00:15:12 -0000 1.29 --- controls.i 9 Mar 2007 06:10:15 -0000 1.30 *************** *** 145,150 **** //void* GetClientData(unsigned int n) const wxClientData* GetClientObject(unsigned int n) const - // Get the wxStringClientData if and only if you have called SetClientObject with a wxStringClientData - // %override %rename GetStringClientObject wxStringClientData* GetClientObject(int n) const %rename GetStringClientObject wxStringClientData* GetClientObject(int n) const int GetCount() const --- 145,148 ---- Index: event.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/event.i,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** event.i 9 Mar 2007 00:15:12 -0000 1.19 --- event.i 9 Mar 2007 06:10:15 -0000 1.20 *************** *** 50,53 **** --- 50,58 ---- %include "wx/event.h" + %enum Propagation_state + wxEVENT_PROPAGATE_NONE // don't propagate it at all + wxEVENT_PROPAGATE_MAX // propagate it until it is processed + %endenum + %class %delete wxEvent, wxObject // wxEvent(int id = 0, wxEventType eventType = wxEVT_NULL) virtual base class *************** *** 75,78 **** --- 80,105 ---- //----------------------------------------------------------------------------- + // wxPropagationDisabler + + %include "wx/event.h" + + %class %noclassinfo %encapsulate %delete wxPropagationDisabler + // NOTE: ALWAYS Delete() this when done since lua's gc may not delete it soon enough + wxPropagationDisabler(wxEvent& event) + + %endclass + + //----------------------------------------------------------------------------- + // wxPropagateOnce + + %include "wx/event.h" + + %class %noclassinfo %encapsulate %delete wxPropagateOnce + // NOTE: ALWAYS Delete() this when done since lua's gc may not delete it soon enough + wxPropagateOnce(wxEvent& event) + + %endclass + + //----------------------------------------------------------------------------- // wxCommandEvent *************** *** 120,125 **** wxCommandEvent(wxEventType commandEventType = wxEVT_NULL, int id = 0) ! wxObject* GetClientData() // FIXME does this really work? wxClientData* GetClientObject() long GetExtraLong() int GetInt() --- 147,153 ---- wxCommandEvent(wxEventType commandEventType = wxEVT_NULL, int id = 0) ! wxObject* GetClientData() wxClientData* GetClientObject() + %rename GetStringClientObject wxStringClientData* GetClientObject() long GetExtraLong() int GetInt() *************** *** 832,837 **** --- 860,867 ---- bool GetChecked() const bool GetEnabled() const + %wxchkver_2_8 bool GetShown() const bool GetSetChecked() const bool GetSetEnabled() const + %wxchkver_2_8 bool GetSetShown() const bool GetSetText() const wxString GetText() const *************** *** 842,845 **** --- 872,876 ---- void SetText(const wxString& text) static void SetUpdateInterval(long updateInterval) + %wxchkver_2_8 void Show(bool show) %property=Checked, read *************** *** 869,878 **** %define %event wxEVT_CONTEXT_MENU ! wxHelpEvent(wxEventType type = wxEVT_NULL, wxWindowID id = 0, const wxPoint& pt = wxDefaultPosition) wxString GetLink() wxPoint GetPosition() wxString GetTarget() void SetLink(const wxString& link) void SetPosition(const wxPoint& pos) void SetTarget(const wxString& target) --- 900,912 ---- %define %event wxEVT_CONTEXT_MENU ! !%wxchkver_2_8 wxHelpEvent(wxEventType type = wxEVT_NULL, wxWindowID id = 0, const wxPoint& pt = wxDefaultPosition) ! %wxchkver_2_8 wxHelpEvent(wxEventType type = wxEVT_NULL, wxWindowID id = 0, const wxPoint& pt = wxDefaultPosition, wxHelpEvent::Origin origin = wxHelpEvent::Origin_Unknown) wxString GetLink() + %wxchkver_2_8 wxHelpEvent::Origin GetOrigin() const wxPoint GetPosition() wxString GetTarget() void SetLink(const wxString& link) + %wxchkver_2_8 void SetOrigin(wxHelpEvent::Origin origin) void SetPosition(const wxPoint& pos) void SetTarget(const wxString& target) |