From: John L. <jr...@us...> - 2007-06-06 23:43:50
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4156/wxLua/modules/wxbindstc/src Modified Files: stc.cpp wxstc_bind.cpp Log Message: Rename structs WXLUACLASS, WXLUAMETHOD, WXLUADEFINE, WXLUASTRING, WXLUAEVENT to wxLuaBindClass, wxLuaBindMethod, wxLuaBindDefine, wxLuaBindString, wxLuaBindEvent Fix %renamed listCtrl:SetItemString to now use overload SetItem Fix recursion in traversing the base class methods Add IntArray_FromLuaTable for binding generator to do (int n, int* items) from a table Use NULL in bindings for items that are *pointers for clarity Use sizeof(struct name) instead of sizeof(array[0]) in bindings Rename wxLuaBinding GetLuaClassList to just GetClassArray since it's a C array Index: wxstc_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/wxstc_bind.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wxstc_bind.cpp 31 May 2007 17:18:54 -0000 1.21 --- wxstc_bind.cpp 6 Jun 2007 23:43:15 -0000 1.22 *************** *** 24,30 **** // --------------------------------------------------------------------------- ! WXLUAEVENT* wxLuaGetEventList_wxstc(size_t &count) { ! static WXLUAEVENT eventList[] = { { &wxEVT_STC_AUTOCOMP_SELECTION, "wxEVT_STC_AUTOCOMP_SELECTION", &s_wxluatag_wxStyledTextEvent }, --- 24,30 ---- // --------------------------------------------------------------------------- ! wxLuaBindEvent* wxLuaGetEventList_wxstc(size_t &count) { ! static wxLuaBindEvent eventList[] = { { &wxEVT_STC_AUTOCOMP_SELECTION, "wxEVT_STC_AUTOCOMP_SELECTION", &s_wxluatag_wxStyledTextEvent }, *************** *** 62,66 **** { 0, 0, 0 }, }; ! count = (sizeof(eventList)/sizeof(eventList[0])) - 1; return eventList; } --- 62,66 ---- { 0, 0, 0 }, }; ! count = sizeof(eventList)/sizeof(wxLuaBindEvent) - 1; return eventList; } *************** *** 70,76 **** // --------------------------------------------------------------------------- ! WXLUADEFINE* wxLuaGetDefineList_wxstc(size_t &count) { ! static WXLUADEFINE defineList[] = { { "wxSTC_ADA_CHARACTER", wxSTC_ADA_CHARACTER }, --- 70,76 ---- // --------------------------------------------------------------------------- ! wxLuaBindDefine* wxLuaGetDefineList_wxstc(size_t &count) { ! static wxLuaBindDefine defineList[] = { { "wxSTC_ADA_CHARACTER", wxSTC_ADA_CHARACTER }, *************** *** 1433,1437 **** { 0, 0 }, }; ! count = (sizeof(defineList)/sizeof(defineList[0])) - 1; return defineList; } --- 1433,1437 ---- { 0, 0 }, }; ! count = sizeof(defineList)/sizeof(wxLuaBindDefine) - 1; return defineList; } *************** *** 1442,1453 **** // --------------------------------------------------------------------------- ! WXLUASTRING* wxLuaGetStringList_wxstc(size_t &count) { ! static WXLUASTRING stringList[] = { { 0, 0 }, }; ! count = (sizeof(stringList)/sizeof(stringList[0])) - 1; return stringList; } --- 1442,1453 ---- // --------------------------------------------------------------------------- ! wxLuaBindString* wxLuaGetStringList_wxstc(size_t &count) { ! static wxLuaBindString stringList[] = { { 0, 0 }, }; ! count = sizeof(stringList)/sizeof(wxLuaBindString) - 1; return stringList; } *************** *** 1457,1468 **** // --------------------------------------------------------------------------- ! WXLUAOBJECT* wxLuaGetObjectList_wxstc(size_t &count) { ! static WXLUAOBJECT objectList[] = { { 0, 0, 0, 0 }, }; ! count = (sizeof(objectList)/sizeof(objectList[0])) - 1; return objectList; } --- 1457,1468 ---- // --------------------------------------------------------------------------- ! wxLuaBindObject* wxLuaGetObjectList_wxstc(size_t &count) { ! static wxLuaBindObject objectList[] = { { 0, 0, 0, 0 }, }; ! count = sizeof(objectList)/sizeof(wxLuaBindObject) - 1; return objectList; } *************** *** 1476,1487 **** // --------------------------------------------------------------------------- ! WXLUAMETHOD* wxLuaGetFunctionList_wxstc(size_t &count) { ! static WXLUAMETHOD functionList[] = { ! { WXLUAMETHOD_CFUNCTION, 0, 0, 0 }, }; ! count = (sizeof(functionList)/sizeof(functionList[0])) - 1; return functionList; } --- 1476,1487 ---- // --------------------------------------------------------------------------- ! wxLuaBindMethod* wxLuaGetFunctionList_wxstc(size_t &count) { ! static wxLuaBindMethod functionList[] = { ! { 0, 0, 0, 0 }, }; ! count = sizeof(functionList)/sizeof(wxLuaBindMethod) - 1; return functionList; } *************** *** 1493,1499 **** // --------------------------------------------------------------------------- ! WXLUACLASS* wxLuaGetClassList_wxstc(size_t &count) { ! static WXLUACLASS classList[] = { { "wxStyledTextCtrl", wxStyledTextCtrl_methods, wxStyledTextCtrl_methodCount, CLASSINFO(wxStyledTextCtrl), &s_wxluatag_wxStyledTextCtrl, "wxControl", NULL ,wxStyledTextCtrl_enums, wxStyledTextCtrl_enumCount, }, --- 1493,1499 ---- // --------------------------------------------------------------------------- ! wxLuaBindClass* wxLuaGetClassList_wxstc(size_t &count) { ! static wxLuaBindClass classList[] = { { "wxStyledTextCtrl", wxStyledTextCtrl_methods, wxStyledTextCtrl_methodCount, CLASSINFO(wxStyledTextCtrl), &s_wxluatag_wxStyledTextCtrl, "wxControl", NULL ,wxStyledTextCtrl_enums, wxStyledTextCtrl_enumCount, }, *************** *** 1502,1506 **** { 0, 0, 0, 0, 0, 0, 0 }, }; ! count = (sizeof(classList)/sizeof(classList[0])) - 1; return classList; --- 1502,1506 ---- { 0, 0, 0, 0, 0, 0, 0 }, }; ! count = sizeof(classList)/sizeof(wxLuaBindClass) - 1; return classList; *************** *** 1513,1522 **** // binding class ! extern WXLUACLASS *wxLuaGetClassList_wxstc(size_t &count); ! extern WXLUADEFINE *wxLuaGetDefineList_wxstc(size_t &count); ! extern WXLUASTRING *wxLuaGetStringList_wxstc(size_t &count); ! extern WXLUAEVENT *wxLuaGetEventList_wxstc(size_t &count); ! extern WXLUAOBJECT *wxLuaGetObjectList_wxstc(size_t &count); ! extern WXLUAMETHOD *wxLuaGetFunctionList_wxstc(size_t &count); --- 1513,1522 ---- // binding class ! extern wxLuaBindClass *wxLuaGetClassList_wxstc(size_t &count); ! extern wxLuaBindDefine *wxLuaGetDefineList_wxstc(size_t &count); ! extern wxLuaBindString *wxLuaGetStringList_wxstc(size_t &count); ! extern wxLuaBindEvent *wxLuaGetEventList_wxstc(size_t &count); ! extern wxLuaBindObject *wxLuaGetObjectList_wxstc(size_t &count); ! extern wxLuaBindMethod *wxLuaGetFunctionList_wxstc(size_t &count); *************** *** 1525,1536 **** wxLuaBinding_wxstc::wxLuaBinding_wxstc() : wxLuaBinding() { ! m_bindingName = wxT("wxstc"); ! m_nameSpace = wxT("wx"); ! m_classList = wxLuaGetClassList_wxstc(m_classCount); ! m_defineList = wxLuaGetDefineList_wxstc(m_defineCount); ! m_stringList = wxLuaGetStringList_wxstc(m_stringCount); ! m_eventList = wxLuaGetEventList_wxstc(m_eventCount); ! m_objectList = wxLuaGetObjectList_wxstc(m_objectCount); ! m_functionList = wxLuaGetFunctionList_wxstc(m_functionCount); } --- 1525,1536 ---- wxLuaBinding_wxstc::wxLuaBinding_wxstc() : wxLuaBinding() { ! m_bindingName = wxT("wxstc"); ! m_nameSpace = wxT("wx"); ! m_classArray = wxLuaGetClassList_wxstc(m_classCount); ! m_defineArray = wxLuaGetDefineList_wxstc(m_defineCount); ! m_stringArray = wxLuaGetStringList_wxstc(m_stringCount); ! m_eventArray = wxLuaGetEventList_wxstc(m_eventCount); ! m_objectArray = wxLuaGetObjectList_wxstc(m_objectCount); ! m_functionArray = wxLuaGetFunctionList_wxstc(m_functionCount); } Index: stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/stc.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** stc.cpp 6 Jun 2007 03:53:39 -0000 1.34 --- stc.cpp 6 Jun 2007 23:43:14 -0000 1.35 *************** *** 27,33 **** int s_wxluatag_wxStyledTextCtrl = -1; ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_AddRefDocument[] = { &s_wxluatag_wxStyledTextCtrl, &s_wxluaarg_LightUserData, 0 }; static int LUACALL wxLua_wxStyledTextCtrl_AddRefDocument(lua_State *L); ! static WXLUAMETHOD_CFUNC s_wxluafunc_wxLua_wxStyledTextCtrl_AddRefDocument[1] = {{ wxLua_wxStyledTextCtrl_AddRefDocument, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxStyledTextCtrl_AddRefDocument }}; // void AddRefDocument(void* docPointer); --- 27,33 ---- int s_wxluatag_wxStyledTextCtrl = -1; [...9600 lines suppressed...] ! { WXLUAMETHOD_METHOD, "SetModificationType", s_wxluafunc_wxLua_wxStyledTextEvent_SetModificationType, 1, NULL }, ! { WXLUAMETHOD_METHOD, "SetModifiers", s_wxluafunc_wxLua_wxStyledTextEvent_SetModifiers, 1, NULL }, ! { WXLUAMETHOD_METHOD, "SetPosition", s_wxluafunc_wxLua_wxStyledTextEvent_SetPosition, 1, NULL }, ! { WXLUAMETHOD_METHOD, "SetText", s_wxluafunc_wxLua_wxStyledTextEvent_SetText, 1, NULL }, ! { WXLUAMETHOD_METHOD, "SetWParam", s_wxluafunc_wxLua_wxStyledTextEvent_SetWParam, 1, NULL }, ! { WXLUAMETHOD_METHOD, "SetX", s_wxluafunc_wxLua_wxStyledTextEvent_SetX, 1, NULL }, ! { WXLUAMETHOD_METHOD, "SetY", s_wxluafunc_wxLua_wxStyledTextEvent_SetY, 1, NULL }, ! { WXLUAMETHOD_CONSTRUCTOR, "wxStyledTextEvent", s_wxluafunc_wxLua_wxStyledTextEvent_constructor, 1, NULL }, ! { 0, 0, 0, 0 }, }; ! int wxStyledTextEvent_methodCount = sizeof(wxStyledTextEvent_methods)/sizeof(wxLuaBindMethod) - 1; ! wxLuaBindDefine wxStyledTextEvent_enums[] = { { NULL, 0, }, }; ! int wxStyledTextEvent_enumCount = sizeof(wxStyledTextEvent_enums)/sizeof(wxLuaBindDefine) - 1; |