[vala/staging] gdk-pixbuf-2.0: Make PixbufSaveFunc usable



commit b98377c8dd7f1f97516de82ab73835d0595ce639
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Jan 9 18:35:39 2019 +0100

    gdk-pixbuf-2.0: Make PixbufSaveFunc usable
    
    This delegates does place its target at the end, where vala expects
    the error parameter. Vala does not support that at this point.
    
    See https://gitlab.gnome.org/GNOME/vala/issues/728

 vapi/gdk-pixbuf-2.0.vapi                | 5 +++--
 vapi/metadata/GdkPixbuf-2.0-custom.vala | 3 ---
 vapi/metadata/GdkPixbuf-2.0.metadata    | 3 ++-
 3 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/vapi/gdk-pixbuf-2.0.vapi b/vapi/gdk-pixbuf-2.0.vapi
index ba9088a64..3320618ed 100644
--- a/vapi/gdk-pixbuf-2.0.vapi
+++ b/vapi/gdk-pixbuf-2.0.vapi
@@ -311,8 +311,9 @@ namespace Gdk {
        }
        [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", instance_pos = 1.9)]
        public delegate void PixbufDestroyNotify ([CCode (array_length = false)] uint8[] pixels);
-       [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", instance_pos = -0.9)]
-       public delegate bool PixbufSaveFunc ([CCode (array_length_type = "gsize")] uint8[] buf) throws 
GLib.Error;
+       [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", instance_pos = 2.9)]
+       [Version (since = "2.4")]
+       public delegate bool PixbufSaveFunc ([CCode (array_length_cname = "count", array_length_pos = 1.5, 
array_length_type = "gsize")] uint8[] buf, out GLib.Error error);
        [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_FEATURES_H")]
        public const int PIXBUF_FEATURES_H;
        [CCode (cheader_filename = "gdk-pixbuf/gdk-pixbuf.h", cname = "GDK_PIXBUF_MAGIC_NUMBER")]
diff --git a/vapi/metadata/GdkPixbuf-2.0-custom.vala b/vapi/metadata/GdkPixbuf-2.0-custom.vala
index df3c07902..64a610b59 100644
--- a/vapi/metadata/GdkPixbuf-2.0-custom.vala
+++ b/vapi/metadata/GdkPixbuf-2.0-custom.vala
@@ -9,7 +9,4 @@ namespace Gdk {
                [Version (deprecated = true, deprecated_since = "2.32")]
                public static Gdk.Pixbuf from_pixdata (Gdk.Pixdata pixdata, bool copy_pixels = true) throws 
GLib.Error;
        }
-
-       [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h", instance_pos = -0.9)]
-       public delegate bool PixbufSaveFunc ([CCode (array_length_type = "gsize")] uint8[] buf) throws 
GLib.Error;
 }
diff --git a/vapi/metadata/GdkPixbuf-2.0.metadata b/vapi/metadata/GdkPixbuf-2.0.metadata
index d8eb92174..e73ab0b24 100644
--- a/vapi/metadata/GdkPixbuf-2.0.metadata
+++ b/vapi/metadata/GdkPixbuf-2.0.metadata
@@ -26,4 +26,5 @@ Pixbuf
         .new_from_data.destroy_fn default=GLib.free
 
 // Bug #666798: delegates which throw exceptions
-PixbufSaveFunc skip
+// Issue #728: Support non-default error parameter position
+PixbufSaveFunc.error out unowned=false


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