[librsvg/introspection] Add gobject introspection bindings



commit 774c9c96febc735722e0a0c85e3bceb9e571deb7
Author: Daniel Drake <dsd laptop org>
Date:   Sun Oct 30 14:10:26 2011 +0000

    Add gobject introspection bindings
    
    Allow rsvg to be accessed through gobject introspection.
    Add one missing transfer annotation needed by Sugar.

 Makefile.am  |   45 +++++++++++++++++++++++++++++++++++++++++++--
 configure.in |   14 ++++++++++++++
 rsvg.c       |    2 +-
 3 files changed, 58 insertions(+), 3 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 5e3916d..68a7840 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,7 @@
 SUBDIRS = . gdk-pixbuf-loader data tests tools doc
 
+NULL =
+
 ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
 
 if ENABLE_GTK_ENGINE
@@ -75,7 +77,12 @@ librsvg_ RSVG_API_MAJOR_VERSION@_la_SOURCES = \
 	rsvg-gobject.c		\
 	rsvg-file-util.c	\
 	rsvg-xml.c		\
-	rsvg-xml.h
+	rsvg-xml.h		\
+	rsvg.h			\
+	rsvg-cairo.h		\
+	librsvg-features.h 	\
+	librsvg-enum-types.h	\
+	$(NULL)
 
 librsvg_ RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \
 	-I$(top_srcdir) 			\
@@ -200,7 +207,7 @@ EXTRA_DIST =				\
 	librsvg.def			\
 	gtk-doc.make
 
-CLEANFILES = \
+CLEANFILES += \
 	$(enum_sources) \
 	s-enum-types-h s-enum-types-c
 
@@ -244,6 +251,40 @@ s-enum-types-c: $(headers) Makefile
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
 
+if HAVE_INTROSPECTION
+-include $(INTROSPECTION_MAKEFILE)
+
+INTROSPECTION_GIRS = Rsvg- RSVG_API_VERSION@.gir
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
+Rsvg- RSVG_API_VERSION_U@.gir: librsvg- RSVG_API_MAJOR_VERSION@.la
+
+Rsvg_ RSVG_API_VERSION_U@_gir_NAMESPACE = RSVG
+Rsvg_ RSVG_API_VERSION_U@_gir_EXPORT_PACKAGES = librsvg-$(RSVG_API_VERSION)
+Rsvg_ RSVG_API_VERSION_U@_gir_FILES = $(librsvg_ RSVG_API_MAJOR_VERSION@_la_SOURCES)
+Rsvg_ RSVG_API_VERSION_U@_gir_INCLUDES = \
+	GLib-2.0 \
+	GObject-2.0 \
+	Gio-2.0 \
+	cairo-1.0 \
+	Pango-1.0 \
+	GdkPixbuf-2.0 \
+	libxml2-2.0 \
+	$(NULL)
+Rsvg_ RSVG_API_VERSION_U@_gir_CFLAGS = -I$(top_builddir)
+Rsvg_ RSVG_API_VERSION_U@_gir_LIBS = librsvg- RSVG_API_MAJOR_VERSION@.la
+
+girdir = $(datadir)/gir-1.0
+dist_gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
+
+endif # HAVE_INTROSPECTION
+
 # ChangeLog generation
 
 ChangeLog:
diff --git a/configure.in b/configure.in
index 3b294ea..c43e3af 100644
--- a/configure.in
+++ b/configure.in
@@ -21,9 +21,12 @@ dnl ===========================================================================
 
 RSVG_API_VERSION=2.0
 RSVG_API_MAJOR_VERSION=2
+RSVG_API_MINOR_VERSION=0
 
 AC_SUBST([RSVG_API_VERSION])
 AC_SUBST([RSVG_API_MAJOR_VERSION])
+AC_SUBST([RSVG_API_MINOR_VERSION])
+AC_SUBST([RSVG_API_VERSION_U],[AS_TR_SH([$RSVG_API_VERSION])])
 
 dnl ===========================================================================
 
@@ -331,6 +334,16 @@ fi
 AM_CONDITIONAL([BUILD_MISC_TOOLS], [test "x$build_misc_tools" = "xyes"])
 
 dnl ===========================================================================
+dnl Build introspectable bindings
+
+# No automagic please!
+if test -z "$enable_introspection"; then
+  enable_introspection=no
+fi
+
+GOBJECT_INTROSPECTION_CHECK([0.10.8])
+
+dnl ===========================================================================
 
 m4_copy([AC_DEFUN],[glib_DEFUN])
 glib_DEFUN([GLIB_LC_MESSAGES],
@@ -385,6 +398,7 @@ librsvg-$VERSION
 	Build GdkPixbuf loader:         ${enable_pixbuf_loader}
 	Build theme engine:             ${enable_gtk_theme}
 	Build miscellaenous tools:      ${build_misc_tools}
+	Build introspectable bindings:  ${found_introspection}
 	Handle svgz files:              ${test_svgz}
 	Use libcroco for css parsing:   ${test_croco}
 "
diff --git a/rsvg.c b/rsvg.c
index fa60723..38fe111 100644
--- a/rsvg.c
+++ b/rsvg.c
@@ -129,7 +129,7 @@ rsvg_handle_get_pixbuf_sub (RsvgHandle * handle, const char *id)
  * will be returned.  Note that the pixbuf may not be complete until
  * @rsvg_handle_close has been called.
  *
- * Returns: the pixbuf loaded by #handle, or %NULL.
+ * Returns: (transfer full): the pixbuf loaded by #handle, or %NULL.
  **/
 GdkPixbuf *
 rsvg_handle_get_pixbuf (RsvgHandle * handle)



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