[anjuta] add initial gobject-introspection support



commit e530c599124819de15df8bb24ae67821d748ccdd
Author: Abderrahim Kitouni <a kitouni gmail com>
Date:   Tue Jun 8 16:45:41 2010 +0100

    add initial gobject-introspection support

 configure.in                            |   10 ++++--
 libanjuta/Makefile.am                   |   50 ++++++++++++++++++++++++++++++-
 libanjuta/anjuta-project.h              |    4 +-
 libanjuta/anjuta-utils.c                |    4 +-
 plugins/language-support-js/Makefile.am |    2 +-
 5 files changed, 61 insertions(+), 9 deletions(-)
---
diff --git a/configure.in b/configure.in
index 066acd4..a71e27b 100644
--- a/configure.in
+++ b/configure.in
@@ -45,6 +45,7 @@ GDA_REQUIRED=4.1.6
 UNIQUE_REQUIRED=1.0.0
 VALA_REQUIRED=0.7.8
 LIBGRAPHVIZ_REQUIRED=1.0
+GI_REQUIRED=0.6.6
 
 AC_SUBST(GLIB_REQUIRED)
 AC_SUBST(GDK_PIXBUF_REQUIRED)
@@ -124,11 +125,14 @@ AC_PATH_PROG(GCONFTOOL, gconftool-2)
 AM_GCONF_SOURCE_2
 
 dnl ***************************************************************************
-dnl Set gjsdir && girdir
+dnl Check for GObject-Introspection
+dnl ***************************************************************************
+GOBJECT_INTROSPECTION_CHECK([$GI_REQUIRED])
+
+dnl ***************************************************************************
+dnl Set gjsdir
 dnl ***************************************************************************
-girdir=`pkg-config --variable=girdir gobject-introspection-1.0`
 gjsdir=`pkg-config --variable=jsdir gjs-1.0`
-AC_SUBST(girdir)
 AC_SUBST(gjsdir)
 
 dnl ***************************************************************************
diff --git a/libanjuta/Makefile.am b/libanjuta/Makefile.am
index 2a8742d..14bad0b 100644
--- a/libanjuta/Makefile.am
+++ b/libanjuta/Makefile.am
@@ -205,6 +205,54 @@ EXTRA_DIST = \
 DISTCLEANFILES = \
   anjuta-enum-types.h \
   anjuta-enum-types.c \
-  stamp-anjuta-enum-types.h
+  stamp-anjuta-enum-types.h \
+  Anjuta-1.0.gir \
+  IAnjuta-1.0.gir \
+  Anjuta-1.0.typelib \
+  IAnjuta-1.0.typelib
+
+if HAVE_INTROSPECTION
+
+girdir = $(INTROSPECTION_GIRDIR)
+gir_DATA = Anjuta-1.0.gir IAnjuta-1.0.gir
+
+typelibdir = $(INTROSPECTION_TYPELIBDIR)
+typelib_DATA = Anjuta-1.0.typelib IAnjuta-1.0.typelib
+
+Anjuta-1.0.gir: $(libanjuta_la_SOURCES) libanjuta.la
+	$(INTROSPECTION_SCANNER) --namespace Anjuta --nsversion 1.0 \
+		--include GConf-2.0 --include Gtk-2.0 \
+		--library libanjuta.la \
+		--libtool "$(LIBTOOL)" \
+		--output $@ \
+		--pkg-export libanjuta-1.0 \
+		-I$(top_srcdir) -I. \
+		$(libanjuta_la_SOURCES) \
+		$(libanjuta_include)
+
+# Using interfaces/*.c is not very nice but otherwise we get circular
+# dependencies : libanjuta.la depends on libanjuta-interfaces.la and
+# IAnjuta-1.0.gir depends on Anjuta-1.0.gir
+IAnjuta-1.0.gir: $(libanjuta_interfaces_la_SOURCES) interfaces/libanjuta-interfaces.la
+	$(INTROSPECTION_SCANNER) --namespace IAnjuta --nsversion 1.0 \
+		--add-include-path . \
+		--include GConf-2.0 --include Gtk-2.0 --include Anjuta-1.0 \
+		--library interfaces/libanjuta-interfaces.la \
+		--library libanjuta.la \
+		--libtool "$(LIBTOOL)" \
+		--output $@ \
+		--pkg-export libanjuta-1.0 \
+		-I$(top_srcdir) -I. \
+		interfaces/*.c \
+		interfaces/*.h
+
+Anjuta-1.0.typelib: Anjuta-1.0.gir
+	$(INTROSPECTION_COMPILER) $< -o $@
+
+IAnjuta-1.0.typelib: IAnjuta-1.0.gir
+	$(INTROSPECTION_COMPILER) $< -o $@
+
+endif
+
 
 -include $(top_srcdir)/git.mk
diff --git a/libanjuta/anjuta-project.h b/libanjuta/anjuta-project.h
index 50db92d..632b8ba 100644
--- a/libanjuta/anjuta-project.h
+++ b/libanjuta/anjuta-project.h
@@ -60,14 +60,14 @@ typedef enum
 	ANJUTA_TARGET_GENMARSHAL
 } AnjutaProjectTargetClass;
 
-typedef struct 
+typedef struct _AnjutaProjectTargetInformation
 {
 	gchar *name;
 	AnjutaProjectTargetClass base;
 	gchar *mime_type;
 } AnjutaProjectTargetInformation;
 
-typedef AnjutaProjectTargetInformation* AnjutaProjectTargetType;
+typedef struct _AnjutaProjectTargetInformation* AnjutaProjectTargetType;
 
 typedef struct
 {
diff --git a/libanjuta/anjuta-utils.c b/libanjuta/anjuta-utils.c
index c9bb5d7..f471568 100644
--- a/libanjuta/anjuta-utils.c
+++ b/libanjuta/anjuta-utils.c
@@ -1012,8 +1012,8 @@ anjuta_util_create_dir (const gchar* path)
 				NULL, NULL);
 		if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY)
 		{
-			g_message ("Warning: %s is a file. \n \
-					It is trying to be treated as a directory.",g_file_get_path (dir));
+			g_message ("Warning: %s is a file. \n "
+					"It is trying to be treated as a directory.",g_file_get_path (dir));
 			g_object_unref (dir);
 			return FALSE;
 		}
diff --git a/plugins/language-support-js/Makefile.am b/plugins/language-support-js/Makefile.am
index 0d62c03..f2afff5 100644
--- a/plugins/language-support-js/Makefile.am
+++ b/plugins/language-support-js/Makefile.am
@@ -40,7 +40,7 @@ AM_CPPFLAGS = \
 	$(LIBXML_CFLAGS) \
 	$(LIBANJUTA_CFLAGS) \
 	-DPACKAGE_SRC_DIR=\"$(srcdir)\" \
-	-DGIR_PATH=\"$(girdir)\" \
+	-DGIR_PATH=\"$(INTROSPECTION_GIRDIR)\" \
 	-DGJS_PATH=\"$(gjsdir)\" \
 	-DG_LOG_DOMAIN=\"language-support-js\"
 



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