From: John L. <jr...@us...> - 2007-08-10 21:23:42
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23945/wxLua/modules/wxlua/include Modified Files: wxlstate.h Log Message: Streamline the creation of a wxLuaState Changed the enums WXLUASTATE_ATTACH/SETSTATE for clarity and completeness. Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** wxlstate.h 10 Aug 2007 01:41:08 -0000 1.92 --- wxlstate.h 10 Aug 2007 21:23:39 -0000 1.93 *************** *** 401,408 **** enum wxLuaState_Type { ! WXLUASTATE_ATTACH = 1, // Attach to a previously created wxLuaState's // lua_State refing the existing wxLuaStateRefData ! WXLUASTATE_SETSTATE = 2 // Set the lua_State, register the bindings, ! // and don't close it when destroyed }; --- 401,412 ---- enum wxLuaState_Type { ! wxLUASTATE_GETSTATE = 1, // Attach to a previously created wxLuaState's // lua_State refing the existing wxLuaStateRefData ! wxLUASTATE_USESTATE = 2, // Set the lua_State and register the bindings. ! wxLUASTATE_SETSTATE = 3, // Set the lua_State, but don't register the bindings. ! ! wxLUASTATE_STATICSTATE = 0x1000 // The lua_State is static and the wxLuaState ! // will not lua_close() it when Destroy()ed. ! // Use with wxLUASTATE_USESTATE/SETSTATE only. }; *************** *** 417,426 **** wxLuaState(bool create = false) { if (create) Create(); } // Create a new lua_State, add the bindings in wxLuaBinding::GetBindingList() ! // sets the wxEvtHandler and wxWindowID to send the wxLuaEvents to wxLuaState(wxEvtHandler *handler, wxWindowID id = wxID_ANY) { Create(handler, id); } ! // Create a wxLuaState from an existing lua_State ! inline wxLuaState(lua_State* L, wxLuaState_Type type = WXLUASTATE_ATTACH) { Create(L, type); } // Copy constructor, refs existing wxLuaState ! inline wxLuaState(const wxLuaState& wxlState) { Create(wxlState); } // ALWAYS destroy lua_State instead of calling UnRef, else circular --- 421,431 ---- wxLuaState(bool create = false) { if (create) Create(); } // Create a new lua_State, add the bindings in wxLuaBinding::GetBindingList() ! // sets the wxEvtHandler and wxWindowID to send the wxLuaEvents to. wxLuaState(wxEvtHandler *handler, wxWindowID id = wxID_ANY) { Create(handler, id); } ! // Create a wxLuaState from an existing lua_State. ! // state_type is enum wxLuaState_Type. ! inline wxLuaState(lua_State* L, int state_type = wxLUASTATE_GETSTATE) { Create(L, state_type); } // Copy constructor, refs existing wxLuaState ! inline wxLuaState(const wxLuaState& wxlState) { Ref(wxlState); } // ALWAYS destroy lua_State instead of calling UnRef, else circular *************** *** 433,439 **** // handler may be NULL to not send events to anyone bool Create(wxEvtHandler *handler = NULL, wxWindowID id = wxID_ANY); ! // Create a new lua_State if L = NULL or just attach to the ! // input lua_State ! bool Create(lua_State* L, wxLuaState_Type type = WXLUASTATE_ATTACH); // ----------------------------------------------------------------------- --- 438,444 ---- // handler may be NULL to not send events to anyone bool Create(wxEvtHandler *handler = NULL, wxWindowID id = wxID_ANY); ! // Create a wxLuaState from an existing lua_State. ! // state_type is enum wxLuaState_Type. ! bool Create(lua_State* L, int state_type = wxLUASTATE_GETSTATE); // ----------------------------------------------------------------------- *************** *** 479,484 **** // ----------------------------------------------------------------------- ! // Set the event handler that the wxLuaEvents from this will be sent to, can be NULL ! // see wxEVT_LUA_XXX for a list of possible events that may be sent. void SetEventHandler(wxEvtHandler *evtHandler); wxEvtHandler *GetEventHandler() const; --- 484,489 ---- // ----------------------------------------------------------------------- ! // Set the event handler that the wxLuaEvents from this will be sent to, can be NULL. ! // See wxEVT_LUA_XXX for a list of possible events that may be sent. void SetEventHandler(wxEvtHandler *evtHandler); wxEvtHandler *GetEventHandler() const; |