From: John L. <jla...@gm...> - 2005-11-25 03:20:01
|
I've made some pretty big changes, mainly just moving stuff around. I've added wxlstate.h/cpp, wxLuaState, which will be replacement for wxLuaStateVariables, It'll be a ref counted class so that it can be passed around and if anybody holds a reference to it, they'll be able to check if the lua_State has been closed. The current (old) way just passes around the lua_State pointer so it's easy to write to an invalid pointer if you're not careful. The wxLuaState class will cleanup the GET_LUASTATEVARS_RET defines by having a static function to get the wxLuaState from the lua_State. I can make a constructor that takes a lua_State and attaches to it if it already exists. Moved wxLuaBindings into their own file, wxlbind.h/cpp. Moved the code for wxLuaCallback into it's own wxlcallb.h/cpp file. Renamed library.h/cpp to wxlhandl.h/cpp since it only contains wxLuaHandler= . Added an alternative editor to run wxLua in, app/wxluaedit using my wxstedit component on wxCode. It's not compiled by default and I hope I got it right. in the bakefiles. To compile it, set the environment variable WXSTEDIT=3D/path/to/wxCode/components/wxstedit and run in wxLua/apps/build/msw; nmake USE_WXLUAEDITAPP=3D1 -f makefile.vc or in linux just run make in wxLua/apps/wxluaedit/src. --------------- It's tested and works in linux using wxWidgets 2.6 Regards, John Labenski |
From: klaas.holwerda <kho...@xs...> - 2005-11-25 08:58:16
|
Hi John, John Labenski wrote: > It'll be a ref counted class so that it can be >passed around and > > In case you need a smart pointer class, wxArt2D has one and is using it all over. >Added an alternative editor to run wxLua in, app/wxluaedit using my >wxstedit component on wxCode. > great! I already had used your editing/console in my wxlua version, now it will be a full replacement for the old one. >--------------- >It's tested and works in linux using wxWidgets 2.6 > > Time i switch to Linux too ;-) Klaas |
From: John L. <jla...@gm...> - 2005-11-25 17:57:09
|
On 11/25/05, klaas.holwerda <kho...@xs...> wrote: > > It'll be a ref counted class so that it can be > >passed around and > > > In case you need a smart pointer class, wxArt2D has one and is using it > all over. We use a very simple smart pointer class for wxStrings and ints. see wxLuaSmartStringArray http://cvs.sourceforge.net/viewcvs.py/wxlua/wxLua/modules/wxlua/include/int= ernal.h?rev=3D1.6&view=3Dmarkup I don't think we need more, can you give me a link to yours? > >Added an alternative editor to run wxLua in, app/wxluaedit using my > >wxstedit component on wxCode. > > > great! I already had used your editing/console in my wxlua version, now > it will be a full replacement for the old one. I'm glad you like it, it's not perfect, but it's a good test for running lua w/ c++ wxWidgets in the same thread. > >It's tested and works in linux using wxWidgets 2.6 > > > Time i switch to Linux too ;-) Yeah, my windows machine is sloooooow so it doesn't get used too much. -John |
From: klaas.holwerda <kho...@xs...> - 2005-11-25 20:38:40
|
John Labenski wrote: >On 11/25/05, klaas.holwerda <kho...@xs...> wrote: > > >>>It'll be a ref counted class so that it can be >>>passed around and >>> >>> >>> >>In case you need a smart pointer class, wxArt2D has one and is using it >>all over. >> >> > >We use a very simple smart pointer class for wxStrings and ints. see >wxLuaSmartStringArray >http://cvs.sourceforge.net/viewcvs.py/wxlua/wxLua/modules/wxlua/include/internal.h?rev=1.6&view=markup > >I don't think we need more, can you give me a link to yours? > > It is all in the next two files, a2dSmrtPtr http://cvs.sourceforge.net/viewcvs.py/wxart2d/wxArt2D/modules/general/include/smrtptr.h?rev=1.15&view=markup http://cvs.sourceforge.net/viewcvs.py/wxart2d/wxArt2D/modules/general/include/smrtptr.inl?rev=1.9&view=markup For lists we use STL -> a2dList -> a2dSmrtPtrList derived list. So a list of smart pointers. Easier in use then wxList when it comes to smart pointers. Our a2dObject is derived from wxObject and has the counter for the smart pointers. I love smart pointers. Especially in window close situations, and events, it easy to control when deletion will be done. And also easier during debugging. And with STL one almost has to use smart pointers else it will be impossible to store pointers, which will be deleted properly. That is why i choose to make wxArt2D, wxList free, so later it will be easy. The longer one waites, the worse it gets. How does wxLua deal with wxList? Regards, Klaas |
From: John L. <jla...@gm...> - 2005-11-25 22:03:55
|
> For lists we use STL -> a2dList -> a2dSmrtPtrList derived list. > So a list of smart pointers. Easier in use then wxList when it comes to s= mart pointers. > Our a2dObject is derived from wxObject and has the counter for the smart = pointers. Ok, good to know. > I love smart pointers. Especially in window close situations, and events,= it easy to > control when deletion will be done. And also easier during debugging. This may come in handy for the pushed event handlers. > How does wxLua deal with wxList? We don't very much if at all. -John |