From e75900ec549270da4e1ac4440777a0e6a83918a6 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 18 Sep 2018 18:40:38 +0200 Subject: [PATCH] gtk+-3.0: Treat Gtk.IconInfo as GLib.Object which it is since 3.8 This change is backwards incompatible! See https://gitlab.gnome.org/GNOME/vala/issues/663 --- vapi/gtk+-3.0.vapi | 16 +++++----------- vapi/metadata/Gtk-3.0-custom.vala | 5 ----- vapi/metadata/Gtk-3.0.metadata | 7 ++++--- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/vapi/gtk+-3.0.vapi b/vapi/gtk+-3.0.vapi index 2e0755dab..11acd0041 100644 --- a/vapi/gtk+-3.0.vapi +++ b/vapi/gtk+-3.0.vapi @@ -3860,17 +3860,14 @@ namespace Gtk { public static unowned Gtk.IconSet lookup_default (string stock_id); public void remove_default (); } - [CCode (cheader_filename = "gtk/gtk.h", copy_function = "gtk_icon_info_copy", free_function = "gtk_icon_info_free", type_id = "gtk_icon_info_get_type ()")] - [Compact] - public class IconInfo { - [Version (deprecated = true, deprecated_since = "3.8", since = "2.4")] - public Gtk.IconInfo copy (); + [CCode (cheader_filename = "gtk/gtk.h", type_id = "gtk_icon_info_get_type ()")] + [Version (since = "3.8")] + public class IconInfo : GLib.Object { + [CCode (has_construct_function = false)] + protected IconInfo (); [CCode (has_construct_function = false)] [Version (since = "2.14")] public IconInfo.for_pixbuf (Gtk.IconTheme icon_theme, Gdk.Pixbuf pixbuf); - [DestroysInstance] - [Version (deprecated = true, deprecated_since = "3.8", since = "2.4")] - public void free (); [Version (deprecated = true, deprecated_since = "3.14", since = "2.4")] public bool get_attach_points ([CCode (array_length_cname = "n_points", array_length_pos = 1.1)] out Gdk.Point[] points); [Version (since = "3.10")] @@ -3889,17 +3886,14 @@ namespace Gtk { public bool is_symbolic (); [Version (since = "2.4")] public Gdk.Pixbuf load_icon () throws GLib.Error; - [Version (since = "3.8")] public async Gdk.Pixbuf load_icon_async (GLib.Cancellable? cancellable = null) throws GLib.Error; [Version (since = "3.10")] public Cairo.Surface load_surface (Gdk.Window? for_window) throws GLib.Error; [Version (since = "3.0")] public Gdk.Pixbuf load_symbolic (Gdk.RGBA fg, Gdk.RGBA? success_color = null, Gdk.RGBA? warning_color = null, Gdk.RGBA? error_color = null, out bool was_symbolic = null) throws GLib.Error; - [Version (since = "3.8")] public async Gdk.Pixbuf load_symbolic_async (Gdk.RGBA fg, Gdk.RGBA? success_color = null, Gdk.RGBA? warning_color = null, Gdk.RGBA? error_color = null, GLib.Cancellable? cancellable = null, out bool was_symbolic = null) throws GLib.Error; [Version (since = "3.0")] public Gdk.Pixbuf load_symbolic_for_context (Gtk.StyleContext context, out bool was_symbolic = null) throws GLib.Error; - [Version (since = "3.8")] public async Gdk.Pixbuf load_symbolic_for_context_async (Gtk.StyleContext context, GLib.Cancellable? cancellable = null, out bool was_symbolic = null) throws GLib.Error; [Version (deprecated = true, deprecated_since = "3.0", since = "3.0")] public Gdk.Pixbuf load_symbolic_for_style (Gtk.Style style, Gtk.StateType state, out bool was_symbolic = null) throws GLib.Error; diff --git a/vapi/metadata/Gtk-3.0-custom.vala b/vapi/metadata/Gtk-3.0-custom.vala index d16624b6a..9e4a9c4ae 100644 --- a/vapi/metadata/Gtk-3.0-custom.vala +++ b/vapi/metadata/Gtk-3.0-custom.vala @@ -45,11 +45,6 @@ namespace Gtk { public bool load_from_data (string data, ssize_t length = -1) throws GLib.Error; } - [CCode (cheader_filename = "gtk/gtk.h", copy_function = "gtk_icon_info_copy", free_function = "gtk_icon_info_free", type_id = "gtk_icon_info_get_type ()")] - [Compact] - public class IconInfo { - } - [CCode (cheader_filename = "gtk/gtk.h", has_copy_function = false, has_destroy_function = false, has_type_id = false)] public struct RecentData { } diff --git a/vapi/metadata/Gtk-3.0.metadata b/vapi/metadata/Gtk-3.0.metadata index d06320656..ce154b82b 100644 --- a/vapi/metadata/Gtk-3.0.metadata +++ b/vapi/metadata/Gtk-3.0.metadata @@ -459,9 +459,6 @@ EntryBuffer .emit_inserted_text.chars type="uint8[]" array_length_idx=2 .insert_text.chars type="uint8[]" array_length_idx=2 .set_text.chars type="uint8[]" array_length_idx=1 -IconInfo - .copy skip=false - .free skip=false destroys_instance IconSet .get_sizes.sizes type="Gtk.IconSize[]" .render_icon*.size type="Gtk.IconSize" @@ -591,6 +588,10 @@ test_init.argvp unowned *.string name="str" *.*.string name="str" +// Broken backwards compat +////////////////////////// +IconInfo since="3.8" + // Forward upstream /////////////////// Widget -- 2.47.2