gdlmm



Hello all,

The task of wrapping gdl turns out to be rather frustrating :-/ mostly
due to the lack of understandable documentation. Currently i have the
following problems;

- How to wrap a simpel C structure, for example ;
struct _GdlDockRequest {
    GdlDockObject    *applicant;
    GdlDockObject    *target;
    GdlDockPlacement  position;
    GdkRectangle      rect;
    GValue            extra;
};

I tried several of the _CLASS_* macros but they all seem to fail one way
or another, in the documentation it doesn't not mention what the
arguments to the macros should be. Trying to copy the Gdk::Rectangle
source code didn't work.

- How to wrap a enum like the following ;
/* data types & structures */
typedef enum {
    /* the parameter is to be exported for later layout rebuilding */
    GDL_DOCK_PARAM_EXPORT = 1 << G_PARAM_USER_SHIFT,
    /* the parameter must be set after adding the children objects */
    GDL_DOCK_PARAM_AFTER  = 1 << (G_PARAM_USER_SHIFT + 1)
} GdlDockParamFlags;

The generated .defs file by enum.pl (which I found after a long search
in gnome CVS http://cvs.gnome.org/viewcvs/gtkmm-root/tools/ ) doesn'T
like the  G_PARAM_USER_SHIFT part, i had to replace them by hand with 8
and 9 (the resuld ot the G_PARAM_USER_SHIFT + 0 and G_PARAM_USER_SHIFT +
1)


- How to setup convert_gdlmm.m4 so that i can use Glib::RefPtr<> return
values. 

- Do the .defs files have to be hand edited, or should the result of the
scripts like enum.pl be final ? I had to edit them because things like
() in comments cause errors. 

Even though things are going slow and painful the test-dock example is
converted to C++ and works (with a small crash at the end due to some
memory management problems). Of course the fact that the gdl api is
without one a single comment doesn't really help :-/ 

For the C++ API i have some style questions, are reference arguments
preferred to pointer arguments ? When functions return a pointer in C,
what is the preferred return type for the C++ wrapper, and how to decide
between pointer, reference and RefPtr<> ? 

The GDL docking functionality looks very nice, are there plans to split
it of and integrate it with GTK, or will it always be separated, cause
docking is one of the things GTK really is missing at the moment.  GDL
is nice but it has some rather random widgets like GdlComboButton too. 

- Erwin









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]