On Tue, Oct 21, 2008 at 12:47 PM, klaas.holwerda <[EMAIL PROTECTED]> wrote:
> John Labenski wrote:
>>  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)
>>
> Here is there error i get, and after that the wrapping code i used
>
> c:\data\art2d\a2d288deb\modules\luawraps\src>genwxbind.bat | more
> Generating wxWidgets Binding
> c:/data/art2d/wxluacvs/wxLua\bin\vc_lib\lua:
> c:/data/art2d/wxluacvs/wxLua\bindings\genwxbind.lua:3712: attempt to
> index field '?' (a nil value)

Fixed in CVS. It was not translating the typedef.

> ------------------------------------
> This LINE is the problem line in the next code:
>
>     a2dPoint2D GetTranslation() const
>
> But as you can see, i out commented many things which also give problems.
>
> --------------------- Here the wrapped code --------
>
> // *****************************************************************
> // artbase/include\afmatrix.h
> // *****************************************************************
>
> %typedef a2dPoint2D wxPoint2DDouble

******* NOTE
I changed the $typedef semantics to match that of C/C++

%typedef wxPoint2DDouble a2dPoint2D

> //
> ---------------------------------------------------------------------------
> // a2dAffineMatrix
> //
> ---------------------------------------------------------------------------
>
> %include "artbase/include/afmatrix.h"
> %class %noclassinfo  %encapsulate a2dAffineMatrix
>    a2dAffineMatrix( double xt, double yt, double scalex = 1, double
> scaley = 1, double degrees = 0 )
>    a2dAffineMatrix()
>    a2dAffineMatrix( const a2dAffineMatrix& mat )
>    %operator void operator = ( const a2dAffineMatrix& mat )
>    %operator bool operator == ( const a2dAffineMatrix& a, const
> a2dAffineMatrix& b )
>    %operator bool operator != ( const a2dAffineMatrix& a, const
> a2dAffineMatrix& b )
>    //%operator a2dAffineMatrix&          operator*=( const
> a2dAffineMatrix& m )
>    //%operator a2dAffineMatrix           operator*( const
> a2dAffineMatrix& m ) const

Should work? See wxPoint2DDouble operators.

>    //%operator a2dAffineMatrix operator-( const a2dAffineMatrix& a,
> const a2dAffineMatrix& b )
>    //static a2dAffineMatrix Mul( const a2dAffineMatrix &m1, const
> a2dAffineMatrix &m2 )
>    //double& operator()( int col, int row )
>    //%operator double& operator()( int col, int row )
>    //double operator()( int col, int row ) const
>    //%operator double operator()( int col, int row ) const

There is no support for 2 params to the operators, I can add this.

>    a2dPoint2D GetTranslation() const
>    //%member double  m_matrix[3][2]

This would be hard to implement since we'd have to return m_matrix[3]
as an array wrapped in a new userdata type that would allow you to get
to the second [2] dimension. I would provide a safe member function,
with bounds checks so you don't get a segfault with no error message
if you try to access a value out of bounds.

>    %member bool    m_isIdentity
> %endclass
>
>
> %define a2dACCUR 1e-6
> //%define Round( x ) (int) floor( (x) + 0.5 )

Treat this as a function, the binder doesn't know the difference.

%function double Round(double x)

Regards,
    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