[gtk+/scrollable: 2/2] Remove ::set_scroll_adjustments
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/scrollable: 2/2] Remove ::set_scroll_adjustments
- Date: Mon, 18 Oct 2010 04:40:01 +0000 (UTC)
commit ae7da3c7ab0a7366c3f5d165065823a60bde4179
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 18 00:38:26 2010 -0400
Remove ::set_scroll_adjustments
Remove all traces of the ::set_scroll_adjustments signal.
docs/reference/gtk/gtk3-sections.txt | 1 -
gtk/gtk.symbols | 1 -
gtk/gtkscrolledwindow.c | 33 ++++++----------------
gtk/gtkwidget.c | 51 ----------------------------------
gtk/gtkwidget.h | 9 ------
5 files changed, 9 insertions(+), 86 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 095a785..836ceef 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -4879,7 +4879,6 @@ gtk_widget_set_app_paintable
gtk_widget_set_double_buffered
gtk_widget_set_redraw_on_allocate
gtk_widget_set_composite_name
-gtk_widget_set_scroll_adjustments
gtk_widget_mnemonic_activate
gtk_widget_class_install_style_property
gtk_widget_class_install_style_property_parser
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index d6f6fc8..8b6258c 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -4323,7 +4323,6 @@ gtk_widget_set_parent
gtk_widget_set_parent_window
gtk_widget_set_receives_default
gtk_widget_set_redraw_on_allocate
-gtk_widget_set_scroll_adjustments
gtk_widget_set_sensitive
gtk_widget_set_size_request
gtk_widget_set_state
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 95fee96..209eebf 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -531,7 +531,6 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
{
GtkScrolledWindowPrivate *priv;
GtkBin *bin;
- GtkWidget *child;
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (scrolled_window));
if (hadjustment)
@@ -556,7 +555,7 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
else
{
GtkAdjustment *old_adjustment;
-
+
old_adjustment = gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar));
if (old_adjustment == hadjustment)
return;
@@ -574,14 +573,9 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
scrolled_window);
gtk_scrolled_window_adjustment_changed (hadjustment, scrolled_window);
- child = gtk_bin_get_child (bin);
- if (GTK_IS_SCROLLABLE (child))
- gtk_scrollable_set_hadjustment (GTK_SCROLLABLE (child),
- gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar)));
- else if (child)
- gtk_widget_set_scroll_adjustments (child,
- gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar)),
- gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar)));
+ g_object_set (gtk_bin_get_child (bin),
+ "hadjustment", gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar)),
+ NULL);
g_object_notify (G_OBJECT (scrolled_window), "hadjustment");
}
@@ -599,7 +593,6 @@ gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window,
{
GtkScrolledWindowPrivate *priv;
GtkBin *bin;
- GtkWidget *child;
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (scrolled_window));
if (vadjustment)
@@ -642,14 +635,9 @@ gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window,
scrolled_window);
gtk_scrolled_window_adjustment_changed (vadjustment, scrolled_window);
- child = gtk_bin_get_child (bin);
- if (GTK_IS_SCROLLABLE (child))
- gtk_scrollable_set_vadjustment (GTK_SCROLLABLE (child),
- gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar)));
- else if (child)
- gtk_widget_set_scroll_adjustments (child,
- gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar)),
- gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar)));
+ g_object_set (gtk_bin_get_child (bin),
+ "vadjustment", gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar)),
+ NULL);
g_object_notify (G_OBJECT (scrolled_window), "vadjustment");
}
@@ -1883,7 +1871,7 @@ gtk_scrolled_window_add (GtkContainer *container,
if (GTK_IS_SCROLLABLE (child))
g_object_set (child, "hadjustment", hadj, "vadjustment", vadj, NULL);
- else if (!gtk_widget_set_scroll_adjustments (child, hadj, vadj))
+ else
g_warning ("gtk_scrolled_window_add(): cannot add non scrollable widget "
"use gtk_scrolled_window_add_with_viewport() instead");
}
@@ -1896,10 +1884,7 @@ gtk_scrolled_window_remove (GtkContainer *container,
g_return_if_fail (child != NULL);
g_return_if_fail (gtk_bin_get_child (GTK_BIN (container)) == child);
- if (GTK_IS_SCROLLABLE (child))
- g_object_set (child, "hadjustment", NULL, "vadjustment", NULL, NULL);
- else
- gtk_widget_set_scroll_adjustments (child, NULL, NULL);
+ g_object_set (child, "hadjustment", NULL, "vadjustment", NULL, NULL);
/* chain parent class handler to remove child */
GTK_CONTAINER_CLASS (gtk_scrolled_window_parent_class)->remove (container, child);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 114aafe..e671cac 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -741,7 +741,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->destroy = gtk_widget_real_destroy;
klass->activate_signal = 0;
- klass->set_scroll_adjustments_signal = 0;
klass->dispatch_child_properties_changed = gtk_widget_dispatch_child_properties_changed;
klass->show = gtk_widget_real_show;
klass->show_all = gtk_widget_show;
@@ -5906,56 +5905,6 @@ gtk_widget_activate (GtkWidget *widget)
return FALSE;
}
-/**
- * gtk_widget_set_scroll_adjustments:
- * @widget: a #GtkWidget
- * @hadjustment: (allow-none): an adjustment for horizontal scrolling, or %NULL
- * @vadjustment: (allow-none): an adjustment for vertical scrolling, or %NULL
- *
- * For widgets that support scrolling, sets the scroll adjustments and
- * returns %TRUE. For widgets that don't support scrolling, does
- * nothing and returns %FALSE. Widgets that don't support scrolling
- * can be scrolled by placing them in a #GtkViewport, which does
- * support scrolling.
- *
- * Return value: %TRUE if the widget supports scrolling
- **/
-gboolean
-gtk_widget_set_scroll_adjustments (GtkWidget *widget,
- GtkAdjustment *hadjustment,
- GtkAdjustment *vadjustment)
-{
- guint signal_id;
- GSignalQuery query;
-
- g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
-
- if (hadjustment)
- g_return_val_if_fail (GTK_IS_ADJUSTMENT (hadjustment), FALSE);
- if (vadjustment)
- g_return_val_if_fail (GTK_IS_ADJUSTMENT (vadjustment), FALSE);
-
- signal_id = WIDGET_CLASS (widget)->set_scroll_adjustments_signal;
- if (!signal_id)
- return FALSE;
-
- g_signal_query (signal_id, &query);
- if (!query.signal_id ||
- !g_type_is_a (query.itype, GTK_TYPE_WIDGET) ||
- query.return_type != G_TYPE_NONE ||
- query.n_params != 2 ||
- query.param_types[0] != GTK_TYPE_ADJUSTMENT ||
- query.param_types[1] != GTK_TYPE_ADJUSTMENT)
- {
- g_warning (G_STRLOC ": signal \"%s::%s\" has wrong signature",
- G_OBJECT_TYPE_NAME (widget), query.signal_name);
- return FALSE;
- }
-
- g_signal_emit (widget, signal_id, 0, hadjustment, vadjustment);
- return TRUE;
-}
-
static void
gtk_widget_reparent_subwindows (GtkWidget *widget,
GdkWindow *new_window)
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 53d90c8..a596500 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -131,10 +131,6 @@ struct _GtkWidget
* @activate_signal: The signal to emit when a widget of this class is
* activated, gtk_widget_activate() handles the emission.
* Implementation of this signal is optional.
- * @set_scroll_adjustments_signal: This signal is emitted when a widget of
- * this class is added to a scrolling aware parent,
- * gtk_widget_set_scroll_adjustments() handles the emission.
- * Implementation of this signal is optional.
* @adjust_size_request: Convert an initial size request from a widget's
* #GtkSizeRequest virtual method implementations into a size request to
* be used by parent containers in laying out the widget.
@@ -171,8 +167,6 @@ struct _GtkWidgetClass
guint activate_signal;
- guint set_scroll_adjustments_signal;
-
/* seldomly overidden */
void (*dispatch_child_properties_changed) (GtkWidget *widget,
guint n_pspecs,
@@ -498,9 +492,6 @@ gboolean gtk_widget_send_focus_change (GtkWidget *widget,
GdkEvent *event);
gboolean gtk_widget_activate (GtkWidget *widget);
-gboolean gtk_widget_set_scroll_adjustments (GtkWidget *widget,
- GtkAdjustment *hadjustment,
- GtkAdjustment *vadjustment);
void gtk_widget_reparent (GtkWidget *widget,
GtkWidget *new_parent);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]