[emerillon] Added GObject introspection support



commit 7e38afe068f8a0dbae33c6e5888b859be9c95834
Author: Å?ukasz JernaÅ? <deejay1 srem org>
Date:   Sun May 16 12:43:38 2010 +0200

    Added GObject introspection support

 Makefile.am           |    5 ++++-
 configure.ac          |   11 +++++++++++
 emerillon/Makefile.am |   30 +++++++++++++++++++++++++++++-
 emerillon/main.c      |    7 +++++++
 4 files changed, 51 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index c9bd11c..9de7f6a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,5 @@
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+
 SUBDIRS = cut-paste emerillon data plugins po bindings docs
 
 EXTRA_DIST = 			\
@@ -12,7 +14,8 @@ DISTCLEANFILES = 		\
 DISTCHECK_CONFIGURE_FLAGS =		\
 	--disable-scrollkeeper		\
 	--disable-schemas-install	\
-	--enable-gtk-doc
+	--enable-gtk-doc \
+	--enable-introspection
 
 .PHONY: ChangeLog
 ChangeLog: Makefile.am
diff --git a/configure.ac b/configure.ac
index 4f55962..8058036 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,8 @@ AC_CONFIG_MACRO_DIR([m4])
 AM_MAINTAINER_MODE([enable])
 AM_SILENT_RULES([yes])
 
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
+
 GNOME_MAINTAINER_MODE_DEFINES
 GNOME_COMPILE_WARNINGS([maximum])
 GNOME_DEBUG_CHECK
@@ -124,6 +126,15 @@ fi
 AM_CONDITIONAL(ENABLE_SEARCH, test "x$enable_search" = "xyes")
 # -----------------------------------------------------------
 
+#################
+# Introspection #
+#################
+if test "x$enable_introspection" = "xyes"
+then
+  AC_DEFINE(HAVE_INTROSPECTION, [1], [Enable introspection runtime options])
+fi
+
+
 # Workaround a bug in geoclue.
 EMERILLON_CFLAGS=`echo $EMERILLON_CFLAGS | sed s,/geoclue,,`
 
diff --git a/emerillon/Makefile.am b/emerillon/Makefile.am
index 3f1a605..115d54d 100644
--- a/emerillon/Makefile.am
+++ b/emerillon/Makefile.am
@@ -2,7 +2,7 @@ SUBDIRS =
 
 INCLUDES =								\
 	-I$(top_srcdir)							\
-	-I$(srcdir)								\
+	-I$(srcdir)							\
 	$(EMERILLON_CFLAGS)						\
 	$(WARN_CFLAGS)						\
 	$(DISABLE_DEPRECATED)					\
@@ -39,6 +39,11 @@ emerillon_LDFLAGS = -export-dynamic
 
 emerillon_LDADD = libemerillon.la $(EMERILLON_LIBS)
 
+if HAVE_INTROSPECTION
+EMERILLON_CFLAGS += $(INTROSPECTION_CFLAGS)
+emerillon_LDADD += $(INTROSPECTION_LIBS)
+endif
+
 CLEANFILES = $(BUILT_SOURCES)
 
 headerdir = $(prefix)/include/emerillon- EMERILLON_API_VERSION@/emerillon
@@ -49,5 +54,28 @@ API_H_FILES =			\
 	window.h			\
 	sidebar.h
 
+if HAVE_INTROSPECTION
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS = Emerillon-0.1.gir
+
+  introspection_sources = emerillon.h
+
+  Emerillon-0.1.gir: $(libemerillon_la_SOURCES) $(bin_PROGRAMS)
+  Emerillon_0_1_gir_INCLUDES = GObject-2.0 Gtk-2.0 Clutter-1.0 Champlain-0.4 GtkChamplain-0.4
+  Emerillon_0_1_gir_CFLAGS =  -I$(top_srcdir) $(EMERILLON_CFLAGS) -DEMERILLON_COMPILATION
+  Emerillon_0_1_gir_PROGRAM = ./$(bin_PROGRAMS)
+  Emerillon_0_1_gir_FILES = emerillon.h window.h sidebar.h
+
+  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
+
 dist-hook:
 	cd $(distdir); rm -f $(BUILT_SOURCES)
diff --git a/emerillon/main.c b/emerillon/main.c
index a3ed95b..fa05e96 100644
--- a/emerillon/main.c
+++ b/emerillon/main.c
@@ -28,6 +28,10 @@
 #include <clutter-gtk/clutter-gtk.h>
 #include <ethos/ethos.h>
 
+#ifdef HAVE_INTROSPECTION
+#include <gobject-introspection-1.0/girepository.h>
+#endif
+
 #include <stdlib.h>
 
 #include "manager.h"
@@ -94,6 +98,9 @@ parse_options (int *argc,
   g_option_group_add_entries (position_group, position_entries);
   g_option_group_set_parse_hooks (position_group, NULL, parse_position_options);
   g_option_context_add_group (context, position_group);
+#ifdef HAVE_INTROSPECTION
+  g_option_context_add_group (context, g_irepository_get_option_group ());
+#endif
 
   if (!g_option_context_parse (context, argc, argv, &error))
     {



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