After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 579803 - [patch] Cairo.ImageSurface.get_data vapi needs adjustment
[patch] Cairo.ImageSurface.get_data vapi needs adjustment
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.7.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-22 07:20 UTC by Sebastian Spaeth
Modified: 2009-04-23 08:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Spaeth 2009-04-22 07:20:15 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:
Comment 1 Sebastian Spaeth 2009-04-22 07:22:01 UTC
Sorry, ignore the few superfluous chars in the above patch. The only change is obviously: 

+                [CCode (array_length = false)]
                public uchar[] get_data ();
Comment 2 Jürg Billeter 2009-04-23 08:32:11 UTC
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.