aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-04-13 13:20:31 +0800
committerJavier Jardón <jjardon@gnome.org>2010-04-13 22:23:16 +0800
commit96421ff37cd554af1ac11527bcad25cc2f2f1930 (patch)
tree3f1a0d1ded8ab241481df3eb1ae1772c137eff7f /widgets/misc
parent7e931d4c10c0b0d06c9df571589d003e43790690 (diff)
downloadgsoc2013-evolution-96421ff37cd554af1ac11527bcad25cc2f2f1930.tar.gz
gsoc2013-evolution-96421ff37cd554af1ac11527bcad25cc2f2f1930.tar.zst
gsoc2013-evolution-96421ff37cd554af1ac11527bcad25cc2f2f1930.zip
Use accessor functions instead direct access (GSEAL work)
Still remaining: GtkAccessible::widget GtkAssistant::forward GtkAssistant::back GtkObject::flags GtkTreeStore::stamp The GtkAssistant fields are related to bug #596428. We don't need accessor functions so much as the enhancement described there implemented. https://bugzilla.gnome.org/show_bug.cgi?id=615613
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/e-attachment-paned.c4
-rw-r--r--widgets/misc/e-calendar.c17
-rw-r--r--widgets/misc/e-map.c9
-rw-r--r--widgets/misc/e-menu-tool-button.c3
-rw-r--r--widgets/misc/e-online-button.c2
-rw-r--r--widgets/misc/e-preferences-window.c2
6 files changed, 21 insertions, 16 deletions
diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c
index 417e436f50..110e858e74 100644
--- a/widgets/misc/e-attachment-paned.c
+++ b/widgets/misc/e-attachment-paned.c
@@ -547,7 +547,7 @@ attachment_paned_init (EAttachmentPaned *paned)
container = widget;
widget = e_attachment_icon_view_new ();
- GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (widget, TRUE);
gtk_icon_view_set_model (GTK_ICON_VIEW (widget), paned->priv->model);
gtk_container_add (GTK_CONTAINER (container), widget);
paned->priv->icon_view = g_object_ref (widget);
@@ -567,7 +567,7 @@ attachment_paned_init (EAttachmentPaned *paned)
container = widget;
widget = e_attachment_tree_view_new ();
- GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (widget, TRUE);
gtk_tree_view_set_model (GTK_TREE_VIEW (widget), paned->priv->model);
gtk_container_add (GTK_CONTAINER (container), widget);
paned->priv->tree_view = g_object_ref (widget);
diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c
index 3164b7b976..fd8f882b25 100644
--- a/widgets/misc/e-calendar.c
+++ b/widgets/misc/e-calendar.c
@@ -623,26 +623,29 @@ e_calendar_focus (GtkWidget *widget, GtkDirectionType direction)
void
e_calendar_set_focusable (ECalendar *cal, gboolean focusable)
{
+ GtkWidget *widget;
GtkWidget *prev_widget, *next_widget;
+ GtkWidget *toplevel;
g_return_if_fail (E_IS_CALENDAR (cal));
+ widget = GTK_WIDGET (cal);
prev_widget = GNOME_CANVAS_WIDGET(cal->prev_item)->widget;
next_widget = GNOME_CANVAS_WIDGET(cal->next_item)->widget;
if (focusable) {
- GTK_WIDGET_SET_FLAGS (cal, GTK_CAN_FOCUS);
- GTK_WIDGET_SET_FLAGS (prev_widget, GTK_CAN_FOCUS);
- GTK_WIDGET_SET_FLAGS (next_widget, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (widget, TRUE);
+ gtk_widget_set_can_focus (prev_widget, TRUE);
+ gtk_widget_set_can_focus (next_widget, TRUE);
}
else {
if (gtk_widget_has_focus (GTK_WIDGET (cal)) || e_calendar_button_has_focus (cal)) {
- GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (cal));
+ toplevel = gtk_widget_get_toplevel (widget);
if (toplevel)
gtk_widget_grab_focus (toplevel);
}
- GTK_WIDGET_UNSET_FLAGS (cal, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (prev_widget, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (next_widget, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (widget, FALSE);
+ gtk_widget_set_can_focus (prev_widget, FALSE);
+ gtk_widget_set_can_focus (next_widget, FALSE);
}
}
diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c
index 4ce8d75084..22ea72fa6a 100644
--- a/widgets/misc/e-map.c
+++ b/widgets/misc/e-map.c
@@ -198,8 +198,11 @@ static void
e_map_init (EMap *view)
{
EMapPrivate *priv;
+ GtkWidget *widget;
gchar *map_file_name = g_build_filename (EVOLUTION_IMAGESDIR, "world_map-960.png", NULL);
+ widget = GTK_WIDGET (view);
+
priv = g_new0 (EMapPrivate, 1);
view->priv = priv;
@@ -210,8 +213,8 @@ e_map_init (EMap *view)
priv->zoom_state = E_MAP_ZOOMED_OUT;
priv->points = g_ptr_array_new ();
- GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (view, GTK_NO_WINDOW);
+ gtk_widget_set_can_focus (widget, TRUE);
+ gtk_widget_set_has_window (widget, TRUE);
}
/* Destroy handler for the map view */
@@ -300,7 +303,7 @@ e_map_realize (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (E_IS_MAP (widget));
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ gtk_widget_set_realized (widget, TRUE);
gtk_widget_get_allocation (widget, &allocation);
diff --git a/widgets/misc/e-menu-tool-button.c b/widgets/misc/e-menu-tool-button.c
index 0d9599c2f4..5a87e7420a 100644
--- a/widgets/misc/e-menu-tool-button.c
+++ b/widgets/misc/e-menu-tool-button.c
@@ -50,8 +50,7 @@ menu_tool_button_get_first_menu_item (GtkMenuToolButton *menu_tool_button)
if (!GTK_IS_MENU (menu))
return NULL;
- /* XXX GTK+ 2.18 provides no accessor function. */
- children = GTK_MENU_SHELL (menu)->children;
+ children = gtk_container_get_children (GTK_CONTAINER (menu));
if (children == NULL)
return NULL;
diff --git a/widgets/misc/e-online-button.c b/widgets/misc/e-online-button.c
index cb7dab1453..6fcd446958 100644
--- a/widgets/misc/e-online-button.c
+++ b/widgets/misc/e-online-button.c
@@ -141,7 +141,7 @@ online_button_init (EOnlineButton *button)
button->priv = E_ONLINE_BUTTON_GET_PRIVATE (button);
- GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (button, FALSE);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
widget = gtk_image_new ();
diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c
index f40dee180b..27caa80e80 100644
--- a/widgets/misc/e-preferences-window.c
+++ b/widgets/misc/e-preferences-window.c
@@ -287,7 +287,7 @@ preferences_window_init (EPreferencesWindow *window)
g_signal_connect_swapped (
widget, "clicked",
G_CALLBACK (gtk_widget_hide), window);
- GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (widget, TRUE);
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
accel_group = gtk_accel_group_new ();
gtk_widget_add_accelerator (