diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-04-13 13:20:31 +0800 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-04-13 22:23:16 +0800 |
commit | 96421ff37cd554af1ac11527bcad25cc2f2f1930 (patch) | |
tree | 3f1a0d1ded8ab241481df3eb1ae1772c137eff7f /widgets | |
parent | 7e931d4c10c0b0d06c9df571589d003e43790690 (diff) | |
download | gsoc2013-evolution-96421ff37cd554af1ac11527bcad25cc2f2f1930.tar gsoc2013-evolution-96421ff37cd554af1ac11527bcad25cc2f2f1930.tar.gz gsoc2013-evolution-96421ff37cd554af1ac11527bcad25cc2f2f1930.tar.bz2 gsoc2013-evolution-96421ff37cd554af1ac11527bcad25cc2f2f1930.tar.lz gsoc2013-evolution-96421ff37cd554af1ac11527bcad25cc2f2f1930.tar.xz 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')
-rw-r--r-- | widgets/misc/e-attachment-paned.c | 4 | ||||
-rw-r--r-- | widgets/misc/e-calendar.c | 17 | ||||
-rw-r--r-- | widgets/misc/e-map.c | 9 | ||||
-rw-r--r-- | widgets/misc/e-menu-tool-button.c | 3 | ||||
-rw-r--r-- | widgets/misc/e-online-button.c | 2 | ||||
-rw-r--r-- | widgets/misc/e-preferences-window.c | 2 | ||||
-rw-r--r-- | widgets/table/e-cell-combo.c | 8 | ||||
-rw-r--r-- | widgets/table/e-table-field-chooser.c | 6 | ||||
-rw-r--r-- | widgets/table/e-table.c | 2 | ||||
-rw-r--r-- | widgets/table/e-tree.c | 4 |
10 files changed, 29 insertions, 28 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 ( diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 47e1a87eac..186ae4dfed 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -146,12 +146,8 @@ e_cell_combo_init (ECellCombo *ecc) gtk_scrolled_window_set_policy (scrolled_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - GTK_WIDGET_UNSET_FLAGS ( - gtk_scrolled_window_get_hscrollbar (scrolled_window), - GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS ( - gtk_scrolled_window_get_vscrollbar (scrolled_window), - GTK_CAN_FOCUS); + gtk_widget_set_can_focus (gtk_scrolled_window_get_hscrollbar (scrolled_window), FALSE); + gtk_widget_set_can_focus (gtk_scrolled_window_get_vscrollbar (scrolled_window), FALSE); gtk_container_add (GTK_CONTAINER (frame), ecc->popup_scrolled_window); gtk_widget_show (ecc->popup_scrolled_window); diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index e56293b111..2cf0d5f114 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -156,14 +156,14 @@ create_content (GnomeCanvas **canvas) scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow1); gtk_box_pack_start (GTK_BOX (vbox_top), scrolledwindow1, TRUE, TRUE, 0); - GTK_WIDGET_UNSET_FLAGS (scrolledwindow1, GTK_CAN_FOCUS); + gtk_widget_set_can_focus (scrolledwindow1, FALSE); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); canvas_buttons = e_canvas_new (); gtk_widget_show (canvas_buttons); gtk_container_add (GTK_CONTAINER (scrolledwindow1), canvas_buttons); - GTK_WIDGET_UNSET_FLAGS (canvas_buttons, GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS (canvas_buttons, GTK_CAN_DEFAULT); + gtk_widget_set_can_focus (canvas_buttons, FALSE); + gtk_widget_set_can_default (canvas_buttons, FALSE); *canvas = GNOME_CANVAS (canvas_buttons); diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index ce2253bc66..90c42b9e44 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -509,7 +509,7 @@ et_finalize (GObject *object) static void e_table_init (ETable *e_table) { - GTK_WIDGET_SET_FLAGS (GTK_WIDGET (e_table), GTK_CAN_FOCUS); + gtk_widget_set_can_focus (GTK_WIDGET (e_table), TRUE); gtk_table_set_homogeneous (GTK_TABLE (e_table), FALSE); diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 586544900d..f14c72b4dd 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -538,7 +538,7 @@ et_search_accept (ETableSearch *search, ETree *et) static void e_tree_init (ETree *e_tree) { - GTK_WIDGET_SET_FLAGS (GTK_WIDGET (e_tree), GTK_CAN_FOCUS); + gtk_widget_set_can_focus (GTK_WIDGET (e_tree), TRUE); gtk_table_set_homogeneous (GTK_TABLE (e_tree), FALSE); @@ -709,7 +709,7 @@ e_tree_setup_header (ETree *e_tree) { gchar *pointer; e_tree->priv->header_canvas = GNOME_CANVAS (e_canvas_new ()); - GTK_WIDGET_UNSET_FLAGS (e_tree->priv->header_canvas, GTK_CAN_FOCUS); + gtk_widget_set_can_focus (e_tree->priv->header_canvas, FALSE); gtk_widget_show (GTK_WIDGET (e_tree->priv->header_canvas)); |