[gtk+] gtktearoffmenuitem: Move public members to private structure
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtktearoffmenuitem: Move public members to private structure
- Date: Tue, 13 Jul 2010 23:19:23 +0000 (UTC)
commit e69979f7b66c02ac34e80d62af76c2babdbdf854
Author: Javier Jardón <jjardon gnome org>
Date: Tue Jul 13 20:09:59 2010 +0200
gtktearoffmenuitem: Move public members to private structure
gtk/gtktearoffmenuitem.c | 22 +++++++++++++++++++---
gtk/gtktearoffmenuitem.h | 4 +++-
2 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktearoffmenuitem.c b/gtk/gtktearoffmenuitem.c
index a2a346c..0a1de9a 100644
--- a/gtk/gtktearoffmenuitem.c
+++ b/gtk/gtktearoffmenuitem.c
@@ -34,6 +34,11 @@
#define TEAR_LENGTH 5
#define BORDER_SPACING 3
+struct _GtkTearoffMenuItemPriv
+{
+ guint torn_off : 1;
+};
+
static void gtk_tearoff_menu_item_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static gint gtk_tearoff_menu_item_expose (GtkWidget *widget,
@@ -64,12 +69,21 @@ gtk_tearoff_menu_item_class_init (GtkTearoffMenuItemClass *klass)
widget_class->parent_set = gtk_tearoff_menu_item_parent_set;
menu_item_class->activate = gtk_tearoff_menu_item_activate;
+
+ g_type_class_add_private (klass, sizeof (GtkTearoffMenuItemPriv));
}
static void
gtk_tearoff_menu_item_init (GtkTearoffMenuItem *tearoff_menu_item)
{
- tearoff_menu_item->torn_off = FALSE;
+ GtkTearoffMenuItemPriv *priv;
+
+ tearoff_menu_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (tearoff_menu_item,
+ GTK_TYPE_TEAROFF_MENU_ITEM,
+ GtkTearoffMenuItemPriv);
+ priv = tearoff_menu_item->priv;
+
+ priv->torn_off = FALSE;
}
static void
@@ -227,8 +241,9 @@ tearoff_state_changed (GtkMenu *menu,
gpointer data)
{
GtkTearoffMenuItem *tearoff_menu_item = GTK_TEAROFF_MENU_ITEM (data);
+ GtkTearoffMenuItemPriv *priv = tearoff_menu_item->priv;
- tearoff_menu_item->torn_off = gtk_menu_get_tearoff_state (menu);
+ priv->torn_off = gtk_menu_get_tearoff_state (menu);
}
static void
@@ -236,6 +251,7 @@ gtk_tearoff_menu_item_parent_set (GtkWidget *widget,
GtkWidget *previous)
{
GtkTearoffMenuItem *tearoff_menu_item = GTK_TEAROFF_MENU_ITEM (widget);
+ GtkTearoffMenuItemPriv *priv = tearoff_menu_item->priv;
GtkMenu *menu = GTK_IS_MENU (widget->parent) ? GTK_MENU (widget->parent) : NULL;
if (previous)
@@ -245,7 +261,7 @@ gtk_tearoff_menu_item_parent_set (GtkWidget *widget,
if (menu)
{
- tearoff_menu_item->torn_off = gtk_menu_get_tearoff_state (menu);
+ priv->torn_off = gtk_menu_get_tearoff_state (menu);
g_signal_connect (menu, "notify::tearoff-state",
G_CALLBACK (tearoff_state_changed),
tearoff_menu_item);
diff --git a/gtk/gtktearoffmenuitem.h b/gtk/gtktearoffmenuitem.h
index 3fa32a6..2b84059 100644
--- a/gtk/gtktearoffmenuitem.h
+++ b/gtk/gtktearoffmenuitem.h
@@ -46,13 +46,15 @@ G_BEGIN_DECLS
typedef struct _GtkTearoffMenuItem GtkTearoffMenuItem;
+typedef struct _GtkTearoffMenuItemPriv GtkTearoffMenuItemPriv;
typedef struct _GtkTearoffMenuItemClass GtkTearoffMenuItemClass;
struct _GtkTearoffMenuItem
{
GtkMenuItem menu_item;
- guint GSEAL (torn_off) : 1;
+ /* <private> */
+ GtkTearoffMenuItemPriv *priv;
};
struct _GtkTearoffMenuItemClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]