[gtk+/extended-layout-jhs: 52/64] Rename gtk_tree_view_column_cell_get_size_impl to
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/extended-layout-jhs: 52/64] Rename gtk_tree_view_column_cell_get_size_impl to
- Date: Wed, 25 Nov 2009 11:23:16 +0000 (UTC)
commit a0b5765bc44cfb903cb141825e5437b0caab2537
Author: Mathias Hasselmann <mathias hasselmann gmx de>
Date: Mon Aug 6 14:03:16 2007 +0000
Rename gtk_tree_view_column_cell_get_size_impl to
2007-08-06 Mathias Hasselmann <mathias hasselmann gmx de>
* gtk/gtktreeviewcolumn.c:
Rename gtk_tree_view_column_cell_get_size_impl
to gtk_tree_view_column_cell_get_real_size to
fit naming conventions.
* gtk/gtkscrolledwindow.c:
Provide and consider natural size information.
* tests/testextendedlayout.c:
Show natural size of the hovered widget in statusbar.
svn path=/branches/extended-layout/; revision=18583
ChangeLog.gtk-extended-layout | 11 +++++++++
gtk/gtkscrolledwindow.c | 46 +++++++++++++++++++++++++++++++++++++---
gtk/gtktreeviewcolumn.c | 6 ++--
tests/testextendedlayout.c | 13 ++++++++++-
4 files changed, 68 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog.gtk-extended-layout b/ChangeLog.gtk-extended-layout
index 8be2e1d..cacf738 100644
--- a/ChangeLog.gtk-extended-layout
+++ b/ChangeLog.gtk-extended-layout
@@ -1,5 +1,16 @@
2007-08-06 Mathias Hasselmann <mathias hasselmann gmx de>
+ * gtk/gtktreeviewcolumn.c:
+ Rename gtk_tree_view_column_cell_get_size_impl
+ to gtk_tree_view_column_cell_get_real_size to
+ fit naming conventions.
+ * gtk/gtkscrolledwindow.c:
+ Provide and consider natural size information.
+ * tests/testextendedlayout.c:
+ Show natural size of the hovered widget in statusbar.
+
+2007-08-06 Mathias Hasselmann <mathias hasselmann gmx de>
+
* gtk/gtktreeprivate.h, gtk/gtktreeviewcolumn.h:
Introduce GtkTreeViewColumnPrivate.
* gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c:
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 584a2bd..5740670 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -31,6 +31,7 @@
#include "gtkmarshalers.h"
#include "gtkscrolledwindow.h"
#include "gtkwindow.h"
+#include "gtkextendedlayout.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkalias.h"
@@ -144,9 +145,13 @@ static void gtk_scrolled_window_adjustment_changed (GtkAdjustment *adju
static void gtk_scrolled_window_update_real_placement (GtkScrolledWindow *scrolled_window);
+static void gtk_scrolled_window_extended_layout_init (GtkExtendedLayoutIface *iface);
+
static guint signals[LAST_SIGNAL] = {0};
-G_DEFINE_TYPE (GtkScrolledWindow, gtk_scrolled_window, GTK_TYPE_BIN)
+G_DEFINE_TYPE_WITH_CODE (GtkScrolledWindow, gtk_scrolled_window, GTK_TYPE_BIN,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
+ gtk_scrolled_window_extended_layout_init))
static void
add_scroll_binding (GtkBindingSet *binding_set,
@@ -1170,8 +1175,9 @@ gtk_scrolled_window_move_focus_out (GtkScrolledWindow *scrolled_window,
}
static void
-gtk_scrolled_window_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
+gtk_scrolled_window_real_size_request (GtkWidget *widget,
+ GtkRequisition *requisition,
+ gboolean consider_natural_size)
{
GtkScrolledWindow *scrolled_window;
GtkBin *bin;
@@ -1202,7 +1208,12 @@ gtk_scrolled_window_size_request (GtkWidget *widget,
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
- gtk_widget_size_request (bin->child, &child_requisition);
+ if (consider_natural_size &&
+ GTK_EXTENDED_LAYOUT_HAS_NATURAL_SIZE (bin->child))
+ gtk_extended_layout_get_natural_size (GTK_EXTENDED_LAYOUT (bin->child),
+ &child_requisition);
+ else
+ gtk_widget_size_request (bin->child, &child_requisition);
if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
requisition->width += child_requisition.width;
@@ -1262,6 +1273,13 @@ gtk_scrolled_window_size_request (GtkWidget *widget,
}
static void
+gtk_scrolled_window_size_request (GtkWidget *widget,
+ GtkRequisition *requisition)
+{
+ gtk_scrolled_window_real_size_request (widget, requisition, FALSE);
+}
+
+static void
gtk_scrolled_window_relative_allocation (GtkWidget *widget,
GtkAllocation *allocation)
{
@@ -1712,5 +1730,25 @@ _gtk_scrolled_window_get_scrollbar_spacing (GtkScrolledWindow *scrolled_window)
}
}
+static GtkExtendedLayoutFeatures
+gtk_scrolled_window_extended_layout_get_features (GtkExtendedLayout *layout)
+{
+ return GTK_EXTENDED_LAYOUT_NATURAL_SIZE;
+}
+
+static void
+gtk_scrolled_window_extended_layout_get_natural_size (GtkExtendedLayout *layout,
+ GtkRequisition *requisition)
+{
+ gtk_scrolled_window_real_size_request (GTK_WIDGET (layout), requisition, TRUE);
+}
+
+static void
+gtk_scrolled_window_extended_layout_init (GtkExtendedLayoutIface *iface)
+{
+ iface->get_features = gtk_scrolled_window_extended_layout_get_features;
+ iface->get_natural_size = gtk_scrolled_window_extended_layout_get_natural_size;
+}
+
#define __GTK_SCROLLED_WINDOW_C__
#include "gtkaliasdef.c"
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 3ddac1b..46b5ca6 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -2556,7 +2556,7 @@ gtk_tree_view_column_cell_set_cell_data (GtkTreeViewColumn *tree_column,
}
void
-gtk_tree_view_column_cell_get_size_impl (GtkTreeViewColumn *tree_column,
+gtk_tree_view_column_cell_get_real_size (GtkTreeViewColumn *tree_column,
GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
@@ -2639,7 +2639,7 @@ gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column,
gint *width,
gint *height)
{
- gtk_tree_view_column_cell_get_size_impl (tree_column, cell_area,
+ gtk_tree_view_column_cell_get_real_size (tree_column, cell_area,
x_offset, y_offset, width, height, FALSE);
}
@@ -3778,7 +3778,7 @@ static void
gtk_tree_view_column_extended_layout_get_natural_size (GtkExtendedLayout *layout,
GtkRequisition *requisition)
{
- gtk_tree_view_column_cell_get_size_impl (GTK_TREE_VIEW_COLUMN (layout),
+ gtk_tree_view_column_cell_get_real_size (GTK_TREE_VIEW_COLUMN (layout),
NULL, NULL, NULL,
&requisition->width,
&requisition->height,
diff --git a/tests/testextendedlayout.c b/tests/testextendedlayout.c
index 1dc4d30..5a4565f 100644
--- a/tests/testextendedlayout.c
+++ b/tests/testextendedlayout.c
@@ -1937,7 +1937,7 @@ update_status (TestSuite *suite,
g_string_append_printf (status, " (%s)", widget_name);
g_string_append_printf (status,
- ":\npos=%dx%d; size=%dx%d req=%dx%d",
+ ":\nposition=%dx%d; size=%dx%d; requisition=%dx%d",
child->allocation.x,
child->allocation.y,
child->allocation.width,
@@ -1947,6 +1947,17 @@ update_status (TestSuite *suite,
if (GTK_IS_EXTENDED_LAYOUT (child))
{
+ if (GTK_EXTENDED_LAYOUT_HAS_NATURAL_SIZE (child))
+ {
+ GtkRequisition requisition;
+
+ gtk_extended_layout_get_natural_size (GTK_EXTENDED_LAYOUT (child),
+ &requisition);
+
+ g_string_append_printf (status, "; natural-size: %dx%d",
+ requisition.width, requisition.height);
+ }
+
if (GTK_EXTENDED_LAYOUT_HAS_BASELINES (child))
{
gint *baselines = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]