On Wed, Oct 22, 2008 at 3:06 PM, klaas.holwerda <[EMAIL PROTECTED]> wrote:
> John,
>
> I hope you don't mind i keep reporting issues, it just to improve wxLua.
> Most of them i can just change to make them work, but maybe you can
> improve the binding generator.
> If you prefer i report them in separate threads, let me know.
>

No this is fine, but remind me if I accidentally skip over one.

By the way, I'm a little hesitant to do too much work on the bindings
since wxWidgets 3.0 uses doxygen and some sort of stripped down
headers for their docs. In order to keep the bindings updated I'll
probably want to switch to that format and have to completely rewrite
the binder.

> =====================================
> The default values like this are refused.
>
> virtual void BlitBuffer( wxDC* dc, wxRect rect, const wxPoint& bufferpos
> = wxPoint( 0, 0 )  )

The parser probably gags on the extra (). I think a reasonable hack
would be to have something like this as a replacement.

#define wxZeroPoint wxPoint(0,0)

> =====================================
>
> I have no idea, why this member of a class is a problem.
>
>    void SetAlpha( unsigned char* alphadata )
>
> 1>..\..\..\..\wxArt2D\modules\luawraps\src\artbase.cpp(7533) : error
> C2664: 'void a2dImageRGBA::SetAlpha(unsigned char)' : cannot convert
> parameter 1 from 'wxCharBuffer' to 'unsigned char'

Hopefully fixed, I added code to cast the wxCharBuffer (unsigned
char*). However, it does have to be "const unsigned char*" since you
cannot take ownership of the string from Lua. I think wxImage wrappers
have an override that shows how to set the image data from a Lua
string.

> ========================================
>
> These are memebers of a class, i just removed friend, and it is
> compiling, did not actually use it in lua code.
>
>        %operator friend bool operator==(const a2dFont& a, const
> a2dFont& b)
>        %operator friend bool operator!=(const a2dFont& a, const
> a2dFont& b)
>
> I made it:
>
>    %operator bool operator==(const a2dFont& a, const a2dFont& b)
>    %operator bool operator!=(const a2dFont& a, const a2dFont& b)

Probably ok to just remove the friend word as you did. What does it
mean to have a friend function like this in C++?

> =======================================
>
> It seems that a default value like &something is not accepted.
>
>    a2dComEvent( a2dPropObject* sender, const a2dPropertyId& id, const
> wxEventType* eventid = &a2dComEvent::sm_changedProperty  )
>    a2dComEvent( wxObject* sender, a2dNamedProperty* property, const
> wxEventType* id = &sm_changedProperty, bool ownProp = false )
>
>
> ERROR: Expected Parameter Default Value, got Tag='&'. File:
> 'C:/data/art2d/wxArt2D/modules/luawraps/src/general.i':(line 435)
>    '    a2dComEvent( a2dPropObject* sender, const a2dPropertyId& id,
> const wxEventType* eventid = &a2dComEvent::sm_changedProperty  )'
> ERROR: Expected Parameter Default Value, got Tag='&'. File:
> 'C:/data/art2d/wxArt2D/modules/luawraps/src/general.i':(line 436)
>    '    a2dComEvent( wxObject* sender, a2dNamedProperty* property,
> const wxEventType* id = &sm_changedProperty, bool ownProp = false )'
>

I'll look into this.

> =======================================
>
> I don't know why, but a reference to wxUint32 are any other type does
> give a problem in C++.
>
> %class %noclassinfo a2dUint32Property, a2dNamedProperty
>    a2dUint32Property()
>    wxUint32& GetValueRef()
>
>
> 1>        There is no context in which this conversion is possible
> 1>..\..\..\..\wxArt2D\modules\luawraps\src\general.cpp(5161) : error
> C2440: 'initializing' : cannot convert from 'wxUint32 *' to 'wxUint32'
>
>
> static int LUACALL wxLua_a2dUint32Property_GetValueRef(lua_State *L)
> {
>    // get this
>    a2dUint32Property * self = (a2dUint32Property
> *)wxluaT_getuserdatatype(L, 1, wxluatype_a2dUint32Property);
>    // call GetValueRef
>    wxUint32 returns = &self->GetValueRef();
>    // push the result number
>    lua_pushnumber(L, returns);
>
>    return 1;
> }

You can't get & references like this in Lua since it only has double
valued numbers. But, I've fixed the bindings to not put the extra &
before self->GetValueRef().



-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