[vinagre/libpeas: 9/10] Add GObject introspection support



commit 3f94cf5b41962929336b3881de0e080c1e5956b0
Author: Jonh Wendell <jwendell gnome org>
Date:   Mon Jul 26 15:57:01 2010 +0200

    Add GObject introspection support

 configure.ac                 |   11 +++++++++++
 vinagre/Makefile.am          |   21 +++++++++++++++++++++
 vinagre/vinagre-connection.c |    2 +-
 vinagre/vinagre-connection.h |    4 ++--
 vinagre/vinagre-main.c       |    8 ++++++++
 5 files changed, 43 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ccfe49d..dd280af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -286,6 +286,16 @@ AC_SUBST(VINAGRE_PLUGINS_DATA_DIR)
 VINAGRE_PLUGINS_LIBS_DIR="$libdir/vinagre-1/plugins"
 AC_SUBST(VINAGRE_PLUGINS_LIBS_DIR)
 
+# Introspection
+GOBJECT_INTROSPECTION_CHECK([0.9.3])
+
+if test "$found_introspection" = "yes"; then
+	enable_introspection=yes
+	AC_DEFINE([ENABLE_INTROSPECTION], [1], [Define to enable GObject Introspection])
+else
+	enable_introspection=no
+fi
+
 #*******************************************************************************
 AC_CONFIG_FILES([
 Makefile
@@ -316,6 +326,7 @@ Configure summary:
 
 	Compiler ...................:  ${CC} 
 	Compiler Flags .............:  ${CFLAGS}
+	GObject Introspection.......:  $enable_introspection
 
 	Avahi enabled ..............:  ${enable_avahi}
 	GNOME Panel applet..........:  ${enable_applet}
diff --git a/vinagre/Makefile.am b/vinagre/Makefile.am
index 5a4e7d3..21dc48c 100644
--- a/vinagre/Makefile.am
+++ b/vinagre/Makefile.am
@@ -13,6 +13,7 @@ INCLUDES = 						\
 	-DSSH_PROGRAM=\"$(SSH_PROGRAM)\"		\
 	$(VINAGRE_CFLAGS)				\
 	$(AVAHI_CFLAGS)					\
+	$(INTROSPECTION_CFLAGS)				\
 	$(NULL)
 
 NOINST_H_FILES = \
@@ -114,6 +115,7 @@ vinagre_LDADD = \
 	$(VINAGRE_LIBS)		\
 	$(AVAHI_LIBS)		\
 	$(GTKVNC_LIBS)		\
+	$(INTROSPECTION_LIBS)	\
 	$(NULL)
 
 vinagre_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
@@ -263,6 +265,25 @@ handwritten_sources += \
 
 endif
 
+if HAVE_INTROSPECTION
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS = Vinagre-3.0.gir
+
+Vinagre-3.0.gir: vinagre
+INTROSPECTION_SCANNER_ARGS = $(VINAGRE_CFLAGS) -I$(top_srcdir) --warn-all
+Vinagre_3_0_gir_NAMESPACE = Vinagre
+Vinagre_3_0_gir_VERSION = 3.0
+Vinagre_3_0_gir_PROGRAM = $(builddir)/vinagre
+Vinagre_3_0_gir_FILES = $(INST_H_FILES) $(NOINST_H_FILES) $(handwritten_sources)
+Vinagre_3_0_gir_INCLUDES = Gtk-3.0 libxml2-2.0
+
+girdir = $(datadir)/vinagre/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/vinagre/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+endif
+
 DISTCLEANFILES =		\
 	$(BUILT_SOURCES)	\
 	$(server_in_files)	\
diff --git a/vinagre/vinagre-connection.c b/vinagre/vinagre-connection.c
index bcdca16..f4c607a 100644
--- a/vinagre/vinagre-connection.c
+++ b/vinagre/vinagre-connection.c
@@ -701,7 +701,7 @@ vinagre_connection_get_string_rep (VinagreConnection *conn,
 
 void
 vinagre_connection_fill_writer (VinagreConnection *conn,
-				xmlTextWriter     *writer)
+				xmlTextWriterPtr   writer)
 {
   VINAGRE_CONNECTION_GET_CLASS (conn)->impl_fill_writer (conn, writer);
 }
diff --git a/vinagre/vinagre-connection.h b/vinagre/vinagre-connection.h
index 0979eac..16b8971 100644
--- a/vinagre/vinagre-connection.h
+++ b/vinagre/vinagre-connection.h
@@ -44,7 +44,7 @@ struct _VinagreConnectionClass
   GObjectClass	parent_class;
 
   /* Virtual functions */
-  void		(*impl_fill_writer)		(VinagreConnection *conn, xmlTextWriter *writer);
+  void		(*impl_fill_writer)		(VinagreConnection *conn, xmlTextWriterPtr writer);
   void		(*impl_parse_item)		(VinagreConnection *conn, xmlNode *root);
   gchar *	(*impl_get_best_name)		(VinagreConnection *conn);
   void		(*impl_fill_conn_from_file)	(VinagreConnection *conn, GKeyFile *file);
@@ -106,7 +106,7 @@ gchar*		    vinagre_connection_get_string_rep	(VinagreConnection *conn,
 /* vinagre_connection_fill_writer(): Used to fill a xml writer when saving bookmarks.
    subclasses must inherit from it and call super() */
 void                vinagre_connection_fill_writer	(VinagreConnection *conn,
-							 xmlTextWriter *writer);
+							 xmlTextWriterPtr  writer);
 
 /* vinagre_connection_parse_item(): Used to parse a xml item when loading bookmarks.
    subclasses must inherit from it and call super() */
diff --git a/vinagre/vinagre-main.c b/vinagre/vinagre-main.c
index a1d5168..7a895b6 100644
--- a/vinagre/vinagre-main.c
+++ b/vinagre/vinagre-main.c
@@ -22,6 +22,10 @@
 #include <config.h>
 #endif
 
+#ifdef ENABLE_INTROSPECTION
+#include <girepository.h>
+#endif
+
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <locale.h>
@@ -77,6 +81,10 @@ int main (int argc, char **argv) {
   g_option_context_add_main_entries (context, all_options, GETTEXT_PACKAGE);
   g_option_context_add_group (context, gtk_get_option_group (TRUE));
 
+#ifdef ENABLE_INTROSPECTION
+  g_option_context_add_group (context, g_irepository_get_option_group ());
+#endif
+
   for (l = plugins; l; l = l->next)
     {
       GSList            *groups, *l2;



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