Re: [Vala] bindings from vapi



On Tue, Sep 29, 2009 at 4:12 PM, John Carr <john carr unrouted co uk> wrote:

the valac entry point hacked to run my code and then some code to
generate the ctypes bindings.


Hmm.. someone should step up with a GModule-like proposition for the
vala compiler 'driver'. You are not the only one doing this.

On Tue, Sep 29, 2009 at 1:36 PM, pancake <pancake youterm com> wrote:

Should I use libvala?like valadoc does?


Maybe not. Somebody here on the mailing list maybe has information of
using GObjectIntrospection[1] directly.


Is there any example code iterating over
methods, namespaces, arguments of signatures, etc..?

Citing from memory (since I'm at work), in vala's valacompiler.vala
you have the CodeContext which has a "context.root" of type Namespace.

Namespaces can contain nested namespaces
  foreach (var ns in context.root.get_namespaces ())
    ...
Each Vala.Namespace can contain Classes, Structs, free Methods.
(get_classes (), get_structs () etc.)
Each Vala.Class can contain (inner) Classes, Structs, member Methods
(get_methods () etc.)

The important part is to get the _cname_ in the end, for your python FFI.



[1] http://live.gnome.org/GObjectIntrospection



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