/pidgin/main: 6f18aa933641: Finch: don't break ABI - it's not po...

Tomasz Wasilczyk twasilczyk at pidgin.im
Sat Apr 26 17:38:23 EDT 2014


Changeset: 6f18aa933641fcf6051af974f873dcd0c179eb0b
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-26 23:38 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/6f18aa933641

Description:

Finch: don't break ABI - it's not possible to add private fields to the GntMenuItem (sic)

diffstat:

 finch/libgnt/gntmenuitem.c |  12 ++++++++++++
 finch/libgnt/gntmenuitem.h |   4 +++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diffs (64 lines):

diff --git a/finch/libgnt/gntmenuitem.c b/finch/libgnt/gntmenuitem.c
--- a/finch/libgnt/gntmenuitem.c
+++ b/finch/libgnt/gntmenuitem.c
@@ -66,9 +66,13 @@ static void
 gnt_menuitem_init(GTypeInstance *instance, gpointer klass)
 {
 	GntMenuItem *item = GNT_MENU_ITEM(instance);
+#if 0
 	GntMenuItemPriv *priv = &item->priv;
 
 	priv->visible = TRUE;
+#else
+	item->visible = TRUE;
+#endif
 }
 
 /******************************************************************************
@@ -164,9 +168,13 @@ gboolean gnt_menuitem_activate(GntMenuIt
 void
 gnt_menuitem_set_visible(GntMenuItem *item, gboolean visible)
 {
+#if 0
 	GntMenuItemPriv *priv = &item->priv;
 
 	priv->visible = visible;
+#else
+	item->visible = visible;
+#endif
 }
 
 gboolean
@@ -174,7 +182,11 @@ gnt_menuitem_is_visible(GntMenuItem *ite
 {
 	g_return_val_if_fail(GNT_IS_MENU_ITEM(item), FALSE);
 
+#if 0
 	return item->priv.visible;
+#else
+	return item->visible;
+#endif
 }
 
 void
diff --git a/finch/libgnt/gntmenuitem.h b/finch/libgnt/gntmenuitem.h
--- a/finch/libgnt/gntmenuitem.h
+++ b/finch/libgnt/gntmenuitem.h
@@ -56,7 +56,6 @@ struct _GntMenuItemPriv
 	int y;
 	char trigger;
 	char *id;
-	gboolean visible;
 };
 
 typedef void (*GntMenuItemCallback)(GntMenuItem *item, gpointer data);
@@ -75,6 +74,9 @@ struct _GntMenuItem
 	GntMenuItemCallback callback;
 
 	GntMenu *submenu;
+
+	/*< private >*/
+	gboolean visible;
 };
 
 struct _GntMenuItemClass



More information about the Commits mailing list