From: Ray G. <ray...@sc...> - 2005-11-18 02:58:52
|
I am still working on generating a new set of interfaces directly from wx head cvs. I am making progress, but nothing stable yet.=20 Trying to figure out the best way to handle issues involving base classes that vary according to implementation (e.g. using wxGeneric vs native) wxLua tends to only create luac functions for prototypes in lua metatable, if not found it then goes to base class metatable. My current thought is simply merge all base class calls up to main class metatable and ignore base class redirection - thereby avoiding bad casts. This of coarse will be at the cost of code bloat. Ray -----Original Message----- From: wxl...@li... [mailto:wxl...@li...] On Behalf Of John Labenski Sent: Thursday, 17 November 2005 17:02 To: wxl...@li... Subject: [Wxlua-users] CVS updated to work... sort of I've fixed the handling of %if statements for enums and added the bindings for "builtin" (global) functions like wxYield. I'm using wxWidgets CVS head, but when I updated the interface files I looked at the 2.6 headers, so it should work for that too. It compiles without error in GCC 4, but still needs some work and the Makefiles need some tweaking. If you want to try it use the Makefile in the apps/wxlua/src dir, gcc in linux only. Current bugs: (in Linux, wx27 CVS HEAD) Segfaults if you run the wxLua sample directly and you can't get a backtrace, this will probably be hard to figure out, but with some luck... $./wxLua wxLua: Expected enum number for parameter 6.wxLua: Error while running chunkwxLua: Error while running chunk Runs if you do $./wxLua ../../../samples/editor.wx.lua wxLua: Error while running chunk wxLua: Unexpected user defined data type for parameter 2. Open the "grid" sample and then The menu item "Run" wxLua: Error while running chunk ../../../samples/editor.wx.lua:1645: attempt to call field `wxExecute' (a nil value) stack traceback: ../../../samples/editor.wx.lua:1645: in function <../../../samples/editor.wx.lua:1635> But if you do "Debug" and then "Continue" it does show and even works! I'll try to clean it up a little more, fix these problems, and I think we should be workable in just a short time. -John Labenski ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_idv28&alloc_id=16845&op=3Dick _______________________________________________ Wxlua-users mailing list Wxl...@li... https://lists.sourceforge.net/lists/listinfo/wxlua-users |
From: John L. <jla...@gm...> - 2005-11-18 06:10:43
|
On 11/17/05, Ray Gilbert <ray...@sc...> wrote: > I am still working on generating a new set of interfaces directly from > wx head cvs. I am making progress, but nothing stable yet. Good. You had mentioned that these interface files are in XML, is that righ= t? > Trying to figure out the best way to handle issues involving base > classes that vary according to implementation (e.g. using wxGeneric vs > native) Which classes give you a problem? As an aside, but I'm guessing that this is kinda' along the same lines as your problem, I've been wondering if I should ask on wx-dev if wxWidgets should rename all the classes to follow something like this. wxListCtrlBase (for example) msw wxListCtrlMSW gtk wxListCtrlGTK univ wxListCtrlUniv generic wxListCtrlGeneric (and GTK would be typedefed to this) etc... and then using #defines typdef wxListCtrl to the appropriate class. This way, in MSW for example, you could use wxListCtrlGeneric and wxListCtrlMSW (the latter of which would be typedefed to just wxListCtrl. > wxLua tends to only create luac functions for prototypes in lua > metatable, if not found it then goes to base class metatable. This seems reasonable, if not the best way to do it. > My current thought is simply merge all base class calls up to main class > metatable and ignore base class redirection - thereby avoiding bad > casts. Maybe this could be worked around somehow with our own code, if there aren't too many of them. Maybe add something like this to the interface files, where we can add C++ to the generated files directly. %verbatim (or %inline) #if __WXGTK__ typedef wxXXXGeneric wxXXX #elseif __WXMSW__ ... #endif %endverbatum -John Labenski |
From: John L. <jla...@gm...> - 2005-11-20 00:28:05
|
Ray, to hold us over for a bit, could you please take a look at the current genwxbind.lua file. It doesn't seem to want to wrap wxICON_QUESTION and some other %defines for some reason. I cannot seem to figure out why and currently there's some debugging code in it to show you what the problem is. Look for the FIXME lines, you should be able to see that in the function ParseData(interfaceData) the %define wxICON_QUESTION is parsed (from dialogs.i), but mysteriously by the time it gets to GenerateLuaLanguageBinding(interface) it's gone. I've added a function DumpTable and have tried to compare some of the %defines that do work with those that don't, but I cannot see any difference. I have changed the code slightly to not write directly to the files, but rather to fill a table with the code and compare with the existing file to save on compilation time, but the functions where the problem seems to be should be pretty much the way you had them. All you need to do is run genwxbind.lua in the bindings dir. You can look at apps/wxlua/src/Makefile_import to see what the proper command like would be for MSW or just run make -f Makefile_import directly in linux. The output is put into modules/wxbind/src and the error.txt file (where my debugging stuff is written) is in bindings/wxwidgets. Just about everything works, execept for genwxbind missing some %defines. Thanks, John Labenski |