[Vala] Asynchronous construction

2012-03-27 Thread tomw
Hi, trying to make the gfreenect [1] library work with Vala and in particular to deal with the missing asynchronous constructor support I was running into some issues. The vapi [2] is generated from GIR. The corresponding code in C is pretty straight forward and would look like this: static

Re: [Vala] Asynchronous construction

2012-03-27 Thread Jens Georg
Hi, [Freenect C init sample ] Trying to implement that in Vala, I took the approach below. It seems however, that the init_async does not work. Looking at the generated C-Code it looks like the g_async_initable_init_finish method is called right after init_async an not with in the

Re: [Vala] Asynchronous construction

2012-03-27 Thread tomw
On Di, 2012-03-27 at 11:59 +0200, Jens Georg wrote: try { debug (Trying to run init_async); bool re = yield device.init_async (Priority.DEFAULT, cancellable); ^^ this yield returns to main loop and once init_async calls its call-back will call

Re: [Vala] Asynchronous construction

2012-03-27 Thread Jens Georg
On Di, 2012-03-27 at 12:24 +0200, tomw wrote: On Di, 2012-03-27 at 11:59 +0200, Jens Georg wrote: try { debug (Trying to run init_async); bool re = yield device.init_async (Priority.DEFAULT, cancellable); ^^ this yield returns to main loop and once

Re: [Vala] Asynchronous construction

2012-03-27 Thread tomw
gfreenect_device_new_finished is just calling _async_initable_new_finish which calls async_initable_finish, same for _device_new. Removing the subdevices property stops the crashing here. looking at the gfreenect code that isn't used at all:

[Vala] vapigen and Autotools problem

2012-03-27 Thread Alejandro T. Colombini
Hi, vala-list. Before anything else, I have to say I'm new to Vala and also to vapigen usage. I've been working on a library which uses GObject and GTK + and is written in C, now other developers are going to use this library to write an application, but they will do it using Vala, so I'm

Re: [Vala] vapigen and Autotools problem

2012-03-27 Thread Alejandro T Colombini Gómez
August, I just didn't know that. Reading the documentation and looking at an official gnome project (GDA, that does the same thing I was trying to do) I though it was the only way to bind C to Vala. And the other developers I mentioned are using Vala by the first time, too. If I can do this

Re: [Vala] vapigen and Autotools problem

2012-03-27 Thread august
Alejandro, Is there a reason to create a .vapi file? Couldn't your vala developers just use the .gir file? AFAIK, that is the preferred method for binding to vala if you are already writing gobject libs. -august. Hi, vala-list. Before anything else, I have to say I'm new to Vala and

Re: [Vala] vapigen and Autotools problem

2012-03-27 Thread Alejandro T Colombini Gómez
Abderrahim, I did. In fact I needed to, in order to generate the Sql-0.1.gir and the subsequent .girs'. I noted that the name the error gives to the package is not the same I gave it when exporting it. I called it gvn-0.1 and the error talks about Gvn-0.1, which is not a correct package name.

Re: [Vala] vapigen and Autotools problem

2012-03-27 Thread august
August, I just didn't know that. Reading the documentation and looking at an official gnome project (GDA, that does the same thing I was trying to do) I though it was the only way to bind C to Vala. And the other developers I mentioned are using Vala by the first time, too. If I can do