[gtk+/refactor: 95/106] Use accessor functions to access GtkScrolledWindow
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/refactor: 95/106] Use accessor functions to access GtkScrolledWindow
- Date: Tue, 13 Jul 2010 17:38:00 +0000 (UTC)
commit 0998b1a95a7a67ae13247b38b66cb332755f6a67
Author: Javier Jardón <jjardon gnome org>
Date: Fri Jul 9 21:53:55 2010 +0200
Use accessor functions to access GtkScrolledWindow
gtk/gtkentrycompletion.c | 3 +-
modules/other/gail/gailscrolledwindow.c | 34 +++++++++++++++++++-----------
2 files changed, 23 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index f793fa8..3bd43fb 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -471,7 +471,8 @@ gtk_entry_completion_init (GtkEntryCompletion *completion)
GTK_SHADOW_NONE);
/* a nasty hack to get the completions treeview to size nicely */
- gtk_widget_set_size_request (GTK_SCROLLED_WINDOW (priv->scrolled_window)->vscrollbar, -1, 0);
+ gtk_widget_set_size_request (gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (priv->scrolled_window)),
+ -1, 0);
/* actions */
priv->actions = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN);
diff --git a/modules/other/gail/gailscrolledwindow.c b/modules/other/gail/gailscrolledwindow.c
index 8a0bc4b..15706cf 100644
--- a/modules/other/gail/gailscrolledwindow.c
+++ b/modules/other/gail/gailscrolledwindow.c
@@ -64,12 +64,13 @@ gail_scrolled_window_real_initialize (AtkObject *obj,
ATK_OBJECT_CLASS (gail_scrolled_window_parent_class)->initialize (obj, data);
window = GTK_SCROLLED_WINDOW (data);
- g_signal_connect_data (window->hscrollbar, "notify::visible",
- (GCallback)gail_scrolled_window_scrollbar_visibility_changed,
- obj, NULL, FALSE);
- g_signal_connect_data (window->vscrollbar, "notify::visible",
- (GCallback)gail_scrolled_window_scrollbar_visibility_changed,
- obj, NULL, FALSE);
+
+ g_signal_connect_data (gtk_scrolled_window_get_hscrollbar (window), "notify::visible",
+ G_CALLBACK (gail_scrolled_window_scrollbar_visibility_changed),
+ obj, NULL, FALSE);
+ g_signal_connect_data (gtk_scrolled_window_get_vscrollbar (window), "notify::visible",
+ G_CALLBACK (gail_scrolled_window_scrollbar_visibility_changed),
+ obj, NULL, FALSE);
obj->role = ATK_ROLE_SCROLL_PANE;
}
@@ -110,6 +111,7 @@ gail_scrolled_window_ref_child (AtkObject *obj,
{
GtkWidget *widget;
GtkScrolledWindow *gtk_window;
+ GtkWidget *hscrollbar, *vscrollbar;
GList *children, *tmp_list;
gint n_children;
AtkObject *accessible = NULL;
@@ -122,6 +124,8 @@ gail_scrolled_window_ref_child (AtkObject *obj,
return NULL;
gtk_window = GTK_SCROLLED_WINDOW (widget);
+ hscrollbar = gtk_scrolled_window_get_hscrollbar (gtk_window);
+ vscrollbar = gtk_scrolled_window_get_vscrollbar (gtk_window);
children = gtk_container_get_children (GTK_CONTAINER (gtk_window));
n_children = g_list_length (children);
@@ -129,14 +133,14 @@ gail_scrolled_window_ref_child (AtkObject *obj,
if (child == n_children)
{
if (gtk_window->hscrollbar_visible)
- accessible = gtk_widget_get_accessible (gtk_window->hscrollbar);
+ accessible = gtk_widget_get_accessible (hscrollbar);
else if (gtk_window->vscrollbar_visible)
- accessible = gtk_widget_get_accessible (gtk_window->vscrollbar);
+ accessible = gtk_widget_get_accessible (vscrollbar);
}
else if (child == n_children+1 &&
gtk_window->hscrollbar_visible &&
gtk_window->vscrollbar_visible)
- accessible = gtk_widget_get_accessible (gtk_window->vscrollbar);
+ accessible = gtk_widget_get_accessible (vscrollbar);
else if (child < n_children)
{
tmp_list = g_list_nth (children, child);
@@ -164,6 +168,7 @@ gail_scrolled_window_scrollbar_visibility_changed (GObject *object,
GList *children;
AtkObject *child;
GtkScrolledWindow *gtk_window;
+ GtkWidget *hscrollbar, *vscrollbar;
GailScrolledWindow *gail_window = GAIL_SCROLLED_WINDOW (user_data);
gchar *signal_name;
@@ -174,19 +179,22 @@ gail_scrolled_window_scrollbar_visibility_changed (GObject *object,
index = n_children = g_list_length (children);
g_list_free (children);
- if ((gpointer) object == (gpointer) (gtk_window->hscrollbar))
+ hscrollbar = gtk_scrolled_window_get_hscrollbar (gtk_window);
+ vscrollbar = gtk_scrolled_window_get_vscrollbar (gtk_window);
+
+ if ((gpointer) object == (gpointer) (hscrollbar))
{
if (gtk_window->hscrollbar_visible)
child_added = TRUE;
- child = gtk_widget_get_accessible (gtk_window->hscrollbar);
+ child = gtk_widget_get_accessible (hscrollbar);
}
- else if ((gpointer) object == (gpointer) (gtk_window->vscrollbar))
+ else if ((gpointer) object == (gpointer) (vscrollbar))
{
if (gtk_window->vscrollbar_visible)
child_added = TRUE;
- child = gtk_widget_get_accessible (gtk_window->vscrollbar);
+ child = gtk_widget_get_accessible (vscrollbar);
if (gtk_window->hscrollbar_visible)
index = n_children+1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]