[gtk+/refactor: 168/169] gtkwidget: move public members to private structure



commit b172966d41debd1806f363bea42d1b0feddfef78
Author: Javier Jardón <jjardon gnome org>
Date:   Tue Aug 3 02:02:25 2010 +0200

    gtkwidget: move public members to private structure

 gtk/gtkwidget.c |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 gtk/gtkwidget.h |   58 +++---------------------------------------------------
 2 files changed, 60 insertions(+), 54 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 3da8d58..fdb915b 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -131,6 +131,62 @@
 #define	INIT_PATH_SIZE	(512)
 
 
+struct _GtkWidgetPriv
+{
+  /* The widget's allocated size.
+   */
+  GtkAllocation allocation;
+
+  /* The widget's desired size.
+   */
+  GtkRequisition requisition;
+
+  /* The style for the widget. The style contains the
+   *  colors the widget should be drawn in for each state
+   *  along with graphics contexts used to draw with and
+   *  the font to use for text.
+   */
+  GtkStyle *style;
+
+  /* The widget's parent.
+   */
+  GtkWidget *parent;
+
+  /* The widget's window or its parent window if it does
+   *  not have a window. (Which will be indicated by the
+   *  GTK_NO_WINDOW flag being set).
+   */
+  GdkWindow *window;
+
+  /* The widget's name. If the widget does not have a name
+   *  (the name is NULL), then its name (as returned by
+   *  "gtk_widget_get_name") is its class's name.
+   * Among other things, the widget name is used to determine
+   *  the style to use for a widget.
+   */
+  gchar *name;
+
+  /* The saved state of the widget. When a widget's state
+   *  is changed to GTK_STATE_INSENSITIVE via
+   *  "gtk_widget_set_state" or "gtk_widget_set_sensitive"
+   *  the old state is kept around in this field. The state
+   *  will be restored once the widget gets sensitive again.
+   */
+  guint8 saved_state1;
+
+  /* The state of the widget. There are actually only
+   *  5 widget states (defined in "gtkenums.h").
+   */
+  guint8 state;
+
+  /* 16 bits of internally used private flags.
+   * this will be packed into the same 4 byte alignment frame that
+   * state and saved_state go. we therefore don't waste any new
+   * space on this.
+   */
+  guint16 private_flags;
+};
+
 enum {
   SHOW,
   HIDE,
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 0bae2c6..cb352b6 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -196,6 +196,7 @@ typedef enum
  */
 typedef struct _GtkRequisition	   GtkRequisition;
 typedef struct _GtkSelectionData   GtkSelectionData;
+typedef struct _GtkWidgetPriv      GtkWidgetPriv;
 typedef struct _GtkWidgetClass	   GtkWidgetClass;
 typedef struct _GtkWidgetAuxInfo   GtkWidgetAuxInfo;
 typedef struct _GtkWidgetShapeInfo GtkWidgetShapeInfo;
@@ -256,61 +257,10 @@ struct _GtkWidget
    *  GtkObject pointer.
    */
   GtkObject object;
-  
-  /* 16 bits of internally used private flags.
-   * this will be packed into the same 4 byte alignment frame that
-   * state and saved_state go. we therefore don't waste any new
-   * space on this.
-   */
-  guint16 GSEAL (private_flags);
-  
-  /* The state of the widget. There are actually only
-   *  5 widget states (defined in "gtkenums.h").
-   */
-  guint8 GSEAL (state);
-  
-  /* The saved state of the widget. When a widget's state
-   *  is changed to GTK_STATE_INSENSITIVE via
-   *  "gtk_widget_set_state" or "gtk_widget_set_sensitive"
-   *  the old state is kept around in this field. The state
-   *  will be restored once the widget gets sensitive again.
-   */
-  guint8 GSEAL (saved_state);
-  
-  /* The widget's name. If the widget does not have a name
-   *  (the name is NULL), then its name (as returned by
-   *  "gtk_widget_get_name") is its class's name.
-   * Among other things, the widget name is used to determine
-   *  the style to use for a widget.
-   */
-  gchar *GSEAL (name);
-  
-  /*< public >*/
 
-  /* The style for the widget. The style contains the
-   *  colors the widget should be drawn in for each state
-   *  along with graphics contexts used to draw with and
-   *  the font to use for text.
-   */
-  GtkStyle *GSEAL (style);
-  
-  /* The widget's desired size.
-   */
-  GtkRequisition GSEAL (requisition);
-  
-  /* The widget's allocated size.
-   */
-  GtkAllocation GSEAL (allocation);
-  
-  /* The widget's window or its parent window if it does
-   *  not have a window. (Which will be indicated by the
-   *  GTK_NO_WINDOW flag being set).
-   */
-  GdkWindow *GSEAL (window);
-  
-  /* The widget's parent.
-   */
-  GtkWidget *GSEAL (parent);
+  guint16 private_flags;
+
+  GtkWidgetPriv *priv;
 };
 
 /**



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