From: John L. <jr...@us...> - 2007-12-05 05:54:17
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20622/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxlstate.h Log Message: Rename wxLuaBinding/wxLuaState::GetLuaClass() to GetBindClass() since it gets the wxLuaBindClass struct Moved the code for searching the binding classes to static functions of wxLuaBinding to keep the code together with the wxLuaBinding class Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** wxlbind.h 5 Dec 2007 00:34:46 -0000 1.67 --- wxlbind.h 5 Dec 2007 05:54:11 -0000 1.68 *************** *** 406,425 **** void SetLuaNamespace(const wxString& nameSpace) { m_nameSpace = nameSpace; } ! size_t GetClassCount() const { return m_classCount; } ! wxLuaBindClass* GetClassArray() { return m_classArray; } ! size_t GetDefineCount() const { return m_defineCount; } ! wxLuaBindDefine* GetDefineArray() { return m_defineArray; } ! size_t GetStringCount() const { return m_stringCount; } ! wxLuaBindString* GetStringArray() { return m_stringArray; } ! size_t GetEventCount() { return m_eventCount; } ! wxLuaBindEvent* GetEventArray() { return m_eventArray; } ! size_t GetObjectCount() { return m_objectCount; } ! wxLuaBindObject* GetObjectArray() { return m_objectArray; } ! size_t GetFunctionCount() { return m_functionCount; } wxLuaBindMethod* GetFunctionArray() { return m_functionArray; } --- 406,425 ---- void SetLuaNamespace(const wxString& nameSpace) { m_nameSpace = nameSpace; } ! size_t GetClassCount() const { return m_classCount; } ! wxLuaBindClass* GetClassArray() { return m_classArray; } ! size_t GetDefineCount() const { return m_defineCount; } ! wxLuaBindDefine* GetDefineArray() { return m_defineArray; } ! size_t GetStringCount() const { return m_stringCount; } ! wxLuaBindString* GetStringArray() { return m_stringArray; } ! size_t GetEventCount() const { return m_eventCount; } ! wxLuaBindEvent* GetEventArray() { return m_eventArray; } ! size_t GetObjectCount() const { return m_objectCount; } ! wxLuaBindObject* GetObjectArray() { return m_objectArray; } ! size_t GetFunctionCount() const { return m_functionCount; } wxLuaBindMethod* GetFunctionArray() { return m_functionArray; } *************** *** 437,452 **** // Find the wxLuaBindEvent with the wxEventType, returns NULL if not found. ! const wxLuaBindEvent* GetEvent(wxEventType eventType) const; // Look up the event type name as a string, from the wxEventType number // in the wxLuaBindEvent* struct list of this binding. wxString GetEventTypeName(wxEventType eventType) const; // Get the wxLuaBindClass that has this tag, or NULL if none ! const wxLuaBindClass* GetLuaClass(int class_tag) const; // Get the first wxLuaBindClass that has this wxLuaBindMethod ! const wxLuaBindClass* GetLuaClass(const wxLuaBindMethod* wxlMethod) const; // Get the first wxLuaBindClass that has this wxLuaBindCFunc ! const wxLuaBindClass* GetLuaClass(const wxLuaBindCFunc* wxlMethod_cfunc) const; // ----------------------------------------------------------------------- // Lookup a Lua method or get property called methodName in the wxLuaBindClass array wxlClass. --- 437,476 ---- // Find the wxLuaBindEvent with the wxEventType, returns NULL if not found. ! const wxLuaBindEvent* GetBindEvent(wxEventType eventType) const; // Look up the event type name as a string, from the wxEventType number // in the wxLuaBindEvent* struct list of this binding. wxString GetEventTypeName(wxEventType eventType) const; // Get the wxLuaBindClass that has this tag, or NULL if none ! const wxLuaBindClass* GetBindClass(int class_tag) const; // Get the first wxLuaBindClass that has this wxLuaBindMethod ! const wxLuaBindClass* GetBindClass(const wxLuaBindMethod* wxlMethod) const; // Get the first wxLuaBindClass that has this wxLuaBindCFunc ! const wxLuaBindClass* GetBindClass(const wxLuaBindCFunc* wxlMethod_cfunc) const; // ----------------------------------------------------------------------- + // These functions search through the input wxLuaBindingList or if NULL + // the static wxLuaBinding::GetBindingList(). + + // Get the installed wxLuaBinding with the given + // wxLuaBinding::GetBindingName() or NULL for no match. + static wxLuaBinding* GetLuaBinding(const wxString& bindingName, const wxLuaBindingList* bindingList); + + // Get wxLuaBindClass for given Lua Tag using wxLuaBindClass::class_tag, + // returns NULL on failure. + static const wxLuaBindClass* GetBindClass(int class_tag, const wxLuaBindingList* bindingList); + // Get the first wxLuaBindClass that has this particular wxLuaBindMethod + // returns NULL on failure. + static const wxLuaBindClass* GetBindClass(const wxLuaBindMethod* method, const wxLuaBindingList* bindingList); + // Get the first wxLuaBindClass that has this particular wxLuaBindCFunc in it's methods + // returns NULL on failure. + static const wxLuaBindClass* GetBindClass(const wxLuaBindCFunc* method_cfunc, const wxLuaBindingList* bindingList); + + // Get wxLuaBindEvent for given wxEventType (wxEvent::GetEventType()) by finding + // the matching wxLuaBindEvent::eventType. + // returns NULL on failure. + static const wxLuaBindEvent* GetBindEvent(wxEventType eventType_, const wxLuaBindingList* bindingList); + + // ----------------------------------------------------------------------- + // These functions search through the input struct // Lookup a Lua method or get property called methodName in the wxLuaBindClass array wxlClass. *************** *** 464,467 **** --- 488,493 ---- static wxLuaBindMethod* GetClassProperty(const wxLuaBindClass *wxlClass, const char *propName, bool isLuaSetProp); + // ----------------------------------------------------------------------- + // Get all the bindings that were initialized using the generated binding // function wxLuaBinding_[binding name]_init(). *************** *** 470,475 **** static wxLuaBindingList* GetBindingList() { return &sm_bindingList; } ! // Initialize all of the bindings by iterating the GetBindingList() and // setting the base classes and base class functions. This function // is automatically run by the wxLuaState and should not ever need to be called. --- 496,502 ---- static wxLuaBindingList* GetBindingList() { return &sm_bindingList; } + // ----------------------------------------------------------------------- ! // Initialize all of the bindings by iterating the GetBindingList() and // setting the base classes and base class functions. This function // is automatically run by the wxLuaState and should not ever need to be called. Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** wxlstate.h 5 Dec 2007 00:34:46 -0000 1.99 --- wxlstate.h 5 Dec 2007 05:54:11 -0000 1.100 *************** *** 103,111 **** extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_objects_key; // The key in the LUA_REGISTRYINDEX table that is table of all ! // wxLuaCallbacks that we've created. // t[lightuserdata wxLuaCallback] = lightuserdata wxEvtHandler extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_evtcallbacks_key; // The key in the LUA_REGISTRYINDEX table that is table of all ! // wxLuaWinDestroyCallbacks that we've created. // t[lightuserdata wxLuaWinDestroyCallback] = 1 (the number 1) // t[lightuserdata wxWindow] = lightuserdata wxLuaWinDestroyCallback --- 103,111 ---- extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_objects_key; // The key in the LUA_REGISTRYINDEX table that is table of all ! // wxLuaCallbacks that we've created. // t[lightuserdata wxLuaCallback] = lightuserdata wxEvtHandler extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_evtcallbacks_key; // The key in the LUA_REGISTRYINDEX table that is table of all ! // wxLuaWinDestroyCallbacks that we've created. // t[lightuserdata wxLuaWinDestroyCallback] = 1 (the number 1) // t[lightuserdata wxWindow] = lightuserdata wxLuaWinDestroyCallback *************** *** 601,612 **** // Get wxLuaBindClass for given Lua Tag using wxLuaBindClass::class_tag, // returns NULL on failure. ! const wxLuaBindClass* GetLuaClass(int iClassTag) const; // Get wxLuaBindClass for given class name using wxLuaBindClass::name, // returns NULL on failure. ! const wxLuaBindClass* GetLuaClass(const char* className) const; // Get the first wxLuaBindClass that has this particular wxLuaBindMethod ! const wxLuaBindClass* GetLuaClass(const wxLuaBindMethod* method) const; // Get the first wxLuaBindClass that has this particular wxLuaBindCFunc in it's methods ! const wxLuaBindClass* GetLuaClass(const wxLuaBindCFunc* method_cfunc) const; // returns >= 0 if iClassTag is derived from or equal to iBaseClassTag by using // wxLuaBindClass::class_tag and wxLuaBindClass::baseclass_tag. --- 601,614 ---- // Get wxLuaBindClass for given Lua Tag using wxLuaBindClass::class_tag, // returns NULL on failure. ! const wxLuaBindClass* GetBindClass(int iClassTag) const; // Get wxLuaBindClass for given class name using wxLuaBindClass::name, // returns NULL on failure. ! const wxLuaBindClass* GetBindClass(const char* className) const; // Get the first wxLuaBindClass that has this particular wxLuaBindMethod ! // returns NULL on failure. ! const wxLuaBindClass* GetBindClass(const wxLuaBindMethod* method) const; // Get the first wxLuaBindClass that has this particular wxLuaBindCFunc in it's methods ! // returns NULL on failure. ! const wxLuaBindClass* GetBindClass(const wxLuaBindCFunc* method_cfunc) const; // returns >= 0 if iClassTag is derived from or equal to iBaseClassTag by using // wxLuaBindClass::class_tag and wxLuaBindClass::baseclass_tag. *************** *** 616,620 **** // Get wxLuaBindEvent for given wxEventType (wxEvent::GetEventType()) by finding // the matching wxLuaBindEvent::eventType. ! const wxLuaBindEvent* GetLuaEvent(wxEventType eventType) const; // Get the wxLuaBinding list of classes/objects installed into Lua. --- 618,622 ---- // Get wxLuaBindEvent for given wxEventType (wxEvent::GetEventType()) by finding // the matching wxLuaBindEvent::eventType. ! const wxLuaBindEvent* GetBindEvent(wxEventType eventType) const; // Get the wxLuaBinding list of classes/objects installed into Lua. |