Gail: use accessor functions to access GtkWidget

This commit is contained in:
Javier Jardón
2010-08-15 19:45:13 +02:00
parent c8afa3f000
commit 104fdae2bf
10 changed files with 73 additions and 49 deletions

View File

@ -434,6 +434,7 @@ gail_window_ref_state_set (AtkObject *accessible)
AtkStateSet *state_set;
GtkWidget *widget;
GtkWindow *window;
GdkWindow *gdk_window;
GdkWindowState state;
state_set = ATK_OBJECT_CLASS (gail_window_parent_class)->ref_state_set (accessible);
@ -447,9 +448,10 @@ gail_window_ref_state_set (AtkObject *accessible)
if (window->has_focus)
atk_state_set_add_state (state_set, ATK_STATE_ACTIVE);
if (widget->window)
gdk_window = gtk_widget_get_window (widget);
if (window)
{
state = gdk_window_get_state (widget->window);
state = gdk_window_get_state (gdk_window);
if (state & GDK_WINDOW_STATE_ICONIFIED)
atk_state_set_add_state (state_set, ATK_STATE_ICONIFIED);
}
@ -570,7 +572,8 @@ gail_window_get_extents (AtkComponent *component,
return;
}
gdk_window_get_frame_extents (widget->window, &rect);
gdk_window_get_frame_extents (gtk_widget_get_window (widget),
&rect);
*width = rect.width;
*height = rect.height;
@ -584,7 +587,8 @@ gail_window_get_extents (AtkComponent *component,
*y = rect.y;
if (coord_type == ATK_XY_WINDOW)
{
gdk_window_get_origin (widget->window, &x_toplevel, &y_toplevel);
gdk_window_get_origin (gtk_widget_get_window (widget),
&x_toplevel, &y_toplevel);
*x -= x_toplevel;
*y -= y_toplevel;
}
@ -614,7 +618,7 @@ gail_window_get_size (AtkComponent *component,
parent_iface->get_size (component, width, height);
return;
}
gdk_window_get_frame_extents (widget->window, &rect);
gdk_window_get_frame_extents (gtk_widget_get_window (widget), &rect);
*width = rect.width;
*height = rect.height;
@ -1010,7 +1014,7 @@ gail_window_get_mdi_zorder (AtkComponent *component)
gail_return_val_if_fail (GTK_IS_WINDOW (widget), -1);
return get_window_zorder (widget->window);
return get_window_zorder (gtk_widget_get_window (widget));
}
#elif defined (GDK_WINDOWING_WIN32)