Re: GObject-Introspection



2008/6/2 Johan Dahlin <jdahlin async com br>:
> An alternative here is make a clean break, eg only use this in new
> language bindings and make the typelib/GIR define the API.
>
> For Python I plan to;
> * Convert PyGTK .defs to .xml, still keep them locally
> * Find out the changes between the .gir in gir-repository/upstream and
>   apply fixes/patches on top of them
> * Write a new module, eg pybank which interacts with the typelibs only
>
> That means that the old cruft we collected in PyGTK will only
> be cruft there and not upstream. For future modules we'll use the
> more 'dynamic' bindings as available in pybank.

About the xml format... What is the advantage of having the c library
meta data stored in xml format instead of s-expressions? The .defs
files used for Python bindings are very succinct in comparison to the
ugly .xml files GIR brings to the table. Writing and updating
s-expressions is much easier than xml.

Why is a new XML syntax needed altogether when .defs already exist?
Couldn't that syntax just be extended?

I looked at the gir-repository, I couldn't find anything that makes
writing bindings easier. E.g:

<function name="init" c:identifier="FcInit">
      <return-value>
        <type name="none" c:type="void"/>
      </return-value>
      <parameters>
      </parameters>
    </function>

seem to be roughly the same as:

(define-function init
  (c-name "FcInit")
  (return-type "none")
  (parameters
    '()
  )
)

And presumably, you would still have to hand-write large parts of the
bindings using something analogous to PyGTK's overrides. I can't think
of any automagic that would turn this C function:

  void gtk_label_get (GtkLabel *label, char **text);

to this Python method:

  gtk.Label.get() -> str()

Please tell me if I'm wrong.


-- 
mvh Björn


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