diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-08-17 00:36:13 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-17 00:36:46 +0800 |
commit | 2a8e2030e46b63a9cac0cd5d3017fd9d73a57407 (patch) | |
tree | 1528b2baf5a21317d55e1d2358e36ad45b11144f | |
parent | 672adf12a0923437e90d08ab7925bd9329fcce0d (diff) | |
download | gsoc2013-evolution-2a8e2030e46b63a9cac0cd5d3017fd9d73a57407.tar.gz gsoc2013-evolution-2a8e2030e46b63a9cac0cd5d3017fd9d73a57407.tar.zst gsoc2013-evolution-2a8e2030e46b63a9cac0cd5d3017fd9d73a57407.zip |
Chip away at GSEAL compliance.
-rw-r--r-- | e-util/e-dialog-widgets.c | 14 | ||||
-rw-r--r-- | e-util/e-error.c | 19 | ||||
-rw-r--r-- | e-util/e-request.c | 2 | ||||
-rw-r--r-- | filter/filter-datespec.c | 4 | ||||
-rw-r--r-- | filter/filter-rule.c | 8 | ||||
-rw-r--r-- | filter/rule-context.c | 4 | ||||
-rw-r--r-- | filter/rule-editor.c | 17 | ||||
-rw-r--r-- | widgets/misc/e-calendar.c | 31 |
8 files changed, 68 insertions, 31 deletions
diff --git a/e-util/e-dialog-widgets.c b/e-util/e-dialog-widgets.c index afa680d11b..cdcd52dd26 100644 --- a/e-util/e-dialog-widgets.c +++ b/e-util/e-dialog-widgets.c @@ -320,9 +320,11 @@ e_dialog_radio_get (GtkWidget *widget, const gint *value_map) group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget)); for (i = 0, l = group; l; l = l->next, i++) { - widget = GTK_WIDGET (l->data); + GtkToggleButton *toggle_button; - if (GTK_TOGGLE_BUTTON (widget)->active) + toggle_button = GTK_TOGGLE_BUTTON (l->data); + + if (gtk_toggle_button_get_active (toggle_button)) break; } @@ -373,10 +375,9 @@ e_dialog_toggle_set (GtkWidget *widget, gboolean value) gboolean e_dialog_toggle_get (GtkWidget *widget) { - g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_TOGGLE_BUTTON (widget), FALSE); - return GTK_TOGGLE_BUTTON (widget)->active; + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); } /** @@ -396,7 +397,7 @@ e_dialog_spin_set (GtkWidget *widget, double value) adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)); - adj->value = value; + gtk_adjustment_set_value (adj, value); g_signal_emit_by_name (adj, "value_changed", 0); } @@ -417,7 +418,8 @@ e_dialog_spin_get_double (GtkWidget *widget) g_return_val_if_fail (GTK_IS_SPIN_BUTTON (widget), 0.0); adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)); - return adj->value; + + return gtk_adjustment_get_value (adj); } /** diff --git a/e-util/e-error.c b/e-util/e-error.c index dd5dddf64e..b672e1d17e 100644 --- a/e-util/e-error.c +++ b/e-util/e-error.c @@ -412,6 +412,8 @@ e_error_newv(GtkWindow *parent, const gchar *tag, const gchar *arg0, va_list ap) struct _e_error *e; struct _e_error_button *b; GtkWidget *hbox, *w, *scroll=NULL; + GtkWidget *action_area; + GtkWidget *content_area; gchar *tmp, *domain, *id; GString *out, *oerr; GPtrArray *args; @@ -422,11 +424,14 @@ e_error_newv(GtkWindow *parent, const gchar *tag, const gchar *arg0, va_list ap) ee_load_tables(); dialog = (GtkDialog *)gtk_dialog_new(); + action_area = gtk_dialog_get_action_area (dialog); + content_area = gtk_dialog_get_content_area (dialog); + gtk_dialog_set_has_separator(dialog, FALSE); gtk_widget_ensure_style ((GtkWidget *)dialog); - gtk_container_set_border_width ((GtkContainer *)(dialog->vbox), 0); - gtk_container_set_border_width ((GtkContainer *)(dialog->action_area), 12); + gtk_container_set_border_width (GTK_CONTAINER (action_area), 12); + gtk_container_set_border_width (GTK_CONTAINER (content_area), 0); if (parent == NULL && ee_parent_list) parent = (GtkWindow *)ee_parent_list->data; @@ -454,7 +459,7 @@ e_error_newv(GtkWindow *parent, const gchar *tag, const gchar *arg0, va_list ap) gtk_label_set_markup((GtkLabel *)w, tmp); GTK_WIDGET_UNSET_FLAGS (w, GTK_CAN_FOCUS); gtk_widget_show(w); - gtk_box_pack_start((GtkBox *)dialog->vbox, w, TRUE, TRUE, 12); + gtk_box_pack_start (GTK_BOX (content_area), w, TRUE, TRUE, 12); return (GtkWidget *)dialog; } @@ -557,7 +562,7 @@ e_error_newv(GtkWindow *parent, const gchar *tag, const gchar *arg0, va_list ap) gtk_widget_show_all(hbox); - gtk_box_pack_start((GtkBox *)dialog->vbox, hbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0); g_object_set_data_full ((GObject *) dialog, "primary", perr, g_free); g_object_set_data_full ((GObject *) dialog, "secondary", serr, g_free); @@ -645,14 +650,14 @@ e_error_run(GtkWindow *parent, const gchar *tag, const gchar *arg0, ...) guint e_error_count_buttons (GtkDialog *dialog) { - GtkContainer *action_area; + GtkWidget *container; GList *children, *iter; guint n_buttons = 0; g_return_val_if_fail (GTK_DIALOG (dialog), 0); - action_area = GTK_CONTAINER (dialog->action_area); - children = gtk_container_get_children (action_area); + container = gtk_dialog_get_action_area (dialog); + children = gtk_container_get_children (GTK_CONTAINER (container)); /* Iterate over the children looking for buttons. */ for (iter = children; iter != NULL; iter = iter->next) diff --git a/e-util/e-request.c b/e-util/e-request.c index 3cd23968b2..58784ee1ae 100644 --- a/e-util/e-request.c +++ b/e-util/e-request.c @@ -64,7 +64,7 @@ e_request_string (GtkWindow *parent, gtk_window_set_default_size (GTK_WINDOW (dialog), 275, -1); gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); - vbox = GTK_DIALOG (dialog)->vbox; + vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); prompt_label = gtk_label_new (prompt); gtk_box_pack_start (GTK_BOX (vbox), prompt_label, TRUE, TRUE, 6); diff --git a/filter/filter-datespec.c b/filter/filter-datespec.c index 934434c619..fcfc877dc0 100644 --- a/filter/filter-datespec.c +++ b/filter/filter-datespec.c @@ -426,6 +426,7 @@ static void button_clicked (GtkButton *button, FilterDatespec *fds) { struct _FilterDatespecPrivate *p = PRIV(fds); + GtkWidget *content_area; GtkWidget *toplevel; GtkDialog *dialog; GladeXML *gui; @@ -458,7 +459,8 @@ button_clicked (GtkButton *button, FilterDatespec *fds) g_signal_connect (p->combobox_relative, "changed", G_CALLBACK (set_combobox_relative), fds); g_signal_connect (p->combobox_past_future, "changed", G_CALLBACK (set_combobox_past_future), fds); - gtk_box_pack_start ((GtkBox *) dialog->vbox, toplevel, TRUE, TRUE, 3); + content_area = gtk_dialog_get_content_area (dialog); + gtk_box_pack_start (GTK_BOX (content_area), toplevel, TRUE, TRUE, 3); if (gtk_dialog_run (dialog) == GTK_RESPONSE_OK) { get_values (fds); diff --git a/filter/filter-rule.c b/filter/filter-rule.c index 354d276fe8..7d28881fb4 100644 --- a/filter/filter-rule.c +++ b/filter/filter-rule.c @@ -807,8 +807,12 @@ more_parts (GtkWidget *button, struct _rule_data *data) GtkAdjustment *adjustment; adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (w)); - if (adjustment) - gtk_adjustment_set_value (adjustment, adjustment->upper); + if (adjustment) { + gdouble upper; + + upper = gtk_adjustment_get_upper (adjustment); + gtk_adjustment_set_value (adjustment, upper); + } } } diff --git a/filter/rule-context.c b/filter/rule-context.c index 84cf2e4e92..b6e7df47de 100644 --- a/filter/rule-context.c +++ b/filter/rule-context.c @@ -711,6 +711,7 @@ rule_context_add_rule_gui(RuleContext *rc, FilterRule *rule, const gchar *title, { GtkDialog *dialog; GtkWidget *widget; + GtkWidget *content_area; d(printf("add rule gui '%s'\n", rule->name)); @@ -731,7 +732,8 @@ rule_context_add_rule_gui(RuleContext *rc, FilterRule *rule, const gchar *title, gtk_window_set_default_size((GtkWindow *) dialog, 600, 400); gtk_window_set_resizable((GtkWindow *) dialog, TRUE); - gtk_box_pack_start((GtkBox *) dialog->vbox, widget, TRUE, TRUE, 0); + content_area = gtk_dialog_get_content_area (dialog); + gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0); g_object_set_data_full((GObject *) dialog, "rule", rule, g_object_unref); if (path) diff --git a/filter/rule-editor.c b/filter/rule-editor.c index 59006f7597..7a9335990f 100644 --- a/filter/rule-editor.c +++ b/filter/rule-editor.c @@ -363,6 +363,7 @@ static void rule_add (GtkWidget *widget, RuleEditor *re) { GtkWidget *rules; + GtkWidget *content_area; if (re->edit != NULL) return; @@ -384,7 +385,8 @@ rule_add (GtkWidget *widget, RuleEditor *re) gtk_window_set_transient_for ((GtkWindow *) re->dialog, (GtkWindow *) re); gtk_container_set_border_width ((GtkContainer *) re->dialog, 6); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 3); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (re->dialog)); + gtk_box_pack_start (GTK_BOX (content_area), rules, TRUE, TRUE, 3); g_signal_connect (re->dialog, "response", G_CALLBACK (add_editor_response), re); g_object_weak_ref ((GObject *) re->dialog, (GWeakNotify) editor_destroy, re); @@ -442,6 +444,7 @@ static void rule_edit (GtkWidget *widget, RuleEditor *re) { GtkWidget *rules; + GtkWidget *content_area; update_selected_rule(re); @@ -465,7 +468,8 @@ rule_edit (GtkWidget *widget, RuleEditor *re) gtk_widget_set_parent_window (GTK_WIDGET (re->dialog), GTK_WIDGET (re)->window); gtk_container_set_border_width ((GtkContainer *) re->dialog, 6); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 3); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (re->dialog)); + gtk_box_pack_start (GTK_BOX (content_area), rules, TRUE, TRUE, 3); g_signal_connect (re->dialog, "response", G_CALLBACK (edit_editor_response), re); g_object_weak_ref ((GObject *) re->dialog, (GWeakNotify) editor_destroy, re); @@ -828,19 +832,24 @@ void rule_editor_construct (RuleEditor *re, RuleContext *context, GladeXML *gui, const gchar *source, const gchar *label) { GtkWidget *w; + GtkWidget *action_area; + GtkWidget *content_area; gint i; gchar *tmp; re->context = context; g_object_ref (context); + action_area = gtk_dialog_get_action_area (GTK_DIALOG (re)); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (re)); + gtk_window_set_resizable ((GtkWindow *) re, TRUE); gtk_window_set_default_size ((GtkWindow *) re, 350, 400); gtk_widget_realize ((GtkWidget *) re); - gtk_container_set_border_width ((GtkContainer *) ((GtkDialog *) re)->action_area, 12); + gtk_container_set_border_width (GTK_CONTAINER (action_area), 12); w = glade_xml_get_widget(gui, "rule_editor"); - gtk_box_pack_start((GtkBox *)((GtkDialog *)re)->vbox, w, TRUE, TRUE, 3); + gtk_box_pack_start (GTK_BOX (content_area), w, TRUE, TRUE, 3); for (i = 0; i < BUTTON_LAST; i++) { re->priv->buttons[i] = (GtkButton *) (w = glade_xml_get_widget (gui, edit_buttons[i].name)); diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index fd17c67aab..e9aacfa8b9 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -241,12 +241,16 @@ e_calendar_destroy (GtkObject *object) static void e_calendar_realize (GtkWidget *widget) { + GtkStyle *style; + GdkWindow *window; + (*GTK_WIDGET_CLASS (e_calendar_parent_class)->realize) (widget); /* Set the background of the canvas window to the normal color, or the arrow buttons are not displayed properly. */ - gdk_window_set_background (GTK_LAYOUT (widget)->bin_window, - &widget->style->bg[GTK_STATE_NORMAL]); + style = gtk_widget_get_style (widget); + window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); + gdk_window_set_background (window, &style->bg[GTK_STATE_NORMAL]); } static void @@ -254,6 +258,7 @@ e_calendar_style_set (GtkWidget *widget, GtkStyle *previous_style) { ECalendar *e_calendar; + GtkWidget *parent; e_calendar = E_CALENDAR(widget); if (GTK_WIDGET_CLASS (e_calendar_parent_class)->style_set) @@ -262,9 +267,15 @@ e_calendar_style_set (GtkWidget *widget, /* Set the background of the canvas window to the normal color, or the arrow buttons are not displayed properly. */ - if (GTK_WIDGET_REALIZED (widget->parent)) - gdk_window_set_background (GTK_LAYOUT (widget)->bin_window, - &widget->style->bg[GTK_STATE_NORMAL]); + parent = gtk_widget_get_parent (widget); + if (GTK_WIDGET_REALIZED (parent)) { + GtkStyle *style; + GdkWindow *window; + + style = gtk_widget_get_style (widget); + window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); + gdk_window_set_background (window, &style->bg[GTK_STATE_NORMAL]); + } e_calendar_item_style_set (widget, e_calendar->calitem); } @@ -277,7 +288,7 @@ e_calendar_size_request (GtkWidget *widget, gint col_width, row_height, width, height; cal = E_CALENDAR (widget); - style = GTK_WIDGET (cal)->style; + style = gtk_widget_get_style (GTK_WIDGET (cal)); g_object_get((cal->calitem), "row_height", &row_height, @@ -296,6 +307,7 @@ e_calendar_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { ECalendar *cal; + GtkStyle *style; PangoFontDescription *font_desc; PangoContext *pango_context; PangoFontMetrics *font_metrics; @@ -303,8 +315,9 @@ e_calendar_size_allocate (GtkWidget *widget, gdouble xthickness, ythickness, arrow_button_size; cal = E_CALENDAR (widget); - xthickness = widget->style->xthickness; - ythickness = widget->style->ythickness; + style = gtk_widget_get_style (widget); + xthickness = style->xthickness; + ythickness = style->ythickness; (*GTK_WIDGET_CLASS (e_calendar_parent_class)->size_allocate) (widget, allocation); @@ -412,7 +425,7 @@ e_calendar_get_border_size (ECalendar *cal, g_return_if_fail (E_IS_CALENDAR (cal)); - style = GTK_WIDGET (cal)->style; + style = gtk_widget_get_style (GTK_WIDGET (cal)); if (style) { *top = style->ythickness; |