[librsvg] Generate introspection GIR and typelib



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

    Generate introspection GIR and typelib
    
    ... and add some annotations.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663049

 Makefile.am           |   45 ++++++++++++++++++++++++++++++++++++++++++++-
 configure.in          |   14 ++++++++++++++
 rsvg-base-file-util.c |    2 +-
 rsvg-base.c           |    2 +-
 rsvg.c                |    2 +-
 5 files changed, 61 insertions(+), 4 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 5e3916d..2281fd8 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) 			\
@@ -244,6 +251,42 @@ 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 \
+	GdkPixbuf-2.0 \
+	$(NULL)
+Rsvg_ RSVG_API_VERSION_U@_gir_PACKAGES = \
+	Pango-1.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..10df350 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],
@@ -382,6 +395,7 @@ librsvg-$VERSION
 	prefix:                         ${prefix}
 	compiler:                       ${CC}
 	
+	Build introspectable bindings:  ${found_introspection}
 	Build GdkPixbuf loader:         ${enable_pixbuf_loader}
 	Build theme engine:             ${enable_gtk_theme}
 	Build miscellaenous tools:      ${build_misc_tools}
diff --git a/rsvg-base-file-util.c b/rsvg-base-file-util.c
index 2c79c1f..902c436 100644
--- a/rsvg-base-file-util.c
+++ b/rsvg-base-file-util.c
@@ -45,7 +45,7 @@ rsvg_handle_fill_with_data (RsvgHandle * handle,
 
 /**
  * rsvg_handle_new_from_data:
- * @data: The SVG data
+ * @data: (array length=data_len): The SVG data
  * @data_len: The length of #data, in bytes
  * @error: return location for errors
  *
diff --git a/rsvg-base.c b/rsvg-base.c
index b1a2d8b..0e131a0 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -1318,7 +1318,7 @@ rsvg_handle_get_desc (RsvgHandle * handle)
 /**
  * rsvg_handle_get_dimensions
  * @handle: A #RsvgHandle
- * @dimension_data: A place to store the SVG's size
+ * @dimension_data: (out): A place to store the SVG's size
  *
  * Get the SVG's size. Do not call from within the size_func callback, because an infinite loop will occur.
  *
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]