From: John L. <jr...@us...> - 2005-11-28 06:05:17
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27690/wxLua/bindings Modified Files: genwxbind.lua 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: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** genwxbind.lua 26 Nov 2005 08:46:57 -0000 1.8 --- genwxbind.lua 28 Nov 2005 06:05:08 -0000 1.9 *************** *** 2310,2315 **** encapsulationBinding = { ! Declaration="DECLARE_ENCAPSULATION("..parseObject.Name..")\n", ! Implementation="IMPLEMENT_ENCAPSULATION("..parseObject.Name..")\n", Condition=encapcondition } --- 2310,2315 ---- encapsulationBinding = { ! Declaration="wxLUA_DECLARE_ENCAPSULATION("..parseObject.Name..")\n", ! Implementation="wxLUA_IMPLEMENT_ENCAPSULATION("..parseObject.Name..")\n", Condition=encapcondition } *************** *** 2427,2434 **** table.insert(codeList, "static int LUACALL "..parseObject.Name.."_"..memberGetFunc.."(lua_State *L)\n") table.insert(codeList, "{\n") if (comment) then table.insert(codeList, " // get this\n") end ! table.insert(codeList, " "..parseObject.Name.." *self = ("..parseObject.Name.." *) getuserdatatype(L, 1, s_"..MakeClassVar(parseObject.Name)..");\n") if memberType == "wxString" then --- 2427,2435 ---- table.insert(codeList, "static int LUACALL "..parseObject.Name.."_"..memberGetFunc.."(lua_State *L)\n") table.insert(codeList, "{\n") + table.insert(codeList, " wxLuaState wxlState(L);\n") if (comment) then table.insert(codeList, " // get this\n") end ! table.insert(codeList, " "..parseObject.Name.." *self = ("..parseObject.Name.." *) wxlState.getuserdatatype(1, s_"..MakeClassVar(parseObject.Name)..");\n") if memberType == "wxString" then *************** *** 2443,2449 **** -- if string.find(member.Name, "::") then ! -- table.insert(codeList, " pushuserdatatype(L, s_"..MakeClassVar(memberType)..", "..member.Name..");\n") -- else ! table.insert(codeList, " pushuserdatatype(L, s_"..MakeClassVar(memberType)..", &self->"..member.Name..");\n") -- end elseif not intrinsic then --- 2444,2450 ---- -- if string.find(member.Name, "::") then ! -- table.insert(codeList, " wxlState.pushuserdatatype(s_"..MakeClassVar(memberType)..", "..member.Name..");\n") -- else ! table.insert(codeList, " wxlState.pushuserdatatype(s_"..MakeClassVar(memberType)..", &self->"..member.Name..");\n") -- end elseif not intrinsic then *************** *** 2452,2456 **** end ! table.insert(codeList, " pushuserdatatype(L, s_"..MakeClassVar(memberType)..", self->"..member.Name..");\n") elseif type == "BOOL" or type == "bool" then if (comment) then --- 2453,2457 ---- end ! table.insert(codeList, " wxlState.pushuserdatatype(s_"..MakeClassVar(memberType)..", self->"..member.Name..");\n") elseif type == "BOOL" or type == "bool" then if (comment) then *************** *** 2470,2474 **** table.insert(codeList, " return 1;\n") table.insert(codeList, "}\n\n") - -- bind method methodBinding = --- 2471,2474 ---- *************** *** 2500,2533 **** table.insert(codeList, "static int LUACALL "..parseObject.Name.."_"..memberSetFunc.."(lua_State *L)\n") table.insert(codeList, "{\n") if memberType == "wxString" then if (comment) then table.insert(codeList, " // get the string value\n") end ! table.insert(codeList, " wxString val = lua2wx(getstringtype(L, 2));\n") elseif not intrinsic and (not memberPtr or memberPtr == "&") then if (comment) then table.insert(codeList, " // get the data type value\n") end ! table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)getuserdatatype(L, 2, s_"..MakeClassVar(memberType).." );\n") elseif not intrinsic then if (comment) then table.insert(codeList, " // get the data type value\n") end ! table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)getuserdatatype(L, 2, s_"..MakeClassVar(memberType).." );\n") elseif memberType == "BOOL" or memberType == "bool" then if (comment) then table.insert(codeList, " // get the boolean value\n") end ! table.insert(codeList, " bool val = getbooleantype(L, 2);\n") else if (comment) then table.insert(codeList, " // get the number value\n") end ! table.insert(codeList, " "..memberType.." val = getnumbertype(L, 2);\n") end if (comment) then table.insert(codeList, " // get this\n") end ! table.insert(codeList, " "..parseObject.Name.." *self = ("..parseObject.Name.." *) getuserdatatype(L, 1, s_"..MakeClassVar(parseObject.Name)..");\n") if not intrinsic and (not memberPtr or memberPtr == "&") then --- 2500,2535 ---- table.insert(codeList, "static int LUACALL "..parseObject.Name.."_"..memberSetFunc.."(lua_State *L)\n") table.insert(codeList, "{\n") + table.insert(codeList, " wxLuaState wxlState(L);\n") + if memberType == "wxString" then if (comment) then table.insert(codeList, " // get the string value\n") end ! table.insert(codeList, " wxString val = lua2wx(wxlState.getstringtype(2));\n") elseif not intrinsic and (not memberPtr or memberPtr == "&") then if (comment) then table.insert(codeList, " // get the data type value\n") end ! table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)wxlState.getuserdatatype(2, s_"..MakeClassVar(memberType).." );\n") elseif not intrinsic then if (comment) then table.insert(codeList, " // get the data type value\n") end ! table.insert(codeList, " "..memberType.."* val = ("..memberType.."*)wxlState.getuserdatatype(2, s_"..MakeClassVar(memberType).." );\n") elseif memberType == "BOOL" or memberType == "bool" then if (comment) then table.insert(codeList, " // get the boolean value\n") end ! table.insert(codeList, " bool val = wxlState.getbooleantype(2);\n") else if (comment) then table.insert(codeList, " // get the number value\n") end ! table.insert(codeList, " "..memberType.." val = wxlState.getnumbertype(2);\n") end if (comment) then table.insert(codeList, " // get this\n") end ! table.insert(codeList, " "..parseObject.Name.." *self = ("..parseObject.Name.." *)wxlState.getuserdatatype(1, s_"..MakeClassVar(parseObject.Name)..");\n") if not intrinsic and (not memberPtr or memberPtr == "&") then *************** *** 2808,2812 **** end ! if (indirectionCount == 1) and argPtr == "[]" then argTypeWithAttrib = argTypeWithAttrib.." *" --- 2810,2814 ---- end ! if (indirectionCount == 1) and (argPtr == "[]") then argTypeWithAttrib = argTypeWithAttrib.." *" *************** *** 2817,2830 **** end ! argItem = "tostringarray(L, "..argNum..", count)" declare = "int count = 0; wxLuaSmartStringArray ptr; "..argTypeWithAttrib.." "..argName.."; ptr = " elseif not intrinsic then ! argItem = "("..argTypeWithAttrib..") getuserdatatype(L, "..argNum..", s_"..MakeClassVar(argType)..")" else ! argItem = "("..argTypeWithAttrib..") ttouserdata(L, "..argNum..")" end elseif indirectionCount == 1 and argPtr == "*" then if argType == "wxString" then ! argItem = "lua2wx(getstringtype(L, "..argNum.."))" -- Default String Value --- 2819,2832 ---- end ! argItem = "wxlState.tostringarray("..argNum..", count)" declare = "int count = 0; wxLuaSmartStringArray ptr; "..argTypeWithAttrib.." "..argName.."; ptr = " elseif not intrinsic then ! argItem = "("..argTypeWithAttrib..") wxlState.getuserdatatype("..argNum..", s_"..MakeClassVar(argType)..")" else ! argItem = "("..argTypeWithAttrib..") wxlState.ttouserdata("..argNum..")" end elseif indirectionCount == 1 and argPtr == "*" then if argType == "wxString" then ! argItem = "lua2wx(wxlState.getstringtype("..argNum.."))" -- Default String Value *************** *** 2847,2853 **** if not intrinsic then ! argItem = "("..argTypeWithAttrib..") getuserdatatype(L, "..argNum..", s_"..MakeClassVar(argType)..")" else ! argItem = "("..argTypeWithAttrib..") ttouserdata(L, "..argNum..")" end end --- 2849,2855 ---- if not intrinsic then ! argItem = "("..argTypeWithAttrib..")wxlState.getuserdatatype("..argNum..", s_"..MakeClassVar(argType)..")" else ! argItem = "("..argTypeWithAttrib..")wxlState.ttouserdata("..argNum..")" end end *************** *** 2855,2866 **** if not intrinsic then argTypeWithAttrib = argTypeWithAttrib.." **" ! argItem = "("..argTypeWithAttrib..") getuserdatatype(L, "..argNum..", s_"..MakeClassVar(argType)..")" else argTypeWithAttrib = argTypeWithAttrib.." *" ! argItem = "("..argTypeWithAttrib..") ttouserdata(L, "..argNum..")" end elseif indirectionCount == 1 and argPtr == "&" then if argType == "wxString" then ! argItem = "lua2wx(getstringtype(L, "..argNum.."))" -- Default String Value --- 2857,2868 ---- if not intrinsic then argTypeWithAttrib = argTypeWithAttrib.." **" ! argItem = "("..argTypeWithAttrib..")wxlState.getuserdatatype("..argNum..", s_"..MakeClassVar(argType)..")" else argTypeWithAttrib = argTypeWithAttrib.." *" ! argItem = "("..argTypeWithAttrib..")wxlState.ttouserdata("..argNum..")" end elseif indirectionCount == 1 and argPtr == "&" then if argType == "wxString" then ! argItem = "lua2wx(wxlState.getstringtype("..argNum.."))" -- Default String Value *************** *** 2877,2883 **** argTypeWithAttrib = argTypeWithAttrib.." *" if not intrinsic then ! argItem = "("..argTypeWithAttrib..") getuserdatatype(L, "..argNum..", s_"..MakeClassVar(argType)..")" else ! argItem = "("..argTypeWithAttrib..") ttouserdata(L, "..argNum..")" end --- 2879,2885 ---- argTypeWithAttrib = argTypeWithAttrib.." *" if not intrinsic then ! argItem = "("..argTypeWithAttrib..")wxlState.getuserdatatype("..argNum..", s_"..MakeClassVar(argType)..")" else ! argItem = "("..argTypeWithAttrib..")wxlState.ttouserdata("..argNum..")" end *************** *** 2889,2893 **** elseif indirectionCount == 0 then if argType == "wxString" then ! argItem = "lua2wx(getstringtype(L, "..argNum.."))" -- Default String Value --- 2891,2895 ---- elseif indirectionCount == 0 then if argType == "wxString" then ! argItem = "lua2wx(wxlState.getstringtype("..argNum.."))" -- Default String Value *************** *** 2902,2910 **** end elseif argType == "bool" or argType == "BOOL" then ! argItem = "getbooleantype(L, "..argNum..")" elseif isEnum(argType) then ! argItem = "("..argType..") getenumerationtype(L, "..argNum..")" else ! argItem = "("..argType..") getnumbertype(L, "..argNum..")" end else --- 2904,2912 ---- end elseif argType == "bool" or argType == "BOOL" then ! argItem = "wxlState.getbooleantype("..argNum..")" elseif isEnum(argType) then ! argItem = "("..argType..")wxlState.getenumerationtype("..argNum..")" else ! argItem = "("..argType..")wxlState.getnumbertype("..argNum..")" end else *************** *** 3005,3008 **** --- 3007,3011 ---- table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n") + table.insert(codeList, " wxLuaState wxlState(L);\n") -- determine function return type *************** *** 3124,3128 **** if (comment) then table.insert(codeList, " // add to tracked window list\n") end table.insert(codeList, " if (returns && returns->IsKindOf(CLASSINFO(wxWindow)))\n") ! table.insert(codeList, " addToTrackedWindowList(L, (wxWindow*)returns);\n") end --- 3127,3131 ---- if (comment) then table.insert(codeList, " // add to tracked window list\n") end table.insert(codeList, " if (returns && returns->IsKindOf(CLASSINFO(wxWindow)))\n") ! table.insert(codeList, " wxlState.addToTrackedWindowList((wxWindow*)returns);\n") end *************** *** 3130,3134 **** table.insert(codeList, " // push the constructed class pointer\n") end ! table.insert(codeList, " pushuserdatatype(L, s_"..MakeClassVar(parseObject.Name)..", returns );\n") table.insert(codeList, "\n return 1;\n") --- 3133,3137 ---- table.insert(codeList, " // push the constructed class pointer\n") end ! table.insert(codeList, " wxlState.pushuserdatatype(s_"..MakeClassVar(parseObject.Name)..", returns );\n") table.insert(codeList, "\n return 1;\n") *************** *** 3145,3149 **** end ! table.insert(codeList, " "..parseObject.Name.." * self = ( "..parseObject.Name.." * ) getuserdatatype(L, 1, s_"..MakeClassVar(parseObject.Name).." );\n") -- static member function? --- 3148,3152 ---- end ! table.insert(codeList, " "..parseObject.Name.." * self = ( "..parseObject.Name.." * )wxlState.getuserdatatype(1, s_"..MakeClassVar(parseObject.Name).." );\n") -- static member function? *************** *** 3208,3212 **** table.insert(codeList, " // push the result datatype\n") end ! table.insert(codeList, " pushuserdatatype(L, s_"..MakeClassVar(memberType)..", returns );\n") elseif member.DataType == "BOOL" or member.DataType == "bool" then if (comment) then --- 3211,3215 ---- table.insert(codeList, " // push the result datatype\n") end ! table.insert(codeList, " wxlState.pushuserdatatype(s_"..MakeClassVar(memberType)..", returns );\n") elseif member.DataType == "BOOL" or member.DataType == "bool" then if (comment) then *************** *** 3333,3337 **** codeList = {} table.insert(codeList, "static int LUACALL "..MakeVar(parseObject.Name).."_destructor(lua_State *L)\n{\n") ! table.insert(codeList, " "..parseObject.Name.." * self = ("..parseObject.Name.." *) getuserdatatype(L, 1, s_"..MakeClassVar(parseObject.Name)..");\n") if (comment) then --- 3336,3341 ---- codeList = {} table.insert(codeList, "static int LUACALL "..MakeVar(parseObject.Name).."_destructor(lua_State *L)\n{\n") ! table.insert(codeList, " wxLuaState wxlState(L);\n") ! table.insert(codeList, " "..parseObject.Name.." * self = ("..parseObject.Name.." *)wxlState.getuserdatatype(1, s_"..MakeClassVar(parseObject.Name)..");\n") if (comment) then *************** *** 3360,3364 **** codeList = {} table.insert(codeList, "static int LUACALL "..MakeVar(parseObject.Name).."_Delete(lua_State *L)\n{\n") ! table.insert(codeList, " "..parseObject.Name.." * self = ("..parseObject.Name.." *) getuserdatatype(L, 1, s_"..MakeClassVar(parseObject.Name)..");\n") if (comment) then --- 3364,3369 ---- codeList = {} table.insert(codeList, "static int LUACALL "..MakeVar(parseObject.Name).."_Delete(lua_State *L)\n{\n") ! table.insert(codeList, " wxLuaState wxlState(L);\n") ! table.insert(codeList, " "..parseObject.Name.." * self = ("..parseObject.Name.." *)wxlState.getuserdatatype(1, s_"..MakeClassVar(parseObject.Name)..");\n") if (comment) then |