From: John L. <jr...@us...> - 2007-06-06 23:43:28
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4156/wxLua/bindings Modified Files: genwxbind.lua 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: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** genwxbind.lua 6 Jun 2007 03:46:37 -0000 1.113 --- genwxbind.lua 6 Jun 2007 23:42:53 -0000 1.114 *************** *** 18,22 **** -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 8 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. --- 18,22 ---- -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 9 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. *************** *** 269,272 **** --- 269,273 ---- AllocDataType("wxArrayString_FromLuaTable", "special", true) AllocDataType("wxArrayInt_FromLuaTable", "special", true) + AllocDataType("IntArray_FromLuaTable", "special", true) -- attributes that can precede a data type (must set equal to true) *************** *** 2762,2766 **** overload_argListName = "s_wxluaargArray_None" else ! overload_argList = "{ "..overload_argList.."0 }" end --- 2763,2767 ---- overload_argListName = "s_wxluaargArray_None" else ! overload_argList = "{ "..overload_argList.."NULL }" end *************** *** 2778,2782 **** FuncMap = "{ "..funcName..", WXLUAMETHOD_METHOD, 1, 1, "..overload_argListName.." }", FuncMapName = funcMapName, ! Map = " { WXLUAMETHOD_METHOD, \""..memberGetFunc.."\", "..funcMapName..", 1, 0 },\n", Condition = membercondition } --- 2779,2783 ---- FuncMap = "{ "..funcName..", WXLUAMETHOD_METHOD, 1, 1, "..overload_argListName.." }", FuncMapName = funcMapName, ! Map = " { WXLUAMETHOD_METHOD, \""..memberGetFunc.."\", "..funcMapName..", 1, NULL },\n", Condition = membercondition } *************** *** 2787,2791 **** LuaName = member.Name, FuncType = "WXLUAMETHOD_GETPROP", ! Map = " { WXLUAMETHOD_GETPROP, \""..member.Name.."\", "..funcMapName..", 1, 0 },\n", Condition = membercondition } --- 2788,2792 ---- LuaName = member.Name, FuncType = "WXLUAMETHOD_GETPROP", ! Map = " { WXLUAMETHOD_GETPROP, \""..member.Name.."\", "..funcMapName..", 1, NULL },\n", Condition = membercondition } *************** *** 2851,2855 **** overload_argListName = "s_wxluaargArray_None" else ! overload_argList = "{ "..overload_argList.."0 }" end --- 2852,2856 ---- overload_argListName = "s_wxluaargArray_None" else ! overload_argList = "{ "..overload_argList.."NULL }" end *************** *** 2867,2871 **** FuncMap = "{ "..funcName..", WXLUAMETHOD_METHOD, 2, 2, "..overload_argListName.." }", -- FIXME make sure this is right FuncMapName = funcMapName, ! Map = " { WXLUAMETHOD_METHOD, \""..memberSetFunc.."\", "..funcMapName..", 1, 0 },\n", Condition = membercondition } --- 2868,2872 ---- FuncMap = "{ "..funcName..", WXLUAMETHOD_METHOD, 2, 2, "..overload_argListName.." }", -- FIXME make sure this is right FuncMapName = funcMapName, ! Map = " { WXLUAMETHOD_METHOD, \""..memberSetFunc.."\", "..funcMapName..", 1, NULL },\n", Condition = membercondition } *************** *** 2876,2880 **** LuaName = member.Name, FuncType = "WXLUAMETHOD_SETPROP", ! Map = " { WXLUAMETHOD_SETPROP, \""..member.Name.."\", "..funcMapName..", 1, 0 },\n", Condition = fullcondition } --- 2877,2881 ---- LuaName = member.Name, FuncType = "WXLUAMETHOD_SETPROP", ! Map = " { WXLUAMETHOD_SETPROP, \""..member.Name.."\", "..funcMapName..", 1, NULL },\n", Condition = fullcondition } *************** *** 2980,2984 **** { LuaName = luaname, ! Map = " { \""..luaname.."\", &s_wxluatag_"..MakeClassVar(parseObject.Name)..", &"..member.Name..", 0 },\n", Condition = fullcondition } --- 2981,2985 ---- { LuaName = luaname, ! Map = " { \""..luaname.."\", &s_wxluatag_"..MakeClassVar(parseObject.Name)..", &"..member.Name..", NULL },\n", Condition = fullcondition } *************** *** 2995,2999 **** { LuaName = luaname, ! Map = " { \""..luaname.."\", &s_wxluatag_"..MakeClassVar(parseObject.Name)..", 0, (const void **) &"..member.Name.." },\n", Condition = fullcondition } --- 2996,3000 ---- { LuaName = luaname, ! Map = " { \""..luaname.."\", &s_wxluatag_"..MakeClassVar(parseObject.Name)..", NULL, (const void **) &"..member.Name.." },\n", Condition = fullcondition } *************** *** 3084,3087 **** --- 3085,3093 ---- argItem = "wxArrayInt(); wxlState.GetwxArrayInt("..argNum..", "..argName..")" declare = "wxArrayInt " + elseif argType == "IntArray_FromLuaTable" then + overload_argList = overload_argList.."&s_wxluaarg_LuaTable, " + argItem = "NULL; ptr = "..argName.." = wxlState.GetIntArray("..argNum..", count_)" + declare = "int count_ = 0; wxLuaSmartIntArray ptr; int*" + argList = argList.."count_, " elseif argType == "LuaTable" then -- THIS MUST BE AN OVERRIDE AND HANDLED THERE, we just set overload_argList *************** *** 3334,3338 **** table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") if member.IsConstructor then ! table.insert(codeList, " wxlua_removetableforcall(L);\n") end table.insert(codeList, " wxLuaState wxlState(L);\n") --- 3340,3344 ---- table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") if member.IsConstructor then ! table.insert(codeList, " wxluabind_removetableforcall(L);\n") end table.insert(codeList, " wxLuaState wxlState(L);\n") *************** *** 3565,3569 **** overload_argListName = "s_wxluaargArray_None" else ! overload_argList = "{ "..overload_argList.."0 }" end --- 3571,3575 ---- overload_argListName = "s_wxluaargArray_None" else ! overload_argList = "{ "..overload_argList.."NULL }" end *************** *** 3571,3575 **** local funcMapName = "s_wxluafunc_"..funcName local funcMap = "{ "..funcName..", "..funcType..", "..tostring(requiredParamCount)..", "..tostring(paramCount)..", "..overload_argListName.." }" ! local methodMap = " { "..funcType..", \""..funcLuaCall.."\", "..funcMapName..", 1, 0 },\n" -- build method condition --- 3577,3581 ---- local funcMapName = "s_wxluafunc_"..funcName local funcMap = "{ "..funcName..", "..funcType..", "..tostring(requiredParamCount)..", "..tostring(paramCount)..", "..overload_argListName.." }" ! local methodMap = " { "..funcType..", \""..funcLuaCall.."\", "..funcMapName..", 1, NULL },\n" -- build method condition *************** *** 3648,3654 **** { ExternDeclaration = "extern "..MakeImpExpData("int").." s_wxluatag_"..MakeClassVar(parseObject.Name)..";\n", ! ExternMethodDeclaration = "extern "..output_cpp_impexpsymbol.." WXLUAMETHOD "..MakeVar(parseObject.Name).."_methods[];\n", ExternMethodCountDeclaration = "extern "..MakeImpExpData("int").." "..MakeVar(parseObject.Name).."_methodCount;\n", ! ExternEnumDeclaration = "extern "..output_cpp_impexpsymbol.." WXLUADEFINE "..MakeVar(parseObject.Name).."_enums[];\n", ExternEnumCountDeclaration = "extern "..MakeImpExpData("int").." "..MakeVar(parseObject.Name).."_enumCount;\n", Condition = tagcondition --- 3654,3660 ---- { ExternDeclaration = "extern "..MakeImpExpData("int").." s_wxluatag_"..MakeClassVar(parseObject.Name)..";\n", ! ExternMethodDeclaration = "extern "..output_cpp_impexpsymbol.." wxLuaBindMethod "..MakeVar(parseObject.Name).."_methods[];\n", ExternMethodCountDeclaration = "extern "..MakeImpExpData("int").." "..MakeVar(parseObject.Name).."_methodCount;\n", ! ExternEnumDeclaration = "extern "..output_cpp_impexpsymbol.." wxLuaBindDefine "..MakeVar(parseObject.Name).."_enums[];\n", ExternEnumCountDeclaration = "extern "..MakeImpExpData("int").." "..MakeVar(parseObject.Name).."_enumCount;\n", Condition = tagcondition *************** *** 3698,3702 **** local overload_argListName = "s_wxluatagArray_".. funcName ! local overload_argList = "{ &s_wxluatag_"..MakeClassVar(parseObject.Name)..", 0 }" local condition = FixCondition(parseObject.Condition) --- 3704,3708 ---- local overload_argListName = "s_wxluatagArray_".. funcName ! local overload_argList = "{ &s_wxluatag_"..MakeClassVar(parseObject.Name)..", NULL }" local condition = FixCondition(parseObject.Condition) *************** *** 3714,3718 **** ParamCount = 1, RequiredParamCount = 1, ! Map = " { WXLUAMETHOD_METHOD, \"Delete\", "..funcMapName..", 1, 0 },\n", Condition = condition } --- 3720,3724 ---- ParamCount = 1, RequiredParamCount = 1, ! Map = " { WXLUAMETHOD_METHOD, \"Delete\", "..funcMapName..", 1, NULL },\n", Condition = condition } *************** *** 4031,4036 **** table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "WXLUACLASS* "..hook_cpp_class_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static WXLUACLASS classList[] =\n {\n") local namedBindingTable = {} --- 4037,4042 ---- table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "wxLuaBindClass* "..hook_cpp_class_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static wxLuaBindClass classList[] =\n {\n") local namedBindingTable = {} *************** *** 4044,4048 **** table.insert(fileData, " { 0, 0, 0, 0, 0, 0, 0 }, \n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = (sizeof(classList)/sizeof(classList[0])) - 1;\n\n") table.insert(fileData, " return classList;\n") table.insert(fileData, "}\n") --- 4050,4054 ---- table.insert(fileData, " { 0, 0, 0, 0, 0, 0, 0 }, \n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = sizeof(classList)/sizeof(wxLuaBindClass) - 1;\n\n") table.insert(fileData, " return classList;\n") table.insert(fileData, "}\n") *************** *** 4059,4068 **** table.insert(fileData, "// binding class\n") ! table.insert(fileData, "extern WXLUACLASS *"..hook_cpp_class_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern WXLUADEFINE *"..hook_cpp_define_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern WXLUASTRING *"..hook_cpp_string_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern WXLUAEVENT *"..hook_cpp_event_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern WXLUAOBJECT *"..hook_cpp_object_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern WXLUAMETHOD *"..hook_cpp_function_funcname.."(size_t &count);\n") table.insert(fileData, "\n\n") table.insert(fileData, "IMPLEMENT_DYNAMIC_CLASS("..hook_cpp_binding_classname..", wxLuaBinding)\n") --- 4065,4074 ---- table.insert(fileData, "// binding class\n") ! table.insert(fileData, "extern wxLuaBindClass *"..hook_cpp_class_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern wxLuaBindDefine *"..hook_cpp_define_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern wxLuaBindString *"..hook_cpp_string_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern wxLuaBindEvent *"..hook_cpp_event_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern wxLuaBindObject *"..hook_cpp_object_funcname.."(size_t &count);\n") ! table.insert(fileData, "extern wxLuaBindMethod *"..hook_cpp_function_funcname.."(size_t &count);\n") table.insert(fileData, "\n\n") table.insert(fileData, "IMPLEMENT_DYNAMIC_CLASS("..hook_cpp_binding_classname..", wxLuaBinding)\n") *************** *** 4070,4081 **** table.insert(fileData, ""..hook_cpp_binding_classname.."::"..hook_cpp_binding_classname.."() : wxLuaBinding()\n") table.insert(fileData, "{\n") ! table.insert(fileData, " m_bindingName = wxT(\""..hook_cpp_namespace.."\");\n") ! table.insert(fileData, " m_nameSpace = wxT(\""..hook_lua_namespace.."\");\n") ! table.insert(fileData, " m_classList = "..hook_cpp_class_funcname.."(m_classCount);\n") ! table.insert(fileData, " m_defineList = "..hook_cpp_define_funcname.."(m_defineCount);\n") ! table.insert(fileData, " m_stringList = "..hook_cpp_string_funcname.."(m_stringCount);\n") ! table.insert(fileData, " m_eventList = "..hook_cpp_event_funcname.."(m_eventCount);\n") ! table.insert(fileData, " m_objectList = "..hook_cpp_object_funcname.."(m_objectCount);\n") ! table.insert(fileData, " m_functionList = "..hook_cpp_function_funcname.."(m_functionCount);\n") table.insert(fileData, "}\n") table.insert(fileData, "\n") --- 4076,4087 ---- table.insert(fileData, ""..hook_cpp_binding_classname.."::"..hook_cpp_binding_classname.."() : wxLuaBinding()\n") table.insert(fileData, "{\n") ! table.insert(fileData, " m_bindingName = wxT(\""..hook_cpp_namespace.."\");\n") ! table.insert(fileData, " m_nameSpace = wxT(\""..hook_lua_namespace.."\");\n") ! table.insert(fileData, " m_classArray = "..hook_cpp_class_funcname.."(m_classCount);\n") ! table.insert(fileData, " m_defineArray = "..hook_cpp_define_funcname.."(m_defineCount);\n") ! table.insert(fileData, " m_stringArray = "..hook_cpp_string_funcname.."(m_stringCount);\n") ! table.insert(fileData, " m_eventArray = "..hook_cpp_event_funcname.."(m_eventCount);\n") ! table.insert(fileData, " m_objectArray = "..hook_cpp_object_funcname.."(m_objectCount);\n") ! table.insert(fileData, " m_functionArray = "..hook_cpp_function_funcname.."(m_functionCount);\n") table.insert(fileData, "}\n") table.insert(fileData, "\n") *************** *** 4173,4180 **** table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "WXLUADEFINE* "..hook_cpp_define_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static WXLUADEFINE defineList[] =\n {\n") ! -- mix the %define and %enums together since they're both in the same WXLUADEFINE struct local namedBindingTable = {} GenerateLuaNameFromIndexedTable(defineBindingTable, namedBindingTable) --- 4179,4186 ---- table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "wxLuaBindDefine* "..hook_cpp_define_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static wxLuaBindDefine defineList[] =\n {\n") ! -- mix the %define and %enums together since they're both in the same wxLuaBindDefine struct local namedBindingTable = {} GenerateLuaNameFromIndexedTable(defineBindingTable, namedBindingTable) *************** *** 4188,4192 **** table.insert(fileData, " { 0, 0 },\n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = (sizeof(defineList)/sizeof(defineList[0])) - 1;\n") table.insert(fileData, " return defineList;\n") table.insert(fileData, "}\n\n") --- 4194,4198 ---- table.insert(fileData, " { 0, 0 },\n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = sizeof(defineList)/sizeof(wxLuaBindDefine) - 1;\n") table.insert(fileData, " return defineList;\n") table.insert(fileData, "}\n\n") *************** *** 4199,4204 **** table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "WXLUASTRING* "..hook_cpp_string_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static WXLUASTRING stringList[] =\n {\n") local namedBindingTable = {} --- 4205,4210 ---- table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "wxLuaBindString* "..hook_cpp_string_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static wxLuaBindString stringList[] =\n {\n") local namedBindingTable = {} *************** *** 4212,4216 **** table.insert(fileData, " { 0, 0 },\n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = (sizeof(stringList)/sizeof(stringList[0])) - 1;\n") table.insert(fileData, " return stringList;\n") table.insert(fileData, "}\n\n") --- 4218,4222 ---- table.insert(fileData, " { 0, 0 },\n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = sizeof(stringList)/sizeof(wxLuaBindString) - 1;\n") table.insert(fileData, " return stringList;\n") table.insert(fileData, "}\n\n") *************** *** 4232,4239 **** -- GetObjectList -- ------------------------------------------------------------------------ ! table.insert(fileData, "WXLUAOBJECT* "..hook_cpp_object_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static WXLUAOBJECT objectList[] =\n {\n") ! -- mix %object and %pointer together since they're both in the same WXLUAOBJECT struct local namedBindingTable = {} GenerateLuaNameFromIndexedTable(objectBindingTable, namedBindingTable) --- 4238,4245 ---- -- GetObjectList -- ------------------------------------------------------------------------ ! table.insert(fileData, "wxLuaBindObject* "..hook_cpp_object_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static wxLuaBindObject objectList[] =\n {\n") ! -- mix %object and %pointer together since they're both in the same wxLuaBindObject struct local namedBindingTable = {} GenerateLuaNameFromIndexedTable(objectBindingTable, namedBindingTable) *************** *** 4247,4251 **** table.insert(fileData, " { 0, 0, 0, 0 },\n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = (sizeof(objectList)/sizeof(objectList[0])) - 1;\n") table.insert(fileData, " return objectList;\n") table.insert(fileData, "}\n\n") --- 4253,4257 ---- table.insert(fileData, " { 0, 0, 0, 0 },\n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = sizeof(objectList)/sizeof(wxLuaBindObject) - 1;\n") table.insert(fileData, " return objectList;\n") table.insert(fileData, "}\n\n") *************** *** 4267,4272 **** -- GetEventList -- ------------------------------------------------------------------------ ! table.insert(fileData, "WXLUAEVENT* "..hook_cpp_event_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static WXLUAEVENT eventList[] =\n {\n") local namedBindingTable = {} --- 4273,4278 ---- -- GetEventList -- ------------------------------------------------------------------------ ! table.insert(fileData, "wxLuaBindEvent* "..hook_cpp_event_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static wxLuaBindEvent eventList[] =\n {\n") local namedBindingTable = {} *************** *** 4279,4283 **** table.insert(fileData, " { 0, 0, 0 },\n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = (sizeof(eventList)/sizeof(eventList[0])) - 1;\n") table.insert(fileData, " return eventList;\n") table.insert(fileData, "}\n\n") --- 4285,4289 ---- table.insert(fileData, " { 0, 0, 0 },\n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = sizeof(eventList)/sizeof(wxLuaBindEvent) - 1;\n") table.insert(fileData, " return eventList;\n") table.insert(fileData, "}\n\n") *************** *** 4313,4317 **** if functionBinding.FuncMapName then ! table.insert(fileData, "static WXLUAMETHOD_CFUNC "..functionBinding.FuncMapName.."[1] = {"..functionBinding.FuncMap.."};\n\n") end end --- 4319,4323 ---- if functionBinding.FuncMapName then ! table.insert(fileData, "static wxLuaBindCFunc "..functionBinding.FuncMapName.."[1] = {"..functionBinding.FuncMap.."};\n\n") end end *************** *** 4327,4339 **** table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "WXLUAMETHOD* "..hook_cpp_function_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static WXLUAMETHOD functionList[] =\n {\n") GenerateMap(fileData, sortedBindings, " ") table.insert(fileData, "\n") ! table.insert(fileData, " { WXLUAMETHOD_CFUNCTION, 0, 0, 0 }, \n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = (sizeof(functionList)/sizeof(functionList[0])) - 1;\n") table.insert(fileData, " return functionList;\n") table.insert(fileData, "}\n\n") --- 4333,4345 ---- table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "wxLuaBindMethod* "..hook_cpp_function_funcname.."(size_t &count)\n{\n") ! table.insert(fileData, " static wxLuaBindMethod functionList[] =\n {\n") GenerateMap(fileData, sortedBindings, " ") table.insert(fileData, "\n") ! table.insert(fileData, " { 0, 0, 0, 0 }, \n") table.insert(fileData, " };\n") ! table.insert(fileData, " count = sizeof(functionList)/sizeof(wxLuaBindMethod) - 1;\n") table.insert(fileData, " return functionList;\n") table.insert(fileData, "}\n\n") *************** *** 4398,4402 **** CommentBindingTable(funcMap, "// function overload table\n") ! table.insert(funcMap, "static WXLUAMETHOD_CFUNC "..funcMapName.."[] =\n{\n") table.insert(funcMap, " { "..funcName..", WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, "..tostring(requiredParamCount)..", "..tostring(paramCount)..", s_wxluaargArray_None },\n") for i = 1, #methodBindings do --- 4404,4408 ---- CommentBindingTable(funcMap, "// function overload table\n") ! table.insert(funcMap, "static wxLuaBindCFunc "..funcMapName.."[] =\n{\n") table.insert(funcMap, " { "..funcName..", WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, "..tostring(requiredParamCount)..", "..tostring(paramCount)..", s_wxluaargArray_None },\n") for i = 1, #methodBindings do *************** *** 4413,4417 **** table.insert(funcMap, "};\n") ! table.insert(funcMap, "static int "..funcMapName.."_count = sizeof("..funcMapName..")/sizeof("..funcMapName.."[0]);\n") local methodMap = " { "..funcType..", \""..methodBindings[1].LuaName.."\", "..funcMapName..", "..funcMapName.."_count, 0 }" --- 4419,4423 ---- table.insert(funcMap, "};\n") ! table.insert(funcMap, "static int "..funcMapName.."_count = sizeof("..funcMapName..")/sizeof(wxLuaBindCFunc);\n") local methodMap = " { "..funcType..", \""..methodBindings[1].LuaName.."\", "..funcMapName..", "..funcMapName.."_count, 0 }" *************** *** 4422,4426 **** table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") table.insert(codeList, " wxLuaState wxlState(L);\n") ! table.insert(codeList, " static WXLUAMETHOD overload_method = \n") table.insert(codeList, " "..methodMap..";\n") table.insert(codeList, " return wxlState.CallOverloadedFunction(&overload_method);\n") --- 4428,4432 ---- table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") table.insert(codeList, " wxLuaState wxlState(L);\n") ! table.insert(codeList, " static wxLuaBindMethod overload_method = \n") table.insert(codeList, " "..methodMap..";\n") table.insert(codeList, " return wxlState.CallOverloadedFunction(&overload_method);\n") *************** *** 4573,4577 **** if functionBinding.FuncMapName then table.insert(fileData, "static int LUACALL "..functionBinding.CFunctionName.."(lua_State *L);\n") ! table.insert(fileData, "static WXLUAMETHOD_CFUNC "..functionBinding.FuncMapName.."[1] = {"..functionBinding.FuncMap.."};\n\n") end --- 4579,4583 ---- if functionBinding.FuncMapName then table.insert(fileData, "static int LUACALL "..functionBinding.CFunctionName.."(lua_State *L);\n") ! table.insert(fileData, "static wxLuaBindCFunc "..functionBinding.FuncMapName.."[1] = {"..functionBinding.FuncMap.."};\n\n") end *************** *** 4604,4618 **** CommentBindingTable(fileData, "// Map Lua Class Methods to C Binding Functions\n") ! table.insert(fileData, "WXLUAMETHOD "..MakeClassVar(ObjectName).."_methods[] = {\n") GenerateMap(fileData, sortedBindings, "", nil, false, object.Condition) ! table.insert(fileData, " { WXLUAMETHOD_METHOD, 0, 0, 0 },\n") table.insert(fileData, "};\n\n") -- since there may be conditions count them up afterwards ! table.insert(fileData, "int "..MakeVar(ObjectName).."_methodCount = sizeof("..MakeClassVar(ObjectName).."_methods)/sizeof("..MakeClassVar(ObjectName).."_methods[0]) - 1;\n") table.insert(fileData, "\n\n") ! table.insert(fileData, "WXLUADEFINE "..MakeClassVar(ObjectName).."_enums[] = {\n") -- FIXME use dummy for empty if enumClassBindingTable[MakeClassVar(ObjectName)] then --- 4610,4624 ---- CommentBindingTable(fileData, "// Map Lua Class Methods to C Binding Functions\n") ! table.insert(fileData, "wxLuaBindMethod "..MakeClassVar(ObjectName).."_methods[] = {\n") GenerateMap(fileData, sortedBindings, "", nil, false, object.Condition) ! table.insert(fileData, " { 0, 0, 0, 0 },\n") table.insert(fileData, "};\n\n") -- since there may be conditions count them up afterwards ! table.insert(fileData, "int "..MakeVar(ObjectName).."_methodCount = sizeof("..MakeClassVar(ObjectName).."_methods)/sizeof(wxLuaBindMethod) - 1;\n") table.insert(fileData, "\n\n") ! table.insert(fileData, "wxLuaBindDefine "..MakeClassVar(ObjectName).."_enums[] = {\n") -- FIXME use dummy for empty if enumClassBindingTable[MakeClassVar(ObjectName)] then *************** *** 4627,4631 **** -- since there may be conditions count them up afterwards ! table.insert(fileData, "int "..MakeVar(ObjectName).."_enumCount = sizeof("..MakeClassVar(ObjectName).."_enums)/sizeof("..MakeClassVar(ObjectName).."_enums[0]) - 1;\n") if object.Condition then --- 4633,4637 ---- -- since there may be conditions count them up afterwards ! table.insert(fileData, "int "..MakeVar(ObjectName).."_enumCount = sizeof("..MakeClassVar(ObjectName).."_enums)/sizeof(wxLuaBindDefine) - 1;\n") if object.Condition then *************** *** 4637,4650 **** end ! RemoveExtraWXLUAMETHOD_CFUNC(fileData) return fileData end ! function RemoveExtraWXLUAMETHOD_CFUNC(fileData) local cfuncTable = {} for n = 1, #fileData do ! if string.find(fileData[n], "static WXLUAMETHOD_CFUNC s_wxluafunc", 1, 1) then local a, b = string.find(fileData[n], "s_wxluafunc", 1, 1) local s = string.sub(fileData[n], a) --- 4643,4656 ---- end ! RemoveExtra_wxLuaBindCFunc(fileData) return fileData end ! function RemoveExtra_wxLuaBindCFunc(fileData) local cfuncTable = {} for n = 1, #fileData do ! if string.find(fileData[n], "static wxLuaBindCFunc s_wxluafunc", 1, 1) then local a, b = string.find(fileData[n], "s_wxluafunc", 1, 1) local s = string.sub(fileData[n], a) |