[eog] Add the necessary machinery to generate the introspection data from eog



commit b316c9e0b30a8c6d67feb8f21a20268e18c8cc3d
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Aug 9 00:55:11 2010 +0300

    Add the necessary machinery to generate the introspection data from eog
    
    Annotations are still missing, but this provides enough for basic
    introspection usage
    
    https://bugzilla.gnome.org/show_bug.cgi?id=626257

 configure.ac    |   11 +++++++++++
 src/Makefile.am |   44 ++++++++++++++++++++++++++++++++++++--------
 src/main.c      |    6 ++++++
 3 files changed, 53 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4528a00..570798a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,16 @@ EOG_MODULES="gtk+-3.0 >= $GTK_REQUIRED \
              libpeas-1.0 >= 0.7.0 \
              libpeas-gtk-1.0 >= 0.7.0"
 
+# Introspection
+GOBJECT_INTROSPECTION_CHECK([0.9.3])
+
+if test "$found_introspection" = "yes"; then
+	have_introspection=yes
+	AC_DEFINE([HAVE_INTROSPECTION], [1], [Define to enable GObject Introspection])
+else
+	have_introspection=no
+fi
+
 # ***************
 # ZLIB (required)
 # ***************
@@ -499,4 +509,5 @@ Configure summary:
 	JPEG support ...............:  ${have_jpeg}
 	Colour management support ..:  ${have_lcms}
 	D-Bus activation............:  ${have_dbus}
+	GObject Introspection.......:  ${have_introspection}
 "
diff --git a/src/Makefile.am b/src/Makefile.am
index 6bbe43d..a6672fc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -67,7 +67,7 @@ INST_H_FILES =				\
 	eog-job-queue.h			\
 	eog-jobs.h
 
-libeog_la_SOURCES =			\
+libeog_c_files = 			\
 	eog-application.c		\
 	eog-session.c			\
 	eog-debug.c			\
@@ -104,7 +104,10 @@ libeog_la_SOURCES =			\
 	eog-plugin-engine.c            	\
 	eog-clipboard-handler.c		\
 	uta.c				\
-	zoom.c				\
+	zoom.c
+
+libeog_la_SOURCES =			\
+	$(libeog_c_files)		\
 	$(BUILT_SOURCES)		\
 	$(NOINST_H_FILES)		\
 	$(INST_H_FILES)
@@ -113,7 +116,7 @@ if HAVE_EXIF
 INST_H_FILES +=				\
 	eog-exif-util.h			\
 	eog-exif-details.h
-libeog_la_SOURCES +=			\
+libeog_c_files +=			\
 	eog-exif-util.c			\
 	eog-exif-details.c
 endif
@@ -138,12 +141,10 @@ libeog_la_SOURCES +=			\
 	eog-exif-details.c
 endif HAVE_EXEMPI
 
-libeog_la_CFLAGS =						\
+libeog_la_CPPFLAGS =						\
 	-I$(top_srcdir)/jpegutils				\
 	-I$(top_srcdir)/cut-n-paste/toolbar-editor		\
 	-I$(top_srcdir)/cut-n-paste/totem-screensaver		\
-	$(EOG_CFLAGS)						\
-	$(WARN_CFLAGS)						\
 	-DG_LOG_DOMAIN=\"EOG\"					\
 	-DEOG_PREFIX=\""${prefix}"\"				\
 	-DEOG_DATA_DIR=\""$(pkgdatadir)"\"			\
@@ -151,6 +152,10 @@ libeog_la_CFLAGS =						\
 	-DEOG_PIXMAPS_DIR=\""$(datadir)/pixmaps/eog"\"		\
 	-DEOG_PLUGIN_DIR=\""$(libdir)/eog/plugins"\"
 
+libeog_la_CFLAGS =						\
+	$(EOG_CFLAGS)						\
+	$(WARN_CFLAGS)
+
 libeog_la_LIBADD = \
 	$(EOG_LIBS)
 
@@ -182,7 +187,8 @@ eog_CFLAGS = 							\
 	-I$(top_srcdir)/cut-n-paste/totem-screensaver		\
 	$(EOG_CFLAGS)						\
 	-DEOG_DATA_DIR=\""$(pkgdatadir)"\"			\
-	-DEOG_LOCALE_DIR=\""$(datadir)/locale"\"
+	-DEOG_LOCALE_DIR=\""$(datadir)/locale"\"                \
+	$(INTROSPECTION_CFLAGS)
 
 eog_LDADD = 				\
 	libeog.la			\
@@ -190,7 +196,8 @@ eog_LDADD = 				\
 	$(LIBJPEG)			\
 	$(toolbar_LIB)			\
 	$(screensaver_LIB)		\
-	$(jpeg_LIB)
+	$(jpeg_LIB)			\
+	$(INTROSPECTION_LIBS)
 
 eog_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
 
@@ -229,6 +236,27 @@ endif
 
 CLEANFILES = $(BUILT_SOURCES)
 
+if HAVE_INTROSPECTION
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS = Eog-3.0.gir
+INTROSPECTION_SCANNER_ARGS = -I$(top_srcdir) --warn-all $(libeog_la_CPPFLAGS)
+
+Eog-3.0.gir: eog
+Eog_3_0_gir_INCLUDES = Gtk-3.0
+Eog_3_0_gir_FILES = $(INST_H_FILES) $(libeog_c_files) $(BUILT_SOURCES)
+Eog_3_0_gir_VERSION = 3.0
+Eog_3_0_gir_PROGRAM = $(builddir)/eog
+Eog_3_0_gir_NAMESPACE = Eog
+Eog_3_0_gir_CFLAGS = $(EOG_CFLAGS)
+girdir = $(datadir)/eog/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/eog/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif
+
 dist-hook:
 	cd $(distdir); rm -f $(BUILT_SOURCES)
 
diff --git a/src/main.c b/src/main.c
index 12788b4..eeefc21 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,6 +30,9 @@
 #include <dbus/dbus-glib-bindings.h>
 #include <gdk/gdkx.h>
 #endif
+#ifdef HAVE_INTROSPECTION
+#include <girepository.h>
+#endif
 
 #include "eog-session.h"
 #include "eog-debug.h"
@@ -200,6 +203,9 @@ main (int argc, char **argv)
 	/* Option groups are free'd together with the context 
 	 * Using gtk_get_option_group here initializes gtk during parsing */
 	g_option_context_add_group (ctx, gtk_get_option_group (TRUE));
+#ifdef HAVE_INTROSPECTION
+	g_option_context_add_group (ctx, g_irepository_get_option_group ());
+#endif
 
 	if (!g_option_context_parse (ctx, &argc, &argv, &error)) {
 		gchar *help_msg;



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