diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-21 22:02:58 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:17 +0800 |
commit | 5146ff4c535f443fe25290eb96631e91ad44c8ef (patch) | |
tree | b8cc31419c1f297092e13eedd9a5877f4c106eda /widgets | |
parent | ea8a59a443f861af88ddb21d5dcbde1c95006203 (diff) | |
download | gsoc2013-evolution-5146ff4c535f443fe25290eb96631e91ad44c8ef.tar.gz gsoc2013-evolution-5146ff4c535f443fe25290eb96631e91ad44c8ef.tar.zst gsoc2013-evolution-5146ff4c535f443fe25290eb96631e91ad44c8ef.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets')
26 files changed, 497 insertions, 336 deletions
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.h b/widgets/menus/gal-view-instance-save-as-dialog.h index a316c9acfb..b5f9ac56e8 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.h +++ b/widgets/menus/gal-view-instance-save-as-dialog.h @@ -77,9 +77,11 @@ struct _GalViewInstanceSaveAsDialogClass { GtkDialogClass parent_class; }; -GType gal_view_instance_save_as_dialog_get_type (void); -GtkWidget * gal_view_instance_save_as_dialog_new (GalViewInstance *instance); -void gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog); +GType gal_view_instance_save_as_dialog_get_type (void); +GtkWidget * gal_view_instance_save_as_dialog_new + (GalViewInstance *instance); +void gal_view_instance_save_as_dialog_save + (GalViewInstanceSaveAsDialog *dialog); G_END_DECLS diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index f58259bdd8..ad7b95bfd4 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -2124,7 +2124,12 @@ e_calendar_item_button_press (ECalendarItem *calitem, day += calitem->selection_start_day - tmp_start_day; /* keep same count of days selected */ - add_days = e_calendar_item_get_inclusive_days (calitem, calitem->selection_start_month_offset, calitem->selection_start_day, calitem->selection_end_month_offset, calitem->selection_end_day) - 1; + add_days = e_calendar_item_get_inclusive_days ( + calitem, + calitem->selection_start_month_offset, + calitem->selection_start_day, + calitem->selection_end_month_offset, + calitem->selection_end_day) - 1; } calitem->selection_set = TRUE; @@ -2153,8 +2158,10 @@ e_calendar_item_button_press (ECalendarItem *calitem, round_up_end = TRUE; } - /* Don't round up or down if we can't select a week or more. Or when keeping week days */ - if (calitem->max_days_selected < 7 || (all_week && calitem->keep_wdays_on_weeknum_click)) { + /* Don't round up or down if we can't select a week or more, + * or when keeping week days. */ + if (calitem->max_days_selected < 7 || + (all_week && calitem->keep_wdays_on_weeknum_click)) { round_down_start = FALSE; round_up_end = FALSE; } @@ -2655,7 +2662,8 @@ e_calendar_item_set_first_month (ECalendarItem *calitem, /* Make sure the selection will be displayed. */ if (calitem->selection_start_month_offset < 0 || calitem->selection_start_month_offset >= num_months) { - calitem->selection_end_month_offset -= calitem->selection_start_month_offset; + calitem->selection_end_month_offset -= + calitem->selection_start_month_offset; calitem->selection_start_month_offset = 0; } diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index 9332345875..b0e8cbe12f 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -658,7 +658,8 @@ e_calendar_set_focusable (ECalendar *cal, gboolean focusable) gtk_widget_set_can_focus (next_widget, TRUE); } else { - if (gtk_widget_has_focus (GTK_WIDGET (cal)) || e_calendar_button_has_focus (cal)) { + if (gtk_widget_has_focus (GTK_WIDGET (cal)) || + e_calendar_button_has_focus (cal)) { toplevel = gtk_widget_get_toplevel (widget); if (toplevel) gtk_widget_grab_focus (toplevel); diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 05832f74af..e2d0fe7bbf 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -286,7 +286,8 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) } else canvas->new_current_item = NULL; - if ((canvas->new_current_item == canvas->current_item) && !canvas->left_grabbed_item) + if ((canvas->new_current_item == canvas->current_item) && + !canvas->left_grabbed_item) return retval; /* current item did not change */ /* Synthesize events for old and new current items */ diff --git a/widgets/misc/e-canvas.h b/widgets/misc/e-canvas.h index 97055ab5ff..72a2e47f54 100644 --- a/widgets/misc/e-canvas.h +++ b/widgets/misc/e-canvas.h @@ -72,12 +72,6 @@ enum { E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW = 1 << 14 }; -enum { - E_CANVAS_ITEM_SELECTION_SELECT = 1 << 0, /* TRUE = select. FALSE = unselect. */ - E_CANVAS_ITEM_SELECTION_CURSOR = 1 << 1, /* TRUE = has become cursor. FALSE = not cursor. */ - E_CANVAS_ITEM_SELECTION_DELETE_DATA = 1 << 2 -}; - typedef struct { GnomeCanvasItem *item; gpointer id; diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 881f1f332c..7fb0f8cd79 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -1944,23 +1944,26 @@ e_date_edit_update_date_entry (EDateEdit *dedit) /* This sets the text in the time entry according to the current settings. */ static void -e_date_edit_update_time_entry (EDateEdit *dedit) +e_date_edit_update_time_entry (EDateEdit *dedit) { EDateEditPrivate *priv; + GtkComboBox *combo_box; GtkWidget *child; gchar buffer[40]; struct tm tmp_tm = { 0 }; priv = dedit->priv; + combo_box = GTK_COMBO_BOX (priv->time_combo); child = gtk_bin_get_child (GTK_BIN (priv->time_combo)); if (priv->time_set_to_none || !priv->time_is_valid) { - gtk_combo_box_set_active (GTK_COMBO_BOX (priv->time_combo), -1); + gtk_combo_box_set_active (combo_box, -1); gtk_entry_set_text (GTK_ENTRY (child), ""); } else { GtkTreeModel *model; GtkTreeIter iter; + gboolean valid; gchar *b; /* Set these to reasonable values just in case. */ @@ -1975,15 +1978,19 @@ e_date_edit_update_time_entry (EDateEdit *dedit) tmp_tm.tm_isdst = -1; if (priv->use_24_hour_format) - /* This is a strftime() format. %H = hour (0-23), %M = minute. */ - e_time_format_time (&tmp_tm, 1, 0, buffer, sizeof (buffer)); + /* This is a strftime() format. + * %H = hour (0-23), %M = minute. */ + e_time_format_time ( + &tmp_tm, 1, 0, buffer, sizeof (buffer)); else - /* This is a strftime() format. %I = hour (1-12), - * %M = minute, %p = am/pm string. */ - e_time_format_time (&tmp_tm, 0, 0, buffer, sizeof (buffer)); - - /* For 12-hour am/pm format, we want space padding, not zero padding. This - * can be done with strftime's %l, but it's a potentially unportable extension. */ + /* This is a strftime() format. + * %I = hour (1-12), %M = minute, %p = am/pm. */ + e_time_format_time ( + &tmp_tm, 0, 0, buffer, sizeof (buffer)); + + /* For 12-hour am/pm format, we want space padding, not + * zero padding. This can be done with strftime's %l, + * but it's a potentially unportable extension. */ if (!priv->use_24_hour_format && buffer[0] == '0') buffer[0] = ' '; @@ -1994,28 +2001,31 @@ e_date_edit_update_time_entry (EDateEdit *dedit) while (*b == ' ') b++; - model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->time_combo)); - if (gtk_tree_model_get_iter_first (model, &iter)) { - do { - gchar *text = NULL; + model = gtk_combo_box_get_model (combo_box); + valid = gtk_tree_model_get_iter_first (model, &iter); + + while (valid) { + gchar *text = NULL; - gtk_tree_model_get (model, &iter, 0, &text, -1); - if (text) { - gchar *t = text; + gtk_tree_model_get (model, &iter, 0, &text, -1); + if (text) { + gchar *t = text; - /* truncate left spaces */ - while (*t == ' ') - t++; + /* truncate left spaces */ + while (*t == ' ') + t++; - if (strcmp (b, t) == 0) { - gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->time_combo), &iter); - g_free (text); - break; - } + if (strcmp (b, t) == 0) { + gtk_combo_box_set_active_iter ( + combo_box, &iter); + g_free (text); + break; } + } + + g_free (text); - g_free (text); - } while (gtk_tree_model_iter_next (model, &iter)); + valid = gtk_tree_model_iter_next (model, &iter); } } diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index a87f7ce040..521e8fb76b 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -1027,7 +1027,8 @@ set_import_uris (EImportAssistant *assistant, gchar **uris) furi = g_filename_to_uri (filename, NULL, NULL); target = e_import_target_new_uri (priv->import, furi, NULL); - importers = e_import_get_importers (priv->import, (EImportTarget *) target); + importers = e_import_get_importers ( + priv->import, (EImportTarget *) target); if (importers != NULL) { /* there is at least one importer which can be used, @@ -1291,38 +1292,48 @@ import_assistant_construct (EImportAssistant *import_assistant) gtk_widget_show (page); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Evolution Import Assistant")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_INTRO); + gtk_assistant_set_page_title ( + assistant, page, _("Evolution Import Assistant")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_INTRO); gtk_assistant_set_page_complete (assistant, page, TRUE); /* Intelligent or direct import page */ page = import_assistant_type_page_init (import_assistant); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Importer Type")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_title ( + assistant, page, _("Importer Type")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_CONTENT); gtk_assistant_set_page_complete (assistant, page, TRUE); /* Intelligent importer source page */ page = import_assistant_selection_page_init (import_assistant); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Select Information to Import")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_title ( + assistant, page, _("Select Information to Import")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_CONTENT); /* File selection and file type page */ page = import_assistant_file_page_init (import_assistant); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Select a File")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_title ( + assistant, page, _("Select a File")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_CONTENT); /* File destination page */ page = import_assistant_destination_page_init (import_assistant); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Import Location")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_title ( + assistant, page, _("Import Location")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_CONTENT); /* Finish page */ page = gtk_label_new (""); diff --git a/widgets/misc/e-popup-menu.h b/widgets/misc/e-popup-menu.h index 2af3183933..24a8fa6022 100644 --- a/widgets/misc/e-popup-menu.h +++ b/widgets/misc/e-popup-menu.h @@ -32,7 +32,9 @@ G_BEGIN_DECLS #define E_POPUP_SEPARATOR { (gchar *) "", NULL, (NULL), NULL, 0 } #define E_POPUP_TERMINATOR { NULL, NULL, (NULL), NULL, 0 } -#define E_POPUP_ITEM(name,fn,disable_mask) { (gchar *) (name), NULL, (fn), NULL, (disable_mask), NULL, NULL, 0, 0, 0, 0 } +#define E_POPUP_ITEM(name,fn,disable_mask) \ + { (gchar *) (name), NULL, (fn), NULL, \ + (disable_mask), NULL, NULL, 0, 0, 0, 0 } typedef struct _EPopupMenu EPopupMenu; @@ -55,15 +57,15 @@ struct _EPopupMenu { guint use_custom_closure : 1; }; -GtkMenu *e_popup_menu_create (EPopupMenu *menu_list, - guint32 disable_mask, - guint32 hide_mask, - void *default_closure); -GtkMenu *e_popup_menu_create_with_domain (EPopupMenu *menu_list, - guint32 disable_mask, - guint32 hide_mask, - void *default_closure, - const gchar *domain); +GtkMenu * e_popup_menu_create (EPopupMenu *menu_list, + guint32 disable_mask, + guint32 hide_mask, + gpointer default_closure); +GtkMenu * e_popup_menu_create_with_domain (EPopupMenu *menu_list, + guint32 disable_mask, + guint32 hide_mask, + gpointer default_closure, + const gchar *domain); G_END_DECLS diff --git a/widgets/misc/e-searching-tokenizer.c b/widgets/misc/e-searching-tokenizer.c index 0955779534..6d34b6d8f0 100644 --- a/widgets/misc/e-searching-tokenizer.c +++ b/widgets/misc/e-searching-tokenizer.c @@ -51,7 +51,8 @@ G_DEFINE_TYPE ( /* Utility functions */ -/* This is faster and safer than glib2's utf8 abomination, but isn't exported from camel as yet */ +/* This is faster and safer than glib2's utf8 abomination, + * but isn't exported from camel as yet */ static inline guint32 camel_utf8_getc (const guchar **ptr) { @@ -89,7 +90,8 @@ loop: return v; } -/* note: our tags of interest are 7 bit ascii, only, no need to do any fancy utf8 stuff */ +/* note: our tags of interest are 7 bit ascii + * only no need to do any fancy utf8 stuff */ /* tags should be upper case if this list gets longer than 10 entries, consider binary search */ static const gchar *ignored_tags[] = { @@ -246,7 +248,10 @@ build_trie (gint nocase, gint len, guchar **words) q->final = 0; if (state_depth_max < depth) { state_depth_max += 64; - state_depth = g_realloc (state_depth, sizeof (*state_depth[0])*state_depth_max); + state_depth = g_realloc ( + state_depth, + sizeof (*state_depth[0]) * + state_depth_max); } if (state_depth_size < depth) { state_depth[depth] = NULL; @@ -369,14 +374,20 @@ struct _searcher { }; static void -searcher_set_tokenfunc (struct _searcher *s, gchar *(*next)(), gpointer data) +searcher_set_tokenfunc (struct _searcher *s, + gchar *(*next)(), + gpointer data) { s->next_token = next; s->next_data = data; } static struct _searcher * -searcher_new (gint flags, gint argc, guchar **argv, const gchar *tags, const gchar *tage) +searcher_new (gint flags, + gint argc, + guchar **argv, + const gchar *tags, + const gchar *tage) { gint i, m; struct _searcher *s; @@ -457,10 +468,8 @@ output_token (struct _searcher *s, struct _token *token) if (token->tok[0] == TAG_ESCAPE) { if (token->offset >= s->offout) { - d (printf("moving tag token '%s' from input to output\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); g_queue_push_tail (&s->output, token); } else { - d (printf("discarding tag token '%s' from input\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); free_token (token); } } else { @@ -470,11 +479,9 @@ output_token (struct _searcher *s, struct _token *token) pre = s->offout - token->offset; if (pre>0) memmove (token->tok, token->tok+pre, left+1); - d (printf("adding partial remaining/failed '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); s->offout = offend; g_queue_push_tail (&s->output, token); } else { - d (printf("discarding whole token '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); free_token (token); } } @@ -516,20 +523,18 @@ output_match (struct _searcher *s, guint start, guint end) return; } - d (printf("start in token '%s'\n", starttoken->tok[0]==TAG_ESCAPE?starttoken->tok+1:starttoken->tok)); - d (printf("end in token '%s'\n", endtoken->tok[0]==TAG_ESCAPE?endtoken->tok+1:endtoken->tok)); - /* output pending stuff that didn't match afterall */ while ((struct _token *) g_queue_peek_head (&s->input) != starttoken) { token = g_queue_pop_head (&s->input); - d (printf("appending failed match '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); output_token (s, token); } /* output any pre-match text */ if (s->offout < start) { - token = append_token (&s->output, starttoken->tok + (s->offout-starttoken->offset), start-s->offout); - d (printf("adding pre-match text '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); + token = append_token ( + &s->output, starttoken->tok + + (s->offout-starttoken->offset), + start-s->offout); s->offout = start; } @@ -545,15 +550,16 @@ output_match (struct _searcher *s, guint start, guint end) if (starttoken != endtoken) { while ((struct _token *) g_queue_peek_head (&s->input) != endtoken) { token = g_queue_pop_head (&s->input); - d (printf("appending (partial) match node (head) '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); output_token (s, token); } } /* any remaining partial content */ if (s->offout < end) { - token = append_token (&s->output, endtoken->tok+(s->offout-endtoken->offset), end-s->offout); - d (printf("appending (partial) match node (tail) '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); + token = append_token ( + &s->output, endtoken->tok + + (s->offout-endtoken->offset), + end-s->offout); s->offout = end; } @@ -608,7 +614,8 @@ merge_subpending (struct _searcher *s, gint offstart, gint offend) static void push_subpending (struct _searcher *s, gint offstart, gint offend) { - /* This is really an assertion, we just ignore the last pending match instead of crashing though */ + /* This is really an assertion, we just ignore the + * last pending match instead of crashing though. */ if (s->submatchp >= s->words) { d (printf("ERROR: submatch pending stack overflow\n")); s->submatchp = s->words-1; @@ -619,7 +626,8 @@ push_subpending (struct _searcher *s, gint offstart, gint offend) s->submatchp++; } -/* move any (partial) tokens from input to output if they are beyond the current output position */ +/* move any (partial) tokens from input to output + * if they are beyond the current output position */ static void output_pending (struct _searcher *s) { @@ -679,8 +687,6 @@ searcher_next_token (struct _searcher *s) token->offset = s->offset; tok = (guchar *) token->tok; - d (printf("new token %d '%s'\n", token->offset, token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - /* tag test, reset state on unknown tags */ if (tok[0] == TAG_ESCAPE) { if (!ignore_tag ((gchar *) tok)) { @@ -728,8 +734,10 @@ searcher_next_token (struct _searcher *s) push_subpending (s, offstart, offend); /*output_match(s, offstart, offend);*/ } else if (g_queue_get_length (&s->input) > 8) { - /* we're continuing to match and merge, but we have a lot of stuff - waiting, so flush it out now since this is a safe point to do it */ + /* we're continuing to match and merge, + * but we have a lot of stuff waiting, + * so flush it out now since this is a + * safe point to do it */ output_subpending (s); } } else { @@ -895,7 +903,9 @@ search_info_to_searcher (struct _search_info *si) tage = g_alloca (20); sprintf(tage, "%c</font>", TAG_ESCAPE); - return searcher_new (si->flags, si->strv->len, (guchar **) si->strv->pdata, tags, tage); + return searcher_new ( + si->flags, si->strv->len, + (guchar **) si->strv->pdata, tags, tage); } /* ********************************************************************** */ diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index d5ce69a1a6..e41d44e808 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -744,7 +744,8 @@ e_selection_model_key_press (ESelectionModel *selection, gint cursor_col = e_selection_model_cursor_col (selection); row = e_sorter_sorted_to_model (selection->sorter, row); - e_selection_model_select_as_key_press (selection, row, cursor_col, key->state); + e_selection_model_select_as_key_press ( + selection, row, cursor_col, key->state); return TRUE; } break; @@ -755,7 +756,8 @@ e_selection_model_key_press (ESelectionModel *selection, gint cursor_col = e_selection_model_cursor_col (selection); row = e_sorter_sorted_to_model (selection->sorter, row); - e_selection_model_select_as_key_press (selection, row, cursor_col, key->state); + e_selection_model_select_as_key_press ( + selection, row, cursor_col, key->state); return TRUE; } break; diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index e7153761ac..54bd251a53 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -476,9 +476,12 @@ web_view_button_press_event_cb (EWebView *web_view, if (event) { GdkPixbufAnimation *anim; - anim = gtk_html_get_image_at (frame ? frame : GTK_HTML (web_view), event->x, event->y); + if (frame == NULL) + frame = GTK_HTML (web_view); + + anim = gtk_html_get_image_at (frame, event->x, event->y); e_web_view_set_cursor_image (web_view, anim); - if (anim) + if (anim != NULL) g_object_unref (anim); } @@ -772,7 +775,7 @@ web_view_dispose (GObject *object) priv->paste_target_list = NULL; } - if (priv->cursor_image) { + if (priv->cursor_image != NULL) { g_object_unref (priv->cursor_image); priv->cursor_image = NULL; } @@ -1987,10 +1990,10 @@ e_web_view_set_cursor_image (EWebView *web_view, { g_return_if_fail (E_IS_WEB_VIEW (web_view)); - if (image) + if (image != NULL) g_object_ref (image); - if (web_view->priv->cursor_image) + if (web_view->priv->cursor_image != NULL) g_object_unref (web_view->priv->cursor_image); web_view->priv->cursor_image = image; diff --git a/widgets/misc/e-web-view.h b/widgets/misc/e-web-view.h index ed9017e3bd..b5f368f622 100644 --- a/widgets/misc/e-web-view.h +++ b/widgets/misc/e-web-view.h @@ -124,7 +124,8 @@ void e_web_view_set_magic_smileys (EWebView *web_view, const gchar * e_web_view_get_selected_uri (EWebView *web_view); void e_web_view_set_selected_uri (EWebView *web_view, const gchar *selected_uri); -GdkPixbufAnimation * e_web_view_get_cursor_image(EWebView *web_view); +GdkPixbufAnimation * + e_web_view_get_cursor_image (EWebView *web_view); void e_web_view_set_cursor_image (EWebView *web_view, GdkPixbufAnimation *animation); GtkAction * e_web_view_get_open_proxy (EWebView *web_view); diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 48a762a8d9..b366c9382c 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -73,38 +73,36 @@ /* The height to make the popup list if there aren't any items in it. */ #define E_CELL_COMBO_LIST_EMPTY_HEIGHT 15 -static void e_cell_combo_dispose (GObject *object); - -static gint e_cell_combo_do_popup (ECellPopup *ecp, - GdkEvent *event, - gint row, - gint view_col); -static void e_cell_combo_select_matching_item (ECellCombo *ecc); -static void e_cell_combo_show_popup (ECellCombo *ecc, - gint row, - gint view_col); -static void e_cell_combo_get_popup_pos (ECellCombo *ecc, - gint row, - gint view_col, - gint *x, - gint *y, - gint *height, - gint *width); - -static void e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc); - -static gint e_cell_combo_button_press (GtkWidget *popup_window, - GdkEvent *event, - ECellCombo *ecc); -static gint e_cell_combo_button_release (GtkWidget *popup_window, - GdkEventButton *event, - ECellCombo *ecc); -static gint e_cell_combo_key_press (GtkWidget *popup_window, - GdkEventKey *event, - ECellCombo *ecc); - -static void e_cell_combo_update_cell (ECellCombo *ecc); -static void e_cell_combo_restart_edit (ECellCombo *ecc); +static void e_cell_combo_dispose (GObject *object); +static gint e_cell_combo_do_popup (ECellPopup *ecp, + GdkEvent *event, + gint row, + gint view_col); +static void e_cell_combo_select_matching_item + (ECellCombo *ecc); +static void e_cell_combo_show_popup (ECellCombo *ecc, + gint row, + gint view_col); +static void e_cell_combo_get_popup_pos (ECellCombo *ecc, + gint row, + gint view_col, + gint *x, + gint *y, + gint *height, + gint *width); +static void e_cell_combo_selection_changed (GtkTreeSelection *selection, + ECellCombo *ecc); +static gint e_cell_combo_button_press (GtkWidget *popup_window, + GdkEvent *event, + ECellCombo *ecc); +static gint e_cell_combo_button_release (GtkWidget *popup_window, + GdkEventButton *event, + ECellCombo *ecc); +static gint e_cell_combo_key_press (GtkWidget *popup_window, + GdkEventKey *event, + ECellCombo *ecc); +static void e_cell_combo_update_cell (ECellCombo *ecc); +static void e_cell_combo_restart_edit (ECellCombo *ecc); G_DEFINE_TYPE (ECellCombo, e_cell_combo, E_TYPE_CELL_POPUP) @@ -132,7 +130,8 @@ e_cell_combo_init (ECellCombo *ecc) ever be one popup in use at a time. */ ecc->popup_window = gtk_window_new (GTK_WINDOW_POPUP); - gtk_window_set_type_hint (GTK_WINDOW (ecc->popup_window), GDK_WINDOW_TYPE_HINT_COMBO); + gtk_window_set_type_hint ( + GTK_WINDOW (ecc->popup_window), GDK_WINDOW_TYPE_HINT_COMBO); gtk_window_set_resizable (GTK_WINDOW (ecc->popup_window), TRUE); frame = gtk_frame_new (NULL); @@ -143,53 +142,60 @@ e_cell_combo_init (ECellCombo *ecc) ecc->popup_scrolled_window = gtk_scrolled_window_new (NULL, NULL); scrolled_window = GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window); - gtk_scrolled_window_set_policy (scrolled_window, - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - 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_scrolled_window_set_policy ( + scrolled_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + 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); store = gtk_list_store_new (1, G_TYPE_STRING); - ecc->popup_tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); + ecc->popup_tree_view = + gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); g_object_unref (store); gtk_tree_view_append_column ( GTK_TREE_VIEW (ecc->popup_tree_view), - gtk_tree_view_column_new_with_attributes ("Text", gtk_cell_renderer_text_new (), "text", 0, NULL)); + gtk_tree_view_column_new_with_attributes ( + "Text", gtk_cell_renderer_text_new (), + "text", 0, NULL)); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ecc->popup_tree_view), FALSE); + gtk_tree_view_set_headers_visible ( + GTK_TREE_VIEW (ecc->popup_tree_view), FALSE); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ecc->popup_tree_view)); + selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (ecc->popup_tree_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window), ecc->popup_tree_view); - gtk_container_set_focus_vadjustment (GTK_CONTAINER (ecc->popup_tree_view), - gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window))); - gtk_container_set_focus_hadjustment (GTK_CONTAINER (ecc->popup_tree_view), - gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window))); + gtk_scrolled_window_add_with_viewport ( + GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window), + ecc->popup_tree_view); + gtk_container_set_focus_vadjustment ( + GTK_CONTAINER (ecc->popup_tree_view), + gtk_scrolled_window_get_vadjustment ( + GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window))); + gtk_container_set_focus_hadjustment ( + GTK_CONTAINER (ecc->popup_tree_view), + gtk_scrolled_window_get_hadjustment ( + GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window))); gtk_widget_show (ecc->popup_tree_view); a11y = gtk_widget_get_accessible (ecc->popup_tree_view); atk_object_set_name (a11y, _("popup list")); - g_signal_connect (selection, - "changed", - G_CALLBACK (e_cell_combo_selection_changed), - ecc); - g_signal_connect (ecc->popup_window, - "button_press_event", - G_CALLBACK (e_cell_combo_button_press), - ecc); - /* We use connect_after here so the list updates the selection before - we hide the popup and update the cell. */ - g_signal_connect (ecc->popup_window, - "button_release_event", - G_CALLBACK (e_cell_combo_button_release), - ecc); - g_signal_connect (ecc->popup_window, - "key_press_event", - G_CALLBACK (e_cell_combo_key_press), ecc); + g_signal_connect ( + selection, "changed", + G_CALLBACK (e_cell_combo_selection_changed), ecc); + g_signal_connect ( + ecc->popup_window, "button_press_event", + G_CALLBACK (e_cell_combo_button_press), ecc); + g_signal_connect ( + ecc->popup_window, "button_release_event", + G_CALLBACK (e_cell_combo_button_release), ecc); + g_signal_connect ( + ecc->popup_window, "key_press_event", + G_CALLBACK (e_cell_combo_key_press), ecc); } /** @@ -209,7 +215,7 @@ e_cell_combo_new (void) * GObject::dispose method */ static void -e_cell_combo_dispose (GObject *object) +e_cell_combo_dispose (GObject *object) { ECellCombo *ecc = E_CELL_COMBO (object); @@ -221,8 +227,8 @@ e_cell_combo_dispose (GObject *object) } void -e_cell_combo_set_popdown_strings (ECellCombo *ecc, - GList *strings) +e_cell_combo_set_popdown_strings (ECellCombo *ecc, + GList *strings) { GList *elem; GtkListStore *store; @@ -230,7 +236,9 @@ e_cell_combo_set_popdown_strings (ECellCombo *ecc, g_return_if_fail (E_IS_CELL_COMBO (ecc)); g_return_if_fail (strings != NULL); - store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (ecc->popup_tree_view))); + store = GTK_LIST_STORE ( + gtk_tree_view_get_model ( + GTK_TREE_VIEW (ecc->popup_tree_view))); gtk_list_store_clear (store); for (elem = strings; elem; elem = elem->next) { @@ -243,10 +251,10 @@ e_cell_combo_set_popdown_strings (ECellCombo *ecc, } static gint -e_cell_combo_do_popup (ECellPopup *ecp, - GdkEvent *event, - gint row, - gint view_col) +e_cell_combo_do_popup (ECellPopup *ecp, + GdkEvent *event, + gint row, + gint view_col) { ECellCombo *ecc = E_CELL_COMBO (ecp); guint32 time; @@ -311,9 +319,12 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) gtk_tree_model_get (model, &iter, 0, &str, -1); if (str && g_str_equal (str, cell_text)) { - GtkTreePath *path = gtk_tree_model_get_path (model, &iter); + GtkTreePath *path; - gtk_tree_view_set_cursor (GTK_TREE_VIEW (ecc->popup_tree_view), path, NULL, FALSE); + path = gtk_tree_model_get_path (model, &iter); + gtk_tree_view_set_cursor ( + GTK_TREE_VIEW (ecc->popup_tree_view), + path, NULL, FALSE); gtk_tree_path_free (path); found = TRUE; @@ -444,7 +455,9 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, gtk_widget_get_preferred_size (ecc->popup_tree_view, &list_requisition, NULL); min_height = MIN (list_requisition.height, requisition.height); - if (!gtk_tree_model_iter_n_children (gtk_tree_view_get_model (GTK_TREE_VIEW (ecc->popup_tree_view)), NULL)) + if (!gtk_tree_model_iter_n_children ( + gtk_tree_view_get_model ( + GTK_TREE_VIEW (ecc->popup_tree_view)), NULL)) list_requisition.height += E_CELL_COMBO_LIST_EMPTY_HEIGHT; popwin_child = gtk_bin_get_child (popwin); @@ -530,7 +543,8 @@ e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc) GtkTreeIter iter; GtkTreeModel *model; - if (!gtk_widget_get_realized (ecc->popup_window) || !gtk_tree_selection_get_selected (selection, &model, &iter)) + if (!gtk_widget_get_realized (ecc->popup_window) || + !gtk_tree_selection_get_selected (selection, &model, &iter)) return; e_cell_combo_update_cell (ecc); @@ -633,7 +647,8 @@ e_cell_combo_key_press (GtkWidget *popup_window, && event->keyval != GDK_KEY_3270_Enter) return FALSE; - if (event->keyval == GDK_KEY_Escape && (!ecc->popup_window||!gtk_widget_get_visible (ecc->popup_window))) + if (event->keyval == GDK_KEY_Escape && + (!ecc->popup_window || !gtk_widget_get_visible (ecc->popup_window))) return FALSE; gtk_grab_remove (ecc->popup_window); @@ -660,7 +675,8 @@ e_cell_combo_update_cell (ECellCombo *ecc) ECellText *ecell_text = E_CELL_TEXT (ecp->child); ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); ETableCol *ecol; - GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ecc->popup_tree_view)); + GtkTreeSelection *selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (ecc->popup_tree_view)); GtkTreeModel *model; GtkTreeIter iter; gchar *text = NULL, *old_text; diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index fc81d59cfd..750b4dea0b 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -843,7 +843,7 @@ e_cell_date_edit_on_ok_clicked (GtkWidget *button, } static void -e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) +e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) { GtkWidget *dialog; struct tm date_tm; @@ -873,46 +873,48 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) } static void -e_cell_date_edit_on_now_clicked (GtkWidget *button, - ECellDateEdit *ecde) +e_cell_date_edit_on_now_clicked (GtkWidget *button, + ECellDateEdit *ecde) { struct tm tmp_tm; time_t t; gchar buffer[64]; if (ecde->time_callback) { - tmp_tm = (*ecde->time_callback) (ecde, ecde->time_callback_data); + tmp_tm = ecde->time_callback ( + ecde, ecde->time_callback_data); } else { t = time (NULL); tmp_tm = *localtime (&t); } - e_time_format_date_and_time (&tmp_tm, - ecde->use_24_hour_format, - TRUE, FALSE, - buffer, sizeof (buffer)); + + e_time_format_date_and_time ( + &tmp_tm, ecde->use_24_hour_format, + TRUE, FALSE, buffer, sizeof (buffer)); e_cell_date_edit_update_cell (ecde, buffer); e_cell_date_edit_hide_popup (ecde); } static void -e_cell_date_edit_on_none_clicked (GtkWidget *button, - ECellDateEdit *ecde) +e_cell_date_edit_on_none_clicked (GtkWidget *button, + ECellDateEdit *ecde) { e_cell_date_edit_update_cell (ecde, ""); e_cell_date_edit_hide_popup (ecde); } static void -e_cell_date_edit_on_today_clicked (GtkWidget *button, - ECellDateEdit *ecde) +e_cell_date_edit_on_today_clicked (GtkWidget *button, + ECellDateEdit *ecde) { struct tm tmp_tm; time_t t; gchar buffer[64]; if (ecde->time_callback) { - tmp_tm = (*ecde->time_callback) (ecde, ecde->time_callback_data); + tmp_tm = ecde->time_callback ( + ecde, ecde->time_callback_data); } else { t = time (NULL); tmp_tm = *localtime (&t); @@ -921,18 +923,18 @@ e_cell_date_edit_on_today_clicked (GtkWidget *button, tmp_tm.tm_hour = 0; tmp_tm.tm_min = 0; tmp_tm.tm_sec = 0; - e_time_format_date_and_time (&tmp_tm, - ecde->use_24_hour_format, - FALSE, FALSE, - buffer, sizeof (buffer)); + + e_time_format_date_and_time ( + &tmp_tm, ecde->use_24_hour_format, + FALSE, FALSE, buffer, sizeof (buffer)); e_cell_date_edit_update_cell (ecde, buffer); e_cell_date_edit_hide_popup (ecde); } static void -e_cell_date_edit_update_cell (ECellDateEdit *ecde, - const gchar *text) +e_cell_date_edit_update_cell (ECellDateEdit *ecde, + const gchar *text) { ECellPopup *ecp = E_CELL_POPUP (ecde); ECellText *ecell_text = E_CELL_TEXT (ecp->child); @@ -944,21 +946,26 @@ e_cell_date_edit_update_cell (ECellDateEdit *ecde, /* Compare the new text with the existing cell contents. */ ecol = e_table_header_get_column (eti->header, ecp->popup_view_col); - old_text = e_cell_text_get_text (ecell_text, ecv->e_table_model, - ecol->col_idx, ecp->popup_row); + old_text = e_cell_text_get_text ( + ecell_text, ecv->e_table_model, + ecol->col_idx, ecp->popup_row); /* If they are different, update the cell contents. */ if (strcmp (old_text, text)) { - e_cell_text_set_value (ecell_text, ecv->e_table_model, - ecol->col_idx, ecp->popup_row, text); - e_cell_leave_edit (ecv, ecp->popup_view_col, ecol->col_idx, ecp->popup_row, NULL); + e_cell_text_set_value ( + ecell_text, ecv->e_table_model, + ecol->col_idx, ecp->popup_row, text); + e_cell_leave_edit ( + ecv, ecp->popup_view_col, + ecol->col_idx, ecp->popup_row, NULL); } e_cell_text_free_text (ecell_text, old_text); } static void -e_cell_date_edit_on_time_selected (GtkTreeSelection *selection, ECellDateEdit *ecde) +e_cell_date_edit_on_time_selected (GtkTreeSelection *selection, + ECellDateEdit *ecde) { gchar *list_item_text = NULL; GtkTreeIter iter; @@ -977,7 +984,7 @@ e_cell_date_edit_on_time_selected (GtkTreeSelection *selection, ECellDateEdit *e } static void -e_cell_date_edit_hide_popup (ECellDateEdit *ecde) +e_cell_date_edit_hide_popup (ECellDateEdit *ecde) { gtk_grab_remove (ecde->popup_window); gtk_widget_hide (ecde->popup_window); diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index b1edb1424e..76fd452397 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -185,11 +185,8 @@ cell_toggle_draw (ECellView *ecell_view, priv = E_CELL_TOGGLE (ecell_view->ecell)->priv; - if (value < 0 || value >= priv->pixbufs->len) { - g_warning ("Value from the table model is %d, the states we support are [0..%d)\n", - value, priv->pixbufs->len); + if (value < 0 || value >= priv->pixbufs->len) return; - } image = g_ptr_array_index (priv->pixbufs, value); @@ -238,7 +235,8 @@ cell_toggle_event (ECellView *ecell_view, ECellActions *actions) { ECellToggleView *toggle_view = (ECellToggleView *) ecell_view; - gpointer _value = e_table_model_value_at (ecell_view->e_table_model, model_col, row); + gpointer _value = e_table_model_value_at ( + ecell_view->e_table_model, model_col, row); const gint value = GPOINTER_TO_INT (_value); switch (event->type) { @@ -290,11 +288,8 @@ cell_toggle_print (ECellView *ecell_view, priv = E_CELL_TOGGLE (ecell_view->ecell)->priv; - if (value >= priv->pixbufs->len) { - g_warning ("Value from the table model is %d, the states we support are [0..%d)\n", - value, priv->pixbufs->len); + if (value >= priv->pixbufs->len) return; - } image = g_ptr_array_index (priv->pixbufs, value); if (image) { diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 00ad664e61..01d62602e2 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -835,7 +835,14 @@ configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) { GSList *l; gint i; - const gchar *algs[] = {"alignment4", "alignment3", "alignment2", "alignment1", NULL}; + + const gchar *algs[] = { + "alignment4", + "alignment3", + "alignment2", + "alignment1", + NULL + }; for (i = 0; i < 4; i++) { gchar buffer[80]; @@ -1268,7 +1275,9 @@ setup_gui (ETableConfig *config) builder, "e-table-config"); if (config->header) - gtk_window_set_title (GTK_WINDOW (config->dialog_toplevel), config->header); + gtk_window_set_title ( + GTK_WINDOW (config->dialog_toplevel), + config->header); config->dialog_show_fields = e_builder_get_widget ( builder, "dialog-show-fields"); @@ -1284,9 +1293,15 @@ setup_gui (ETableConfig *config) config->fields_label = e_builder_get_widget ( builder, "label-fields"); - connect_button (config, builder, "button-sort", G_CALLBACK (config_button_sort)); - connect_button (config, builder, "button-group", G_CALLBACK (config_button_group)); - connect_button (config, builder, "button-fields", G_CALLBACK (config_button_fields)); + connect_button ( + config, builder, "button-sort", + G_CALLBACK (config_button_sort)); + connect_button ( + config, builder, "button-group", + G_CALLBACK (config_button_group)); + connect_button ( + config, builder, "button-fields", + G_CALLBACK (config_button_fields)); if (!can_group) { GtkWidget *w; diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index db18a8cf9e..75626aa2a9 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -123,7 +123,8 @@ g_utf8_strncasecmp (const gchar *s1, c1 = g_unichar_tolower (g_utf8_get_char (s1)); c2 = g_unichar_tolower (g_utf8_get_char (s2)); - /* Collation is locale-dependent, so this totally fails to do the right thing. */ + /* Collation is locale-dependent, so this + * totally fails to do the right thing. */ if (c1 != c2) return c1 < c2 ? -1 : 1; diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 5d38b686a0..12fc9b95bb 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -131,7 +131,8 @@ ethi_dispose (GObject *object) { ethi->full_header = NULL; if (ethi->etfcd.widget) - g_object_remove_weak_pointer (G_OBJECT (ethi->etfcd.widget), ði->etfcd.pointer); + g_object_remove_weak_pointer ( + G_OBJECT (ethi->etfcd.widget), ði->etfcd.pointer); if (ethi->config) g_object_unref (ethi->config); @@ -586,7 +587,8 @@ do_drag_motion (ETableHeaderItem *ethi, col = ethi_find_col_by_x_nearest (ethi, x); suggested_action = gdk_drag_context_get_suggested_action (context); - if (ethi->drag_col != -1 && (col == ethi->drag_col || col == ethi->drag_col + 1)) { + if (ethi->drag_col != -1 && (col == ethi->drag_col || + col == ethi->drag_col + 1)) { if (ethi->drag_col != -1) ethi_remove_destroy_marker (ethi); @@ -701,10 +703,10 @@ static void context_connect (ETableHeaderItem *ethi, GdkDragContext *context) { - if (g_dataset_get_data (context, "e-table-header-item") == NULL) { - g_object_ref (ethi); - g_dataset_set_data_full (context, "e-table-header-item", ethi, context_destroyed); - } + if (g_dataset_get_data (context, "e-table-header-item") == NULL) + g_dataset_set_data_full ( + context, "e-table-header-item", + g_object_ref (ethi), context_destroyed); } static gboolean @@ -984,26 +986,39 @@ ethi_draw (GnomeCanvasItem *item, style = gtk_widget_get_style (GTK_WIDGET (canvas)); if (ethi->sort_info) { - gint length = e_table_sort_info_grouping_get_count (ethi->sort_info); + gint length; gint i; + + length = e_table_sort_info_grouping_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = - e_table_sort_info_grouping_get_nth ( + ETableSortColumn column; + + column = e_table_sort_info_grouping_get_nth ( ethi->sort_info, i); - g_hash_table_insert (arrows, - GINT_TO_POINTER ((gint) column.column), - GINT_TO_POINTER (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + + g_hash_table_insert ( + arrows, + GINT_TO_POINTER ((gint) column.column), + GINT_TO_POINTER ( + column.ascending ? + E_TABLE_COL_ARROW_DOWN : + E_TABLE_COL_ARROW_UP)); } + length = e_table_sort_info_sorting_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth (ethi->sort_info, i); - g_hash_table_insert (arrows, - GINT_TO_POINTER ((gint) column.column), - GINT_TO_POINTER (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + ETableSortColumn column; + + column = e_table_sort_info_sorting_get_nth ( + ethi->sort_info, i); + + g_hash_table_insert ( + arrows, + GINT_TO_POINTER ((gint) column.column), + GINT_TO_POINTER ( + column.ascending ? + E_TABLE_COL_ARROW_DOWN : + E_TABLE_COL_ARROW_UP)); } } @@ -1710,7 +1725,11 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) length = e_table_sort_info_grouping_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_grouping_get_nth (ethi->sort_info, i); + ETableSortColumn column; + + column = e_table_sort_info_grouping_get_nth ( + ethi->sort_info, i); + if (model_col == column.column || model_col == -1) { gint ascending = column.ascending; ascending = !ascending; @@ -1725,7 +1744,10 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) if (!found) { length = e_table_sort_info_sorting_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth (ethi->sort_info, i); + ETableSortColumn column; + + column = e_table_sort_info_sorting_get_nth ( + ethi->sort_info, i); if (model_col == column.column || model_col == -1) { gint ascending = column.ascending; @@ -1909,13 +1931,15 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) info->col = ethi->selected_col; ecol = e_table_header_get_column (ethi->eth, info->col); - popup = e_popup_menu_create_with_domain (ethi_context_menu, - 1 + - (ecol->sortable ? 0 : 2) + - ((ethi->table || ethi->tree) ? 0 : 4) + - ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), - ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + - 128, info, GETTEXT_PACKAGE); + popup = e_popup_menu_create_with_domain ( + ethi_context_menu, + 1 + + (ecol->sortable ? 0 : 2) + + ((ethi->table || ethi->tree) ? 0 : 4) + + ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), + ((e_table_sort_info_get_can_group ( + ethi->sort_info)) ? 0 : 16) + + 128, info, GETTEXT_PACKAGE); g_object_ref_sink (popup); g_signal_connect (popup, "selection-done", G_CALLBACK (free_popup_info), info); @@ -1932,13 +1956,15 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) (e->key.keyval == GDK_KEY_KP_Right)) { ETableCol *ecol; - if ((ethi->selected_col < 0) || (ethi->selected_col >= ethi->eth->col_count - 1)) + if ((ethi->selected_col < 0) || + (ethi->selected_col >= ethi->eth->col_count - 1)) ethi->selected_col = 0; else ethi->selected_col++; ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); ethi_change_sort_state (ethi, ecol); - } else if ((e->key.keyval == GDK_KEY_Left) || (e->key.keyval == GDK_KEY_KP_Left)) { + } else if ((e->key.keyval == GDK_KEY_Left) || + (e->key.keyval == GDK_KEY_KP_Left)) { ETableCol *ecol; if ((ethi->selected_col <= 0) || (ethi->selected_col >= ethi->eth->col_count)) diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index cc5b147747..e890d4836c 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -395,7 +395,8 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) if (pos == -1) pos = eth->col_count; - eth->columns = g_realloc (eth->columns, sizeof (ETableCol *) * (eth->col_count + 1)); + eth->columns = g_realloc ( + eth->columns, sizeof (ETableCol *) * (eth->col_count + 1)); /* * We are the primary owners of the column diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index be9e3e29ec..78a980a660 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -48,7 +48,9 @@ etssv_add (ETableSubsetVariable *etssv, if (etss->n_map + 1 > etssv->n_vals_allocated) { etssv->n_vals_allocated += INCREMENT_AMOUNT; - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); + etss->map_table = g_realloc ( + etss->map_table, + etssv->n_vals_allocated * sizeof (gint)); } etss->map_table[etss->n_map++] = row; @@ -69,7 +71,9 @@ etssv_add_array (ETableSubsetVariable *etssv, if (etss->n_map + count > etssv->n_vals_allocated) { etssv->n_vals_allocated += MAX (INCREMENT_AMOUNT, count); - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); + etss->map_table = g_realloc ( + etss->map_table, + etssv->n_vals_allocated * sizeof (gint)); } for (i = 0; i < count; i++) etss->map_table[etss->n_map++] = array[i]; @@ -90,7 +94,9 @@ etssv_add_all (ETableSubsetVariable *etssv) rows = e_table_model_row_count (etss->source); if (etss->n_map + rows > etssv->n_vals_allocated) { etssv->n_vals_allocated += MAX (INCREMENT_AMOUNT, rows); - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); + etss->map_table = g_realloc ( + etss->map_table, + etssv->n_vals_allocated * sizeof (gint)); } for (i = 0; i < rows; i++) etss->map_table[etss->n_map++] = i; @@ -109,7 +115,10 @@ etssv_remove (ETableSubsetVariable *etssv, for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] == row) { e_table_model_pre_change (etm); - memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof (gint)); + memmove ( + etss->map_table + i, + etss->map_table + i + 1, + (etss->n_map - i - 1) * sizeof (gint)); etss->n_map--; e_table_model_row_deleted (etm, i); diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index c1d0a2ad94..d1241543a5 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -1665,41 +1665,47 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, e_table->horizontal_resize = specification->horizontal_resize; e_table->allow_grouping = specification->allow_grouping; - e_table->sort_info = state->sort_info; - g_object_ref (state->sort_info); - e_table_sort_info_set_can_group (e_table->sort_info, e_table->allow_grouping); + e_table->sort_info = g_object_ref (state->sort_info); + + e_table_sort_info_set_can_group ( + e_table->sort_info, e_table->allow_grouping); - e_table->group_info_change_id = - g_signal_connect (G_OBJECT (e_table->sort_info), "group_info_changed", - G_CALLBACK (group_info_changed), e_table); + e_table->group_info_change_id = g_signal_connect ( + e_table->sort_info, "group_info_changed", + G_CALLBACK (group_info_changed), e_table); - e_table->sort_info_change_id = - g_signal_connect (G_OBJECT (e_table->sort_info), "sort_info_changed", - G_CALLBACK (sort_info_changed), e_table); + e_table->sort_info_change_id = g_signal_connect ( + e_table->sort_info, "sort_info_changed", + G_CALLBACK (sort_info_changed), e_table); g_value_set_object (val, e_table->sort_info); g_object_set_property (G_OBJECT(e_table->header), "sort_info", val); g_free (val); - e_table->sorter = e_table_sorter_new (etm, e_table->full_header, e_table->sort_info); + e_table->sorter = e_table_sorter_new ( + etm, e_table->full_header, e_table->sort_info); - g_object_set (e_table->selection, - "model", etm, - "selection_mode", specification->selection_mode, - "cursor_mode", specification->cursor_mode, - "sorter", e_table->sorter, - "header", e_table->header, - NULL); + g_object_set ( + e_table->selection, + "model", etm, + "selection_mode", specification->selection_mode, + "cursor_mode", specification->cursor_mode, + "sorter", e_table->sorter, + "header", e_table->header, + NULL); - g_signal_connect(e_table->selection, "selection_changed", - G_CALLBACK (et_selection_model_selection_changed), e_table); - g_signal_connect(e_table->selection, "selection_row_changed", - G_CALLBACK (et_selection_model_selection_row_changed), e_table); + g_signal_connect ( + e_table->selection, "selection_changed", + G_CALLBACK (et_selection_model_selection_changed), e_table); + g_signal_connect ( + e_table->selection, "selection_row_changed", + G_CALLBACK (et_selection_model_selection_row_changed), e_table); - if (!specification->no_headers) { + if (!specification->no_headers) e_table_setup_header (e_table); - } - e_table_setup_table (e_table, e_table->full_header, e_table->header, etm); + + e_table_setup_table ( + e_table, e_table->full_header, e_table->header, etm); e_table_fill_table (e_table, etm); scrollable = GTK_SCROLLABLE (e_table->table_canvas); @@ -2235,7 +2241,8 @@ e_table_commit_click_to_add (ETable *table) { et_eti_leave_edit (table); if (table->click_to_add) - e_table_click_to_add_commit (E_TABLE_CLICK_TO_ADD (table->click_to_add)); + e_table_click_to_add_commit ( + E_TABLE_CLICK_TO_ADD (table->click_to_add)); } static void @@ -2261,25 +2268,33 @@ et_get_property (GObject *object, break; case PROP_HADJUSTMENT: if (etable->table_canvas) - g_object_get_property (G_OBJECT (etable->table_canvas), "hadjustment", value); + g_object_get_property ( + G_OBJECT (etable->table_canvas), + "hadjustment", value); else g_value_set_object (value, NULL); break; case PROP_VADJUSTMENT: if (etable->table_canvas) - g_object_get_property (G_OBJECT (etable->table_canvas), "vadjustment", value); + g_object_get_property ( + G_OBJECT (etable->table_canvas), + "vadjustment", value); else g_value_set_object (value, NULL); break; case PROP_HSCROLL_POLICY: if (etable->table_canvas) - g_object_get_property (G_OBJECT (etable->table_canvas), "hscroll-policy", value); + g_object_get_property ( + G_OBJECT (etable->table_canvas), + "hscroll-policy", value); else g_value_set_enum (value, 0); break; case PROP_VSCROLL_POLICY: if (etable->table_canvas) - g_object_get_property (G_OBJECT (etable->table_canvas), "vscroll-policy", value); + g_object_get_property ( + G_OBJECT (etable->table_canvas), + "vscroll-policy", value); else g_value_set_enum (value, 0); break; @@ -2295,9 +2310,9 @@ typedef struct { static void et_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint prop_id, + const GValue *value, + GParamSpec *pspec) { ETable *etable = E_TABLE (object); @@ -2305,17 +2320,21 @@ et_set_property (GObject *object, case PROP_LENGTH_THRESHOLD: etable->length_threshold = g_value_get_int (value); if (etable->group) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etable->group), - "length_threshold", etable->length_threshold, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etable->group), + "length_threshold", + etable->length_threshold, + NULL); } break; case PROP_UNIFORM_ROW_HEIGHT: etable->uniform_row_height = g_value_get_boolean (value); if (etable->group) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etable->group), - "uniform_row_height", etable->uniform_row_height, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etable->group), + "uniform_row_height", + etable->uniform_row_height, + NULL); } break; case PROP_ALWAYS_SEARCH: @@ -2333,23 +2352,27 @@ et_set_property (GObject *object, clear_current_search_col (etable); if (etable->use_click_to_add) { - etable->click_to_add = gnome_canvas_item_new - (GNOME_CANVAS_GROUP (etable->canvas_vbox), - e_table_click_to_add_get_type (), - "header", etable->header, - "model", etable->model, - "message", etable->click_to_add_message, - NULL); + etable->click_to_add = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (etable->canvas_vbox), + e_table_click_to_add_get_type (), + "header", etable->header, + "model", etable->model, + "message", etable->click_to_add_message, + NULL); if (etable->use_click_to_add_end) - e_canvas_vbox_add_item (E_CANVAS_VBOX (etable->canvas_vbox), - etable->click_to_add); + e_canvas_vbox_add_item ( + E_CANVAS_VBOX (etable->canvas_vbox), + etable->click_to_add); else - e_canvas_vbox_add_item_start (E_CANVAS_VBOX (etable->canvas_vbox), - etable->click_to_add); - - g_signal_connect (G_OBJECT (etable->click_to_add), "cursor_change", - G_CALLBACK (click_to_add_cursor_change), etable); + e_canvas_vbox_add_item_start ( + E_CANVAS_VBOX (etable->canvas_vbox), + etable->click_to_add); + + g_signal_connect ( + etable->click_to_add, "cursor_change", + G_CALLBACK (click_to_add_cursor_change), + etable); } else { g_object_run_dispose (G_OBJECT (etable->click_to_add)); etable->click_to_add = NULL; @@ -2357,19 +2380,27 @@ et_set_property (GObject *object, break; case PROP_HADJUSTMENT: if (etable->table_canvas) - g_object_set_property (G_OBJECT (etable->table_canvas), "hadjustment", value); + g_object_set_property ( + G_OBJECT (etable->table_canvas), + "hadjustment", value); break; case PROP_VADJUSTMENT: if (etable->table_canvas) - g_object_set_property (G_OBJECT (etable->table_canvas), "vadjustment", value); + g_object_set_property ( + G_OBJECT (etable->table_canvas), + "vadjustment", value); break; case PROP_HSCROLL_POLICY: if (etable->table_canvas) - g_object_set_property (G_OBJECT (etable->table_canvas), "hscroll-policy", value); + g_object_set_property ( + G_OBJECT (etable->table_canvas), + "hscroll-policy", value); break; case PROP_VSCROLL_POLICY: if (etable->table_canvas) - g_object_set_property (G_OBJECT (etable->table_canvas), "vscroll-policy", value); + g_object_set_property ( + G_OBJECT (etable->table_canvas), + "vscroll-policy", value); break; } } diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 61200cda4c..0fe0cb79b0 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -338,12 +338,15 @@ etmm_clear_children_computed (ETreeMemoryPath *path) static void etmm_node_request_collapse (ETreeModel *etm, ETreePath node) { + ETreeModelClass *parent_class; + if (node) etmm_clear_children_computed (node); - if (E_TREE_MODEL_CLASS (e_tree_memory_parent_class)->node_request_collapse) { - E_TREE_MODEL_CLASS (e_tree_memory_parent_class)->node_request_collapse (etm, node); - } + parent_class = E_TREE_MODEL_CLASS (e_tree_memory_parent_class); + + if (parent_class->node_request_collapse != NULL) + parent_class->node_request_collapse (etm, node); } diff --git a/widgets/table/gal-a11y-e-table-click-to-add.c b/widgets/table/gal-a11y-e-table-click-to-add.c index 1b7ce531e2..a118359b1c 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add.c +++ b/widgets/table/gal-a11y-e-table-click-to-add.c @@ -36,7 +36,9 @@ static AtkObjectClass *parent_class; static GType parent_type; static gint priv_offset; -#define GET_PRIVATE(object) ((GalA11yETableClickToAddPrivate *) (((gchar *) object) + priv_offset)) +#define GET_PRIVATE(object) \ + ((GalA11yETableClickToAddPrivate *) \ + (((gchar *) object) + priv_offset)) #define PARENT_TYPE (parent_type) struct _GalA11yETableClickToAddPrivate { @@ -128,7 +130,9 @@ etcta_get_name (AtkObject *obj) g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD (obj), NULL); - etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (obj))); + etcta = E_TABLE_CLICK_TO_ADD ( + atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (obj))); if (etcta && etcta->message != NULL) return etcta->message; @@ -141,9 +145,9 @@ etcta_get_n_children (AtkObject *accessible) return 1; } -static AtkObject* +static AtkObject * etcta_ref_child (AtkObject *accessible, - gint i) + gint i) { AtkObject * atk_obj = NULL; ETableClickToAdd * etcta; @@ -151,14 +155,18 @@ etcta_ref_child (AtkObject *accessible, if (i != 0) return NULL; - etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible))); + etcta = E_TABLE_CLICK_TO_ADD ( + atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (accessible))); g_return_val_if_fail (etcta, NULL); if (etcta->rect) { - atk_obj = atk_gobject_accessible_for_object (G_OBJECT (etcta->rect)); + atk_obj = atk_gobject_accessible_for_object ( + G_OBJECT (etcta->rect)); } else if (etcta->row) { - atk_obj = atk_gobject_accessible_for_object (G_OBJECT (etcta->row)); + atk_obj = atk_gobject_accessible_for_object ( + G_OBJECT (etcta->row)); } g_object_ref (atk_obj); @@ -198,15 +206,6 @@ etcta_init (GalA11yETableClickToAdd *a11y) { } -/** - * gal_a11y_e_table_click_to_add_get_type: - * @void: - * - * Registers the &GalA11yETableClickToAdd class if necessary, and returns the type ID - * associated to it. - * - * Return value: The type ID of the &GalA11yETableClickToAdd class. - **/ GType gal_a11y_e_table_click_to_add_get_type (void) { @@ -234,7 +233,9 @@ gal_a11y_e_table_click_to_add_get_type (void) NULL }; - factory = atk_registry_get_factory (atk_get_default_registry (), GNOME_TYPE_CANVAS_ITEM); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GNOME_TYPE_CANVAS_ITEM); parent_type = atk_object_factory_get_accessible_type (factory); type = gal_a11y_type_register_static_with_private (PARENT_TYPE, @@ -288,14 +289,19 @@ etcta_selection_cursor_changed (ESelectionModel *esm, gint row, gint col, ETableClickToAdd *etcta; AtkObject *row_a11y; - etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (a11y))); + etcta = E_TABLE_CLICK_TO_ADD ( + atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (a11y))); if (etcta == NULL || etcta->row == NULL) return; row_a11y = atk_gobject_accessible_for_object (G_OBJECT (etcta->row)); if (row_a11y) { - AtkObject *cell_a11y = g_object_get_data (G_OBJECT(row_a11y), "gail-focus-object"); + AtkObject *cell_a11y; + + cell_a11y = g_object_get_data ( + G_OBJECT (row_a11y), "gail-focus-object"); if (cell_a11y) { atk_focus_tracker_notify (cell_a11y); } diff --git a/widgets/table/gal-a11y-e-table-item.c b/widgets/table/gal-a11y-e-table-item.c index ffa4bd51c2..1d0add2353 100644 --- a/widgets/table/gal-a11y-e-table-item.c +++ b/widgets/table/gal-a11y-e-table-item.c @@ -654,7 +654,10 @@ table_remove_row_selection (AtkTable *table, gint row) if (!atk_table_is_row_selected (table, row)) return TRUE; - e_selection_model_toggle_single_row (item->selection, view_to_model_row (item, row)); + + e_selection_model_toggle_single_row ( + item->selection, view_to_model_row (item, row)); + return TRUE; } diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 3986033c75..fe50f85a0c 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1827,7 +1827,10 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) } start_editing (text); - text->show_cursor = FALSE; /* so we'll redraw and the cursor will be shown */ + + /* So we'll redraw and the + * cursor will be shown. */ + text->show_cursor = FALSE; } else { if (text->im_context) { gtk_im_context_focus_out (text->im_context); @@ -2190,10 +2193,9 @@ e_text_paste (EText *text, GdkAtom selection) { g_object_ref (text); gtk_clipboard_request_text ( - - gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), - selection), - paste_received, text); + gtk_widget_get_clipboard ( + GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), + selection), paste_received, text); } typedef struct { diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c index dcc96d1d69..aeb6e6bf3b 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/widgets/text/gal-a11y-e-text.c @@ -677,7 +677,8 @@ et_get_selection (AtkText *text, if (full_text == NULL) return NULL; len = g_utf8_strlen (full_text, -1); - etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text))); + etext = E_TEXT (atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (text))); start = MIN (etext->selection_start, etext->selection_end); end = MAX (etext->selection_start, etext->selection_end); start = MIN (MAX (0, start), len); |