From: John L. <jr...@us...> - 2005-11-25 02:43:10
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25355/wxLua/modules/wxlua/include Modified Files: internal.h wxlua.h Removed Files: callback.h defs.h interp.h library.h Log Message: started to break up internal.cpp into wxlstate, wxlcallb... rename library.h/cpp to wxlhandl since it only contains wxLuaHandler remove wxLuaApp code, it doesn't exist anymore compiles and runs in linux --- defs.h DELETED --- --- callback.h DELETED --- --- interp.h DELETED --- Index: wxlua.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlua.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxlua.h 18 Jun 2005 20:45:59 -0000 1.3 --- wxlua.h 25 Nov 2005 02:43:02 -0000 1.4 *************** *** 10,44 **** #define WX_LUA_H - extern "C" - { - #include "lua/include/lua.h" - #include "lua/include/lualib.h" - #include "lua/include/lauxlib.h" - } - - #include "wxlua/include/defs.h" - - // If you're using stdcall in Lua, then override this with - // "LUACALL = __stdcall" in your makefile or project. - #ifndef LUACALL - #define LUACALL - #endif - - // Two cases where you might multiply call RegisterWxLua: - // 1. You have several lua_State values. Then registerTypes - // should always be true. - // 2. You have only one lua_State, but have swapped out - // the global table. Then you want to set registerTypes to false - // for second and subsequent registrations. - int LUACALL RegisterWxLuaFunctions(lua_State *L, bool registerTypes = true); ! // Call this on application exit, to let wxLua tidy up ! void LUACALL CleanupWxLua(lua_State *L, bool closeLua = true); ! ! // Given a lua tag, return the corresponding tag name ! const char * LUACALL GetLuaTagName(lua_State *L, int nTag); - // Used to create a set of standard bitmaps for wxLua - int LUACALL CreateStandaloneBitmaps(lua_State *luaState); #endif // WX_LUA_H --- 10,16 ---- #define WX_LUA_H ! #include "wxlua/include/internal.h" #endif // WX_LUA_H --- library.h DELETED --- Index: internal.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/internal.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** internal.h 17 Nov 2005 05:51:20 -0000 1.4 --- internal.h 25 Nov 2005 02:43:02 -0000 1.5 *************** *** 15,21 **** #include "wx/treectrl.h" ! #include "wxlua/include/defs.h" #include "wxlua/include/wxlua.h" ! #include "wxlua/include/interp.h" extern "C" --- 15,22 ---- #include "wx/treectrl.h" ! #include "wxlua/include/wxldefs.h" ! #include "wxlua/include/wxlbind.h" #include "wxlua/include/wxlua.h" ! #include "wxlua/include/wxlintrp.h" extern "C" *************** *** 45,190 **** // ---------------------------------------------------------------------------- - // wxLua type enums and structs - // ---------------------------------------------------------------------------- - - enum LuaType // The type of a Lua method - { - LuaDelete = 1, // gc routine - LuaConstructor = 2, // constructor - LuaDestructor = 4, // destructor (not used) - LuaMethod = 8, // class method - LuaGlobal = 16, // global method (not really related to the class) - LuaGetProp = 32, - LuaSetProp = 64 - }; - - struct WXLUAMETHOD // defines a LUA method or property - { - LuaType type; // type (one of the above enumeration values) - const char *name; // name of the method or property - lua_CFunction func; // function that implements the method or property - int params; // number of params to the method (required + optional) - int required; // number of required params - }; - - struct WXLUACLASS // defines a LUA class interface - { - const char *name; // name of the class - WXLUAMETHOD *methods; // pointer to methods for this class - int num_methods; // number of methods - int baseclass_tag; // index in the class list to the base class - wxClassInfo *pClassInfo; // pointer to the wxClassInfo associated with this class - int *class_tag; // tag for user data allocated by ourselves - // and therefore needs gc. - const char *baseclass; // name of base class - }; - - struct WXLUADEFINE // defines a wxWidgets define for wxLua - { - const char *name; // name - bool isString; // true if a string definition FIXME use WXLUASTRING - double value; // numeric value - const wxChar *strValue; // string value - }; - - struct WXLUASTRING // defines a wxWidgets define for wxLua - { - const char *name; // name - const wxChar *value; // string value - }; - - struct WXLUAEVENT // defines a wxWidgets Event for wxLua - { - const int *eventType; // new wxWidgets event type - const char *eventName; // name of the event - int *eventClassTag; // lua class tag - }; - - struct WXLUAOBJECT // Defines a wxWidgets object or pointer for wxLua - { - const void *objPtr; // a pointer to the object or pointer - const void **pObjPtr; // a pointer to the object or pointer - const char *objName; // the name of the object or pointer - int *objClassTag; // the class tag of the object or pointer. - }; - - 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 &); - - class WXDLLIMPEXP_WXLUA wxLuaBinding : public wxObject - { - public: - wxLuaBinding(); - - // lua namespace e.g. "wx" - wxString nameSpace; - - // Pointers to external Binding Functions - GetClassListFunction pfGetClassList; - GetDefineListFunction pfGetDefineList; - GetEventListFunction pfGetEventList; - GetObjectListFunction pfGetObjectList; - GetBuiltinListFunction pfGetBuiltinList; - - // Registers binding - void RegisterBinding(lua_State *L, bool registerTypes); - void UnRegisterBinding(lua_State *L); - - // - size_t GetLuaClassCount() const { return m_classCount; } - WXLUACLASS* GetLuaClassList() { return m_classList; } - - size_t GetLuaDefineCount() const { return m_defineCount; } - WXLUADEFINE* GetLuaDefineList() { return m_defineList; } - - size_t GetLuaEventCount() { return m_eventCount; } - WXLUAEVENT* GetLuaEventList() { return m_eventList; } - - size_t GetLuaObjectCount() { return m_objectCount; } - WXLUAOBJECT* GetLuaObjectList() { return m_objectList; } - - size_t GetLuaBuiltinCount() { return m_builtinCount; } - WXLUAMETHOD* GetLuaBuiltinList() { return m_builtinList; } - - bool IsTag(int tag) { return (tag >= m_startTag && tag <= m_lastTag); } - - // Look for base class WXDLLIMPEXP_CDLUA in binding, set baseclass_tag - bool SetBaseClassTag(WXLUACLASS *pClass); - - protected: - int LUACALL RegisterFunctions(lua_State *L, bool registerTypes); - void LUACALL RegisterGeneratedClasses(lua_State *L, int tableOffset, bool registerTypes); - - virtual void OnRegister(lua_State * WXUNUSED(L), bool WXUNUSED(registerTypes), int WXUNUSED(luaTable)) {} - - // 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; - - 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_wxLuaTable; // The lua tag for the wxLua private tables - - DECLARE_CLASS(wxLuaBinding) - }; - - // list of wxLua Bindings - // WX_DECLARE_LIST(wxLuaBinding, wxLuaBindingList); - WX_DECLARE_USER_EXPORTED_LIST(wxLuaBinding, wxLuaBindingList, WXDLLIMPEXP_WXLUA); - - // ---------------------------------------------------------------------------- // wxLuaStateVariables - state variables for a wxLua instance // ---------------------------------------------------------------------------- --- 46,49 ---- *************** *** 195,199 **** wxLuaStateVariables(); ~wxLuaStateVariables(); ! void ClearCallbacks(); --- 54,58 ---- wxLuaStateVariables(); ~wxLuaStateVariables(); ! void ClearCallbacks(); *************** *** 217,221 **** int m_functionTag; // The lua tag for function objects. int m_wxLuaTable; // The lua tag for the wxLua private tables ! int m_wxNull; // The lua tag for wxNull (for NULL pointers) int m_wxDeleteTable; // The lua tag for the wxWindow destroy tracking table --- 76,80 ---- 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 *************** *** 225,229 **** wxHashTable *m_pTrackedList; // The list of tracked objects. wxList *m_pAppHandlerList; // The list of event objects associated with the application object ! wxList *m_pDestroyHandlerList; // The list of wxLuaDestroyCallbacks installed wxList *m_pWindowList; // The list of all wxWindow objects, wxWidgets will delete these // but for an embedded program they must be deleted before --- 84,88 ---- wxHashTable *m_pTrackedList; // The list of tracked objects. wxList *m_pAppHandlerList; // The list of event objects associated with the application object ! wxList *m_pDestroyHandlerList; // The list of wxLuaDestroyCallbacks installed wxList *m_pWindowList; // The list of all wxWindow objects, wxWidgets will delete these // but for an embedded program they must be deleted before *************** *** 248,251 **** --- 107,113 ---- wxCHECK_RET(stateVars, wxT("invalid wxLuaInterpreter")); + // Call this on application exit, to let wxLua tidy up + void LUACALL CleanupWxLua(lua_State *L, bool closeLua = true); + // ---------------------------------------------------------------------------- // SmartStringArray - A class to wrap an array of wxStrings with an *************** *** 436,439 **** --- 298,304 ---- int LUACALL callFunction(lua_State *L); + // Given a lua tag, return the corresponding tag name + const char * LUACALL GetLuaTagName(lua_State *L, int nTag); + // global function in Lua for wiring int LUACALL ConnectEvent(lua_State *L); *************** *** 540,543 **** --- 405,413 ---- }; + + // ---------------------------------------------------------------------------- + // Used to create a set of standard bitmaps for wxLua + int LUACALL CreateStandaloneBitmaps(lua_State *luaState); + // ---------------------------------------------------------------------------- // String functions - convert between Lua (ansi string) and wxString (encoded) *************** *** 549,553 **** if (luastr == NULL) return wxEmptyString; ! return wxConvertMB2WX(luastr); } --- 419,423 ---- if (luastr == NULL) return wxEmptyString; ! return wxConvertMB2WX(luastr); } |