Autogenerating wxEuphoria wrappers

new topic     » topic index » view thread      » older message » newer message

I figured since I've diverged from my original topic, I'd at least give the new thread a proper title. smile

I'm writing a wrapper generator for wxEuphoria. Input function prototypes (like a .h file) and it auto-generates wrappers.

I have a couple more stupid questions. Given this prototype:

wxScrollBar(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSB_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = "scrollBar")

The wrapper code generates:

object WXEUAPI new_wxScrollBar(object parms)
{
int seq_len = ((s1_ptr)SEQ_PTR(parms))->length;

intptr_t parent;
parent = (wxScrollBar*)get_int( parms, 1 );

intptr_t id;
id = (wxScrollBar*)get_int( parms, 2 );

intptr_t pos;
if (seq_len < 3)
pos = wxDefaultPosition else
pos = (wxScrollBar*)get_int( parms, 3 );

intptr_t size;
if (seq_len < 4)
size = wxDefaultSize else
size = (wxScrollBar*)get_int( parms, 4 );

??? style;
if (seq_len < 5)
style = wxSB_HORIZONTAL else
style = ???;

intptr_t validator;
if (seq_len < 6)
validator = wxDefaultValidator else
validator = (wxScrollBar*)get_int( parms, 6 );

object name;
if (seq_len < 7)
name = wxT{"scrollBar") else
name = (wxScrollBar*)get_int( parms, 7 );

wxDeRefDS( parms );
return BOX_INT( new wxScrollBar( parent, id, pos, size, style, validator, name );
}

Again, the ?? indicates where the program doesn't know how to handle a datatype. In this case, it's a long.

How should I be casting the long? And is there anything else obviously wrong with the code? I've got my doubts about the handling of the string literal.

Thanks!

- David

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu