Re: [Vala] valac can read a typelib in place of a vapi binding



Hi Adam,

On Fri, 2011-04-01 at 13:07 -0700, Adam Dingle wrote:
I realized to my surprise today that valac (0.11.7) can read a GObject 
introspection type library in place of a VAPI file!  For example, I can 
specify '--pkg PeasGtk-1.0' on the command line and valac will read 
types from /usr/lib/girepository-1.0/PeasGtk-1.0.typelib, which lets me 
use libpeas types even though there is no libpeas.vapi anywhere.

1. Is this documented somewhere?  How long has this cool feature existed 
without my knowing about it?  :)

It was added a long time ago. In the beginning there were lots of issues
and it is still a work in progress. However, it is usable nowadays for
certain libraries and more improvements are waiting in a branch.

2. Is there a long-term plan to deprecate .vapi files in favor of type 
libraries?  Can type libraries express everything that .vapi files can?

GIR files (vala doesn't read typelibs, it reads the xml versions) cannot
express everything that .vapi files can and probably never will. They
are focused on GObject-based libraries while .vapi can also handle quite
a few other libraries reasonably well.

The plan is to replace our .gi files (old gobject-introspection) by .gir
files (new gobject-introspection) as soon as possible, while still
shipping generated .vapi files.

Jürg




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