]> Pileus Git - ~andy/gtk/commitdiff
Change docs and signature of gtk_widget_get_allocation
authorTim Janik <timj@src.gnome.org>
Fri, 20 Jun 2008 11:10:14 +0000 (11:10 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 20 Jun 2008 11:10:14 +0000 (11:10 +0000)
svn path=/trunk/; revision=20625

gtk/gtkwidget.c
gtk/gtkwidget.h

index 790d244b9b61e51d089f72e93a05da256fe7ca50..6b5c49fcf3dcf9ba5e167d16acaccc9f0491617d 100644 (file)
@@ -677,8 +677,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   /**
    * 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).
+   * The widget's window if it is realized, %NULL otherwise.
    *
    * Since: GSEAL-branch
    */
@@ -686,7 +685,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                                   PROP_WINDOW,
                                   g_param_spec_object ("window",
                                                        P_("Window"),
-                                                       P_("The widget's window or its parent window"),
+                                                       P_("The widget's window if it is realized"),
                                                        GDK_TYPE_WINDOW,
                                                        GTK_PARAM_READABLE));
 
@@ -9890,30 +9889,27 @@ gtk_widget_get_has_tooltip (GtkWidget *widget)
 /**
  * gtk_widget_get_allocation:
  * @widget: a #GtkWidget
- * @allocation: a #GtkAllocation
  *
- * Fills @allocation with the widget's allocation as provided by its parent.
+ * Retrieves the widget's allocation.
+ *
+ * Return value: widget's allocation
  *
  * Since: GSEAL-branch
  */
-void
-gtk_widget_get_allocation (GtkWidget     *widget,
-                           GtkAllocation *allocation)
+GtkAllocation
+gtk_widget_get_allocation (GtkWidget *widget)
 {
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (allocation != NULL);
+  GtkAllocation allocation;
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), allocation);
 
-  allocation->x = widget->allocation.x;
-  allocation->y = widget->allocation.y;
-  allocation->width = widget->allocation.width;
-  allocation->height = widget->allocation.height;
+  return widget->allocation;
 }
 
 /**
  * gtk_widget_get_window:
  * @widget: a #GtkWidget
  *
- * Returns the widget's window or the parent window.
+ * Returns the widget's window if it is realized, %NULL otherwise
  *
  * Return value: @widget's window.
  *
index cbf070e034dfa346be1745855956ba286a5651bf..dfc423e900243ab86adcb0682a335d29bead871f 100644 (file)
@@ -572,8 +572,7 @@ void                  gtk_widget_set_parent_window      (GtkWidget    *widget,
 void                  gtk_widget_set_child_visible      (GtkWidget    *widget,
                                                         gboolean      is_visible);
 gboolean              gtk_widget_get_child_visible      (GtkWidget    *widget);
-void                 gtk_widget_get_allocation         (GtkWidget    *widget,
-                                                        GtkAllocation*allocation);
+GtkAllocation        gtk_widget_get_allocation         (GtkWidget    *widget);
 GdkWindow*            gtk_widget_get_window             (GtkWidget    *widget);
 
 GtkWidget *gtk_widget_get_parent          (GtkWidget           *widget);