[gtk+/native-layout] Bug 548026 - No accessor for GtkWidget.requisition
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/native-layout] Bug 548026 - No accessor for GtkWidget.requisition
- Date: Sun, 4 Apr 2010 02:28:11 +0000 (UTC)
commit 87334d465c170a8ea9ca8eb809d52ef895b613d2
Author: Michael Natterer <mitch gimp org>
Date: Fri Feb 19 17:04:20 2010 +0100
Bug 548026 - No accessor for GtkWidget.requisition
Add gtk_widget_get_requisition().
gtk/gtk.symbols | 1 +
gtk/gtkwidget.c | 26 ++++++++++++++++++++++++++
gtk/gtkwidget.h | 3 +++
3 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 91acae8..1518e36 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -5134,6 +5134,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 f969d47..ca77d8c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11305,6 +11305,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 8039df7..66d58b0 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -961,6 +961,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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]