On Sat, Oct 18, 2008 at 5:19 AM, klaas.holwerda <[EMAIL PROTECTED]> wrote:
> Hi,
>
> My typedef in C++ become reversed in *.i files. not a problem, but
> further down, it looks like the typedef is not respected.
> Not only with a template like down here, also with simple classes.
> Like:
>
> %typedef a2dPoint2D wxPoint2DDouble
>
> That line is understood by the generator, but next when a2dPoint is
> used, eg as return value for a function, it is not oke (exceptions in
> lua). So i decided to copy the wxPoint2DDouble wrapping from wxLua as a
> whole, and put in my own after replacing wxPoint2DDouble with
> a2dPoint2D. So in end "as if" i have a class a2dPoint2D, and that works
> for all the generated C++ code.
> Still i wonder how this should be solved.
> Maybe it does not work because wxPoint2DDouble is from another wrap module??

The typename wxPoint2DDouble  should be known if you have this line in
your rules since the file wxcore_datatypes.lua defines them.

datatype_cache_input_fileTable = {
wxlua_dir.."bindings/wxwidgets/wxcore_datatypes.lua" }

The typedefs have not been thoroughly tested as they're not used too
much in the bindings. You're saying that if you have something like
this in your interface files you get a crash. For both uses of the
typedef or only for the return value... ? This should be fixable if I
can get a simple example of what makes the binder crash.

%typedef a2dPoint2D wxPoint2DDouble

%function a2dPoint2D GetPoint()
%function void SetPoint(const a2dPoint2D& pt)

> After that i have many of the next, which are instances of a template.
> If instead of using a typedef, i just wrap the a2dPropertyIdMatrix as
> an empty class, it does work better.
>
> %class %noclassinfo a2dPropertyIdMatrix
> %endclass
>
> Since it are id's and most of the time static id's in C++, i think this
> will work. But for me its all a bit fuzzy logic at the moment :-)
>
> %typedef a2dPropertyIdMatrix a2dPropertyIdTyped<a2dAffineMatrix,
> a2dMatrixProperty>
>
> ERROR: Supposed datatype: 'a2dPropertyIdMatrix' has typedef =
> 'a2dPropertyIdTyped<a2dAffineMatrix , a2dMatrixProperty>' which is not a
> data type either

There is no support for templates, therefore you have to define each
templated class. However, if you can, wrap the base class and then for
each templated class only override the functions whose input or output
data types are different.

-John

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to