Re: [Gnome-bindings] Ok, here we go...



One thing you did not put on your list, and that is used heavily at least in
the GtkAda binding is that each time a function takes a "user_data" (this is
true for callbacks and a few other functions like idle and timeouts), it
should provide two versions:

    gtk_connect (foo, gpointer user_data);
       /* for C users' convenience */

    gtk_connect_full (foo, gpointer user_data, DestroyFunc);
       /* for bindings convenience */

It allows the bindings to copy an internal structure compatible with a
gpointer, even if the real type in the binding is not, and still get the
memory management done by gtk+.

For instance, Strings in Ada are not fully compatible with gchar*, since they
also include bounds information. Thus, we do a copy internally that is
compatible with a gchar*/gpointer, and free the allocated memory whenever gtk+
calls DestroyFunc above.

I believe that gtk+ is mostly clean in that regard, I haven't looked carefully
at Gnome yet, and I know that gtk+extra is not compatible.

Emmanuel




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