Re: glib.defs and gdk.defs



On 08 May 2001 12:03:57 +0800, James Henstridge wrote:
> We should move on with reviewing the defs format.
>  - making a list of the various features in the defs format, and getting
>    all the language binding authors to say which parts they would actually
>    be using in their binding.  Putting this info together, we will have a
>    better idea of what is actually useful in the defs format (and see if
>    there is any dead wood).

For my Tcl bindings I need at a minimum:
    - function names
    - the C types of the arguments
    - the C return type

The defs format lists the function names, but it unfortunately does not
list the exact C type of each argument and return value. Instead it
uses an alias created with "type" or "object" like:

(type
    (alias GtkWidget)
    (in-module (Gtk))
    (gtk-type-id GTK_TYPE_WIDGET)
    ;; ^^^^^^^^
    ;; Should be g-type-id

    (in-c-name "GtkWidget*")
    (inout-c-name "GtkWidget*")
    (out-c-name "GtkWidget**"))

There aren't any of these definitions in gtk.defs. Some rather
complicated syntax for the parameters in define-func is supposed to
indicate in, inout, etc. However it isn't used in gtk.defs.
I'd rather get rid of the alias stuff and just use the C types in
define-func. Or if people are attached to the aliases, how about
including the C types as well?

Features I would like:
    - A way to map from C types to GTypes.
    - Each function definition includes the function's class.

Both can mostly be done automatically, but always require some hand
corrections. If the "type", "object", and "in-module" commands were
actually used, they would give this information.

In short the defs format includes all the information that I need, but I
havent' seen any actual defs with all that information. :)

Mark





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