From: Rico Tzschichholz Date: Sun, 5 Jan 2014 10:19:10 +0000 (+0100) Subject: librsvg-2.0: Switch to GIR X-Git-Tag: 0.23.2~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=110b25e30b3235c166a21c22ff2cd4169f5c73e2;p=thirdparty%2Fvala.git librsvg-2.0: Switch to GIR This binding is still deprecated and it shipped upstream since 2.26.2. Despite that update it one last time to ship a proper vapi rather than an out-dated erroneous one. --- diff --git a/vapi/Makefile.am b/vapi/Makefile.am index 69612f87e..8d5da2fe7 100644 --- a/vapi/Makefile.am +++ b/vapi/Makefile.am @@ -345,7 +345,6 @@ GIDL_BINDINGS = \ libgnomeui-2.0 \ libgsf-1 \ liboobs-1 \ - librsvg-2.0 \ libsexy \ libsoup-2.2 \ libwnck-1.0 \ @@ -401,6 +400,7 @@ GIR_BINDINGS = \ libnotify \ libpeas-1.0 \ libpeas-gtk-1.0 \ + librsvg-2.0 \ libsoup-2.4 \ libwnck-3.0 \ mx-1.0 \ @@ -690,7 +690,7 @@ libpeas-gtk-1.0: $(GENVAPI) --library $(srcdir)/libpeas-gtk-1.0 --pkg libpeas-1.0 --pkg gtk+-3.0 --metadatadir $(METADATADIR) $(GIRDIR)/PeasGtk-1.0.gir librsvg-2.0: - $(GENVAPI) --library $(srcdir)/librsvg-2.0 $(PACKAGESDIR)/librsvg-2.0/librsvg-2.0.gi + $(GENVAPI) --library $(srcdir)/librsvg-2.0 --pkg gdk-pixbuf-2.0 --pkg gio-2.0 --metadatadir $(METADATADIR) $(METADATADIR)/Rsvg-2.0-custom.vala $(GIRDIR)/Rsvg-2.0.gir libsexy: $(GENVAPI) --library $(srcdir)/libsexy $(PACKAGESDIR)/libsexy/libsexy.gi diff --git a/vapi/librsvg-2.0.vapi b/vapi/librsvg-2.0.vapi index c7e01493d..109261f1c 100644 --- a/vapi/librsvg-2.0.vapi +++ b/vapi/librsvg-2.0.vapi @@ -1,38 +1,64 @@ /* librsvg-2.0.vapi generated by vapigen, do not modify. */ +[CCode (cprefix = "Rsvg", gir_namespace = "Rsvg", gir_version = "2.0", lower_case_cprefix = "rsvg_")] [Deprecated (replacement = "bindings distributed with librsvg-2.0", since = "2.36.2")] namespace Rsvg { + namespace Version { + [CCode (cheader_filename = "librsvg/rsvg.h", cname = "LIBRSVG_MAJOR_VERSION")] + public const int MAJOR; + [CCode (cheader_filename = "librsvg/rsvg.h", cname = "LIBRSVG_MICRO_VERSION")] + public const int MICRO; + [CCode (cheader_filename = "librsvg/rsvg.h", cname = "LIBRSVG_MINOR_VERSION")] + public const int MINOR; + [CCode (cheader_filename = "librsvg/rsvg.h", cname = "LIBRSVG_VERSION")] + public const string STRING; + [CCode (cheader_filename = "librsvg/rsvg.h", cname = "LIBRSVG_CHECK_VERSION")] + public static bool check (int major, int minor, int micro); + } [CCode (cheader_filename = "librsvg/rsvg.h")] public class Handle : GLib.Object { [CCode (has_construct_function = false)] public Handle (); public bool close () throws GLib.Error; + [Deprecated (replacement = "GLib.Object.unref")] public void free (); [CCode (has_construct_function = false)] - public Handle.from_data ([CCode (array_length = false)] uchar[] data, size_t data_len) throws GLib.Error; + public Handle.from_data ([CCode (array_length_cname = "data_len", array_length_pos = 1.1, array_length_type = "gsize")] uint8[] data) throws GLib.Error; [CCode (has_construct_function = false)] public Handle.from_file (string file_name) throws GLib.Error; + [CCode (has_construct_function = false)] + public Handle.from_gfile_sync (GLib.File file, Rsvg.HandleFlags flags, GLib.Cancellable? cancellable = null) throws GLib.Error; + [CCode (has_construct_function = false)] + public Handle.from_stream_sync (GLib.InputStream input_stream, GLib.File? base_file, Rsvg.HandleFlags flags, GLib.Cancellable? cancellable = null) throws GLib.Error; public unowned string get_base_uri (); + [Deprecated (since = "2.36")] public unowned string get_desc (); - public void get_dimensions (Rsvg.DimensionData dimension_data); - public bool get_dimensions_sub (ref Rsvg.DimensionData dimension_data, string id); + public Rsvg.DimensionData get_dimensions (); + public bool get_dimensions_sub (out Rsvg.DimensionData dimension_data, string id); + [Deprecated (since = "2.36")] public unowned string get_metadata (); - public unowned Gdk.Pixbuf get_pixbuf (); - public unowned Gdk.Pixbuf get_pixbuf_sub (string id); - public bool get_position_sub (ref Rsvg.PositionData position_data, string id); + public Gdk.Pixbuf get_pixbuf (); + public Gdk.Pixbuf get_pixbuf_sub (string id); + public bool get_position_sub (out Rsvg.PositionData position_data, string id); + [Deprecated (since = "2.36")] public unowned string get_title (); public bool has_sub (string id); - [CCode (cheader_filename = "librsvg/rsvg-cairo.h")] + public bool read_stream_sync (GLib.InputStream stream, GLib.Cancellable? cancellable = null) throws GLib.Error; public bool render_cairo (Cairo.Context cr); - [CCode (cheader_filename = "librsvg/rsvg-cairo.h")] public bool render_cairo_sub (Cairo.Context cr, string id); + public void set_base_gfile (GLib.File base_file); public void set_base_uri (string base_uri); public void set_dpi (double dpi); public void set_dpi_x_y (double dpi_x, double dpi_y); + [Deprecated (replacement = "render_cairo")] public void set_size_callback (owned Rsvg.SizeFunc size_func); - public bool write (uchar[] buf, size_t count) throws GLib.Error; + [CCode (has_construct_function = false)] + public Handle.with_flags (Rsvg.HandleFlags flags); + public bool write ([CCode (array_length_cname = "count", array_length_pos = 1.1, array_length_type = "gsize")] uint8[] buf) throws GLib.Error; public string base_uri { get; set construct; } - public string desc { get; } + [Deprecated] + [NoAccessorMethod] + public string desc { owned get; } [NoAccessorMethod] public double dpi_x { get; set construct; } [NoAccessorMethod] @@ -42,9 +68,15 @@ namespace Rsvg { [NoAccessorMethod] public double ex { get; } [NoAccessorMethod] + public Rsvg.HandleFlags flags { get; construct; } + [NoAccessorMethod] public int height { get; } - public string metadata { get; } - public string title { get; } + [Deprecated] + [NoAccessorMethod] + public string metadata { owned get; } + [Deprecated] + [NoAccessorMethod] + public string title { owned get; } [NoAccessorMethod] public int width { get; } } @@ -60,48 +92,44 @@ namespace Rsvg { public int x; public int y; } + [CCode (cheader_filename = "librsvg/rsvg.h", cprefix = "RSVG_HANDLE_FLAGS_", type_id = "rsvg_handle_flags_get_type ()")] + [Flags] + public enum HandleFlags { + NONE + } [CCode (cheader_filename = "librsvg/rsvg.h", cprefix = "RSVG_ERROR_")] - public enum Error { - FAILED + public errordomain Error { + FAILED; + public static GLib.Quark quark (); } [CCode (cheader_filename = "librsvg/rsvg.h")] + [Deprecated] public delegate void SizeFunc (ref int width, ref int height); [CCode (cheader_filename = "librsvg/rsvg.h")] - public const int LIBRSVG_FEATURES_H; - [CCode (cheader_filename = "librsvg/rsvg.h")] - public const int LIBRSVG_HAVE_CSS; - [CCode (cheader_filename = "librsvg/rsvg.h")] - public const int LIBRSVG_HAVE_SVGZ; - [CCode (cheader_filename = "librsvg/rsvg.h")] - public const int LIBRSVG_MAJOR_VERSION; - [CCode (cheader_filename = "librsvg/rsvg.h")] - public const int LIBRSVG_MICRO_VERSION; - [CCode (cheader_filename = "librsvg/rsvg.h")] - public const int LIBRSVG_MINOR_VERSION; - [CCode (cheader_filename = "librsvg/rsvg.h")] - public const string LIBRSVG_VERSION; - [CCode (cheader_filename = "librsvg/rsvg.h")] - public static GLib.Quark error_quark (); + public static void cleanup (); [CCode (cheader_filename = "librsvg/rsvg.h")] + [Deprecated (since = "2.36")] public static void init (); - [CCode (cheader_filename = "librsvg/rsvg.h", cname = "librsvg_postinit")] - public static void librsvg_postinit (void* app, void* modinfo); - [CCode (cheader_filename = "librsvg/rsvg.h", cname = "librsvg_preinit")] - public static void librsvg_preinit (void* app, void* modinfo); [CCode (cheader_filename = "librsvg/rsvg.h")] - public static unowned Gdk.Pixbuf pixbuf_from_file (string file_name) throws GLib.Error; + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file (string file_name) throws GLib.Error; [CCode (cheader_filename = "librsvg/rsvg.h")] - public static unowned Gdk.Pixbuf pixbuf_from_file_at_max_size (string file_name, int max_width, int max_height) throws GLib.Error; + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file_at_max_size (string file_name, int max_width, int max_height) throws GLib.Error; [CCode (cheader_filename = "librsvg/rsvg.h")] - public static unowned Gdk.Pixbuf pixbuf_from_file_at_size (string file_name, int width, int height) throws GLib.Error; + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file_at_size (string file_name, int width, int height) throws GLib.Error; [CCode (cheader_filename = "librsvg/rsvg.h")] - public static unowned Gdk.Pixbuf pixbuf_from_file_at_zoom (string file_name, double x_zoom, double y_zoom) throws GLib.Error; + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file_at_zoom (string file_name, double x_zoom, double y_zoom) throws GLib.Error; [CCode (cheader_filename = "librsvg/rsvg.h")] - public static unowned Gdk.Pixbuf pixbuf_from_file_at_zoom_with_max (string file_name, double x_zoom, double y_zoom, int max_width, int max_height) throws GLib.Error; + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file_at_zoom_with_max (string file_name, double x_zoom, double y_zoom, int max_width, int max_height) throws GLib.Error; [CCode (cheader_filename = "librsvg/rsvg.h")] public static void set_default_dpi (double dpi); [CCode (cheader_filename = "librsvg/rsvg.h")] public static void set_default_dpi_x_y (double dpi_x, double dpi_y); [CCode (cheader_filename = "librsvg/rsvg.h")] + [Deprecated (since = "2.36")] public static void term (); } diff --git a/vapi/metadata/Rsvg-2.0-custom.vala b/vapi/metadata/Rsvg-2.0-custom.vala new file mode 100644 index 000000000..46f1a6fa1 --- /dev/null +++ b/vapi/metadata/Rsvg-2.0-custom.vala @@ -0,0 +1,37 @@ +namespace Rsvg { + public class Handle : GLib.Object { + [Deprecated (since = "2.36")] + public unowned string get_desc (); + [Deprecated (replacement = "GLib.Object.unref")] + public void free (); + [Deprecated (replacement = "render_cairo")] + public void set_size_callback (owned Rsvg.SizeFunc size_func); + [Deprecated (since = "2.36")] + public unowned string get_title (); + [Deprecated (since = "2.36")] + public unowned string get_metadata (); + } + + namespace Version { + [CCode (cname = "LIBRSVG_CHECK_VERSION")] + public static bool check (int major, int minor, int micro); + } + + [Deprecated] + public delegate void SizeFunc (ref int width, ref int height); + + [Deprecated (since = "2.36")] + public static void init (); + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file (string file_name) throws GLib.Error; + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file_at_max_size (string file_name, int max_width, int max_height) throws GLib.Error; + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file_at_size (string file_name, int width, int height) throws GLib.Error; + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file_at_zoom (string file_name, double x_zoom, double y_zoom) throws GLib.Error; + [Deprecated] + public static Gdk.Pixbuf pixbuf_from_file_at_zoom_with_max (string file_name, double x_zoom, double y_zoom, int max_width, int max_height) throws GLib.Error; + [Deprecated (since = "2.36")] + public static void term (); +} diff --git a/vapi/metadata/Rsvg-2.0.metadata b/vapi/metadata/Rsvg-2.0.metadata new file mode 100644 index 000000000..32cf9b619 --- /dev/null +++ b/vapi/metadata/Rsvg-2.0.metadata @@ -0,0 +1,4 @@ +Rsvg deprecated_since="2.36.2" replacement="bindings distributed with librsvg-2.0" + +*_VERSION parent="Rsvg.Version" name="(.+)_VERSION" +VERSION parent="Rsvg.Version" name="STRING" diff --git a/vapi/packages/librsvg-2.0/librsvg-2.0.deps b/vapi/packages/librsvg-2.0/librsvg-2.0.deps deleted file mode 100644 index 4cbbfb49e..000000000 --- a/vapi/packages/librsvg-2.0/librsvg-2.0.deps +++ /dev/null @@ -1,4 +0,0 @@ -pango -cairo -gio-2.0 -gdk-pixbuf-2.0 diff --git a/vapi/packages/librsvg-2.0/librsvg-2.0.files b/vapi/packages/librsvg-2.0/librsvg-2.0.files deleted file mode 100644 index 577298282..000000000 --- a/vapi/packages/librsvg-2.0/librsvg-2.0.files +++ /dev/null @@ -1,2 +0,0 @@ -include/librsvg-2 -lib/librsvg-2.so diff --git a/vapi/packages/librsvg-2.0/librsvg-2.0.gi b/vapi/packages/librsvg-2.0/librsvg-2.0.gi deleted file mode 100644 index 65d22a758..000000000 --- a/vapi/packages/librsvg-2.0/librsvg-2.0.gi +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vapi/packages/librsvg-2.0/librsvg-2.0.metadata b/vapi/packages/librsvg-2.0/librsvg-2.0.metadata deleted file mode 100644 index 8361e23c9..000000000 --- a/vapi/packages/librsvg-2.0/librsvg-2.0.metadata +++ /dev/null @@ -1,11 +0,0 @@ -Rsvg cheader_filename="librsvg/rsvg.h" deprecated_since="2.36.2" replacement="bindings distributed with librsvg-2.0" -RsvgDimensionData is_value_type="1" has_type_id="0" -RsvgPositionData is_value_type="1" has_type_id="0" -RsvgSizeFunc.width is_ref="1" -RsvgSizeFunc.height is_ref="1" -rsvg_handle_get_dimensions_sub.dimension_data is_ref="1" -rsvg_handle_get_position_sub.position_data is_ref="1" -rsvg_handle_render_cairo* cheader_filename="librsvg/rsvg-cairo.h" -rsvg_handle_new_from_data.data is_array="1" no_array_length="1" -rsvg_handle_set_size_callback.size_func transfer_ownership="1" -rsvg_handle_set_size_callback.user_data_destroy hidden="1" diff --git a/vapi/packages/librsvg-2.0/librsvg-2.0.namespace b/vapi/packages/librsvg-2.0/librsvg-2.0.namespace deleted file mode 100644 index 723271669..000000000 --- a/vapi/packages/librsvg-2.0/librsvg-2.0.namespace +++ /dev/null @@ -1 +0,0 @@ -Rsvg