gtk+ r20620 - trunk/gtk



Author: timj
Date: Fri Jun 20 11:09:42 2008
New Revision: 20620
URL: http://svn.gnome.org/viewvc/gtk+?rev=20620&view=rev

Log:
Seal GtkWidget


Modified:
   trunk/gtk/gtk.symbols
   trunk/gtk/gtkwidget.c
   trunk/gtk/gtkwidget.h

Modified: trunk/gtk/gtk.symbols
==============================================================================
--- trunk/gtk/gtk.symbols	(original)
+++ trunk/gtk/gtk.symbols	Fri Jun 20 11:09:42 2008
@@ -4778,6 +4778,9 @@
 gtk_widget_unmap
 gtk_widget_unparent
 gtk_widget_unrealize
+gtk_widget_unref
+gtk_widget_get_allocation
+gtk_widget_get_window
 #endif
 #endif
 

Modified: trunk/gtk/gtkwidget.c
==============================================================================
--- trunk/gtk/gtkwidget.c	(original)
+++ trunk/gtk/gtkwidget.c	Fri Jun 20 11:09:42 2008
@@ -153,7 +153,8 @@
   PROP_NO_SHOW_ALL,
   PROP_HAS_TOOLTIP,
   PROP_TOOLTIP_MARKUP,
-  PROP_TOOLTIP_TEXT
+  PROP_TOOLTIP_TEXT,
+  PROP_WINDOW
 };
 
 typedef	struct	_GtkStateData	 GtkStateData;
@@ -673,6 +674,22 @@
 							NULL,
 							GTK_PARAM_READWRITE));
 
+  /**
+   * GtkWidget:window:
+   *
+   * The widget's window or its parent window if it does not have a
+   * window (as indicated by the GTK_NO_WINDOW flag).
+   *
+   * Since: GSEAL-branch
+   */
+  g_object_class_install_property (gobject_class,
+				   PROP_WINDOW,
+				   g_param_spec_object ("window",
+ 							P_("Window"),
+							P_("The widget's window or its parent window"),
+							GDK_TYPE_WINDOW,
+							GTK_PARAM_READABLE));
+
   widget_signals[SHOW] =
     g_signal_new (I_("show"),
 		  G_TYPE_FROM_CLASS (gobject_class),
@@ -2585,6 +2602,9 @@
     case PROP_TOOLTIP_MARKUP:
       g_value_set_string (value, g_object_get_qdata (object, quark_tooltip_markup));
       break;
+    case PROP_WINDOW:
+      g_value_set_object (value, gtk_widget_get_window (widget));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -9867,5 +9887,41 @@
   return has_tooltip;
 }
 
+/**
+ * gtk_widget_get_allocation:
+ * @widget: a #GtkWidget
+ *
+ * Returns the widget's allocation as provided by its parent.
+ *
+ * Return value: current allocation of @widget.
+ *
+ * Since: GSEAL-branch
+ */
+GtkAllocation
+gtk_widget_get_allocation (GtkWidget *widget)
+{
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+  return widget->allocation;
+}
+
+/**
+ * gtk_widget_get_window:
+ * @widget: a #GtkWidget
+ *
+ * Returns the widget's window or the parent window.
+ *
+ * Return value: @widget's window.
+ *
+ * Since: GSEAL-branch
+ */
+GdkWindow*
+gtk_widget_get_window (GtkWidget *widget)
+{
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+  return widget->window;
+}
+
 #define __GTK_WIDGET_C__
 #include "gtkaliasdef.c"

Modified: trunk/gtk/gtkwidget.h
==============================================================================
--- trunk/gtk/gtkwidget.h	(original)
+++ trunk/gtk/gtkwidget.h	Fri Jun 20 11:09:42 2008
@@ -178,12 +178,12 @@
    * state and saved_state go. we therefore don't waste any new
    * space on this.
    */
-  guint16 private_flags;
+  guint16 GSEAL (private_flags);
   
   /* The state of the widget. There are actually only
    *  5 widget states (defined in "gtkenums.h").
    */
-  guint8 state;
+  guint8 GSEAL (state);
   
   /* The saved state of the widget. When a widget's state
    *  is changed to GTK_STATE_INSENSITIVE via
@@ -191,7 +191,7 @@
    *  the old state is kept around in this field. The state
    *  will be restored once the widget gets sensitive again.
    */
-  guint8 saved_state;
+  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
@@ -199,7 +199,7 @@
    * Among other things, the widget name is used to determine
    *  the style to use for a widget.
    */
-  gchar *name;
+  gchar *GSEAL (name);
   
   /*< public >*/
 
@@ -208,25 +208,25 @@
    *  along with graphics contexts used to draw with and
    *  the font to use for text.
    */
-  GtkStyle *style;
+  GtkStyle *GSEAL (style);
   
   /* The widget's desired size.
    */
-  GtkRequisition requisition;
+  GtkRequisition GSEAL (requisition);
   
   /* The widget's allocated size.
    */
-  GtkAllocation allocation;
+  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 *window;
+  GdkWindow *GSEAL (window);
   
   /* The widget's parent.
    */
-  GtkWidget *parent;
+  GtkWidget *GSEAL (parent);
 };
 
 struct _GtkWidgetClass
@@ -572,6 +572,8 @@
 void                  gtk_widget_set_child_visible      (GtkWidget    *widget,
 							 gboolean      is_visible);
 gboolean              gtk_widget_get_child_visible      (GtkWidget    *widget);
+GtkAllocation         gtk_widget_get_allocation         (GtkWidget    *widget);
+GdkWindow*            gtk_widget_get_window             (GtkWidget    *widget);
 
 GtkWidget *gtk_widget_get_parent          (GtkWidget           *widget);
 GdkWindow *gtk_widget_get_parent_window	  (GtkWidget	       *widget);



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