Table of Contents

wxEuphoria Developers

Information about extending or debugging the library


All of the tools and scripts mentioned below can be found in the developer's download from the download section of the wxEuphoria home page.

If you look at the files, you'll see that I'm trying to maintain only one set of files, with platform specific code bracketed and commented out as appropriate:

     ...platform independent code goes here...

--#WIN32 ...win32 specific stuff goes here... --#ENDWIN32

...platform independent code goes here...

--#LINUX ...linux specific stuff goes here... --#ENDLINUX

...platform independent code goes here...

I have a Perl script (yeah, yeah, I'll probably rewrite it into Euphoria some day) called platform.pl, which comments and uncomments based on the target platform.

Of course, you'll also have to regenerate the imports when switching platforms. This is done using generate.exw (which will run under Linux). It looks at the appropriate database for the platform you're interested in, and allows a choice of files to generate. If the file doesn't exist, it will create the file, but you won't have anything other than a file of imports (and a couple of standard include statements).

Contributing to the library

I welcome and encourage others to extend the library, improving the wrappers that I've already written and wrapping new classes. If you take a look at the wxWidgets documentation, you'll see that there are a LOT of classes, and pretty much all of them are available to wxEuphoria, once the proper wrapper is generated. Please refer to the documentation in the developer's package for details on using the wxEuphoria developer tools.

If you do want to contribute something, please send the source to me, with your additions or modifications clearly marked with your initials:

    -- begin mwl 1/23/04 

-- new code....

-- end mwl 1/23/04

...will be perfect. The same goes for modifications to wxWidgets source (which might be required in some cases). Also, please document your wrappers using the same format as the rest of the library, so that it can be easily included in the wxEuphoria documentation, which is automatically generated from the source files.

  • func call_back_member( integer rid, integer params )   
  • func call_cdecl( atom func, object params )   
  • func call_cdecl_s( atom func, object params )   
  • func call_cdecl_str( atom func, object params )   
  • func call_member( atom fptr, atom this, object params )   
  • func call_member_s( atom fptr, atom this, object params )   
  • func call_member_str( atom fptr, atom this, object params )   
  • proc create_func( integer class, integer id )   
  • func define_class(sequence name, atom hlib, atom constructor,integer bytes, atom destructor )   
  • func deref_instance( object this )   
  • func derived_class( sequence name, integer parent, atom hlib, sequence overrides, integer bytes )   
  • func get_constructor( integer class )   
  • func get_destructor( integer class )   
  • func new_control( integer class, atom this, sequence params, sequence default )   
  • func new_instance( integer class_ix, atom this, sequence params )   
  • proc register_instance( atom this, integer class )   
  • proc set_destructor( integer class, integer dtor )   


    Table of Contents

    [func]
    call_back_member
    ( integer rid, integer params )

    Category: wxEuphoria Developers

    Creates a callback with the appropriate calling convention and parameters by platform. This is no longer needed. You may use Euphoria's built-in call_back() function to create a cdecl callback:

        my_callback = call_back( '+' & my_routine_id )
    

    See Also: call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    call_cdecl
    ( atom func, object params )

    Category: wxEuphoria Developers

    See Also: call_back_member, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    call_cdecl_s
    ( atom func, object params )

    Category: wxEuphoria Developers

    See Also: call_back_member, call_cdecl, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    call_cdecl_str
    ( atom func, object params )

    Category: wxEuphoria Developers

    Calls a function using the appropriate calling convention by platform, and returns a wxString. If a function returns a wxString by value, you need to use this instead of call_member(), or else your application will crash. You are responsible for calling delete_instance() or delete_string() on the returned pointer.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    call_member
    ( atom fptr, atom this, object params )

    Category: wxEuphoria Developers

    Calls a member function using the appropriate calling convention by platform, and returns an unsigned value.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    call_member_s
    ( atom fptr, atom this, object params )

    Category: wxEuphoria Developers

    Calls a member function using the appropriate calling convention by platform, and returns a signed value.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    call_member_str
    ( atom fptr, atom this, object params )

    Category: wxEuphoria Developers

    Calls a member function using the appropriate calling convention by platform, and returns a wxString. If a function returns a wxString by value, you need to use this instead of call_member(), or else your application will crash. You are responsible for calling delete_instance() or delete_string() on the returned pointer.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [proc]
    create_func
    ( integer class, integer id )

    Category: wxEuphoria Developers

    This registers a function as the create function for a class, so that a user can call create() without having to know the specific function required to create an object of the class. Your create function should take one sequence as a parameter. The sequence will contain any required parameters. You should only use a create function if there is some manipulation required before creation, such as creating a wxString, wxSize or wxPoint, otherwise, create() can handle the creation of the object.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    define_class
    (sequence name, atom hlib, atom constructor,integer bytes, atom destructor )

    Category: wxEuphoria Developers

    Used to wrap a C++ class.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    deref_instance
    ( object this )

    Category: wxEuphoria Developers

    Dereferences an object so that it cannot be destroyed by wxEuphoria. Use this if wxWidgets takes ownership of an object, and will delete it automatically.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    derived_class
    ( sequence name, integer parent, atom hlib, sequence overrides, integer bytes )

    Category: wxEuphoria Developers

    Used to derive a class from another. This is rarely (if ever) needed in wxEuphoria.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, get_constructor, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    get_constructor
    ( integer class )

    Category: wxEuphoria Developers

    Returns the constructor for the class.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_destructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    get_destructor
    ( integer class )

    Category: wxEuphoria Developers

    If the return value is negative, then its absolute value is the routine id of a user supplied destructor routine.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, new_control, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    new_control
    ( integer class, atom this, sequence params, sequence default )

    Category: wxEuphoria Developers

    This is a generic create function that can be used by other create routines that use default arguments. It assumes that the arguments passed are:

    Additionally, there can be an arbitrary number of other params. new_control() will create the wxPoint and wxPosition objects for (x,y) and (cx,cy), and will create the wxString for caption. Most controls use this format in their constructors, and this function should make it easier to write the Euphoria wrapper for the constructors.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_instance, register_instance, set_destructor



    Table of Contents

    [func]
    new_instance
    ( integer class_ix, atom this, sequence params )

    Category: wxEuphoria Developers

    Allocates space, calls the constructor and registers a new instance of a class.

    This function should only be called by create_func 's. You should use create() to create new instances of objects.

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, register_instance, set_destructor



    Table of Contents

    [proc]
    register_instance
    ( atom this, integer class )

    Category: wxEuphoria Developers

    Registers an instance of a class, so that delete_instance() can be used to destroy it. This does not need to be done for objects created with new_instance().

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, set_destructor



    Table of Contents

    [proc]
    set_destructor
    ( integer class, integer dtor )

    Category: wxEuphoria Developers

    Sets the destructor for the class to dtor, where dtor is the routine id of a user supplied procedure that will be called instead of a wxWidgets supplied destructor. The procedure should take one atom (this pointer) as its arguments, and should free the memory allocated by the object (because wxEuphoria won't).

      ex:
        global procedure delete_string( atom string )
            deref_string( string )
            free(string)
        end procedure
        set_destructor( wxString, routine_id("delete_string"))
    

    See Also: call_back_member, call_cdecl, call_cdecl_s, call_cdecl_str, call_member, call_member_s, call_member_str, create_func, define_class, deref_instance, derived_class, get_constructor, get_destructor, new_control, new_instance, register_instance