From: John L. <jr...@us...> - 2005-11-28 06:05:17
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27690/wxLua/modules/wxlua/include Modified Files: internal.h wxlbind.h wxlstate.h Log Message: Use wxLuaState in the bindings #define tpushliteralstring replaced with tpushwxLuaReferences tpushwxLuaNull #define caused linking problems w/ gcc remove unused vars in wxLuaStateRefData Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxlbind.h 26 Nov 2005 08:46:57 -0000 1.2 --- wxlbind.h 28 Nov 2005 06:05:08 -0000 1.3 *************** *** 87,94 **** }; ! typedef WXLUACLASS* (*GetClassListFunction)(size_t &); typedef WXLUADEFINE* (*GetDefineListFunction)(size_t &); //typedef WXLUASTRING* (*GetDefineListFunction)(size_t &); FIXME - use this ! typedef WXLUAEVENT* (*GetEventListFunction)(size_t &); typedef WXLUAOBJECT* (*GetObjectListFunction)(size_t &); typedef WXLUAMETHOD* (*GetBuiltinListFunction)(size_t &); --- 87,94 ---- }; ! typedef WXLUACLASS* (*GetClassListFunction)(size_t &); typedef WXLUADEFINE* (*GetDefineListFunction)(size_t &); //typedef WXLUASTRING* (*GetDefineListFunction)(size_t &); FIXME - use this ! typedef WXLUAEVENT* (*GetEventListFunction)(size_t &); typedef WXLUAOBJECT* (*GetObjectListFunction)(size_t &); typedef WXLUAMETHOD* (*GetBuiltinListFunction)(size_t &); *************** *** 137,141 **** WXLUAMETHOD* GetLuaBuiltinList() { return m_builtinList; } ! bool IsTag(int tag) { return (tag >= m_startTag && tag <= m_lastTag); } // Look for base class in binding, set baseclass_tag --- 137,141 ---- WXLUAMETHOD* GetLuaBuiltinList() { return m_builtinList; } ! bool IsTag(int tag) { return (tag >= m_startTag) && (tag <= m_lastTag); } // Look for base class in binding, set baseclass_tag *************** *** 152,164 **** // binding objects ! size_t m_classCount; ! WXLUACLASS* m_classList; ! size_t m_defineCount; WXLUADEFINE* m_defineList; ! size_t m_eventCount; ! WXLUAEVENT* m_eventList; ! size_t m_objectCount; WXLUAOBJECT* m_objectList; ! size_t m_builtinCount; WXLUAMETHOD* m_builtinList; --- 152,164 ---- // binding objects ! size_t m_classCount; ! WXLUACLASS* m_classList; ! size_t m_defineCount; WXLUADEFINE* m_defineList; ! size_t m_eventCount; ! WXLUAEVENT* m_eventList; ! size_t m_objectCount; WXLUAOBJECT* m_objectList; ! size_t m_builtinCount; WXLUAMETHOD* m_builtinList; Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxlstate.h 26 Nov 2005 08:46:57 -0000 1.4 --- wxlstate.h 28 Nov 2005 06:05:08 -0000 1.5 *************** *** 43,47 **** } ! //#include "wxlua/include/internal.h" #include "wxlua/include/wxlbind.h" --- 43,47 ---- } ! #include "wxlua/include/wxldefs.h" #include "wxlua/include/wxlbind.h" *************** *** 54,58 **** //---------------------------------------------------------------------------- // wxLuaStateRefData - the internal data for the wxLuaState. ! // please use the wxLuaStare accessor functions //---------------------------------------------------------------------------- --- 54,58 ---- //---------------------------------------------------------------------------- // wxLuaStateRefData - the internal data for the wxLuaState. ! // please use the wxLuaState accessor functions //---------------------------------------------------------------------------- *************** *** 80,91 **** bool m_typesRegistered; // Is the binding registered - int m_startTag; // The first wxLua allocated lua tag - int m_lastTag; // The last wxLua lua tag of registered classes int m_functionTag; // The lua tag for function objects. - int m_wxLuaTable; // The lua tag for the wxLua private tables int m_wxLuaNull; // The lua tag for wxLuaNull (for NULL pointers) int m_wxDeleteTable; // The lua tag for the wxWindow destroy tracking table ! wxEventType m_inEventType; // wxEventType set when in event, else -1 wxHashTable* m_pDerivedList; // derived objects. --- 80,88 ---- bool m_typesRegistered; // Is the binding registered int m_functionTag; // The lua tag for function objects. int m_wxLuaNull; // The lua tag for wxLuaNull (for NULL pointers) int m_wxDeleteTable; // The lua tag for the wxWindow destroy tracking table ! wxEventType m_inEventType; // wxEventType set when in event, else wxEVT_NULL wxHashTable* m_pDerivedList; // derived objects. *************** *** 113,116 **** --- 110,114 ---- { WXLUASTATE_ATTACH = 1, // Attach to a currently created lua_State + // refing the existing wxLuaStateRefData WXLUASTATE_SETSTATE = 2 // Only set the lua_State and don't close it // when destroyed *************** *** 136,145 **** bool Create(wxLuaStateRefData* refData); ! // Is this wxLuaState valid, has refed data bool Ok() const; // Destroy the refed data void Destroy() { UnRef(); } ! // bool CloseLuaState(bool force); --- 134,144 ---- bool Create(wxLuaStateRefData* refData); ! // Is this wxLuaState valid, has refed data and it's lua_State is created bool Ok() const; // Destroy the refed data void Destroy() { UnRef(); } ! // Close the lua_State and if 'force' close all attached wxWindows ! // if not force then popup dialog to ask if windows should be destroyed. bool CloseLuaState(bool force); *************** *** 149,152 **** --- 148,155 ---- wxLuaStateRefData* GetLuaStateRefData() const { return (wxLuaStateRefData*)GetRefData(); } + + // Get the wxEventType currently + wxEventType GetInEventType() const; + // ----------------------------------------------------------------------- // Binding functions *************** *** 160,173 **** const WXLUACLASS * GetBaseLuaClass(int iClassTag); bool IsDerivedClass(int iClassTag, int iBaseClassTag); - const WXLUAEVENT * GetLuaEvent(wxEvent *pEvent); void GarbageCollectWindows(bool closeWindows); // ----------------------------------------------------------------------- // memory tracking functions ! bool removeTrackedMemory(void *pObject, bool fDelete); void addToTrackedMemoryList(wxObject *pObject); ! void addToTrackedWindowList(wxWindow *); // ----------------------------------------------------------------------- --- 163,186 ---- const WXLUACLASS * GetBaseLuaClass(int iClassTag); bool IsDerivedClass(int iClassTag, int iBaseClassTag); const WXLUAEVENT * GetLuaEvent(wxEvent *pEvent); void GarbageCollectWindows(bool closeWindows); + // Get the binding list used to initialize this class + wxLuaBindingList* GetLuaBindingList() const; + bool GetTypesRegistered() const; // Is the binding registered + int GetLuaFunctionTag() const; // The lua tag for function objects. + int GetLuaNull() const; // The lua tag for wxLuaNull (for NULL pointers) + int GetLuaDeleteTable() const; // The lua tag for the wxWindow destroy tracking table + // ----------------------------------------------------------------------- // memory tracking functions ! void addToTrackedMemoryList(wxObject *pObject); ! bool removeTrackedMemory(void *pObject, bool fDelete); ! ! void addToTrackedWindowList(wxWindow *win); ! void removeTrackedWindow(wxWindow *win); ! bool isWindowTracked(wxWindow *win) const; // ----------------------------------------------------------------------- *************** *** 202,205 **** --- 215,222 ---- // wxLua get data type + // push the string onto the stack + void tpushliteralstring(const char *str, size_t len); + void tpushstring(const char *str); + // Return a pointer to the object that corresponds to the specified stack // index and tag Index: internal.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/internal.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** internal.h 28 Nov 2005 01:28:54 -0000 1.9 --- internal.h 28 Nov 2005 06:05:08 -0000 1.10 *************** *** 29,34 **** // with standard lua functions. - #define WXLUAREFERENCES "wxLuaReferences" - #define wxFileRead read #define wxFileWrite write --- 29,32 ---- *************** *** 87,91 **** // ---------------------------------------------------------------------------- ! #define DECLARE_ENCAPSULATION(theObject) \ class theObject; \ void LUACALL addToTrackedMemoryList(lua_State *, theObject *); \ --- 85,89 ---- // ---------------------------------------------------------------------------- ! #define wxLUA_DECLARE_ENCAPSULATION(theObject) \ class theObject; \ void LUACALL addToTrackedMemoryList(lua_State *, theObject *); \ *************** *** 99,103 **** }; ! #define IMPLEMENT_ENCAPSULATION(theObject) \ theObject##Object::theObject##Object(theObject *p##theObject) : \ m_p##theObject(p##theObject) \ --- 97,101 ---- }; ! #define wxLUA_IMPLEMENT_ENCAPSULATION(theObject) \ theObject##Object::theObject##Object(theObject *p##theObject) : \ m_p##theObject(p##theObject) \ *************** *** 113,118 **** wxLuaState wxlState(L); \ wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); \ - if (wxlState.GetLuaStateRefData()->m_pTrackedList == NULL) \ - wxlState.GetLuaStateRefData()->m_pTrackedList = new wxHashTable(wxKEY_INTEGER); \ wxlState.GetLuaStateRefData()->m_pTrackedList->Put((int)p##theObject, new theObject##Object(p##theObject)); \ } --- 111,114 ---- *************** *** 188,191 **** --- 184,191 ---- }; + // ---------------------------------------------------------------------------- + // wxLuaTreeItemData + // ---------------------------------------------------------------------------- + class wxLuaTreeItemData : public wxTreeItemData { *************** *** 295,304 **** // if pClass is non-null set the upvalue of the function to the supplied class bool LUACALL tsettagmethod(lua_State *L, int tag, const char *method, lua_CFunction func, void *pClass = NULL); - #define tpushliteralstring(L, n) \ - lua_pushlstring(L, n, sizeof(n)-1) #define TLUA_NOTAG 0 class WXDLLIMPEXP_WXLUA wxLuaCheckStack { --- 295,310 ---- // if pClass is non-null set the upvalue of the function to the supplied class bool LUACALL tsettagmethod(lua_State *L, int tag, const char *method, lua_CFunction func, void *pClass = NULL); + // push the wxLuaReferences string onto the stack + void LUACALL tpushwxLuaReferences(lua_State *L); + // push the wxLuaNull string onto the stack + void LUACALL tpushwxLuaNull(lua_State *L); #define TLUA_NOTAG 0 + // ---------------------------------------------------------------------------- + // wxLuaCheckStack - dumps the contents of the lua_State + // ---------------------------------------------------------------------------- + class WXDLLIMPEXP_WXLUA wxLuaCheckStack { *************** *** 353,357 **** }; - // ---------------------------------------------------------------------------- // Used to create a set of standard bitmaps for wxLua --- 359,362 ---- |