Re: [Vala] [PATCH] Belongs_to and is_instance for vapigen



On Fri, 2010-10-01 at 22:49 -0400, tecywiz121 wrote:
> On Tue, 2010-09-28 at 10:15 -0700, Evan Nemerson wrote:
> > On Mon, 2010-09-27 at 17:34 -0400, tecywiz121 wrote:
> > > Hello vala developers!
> > > 
> > > I updated my old patch adding belongs_to and is_instance options to
> > > vapigen, and I was wondering if I could get them included in vapigen.
> > > They are quite useful in wrapping not-entirely-glib libraries.
> > 
> > How is belongs_to different from parent?
> 
> Okay, so I tried my generation with parent instead of belongs_to.  I got
> a bunch of errors along the lines of:
> 
> error: `cp.Body' is not a type
> 
> Even though the classes are defined in my chipmunk-custom.vala file.
> Correct me if I am wrong, but I think the way parent works is by adding
> functions to a type that was parsed by vala-gen-introspect.  Belongs_to
> will add the function to types that are defined near the end of
> generating the vapi file.

No, the symbols are added to a list which for which processing is
deferred until all other symbols have been processed. See [1]. The patch
which added initial support for parent is at [2]. There are examples of
its use in gtk+-2.0, gtk+-3.0, and libsoup-2.4.

It's hard to know exactly what is going on without an example--can you
post the gidl and metadata somewhere?


-Evan

[1]
http://git.gnome.org/browse/vala/tree/vapigen/valagidlparser.vala?id=a95f05c42519bbd6ffd4fda1e274504b31dbb48b#n401
[2]
http://git.gnome.org/browse/vala/commit/?id=6491d670d4608a39443ada0d02ffb22623bac3fc



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