[totem-pl-parser] Bug 555848 — Add introspection support
- From: Philip Withnall <pwithnall src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [totem-pl-parser] Bug 555848 — Add introspection support
- Date: Mon, 4 Jan 2010 16:22:50 +0000 (UTC)
commit fa45f9b86eb1523e1ee981c6a2aeb28b0230bab5
Author: Philip Withnall <philip tecnocode co uk>
Date: Sat Jan 2 00:26:32 2010 +0000
Bug 555848 â?? Add introspection support
Add complete introspection support to totem-pl-parser, including enough
annotations to ensure the GIR file is accurate. Closes: bgo#555848
Makefile.am | 4 ++-
autogen.sh | 1 +
configure.in | 3 +-
plparse/Makefile.am | 69 +++++++++++++++++++++++++++++++++++---------
plparse/totem-disc.c | 4 +-
plparse/totem-pl-parser.c | 12 ++++----
plparse/totem-pl-parser.h | 6 ++--
7 files changed, 72 insertions(+), 27 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 3a14c52..8394826 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,7 @@
SUBDIRS = lib plparse po docs
+ACLOCAL_AMFLAGS = -I m4
+
EXTRA_DIST = \
COPYING.LIB \
autogen.sh \
@@ -20,7 +22,7 @@ DISTCLEANFILES = intltool-extract intltool-merge intltool-update \
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = totem-plparser.pc totem-plparser-mini.pc
-DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --enable-gtk-doc
+DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --enable-gtk-doc --enable-introspection
# Build ChangeLog from GIT history
ChangeLog:
diff --git a/autogen.sh b/autogen.sh
index 3b24833..dde490f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -5,6 +5,7 @@ srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
PKG_NAME="totem-pl-parser"
+REQUIRED_M4MACROS=introspection.m4
(test -f $srcdir/configure.in) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
diff --git a/configure.in b/configure.in
index 8361d65..464b708 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-AC_PREREQ(2.52)
+AC_PREREQ(2.62)
m4_define(totem_version_major, 2)
m4_define(totem_version_minor, 28)
@@ -121,6 +121,7 @@ AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
GTK_DOC_CHECK(1.11)
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
AC_CONFIG_FILES([
Makefile
diff --git a/plparse/Makefile.am b/plparse/Makefile.am
index 0b4b212..4d6a7f8 100644
--- a/plparse/Makefile.am
+++ b/plparse/Makefile.am
@@ -19,36 +19,39 @@ plparserinclude_HEADERS = \
totem-disc.h \
totem-pl-parser-mini.h
-libtotem_plparser_la_SOURCES = \
+plparser_sources = \
totem-pl-parser-builtins.c \
- totem-pl-parser-builtins.h \
totem-disc.c \
- totem-disc.h \
totem-pl-parser.c \
+ totem-pl-parser-lines.c \
+ totemplparser-marshal.c \
+ totem-pl-parser-media.c \
+ totem-pl-parser-misc.c \
+ totem-pl-parser-pla.c \
+ totem-pl-parser-pls.c \
+ totem-pl-parser-podcast.c \
+ totem-pl-parser-qt.c \
+ totem-pl-parser-smil.c \
+ totem-pl-parser-wm.c \
+ totem-pl-parser-xspf.c
+
+libtotem_plparser_la_SOURCES = \
+ $(plparser_sources) \
+ totem-pl-parser-builtins.h \
+ totem-disc.h \
totem-pl-parser-features.h \
totem-pl-parser.h \
- totem-pl-parser-lines.c \
totem-pl-parser-lines.h \
- totemplparser-marshal.c \
totemplparser-marshal.h \
- totem-pl-parser-media.c \
totem-pl-parser-media.h \
- totem-pl-parser-misc.c \
totem-pl-parser-misc.h \
- totem-pl-parser-pla.c \
totem-pl-parser-pla.h \
- totem-pl-parser-pls.c \
totem-pl-parser-pls.h \
- totem-pl-parser-podcast.c \
totem-pl-parser-podcast.h \
totem-pl-parser-private.h \
- totem-pl-parser-qt.c \
totem-pl-parser-qt.h \
- totem-pl-parser-smil.c \
totem-pl-parser-smil.h \
- totem-pl-parser-wm.c \
totem-pl-parser-wm.h \
- totem-pl-parser-xspf.c \
totem-pl-parser-xspf.h \
xmlparser.h xmlparser.c \
xmllexer.h xmllexer.c \
@@ -163,3 +166,41 @@ EXTRA_DIST = \
totem-pl-parser-features.h.in \
plparser.symbols \
plparser-mini.symbols
+
+# Introspection
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
+if HAVE_INTROSPECTION
+introspection_sources = \
+ $(plparser_sources) \
+ $(plparserinclude_HEADERS)
+
+TotemPlParser.gir: libtotem-plparser.la Makefile
+TotemPlParser_gir_SCANNERFLAGS = --namespace=TotemPlParser --strip-prefix=TotemPlParser
+TotemPlParser_gir_INCLUDES = GObject-2.0 Gtk-2.0
+TotemPlParser_gir_CFLAGS = \
+ $(TOTEM_PLPARSER_CFLAGS) \
+ $(HAL_CFLAGS) \
+ $(DBUS_CFLAGS) \
+ $(AM_CFLAGS) \
+ -D_FILE_OFFSET_BITS=64 \
+ -D_LARGEFILE64_SOURCE \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/lib \
+ -I$(top_builddir)/plparse \
+ -D_GNU_SOURCE
+TotemPlParser_gir_LIBS = libtotem-plparser.la
+TotemPlParser_gir_FILES = $(addprefix $(srcdir)/,$(introspection_sources))
+INTROSPECTION_GIRS += TotemPlParser.gir
+
+girdir = $(datadir)/gir-1.0
+dist_gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(dist_gir_DATA) $(typelib_DATA)
+endif
diff --git a/plparse/totem-disc.c b/plparse/totem-disc.c
index 33c3568..35085ce 100644
--- a/plparse/totem-disc.c
+++ b/plparse/totem-disc.c
@@ -663,7 +663,7 @@ totem_cd_dir_get_parent (const char *dir)
/**
* totem_cd_detect_type_from_dir:
* @dir: a directory URI
- * @mrl: return location for the disc's MRL, or %NULL
+ * @mrl: (out) (transfer full) (allow-none): return location for the disc's MRL, or %NULL
* @error: return location for a #GError, or %NULL
*
* Detects the disc's type, given its mount directory URI. If
@@ -731,7 +731,7 @@ totem_cd_detect_type_from_dir (const char *dir, char **mrl, GError **error)
/**
* totem_cd_detect_type_with_url:
* @device: a device node path
- * @mrl: return location for the disc's MRL, or %NULL
+ * @mrl: (out) (transfer full) (allow-none): return location for the disc's MRL, or %NULL
* @error: return location for a #GError, or %NULL
*
* Detects the disc's type, given its device node path. If
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index 9506f48..788e720 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -1980,11 +1980,11 @@ parse_thread (GSimpleAsyncResult *result, GObject *object, GCancellable *cancell
* totem_pl_parser_parse_with_base_async:
* @parser: a #TotemPlParser
* @uri: the URI of the playlist to parse
- * @base: the base path for relative filenames
+ * @base: (allow-none): the base path for relative filenames, or %NULL
* @fallback: %TRUE if the parser should add the playlist URI to the
* end of the playlist on parse failure
- * @cancellable: optional #GCancellable object, or %NULL
- * @callback: a #GAsyncReadyCallback to call when parsing is finished
+ * @cancellable: (allow-none): optional #GCancellable object, or %NULL
+ * @callback: (allow-none): a #GAsyncReadyCallback to call when parsing is finished
* @user_data: data to pass to the @callback function
*
* Starts asynchronous parsing of a playlist given by the absolute URI @uri, using @base to resolve relative paths where appropriate.
@@ -2021,7 +2021,7 @@ totem_pl_parser_parse_with_base_async (TotemPlParser *parser, const char *uri, c
* totem_pl_parser_parse_with_base:
* @parser: a #TotemPlParser
* @uri: the URI of the playlist to parse
- * @base: the base path for relative filenames
+ * @base: (allow-none): the base path for relative filenames, or %NULL
* @fallback: %TRUE if the parser should add the playlist URI to the
* end of the playlist on parse failure
*
@@ -2075,8 +2075,8 @@ totem_pl_parser_parse_with_base (TotemPlParser *parser, const char *uri,
* @uri: the URI of the playlist to parse
* @fallback: %TRUE if the parser should add the playlist URI to the
* end of the playlist on parse failure
- * @cancellable: optional #GCancellable object, or %NULL
- * @callback: a #GAsyncReadyCallback to call when parsing is finished
+ * @cancellable: (allow-none): optional #GCancellable object, or %NULL
+ * @callback: (allow-none): a #GAsyncReadyCallback to call when parsing is finished
* @user_data: data to pass to the @callback function
*
* Starts asynchronous parsing of a playlist given by the absolute URI @uri. @self and @uri are both reffed/copied
diff --git a/plparse/totem-pl-parser.h b/plparse/totem-pl-parser.h
index 1924d7c..2f62eb6 100644
--- a/plparse/totem-pl-parser.h
+++ b/plparse/totem-pl-parser.h
@@ -318,9 +318,9 @@ GQuark totem_pl_parser_error_quark (void);
* TotemPlParserIterFunc:
* @model: a #GtkTreeModel containing the playlist entries
* @iter: a #GtkTreeIter pointing to the current row
- * @uri: return location for the entry's URI, or %NULL
- * @title: return location for the entry's title, or %NULL
- * @custom_title: return location for a boolean which, if %TRUE, indicates that the entry's @title is custom; or %NULL
+ * @uri: (out) (transfer full): return location for the entry's URI, or %NULL
+ * @title: (out) (transfer full): return location for the entry's title, or %NULL
+ * @custom_title: (out) (transfer full): return location for a boolean which, if %TRUE, indicates that the entry's @title is custom; or %NULL
* @user_data: user data to pass to the function
*
* Functions such as totem_pl_parser_write() accept pointers to TotemPlParserIterFunc()s
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]