[vala] librsvg-2.0: Switch to GIR



commit 110b25e30b3235c166a21c22ff2cd4169f5c73e2
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Jan 5 11:19:10 2014 +0100

    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.

 vapi/Makefile.am                                |    4 +-
 vapi/librsvg-2.0.vapi                           |  104 ++++++---
 vapi/metadata/Rsvg-2.0-custom.vala              |   37 +++
 vapi/metadata/Rsvg-2.0.metadata                 |    4 +
 vapi/packages/librsvg-2.0/librsvg-2.0.deps      |    4 -
 vapi/packages/librsvg-2.0/librsvg-2.0.files     |    2 -
 vapi/packages/librsvg-2.0/librsvg-2.0.gi        |  279 -----------------------
 vapi/packages/librsvg-2.0/librsvg-2.0.metadata  |   11 -
 vapi/packages/librsvg-2.0/librsvg-2.0.namespace |    1 -
 9 files changed, 109 insertions(+), 337 deletions(-)
---
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index 69612f8..8d5da2f 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 c7e0149..109261f 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 0000000..46f1a6f
--- /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 0000000..32cf9b6
--- /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"


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