Delivered-To: garrigue at math.nagoya-u.ac.jp Authentication-Results: mailhost.math.nagoya-u.ac.jp sender=lablgtk-bounces at yquem.inria.fr; domainkey=neutral (no query protocol specified; no policy for yquem.inria.fr) Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=fg91ZOTu2Nmk4XydES28qALnqTh/VMImDLXpWOeT+Ik=; b=BdxMpVrKTi2uOYB6MxqGZL4JgeBZ/N8FTaaALHMwBpMVlR1lV+NK4zQbm19qPRKCFa cSvZ5ArdfK1FXd8jXpHubh09Lsh2q5ueP+c9wdumWQNPjQCr6OKhqWoCLO6MHNugMwNq TJIlfFU9rXHlQfp3DdLD15kP9S3bMIXWfeHR8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=TMiY2z9lK0Q3YNz2t2E/wCteiRrJelBgtMx1jZugYrXYv9mcGF7UnAHj5elJ/Cgt3x 35uf8d0qSpDUDAjpKgc/fyZGD0hRikxtun7sGWvMpwZSgQWX0jKvMBX811wgfzilgm9H KWi+5fDNTSJBpLIp+l2LeG9VbOJbrvUU+tcz0= MIME-Version: 1.0 In-Reply-To: <666572260910040501n79651d01r33566967299a4572 at mail.gmail.com> References: <666572260910040501n79651d01r33566967299a4572 at mail.gmail.com> Date: Mon, 12 Oct 2009 11:51:56 +0200 Message-ID: <666572260910120251r5ac76f62lda0ac557005157e6 at mail.gmail.com> Subject: Re: [Lablgtk] [ANN] ocaml-gir 0.9 alpha - binding generator for glib2-based libs From: Adrien To: lablgtk Content-Type: text/plain; charset=ISO-8859-1 Hi, I managed to sort this after finally sleeping than I had been. Well, I was still a bit tired and solved the wrong problem: it compiles but some of the generated code is never used. Anyway, I found iconview_foreach and used it as a template. Over the week I've also fixed a few other bugs which now let webkit-gtk and dbus-glib binding compile and work (at least partially) and made an -alpha2 release. I've made a screenshot for a 12-line browser with webkit-gtk[1] (12 lines, that's why it has absolutely no bar or menu whatsoever). There are roughly 1700 lines of code generated for the webkit bindings and 1000 for the dbus ones. I don't know if I had said that but the usage is: run ./me.sh , it will create bindings-directory/WebKit-bindings and bindings-directory/DBus-bindings. Have a look in the generated folder, everything is there. Of course, you will need the corresponding libraries and headers. This has been tested successfully on slackware and debian. As last time, the project is hosted on git at the ocamlforge[2] and a tarball is available[3]. There is one problem for the webkit-gtk bindings however: webkit-gtk now requires that "the thread system is initialized" which is done through a call to g_init_thread() which isn't currently available in lablgtk2 (I've seen some commented code reference to it however). Would it be possible that this function is added in future releases? [1]: http://omploader.org/vMmoyYg/ua.png [2]: http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=ocaml-gir/ocaml-gir.git;a=summary [3]: http://forge.ocamlcore.org/frs/?group_id=73&release_id=186 --- Adrien Nader On 04/10/2009, Adrien wrote: > ocaml-gir is an automated binding generator for libaries based on > glib2, using the parsing done by gobject-intropesction[1] (although it > sucks and I may just diss it). > > It is almost able to write bindings for webkit-gtk, dbus-glib and > other libraries. With minor editing (commenting out functions that > couldn't work), I've been able to write a small working browser using > webkit-gtk. > > THe project is hosted on forge.ocamlcore.org . A tarball is available > [2] and git too [3], as well as gitweb [4] (development is done on the > master branch btw). The logic of the code is basically: ocamlgir.ml > parses the .gir (xml) file produced by g-ir-scanner and type.ml holds > functions to translate from the xml tree to a nicer format and finally > there is a .ml file for each file that has to be created (c.ml, > gtk.ml, g.ml, c_tags.ml, h.ml, ...). girstring.ml is a module to > change the casing of a string: FooBarBlaBla <-> FOO_BAR_BLA_BLA <-> > foo_bar_bla_bla. > > What is currently missing is signals/callbacks, inheriting between > libraries (webkit-gtk depends on libsoup) and something about > callbacks I'm not sure how I could do and which is the reason I am > writing this a bit before ocaml-gir is ready. > > For instance, a function takes a DBusGProxyCallNotify* which is > defined as follows: > typedef void (* DBusGProxyCallNotify) > (DBusGProxy *proxy, DBusGProxyCall *call_id, > void *user_data); > How should I write the C conversion macro to/from value? > Thanks. > > And just a word about gobject-introspection: I hate it. =) > > > [1] http://live.gnome.org/GObjectIntrospection > [2] http://forge.ocamlcore.org/frs/?group_id=73&release_id=180 > [3] http://git.ocamlcore.org/ocaml-gir/ocaml-gir.git > [4] > http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=ocaml-gir/ocaml-gir.git;a=summary > > > --- > > Adrien Nader > _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk