/soc/2013/ankitkv/gobjectification: 5d1f08386e92: Enable introsp...

Ankit Vani a at nevitus.org
Thu Feb 6 14:36:30 EST 2014


Changeset: 5d1f08386e929b2f35d9477965bb527915b2842f
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-07 01:06 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/5d1f08386e92

Description:

Enable introspection for GNT

diffstat:

 finch/Makefile.am          |  15 ++++++++++++---
 finch/libgnt/Makefile.am   |  32 ++++++++++++++++++++++++++++++++
 finch/libgnt/gntbindable.h |   4 ++--
 finch/libgnt/gntbox.h      |   8 ++++----
 finch/libgnt/gntbutton.h   |   8 ++++----
 finch/libgnt/gntlabel.h    |   8 ++++----
 finch/libgnt/gnttree.h     |   7 +++++--
 finch/libgnt/gntwidget.h   |   8 ++++----
 8 files changed, 67 insertions(+), 23 deletions(-)

diffs (188 lines):

diff --git a/finch/Makefile.am b/finch/Makefile.am
--- a/finch/Makefile.am
+++ b/finch/Makefile.am
@@ -109,14 +109,23 @@ AM_CPPFLAGS = \
 if ENABLE_GNT
 -include $(INTROSPECTION_MAKEFILE)
 INTROSPECTION_GIRS =
-INTROSPECTION_SCANNER_ARGS = --add-include-path=$(builddir) --add-include-path=$(top_builddir)/libpurple
-INTROSPECTION_COMPILER_ARGS = --includedir=$(top_builddir)/libpurple
+INTROSPECTION_SCANNER_ARGS = \
+	--add-include-path=$(builddir) \
+	--add-include-path=$(builddir)/libgnt \
+	--add-include-path=$(top_builddir)/libpurple
+
+INTROSPECTION_COMPILER_ARGS = \
+	--includedir=$(builddir)/libgnt \
+	--includedir=$(top_builddir)/libpurple
 
 if HAVE_INTROSPECTION
 introspection_sources = $(libfinchinclude_HEADERS)
 
 Finch-$(PURPLE_MAJOR_VERSION).$(PURPLE_MINOR_VERSION).gir: $(builddir)/libfinch.la
-Finch_3_0_gir_INCLUDES = GObject-2.0 Purple-$(PURPLE_MAJOR_VERSION).$(PURPLE_MINOR_VERSION)
+Finch_3_0_gir_INCLUDES = \
+	Gnt-$(GNT_MAJOR_VERSION).$(GNT_MINOR_VERSION) \
+	Purple-$(PURPLE_MAJOR_VERSION).$(PURPLE_MINOR_VERSION)
+
 Finch_3_0_gir_CFLAGS = \
 	$(INCLUDES) \
 	-DSTANDALONE \
diff --git a/finch/libgnt/Makefile.am b/finch/libgnt/Makefile.am
--- a/finch/libgnt/Makefile.am
+++ b/finch/libgnt/Makefile.am
@@ -89,6 +89,7 @@ libgnt_la_LIBADD = \
 	$(GLIB_LIBS) \
 	$(GNT_LIBS) \
 	$(LIBXML_LIBS) \
+	$(INTROSPECTION_LIBS) \
 	$(PY_LIBS)
 
 AM_CPPFLAGS = \
@@ -96,5 +97,36 @@ AM_CPPFLAGS = \
 	$(GNT_CFLAGS) \
 	$(DEBUG_CFLAGS) \
 	$(LIBXML_CFLAGS) \
+	$(INTROSPECTION_CFLAGS) \
 	$(PY_CFLAGS)
 
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(builddir)
+INTROSPECTION_COMPILER_ARGS =
+
+if HAVE_INTROSPECTION
+introspection_sources = $(libgnt_lainclude_HEADERS)
+
+Gnt-$(GNT_MAJOR_VERSION).$(GNT_MINOR_VERSION).gir: $(builddir)/libgnt.la
+Gnt_2_8_gir_INCLUDES = GObject-2.0
+Gnt_2_8_gir_CFLAGS = \
+	$(INCLUDES) \
+	$(GLIB_CFLAGS) \
+	$(GNT_CFLAGS) \
+	$(LIBXML_CFLAGS) \
+	$(INTROSPECTION_CFLAGS) \
+	$(PY_CFLAGS)
+
+Gnt_2_8_gir_LIBS = $(builddir)/libgnt.la
+Gnt_2_8_gir_FILES = $(introspection_sources)
+INTROSPECTION_GIRS += Gnt-$(GNT_MAJOR_VERSION).$(GNT_MINOR_VERSION).gir
+
+girdir = $(INTROSPECTION_GIRDIR)
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(INTROSPECTION_TYPELIBDIR)
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif
diff --git a/finch/libgnt/gntbindable.h b/finch/libgnt/gntbindable.h
--- a/finch/libgnt/gntbindable.h
+++ b/finch/libgnt/gntbindable.h
@@ -89,8 +89,8 @@ struct _GntBindableAction
 {
 	char *name;        /* The name of the action */
 	union {
-		gboolean (*action)(GntBindable *bindable, GList *params);
-		gboolean (*action_noparam)(GntBindable *bindable);
+		GntBindableActionCallback action;
+		GntBindableActionCallbackNoParam action_noparam;
 	} u;
 };
 
diff --git a/finch/libgnt/gntbox.h b/finch/libgnt/gntbox.h
--- a/finch/libgnt/gntbox.h
+++ b/finch/libgnt/gntbox.h
@@ -72,10 +72,10 @@ struct _GntBox
 	GList *focus;		/* List of widgets to cycle focus (only valid for parent boxes) */
 
 	/*< private >*/
-    void (*gnt_reserved1)(void);
-    void (*gnt_reserved2)(void);
-    void (*gnt_reserved3)(void);
-    void (*gnt_reserved4)(void);
+    void *res1;
+    void *res2;
+    void *res3;
+    void *res4;
 };
 
 struct _GntBoxClass
diff --git a/finch/libgnt/gntbutton.h b/finch/libgnt/gntbutton.h
--- a/finch/libgnt/gntbutton.h
+++ b/finch/libgnt/gntbutton.h
@@ -57,10 +57,10 @@ struct _GntButton
 	GntButtonPriv *priv;
 
 	/*< private >*/
-    void (*gnt_reserved1)(void);
-    void (*gnt_reserved2)(void);
-    void (*gnt_reserved3)(void);
-    void (*gnt_reserved4)(void);
+    void *res1;
+    void *res2;
+    void *res3;
+    void *res4;
 };
 
 struct _GntButtonClass
diff --git a/finch/libgnt/gntlabel.h b/finch/libgnt/gntlabel.h
--- a/finch/libgnt/gntlabel.h
+++ b/finch/libgnt/gntlabel.h
@@ -51,10 +51,10 @@ struct _GntLabel
 	GntTextFormatFlags flags;
 
 	/*< private >*/
-    void (*gnt_reserved1)(void);
-    void (*gnt_reserved2)(void);
-    void (*gnt_reserved3)(void);
-    void (*gnt_reserved4)(void);
+    void *res1;
+    void *res2;
+    void *res3;
+    void *res4;
 };
 
 struct _GntLabelClass
diff --git a/finch/libgnt/gnttree.h b/finch/libgnt/gnttree.h
--- a/finch/libgnt/gnttree.h
+++ b/finch/libgnt/gnttree.h
@@ -42,6 +42,9 @@
 #define GNT_IS_TREE_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_TREE))
 #define GNT_TREE_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_TREE, GntTreeClass))
 
+typedef guint (*GntTreeHashFunc)(gconstpointer);
+typedef gboolean (*GntTreeHashEqualityFunc)(gconstpointer, gconstpointer);
+
 typedef struct _GntTree			GntTree;
 typedef struct _GntTreePriv		GntTreePriv;
 typedef struct _GntTreeClass		GntTreeClass;
@@ -78,8 +81,8 @@ struct _GntTree
 
 	GList *list;            /* List of GntTreeRow s */
 	GHashTable *hash;       /* We need this for quickly referencing the rows */
-	guint (*hash_func)(gconstpointer);
-	gboolean (*hash_eq_func)(gconstpointer, gconstpointer);
+	GntTreeHashFunc hash_func;
+	GntTreeHashEqualityFunc hash_eq_func;
 	GDestroyNotify key_destroy;
 	GDestroyNotify value_destroy;
 
diff --git a/finch/libgnt/gntwidget.h b/finch/libgnt/gntwidget.h
--- a/finch/libgnt/gntwidget.h
+++ b/finch/libgnt/gntwidget.h
@@ -107,10 +107,10 @@ struct _GntWidget
 	WINDOW *window;
 
 	/*< private >*/
-    void (*gnt_reserved1)(void);
-    void (*gnt_reserved2)(void);
-    void (*gnt_reserved3)(void);
-    void (*gnt_reserved4)(void);
+    void *res1;
+    void *res2;
+    void *res3;
+    void *res4;
 };
 
 struct _GntWidgetClass



More information about the Commits mailing list