[Vala] Fwd: Questions about vapi files writing

2011/11/16 Giulio Paci <giuliopaci interfree it>:
Hi to all,
       I am trying to (re)write Vala bindings for libcurl.

I started following the instruction in this page
and using information from this page

Add to your list of useful information:

[1] https://live.gnome.org/Vala/Manual/Attributes

There are lot of annotations you must add to your code in order to do
what you want to.

At last I got a libcurl.gi that was close to what I expected and I tried
to write a metadata file to get an usable vapi file. Unfortunately I
have some problems completing the task.

I have attached an example containing some of the problem I am currently
facing. The libcurl.vapi.target is the desired vapi file, while the
libcurl.vapi is obtained from libcurl.gi and libcurl.metadata using
vapigen (0.14).

Are there GLib bindings of libcurl?

This is because Vala is moving to GIR and is easy to make glibcurl
could generate GObject-Introspection information, using annotations
inside the GLib/C code, then generate the Vala bindigs: Advantage: you
will help lot others languages (not just Vala) to use libcurl like
Python, JavaScript and other with support of GObject Introspection.

The main issues are:
1) How can I specify that a method (curl_easy_init) is the constructor
of a class (EasyHandle)?
2) How can I instruct vapigen that a function is a method of a class and
not a static function?
3) How can I instruct vapigen to put a cname attibute where needed (e.g.
for the EasyHandle class or the Code enumeration)?
4) How can I handle an enumeration value with a different prefix from
all the other values (e.g.: the last value in the Code enumeration)?
5) Is there any way I can put a static function in a nested namespace
(e.g.: Curl.Global.init())?

Most of this questions can be solved by see at Attributes is [1]
above. I'm not realy sure how to add that annotations using metadata,
but you can add custom code instead.

Thank you for your help.


vala-list mailing list
vala-list gnome org

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