[Vala] vapi and arguments



Hi

I was trying to use the recently released GLib bindings to libfreenect
[1]. Creating a new device (according to the docs) should work like :

using GLib;
using GFreenect;

public class Main : Object 
{

    public GFreenect.Device device;
        
    public Main () {
        device = new Device (0, 
                             0, 
                             null, 
                             on_device_ready);
   }
        
   public void on_device_ready (Device device, AsyncResult result) {
                stdout.printf("Device ready ...\n");
   }
        

   static int main (string[] args) {

        var app = new Main ();

                
        return 0;
   }

}

If I do it like above I get the error message:

error: 1 extra arguments for `void GFreenect.Device.new (int
device_index, uint subdevices, GLib.Cancellable? cancellable)'

if I remove the callback argument I get the error message:

error: too few arguments to function ‘gfreenect_device_new’

The same approach using Python and GI works fine.
 
If I look at the vapi file, it states only two 3 parameters:

public async Device (int device_index, uint subdevices,
GLib.Cancellable? cancellable);

Is it possible, that the generated vapi file (using vapigen from
GFreenect-0.1.gir) is not properly build?

Any idea how can I fix this?

Thanks

[1] https://gitorious.org/gfreenect
-- 
tomw <tomw ubilix com>




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