From: John L. <jr...@us...> - 2007-12-15 16:56:45
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24974/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxlcallb.h wxlstate.h Log Message: * Changed signature of the function wxLuaState::SetLuaDebugHook() so that the inputs to lua_sethook() are together and in the same order. - Renamed wxLuaCallback to wxLuaEventCallback to make it more clear that it is a callback for the wxEvents using wxEvtHandlers. Cleaned up the comments in the headers. Index: wxlcallb.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlcallb.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wxlcallb.h 7 Dec 2007 06:44:46 -0000 1.24 --- wxlcallb.h 15 Dec 2007 16:56:41 -0000 1.25 *************** *** 1,5 **** ///////////////////////////////////////////////////////////////////////////// // Name: wxlcallb.h ! // Purpose: wxLuaCallback and wxLuaWinDestroyCallback // Author: Francis Irving, John Labenski // Created: 21/01/2002 --- 1,5 ---- ///////////////////////////////////////////////////////////////////////////// // Name: wxlcallb.h ! // Purpose: wxLuaEventCallback and wxLuaWinDestroyCallback // Author: Francis Irving, John Labenski // Created: 21/01/2002 *************** *** 15,21 **** // ---------------------------------------------------------------------------- ! // wxLuaCallback - Forward events from C++ wxWidgets wxEvtHandlers to Lua functions // ! // The wxLuaCallback is created with the wxLuaState, the stack index of a // Lua function to call when a wxEvent is received, the window id ranges, and // the wxEventType to connect using wxEvtHandler::Connect() with this as the --- 15,21 ---- // ---------------------------------------------------------------------------- ! // wxLuaEventCallback - Forward events from C++ wxWidgets wxEvtHandlers to Lua functions // ! // The wxLuaEventCallback is created with the wxLuaState, the stack index of a // Lua function to call when a wxEvent is received, the window id ranges, and // the wxEventType to connect using wxEvtHandler::Connect() with this as the *************** *** 25,44 **** // // The function EventHandler() generically handles the events and forwards them ! // to the event's wxLuaCallback callback user data function CallFunction(). // ---------------------------------------------------------------------------- ! #define WXLUACALLBACK_NOROUTINE 1000000 // use this for the lua_func_stack_idx ! // param of the constructor for no Lua routine ! 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& wxlState, int lua_func_stack_idx, ! wxWindowID win_id, wxWindowID last_id, ! wxEventType eventType, wxEvtHandler *evtHandler ); ! virtual ~wxLuaCallback(); void ClearwxLuaState(); // m_wxlState.UnRef() --- 25,44 ---- // // The function EventHandler() generically handles the events and forwards them ! // to the event's wxLuaEventCallback callback user data function CallFunction(). // ---------------------------------------------------------------------------- ! #define WXLUAEVENTCALLBACK_NOROUTINE 1000000 // use this for the lua_func_stack_idx ! // param of the constructor for no Lua routine ! class WXDLLIMPEXP_WXLUA wxLuaEventCallback : public wxObject { public: // winID and lastID follow the same notation as wxEvtHandler::Connect // if only one event Id is needed set lastId = wxID_ANY ! wxLuaEventCallback( const wxLuaState& wxlState, int lua_func_stack_idx, ! wxWindowID win_id, wxWindowID last_id, ! wxEventType eventType, wxEvtHandler *evtHandler ); ! virtual ~wxLuaEventCallback(); void ClearwxLuaState(); // m_wxlState.UnRef() *************** *** 54,62 **** // Get a human readable string ! // "wxEVT_XXX(evt#) -> wxLuaCallback(&callback, ids %d %d)|wxEvtHandler(&evthandler) -> wxEvtHandlerClassName" wxString GetInfo() const; // Get a human readable string // Central event handler that calls CallFunction() for the actual ! // wxLuaCallback callback user data. This function is treated like a // static function that all handlers of this class will call. void EventHandler(wxEvent& event); --- 54,62 ---- // Get a human readable string ! // "wxEVT_XXX(evt#) -> wxLuaEventCallback(&callback, ids %d %d)|wxEvtHandler(&evthandler) -> wxEvtHandlerClassName" wxString GetInfo() const; // Get a human readable string // Central event handler that calls CallFunction() for the actual ! // wxLuaEventCallback callback user data. This function is treated like a // static function that all handlers of this class will call. void EventHandler(wxEvent& event); *************** *** 75,79 **** private: ! DECLARE_ABSTRACT_CLASS(wxLuaCallback) }; --- 75,79 ---- private: ! DECLARE_ABSTRACT_CLASS(wxLuaEventCallback) }; Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** wxlbind.h 13 Dec 2007 00:47:51 -0000 1.71 --- wxlbind.h 15 Dec 2007 16:56:41 -0000 1.72 *************** *** 407,410 **** --- 407,412 ---- operator wxArrayString &() { return *GetArray(); } + // You may have to cast the wxLuaSmartwxArrayString with (wxArrayString&) + // e.g. wxLuaSmartwxArrayString arr; ((wxArrayString&)arr).Add(wxT("hello")); wxLuaSmartwxArrayString& operator = (const wxLuaSmartwxArrayString& arr) { *************** *** 431,434 **** --- 433,438 ---- operator wxSortedArrayString &() { return *GetArray(); } + // You may have to cast the wxLuaSmartwxSortedArrayString with (wxSortedArrayString&) + // e.g. wxLuaSmartwxSortedArrayString arr; ((wxSortedArrayString&)arr).Add(wxT("hello")); wxLuaSmartwxSortedArrayString& operator = (const wxLuaSmartwxSortedArrayString& arr) { *************** *** 455,458 **** --- 459,464 ---- operator wxArrayInt &() { return *GetArray(); } + // You may have to cast the wxLuaSmartwxArrayInt with (wxArrayInt&) + // e.g. wxLuaSmartwxArrayInt arr; ((wxArrayInt&)arr).Add(5); wxLuaSmartwxArrayInt& operator = (const wxLuaSmartwxArrayInt& arr) { Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** wxlstate.h 13 Dec 2007 06:23:54 -0000 1.106 --- wxlstate.h 15 Dec 2007 16:56:41 -0000 1.107 *************** *** 19,23 **** class WXDLLIMPEXP_WXLUA wxLuaState; class WXDLLIMPEXP_WXLUA wxLuaStateRefData; ! class WXDLLIMPEXP_WXLUA wxLuaCallback; class WXDLLIMPEXP_WXLUA wxLuaWinDestroyCallback; class WXDLLIMPEXP_WXLUA wxLuaDebugHookData; --- 19,23 ---- class WXDLLIMPEXP_WXLUA wxLuaState; class WXDLLIMPEXP_WXLUA wxLuaStateRefData; ! class WXDLLIMPEXP_WXLUA wxLuaEventCallback; class WXDLLIMPEXP_WXLUA wxLuaWinDestroyCallback; [...1271 lines suppressed...] bool HasDerivedMethod(void *pObject, const char *method_name, bool push_method) const; // When an object is being garbage collected and we call RemoveTrackedObject // object on it, we should also remove any derived functions or values it may have. bool RemoveDerivedMethods(void *pObject) const; // Find a derived method given an object and and a method name. --- 1010,1023 ---- // userdata and the new wxLuaObject wraps the Lua function or value // which will be deleted by this. ! // See wxlua_setderivedmethod bool SetDerivedMethod(void *pObject, const char *method_name, wxLuaObject* wxlObj); // Is there a derived method given an object and and a method name. // If push_method then push the method onto the stack. // A derived method is when a function or value is set to a wxLua userdata. + // See wxlua_hasderivedmethod(). bool HasDerivedMethod(void *pObject, const char *method_name, bool push_method) const; // When an object is being garbage collected and we call RemoveTrackedObject // object on it, we should also remove any derived functions or values it may have. + // See wxlua_removederivedmethods() bool RemoveDerivedMethods(void *pObject) const; // Find a derived method given an object and and a method name. |