GNOME Bugzilla – Bug 579803
[patch] Cairo.ImageSurface.get_data vapi needs adjustment
Last modified: 2009-04-23 08:32:11 UTC
Please describe the problem: Using current git master, I experience the following Cairo problem: -I am puzzled. I use a Cairo.ImageSurface.get_data in the .vapi it's defined like this: public uchar[] get_data (); -In the .vala code I use uchar[] data = surface.get_data(); -The generated C code however has one more parameter: data = (_tmp1 = cairo_image_surface_get_data (self->priv->surface, &_tmp0), data_length1 = _tmp0, data_size = data_length1, _tmp1); and valac complains of course when compiling: error: too many arguments to function 'cairo_image_surface_get_data' thanks to a tip from crdlb on IRC, I fixed this by modifiying cairo.vapi: index f7f15f9..2e128f2 100644 --- a/vapi/cairo.vapi +++ b/vapi/cairo.vapi @@ -450,6 +450,7 @@ namespace Cairo { public ImageSurface (Format format, int width, int height); [CCode (cname = "cairo_image_surface_create_for_data")] public ImageSurface.for_data ([CCode (array_length = false)] uch + [CCode (array_length = false)] public uchar[] get_data (); public Format get_format (); public int get_width (); Using this, my generated C code looks right now: data = cairo_image_surface_get_data (self->priv->surface); Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Sorry, ignore the few superfluous chars in the above patch. The only change is obviously: + [CCode (array_length = false)] public uchar[] get_data ();
commit 896fac6acc9d699d85215b6538e12ff7723e8a68 Author: Sebastian Spaeth <sebastian@sspaeth.de> Date: Thu Apr 23 10:18:06 2009 +0200 cairo: Fix cairo_image_surface_get_data binding Fixes bug 579803.