From: k. h. <kla...@nl...> - 2006-01-13 14:56:03
|
Hi John, After searching for a long time, i realize that the namespace is my problem. The situation is like this, i have one library containing the wrapping for wxArt2D, and a second part is wrapped inside the application based on wxArt2d. Both wrapping are generated seperate using genwxbind.bat, each with its own rules file, and its own namespace. Choosing the same namespace for both is a problem, since it result in eqaul named C++ code. The problem start when a derived class in my application is wrapped, while the baseclass is wrapped inside the wxArt2D wraplibrary. The one in my application has namespaceX and the baseclass has namspace Y. And the classes and methods etc. in name space X do not know the ones in namespace Y. Maybe this is exactly how it was meant, but for me it is not usable, and i think that it is in general the case. As long as one does not drive classes in his own application, which need to be wrapped, it is oke. But as soon one wants this, (e.g. derive from a wxWidgets class, and wrapped that class into wxlua, this wrapped class gets its own namespace. And that simply does not work. The derived class in lua, will not know there is a baseclass or at least it does not know it has methods. ( a forward decleration trick is not enough, or maybe is causing the problem?? ). So i think we need something to extend a binding Y_Binding ( generated with genwxbind.bat ), with another X_binding which not creates a new set of binding classes, but extend an existing binding class. Or at least extends an existing namespace table, and not start a new one. Another solution might be to extend wrapped classes/tables in one higher namespace somehow with its baseclasses/tables from a lower namespace. I think this is what it is in C++, and would be best for wxLua too. But still if this was already the case, it would still be good to have a way to extend a namespace. To be sure the above is my problem, i put all my binding into the application and into one namespace, and all works well. How and where are baseclasses actually coupled to its derived classes? Maybe it is not so hard to couple classes in one namespace/binding to its baseclasses in another namespace? Actually it looks like this is done in wxLuaState::RegisterBindings(), but somehow its not working correctly. Hope you see what can be done, or what i am missing, regards, Klaas -- Unclassified |