[libgxps] Add GObject introspection support
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgxps] Add GObject introspection support
- Date: Sat, 8 Oct 2011 15:30:15 +0000 (UTC)
commit ea1dfc11e3639aeada0adcc0743000607623ac64
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sat Oct 8 17:26:10 2011 +0200
Add GObject introspection support
Makefile.am | 7 ++++---
TODO | 1 -
configure.ac | 3 +++
libgxps/Makefile.am | 27 +++++++++++++++++++++++++++
libgxps/gxps-document.c | 4 ++--
libgxps/gxps-file.c | 2 +-
6 files changed, 37 insertions(+), 7 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 50878b4..2535e65 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,6 +15,7 @@ EXTRA_DIST = \
DISTCLEANFILES = \
$(pkgconfig_DATA)
-DISTCHECK_CONFIGURE_FLAGS = \
- --enable-gtk-doc \
- --disable-maintainer-mode
\ No newline at end of file
+DISTCHECK_CONFIGURE_FLAGS = \
+ --enable-gtk-doc \
+ --disable-maintainer-mode \
+ --enable-introspection
diff --git a/TODO b/TODO
index 6ed0d19..52c6013 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,6 @@
General
-------
-- GObject Introspection
- Version API (Check macros)
- Tools: xps2ps, xps2pdf, xps2html, ...
- Regression tests
diff --git a/configure.ac b/configure.ac
index 772b140..0d31018 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,6 +150,9 @@ AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes)
dnl gtk-doc
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+dnl GObject instrospection
+GOBJECT_INTROSPECTION_CHECK([0.10.1])
+
# **********
# Versioning
# **********
diff --git a/libgxps/Makefile.am b/libgxps/Makefile.am
index da00670..c5a4e66 100644
--- a/libgxps/Makefile.am
+++ b/libgxps/Makefile.am
@@ -55,3 +55,30 @@ libgxps_la_LIBADD = \
$(GXPS_LIBS) \
$(LIBJPEG) \
$(LIBTIFF)
+
+CLEANFILES =
+
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all --identifier-prefix=GXPS --symbol-prefix=gxps
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
+if HAVE_INTROSPECTION
+introspection_sources = $(filter-out $(NOINST_H_FILES) gxps-archive.c gxps-fonts.c gxps-images.c gxps-parse-utils.c, $(libgxps_la_SOURCES))
+
+GXPS-0.1.gir: libgxps.la
+GXPS_0_1_gir_INCLUDES = GObject-2.0 Gio-2.0 cairo-1.0
+GXPS_0_1_gir_CFLAGS = $(libgxps_la_CPPFLAGS) $(Gxps_CFLAGS)
+GXPS_0_1_gir_LIBS = libgxps.la
+GXPS_0_1_gir_FILES = $(addprefix $(srcdir)/, $(introspection_sources))
+
+INTROSPECTION_GIRS += GXPS-0.1.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif
\ No newline at end of file
diff --git a/libgxps/gxps-document.c b/libgxps/gxps-document.c
index e4758aa..5a2f79a 100644
--- a/libgxps/gxps-document.c
+++ b/libgxps/gxps-document.c
@@ -479,7 +479,7 @@ gxps_document_get_n_pages (GXPSDocument *doc)
* Creates a new #GXPSPage representing the page at
* index @n_doc in @doc document.
*
- * Returns: a new #GXPSPage or %NULL on error.
+ * Returns: (transfer full): a new #GXPSPage or %NULL on error.
* Free the returned object with g_object_unref().
*/
GXPSPage *
@@ -567,7 +567,7 @@ gxps_document_get_page_for_anchor (GXPSDocument *doc,
* Creates a new #GXPSDocumentStructure representing the document
* structure of @doc.
*
- * Returns: a new #GXPSDocumentStructure or %NULL if document doesn't have a structure.
+ * Returns: (transfer full): a new #GXPSDocumentStructure or %NULL if document doesn't have a structure.
* Free the returned object with g_object_unref().
*/
GXPSDocumentStructure *
diff --git a/libgxps/gxps-file.c b/libgxps/gxps-file.c
index 47d2d92..bbb1d9c 100644
--- a/libgxps/gxps-file.c
+++ b/libgxps/gxps-file.c
@@ -417,7 +417,7 @@ gxps_file_get_n_documents (GXPSFile *xps)
* Creates a new #GXPSDocument representing the document at
* index @n_doc in @xps file.
*
- * Returns: a new #GXPSDocument or %NULL on error.
+ * Returns: (transfer full): a new #GXPSDocument or %NULL on error.
* Free the returned object with g_object_unref().
*/
GXPSDocument *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]