summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMichael Natterer <mitch@gimp.org>2010-02-19 17:04:20 +0100
committerMichael Natterer <mitch@gimp.org>2010-02-19 17:04:20 +0100
commit347d406f80f2140a466da30764171cd92aa7d7ea (patch)
treee697b01135e0b09b5fa4c5c934dff8ff9d59a82a /gtk
parent68a4847ac97b1dfc5327c98aa2abba056483aabb (diff)
downloadgtk+-347d406f80f2140a466da30764171cd92aa7d7ea.tar.gz
Bug 548026 - No accessor for GtkWidget.requisition
Add gtk_widget_get_requisition().
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtk.symbols1
-rw-r--r--gtk/gtkwidget.c26
-rw-r--r--gtk/gtkwidget.h3
3 files changed, 30 insertions, 0 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index d6aa08907d..167936dc99 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -5123,6 +5123,7 @@ gtk_widget_get_parent_window
gtk_widget_get_pointer
gtk_widget_get_receives_default
gtk_widget_get_root_window
+gtk_widget_get_requisition
gtk_widget_get_screen
gtk_widget_get_sensitive
gtk_widget_get_settings
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 0c67bfbb4a..4adba85299 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11196,6 +11196,32 @@ gtk_widget_set_allocation (GtkWidget *widget,
}
/**
+ * gtk_widget_get_requisition:
+ * @widget: a #GtkWidget
+ * @requisition: (out): a pointer to a #GtkRequisition to copy to
+ *
+ * Retrieves the widget's requisition.
+ *
+ * This function should only be used by widget implementations in
+ * order to figure whether the widget's requisition has actually
+ * changed after some internal state change (so that they can call
+ * gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
+ *
+ * Normally, gtk_widget_size_request() should be used.
+ *
+ * Since: 2.20
+ */
+void
+gtk_widget_get_requisition (GtkWidget *widget,
+ GtkRequisition *requisition)
+{
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (requisition != NULL);
+
+ *requisition = widget->requisition;
+}
+
+/**
* gtk_widget_set_window:
* @widget: a #GtkWidget
* @window: a #GdkWindow
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 757be3f685..0f361f371c 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -955,6 +955,9 @@ void gtk_widget_get_allocation (GtkWidget *widget,
void gtk_widget_set_allocation (GtkWidget *widget,
const GtkAllocation *allocation);
+void gtk_widget_get_requisition (GtkWidget *widget,
+ GtkRequisition *requisition);
+
gboolean gtk_widget_child_focus (GtkWidget *widget,
GtkDirectionType direction);
gboolean gtk_widget_keynav_failed (GtkWidget *widget,