Update of /cvsroot/wxlua/wxLua/bindings
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16698/wxLua/bindings
Modified Files:
genwxbind.lua
Log Message:
Add "voidptr_long" binding tag to allow using void* as a number
Speed up bindings by using numbers as keys in the registry (avoid lua doing a string copy)
Get rid of wxLuaState::GetXXXTag functions, something better needs to be implemented,
using global vars for the few tags that we really use often now
Allow the wxLuaStackDialog to be able to show lua's registry
lots of cleanup in bindings.wx.lua
Index: genwxbind.lua
===================================================================
RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v
retrieving revision 1.122
retrieving revision 1.123
diff -C2 -d -r1.122 -r1.123
*** genwxbind.lua 14 Jun 2007 01:23:07 -0000 1.122
--- genwxbind.lua 14 Jun 2007 23:59:41 -0000 1.123
***************
*** 271,274 ****
--- 271,275 ----
--AllocDataType("wxArrayInt", "special", true) -- special, but we only convert input, not output
AllocDataType("IntArray_FromLuaTable", "special", true)
+ AllocDataType("voidptr_long", "special", true)
-- attributes that can precede a data type (must set equal to true)
***************
*** 3078,3081 ****
--- 3079,3090 ----
end
+
+ -- the function take (void*), but we just pass an int
+ if argType == "voidptr_long" then
+ argType = "long"
+ argTypeWithAttrib = "long"
+ argCast = "void*"
+ end
+
-- our special notation to get wxString/IntArray from a lua table of strings
-- BUT! it has to be const wxArrayString& arr or wxArrayString arr
***************
*** 3404,3407 ****
--- 3413,3420 ----
end
+ if memberTypeWithAttrib == "voidptr_long " then
+ memberTypeWithAttrib = "long "
+ end
+
table.insert(codeList, " "..memberTypeWithAttrib.."returns;\n")
end
***************
*** 3551,3558 ****
elseif (not member.IsOperator) and (memberPtr == "&") and (memberType ~= "wxString") then
table.insert(codeList, " returns = &"..functor..";\n")
! elseif (memberPtr == "*") then
table.insert(codeList, " returns = ("..memberTypeWithAttrib..")"..functor..";\n")
else
! table.insert(codeList, " returns = "..functor..";\n")
end
--- 3564,3571 ----
elseif (not member.IsOperator) and (memberPtr == "&") and (memberType ~= "wxString") then
table.insert(codeList, " returns = &"..functor..";\n")
! elseif (memberPtr == "*") or (memberType == "voidptr_long") then
table.insert(codeList, " returns = ("..memberTypeWithAttrib..")"..functor..";\n")
else
! table.insert(codeList, " returns = ("..functor..");\n")
end
|