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...> - 2006-12-17 07:47:20
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28504/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp Log Message: separate out the wxluatag arrays and use pointer in WXLUAMETHOD Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wxlbind.cpp 14 Dec 2006 01:01:26 -0000 1.47 --- wxlbind.cpp 17 Dec 2006 07:47:17 -0000 1.48 *************** *** 28,32 **** // and 0 is used as an end marker for tag array that // represents prototypes argument types ! // int s_wxluaarg_None = 0; int s_wxluaarg_String = -2; --- 28,34 ---- // and 0 is used as an end marker for tag array that // represents prototypes argument types ! ! wxLuaArgTag s_wxluaargArray_None[1] = {0}; ! int s_wxluaarg_None = 0; int s_wxluaarg_String = -2; |
From: John L. <jr...@us...> - 2006-12-17 07:47:20
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28504/wxLua/modules/wxbindstc/include Modified Files: wxbind.h Log Message: separate out the wxluatag arrays and use pointer in WXLUAMETHOD Index: wxbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/include/wxbind.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wxbind.h 14 Dec 2006 01:01:26 -0000 1.16 --- wxbind.h 17 Dec 2006 07:47:16 -0000 1.17 *************** *** 22,28 **** #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 3 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 3 // binding class --- 22,28 ---- #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 4 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 4 // binding class |
From: Francesco M. <fr...@us...> - 2006-12-16 12:09:08
|
Update of /cvsroot/wxlua/wxLua/modules/build/bakefiles In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2229/modules/build/bakefiles Modified Files: common.bkl Log Message: fixed DLL output path removing unwanted <dirname> and <include> tags Index: common.bkl =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/build/bakefiles/common.bkl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** common.bkl 11 Dec 2006 00:08:19 -0000 1.8 --- common.bkl 16 Dec 2006 12:09:05 -0000 1.9 *************** *** 165,171 **** </if> - <include>$(SRCDIR)/include</include> - <dirname>$(SRCDIR)/lib</dirname> - <!-- This is required because wxbind.h refers to wx contrib section, too --> <if cond="TARGETING_WIN32=='1'"><include>$(WX_DIR)/contrib/include</include></if> --- 165,168 ---- |
From: Francesco M. <fr...@us...> - 2006-12-16 12:08:23
|
Update of /cvsroot/wxlua/wxLua/build/bakefiles In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1961/build/bakefiles Modified Files: wxluabase.bkl Log Message: moved default version of wxLua bakefiles to 28 changed build directory to be more wx-like Index: wxluabase.bkl =================================================================== RCS file: /cvsroot/wxlua/wxLua/build/bakefiles/wxluabase.bkl,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** wxluabase.bkl 12 Dec 2006 18:30:54 -0000 1.27 --- wxluabase.bkl 16 Dec 2006 12:08:19 -0000 1.28 *************** *** 136,141 **** <set var="SHARED_SUFFIX"> ! <if cond="SHARED=='0'">static</if> ! <if cond="SHARED=='1'">shared</if> </set> --- 136,141 ---- <set var="SHARED_SUFFIX"> ! <if cond="SHARED=='0'"></if> ! <if cond="SHARED=='1'">dll</if> </set> *************** *** 144,148 **** <if cond="FORMAT!='autoconf'"> <set var="BUILDDIR"> ! $(FORMAT)$(WXLUA_LIBPOSTFIX)_$(SHARED_SUFFIX) </set> </if> --- 144,148 ---- <if cond="FORMAT!='autoconf'"> <set var="BUILDDIR"> ! $(COMPILER)$(WXLUA_LIBPOSTFIX)$(SHARED_SUFFIX) </set> </if> |
From: John L. <jr...@us...> - 2006-12-15 19:04:54
|
Update of /cvsroot/wxlua/wxLua/apps/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26807/wxLua/apps/wxlua/src Modified Files: lconsole.cpp Log Message: make the wxLuaEditor a little nicer, more checks and add help info Index: lconsole.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxlua/src/lconsole.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** lconsole.cpp 15 Dec 2006 05:16:01 -0000 1.16 --- lconsole.cpp 15 Dec 2006 19:04:47 -0000 1.17 *************** *** 19,25 **** #endif ! #if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) #include "art/wxlua.xpm" ! #endif #include "wx/splitter.h" --- 19,25 ---- #endif ! //#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) #include "art/wxlua.xpm" ! //#endif #include "wx/splitter.h" |
From: John L. <jr...@us...> - 2006-12-15 19:04:51
|
Update of /cvsroot/wxlua/wxLua/apps/wxluaedit/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26807/wxLua/apps/wxluaedit/src Modified Files: wxledit.cpp wxledit.h wxluaedit.cpp Log Message: make the wxLuaEditor a little nicer, more checks and add help info Index: wxledit.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxledit.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wxledit.h 15 Dec 2006 05:16:01 -0000 1.16 --- wxledit.h 15 Dec 2006 19:04:48 -0000 1.17 *************** *** 106,121 **** wxLuaState GetwxLuaState() const { return m_wxlState; } // Set this shell to use another interpreter, will close it if !is_static - // note shell has built in function virtual void SetwxLuaState(const wxLuaState& wxlState, bool is_static); ! // Used to create/recreate local interpreter ! // Can be subclassed to use your own interpreter derived from a wxLuaState ! // or a new interpreter can be set in by catching the wxEVT_LUASHELL_wxLUA_CREATION ! // wxLuaEvent that's sent with this control's id and *this as the GetEventObject ! // the preferred window ID is in event.GetExtraLong() ! // if you call event.SetwxLuaState(wxLuaState(...)) ! // and event.SetInt(1 for static interpreter or 0 for not static) ! // then SetLuaIntpreter(event.GetLuaInterpreter(), event.GetInt() == 1) ! // is called. You'll probably want to set the lua interpreter's eventhandler ! // to this as well as it's win id virtual bool RecreatewxLuaState(wxEvtHandler *wxlStateEvtHandler, int win_id); --- 106,130 ---- wxLuaState GetwxLuaState() const { return m_wxlState; } // Set this shell to use another interpreter, will close it if !is_static virtual void SetwxLuaState(const wxLuaState& wxlState, bool is_static); ! // RecreatewxLuaState - Used to create/recreate local interpreter ! // Can be subclassed to use your own interpreter derived from a wxLuaState. ! // ! // Using a customized wxLuaState by handling wxEVT_LUASHELL_wxLUA_CREATION event: ! // The RecreatewxLuaState function sends a wxLuaEvent with this control's id ! // in GetId(), *this as the GetEventObject(), and the preferred window ID ! // for the new wxLuaState in event.GetExtraLong() (typically wxID_ANY) and ! // the current wxLuaState in GetwxLuaState(). ! // ! // Your wxEVT_LUASHELL_wxLUA_CREATION event handler can set the new wxLuaState ! // by calling event.SetwxLuaState(wxLuaState(...)) ! // and event.SetInt(1 for static interpreter or 0 for not static), where ! // static means that the wxLuaShell will not close the wxLuaState on exit. ! // You'll probably want to set the new wxLuaState's eventhandler ! // to this as well as it's win id. ! // ! // If the event is skipped or not handled the RecreatewxLuaState will call ! // SetLuaIntpreter(event.GetLuaInterpreter(), event.GetInt() == 1) ! // if the event's wxLuaState is valid. You can not skip the event to not have ! // the wxLuaState recreated at all. virtual bool RecreatewxLuaState(wxEvtHandler *wxlStateEvtHandler, int win_id); Index: wxluaedit.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxluaedit.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** wxluaedit.cpp 15 Dec 2006 05:16:01 -0000 1.28 --- wxluaedit.cpp 15 Dec 2006 19:04:48 -0000 1.29 *************** *** 457,460 **** --- 457,468 ---- m_sideSplitter->SplitVertically(m_sideNotebook, m_wxluaIDE, 150); + wxLuaShell *shell = m_wxluaIDE->GetLuaShellWin(); + shell->AppendText(wxT("Welcome to the wxLuaShell, an interactive lua interpreter.\n")); + shell->AppendText(wxT(" Enter lua code and press <enter> to run it.\n")); + shell->AppendText(wxT(" Multiline code can be typed by pressing <shift>-<enter>.\n")); + shell->AppendText(wxT(" The wxLua intrepreter can be restarted with the command 'reset'.\n")); + shell->MarkerDeleteAll(wxSTEditorShell::markerPrompt); + shell->CheckPrompt(true); + return true; } *************** *** 505,509 **** wxString script; ! script += wxT("local msg = \"Welcome to wxLuaEditor\\n\""); script += wxT("msg = msg..\"Written by John Labenski\\n\\n\""); script += wxT("msg = msg..string.format(\"%s\", \"This dialog is created from a wxLua script.\")"); --- 513,518 ---- wxString script; ! script += wxT("local msg = \"Welcome to wxLuaEditor using \"..wx.WXLUA_VERSION_STRING..\"\\n\""); ! script += wxT("msg = msg..\"and compiled with \"..wx.wxVERSION_STRING..\"\\n\""); script += wxT("msg = msg..\"Written by John Labenski\\n\\n\""); script += wxT("msg = msg..string.format(\"%s\", \"This dialog is created from a wxLua script.\")"); Index: wxledit.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxledit.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** wxledit.cpp 15 Dec 2006 05:16:01 -0000 1.29 --- wxledit.cpp 15 Dec 2006 19:04:47 -0000 1.30 *************** *** 83,91 **** if (m_wxlState.Ok() && !m_wxlstate_static) { if (m_wxlState.IsRunning()) m_wxlState.DebugHookBreak(); m_wxlState.CloseLuaState(true); // force closing it since we own it - m_wxlState.Destroy(); // unref it so it's invalid } --- 83,94 ---- if (m_wxlState.Ok() && !m_wxlstate_static) { + // try to close it nicely first if (m_wxlState.IsRunning()) + { + wxSafeYield(); m_wxlState.DebugHookBreak(); + } m_wxlState.CloseLuaState(true); // force closing it since we own it } *************** *** 97,105 **** { // ask if anyone else wants to create the wxLuaState for us ! wxLuaEvent event(wxEVT_LUASHELL_wxLUA_CREATION, GetId(), wxNullLuaState); event.SetEventObject(this); event.SetInt(0); event.SetExtraLong(win_id); ! GetEventHandler()->ProcessEvent( event ); if (event.GetwxLuaState().Ok()) --- 100,110 ---- { // ask if anyone else wants to create the wxLuaState for us ! wxLuaEvent event(wxEVT_LUASHELL_wxLUA_CREATION, GetId(), m_wxlState); event.SetEventObject(this); event.SetInt(0); event.SetExtraLong(win_id); ! // return if handled, but not skipped. ! if (GetEventHandler()->ProcessEvent(event)) ! return false; if (event.GetwxLuaState().Ok()) *************** *** 529,537 **** if (m_wxlState.Ok() && !m_wxlstate_static) { if (m_wxlState.IsRunning()) m_wxlState.DebugHookBreak(); m_wxlState.CloseLuaState(true); // force closing it since we own it - m_wxlState.Destroy(); // unref it so it's invalid } --- 534,545 ---- if (m_wxlState.Ok() && !m_wxlstate_static) { + // try to close it nicely first if (m_wxlState.IsRunning()) + { + wxSafeYield(); m_wxlState.DebugHookBreak(); + } m_wxlState.CloseLuaState(true); // force closing it since we own it } *************** *** 641,649 **** editor->MarkerDeleteAll(wxLuaEditor::markerError); m_luaOutput->SetReadOnly(false); m_luaOutput->ClearAll(); m_luaOutput->MarkerDeleteAll(wxLuaShell::markerPrompt); ! WriteMessage(m_luaOutput, wxT("Running lua script : ") + wxNow() + wxT("\n")); wxStopWatch stopWatch; //m_luaOutput->SetReadOnly(true); --- 649,658 ---- editor->MarkerDeleteAll(wxLuaEditor::markerError); + wxString name = m_editorNotebook->GetPageText(m_editorNotebook->GetSelection()); m_luaOutput->SetReadOnly(false); m_luaOutput->ClearAll(); m_luaOutput->MarkerDeleteAll(wxLuaShell::markerPrompt); ! WriteMessage(m_luaOutput, wxT("Running lua script '") + name + wxT("' : ") + wxNow() + wxT("\n")); wxStopWatch stopWatch; //m_luaOutput->SetReadOnly(true); *************** *** 670,675 **** m_wxlState.SetLuaDebugHook(1000, 100, false, LUA_MASKCALL|LUA_MASKRET|LUA_MASKLINE|LUA_MASKCOUNT); - wxString name = m_editorNotebook->GetPageText(m_editorNotebook->GetSelection()); - m_luaOutput->SetReadOnly(true); editor->SetReadOnly(true); --- 679,682 ---- *************** *** 695,699 **** m_wxlState.DebugHookBreak(wxT("Interpreter stopped")); } ! else if (m_luaShell->GetwxLuaState().Ok() && m_luaShell->GetwxLuaState().IsRunning()) { m_luaShell->GetwxLuaState().DebugHookBreak(wxT("Interpreter stopped")); --- 702,706 ---- m_wxlState.DebugHookBreak(wxT("Interpreter stopped")); } ! else if (m_luaShell && m_luaShell->GetwxLuaState().Ok() && m_luaShell->GetwxLuaState().IsRunning()) { m_luaShell->GetwxLuaState().DebugHookBreak(wxT("Interpreter stopped")); |
From: John L. <jr...@us...> - 2006-12-15 05:16:10
|
Update of /cvsroot/wxlua/wxLua/apps/wxluaedit/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26340/wxLua/apps/wxluaedit/src Modified Files: wxledit.cpp wxledit.h wxluaedit.cpp Log Message: Rename wxLuaEditor's wxLuaConsole class to wxLuaIDE so it won't conflict with the wxLuaApp's wxLuaConsole allow use wxLuaConsole from wxlua app in wxluaeditor Index: wxledit.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxledit.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxledit.h 15 Dec 2006 00:02:13 -0000 1.15 --- wxledit.h 15 Dec 2006 05:16:01 -0000 1.16 *************** *** 21,25 **** class WXDLLIMPEXP_WXLUA wxLuaState; class WXDLLIMPEXP_WXLUA wxLuaEvent; ! class wxLuaConsole; // Note: If you get a compilation error on the next two lines you need to --- 21,25 ---- class WXDLLIMPEXP_WXLUA wxLuaState; class WXDLLIMPEXP_WXLUA wxLuaEvent; ! class wxLuaIDE; // Note: If you get a compilation error on the next two lines you need to *************** *** 31,38 **** // we use the following macro to do a compile-time check of wxLuaEdit version #if !defined(wxCHECK_STE_VERSION) ! #error wxStEdit version is too old #endif ! #if !wxCHECK_STE_VERSION(1, 2, 0) ! #error wxStEdit version is too old #endif --- 31,38 ---- // we use the following macro to do a compile-time check of wxLuaEdit version #if !defined(wxCHECK_STE_VERSION) ! #error "wxStEdit version is too old, need at least version 1.2.4" #endif ! #if !wxCHECK_STE_VERSION(1, 2, 3) ! #error "wxStEdit version is too old, need at least version 1.2.4" #endif *************** *** 42,76 **** { // buttons ! ID_LUACON_LOAD_LUA = ID_STE__LAST + 1, ! ID_LUACON_SAVEAS_LUA, ! ID_LUACON_RUN_LUA, ! ID_LUACON_BREAK_LUA, ! ID_LUACON_SHOW_STACK, ! ID_LUACON_TOGGLE_BREAKPOINT, // windows ! ID_LUACON_EDITOR_NOTEBOOK, ! ID_LUACON_MSG_NOTEBOOK, ! ID_LUACON_SHELL, ! ID_LUACON_OUTPUT_WIN }; //----------------------------------------------------------------------------- ! // Events for the wxLuaShell and wxLuaConsole when a wxLua interpreter is // being created. You may intercept this event to adjust or run strings // to finish creating the wxLua interpreter. // // EVT_LUASHELL_wxLUA_CREATION(id, wxLuaEvent& fn) ! // EVT_LUACONSOLE_wxLUA_CREATION(id, wxLuaEvent& fn) //----------------------------------------------------------------------------- BEGIN_DECLARE_EVENT_TYPES() DECLARE_LOCAL_EVENT_TYPE(wxEVT_LUASHELL_wxLUA_CREATION, 7000) ! DECLARE_LOCAL_EVENT_TYPE(wxEVT_LUACONSOLE_wxLUA_CREATION, 7001) END_DECLARE_EVENT_TYPES() #define EVT_LUASHELL_wxLUA_CREATION(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_LUASHELL_wxLUA_CREATION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) (wxLuaEventFunction) & fn, (wxObject *) NULL ), ! #define EVT_LUACONSOLE_wxLUA_CREATION(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_LUACONSOLE_wxLUA_CREATION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) (wxLuaEventFunction) & fn, (wxObject *) NULL ), //----------------------------------------------------------------------------- --- 42,78 ---- { // buttons ! ID_WXLUAIDE_LOAD_LUA = ID_STE__LAST + 1, ! ID_WXLUAIDE_SAVEAS_LUA, ! ID_WXLUAIDE_RUN_LUA, ! ID_WXLUAIDE_BREAK_LUA, ! ID_WXLUAIDE_SHOW_STACK, ! ID_WXLUAIDE_TOGGLE_BREAKPOINT, // windows ! ID_WXLUAIDE_EDITOR_NOTEBOOK, ! ID_WXLUAIDE_MSG_NOTEBOOK, ! ID_WXLUAIDE_SHELL, ! ID_WXLUAIDE_OUTPUT_WIN, ! ! ID_WXLUAIDE__LAST }; //----------------------------------------------------------------------------- ! // Events for the wxLuaShell and wxLuaIDE when a wxLua interpreter is // being created. You may intercept this event to adjust or run strings // to finish creating the wxLua interpreter. // // EVT_LUASHELL_wxLUA_CREATION(id, wxLuaEvent& fn) ! // EVT_LUAIDE_wxLUA_CREATION(id, wxLuaEvent& fn) //----------------------------------------------------------------------------- BEGIN_DECLARE_EVENT_TYPES() DECLARE_LOCAL_EVENT_TYPE(wxEVT_LUASHELL_wxLUA_CREATION, 7000) ! DECLARE_LOCAL_EVENT_TYPE(wxEVT_LUAIDE_wxLUA_CREATION, 7001) END_DECLARE_EVENT_TYPES() #define EVT_LUASHELL_wxLUA_CREATION(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_LUASHELL_wxLUA_CREATION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) (wxLuaEventFunction) & fn, (wxObject *) NULL ), ! #define EVT_LUAIDE_wxLUA_CREATION(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_LUAIDE_wxLUA_CREATION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) (wxLuaEventFunction) & fn, (wxObject *) NULL ), //----------------------------------------------------------------------------- *************** *** 103,107 **** // Get the interpreter this shell uses wxLuaState GetwxLuaState() const { return m_wxlState; } ! // Set this shell to use another interpreter, will delete it if !is_static // note shell has built in function virtual void SetwxLuaState(const wxLuaState& wxlState, bool is_static); --- 105,109 ---- // Get the interpreter this shell uses wxLuaState GetwxLuaState() const { return m_wxlState; } ! // Set this shell to use another interpreter, will close it if !is_static // note shell has built in function virtual void SetwxLuaState(const wxLuaState& wxlState, bool is_static); *************** *** 164,169 **** virtual ~wxLuaEditor() {} ! wxLuaConsole* GetwxLuaConsole() const { return m_wxluaConsole; } ! void SetwxLuaConsole(wxLuaConsole* wxluaConsole) { m_wxluaConsole = wxluaConsole; } enum mark_Type --- 166,171 ---- virtual ~wxLuaEditor() {} ! wxLuaIDE* GetwxLuaIDE() const { return m_wxluaIDE; } ! void SetwxLuaIDE(wxLuaIDE* wxluaIDE) { m_wxluaIDE = wxluaIDE; } enum mark_Type *************** *** 190,194 **** protected: ! wxLuaConsole* m_wxluaConsole; private: --- 192,196 ---- protected: ! wxLuaIDE* m_wxluaIDE; private: *************** *** 199,225 **** //----------------------------------------------------------------------------- ! // wxLuaConsole - toolbar at the top for open/save/run/stop lua programs // notebook with editors for editing lua programs // notebook with a console and an output window for above editors //----------------------------------------------------------------------------- ! enum wxLuaConsole_Styles { ! LUACON_TB_FILE = 0x0001, ! LUACON_TB_LUA = 0x0002, ! LUACON_TOOLBAR = LUACON_TB_FILE|LUACON_TB_LUA, ! LUACON_DEFAULT = LUACON_TOOLBAR }; ! class wxLuaConsole : public wxWindow { public: ! wxLuaConsole() : wxWindow() { Init(); } ! wxLuaConsole( wxWindow *parent, wxWindowID id, ! const wxPoint& pos = wxDefaultPosition, ! const wxSize& size = wxDefaultSize, ! long style = 0, ! long options = LUACON_DEFAULT, ! const wxString& name = wxT("wxLuaConsole")) : wxWindow() { Init(); --- 201,227 ---- //----------------------------------------------------------------------------- ! // wxLuaIDE - toolbar at the top for open/save/run/stop lua programs // notebook with editors for editing lua programs // notebook with a console and an output window for above editors //----------------------------------------------------------------------------- ! enum wxLuaIDE_Styles { ! WXLUAIDE_TB_FILE = 0x0001, ! WXLUAIDE_TB_LUA = 0x0002, ! WXLUAIDE_TOOLBAR = WXLUAIDE_TB_FILE|WXLUAIDE_TB_LUA, ! WXLUAIDE_DEFAULT = WXLUAIDE_TOOLBAR }; ! class wxLuaIDE : public wxWindow { public: ! wxLuaIDE() : wxWindow() { Init(); } ! wxLuaIDE( wxWindow *parent, wxWindowID id, ! const wxPoint& pos = wxDefaultPosition, ! const wxSize& size = wxDefaultSize, ! long style = 0, ! long options = WXLUAIDE_DEFAULT, ! const wxString& name = wxT("wxLuaIDE")) : wxWindow() { Init(); *************** *** 231,238 **** const wxSize& size = wxDefaultSize, long style = 0, ! long options = LUACON_DEFAULT, ! const wxString& name = wxT("wxLuaConsole")); ! virtual ~wxLuaConsole(); // Get the interpreter this shell uses --- 233,240 ---- const wxSize& size = wxDefaultSize, long style = 0, ! long options = WXLUAIDE_DEFAULT, ! const wxString& name = wxT("wxLuaIDE")); ! virtual ~wxLuaIDE(); // Get the interpreter this shell uses *************** *** 274,278 **** wxToolBar *GetToolBar() const { return m_editorOptions.GetToolBar(); } // may be NULL // add our own tools to the toolbar ! void PopulateToolBar(wxToolBar *toolBar, long options = LUACON_TOOLBAR) const; // create a "new" wxMenu to add to the menubar and popupmenu wxMenu* CreatewxLuaMenu() const; --- 276,280 ---- wxToolBar *GetToolBar() const { return m_editorOptions.GetToolBar(); } // may be NULL // add our own tools to the toolbar ! void PopulateToolBar(wxToolBar *toolBar, long options = WXLUAIDE_TOOLBAR) const; // create a "new" wxMenu to add to the menubar and popupmenu wxMenu* CreatewxLuaMenu() const; *************** *** 293,298 **** wxSTEditorNotebook *m_editorNotebook; wxSTEditorNotebook *m_msgNotebook; // bottom ! wxLuaShell *m_luaOutput; ! wxLuaShell *m_luaShell; wxToolBar *m_toolBar; // a toolbar that is a child of this wxSTEditorOptions m_editorOptions; --- 295,300 ---- wxSTEditorNotebook *m_editorNotebook; wxSTEditorNotebook *m_msgNotebook; // bottom ! wxLuaShell *m_luaOutput; // output of the editor program + shell ! wxLuaShell *m_luaShell; // user interactive shell wxToolBar *m_toolBar; // a toolbar that is a child of this wxSTEditorOptions m_editorOptions; *************** *** 309,313 **** DECLARE_EVENT_TABLE(); ! DECLARE_DYNAMIC_CLASS(wxLuaConsole); }; --- 311,315 ---- DECLARE_EVENT_TABLE(); ! DECLARE_DYNAMIC_CLASS(wxLuaIDE); }; Index: wxluaedit.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxluaedit.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** wxluaedit.cpp 11 Dec 2006 00:09:15 -0000 1.27 --- wxluaedit.cpp 15 Dec 2006 05:16:01 -0000 1.28 *************** *** 31,34 **** --- 31,38 ---- #include "wxluadebug/include/staktree.h" + class wxLuaConsole; + + //#include "art/wxlua.xpm" get it from the lconsole + // Declare the binding initialization functions as extern so we don't have to // #include the binding header for simplicity. *************** *** 38,41 **** --- 42,46 ---- wxWindowID ID_WXLUASTATE_DEBUG = 200; + wxWindowID ID_WXLUA_CONSOLE = 201; // ---------------------------------------------------------------------------- *************** *** 65,74 **** // ---------------------------------------------------------------------------- - // resources and constants - // ---------------------------------------------------------------------------- - - #include "art/wxlua.xpm" - - // ---------------------------------------------------------------------------- // wxLuaEditorApp // ---------------------------------------------------------------------------- --- 70,73 ---- *************** *** 83,91 **** void OnLua(wxLuaEvent &event); ! void DisplayError(const wxString &strError) const; wxLuaDebugTarget *m_pDebugTarget; wxLuaState m_wxlState; wxString m_programName; private: --- 82,93 ---- void OnLua(wxLuaEvent &event); ! void DisplayMessage(const wxString &msg, bool is_error, ! const wxLuaState& wxlState = wxNullLuaState); wxLuaDebugTarget *m_pDebugTarget; wxLuaState m_wxlState; wxString m_programName; + wxLuaConsole *m_luaConsole; + bool m_want_console; private: *************** *** 93,96 **** --- 95,103 ---- }; + IMPLEMENT_APP(wxLuaEditorApp) + + #define WXLUAEDITOR_APP + #include "../../wxlua/src/lconsole.cpp" + // ---------------------------------------------------------------------------- // wxLuaEditorFrame *************** *** 114,118 **** void OnAbout(wxCommandEvent& event); ! wxLuaConsole *m_luaConsole; private: --- 121,125 ---- void OnAbout(wxCommandEvent& event); ! wxLuaIDE *m_wxluaIDE; private: *************** *** 125,130 **** // ---------------------------------------------------------------------------- - IMPLEMENT_APP(wxLuaEditorApp) - BEGIN_EVENT_TABLE(wxLuaEditorApp, wxApp) EVT_LUA_PRINT (ID_WXLUASTATE_DEBUG, wxLuaEditorApp::OnLua) --- 132,135 ---- *************** *** 137,140 **** --- 142,147 ---- m_pDebugTarget = NULL; m_programName = argv[0]; + m_luaConsole = NULL; + m_want_console = false; #if defined(__WXMSW__) && wxCHECK_VERSION(2, 3, 3) *************** *** 175,196 **** case 0: { ! wxString value; ! if (parser.Found(wxT("d"), &value)) { ! // wxLuaDebugServer::StartClient() runs wxExecute(m_programName -d[host]:[port], ...) ! ! m_wxlState = wxLuaState(this, ID_WXLUASTATE_DEBUG); ! if (!m_wxlState.Ok()) ! return false; ! // Set up for debugging ! wxString serverName(value.BeforeFirst(wxT(':'))); ! long portNumber = 0; ! if (value.AfterFirst(wxT(':')).ToLong(&portNumber)) { ! m_pDebugTarget = new wxLuaDebugTarget(m_wxlState, serverName, (int)portNumber); ! if (m_pDebugTarget != NULL) ! return m_pDebugTarget->Run(); } return false; --- 182,215 ---- case 0: { ! wxString debugString; ! if (parser.Found(wxT("d"), &debugString)) { ! // Note: wxLuaDebuggerServer::StartClient() runs ! // wxExecute(m_programName -d[host]:[port], ...) ! wxString serverName(debugString.BeforeFirst(wxT(':'))); ! if (serverName.IsEmpty()) { ! DisplayMessage(_("The wxLua debugger server host name is empty : wxLua -d[host]:[port]\n"), true); ! } ! else ! { ! long portNumber = 0; ! if (debugString.AfterFirst(wxT(':')).ToLong(&portNumber)) ! { ! m_wxlState = wxLuaState(this, ID_WXLUASTATE_DEBUG); ! if (!m_wxlState.Ok()) ! return false; ! ! m_pDebugTarget = new wxLuaDebugTarget(m_wxlState, serverName, (int)portNumber); ! if (m_pDebugTarget != NULL) ! { ! bool ok = m_pDebugTarget->Run(); ! return ok; ! } ! else ! DisplayMessage(_("The wxLua debug target cannot start.\n"), true); ! } } return false; *************** *** 235,244 **** frame->GetToolBar()->AddSeparator(); ! frame->m_luaConsole->PopulateToolBar(frame->GetToolBar(), LUACON_TB_LUA); ! frame->m_luaConsole->SetToolBar(frame->GetToolBar()); ! frame->m_luaConsole->SetMenuBar(frame->GetMenuBar()); // The size of the frame isn't set when the splitter is created, resize it ! wxSplitterWindow *splitWin = frame->m_luaConsole->GetSplitterWin(); splitWin->SetSashPosition(splitWin->GetSize().y/2); --- 254,263 ---- frame->GetToolBar()->AddSeparator(); ! frame->m_wxluaIDE->PopulateToolBar(frame->GetToolBar(), WXLUAIDE_TB_LUA); ! frame->m_wxluaIDE->SetToolBar(frame->GetToolBar()); ! frame->m_wxluaIDE->SetMenuBar(frame->GetMenuBar()); // The size of the frame isn't set when the splitter is created, resize it ! wxSplitterWindow *splitWin = frame->m_wxluaIDE->GetSplitterWin(); splitWin->SetSashPosition(splitWin->GetSize().y/2); *************** *** 282,288 **** } - #if wxCHECK_STE_VERSION(1,2,2) frame->UpdateFileTreeCtrl(); - #endif frame->Show(true); --- 301,305 ---- *************** *** 342,364 **** else if (event.GetEventType() == wxEVT_LUA_ERROR) { ! DisplayError(event.GetString()); } } ! void wxLuaEditorApp::DisplayError(const wxString &errorStr) const { ! if (m_pDebugTarget != NULL) ! m_pDebugTarget->DisplayError(errorStr); else { ! //if (m_pConsole != NULL) ! // m_pConsole->DisplayText(errorStr, true); ! //else #ifdef __WXMSW__ ! wxMessageBox(errorStr, wxT("wxLua")); #else ! fprintf(stderr, wx2lua(errorStr + wxT("\n"))); #endif // __WXMSW__ ! } } --- 359,411 ---- else if (event.GetEventType() == wxEVT_LUA_ERROR) { ! DisplayMessage(event.GetString(), true); } } ! void wxLuaEditorApp::DisplayMessage(const wxString &msg, bool is_error, ! const wxLuaState& wxlState) { ! // If they closed the console, but specified they wanted it ! // on the command-line, recreate it. ! if (m_want_console && (m_luaConsole == NULL)) ! { ! m_luaConsole = new wxLuaConsole(NULL, ID_WXLUA_CONSOLE); ! m_luaConsole->Show(true); ! } ! ! if (!is_error) ! { ! if (m_luaConsole != NULL) ! m_luaConsole->DisplayText(msg); ! else ! { ! #ifdef __WXMSW__ ! wxMessageBox(msg, wxT("wxLua Print")); ! #else ! //fprintf(stderr, wx2lua(msg + wxT("\n"))); ! wxPrintf(msg + wxT("\n")); ! #endif // __WXMSW__ ! } ! } else { ! if (m_pDebugTarget != NULL) ! m_pDebugTarget->DisplayError(msg); ! else if (m_luaConsole != NULL) ! { ! m_luaConsole->DisplayText(msg); ! m_luaConsole->SetExitOnError(is_error); ! if (wxlState.Ok()) ! m_luaConsole->DisplayStack(wxlState); ! } ! else ! { #ifdef __WXMSW__ ! wxMessageBox(msg, wxT("wxLua Error")); #else ! //fprintf(stderr, wx2lua(msg + wxT("\n"))); ! wxPrintf(msg + wxT("\n")); #endif // __WXMSW__ ! } } } *************** *** 377,381 **** { ! m_luaConsole = NULL; if (!wxSTEditorFrame::Create(NULL, wxID_ANY, title, pos, size, frame_style)) return false; --- 424,428 ---- { ! m_wxluaIDE = NULL; if (!wxSTEditorFrame::Create(NULL, wxID_ANY, title, pos, size, frame_style)) return false; *************** *** 404,412 **** m_sideSplitterWin1 = m_sideNotebook; ! m_luaConsole = new wxLuaConsole(m_sideSplitter, wxID_ANY, wxDefaultPosition, wxSize(400,300), 0, 0); ! m_steNotebook = m_luaConsole->GetEditorNotebook(); ! m_sideSplitterWin2 = m_luaConsole; ! m_sideSplitter->SplitVertically(m_sideNotebook, m_luaConsole, 150); return true; --- 451,459 ---- m_sideSplitterWin1 = m_sideNotebook; ! m_wxluaIDE = new wxLuaIDE(m_sideSplitter, wxID_ANY, wxDefaultPosition, wxSize(400,300), 0, 0); ! m_steNotebook = m_wxluaIDE->GetEditorNotebook(); ! m_sideSplitterWin2 = m_wxluaIDE; ! m_sideSplitter->SplitVertically(m_sideNotebook, m_wxluaIDE, 150); return true; *************** *** 430,437 **** { // These windows only handle these IDs ! if (focusWin == m_luaConsole->GetLuaOutputWin()) ! return m_luaConsole->GetLuaOutputWin()->HandleMenuEvent(event); ! if (focusWin == m_luaConsole->GetLuaShellWin()) ! return m_luaConsole->GetLuaShellWin()->HandleMenuEvent(event); break; --- 477,484 ---- { // These windows only handle these IDs ! if (focusWin == m_wxluaIDE->GetLuaOutputWin()) ! return m_wxluaIDE->GetLuaOutputWin()->HandleMenuEvent(event); ! if (focusWin == m_wxluaIDE->GetLuaShellWin()) ! return m_wxluaIDE->GetLuaShellWin()->HandleMenuEvent(event); break; *************** *** 442,446 **** if (!wxSTEditorFrame::HandleMenuEvent(event)) ! m_luaConsole->OnMenu(event); return true; --- 489,493 ---- if (!wxSTEditorFrame::HandleMenuEvent(event)) ! m_wxluaIDE->OnMenu(event); return true; *************** *** 461,467 **** script += wxT("msg = msg..\"Written by John Labenski\\n\\n\""); script += wxT("msg = msg..string.format(\"%s\", \"This dialog is created from a wxLua script.\")"); ! script += wxT("wx.wxMessageBox(msg, \"About wxLua Embedded\", wx.wxOK + wx.wxICON_INFORMATION)"); wxlState.RunString(script); // Equivalent code --- 508,515 ---- script += wxT("msg = msg..\"Written by John Labenski\\n\\n\""); script += wxT("msg = msg..string.format(\"%s\", \"This dialog is created from a wxLua script.\")"); ! script += wxT("wx.wxMessageBox(msg, \"About wxLua Editor\", wx.wxOK + wx.wxICON_INFORMATION)"); wxlState.RunString(script); + wxlState.Destroy(); // Equivalent code Index: wxledit.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxledit.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** wxledit.cpp 15 Dec 2006 00:02:13 -0000 1.28 --- wxledit.cpp 15 Dec 2006 05:16:01 -0000 1.29 *************** *** 29,32 **** --- 29,34 ---- #include "wxluadebug/include/wxldebug.h" + #include "wx/stedit/stemenum.h" + #include "art/wxlua.xpm" #include "art/open.xpm" *************** *** 38,42 **** DEFINE_LOCAL_EVENT_TYPE(wxEVT_LUASHELL_wxLUA_CREATION) ! DEFINE_LOCAL_EVENT_TYPE(wxEVT_LUACONSOLE_wxLUA_CREATION) //----------------------------------------------------------------------------- --- 40,44 ---- DEFINE_LOCAL_EVENT_TYPE(wxEVT_LUASHELL_wxLUA_CREATION) ! DEFINE_LOCAL_EVENT_TYPE(wxEVT_LUAIDE_wxLUA_CREATION) //----------------------------------------------------------------------------- *************** *** 64,68 **** SetFileName(name, false); ! SetLanguage(wxT("a.lua")); return true; --- 66,70 ---- SetFileName(name, false); ! SetLanguage(wxT("a.lua")); // use the lua lexer return true; *************** *** 146,154 **** } else ! AppendText(wxT("Unsucessfully reset interpreter.\n")); } } else if (m_wxlState.Ok()) ! ret = m_wxlState.RunString(string, wxT("shell")) == 0; else AppendText(wxT("The lua interpreter is not available - try running 'reset'.\n")); --- 148,156 ---- } else ! AppendText(wxT("Unable to reset interpreter.\n")); } } else if (m_wxlState.Ok()) ! ret = m_wxlState.RunString(string, wxT("wxLuaShell")) == 0; else AppendText(wxT("The lua interpreter is not available - try running 'reset'.\n")); *************** *** 179,183 **** else if (event.GetEventType() == wxEVT_LUA_ERROR) { ! AppendText(wxT("\nErr: ") + event.GetString() + wxT("\n")); } } --- 181,185 ---- else if (event.GetEventType() == wxEVT_LUA_ERROR) { ! AppendText(wxT("\nError: ") + event.GetString() + wxT("\n")); } } *************** *** 187,193 **** bool is_running = m_wxlState.Ok() && m_wxlState.IsRunning(); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_LUACON_RUN_LUA, !is_running); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_LUACON_BREAK_LUA, is_running); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_LUACON_SHOW_STACK, m_wxlState.Ok()); wxSTEditor::UpdateItems(menu, menuBar, toolBar); --- 189,195 ---- bool is_running = m_wxlState.Ok() && m_wxlState.IsRunning(); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_WXLUAIDE_RUN_LUA, !is_running); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_WXLUAIDE_BREAK_LUA, is_running); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_WXLUAIDE_SHOW_STACK, m_wxlState.Ok()); wxSTEditor::UpdateItems(menu, menuBar, toolBar); *************** *** 201,210 **** BEGIN_EVENT_TABLE(wxLuaEditor, wxSTEditor) EVT_STC_MARGINCLICK(wxID_ANY, wxLuaEditor::OnMarginClick) ! EVT_MENU(ID_LUACON_TOGGLE_BREAKPOINT, wxLuaEditor::OnMenu) END_EVENT_TABLE() void wxLuaEditor::Init() { ! m_wxluaConsole = NULL; } --- 203,212 ---- BEGIN_EVENT_TABLE(wxLuaEditor, wxSTEditor) EVT_STC_MARGINCLICK(wxID_ANY, wxLuaEditor::OnMarginClick) ! EVT_MENU(ID_WXLUAIDE_TOGGLE_BREAKPOINT, wxLuaEditor::OnMenu) END_EVENT_TABLE() void wxLuaEditor::Init() { ! m_wxluaIDE = NULL; } *************** *** 245,249 **** switch (event.GetId()) { ! case ID_LUACON_TOGGLE_BREAKPOINT : { if (HasBreakpoint(line)) --- 247,251 ---- switch (event.GetId()) { ! case ID_WXLUAIDE_TOGGLE_BREAKPOINT : { if (HasBreakpoint(line)) *************** *** 280,284 **** void wxLuaEditor::AddBreakpoint(int line) { ! if (HasBreakpoint(line) || (line<0) || (line>GetLineCount())) return; --- 282,286 ---- void wxLuaEditor::AddBreakpoint(int line) { ! if ((line < 0) || (line > GetLineCount()) || HasBreakpoint(line)) return; *************** *** 296,307 **** { wxLuaState wxlState; ! if (GetwxLuaConsole()) ! wxlState = GetwxLuaConsole()->GetwxLuaState(); bool is_running = wxlState.Ok() && wxlState.IsRunning(); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_LUACON_RUN_LUA, !is_running); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_LUACON_BREAK_LUA, is_running); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_LUACON_SHOW_STACK, wxlState.Ok()); wxSTEditor::UpdateItems(menu, menuBar, toolBar); --- 298,309 ---- { wxLuaState wxlState; ! if (GetwxLuaIDE()) ! wxlState = GetwxLuaIDE()->GetwxLuaState(); bool is_running = wxlState.Ok() && wxlState.IsRunning(); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_WXLUAIDE_RUN_LUA, !is_running); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_WXLUAIDE_BREAK_LUA, is_running); ! wxSTEditorMenuManager::DoEnableItem(menu, menuBar, toolBar, ID_WXLUAIDE_SHOW_STACK, wxlState.Ok()); wxSTEditor::UpdateItems(menu, menuBar, toolBar); *************** *** 309,334 **** //----------------------------------------------------------------------------- ! // wxLuaConsole //----------------------------------------------------------------------------- ! IMPLEMENT_DYNAMIC_CLASS(wxLuaConsole, wxWindow); ! BEGIN_EVENT_TABLE(wxLuaConsole, wxWindow) ! EVT_MENU(ID_LUACON_LOAD_LUA, wxLuaConsole::OnMenu) ! EVT_MENU(ID_LUACON_SAVEAS_LUA, wxLuaConsole::OnMenu) ! EVT_MENU(ID_LUACON_RUN_LUA, wxLuaConsole::OnMenu) ! EVT_MENU(ID_LUACON_BREAK_LUA, wxLuaConsole::OnMenu) ! EVT_MENU(ID_LUACON_SHOW_STACK, wxLuaConsole::OnMenu) ! EVT_STS_CREATE_EDITOR(wxID_ANY, wxLuaConsole::OnCreateEditor) ! EVT_SIZE (wxLuaConsole::OnSize) ! EVT_LUA_PRINT (wxID_ANY, wxLuaConsole::OnLua) ! EVT_LUA_ERROR (wxID_ANY, wxLuaConsole::OnLua) ! EVT_LUA_DEBUG_HOOK (wxID_ANY, wxLuaConsole::OnLua) END_EVENT_TABLE() ! void wxLuaConsole::Init() { m_wxlstate_static = false; --- 311,336 ---- //----------------------------------------------------------------------------- ! // wxLuaIDE //----------------------------------------------------------------------------- ! IMPLEMENT_DYNAMIC_CLASS(wxLuaIDE, wxWindow); ! BEGIN_EVENT_TABLE(wxLuaIDE, wxWindow) ! EVT_MENU(ID_WXLUAIDE_LOAD_LUA, wxLuaIDE::OnMenu) ! EVT_MENU(ID_WXLUAIDE_SAVEAS_LUA, wxLuaIDE::OnMenu) ! EVT_MENU(ID_WXLUAIDE_RUN_LUA, wxLuaIDE::OnMenu) ! EVT_MENU(ID_WXLUAIDE_BREAK_LUA, wxLuaIDE::OnMenu) ! EVT_MENU(ID_WXLUAIDE_SHOW_STACK, wxLuaIDE::OnMenu) ! EVT_STS_CREATE_EDITOR(wxID_ANY, wxLuaIDE::OnCreateEditor) ! EVT_SIZE(wxLuaIDE::OnSize) ! EVT_LUA_PRINT (wxID_ANY, wxLuaIDE::OnLua) ! EVT_LUA_ERROR (wxID_ANY, wxLuaIDE::OnLua) ! EVT_LUA_DEBUG_HOOK (wxID_ANY, wxLuaIDE::OnLua) END_EVENT_TABLE() ! void wxLuaIDE::Init() { m_wxlstate_static = false; *************** *** 345,351 **** } ! bool wxLuaConsole::Create( wxWindow *parent, int id, ! const wxPoint& pos, const wxSize& size, ! long style, long options, const wxString& name) { m_options = options; --- 347,353 ---- } ! bool wxLuaIDE::Create( wxWindow *parent, int id, ! const wxPoint& pos, const wxSize& size, ! long style, long options, const wxString& name) { m_options = options; *************** *** 354,362 **** return false; ! if ((m_options & LUACON_TOOLBAR) != 0) { m_toolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize); PopulateToolBar(m_toolBar, m_options); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_LUACON_BREAK_LUA, false); } --- 356,364 ---- return false; ! if ((m_options & WXLUAIDE_TOOLBAR) != 0) { m_toolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize); PopulateToolBar(m_toolBar, m_options); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_WXLUAIDE_BREAK_LUA, false); } *************** *** 373,377 **** m_editorOptions.LoadConfig(*wxConfigBase::Get(false)); ! m_editorNotebook = new wxSTEditorNotebook(m_splitter, ID_LUACON_EDITOR_NOTEBOOK, wxDefaultPosition, wxSize(200,100), wxCLIP_CHILDREN); m_editorNotebook->CreateOptions(m_editorOptions); --- 375,379 ---- m_editorOptions.LoadConfig(*wxConfigBase::Get(false)); ! m_editorNotebook = new wxSTEditorNotebook(m_splitter, ID_WXLUAIDE_EDITOR_NOTEBOOK, wxDefaultPosition, wxSize(200,100), wxCLIP_CHILDREN); m_editorNotebook->CreateOptions(m_editorOptions); *************** *** 392,396 **** m_shellOptions.SetEditorPopupMenu(wxSTEditorMenuManager(0, 0, STE_MENU_EDIT_CUTCOPYPASTE).CreateEditMenu(), false); m_shellOptions.SetToolBar(m_toolBar); ! m_msgNotebook = new wxSTEditorNotebook(m_splitter, ID_LUACON_MSG_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN); m_msgNotebook->CreateOptions(m_shellOptions); --- 394,398 ---- m_shellOptions.SetEditorPopupMenu(wxSTEditorMenuManager(0, 0, STE_MENU_EDIT_CUTCOPYPASTE).CreateEditMenu(), false); m_shellOptions.SetToolBar(m_toolBar); ! m_msgNotebook = new wxSTEditorNotebook(m_splitter, ID_WXLUAIDE_MSG_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN); m_msgNotebook->CreateOptions(m_shellOptions); *************** *** 399,403 **** wxDefaultPosition, wxDefaultSize, wxSP_3D); steSplitter->CreateOptions(m_shellOptions); ! m_luaShell = new wxLuaShell(steSplitter, ID_LUACON_SHELL, wxDefaultPosition, wxDefaultSize, 0); m_luaShell->CreateOptions(m_shellOptions); --- 401,405 ---- wxDefaultPosition, wxDefaultSize, wxSP_3D); steSplitter->CreateOptions(m_shellOptions); ! m_luaShell = new wxLuaShell(steSplitter, ID_WXLUAIDE_SHELL, wxDefaultPosition, wxDefaultSize, 0); m_luaShell->CreateOptions(m_shellOptions); *************** *** 409,416 **** steSplitter = new wxSTEditorSplitter(m_msgNotebook, wxID_ANY, ! wxDefaultPosition, wxDefaultSize, wxSP_3D); steSplitter->CreateOptions(m_shellOptions); ! m_luaOutput = new wxLuaShell(steSplitter, ID_LUACON_OUTPUT_WIN, ! wxDefaultPosition, wxDefaultSize, 0); m_luaOutput->CreateOptions(m_shellOptions); steSplitter->Initialize(m_luaOutput); --- 411,418 ---- steSplitter = new wxSTEditorSplitter(m_msgNotebook, wxID_ANY, ! wxDefaultPosition, wxDefaultSize, wxSP_3D); steSplitter->CreateOptions(m_shellOptions); ! m_luaOutput = new wxLuaShell(steSplitter, ID_WXLUAIDE_OUTPUT_WIN, ! wxDefaultPosition, wxDefaultSize, 0); m_luaOutput->CreateOptions(m_shellOptions); steSplitter->Initialize(m_luaOutput); *************** *** 428,432 **** } ! wxLuaConsole::~wxLuaConsole() { if (m_wxlState.Ok()) --- 430,434 ---- } ! wxLuaIDE::~wxLuaIDE() { if (m_wxlState.Ok()) *************** *** 436,440 **** } ! void wxLuaConsole::OnSize(wxSizeEvent& event) { event.Skip(); --- 438,442 ---- } ! void wxLuaIDE::OnSize(wxSizeEvent& event) { event.Skip(); *************** *** 462,466 **** } ! void wxLuaConsole::SetMenuBar(wxMenuBar *menuBar) { m_editorOptions.SetMenuBar(menuBar); --- 464,468 ---- } ! void wxLuaIDE::SetMenuBar(wxMenuBar *menuBar) { m_editorOptions.SetMenuBar(menuBar); *************** *** 474,481 **** if (!m_wxlState.Ok() || !m_wxlState.IsRunning()) ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_LUACON_BREAK_LUA, false); } ! void wxLuaConsole::SetToolBar(wxToolBar *toolBar) { m_editorOptions.SetToolBar(toolBar); --- 476,483 ---- if (!m_wxlState.Ok() || !m_wxlState.IsRunning()) ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_WXLUAIDE_BREAK_LUA, false); } ! void wxLuaIDE::SetToolBar(wxToolBar *toolBar) { m_editorOptions.SetToolBar(toolBar); *************** *** 485,528 **** if (!m_wxlState.Ok() || !m_wxlState.IsRunning()) ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_LUACON_BREAK_LUA, false); } ! void wxLuaConsole::PopulateToolBar(wxToolBar *toolBar, long options) const { bool add_sep = false; ! if ((options & LUACON_TB_FILE) != 0) { ! toolBar->AddTool( ID_LUACON_LOAD_LUA, wxT("Open file"), wxBitmap(open_xpm), wxT("Open lua program") ); ! toolBar->AddTool( ID_LUACON_SAVEAS_LUA, wxT("Save as..."), wxBitmap(save_xpm), wxT("Save lua program") ); add_sep = true; } ! if ((options & LUACON_TB_LUA) != 0) { if (add_sep) toolBar->AddSeparator(); ! toolBar->AddTool( ID_LUACON_RUN_LUA, wxT("Run wxLua program"), wxBitmap(play_xpm), wxT("Run the wxLua program") ); ! toolBar->AddTool( ID_LUACON_BREAK_LUA, wxT("Stop wxLua program"), wxBitmap(stop_xpm), wxT("Stop the running wxLua program") ); toolBar->AddSeparator(); ! toolBar->AddTool( ID_LUACON_SHOW_STACK, wxT("Show stack tree"), wxBitmap(LUA_xpm), wxT("Show the lua stack tree") ); } toolBar->Realize(); } ! #include "wx/stedit/stemenum.h" ! wxMenu* wxLuaConsole::CreatewxLuaMenu() const { wxSTEditorMenuManager s; wxMenu *wxluaMenu = new wxMenu(); ! wxluaMenu->Append(s.MenuItem(wxluaMenu, ID_LUACON_RUN_LUA, wxT("&Run wxLua program"), wxT("Run the wxLua program") , wxITEM_NORMAL, wxBitmap(play_xpm))); ! wxluaMenu->Append(s.MenuItem(wxluaMenu, ID_LUACON_BREAK_LUA, wxT("&Stop wxLua program"), wxT("Stop the running wxLua program") , wxITEM_NORMAL, wxBitmap(stop_xpm))); wxluaMenu->AppendSeparator(); ! wxluaMenu->Append(s.MenuItem(wxluaMenu, ID_LUACON_SHOW_STACK, wxT("Stack &tree"), wxT("Show the lua stack tree") , wxITEM_NORMAL, wxBitmap(LUA_xpm))); wxluaMenu->AppendSeparator(); ! wxluaMenu->Append(ID_LUACON_TOGGLE_BREAKPOINT, wxT("&Toggle breakpoint")); return wxluaMenu; } ! void wxLuaConsole::SetwxLuaState(const wxLuaState& wxlState, bool is_static) { if (m_wxlState.Ok() && !m_wxlstate_static) --- 487,529 ---- if (!m_wxlState.Ok() || !m_wxlState.IsRunning()) ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_WXLUAIDE_BREAK_LUA, false); } ! void wxLuaIDE::PopulateToolBar(wxToolBar *toolBar, long options) const { bool add_sep = false; ! if ((options & WXLUAIDE_TB_FILE) != 0) { ! toolBar->AddTool( ID_WXLUAIDE_LOAD_LUA, wxT("Open file"), wxBitmap(open_xpm), wxT("Open lua program") ); ! toolBar->AddTool( ID_WXLUAIDE_SAVEAS_LUA, wxT("Save as..."), wxBitmap(save_xpm), wxT("Save lua program") ); add_sep = true; } ! if ((options & WXLUAIDE_TB_LUA) != 0) { if (add_sep) toolBar->AddSeparator(); ! toolBar->AddTool( ID_WXLUAIDE_RUN_LUA, wxT("Run wxLua program"), wxBitmap(play_xpm), wxT("Run the wxLua program") ); ! toolBar->AddTool( ID_WXLUAIDE_BREAK_LUA, wxT("Stop wxLua program"), wxBitmap(stop_xpm), wxT("Stop the running wxLua program") ); toolBar->AddSeparator(); ! toolBar->AddTool( ID_WXLUAIDE_SHOW_STACK, wxT("Show stack tree"), wxBitmap(LUA_xpm), wxT("Show the lua stack tree") ); } toolBar->Realize(); } ! wxMenu* wxLuaIDE::CreatewxLuaMenu() const { wxSTEditorMenuManager s; wxMenu *wxluaMenu = new wxMenu(); ! wxluaMenu->Append(s.MenuItem(wxluaMenu, ID_WXLUAIDE_RUN_LUA, wxT("&Run wxLua program"), wxT("Run the wxLua program") , wxITEM_NORMAL, wxBitmap(play_xpm))); ! wxluaMenu->Append(s.MenuItem(wxluaMenu, ID_WXLUAIDE_BREAK_LUA, wxT("&Stop wxLua program"), wxT("Stop the running wxLua program") , wxITEM_NORMAL, wxBitmap(stop_xpm))); wxluaMenu->AppendSeparator(); ! wxluaMenu->Append(s.MenuItem(wxluaMenu, ID_WXLUAIDE_SHOW_STACK, wxT("Stack &tree"), wxT("Show the lua stack tree") , wxITEM_NORMAL, wxBitmap(LUA_xpm))); wxluaMenu->AppendSeparator(); ! wxluaMenu->Append(ID_WXLUAIDE_TOGGLE_BREAKPOINT, wxT("&Toggle breakpoint")); return wxluaMenu; } ! void wxLuaIDE::SetwxLuaState(const wxLuaState& wxlState, bool is_static) { if (m_wxlState.Ok() && !m_wxlstate_static) *************** *** 531,535 **** m_wxlState.DebugHookBreak(); ! m_wxlState.Destroy(); } --- 532,537 ---- m_wxlState.DebugHookBreak(); ! m_wxlState.CloseLuaState(true); // force closing it since we own it ! m_wxlState.Destroy(); // unref it so it's invalid } *************** *** 538,544 **** } ! bool wxLuaConsole::RecreatewxLuaState(wxEvtHandler *wxlStateEvtHandler, int win_id) { ! wxLuaEvent event(wxEVT_LUACONSOLE_wxLUA_CREATION, GetId(), wxNullLuaState); event.SetEventObject(this); event.SetInt(0); --- 540,546 ---- } ! bool wxLuaIDE::RecreatewxLuaState(wxEvtHandler *wxlStateEvtHandler, int win_id) { ! wxLuaEvent event(wxEVT_LUAIDE_wxLUA_CREATION, GetId(), wxNullLuaState); event.SetEventObject(this); event.SetInt(0); *************** *** 558,562 **** } ! void wxLuaConsole::OnCreateEditor(wxCommandEvent &event) { wxWindow *win = (wxWindow*)event.GetEventObject(); --- 560,564 ---- } ! void wxLuaIDE::OnCreateEditor(wxCommandEvent &event) { wxWindow *win = (wxWindow*)event.GetEventObject(); *************** *** 564,572 **** wxDefaultPosition, wxDefaultSize, 0); editor->CreateOptions(m_editorOptions); ! editor->SetwxLuaConsole(this); event.SetEventObject(editor); } ! void wxLuaConsole::OnMenu(wxCommandEvent &event) { //wxSTERecursionGuard guard(m_rGuard_OnMenu); can't have for BREAK --- 566,574 ---- wxDefaultPosition, wxDefaultSize, 0); editor->CreateOptions(m_editorOptions); ! editor->SetwxLuaIDE(this); event.SetEventObject(editor); } ! void wxLuaIDE::OnMenu(wxCommandEvent &event) { //wxSTERecursionGuard guard(m_rGuard_OnMenu); can't have for BREAK *************** *** 577,581 **** } ! bool wxLuaConsole::HandleMenuEvent(wxCommandEvent& event) { //wxSTERecursionGuard guard(m_rGuard_HandleMenuEvent); can't have for BREAK --- 579,583 ---- } ! bool wxLuaIDE::HandleMenuEvent(wxCommandEvent& event) { //wxSTERecursionGuard guard(m_rGuard_HandleMenuEvent); can't have for BREAK *************** *** 587,591 **** switch(event.GetId()) { ! case ID_LUACON_LOAD_LUA : { wxString filename = editor->GetFileName(); --- 589,593 ---- switch(event.GetId()) { ! case ID_WXLUAIDE_LOAD_LUA : { wxString filename = editor->GetFileName(); *************** *** 612,621 **** return true; } ! case ID_LUACON_SAVEAS_LUA : { editor->SaveFile(true); return true; } ! case ID_LUACON_RUN_LUA : { wxString program = editor->GetText(); --- 614,623 ---- return true; } ! case ID_WXLUAIDE_SAVEAS_LUA : { editor->SaveFile(true); return true; } ! case ID_WXLUAIDE_RUN_LUA : { wxString program = editor->GetText(); *************** *** 634,640 **** wxCHECK_MSG(RecreatewxLuaState(GetEventHandler(), editor->GetId()), true, wxT("Can't recreate lua interpreter")); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_LUACON_RUN_LUA, false); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_LUACON_BREAK_LUA, true); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_LUACON_SHOW_STACK, false); editor->MarkerDeleteAll(wxLuaEditor::markerError); --- 636,642 ---- wxCHECK_MSG(RecreatewxLuaState(GetEventHandler(), editor->GetId()), true, wxT("Can't recreate lua interpreter")); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_WXLUAIDE_RUN_LUA, false); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_WXLUAIDE_BREAK_LUA, true); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_WXLUAIDE_SHOW_STACK, false); editor->MarkerDeleteAll(wxLuaEditor::markerError); *************** *** 681,691 **** m_luaOutput->CheckPrompt(true); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_LUACON_RUN_LUA, true); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_LUACON_BREAK_LUA, false); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_LUACON_SHOW_STACK, true); return true; } ! case ID_LUACON_BREAK_LUA : { if (m_wxlState.Ok() && m_wxlState.IsRunning()) --- 683,693 ---- m_luaOutput->CheckPrompt(true); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_WXLUAIDE_RUN_LUA, true); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_WXLUAIDE_BREAK_LUA, false); ! wxSTEditorMenuManager::DoEnableItem(NULL, GetMenuBar(), GetToolBar(), ID_WXLUAIDE_SHOW_STACK, true); return true; } ! case ID_WXLUAIDE_BREAK_LUA : { if (m_wxlState.Ok() && m_wxlState.IsRunning()) *************** *** 700,704 **** return true; } ! case ID_LUACON_SHOW_STACK : { m_show_stack = true; --- 702,706 ---- return true; } ! case ID_WXLUAIDE_SHOW_STACK : { m_show_stack = true; *************** *** 746,750 **** } ! void wxLuaConsole::OnLua(wxLuaEvent &event) { wxLuaShell *outEditor = NULL; --- 748,752 ---- } ! void wxLuaIDE::OnLua(wxLuaEvent &event) { wxLuaShell *outEditor = NULL; *************** *** 758,768 **** } ! void wxLuaConsole::OutputLuaEvent(wxLuaEvent &event, wxLuaShell *outEditor) { // perhaps there was an error at startup, but editor isn't created yet if (outEditor == NULL) - { return; - } if (event.GetEventType() == wxEVT_LUA_DEBUG_HOOK) --- 760,768 ---- } ! void wxLuaIDE::OutputLuaEvent(wxLuaEvent &event, wxLuaShell *outEditor) { // perhaps there was an error at startup, but editor isn't created yet if (outEditor == NULL) return; if (event.GetEventType() == wxEVT_LUA_DEBUG_HOOK) *************** *** 792,799 **** else if (event.GetEventType() == wxEVT_LUA_ERROR) { ! WriteMessage(outEditor, wxT("\nErr: ") + event.GetString() + wxT("\n")); int line = event.GetLineNum(); // Put a marker where the error occurred if ((line >= 0) && (event.GetwxLuaState() == m_wxlState)) --- 792,803 ---- else if (event.GetEventType() == wxEVT_LUA_ERROR) { ! WriteMessage(outEditor, wxT("\nError: ") + event.GetString() + wxT("\n")); int line = event.GetLineNum(); + // the user generated an error from running something in the shell + if (event.GetString().Find(wxT("[string \"wxLuaShell\"]")) != wxNOT_FOUND) + line = -1; + // Put a marker where the error occurred if ((line >= 0) && (event.GetwxLuaState() == m_wxlState)) *************** *** 812,819 **** } ! void wxLuaConsole::WriteMessage(wxLuaShell *outputWin, const wxString& str) { wxCHECK_RET(outputWin, wxT("Invalid wxLuaShell to write message to.")); if (m_msgNotebook) { --- 816,834 ---- } ! void wxLuaIDE::WriteMessage(wxLuaShell *outputWin, const wxString& str) { wxCHECK_RET(outputWin, wxT("Invalid wxLuaShell to write message to.")); + // try to turn the message notebook page to show the message + if (m_msgNotebook) + { + int sel = m_msgNotebook->GetSelection(); + if ((outputWin->GetId() == ID_WXLUAIDE_SHELL) && (sel != 0)) + m_msgNotebook->SetSelection(0); + if ((outputWin->GetId() == ID_WXLUAIDE_OUTPUT_WIN) && (sel != 1)) + m_msgNotebook->SetSelection(1); + } + + /* if (m_msgNotebook) { *************** *** 823,832 **** win = win->GetParent(); ! int sel = GetMsgNotebook()->GetSelection(); ! if (win && ((sel < 0) || (GetMsgNotebook()->GetPage(sel) != win))) { ! int count = m_msgNotebook->GetPageCount(); ! for (int n = 0; n < count; n++) { if ((n != sel) && (m_msgNotebook->GetPage(n) == win)) --- 838,847 ---- win = win->GetParent(); ! int sel = m_msgNotebook->GetSelection(); ! if (win && ((sel < 0) || (m_msgNotebook->GetPage(sel) != win))) { ! int n, count = m_msgNotebook->GetPageCount(); ! for (n = 0; n < count; n++) { if ((n != sel) && (m_msgNotebook->GetPage(n) == win)) *************** *** 838,841 **** --- 853,857 ---- } } + */ outputWin->AppendText(str); |
From: John L. <jr...@us...> - 2006-12-15 05:16:05
|
Update of /cvsroot/wxlua/wxLua/apps/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26340/wxLua/apps/wxlua/src Modified Files: lconsole.cpp Log Message: Rename wxLuaEditor's wxLuaConsole class to wxLuaIDE so it won't conflict with the wxLuaApp's wxLuaConsole allow use wxLuaConsole from wxlua app in wxluaeditor Index: lconsole.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxlua/src/lconsole.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** lconsole.cpp 12 Dec 2006 01:23:40 -0000 1.15 --- lconsole.cpp 15 Dec 2006 05:16:01 -0000 1.16 *************** *** 26,32 **** #include "wxlua/include/wxlua.h" - #include "wxlua.h" #include "lconsole.h" // ---------------------------------------------------------------------------- // wxLuaConsole --- 26,35 ---- #include "wxlua/include/wxlua.h" #include "lconsole.h" + #ifndef WXLUAEDITOR_APP + #include "wxlua.h" + #endif //WXLUAEDITOR_APP + // ---------------------------------------------------------------------------- // wxLuaConsole |
From: John L. <jr...@us...> - 2006-12-15 00:02:18
|
Update of /cvsroot/wxlua/wxLua/apps/wxluaedit/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv728/wxLua/apps/wxluaedit/src Modified Files: wxledit.cpp wxledit.h Log Message: write message output to appropriate wxLuaShell Index: wxledit.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxledit.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wxledit.h 12 Dec 2006 01:23:40 -0000 1.14 --- wxledit.h 15 Dec 2006 00:02:13 -0000 1.15 *************** *** 253,258 **** --- 253,263 ---- virtual bool RecreatewxLuaState(wxEvtHandler *wxlStateEvtHandler, int win_id); + // Direct the string output of the wxLuaEvent to the given wxLuaShell virtual void OutputLuaEvent(wxLuaEvent &event, wxLuaShell *outputWin); + // Write the string to the given shell and make it visible if it's in the + // GetMsgNotebook. + virtual void WriteMessage(wxLuaShell *outputWin, const wxString& str); + // Get or adjust the child windows of this control wxSplitterWindow *GetSplitterWin() const { return m_splitter; } Index: wxledit.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxledit.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** wxledit.cpp 13 Dec 2006 06:57:48 -0000 1.27 --- wxledit.cpp 15 Dec 2006 00:02:13 -0000 1.28 *************** *** 643,647 **** m_luaOutput->ClearAll(); m_luaOutput->MarkerDeleteAll(wxLuaShell::markerPrompt); ! m_luaOutput->AppendText(wxT("Running lua script : ") + wxNow() + wxT("\n")); wxStopWatch stopWatch; //m_luaOutput->SetReadOnly(true); --- 643,647 ---- m_luaOutput->ClearAll(); m_luaOutput->MarkerDeleteAll(wxLuaShell::markerPrompt); ! WriteMessage(m_luaOutput, wxT("Running lua script : ") + wxNow() + wxT("\n")); wxStopWatch stopWatch; //m_luaOutput->SetReadOnly(true); *************** *** 676,681 **** m_luaOutput->SetReadOnly(false); ! m_luaOutput->AppendText(wxT("End lua script : ") + wxNow() + wxT("\n")); ! m_luaOutput->AppendText(wxString::Format(wxT("Execution time : %.3lf(s)\n"), stopWatch.Time()/1000.0)); m_luaOutput->CheckPrompt(true); --- 676,681 ---- m_luaOutput->SetReadOnly(false); ! WriteMessage(m_luaOutput, wxT("End lua script : ") + wxNow() + wxT("\n")); ! WriteMessage(m_luaOutput, wxString::Format(wxT("Execution time : %.3lf(s)\n"), stopWatch.Time()/1000.0)); m_luaOutput->CheckPrompt(true); *************** *** 788,796 **** else if (event.GetEventType() == wxEVT_LUA_PRINT) { ! outEditor->AppendText(event.GetString() + wxT("\n")); } else if (event.GetEventType() == wxEVT_LUA_ERROR) { ! outEditor->AppendText(wxT("\nErr: ") + event.GetString() + wxT("\n")); int line = event.GetLineNum(); --- 788,796 ---- else if (event.GetEventType() == wxEVT_LUA_PRINT) { ! WriteMessage(outEditor, event.GetString() + wxT("\n")); } else if (event.GetEventType() == wxEVT_LUA_ERROR) { ! WriteMessage(outEditor, wxT("\nErr: ") + event.GetString() + wxT("\n")); int line = event.GetLineNum(); *************** *** 811,812 **** --- 811,842 ---- } } + + void wxLuaConsole::WriteMessage(wxLuaShell *outputWin, const wxString& str) + { + wxCHECK_RET(outputWin, wxT("Invalid wxLuaShell to write message to.")); + + if (m_msgNotebook) + { + // the parent of the wxLuaShell is probably a splitter + wxWindow* win = outputWin; + while (win->GetParent() && (win->GetParent() != m_msgNotebook)) + win = win->GetParent(); + + int sel = GetMsgNotebook()->GetSelection(); + if (win && ((sel < 0) || (GetMsgNotebook()->GetPage(sel) != win))) + { + int count = m_msgNotebook->GetPageCount(); + + for (int n = 0; n < count; n++) + { + if ((n != sel) && (m_msgNotebook->GetPage(n) == win)) + { + m_msgNotebook->SetSelection(n); + break; + } + } + } + } + + outputWin->AppendText(str); + } |
From: John L. <jr...@us...> - 2006-12-14 22:03:04
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17944/wxLua/bindings/wxwidgets Modified Files: wx_datatypes.lua Log Message: speedup genwxbind.lua another 30%, make global vars more readable Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wx_datatypes.lua 13 Dec 2006 06:57:49 -0000 1.42 --- wx_datatypes.lua 14 Dec 2006 22:02:57 -0000 1.43 *************** *** 7,13 **** -- --------------------------------------------------------------------------- ! -- typeDefs -- --------------------------------------------------------------------------- ! wx_typeDefs = { WXHANDLE = "void *", --- 7,13 ---- -- --------------------------------------------------------------------------- ! -- typedefTable -- --------------------------------------------------------------------------- ! wx_typedefTable = { WXHANDLE = "void *", *************** *** 25,29 **** -- dataTypes -- --------------------------------------------------------------------------- ! wx_dataTypes = { BOOL = { --- 25,29 ---- -- dataTypes -- --------------------------------------------------------------------------- ! wx_dataTypeTable = { BOOL = { *************** *** 3247,3253 **** -- --------------------------------------------------------------------------- ! -- conditions -- --------------------------------------------------------------------------- ! wx_conditions = { ["%__WIN16__"] = "defined(__WIN16__)", --- 3247,3253 ---- -- --------------------------------------------------------------------------- ! -- preprocConditionTable -- --------------------------------------------------------------------------- ! wx_preprocConditionTable = { ["%__WIN16__"] = "defined(__WIN16__)", *************** *** 3627,3637 **** -- Cache the dataTypes -- --------------------------------------------------------------------------- ! for k, v in pairs(wx_typeDefs) do ! typeDefs[k] = v end ! for k, v in pairs(wx_dataTypes) do ! dataTypes[k] = v end ! for k, v in pairs(wx_conditions) do ! conditions[k] = v end --- 3627,3637 ---- -- Cache the dataTypes -- --------------------------------------------------------------------------- ! for k, v in pairs(wx_typedefTable) do ! typedefTable[k] = v end ! for k, v in pairs(wx_dataTypeTable) do ! dataTypeTable[k] = v end ! for k, v in pairs(wx_preprocConditionTable) do ! preprocConditionTable[k] = v end |
From: John L. <jr...@us...> - 2006-12-14 22:03:03
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17944/wxLua/bindings Modified Files: genwxbind.lua Log Message: speedup genwxbind.lua another 30%, make global vars more readable Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** genwxbind.lua 14 Dec 2006 07:00:33 -0000 1.91 --- genwxbind.lua 14 Dec 2006 22:02:57 -0000 1.92 *************** *** 21,37 **** -- see modules/wxlua/include/wxldefs.h ! keywords = {} -- Keyword table ! conditions = {} -- Preprocessor conditions ! conditionOperators = {} -- Preprocessor operators ! operators = {} -- %operators ! ignore = {} -- Keyword ignore table ! delimiters = { "[]", "==", "&&", "||", "//", "/*", "*/", "*", "&", "|", "(", ")", "[", "]", ",", "=", "{", "}", "!", ";", "\t", "\r", "\n", " " } ! keep = { "[]", "==", "&&", "||", "//", "/*", "*/", "*", "&", "|", "(", ")", "[", "]", ",", "=", "{", "!" } -- keep delimiters, except for white space [...2591 lines suppressed...] ! table.insert(fileData, " for k, v in pairs("..hook_cpp_namespace.."_dataTypes) do\n") ! table.insert(fileData, " dataTypes[k] = v\n") table.insert(fileData, " end\n") ! table.insert(fileData, " for k, v in pairs("..hook_cpp_namespace.."_conditions) do\n") ! table.insert(fileData, " conditions[k] = v\n") table.insert(fileData, " end\n") --- 4603,4614 ---- table.insert(fileData, "-- Cache the dataTypes\n") table.insert(fileData, "-- ---------------------------------------------------------------------------\n") ! table.insert(fileData, " for k, v in pairs("..hook_cpp_namespace.."_typedefTable) do\n") ! table.insert(fileData, " typedefTable[k] = v\n") table.insert(fileData, " end\n") ! table.insert(fileData, " for k, v in pairs("..hook_cpp_namespace.."_dataTypeTable) do\n") ! table.insert(fileData, " dataTypeTable[k] = v\n") table.insert(fileData, " end\n") ! table.insert(fileData, " for k, v in pairs("..hook_cpp_namespace.."_preprocConditionTable) do\n") ! table.insert(fileData, " preprocConditionTable[k] = v\n") table.insert(fileData, " end\n") |
From: John L. <jr...@us...> - 2006-12-14 22:03:03
|
Update of /cvsroot/wxlua/wxLua/bindings/wxstc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17944/wxLua/bindings/wxstc Modified Files: wxstc_datatypes.lua Log Message: speedup genwxbind.lua another 30%, make global vars more readable Index: wxstc_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxstc/wxstc_datatypes.lua,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wxstc_datatypes.lua 13 Dec 2006 06:57:49 -0000 1.37 --- wxstc_datatypes.lua 14 Dec 2006 22:02:57 -0000 1.38 *************** *** 7,13 **** -- --------------------------------------------------------------------------- ! -- typeDefs -- --------------------------------------------------------------------------- ! wxstc_typeDefs = { WXHANDLE = "void *", --- 7,13 ---- -- --------------------------------------------------------------------------- ! -- typedefTable -- --------------------------------------------------------------------------- ! wxstc_typedefTable = { WXHANDLE = "void *", *************** *** 25,29 **** -- dataTypes -- --------------------------------------------------------------------------- ! wxstc_dataTypes = { BOOL = { --- 25,29 ---- -- dataTypes -- --------------------------------------------------------------------------- ! wxstc_dataTypeTable = { BOOL = { *************** *** 3259,3265 **** -- --------------------------------------------------------------------------- ! -- conditions -- --------------------------------------------------------------------------- ! wxstc_conditions = { ["%__WIN16__"] = "defined(__WIN16__)", --- 3259,3265 ---- -- --------------------------------------------------------------------------- ! -- preprocConditionTable -- --------------------------------------------------------------------------- ! wxstc_preprocConditionTable = { ["%__WIN16__"] = "defined(__WIN16__)", *************** *** 3639,3649 **** -- Cache the dataTypes -- --------------------------------------------------------------------------- ! for k, v in pairs(wxstc_typeDefs) do ! typeDefs[k] = v end ! for k, v in pairs(wxstc_dataTypes) do ! dataTypes[k] = v end ! for k, v in pairs(wxstc_conditions) do ! conditions[k] = v end --- 3639,3649 ---- -- Cache the dataTypes -- --------------------------------------------------------------------------- ! for k, v in pairs(wxstc_typedefTable) do ! typedefTable[k] = v end ! for k, v in pairs(wxstc_dataTypeTable) do ! dataTypeTable[k] = v end ! for k, v in pairs(wxstc_preprocConditionTable) do ! preprocConditionTable[k] = v end |
From: John L. <jr...@us...> - 2006-12-14 07:00:36
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10948/wxLua/bindings Modified Files: genwxbind.lua Log Message: double the speed of genwxbind.lua Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** genwxbind.lua 14 Dec 2006 01:01:22 -0000 1.90 --- genwxbind.lua 14 Dec 2006 07:00:33 -0000 1.91 *************** *** 2,16 **** -- Name: genwxbind.lua -- Purpose: This script generates wrapper files from the table interface_fileTable (see below) ! -- Author: Ray Gilbert -- Created: 19/05/2004 -- Copyright: Ray Gilbert ! -- sLicence: wxWidgets licence -- --------------------------------------------------------------------------- - -- code generated is compatible with wxWrapLua.lua, J Winwood's work from wxLua - -- - -- There were a few shortcomings of the code generated by wxWrapLua [...2004 lines suppressed...] end end --- 4590,4606 ---- for condition, BindTableList in pairs_sort(BindTable) do ! if HasCondition(condition) and (condition ~= object.Condition) then ! table.insert(fileData, "\n#if "..condition.."\n") ! end ! local bindCount = #BindTableList ! for i=1,bindCount do ! if BindTableList[i].Map then ! table.insert(fileData, BindTableList[i].Map) end + end ! if HasCondition(condition) and (condition ~= object.Condition) then ! table.insert(fileData, "#endif // "..condition.."\n\n") end end |
From: John L. <jr...@us...> - 2006-12-14 01:01:56
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/bindings Modified Files: genwxbind.lua Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** genwxbind.lua 13 Dec 2006 06:57:48 -0000 1.89 --- genwxbind.lua 14 Dec 2006 01:01:22 -0000 1.90 *************** *** 24,28 **** -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 2 -- Used to verify that the bindings are updated -- see modules/wxlua/include/wxldefs.h --- 24,28 ---- -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 3 -- Used to verify that the bindings are updated -- see modules/wxlua/include/wxldefs.h *************** *** 61,64 **** --- 61,73 ---- overrideTableUsed = {} -- table set to true if override was used + -- helpers for SplitString to make it faster + + local string_sub = string.sub -- make local so no table lookup + local string_len = string.len + local string_byte = string.byte + + local char_BACKSLASH = string.byte("\\") + local char_DOUBLEQUOTE = string.byte("\"") + -- --------------------------------------------------------------------------- -- CheckRules - check the settings in the rules file for common errors *************** *** 149,153 **** -- --------------------------------------------------------------------------- function AllocDataType(name, deftype, is_number, abstract) ! local datatype = { DefType = deftype, -- number, enum, class, special (special handling) --- 158,162 ---- -- --------------------------------------------------------------------------- function AllocDataType(name, deftype, is_number, abstract) ! dataTypes[name] = { DefType = deftype, -- number, enum, class, special (special handling) *************** *** 159,164 **** Condition = nil, -- conditions for this data type, eg. wxLUA_USE_xxx } - - return datatype end --- 168,171 ---- *************** *** 168,236 **** function InitDataTypes() -- Standard C data types ! dataTypes["bool"] = AllocDataType("bool", "number", true) ! dataTypes["BOOL"] = AllocDataType("BOOL", "number", true) ! dataTypes["double"] = AllocDataType("double", "number", true) ! dataTypes["int"] = AllocDataType("int", "number", true) ! dataTypes["char"] = AllocDataType("char", "number", true) ! dataTypes["float"] = AllocDataType("float", "number", true) ! dataTypes["long"] = AllocDataType("long", "number", true) ! dataTypes["short"] = AllocDataType("short", "number", true) ! dataTypes["size_t"] = AllocDataType("size_t", "number", true) ! dataTypes["time_t"] = AllocDataType("time_t", "number", true) ! dataTypes["unsigned char"] = AllocDataType("unsigned char", "number", true) ! dataTypes["unsigned int"] = AllocDataType("unsigned int", "number", true) ! dataTypes["unsigned long"] = AllocDataType("unsigned long", "number", true) ! dataTypes["unsigned short"] = AllocDataType("unsigned short", "number", true) ! dataTypes["uchar"] = AllocDataType("uchar", "number", true) ! dataTypes["uint"] = AllocDataType("uint", "number", true) ! dataTypes["ulong"] = AllocDataType("ulong", "number", true) ! dataTypes["ushort"] = AllocDataType("ushort", "number", true) ! dataTypes["void"] = AllocDataType("void", "number", true) ! dataTypes["wchar_t"] = AllocDataType("wchar_t", "number", true) -- wxWidgets defined data types ! --dataTypes["wxArtClient"] = AllocDataType("wxString", "special", true) -- treat as wxString ! --dataTypes["wxArtID"] = AllocDataType("wxString", "special", true) ! dataTypes["wxByte"] = AllocDataType("wxByte", "number", true) ! dataTypes["wxChar"] = AllocDataType("wxChar", "number", true) ! dataTypes["wxWord"] = AllocDataType("wxWord", "number", true) ! dataTypes["wxInt8"] = AllocDataType("wxInt8", "number", true) ! dataTypes["wxUint8"] = AllocDataType("wxUint8", "number", true) ! dataTypes["wxInt16"] = AllocDataType("wxInt16", "number", true) ! dataTypes["wxUint16"] = AllocDataType("wxUint16", "number", true) ! dataTypes["wxInt32"] = AllocDataType("wxInt32", "number", true) ! dataTypes["wxUint32"] = AllocDataType("wxUint32", "number", true) ! dataTypes["wxInt64"] = AllocDataType("wxInt64", "number", true) ! dataTypes["wxUint64"] = AllocDataType("wxUint64", "number", true) ! dataTypes["wxFloat32"] = AllocDataType("wxFloat32", "number", true) ! dataTypes["wxFloat64"] = AllocDataType("wxFloat64", "number", true) ! dataTypes["wxDouble"] = AllocDataType("wxDouble", "number", true) ! dataTypes["wxCoord"] = AllocDataType("wxCoord", "number", true) ! dataTypes["wxTextCoord"] = AllocDataType("wxTextCoord", "number", true) ! dataTypes["wxMemorySize"] = AllocDataType("wxMemorySize", "number", true) ! dataTypes["WXTYPE"] = AllocDataType("WXTYPE", "number", true) ! dataTypes["wxWindowID"] = AllocDataType("wxWindowID", "number", true) ! dataTypes["wxEventType"] = AllocDataType("wxEventType", "number", true) ! dataTypes["wxFileOffset"] = AllocDataType("wxFileOffset", "number", true) ! --dataTypes["wxStructStat"] = AllocDataType("wxStructStat", "number", true) -- lua data types ! dataTypes["lua_State"] = AllocDataType("lua_State", "number", false) -- win32 data types ! dataTypes["HANDLE"] = AllocDataType("HANDLE", "number", false) ! dataTypes["DWORD64"] = AllocDataType("DWORD64", "number", true) ! dataTypes["DWORD"] = AllocDataType("DWORD", "number", true) ! dataTypes["PVOID"] = AllocDataType("PVOID", "number", true) ! dataTypes["LPCVOID"] = AllocDataType("LPCVOID", "number", true) ! dataTypes["LPVOID"] = AllocDataType("LPVOID", "number", true) ! dataTypes["LPDWORD"] = AllocDataType("LPDWORD", "number", true) -- "fake" data types that we handle in some more complicated way ! dataTypes["LuaFunction"] = AllocDataType("LuaFunction", "special", true) ! dataTypes["LuaTable"] = AllocDataType("LuaTable", "special", true) ! dataTypes["wxString"] = AllocDataType("wxString", "special", true) ! dataTypes["wxArrayString_FromLuaTable"] = AllocDataType("wxArrayString_FromLuaTable", "special", true) ! dataTypes["wxArrayInt_FromLuaTable"] = AllocDataType("wxArrayInt_FromLuaTable", "special", true) -- attributes that can precede a data type --- 175,243 ---- function InitDataTypes() -- Standard C data types ! AllocDataType("bool", "number", true) ! AllocDataType("BOOL", "number", true) ! AllocDataType("double", "number", true) ! AllocDataType("int", "number", true) ! AllocDataType("char", "number", true) ! AllocDataType("float", "number", true) ! AllocDataType("long", "number", true) ! AllocDataType("short", "number", true) ! AllocDataType("size_t", "number", true) ! AllocDataType("time_t", "number", true) ! AllocDataType("unsigned char", "number", true) ! AllocDataType("unsigned int", "number", true) ! AllocDataType("unsigned long", "number", true) ! AllocDataType("unsigned short", "number", true) ! AllocDataType("uchar", "number", true) ! AllocDataType("uint", "number", true) ! AllocDataType("ulong", "number", true) ! AllocDataType("ushort", "number", true) ! AllocDataType("void", "number", true) ! AllocDataType("wchar_t", "number", true) -- wxWidgets defined data types ! --AllocDataType("wxString", "special", true) -- treat as wxString ! --AllocDataType("wxString", "special", true) ! AllocDataType("wxByte", "number", true) ! AllocDataType("wxChar", "number", true) ! AllocDataType("wxWord", "number", true) ! AllocDataType("wxInt8", "number", true) ! AllocDataType("wxUint8", "number", true) ! AllocDataType("wxInt16", "number", true) ! AllocDataType("wxUint16", "number", true) ! AllocDataType("wxInt32", "number", true) ! AllocDataType("wxUint32", "number", true) ! AllocDataType("wxInt64", "number", true) ! AllocDataType("wxUint64", "number", true) ! AllocDataType("wxFloat32", "number", true) ! AllocDataType("wxFloat64", "number", true) ! AllocDataType("wxDouble", "number", true) ! AllocDataType("wxCoord", "number", true) ! AllocDataType("wxTextCoord", "number", true) ! AllocDataType("wxMemorySize", "number", true) ! AllocDataType("WXTYPE", "number", true) ! AllocDataType("wxWindowID", "number", true) ! AllocDataType("wxEventType", "number", true) ! AllocDataType("wxFileOffset", "number", true) ! --AllocDataType("wxStructStat", "number", true) -- lua data types ! AllocDataType("lua_State", "number", false) -- win32 data types ! AllocDataType("HANDLE", "number", false) ! AllocDataType("DWORD64", "number", true) ! AllocDataType("DWORD", "number", true) ! AllocDataType("PVOID", "number", true) ! AllocDataType("LPCVOID", "number", true) ! AllocDataType("LPVOID", "number", true) ! AllocDataType("LPDWORD", "number", true) -- "fake" data types that we handle in some more complicated way ! AllocDataType("LuaFunction", "special", true) ! AllocDataType("LuaTable", "special", true) ! AllocDataType("wxString", "special", true) ! AllocDataType("wxArrayString_FromLuaTable", "special", true) ! AllocDataType("wxArrayInt_FromLuaTable", "special", true) -- attributes that can precede a data type *************** *** 1151,1154 **** --- 1158,1169 ---- -- --------------------------------------------------------------------------- function SplitString(line, delimiter, keep, stringliterals, lineTable) + if not line then + if lineTable then + print("Error: line is nil in SplitString, "..LineTableErrString(lineTable)) + else + print("Error: line is nil in SplitString") -- let it fail on string.len + end + end + local item = {} local wordStart = -1 *************** *** 1157,1199 **** local escaped = false ! if not line then ! if lineTable then ! print("Error: line is nil in SplitString, "..LineTableErrString(lineTable)) ! else ! print("Error: line is nil in SplitString") -- let it fail on string.len end end local i = 1 ! local len = string.len(line) while i <= len do ! local val = string.sub(line, i) local delim = nil local keepDelim = false if stringliterals then if inStringLiteral then ! if string.sub(val, 1, 1) == "\\" then escaped = not escaped ! else ! if not escaped and (string.sub(val, 1, 1) == "\"") then ! inStringLiteral = false ! end ! escaped = false ! end ! else ! if string.sub(val, 1, 1) == "\"" then ! inStringLiteral = true end end end if not inStringLiteral then ! -- delimiter can be an table of strings ! local d = 0 ! while delimiter[d+1] do ! d = d + 1 ! if string.sub(val, 1, string.len(delimiter[d])) == delimiter[d] then ! delim = delimiter[d] break end --- 1172,1216 ---- local escaped = false ! -- create a list of the lengths of the delimiter strings ! local delimiter_len = {} ! local delimiter_count = #delimiter ! for n = 1, delimiter_count do ! delimiter_len[n] = string_len(delimiter[n]) ! end ! ! -- create a hash table of the keep strings ! local keep_table = {} ! if keep then ! local keep_count = #keep ! for n = 1, keep_count do ! keep_table[keep[n]] = true end end local i = 1 ! local len = string_len(line) while i <= len do ! local val = string_sub(line, i) local delim = nil local keepDelim = false if stringliterals then + local char = string_byte(val) if inStringLiteral then ! if char == char_BACKSLASH then escaped = not escaped ! elseif not escaped and (char == char_DOUBLEQUOTE) then ! inStringLiteral = false end + elseif char == char_DOUBLEQUOTE then + inStringLiteral = true end end if not inStringLiteral then ! -- delimiter can be a table of strings ! for n = 1, delimiter_count do ! if string_sub(val, 1, delimiter_len[n]) == delimiter[n] then ! delim = delimiter[n] break end *************** *** 1201,1213 **** -- keep delimiter in list ! if delim and keep then ! local d = 0 ! while keep[d+1] do ! d = d + 1 ! if delim == keep[d] then ! keepDelim = true ! break ! end ! end end end --- 1218,1223 ---- -- keep delimiter in list ! if delim and keep and keep_table[delim] then ! keepDelim = true end end *************** *** 1222,1226 **** else if wordStart ~= -1 then ! table.insert(item, string.sub(line, wordStart, wordEnd)) end if keepDelim then --- 1232,1236 ---- else if wordStart ~= -1 then ! table.insert(item, string_sub(line, wordStart, wordEnd)) end if keepDelim then *************** *** 1229,1238 **** wordStart = -1 ! i = i + string.len(delim) end end if (wordStart ~= -1) then ! table.insert(item, string.sub(line, wordStart)) end --- 1239,1248 ---- wordStart = -1 ! i = i + string_len(delim) end end if (wordStart ~= -1) then ! table.insert(item, string_sub(line, wordStart)) end *************** *** 1380,1383 **** --- 1390,1395 ---- local interfaceList = {} + local time1 = os.time() + -- read all interface files and build DataType Table local idx = 0 *************** *** 1398,1401 **** --- 1410,1417 ---- end + local time2 = os.time() + print("Timing: BuildDataTypeTable "..os.difftime(time2, time1).." seconds.") + time1 = time2 + local idx = 0 while interfaceFileDataList[idx+1] do *************** *** 1420,1423 **** --- 1436,1442 ---- end + local time2 = os.time() + print("Timing: ParseData "..os.difftime(time2, time1).." seconds.") + return interfaceList end *************** *** 1427,1430 **** --- 1446,1450 ---- -- --------------------------------------------------------------------------- function WriteWrapperFiles(interfaceList) + local time1 = os.time() -- generatelanguage binding, binding is stored in objectList *************** *** 1443,1446 **** --- 1463,1469 ---- end + local time2 = os.time() + --print("Timing: GenerateLuaLanguageBinding and GenerateBindingFileTable "..os.difftime(time2, time1).." seconds.") + local fileData = GenerateHookHeaderFileTable() WriteTableToFile(GetCPPHeaderFileName(hook_cpp_header_filename), fileData, false) *************** *** 1544,1549 **** local lineState = { ! ClassName = nil, ! Action = nil } --- 1567,1572 ---- local lineState = { ! ClassName = nil, ! Action = nil } *************** *** 1577,1618 **** end end ! elseif not in_block_comment then ! if not conditionOperators[tag] and (not FindOrCreateCondition(tag)) and (not ignore[tag]) then ! if lineState.Action == "classname" then ! if not dataTypes[tag] then ! dataTypes[tag] = AllocDataType(tag, "class", false) ! end ! lineState.ClassName = tag ! lineState.Action = "classcomma" ! elseif lineState.Action == "classcomma" then ! if tag ~= "," then ! print("WARNING : Expected comma (',') after class name : '"..lineState.ClassName.."' in "..LineTableErrString(lineTable)) ! end ! lineState.Action = "classbase" ! elseif lineState.Action == "classbase" then ! if not dataTypes[tag] then ! dataTypes[tag] = AllocDataType(tag, "class", false) ! end ! -- set class's BaseClass ! if not dataTypes[lineState.ClassName].BaseClass then ! dataTypes[lineState.ClassName].BaseClass = tag ! end ! lineState.Action = "classcomma" ! elseif lineState.Action == "structname" then ! if not dataTypes[tag] then ! dataTypes[tag] = AllocDataType(tag, "struct", false) ! end ! lineState.Action = nil ! elseif lineState.Action == "enumname" then ! if not dataTypes[tag] then ! dataTypes[tag] = AllocDataType(tag, "enum", true) ! end ! lineState.Action = nil end end end --- 1600,1642 ---- end end ! elseif (not in_block_comment) and lineState.Action and ! (not conditionOperators[tag]) and (not FindOrCreateCondition(tag)) and ! (not ignore[tag]) then ! if lineState.Action == "classname" then ! if not dataTypes[tag] then ! AllocDataType(tag, "class", false) ! end ! lineState.ClassName = tag ! lineState.Action = "classcomma" ! elseif lineState.Action == "classcomma" then ! if tag ~= "," then ! print("WARNING : Expected comma (',') after class name : '"..lineState.ClassName.."' in "..LineTableErrString(lineTable)) ! end ! lineState.Action = "classbase" ! elseif lineState.Action == "classbase" then ! if not dataTypes[tag] then ! AllocDataType(tag, "class", false) ! end ! -- set class's BaseClass ! if not dataTypes[lineState.ClassName].BaseClass then ! dataTypes[lineState.ClassName].BaseClass = tag ! end ! lineState.Action = "classcomma" ! elseif lineState.Action == "structname" then ! if not dataTypes[tag] then ! AllocDataType(tag, "struct", false) ! end ! lineState.Action = nil ! elseif lineState.Action == "enumname" then ! if not dataTypes[tag] then ! AllocDataType(tag, "enum", true) end + + lineState.Action = nil end end *************** *** 3611,3615 **** CommentBindingTable(codeList, " // add to tracked memory list\n") ! -- Un 'const' AddToTrackedMemoryList local returnCast = memberTypeWithAttrib if string.sub(returnCast, 1, 6) == "const " then --- 3635,3639 ---- CommentBindingTable(codeList, " // add to tracked memory list\n") ! -- Un 'const' AddTrackedObject local returnCast = memberTypeWithAttrib if string.sub(returnCast, 1, 6) == "const " then *************** *** 3617,3625 **** end ! table.insert(codeList, " wxLua_AddToTrackedMemoryList(wxlState, ("..returnCast..")returns);\n") elseif parseObject.HasClassInfo then CommentBindingTable(codeList, " // add to tracked window list\n") table.insert(codeList, " if (returns && returns->IsKindOf(CLASSINFO(wxWindow)))\n") ! table.insert(codeList, " wxlState.AddToTrackedWindowList((wxWindow*)returns);\n") end --- 3641,3649 ---- end ! table.insert(codeList, " wxLua_AddTrackedObject(wxlState, ("..returnCast..")returns);\n") elseif parseObject.HasClassInfo then CommentBindingTable(codeList, " // add to tracked window list\n") table.insert(codeList, " if (returns && returns->IsKindOf(CLASSINFO(wxWindow)))\n") ! table.insert(codeList, " wxlState.AddTrackedWindow((wxWindow*)returns);\n") end *************** *** 3684,3688 **** CommentBindingTable(codeList, " // add the new object to the tracked memory list\n") ! -- Un 'const' AddToTrackedMemoryList local returnCast = memberTypeWithAttrib if string.sub(returnCast, 1, 6) == "const " then --- 3708,3712 ---- CommentBindingTable(codeList, " // add the new object to the tracked memory list\n") ! -- Un 'const' AddTrackedObject local returnCast = memberTypeWithAttrib if string.sub(returnCast, 1, 6) == "const " then *************** *** 3690,3694 **** end ! table.insert(codeList, " wxLua_AddToTrackedMemoryList(wxlState, ("..returnCast..")returns);\n") elseif (not member.IsOperator) and (memberPtr == "&") and (memberType ~= "wxString") then table.insert(codeList, " returns = &"..functor..";\n") --- 3714,3718 ---- end ! table.insert(codeList, " wxLua_AddTrackedObject(wxlState, ("..returnCast..")returns);\n") elseif (not member.IsOperator) and (memberPtr == "&") and (memberType ~= "wxString") then table.insert(codeList, " returns = &"..functor..";\n") *************** *** 3855,3859 **** table.insert(codeList, " if (self != 0)\n") ! table.insert(codeList, " wxlState.RemoveTrackedMemory(self);\n") table.insert(codeList, " return 0;\n") table.insert(codeList, "}\n\n") --- 3879,3883 ---- table.insert(codeList, " if (self != 0)\n") ! table.insert(codeList, " wxlState.RemoveTrackedObject(self);\n") table.insert(codeList, " return 0;\n") table.insert(codeList, "}\n\n") *************** *** 3882,3886 **** table.insert(codeList, " if (self != 0)\n") ! table.insert(codeList, " if (wxlState.RemoveTrackedMemory(self))\n") table.insert(codeList, " { // if removed, reset the tag so that gc() is not called on this object.\n") table.insert(codeList, " lua_pushnil(L);\n") --- 3906,3910 ---- table.insert(codeList, " if (self != 0)\n") ! table.insert(codeList, " if (wxlState.RemoveTrackedObject(self))\n") table.insert(codeList, " { // if removed, reset the tag so that gc() is not called on this object.\n") table.insert(codeList, " lua_pushnil(L);\n") *************** *** 4212,4216 **** table.insert(fileData, ""..hook_cpp_binding_classname.."::"..hook_cpp_binding_classname.."() : wxLuaBinding()\n") table.insert(fileData, "{\n") ! table.insert(fileData, " m_nameSpace = wxT(\""..hook_lua_namespace.."\");\n") table.insert(fileData, " m_classList = "..hook_cpp_class_funcname.."(m_classCount);\n") table.insert(fileData, " m_defineList = "..hook_cpp_define_funcname.."(m_defineCount);\n") --- 4236,4241 ---- table.insert(fileData, ""..hook_cpp_binding_classname.."::"..hook_cpp_binding_classname.."() : wxLuaBinding()\n") table.insert(fileData, "{\n") ! table.insert(fileData, " m_bindingName = wxT(\""..hook_cpp_namespace.."\");\n") ! table.insert(fileData, " m_nameSpace = wxT(\""..hook_lua_namespace.."\");\n") table.insert(fileData, " m_classList = "..hook_cpp_class_funcname.."(m_classCount);\n") table.insert(fileData, " m_defineList = "..hook_cpp_define_funcname.."(m_defineCount);\n") *************** *** 4871,4874 **** --- 4896,4901 ---- function main() + local time1 = os.time() + -- load rules file if not rulesFilename then *************** *** 4919,4922 **** --- 4946,4950 ---- end + print("Timing: "..os.difftime(os.time(), time1).." seconds.") print("Done\n") end |
From: John L. <jr...@us...> - 2006-12-14 01:01:56
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/bindings/wxwidgets Modified Files: override.hpp Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/override.hpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** override.hpp 6 Nov 2006 06:11:43 -0000 1.56 --- override.hpp 14 Dec 2006 01:01:23 -0000 1.57 *************** *** 190,194 **** if (returns != NULL) { ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxAcceleratorTable, returns); --- 190,194 ---- if (returns != NULL) { ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxAcceleratorTable, returns); *************** *** 854,858 **** returns = new wxTreeItemId(self->GetFirstChild(*item, cookie)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); --- 854,858 ---- returns = new wxTreeItemId(self->GetFirstChild(*item, cookie)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); *************** *** 889,893 **** returns = new wxTreeItemId(self->GetNextChild(*item, cookie)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); --- 889,893 ---- returns = new wxTreeItemId(self->GetNextChild(*item, cookie)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); *************** *** 944,948 **** returns = new wxTreeItemId(self->HitTest(*point, flags)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the result datatype --- 944,948 ---- returns = new wxTreeItemId(self->HitTest(*point, flags)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the result datatype *************** *** 971,975 **** returns = new wxString(str); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxString, returns); --- 971,975 ---- returns = new wxString(str); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxString, returns); *************** *** 1154,1158 **** returns = new wxGenericValidator(boolPtr->GetBoolPtr()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); --- 1154,1158 ---- returns = new wxGenericValidator(boolPtr->GetBoolPtr()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); *************** *** 1173,1177 **** returns = new wxGenericValidator(valPtr->GetStringPtr()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); --- 1173,1177 ---- returns = new wxGenericValidator(valPtr->GetStringPtr()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); *************** *** 1192,1196 **** returns = new wxGenericValidator(valPtr->GetIntPtr()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); --- 1192,1196 ---- returns = new wxGenericValidator(valPtr->GetIntPtr()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); *************** *** 1211,1215 **** returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); --- 1211,1215 ---- returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGenericValidator, returns); *************** *** 1473,1477 **** returns = new wxBusyCursor(cursor); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxBusyCursor *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyCursor, returns); --- 1473,1477 ---- returns = new wxBusyCursor(cursor); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxBusyCursor *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyCursor, returns); *************** *** 1583,1587 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxSingleChoiceDialog, returns); --- 1583,1587 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxSingleChoiceDialog, returns); *************** *** 1693,1699 **** wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! int winId = wxID_ANY; ! int lastId = wxID_ANY; ! int eventType = 0; wxLuaCallback *pCallback = NULL; --- 1693,1699 ---- wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! wxWindowID winId = wxID_ANY; ! wxWindowID lastId = wxID_ANY; ! wxEventType eventType = 0; wxLuaCallback *pCallback = NULL; *************** *** 1713,1717 **** if (wxlState.IsEnumerationType(3)) ! lastId = (int)lua_tonumber(L, 3); else { --- 1713,1717 ---- if (wxlState.IsEnumerationType(3)) ! lastId = (wxWindowID)lua_tonumber(L, 3); else { *************** *** 1722,1726 **** if (wxlState.IsEnumerationType(2)) ! winId = (int)lua_tonumber(L, 2); else { --- 1722,1726 ---- if (wxlState.IsEnumerationType(2)) ! winId = (wxWindowID)lua_tonumber(L, 2); else { *************** *** 1738,1742 **** if (wxlState.IsEnumerationType(2)) ! winId = (int)lua_tonumber(L, 2); else { --- 1738,1742 ---- if (wxlState.IsEnumerationType(2)) ! winId = (wxWindowID)lua_tonumber(L, 2); else { *************** *** 1772,1776 **** default: { ! wxlState.terror("wxLua: Connect: Incorrect number of parameters."); return 0; } --- 1772,1776 ---- default: { ! wxlState.terror("wxLua: wxEvtHandler Connect: Incorrect number of parameters."); return 0; } *************** *** 1785,1789 **** if (wxlState.IsEnumerationType(evttype_idx)) ! eventType = (int)lua_tonumber(L, evttype_idx); else { --- 1785,1789 ---- if (wxlState.IsEnumerationType(evttype_idx)) ! eventType = (wxEventType)lua_tonumber(L, evttype_idx); else { *************** *** 1810,1816 **** wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! int winId = wxID_ANY; ! int lastId = wxID_ANY; ! int eventType = 0; int nParams = lua_gettop(L); --- 1810,1816 ---- wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! wxWindowID winId = wxID_ANY; ! wxWindowID lastId = wxID_ANY; ! wxEventType eventType = 0; int nParams = lua_gettop(L); *************** *** 1827,1831 **** if (wxlState.IsEnumerationType(3)) ! lastId = (int)lua_tonumber(L, 3); else { --- 1827,1831 ---- if (wxlState.IsEnumerationType(3)) ! lastId = (wxWindowID)lua_tonumber(L, 3); else { *************** *** 1836,1840 **** if (wxlState.IsEnumerationType(2)) ! winId = (int)lua_tonumber(L, 2); else { --- 1836,1840 ---- if (wxlState.IsEnumerationType(2)) ! winId = (wxWindowID)lua_tonumber(L, 2); else { *************** *** 1851,1855 **** if (wxlState.IsEnumerationType(2)) ! winId = (int)lua_tonumber(L, 2); else { --- 1851,1855 ---- if (wxlState.IsEnumerationType(2)) ! winId = (wxWindowID)lua_tonumber(L, 2); else { *************** *** 1875,1879 **** if (wxlState.IsEnumerationType(evttype_idx)) ! eventType = (int)lua_tonumber(L, evttype_idx); else { --- 1875,1879 ---- if (wxlState.IsEnumerationType(evttype_idx)) ! eventType = (wxEventType)lua_tonumber(L, evttype_idx); else { *************** *** 2006,2012 **** returns = self->GetTimes(dtAccess, dtMod, dtCreate); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, dtAccess); ! wxLua_AddToTrackedMemoryList(wxlState, dtMod); ! wxLua_AddToTrackedMemoryList(wxlState, dtCreate); // push the constructed class pointers wxlState.PushUserDataType(s_wxluatag_wxDateTime, dtAccess); --- 2006,2012 ---- returns = self->GetTimes(dtAccess, dtMod, dtCreate); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, dtAccess); ! wxLua_AddTrackedObject(wxlState, dtMod); ! wxLua_AddTrackedObject(wxlState, dtCreate); // push the constructed class pointers wxlState.PushUserDataType(s_wxluatag_wxDateTime, dtAccess); *************** *** 2502,2506 **** returns = new wxBitmap(data, type, width, height, depth); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); --- 2502,2506 ---- returns = new wxBitmap(data, type, width, height, depth); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); *************** *** 2527,2531 **** returns = new wxBitmap(sizeArray); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); --- 2527,2531 ---- returns = new wxBitmap(sizeArray); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); *************** *** 3122,3126 **** returns = new wxImage(width, height, data, static_data); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 3122,3126 ---- returns = new wxImage(width, height, data, static_data); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 3141,3145 **** returns = new wxImage(bitmap->ConvertToImage()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 3141,3145 ---- returns = new wxImage(bitmap->ConvertToImage()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 3689,3693 **** *returns = *self; // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPrintData, returns); --- 3689,3693 ---- *returns = *self; // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPrintData, returns); *************** *** 3707,3711 **** *returns = *self; // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPageSetupDialogData, returns); --- 3707,3711 ---- *returns = *self; // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPageSetupDialogData, returns); *************** *** 3734,3739 **** // we must disconnect them from our tracking list if (printoutForPrinting != NULL) ! wxlState.RemoveTrackedMemory(printoutForPrinting, false); ! wxlState.RemoveTrackedMemory(printout, false); // call constructor --- 3734,3739 ---- // we must disconnect them from our tracking list if (printoutForPrinting != NULL) ! wxlState.RemoveTrackedObject(printoutForPrinting, false); ! wxlState.RemoveTrackedObject(printout, false); // call constructor *************** *** 4404,4408 **** returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaObject, returns); --- 4404,4408 ---- returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaObject, returns); *************** *** 4455,4459 **** returns = new wxLuaPrintout(wxlState, title, pObject); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxLuaPrintout *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaPrintout, returns); --- 4455,4459 ---- returns = new wxLuaPrintout(wxlState, title, pObject); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxLuaPrintout *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaPrintout, returns); *************** *** 4487,4491 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaHtmlWindow, returns); --- 4487,4491 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaHtmlWindow, returns); |
From: John L. <jr...@us...> - 2006-12-14 01:01:56
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/modules/wxbind/include Modified Files: wxbind.h Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: wxbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxbind.h,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** wxbind.h 13 Dec 2006 06:57:49 -0000 1.46 --- wxbind.h 14 Dec 2006 01:01:23 -0000 1.47 *************** *** 39,45 **** #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 2 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 2 // binding class --- 39,45 ---- #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 3 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 3 // binding class |
From: John L. <jr...@us...> - 2006-12-14 01:01:55
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/apps/wxluacan/src Modified Files: wxluacan.h wxluacan_bind.cpp Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: wxluacan_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_bind.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxluacan_bind.cpp 13 Dec 2006 00:27:55 -0000 1.10 --- wxluacan_bind.cpp 14 Dec 2006 01:01:22 -0000 1.11 *************** *** 180,184 **** wxLuaBinding_wxluacan::wxLuaBinding_wxluacan() : wxLuaBinding() { ! m_nameSpace = wxT("wxluacan"); m_classList = wxLuaGetClassList_wxluacan(m_classCount); m_defineList = wxLuaGetDefineList_wxluacan(m_defineCount); --- 180,185 ---- wxLuaBinding_wxluacan::wxLuaBinding_wxluacan() : wxLuaBinding() { ! m_bindingName = wxT("wxluacan"); ! m_nameSpace = wxT("wxluacan"); m_classList = wxLuaGetClassList_wxluacan(m_classCount); m_defineList = wxLuaGetDefineList_wxluacan(m_defineCount); Index: wxluacan.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wxluacan.h 13 Dec 2006 06:57:48 -0000 1.17 --- wxluacan.h 14 Dec 2006 01:01:22 -0000 1.18 *************** *** 14,20 **** #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 2 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 2 // binding class --- 14,20 ---- #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 3 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 3 // binding class |
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/modules/wxbind/src Modified Files: appframe.cpp clipdrag.cpp controls.cpp data.cpp datetime.cpp defsutil.cpp dialogs.cpp event.cpp file.cpp gdi.cpp geometry.cpp grid.cpp help.cpp html.cpp image.cpp mdi.cpp menutool.cpp print.cpp regex.cpp sizer.cpp socket.cpp wave.cpp windows.cpp wx_bind.cpp wxlua.cpp xml.cpp Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: xml.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/xml.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** xml.cpp 12 Dec 2006 07:09:41 -0000 1.15 --- xml.cpp 14 Dec 2006 01:01:26 -0000 1.16 *************** *** 43,47 **** returns = new wxXmlNode(); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxXmlNode *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); --- 43,47 ---- returns = new wxXmlNode(); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxXmlNode *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); *************** *** 66,70 **** returns = new wxXmlNode(type, name, content); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxXmlNode *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); --- 66,70 ---- returns = new wxXmlNode(type, name, content); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxXmlNode *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); *************** *** 93,97 **** returns = new wxXmlNode(parent, type, name, content, props, next); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxXmlNode *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); --- 93,97 ---- returns = new wxXmlNode(parent, type, name, content, props, next); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxXmlNode *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); *************** *** 462,466 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 462,466 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 472,476 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 472,476 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 556,560 **** returns = new wxXmlProperty(name, value, next); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxXmlProperty *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlProperty, returns); --- 556,560 ---- returns = new wxXmlProperty(name, value, next); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxXmlProperty *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlProperty, returns); *************** *** 571,575 **** returns = new wxXmlProperty(); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxXmlProperty *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlProperty, returns); --- 571,575 ---- returns = new wxXmlProperty(); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxXmlProperty *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlProperty, returns); *************** *** 672,676 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 672,676 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 682,686 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 682,686 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 734,738 **** returns = new wxXmlDocument(); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxXmlDocument *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlDocument, returns); --- 734,738 ---- returns = new wxXmlDocument(); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxXmlDocument *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlDocument, returns); *************** *** 755,759 **** returns = new wxXmlDocument(filename, encoding); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxXmlDocument *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlDocument, returns); --- 755,759 ---- returns = new wxXmlDocument(filename, encoding); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxXmlDocument *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlDocument, returns); *************** *** 909,913 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 909,913 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 919,923 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 919,923 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 1007,1011 **** returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxBitmap *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); --- 1007,1011 ---- returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxBitmap *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); *************** *** 1150,1154 **** returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxIcon *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxIcon, returns); --- 1150,1154 ---- returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxIcon *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxIcon, returns); *************** *** 1253,1257 **** returns = new wxXmlResource(filemask, flags); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxXmlResource *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); --- 1253,1257 ---- returns = new wxXmlResource(filemask, flags); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxXmlResource *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); *************** *** 1286,1290 **** returns = new wxXmlResource(flags); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxXmlResource *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); --- 1286,1290 ---- returns = new wxXmlResource(flags); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxXmlResource *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); *************** *** 1534,1538 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 1534,1538 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 1544,1548 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 1544,1548 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); Index: defsutil.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/defsutil.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** defsutil.cpp 12 Dec 2006 07:09:39 -0000 1.19 --- defsutil.cpp 14 Dec 2006 01:01:23 -0000 1.20 *************** *** 177,181 **** returns = new wxProcess(parent, nId); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxProcess *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxProcess, returns); --- 177,181 ---- returns = new wxProcess(parent, nId); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxProcess *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxProcess, returns); *************** *** 285,289 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 285,289 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 295,299 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 295,299 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 356,360 **** returns = new wxMouseState(); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxMouseState *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMouseState, returns); --- 356,360 ---- returns = new wxMouseState(); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxMouseState *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMouseState, returns); *************** *** 646,650 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 646,650 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 656,660 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 656,660 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 723,727 **** returns = new wxBusyCursor(cursor); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxBusyCursor *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyCursor, returns); --- 723,727 ---- returns = new wxBusyCursor(cursor); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxBusyCursor *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyCursor, returns); *************** *** 739,743 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 739,743 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 749,753 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 749,753 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 798,802 **** returns = new wxBusyInfo(message, parent); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxBusyInfo *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyInfo, returns); --- 798,802 ---- returns = new wxBusyInfo(message, parent); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxBusyInfo *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyInfo, returns); *************** *** 812,816 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 812,816 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 822,826 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 822,826 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); Index: wxlua.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxlua.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wxlua.cpp 12 Dec 2006 07:09:41 -0000 1.22 --- wxlua.cpp 14 Dec 2006 01:01:25 -0000 1.23 *************** *** 40,44 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 40,44 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 50,54 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 50,54 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 86,90 **** returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaObject, returns); --- 86,90 ---- returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaObject, returns); *************** *** 177,181 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 177,181 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 187,191 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 187,191 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 240,244 **** returns = new wxLuaPrintout(wxlState, title, pObject); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxLuaPrintout *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaPrintout, returns); --- 240,244 ---- returns = new wxLuaPrintout(wxlState, title, pObject); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxLuaPrintout *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaPrintout, returns); *************** *** 291,295 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 291,295 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 301,305 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 301,305 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 360,364 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaHtmlWindow, returns); --- 360,364 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaHtmlWindow, returns); *************** *** 472,476 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 472,476 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 482,486 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 482,486 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); Index: image.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/image.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** image.cpp 12 Dec 2006 07:09:39 -0000 1.19 --- image.cpp 14 Dec 2006 01:01:24 -0000 1.20 *************** *** 48,52 **** returns = new wxImage(bitmap->ConvertToImage()); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 48,52 ---- returns = new wxImage(bitmap->ConvertToImage()); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 87,91 **** returns = new wxPalette(self->GetPalette()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxPalette *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxPalette, returns); --- 87,91 ---- returns = new wxPalette(self->GetPalette()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxPalette *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxPalette, returns); *************** *** 125,129 **** returns = new wxImage(self->GetSubImage(*rect)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 125,129 ---- returns = new wxImage(self->GetSubImage(*rect)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 180,184 **** returns = new wxImage(self->Rotate(angle, *rotationCentre, interpolating, offsetAfterRotation)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 180,184 ---- returns = new wxImage(self->Rotate(angle, *rotationCentre, interpolating, offsetAfterRotation)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 210,214 **** returns = new wxImage(self->Size(*size, *pos, red, green, blue)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 210,214 ---- returns = new wxImage(self->Size(*size, *pos, red, green, blue)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 295,299 **** returns = new wxImage(*image); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 295,299 ---- returns = new wxImage(*image); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 310,314 **** returns = new wxImage(); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 310,314 ---- returns = new wxImage(); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 333,337 **** returns = new wxImage(width, height, clear); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 333,337 ---- returns = new wxImage(width, height, clear); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 359,363 **** returns = new wxImage(width, height, data, static_data); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 359,363 ---- returns = new wxImage(width, height, data, static_data); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 380,384 **** returns = new wxImage(name, type); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 380,384 ---- returns = new wxImage(name, type); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 426,430 **** returns = new wxImage(self->ConvertToMono(r, g, b)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 426,430 ---- returns = new wxImage(self->ConvertToMono(r, g, b)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 444,448 **** returns = new wxImage(self->Copy()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 444,448 ---- returns = new wxImage(self->Copy()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 1045,1049 **** returns = new wxImage(self->Mirror(horizontally)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 1045,1049 ---- returns = new wxImage(self->Mirror(horizontally)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 1124,1128 **** returns = new wxImage(self->Rotate90(clockwise)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 1124,1128 ---- returns = new wxImage(self->Rotate90(clockwise)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 1199,1203 **** returns = new wxImage(self->Scale(width, height)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 1199,1203 ---- returns = new wxImage(self->Scale(width, height)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxImage *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 1401,1405 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 1401,1405 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 1411,1415 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 1411,1415 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 1722,1726 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 1722,1726 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 1732,1736 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 1732,1736 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 1794,1798 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBMPHandler, returns); --- 1794,1798 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBMPHandler, returns); *************** *** 1837,1841 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxICOHandler, returns); --- 1837,1841 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxICOHandler, returns); *************** *** 1880,1884 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxCURHandler, returns); --- 1880,1884 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxCURHandler, returns); *************** *** 1923,1927 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxANIHandler, returns); --- 1923,1927 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxANIHandler, returns); *************** *** 1966,1970 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxIFFHandler, returns); --- 1966,1970 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxIFFHandler, returns); *************** *** 2009,2013 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGIFHandler, returns); --- 2009,2013 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGIFHandler, returns); *************** *** 2052,2056 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxJPEGHandler, returns); --- 2052,2056 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxJPEGHandler, returns); *************** *** 2095,2099 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPCXHandler, returns); --- 2095,2099 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPCXHandler, returns); *************** *** 2138,2142 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPNGHandler, returns); --- 2138,2142 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPNGHandler, returns); *************** *** 2181,2185 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPNMHandler, returns); --- 2181,2185 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPNMHandler, returns); *************** *** 2224,2228 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxTIFFHandler, returns); --- 2224,2228 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxTIFFHandler, returns); *************** *** 2267,2271 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXPMHandler, returns); --- 2267,2271 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXPMHandler, returns); *************** *** 2320,2324 **** returns = new wxBitmap(wxArtProvider::GetBitmap(id, client, *size)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxBitmap *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); --- 2320,2324 ---- returns = new wxBitmap(wxArtProvider::GetBitmap(id, client, *size)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxBitmap *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); *************** *** 2348,2352 **** returns = new wxIcon(wxArtProvider::GetIcon(id, client, *size)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxIcon *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxIcon, returns); --- 2348,2352 ---- returns = new wxIcon(wxArtProvider::GetIcon(id, client, *size)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxIcon *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxIcon, returns); *************** *** 2374,2378 **** returns = new wxSize(wxArtProvider::GetSizeHint(client, platform_dependent)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxSize *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxSize, returns); --- 2374,2378 ---- returns = new wxSize(wxArtProvider::GetSizeHint(client, platform_dependent)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxSize *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxSize, returns); Index: mdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/mdi.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mdi.cpp 12 Dec 2006 07:09:39 -0000 1.18 --- mdi.cpp 14 Dec 2006 01:01:25 -0000 1.19 *************** *** 88,92 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIParentFrame, returns); --- 88,92 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIParentFrame, returns); *************** *** 188,192 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIParentFrame, returns); --- 188,192 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIParentFrame, returns); *************** *** 422,426 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIChildFrame, returns); --- 422,426 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIChildFrame, returns); *************** *** 471,475 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIChildFrame, returns); --- 471,475 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIChildFrame, returns); *************** *** 573,577 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocChildFrame, returns); --- 573,577 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocChildFrame, returns); *************** *** 922,926 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocManager, returns); --- 922,926 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocManager, returns); *************** *** 1435,1439 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocParentFrame, returns); --- 1435,1439 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocParentFrame, returns); *************** *** 1508,1512 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocTemplate, returns); --- 1508,1512 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocTemplate, returns); *************** *** 1962,1966 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocument, returns); --- 1962,1966 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocument, returns); *************** *** 2832,2836 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxCommandProcessor, returns); --- 2832,2836 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxCommandProcessor, returns); *************** *** 3355,3359 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxFileHistory, returns); --- 3355,3359 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxFileHistory, returns); Index: grid.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/grid.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** grid.cpp 12 Dec 2006 07:09:39 -0000 1.19 --- grid.cpp 14 Dec 2006 01:01:24 -0000 1.20 *************** *** 125,129 **** returns = new wxSize(self->GetBestSize(*grid, *attr, *dc, row, col)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxSize *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxSize, returns); --- 125,129 ---- returns = new wxSize(self->GetBestSize(*grid, *attr, *dc, row, col)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxSize *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxSize, returns); *************** *** 1207,1211 **** returns = new wxColour(self->GetTextColour()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 1207,1211 ---- returns = new wxColour(self->GetTextColour()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 1225,1229 **** returns = new wxColour(self->GetBackgroundColour()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 1225,1229 ---- returns = new wxColour(self->GetBackgroundColour()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 1261,1265 **** returns = new wxFont(self->GetFont()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxFont *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxFont, returns); --- 1261,1265 ---- returns = new wxFont(self->GetFont()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxFont *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxFont, returns); *************** *** 2610,2614 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridStringTable, returns); --- 2610,2614 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridStringTable, returns); *************** *** 3080,3084 **** returns = new wxColour(self->GetLabelBackgroundColour()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3080,3084 ---- returns = new wxColour(self->GetLabelBackgroundColour()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3098,3102 **** returns = new wxColour(self->GetLabelTextColour()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3098,3102 ---- returns = new wxColour(self->GetLabelTextColour()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3116,3120 **** returns = new wxColour(self->GetGridLineColour()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3116,3120 ---- returns = new wxColour(self->GetGridLineColour()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3134,3138 **** returns = new wxColour(self->GetCellHighlightColour()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3134,3138 ---- returns = new wxColour(self->GetCellHighlightColour()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3208,3212 **** returns = new wxColour(self->GetDefaultCellBackgroundColour()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3208,3212 ---- returns = new wxColour(self->GetDefaultCellBackgroundColour()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3230,3234 **** returns = new wxColour(self->GetCellBackgroundColour(row, col)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3230,3234 ---- returns = new wxColour(self->GetCellBackgroundColour(row, col)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3248,3252 **** returns = new wxColour(self->GetDefaultCellTextColour()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3248,3252 ---- returns = new wxColour(self->GetDefaultCellTextColour()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3270,3274 **** returns = new wxColour(self->GetCellTextColour(row, col)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3270,3274 ---- returns = new wxColour(self->GetCellTextColour(row, col)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3352,3356 **** returns = new wxColour(self->GetSelectionBackground()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3352,3356 ---- returns = new wxColour(self->GetSelectionBackground()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3370,3374 **** returns = new wxColour(self->GetSelectionForeground()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 3370,3374 ---- returns = new wxColour(self->GetSelectionForeground()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 3420,3424 **** returns = new wxFont(self->GetLabelFont()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxFont *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxFont, returns); --- 3420,3424 ---- returns = new wxFont(self->GetLabelFont()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxFont *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxFont, returns); *************** *** 3452,3456 **** returns = new wxFont(self->GetDefaultCellFont()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxFont *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxFont, returns); --- 3452,3456 ---- returns = new wxFont(self->GetDefaultCellFont()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxFont *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxFont, returns); *************** *** 3474,3478 **** returns = new wxFont(self->GetCellFont(row, col)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxFont *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxFont, returns); --- 3474,3478 ---- returns = new wxFont(self->GetCellFont(row, col)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxFont *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxFont, returns); *************** *** 3540,3544 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGrid, returns); --- 3540,3544 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGrid, returns); *************** *** 3562,3566 **** returns = new wxRect(self->CellToRect(row, col)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxRect *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxRect, returns); --- 3562,3566 ---- returns = new wxRect(self->CellToRect(row, col)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxRect *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxRect, retur... [truncated message content] |
From: John L. <jr...@us...> - 2006-12-14 01:01:34
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxlcallb.h wxldefs.h wxlstate.h Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: wxlcallb.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlcallb.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wxlcallb.h 12 Dec 2006 07:09:41 -0000 1.14 --- wxlcallb.h 14 Dec 2006 01:01:26 -0000 1.15 *************** *** 1,4 **** ///////////////////////////////////////////////////////////////////////////// ! // Purpose: wxLuaCallback and wxLuaDestroyCallback // Author: Francis Irving // Created: 21/01/2002 --- 1,5 ---- ///////////////////////////////////////////////////////////////////////////// ! // Name: wxlcallb.h ! // Purpose: wxLuaCallback and wxLuaWinDestroyCallback // Author: Francis Irving // Created: 21/01/2002 *************** *** 14,27 **** // ---------------------------------------------------------------------------- ! // wxLuaCallback - proxy class to pass a reference to a lua function ! // through the wxWidgets event system. // ---------------------------------------------------------------------------- ! class WXDLLIMPEXP_WXLUA wxLuaCallback : public wxEvtHandler { public: // winID and lastID follow the same notation as wxEvtHandler::Connect // if only one event Id is needed set lastId = wxID_ANY ! wxLuaCallback( const wxLuaState& state, int theRoutine, wxWindowID winId, wxWindowID lastId, wxEventType eventType, wxEvtHandler *pHandler ); --- 15,37 ---- // ---------------------------------------------------------------------------- ! // wxLuaCallback - Forward events from C++ wxWidgets wxEvtHandlers to lua functions ! // ! // The wxLuaCallback is created with the wxLuaState, the stack index of the ! // lua function to call when an event is received, the window id ranges, and ! // the wxEventType to connect to the wxEvtHandler with this as the callback ! // user data for event. ! // ! // Do NOT delete this, the wxEvtHandler deletes the callback user data itself. ! // ! // The function wxLuaCallback::EventHandler generically handles the events and ! // forwards them to the event's wxLuaCallback callback user data CallFunction(). // ---------------------------------------------------------------------------- ! class WXDLLIMPEXP_WXLUA wxLuaCallback : public wxObject { public: // winID and lastID follow the same notation as wxEvtHandler::Connect // if only one event Id is needed set lastId = wxID_ANY ! wxLuaCallback( const wxLuaState& state, int lua_func_stack_idx, wxWindowID winId, wxWindowID lastId, wxEventType eventType, wxEvtHandler *pHandler ); *************** *** 32,53 **** wxLuaState GetwxLuaState() const { return m_wxlState; } ! int GetId() const { return m_id; } wxEventType GetEventType() const { return m_eventType; } wxEvtHandler *GetEvtHandler() const { return m_pHandler; } ! // central event handler ! // This function is called with "this" being of the type which the event is ! // arriving at. The user data wxLuaCallback is used to route it to the ! // correct place by calling CallFunction with the event. void EventHandler(wxEvent& event); ! ! protected: ! // event handler dispatcher back to Lua ! // Call a lua function to handle an event. The lua function will receive ! // a single parameter, the type of event. virtual void CallFunction(wxEvent *pEvent); ! // reference to the lua routine to call ! int m_routine; // store the wxLuaState since we're added to a list of it's callbacks. --- 42,59 ---- wxLuaState GetwxLuaState() const { return m_wxlState; } ! wxWindowID GetId() const { return m_id; } ! wxWindowID GetLastId() const { return m_lastId; } wxEventType GetEventType() const { return m_eventType; } wxEvtHandler *GetEvtHandler() const { return m_pHandler; } ! // Central event handler that calls CallFunction() for the actual ! // wxLuaCallback callback user data void EventHandler(wxEvent& event); ! // Handle the event by calling the lua function to handle the event. ! // The lua function will receive a single parameter, the type of event. virtual void CallFunction(wxEvent *pEvent); ! protected: ! int m_routine; // reference to the lua routine to call // store the wxLuaState since we're added to a list of it's callbacks. *************** *** 63,78 **** // ---------------------------------------------------------------------------- ! // wxLuaDestroyCallback - proxy class to handle the destruction of wxWindow ! // derived objects using wxEVT_DESTROY // ---------------------------------------------------------------------------- ! class WXDLLIMPEXP_WXLUA wxLuaDestroyCallback : public wxEvtHandler { public: ! wxLuaDestroyCallback( const wxLuaState& state, ! wxWindowID id, wxEvtHandler *pHandler, ! int iTag ); ! virtual ~wxLuaDestroyCallback(); void ClearwxLuaState() { m_wxlState.UnRef(); } --- 69,87 ---- // ---------------------------------------------------------------------------- ! // wxLuaWinDestroyCallback - Handle the wxEVT_DESTROY event from wxWindows. ! // ! // Removes the reference to the window so lua won't delete it. ! // ! // Do NOT delete this, the wxEvtHandler deletes the callback user data itself. // ---------------------------------------------------------------------------- ! class WXDLLIMPEXP_WXLUA wxLuaWinDestroyCallback : public wxObject { public: ! wxLuaWinDestroyCallback(const wxLuaState& state, ! wxWindowID id, wxEvtHandler *pHandler, ! int iTag); ! virtual ~wxLuaWinDestroyCallback(); void ClearwxLuaState() { m_wxlState.UnRef(); } *************** *** 82,91 **** wxEvtHandler* GetEvtHandler() const { return m_pHandler; } ! // central event handler void EventHandler(wxWindowDestroyEvent& event); protected: - void OnDestroy(); - // store the wxLuaState since we're added to a list of it's callbacks. wxLuaState m_wxlState; --- 91,101 ---- wxEvtHandler* GetEvtHandler() const { return m_pHandler; } ! // Central event handler that calls OnDestroy() for the actual ! // wxLuaWinDestroyCallback callback user data void EventHandler(wxWindowDestroyEvent& event); + // Handle the event by clearing the metatable for the window + virtual void OnDestroy(wxWindowDestroyEvent& event); protected: // store the wxLuaState since we're added to a list of it's callbacks. wxLuaState m_wxlState; *************** *** 94,98 **** private: ! DECLARE_ABSTRACT_CLASS(wxLuaDestroyCallback) }; --- 104,108 ---- private: ! DECLARE_ABSTRACT_CLASS(wxLuaWinDestroyCallback) }; Index: wxldefs.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxldefs.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxldefs.h 13 Dec 2006 06:57:50 -0000 1.10 --- wxldefs.h 14 Dec 2006 01:01:26 -0000 1.11 *************** *** 49,53 **** //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 2 // ---------------------------------------------------------------------------- --- 49,53 ---- //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 3 // ---------------------------------------------------------------------------- Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** wxlbind.h 12 Dec 2006 07:09:41 -0000 1.30 --- wxlbind.h 14 Dec 2006 01:01:26 -0000 1.31 *************** *** 215,219 **** #define wxLUA_DECLARE_ENCAPSULATION(IMPEXPSYMBOL, className, objName) \ ! IMPEXPSYMBOL void LUACALL wxLua_AddToTrackedMemoryList(wxLuaState& wxlState, className *); \ class IMPEXPSYMBOL wxObject_##objName : public wxObject \ { \ --- 215,219 ---- #define wxLUA_DECLARE_ENCAPSULATION(IMPEXPSYMBOL, className, objName) \ ! IMPEXPSYMBOL void LUACALL wxLua_AddTrackedObject(wxLuaState& wxlState, className *); \ class IMPEXPSYMBOL wxObject_##objName : public wxObject \ { \ *************** *** 232,238 **** if (m_p##objName != NULL) delete m_p##objName; \ } \ ! void LUACALL wxLua_AddToTrackedMemoryList(wxLuaState& wxlState, className *p##objName) \ { \ ! wxlState.AddToTrackedMemoryList((long)p##objName, new wxObject_##objName(p##objName)); \ } --- 232,238 ---- if (m_p##objName != NULL) delete m_p##objName; \ } \ ! void LUACALL wxLua_AddTrackedObject(wxLuaState& wxlState, className *p##objName) \ { \ ! wxlState.AddTrackedObject((long)p##objName, new wxObject_##objName(p##objName)); \ } *************** *** 240,244 **** // garbage collection purposes. This is a C function for symmetry with // the functions defined using wxLUA_DECLARE_ENCAPSULATION. ! WXDLLIMPEXP_WXLUA void LUACALL wxLua_AddToTrackedMemoryList(wxLuaState& wxlState, wxObject *); // ---------------------------------------------------------------------------- --- 240,244 ---- // garbage collection purposes. This is a C function for symmetry with // the functions defined using wxLUA_DECLARE_ENCAPSULATION. ! WXDLLIMPEXP_WXLUA void LUACALL wxLua_AddTrackedObject(wxLuaState& wxlState, wxObject *); // ---------------------------------------------------------------------------- *************** *** 298,301 **** --- 298,307 ---- virtual void UnRegisterBinding(lua_State* L); + // Get/Set the binding name, a unique name of the binding. + // By default it is the "hook_cpp_namespace" used in the binding + // generator which needs to be a unique name. + wxString GetBindingName() const { return m_bindingName; } + void SetBindingName(const wxString& name) { m_bindingName = name; } + // Get/Set the namespace in lua that this binding will be installed to wxString GetLuaNamespace() const { return m_nameSpace; } *************** *** 360,363 **** --- 366,370 ---- WXLUAMETHOD* m_functionList; + wxString m_bindingName; // A unique name of the binding wxString m_nameSpace; // lua table namespace e.g. "wx" bool m_bindings_registered; // Is the binding registered Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** wxlstate.h 12 Dec 2006 07:09:41 -0000 1.56 --- wxlstate.h 14 Dec 2006 01:01:26 -0000 1.57 *************** *** 48,51 **** --- 48,53 ---- class WXDLLIMPEXP_WXLUA wxLuaState; class WXDLLIMPEXP_WXLUA wxLuaStateRefData; + class WXDLLIMPEXP_WXLUA wxLuaCallback; + class WXDLLIMPEXP_WXLUA wxLuaWinDestroyCallback; WX_DECLARE_STRING_HASH_MAP_WITH_DECL(long, wxLuaStringToLongHashMap, class WXDLLIMPEXP_WXLUA); *************** *** 212,224 **** wxEventType m_inEventType; // wxEventType set when in event, else wxEVT_NULL ! wxLongToLongHashMap m_pDerivedList; // derived objects. ! wxLongToLongHashMap m_pTrackedList; // tracked objects. ! wxList m_eventHandlerList; // event objects for wxLuaCallback ! wxList m_destroyHandlerList; // wxLuaDestroyCallbacks installed ! wxList m_windowList; // all wxWindow objects, wxWidgets will delete these ! // but for an embedded program they must be deleted before ! // shutting down the interpreter, else they dangle ! wxArrayInt m_unusedReferenceIndexes; // array of unused (available) table indicies in the ! // wxLuaReferences registry table bool m_is_running; // is the lua_State running a script --- 214,226 ---- wxEventType m_inEventType; // wxEventType set when in event, else wxEVT_NULL ! wxLongToLongHashMap m_pDerivedList; // derived objects. ! wxLongToLongHashMap m_trackedObjects; // tracked objects. ! wxList m_callbackList; // event objects for wxLuaCallback ! wxList m_winDestroyCallbackList; // wxLuaWinDestroyCallback installed ! wxList m_windowList; // all wxWindow objects, wxWidgets will delete these ! // but for an embedded program they must be deleted before ! // shutting down the interpreter, else they dangle ! wxArrayInt m_unusedReferenceIndexes; // array of unused (available) table indicies in the ! // wxLuaReferences registry table bool m_is_running; // is the lua_State running a script *************** *** 355,358 **** --- 357,362 ---- // event handler. Be careful about destroying lua when in an event handler. wxEventType GetInEventType() const; + // Set the wxEventType that the lua code is currently running (internal use) + void SetInEventType(wxEventType eventType); // ----------------------------------------------------------------------- *************** *** 451,461 **** wxLUA_UNUSED_NOTUNICODE(void RegisterFunction(lua_CFunction func, const wxString &funcName) { RegisterFunction(func, wx2lua(funcName)); }) // Register all the bindings in the wxLuaStateData, this is done ! // automatically by default void RegisterBindings(bool registerTypes); ! // Get the wxLuaBinding with the given nameSpace or NULL for no match ! // only returns the first binding with the given namespace, but more than ! // two can share the same namespace. ! wxLuaBinding* GetLuaBinding(const wxString& nameSpace) const; // Get WXLUACLASS for given lua Tag, the number lua uses to track the class --- 455,464 ---- wxLUA_UNUSED_NOTUNICODE(void RegisterFunction(lua_CFunction func, const wxString &funcName) { RegisterFunction(func, wx2lua(funcName)); }) // Register all the bindings in the wxLuaStateData, this is done ! // automatically by default (internal use) void RegisterBindings(bool registerTypes); ! // Get the installed wxLuaBinding with the given ! // wxLuaBinding::GetBindingName or NULL for no match. ! wxLuaBinding* GetLuaBinding(const wxString& bindingName) const; // Get WXLUACLASS for given lua Tag, the number lua uses to track the class *************** *** 489,505 **** // Track this object and delete it when lua calls the gc method for it ! void AddToTrackedMemoryList(wxObject *pObject); // Track this object, but hash it on the obj_ptr which may differ from the // pObject and delete it when lua calls the gc method for it. // This is used for encapsulated classes that are wrapped in a wxObject. ! void AddToTrackedMemoryList(long obj_ptr, wxObject *pObject); // Remove the object from the tracked memory and if fDelete, delete it too. ! bool RemoveTrackedMemory(void *pObject, bool fDelete = true); // Add a wxWindow to track and delete when we're closed, only track ! // the parent window, no it's children. ! void AddToTrackedWindowList(wxWindow *win); ! // Don't track this window anymore. ! void RemoveTrackedWindow(wxWindow *win); // Is this window tracked, if check_parents see if a parent of it is. bool IsWindowTracked(wxWindow *win, bool check_parents = true) const; --- 492,509 ---- // Track this object and delete it when lua calls the gc method for it ! void AddTrackedObject(wxObject *pObject); // Track this object, but hash it on the obj_ptr which may differ from the // pObject and delete it when lua calls the gc method for it. // This is used for encapsulated classes that are wrapped in a wxObject. ! void AddTrackedObject(long obj_ptr, wxObject *pObject); // Remove the object from the tracked memory and if fDelete, delete it too. ! bool RemoveTrackedObject(void *pObject, bool fDelete = true); ! wxLongToLongHashMap* GetTrackedObjects(); // Add a wxWindow to track and delete when we're closed, only track ! // the parent window, not it's children. ! void AddTrackedWindow(wxWindow *win); ! // Don't track this window anymore and don't delete it. ! bool RemoveTrackedWindow(wxWindow *win); // Is this window tracked, if check_parents see if a parent of it is. bool IsWindowTracked(wxWindow *win, bool check_parents = true) const; *************** *** 509,522 **** void GarbageCollectWindows(bool closeWindows); ! // Add or remove a wxEvtHandler used by lua code, see usage in wxLuaCallback ! void AddTrackedEventHandler(wxEvtHandler* evtHandler); ! bool RemoveTrackedEventHandler(wxEvtHandler* evtHandler); ! wxList* GetTrackedEventHandlerList(); ! // Add or remove a wxEvtHandler connected to wxEVT_DESTROY used by lua code, ! // see usage in wxLuaDestroyCallback ! void AddTrackedDestroyEventHandler(wxEvtHandler* evtHandler); ! bool RemoveTrackedDestroyEventHandler(wxEvtHandler* evtHandler); ! wxList* GetTrackedDestroyEventHandlerList(); // ----------------------------------------------------------------------- --- 513,525 ---- void GarbageCollectWindows(bool closeWindows); ! // Add or remove a tracked wxLuaCallback connected to a wxEvtHandler ! void AddTrackedCallback(wxLuaCallback* callback); ! bool RemoveTrackedCallback(wxLuaCallback* callback); ! wxList* GetTrackedCallbackList(); ! // Add or remove a tracked wxLuaWinDestroyCallback connected to wxEVT_DESTROY. ! void AddTrackedWinDestroyCallback(wxLuaWinDestroyCallback* callback); ! bool RemoveTrackedWinDestroyCallback(wxLuaWinDestroyCallback* callback); ! wxList* GetTrackedWinDestroyCallbackList(); // ----------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2006-12-14 01:01:34
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/modules/wxluasocket/src Modified Files: wxluasocket.cpp wxluasocket_bind.cpp Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: wxluasocket_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxluasocket_bind.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxluasocket_bind.cpp 12 Dec 2006 07:09:42 -0000 1.10 --- wxluasocket_bind.cpp 14 Dec 2006 01:01:27 -0000 1.11 *************** *** 155,159 **** wxLuaBinding_wxluasocket::wxLuaBinding_wxluasocket() : wxLuaBinding() { ! m_nameSpace = wxT("wx"); m_classList = wxLuaGetClassList_wxluasocket(m_classCount); m_defineList = wxLuaGetDefineList_wxluasocket(m_defineCount); --- 155,160 ---- wxLuaBinding_wxluasocket::wxLuaBinding_wxluasocket() : wxLuaBinding() { ! m_bindingName = wxT("wxluasocket"); ! m_nameSpace = wxT("wx"); m_classList = wxLuaGetClassList_wxluasocket(m_classCount); m_defineList = wxLuaGetDefineList_wxluasocket(m_defineCount); Index: wxluasocket.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxluasocket.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxluasocket.cpp 13 Dec 2006 06:57:50 -0000 1.10 --- wxluasocket.cpp 14 Dec 2006 01:01:27 -0000 1.11 *************** *** 37,41 **** returns = new wxLuaDebuggerServer(portNumber); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxLuaDebuggerServer *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaDebuggerServer, returns); --- 37,41 ---- returns = new wxLuaDebuggerServer(portNumber); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxLuaDebuggerServer *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaDebuggerServer, returns); *************** *** 351,355 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 351,355 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 361,365 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 361,365 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); *************** *** 475,479 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 475,479 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 485,489 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 485,489 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); |
From: John L. <jr...@us...> - 2006-12-14 01:01:33
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlcallb.cpp wxlstate.cpp Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** wxlstate.cpp 12 Dec 2006 07:09:41 -0000 1.84 --- wxlstate.cpp 14 Dec 2006 01:01:26 -0000 1.85 *************** *** 249,253 **** wxLongToLongHashMap::iterator it; ! wxLongToLongHashMap* hashMap = &wxlState.GetLuaStateRefData()->m_wxlStateData->m_pTrackedList; for (it = hashMap->begin(); it != hashMap->end(); ++it) { --- 249,253 ---- wxLongToLongHashMap::iterator it; ! wxLongToLongHashMap* hashMap = &wxlState.GetLuaStateRefData()->m_wxlStateData->m_trackedObjects; for (it = hashMap->begin(); it != hashMap->end(); ++it) { *************** *** 447,453 **** switch (ltype) { ! case LUA_TNIL: case LUA_TSTRING: ! case LUA_TNUMBER: // can convert easily return true; default: --- 447,453 ---- switch (ltype) { ! //case LUA_TNIL: too easy to have a variable typo, use (str or "") case LUA_TSTRING: ! case LUA_TNUMBER: // can convert easily, always works return true; default: *************** *** 463,468 **** switch (ltype) { ! case LUA_TNIL: ! case LUA_TNUMBER: case LUA_TBOOLEAN: return true; --- 463,468 ---- switch (ltype) { ! case LUA_TNIL: // evaluates to false ! case LUA_TNUMBER: // as in C 0 == false case LUA_TBOOLEAN: return true; *************** *** 479,483 **** switch (ltype) { ! case LUA_TNUMBER: // make sure it's only a number for an enum return true; default: --- 479,484 ---- switch (ltype) { ! case LUA_TNIL: // evaluates to 0 so wx.ENUM_typo = 0 ! case LUA_TNUMBER: // make sure it's only a number for an enum return true; default: *************** *** 493,500 **** switch (ltype) { ! case LUA_TNIL: ! //case LUA_TSTRING: // will be 0 unless really a number "2" case LUA_TNUMBER: ! case LUA_TBOOLEAN: return true; default: --- 494,501 ---- switch (ltype) { ! //case LUA_TNIL: evaluates to 0, too easy to have a typo ! //case LUA_TSTRING: will be 0 unless really a number "2" case LUA_TNUMBER: ! case LUA_TBOOLEAN: // can't do (bool_val or 1) return true; default: *************** *** 867,873 **** { // don't "own" pointers to wxLuaCallbacks, let wxEventHandler do it ! m_eventHandlerList.DeleteContents(false); ! // don't delete wxLuaDestroyCallbacks, let wxEventHandler do it ! m_destroyHandlerList.DeleteContents(false); // don't delete wxWindow derived classes, let wxWidgets do it m_windowList.DeleteContents(false); --- 868,874 ---- { // don't "own" pointers to wxLuaCallbacks, let wxEventHandler do it ! m_callbackList.DeleteContents(false); ! // don't delete wxLuaWinDestroyCallbacks, let wxEventHandler do it ! m_winDestroyCallbackList.DeleteContents(false); // don't delete wxWindow derived classes, let wxWidgets do it m_windowList.DeleteContents(false); *************** *** 897,906 **** m_pDerivedList.clear(); ! for (it = m_pTrackedList.begin(); it != m_pTrackedList.end(); ++it) { wxObject* obj = (wxObject*)it->second; delete obj; } ! m_pTrackedList.clear(); wxLuaBindingList::Node *node = m_bindingList.GetFirst(); --- 898,907 ---- m_pDerivedList.clear(); ! for (it = m_trackedObjects.begin(); it != m_trackedObjects.end(); ++it) { wxObject* obj = (wxObject*)it->second; delete obj; } ! m_trackedObjects.clear(); wxLuaBindingList::Node *node = m_bindingList.GetFirst(); *************** *** 1006,1011 **** } ! m_wxlStateData->m_eventHandlerList.Clear(); ! m_wxlStateData->m_destroyHandlerList.Clear(); m_wxlStateData->m_windowList.Clear(); } --- 1007,1012 ---- } ! m_wxlStateData->m_callbackList.Clear(); ! m_wxlStateData->m_winDestroyCallbackList.Clear(); m_wxlStateData->m_windowList.Clear(); } *************** *** 1014,1021 **** { // remove any and all callbacks that use this event handler since its gone ! wxNode* node = m_wxlStateData->m_eventHandlerList.GetFirst(); while (node) { ! wxLuaCallback *pCallback = (wxLuaCallback *) node->GetData(); wxCHECK_RET(pCallback, wxT("Invalid wxLuaCallback")); if (pCallback->GetwxLuaState().GetRefData() != this) // don't unref us --- 1015,1022 ---- { // remove any and all callbacks that use this event handler since its gone ! wxNode* node = m_wxlStateData->m_callbackList.GetFirst(); while (node) { ! wxLuaCallback *pCallback = (wxLuaCallback *)node->GetData(); wxCHECK_RET(pCallback, wxT("Invalid wxLuaCallback")); if (pCallback->GetwxLuaState().GetRefData() != this) // don't unref us *************** *** 1025,1033 **** } ! node = m_wxlStateData->m_destroyHandlerList.GetFirst(); while (node) { ! wxLuaDestroyCallback *pCallback = (wxLuaDestroyCallback *) node->GetData(); ! wxCHECK_RET(pCallback, wxT("Invalid wxLuaCallback")); if (pCallback->GetwxLuaState().GetRefData() != this) // don't unref us pCallback->ClearwxLuaState(); --- 1026,1034 ---- } ! node = m_wxlStateData->m_winDestroyCallbackList.GetFirst(); while (node) { ! wxLuaWinDestroyCallback *pCallback = (wxLuaWinDestroyCallback *) node->GetData(); ! wxCHECK_RET(pCallback, wxT("Invalid wxLuaWinDestroyCallback")); if (pCallback->GetwxLuaState().GetRefData() != this) // don't unref us pCallback->ClearwxLuaState(); *************** *** 1036,1041 **** } ! m_wxlStateData->m_eventHandlerList.Clear(); ! m_wxlStateData->m_destroyHandlerList.Clear(); } --- 1037,1042 ---- } ! m_wxlStateData->m_callbackList.Clear(); ! m_wxlStateData->m_winDestroyCallbackList.Clear(); } *************** *** 1286,1289 **** --- 1287,1296 ---- } + void wxLuaState::SetInEventType(wxEventType eventType) + { + wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); + M_WXLSTATEDATA->m_wxlStateData->m_inEventType = eventType; + } + void wxLuaState::SetEventHandler(wxEvtHandler *evtHandler) { *************** *** 1703,1707 **** } ! wxLuaBinding* wxLuaState::GetLuaBinding(const wxString& nameSpace) const { wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); --- 1710,1714 ---- } ! wxLuaBinding* wxLuaState::GetLuaBinding(const wxString& bindingName) const { wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); *************** *** 1710,1714 **** { wxLuaBinding* binding = node->GetData(); ! if (binding->GetLuaNamespace() == nameSpace) return binding; } --- 1717,1721 ---- { wxLuaBinding* binding = node->GetData(); ! if (binding->GetBindingName() == bindingName) return binding; } *************** *** 1878,1900 **** // memory tracking functions ! void wxLuaState::AddToTrackedMemoryList(wxObject *pObject) { ! wxCHECK_RET(Ok() && pObject, wxT("Invalid wxLuaState or wxObject to track")); ! M_WXLSTATEDATA->m_wxlStateData->m_pTrackedList[(long)pObject] = (long)pObject; } ! void wxLuaState::AddToTrackedMemoryList(long obj_ptr, wxObject *pObject) { wxCHECK_RET(Ok() && pObject, wxT("Invalid wxLuaState or wxObject to track")); ! M_WXLSTATEDATA->m_wxlStateData->m_pTrackedList[obj_ptr] = (long)pObject; } ! bool wxLuaState::RemoveTrackedMemory(void *pObject, bool fDelete) { wxCHECK_MSG(Ok() && pObject, false, wxT("Invalid wxLuaState or object")); ! wxLongToLongHashMap::iterator it = M_WXLSTATEDATA->m_wxlStateData->m_pTrackedList.find((long) pObject); ! if (it != M_WXLSTATEDATA->m_wxlStateData->m_pTrackedList.end()) { // always delete the object for the case where it's encapsulated --- 1885,1906 ---- // memory tracking functions ! void wxLuaState::AddTrackedObject(wxObject *pObject) { ! AddTrackedObject((long)pObject, pObject); } ! void wxLuaState::AddTrackedObject(long obj_ptr, wxObject *pObject) { wxCHECK_RET(Ok() && pObject, wxT("Invalid wxLuaState or wxObject to track")); ! M_WXLSTATEDATA->m_wxlStateData->m_trackedObjects[obj_ptr] = (long)pObject; } ! bool wxLuaState::RemoveTrackedObject(void *pObject, bool fDelete) { wxCHECK_MSG(Ok() && pObject, false, wxT("Invalid wxLuaState or object")); ! wxLongToLongHashMap::iterator it = M_WXLSTATEDATA->m_wxlStateData->m_trackedObjects.find((long) pObject); ! if (it != M_WXLSTATEDATA->m_wxlStateData->m_trackedObjects.end()) { // always delete the object for the case where it's encapsulated *************** *** 1906,1910 **** // remove the item from being tracked ! M_WXLSTATEDATA->m_wxlStateData->m_pTrackedList.erase(it); return true; --- 1912,1916 ---- // remove the item from being tracked ! M_WXLSTATEDATA->m_wxlStateData->m_trackedObjects.erase(it); return true; *************** *** 1914,1918 **** } ! void wxLuaState::AddToTrackedWindowList(wxWindow *pWindow) { wxCHECK_RET(Ok() && pWindow, wxT("Invalid wxLuaState or wxWindow")); --- 1920,1930 ---- } ! wxLongToLongHashMap* wxLuaState::GetTrackedObjects() ! { ! wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return &M_WXLSTATEDATA->m_wxlStateData->m_trackedObjects; ! } ! ! void wxLuaState::AddTrackedWindow(wxWindow *pWindow) { wxCHECK_RET(Ok() && pWindow, wxT("Invalid wxLuaState or wxWindow")); *************** *** 1930,1937 **** } ! void wxLuaState::RemoveTrackedWindow(wxWindow *pWindow) { ! wxCHECK_RET(Ok() && pWindow, wxT("Invalid wxLuaState or wxWindow")); ! M_WXLSTATEDATA->m_wxlStateData->m_windowList.DeleteObject(pWindow); } --- 1942,1949 ---- } ! bool wxLuaState::RemoveTrackedWindow(wxWindow *pWindow) { ! wxCHECK_MSG(Ok() && pWindow, false, wxT("Invalid wxLuaState or wxWindow")); ! return M_WXLSTATEDATA->m_wxlStateData->m_windowList.DeleteObject(pWindow); } *************** *** 1962,1995 **** } ! void wxLuaState::AddTrackedEventHandler(wxEvtHandler* evtHandler) { wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_eventHandlerList.Append(evtHandler); } ! bool wxLuaState::RemoveTrackedEventHandler(wxEvtHandler* evtHandler) { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_eventHandlerList.DeleteObject(evtHandler); } ! wxList* wxLuaState::GetTrackedEventHandlerList() { wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return &M_WXLSTATEDATA->m_wxlStateData->m_eventHandlerList; } ! void wxLuaState::AddTrackedDestroyEventHandler(wxEvtHandler* evtHandler) { wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_destroyHandlerList.Append(evtHandler); } ! bool wxLuaState::RemoveTrackedDestroyEventHandler(wxEvtHandler* evtHandler) { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_destroyHandlerList.DeleteObject(evtHandler); } ! wxList* wxLuaState::GetTrackedDestroyEventHandlerList() { wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return &M_WXLSTATEDATA->m_wxlStateData->m_destroyHandlerList; } --- 1974,2007 ---- } ! void wxLuaState::AddTrackedCallback(wxLuaCallback* callback) { wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_callbackList.Append(callback); } ! bool wxLuaState::RemoveTrackedCallback(wxLuaCallback* callback) { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_callbackList.DeleteObject(callback); } ! wxList* wxLuaState::GetTrackedCallbackList() { wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return &M_WXLSTATEDATA->m_wxlStateData->m_callbackList; } ! void wxLuaState::AddTrackedWinDestroyCallback(wxLuaWinDestroyCallback* callback) { wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); ! M_WXLSTATEDATA->m_wxlStateData->m_winDestroyCallbackList.Append(callback); } ! bool wxLuaState::RemoveTrackedWinDestroyCallback(wxLuaWinDestroyCallback* callback) { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return M_WXLSTATEDATA->m_wxlStateData->m_winDestroyCallbackList.DeleteObject(callback); } ! wxList* wxLuaState::GetTrackedWinDestroyCallbackList() { wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return &M_WXLSTATEDATA->m_wxlStateData->m_winDestroyCallbackList; } *************** *** 2259,2267 **** // check to make sure that we're not trying to attach another destroy callback bool already_handled = false; ! wxNode* node = M_WXLSTATEDATA->m_wxlStateData->m_destroyHandlerList.GetFirst(); while (node) { ! wxLuaDestroyCallback *pCallback = (wxLuaDestroyCallback *)node->GetData(); ! wxCHECK_RET(pCallback, wxT("Invalid wxLuaCallback")); if (pCallback->GetEvtHandler() == win) { --- 2271,2279 ---- // check to make sure that we're not trying to attach another destroy callback bool already_handled = false; ! wxNode* node = M_WXLSTATEDATA->m_wxlStateData->m_winDestroyCallbackList.GetFirst(); while (node) { ! wxLuaWinDestroyCallback *pCallback = (wxLuaWinDestroyCallback *)node->GetData(); ! wxCHECK_RET(pCallback, wxT("Invalid wxLuaWinDestroyCallback")); if (pCallback->GetEvtHandler() == win) { *************** *** 2277,2287 **** { handled = true; ! wxLuaDestroyCallback *pCallback = new wxLuaDestroyCallback(*this, ! win->GetId(), ! (wxEvtHandler *) win, ! tag); if (pCallback == NULL) { ! terror("wxLua: Out of memory"); } } --- 2289,2298 ---- { handled = true; ! wxLuaWinDestroyCallback *pCallback = ! new wxLuaWinDestroyCallback(*this, win->GetId(), ! (wxEvtHandler*)win, tag); if (pCallback == NULL) { ! terror("wxLua: Out of memory creating wxLuaWinDestroyCallback."); } } Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** wxlbind.cpp 12 Dec 2006 07:09:41 -0000 1.46 --- wxlbind.cpp 14 Dec 2006 01:01:26 -0000 1.47 *************** *** 231,237 **** // ---------------------------------------------------------------------------- ! void LUACALL wxLua_AddToTrackedMemoryList(wxLuaState& wxlState, wxObject *pObject) { ! wxlState.AddToTrackedMemoryList(pObject); } --- 231,237 ---- // ---------------------------------------------------------------------------- ! void LUACALL wxLua_AddTrackedObject(wxLuaState& wxlState, wxObject *pObject) { ! wxlState.AddTrackedObject(pObject); } *************** *** 268,272 **** //tracked = ! wxlState.RemoveTrackedMemory((void*)key, true); // delete from m_pTrackedList wxLongToLongHashMap& pDerivedList = wxlState.GetLuaStateData()->m_pDerivedList; --- 268,272 ---- //tracked = ! wxlState.RemoveTrackedObject((void*)key, true); // delete from m_pTrackedList wxLongToLongHashMap& pDerivedList = wxlState.GetLuaStateData()->m_pDerivedList; *************** *** 460,464 **** } } ! (*pHashTable)[index] = (long)new wxLuaObject(L, 3); } } --- 460,464 ---- } } ! (*pHashTable)[index] = (long)new wxLuaObject(wxlState, 3); } } Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wxlcallb.cpp 12 Dec 2006 07:09:41 -0000 1.22 --- wxlcallb.cpp 14 Dec 2006 01:01:26 -0000 1.23 *************** *** 1,5 **** ///////////////////////////////////////////////////////////////////////////// ! // Name: wxLuaCallback ! // Purpose: A simple class for a C++ wxWidgets program to embed wxLua // Author: Francis Irving // Created: 11/05/2002 --- 1,5 ---- ///////////////////////////////////////////////////////////////////////////// ! // Name: wxlcallb.cpp ! // Purpose: wxLuaCallback and wxLuaWinDestroyCallback // Author: Francis Irving // Created: 11/05/2002 *************** *** 21,36 **** #include "wxlua/include/wxlcallb.h" - //extern int s_wxluatag_wxEvent; - //----------------------------------------------------------------------------- // wxLuaCallback //----------------------------------------------------------------------------- ! IMPLEMENT_ABSTRACT_CLASS(wxLuaCallback, wxEvtHandler) ! ! wxLuaCallback::wxLuaCallback( const wxLuaState& state, int theRoutine, ! wxWindowID winId, wxWindowID lastId, ! wxEventType eventType, wxEvtHandler *pEvtHandler ) ! : wxEvtHandler(), m_wxlState(state), m_pHandler(pEvtHandler), m_id(winId), m_lastId(lastId), m_eventType(eventType) --- 21,33 ---- #include "wxlua/include/wxlcallb.h" //----------------------------------------------------------------------------- // wxLuaCallback //----------------------------------------------------------------------------- + IMPLEMENT_ABSTRACT_CLASS(wxLuaCallback, wxObject) ! wxLuaCallback::wxLuaCallback(const wxLuaState& state, int lua_func_stack_idx, ! wxWindowID winId, wxWindowID lastId, ! wxEventType eventType, wxEvtHandler *pEvtHandler) ! : wxObject(), m_wxlState(state), m_pHandler(pEvtHandler), m_id(winId), m_lastId(lastId), m_eventType(eventType) *************** *** 38,42 **** wxCHECK_RET(m_wxlState.Ok(), wxT("Invalid wxLuaState")); ! m_routine = m_wxlState.tinsert(theRoutine); pEvtHandler->Connect( winId, lastId, eventType, --- 35,40 ---- wxCHECK_RET(m_wxlState.Ok(), wxT("Invalid wxLuaState")); ! // create a reference to the lua function ! m_routine = m_wxlState.tinsert(lua_func_stack_idx); pEvtHandler->Connect( winId, lastId, eventType, *************** *** 44,48 **** this); ! m_wxlState.AddTrackedEventHandler(this); } --- 42,46 ---- this); ! m_wxlState.AddTrackedCallback(this); } *************** *** 54,58 **** m_wxlState.tremove(m_routine); // delete the reference to this handler ! m_wxlState.RemoveTrackedEventHandler(this); } } --- 52,56 ---- m_wxlState.tremove(m_routine); // delete the reference to this handler ! m_wxlState.RemoveTrackedCallback(this); } } *************** *** 68,72 **** wxLuaState wxlState(theCallback->GetwxLuaState()); ! wxlState.GetLuaStateRefData()->m_wxlStateData->m_inEventType = event.GetEventType(); if (event.GetEventType() == wxEVT_DESTROY) --- 66,70 ---- wxLuaState wxlState(theCallback->GetwxLuaState()); ! wxlState.SetInEventType(event.GetEventType()); if (event.GetEventType() == wxEVT_DESTROY) *************** *** 75,79 **** wxlState.RemoveTrackedWindow((wxWindow*)event.GetEventObject()); // delete the reference to this handler since we're clearing it ! wxlState.RemoveTrackedEventHandler(theCallback); // Disconnect all callbacks associated with this window's evthandler --- 73,77 ---- wxlState.RemoveTrackedWindow((wxWindow*)event.GetEventObject()); // delete the reference to this handler since we're clearing it ! wxlState.RemoveTrackedCallback(theCallback); // Disconnect all callbacks associated with this window's evthandler *************** *** 82,89 **** wxEvtHandler *evtHandler = ((wxWindow*)event.GetEventObject())->GetEventHandler(); ! wxNode* node = wxlState.GetTrackedEventHandlerList()->GetFirst(); while (node) { ! wxLuaCallback *pCallback = (wxLuaCallback *) node->GetData(); if ((pCallback != NULL) && (pCallback->GetEvtHandler() == evtHandler)) --- 80,87 ---- wxEvtHandler *evtHandler = ((wxWindow*)event.GetEventObject())->GetEventHandler(); ! wxNode* node = wxlState.GetTrackedCallbackList()->GetFirst(); while (node) { ! wxLuaCallback *pCallback = (wxLuaCallback *)node->GetData(); if ((pCallback != NULL) && (pCallback->GetEvtHandler() == evtHandler)) *************** *** 92,96 **** wxNode* pc_node = node; // remember current node node = node->GetNext(); ! wxlState.GetTrackedEventHandlerList()->Erase(pc_node); pCallback->ClearwxLuaState(); --- 90,94 ---- wxNode* pc_node = node; // remember current node node = node->GetNext(); ! wxlState.GetTrackedCallbackList()->Erase(pc_node); pCallback->ClearwxLuaState(); *************** *** 103,107 **** theCallback->CallFunction(&event); ! wxlState.GetLuaStateRefData()->m_wxlStateData->m_inEventType = wxEVT_NULL; } --- 101,105 ---- theCallback->CallFunction(&event); ! wxlState.SetInEventType(wxEVT_NULL); } *************** *** 143,156 **** // ---------------------------------------------------------------------------- ! // wxLuaDestroyCallback // ---------------------------------------------------------------------------- ! IMPLEMENT_ABSTRACT_CLASS(wxLuaDestroyCallback, wxEvtHandler) ! ! wxLuaDestroyCallback::wxLuaDestroyCallback(const wxLuaState& state, ! wxWindowID id, wxEvtHandler *pHandler, ! int iTag) ! : wxEvtHandler(), m_wxlState(state), ! m_pHandler(pHandler), m_id(id) { wxCHECK_RET(m_wxlState.Ok(), wxT("Invalid wxLuaState")); --- 141,153 ---- // ---------------------------------------------------------------------------- ! // wxLuaWinDestroyCallback // ---------------------------------------------------------------------------- + IMPLEMENT_ABSTRACT_CLASS(wxLuaWinDestroyCallback, wxObject) ! wxLuaWinDestroyCallback::wxLuaWinDestroyCallback(const wxLuaState& state, ! wxWindowID id, wxEvtHandler *pHandler, ! int iTag) ! :wxObject(), m_wxlState(state), ! m_pHandler(pHandler), m_id(id) { wxCHECK_RET(m_wxlState.Ok(), wxT("Invalid wxLuaState")); *************** *** 158,162 **** // allocate a LUA proxy for the object ! const void **ptr = (const void **) lua_newuserdata(L, sizeof(void *)); if (ptr != NULL) { --- 155,159 ---- // allocate a LUA proxy for the object ! const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); if (ptr != NULL) { *************** *** 168,174 **** { if (lua_setmetatable(L, -2) == 0) ! { ! m_wxlState.terror("wxLua: Unable to set metatable"); ! } } --- 165,169 ---- { if (lua_setmetatable(L, -2) == 0) ! m_wxlState.terror("wxLua: Unable to set metatable of proxy in wxLuaWinDestroyCallback."); } *************** *** 184,219 **** } ! m_wxlState.AddTrackedDestroyEventHandler(this); // connect the event handler pHandler->Connect(id, wxEVT_DESTROY, ! (wxObjectEventFunction)&wxLuaDestroyCallback::EventHandler, this); } else { ! m_wxlState.terror("wxLua: Out of memory"); } } ! wxLuaDestroyCallback::~wxLuaDestroyCallback() { if (m_wxlState.Ok()) ! m_wxlState.RemoveTrackedDestroyEventHandler(this); } ! void wxLuaDestroyCallback::EventHandler(wxWindowDestroyEvent& event) { ! wxLuaDestroyCallback *theCallback = (wxLuaDestroyCallback *) event.m_callbackUserData; if (theCallback && (((wxEvtHandler*)event.GetEventObject()) == theCallback->m_pHandler)) { ! theCallback->OnDestroy(); } ! ! event.Skip(); } ! void wxLuaDestroyCallback::OnDestroy() { // FIXME - Is it an error to receive an event after you've deleted lua? // probably not if lua is getting shutdown --- 179,216 ---- } ! m_wxlState.AddTrackedWinDestroyCallback(this); // connect the event handler pHandler->Connect(id, wxEVT_DESTROY, ! (wxObjectEventFunction)&wxLuaWinDestroyCallback::EventHandler, this); } else { ! m_wxlState.terror("wxLua: Out of memory trying to create wxLuaWinDestroyCallback."); } } ! wxLuaWinDestroyCallback::~wxLuaWinDestroyCallback() { if (m_wxlState.Ok()) ! m_wxlState.RemoveTrackedWinDestroyCallback(this); } ! void wxLuaWinDestroyCallback::EventHandler(wxWindowDestroyEvent& event) { ! wxLuaWinDestroyCallback *theCallback = (wxLuaWinDestroyCallback *)event.m_callbackUserData; if (theCallback && (((wxEvtHandler*)event.GetEventObject()) == theCallback->m_pHandler)) { ! theCallback->OnDestroy(event); } ! else ! event.Skip(); } ! void wxLuaWinDestroyCallback::OnDestroy(wxWindowDestroyEvent& event) { + event.Skip(); + // FIXME - Is it an error to receive an event after you've deleted lua? // probably not if lua is getting shutdown |
From: John L. <jr...@us...> - 2006-12-14 01:01:33
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/modules/wxbindstc/src Modified Files: stc.cpp wxstc_bind.cpp Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: wxstc_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/wxstc_bind.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxstc_bind.cpp 12 Dec 2006 07:09:41 -0000 1.15 --- wxstc_bind.cpp 14 Dec 2006 01:01:26 -0000 1.16 *************** *** 1475,1479 **** wxLuaBinding_wxstc::wxLuaBinding_wxstc() : wxLuaBinding() { ! m_nameSpace = wxT("wx"); m_classList = wxLuaGetClassList_wxstc(m_classCount); m_defineList = wxLuaGetDefineList_wxstc(m_defineCount); --- 1475,1480 ---- wxLuaBinding_wxstc::wxLuaBinding_wxstc() : wxLuaBinding() { ! m_bindingName = wxT("wxstc"); ! m_nameSpace = wxT("wx"); m_classList = wxLuaGetClassList_wxstc(m_classCount); m_defineList = wxLuaGetDefineList_wxstc(m_defineCount); Index: stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/stc.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** stc.cpp 12 Dec 2006 07:09:41 -0000 1.18 --- stc.cpp 14 Dec 2006 01:01:26 -0000 1.19 *************** *** 40,44 **** returns = new wxColour(self->GetCaretLineBackground()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 40,44 ---- returns = new wxColour(self->GetCaretLineBackground()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 76,80 **** returns = new wxColour(self->GetCaretLineBack()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 76,80 ---- returns = new wxColour(self->GetCaretLineBack()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 6214,6218 **** returns = new wxColour(self->IndicatorGetForeground(indic)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 6214,6218 ---- returns = new wxColour(self->IndicatorGetForeground(indic)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 6264,6268 **** returns = new wxColour(self->GetCaretForeground()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 6264,6268 ---- returns = new wxColour(self->GetCaretForeground()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 6356,6360 **** returns = new wxColour(self->GetEdgeColour()); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); --- 6356,6360 ---- returns = new wxColour(self->GetEdgeColour()); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxColour *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxColour, returns); *************** *** 6500,6504 **** // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddToTrackedWindowList((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextCtrl, returns); --- 6500,6504 ---- // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextCtrl, returns); *************** *** 6537,6541 **** returns = new wxPoint(self->PointFromPosition(pos)); // add the new object to the tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxPoint *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxPoint, returns); --- 6537,6541 ---- returns = new wxPoint(self->PointFromPosition(pos)); // add the new object to the tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxPoint *)returns); // push the result datatype wxlState.PushUserDataType(s_wxluatag_wxPoint, returns); *************** *** 7201,7205 **** returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxStyledTextEvent *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextEvent, returns); --- 7201,7205 ---- returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxLua_AddTrackedObject(wxlState, (wxStyledTextEvent *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextEvent, returns); *************** *** 7811,7815 **** // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedMemory(self); return 0; } --- 7811,7815 ---- // remove from tracked memory list if (self != 0) ! wxlState.RemoveTrackedObject(self); return 0; } *************** *** 7821,7825 **** // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedMemory(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); --- 7821,7825 ---- // remove from tracked memory list if (self != 0) ! if (wxlState.RemoveTrackedObject(self)) { // if removed, reset the tag so that gc() is not called on this object. lua_pushnil(L); |
From: John L. <jr...@us...> - 2006-12-14 01:01:33
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/modules/wxluadebug/src Modified Files: staktree.cpp Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: staktree.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/staktree.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** staktree.cpp 13 Dec 2006 06:57:50 -0000 1.34 --- staktree.cpp 14 Dec 2006 01:01:27 -0000 1.35 *************** *** 259,272 **** int derivedCount = wxlState.GetLuaStateData()->m_pDerivedList.size(); ! int trackedCount = wxlState.GetLuaStateData()->m_pTrackedList.size(); ! int evtHandlerCount = wxlState.GetTrackedEventHandlerList()->GetCount(); int windowCount = wxlState.GetLuaStateData()->m_windowList.GetCount(); ! int destroyCount = wxlState.GetLuaStateData()->m_destroyHandlerList.GetCount(); wxLuaDebugDataItem* derivedItem = new wxLuaDebugDataItem(_("Derived List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), derivedCount), wxT(""), LUA_NOREF, 0); wxLuaDebugDataItem* trackedItem = new wxLuaDebugDataItem(_("Tracked List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), trackedCount), wxT(""), LUA_NOREF, 0); ! wxLuaDebugDataItem* evtHandlerItem = new wxLuaDebugDataItem(_("Event Handler List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), evtHandlerCount), wxT(""), LUA_NOREF, 0); wxLuaDebugDataItem* windowItem = new wxLuaDebugDataItem(_("wxWindow List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), windowCount), wxT(""), LUA_NOREF, 0); ! wxLuaDebugDataItem* destroyItem = new wxLuaDebugDataItem(_("wxWindow Destroy List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), destroyCount), wxT(""), LUA_NOREF, 0); wxTreeItemId treeNode; --- 259,272 ---- int derivedCount = wxlState.GetLuaStateData()->m_pDerivedList.size(); ! int trackedCount = wxlState.GetTrackedObjects()->size(); ! int callbackCount = wxlState.GetTrackedCallbackList()->GetCount(); int windowCount = wxlState.GetLuaStateData()->m_windowList.GetCount(); ! int destroyCount = wxlState.GetTrackedWinDestroyCallbackList()->GetCount(); wxLuaDebugDataItem* derivedItem = new wxLuaDebugDataItem(_("Derived List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), derivedCount), wxT(""), LUA_NOREF, 0); wxLuaDebugDataItem* trackedItem = new wxLuaDebugDataItem(_("Tracked List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), trackedCount), wxT(""), LUA_NOREF, 0); ! wxLuaDebugDataItem* callbackItem = new wxLuaDebugDataItem(_("Event Callback List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), callbackCount), wxT(""), LUA_NOREF, 0); wxLuaDebugDataItem* windowItem = new wxLuaDebugDataItem(_("wxWindow List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), windowCount), wxT(""), LUA_NOREF, 0); ! wxLuaDebugDataItem* destroyItem = new wxLuaDebugDataItem(_("wxWindow Destroy Callback List"), wxT("wxLuaData"), wxString::Format(wxT("%d"), destroyCount), wxT(""), LUA_NOREF, 0); wxTreeItemId treeNode; *************** *** 276,281 **** treeNode = treeControl->AppendItem(rootItem, wxT("Tracked List"), 1, 1, trackedItem); if (trackedCount > 0) m_treeControl->SetItemHasChildren(treeNode); ! treeNode = treeControl->AppendItem(rootItem, wxT("Event Handler List"), 1, 1, evtHandlerItem); ! if (evtHandlerCount > 0) m_treeControl->SetItemHasChildren(treeNode); treeNode = treeControl->AppendItem(rootItem, wxT("wxWindow List"), 1, 1, windowItem); if (windowCount > 0) m_treeControl->SetItemHasChildren(treeNode); --- 276,281 ---- treeNode = treeControl->AppendItem(rootItem, wxT("Tracked List"), 1, 1, trackedItem); if (trackedCount > 0) m_treeControl->SetItemHasChildren(treeNode); ! treeNode = treeControl->AppendItem(rootItem, wxT("Event Callback List"), 1, 1, callbackItem); ! if (callbackCount > 0) m_treeControl->SetItemHasChildren(treeNode); treeNode = treeControl->AppendItem(rootItem, wxT("wxWindow List"), 1, 1, windowItem); if (windowCount > 0) m_treeControl->SetItemHasChildren(treeNode); *************** *** 320,324 **** else if (m_wxlState.Ok() && ((pDebugDataItem->GetName() == _("Tracked List")) || ! (pDebugDataItem->GetName() == _("Event Handler List")) || (pDebugDataItem->GetName() == _("wxWindow List")))) { --- 320,324 ---- else if (m_wxlState.Ok() && ((pDebugDataItem->GetName() == _("Tracked List")) || ! (pDebugDataItem->GetName() == _("Event Callback List")) || (pDebugDataItem->GetName() == _("wxWindow List")))) { *************** *** 331,335 **** { wxLongToLongHashMap::iterator it; ! wxLongToLongHashMap* hashMap = &wxlState.GetLuaStateRefData()->m_wxlStateData->m_pTrackedList; for (it = hashMap->begin(); it != hashMap->end(); ++it) --- 331,335 ---- { wxLongToLongHashMap::iterator it; ! wxLongToLongHashMap* hashMap = wxlState.GetTrackedObjects(); for (it = hashMap->begin(); it != hashMap->end(); ++it) *************** *** 353,359 **** } } ! else if (pDebugDataItem->GetName() == _("Event Handler List")) { ! wxNode* node = wxlState.GetTrackedEventHandlerList()->GetFirst(); while (node) { --- 353,359 ---- } } ! else if (pDebugDataItem->GetName() == _("Event Callback List")) { ! wxNode* node = wxlState.GetTrackedCallbackList()->GetFirst(); while (node) { |
From: John L. <jr...@us...> - 2006-12-14 01:01:33
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/modules/wxbindstc/include Modified Files: wxbind.h Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: wxbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/include/wxbind.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxbind.h 13 Dec 2006 06:57:50 -0000 1.15 --- wxbind.h 14 Dec 2006 01:01:26 -0000 1.16 *************** *** 22,28 **** #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 2 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 2 // binding class --- 22,28 ---- #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 3 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 3 // binding class |
From: John L. <jr...@us...> - 2006-12-14 01:01:33
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1560/wxLua/modules/wxluasocket/include Modified Files: wxluasocket_bind.h Log Message: speed up genwxbind.lua add wxLuaBinding::GetBindingName as a unique name to know if it's added Rename *AddToTrackedMemory -> AddTrackedObject since it only tracks wxObjects Rename wxLuaState::AddTrackedEventHandler to AddTrackedCallback and only accept wxLuaCallbacks Rename wxLuaState::AddTrackedDestroyEventHandler to AddTrackedWinDestroyCallback and only accept wxLuaWinDestroyCallbacks Make type evaluation for the bindings more strict Index: wxluasocket_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxluasocket_bind.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wxluasocket_bind.h 13 Dec 2006 06:57:50 -0000 1.9 --- wxluasocket_bind.h 14 Dec 2006 01:01:27 -0000 1.10 *************** *** 23,29 **** #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 2 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 2 // binding class --- 23,29 ---- #include "wxlua/include/wxlbind.h" ! #if WXLUA_BINDING_VERSION > 3 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 3 // binding class |