diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-08-16 23:25:56 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-14 20:09:00 +0800 |
commit | 777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 (patch) | |
tree | dfab9ca8f30c7b1539f86dfe19b8bf761d6a899c | |
parent | 83675abbc2b3a3bc6421094a56651d021fc0cdcd (diff) | |
download | gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.gz gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.bz2 gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.lz gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.xz gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.zst gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.zip |
Coding style and whitespace cleanup.
521 files changed, 16877 insertions, 11588 deletions
diff --git a/a11y/ea-factory.h b/a11y/ea-factory.h index b156b3b4b2..f68b3a065b 100644 --- a/a11y/ea-factory.h +++ b/a11y/ea-factory.h @@ -30,7 +30,7 @@ #include <atk/atkobject.h> #define EA_FACTORY_PARTA_GOBJECT(type, type_as_function, opt_create_accessible) \ -static AtkObject* \ +static AtkObject * \ type_as_function ## _factory_create_accessible (GObject *obj) \ { \ AtkObject *accessible; \ @@ -40,7 +40,7 @@ type_as_function ## _factory_create_accessible (GObject *obj) \ } #define EA_FACTORY_PARTA(type, type_as_function, opt_create_accessible) \ -static AtkObject* \ +static AtkObject * \ type_as_function ## _factory_create_accessible (GObject *obj) \ { \ GtkWidget *widget; \ diff --git a/a11y/gal-a11y-factory.h b/a11y/gal-a11y-factory.h index 3c774dd52c..9cd2b7b151 100644 --- a/a11y/gal-a11y-factory.h +++ b/a11y/gal-a11y-factory.h @@ -36,7 +36,7 @@ type_as_function ## _factory_get_accessible_type (void) \ return type; \ } \ \ -static AtkObject* \ +static AtkObject * \ type_as_function ## _factory_create_accessible (GObject *obj) \ { \ GtkWidget *widget; \ diff --git a/a11y/gal-a11y-util.c b/a11y/gal-a11y-util.c index 5bc91b70b7..9d44758187 100644 --- a/a11y/gal-a11y-util.c +++ b/a11y/gal-a11y-util.c @@ -28,12 +28,12 @@ #include "gal-a11y-util.h" GType -gal_a11y_type_register_static_with_private (GType parent_type, - const gchar *type_name, - GTypeInfo *info, - GTypeFlags flags, - gint priv_size, - gint *priv_offset) +gal_a11y_type_register_static_with_private (GType parent_type, + const gchar *type_name, + GTypeInfo *info, + GTypeFlags flags, + gint priv_size, + gint *priv_offset) { GTypeQuery query; diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index c2dc45304b..c23a05ba6f 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -249,7 +249,7 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam GTK_WINDOW (e_contact_editor_fullname), "contact-new"); } -GtkWidget* +GtkWidget * e_contact_editor_fullname_new (const EContactName *name) { GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, NULL); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 5dd02b48e6..6ce9524afc 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -76,11 +76,11 @@ enum { static void e_contact_editor_init (EContactEditor *editor); static void e_contact_editor_class_init (EContactEditorClass *klass); static void e_contact_editor_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec); static void e_contact_editor_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec); static void e_contact_editor_dispose (GObject *object); @@ -488,7 +488,7 @@ name_to_style (const EContactName *name, string = g_strjoinv(" ", strings); break; case 2: - midstrptr=midstring; + midstrptr = midstring; if (name) { if (name->family && *name->family) *(midstrptr++) = name->family; @@ -567,7 +567,8 @@ file_as_get_style (EContactEditor *editor) } static void -file_as_set_style (EContactEditor *editor, gint style) +file_as_set_style (EContactEditor *editor, + gint style) { gchar *string; gint i; @@ -1008,7 +1009,8 @@ get_ui_slot (EVCardAttribute *attr) } static void -set_ui_slot (EVCardAttribute *attr, gint slot) +set_ui_slot (EVCardAttribute *attr, + gint slot) { EVCardAttributeParam *param; gchar *slot_str; @@ -1524,7 +1526,8 @@ extract_phone (EContactEditor *editor) } static void -init_phone_record_type (EContactEditor *editor, gint record) +init_phone_record_type (EContactEditor *editor, + gint record) { GtkWidget *phone_type_combo_box; GtkWidget *phone_entry; @@ -1945,7 +1948,8 @@ extract_im (EContactEditor *editor) } static void -sensitize_im_types (EContactEditor *editor, GtkWidget *combo_box) +sensitize_im_types (EContactEditor *editor, + GtkWidget *combo_box) { GtkTreeModel *model; GtkTreeIter iter; @@ -1971,7 +1975,9 @@ sensitize_im_types (EContactEditor *editor, GtkWidget *combo_box) } static void -sensitize_im_record (EContactEditor *editor, gint record, gboolean enabled) +sensitize_im_record (EContactEditor *editor, + gint record, + gboolean enabled) { GtkWidget *service_combo_box; #ifdef ENABLE_IM_LOCATION @@ -2038,7 +2044,8 @@ init_personal (EContactEditor *editor) } static void -init_address_textview (EContactEditor *editor, gint record) +init_address_textview (EContactEditor *editor, + gint record) { gchar *textview_name; GtkWidget *textview; @@ -2078,7 +2085,8 @@ init_address_field (EContactEditor *editor, } static void -init_address_record (EContactEditor *editor, gint record) +init_address_record (EContactEditor *editor, + gint record) { init_address_textview (editor, record); init_address_field (editor, record, "city"); @@ -2325,7 +2333,8 @@ set_address_label (EContact *contact, } static void -extract_address_record (EContactEditor *editor, gint record) +extract_address_record (EContactEditor *editor, + gint record) { EContactAddress *address; @@ -2411,7 +2420,9 @@ sensitize_address_field (EContactEditor *editor, } static void -sensitize_address_record (EContactEditor *editor, gint record, gboolean enabled) +sensitize_address_record (EContactEditor *editor, + gint record, + gboolean enabled) { sensitize_address_textview (editor, record, enabled); sensitize_address_field (editor, record, "city", enabled); @@ -2520,7 +2531,8 @@ static FieldMapping simple_field_map[] = { }; static void -init_simple_field (EContactEditor *editor, GtkWidget *widget) +init_simple_field (EContactEditor *editor, + GtkWidget *widget) { GObject *changed_object = NULL; @@ -2569,7 +2581,9 @@ init_simple_field (EContactEditor *editor, GtkWidget *widget) } static void -fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) +fill_in_simple_field (EContactEditor *editor, + GtkWidget *widget, + gint field_id) { EContact *contact; @@ -2707,9 +2721,9 @@ extract_simple_field (EContactEditor *editor, EContactDate date; if (e_date_edit_get_date ( E_DATE_EDIT (widget), - (gint *)&date.year, - (gint *)&date.month, - (gint *)&date.day)) + (gint *) &date.year, + (gint *) &date.month, + (gint *) &date.day)) e_contact_set (contact, field_id, &date); else e_contact_set (contact, field_id, NULL); @@ -2809,7 +2823,8 @@ extract_simple_field (EContactEditor *editor, } static void -sensitize_simple_field (GtkWidget *widget, gboolean enabled) +sensitize_simple_field (GtkWidget *widget, + gboolean enabled) { if (GTK_IS_ENTRY (widget)) gtk_editable_set_editable (GTK_EDITABLE (widget), enabled); @@ -3258,7 +3273,7 @@ categories_clicked (GtkWidget *button, return; } - g_signal_connect(dialog, "response", + g_signal_connect (dialog, "response", G_CALLBACK (categories_response), editor); /* Close the category dialog if the editor is closed*/ @@ -3649,7 +3664,8 @@ save_contact (EContactEditor *ce, } static void -e_contact_editor_save_contact (EABEditor *editor, gboolean should_close) +e_contact_editor_save_contact (EABEditor *editor, + gboolean should_close) { save_contact (E_CONTACT_EDITOR (editor), should_close); } @@ -3782,7 +3798,7 @@ e_contact_editor_is_changed (EABEditor *editor) return E_CONTACT_EDITOR (editor)->changed; } -static GtkWindow* +static GtkWindow * e_contact_editor_get_window (EABEditor *editor) { return GTK_WINDOW (E_CONTACT_EDITOR (editor)->app); @@ -3837,14 +3853,17 @@ app_delete_event_cb (GtkWidget *widget, } static void -show_help_cb (GtkWidget *widget, gpointer data) +show_help_cb (GtkWidget *widget, + gpointer data) { /* FIXME Pass a proper parent window. */ e_display_help (NULL, "usage-contact-cards"); } static GList * -add_to_tab_order (GList *list, GtkBuilder *builder, const gchar *name) +add_to_tab_order (GList *list, + GtkBuilder *builder, + const gchar *name) { GtkWidget *widget = e_builder_get_widget (builder, name); return g_list_prepend (list, widget); @@ -3857,7 +3876,7 @@ setup_tab_order (GtkBuilder *builder) GList *list = NULL; /* container = e_builder_get_widget(builder, "table-contact-editor-general"); - + * if (container) { list = add_to_tab_order(list, builder, "entry-fullname"); list = add_to_tab_order(list, builder, "entry-jobtitle"); @@ -3867,7 +3886,7 @@ setup_tab_order (GtkBuilder *builder) list = add_to_tab_order(list, builder, "entry-phone-2"); list = add_to_tab_order(list, builder, "entry-phone-3"); list = add_to_tab_order(list, builder, "entry-phone-4"); - + * list = add_to_tab_order(list, builder, "entry-email1"); list = add_to_tab_order(list, builder, "alignment-htmlmail"); list = add_to_tab_order(list, builder, "entry-web"); @@ -4253,12 +4272,16 @@ e_contact_editor_new (EShell *shell, } static void -notify_readonly_cb (EBookClient *book_client, GParamSpec *pspec, EContactEditor *ce) +notify_readonly_cb (EBookClient *book_client, + GParamSpec *pspec, + EContactEditor *ce) { + EClient *client; gint new_target_editable; gboolean changed = FALSE; - new_target_editable = !e_client_is_readonly (E_CLIENT (ce->target_client)); + client = E_CLIENT (ce->target_client); + new_target_editable = !e_client_is_readonly (client); if (ce->target_editable != new_target_editable) changed = TRUE; @@ -4271,7 +4294,7 @@ notify_readonly_cb (EBookClient *book_client, GParamSpec *pspec, EContactEditor static void e_contact_editor_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -4279,7 +4302,7 @@ e_contact_editor_set_property (GObject *object, editor = E_CONTACT_EDITOR (object); - switch (prop_id) { + switch (property_id) { case PROP_SOURCE_CLIENT: { gboolean writable; gboolean changed = FALSE; @@ -4429,14 +4452,14 @@ e_contact_editor_set_property (GObject *object, NULL, g_value_get_pointer (value)); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_contact_editor_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { @@ -4444,7 +4467,7 @@ e_contact_editor_get_property (GObject *object, e_contact_editor = E_CONTACT_EDITOR (object); - switch (prop_id) { + switch (property_id) { case PROP_SOURCE_CLIENT: g_value_set_object (value, e_contact_editor->source_client); break; @@ -4480,7 +4503,7 @@ e_contact_editor_get_property (GObject *object, g_value_set_pointer (value, e_contact_editor->required_fields); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 0b33f8aa79..96af36fed2 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -91,7 +91,8 @@ quick_add_unref (QuickAdd *qa) } static void -quick_add_set_name (QuickAdd *qa, const gchar *name) +quick_add_set_name (QuickAdd *qa, + const gchar *name) { if (name == qa->name) return; @@ -101,7 +102,8 @@ quick_add_set_name (QuickAdd *qa, const gchar *name) } static void -quick_add_set_email (QuickAdd *qa, const gchar *email) +quick_add_set_email (QuickAdd *qa, + const gchar *email) { if (email == qa->email) return; @@ -111,7 +113,8 @@ quick_add_set_email (QuickAdd *qa, const gchar *email) } static void -quick_add_set_vcard (QuickAdd *qa, const gchar *vcard) +quick_add_set_vcard (QuickAdd *qa, + const gchar *vcard) { if (vcard == qa->vcard) return; @@ -332,7 +335,9 @@ edit_contact (QuickAdd *qa) #define QUICK_ADD_RESPONSE_EDIT_FULL 2 static void -clicked_cb (GtkWidget *w, gint button, gpointer closure) +clicked_cb (GtkWidget *w, + gint button, + gpointer closure) { QuickAdd *qa = (QuickAdd *) closure; @@ -400,7 +405,8 @@ sanitize_widgets (QuickAdd *qa) } static void -source_changed (ESourceComboBox *source_combo_box, QuickAdd *qa) +source_changed (ESourceComboBox *source_combo_box, + QuickAdd *qa) { ESource *source; @@ -423,7 +429,7 @@ build_quick_add_dialog (QuickAdd *qa) GtkWidget *label; GtkTable *table; ESource *source; - const gint xpad=0, ypad=0; + const gint xpad = 0, ypad = 0; g_return_val_if_fail (qa != NULL, NULL); @@ -480,7 +486,7 @@ build_quick_add_dialog (QuickAdd *qa) gtk_table_set_col_spacings (table, 12); label = gtk_label_new_with_mnemonic (_("_Full name")); - gtk_label_set_mnemonic_widget ((GtkLabel*) label, qa->name_entry); + gtk_label_set_mnemonic_widget ((GtkLabel *) label, qa->name_entry); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (table, label, @@ -522,8 +528,10 @@ build_quick_add_dialog (QuickAdd *qa) } void -e_contact_quick_add (const gchar *in_name, const gchar *email, - EContactQuickAddCallback cb, gpointer closure) +e_contact_quick_add (const gchar *in_name, + const gchar *email, + EContactQuickAddCallback cb, + gpointer closure) { QuickAdd *qa; GtkWidget *dialog; @@ -543,10 +551,10 @@ e_contact_quick_add (const gchar *in_name, const gchar *email, /* Remove extra whitespace and the quotes some mailers put around names. */ g_strstrip (name); len = strlen (name); - if ((name[0] == '\'' && name[len-1] == '\'') || + if ((name[0] == '\'' && name[len - 1] == '\'') || (name[0] == '"' && name[len-1] == '"')) { name[0] = ' '; - name[len-1] = ' '; + name[len - 1] = ' '; } g_strstrip (name); } @@ -570,7 +578,7 @@ e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, gpointer closure) { - gchar *name=NULL, *email=NULL; + gchar *name = NULL, *email = NULL; const gchar *last_at, *s; gboolean in_quote; @@ -612,7 +620,7 @@ e_contact_quick_add_free_form (const gchar *text, /* ...and then split the text there */ if (!bad_char) { if (text < last_at) - name = g_strndup (text, last_at-text); + name = g_strndup (text, last_at - text); email = g_strdup (last_at); } } @@ -629,8 +637,8 @@ e_contact_quick_add_free_form (const gchar *text, *email = ' '; changed = TRUE; } - if (email[strlen (email)-1] == '>') { - email[strlen (email)-1] = ' '; + if (email[strlen (email) - 1] == '>') { + email[strlen (email) - 1] = ' '; changed = TRUE; } if (changed) diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c index bea34db512..241bc477a4 100644 --- a/addressbook/gui/contact-editor/eab-editor.c +++ b/addressbook/gui/contact-editor/eab-editor.c @@ -301,7 +301,8 @@ eab_editor_raise (EABEditor *editor) } void -eab_editor_save_contact (EABEditor *editor, gboolean should_close) +eab_editor_save_contact (EABEditor *editor, + gboolean should_close) { EABEditorClass *class; @@ -339,7 +340,7 @@ eab_editor_is_valid (EABEditor *editor) return class->is_valid (editor); } -GtkWindow* +GtkWindow * eab_editor_get_window (EABEditor *editor) { EABEditorClass *class; @@ -353,11 +354,12 @@ eab_editor_get_window (EABEditor *editor) } /* This function prompts for saving if editor conents are in changed state and - save or discards or cancels (just returns with out doing anything) according - to user input. Editor gets destroyed in case of save and discard case. */ + * save or discards or cancels (just returns with out doing anything) according + * to user input. Editor gets destroyed in case of save and discard case. */ gboolean -eab_editor_prompt_to_save_changes (EABEditor *editor, GtkWindow *window) +eab_editor_prompt_to_save_changes (EABEditor *editor, + GtkWindow *window) { if (!eab_editor_is_changed (editor)) { eab_editor_close (EAB_EDITOR (editor)); diff --git a/addressbook/gui/contact-editor/eab-editor.h b/addressbook/gui/contact-editor/eab-editor.h index 43e36e53a3..cf8a20aecb 100644 --- a/addressbook/gui/contact-editor/eab-editor.h +++ b/addressbook/gui/contact-editor/eab-editor.h @@ -68,7 +68,7 @@ struct _EABEditorClass { void (* save_contact) (EABEditor *editor, gboolean should_close); gboolean (* is_valid) (EABEditor *editor); gboolean (* is_changed) (EABEditor *editor); - GtkWindow* (* get_window) (EABEditor *editor); + GtkWindow * (* get_window) (EABEditor *editor); /* signals */ void (* contact_added) (EABEditor *editor, const GError *error, EContact *contact); diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c index 2f54bd57b1..1d9c24aed7 100644 --- a/addressbook/gui/contact-editor/test-editor.c +++ b/addressbook/gui/contact-editor/test-editor.c @@ -67,7 +67,8 @@ read_file (gchar *name) /* Callback used when a contact editor is closed */ static void -editor_closed_cb (EContactEditor *ce, gpointer data) +editor_closed_cb (EContactEditor *ce, + gpointer data) { static gint count = 2; @@ -79,7 +80,8 @@ editor_closed_cb (EContactEditor *ce, gpointer data) } gint -main (gint argc, gchar *argv[]) +main (gint argc, + gchar *argv[]) { gchar *cardstr; EContactEditor *ce; diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 7ad6c124cc..1750f5a686 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -258,7 +258,7 @@ contact_list_editor_add_destination (GtkWidget *widget, static void contact_list_editor_add_email (EContactListEditor *editor, - const gchar *email) + const gchar *email) { CamelInternetAddress *addr; EContactListEditorPrivate *priv = editor->priv; @@ -424,7 +424,7 @@ contact_list_editor_render_destination (GtkTreeViewColumn *column, static void contact_list_editor_selection_changed_cb (GtkTreeSelection *selection, - gpointer user_data) + gpointer user_data) { EContactListEditor *editor = user_data; GtkTreeModel *model; @@ -545,15 +545,17 @@ contact_list_editor_delete_event_cb (GtkWidget *widget, void contact_list_editor_drag_data_received_cb (GtkWidget *widget, GdkDragContext *context, - gint x, gint y, - GtkSelectionData *selection_data, - guint info, - guint time); + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time); void contact_list_editor_drag_data_received_cb (GtkWidget *widget, GdkDragContext *context, - gint x, gint y, + gint x, + gint y, GtkSelectionData *selection_data, guint info, guint time) @@ -695,7 +697,7 @@ contact_list_editor_email_entry_key_press_event_cb (GtkWidget *widget, gint cpos = -1; entry = GTK_ENTRY (WIDGET (EMAIL_ENTRY)); - g_object_get (G_OBJECT (entry), "cursor-position", &cpos, NULL); + g_object_get (entry, "cursor-position", &cpos, NULL); /* not the first letter */ if (cpos > 0) { @@ -817,7 +819,7 @@ contact_list_editor_remove_button_clicked_cb (GtkWidget *widget) } /* new_selection != NULL when there is at least one item below the - removed selection */ + * removed selection */ if (new_selection) { path = gtk_tree_row_reference_get_path (new_selection); gtk_tree_selection_select_path (selection, path); @@ -825,7 +827,7 @@ contact_list_editor_remove_button_clicked_cb (GtkWidget *widget) gtk_tree_row_reference_free (new_selection); } else { /* If selection was including the last item in the list, then - find and select the new last item */ + * find and select the new last item */ GtkTreeIter iter, iter2; /* When FALSE is returned, there are no items in the list to be selected */ @@ -1157,7 +1159,7 @@ setup_custom_widgets (EContactListEditor *editor) combo_box = WIDGET (SOURCE_MENU); if (!e_book_client_get_sources (&source_list, &error)) source_list = NULL; - g_object_set (G_OBJECT (combo_box), "source-list", source_list, NULL); + g_object_set (combo_box, "source-list", source_list, NULL); if (source_list) g_object_unref (source_list); @@ -1242,7 +1244,7 @@ contact_list_editor_constructor (GType type, static void contact_list_editor_set_property (GObject *object, guint property_id, - const GValue *value, + const GValue *value, GParamSpec *pspec) { switch (property_id) { @@ -1772,8 +1774,8 @@ e_contact_list_editor_get_contact (EContactListEditor *editor) save_contact_list (model, &iter, &attrs, &parent_id); /* Put it in reverse order because e_vcard_add_attribute also uses prepend, - but we want to keep order of mails there. Hopefully noone will change - the behaviour of the e_vcard_add_attribute. */ + * but we want to keep order of mails there. Hopefully noone will change + * the behaviour of the e_vcard_add_attribute. */ for (a = attrs; a; a = a->next) { e_vcard_add_attribute (E_VCARD (contact), a->data); } diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c index e4eee15cb1..6774eee3b7 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -137,7 +137,7 @@ e_contact_list_model_has_uid (EContactListModel *model, return (g_hash_table_lookup (model->priv->uids_table, uid) != NULL); } -GtkTreePath* +GtkTreePath * e_contact_list_model_add_destination (EContactListModel *model, EDestination *destination, GtkTreeIter *parent, @@ -213,7 +213,7 @@ e_contact_list_model_add_contact (EContactListModel *model, static void contact_list_model_unref_row_dest (EContactListModel *model, - GtkTreeIter *iter) + GtkTreeIter *iter) { EDestination *dest; GtkTreeModel *tree_model; @@ -227,7 +227,7 @@ contact_list_model_unref_row_dest (EContactListModel *model, e_destination_get_contact_uid (dest))); /* If the list is only once in the model, then remove it from the hash table, - otherwise decrease the counter by one */ + * otherwise decrease the counter by one */ if (list_refs <= 1) { g_hash_table_remove (model->priv->uids_table, e_destination_get_contact_uid (dest)); @@ -270,11 +270,11 @@ e_contact_list_model_remove_row (EContactListModel *model, g_return_if_fail (iter); /* Use helper function to update our reference counters in - hash tables but don't remove any row. */ + * hash tables but don't remove any row. */ contact_list_model_unref_row_dest (model, iter); /* Get iter of parent of the row to be removed. After the row is removed, check if there are - any more children left for the parent_iter, an eventually remove the parent_iter as well */ + * any more children left for the parent_iter, an eventually remove the parent_iter as well */ if (gtk_tree_model_iter_parent (GTK_TREE_MODEL (model), &parent_iter, iter)) { gtk_tree_store_remove (GTK_TREE_STORE (model), iter); if (!gtk_tree_model_iter_has_child (GTK_TREE_MODEL (model), &parent_iter)) { diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index fd6ad8c012..a25ad4e403 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -33,10 +33,10 @@ #include "eab-contact-compare.h" /* This is an "optimistic" combiner: the best of the two outcomes is - selected. */ + * selected. */ static EABContactMatchType combine_comparisons (EABContactMatchType prev, - EABContactMatchType new_info) + EABContactMatchType new_info) { if (new_info == EAB_CONTACT_MATCH_NOT_APPLICABLE) return prev; @@ -46,7 +46,7 @@ combine_comparisons (EABContactMatchType prev, /*** Name comparisons ***/ /* This *so* doesn't belong here... at least not implemented in a - sucky way like this. But it can be fixed later. */ + * sucky way like this. But it can be fixed later. */ /* This is very Anglocentric. */ static const gchar *name_synonyms[][2] = { @@ -83,7 +83,9 @@ static const gchar *name_synonyms[][2] = { }; static gboolean -name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean strict) +name_fragment_match_with_synonyms (const gchar *a, + const gchar *b, + gboolean strict) { gint i; @@ -94,7 +96,7 @@ name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean stri return TRUE; /* Check for nicknames. Yes, the linear search blows. */ - for (i=0; name_synonyms[i][0]; ++i) { + for (i = 0; name_synonyms[i][0]; ++i) { if (!e_utf8_casefold_collate (name_synonyms[i][0], a) && !e_utf8_casefold_collate (name_synonyms[i][1], b)) @@ -109,14 +111,19 @@ name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean stri } EABContactMatchType -eab_contact_compare_name_to_string (EContact *contact, const gchar *str) +eab_contact_compare_name_to_string (EContact *contact, + const gchar *str) { return eab_contact_compare_name_to_string_full (contact, str, FALSE, NULL, NULL, NULL); } EABContactMatchType -eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gboolean allow_partial_matches, - gint *matched_parts_out, EABContactMatchPart *first_matched_part_out, gint *matched_character_count_out) +eab_contact_compare_name_to_string_full (EContact *contact, + const gchar *str, + gboolean allow_partial_matches, + gint *matched_parts_out, + EABContactMatchPart *first_matched_part_out, + gint *matched_character_count_out) { gchar **namev, **givenv = NULL, **addv = NULL, **familyv = NULL; @@ -172,8 +179,8 @@ eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gb this_part_match = EAB_CONTACT_MATCH_PART_NONE; /* When we are allowing partials, we are strict about the matches we allow. - Does this make sense? Not really, but it does the right thing for the purposes - of completion. */ + * Does this make sense? Not really, but it does the right thing for the purposes + * of completion. */ if (givenv && this_part_match == EAB_CONTACT_MATCH_PART_NONE) { for (j = 0; givenv[j]; ++j) { @@ -182,7 +189,7 @@ eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gb this_part_match = EAB_CONTACT_MATCH_PART_GIVEN_NAME; /* We remove a piece of a name once it has been matched against, so - that "john john" won't match "john doe". */ + * that "john john" won't match "john doe". */ g_free (givenv[j]); givenv[j] = g_strdup (""); break; @@ -261,7 +268,8 @@ eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gb } EABContactMatchType -eab_contact_compare_file_as (EContact *contact1, EContact *contact2) +eab_contact_compare_file_as (EContact *contact1, + EContact *contact2) { EABContactMatchType match_type; gchar *a, *b; @@ -292,10 +300,11 @@ eab_contact_compare_file_as (EContact *contact1, EContact *contact2) } EABContactMatchType -eab_contact_compare_name (EContact *contact1, EContact *contact2) +eab_contact_compare_name (EContact *contact1, + EContact *contact2) { EContactName *a, *b; - gint matches=0, possible=0; + gint matches = 0, possible = 0; gboolean family_match = FALSE; g_return_val_if_fail (E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE); @@ -337,8 +346,8 @@ eab_contact_compare_name (EContact *contact1, EContact *contact2) e_contact_name_free (b); /* Now look at the # of matches and try to intelligently map - an EAB_CONTACT_MATCH_* type to it. Special consideration is given - to family-name matches. */ + * an EAB_CONTACT_MATCH_* type to it. Special consideration is given + * to family-name matches. */ if (possible == 0) return EAB_CONTACT_MATCH_NOT_APPLICABLE; @@ -349,7 +358,7 @@ eab_contact_compare_name (EContact *contact1, EContact *contact2) if (possible == matches) return family_match ? EAB_CONTACT_MATCH_EXACT : EAB_CONTACT_MATCH_PARTIAL; - if (possible == matches+1) + if (possible == matches + 1) return family_match ? EAB_CONTACT_MATCH_VAGUE : EAB_CONTACT_MATCH_NONE; return EAB_CONTACT_MATCH_NONE; @@ -358,7 +367,8 @@ eab_contact_compare_name (EContact *contact1, EContact *contact2) /*** Nickname Comparisons ***/ EABContactMatchType -eab_contact_compare_nickname (EContact *contact1, EContact *contact2) +eab_contact_compare_nickname (EContact *contact1, + EContact *contact2) { g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE); g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE); @@ -369,7 +379,8 @@ eab_contact_compare_nickname (EContact *contact1, EContact *contact2) /*** E-mail Comparisons ***/ static gboolean -match_email_username (const gchar *addr1, const gchar *addr2) +match_email_username (const gchar *addr1, + const gchar *addr2) { gint c1, c2; if (addr1 == NULL || addr2 == NULL) @@ -388,7 +399,8 @@ match_email_username (const gchar *addr1, const gchar *addr2) } static gboolean -match_email_hostname (const gchar *addr1, const gchar *addr2) +match_email_hostname (const gchar *addr1, + const gchar *addr2) { gint c1, c2; gboolean seen_at1, seen_at2; @@ -436,7 +448,8 @@ match_email_hostname (const gchar *addr1, const gchar *addr2) } static EABContactMatchType -compare_email_addresses (const gchar *addr1, const gchar *addr2) +compare_email_addresses (const gchar *addr1, + const gchar *addr2) { if (addr1 == NULL || *addr1 == 0 || addr2 == NULL || *addr2 == 0) @@ -449,7 +462,8 @@ compare_email_addresses (const gchar *addr1, const gchar *addr2) } EABContactMatchType -eab_contact_compare_email (EContact *contact1, EContact *contact2) +eab_contact_compare_email (EContact *contact1, + EContact *contact2) { EABContactMatchType match = EAB_CONTACT_MATCH_NOT_APPLICABLE; GList *contact1_email, *contact2_email; @@ -473,8 +487,8 @@ eab_contact_compare_email (EContact *contact1, EContact *contact2) i1 = contact1_email; /* Do pairwise-comparisons on all of the e-mail addresses. If - we find an exact match, there is no reason to keep - checking. */ + * we find an exact match, there is no reason to keep + * checking. */ while (i1 && match != EAB_CONTACT_MATCH_EXACT) { gchar *addr1 = (gchar *) i1->data; @@ -500,7 +514,8 @@ eab_contact_compare_email (EContact *contact1, EContact *contact2) } EABContactMatchType -eab_contact_compare_address (EContact *contact1, EContact *contact2) +eab_contact_compare_address (EContact *contact1, + EContact *contact2) { g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE); g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE); @@ -511,7 +526,8 @@ eab_contact_compare_address (EContact *contact1, EContact *contact2) } EABContactMatchType -eab_contact_compare_telephone (EContact *contact1, EContact *contact2) +eab_contact_compare_telephone (EContact *contact1, + EContact *contact2) { g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE); g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE); @@ -522,7 +538,8 @@ eab_contact_compare_telephone (EContact *contact1, EContact *contact2) } EABContactMatchType -eab_contact_compare (EContact *contact1, EContact *contact2) +eab_contact_compare (EContact *contact1, + EContact *contact2) { EABContactMatchType result; @@ -660,13 +677,13 @@ query_cb (GObject *source_object, #define MAX_QUERY_PARTS 10 static void use_common_book_client (EBookClient *book_client, - MatchSearchInfo *info) + MatchSearchInfo *info) { EContact *contact = info->contact; EContactName *contact_name; GList *contact_email; gchar *query_parts[MAX_QUERY_PARTS]; - gint p=0; + gint p = 0; gchar *contact_file_as, *qj; EBookQuery *query = NULL; gint i; diff --git a/addressbook/gui/merging/eab-contact-compare.h b/addressbook/gui/merging/eab-contact-compare.h index df67c5d752..7ce31eddb9 100644 --- a/addressbook/gui/merging/eab-contact-compare.h +++ b/addressbook/gui/merging/eab-contact-compare.h @@ -40,9 +40,9 @@ typedef enum { typedef enum { EAB_CONTACT_MATCH_PART_NOT_APPLICABLE = -1, EAB_CONTACT_MATCH_PART_NONE = 0, - EAB_CONTACT_MATCH_PART_GIVEN_NAME = 1<<0, - EAB_CONTACT_MATCH_PART_ADDITIONAL_NAME = 1<<2, - EAB_CONTACT_MATCH_PART_FAMILY_NAME = 1<<3 + EAB_CONTACT_MATCH_PART_GIVEN_NAME = 1 << 0, + EAB_CONTACT_MATCH_PART_ADDITIONAL_NAME = 1 << 2, + EAB_CONTACT_MATCH_PART_FAMILY_NAME = 1 << 3 } EABContactMatchPart; typedef void (*EABContactMatchQueryCallback) (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure); diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c index 557af481bb..70e43fa284 100644 --- a/addressbook/gui/merging/eab-contact-merging.c +++ b/addressbook/gui/merging/eab-contact-merging.c @@ -210,7 +210,8 @@ add_contact_ready_cb (GObject *source_object, } static void -doit (EContactMergingLookup *lookup, gboolean force_modify) +doit (EContactMergingLookup *lookup, + gboolean force_modify) { if (lookup->op == E_CONTACT_MERGING_ADD) { if (force_modify) @@ -236,7 +237,9 @@ cancelit (EContactMergingLookup *lookup) } static void -dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) +dialog_map (GtkWidget *window, + GdkEvent *event, + GtkWidget *table) { GtkAllocation allocation; gint h, w; @@ -256,7 +259,8 @@ dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) } static void -dropdown_changed (GtkWidget *dropdown, dropdown_data *data) +dropdown_changed (GtkWidget *dropdown, + dropdown_data *data) { gchar *str; str = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (dropdown)); @@ -357,7 +361,7 @@ mergeit (EContactMergingLookup *lookup) use_field = E_CONTACT_EMAIL_2; break; } - else/*Either the new contact has no email OR the email already exist in the duplicate contact*/ + else/*Either the new contact has no email OR the email already exist in the duplicate contact */ continue; case 2: /*New contact has email and it is equal to neither of the 2 emails in the duplicate contact*/ @@ -381,7 +385,7 @@ mergeit (EContactMergingLookup *lookup) } label = gtk_label_new (_("Email")); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) label, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 0, 1, row, row + 1); dropdown = gtk_combo_box_text_new (); @@ -398,7 +402,7 @@ mergeit (EContactMergingLookup *lookup) g_signal_connect (dropdown, "changed", G_CALLBACK(dropdown_changed), data); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) dropdown, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) dropdown, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 1, 2, row, row + 1); gtk_widget_show ((GtkWidget *) dropdown); continue; @@ -407,13 +411,13 @@ mergeit (EContactMergingLookup *lookup) row++; label = gtk_label_new (e_contact_pretty_name (field)); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) label, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 0, 1, row, row + 1); label = gtk_label_new (string); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) label, FALSE, FALSE, 0); - gtk_table_attach_defaults (table, (GtkWidget*) hbox, 1, 2, row, row + 1); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) label, FALSE, FALSE, 0); + gtk_table_attach_defaults (table, (GtkWidget *) hbox, 1, 2, row, row + 1); continue; } @@ -422,7 +426,7 @@ mergeit (EContactMergingLookup *lookup) row++; label = gtk_label_new (e_contact_pretty_name (field)); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) label, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 0, 1, row, row + 1); data = g_new0 (dropdown_data, 1); dropdown = gtk_combo_box_text_new (); @@ -443,7 +447,7 @@ mergeit (EContactMergingLookup *lookup) g_signal_connect (dropdown, "changed", G_CALLBACK(dropdown_changed), data); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) dropdown, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) dropdown, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 1, 2, row, row + 1); gtk_widget_show_all ((GtkWidget *) dropdown); } @@ -475,7 +479,8 @@ mergeit (EContactMergingLookup *lookup) } static gboolean -check_if_same (EContact *contact, EContact *match) +check_if_same (EContact *contact, + EContact *match) { EContactField field; GList *email_attr_list; @@ -487,7 +492,7 @@ check_if_same (EContact *contact, EContact *match) num_of_email = g_list_length (email_attr_list); if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 - || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email<4)) { + || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email < 4)) { str = (gchar *) e_contact_get_const (contact, field); switch (num_of_email) { @@ -522,7 +527,9 @@ check_if_same (EContact *contact, EContact *match) } static void -response (GtkWidget *dialog, gint response, EContactMergingLookup *lookup) +response (GtkWidget *dialog, + gint response, + EContactMergingLookup *lookup) { static gint merge_response; @@ -547,7 +554,10 @@ response (GtkWidget *dialog, gint response, EContactMergingLookup *lookup) } static void -match_query_callback (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure) +match_query_callback (EContact *contact, + EContact *match, + EABContactMatchType type, + gpointer closure) { EContactMergingLookup *lookup = closure; gint flag; @@ -631,9 +641,9 @@ match_query_callback (EContact *contact, EContact *match, EABContactMatchType ty gboolean eab_merging_book_add_contact (EBookClient *book_client, - EContact *contact, - EABMergingIdAsyncCallback cb, - gpointer closure) + EContact *contact, + EABMergingIdAsyncCallback cb, + gpointer closure) { EContactMergingLookup *lookup; @@ -654,9 +664,9 @@ eab_merging_book_add_contact (EBookClient *book_client, gboolean eab_merging_book_modify_contact (EBookClient *book_client, - EContact *contact, - EABMergingAsyncCallback cb, - gpointer closure) + EContact *contact, + EABMergingAsyncCallback cb, + gpointer closure) { EContactMergingLookup *lookup; @@ -677,9 +687,9 @@ eab_merging_book_modify_contact (EBookClient *book_client, gboolean eab_merging_book_find_contact (EBookClient *book_client, - EContact *contact, - EABMergingContactAsyncCallback cb, - gpointer closure) + EContact *contact, + EABMergingContactAsyncCallback cb, + gpointer closure) { EContactMergingLookup *lookup; diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index dc1068dea3..74e794bd6e 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -324,10 +324,13 @@ view_complete_cb (EBookClientView *client_view, static void readonly_cb (EBookClient *book_client, - GParamSpec *pspec, + GParamSpec *pspec, EAddressbookModel *model) { - e_addressbook_model_set_editable (model, !e_client_is_readonly (E_CLIENT (book_client))); + gboolean editable; + + editable = !e_client_is_readonly (E_CLIENT (book_client)); + e_addressbook_model_set_editable (model, editable); } static void @@ -734,7 +737,7 @@ e_addressbook_model_get_type (void) return type; } -EAddressbookModel* +EAddressbookModel * e_addressbook_model_new (void) { return g_object_new (E_TYPE_ADDRESSBOOK_MODEL, NULL); @@ -742,7 +745,7 @@ e_addressbook_model_new (void) EContact * e_addressbook_model_get_contact (EAddressbookModel *model, - gint row) + gint row) { GPtrArray *array; @@ -845,6 +848,8 @@ void e_addressbook_model_set_client (EAddressbookModel *model, EBookClient *book_client) { + gboolean editable; + g_return_if_fail (E_IS_ADDRESSBOOK_MODEL (model)); g_return_if_fail (E_IS_BOOK_CLIENT (book_client)); @@ -878,7 +883,8 @@ e_addressbook_model_set_client (EAddressbookModel *model, book_client, "backend-died", G_CALLBACK (backend_died_cb), model); - e_addressbook_model_set_editable (model, !e_client_is_readonly (E_CLIENT (book_client))); + editable = !e_client_is_readonly (E_CLIENT (book_client)); + e_addressbook_model_set_editable (model, editable); if (model->priv->client_view_idle_id == 0) model->priv->client_view_idle_id = g_idle_add ( diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 680a511d05..0d2fc85478 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -99,7 +99,8 @@ unlink_model (EAddressbookReflowAdapter *adapter) } static gint -text_height (PangoLayout *layout, const gchar *text) +text_height (PangoLayout *layout, + const gchar *text) { gint height; @@ -119,7 +120,8 @@ addressbook_dispose (GObject *object) } static void -addressbook_set_width (EReflowModel *erm, gint width) +addressbook_set_width (EReflowModel *erm, + gint width) { } @@ -135,14 +137,16 @@ addressbook_count (EReflowModel *erm) /* This function returns the height of the minicontact in question */ static gint -addressbook_height (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) +addressbook_height (EReflowModel *erm, + gint i, + GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; EContactField field; gint count = 0; gchar *string; - EContact *contact = (EContact*) e_addressbook_model_contact_at (priv->model, i); + EContact *contact = (EContact *) e_addressbook_model_contact_at (priv->model, i); PangoLayout *layout; gint height; @@ -220,18 +224,21 @@ addressbook_create_cmp_cache (EReflowModel *erm) } static gint -addressbook_compare (EReflowModel *erm, gint n1, gint n2, GHashTable *cmp_cache) +addressbook_compare (EReflowModel *erm, + gint n1, + gint n2, + GHashTable *cmp_cache) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; EContact *contact1, *contact2; if (priv->loading) { - return n1-n2; + return n1 - n2; } else { - contact1 = (EContact*) e_addressbook_model_contact_at (priv->model, n1); - contact2 = (EContact*) e_addressbook_model_contact_at (priv->model, n2); + contact1 = (EContact *) e_addressbook_model_contact_at (priv->model, n1); + contact2 = (EContact *) e_addressbook_model_contact_at (priv->model, n2); if (contact1 && contact2) { const gchar *file_as1, *file_as2; @@ -292,7 +299,9 @@ adapter_open_contact (EMinicard *card, } static GnomeCanvasItem * -addressbook_incarnate (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) +addressbook_incarnate (EReflowModel *erm, + gint i, + GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -319,7 +328,9 @@ addressbook_incarnate (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) } static void -addressbook_reincarnate (EReflowModel *erm, gint i, GnomeCanvasItem *item) +addressbook_reincarnate (EReflowModel *erm, + gint i, + GnomeCanvasItem *item) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -331,8 +342,9 @@ addressbook_reincarnate (EReflowModel *erm, gint i, GnomeCanvasItem *item) static void create_contact (EAddressbookModel *model, - gint index, gint count, - EAddressbookReflowAdapter *adapter) + gint index, + gint count, + EAddressbookReflowAdapter *adapter) { e_reflow_model_items_inserted (E_REFLOW_MODEL (adapter), index, @@ -341,8 +353,8 @@ create_contact (EAddressbookModel *model, static void remove_contacts (EAddressbookModel *model, - gpointer data, - EAddressbookReflowAdapter *adapter) + gpointer data, + EAddressbookReflowAdapter *adapter) { GArray *indices = (GArray *) data; gint count = indices->len; @@ -358,22 +370,22 @@ remove_contacts (EAddressbookModel *model, static void modify_contact (EAddressbookModel *model, - gint index, - EAddressbookReflowAdapter *adapter) + gint index, + EAddressbookReflowAdapter *adapter) { e_reflow_model_item_changed (E_REFLOW_MODEL (adapter), index); } static void model_changed (EAddressbookModel *model, - EAddressbookReflowAdapter *adapter) + EAddressbookReflowAdapter *adapter) { e_reflow_model_changed (E_REFLOW_MODEL (adapter)); } static void search_started (EAddressbookModel *model, - EAddressbookReflowAdapter *adapter) + EAddressbookReflowAdapter *adapter) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -382,8 +394,8 @@ search_started (EAddressbookModel *model, static void search_result (EAddressbookModel *model, - const GError *error, - EAddressbookReflowAdapter *adapter) + const GError *error, + EAddressbookReflowAdapter *adapter) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -394,14 +406,14 @@ search_result (EAddressbookModel *model, static void addressbook_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (object); EAddressbookReflowAdapterPrivate *priv = adapter->priv; - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: g_object_set (priv->model, "client", g_value_get_object (value), @@ -418,21 +430,21 @@ addressbook_set_property (GObject *object, NULL); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void addressbook_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (object); EAddressbookReflowAdapterPrivate *priv = adapter->priv; - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: { g_object_get_property (G_OBJECT (priv->model), "client", value); @@ -452,7 +464,7 @@ addressbook_get_property (GObject *object, g_value_set_object (value, priv->model); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -568,7 +580,7 @@ e_addressbook_reflow_adapter_get_type (void) void e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter, - EAddressbookModel *model) + EAddressbookModel *model) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -616,7 +628,7 @@ e_addressbook_reflow_adapter_new (EAddressbookModel *model) EContact * e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter, - gint index) + gint index) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index e47b5bb186..f102b684d7 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -107,7 +107,9 @@ addressbook_row_count (ETableModel *etc) /* This function returns the value at a particular point in our ETableModel. */ static gpointer -addressbook_value_at (ETableModel *etc, gint col, gint row) +addressbook_value_at (ETableModel *etc, + gint col, + gint row) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -157,7 +159,10 @@ contact_modified_cb (EBookClient *book_client, } static void -addressbook_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) +addressbook_set_value_at (ETableModel *etc, + gint col, + gint row, + gconstpointer val) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -199,33 +204,17 @@ addressbook_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer va /* This function returns whether a particular cell is editable. */ static gboolean -addressbook_is_cell_editable (ETableModel *etc, gint col, gint row) +addressbook_is_cell_editable (ETableModel *etc, + gint col, + gint row) { -#if 0 - EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc); - EAddressbookTableAdapterPrivate *priv = adapter->priv; - const EContact *contact; - - if (row >= 0 && row < e_addressbook_model_contact_count (priv->model)) - contact = e_addressbook_model_contact_at (priv->model, row); - else - contact = NULL; - - if (!e_addressbook_model_editable (priv->model)) - return FALSE; - else if (contact && e_contact_get ((EContact *) contact, E_CONTACT_IS_LIST)) - /* we only allow editing of the name and file as for - * lists */ - return col == E_CONTACT_FULL_NAME || col == E_CONTACT_FILE_AS; - else - return col < E_CONTACT_LAST_SIMPLE_STRING; -#endif - return FALSE; } static void -addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) +addressbook_append_row (ETableModel *etm, + ETableModel *source, + gint row) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etm); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -248,32 +237,41 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) /* This function duplicates the value passed to it. */ static gpointer -addressbook_duplicate_value (ETableModel *etc, gint col, gconstpointer value) +addressbook_duplicate_value (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } /* This function frees the value passed to it. */ static void -addressbook_free_value (ETableModel *etc, gint col, gpointer value) +addressbook_free_value (ETableModel *etc, + gint col, + gpointer value) { g_free (value); } static gpointer -addressbook_initialize_value (ETableModel *etc, gint col) +addressbook_initialize_value (ETableModel *etc, + gint col) { return g_strdup(""); } static gboolean -addressbook_value_is_empty (ETableModel *etc, gint col, gconstpointer value) +addressbook_value_is_empty (ETableModel *etc, + gint col, + gconstpointer value) { return !(value && *(gchar *) value); } static gchar * -addressbook_value_to_string (ETableModel *etc, gint col, gconstpointer value) +addressbook_value_to_string (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } @@ -316,8 +314,9 @@ eab_table_adapter_init (GObject *object) static void create_contact (EAddressbookModel *model, - gint index, gint count, - EAddressbookTableAdapter *adapter) + gint index, + gint count, + EAddressbookTableAdapter *adapter) { e_table_model_pre_change (E_TABLE_MODEL (adapter)); e_table_model_rows_inserted (E_TABLE_MODEL (adapter), index, count); @@ -325,8 +324,8 @@ create_contact (EAddressbookModel *model, static void remove_contacts (EAddressbookModel *model, - gpointer data, - EAddressbookTableAdapter *adapter) + gpointer data, + EAddressbookTableAdapter *adapter) { GArray *indices = (GArray *) data; gint count = indices->len; @@ -345,8 +344,8 @@ remove_contacts (EAddressbookModel *model, static void modify_contact (EAddressbookModel *model, - gint index, - EAddressbookTableAdapter *adapter) + gint index, + EAddressbookTableAdapter *adapter) { /* clear whole cache */ g_hash_table_remove_all (adapter->priv->emails); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 55310949b0..7f3a7a85b8 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -298,8 +298,8 @@ addressbook_view_create_table_view (EAddressbookView *view, e_cell_date_set_format_component (E_CELL_DATE (cell), "addressbook"); /* Here we create the table. We give it the three pieces of - the table we've created, the header, the model, and the - initial layout. It does the rest. */ + * the table we've created, the header, the model, and the + * initial layout. It does the rest. */ etspecfile = g_build_filename ( EVOLUTION_ETSPECDIR, "e-addressbook-view.etspec", NULL); widget = e_table_new_from_spec_file ( @@ -973,7 +973,8 @@ e_addressbook_view_get_view_object (EAddressbookView *view) /* Helper for e_addressbook_view_get_selected() */ static void -add_to_list (gint model_row, gpointer closure) +add_to_list (gint model_row, + gpointer closure) { GSList **list = closure; *list = g_slist_prepend (*list, GINT_TO_POINTER (model_row)); @@ -1058,7 +1059,9 @@ e_addressbook_view_get_paste_target_list (EAddressbookView *view) } static void -status_message (EAddressbookView *view, const gchar *status, gint percent) +status_message (EAddressbookView *view, + const gchar *status, + gint percent) { EActivity *activity; EShellView *shell_view; @@ -1122,7 +1125,8 @@ folder_bar_message (EAddressbookView *view, } static void -stop_state_changed (GObject *object, EAddressbookView *view) +stop_state_changed (GObject *object, + EAddressbookView *view) { command_state_change (view); } @@ -1180,7 +1184,8 @@ contact_print_button_draw_page (GtkPrintOperation *operation, } static void -e_contact_print_button (EPrintable *printable, GtkPrintOperationAction action) +e_contact_print_button (EPrintable *printable, + GtkPrintOperationAction action) { GtkPrintOperation *operation; @@ -1362,7 +1367,8 @@ addressbook_view_confirm_delete (GtkWindow *parent, } void -e_addressbook_view_delete_selection (EAddressbookView *view, gboolean is_delete) +e_addressbook_view_delete_selection (EAddressbookView *view, + gboolean is_delete) { GSList *list, *l; gboolean plural = FALSE, is_list = FALSE; @@ -1621,13 +1627,15 @@ view_transfer_contacts (EAddressbookView *view, } void -e_addressbook_view_copy_to_folder (EAddressbookView *view, gboolean all) +e_addressbook_view_copy_to_folder (EAddressbookView *view, + gboolean all) { view_transfer_contacts (view, FALSE, all); } void -e_addressbook_view_move_to_folder (EAddressbookView *view, gboolean all) +e_addressbook_view_move_to_folder (EAddressbookView *view, + gboolean all) { view_transfer_contacts (view, TRUE, all); } diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index 967853d7b6..c22ffe58a5 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -37,8 +37,8 @@ static void e_minicard_label_init (EMinicardLabel *card); static void e_minicard_label_class_init (EMinicardLabelClass *klass); -static void e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_minicard_label_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_minicard_label_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static gboolean e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_label_realize (GnomeCanvasItem *item); static void e_minicard_label_unrealize (GnomeCanvasItem *item); @@ -199,7 +199,10 @@ e_minicard_label_init (EMinicardLabel *minicard_label) } static void -e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_minicard_label_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { EMinicardLabel *e_minicard_label; GnomeCanvasItem *item; @@ -207,7 +210,7 @@ e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *va e_minicard_label = E_MINICARD_LABEL (object); item = GNOME_CANVAS_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: e_minicard_label->width = g_value_get_double (value); e_minicard_label_resize_children (e_minicard_label); @@ -234,19 +237,22 @@ e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *va g_object_set (e_minicard_label->field, "editable", FALSE /* e_minicard_label->editable */, NULL); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_minicard_label_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicardLabel *e_minicard_label; e_minicard_label = E_MINICARD_LABEL (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, e_minicard_label->width); break; @@ -275,7 +281,7 @@ e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, G g_value_set_boolean (value, e_minicard_label->editable); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -341,7 +347,8 @@ e_minicard_label_unrealize (GnomeCanvasItem *item) } static gboolean -e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event) +e_minicard_label_event (GnomeCanvasItem *item, + GdkEvent *event) { EMinicardLabel *e_minicard_label; @@ -455,13 +462,15 @@ set_colors (EMinicardLabel *label) } static void -e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style) +e_minicard_label_style_set (EMinicardLabel *label, + GtkStyle *previous_style) { set_colors (label); } static void -e_minicard_label_reflow (GnomeCanvasItem *item, gint flags) +e_minicard_label_reflow (GnomeCanvasItem *item, + gint flags) { EMinicardLabel *e_minicard_label = E_MINICARD_LABEL (item); diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 65fa12d9f1..0a0b19df94 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -37,12 +37,12 @@ static void e_minicard_view_widget_class_init (EMinicardViewWidgetClass *class); static void e_minicard_view_widget_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec); static void e_minicard_view_widget_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec); static void e_minicard_view_widget_dispose (GObject *object); @@ -231,15 +231,15 @@ e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter) static void e_minicard_view_widget_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { EMinicardViewWidget *emvw; emvw = E_MINICARD_VIEW_WIDGET (object); - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: if (emvw->book_client) g_object_unref (emvw->book_client); @@ -277,22 +277,22 @@ e_minicard_view_widget_set_property (GObject *object, } break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_minicard_view_widget_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicardViewWidget *emvw; emvw = E_MINICARD_VIEW_WIDGET (object); - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: g_value_set_object (value, emvw->book_client); break; @@ -306,7 +306,7 @@ e_minicard_view_widget_get_property (GObject *object, g_value_set_double (value, emvw->column_width); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -335,49 +335,57 @@ e_minicard_view_widget_dispose (GObject *object) } static void -selection_change (ESelectionModel *esm, EMinicardViewWidget *widget) +selection_change (ESelectionModel *esm, + EMinicardViewWidget *widget) { - g_signal_emit (widget, - signals[SELECTION_CHANGE], 0); + g_signal_emit (widget, signals[SELECTION_CHANGE], 0); } static void -selection_row_change (ESelectionModel *esm, gint row, EMinicardViewWidget *widget) +selection_row_change (ESelectionModel *esm, + gint row, + EMinicardViewWidget *widget) { selection_change (esm, widget); } static void -column_width_changed (ESelectionModel *esm, double width, EMinicardViewWidget *widget) +column_width_changed (ESelectionModel *esm, + gdouble width, + EMinicardViewWidget *widget) { - g_signal_emit (widget, - signals[COLUMN_WIDTH_CHANGED], 0, width); + g_signal_emit (widget, signals[COLUMN_WIDTH_CHANGED], 0, width); } static void -create_contact (EMinicardView *view, EMinicardViewWidget *widget) +create_contact (EMinicardView *view, + EMinicardViewWidget *widget) { g_signal_emit (widget, signals[CREATE_CONTACT], 0); } static void -create_contact_list (EMinicardView *view, EMinicardViewWidget *widget) +create_contact_list (EMinicardView *view, + EMinicardViewWidget *widget) { g_signal_emit (widget, signals[CREATE_CONTACT_LIST], 0); } static guint -right_click (EMinicardView *view, GdkEvent *event, EMinicardViewWidget *widget) +right_click (EMinicardView *view, + GdkEvent *event, + EMinicardViewWidget *widget) { guint ret_val; - g_signal_emit (widget, - signals[RIGHT_CLICK], 0, - event, &ret_val); + + g_signal_emit (widget, signals[RIGHT_CLICK], 0, event, &ret_val); + return ret_val; } static void -e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style) +e_minicard_view_widget_style_set (GtkWidget *widget, + GtkStyle *previous_style) { EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET (widget); GtkStyle *style; @@ -493,7 +501,7 @@ e_minicard_view_widget_get_selection_model (EMinicardViewWidget *view) } EMinicardView * -e_minicard_view_widget_get_view (EMinicardViewWidget *view) +e_minicard_view_widget_get_view (EMinicardViewWidget *view) { if (view->emv) return E_MINICARD_VIEW (view->emv); @@ -502,7 +510,8 @@ e_minicard_view_widget_get_view (EMinicardViewWidget *view) } static gboolean -e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *event) +e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, + GdkEventFocus *event) { GnomeCanvas *canvas; EMinicardViewWidget *view; @@ -524,6 +533,5 @@ e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *ev return GTK_WIDGET_CLASS (parent_class)->focus_in_event (widget, event); return FALSE; - } diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 91a4a12991..ba52e7a0a8 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -81,11 +81,11 @@ static GtkTargetEntry drag_types[] = { static void e_minicard_view_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - EMinicardView *view) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + EMinicardView *view) { GdkAtom target; @@ -149,7 +149,7 @@ e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, target_list = gtk_target_list_new (drag_types, G_N_ELEMENTS (drag_types)); context = gtk_drag_begin (GTK_WIDGET (GNOME_CANVAS_ITEM (view)->canvas), - target_list, actions, 1/*XXX*/, event); + target_list, actions, 1/*XXX */, event); if (!view->canvas_drag_data_get_id) view->canvas_drag_data_get_id = g_signal_connect ( @@ -235,15 +235,15 @@ adapter_changed (EMinicardView *view) static void e_minicard_view_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { EMinicardView *view; view = E_MINICARD_VIEW (object); - switch (prop_id) { + switch (property_id) { case PROP_ADAPTER: if (view->adapter) { if (view->writable_status_id || view->stop_state_id) { @@ -303,22 +303,22 @@ e_minicard_view_set_property (GObject *object, set_empty_message (view); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_minicard_view_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicardView *view; view = E_MINICARD_VIEW (object); - switch (prop_id) { + switch (property_id) { case PROP_ADAPTER: g_value_set_object (value, view->adapter); break; @@ -335,7 +335,7 @@ e_minicard_view_get_property (GObject *object, "editable", value); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -378,7 +378,8 @@ e_minicard_view_dispose (GObject *object) } static guint -e_minicard_view_right_click (EMinicardView *view, GdkEvent *event) +e_minicard_view_right_click (EMinicardView *view, + GdkEvent *event) { guint ret_val = 0; g_signal_emit (view, signals[RIGHT_CLICK], 0, @@ -387,7 +388,8 @@ e_minicard_view_right_click (EMinicardView *view, GdkEvent *event) } static gboolean -e_minicard_view_event (GnomeCanvasItem *item, GdkEvent *event) +e_minicard_view_event (GnomeCanvasItem *item, + GdkEvent *event) { EMinicardView *view; @@ -463,32 +465,6 @@ e_minicard_view_selection_event (EReflow *reflow, return return_val; } -#if 0 -static gint -compare_to_utf_str (EMinicard *card, const gchar *utf_str) -{ - g_return_val_if_fail (card != NULL, 0); - g_return_val_if_fail (E_IS_MINICARD (card), 0); - - if (g_unichar_isdigit (g_utf8_get_char (utf_str))) { - return 1; - } - - if (card->card) { - gchar *file_as; - g_object_get (card->card, - "file_as", &file_as, - NULL); - if (file_as) - return g_utf8_strcasecmp (file_as, utf_str); - else - return 0; - } else { - return 0; - } -} -#endif - static void e_minicard_view_class_init (EMinicardViewClass *klass) { @@ -625,7 +601,8 @@ typedef struct { } ModelAndList; static void -add_to_list (gint index, gpointer closure) +add_to_list (gint index, + gpointer closure) { ModelAndList *mal = closure; mal->list = g_slist_prepend ( diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 352604984c..78d98e2cb2 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -43,8 +43,8 @@ static void e_minicard_init (EMinicard *card); static void e_minicard_class_init (EMinicardClass *class); -static void e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_minicard_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_minicard_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_minicard_dispose (GObject *object); static void e_minicard_finalize (GObject *object); static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event); @@ -266,7 +266,8 @@ e_minicard_init (EMinicard *minicard) } static void -set_selected (EMinicard *minicard, gboolean selected) +set_selected (EMinicard *minicard, + gboolean selected) { GnomeCanvas *canvas; GtkStyle *style; @@ -299,7 +300,8 @@ set_selected (EMinicard *minicard, gboolean selected) } static void -set_has_cursor (EMinicard *minicard, gboolean has_cursor) +set_has_cursor (EMinicard *minicard, + gboolean has_cursor) { if (!minicard->has_focus && has_cursor) e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (minicard), FALSE); @@ -307,7 +309,10 @@ set_has_cursor (EMinicard *minicard, gboolean has_cursor) } static void -e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_minicard_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; EMinicard *e_minicard; @@ -317,7 +322,7 @@ e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, G item = GNOME_CANVAS_ITEM (object); e_minicard = E_MINICARD (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: if (e_minicard->width != g_value_get_double (value)) { e_minicard->width = g_value_get_double (value); @@ -376,19 +381,22 @@ e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, G e_minicard->changed = FALSE; break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_minicard_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicard *e_minicard; e_minicard = E_MINICARD (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, e_minicard->width); break; @@ -411,7 +419,7 @@ e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamS g_value_set_object (value, e_minicard->contact); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -466,7 +474,8 @@ e_minicard_finalize (GObject *object) } static void -e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style) +e_minicard_style_set (EMinicard *minicard, + GtkStyle *previous_style) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard); @@ -552,7 +561,8 @@ e_minicard_activate_editor (EMinicard *minicard) } static gboolean -e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) +e_minicard_event (GnomeCanvasItem *item, + GdkEvent *event) { EMinicard *e_minicard; @@ -658,7 +668,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); if (view_index == 0) - view_index = row_count-1; + view_index = row_count - 1; else view_index--; @@ -683,7 +693,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) gint model_index = e_selection_model_cursor_row (reflow->selection); gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); - if (view_index == row_count-1) + if (view_index == row_count - 1) view_index = 0; else view_index++; @@ -718,7 +728,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) } static void -e_minicard_resize_children ( EMinicard *e_minicard ) +e_minicard_resize_children (EMinicard *e_minicard) { GList *list; gboolean is_list = GPOINTER_TO_INT (e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST)); @@ -742,7 +752,9 @@ e_minicard_resize_children ( EMinicard *e_minicard ) } static void -add_field (EMinicard *e_minicard, EContactField field, gdouble left_width) +add_field (EMinicard *e_minicard, + EContactField field, + gdouble left_width) { GnomeCanvasItem *new_item; GnomeCanvasGroup *group; @@ -808,7 +820,11 @@ get_email_location (EVCardAttribute *attr) } static void -add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, gint limit, gboolean is_list) +add_email_field (EMinicard *e_minicard, + GList *email_list, + gdouble left_width, + gint limit, + gboolean is_list) { GnomeCanvasItem *new_item; GnomeCanvasGroup *group; @@ -820,7 +836,7 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, g GList *emails = e_contact_get (e_minicard->contact, E_CONTACT_EMAIL); group = GNOME_CANVAS_GROUP ( e_minicard ); - for (l=email_list, le=emails; l!=NULL && count < limit && le!=NULL; l = l->next, le=le->next) { + for (l = email_list, le = emails; l != NULL && count < limit && le != NULL; l = l->next, le = le->next) { const gchar *tmp; gchar *email = NULL; gchar *string = NULL; @@ -881,7 +897,8 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, g } static gint -get_left_width (EMinicard *e_minicard, gboolean is_list) +get_left_width (EMinicard *e_minicard, + gboolean is_list) { gchar *name; EContactField field; @@ -910,7 +927,7 @@ get_left_width (EMinicard *e_minicard, gboolean is_list) } static void -remodel ( EMinicard *e_minicard ) +remodel (EMinicard *e_minicard) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (e_minicard); gint count = 0; @@ -947,7 +964,7 @@ remodel ( EMinicard *e_minicard ) for (field = E_CONTACT_FULL_NAME; field != (E_CONTACT_LAST_SIMPLE_STRING -1) && count < 5; field++) { EMinicardField *minicard_field = NULL; - gboolean is_email=FALSE; + gboolean is_email = FALSE; if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME) continue; @@ -958,7 +975,7 @@ remodel ( EMinicard *e_minicard ) if (email_rendered) continue; email_rendered = TRUE; - is_email=TRUE; + is_email = TRUE; } if (list) @@ -992,7 +1009,7 @@ remodel ( EMinicard *e_minicard ) limit = 5 - count; email = e_contact_get_attributes (e_minicard->contact, E_CONTACT_EMAIL); add_email_field (e_minicard, email, left_width, limit, is_list); - if (count+limit >5) + if (count + limit >5) count = 5; else count = count + g_list_length (email); @@ -1014,7 +1031,8 @@ remodel ( EMinicard *e_minicard ) } static void -e_minicard_reflow (GnomeCanvasItem *item, gint flags) +e_minicard_reflow (GnomeCanvasItem *item, + gint flags) { EMinicard *e_minicard = E_MINICARD (item); @@ -1074,7 +1092,8 @@ e_minicard_get_card_id (EMinicard *minicard) } gint -e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) +e_minicard_compare (EMinicard *minicard1, + EMinicard *minicard2) { gint cmp = 0; @@ -1109,7 +1128,8 @@ e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) } gint -e_minicard_selected (EMinicard *minicard, GdkEvent *event) +e_minicard_selected (EMinicard *minicard, + GdkEvent *event) { gint ret_val = 0; GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard); @@ -1129,7 +1149,8 @@ e_minicard_selected (EMinicard *minicard, GdkEvent *event) } static gint -e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event) +e_minicard_drag_begin (EMinicard *minicard, + GdkEvent *event) { gint ret_val = 0; GnomeCanvasItem *parent; diff --git a/addressbook/gui/widgets/ea-addressbook-view.c b/addressbook/gui/widgets/ea-addressbook-view.c index 2d432b6a76..c5bb9fc018 100644 --- a/addressbook/gui/widgets/ea-addressbook-view.c +++ b/addressbook/gui/widgets/ea-addressbook-view.c @@ -106,7 +106,7 @@ ea_ab_view_get_description (AtkObject *accessible) return _("evolution address book"); } -AtkObject* +AtkObject * ea_ab_view_new (GObject *obj) { GObject *object; diff --git a/addressbook/gui/widgets/ea-addressbook-view.h b/addressbook/gui/widgets/ea-addressbook-view.h index db9e008ab1..55da1d5e37 100644 --- a/addressbook/gui/widgets/ea-addressbook-view.h +++ b/addressbook/gui/widgets/ea-addressbook-view.h @@ -48,7 +48,7 @@ struct _EaABViewClass }; GType ea_ab_view_get_type (void); -AtkObject* ea_ab_view_new (GObject *obj); +AtkObject * ea_ab_view_new (GObject *obj); G_END_DECLS diff --git a/addressbook/gui/widgets/ea-addressbook.c b/addressbook/gui/widgets/ea-addressbook.c index b67d876139..b57720be39 100644 --- a/addressbook/gui/widgets/ea-addressbook.c +++ b/addressbook/gui/widgets/ea-addressbook.c @@ -36,9 +36,9 @@ EA_FACTORY_GOBJECT (EA_TYPE_MINICARD_VIEW, ea_minicard_view, ea_minicard_view_ne EA_FACTORY_GOBJECT (EA_TYPE_AB_VIEW, ea_ab_view, ea_ab_view_new) static gboolean ea_addressbook_focus_watcher (GSignalInvocationHint *ihint, - guint n_param_values, - const GValue *param_values, - gpointer data); + guint n_param_values, + const GValue *param_values, + gpointer data); void e_minicard_a11y_init (void) { @@ -64,9 +64,9 @@ void eab_view_a11y_init (void) static gboolean ea_addressbook_focus_watcher (GSignalInvocationHint *ihint, - guint n_param_values, - const GValue *param_values, - gpointer data) + guint n_param_values, + const GValue *param_values, + gpointer data) { GObject *object; GdkEvent *event; diff --git a/addressbook/gui/widgets/ea-minicard-view.c b/addressbook/gui/widgets/ea-minicard-view.c index a61c6074a0..58d3a5fd2b 100644 --- a/addressbook/gui/widgets/ea-minicard-view.c +++ b/addressbook/gui/widgets/ea-minicard-view.c @@ -51,7 +51,7 @@ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, +static AtkObject * selection_interface_ref_selection (AtkSelection *selection, gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, @@ -187,7 +187,7 @@ ea_minicard_view_get_description (AtkObject *accessible) return _("evolution address book"); } -AtkObject* +AtkObject * ea_minicard_view_new (GObject *obj) { GObject *object; @@ -242,7 +242,8 @@ static AtkStateSet *ea_minicard_view_ref_state_set (AtkObject *obj) } static AtkObject * -ea_minicard_view_ref_child (AtkObject *accessible, gint index) +ea_minicard_view_ref_child (AtkObject *accessible, + gint index) { EReflow *reflow; gint child_num; @@ -288,7 +289,8 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint i) +selection_interface_add_selection (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj= NULL; EReflow *reflow = NULL; @@ -322,8 +324,9 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { return ea_minicard_view_ref_child (ATK_OBJECT (selection), i); } @@ -344,7 +347,8 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint i) +selection_interface_is_child_selected (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj = NULL; EReflow *reflow = NULL; @@ -407,13 +411,15 @@ static gint atk_action_interface_get_n_action (AtkAction *iface) } static const gchar * -atk_action_interface_get_description (AtkAction *iface, gint i) +atk_action_interface_get_description (AtkAction *iface, + gint i) { return atk_action_interface_get_name (iface, i); } static const gchar * -atk_action_interface_get_name (AtkAction *iface, gint i) +atk_action_interface_get_name (AtkAction *iface, + gint i) { if ( i >= G_N_ELEMENTS (action_name) || i < 0) return NULL; diff --git a/addressbook/gui/widgets/ea-minicard-view.h b/addressbook/gui/widgets/ea-minicard-view.h index 320c74d15e..889674bb92 100644 --- a/addressbook/gui/widgets/ea-minicard-view.h +++ b/addressbook/gui/widgets/ea-minicard-view.h @@ -49,7 +49,7 @@ struct _EaMinicardViewClass GType ea_minicard_view_get_type (void); -AtkObject* ea_minicard_view_new (GObject *obj); +AtkObject * ea_minicard_view_new (GObject *obj); G_END_DECLS diff --git a/addressbook/gui/widgets/ea-minicard.c b/addressbook/gui/widgets/ea-minicard.c index 2e8d4281ef..45d496ffa0 100644 --- a/addressbook/gui/widgets/ea-minicard.c +++ b/addressbook/gui/widgets/ea-minicard.c @@ -229,7 +229,8 @@ ea_minicard_get_n_children (AtkObject *accessible) } static AtkObject * -ea_minicard_ref_child (AtkObject *accessible, gint index) +ea_minicard_ref_child (AtkObject *accessible, + gint index) { return NULL; } @@ -246,7 +247,8 @@ atk_action_interface_init (AtkActionIface *iface) } static gboolean -atk_action_interface_do_action (AtkAction *iface, gint i) +atk_action_interface_do_action (AtkAction *iface, + gint i) { EMinicard *minicard = NULL; @@ -278,13 +280,15 @@ atk_action_interface_get_n_action (AtkAction *iface) } static const gchar * -atk_action_interface_get_description (AtkAction *iface, gint i) +atk_action_interface_get_description (AtkAction *iface, + gint i) { return atk_action_interface_get_name (iface, i); } static const gchar * -atk_action_interface_get_name (AtkAction *iface, gint i) +atk_action_interface_get_name (AtkAction *iface, + gint i) { if ( i >= G_N_ELEMENTS (action_name) || i < 0) return NULL; diff --git a/addressbook/gui/widgets/ea-minicard.h b/addressbook/gui/widgets/ea-minicard.h index d4c96fa787..ea27158011 100644 --- a/addressbook/gui/widgets/ea-minicard.h +++ b/addressbook/gui/widgets/ea-minicard.h @@ -49,7 +49,7 @@ struct _EaMinicardClass }; GType ea_minicard_get_type (void); -AtkObject* ea_minicard_new (GObject *obj); +AtkObject * ea_minicard_new (GObject *obj); G_END_DECLS diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c index 5cb8d25e81..e1a0501203 100644 --- a/addressbook/gui/widgets/eab-config.c +++ b/addressbook/gui/widgets/eab-config.c @@ -40,7 +40,8 @@ ecp_init (EABConfig *cfg) } static void -ecp_target_free (EConfig *ec, EConfigTarget *t) +ecp_target_free (EConfig *ec, + EConfigTarget *t) { struct _EABConfigPrivate *p = EAB_CONFIG (ec)->priv; @@ -78,13 +79,15 @@ ecp_target_free (EConfig *ec, EConfigTarget *t) } static void -ecp_source_changed (struct _ESource *source, EConfig *ec) +ecp_source_changed (ESource *source, + EConfig *ec) { e_config_target_changed (ec, E_CONFIG_TARGET_CHANGED_STATE); } static void -ecp_set_target (EConfig *ec, EConfigTarget *t) +ecp_set_target (EConfig *ec, + EConfigTarget *t) { struct _EABConfigPrivate *p = EAB_CONFIG (ec)->priv; @@ -137,7 +140,8 @@ eab_config_get_type (void) } EABConfig * -eab_config_new (gint type, const gchar *menuid) +eab_config_new (gint type, + const gchar *menuid) { EABConfig *ecp = g_object_new (eab_config_get_type (), NULL); e_config_construct (&ecp->config, type, menuid); @@ -145,7 +149,8 @@ eab_config_new (gint type, const gchar *menuid) } EABConfigTargetSource * -eab_config_target_new_source (EABConfig *ecp, struct _ESource *source) +eab_config_target_new_source (EABConfig *ecp, + ESource *source) { EABConfigTargetSource *t = e_config_target_new ( &ecp->config, EAB_CONFIG_TARGET_SOURCE, sizeof (*t)); @@ -157,7 +162,8 @@ eab_config_target_new_source (EABConfig *ecp, struct _ESource *source) } EABConfigTargetPrefs * -eab_config_target_new_prefs (EABConfig *ecp, GConfClient *gconf) +eab_config_target_new_prefs (EABConfig *ecp, + GConfClient *gconf) { EABConfigTargetPrefs *t = e_config_target_new ( &ecp->config, EAB_CONFIG_TARGET_PREFS, sizeof (*t)); diff --git a/addressbook/gui/widgets/eab-config.h b/addressbook/gui/widgets/eab-config.h index 7cf79244e2..70023360e0 100644 --- a/addressbook/gui/widgets/eab-config.h +++ b/addressbook/gui/widgets/eab-config.h @@ -25,6 +25,7 @@ #define __EAB_CONFIG_H__ #include <gconf/gconf-client.h> +#include <libedataserver/e-source.h> #include "e-util/e-config.h" #define EAB_TYPE_CONFIG (eab_config_get_type ()) @@ -56,7 +57,7 @@ typedef struct _EABConfigTargetSource EABConfigTargetSource; struct _EABConfigTargetSource { EConfigTarget target; - struct _ESource *source; + ESource *source; }; typedef struct _EABConfigTargetPrefs EABConfigTargetPrefs; @@ -73,7 +74,7 @@ typedef struct _EConfigItem EABConfigItem; GType eab_config_get_type (void); EABConfig *eab_config_new (gint type, const gchar *menuid); -EABConfigTargetSource *eab_config_target_new_source (EABConfig *ecp, struct _ESource *source); +EABConfigTargetSource *eab_config_target_new_source (EABConfig *ecp, ESource *source); EABConfigTargetPrefs *eab_config_target_new_prefs (EABConfig *ecp, GConfClient *gconf); G_END_DECLS diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 56a2511d64..da558352bb 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -52,7 +52,7 @@ struct _EABContactDisplayPrivate { GtkOrientation orientation; gboolean show_maps; - GHashTable *closed_lists; /* see render_contact_list_* */ + GHashTable *closed_lists; /* see render_contact_list_ * */ }; enum { @@ -193,7 +193,9 @@ static GtkActionEntry internal_mailto_entries[] = { }; static void -render_address_link (GString *buffer, EContact *contact, gint map_type) +render_address_link (GString *buffer, + EContact *contact, + gint map_type) { EContactAddress *adr; GString *link = g_string_new (""); @@ -366,8 +368,7 @@ accum_multival_attribute (GString *buffer, GList *val_list, *l; /* Workaround till bug [1] is fixed. - [1] https://bugzilla.gnome.org/show_bug.cgi?id=473862 - */ + * [1] https://bugzilla.gnome.org/show_bug.cgi?id=473862 */ icon = NULL; val_list = e_contact_get (contact, field); @@ -409,7 +410,8 @@ get_email_location (EVCardAttribute *attr) } static void -render_title_block (GString *buffer, EContact *contact) +render_title_block (GString *buffer, + EContact *contact) { const gchar *str; gchar *html; @@ -455,9 +457,9 @@ render_title_block (GString *buffer, EContact *contact) static void render_contact_list_row (GString *buffer, - EDestination *destination, - EABContactDisplay *display) - { + EDestination *destination, + EABContactDisplay *display) +{ gchar *evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); gboolean list_collapsed = FALSE; const gchar *listId = e_destination_get_contact_uid (destination), *textrep; @@ -576,13 +578,14 @@ render_contact_list (GString *buffer, } static void -render_contact_block (GString *buffer, EContact *contact) +render_contact_block (GString *buffer, + EContact *contact) { GString *accum; GList *email_list, *l, *email_attr_list, *al; gint email_num = 0; const gchar *nl; - gchar *nick=NULL; + gchar *nick = NULL; accum = g_string_new (""); nl = ""; @@ -592,7 +595,7 @@ render_contact_block (GString *buffer, EContact *contact) email_list = e_contact_get (contact, E_CONTACT_EMAIL); email_attr_list = e_contact_get_attributes (contact, E_CONTACT_EMAIL); - for (l = email_list, al=email_attr_list; l && al; l = l->next, al = al->next) { + for (l = email_list, al = email_attr_list; l && al; l = l->next, al = al->next) { gchar *name = NULL, *mail = NULL; gchar *attr_str = (gchar *) get_email_location ((EVCardAttribute *) al->data); @@ -669,7 +672,8 @@ render_contact_block (GString *buffer, EContact *contact) } static void -render_work_block (GString *buffer, EContact *contact) +render_work_block (GString *buffer, + EContact *contact) { GString *accum = g_string_new (""); @@ -696,7 +700,8 @@ render_work_block (GString *buffer, EContact *contact) } static void -render_personal_block (GString *buffer, EContact *contact) +render_personal_block (GString *buffer, + EContact *contact) { GString *accum = g_string_new (""); @@ -719,7 +724,8 @@ render_personal_block (GString *buffer, EContact *contact) } static void -render_note_block (GString *buffer, EContact *contact) +render_note_block (GString *buffer, + EContact *contact) { const gchar *str; gchar *html; @@ -738,7 +744,9 @@ render_note_block (GString *buffer, EContact *contact) } static void -render_address_map (GString *buffer, EContact *contact, gint map_type) +render_address_map (GString *buffer, + EContact *contact, + gint map_type) { #ifdef WITH_CONTACT_MAPS if (map_type == E_CONTACT_ADDRESS_WORK) { @@ -750,7 +758,9 @@ render_address_map (GString *buffer, EContact *contact, gint map_type) } static void -render_contact_horizontal (GString *buffer, EContact *contact, gboolean show_maps) +render_contact_horizontal (GString *buffer, + EContact *contact, + gboolean show_maps) { g_string_append (buffer, "<table border=\"0\">"); render_title_block (buffer, contact); @@ -776,7 +786,9 @@ render_contact_horizontal (GString *buffer, EContact *contact, gboolean show_map } static void -render_contact_vertical (GString *buffer, EContact *contact, gboolean show_maps) +render_contact_vertical (GString *buffer, + EContact *contact, + gboolean show_maps) { /* First row: photo & name */ g_string_append (buffer, "<tr><td colspan=\"3\">"); @@ -817,7 +829,10 @@ render_contact_vertical (GString *buffer, EContact *contact, gboolean show_maps) } static void -render_contact (GString *buffer, EContact *contact, GtkOrientation orientation, gboolean show_maps) +render_contact (GString *buffer, + EContact *contact, + GtkOrientation orientation, + gboolean show_maps) { if (orientation == GTK_ORIENTATION_VERTICAL) render_contact_vertical (buffer, contact, show_maps); @@ -911,9 +926,9 @@ eab_contact_display_render_compact (EABContactDisplay *display, GdkPixbuf *pixbuf; /* figure out if we need to downscale the - image here. we don't scale the pixbuf - itself, just insert width/height tags in - the html */ + * image here. we don't scale the pixbuf + * itself, just insert width/height tags in + * the html */ gdk_pixbuf_loader_write (loader, photo->data.inlined.data, photo->data.inlined.length, NULL); gdk_pixbuf_loader_close (loader, NULL); pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); @@ -1259,7 +1274,7 @@ contact_display_link_clicked (EWebView *web_view, contact_display_emit_send_message (display, index); return; } else if (g_str_has_prefix (uri, "##") && g_str_has_suffix (uri, "##")) { - gchar *list_id = g_strndup (uri+2, strlen (uri) - 4); + gchar *list_id = g_strndup (uri + 2, strlen (uri) - 4); if (g_hash_table_lookup (display->priv->closed_lists, list_id)) { g_hash_table_remove (display->priv->closed_lists, list_id); @@ -1278,19 +1293,21 @@ contact_display_link_clicked (EWebView *web_view, } #ifdef WITH_CONTACT_MAPS -/** - * Clutter event handling workaround. Clutter-gtk propagates events down to parent widgets. - * In this case it leads to GtkHTML scrolling up and down while user's trying to zoom in the - * champlain widget. This workaround stops the propagation from map widget down to GtkHTML - */ +/* XXX Clutter event handling workaround. Clutter-gtk propagates events down + * to parent widgets. In this case it leads to GtkHTML scrolling up and + * down while user's trying to zoom in the champlain widget. This + * workaround stops the propagation from map widget down to GtkHTML. */ static gboolean -handle_map_scroll_event (GtkWidget *widget, GdkEvent *event) +handle_map_scroll_event (GtkWidget *widget, + GdkEvent *event) { return TRUE; } static void -contact_display_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, EABContactDisplay *display) +contact_display_object_requested (GtkHTML *html, + GtkHTMLEmbedded *eb, + EABContactDisplay *display) { EContact *contact = display->priv->contact; const gchar *name = e_contact_get_const (contact, E_CONTACT_FILE_AS); @@ -1587,7 +1604,8 @@ eab_contact_display_get_orientation (EABContactDisplay *display) } void -eab_contact_display_set_orientation (EABContactDisplay *display, GtkOrientation orientation) +eab_contact_display_set_orientation (EABContactDisplay *display, + GtkOrientation orientation) { EABContactDisplayMode mode; EContact *contact; @@ -1620,7 +1638,8 @@ eab_contact_display_get_show_maps (EABContactDisplay *display) } void -eab_contact_display_set_show_maps (EABContactDisplay *display, gboolean show_maps) +eab_contact_display_set_show_maps (EABContactDisplay *display, + gboolean show_maps) { EABContactDisplayMode mode; EContact *contact; diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index d910b339b4..c951b290c7 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -83,23 +83,29 @@ typedef enum { } AddressFormat; void -eab_error_dialog (EAlertSink *alert_sink, const gchar *msg, const GError *error) +eab_error_dialog (EAlertSink *alert_sink, + const gchar *msg, + const GError *error) { if (error && error->message) { if (alert_sink) - e_alert_submit (alert_sink, - "addressbook:generic-error", - msg, error->message, NULL); + e_alert_submit ( + alert_sink, + "addressbook:generic-error", + msg, error->message, NULL); else e_alert_run_dialog_for_args ( - e_shell_get_active_window (NULL), - "addressbook:generic-error", - msg, error->message, NULL); + e_shell_get_active_window (NULL), + "addressbook:generic-error", + msg, error->message, NULL); } } void -eab_load_error_dialog (GtkWidget *parent, EAlertSink *alert_sink, ESource *source, const GError *error) +eab_load_error_dialog (GtkWidget *parent, + EAlertSink *alert_sink, + ESource *source, + const GError *error) { gchar *label_string, *label = NULL, *uri; gboolean can_detail_error = TRUE; @@ -110,10 +116,12 @@ eab_load_error_dialog (GtkWidget *parent, EAlertSink *alert_sink, ESource *sourc if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_OFFLINE_UNAVAILABLE)) { can_detail_error = FALSE; - label_string = _("This address book cannot be opened. This either means this " - "book is not marked for offline usage or not yet downloaded " - "for offline usage. Please load the address book once in online mode " - "to download its contents."); + label_string = + _("This address book cannot be opened. This either " + "means this book is not marked for offline usage " + "or not yet downloaded for offline usage. Please " + "load the address book once in online mode to " + "download its contents."); } else if (uri && g_str_has_prefix (uri, "local:")) { @@ -187,7 +195,8 @@ eab_load_error_dialog (GtkWidget *parent, EAlertSink *alert_sink, ESource *sourc } void -eab_search_result_dialog (EAlertSink *alert_sink, const GError *error) +eab_search_result_dialog (EAlertSink *alert_sink, + const GError *error) { gchar *str = NULL; @@ -265,7 +274,8 @@ make_safe_filename (gchar *name) } static void -source_selection_changed_cb (ESourceSelector *selector, GtkWidget *ok_button) +source_selection_changed_cb (ESourceSelector *selector, + GtkWidget *ok_button) { ESource *except_source = NULL, *selected; @@ -276,7 +286,11 @@ source_selection_changed_cb (ESourceSelector *selector, GtkWidget *ok_button) } ESource * -eab_select_source (ESource *except_source, const gchar *title, const gchar *message, const gchar *select_uid, GtkWindow *parent) +eab_select_source (ESource *except_source, + const gchar *title, + const gchar *message, + const gchar *select_uid, + GtkWindow *parent) { ESource *source; ESourceList *source_list; @@ -395,7 +409,8 @@ remove_contact_ready_cb (GObject *source_object, } static void -do_delete_from_source (gpointer data, gpointer user_data) +do_delete_from_source (gpointer data, + gpointer user_data) { ContactCopyProcess *process = user_data; EContact *contact = data; @@ -441,7 +456,10 @@ process_unref (ContactCopyProcess *process) } static void -contact_added_cb (EBookClient *book_client, const GError *error, const gchar *id, gpointer user_data) +contact_added_cb (EBookClient *book_client, + const GError *error, + const gchar *id, + gpointer user_data) { ContactCopyProcess *process = user_data; @@ -462,7 +480,8 @@ contact_added_cb (EBookClient *book_client, const GError *error, const gchar *id } static void -do_copy (gpointer data, gpointer user_data) +do_copy (gpointer data, + gpointer user_data) { EBookClient *book_client; EContact *contact; @@ -568,11 +587,12 @@ eab_transfer_contacts (EBookClient *source_client, } /* To parse something like... -=?UTF-8?Q?=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=?UTF-8?Q?=E0=A4=B0?=\t\n<aa@aa.ccom> -and return the decoded representation of name & email parts. -*/ + * =?UTF-8?Q?=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=?UTF-8?Q?=E0=A4=B0?=\t\n<aa@aa.ccom> + * and return the decoded representation of name & email parts. */ gboolean -eab_parse_qp_email (const gchar *string, gchar **name, gchar **email) +eab_parse_qp_email (const gchar *string, + gchar **name, + gchar **email) { struct _camel_header_address *address; gboolean res = FALSE; @@ -595,9 +615,9 @@ eab_parse_qp_email (const gchar *string, gchar **name, gchar **email) } /* This is only wrapper to parse_qp_mail, it decodes string and if returned TRUE, - then makes one string and returns it, otherwise returns NULL. - Returned string is usable to place directly into GtkHtml stream. - Returned value should be freed with g_free. */ + * then makes one string and returns it, otherwise returns NULL. + * Returned string is usable to place directly into GtkHtml stream. + * Returned value should be freed with g_free. */ gchar * eab_parse_qp_email_to_html (const gchar *string) { @@ -731,7 +751,7 @@ country_to_ISO (const gchar *country) } /* If we get here, then no match was found in the map file and we - fallback to local system locales */ + * fallback to local system locales */ fclose (file); pair = get_locales (); @@ -748,8 +768,8 @@ country_to_ISO (const gchar *country) */ static gchar * get_key_file_locale_string (GKeyFile *key_file, - const gchar *key, - const gchar *locale) + const gchar *key, + const gchar *locale) { gchar *result; gchar *group; @@ -773,9 +793,9 @@ get_key_file_locale_string (GKeyFile *key_file, static void get_address_format (AddressFormat address_format, - const gchar *locale, - gchar **format, - gchar **country_position) + const gchar *locale, + gchar **format, + gchar **country_position) { GKeyFile *key_file; GError *error; @@ -858,7 +878,8 @@ find_balanced_bracket (const gchar *str) } static GString * -string_append_upper (GString *str, const gchar *c) +string_append_upper (GString *str, + const gchar *c) { gchar *up_c; @@ -876,10 +897,10 @@ string_append_upper (GString *str, const gchar *c) static gboolean parse_address_template_section (const gchar *format, - const gchar *realname, - const gchar *org_name, - EContactAddress *address, - gchar **result) + const gchar *realname, + const gchar *org_name, + EContactAddress *address, + gchar **result) { const gchar *pos, *old_pos; @@ -1026,7 +1047,7 @@ parse_address_template_section (const gchar *format, gchar * eab_format_address (EContact *contact, - EContactField address_type) + EContactField address_type) { gchar *result; gchar *format = NULL; @@ -1063,7 +1084,7 @@ eab_format_address (EContact *contact, } /* Expand all the variables in format. - Don't display organization in home address */ + * Don't display organization in home address */ parse_address_template_section (format, e_contact_get_const (contact, E_CONTACT_FULL_NAME), (address_type == E_CONTACT_ADDRESS_WORK) ? e_contact_get_const (contact, E_CONTACT_ORG): NULL, @@ -1071,7 +1092,7 @@ eab_format_address (EContact *contact, &result); /* Add the country line. In some countries, the address can be located above the - rest of the address */ + * rest of the address */ if (addr->country && country_position) { gchar *country_upper = g_utf8_strup (addr->country, -1); gchar *p = result; diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c index 6033b34758..280ae7583f 100644 --- a/addressbook/gui/widgets/gal-view-minicard.c +++ b/addressbook/gui/widgets/gal-view-minicard.c @@ -236,8 +236,8 @@ gal_view_minicard_new (const gchar *title) * Returns: The GalViewMinicard. */ GalView * -gal_view_minicard_construct (GalViewMinicard *view, - const gchar *title) +gal_view_minicard_construct (GalViewMinicard *view, + const gchar *title) { view->title = g_strdup (title); diff --git a/addressbook/importers/evolution-addressbook-importers.h b/addressbook/importers/evolution-addressbook-importers.h index e4579cbc4e..0ba2c9b6f4 100644 --- a/addressbook/importers/evolution-addressbook-importers.h +++ b/addressbook/importers/evolution-addressbook-importers.h @@ -18,6 +18,8 @@ * */ +#include <gtk/gtk.h> + struct _EImportImporter *evolution_ldif_importer_peek (void); struct _EImportImporter *evolution_vcard_importer_peek (void); struct _EImportImporter *evolution_csv_outlook_importer_peek (void); @@ -25,4 +27,4 @@ struct _EImportImporter *evolution_csv_mozilla_importer_peek (void); struct _EImportImporter *evolution_csv_evolution_importer_peek (void); /* private utility function for importers only */ -struct _GtkWidget *evolution_contact_importer_get_preview_widget (const GSList *contacts); +GtkWidget *evolution_contact_importer_get_preview_widget (const GSList *contacts); diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c index 43e9339a81..f41a806940 100644 --- a/addressbook/importers/evolution-csv-importer.c +++ b/addressbook/importers/evolution-csv-importer.c @@ -270,7 +270,9 @@ static import_fields csv_fields_evolution[] = { }; static void -add_to_notes (EContact *contact, const gchar *field_text, gchar *val) +add_to_notes (EContact *contact, + const gchar *field_text, + gchar *val) { GString *new_text; @@ -289,32 +291,32 @@ add_to_notes (EContact *contact, const gchar *field_text, gchar *val) } /* @str: a date string in the format MM-DD-YYYY or MMDDYYYY */ -static EContactDate* +static EContactDate * date_from_string (const gchar *str) { - EContactDate* date; + EContactDate * date; gint i = 0; g_return_val_if_fail (str != NULL, NULL); date = e_contact_date_new (); - if (g_ascii_isdigit (str[i]) && g_ascii_isdigit (str[i+1])) { - date->month = str[i] * 10 + str[i+1] - '0' * 11; - i = i+3; + if (g_ascii_isdigit (str[i]) && g_ascii_isdigit (str[i + 1])) { + date->month = str[i] * 10 + str[i + 1] - '0' * 11; + i = i + 3; } else { date->month = str[i] - '0' * 1; - i = i+2; + i = i + 2; } - if (g_ascii_isdigit (str[i]) && g_ascii_isdigit (str[i+1])) { - date->day = str[i] * 10 + str[i+1] - '0' * 11; - i = i+3; + if (g_ascii_isdigit (str[i]) && g_ascii_isdigit (str[i + 1])) { + date->day = str[i] * 10 + str[i + 1] - '0' * 11; + i = i + 3; } else { date->day = str[i] - '0' * 1; - i = i+2; + i = i + 2; } date->year = str[i] * 1000 + str[i + 1] * 100 + str[i + 2] * 10 + str[i + 3] - '0' * 1111; @@ -364,7 +366,8 @@ parseNextValue (const gchar **pptr) } static GHashTable * -map_fields (const gchar *header_line, gint pimporter) +map_fields (const gchar *header_line, + gint pimporter) { import_fields *fields_array = NULL; gint n_fields = -1, idx, j; @@ -417,8 +420,10 @@ map_fields (const gchar *header_line, gint pimporter) } static gboolean -parseLine (CSVImporter *gci, EContact *contact, gchar *buf) { - +parseLine (CSVImporter *gci, + EContact *contact, + gchar *buf) +{ const gchar *pptr = buf, *field_text; gchar *do_free = NULL; GString *value; @@ -501,69 +506,69 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) { else { switch (flags) { - case FLAG_HOME_ADDRESS|FLAG_STREET: + case FLAG_HOME_ADDRESS | FLAG_STREET: if (strlen (home_street->str) != 0) { home_street = g_string_append(home_street, ",\n"); } home_street = g_string_append (home_street, value->str); break; - case FLAG_HOME_ADDRESS|FLAG_CITY: + case FLAG_HOME_ADDRESS | FLAG_CITY: home_address->locality = g_strdup (value->str); break; - case FLAG_HOME_ADDRESS|FLAG_STATE: + case FLAG_HOME_ADDRESS | FLAG_STATE: home_address->region = g_strdup (value->str); break; - case FLAG_HOME_ADDRESS|FLAG_POSTAL_CODE: + case FLAG_HOME_ADDRESS | FLAG_POSTAL_CODE: home_address->code = g_strdup (value->str); break; - case FLAG_HOME_ADDRESS|FLAG_POBOX: + case FLAG_HOME_ADDRESS | FLAG_POBOX: home_address->po = g_strdup (value->str); break; - case FLAG_HOME_ADDRESS|FLAG_COUNTRY: + case FLAG_HOME_ADDRESS | FLAG_COUNTRY: home_address->country = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_STREET: + case FLAG_WORK_ADDRESS | FLAG_STREET: if (strlen (work_street->str) != 0) { work_street = g_string_append(work_street, ",\n"); } work_street = g_string_append (work_street, value->str); break; - case FLAG_WORK_ADDRESS|FLAG_CITY: + case FLAG_WORK_ADDRESS | FLAG_CITY: work_address->locality = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_STATE: + case FLAG_WORK_ADDRESS | FLAG_STATE: work_address->region = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_POSTAL_CODE: + case FLAG_WORK_ADDRESS | FLAG_POSTAL_CODE: work_address->code = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_POBOX: + case FLAG_WORK_ADDRESS | FLAG_POBOX: work_address->po = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_COUNTRY: + case FLAG_WORK_ADDRESS | FLAG_COUNTRY: work_address->country = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_STREET: + case FLAG_OTHER_ADDRESS | FLAG_STREET: if (strlen (other_street->str) != 0) { other_street = g_string_append(other_street, ",\n"); } other_street = g_string_append (other_street, value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_CITY: + case FLAG_OTHER_ADDRESS | FLAG_CITY: other_address->locality = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_STATE: + case FLAG_OTHER_ADDRESS | FLAG_STATE: other_address->region = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_POSTAL_CODE: + case FLAG_OTHER_ADDRESS | FLAG_POSTAL_CODE: other_address->code = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_POBOX: + case FLAG_OTHER_ADDRESS | FLAG_POBOX: other_address->po = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_COUNTRY: + case FLAG_OTHER_ADDRESS | FLAG_COUNTRY: other_address->country = g_strdup (value->str); break; @@ -634,7 +639,9 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) { } static EContact * -getNextCSVEntry (CSVImporter *gci, FILE *f) { +getNextCSVEntry (CSVImporter *gci, + FILE *f) +{ EContact *contact = NULL; GString *line; GString *str; @@ -745,15 +752,19 @@ csv_import_contacts (gpointer d) } static void -primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) +primary_selection_changed_cb (ESourceSelector *selector, + EImportTarget *target) { - g_datalist_set_data_full(&target->data, "csv-source", - g_object_ref (e_source_selector_get_primary_selection (selector)), - g_object_unref); + g_datalist_set_data_full ( + &target->data, "csv-source", + g_object_ref (e_source_selector_get_primary_selection (selector)), + g_object_unref); } static GtkWidget * -csv_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +csv_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *vbox, *selector; ESource *primary; @@ -792,7 +803,9 @@ static const gchar *supported_extensions[4] = { }; static gboolean -csv_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +csv_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *ext; gint i; @@ -868,7 +881,9 @@ book_loaded_cb (GObject *source_object, } static void -csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) +csv_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { CSVImporter *gci; ESource *source; @@ -909,28 +924,37 @@ csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -outlook_csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) +outlook_csv_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = OUTLOOK_IMPORTER; csv_import (ei, target, im); } static void -mozilla_csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) +mozilla_csv_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = MOZILLA_IMPORTER; csv_import (ei, target, im); } static void -evolution_csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) +evolution_csv_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = EVOLUTION_IMPORTER; csv_import (ei, target, im); } static void -csv_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) { +csv_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) +{ CSVImporter *gci = g_datalist_get_data(&target->data, "csv-data"); if (gci) @@ -938,7 +962,9 @@ csv_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) { } static GtkWidget * -csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +csv_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; GSList *contacts = NULL; @@ -984,21 +1010,27 @@ csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -outlook_csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +outlook_csv_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = OUTLOOK_IMPORTER; return csv_get_preview (ei, target, im); } static GtkWidget * -mozilla_csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +mozilla_csv_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = MOZILLA_IMPORTER; return csv_get_preview (ei, target, im); } static GtkWidget * -evolution_csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +evolution_csv_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = EVOLUTION_IMPORTER; return csv_get_preview (ei, target, im); diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index 72776bf2a5..8eb0c57192 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -130,7 +130,7 @@ ldif_fields[] = { }; static GString * -getValue ( gchar **src ) +getValue (gchar **src) { GString *dest = g_string_new(""); gchar *s = *src; @@ -166,7 +166,9 @@ getValue ( gchar **src ) } static void -populate_contact_address (EContactAddress *address, gchar *attr, gchar *value) +populate_contact_address (EContactAddress *address, + gchar *attr, + gchar *value) { if (!g_ascii_strcasecmp (attr, "locality") || !g_ascii_strcasecmp (attr, "l") || @@ -222,9 +224,11 @@ populate_contact_address (EContactAddress *address, gchar *attr, gchar *value) } static gboolean -parseLine (GHashTable *dn_contact_hash, EContact *contact, - EContactAddress *work_address, EContactAddress *home_address, - gchar **buf) +parseLine (GHashTable *dn_contact_hash, + EContact *contact, + EContactAddress *work_address, + EContactAddress *home_address, + gchar **buf) { gchar *ptr; gchar *colon, *value; @@ -352,7 +356,8 @@ parseLine (GHashTable *dn_contact_hash, EContact *contact, } static EContact * -getNextLDIFEntry (GHashTable *dn_contact_hash, FILE *f ) +getNextLDIFEntry (GHashTable *dn_contact_hash, + FILE *f) { EContact *contact; EContactAddress *work_address, *home_address; @@ -410,14 +415,15 @@ getNextLDIFEntry (GHashTable *dn_contact_hash, FILE *f ) } static void -resolve_list_card (LDIFImporter *gci, EContact *contact) +resolve_list_card (LDIFImporter *gci, + EContact *contact) { GList *email, *l; GList *email_attrs = NULL; gchar *full_name; /* set file_as to full_name so we don't later try and figure - out a first/last name for the list. */ + * out a first/last name for the list. */ full_name = e_contact_get (contact, E_CONTACT_FULL_NAME); if (full_name) e_contact_set (contact, E_CONTACT_FILE_AS, full_name); @@ -456,7 +462,8 @@ resolve_list_card (LDIFImporter *gci, EContact *contact) } static void -add_to_notes (EContact *contact, EContactField field) +add_to_notes (EContact *contact, + EContactField field) { const gchar *old_text; const gchar *field_text; @@ -488,7 +495,7 @@ ldif_import_contacts (gpointer d) gint count = 0; /* We process all normal cards immediately and keep the list - ones till the end */ + * ones till the end */ if (gci->state == 0) { while (count < 50 && (contact = getNextLDIFEntry ( @@ -516,7 +523,7 @@ ldif_import_contacts (gpointer d) } } if (gci->state == 1) { - for (iter = gci->list_iterator;count < 50 && iter;iter=iter->next) { + for (iter = gci->list_iterator; count < 50 && iter; iter = iter->next) { gchar *uid = NULL; contact = iter->data; @@ -543,15 +550,19 @@ ldif_import_contacts (gpointer d) } static void -primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) +primary_selection_changed_cb (ESourceSelector *selector, + EImportTarget *target) { - g_datalist_set_data_full(&target->data, "ldif-source", - g_object_ref (e_source_selector_get_primary_selection (selector)), - g_object_unref); + g_datalist_set_data_full ( + &target->data, "ldif-source", + g_object_ref (e_source_selector_get_primary_selection (selector)), + g_object_unref); } static GtkWidget * -ldif_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *vbox, *selector; ESource *primary; @@ -593,7 +604,9 @@ static const gchar *supported_extensions[3] = { }; static gboolean -ldif_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *ext; gint i; @@ -662,7 +675,9 @@ book_loaded_cb (GObject *source_object, } static void -ldif_import (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { LDIFImporter *gci; ESource *source; @@ -702,7 +717,9 @@ ldif_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -ldif_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { LDIFImporter *gci = g_datalist_get_data(&target->data, "ldif-data"); @@ -711,7 +728,9 @@ ldif_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -ldif_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; GSList *contacts = NULL; diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index 59168d883b..cf3a429337 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -81,7 +81,8 @@ typedef struct { static void vcard_import_done (VCardImporter *gci); static void -add_to_notes (EContact *contact, EContactField field) +add_to_notes (EContact *contact, + EContactField field) { const gchar *old_text; const gchar *field_text; @@ -105,19 +106,20 @@ add_to_notes (EContact *contact, EContactField field) } static void -vcard_import_contact (VCardImporter *gci, EContact *contact) +vcard_import_contact (VCardImporter *gci, + EContact *contact) { EContactPhoto *photo; GList *attrs, *attr; gchar *uid = NULL; /* Apple's addressbook.app exports PHOTO's without a TYPE - param, so let's figure out the format here if there's a - PHOTO attribute missing a TYPE param. - - this is sort of a hack, as EContact sets the type for us if - we use the setter. so let's e_contact_get + e_contact_set - on E_CONTACT_PHOTO. + * param, so let's figure out the format here if there's a + * PHOTO attribute missing a TYPE param. + * + * this is sort of a hack, as EContact sets the type for us if + * we use the setter. so let's e_contact_get + e_contact_set + * on E_CONTACT_PHOTO. */ photo = e_contact_get (contact, E_CONTACT_PHOTO); if (photo) { @@ -144,12 +146,11 @@ vcard_import_contact (VCardImporter *gci, EContact *contact) } e_contact_set_attributes (contact, E_CONTACT_EMAIL, attrs); - /* - Deal with TEL attributes that don't conform to what we need. - - 1. if there's no location (HOME/WORK/OTHER), default to OTHER. - 2. if there's *only* a location specified, default to VOICE. - */ + /* Deal with TEL attributes that don't conform to what we need. + * + * 1. if there's no location (HOME/WORK/OTHER), default to OTHER. + * 2. if there's *only* a location specified, default to VOICE. + */ attrs = e_vcard_get_attributes (E_VCARD (contact)); for (attr = attrs; attr; attr = attr->next) { EVCardAttribute *a = attr->data; @@ -188,7 +189,7 @@ vcard_import_contact (VCardImporter *gci, EContact *contact) if (is_work_home) { /* only WORK and HOME phone numbers require locations, - the rest should be kept as is */ + * the rest should be kept as is */ if (location_only) { /* add VOICE */ e_vcard_attribute_add_param_with_value (a, @@ -204,11 +205,8 @@ vcard_import_contact (VCardImporter *gci, EContact *contact) } } - /* - Deal with ADR and EMAIL attributes that don't conform to what we need. - - if HOME or WORK isn't specified, add TYPE=OTHER. - */ + /* Deal with ADR and EMAIL attributes that don't conform to what + * we need. If HOME or WORK isn't specified, add TYPE=OTHER. */ attrs = e_vcard_get_attributes (E_VCARD (contact)); for (attr = attrs; attr; attr = attr->next) { EVCardAttribute *a = attr->data; @@ -361,8 +359,8 @@ guess_vcard_encoding (const gchar *filename) } fclose (handle); - if (has_bom ((gunichar2*) line)) { - gunichar2 *utf16 = (gunichar2*) line; + if (has_bom ((gunichar2 *) line)) { + gunichar2 *utf16 = (gunichar2 *) line; /* Check for a BOM to try to detect UTF-16 encoded vcards * (MacOSX address book creates such vcards for example) */ @@ -391,15 +389,19 @@ guess_vcard_encoding (const gchar *filename) } static void -primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) +primary_selection_changed_cb (ESourceSelector *selector, + EImportTarget *target) { - g_datalist_set_data_full(&target->data, "vcard-source", - g_object_ref (e_source_selector_get_primary_selection (selector)), - g_object_unref); + g_datalist_set_data_full ( + &target->data, "vcard-source", + g_object_ref (e_source_selector_get_primary_selection (selector)), + g_object_unref); } static GtkWidget * -vcard_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *vbox, *selector; ESource *primary; @@ -437,7 +439,9 @@ vcard_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) } static gboolean -vcard_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { EImportTargetURI *s; gchar *filename; @@ -498,7 +502,7 @@ book_loaded_cb (GObject *source_object, if (gci->encoding == VCARD_ENCODING_UTF16) { gchar *tmp; - gunichar2 *contents_utf16 = (gunichar2*) gci->contents; + gunichar2 *contents_utf16 = (gunichar2 *) gci->contents; tmp = utf16_to_utf8 (contents_utf16); g_free (gci->contents); gci->contents = tmp; @@ -523,7 +527,9 @@ book_loaded_cb (GObject *source_object, } static void -vcard_import (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { VCardImporter *gci; ESource *source; @@ -570,7 +576,9 @@ vcard_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -vcard_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { VCardImporter *gci = g_datalist_get_data(&target->data, "vcard-data"); @@ -579,7 +587,9 @@ vcard_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -vcard_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; GSList *contacts; @@ -653,7 +663,8 @@ evolution_vcard_importer_peek (void) /* utility functions shared between all contact importers */ static void -preview_contact (EWebViewPreview *preview, EContact *contact) +preview_contact (EWebViewPreview *preview, + EContact *contact) { gint idx; gboolean had_value = FALSE; @@ -888,7 +899,8 @@ preview_contact (EWebViewPreview *preview, EContact *contact) } static void -preview_selection_changed_cb (GtkTreeSelection *selection, EWebViewPreview *preview) +preview_selection_changed_cb (GtkTreeSelection *selection, + EWebViewPreview *preview) { GtkTreeIter iter; GtkTreeModel *model = NULL; diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index 7719533fdd..0aac4a7530 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -104,7 +104,9 @@ get_font_width (GtkPrintContext *context, static void e_contact_output (GtkPrintContext *context, PangoFontDescription *font, - gdouble x, gdouble y, gdouble width, + gdouble x, + gdouble y, + gdouble width, const gchar *text) { PangoLayout *layout; @@ -184,7 +186,7 @@ e_contact_print_letter_heading (EContactPrintContext *ctxt, if (ctxt->page_nr == -1 || ctxt->pages != ctxt->page_nr) { /* only calculating number of pages - or on page we do not want to print */ + * or on page we do not want to print */ ctxt->y += pango_units_to_double (height); return; @@ -319,7 +321,7 @@ e_contact_print_contact (EContact *contact, { const gchar *value; gchar *text; - gint wrapped_lines=0; + gint wrapped_lines = 0; if (ctxt->y > page_height) e_contact_start_new_column (ctxt); @@ -341,7 +343,7 @@ e_contact_print_contact (EContact *contact, wrapped_lines = (get_font_width (ctxt->context, ctxt->style->body_font, text) / - (ctxt->column_width+4)) + 1; + (ctxt->column_width + 4)) + 1; ctxt->y = ctxt->y + ((wrapped_lines + 1) * e_contact_text_height (ctxt->context, @@ -431,7 +433,8 @@ get_bool (gchar *data) } static void -get_string (gchar *data, gchar **variable) +get_string (gchar *data, + gchar **variable) { g_free (*variable); *variable = g_strdup ((data != NULL) ? data : ""); @@ -727,8 +730,8 @@ contact_page_draw_footer (GtkPrintOperation *operation, pango_layout_set_text (layout, text, -1); pango_layout_set_width (layout, -1); - x = page_width/2.0 - page_margin; - y = page_height - page_margin/2.0; + x = page_width / 2.0 - page_margin; + y = page_height - page_margin / 2.0; cr = gtk_print_context_get_cairo_context (context); diff --git a/addressbook/printing/test-print.c b/addressbook/printing/test-print.c index 7747318175..6f461959c3 100644 --- a/addressbook/printing/test-print.c +++ b/addressbook/printing/test-print.c @@ -29,7 +29,8 @@ #include "e-contact-print.h" gint -main (gint argc, gchar *argv[]) +main (gint argc, + gchar *argv[]) { GList *shown_fields = NULL; diff --git a/addressbook/tools/evolution-addressbook-export-list-cards.c b/addressbook/tools/evolution-addressbook-export-list-cards.c index b886b2cc32..41d2217ee1 100644 --- a/addressbook/tools/evolution-addressbook-export-list-cards.c +++ b/addressbook/tools/evolution-addressbook-export-list-cards.c @@ -281,7 +281,8 @@ e_contact_csv_get_name (EContactFieldCSV csv_field) } gchar * -e_contact_csv_get (EContact * contact, EContactFieldCSV csv_field) +e_contact_csv_get (EContact *contact, + EContactFieldCSV csv_field) { gint contact_field; gchar *field_value; @@ -399,7 +400,7 @@ e_contact_csv_get (EContact * contact, EContactFieldCSV csv_field) } gchar * -e_contact_csv_get_header_line (GSList * csv_all_fields) +e_contact_csv_get_header_line (GSList *csv_all_fields) { guint field_number; @@ -429,7 +430,8 @@ e_contact_csv_get_header_line (GSList * csv_all_fields) } gchar * -e_contact_to_csv (EContact * contact, GSList * csv_all_fields) +e_contact_to_csv (EContact *contact, + GSList *csv_all_fields) { guint field_number; gint csv_field; @@ -458,7 +460,8 @@ e_contact_to_csv (EContact * contact, GSList * csv_all_fields) } gchar * -e_contact_get_csv (EContact * contact, GSList * csv_all_fields) +e_contact_get_csv (EContact *contact, + GSList *csv_all_fields) { gchar *aline; @@ -467,7 +470,7 @@ e_contact_get_csv (EContact * contact, GSList * csv_all_fields) } gchar * -check_null_pointer (gchar * orig) +check_null_pointer (gchar *orig) { gchar *result; if (orig == NULL) @@ -478,7 +481,8 @@ check_null_pointer (gchar * orig) } gchar * -delivery_address_get_sub_field (const EContactAddress * address, DeliveryAddressField sub_field) +delivery_address_get_sub_field (const EContactAddress *address, + DeliveryAddressField sub_field) { gchar *sub_field_value; gchar *str_temp, *str_temp_a; @@ -563,7 +567,11 @@ escape_string (gchar *orig) } gint -output_n_cards_file (FILE * outputfile, GSList *contacts, gint size, gint begin_no, CARD_FORMAT format) +output_n_cards_file (FILE *outputfile, + GSList *contacts, + gint size, + gint begin_no, + CARD_FORMAT format) { gint i; if (format == CARD_FORMAT_VCARD) { @@ -617,7 +625,8 @@ fork_to_background (void) } static void -action_list_cards (GSList *contacts, ActionContext * p_actctx) +action_list_cards (GSList *contacts, + ActionContext *p_actctx) { FILE *outputfile; long length; @@ -711,7 +720,7 @@ action_list_cards (GSList *contacts, ActionContext * p_actctx) } void -set_pre_defined_field (GSList ** pre_defined_fields) +set_pre_defined_field (GSList **pre_defined_fields) { *pre_defined_fields = NULL; *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CONTACT_CSV_GIVEN_NAME)); @@ -760,7 +769,7 @@ set_pre_defined_field (GSList ** pre_defined_fields) } guint -action_list_cards_init (ActionContext * p_actctx) +action_list_cards_init (ActionContext *p_actctx) { EBookClient *book_client; EBookQuery *query; diff --git a/addressbook/tools/evolution-addressbook-export-list-folders.c b/addressbook/tools/evolution-addressbook-export-list-folders.c index 82241f8f67..2628c9c499 100644 --- a/addressbook/tools/evolution-addressbook-export-list-folders.c +++ b/addressbook/tools/evolution-addressbook-export-list-folders.c @@ -32,7 +32,7 @@ #include "evolution-addressbook-export.h" guint -action_list_folders_init (ActionContext * p_actctx) +action_list_folders_init (ActionContext *p_actctx) { ESourceList *addressbooks = NULL; GSList *groups, *group; diff --git a/addressbook/tools/evolution-addressbook-export.c b/addressbook/tools/evolution-addressbook-export.c index 56a2b14a54..5460c5a8bd 100644 --- a/addressbook/tools/evolution-addressbook-export.c +++ b/addressbook/tools/evolution-addressbook-export.c @@ -80,7 +80,8 @@ static GOptionEntry entries[] = { }; gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { ActionContext actctx; GOptionContext *context; @@ -107,7 +108,7 @@ main (gint argc, gchar **argv) p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy"); if (p_SetProcessDEPPolicy) - (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); + (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); } #endif #endif diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c index e409432d3f..1e54ccf53c 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.c +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c @@ -80,21 +80,23 @@ typedef struct { } AlarmNotify; - -static void -tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data); +static void tree_selection_changed_cb (GtkTreeSelection *selection, + gpointer data); +static void fill_in_labels (AlarmNotify *an, + const gchar *summary, + const gchar *description, + const gchar *location, + time_t occur_start, + time_t occur_end); + +static void edit_pressed_cb (GtkButton *button, + gpointer user_data); +static void snooze_pressed_cb (GtkButton *button, + gpointer user_data); static void -fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, - const gchar *location, time_t occur_start, time_t occur_end); -static void -edit_pressed_cb (GtkButton *button, gpointer user_data); - -static void -snooze_pressed_cb (GtkButton *button, gpointer user_data); - -static void -an_update_minutes_label (GtkSpinButton *sb, gpointer data) +an_update_minutes_label (GtkSpinButton *sb, + gpointer data) { AlarmNotify *an; gint snooze_timeout_min; @@ -106,7 +108,8 @@ an_update_minutes_label (GtkSpinButton *sb, gpointer data) } static void -an_update_hrs_label (GtkSpinButton *sb, gpointer data) +an_update_hrs_label (GtkSpinButton *sb, + gpointer data) { AlarmNotify *an; gint snooze_timeout_hrs; @@ -118,7 +121,8 @@ an_update_hrs_label (GtkSpinButton *sb, gpointer data) } static void -an_update_days_label (GtkSpinButton *sb, gpointer data) +an_update_days_label (GtkSpinButton *sb, + gpointer data) { AlarmNotify *an; gint snooze_timeout_days; @@ -130,7 +134,9 @@ an_update_days_label (GtkSpinButton *sb, gpointer data) } static void -dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data) +dialog_response_cb (GtkDialog *dialog, + guint response_id, + gpointer user_data) { AlarmNotify *an = user_data; GtkTreeIter iter; @@ -161,7 +167,8 @@ dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data) } static void -edit_pressed_cb (GtkButton *button, gpointer user_data) +edit_pressed_cb (GtkButton *button, + gpointer user_data) { AlarmNotify *an = user_data; AlarmFuncInfo *funcinfo = NULL; @@ -180,7 +187,8 @@ edit_pressed_cb (GtkButton *button, gpointer user_data) #define DEFAULT_SNOOZE_MINS 5 static void -snooze_pressed_cb (GtkButton *button, gpointer user_data) +snooze_pressed_cb (GtkButton *button, + gpointer user_data) { gint snooze_timeout; AlarmNotify *an = user_data; @@ -205,7 +213,8 @@ snooze_pressed_cb (GtkButton *button, gpointer user_data) } static void -dismiss_pressed_cb (GtkButton *button, gpointer user_data) +dismiss_pressed_cb (GtkButton *button, + gpointer user_data) { AlarmNotify *an = user_data; GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (an->treeview)); @@ -229,7 +238,8 @@ dismiss_pressed_cb (GtkButton *button, gpointer user_data) } static void -dialog_destroyed_cb (GtkWidget *dialog, gpointer user_data) +dialog_destroyed_cb (GtkWidget *dialog, + gpointer user_data) { AlarmNotify *an = user_data; @@ -265,7 +275,7 @@ notified_alarms_dialog_new (void) G_TYPE_POINTER, /* Start */ G_TYPE_POINTER, /* End */ - G_TYPE_POINTER /* FuncInfo*/)); + G_TYPE_POINTER /* FuncInfo */)); an->builder = gtk_builder_new (); e_load_ui_builder_definition (an->builder, "alarm-notify.ui"); @@ -310,7 +320,8 @@ notified_alarms_dialog_new (void) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (selection), "changed", + g_signal_connect ( + selection, "changed", G_CALLBACK (tree_selection_changed_cb), an); gtk_widget_realize (an->dialog); @@ -328,8 +339,12 @@ notified_alarms_dialog_new (void) g_signal_connect (edit_btn, "clicked", G_CALLBACK (edit_pressed_cb), an); g_signal_connect (snooze_btn, "clicked", G_CALLBACK (snooze_pressed_cb), an); g_signal_connect (an->dismiss_btn, "clicked", G_CALLBACK (dismiss_pressed_cb), an); - g_signal_connect (G_OBJECT (an->dialog), "response", G_CALLBACK (dialog_response_cb), an); - g_signal_connect (G_OBJECT (an->dialog), "destroy", G_CALLBACK (dialog_destroyed_cb), an); + g_signal_connect ( + an->dialog, "response", + G_CALLBACK (dialog_response_cb), an); + g_signal_connect ( + an->dialog, "destroy", + G_CALLBACK (dialog_destroyed_cb), an); if (!gtk_widget_get_realized (an->dialog)) gtk_widget_realize (an->dialog); @@ -337,16 +352,19 @@ notified_alarms_dialog_new (void) gtk_window_set_icon_name (GTK_WINDOW (an->dialog), "stock_alarm"); /* Set callback for updating the snooze "minutes" label */ - g_signal_connect (G_OBJECT (an->snooze_time_min), "value_changed", - G_CALLBACK (an_update_minutes_label), an); + g_signal_connect ( + an->snooze_time_min, "value_changed", + G_CALLBACK (an_update_minutes_label), an); /* Set callback for updating the snooze "hours" label */ - g_signal_connect (G_OBJECT (an->snooze_time_hrs), "value_changed", - G_CALLBACK (an_update_hrs_label), an); + g_signal_connect ( + an->snooze_time_hrs, "value_changed", + G_CALLBACK (an_update_hrs_label), an); /* Set callback for updating the snooze "days" label */ - g_signal_connect (G_OBJECT (an->snooze_time_days), "value_changed", - G_CALLBACK (an_update_days_label), an); + g_signal_connect ( + an->snooze_time_days, "value_changed", + G_CALLBACK (an_update_days_label), an); na = g_new0 (AlarmNotificationsDialog, 1); @@ -376,11 +394,16 @@ notified_alarms_dialog_new (void) **/ GtkTreeIter -add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigger, - time_t occur_start, time_t occur_end, - ECalComponentVType vtype, const gchar *summary, - const gchar *description, const gchar *location, - AlarmNotifyFunc func, gpointer func_data) +add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, + time_t trigger, + time_t occur_start, + time_t occur_end, + ECalComponentVType vtype, + const gchar *summary, + const gchar *description, + const gchar *location, + AlarmNotifyFunc func, + gpointer func_data) { GtkTreeIter iter; GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (na->treeview)); @@ -428,7 +451,8 @@ add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigge } static void -tree_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) +tree_selection_changed_cb (GtkTreeSelection *selection, + gpointer user_data) { GtkTreeModel *model; GtkTreeIter iter; @@ -454,8 +478,12 @@ tree_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) } static void -fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, - const gchar *location, time_t occur_start, time_t occur_end) +fill_in_labels (AlarmNotify *an, + const gchar *summary, + const gchar *description, + const gchar *location, + time_t occur_start, + time_t occur_end) { GtkTextTagTable *table = gtk_text_tag_table_new (); GtkTextBuffer *buffer = gtk_text_buffer_new (table); diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c index 9a4a76aa46..8682011e21 100644 --- a/calendar/gui/alarm-notify/alarm-notify.c +++ b/calendar/gui/alarm-notify/alarm-notify.c @@ -42,7 +42,7 @@ struct _AlarmNotifyPrivate { /* Mapping from EUri's to LoadedClient structures */ /* FIXME do we need per source type uri hashes? or perhaps we - just need to hash based on source */ + * just need to hash based on source */ GHashTable *uri_client_hash[E_CAL_CLIENT_SOURCE_TYPE_LAST]; ESourceList *source_lists[E_CAL_CLIENT_SOURCE_TYPE_LAST]; ESourceList *selected_calendars; diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index c143429f8f..d7a1346a8e 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -180,10 +180,10 @@ static void message_proxy (Message *msg) { g_return_if_fail (msg->func != NULL); - + * msg->func (msg); } - + * static gpointer create_thread_pool (void) { @@ -344,7 +344,7 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gboolean free_object, gboolean remove_alarm) { - QueuedAlarm *qa=NULL; + QueuedAlarm *qa = NULL; GSList *l; debug (("...")); @@ -576,7 +576,9 @@ add_component_alarms (ClientAlarms *ca, /* Loads the alarms of a client for a given range of time */ static void -load_alarms (ClientAlarms *ca, time_t start, time_t end) +load_alarms (ClientAlarms *ca, + time_t start, + time_t end) { gchar *str_query, *iso_start, *iso_end; GError *error = NULL; @@ -1609,10 +1611,12 @@ display_notification (time_t trigger, tray_icon = gtk_status_icon_new (); gtk_status_icon_set_from_icon_name ( tray_icon, "appointment-soon"); - g_signal_connect (G_OBJECT (tray_icon), "activate", - G_CALLBACK (icon_activated), NULL); - g_signal_connect (G_OBJECT (tray_icon), "popup-menu", - G_CALLBACK (popup_menu), NULL); + g_signal_connect ( + tray_icon, "activate", + G_CALLBACK (icon_activated), NULL); + g_signal_connect ( + tray_icon, "popup-menu", + G_CALLBACK (popup_menu), NULL); } current_zone = config_data_get_timezone (); @@ -1661,8 +1665,9 @@ display_notification (time_t trigger, g_free (time_str); g_free (str); - g_signal_connect (G_OBJECT (tray_data->view), "objects_removed", - G_CALLBACK (on_dialog_objs_removed_cb), tray_data); + g_signal_connect ( + tray_data->view, "objects_removed", + G_CALLBACK (on_dialog_objs_removed_cb), tray_data); /* FIXME: We should remove this check */ if (!config_data_get_notify_with_tray ()) { @@ -1864,7 +1869,8 @@ mail_notification (time_t trigger, /* Performs notification of a procedure alarm */ static gboolean -procedure_notification_dialog (const gchar *cmd, const gchar *url) +procedure_notification_dialog (const gchar *cmd, + const gchar *url) { GtkWidget *container; GtkWidget *dialog; @@ -2037,7 +2043,9 @@ alarm_queue_init (gpointer data) } static gboolean -free_client_alarms_cb (gpointer key, gpointer value, gpointer user_data) +free_client_alarms_cb (gpointer key, + gpointer value, + gpointer user_data) { ClientAlarms *ca = value; @@ -2101,7 +2109,8 @@ alarm_queue_done (void) } static gboolean -compare_ids (gpointer a, gpointer b) +compare_ids (gpointer a, + gpointer b) { ECalComponentId *id, *id1; @@ -2370,7 +2379,8 @@ update_cqa (CompQueuedAlarms *cqa, } static void -update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa) +update_qa (ECalComponentAlarms *alarms, + QueuedAlarm *qa) { ECalComponentAlarmInstance *al_inst; GSList *instance_list; diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c index 95d1d7b5a2..968eb95959 100644 --- a/calendar/gui/alarm-notify/alarm.c +++ b/calendar/gui/alarm-notify/alarm.c @@ -167,7 +167,8 @@ setup_timeout (void) /* Used from g_list_insert_sorted(); compares the * trigger times of two AlarmRecord structures. */ static gint -compare_alarm_by_time (gconstpointer a, gconstpointer b) +compare_alarm_by_time (gconstpointer a, + gconstpointer b) { const AlarmRecord *ara = a; const AlarmRecord *arb = b; @@ -187,7 +188,7 @@ queue_alarm (AlarmRecord *ar) old_head = alarms; /* Insert the new alarm in order if the alarm's trigger time is - after the current time */ + * after the current time */ alarms = g_list_insert_sorted (alarms, ar, compare_alarm_by_time); /* If there first item on the list didn't change, the time out is fine */ @@ -215,8 +216,10 @@ queue_alarm (AlarmRecord *ar) * the alarm will not be queued and the function will return NULL. **/ gpointer -alarm_add (time_t trigger, AlarmFunction alarm_fn, gpointer data, - AlarmDestroyNotify destroy_notify_fn) +alarm_add (time_t trigger, + AlarmFunction alarm_fn, + gpointer data, + AlarmDestroyNotify destroy_notify_fn) { AlarmRecord *ar; diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c index 31425c5985..d056131280 100644 --- a/calendar/gui/alarm-notify/config-data.c +++ b/calendar/gui/alarm-notify/config-data.c @@ -124,7 +124,7 @@ config_data_get_calendars (const gchar *key) state = gconf_client_get_bool (conf_client, "/apps/evolution/calendar/notify/notify_with_tray", NULL); - if (!state) /* Should be old client*/ { + if (!state) /* Should be old client */ { GSList *source; gconf_client_set_bool (conf_client, "/apps/evolution/calendar/notify/notify_with_tray", @@ -158,8 +158,8 @@ config_data_get_calendars (const gchar *key) void config_data_replace_string_list (const gchar *key, - const gchar *old, - const gchar *new) + const gchar *old, + const gchar *new) { GSList *source, *tmp; @@ -259,7 +259,8 @@ config_data_get_notify_with_tray (void) * triggered while it was not running. **/ void -config_data_set_last_notification_time (ECalClient *cal, time_t t) +config_data_set_last_notification_time (ECalClient *cal, + time_t t) { GConfClient *client; time_t current_t, now = time (NULL); @@ -287,7 +288,7 @@ config_data_set_last_notification_time (ECalClient *cal, time_t t) return; /* we only store the new notification time if it is bigger - than the already stored one */ + * than the already stored one */ current_t = gconf_client_get_int (client, KEY_LAST_NOTIFICATION_TIME, NULL); if (t > current_t || current_t > now) gconf_client_set_int (client, KEY_LAST_NOTIFICATION_TIME, t, NULL); diff --git a/calendar/gui/alarm-notify/notify-main.c b/calendar/gui/alarm-notify/notify-main.c index a420074c4d..225dde4c26 100644 --- a/calendar/gui/alarm-notify/notify-main.c +++ b/calendar/gui/alarm-notify/notify-main.c @@ -45,7 +45,8 @@ #include "e-util/e-util-private.h" gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { AlarmNotify *alarm_notify_service; gint exit_status; @@ -68,7 +69,7 @@ main (gint argc, gchar **argv) p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy"); if (p_SetProcessDEPPolicy) - (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); + (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); } #endif #endif diff --git a/calendar/gui/alarm-notify/util.c b/calendar/gui/alarm-notify/util.c index d5c6678cc4..891ea131bc 100644 --- a/calendar/gui/alarm-notify/util.c +++ b/calendar/gui/alarm-notify/util.c @@ -34,7 +34,8 @@ /* Converts a time_t to a string, relative to the specified timezone */ gchar * -timet_to_str_with_zone (time_t t, icaltimezone *zone) +timet_to_str_with_zone (time_t t, + icaltimezone *zone) { struct icaltimetype itt; struct tm tm; @@ -52,7 +53,8 @@ timet_to_str_with_zone (time_t t, icaltimezone *zone) } gchar * -calculate_time (time_t start, time_t end) +calculate_time (time_t start, + time_t end) { time_t difference = end - start; gchar *str; diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 29fdb4b2cb..6d97cdf8cf 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -70,7 +70,7 @@ calendar_config_remove_notification (guint id) } /* Returns TRUE if the locale has 'am' and 'pm' strings defined, in which - case the user can choose between 12 and 24-hour time formats. */ + * case the user can choose between 12 and 24-hour time formats. */ gboolean calendar_config_locale_supports_12_hour_format (void) { @@ -133,14 +133,14 @@ calendar_config_get_icaltimezone (void) /* Whether we use 24-hour format or 12-hour format (AM/PM). */ gboolean -calendar_config_get_24_hour_format (void) +calendar_config_get_24_hour_format (void) { calendar_config_init (); /* If the locale defines 'am' and 'pm' strings then the user has the - choice of 12-hour or 24-hour time format, with 12-hour as the - default. If the locale doesn't have 'am' and 'pm' strings we have - to use 24-hour format, or strftime ()/strptime () won't work. */ + * choice of 12-hour or 24-hour time format, with 12-hour as the + * default. If the locale doesn't have 'am' and 'pm' strings we have + * to use 24-hour format, or strftime ()/strptime () won't work. */ if (calendar_config_locale_supports_12_hour_format ()) return gconf_client_get_bool (config, CALENDAR_CONFIG_24HOUR, NULL); @@ -157,7 +157,8 @@ calendar_config_get_month_scroll_by_week (void) } guint -calendar_config_add_notification_month_scroll_by_week (GConfClientNotifyFunc func, gpointer data) +calendar_config_add_notification_month_scroll_by_week (GConfClientNotifyFunc func, + gpointer data) { guint id; @@ -172,7 +173,7 @@ calendar_config_add_notification_month_scroll_by_week (GConfClientNotifyFunc fun /* The working days of the week, a bit-wise combination of flags. */ CalWeekdays -calendar_config_get_working_days (void) +calendar_config_get_working_days (void) { calendar_config_init (); @@ -181,7 +182,7 @@ calendar_config_get_working_days (void) /* Settings to hide completed tasks. */ gboolean -calendar_config_get_hide_completed_tasks (void) +calendar_config_get_hide_completed_tasks (void) { calendar_config_init (); @@ -189,7 +190,7 @@ calendar_config_get_hide_completed_tasks (void) } static EDurationType -calendar_config_get_hide_completed_tasks_units (void) +calendar_config_get_hide_completed_tasks_units (void) { gchar *units; EDurationType cu; @@ -232,7 +233,7 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed) if (value == 0) { /* If the value is 0, we want to hide completed tasks - immediately, so we filter out all complete/incomplete tasks.*/ + * immediately, so we filter out all complete/incomplete tasks.*/ if (!get_completed) sexp = g_strdup ("(not is-completed?)"); else @@ -244,7 +245,7 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed) time_t t; /* Get the current time, and subtract the appropriate - number of days/hours/minutes. */ + * number of days/hours/minutes. */ zone = calendar_config_get_icaltimezone (); tt = icaltime_current_time_with_zone (zone); @@ -265,7 +266,7 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed) t = icaltime_as_timet_with_zone (tt, zone); /* Convert the time to an ISO date string, and build - the query sub-expression. */ + * the query sub-expression. */ isodate = isodate_from_time_t (t); if (!get_completed) sexp = g_strdup_printf ("(not (completed-before? (make-time \"%s\")))", isodate); @@ -299,7 +300,7 @@ calendar_config_get_dir_path (void) } /* contains list of strings, locations, recently used as the second timezone in a day view. - Free with calendar_config_free_day_second_zones. */ + * Free with calendar_config_free_day_second_zones. */ GSList * calendar_config_get_day_second_zones (void) { @@ -424,7 +425,8 @@ calendar_config_select_day_second_zone (void) } guint -calendar_config_add_notification_day_second_zone (GConfClientNotifyFunc func, gpointer data) +calendar_config_add_notification_day_second_zone (GConfClientNotifyFunc func, + gpointer data) { guint id; diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index 61e92efae4..0be1e203c9 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -34,8 +34,8 @@ #include <e-util/e-util-enums.h> /* These are used to get/set the working days in the week. The bit-flags are - combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the - day values used by localtime etc. */ + * combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the + * day values used by localtime etc. */ typedef enum { CAL_SUNDAY = 1 << 0, @@ -68,7 +68,7 @@ gboolean calendar_config_get_hide_completed_tasks (void); gchar * calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed); /* Returns TRUE if the locale has 'am' and 'pm' strings defined, i.e. it - supports 12-hour time format. */ + * supports 12-hour time format. */ gboolean calendar_config_locale_supports_12_hour_format (void); void calendar_config_set_dir_path (const gchar *); diff --git a/calendar/gui/calendar-view-factory.c b/calendar/gui/calendar-view-factory.c index 67736985ce..b1d4a4fd72 100644 --- a/calendar/gui/calendar-view-factory.c +++ b/calendar/gui/calendar-view-factory.c @@ -159,7 +159,8 @@ calendar_view_factory_get_type_code (GalViewFactory *factory) /* new_view method for the calendar view factory */ static GalView * -calendar_view_factory_new_view (GalViewFactory *factory, const gchar *name) +calendar_view_factory_new_view (GalViewFactory *factory, + const gchar *name) { CalendarViewFactory *cal_view_factory; CalendarViewFactoryPrivate *priv; @@ -186,7 +187,7 @@ calendar_view_factory_new_view (GalViewFactory *factory, const gchar *name) **/ GalViewFactory * calendar_view_factory_construct (CalendarViewFactory *cal_view_factory, - GnomeCalendarViewType view_type) + GnomeCalendarViewType view_type) { CalendarViewFactoryPrivate *priv; diff --git a/calendar/gui/calendar-view.c b/calendar/gui/calendar-view.c index 78b0b15716..0931a4b189 100644 --- a/calendar/gui/calendar-view.c +++ b/calendar/gui/calendar-view.c @@ -114,14 +114,16 @@ calendar_view_finalize (GObject *object) /* load method of the calendar view */ static void -calendar_view_load (GalView *view, const gchar *filename) +calendar_view_load (GalView *view, + const gchar *filename) { /* nothing */ } /* save method of the calendar view */ static void -calendar_view_save (GalView *view, const gchar *filename) +calendar_view_save (GalView *view, + const gchar *filename) { /* nothing */ } @@ -141,7 +143,8 @@ calendar_view_get_title (GalView *view) /* set_title method of the calendar view */ static void -calendar_view_set_title (GalView *view, const gchar *title) +calendar_view_set_title (GalView *view, + const gchar *title) { CalendarView *cal_view; CalendarViewPrivate *priv; @@ -218,8 +221,8 @@ calendar_view_clone (GalView *view) **/ CalendarView * calendar_view_construct (CalendarView *cal_view, - GnomeCalendarViewType view_type, - const gchar *title) + GnomeCalendarViewType view_type, + const gchar *title) { CalendarViewPrivate *priv; @@ -245,7 +248,8 @@ calendar_view_construct (CalendarView *cal_view, * Return value: A newly-created calendar view. **/ CalendarView * -calendar_view_new (GnomeCalendarViewType view_type, const gchar *title) +calendar_view_new (GnomeCalendarViewType view_type, + const gchar *title) { CalendarView *cal_view; diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index 43f87f7fa1..9405f24b5a 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -50,7 +50,9 @@ * component object. **/ void -cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone) +cal_comp_util_add_exdate (ECalComponent *comp, + time_t t, + icaltimezone *zone) { GSList *list; ECalComponentDateTime *cdt; @@ -72,7 +74,8 @@ cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone) /* Returns TRUE if the TZIDs are equivalent, i.e. both NULL or the same. */ static gboolean -e_cal_component_compare_tzid (const gchar *tzid1, const gchar *tzid2) +e_cal_component_compare_tzid (const gchar *tzid1, + const gchar *tzid2) { gboolean retval = TRUE; @@ -101,8 +104,8 @@ e_cal_component_compare_tzid (const gchar *tzid1, const gchar *tzid2) **/ gboolean cal_comp_util_compare_event_timezones (ECalComponent *comp, - ECalClient *client, - icaltimezone *zone) + ECalClient *client, + icaltimezone *zone) { ECalComponentDateTime start_datetime, end_datetime; const gchar *tzid; @@ -116,8 +119,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, e_cal_component_get_dtend (comp, &end_datetime); /* If either the DTSTART or the DTEND is a DATE value, we return TRUE. - Maybe if one was a DATE-TIME we should check that, but that should - not happen often. */ + * Maybe if one was a DATE-TIME we should check that, but that should + * not happen often. */ if ((start_datetime.value && start_datetime.value->is_date) || (end_datetime.value && end_datetime.value->is_date)) { retval = TRUE; @@ -125,8 +128,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, } /* If the event uses UTC for DTSTART & DTEND, return TRUE. Outlook - will send single events as UTC, so we don't want to mark all of - these. */ + * will send single events as UTC, so we don't want to mark all of + * these. */ if ((!start_datetime.value || start_datetime.value->is_utc) && (!end_datetime.value || end_datetime.value->is_utc)) { retval = TRUE; @@ -134,8 +137,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, } /* If the event uses floating time for DTSTART & DTEND, return TRUE. - Imported vCalendar files will use floating times, so we don't want - to mark all of these. */ + * Imported vCalendar files will use floating times, so we don't want + * to mark all of these. */ if (!start_datetime.tzid && !end_datetime.tzid) { retval = TRUE; goto out; @@ -145,12 +148,12 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, if (e_cal_component_compare_tzid (tzid, start_datetime.tzid) && e_cal_component_compare_tzid (tzid, end_datetime.tzid)) { /* If both TZIDs are the same as the given zone's TZID, then - we know the timezones are the same so we return TRUE. */ + * we know the timezones are the same so we return TRUE. */ retval = TRUE; } else { /* If the TZIDs differ, we have to compare the UTC offsets - of the start and end times, using their own timezones and - the given timezone. */ + * of the start and end times, using their own timezones and + * the given timezone. */ if (!e_cal_client_get_timezone_sync (client, start_datetime.tzid, &start_zone, NULL, NULL)) goto out; @@ -211,7 +214,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, * user cancelled the deletion. **/ gboolean -cal_comp_is_on_server (ECalComponent *comp, ECalClient *client) +cal_comp_is_on_server (ECalComponent *comp, + ECalClient *client) { const gchar *uid; gchar *rid = NULL; @@ -260,7 +264,8 @@ cal_comp_is_on_server (ECalComponent *comp, ECalClient *client) * icalcomponent, not the ECalComponent. **/ gboolean -is_icalcomp_on_the_server (icalcomponent *icalcomp, ECalClient *client) +is_icalcomp_on_the_server (icalcomponent *icalcomp, + ECalClient *client) { gboolean on_server; ECalComponent *comp; @@ -435,7 +440,8 @@ cal_comp_memo_new_with_defaults (ECalClient *client) } void -cal_comp_update_time_by_active_window (ECalComponent *comp, EShell *shell) +cal_comp_update_time_by_active_window (ECalComponent *comp, + EShell *shell) { GtkWindow *window; @@ -502,7 +508,8 @@ cal_comp_update_time_by_active_window (ECalComponent *comp, EShell *shell) * Returns: the number of icons owned by the component. **/ gint -cal_comp_util_get_n_icons (ECalComponent *comp, GSList **pixbufs) +cal_comp_util_get_n_icons (ECalComponent *comp, + GSList **pixbufs) { GSList *categories_list, *elem; gint num_icons = 0; @@ -543,7 +550,8 @@ cal_comp_util_get_n_icons (ECalComponent *comp, GSList **pixbufs) * cal_comp_selection_get_string_list() to get this list from target data. **/ void -cal_comp_selection_set_string_list (GtkSelectionData *data, GSList *str_list) +cal_comp_selection_set_string_list (GtkSelectionData *data, + GSList *str_list) { /* format is "str1\0str2\0...strN\0" */ GSList *p; @@ -612,7 +620,9 @@ cal_comp_selection_get_string_list (GtkSelectionData *selection_data) } static void -datetime_to_zone (ECalClient *client, ECalComponentDateTime *date, const gchar *tzid) +datetime_to_zone (ECalClient *client, + ECalComponentDateTime *date, + const gchar *tzid) { icaltimezone *from, *to; @@ -783,7 +793,8 @@ comp_util_sanitize_recurrence_master (ECalComponent *comp, } gchar * -icalcomp_suggest_filename (icalcomponent *icalcomp, const gchar *default_name) +icalcomp_suggest_filename (icalcomponent *icalcomp, + const gchar *default_name) { icalproperty *prop; const gchar *summary = NULL; diff --git a/calendar/gui/comp-util.h b/calendar/gui/comp-util.h index 1f69ddb107..12508da42e 100644 --- a/calendar/gui/comp-util.h +++ b/calendar/gui/comp-util.h @@ -35,8 +35,8 @@ struct _EShell; void cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone); /* Returns TRUE if the component uses the given timezone for both DTSTART - and DTEND, or if the UTC offsets of the start and end times are the same - as in the given zone. */ + * and DTEND, or if the UTC offsets of the start and end times are the same + * as in the given zone. */ gboolean cal_comp_util_compare_event_timezones (ECalComponent *comp, ECalClient *client, icaltimezone *zone); diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index ab50520d5c..59cdb4515b 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -246,7 +246,8 @@ alarm_to_dialog (Dialog *dialog) } static void -alarm_to_repeat_widgets (Dialog *dialog, ECalComponentAlarm *alarm) +alarm_to_repeat_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { ECalComponentAlarmRepeat repeat; @@ -284,7 +285,8 @@ alarm_to_repeat_widgets (Dialog *dialog, ECalComponentAlarm *alarm) } static void -repeat_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +repeat_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { ECalComponentAlarmRepeat repeat; @@ -325,7 +327,8 @@ repeat_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the audio alarm data with the values from the widgets */ static void -aalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +aalarm_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { gchar *url; icalattach *attach; @@ -344,7 +347,8 @@ aalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the widgets with audio alarm data */ static void -alarm_to_aalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm) +alarm_to_aalarm_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { const gchar *url; icalattach *attach; @@ -364,7 +368,8 @@ alarm_to_aalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the widgets with display alarm data */ static void -alarm_to_dalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm ) +alarm_to_dalarm_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { ECalComponentText description; GtkTextBuffer *text_buffer; @@ -381,7 +386,8 @@ alarm_to_dalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm ) /* Fills the display alarm data with the values from the widgets */ static void -dalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +dalarm_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { gchar *str; ECalComponentText description; @@ -423,7 +429,8 @@ dalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the mail alarm data with the values from the widgets */ static void -malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +malarm_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { gchar *str; ECalComponentText description; @@ -497,7 +504,8 @@ malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the widgets from mail alarm data */ static void -alarm_to_malarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm ) +alarm_to_malarm_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { ENameSelectorModel *name_selector_model; EDestinationStore *destination_store; @@ -543,7 +551,8 @@ alarm_to_malarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm ) /* Fills the widgets from procedure alarm data */ static void -alarm_to_palarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm) +alarm_to_palarm_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { ECalComponentText description; const gchar *url; @@ -564,7 +573,8 @@ alarm_to_palarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the procedure alarm data with the values from the widgets */ static void -palarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +palarm_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { gchar *program; icalattach *attach; @@ -820,7 +830,7 @@ get_widgets (Dialog *dialog) N_("Send an email") }; - GtkComboBox *combo = (GtkComboBox*) dialog->action_combo; + GtkComboBox *combo = (GtkComboBox *) dialog->action_combo; GtkCellRenderer *cell; GtkListStore *store; gint i; @@ -881,13 +891,16 @@ get_widgets (Dialog *dialog) } static void -addressbook_clicked_cb (GtkWidget *widget, Dialog *dialog) +addressbook_clicked_cb (GtkWidget *widget, + Dialog *dialog) { e_name_selector_show_dialog (dialog->name_selector, dialog->toplevel); } static void -addressbook_response_cb (GtkWidget *widget, gint response, gpointer data) +addressbook_response_cb (GtkWidget *widget, + gint response, + gpointer data) { Dialog *dialog = data; ENameSelectorDialog *name_selector_dialog; @@ -913,8 +926,9 @@ setup_select_names (Dialog *dialog) gtk_widget_show (dialog->malarm_addresses); gtk_box_pack_end (GTK_BOX (dialog->malarm_address_group), dialog->malarm_addresses, TRUE, TRUE, 0); - g_signal_connect (G_OBJECT (dialog->malarm_addressbook), "clicked", - G_CALLBACK (addressbook_clicked_cb), dialog); + g_signal_connect ( + dialog->malarm_addressbook, "clicked", + G_CALLBACK (addressbook_clicked_cb), dialog); name_selector_dialog = e_name_selector_peek_dialog (dialog->name_selector); g_signal_connect (name_selector_dialog, "response", @@ -927,7 +941,8 @@ setup_select_names (Dialog *dialog) * repeat group options as appropriate. */ static void -repeat_toggle_toggled_cb (GtkToggleButton *toggle, gpointer data) +repeat_toggle_toggled_cb (GtkToggleButton *toggle, + gpointer data) { Dialog *dialog = data; gboolean active; @@ -960,7 +975,8 @@ check_custom_sound (Dialog *dialog) } static void -aalarm_sound_toggled_cb (GtkToggleButton *toggle, gpointer data) +aalarm_sound_toggled_cb (GtkToggleButton *toggle, + gpointer data) { Dialog *dialog = data; gboolean active; @@ -972,7 +988,8 @@ aalarm_sound_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -aalarm_attach_changed_cb (GtkWidget *widget, gpointer data) +aalarm_attach_changed_cb (GtkWidget *widget, + gpointer data) { Dialog *dialog = data; @@ -999,7 +1016,8 @@ check_custom_message (Dialog *dialog) } static void -dalarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data) +dalarm_message_toggled_cb (GtkToggleButton *toggle, + gpointer data) { Dialog *dialog = data; gboolean active; @@ -1011,7 +1029,8 @@ dalarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -dalarm_description_changed_cb (GtkWidget *widget, gpointer data) +dalarm_description_changed_cb (GtkWidget *widget, + gpointer data) { Dialog *dialog = data; @@ -1031,7 +1050,8 @@ check_custom_program (Dialog *dialog) } static void -palarm_program_changed_cb (GtkWidget *widget, gpointer data) +palarm_program_changed_cb (GtkWidget *widget, + gpointer data) { Dialog *dialog = data; @@ -1074,7 +1094,8 @@ malarm_addresses_changed_cb (GtkWidget *editable, } static void -malarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data) +malarm_message_toggled_cb (GtkToggleButton *toggle, + gpointer data) { Dialog *dialog = data; gboolean active; @@ -1086,7 +1107,8 @@ malarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -malarm_description_changed_cb (GtkWidget *widget, gpointer data) +malarm_description_changed_cb (GtkWidget *widget, + gpointer data) { Dialog *dialog = data; @@ -1094,7 +1116,8 @@ malarm_description_changed_cb (GtkWidget *widget, gpointer data) } static void -action_changed_cb (GtkWidget *action_combo, gpointer data) +action_changed_cb (GtkWidget *action_combo, + gpointer data) { Dialog *dialog = data; gchar *dir; @@ -1146,43 +1169,53 @@ init_widgets (Dialog *dialog) { GtkTextBuffer *text_buffer; - g_signal_connect (dialog->action_combo, "changed", - G_CALLBACK (action_changed_cb), - dialog); + g_signal_connect ( + dialog->action_combo, "changed", + G_CALLBACK (action_changed_cb), dialog); - g_signal_connect (G_OBJECT (dialog->repeat_toggle), "toggled", - G_CALLBACK (repeat_toggle_toggled_cb), dialog); + g_signal_connect ( + dialog->repeat_toggle, "toggled", + G_CALLBACK (repeat_toggle_toggled_cb), dialog); /* Handle custom sounds */ - g_signal_connect (G_OBJECT (dialog->aalarm_sound), "toggled", - G_CALLBACK (aalarm_sound_toggled_cb), dialog); - g_signal_connect (G_OBJECT (dialog->aalarm_file_chooser), "selection-changed", - G_CALLBACK (aalarm_attach_changed_cb), dialog); + g_signal_connect ( + dialog->aalarm_sound, "toggled", + G_CALLBACK (aalarm_sound_toggled_cb), dialog); + g_signal_connect ( + dialog->aalarm_file_chooser, "selection-changed", + G_CALLBACK (aalarm_attach_changed_cb), dialog); /* Handle custom messages */ - g_signal_connect (G_OBJECT (dialog->dalarm_message), "toggled", - G_CALLBACK (dalarm_message_toggled_cb), dialog); + g_signal_connect ( + dialog->dalarm_message, "toggled", + G_CALLBACK (dalarm_message_toggled_cb), dialog); text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->dalarm_description)); - g_signal_connect (G_OBJECT (text_buffer), "changed", - G_CALLBACK (dalarm_description_changed_cb), dialog); + g_signal_connect ( + text_buffer, "changed", + G_CALLBACK (dalarm_description_changed_cb), dialog); /* Handle program */ - g_signal_connect (G_OBJECT (dialog->palarm_program), "changed", - G_CALLBACK (palarm_program_changed_cb), dialog); + g_signal_connect ( + dialog->palarm_program, "changed", + G_CALLBACK (palarm_program_changed_cb), dialog); /* Handle custom email */ - g_signal_connect (G_OBJECT (dialog->malarm_message), "toggled", - G_CALLBACK (malarm_message_toggled_cb), dialog); + g_signal_connect ( + dialog->malarm_message, "toggled", + G_CALLBACK (malarm_message_toggled_cb), dialog); text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->malarm_description)); - g_signal_connect (G_OBJECT (text_buffer), "changed", - G_CALLBACK (malarm_description_changed_cb), dialog); + g_signal_connect ( + text_buffer, "changed", + G_CALLBACK (malarm_description_changed_cb), dialog); g_signal_connect (dialog->malarm_addresses, "changed", G_CALLBACK (malarm_addresses_changed_cb), dialog); } gboolean -alarm_dialog_run (GtkWidget *parent, ECalClient *cal_client, ECalComponentAlarm *alarm) +alarm_dialog_run (GtkWidget *parent, + ECalClient *cal_client, + ECalComponentAlarm *alarm) { Dialog dialog; GtkWidget *container; diff --git a/calendar/gui/dialogs/alarm-list-dialog.c b/calendar/gui/dialogs/alarm-list-dialog.c index c83dde429d..48503c1023 100644 --- a/calendar/gui/dialogs/alarm-list-dialog.c +++ b/calendar/gui/dialogs/alarm-list-dialog.c @@ -110,7 +110,8 @@ sensitize_buttons (Dialog *dialog) /* Callback used for the "add reminder" button */ static void -add_clicked_cb (GtkButton *button, gpointer data) +add_clicked_cb (GtkButton *button, + gpointer data) { Dialog *dialog = data; ECalComponentAlarm *alarm; @@ -140,7 +141,8 @@ add_clicked_cb (GtkButton *button, gpointer data) /* Callback used for the "edit reminder" button */ static void -edit_clicked_cb (GtkButton *button, gpointer data) +edit_clicked_cb (GtkButton *button, + gpointer data) { Dialog *dialog = data; GtkTreeSelection *selection; @@ -168,7 +170,8 @@ edit_clicked_cb (GtkButton *button, gpointer data) /* Callback used for the "delete reminder" button */ static void -delete_clicked_cb (GtkButton *button, gpointer data) +delete_clicked_cb (GtkButton *button, + gpointer data) { Dialog *dialog = data; GtkTreeSelection *selection; @@ -203,7 +206,8 @@ delete_clicked_cb (GtkButton *button, gpointer data) } static void -selection_changed_cb (GtkTreeSelection *selection, gpointer data) +selection_changed_cb (GtkTreeSelection *selection, + gpointer data) { Dialog *dialog = data; @@ -211,7 +215,8 @@ selection_changed_cb (GtkTreeSelection *selection, gpointer data) } void -alarm_list_dialog_set_client (GtkWidget *dlg_box, ECalClient *cal_client) +alarm_list_dialog_set_client (GtkWidget *dlg_box, + ECalClient *cal_client) { Dialog *dialog; @@ -310,7 +315,8 @@ alarm_list_dialog_run (GtkWidget *parent, } GtkWidget * -alarm_list_dialog_peek (ECalClient *cal_client, EAlarmList *list_store) +alarm_list_dialog_peek (ECalClient *cal_client, + EAlarmList *list_store) { Dialog *dialog; diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c index 3894061eb0..0ffdb4cf1f 100644 --- a/calendar/gui/dialogs/calendar-setup.c +++ b/calendar/gui/dialogs/calendar-setup.c @@ -59,7 +59,9 @@ struct _CalendarSourceDialog { }; static gboolean -eccp_check_complete (EConfig *ec, const gchar *pageid, gpointer data) +eccp_check_complete (EConfig *ec, + const gchar *pageid, + gpointer data) { CalendarSourceDialog *sdialog = data; gboolean valid = TRUE; @@ -101,7 +103,9 @@ eccp_commit (EConfig *ec, } static void -eccp_free (EConfig *ec, GSList *items, gpointer data) +eccp_free (EConfig *ec, + GSList *items, + gpointer data) { CalendarSourceDialog *sdialog = data; @@ -117,7 +121,8 @@ eccp_free (EConfig *ec, GSList *items, gpointer data) } static void -eccp_type_changed (GtkComboBox *dropdown, CalendarSourceDialog *sdialog) +eccp_type_changed (GtkComboBox *dropdown, + CalendarSourceDialog *sdialog) { gint id = gtk_combo_box_get_active (dropdown); GtkTreeModel *model; @@ -169,7 +174,7 @@ eccp_get_source_type (EConfig *ec, gtk_label_set_markup (GTK_LABEL (type), markup); gtk_misc_set_alignment (GTK_MISC (type), 0.0, 0.5); g_free (markup); - gtk_table_attach (GTK_TABLE (parent), type, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), type, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); } else { GtkCellRenderer *cell; GtkListStore *store; @@ -203,19 +208,20 @@ eccp_get_source_type (EConfig *ec, gtk_combo_box_set_active ((GtkComboBox *) type, active); g_signal_connect (type, "changed", G_CALLBACK (eccp_type_changed), sdialog); gtk_widget_show (type); - gtk_table_attach (GTK_TABLE (parent), type, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), type, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), type); } gtk_widget_show (label); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row + 1, GTK_FILL, 0, 0, 0); return type; } static void -name_changed (GtkEntry *entry, ECalConfigTargetSource *t) +name_changed (GtkEntry *entry, + ECalConfigTargetSource *t) { ESource *source = t->source; e_source_set_name (source, gtk_entry_get_text (GTK_ENTRY (entry))); @@ -242,13 +248,15 @@ eccp_get_source_name (EConfig *ec, label = gtk_label_new_with_mnemonic (_("_Name:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_widget_show (label); - gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row + 1, GTK_FILL, 0, 0, 0); entry = gtk_entry_new (); gtk_widget_show (entry); - gtk_table_attach (GTK_TABLE (parent), entry, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), entry, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); - g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (name_changed), (gpointer) t); + g_signal_connect ( + entry, "changed", + G_CALLBACK (name_changed), (gpointer) t); if (source) gtk_entry_set_text (GTK_ENTRY (entry), e_source_peek_name (source)); @@ -257,7 +265,8 @@ eccp_get_source_name (EConfig *ec, } static void -offline_status_changed_cb (GtkWidget *widget, CalendarSourceDialog *sdialog) +offline_status_changed_cb (GtkWidget *widget, + CalendarSourceDialog *sdialog) { if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) @@ -296,7 +305,7 @@ eccp_general_offline (EConfig *ec, gtk_widget_show (offline_setting); g_signal_connect (offline_setting, "toggled", G_CALLBACK (offline_status_changed_cb), sdialog); - gtk_table_attach (GTK_TABLE (parent), offline_setting, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), offline_setting, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); } @@ -307,7 +316,8 @@ eccp_general_offline (EConfig *ec, } static void -alarm_status_changed_cb (GtkWidget *widget, CalendarSourceDialog *sdialog) +alarm_status_changed_cb (GtkWidget *widget, + CalendarSourceDialog *sdialog) { if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) e_source_set_property (sdialog->source, "alarm", "true"); @@ -317,11 +327,11 @@ alarm_status_changed_cb (GtkWidget *widget, CalendarSourceDialog *sdialog) static GtkWidget * eccp_notify_reminders (EConfig *ec, - EConfigItem *item, - GtkWidget *parent, - GtkWidget *old, - gint position, - gpointer data) + EConfigItem *item, + GtkWidget *parent, + GtkWidget *old, + gint position, + gpointer data) { CalendarSourceDialog *sdialog = data; GtkWidget *reminder_setting = NULL; @@ -342,20 +352,22 @@ eccp_notify_reminders (EConfig *ec, gtk_widget_show (reminder_setting); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (reminder_setting), alarm && g_str_equal (alarm, "true")); g_signal_connect (reminder_setting, "toggled", G_CALLBACK (alarm_status_changed_cb), sdialog); - gtk_table_attach (GTK_TABLE (parent), reminder_setting, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), reminder_setting, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); return reminder_setting; } static void -color_changed (GtkColorButton *color_button, ECalConfigTargetSource *target) +color_changed (GtkColorButton *color_button, + ECalConfigTargetSource *target) { ESource *source = target->source; gchar color_spec[16]; GdkColor color; gtk_color_button_get_color (color_button, &color); - g_snprintf (color_spec, sizeof (color_spec), "#%04x%04x%04x", + g_snprintf ( + color_spec, sizeof (color_spec), "#%04x%04x%04x", color.red, color.green, color.blue); e_source_set_color_spec (source, color_spec); } @@ -475,7 +487,9 @@ static ECalConfigItem ecmp_items[] = { */ static void -cs_load_sources (CalendarSourceDialog *sdialog, const gchar *conf_key, ESourceGroup *group) +cs_load_sources (CalendarSourceDialog *sdialog, + const gchar *conf_key, + ESourceGroup *group) { GConfClient *gconf; @@ -501,7 +515,9 @@ cs_load_sources (CalendarSourceDialog *sdialog, const gchar *conf_key, ESourceGr * Show calendar properties for @source. **/ void -calendar_setup_edit_calendar (GtkWindow *parent, ESource *source, ESourceGroup *group) +calendar_setup_edit_calendar (GtkWindow *parent, + ESource *source, + ESourceGroup *group) { CalendarSourceDialog *sdialog = g_new0 (CalendarSourceDialog, 1); gchar *xml; @@ -561,7 +577,8 @@ calendar_setup_new_calendar (GtkWindow *parent) } void -calendar_setup_edit_task_list (GtkWindow *parent, ESource *source) +calendar_setup_edit_task_list (GtkWindow *parent, + ESource *source) { CalendarSourceDialog *sdialog = g_new0 (CalendarSourceDialog, 1); gchar *xml; @@ -620,7 +637,8 @@ calendar_setup_new_task_list (GtkWindow *parent) } void -calendar_setup_edit_memo_list (GtkWindow *parent, ESource *source) +calendar_setup_edit_memo_list (GtkWindow *parent, + ESource *source) { CalendarSourceDialog *sdialog = g_new0 (CalendarSourceDialog, 1); gchar *xml; diff --git a/calendar/gui/dialogs/changed-comp.c b/calendar/gui/dialogs/changed-comp.c index 5fb0240037..78928795f6 100644 --- a/calendar/gui/dialogs/changed-comp.c +++ b/calendar/gui/dialogs/changed-comp.c @@ -44,7 +44,10 @@ * Return value: TRUE if the user clicked Yes, FALSE otherwise. **/ gboolean -changed_component_dialog (GtkWindow *parent, ECalComponent *comp, gboolean deleted, gboolean changed) +changed_component_dialog (GtkWindow *parent, + ECalComponent *comp, + gboolean deleted, + gboolean changed) { GtkWidget *dialog; ECalComponentVType vtype; diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index 89adf7c491..3d8af28153 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -329,7 +329,8 @@ comp_editor_page_fill_widgets (CompEditorPage *page, * Returns: TRUE if the component could be filled, FALSE otherwise **/ gboolean -comp_editor_page_fill_component (CompEditorPage *page, ECalComponent *comp) +comp_editor_page_fill_component (CompEditorPage *page, + ECalComponent *comp) { CompEditorPageClass *class; @@ -355,7 +356,8 @@ comp_editor_page_fill_component (CompEditorPage *page, ECalComponent *comp) * Returns: TRUE if the timezones were added, FALSE otherwise. */ gboolean -comp_editor_page_fill_timezones (CompEditorPage *page, GHashTable *timezones) +comp_editor_page_fill_timezones (CompEditorPage *page, + GHashTable *timezones) { CompEditorPageClass *class; @@ -378,7 +380,8 @@ comp_editor_page_fill_timezones (CompEditorPage *page, GHashTable *timezones) * Sets the date values for this group of widgets **/ void -comp_editor_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) +comp_editor_page_set_dates (CompEditorPage *page, + CompEditorPageDates *dates) { CompEditorPageClass *class; @@ -421,7 +424,7 @@ comp_editor_page_add_attendee (CompEditorPage *page, **/ void comp_editor_page_notify_dates_changed (CompEditorPage *page, - CompEditorPageDates *dates) + CompEditorPageDates *dates) { g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); @@ -442,8 +445,8 @@ comp_editor_page_notify_dates_changed (CompEditorPage *page, */ void comp_editor_page_display_validation_error (CompEditorPage *page, - const gchar *msg, - GtkWidget *field) + const gchar *msg, + GtkWidget *field) { GtkWidget *dialog; diff --git a/calendar/gui/dialogs/comp-editor-page.h b/calendar/gui/dialogs/comp-editor-page.h index a33d83810d..f8ab87de63 100644 --- a/calendar/gui/dialogs/comp-editor-page.h +++ b/calendar/gui/dialogs/comp-editor-page.h @@ -71,9 +71,9 @@ struct _CompEditorPage { GObject object; /* The GtkAccelGroup for the page. We install this when the page is - mapped, and uninstall when it is unmapped. libglade would do this - normally, but we create our pages individually so have to do it - ourselves. */ + * mapped, and uninstall when it is unmapped. libglade would do this + * normally, but we create our pages individually so have to do it + * ourselves. */ GtkAccelGroup *accel_group; CompEditorPagePrivate *priv; diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index a98314b389..cbc34cb108 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -49,7 +49,8 @@ * results. **/ void -comp_editor_dates (CompEditorPageDates *dates, ECalComponent *comp) +comp_editor_dates (CompEditorPageDates *dates, + ECalComponent *comp) { ECalComponentDateTime dt; @@ -59,8 +60,8 @@ comp_editor_dates (CompEditorPageDates *dates, ECalComponent *comp) dates->complete = NULL; /* Note that the ECalComponentDateTime's returned contain allocated - icaltimetype and tzid values, so we just take over ownership of - those. */ + * icaltimetype and tzid values, so we just take over ownership of + * those. */ e_cal_component_get_dtstart (comp, &dt); if (dt.value) { dates->start = g_new (ECalComponentDateTime, 1); @@ -89,7 +90,7 @@ void comp_editor_free_dates (CompEditorPageDates *dates) { /* Note that e_cal_component_free_datetime() only frees the fields in - the struct. It doesn't free the struct itself, so we do that. */ + * the struct. It doesn't free the struct itself, so we do that. */ if (dates->start) { e_cal_component_free_datetime (dates->start); g_free (dates->start); @@ -142,9 +143,9 @@ comp_editor_new_date_edit (gboolean show_date, } /* Returns the current time, for EDateEdit widgets and ECalendar items in the - dialogs. - FIXME: Should probably use the timezone from somewhere in the component - rather than the current timezone. */ + * dialogs. + * FIXME: Should probably use the timezone from somewhere in the component + * rather than the current timezone. */ struct tm comp_editor_get_current_time (EDateEdit *date_edit, CompEditor *editor) @@ -242,7 +243,9 @@ comp_editor_strip_categories (const gchar *categories) } static GSList * -manage_new_attendees (const GSList *lst, const gchar *eml, gboolean add) +manage_new_attendees (const GSList *lst, + const gchar *eml, + gboolean add) { GSList *copy = NULL; const GSList *l; @@ -328,7 +331,8 @@ comp_editor_manage_new_attendees (ECalComponent *comp, * Copies "new-attendees" information from @src to @des component. **/ void -comp_editor_copy_new_attendees (ECalComponent *des, ECalComponent *src) +comp_editor_copy_new_attendees (ECalComponent *des, + ECalComponent *src) { GSList *copy = NULL, *l; @@ -350,7 +354,8 @@ comp_editor_copy_new_attendees (ECalComponent *des, ECalComponent *src) * Returns: Whether @ma is present in the list of new attendees of the comp. **/ gboolean -comp_editor_have_in_new_attendees (ECalComponent *comp, EMeetingAttendee *ma) +comp_editor_have_in_new_attendees (ECalComponent *comp, + EMeetingAttendee *ma) { const gchar *eml; diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index c94b2f5016..1d5a45af31 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -107,7 +107,7 @@ struct _CompEditorPrivate { guint32 attachment_bar_visible : 1; /* TODO use this flags for setting all the boolean variables - below */ + * below */ CompEditorFlags flags; icaltimezone *zone; @@ -238,7 +238,7 @@ static void attachment_store_changed_cb (CompEditor *editor) { /* Mark the editor as changed so it prompts about unsaved - changes on close */ + * changes on close */ comp_editor_set_changed (editor, TRUE); } @@ -348,8 +348,8 @@ get_attachment_list (CompEditor *editor) } /* This sets the focus to the toplevel, so any field being edited is committed. - FIXME: In future we may also want to check some of the fields are valid, - e.g. the EDateEdit fields. */ + * FIXME: In future we may also want to check some of the fields are valid, + * e.g. the EDateEdit fields. */ static void commit_all_fields (CompEditor *editor) { @@ -443,7 +443,9 @@ listen_for_changes (CompEditor *editor) } static void -send_timezone (gpointer key, gpointer value, gpointer user_data) +send_timezone (gpointer key, + gpointer value, + gpointer user_data) { icaltimezone *zone = value; CompEditor *editor = user_data; @@ -885,8 +887,8 @@ action_print_preview_cb (GtkAction *action, static gboolean remove_event_dialog (ECalClient *client, - ECalComponent *comp, - GtkWindow *parent) + ECalComponent *comp, + GtkWindow *parent) { GtkWidget *dialog; gboolean ret; @@ -1508,7 +1510,8 @@ comp_editor_get_property (GObject *object, } static void -unref_page_cb (gpointer editor_page, gpointer comp_editor) +unref_page_cb (gpointer editor_page, + gpointer comp_editor) { if (IS_COMP_EDITOR_PAGE (editor_page)) { GtkWidget *page_widget; @@ -1568,25 +1571,26 @@ comp_editor_dispose (GObject *object) } if (priv->view) { - g_signal_handlers_disconnect_matched (G_OBJECT (priv->view), - G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, - object); - + g_signal_handlers_disconnect_matched ( + G_OBJECT (priv->view), G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); g_object_unref (priv->view); priv->view = NULL; } if (priv->attachment_view) { - g_signal_handlers_disconnect_matched (G_OBJECT (e_attachment_view_get_store (E_ATTACHMENT_VIEW (priv->attachment_view))), - G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, - object); + EAttachmentStore *store; + + store = e_attachment_view_get_store ( + E_ATTACHMENT_VIEW (priv->attachment_view)); + g_signal_handlers_disconnect_matched ( + G_OBJECT (store), G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); } /* We want to destroy the pages after the widgets get destroyed, - since they have lots of signal handlers connected to the widgets - with the pages as the data. */ + * since they have lots of signal handlers connected to the widgets + * with the pages as the data. */ g_list_foreach (priv->pages, (GFunc) unref_page_cb, object); g_list_free (priv->pages); priv->pages = NULL; @@ -2050,7 +2054,7 @@ comp_editor_init (CompEditor *editor) /* Fine Tuning */ action = comp_editor_get_action (editor, "attach"); - g_object_set (G_OBJECT (action), "short-label", _("Attach"), NULL); + g_object_set (action, "short-label", _("Attach"), NULL); /* Desensitize the "save" action. */ action = comp_editor_get_action (editor, "save"); @@ -2175,7 +2179,8 @@ comp_editor_init (CompEditor *editor) } static gboolean -prompt_and_save_changes (CompEditor *editor, gboolean send) +prompt_and_save_changes (CompEditor *editor, + gboolean send) { CompEditorPrivate *priv; gboolean correct = FALSE; @@ -2254,8 +2259,8 @@ close_dialog (CompEditor *editor) g_signal_emit_by_name (editor, "comp_closed", priv->saved); /* FIXME Unfortunately we do this here because otherwise corba - calls happen during destruction and we might get a change - notification back when we are in an inconsistent state */ + * calls happen during destruction and we might get a change + * notification back when we are in an inconsistent state */ if (priv->view) g_signal_handlers_disconnect_matched (G_OBJECT (priv->view), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor); @@ -2275,7 +2280,8 @@ comp_editor_compare (CompEditor *editor_a, } void -comp_editor_set_existing_org (CompEditor *editor, gboolean existing_org) +comp_editor_set_existing_org (CompEditor *editor, + gboolean existing_org) { g_return_if_fail (IS_COMP_EDITOR (editor)); @@ -2745,9 +2751,9 @@ page_unmapped_cb (GtkWidget *page_widget, **/ void comp_editor_append_widget (CompEditor *editor, - GtkWidget *page, - const gchar *label, - gboolean add) + GtkWidget *page, + const gchar *label, + gboolean add) { CompEditorPrivate *priv; GtkWidget *label_widget = NULL; @@ -2771,7 +2777,7 @@ comp_editor_append_widget (CompEditor *editor, } /* Listen for when the page is mapped/unmapped so we can - install/uninstall the appropriate GtkAccelGroup. + * install/uninstall the appropriate GtkAccelGroup. g_signal_connect ( page, "map", G_CALLBACK (page_mapped_cb), page); @@ -2794,9 +2800,9 @@ comp_editor_append_widget (CompEditor *editor, **/ void comp_editor_append_page (CompEditor *editor, - CompEditorPage *page, - const gchar *label, - gboolean add) + CompEditorPage *page, + const gchar *label, + gboolean add) { CompEditorPrivate *priv; GtkWidget *page_widget; @@ -2843,7 +2849,7 @@ comp_editor_append_page (CompEditor *editor, G_CALLBACK (page_dates_changed_cb), editor); /* Listen for when the page is mapped/unmapped so we can - install/uninstall the appropriate GtkAccelGroup. */ + * install/uninstall the appropriate GtkAccelGroup. */ g_signal_connect ( page_widget, "map", G_CALLBACK (page_mapped_cb), page); @@ -2866,7 +2872,8 @@ comp_editor_append_page (CompEditor *editor, * Removes the page from the component editor **/ void -comp_editor_remove_page (CompEditor *editor, CompEditorPage *page) +comp_editor_remove_page (CompEditor *editor, + CompEditorPage *page) { CompEditorPrivate *priv; GtkWidget *page_widget; @@ -2902,7 +2909,8 @@ comp_editor_remove_page (CompEditor *editor, CompEditorPage *page) * **/ void -comp_editor_show_page (CompEditor *editor, CompEditorPage *page) +comp_editor_show_page (CompEditor *editor, + CompEditorPage *page) { CompEditorPrivate *priv; GtkWidget *page_widget; @@ -3009,7 +3017,8 @@ attachment_loaded_cb (EAttachment *attachment, } static void -set_attachment_list (CompEditor *editor, GSList *uri_list) +set_attachment_list (CompEditor *editor, + GSList *uri_list) { EAttachmentStore *store; EAttachmentView *view; @@ -3090,7 +3099,8 @@ fill_widgets (CompEditor *editor) } static void -real_edit_comp (CompEditor *editor, ECalComponent *comp) +real_edit_comp (CompEditor *editor, + ECalComponent *comp) { CompEditorPrivate *priv; @@ -3152,7 +3162,8 @@ set_attendees_for_delegation (ECalComponent *comp, } static void -get_users_from_memo_comp (ECalComponent *comp, GSList **users) +get_users_from_memo_comp (ECalComponent *comp, + GSList **users) { icalcomponent *icalcomp; icalproperty *icalprop; @@ -3298,7 +3309,8 @@ real_send_comp (CompEditor *editor, * Starts the editor editing the given component **/ void -comp_editor_edit_comp (CompEditor *editor, ECalComponent *comp) +comp_editor_edit_comp (CompEditor *editor, + ECalComponent *comp) { CompEditorClass *class; @@ -3328,7 +3340,8 @@ comp_editor_get_comp (CompEditor *editor) * Returns: Newly allocated component, should be unref-ed by g_object_unref(). **/ ECalComponent * -comp_editor_get_current_comp (CompEditor *editor, gboolean *correct) +comp_editor_get_current_comp (CompEditor *editor, + gboolean *correct) { CompEditorPrivate *priv; ECalComponent *comp; @@ -3361,7 +3374,8 @@ comp_editor_get_current_comp (CompEditor *editor, gboolean *correct) * **/ gboolean -comp_editor_save_comp (CompEditor *editor, gboolean send) +comp_editor_save_comp (CompEditor *editor, + gboolean send) { return prompt_and_save_changes (editor, send); } @@ -3516,7 +3530,7 @@ comp_editor_get_mime_attach_list (CompEditor *editor) static void page_dates_changed_cb (CompEditor *editor, - CompEditorPageDates *dates, + CompEditorPageDates *dates, CompEditorPage *page) { CompEditorPrivate *priv = editor->priv; diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h index aca5c8ef11..c2a3082a31 100644 --- a/calendar/gui/dialogs/comp-editor.h +++ b/calendar/gui/dialogs/comp-editor.h @@ -91,11 +91,11 @@ struct _CompEditorClass { }; typedef enum { - COMP_EDITOR_NEW_ITEM = 1<<0, - COMP_EDITOR_MEETING = 1<<1, - COMP_EDITOR_DELEGATE = 1<<2, - COMP_EDITOR_USER_ORG = 1<<3, - COMP_EDITOR_IS_ASSIGNED = 1<<4, + COMP_EDITOR_NEW_ITEM = 1 << 0, + COMP_EDITOR_MEETING = 1 << 1, + COMP_EDITOR_DELEGATE = 1 << 2, + COMP_EDITOR_USER_ORG = 1 << 3, + COMP_EDITOR_IS_ASSIGNED = 1 << 4, COMP_EDITOR_IS_SHARED = 1 << 5, COMP_EDITOR_SEND_TO_NEW_ATTENDEES_ONLY = 1 << 6 } CompEditorFlags; diff --git a/calendar/gui/dialogs/copy-source-dialog.c b/calendar/gui/dialogs/copy-source-dialog.c index 31e7cef1b5..e247f13264 100644 --- a/calendar/gui/dialogs/copy-source-dialog.c +++ b/calendar/gui/dialogs/copy-source-dialog.c @@ -41,7 +41,9 @@ typedef struct { } CopySourceDialogData; static void -show_error (CopySourceDialogData *csdd, const gchar *msg, const GError *error) +show_error (CopySourceDialogData *csdd, + const gchar *msg, + const GError *error) { GtkWidget *dialog; @@ -59,7 +61,8 @@ struct ForeachTzidData }; static void -add_timezone_to_cal_cb (icalparameter *param, gpointer data) +add_timezone_to_cal_cb (icalparameter *param, + gpointer data) { struct ForeachTzidData *ftd = data; icaltimezone *tz = NULL; @@ -231,7 +234,9 @@ copy_source (const CopySourceDialogData *const_csdd) * source to copy to. */ void -copy_source_dialog (GtkWindow *parent, ESource *source, ECalClientSourceType obj_type) +copy_source_dialog (GtkWindow *parent, + ESource *source, + ECalClientSourceType obj_type) { CopySourceDialogData csdd; diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c index f5ac9c9ce4..a28fa00221 100644 --- a/calendar/gui/dialogs/delete-comp.c +++ b/calendar/gui/dialogs/delete-comp.c @@ -162,7 +162,8 @@ delete_component_dialog (ECalComponent *comp, } static void -cb_toggled_cb (GtkToggleButton *toggle, gpointer data) +cb_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active = FALSE; GtkWidget *entry = (GtkWidget *) data; @@ -172,7 +173,10 @@ cb_toggled_cb (GtkToggleButton *toggle, gpointer data) } gboolean -prompt_retract_dialog (ECalComponent *comp, gchar **retract_text, GtkWidget *parent, gboolean *retract) +prompt_retract_dialog (ECalComponent *comp, + gchar **retract_text, + GtkWidget *parent, + gboolean *retract) { gchar *message = NULL; ECalComponentVType type = E_CAL_COMPONENT_NO_TYPE; diff --git a/calendar/gui/dialogs/delete-error.c b/calendar/gui/dialogs/delete-error.c index cd461c7858..a5cc6a1b02 100644 --- a/calendar/gui/dialogs/delete-error.c +++ b/calendar/gui/dialogs/delete-error.c @@ -39,7 +39,8 @@ * **/ void -delete_error_dialog (const GError *error, ECalComponentVType vtype) +delete_error_dialog (const GError *error, + ECalComponentVType vtype) { GtkWidget *dialog; const gchar *str; diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c index da6eeea05d..af61f807a8 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.c +++ b/calendar/gui/dialogs/e-delegate-dialog.c @@ -114,7 +114,9 @@ e_delegate_dialog_finalize (GObject *object) } EDelegateDialog * -e_delegate_dialog_construct (EDelegateDialog *edd, const gchar *name, const gchar *address) +e_delegate_dialog_construct (EDelegateDialog *edd, + const gchar *name, + const gchar *address) { EDelegateDialogPrivate *priv; EDestinationStore *destination_store; @@ -157,7 +159,7 @@ e_delegate_dialog_construct (EDelegateDialog *edd, const gchar *name, const gcha e_destination_store_append_destination (destination_store, dest); g_object_unref (dest); - g_signal_connect((priv->addressbook), "clicked", + g_signal_connect ((priv->addressbook), "clicked", G_CALLBACK (addressbook_clicked_cb), edd); name_selector_dialog = e_name_selector_peek_dialog (priv->name_selector); @@ -188,7 +190,8 @@ get_widgets (EDelegateDialog *edd) } static void -addressbook_clicked_cb (GtkWidget *widget, gpointer data) +addressbook_clicked_cb (GtkWidget *widget, + gpointer data) { EDelegateDialog *edd = data; @@ -197,7 +200,9 @@ addressbook_clicked_cb (GtkWidget *widget, gpointer data) } static void -addressbook_response_cb (GtkWidget *widget, gint response, gpointer data) +addressbook_response_cb (GtkWidget *widget, + gint response, + gpointer data) { EDelegateDialog *edd = data; EDelegateDialogPrivate *priv; @@ -218,7 +223,8 @@ addressbook_response_cb (GtkWidget *widget, gint response, gpointer data) * editor could not be created. **/ EDelegateDialog * -e_delegate_dialog_new (const gchar *name, const gchar *address) +e_delegate_dialog_new (const gchar *name, + const gchar *address) { EDelegateDialog *edd; @@ -227,7 +233,7 @@ e_delegate_dialog_new (const gchar *name, const gchar *address) } gchar * -e_delegate_dialog_get_delegate (EDelegateDialog *edd) +e_delegate_dialog_get_delegate (EDelegateDialog *edd) { EDelegateDialogPrivate *priv; ENameSelectorModel *name_selector_model; @@ -258,7 +264,7 @@ e_delegate_dialog_get_delegate (EDelegateDialog *edd) } gchar * -e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) +e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) { EDelegateDialogPrivate *priv; ENameSelectorModel *name_selector_model; @@ -288,8 +294,8 @@ e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) return g_strdup (priv->name); } -GtkWidget* -e_delegate_dialog_get_toplevel (EDelegateDialog *edd) +GtkWidget * +e_delegate_dialog_get_toplevel (EDelegateDialog *edd) { EDelegateDialogPrivate *priv; diff --git a/calendar/gui/dialogs/e-delegate-dialog.h b/calendar/gui/dialogs/e-delegate-dialog.h index 5e1c9f0e5b..032901c8bc 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.h +++ b/calendar/gui/dialogs/e-delegate-dialog.h @@ -52,11 +52,11 @@ struct _EDelegateDialogClass { GType e_delegate_dialog_get_type (void); -EDelegateDialog* e_delegate_dialog_construct (EDelegateDialog *etd, +EDelegateDialog * e_delegate_dialog_construct (EDelegateDialog *etd, const gchar *name, const gchar *address); -EDelegateDialog* e_delegate_dialog_new (const gchar *name, +EDelegateDialog * e_delegate_dialog_new (const gchar *name, const gchar *address); gchar * e_delegate_dialog_get_delegate (EDelegateDialog *etd); @@ -66,7 +66,7 @@ gchar * e_delegate_dialog_get_delegate_name (EDelegateDialog *etd); void e_delegate_dialog_set_delegate (EDelegateDialog *etd, const gchar *address); -GtkWidget* e_delegate_dialog_get_toplevel (EDelegateDialog *etd); +GtkWidget * e_delegate_dialog_get_toplevel (EDelegateDialog *etd); diff --git a/calendar/gui/dialogs/e-send-options-utils.c b/calendar/gui/dialogs/e-send-options-utils.c index d85e821d91..f8e933574c 100644 --- a/calendar/gui/dialogs/e-send-options-utils.c +++ b/calendar/gui/dialogs/e-send-options-utils.c @@ -31,7 +31,9 @@ #include <string.h> void -e_send_options_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, const gchar *type) +e_send_options_utils_set_default_data (ESendOptionsDialog *sod, + ESource *source, + const gchar *type) { ESendOptionsGeneral *gopts = NULL; ESendOptionsStatusTracking *sopts; diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 0529e90286..f89b67056d 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -377,7 +377,7 @@ event_editor_constructor (GType type, } event_page_set_meeting (priv->event_page, TRUE); - priv->meeting_shown=TRUE; + priv->meeting_shown = TRUE; if (e_shell_get_express_mode (shell)) { attendee_page = event_page_get_attendee_page (priv->event_page); @@ -597,7 +597,8 @@ event_editor_init (EventEditor *ee) } static void -event_editor_edit_comp (CompEditor *editor, ECalComponent *comp) +event_editor_edit_comp (CompEditor *editor, + ECalComponent *comp) { EventEditorPrivate *priv; ECalComponentOrganizer organizer; diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 0ecb18393c..653f0215ac 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -183,8 +183,8 @@ struct _EventPagePrivate { gint alarm_interval; /* This is TRUE if both the start & end timezone are the same. If the - start timezone is then changed, we updated the end timezone to the - same value, since 99% of events start and end in one timezone. */ + * start timezone is then changed, we updated the end timezone to the + * same value, since 99% of events start and end in one timezone. */ gboolean sync_timezones; gboolean is_meeting; @@ -645,7 +645,7 @@ sensitize_widgets (EventPage *epage) alarm = e_dialog_combo_box_get (priv->alarm_time_combo, priv->alarm_map) != ALARM_NONE; custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL) || - e_dialog_combo_box_get (priv->alarm_time_combo, priv->alarm_map) == ALARM_CUSTOM ? TRUE:FALSE; + e_dialog_combo_box_get (priv->alarm_time_combo, priv->alarm_map) == ALARM_CUSTOM ? TRUE : FALSE; if (alarm && !priv->alarm_icon) { priv->alarm_icon = create_alarm_image_button ("stock_bell", _("This event has reminders"), epage); @@ -729,7 +729,7 @@ update_time (EventPage *epage, GtkAction *action; struct icaltimetype *start_tt, *end_tt, implied_tt; icaltimezone *start_zone = NULL, *def_zone = NULL; - gboolean all_day_event, homezone=TRUE; + gboolean all_day_event, homezone = TRUE; gboolean show_timezone; editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage)); @@ -737,8 +737,8 @@ update_time (EventPage *epage, if (start_date->tzid) { /* Note that if we are creating a new event, the timezones may not be - on the server, so we try to get the builtin timezone with the TZID - first. */ + * on the server, so we try to get the builtin timezone with the TZID + * first. */ start_zone = icaltimezone_get_builtin_timezone_from_tzid (start_date->tzid); if (!start_zone) { /* FIXME: Handle error better. */ @@ -753,7 +753,7 @@ update_time (EventPage *epage, } /* If both times are DATE values, we set the 'All Day Event' checkbox. - Also, if DTEND is after DTSTART, we subtract 1 day from it. */ + * Also, if DTEND is after DTSTART, we subtract 1 day from it. */ all_day_event = FALSE; start_tt = start_date->value; end_tt = end_date->value; @@ -774,8 +774,8 @@ update_time (EventPage *epage, set_all_day (epage, all_day_event); /* If it is an all day event, we set both timezones to the current - timezone, so that if the user toggles the 'All Day Event' checkbox - the event uses the current timezone rather than none at all. */ + * timezone, so that if the user toggles the 'All Day Event' checkbox + * the event uses the current timezone rather than none at all. */ if (all_day_event) start_zone = e_meeting_store_get_timezone ( epage->priv->meeting_store); @@ -809,7 +809,7 @@ update_time (EventPage *epage, 0, 0, NULL, NULL, epage); /* Set the timezones, and set sync_timezones to TRUE if both timezones - are the same. */ + * are the same. */ g_signal_handlers_block_matched ( epage->priv->start_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); @@ -843,7 +843,8 @@ update_time (EventPage *epage, } static void -organizer_changed_cb (GtkEntry *entry, EventPage *epage) +organizer_changed_cb (GtkEntry *entry, + EventPage *epage) { gchar *name; gchar *mailto; @@ -949,7 +950,7 @@ event_page_focus_main_widget (CompEditorPage *page) static void event_page_load_locations_list (CompEditorPage *page, - ECalComponent *comp) + ECalComponent *comp) { EShell *shell; EShellBackend *backend; @@ -1008,7 +1009,7 @@ event_page_load_locations_list (CompEditorPage *page, static void event_page_save_locations_list (CompEditorPage *page, - ECalComponent *comp) + ECalComponent *comp) { EShell *shell; EShellBackend *backend; @@ -1455,7 +1456,7 @@ event_page_fill_component (CompEditorPage *page, g_return_val_if_fail (end_date_set, FALSE); /* If the all_day toggle is set, we use DATE values for DTSTART and - DTEND. If not, we fetch the hour & minute from the widgets. */ + * DTEND. If not, we fetch the hour & minute from the widgets. */ all_day_event = priv->all_day_event; if (all_day_event) { @@ -1806,28 +1807,32 @@ event_page_init (EventPage *epage) } void -event_page_set_view_role (EventPage *epage, gboolean state) +event_page_set_view_role (EventPage *epage, + gboolean state) { e_meeting_list_view_column_set_visible ( epage->priv->list_view, E_MEETING_STORE_ROLE_COL, state); } void -event_page_set_view_status (EventPage *epage, gboolean state) +event_page_set_view_status (EventPage *epage, + gboolean state) { e_meeting_list_view_column_set_visible ( epage->priv->list_view, E_MEETING_STORE_STATUS_COL, state); } void -event_page_set_view_type (EventPage *epage, gboolean state) +event_page_set_view_type (EventPage *epage, + gboolean state) { e_meeting_list_view_column_set_visible ( epage->priv->list_view, E_MEETING_STORE_TYPE_COL, state); } void -event_page_set_view_rsvp (EventPage *epage, gboolean state) +event_page_set_view_rsvp (EventPage *epage, + gboolean state) { e_meeting_list_view_column_set_visible ( epage->priv->list_view, E_MEETING_STORE_RSVP_COL, state); @@ -1860,7 +1865,8 @@ event_page_show_options (EventPage *page) } void -event_page_set_meeting (EventPage *page, gboolean set) +event_page_set_meeting (EventPage *page, + gboolean set) { g_return_if_fail (IS_EVENT_PAGE (page)); @@ -1870,7 +1876,8 @@ event_page_set_meeting (EventPage *page, gboolean set) } void -event_page_set_delegate (EventPage *page, gboolean set) +event_page_set_delegate (EventPage *page, + gboolean set) { g_return_if_fail (IS_EVENT_PAGE (page)); @@ -1881,7 +1888,8 @@ event_page_set_delegate (EventPage *page, gboolean set) } static void -time_sel_changed (GtkComboBox *combo, EventPage *epage) +time_sel_changed (GtkComboBox *combo, + EventPage *epage) { EventPagePrivate *priv; gint selection = gtk_combo_box_get_active (combo); @@ -1932,20 +1940,22 @@ void update_end_time_combo (EventPage *epage) end_timet -= start_timet; hours = end_timet / ( 60 * 60 ); - minutes = (end_timet/60) - ( hours * 60 ); + minutes = (end_timet / 60) - ( hours * 60 ); gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->hour_selector), hours); gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->minute_selector), minutes); } static void -hour_sel_changed (GtkSpinButton *widget, EventPage *epage) +hour_sel_changed (GtkSpinButton *widget, + EventPage *epage) { hour_minute_changed (epage); } static void -minute_sel_changed (GtkSpinButton *widget, EventPage *epage) +minute_sel_changed (GtkSpinButton *widget, + EventPage *epage) { hour_minute_changed (epage); } @@ -1981,7 +1991,8 @@ hour_minute_changed (EventPage *epage) } static void -edit_clicked_cb (GtkButton *btn, EventPage *epage) +edit_clicked_cb (GtkButton *btn, + EventPage *epage) { EventPagePrivate *priv; GtkTreePath *path = NULL; @@ -2001,7 +2012,8 @@ edit_clicked_cb (GtkButton *btn, EventPage *epage) } static void -add_clicked_cb (GtkButton *btn, EventPage *epage) +add_clicked_cb (GtkButton *btn, + EventPage *epage) { CompEditor *editor; CompEditorFlags flags; @@ -2020,7 +2032,8 @@ add_clicked_cb (GtkButton *btn, EventPage *epage) } static gboolean -existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) +existing_attendee (EMeetingAttendee *ia, + ECalComponent *comp) { GSList *attendees, *l; const gchar *ia_address; @@ -2056,7 +2069,8 @@ existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) } static void -remove_attendee (EventPage *epage, EMeetingAttendee *ia) +remove_attendee (EventPage *epage, + EMeetingAttendee *ia) { EventPagePrivate *priv = epage->priv; CompEditor *editor; @@ -2070,7 +2084,7 @@ remove_attendee (EventPage *epage, EMeetingAttendee *ia) delegate = (flags & COMP_EDITOR_DELEGATE); /* If the user deletes the organizer attendee explicitly, - assume they no longer want the organizer showing up */ + * assume they no longer want the organizer showing up */ if (ia == priv->ia) { g_object_unref (priv->ia); priv->ia = NULL; @@ -2113,7 +2127,8 @@ remove_attendee (EventPage *epage, EMeetingAttendee *ia) } static void -remove_clicked_cb (GtkButton *btn, EventPage *epage) +remove_clicked_cb (GtkButton *btn, + EventPage *epage) { EventPagePrivate *priv; EMeetingAttendee *ia; @@ -2135,7 +2150,7 @@ remove_clicked_cb (GtkButton *btn, EventPage *epage) } paths = g_list_reverse (paths); - for (tmp = paths; tmp; tmp=tmp->next) { + for (tmp = paths; tmp; tmp = tmp->next) { path = tmp->data; gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->meeting_store), &iter, path); @@ -2214,8 +2229,10 @@ attendee_added_cb (EMeetingListView *emlv, } static gboolean -list_view_event (EMeetingListView *list_view, GdkEvent *event, EventPage *epage) { - +list_view_event (EMeetingListView *list_view, + GdkEvent *event, + EventPage *epage) +{ EventPagePrivate *priv = epage->priv; CompEditor *editor; CompEditorFlags flags; @@ -2240,7 +2257,9 @@ list_view_event (EMeetingListView *list_view, GdkEvent *event, EventPage *epage) } static gboolean -list_key_press (EMeetingListView *list_view, GdkEventKey *event, EventPage *epage) +list_key_press (EMeetingListView *list_view, + GdkEventKey *event, + EventPage *epage) { if (event->keyval == GDK_KEY_Delete) { @@ -2257,7 +2276,8 @@ list_key_press (EMeetingListView *list_view, GdkEventKey *event, EventPage *epag } void -event_page_set_all_day_event (EventPage *epage, gboolean all_day) +event_page_set_all_day_event (EventPage *epage, + gboolean all_day) { EventPagePrivate *priv = epage->priv; struct icaltimetype start_tt = icaltime_null_time (); @@ -2309,7 +2329,7 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) start_tt.is_date = TRUE; /* Round down to the start of the day, or the start of the - previous day if it is midnight. */ + * previous day if it is midnight. */ icaltime_adjust (&end_tt, 0, 0, 0, -1); end_tt.hour = 0; end_tt.minute = 0; @@ -2322,8 +2342,8 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) && end_tt.month == start_tt.month && end_tt.day == start_tt.day) { /* The event is within one day, so we set the event - start to the start of the working day, and the end - to one hour later. */ + * start to the start of the working day, and the end + * to one hour later. */ start_tt.hour = comp_editor_get_work_day_start_hour (editor); start_tt.minute = @@ -2334,8 +2354,8 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) icaltime_adjust (&end_tt, 0, 1, 0, 0); } else { /* The event is longer than 1 day, so we keep exactly - the same times, just using DATE-TIME rather than - DATE. */ + * the same times, just using DATE-TIME rather than + * DATE. */ icaltime_adjust (&end_tt, 1, 0, 0, 0); } @@ -2373,7 +2393,8 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) } void -event_page_set_show_time_busy (EventPage *epage, gboolean state) +event_page_set_show_time_busy (EventPage *epage, + gboolean state) { epage->priv->show_time_as_busy = state; comp_editor_page_changed (COMP_EDITOR_PAGE (epage)); @@ -2386,7 +2407,8 @@ event_page_show_alarm (EventPage *epage) } void -event_page_set_show_timezone (EventPage *epage, gboolean state) +event_page_set_show_timezone (EventPage *epage, + gboolean state) { if (state) { gtk_widget_show_all (epage->priv->start_timezone); @@ -2399,7 +2421,8 @@ event_page_set_show_timezone (EventPage *epage, gboolean state) } void -event_page_set_show_categories (EventPage *epage, gboolean state) +event_page_set_show_categories (EventPage *epage, + gboolean state) { if (state) { gtk_widget_show (epage->priv->categories_btn); @@ -2412,7 +2435,9 @@ event_page_set_show_categories (EventPage *epage, gboolean state) /*If the msg has some value set, the icon should always be set */ void -event_page_set_info_string (EventPage *epage, const gchar *icon, const gchar *msg) +event_page_set_info_string (EventPage *epage, + const gchar *icon, + const gchar *msg) { EventPagePrivate *priv; @@ -2454,7 +2479,7 @@ get_widgets (EventPage *epage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -2572,11 +2597,12 @@ summary_changed_cb (GtkEditable *editable, } /* Note that this assumes that the start_tt and end_tt passed to it are the - dates visible to the user. For DATE values, we have to add 1 day to the - end_tt before emitting the signal. */ + * dates visible to the user. For DATE values, we have to add 1 day to the + * end_tt before emitting the signal. */ static void -notify_dates_changed (EventPage *epage, struct icaltimetype *start_tt, - struct icaltimetype *end_tt) +notify_dates_changed (EventPage *epage, + struct icaltimetype *start_tt, + struct icaltimetype *end_tt) { EventPagePrivate *priv; CompEditorPageDates dates; @@ -2592,7 +2618,7 @@ notify_dates_changed (EventPage *epage, struct icaltimetype *start_tt, if (all_day_event) { /* The actual DTEND is 1 day after the displayed date for - DATE values. */ + * DATE values. */ icaltime_adjust (end_tt, 1, 0, 0, 0); } else { start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone)); @@ -2615,10 +2641,10 @@ notify_dates_changed (EventPage *epage, struct icaltimetype *start_tt, static gboolean check_start_before_end (struct icaltimetype *start_tt, - icaltimezone *start_zone, - struct icaltimetype *end_tt, - icaltimezone *end_zone, - gboolean adjust_end_time) + icaltimezone *start_zone, + struct icaltimetype *end_tt, + icaltimezone *end_zone, + gboolean adjust_end_time) { struct icaltimetype end_tt_copy; gint cmp; @@ -2628,7 +2654,7 @@ check_start_before_end (struct icaltimetype *start_tt, icaltimezone_convert_time (&end_tt_copy, end_zone, start_zone); /* Now check if the start time is after the end time. If it is, - we need to modify one of the times. */ + * we need to modify one of the times. */ cmp = icaltime_compare (*start_tt, end_tt_copy); if (cmp > 0) { if (adjust_end_time) { @@ -2660,7 +2686,8 @@ check_start_before_end (struct icaltimetype *start_tt, * start or end time, the other time is adjusted to make it valid. */ static void -times_updated (EventPage *epage, gboolean adjust_end_time) +times_updated (EventPage *epage, + gboolean adjust_end_time) { EventPagePrivate *priv; struct icaltimetype start_tt = icaltime_null_time (); @@ -2691,7 +2718,7 @@ times_updated (EventPage *epage, gboolean adjust_end_time) if (all_day_event) { /* All Day Events are simple. We just compare the dates and if - start > end we copy one of them to the other. */ + * start > end we copy one of them to the other. */ gint cmp = icaltime_compare_date_only (start_tt, end_tt); if (cmp > 0) { if (adjust_end_time) { @@ -2707,7 +2734,7 @@ times_updated (EventPage *epage, gboolean adjust_end_time) end_tt.is_date = TRUE; } else { /* For DATE-TIME events, we have to convert to the same - timezone before comparing. */ + * timezone before comparing. */ e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), &start_tt.hour, &start_tt.minute); @@ -2858,7 +2885,9 @@ event_page_send_options_clicked_cb (EventPage *epage) } static void -epage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +epage_client_opened_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ESource *source = E_SOURCE (source_object); EClient *client = NULL; @@ -2928,7 +2957,8 @@ epage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer u } static void -source_changed_cb (ESourceComboBox *source_combo_box, EventPage *epage) +source_changed_cb (ESourceComboBox *source_combo_box, + EventPage *epage) { EventPagePrivate *priv = epage->priv; ESource *source; @@ -2950,7 +2980,8 @@ source_changed_cb (ESourceComboBox *source_combo_box, EventPage *epage) } static void -set_subscriber_info_string (EventPage *epage, const gchar *backend_address) +set_subscriber_info_string (EventPage *epage, + const gchar *backend_address) { CompEditor *editor; ECalClient *client; @@ -2963,7 +2994,7 @@ set_subscriber_info_string (EventPage *epage, const gchar *backend_address) if (e_source_get_property (source, "subscriber")) { g_free (epage->priv->subscriber_info_text); /* Translators: This string is used when we are creating an Event - (meeting or appointment) on behalf of some other user */ + * (meeting or appointment) on behalf of some other user */ epage->priv->subscriber_info_text = g_markup_printf_escaped (_("You are acting on behalf of %s"), backend_address); } else { g_free (epage->priv->subscriber_info_text); @@ -3131,7 +3162,7 @@ init_widgets (EventPage *epage) client = comp_editor_get_client (editor); /* Make sure the EDateEdit widgets use our timezones to get the - current time. */ + * current time. */ e_date_edit_set_get_time_callback ( E_DATE_EDIT (priv->start_time), (EDateEditGetTimeCallback) comp_editor_get_current_time, @@ -3147,7 +3178,7 @@ init_widgets (EventPage *epage) gtk_widget_hide (priv->info_hbox); /* Summary */ - g_signal_connect((priv->summary), "changed", + g_signal_connect ((priv->summary), "changed", G_CALLBACK (summary_changed_cb), epage); /* Description */ @@ -3164,11 +3195,11 @@ init_widgets (EventPage *epage) G_CALLBACK (end_date_changed_cb), epage); /* Categories */ - g_signal_connect((priv->categories_btn), "clicked", + g_signal_connect ((priv->categories_btn), "clicked", G_CALLBACK (categories_clicked_cb), epage); /* Source selector */ - g_signal_connect((priv->source_selector), "changed", + g_signal_connect ((priv->source_selector), "changed", G_CALLBACK (source_changed_cb), epage); /* Alarms */ priv->alarm_list_store = e_alarm_list_new (); @@ -3183,7 +3214,7 @@ init_widgets (EventPage *epage) G_CALLBACK (comp_editor_page_changed), epage); /* Timezone changed */ - g_signal_connect((priv->start_timezone), "changed", + g_signal_connect ((priv->start_timezone), "changed", G_CALLBACK (start_timezone_changed_cb), epage); e_meeting_list_view_column_set_visible ( @@ -3212,24 +3243,40 @@ init_widgets (EventPage *epage) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); - g_signal_connect (G_OBJECT (priv->list_view), "event", G_CALLBACK (list_view_event), epage); - g_signal_connect (priv->list_view, "key_press_event", G_CALLBACK (list_key_press), epage); + g_signal_connect ( + priv->list_view, "event", + G_CALLBACK (list_view_event), epage); + g_signal_connect ( + priv->list_view, "key_press_event", + G_CALLBACK (list_key_press), epage); /* Add attendee button */ - g_signal_connect (priv->add, "clicked", G_CALLBACK (add_clicked_cb), epage); + g_signal_connect ( + priv->add, "clicked", + G_CALLBACK (add_clicked_cb), epage); /* Remove attendee button */ - g_signal_connect (priv->remove, "clicked", G_CALLBACK (remove_clicked_cb), epage); + g_signal_connect ( + priv->remove, "clicked", + G_CALLBACK (remove_clicked_cb), epage); /* Edit attendee button */ - g_signal_connect (priv->edit, "clicked", G_CALLBACK (edit_clicked_cb), epage); + g_signal_connect ( + priv->edit, "clicked", + G_CALLBACK (edit_clicked_cb), epage); /* Contacts button */ - g_signal_connect(priv->invite, "clicked", G_CALLBACK (invite_cb), epage); + g_signal_connect ( + priv->invite, "clicked", + G_CALLBACK (invite_cb), epage); /* Alarm dialog */ - g_signal_connect (GTK_DIALOG (priv->alarm_dialog), "response", G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); - g_signal_connect (GTK_DIALOG (priv->alarm_dialog), "delete-event", G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); + g_signal_connect ( + priv->alarm_dialog, "response", + G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); + g_signal_connect ( + priv->alarm_dialog, "delete-event", + G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); priv->alarm_list_dlg_widget = alarm_list_dialog_peek (client, priv->alarm_list_store); gtk_widget_reparent (priv->alarm_list_dlg_widget, priv->alarm_box); gtk_widget_show_all (priv->alarm_list_dlg_widget); @@ -3259,7 +3306,7 @@ init_widgets (EventPage *epage) update_end_time_combo ( epage); /* Hour and Minute selector */ - gtk_spin_button_set_range ( (GtkSpinButton*) priv->hour_selector, 0, G_MAXINT); + gtk_spin_button_set_range ( (GtkSpinButton *) priv->hour_selector, 0, G_MAXINT); g_signal_connect (priv->hour_selector, "value-changed", G_CALLBACK (hour_sel_changed), epage); g_signal_connect (priv->minute_selector, "value-changed", G_CALLBACK (minute_sel_changed), epage); @@ -3363,7 +3410,8 @@ init_widgets (EventPage *epage) static void -event_page_select_organizer (EventPage *epage, const gchar *backend_address) +event_page_select_organizer (EventPage *epage, + const gchar *backend_address) { EventPagePrivate *priv = epage->priv; CompEditor *editor; @@ -3505,7 +3553,8 @@ event_page_new (EMeetingStore *meeting_store, } static void -set_attendees (ECalComponent *comp, const GPtrArray *attendees) +set_attendees (ECalComponent *comp, + const GPtrArray *attendees) { GSList *comp_attendees = NULL, *l; gint i; diff --git a/calendar/gui/dialogs/goto-dialog.c b/calendar/gui/dialogs/goto-dialog.c index 7b8fffa430..4a77c87554 100644 --- a/calendar/gui/dialogs/goto-dialog.c +++ b/calendar/gui/dialogs/goto-dialog.c @@ -59,7 +59,8 @@ static GoToDialog *dlg = NULL; /* Callback used when the year adjustment is changed */ static void -year_changed (GtkAdjustment *adj, gpointer data) +year_changed (GtkAdjustment *adj, + gpointer data) { GtkSpinButton *spin_button; GoToDialog *dlg = data; @@ -73,7 +74,8 @@ year_changed (GtkAdjustment *adj, gpointer data) /* Callback used when a month button is toggled */ static void -month_changed (GtkToggleButton *toggle, gpointer data) +month_changed (GtkToggleButton *toggle, + gpointer data) { GtkComboBox *combo_box; GoToDialog *dlg = data; @@ -86,7 +88,8 @@ month_changed (GtkToggleButton *toggle, gpointer data) } static void -ecal_date_range_changed (ECalendarItem *calitem, gpointer user_data) +ecal_date_range_changed (ECalendarItem *calitem, + gpointer user_data) { GoToDialog *dlg = user_data; ECalModel *model; @@ -101,7 +104,8 @@ ecal_date_range_changed (ECalendarItem *calitem, gpointer user_data) /* Event handler for day groups in the month item. A button press makes * the calendar jump to the selected day and destroys the Go-to dialog box. */ static void -ecal_event (ECalendarItem *calitem, gpointer user_data) +ecal_event (ECalendarItem *calitem, + gpointer user_data) { GoToDialog *dlg = user_data; GDate start_date, end_date; @@ -127,7 +131,8 @@ ecal_event (ECalendarItem *calitem, gpointer user_data) /* Returns the current time, for the ECalendarItem. */ static struct tm -get_current_time (ECalendarItem *calitem, gpointer data) +get_current_time (ECalendarItem *calitem, + gpointer data) { icaltimezone *zone; struct tm tmp_tm = { 0 }; @@ -224,7 +229,8 @@ goto_dialog_init_widgets (GoToDialog *dlg) /* Creates a "goto date" dialog and runs it */ void -goto_dialog (GtkWindow *parent, GnomeCalendar *gcal) +goto_dialog (GtkWindow *parent, + GnomeCalendar *gcal) { ECalModel *model; time_t start_time; diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 9c14fccd0a..cf1e879d1d 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -503,7 +503,8 @@ get_recipients (ECalComponent *comp) } static gboolean -fill_comp_with_recipients (ENameSelector *name_selector, ECalComponent *comp) +fill_comp_with_recipients (ENameSelector *name_selector, + ECalComponent *comp) { EDestinationStore *destination_store; GString *str = NULL; @@ -678,7 +679,7 @@ memo_page_fill_component (CompEditorPage *page, gunichar uc; for (i = 0, p = str, uc = g_utf8_get_char_validated (p, -1); - i < 50 && p && uc < (gunichar)-2; + i < 50 && p && uc < (gunichar) - 2; i++, p = g_utf8_next_char (p), uc = g_utf8_get_char_validated (p, -1)) { if (uc == '\n' || !uc) { p = NULL; @@ -784,7 +785,8 @@ memo_page_fill_component (CompEditorPage *page, } void -memo_page_set_show_categories (MemoPage *page, gboolean state) +memo_page_set_show_categories (MemoPage *page, + gboolean state) { if (state) { gtk_widget_show (page->priv->categories_btn); @@ -797,7 +799,9 @@ memo_page_set_show_categories (MemoPage *page, gboolean state) /*If the msg has some value set, the icon should always be set */ void -memo_page_set_info_string (MemoPage *mpage, const gchar *icon, const gchar *msg) +memo_page_set_info_string (MemoPage *mpage, + const gchar *icon, + const gchar *msg) { MemoPagePrivate *priv; @@ -834,7 +838,7 @@ get_widgets (MemoPage *mpage) } /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -896,7 +900,9 @@ categories_clicked_cb (GtkWidget *button, } static void -mpage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +mpage_client_opened_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ESource *source = E_SOURCE (source_object); EClient *client = NULL; @@ -1002,7 +1008,7 @@ set_subscriber_info_string (MemoPage *mpage, if (e_source_get_property (source, "subscriber")) { g_free (mpage->priv->subscriber_info_text); /* Translators: This string is used when we are creating a Memo - on behalf of some other user */ + * on behalf of some other user */ mpage->priv->subscriber_info_text = g_markup_printf_escaped (_("You are acting on behalf of %s"), backend_address); } else { g_free (mpage->priv->subscriber_info_text); @@ -1082,7 +1088,7 @@ init_widgets (MemoPage *mpage) G_CALLBACK (source_changed_cb), mpage); /* Connect the default signal handler to use to make sure the "changed" - field gets set whenever a field is changed. */ + * field gets set whenever a field is changed. */ /* Belongs to priv->memo_content */ g_signal_connect_swapped ( @@ -1142,7 +1148,8 @@ get_to_entry (ENameSelector *name_selector) } static void -memo_page_select_organizer (MemoPage *mpage, const gchar *backend_address) +memo_page_select_organizer (MemoPage *mpage, + const gchar *backend_address) { MemoPagePrivate *priv; CompEditor *editor; diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c index 3514c03dbf..e9a941998d 100644 --- a/calendar/gui/dialogs/recur-comp.c +++ b/calendar/gui/dialogs/recur-comp.c @@ -33,9 +33,10 @@ gboolean recur_component_dialog (ECalClient *client, - ECalComponent *comp, - CalObjModType *mod, - GtkWindow *parent, gboolean delegated) + ECalComponent *comp, + CalObjModType *mod, + GtkWindow *parent, + gboolean delegated) { gchar *str; GtkWidget *dialog, *rb_this, *rb_prior, *rb_future, *rb_all, *hbox; diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index fa18e0d9f1..6f201b596f 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -463,7 +463,8 @@ clear_widgets (RecurrencePage *rpage) /* Appends an exception date to the list */ static void -append_exception (RecurrencePage *rpage, ECalComponentDateTime *datetime) +append_exception (RecurrencePage *rpage, + ECalComponentDateTime *datetime) { RecurrencePagePrivate *priv; GtkTreeView *view; @@ -478,7 +479,8 @@ append_exception (RecurrencePage *rpage, ECalComponentDateTime *datetime) /* Fills in the exception widgets with the data from the calendar component */ static void -fill_exception_widgets (RecurrencePage *rpage, ECalComponent *comp) +fill_exception_widgets (RecurrencePage *rpage, + ECalComponent *comp) { GSList *list, *l; @@ -588,7 +590,8 @@ sensitize_recur_widgets (RecurrencePage *rpage) } static void -update_with_readonly (RecurrencePage *rpage, gboolean read_only) +update_with_readonly (RecurrencePage *rpage, + gboolean read_only) { RecurrencePagePrivate *priv = rpage->priv; CompEditor *editor; @@ -617,7 +620,9 @@ update_with_readonly (RecurrencePage *rpage, gboolean read_only) } static void -rpage_get_objects_for_uid_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +rpage_get_objects_for_uid_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ECalClient *client = E_CAL_CLIENT (source_object); RecurrencePage *rpage = user_data; @@ -639,7 +644,9 @@ rpage_get_objects_for_uid_cb (GObject *source_object, GAsyncResult *result, gpoi } static void -rpage_get_object_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +rpage_get_object_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ECalClient *client = E_CAL_CLIENT (source_object); RecurrencePage *rpage = user_data; @@ -711,24 +718,12 @@ sensitize_buttons (RecurrencePage *rpage) } } -#if 0 -/* Encondes a position/weekday pair into the proper format for - * icalrecurrencetype.by_day. Not needed at present. - */ -static short -nth_weekday (gint pos, icalrecurrencetype_weekday weekday) -{ - g_assert (pos > 0 && pos <= 5); - - return (pos << 3) | (gint) weekday; -} -#endif - /* Gets the simple recurrence data from the recurrence widgets and stores it in * the calendar component. */ static void -simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) +simple_recur_to_comp (RecurrencePage *rpage, + ECalComponent *comp) { RecurrencePagePrivate *priv; struct icalrecurrencetype r; @@ -820,8 +815,8 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) break; /* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not - accept BYDAY=2TU. So we now use the same as Outlook - by default. */ + * accept BYDAY=2TU. So we now use the same as Outlook + * by default. */ case MONTH_DAY_MON: r.by_day[0] = ICAL_MONDAY_WEEKDAY; r.by_set_pos[0] = month_num; @@ -890,7 +885,7 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) g_return_if_fail (E_IS_DATE_EDIT (priv->ending_date_edit)); /* We only allow a DATE value to be set for the UNTIL property, - since we don't support sub-day recurrences. */ + * since we don't support sub-day recurrences. */ date_set = e_date_edit_get_date (E_DATE_EDIT (priv->ending_date_edit), &r.until.year, &r.until.month, @@ -921,7 +916,8 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) * custom recurrence, it leaves it intact. */ static gboolean -fill_component (RecurrencePage *rpage, ECalComponent *comp) +fill_component (RecurrencePage *rpage, + ECalComponent *comp) { RecurrencePagePrivate *priv; gboolean recurs; @@ -1058,7 +1054,11 @@ make_weekly_special (RecurrencePage *rpage) /* Creates the subtree for the monthly recurrence number */ static void -make_recur_month_num_subtree (GtkTreeStore *store, GtkTreeIter *par, const gchar *title, gint start, gint end) +make_recur_month_num_subtree (GtkTreeStore *store, + GtkTreeIter *par, + const gchar *title, + gint start, + gint end) { GtkTreeIter iter, parent; gint i; @@ -1071,12 +1071,13 @@ make_recur_month_num_subtree (GtkTreeStore *store, GtkTreeIter *par, const gchar gtk_tree_store_set (store, &iter, 0, _(e_cal_recur_nth[i]), 1, i + 1, -1); } } + static void -only_leaf_sensitive (GtkCellLayout *cell_layout, - GtkCellRenderer *cell, - GtkTreeModel *tree_model, - GtkTreeIter *iter, - gpointer data) +only_leaf_sensitive (GtkCellLayout *cell_layout, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data) { gboolean sensitive; @@ -1184,8 +1185,8 @@ make_recur_month_combobox (void) { static const gchar *options[] = { /* For Translator : 'day' is part of the sentence of the form 'appointment recurs/Every [x] month(s) on the [first] [day] [forever]' - (dropdown menu options are in[square brackets]). This means that after 'first', either the string 'day' or - the name of a week day (like 'Monday' or 'Friday') always follow. */ + * (dropdown menu options are in[square brackets]). This means that after 'first', either the string 'day' or + * the name of a week day (like 'Monday' or 'Friday') always follow. */ N_("day"), N_("Monday"), N_("Tuesday"), @@ -1209,7 +1210,8 @@ make_recur_month_combobox (void) } static void -month_num_combo_changed_cb (GtkComboBox *combo, RecurrencePage *rpage) +month_num_combo_changed_cb (GtkComboBox *combo, + RecurrencePage *rpage) { GtkTreeIter iter; RecurrencePagePrivate *priv; @@ -1269,7 +1271,8 @@ month_num_combo_changed_cb (GtkComboBox *combo, RecurrencePage *rpage) * are 1-31 while a Sunday is the 1st through 5th. */ static void -month_day_combo_changed_cb (GtkComboBox *combo, RecurrencePage *rpage) +month_day_combo_changed_cb (GtkComboBox *combo, + RecurrencePage *rpage) { RecurrencePagePrivate *priv; enum month_num_options month_num; @@ -1403,7 +1406,8 @@ make_recurrence_special (RecurrencePage *rpage) /* Counts the elements in the by_xxx fields of an icalrecurrencetype */ static gint -count_by_xxx (gshort *field, gint max_elements) +count_by_xxx (gshort *field, + gint max_elements) { gint i; @@ -1456,7 +1460,7 @@ make_ending_until_special (RecurrencePage *rpage) G_CALLBACK (comp_editor_page_changed), rpage); /* Make sure the EDateEdit widget uses our timezones to get the - current time. */ + * current time. */ e_date_edit_set_get_time_callback ( de, (EDateEditGetTimeCallback) comp_editor_get_current_time, @@ -1554,7 +1558,8 @@ make_ending_special (RecurrencePage *rpage) * component. */ static void -fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) +fill_ending_date (RecurrencePage *rpage, + struct icalrecurrencetype *r) { RecurrencePagePrivate *priv = rpage->priv; CompEditor *editor; @@ -1635,7 +1640,8 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) * no rdates or exrules (exdates are handled just fine elsewhere). */ static gboolean -recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) +recurrence_page_fill_widgets (CompEditorPage *page, + ECalComponent *comp) { RecurrencePage *rpage; RecurrencePagePrivate *priv; @@ -1867,8 +1873,8 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) enum month_day_options month_day; /* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not - accept BYDAY=2TU. So we now use the same as Outlook - by default. */ + * accept BYDAY=2TU. So we now use the same as Outlook + * by default. */ weekday = icalrecurrencetype_day_day_of_week (r->by_day[0]); pos = icalrecurrencetype_day_position (r->by_day[0]); @@ -1988,7 +1994,8 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) /* fill_component handler for the recurrence page */ static gboolean -recurrence_page_fill_component (CompEditorPage *page, ECalComponent *comp) +recurrence_page_fill_component (CompEditorPage *page, + ECalComponent *comp) { RecurrencePage *rpage; @@ -1998,7 +2005,8 @@ recurrence_page_fill_component (CompEditorPage *page, ECalComponent *comp) /* set_dates handler for the recurrence page */ static void -recurrence_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) +recurrence_page_set_dates (CompEditorPage *page, + CompEditorPageDates *dates) { RecurrencePage *rpage; RecurrencePagePrivate *priv; @@ -2088,7 +2096,7 @@ get_widgets (RecurrencePage *rpage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -2170,7 +2178,9 @@ type_toggled_cb (GtkToggleButton *toggle, } static GtkWidget * -create_exception_dialog (RecurrencePage *rpage, const gchar *title, GtkWidget **date_edit) +create_exception_dialog (RecurrencePage *rpage, + const gchar *title, + GtkWidget **date_edit) { RecurrencePagePrivate *priv; GtkWidget *dialog, *toplevel; @@ -2357,7 +2367,7 @@ init_widgets (RecurrencePage *rpage) priv->preview_calendar = e_calendar_new (); ecal = E_CALENDAR (priv->preview_calendar); - g_signal_connect((ecal->calitem), "date_range_changed", + g_signal_connect ((ecal->calitem), "date_range_changed", G_CALLBACK (preview_date_range_changed_cb), rpage); e_calendar_item_set_max_days_sel (ecal->calitem, 0); @@ -2373,7 +2383,7 @@ init_widgets (RecurrencePage *rpage) /* Recurrence types */ - g_signal_connect(priv->recurs, "toggled", G_CALLBACK (type_toggled_cb), rpage); + g_signal_connect (priv->recurs, "toggled", G_CALLBACK (type_toggled_cb), rpage); /* Recurrence interval */ @@ -2402,11 +2412,11 @@ init_widgets (RecurrencePage *rpage) /* Exception buttons */ - g_signal_connect((priv->exception_add), "clicked", + g_signal_connect ((priv->exception_add), "clicked", G_CALLBACK (exception_add_cb), rpage); - g_signal_connect((priv->exception_modify), "clicked", + g_signal_connect ((priv->exception_modify), "clicked", G_CALLBACK (exception_modify_cb), rpage); - g_signal_connect((priv->exception_delete), "clicked", + g_signal_connect ((priv->exception_delete), "clicked", G_CALLBACK (exception_delete_cb), rpage); gtk_widget_set_sensitive (priv->exception_modify, FALSE); diff --git a/calendar/gui/dialogs/save-comp.c b/calendar/gui/dialogs/save-comp.c index 0f9a6fba8e..459ff9a4c6 100644 --- a/calendar/gui/dialogs/save-comp.c +++ b/calendar/gui/dialogs/save-comp.c @@ -41,7 +41,8 @@ **/ GtkResponseType -save_component_dialog (GtkWindow *parent, ECalComponent *comp) +save_component_dialog (GtkWindow *parent, + ECalComponent *comp) { ECalComponentVType vtype = e_cal_component_get_vtype (comp); CompEditorFlags flags; diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 0b78f55c7b..3b96fbd2bc 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -54,8 +54,8 @@ struct _SchedulePagePrivate { EMeetingTimeSelector *sel; /* The timezone we use. Note that we use the same timezone for the - start and end date. We convert the end date if it is passed in in - another timezone. */ + * start and end date. We convert the end date if it is passed in in + * another timezone. */ icaltimezone *zone; }; @@ -95,8 +95,8 @@ update_time (SchedulePage *spage, if (start_date->tzid) { /* Note that if we are creating a new event, the timezones may not be - on the server, so we try to get the builtin timezone with the TZID - first. */ + * on the server, so we try to get the builtin timezone with the TZID + * first. */ start_zone = icaltimezone_get_builtin_timezone_from_tzid (start_date->tzid); if (!start_zone) { GError *error = NULL; @@ -145,7 +145,7 @@ update_time (SchedulePage *spage, all_day = (start_tt.is_date && end_tt.is_date) ? TRUE : FALSE; /* For All Day Events, if DTEND is after DTSTART, we subtract 1 day - from it. */ + * from it. */ if (all_day) { if (icaltime_compare_date_only (end_tt, start_tt) > 0) { icaltime_adjust (&end_tt, -1, 0, 0, 0); @@ -215,7 +215,8 @@ schedule_page_focus_main_widget (CompEditorPage *page) } static gboolean -schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) +schedule_page_fill_widgets (CompEditorPage *page, + ECalComponent *comp) { SchedulePage *spage; ECalComponentDateTime start_date, end_date; @@ -242,13 +243,15 @@ schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } static gboolean -schedule_page_fill_component (CompEditorPage *page, ECalComponent *comp) +schedule_page_fill_component (CompEditorPage *page, + ECalComponent *comp) { return TRUE; } static void -schedule_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) +schedule_page_set_dates (CompEditorPage *page, + CompEditorPageDates *dates) { SchedulePage *spage; @@ -304,7 +307,7 @@ get_widgets (SchedulePage *spage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -368,7 +371,8 @@ schedule_page_set_meeting_time (SchedulePage *spage, * be created. **/ SchedulePage * -schedule_page_construct (SchedulePage *spage, EMeetingStore *ems) +schedule_page_construct (SchedulePage *spage, + EMeetingStore *ems) { SchedulePagePrivate *priv = spage->priv; CompEditor *editor; @@ -450,7 +454,8 @@ schedule_page_update_free_busy (SchedulePage *spage) } void -schedule_page_set_name_selector (SchedulePage *spage, ENameSelector *name_selector) +schedule_page_set_name_selector (SchedulePage *spage, + ENameSelector *name_selector) { SchedulePagePrivate *priv; @@ -504,7 +509,7 @@ times_changed_cb (GtkWidget *widget, end_dt.tzid = start_dt.tzid; } else { /* For All-Day Events, we set the timezone to NULL, and add - 1 day to DTEND. */ + * 1 day to DTEND. */ start_dt.value->is_date = TRUE; start_dt.tzid = NULL; end_dt.value->is_date = TRUE; diff --git a/calendar/gui/dialogs/select-source-dialog.c b/calendar/gui/dialogs/select-source-dialog.c index 4ae9f0a0d8..6a768e5b7a 100644 --- a/calendar/gui/dialogs/select-source-dialog.c +++ b/calendar/gui/dialogs/select-source-dialog.c @@ -35,7 +35,9 @@ * Implements dialog for allowing user to select a destination source. */ ESource * -select_source_dialog (GtkWindow *parent, ECalClientSourceType obj_type, ESource *except_source) +select_source_dialog (GtkWindow *parent, + ECalClientSourceType obj_type, + ESource *except_source) { GtkWidget *dialog; ESourceList *source_list; @@ -78,7 +80,7 @@ select_source_dialog (GtkWindow *parent, ECalClientSourceType obj_type, ESource gchar *absolute_uri; /* set the absolute URI on the source we keep around, since the group - will be unrefed */ + * will be unrefed */ absolute_uri = e_source_build_absolute_uri (selected_source); e_source_set_absolute_uri (selected_source, (const gchar *) absolute_uri); diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c index bf016403ec..3752db372b 100644 --- a/calendar/gui/dialogs/send-comp.c +++ b/calendar/gui/dialogs/send-comp.c @@ -106,7 +106,8 @@ have_nonprocedural_alarm (ECalComponent *comp) } static GtkWidget * -add_checkbox (GtkBox *where, const gchar *caption) +add_checkbox (GtkBox *where, + const gchar *caption) { GtkWidget *checkbox, *align; @@ -133,7 +134,12 @@ add_checkbox (GtkBox *where, const gchar *caption) * Return value: TRUE if the user clicked Yes, FALSE otherwise. **/ gboolean -send_component_dialog (GtkWindow *parent, ECalClient *client, ECalComponent *comp, gboolean new, gboolean *strip_alarms, gboolean *only_new_attendees) +send_component_dialog (GtkWindow *parent, + ECalClient *client, + ECalComponent *comp, + gboolean new, + gboolean *strip_alarms, + gboolean *only_new_attendees) { ECalComponentVType vtype; const gchar *id; @@ -173,7 +179,7 @@ send_component_dialog (GtkWindow *parent, ECalClient *client, ECalComponent *com if (only_new_attendees && !component_has_new_attendees (comp)) { /* do not show the check if there is no new attendee and - set as all attendees are required to be notified */ + * set as all attendees are required to be notified */ *only_new_attendees = FALSE; /* pretend it as being passed NULL to simplify code below */ @@ -206,7 +212,9 @@ send_component_dialog (GtkWindow *parent, ECalClient *client, ECalComponent *com } gboolean -send_component_prompt_subject (GtkWindow *parent, ECalClient *client, ECalComponent *comp) +send_component_prompt_subject (GtkWindow *parent, + ECalClient *client, + ECalComponent *comp) { ECalComponentVType vtype; const gchar *id; diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index bc828cf431..de30baca77 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -269,7 +269,7 @@ task_details_page_fill_widgets (CompEditorPage *page, icaltimezone *utc_zone, *zone; /* Completed is in UTC, but that would confuse the user, so - we convert it to local time. */ + * we convert it to local time. */ utc_zone = icaltimezone_get_utc_timezone (); zone = comp_editor_get_timezone (editor); @@ -376,11 +376,11 @@ task_details_page_fill_component (CompEditorPage *page, } /* COMPLETED must be in UTC, so we assume that the date in the - dialog is in the current timezone, and we now convert it - to UTC. FIXME: We should really use one timezone for the - entire time the dialog is shown. Otherwise if the user - changes the timezone, the COMPLETED date may get changed - as well. */ + * dialog is in the current timezone, and we now convert it + * to UTC. FIXME: We should really use one timezone for the + * entire time the dialog is shown. Otherwise if the user + * changes the timezone, the COMPLETED date may get changed + * as well. */ icaltimezone_convert_time (&icalcomplete, zone, icaltimezone_get_utc_timezone ()); e_cal_component_set_completed (comp, &icalcomplete); @@ -461,7 +461,7 @@ get_widgets (TaskDetailsPage *tdpage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -499,7 +499,9 @@ get_widgets (TaskDetailsPage *tdpage) } static void -complete_date_changed (TaskDetailsPage *tdpage, time_t ctime, gboolean complete) +complete_date_changed (TaskDetailsPage *tdpage, + time_t ctime, + gboolean complete) { CompEditorPageDates dates = {NULL, NULL, NULL, NULL}; icaltimezone *zone; @@ -573,7 +575,8 @@ date_changed_cb (EDateEdit *dedit, } static void -status_changed (GtkWidget *combo, TaskDetailsPage *tdpage) +status_changed (GtkWidget *combo, + TaskDetailsPage *tdpage) { TaskDetailsPagePrivate *priv; icalproperty_status status; @@ -618,7 +621,8 @@ status_changed (GtkWidget *combo, TaskDetailsPage *tdpage) } static void -percent_complete_changed (GtkAdjustment *adj, TaskDetailsPage *tdpage) +percent_complete_changed (GtkAdjustment *adj, + TaskDetailsPage *tdpage) { TaskDetailsPagePrivate *priv; gint percent; @@ -673,7 +677,7 @@ init_widgets (TaskDetailsPage *tdpage) editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage)); /* Make sure the EDateEdit widgets use our timezones to get the - current time. */ + * current time. */ e_date_edit_set_get_time_callback ( E_DATE_EDIT (priv->completed_date), (EDateEditGetTimeCallback) comp_editor_get_current_time, @@ -689,8 +693,8 @@ init_widgets (TaskDetailsPage *tdpage) priv->url_entry); /* Connect signals. The Status, Percent Complete & Date Completed - properties are closely related so whenever one changes we may need - to update the other 2. */ + * properties are closely related so whenever one changes we may need + * to update the other 2. */ g_signal_connect ( GTK_COMBO_BOX (priv->status_combo), "changed", G_CALLBACK (status_changed), tdpage); diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index ee31eb0a1c..31593e0a04 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -377,7 +377,8 @@ task_editor_init (TaskEditor *te) } static void -task_editor_edit_comp (CompEditor *editor, ECalComponent *comp) +task_editor_edit_comp (CompEditor *editor, + ECalComponent *comp) { TaskEditorPrivate *priv; ECalComponentOrganizer organizer; diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 958eac682b..d88976be75 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -546,14 +546,14 @@ task_page_fill_widgets (CompEditorPage *page, e_date_edit_set_time (E_DATE_EDIT (priv->due_date), -1); /* If no time is set, we use the default timezone, so the - user usually doesn't have to set this when they set the - date. */ + * user usually doesn't have to set this when they set the + * date. */ zone = NULL; } /* Note that if we are creating a new task, the timezones may not be - on the server, so we try to get the builtin timezone with the TZID - first. */ + * on the server, so we try to get the builtin timezone with the TZID + * first. */ if (!zone && d.tzid) { GError *error = NULL; if (!e_cal_client_get_timezone_sync (client, d.tzid, &zone, NULL, &error)) @@ -1018,7 +1018,8 @@ task_page_init (TaskPage *tpage) } void -task_page_set_view_role (TaskPage *page, gboolean state) +task_page_set_view_role (TaskPage *page, + gboolean state) { TaskPagePrivate *priv = page->priv; @@ -1026,7 +1027,8 @@ task_page_set_view_role (TaskPage *page, gboolean state) } void -task_page_set_view_status (TaskPage *page, gboolean state) +task_page_set_view_status (TaskPage *page, + gboolean state) { TaskPagePrivate *priv = page->priv; @@ -1034,7 +1036,8 @@ task_page_set_view_status (TaskPage *page, gboolean state) } void -task_page_set_view_type (TaskPage *page, gboolean state) +task_page_set_view_type (TaskPage *page, + gboolean state) { TaskPagePrivate *priv = page->priv; @@ -1042,7 +1045,8 @@ task_page_set_view_type (TaskPage *page, gboolean state) } void -task_page_set_view_rsvp (TaskPage *page, gboolean state) +task_page_set_view_rsvp (TaskPage *page, + gboolean state) { TaskPagePrivate *priv = page->priv; @@ -1076,7 +1080,8 @@ task_page_show_options (TaskPage *page) } void -task_page_set_assignment (TaskPage *page, gboolean set) +task_page_set_assignment (TaskPage *page, + gboolean set) { g_return_if_fail (IS_TASK_PAGE (page)); @@ -1085,7 +1090,8 @@ task_page_set_assignment (TaskPage *page, gboolean set) } static void -add_clicked_cb (GtkButton *btn, TaskPage *page) +add_clicked_cb (GtkButton *btn, + TaskPage *page) { EMeetingAttendee *attendee; CompEditor *editor; @@ -1120,7 +1126,8 @@ static void edit_clicked_cb (GtkButton *btn, TaskPage *tpage) } static gboolean -existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) +existing_attendee (EMeetingAttendee *ia, + ECalComponent *comp) { GSList *attendees, *l; const gchar *ia_address; @@ -1156,7 +1163,8 @@ existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) } static void -remove_attendee (TaskPage *page, EMeetingAttendee *ia) +remove_attendee (TaskPage *page, + EMeetingAttendee *ia) { TaskPagePrivate *priv = page->priv; CompEditor *editor; @@ -1167,7 +1175,7 @@ remove_attendee (TaskPage *page, EMeetingAttendee *ia) flags = comp_editor_get_flags (editor); /* If the user deletes the organizer attendee explicitly, - assume they no longer want the organizer showing up */ + * assume they no longer want the organizer showing up */ if (ia == priv->ia) { g_object_unref (priv->ia); priv->ia = NULL; @@ -1209,7 +1217,8 @@ remove_attendee (TaskPage *page, EMeetingAttendee *ia) } static void -remove_clicked_cb (GtkButton *btn, TaskPage *page) +remove_clicked_cb (GtkButton *btn, + TaskPage *page) { TaskPagePrivate *priv; EMeetingAttendee *ia; @@ -1231,7 +1240,7 @@ remove_clicked_cb (GtkButton *btn, TaskPage *page) } paths = g_list_reverse (paths); - for (tmp = paths; tmp; tmp=tmp->next) { + for (tmp = paths; tmp; tmp = tmp->next) { path = tmp->data; gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->meeting_store), &iter, path); @@ -1310,8 +1319,10 @@ attendee_added_cb (EMeetingListView *emlv, } static gboolean -list_view_event (EMeetingListView *list_view, GdkEvent *event, TaskPage *page) { - +list_view_event (EMeetingListView *list_view, + GdkEvent *event, + TaskPage *page) +{ TaskPagePrivate *priv= page->priv; CompEditor *editor; CompEditorFlags flags; @@ -1336,7 +1347,9 @@ list_view_event (EMeetingListView *list_view, GdkEvent *event, TaskPage *page) { } static gboolean -list_key_press (EMeetingListView *list_view, GdkEventKey *event, TaskPage *page) +list_key_press (EMeetingListView *list_view, + GdkEventKey *event, + TaskPage *page) { if (event->keyval == GDK_KEY_Delete) { @@ -1353,7 +1366,8 @@ list_key_press (EMeetingListView *list_view, GdkEventKey *event, TaskPage *page) } void -task_page_set_show_timezone (TaskPage *page, gboolean state) +task_page_set_show_timezone (TaskPage *page, + gboolean state) { if (state) { gtk_widget_show_all (page->priv->timezone); @@ -1366,7 +1380,8 @@ task_page_set_show_timezone (TaskPage *page, gboolean state) } void -task_page_set_show_categories (TaskPage *page, gboolean state) +task_page_set_show_categories (TaskPage *page, + gboolean state) { if (state) { gtk_widget_show (page->priv->categories_btn); @@ -1379,7 +1394,9 @@ task_page_set_show_categories (TaskPage *page, gboolean state) /*If the msg has some value set, the icon should always be set */ void -task_page_set_info_string (TaskPage *tpage, const gchar *icon, const gchar *msg) +task_page_set_info_string (TaskPage *tpage, + const gchar *icon, + const gchar *msg) { TaskPagePrivate *priv; @@ -1414,7 +1431,7 @@ get_widgets (TaskPage *tpage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -1585,11 +1602,11 @@ categories_clicked_cb (GtkWidget *button, static gboolean check_start_before_end (struct icaltimetype *start_tt, - icaltimezone *start_zone, - struct icaltimetype *end_tt, - icaltimezone *end_zone, - gboolean adjust_end_time, - gboolean adjust_by_hour) + icaltimezone *start_zone, + struct icaltimetype *end_tt, + icaltimezone *end_zone, + gboolean adjust_end_time, + gboolean adjust_by_hour) { struct icaltimetype end_tt_copy; gint cmp; @@ -1599,7 +1616,7 @@ check_start_before_end (struct icaltimetype *start_tt, icaltimezone_convert_time (&end_tt_copy, end_zone, start_zone); /* Now check if the start time is after the end time. If it is, - we need to modify one of the times. */ + * we need to modify one of the times. */ cmp = icaltime_compare (*start_tt, end_tt_copy); if (cmp > 0) { if (adjust_end_time) { @@ -1634,7 +1651,8 @@ check_start_before_end (struct icaltimetype *start_tt, * otherwise times will differ one hour. */ static void -times_updated (TaskPage *tpage, gboolean adjust_end_time) +times_updated (TaskPage *tpage, + gboolean adjust_end_time) { TaskPagePrivate *priv; struct icaltimetype start_tt = icaltime_null_time (); @@ -1704,7 +1722,9 @@ due_date_changed_cb (TaskPage *tpage) } static void -tpage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +tpage_client_opened_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ESource *source = E_SOURCE (source_object); EClient *client = NULL; @@ -1775,7 +1795,8 @@ tpage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer u } static void -source_changed_cb (ESourceComboBox *source_combo_box, TaskPage *tpage) +source_changed_cb (ESourceComboBox *source_combo_box, + TaskPage *tpage) { TaskPagePrivate *priv = tpage->priv; ESource *source; @@ -1791,13 +1812,16 @@ source_changed_cb (ESourceComboBox *source_combo_box, TaskPage *tpage) } priv->open_cancellable = g_cancellable_new (); - e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_TASKS, FALSE, priv->open_cancellable, - e_client_utils_authenticate_handler, NULL, - tpage_client_opened_cb, tpage); + e_client_utils_open_new ( + source, E_CLIENT_SOURCE_TYPE_TASKS, + FALSE, priv->open_cancellable, + e_client_utils_authenticate_handler, NULL, + tpage_client_opened_cb, tpage); } static void -set_subscriber_info_string (TaskPage *tpage, const gchar *backend_address) +set_subscriber_info_string (TaskPage *tpage, + const gchar *backend_address) { CompEditor *editor; ECalClient *client; @@ -1810,7 +1834,7 @@ set_subscriber_info_string (TaskPage *tpage, const gchar *backend_address) if (e_source_get_property (source, "subscriber")) { g_free (tpage->priv->subscriber_info_text); /* Translators: This string is used when we are creating a Task - on behalf of some other user */ + * on behalf of some other user */ tpage->priv->subscriber_info_text = g_markup_printf_escaped (_("You are acting on behalf of %s"), backend_address); } else { g_free (tpage->priv->subscriber_info_text); @@ -1865,7 +1889,7 @@ init_widgets (TaskPage *tpage) editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage)); /* Make sure the EDateEdit widgets use our timezones to get the - current time. */ + * current time. */ e_date_edit_set_get_time_callback ( E_DATE_EDIT (priv->start_date), (EDateEditGetTimeCallback) comp_editor_get_current_time, @@ -1881,7 +1905,7 @@ init_widgets (TaskPage *tpage) gtk_widget_hide (priv->info_hbox); /* Summary */ - g_signal_connect((priv->summary), "changed", + g_signal_connect ((priv->summary), "changed", G_CALLBACK (summary_changed_cb), tpage); /* Description */ @@ -1892,23 +1916,23 @@ init_widgets (TaskPage *tpage) e_buffer_tagger_connect (GTK_TEXT_VIEW (priv->description)); /* Dates */ - g_signal_connect((priv->start_date), "changed", + g_signal_connect ((priv->start_date), "changed", G_CALLBACK (date_changed_cb), tpage); - g_signal_connect((priv->due_date), "changed", + g_signal_connect ((priv->due_date), "changed", G_CALLBACK (date_changed_cb), tpage); /* time zone changed */ g_signal_connect (priv->timezone, "changed", G_CALLBACK(timezone_changed_cb), tpage); /* Categories button */ - g_signal_connect((priv->categories_btn), "clicked", + g_signal_connect ((priv->categories_btn), "clicked", G_CALLBACK (categories_clicked_cb), tpage); /* Source selector */ g_signal_connect (priv->source_selector, "changed", G_CALLBACK (source_changed_cb), tpage); /* Connect the default signal handler to use to make sure the "changed" - field gets set whenever a field is changed. */ + * field gets set whenever a field is changed. */ /* Belongs to priv->description */ g_signal_connect_swapped ( @@ -1953,7 +1977,7 @@ init_widgets (TaskPage *tpage) g_signal_connect (priv->remove, "clicked", G_CALLBACK (remove_clicked_cb), tpage); /* Contacts button */ - g_signal_connect(priv->invite, "clicked", G_CALLBACK (invite_cb), tpage); + g_signal_connect (priv->invite, "clicked", G_CALLBACK (invite_cb), tpage); /* Meeting List View */ g_signal_connect (priv->list_view, "attendee_added", G_CALLBACK (attendee_added_cb), tpage); @@ -1999,7 +2023,8 @@ init_widgets (TaskPage *tpage) static void -task_page_select_organizer (TaskPage *tpage, const gchar *backend_address) +task_page_select_organizer (TaskPage *tpage, + const gchar *backend_address) { TaskPagePrivate *priv = tpage->priv; CompEditor *editor; @@ -2117,7 +2142,8 @@ task_page_construct (TaskPage *tpage, * not be created. **/ TaskPage * -task_page_new (EMeetingStore *model, CompEditor *editor) +task_page_new (EMeetingStore *model, + CompEditor *editor) { TaskPage *tpage; ECalClient *client; diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c index 3a1efc3333..35c3484c13 100644 --- a/calendar/gui/e-alarm-list.c +++ b/calendar/gui/e-alarm-list.c @@ -176,7 +176,8 @@ all_rows_deleted (EAlarmList *alarm_list) } static void -row_deleted (EAlarmList *alarm_list, gint n) +row_deleted (EAlarmList *alarm_list, + gint n) { GtkTreePath *path; @@ -187,7 +188,8 @@ row_deleted (EAlarmList *alarm_list, gint n) } static void -row_added (EAlarmList *alarm_list, gint n) +row_added (EAlarmList *alarm_list, + gint n) { GtkTreePath *path; GtkTreeIter iter; @@ -202,7 +204,8 @@ row_added (EAlarmList *alarm_list, gint n) } static void -row_updated (EAlarmList *alarm_list, gint n) +row_updated (EAlarmList *alarm_list, + gint n) { GtkTreePath *path; GtkTreeIter iter; @@ -238,7 +241,7 @@ e_alarm_list_get_n_columns (GtkTreeModel *tree_model) static GType e_alarm_list_get_column_type (GtkTreeModel *tree_model, - gint index) + gint index) { EAlarmList *alarm_list = (EAlarmList *) tree_model; @@ -251,7 +254,8 @@ e_alarm_list_get_column_type (GtkTreeModel *tree_model, } const ECalComponentAlarm * -e_alarm_list_get_alarm (EAlarmList *alarm_list, GtkTreeIter *iter) +e_alarm_list_get_alarm (EAlarmList *alarm_list, + GtkTreeIter *iter) { g_return_val_if_fail (IS_VALID_ITER (alarm_list, iter), NULL); @@ -271,8 +275,9 @@ copy_alarm (const ECalComponentAlarm *alarm) } void -e_alarm_list_set_alarm (EAlarmList *alarm_list, GtkTreeIter *iter, - const ECalComponentAlarm *alarm) +e_alarm_list_set_alarm (EAlarmList *alarm_list, + GtkTreeIter *iter, + const ECalComponentAlarm *alarm) { ECalComponentAlarm *alarm_old; @@ -285,8 +290,9 @@ e_alarm_list_set_alarm (EAlarmList *alarm_list, GtkTreeIter *iter, } void -e_alarm_list_append (EAlarmList *alarm_list, GtkTreeIter *iter, - const ECalComponentAlarm *alarm) +e_alarm_list_append (EAlarmList *alarm_list, + GtkTreeIter *iter, + const ECalComponentAlarm *alarm) { g_return_if_fail (alarm != NULL); @@ -300,7 +306,8 @@ e_alarm_list_append (EAlarmList *alarm_list, GtkTreeIter *iter, } void -e_alarm_list_remove (EAlarmList *alarm_list, GtkTreeIter *iter) +e_alarm_list_remove (EAlarmList *alarm_list, + GtkTreeIter *iter) { gint n; @@ -328,7 +335,9 @@ e_alarm_list_clear (EAlarmList *alarm_list) } static gboolean -e_alarm_list_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path) +e_alarm_list_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path) { EAlarmList *alarm_list = (EAlarmList *) tree_model; GList *l; @@ -354,7 +363,7 @@ e_alarm_list_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath static GtkTreePath * e_alarm_list_get_path (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { EAlarmList *alarm_list = (EAlarmList *) tree_model; GtkTreePath *retval; @@ -539,9 +548,9 @@ get_alarm_string (ECalComponentAlarm *alarm) static void e_alarm_list_get_value (GtkTreeModel *tree_model, - GtkTreeIter *iter, - gint column, - GValue *value) + GtkTreeIter *iter, + gint column, + GValue *value) { EAlarmList *alarm_list = E_ALARM_LIST (tree_model); ECalComponentAlarm *alarm; @@ -574,8 +583,8 @@ e_alarm_list_get_value (GtkTreeModel *tree_model, } static gboolean -e_alarm_list_iter_next (GtkTreeModel *tree_model, - GtkTreeIter *iter) +e_alarm_list_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter) { GList *l; @@ -597,8 +606,8 @@ e_alarm_list_iter_next (GtkTreeModel *tree_model, static gboolean e_alarm_list_iter_children (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent) + GtkTreeIter *iter, + GtkTreeIter *parent) { EAlarmList *alarm_list = E_ALARM_LIST (tree_model); @@ -619,7 +628,7 @@ e_alarm_list_iter_children (GtkTreeModel *tree_model, static gboolean e_alarm_list_iter_has_child (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { g_return_val_if_fail (IS_VALID_ITER (E_ALARM_LIST (tree_model), iter), FALSE); return FALSE; @@ -627,7 +636,7 @@ e_alarm_list_iter_has_child (GtkTreeModel *tree_model, static gint e_alarm_list_iter_n_children (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { EAlarmList *alarm_list = E_ALARM_LIST (tree_model); @@ -642,9 +651,9 @@ e_alarm_list_iter_n_children (GtkTreeModel *tree_model, static gboolean e_alarm_list_iter_nth_child (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent, - gint n) + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n) { EAlarmList *alarm_list = E_ALARM_LIST (tree_model); @@ -670,8 +679,8 @@ e_alarm_list_iter_nth_child (GtkTreeModel *tree_model, static gboolean e_alarm_list_iter_parent (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *child) + GtkTreeIter *iter, + GtkTreeIter *child) { return FALSE; } diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index f5b8322fa7..ec4f817042 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -40,7 +40,7 @@ struct _ECalComponentPreviewPrivate { /* information about currently showing component in a preview; - if it didn't change then the preview is not updated */ + * if it didn't change then the preview is not updated */ gchar *cal_uid; gchar *comp_uid; struct icaltimetype comp_last_modified; @@ -67,7 +67,7 @@ clear_comp_info (ECalComponentPreview *preview) } /* Stores information about actually shown component and - returns whether component in the preview changed */ + * returns whether component in the preview changed */ static gboolean update_comp_info (ECalComponentPreview *preview, ECalClient *client, @@ -457,7 +457,7 @@ e_cal_component_preview_display (ECalComponentPreview *preview, g_return_if_fail (E_IS_CAL_COMPONENT (comp)); /* do not update preview when setting the same component as last time, - which even didn't change */ + * which even didn't change */ if (!update_comp_info (preview, client, comp)) return; diff --git a/calendar/gui/e-cal-config.c b/calendar/gui/e-cal-config.c index 804af17e91..8269a1067e 100644 --- a/calendar/gui/e-cal-config.c +++ b/calendar/gui/e-cal-config.c @@ -41,7 +41,8 @@ ecp_init (ECalConfig *cfg) } static void -ecp_target_free (EConfig *ec, EConfigTarget *t) +ecp_target_free (EConfig *ec, + EConfigTarget *t) { struct _ECalConfigPrivate *p = E_CAL_CONFIG (ec)->priv; @@ -78,13 +79,15 @@ ecp_target_free (EConfig *ec, EConfigTarget *t) } static void -ecp_source_changed (struct _ESource *source, EConfig *ec) +ecp_source_changed (ESource *source, + EConfig *ec) { e_config_target_changed (ec, E_CONFIG_TARGET_CHANGED_STATE); } static void -ecp_set_target (EConfig *ec, EConfigTarget *t) +ecp_set_target (EConfig *ec, + EConfigTarget *t) { struct _ECalConfigPrivate *p = E_CAL_CONFIG (ec)->priv; @@ -139,7 +142,8 @@ e_cal_config_get_type (void) } ECalConfig * -e_cal_config_new (gint type, const gchar *menuid) +e_cal_config_new (gint type, + const gchar *menuid) { ECalConfig *ecp = g_object_new (e_cal_config_get_type (), NULL); e_config_construct (&ecp->config, type, menuid); @@ -147,7 +151,8 @@ e_cal_config_new (gint type, const gchar *menuid) } ECalConfigTargetSource * -e_cal_config_target_new_source (ECalConfig *ecp, ESource *source) +e_cal_config_target_new_source (ECalConfig *ecp, + ESource *source) { ECalConfigTargetSource *t; diff --git a/calendar/gui/e-cal-config.h b/calendar/gui/e-cal-config.h index f803e99285..582bdf6a53 100644 --- a/calendar/gui/e-cal-config.h +++ b/calendar/gui/e-cal-config.h @@ -73,7 +73,7 @@ typedef struct _ECalConfigTargetPrefs ECalConfigTargetPrefs; struct _ECalConfigTargetSource { EConfigTarget target; - struct _ESource *source; + ESource *source; ECalClientSourceType source_type; }; diff --git a/calendar/gui/e-cal-event.c b/calendar/gui/e-cal-event.c index af84e9e865..176e2923b3 100644 --- a/calendar/gui/e-cal-event.c +++ b/calendar/gui/e-cal-event.c @@ -40,7 +40,8 @@ ece_finalize (GObject *o) } static void -ece_target_free (EEvent *ev, EEventTarget *t) +ece_target_free (EEvent *ev, + EEventTarget *t) { switch (t->type) { case E_CAL_EVENT_TARGET_BACKEND: { diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c index c287b7a6ca..48458e6123 100644 --- a/calendar/gui/e-cal-list-view.c +++ b/calendar/gui/e-cal-list-view.c @@ -109,7 +109,8 @@ e_cal_list_view_init (ECalListView *cal_list_view) /* Returns the current time, for the ECellDateEdit items. */ static struct tm -get_current_time_cb (ECellDateEdit *ecde, gpointer data) +get_current_time_cb (ECellDateEdit *ecde, + gpointer data) { ECalListView *cal_list_view = data; icaltimezone *zone; @@ -132,7 +133,8 @@ get_current_time_cb (ECellDateEdit *ecde, gpointer data) } void -e_cal_list_view_load_state (ECalListView *cal_list_view, gchar *filename) +e_cal_list_view_load_state (ECalListView *cal_list_view, + gchar *filename) { struct stat st; @@ -145,7 +147,8 @@ e_cal_list_view_load_state (ECalListView *cal_list_view, gchar *filename) } void -e_cal_list_view_save_state (ECalListView *cal_list_view, gchar *filename) +e_cal_list_view_save_state (ECalListView *cal_list_view, + gchar *filename) { g_return_if_fail (cal_list_view != NULL); g_return_if_fail (E_IS_CAL_LIST_VIEW (cal_list_view)); @@ -176,7 +179,7 @@ setup_e_table (ECalListView *cal_list_view) /* Normal string fields */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); @@ -186,7 +189,7 @@ setup_e_table (ECalListView *cal_list_view) /* Date fields */ cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); @@ -225,7 +228,7 @@ setup_e_table (ECalListView *cal_list_view) /* Combo fields */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, "editable", FALSE, NULL); @@ -366,8 +369,11 @@ e_cal_list_view_popup_menu (GtkWidget *widget) } static gboolean -e_cal_list_view_on_table_double_click (GtkWidget *table, gint row, gint col, GdkEvent *event, - gpointer data) +e_cal_list_view_on_table_double_click (GtkWidget *table, + gint row, + gint col, + GdkEvent *event, + gpointer data) { ECalListView *cal_list_view = E_CAL_LIST_VIEW (data); ECalModelComponent *comp_data; @@ -379,8 +385,11 @@ e_cal_list_view_on_table_double_click (GtkWidget *table, gint row, gint col, Gdk } static gboolean -e_cal_list_view_on_table_right_click (GtkWidget *table, gint row, gint col, GdkEvent *event, - gpointer data) +e_cal_list_view_on_table_right_click (GtkWidget *table, + gint row, + gint col, + GdkEvent *event, + gpointer data) { ECalListView *cal_list_view = E_CAL_LIST_VIEW (data); @@ -389,7 +398,9 @@ e_cal_list_view_on_table_right_click (GtkWidget *table, gint row, gint col, GdkE } static void -e_cal_list_view_cursor_change_cb (ETable *etable, gint row, gpointer data) +e_cal_list_view_cursor_change_cb (ETable *etable, + gint row, + gpointer data) { ECalListView *cal_list_view = E_CAL_LIST_VIEW (data); @@ -397,7 +408,9 @@ e_cal_list_view_cursor_change_cb (ETable *etable, gint row, gpointer data) } static gboolean -e_cal_list_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time) +e_cal_list_view_get_selected_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { GList *selected; icaltimezone *zone; @@ -471,7 +484,10 @@ e_cal_list_view_get_selected_events (ECalendarView *cal_view) } static void -adjust_range (icaltimetype icaltime, time_t *earliest, time_t *latest, gboolean *set) +adjust_range (icaltimetype icaltime, + time_t *earliest, + time_t *latest, + gboolean *set) { time_t t; @@ -485,11 +501,13 @@ adjust_range (icaltimetype icaltime, time_t *earliest, time_t *latest, gboolean *set = TRUE; } -/* NOTE: Time use for this function increases linearly with number of events. This is not - * ideal, since it's used in a couple of places. We could probably be smarter about it, - * and use do it less frequently... */ +/* NOTE: Time use for this function increases linearly with number of events. + * This is not ideal, since it's used in a couple of places. We could probably + * be smarter about it, and use do it less frequently... */ static gboolean -e_cal_list_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time) +e_cal_list_view_get_visible_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { time_t earliest = G_MAXINT, latest = 0; gboolean set = FALSE; @@ -532,7 +550,9 @@ e_cal_list_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_t } gboolean -e_cal_list_view_get_range_shown (ECalListView *cal_list_view, GDate *start_date, gint *days_shown) +e_cal_list_view_get_range_shown (ECalListView *cal_list_view, + GDate *start_date, + gint *days_shown) { time_t first, last; GDate end_date; diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index ea8dd7bba7..1254a8711b 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -114,7 +114,8 @@ ecmc_column_count (ETableModel *etm) } static ECellDateEditValue * -get_dtend (ECalModelCalendar *model, ECalModelComponent *comp_data) +get_dtend (ECalModelCalendar *model, + ECalModelComponent *comp_data) { struct icaltimetype tt_end; @@ -194,7 +195,9 @@ get_transparency (ECalModelComponent *comp_data) } static gpointer -ecmc_value_at (ETableModel *etm, gint col, gint row) +ecmc_value_at (ETableModel *etm, + gint col, + gint row) { ECalModelComponent *comp_data; ECalModelCalendar *model = (ECalModelCalendar *) etm; @@ -224,13 +227,16 @@ ecmc_value_at (ETableModel *etm, gint col, gint row) } static void -set_dtend (ECalModel* model, ECalModelComponent *comp_data, gconstpointer value) +set_dtend (ECalModel *model, + ECalModelComponent *comp_data, + gconstpointer value) { e_cal_model_update_comp_time (model, comp_data, value, ICAL_DTEND_PROPERTY, icalproperty_set_dtend, icalproperty_new_dtend); } static void -set_location (ECalModelComponent *comp_data, gconstpointer value) +set_location (ECalModelComponent *comp_data, + gconstpointer value) { icalproperty *prop; @@ -252,7 +258,8 @@ set_location (ECalModelComponent *comp_data, gconstpointer value) } static void -set_transparency (ECalModelComponent *comp_data, gconstpointer value) +set_transparency (ECalModelComponent *comp_data, + gconstpointer value) { icalproperty *prop; @@ -289,7 +296,10 @@ set_transparency (ECalModelComponent *comp_data, gconstpointer value) } static void -ecmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) +ecmc_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer value) { ECalModelComponent *comp_data; CalObjModType mod = CALOBJ_MOD_ALL; @@ -377,7 +387,9 @@ ecmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) } static gboolean -ecmc_is_cell_editable (ETableModel *etm, gint col, gint row) +ecmc_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ECalModelCalendar *model = (ECalModelCalendar *) etm; @@ -402,7 +414,9 @@ ecmc_is_cell_editable (ETableModel *etm, gint col, gint row) } static gpointer -ecmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +ecmc_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL); @@ -430,7 +444,9 @@ ecmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -ecmc_free_value (ETableModel *etm, gint col, gpointer value) +ecmc_free_value (ETableModel *etm, + gint col, + gpointer value) { g_return_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST); @@ -450,7 +466,8 @@ ecmc_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -ecmc_initialize_value (ETableModel *etm, gint col) +ecmc_initialize_value (ETableModel *etm, + gint col) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL); @@ -469,7 +486,9 @@ ecmc_initialize_value (ETableModel *etm, gint col) } static gboolean -ecmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +ecmc_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, TRUE); @@ -488,7 +507,9 @@ ecmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -ecmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) +ecmc_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, g_strdup ("")); @@ -509,8 +530,10 @@ ecmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) /* ECalModel class methods */ static void -ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, - ETableModel *source_model, gint row) +ecmc_fill_component_from_model (ECalModel *model, + ECalModelComponent *comp_data, + ETableModel *source_model, + gint row) { g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model)); g_return_if_fail (comp_data != NULL); diff --git a/calendar/gui/e-cal-model-calendar.h b/calendar/gui/e-cal-model-calendar.h index 6e3b3fe617..f29d7d413d 100644 --- a/calendar/gui/e-cal-model-calendar.h +++ b/calendar/gui/e-cal-model-calendar.h @@ -55,7 +55,7 @@ typedef struct _ECalModelCalendarPrivate ECalModelCalendarPrivate; typedef enum { /* If you add new items here or reorder them, you have to update the - .etspec files for the tables using this model */ + * .etspec files for the tables using this model */ E_CAL_MODEL_CALENDAR_FIELD_DTEND = E_CAL_MODEL_FIELD_LAST, E_CAL_MODEL_CALENDAR_FIELD_LOCATION, E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, diff --git a/calendar/gui/e-cal-model-memos.c b/calendar/gui/e-cal-model-memos.c index 59a48d031c..261cdda058 100644 --- a/calendar/gui/e-cal-model-memos.c +++ b/calendar/gui/e-cal-model-memos.c @@ -115,7 +115,9 @@ ecmm_column_count (ETableModel *etm) } static gpointer -ecmm_value_at (ETableModel *etm, gint col, gint row) +ecmm_value_at (ETableModel *etm, + gint col, + gint row) { ECalModelComponent *comp_data; ECalModelMemos *model = (ECalModelMemos *) etm; @@ -136,7 +138,10 @@ ecmm_value_at (ETableModel *etm, gint col, gint row) } static void -ecmm_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) +ecmm_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer value) { ECalModelComponent *comp_data; ECalModelMemos *model = (ECalModelMemos *) etm; @@ -168,7 +173,9 @@ ecmm_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) } static gboolean -ecmm_is_cell_editable (ETableModel *etm, gint col, gint row) +ecmm_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ECalModelMemos *model = (ECalModelMemos *) etm; gboolean retval = FALSE; @@ -187,7 +194,9 @@ ecmm_is_cell_editable (ETableModel *etm, gint col, gint row) } static gpointer -ecmm_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +ecmm_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST, NULL); @@ -198,7 +207,9 @@ ecmm_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -ecmm_free_value (ETableModel *etm, gint col, gpointer value) +ecmm_free_value (ETableModel *etm, + gint col, + gpointer value) { g_return_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST); @@ -209,7 +220,8 @@ ecmm_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -ecmm_initialize_value (ETableModel *etm, gint col) +ecmm_initialize_value (ETableModel *etm, + gint col) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST, NULL); @@ -220,7 +232,9 @@ ecmm_initialize_value (ETableModel *etm, gint col) } static gboolean -ecmm_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +ecmm_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST, TRUE); @@ -231,7 +245,9 @@ ecmm_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -ecmm_value_to_string (ETableModel *etm, gint col, gconstpointer value) +ecmm_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST, g_strdup ("")); @@ -244,8 +260,10 @@ ecmm_value_to_string (ETableModel *etm, gint col, gconstpointer value) /* ECalModel class methods */ static void -ecmm_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, - ETableModel *source_model, gint row) +ecmm_fill_component_from_model (ECalModel *model, + ECalModelComponent *comp_data, + ETableModel *source_model, + gint row) { icaltimetype start; g_return_if_fail (E_IS_CAL_MODEL_MEMOS (model)); diff --git a/calendar/gui/e-cal-model-memos.h b/calendar/gui/e-cal-model-memos.h index 3977bbe0cb..2be1e4d97c 100644 --- a/calendar/gui/e-cal-model-memos.h +++ b/calendar/gui/e-cal-model-memos.h @@ -56,7 +56,7 @@ typedef struct _ECalModelMemosPrivate ECalModelMemosPrivate; typedef enum { /* If you add new items here or reorder them, you have to update the - .etspec files for the tables using this model */ + * .etspec files for the tables using this model */ E_CAL_MODEL_MEMOS_FIELD_LAST = E_CAL_MODEL_FIELD_LAST } ECalModelMemoField; diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index 51811c783f..8602ce58cf 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -195,13 +195,14 @@ ecmt_column_count (ETableModel *etm) } /* This makes sure a task is marked as complete. - It makes sure the "Date Completed" property is set. If the completed_date - is not -1, then that is used, otherwise if the "Date Completed" property - is not already set it is set to the current time. - It makes sure the percent is set to 100, and that the status is "Completed". - Note that this doesn't update the component on the server. */ + * It makes sure the "Date Completed" property is set. If the completed_date + * is not -1, then that is used, otherwise if the "Date Completed" property + * is not already set it is set to the current time. + * It makes sure the percent is set to 100, and that the status is "Completed". + * Note that this doesn't update the component on the server. */ static void -ensure_task_complete (ECalModelComponent *comp_data, time_t completed_date) +ensure_task_complete (ECalModelComponent *comp_data, + time_t completed_date) { icalproperty *prop; gboolean set_completed = TRUE; @@ -276,9 +277,9 @@ ensure_task_partially_complete (ECalModelComponent *comp_data) } /* This makes sure a task is marked as incomplete. It clears the - "Date Completed" property. If the percent is set to 100 it removes it, - and if the status is "Completed" it sets it to "Needs Action". - Note that this doesn't update the component on the client. */ + * "Date Completed" property. If the percent is set to 100 it removes it, + * and if the status is "Completed" it sets it to "Needs Action". + * Note that this doesn't update the component on the client. */ static void ensure_task_not_complete (ECalModelComponent *comp_data) { @@ -486,7 +487,8 @@ typedef enum { } ECalModelTasksDueStatus; static ECalModelTasksDueStatus -get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data) +get_due_status (ECalModelTasks *model, + ECalModelComponent *comp_data) { icalproperty *prop; @@ -542,7 +544,8 @@ get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data) } static gboolean -is_overdue (ECalModelTasks *model, ECalModelComponent *comp_data) +is_overdue (ECalModelTasks *model, + ECalModelComponent *comp_data) { switch (get_due_status (model, comp_data)) { case E_CAL_MODEL_TASKS_DUE_NEVER: @@ -558,7 +561,9 @@ is_overdue (ECalModelTasks *model, ECalModelComponent *comp_data) } static gpointer -ecmt_value_at (ETableModel *etm, gint col, gint row) +ecmt_value_at (ETableModel *etm, + gint col, + gint row) { ECalModelComponent *comp_data; ECalModelTasks *model = (ECalModelTasks *) etm; @@ -602,7 +607,9 @@ ecmt_value_at (ETableModel *etm, gint col, gint row) } static void -set_completed (ECalModelTasks *model, ECalModelComponent *comp_data, gconstpointer value) +set_completed (ECalModelTasks *model, + ECalModelComponent *comp_data, + gconstpointer value) { ECellDateEditValue *dv = (ECellDateEditValue *) value; @@ -613,12 +620,12 @@ set_completed (ECalModelTasks *model, ECalModelComponent *comp_data, gconstpoint if (dv->tt.is_date) { /* if it's a date, it will be floating, - but completed needs a date time value */ + * but completed needs a date time value */ dv->tt.is_date = FALSE; t = icaltime_as_timet_with_zone (dv->tt, e_cal_model_get_timezone (E_CAL_MODEL (model))); } else { /* we assume that COMPLETED is entered in the current timezone, - even though it gets stored in UTC */ + * even though it gets stored in UTC */ t = icaltime_as_timet_with_zone (dv->tt, dv->zone); } @@ -627,7 +634,8 @@ set_completed (ECalModelTasks *model, ECalModelComponent *comp_data, gconstpoint } static void -set_complete (ECalModelComponent *comp_data, gconstpointer value) +set_complete (ECalModelComponent *comp_data, + gconstpointer value) { gint state = GPOINTER_TO_INT (value); @@ -638,7 +646,9 @@ set_complete (ECalModelComponent *comp_data, gconstpointer value) } static void -set_due (ECalModel* model, ECalModelComponent *comp_data, gconstpointer value) +set_due (ECalModel *model, + ECalModelComponent *comp_data, + gconstpointer value) { e_cal_model_update_comp_time (model, comp_data, value, ICAL_DUE_PROPERTY, icalproperty_set_due, icalproperty_new_due); } @@ -658,7 +668,8 @@ show_geo_warning (void) } static void -set_geo (ECalModelComponent *comp_data, const gchar *value) +set_geo (ECalModelComponent *comp_data, + const gchar *value) { gdouble latitude, longitude; gint matched; @@ -690,7 +701,8 @@ set_geo (ECalModelComponent *comp_data, const gchar *value) } static void -set_status (ECalModelComponent *comp_data, const gchar *value) +set_status (ECalModelComponent *comp_data, + const gchar *value) { icalproperty_status status; icalproperty *prop; @@ -748,7 +760,8 @@ set_status (ECalModelComponent *comp_data, const gchar *value) } static void -set_percent (ECalModelComponent *comp_data, gconstpointer value) +set_percent (ECalModelComponent *comp_data, + gconstpointer value) { icalproperty *prop; gint percent = GPOINTER_TO_INT (value); @@ -790,7 +803,8 @@ set_percent (ECalModelComponent *comp_data, gconstpointer value) } static void -set_priority (ECalModelComponent *comp_data, const gchar *value) +set_priority (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; gint priority; @@ -812,7 +826,8 @@ set_priority (ECalModelComponent *comp_data, const gchar *value) } static void -set_url (ECalModelComponent *comp_data, const gchar *value) +set_url (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; @@ -834,7 +849,10 @@ set_url (ECalModelComponent *comp_data, const gchar *value) } static void -ecmt_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) +ecmt_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer value) { ECalModelComponent *comp_data; ECalModelTasks *model = (ECalModelTasks *) etm; @@ -861,7 +879,7 @@ ecmt_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) set_complete (comp_data, value); break; case E_CAL_MODEL_TASKS_FIELD_DUE : - set_due ((ECalModel*) model, comp_data, value); + set_due ((ECalModel *) model, comp_data, value); break; case E_CAL_MODEL_TASKS_FIELD_GEO : set_geo (comp_data, value); @@ -884,7 +902,9 @@ ecmt_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) } static gboolean -ecmt_is_cell_editable (ETableModel *etm, gint col, gint row) +ecmt_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ECalModelTasks *model = (ECalModelTasks *) etm; @@ -915,7 +935,9 @@ ecmt_is_cell_editable (ETableModel *etm, gint col, gint row) } static gpointer -ecmt_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +ecmt_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, NULL); @@ -951,7 +973,9 @@ ecmt_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -ecmt_free_value (ETableModel *etm, gint col, gpointer value) +ecmt_free_value (ETableModel *etm, + gint col, + gpointer value) { g_return_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST); @@ -978,7 +1002,8 @@ ecmt_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -ecmt_initialize_value (ETableModel *etm, gint col) +ecmt_initialize_value (ETableModel *etm, + gint col) { ECalModelTasks *model = (ECalModelTasks *) etm; @@ -1007,7 +1032,9 @@ ecmt_initialize_value (ETableModel *etm, gint col) } static gboolean -ecmt_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +ecmt_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ECalModelTasks *model = (ECalModelTasks *) etm; @@ -1037,7 +1064,9 @@ ecmt_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -ecmt_value_to_string (ETableModel *etm, gint col, gconstpointer value) +ecmt_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ECalModelTasks *model = (ECalModelTasks *) etm; @@ -1099,8 +1128,10 @@ ecmt_get_color_for_component (ECalModel *model, } static void -ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, - ETableModel *source_model, gint row) +ecmt_fill_component_from_model (ECalModel *model, + ECalModelComponent *comp_data, + ETableModel *source_model, + gint row) { gpointer value; diff --git a/calendar/gui/e-cal-model-tasks.h b/calendar/gui/e-cal-model-tasks.h index c0ceaaa2c5..f35f8dd28c 100644 --- a/calendar/gui/e-cal-model-tasks.h +++ b/calendar/gui/e-cal-model-tasks.h @@ -55,7 +55,7 @@ typedef struct _ECalModelTasksPrivate ECalModelTasksPrivate; typedef enum { /* If you add new items here or reorder them, you have to update the - .etspec files for the tables using this model */ + * .etspec files for the tables using this model */ E_CAL_MODEL_TASKS_FIELD_COMPLETED = E_CAL_MODEL_FIELD_LAST, E_CAL_MODEL_TASKS_FIELD_COMPLETE, E_CAL_MODEL_TASKS_FIELD_DUE, diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 7a00fdb7dd..9bb8235d6e 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -778,7 +778,8 @@ get_classification (ECalModelComponent *comp_data) } static const gchar * -get_color (ECalModel *model, ECalModelComponent *comp_data) +get_color (ECalModel *model, + ECalModelComponent *comp_data) { g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL); @@ -809,8 +810,9 @@ get_description (ECalModelComponent *comp_data) return (gpointer) ""; } -static ECellDateEditValue* -get_dtstart (ECalModel *model, ECalModelComponent *comp_data) +static ECellDateEditValue * +get_dtstart (ECalModel *model, + ECalModelComponent *comp_data) { ECalModelPrivate *priv; struct icaltimetype tt_start; @@ -857,8 +859,12 @@ get_dtstart (ECalModel *model, ECalModelComponent *comp_data) return comp_data->dtstart; } -static ECellDateEditValue* -get_datetime_from_utc (ECalModel *model, ECalModelComponent *comp_data, icalproperty_kind propkind, struct icaltimetype (*get_value)(const icalproperty* prop), ECellDateEditValue **buffer) +static ECellDateEditValue * +get_datetime_from_utc (ECalModel *model, + ECalModelComponent *comp_data, + icalproperty_kind propkind, + struct icaltimetype (*get_value) (const icalproperty *prop), + ECellDateEditValue **buffer) { ECalModelPrivate *priv; struct icaltimetype tt_value; @@ -913,7 +919,9 @@ get_uid (ECalModelComponent *comp_data) } static gpointer -ecm_value_at (ETableModel *etm, gint col, gint row) +ecm_value_at (ETableModel *etm, + gint col, + gint row) { ECalModelPrivate *priv; ECalModelComponent *comp_data; @@ -1005,7 +1013,8 @@ ecm_value_at (ETableModel *etm, gint col, gint row) } static void -set_categories (ECalModelComponent *comp_data, const gchar *value) +set_categories (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; @@ -1025,7 +1034,8 @@ set_categories (ECalModelComponent *comp_data, const gchar *value) } static void -set_classification (ECalModelComponent *comp_data, const gchar *value) +set_classification (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; @@ -1056,7 +1066,8 @@ set_classification (ECalModelComponent *comp_data, const gchar *value) } static void -set_description (ECalModelComponent *comp_data, const gchar *value) +set_description (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; @@ -1082,7 +1093,10 @@ set_description (ECalModelComponent *comp_data, const gchar *value) } static void -datetime_to_zone (ECalClient *client, struct icaltimetype *tt, icaltimezone *tt_zone, const gchar *tzid) +datetime_to_zone (ECalClient *client, + struct icaltimetype *tt, + icaltimezone *tt_zone, + const gchar *tzid) { icaltimezone *from, *to; const gchar *tt_tzid = NULL; @@ -1108,7 +1122,13 @@ datetime_to_zone (ECalClient *client, struct icaltimetype *tt, icaltimezone *tt_ /* updates time in a component, and keeps the timezone used in it, if exists */ void -e_cal_model_update_comp_time (ECalModel *model, ECalModelComponent *comp_data, gconstpointer time_value, icalproperty_kind kind, void (*set_func)(icalproperty *prop, struct icaltimetype v), icalproperty * (*new_func)(struct icaltimetype v)) +e_cal_model_update_comp_time (ECalModel *model, + ECalModelComponent *comp_data, + gconstpointer time_value, + icalproperty_kind kind, + void (*set_func) (icalproperty *prop, + struct icaltimetype v), + icalproperty * (*new_func) (struct icaltimetype v)) { ECellDateEditValue *dv = (ECellDateEditValue *) time_value; icalproperty *prop; @@ -1127,7 +1147,7 @@ e_cal_model_update_comp_time (ECalModel *model, ECalModelComponent *comp_data, g param = NULL; /* If we are setting the property to NULL (i.e. removing it), then - we remove it if it exists. */ + * we remove it if it exists. */ if (!dv) { if (prop) { icalcomponent_remove_property (comp_data->icalcomp, prop); @@ -1165,17 +1185,25 @@ e_cal_model_update_comp_time (ECalModel *model, ECalModelComponent *comp_data, g } static void -set_dtstart (ECalModel *model, ECalModelComponent *comp_data, gconstpointer value) +set_dtstart (ECalModel *model, + ECalModelComponent *comp_data, + gconstpointer value) { - e_cal_model_update_comp_time (model, comp_data, value, ICAL_DTSTART_PROPERTY, icalproperty_set_dtstart, icalproperty_new_dtstart); + e_cal_model_update_comp_time ( + model, comp_data, value, + ICAL_DTSTART_PROPERTY, + icalproperty_set_dtstart, + icalproperty_new_dtstart); } static void -set_summary (ECalModelComponent *comp_data, const gchar *value) +set_summary (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; - prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_SUMMARY_PROPERTY); + prop = icalcomponent_get_first_property ( + comp_data->icalcomp, ICAL_SUMMARY_PROPERTY); if (string_is_empty (value)) { if (prop) { @@ -1193,7 +1221,10 @@ set_summary (ECalModelComponent *comp_data, const gchar *value) } static void -ecm_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) +ecm_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer value) { ECalModelPrivate *priv; ECalModelComponent *comp_data; @@ -1250,7 +1281,8 @@ ecm_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) * Returns: Whether @row is editable or not. **/ gboolean -e_cal_model_test_row_editable (ECalModel *model, gint row) +e_cal_model_test_row_editable (ECalModel *model, + gint row) { gboolean readonly; ECalClient *client = NULL; @@ -1276,7 +1308,9 @@ e_cal_model_test_row_editable (ECalModel *model, gint row) } static gboolean -ecm_is_cell_editable (ETableModel *etm, gint col, gint row) +ecm_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ECalModelPrivate *priv; ECalModel *model = (ECalModel *) etm; @@ -1304,7 +1338,9 @@ ecm_is_cell_editable (ETableModel *etm, gint col, gint row) } static void -ecm_append_row (ETableModel *etm, ETableModel *source, gint row) +ecm_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ECalModelClass *model_class; ECalModelComponent *comp_data; @@ -1377,7 +1413,9 @@ ecm_append_row (ETableModel *etm, ETableModel *source, gint row) } static gpointer -ecm_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +ecm_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, NULL); @@ -1412,7 +1450,9 @@ ecm_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -ecm_free_value (ETableModel *etm, gint col, gpointer value) +ecm_free_value (ETableModel *etm, + gint col, + gpointer value) { g_return_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST); @@ -1442,7 +1482,8 @@ ecm_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -ecm_initialize_value (ETableModel *etm, gint col) +ecm_initialize_value (ETableModel *etm, + gint col) { ECalModelPrivate *priv; ECalModel *model = (ECalModel *) etm; @@ -1473,7 +1514,9 @@ ecm_initialize_value (ETableModel *etm, gint col) } static gboolean -ecm_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +ecm_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ECalModelPrivate *priv; ECalModel *model = (ECalModel *) etm; @@ -1514,7 +1557,9 @@ ecm_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -ecm_value_to_string (ETableModel *etm, gint col, gconstpointer value) +ecm_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, g_strdup ("")); @@ -1553,7 +1598,8 @@ typedef struct { } AssignedColorData; static const gchar * -ecm_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data) +ecm_get_color_for_component (ECalModel *model, + ECalModelComponent *comp_data) { ESource *source; const gchar *color_spec; @@ -1633,7 +1679,8 @@ e_cal_model_get_component_kind (ECalModel *model) } void -e_cal_model_set_component_kind (ECalModel *model, icalcomponent_kind kind) +e_cal_model_set_component_kind (ECalModel *model, + icalcomponent_kind kind) { g_return_if_fail (E_IS_CAL_MODEL (model)); @@ -1649,7 +1696,8 @@ e_cal_model_get_flags (ECalModel *model) } void -e_cal_model_set_flags (ECalModel *model, ECalModelFlags flags) +e_cal_model_set_flags (ECalModel *model, + ECalModelFlags flags) { g_return_if_fail (E_IS_CAL_MODEL (model)); @@ -1679,7 +1727,7 @@ e_cal_model_set_timezone (ECalModel *model, model->priv->zone = zone; /* the timezone affects the times shown for date fields, - so we need to redisplay everything */ + * so we need to redisplay everything */ e_table_model_changed (E_TABLE_MODEL (model)); g_object_notify (G_OBJECT (model), "timezone"); @@ -1925,7 +1973,8 @@ e_cal_model_get_default_client (ECalModel *model) } void -e_cal_model_set_default_client (ECalModel *model, ECalClient *client) +e_cal_model_set_default_client (ECalModel *model, + ECalClient *client) { ECalModelPrivate *priv; ECalModelClient *client_data; @@ -1988,7 +2037,8 @@ e_cal_model_get_client_list (ECalModel *model) * @uri: Uri for the client to get. */ ECalClient * -e_cal_model_get_client_for_uri (ECalModel *model, const gchar *uri) +e_cal_model_get_client_for_uri (ECalModel *model, + const gchar *uri) { GList *l; @@ -2006,7 +2056,8 @@ e_cal_model_get_client_for_uri (ECalModel *model, const gchar *uri) } static ECalModelClient * -find_client_data (ECalModel *model, ECalClient *client) +find_client_data (ECalModel *model, + ECalClient *client) { ECalModelPrivate *priv; GList *l; @@ -2024,7 +2075,9 @@ find_client_data (ECalModel *model, ECalClient *client) } static ECalModelComponent * -search_by_id_and_client (ECalModelPrivate *priv, ECalClient *client, const ECalComponentId *id) +search_by_id_and_client (ECalModelPrivate *priv, + ECalClient *client, + const ECalComponentId *id) { gint i; @@ -2070,7 +2123,10 @@ typedef struct { } RecurrenceExpansionData; static gboolean -add_instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end, gpointer user_data) +add_instance_cb (ECalComponent *comp, + time_t instance_start, + time_t instance_end, + gpointer user_data) { ECalModelComponent *comp_data; ECalModelPrivate *priv; @@ -2145,7 +2201,8 @@ ensure_dates_are_in_default_zone (ECalModel *model, } static gint -place_master_object_first_cb (gconstpointer p1, gconstpointer p2) +place_master_object_first_cb (gconstpointer p1, + gconstpointer p2) { icalcomponent *c1 = (icalcomponent *) p1, *c2 = (icalcomponent *) p2; const gchar *uid1, *uid2; @@ -2180,7 +2237,9 @@ place_master_object_first_cb (gconstpointer p1, gconstpointer p2) static void client_view_objects_added_cb (ECalClientView *view, const GSList *objects, ECalModel *model); static void -process_added (ECalClientView *view, const GSList *objects, ECalModel *model) +process_added (ECalClientView *view, + const GSList *objects, + ECalModel *model) { ECalModelPrivate *priv; const GSList *l; @@ -2260,7 +2319,9 @@ process_added (ECalClientView *view, const GSList *objects, ECalModel *model) } static void -process_modified (ECalClientView *view, const GSList *objects, ECalModel *model) +process_modified (ECalClientView *view, + const GSList *objects, + ECalModel *model) { ECalModelPrivate *priv; const GSList *l; @@ -2343,7 +2404,9 @@ process_modified (ECalClientView *view, const GSList *objects, ECalModel *model) } static void -process_removed (ECalClientView *view, const GSList *ids, ECalModel *model) +process_removed (ECalClientView *view, + const GSList *ids, + ECalModel *model) { ECalModelPrivate *priv; const GSList *l; @@ -2406,9 +2469,16 @@ free_comp_id (gpointer id) } static void -process_event (ECalClientView *view, const GSList *objects, ECalModel *model, - void (*process_fn) (ECalClientView *view, const GSList *objects, ECalModel *model), - gboolean *in, GSList **save_list, gpointer (*copy_fn) (gpointer data), void (*free_fn)(gpointer data)) +process_event (ECalClientView *view, + const GSList *objects, + ECalModel *model, + void (*process_fn) (ECalClientView *view, + const GSList *objects, + ECalModel *model), + gboolean *in, + GSList **save_list, + gpointer (*copy_fn) (gpointer data), + void (*free_fn) (gpointer data)) { gboolean skip = FALSE; const GSList *l; @@ -2456,43 +2526,63 @@ process_event (ECalClientView *view, const GSList *objects, ECalModel *model, } static void -client_view_objects_added_cb (ECalClientView *view, const GSList *objects, ECalModel *model) +client_view_objects_added_cb (ECalClientView *view, + const GSList *objects, + ECalModel *model) { - process_event (view, objects, model, - process_added, &model->priv->in_added, &model->priv->notify_added, - (gpointer (*)(gpointer)) icalcomponent_new_clone, (void (*)(gpointer)) icalcomponent_free); + process_event ( + view, objects, model, process_added, + &model->priv->in_added, + &model->priv->notify_added, + (gpointer (*)(gpointer)) icalcomponent_new_clone, + (void (*)(gpointer)) icalcomponent_free); } static void -client_view_objects_modified_cb (ECalClientView *view, const GSList *objects, ECalModel *model) +client_view_objects_modified_cb (ECalClientView *view, + const GSList *objects, + ECalModel *model) { - process_event (view, objects, model, - process_modified, &model->priv->in_modified, &model->priv->notify_modified, - (gpointer (*)(gpointer)) icalcomponent_new_clone, (void (*)(gpointer)) icalcomponent_free); + process_event ( + view, objects, model, process_modified, + &model->priv->in_modified, + &model->priv->notify_modified, + (gpointer (*)(gpointer)) icalcomponent_new_clone, + (void (*)(gpointer)) icalcomponent_free); } static void -client_view_objects_removed_cb (ECalClientView *view, const GSList *ids, ECalModel *model) -{ - process_event (view, ids, model, - process_removed, &model->priv->in_removed, &model->priv->notify_removed, +client_view_objects_removed_cb (ECalClientView *view, + const GSList *ids, + ECalModel *model) +{ + process_event ( + view, ids, model, process_removed, + &model->priv->in_removed, + &model->priv->notify_removed, copy_comp_id, free_comp_id); } static void -client_view_progress_cb (ECalClientView *view, gint percent, const gchar *message, gpointer user_data) +client_view_progress_cb (ECalClientView *view, + gint percent, + const gchar *message, + gpointer user_data) { ECalModel *model = (ECalModel *) user_data; ECalClient *client = e_cal_client_view_get_client (view); g_return_if_fail (E_IS_CAL_MODEL (model)); - g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_PROGRESS], 0, message, - percent, e_cal_client_get_source_type (client)); + g_signal_emit ( + model, signals[CAL_VIEW_PROGRESS], 0, message, + percent, e_cal_client_get_source_type (client)); } static void -client_view_complete_cb (ECalClientView *view, const GError *error, gpointer user_data) +client_view_complete_cb (ECalClientView *view, + const GError *error, + gpointer user_data) { ECalModel *model = (ECalModel *) user_data; ECalClient *client = e_cal_client_view_get_client (view); @@ -2524,7 +2614,9 @@ free_get_view_data (struct get_view_data *gvd) static gboolean retry_get_view_timeout_cb (gpointer user_data); static void -get_view_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +get_view_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { struct get_view_data *gvd = user_data; GError *error = NULL; @@ -2590,7 +2682,8 @@ retry_get_view_timeout_cb (gpointer user_data) } static void -update_e_cal_view_for_client (ECalModel *model, ECalModelClient *client_data) +update_e_cal_view_for_client (ECalModel *model, + ECalModelClient *client_data) { ECalModelPrivate *priv; struct get_view_data *gvd; @@ -2633,7 +2726,9 @@ update_e_cal_view_for_client (ECalModel *model, ECalModelClient *client_data) } void -e_cal_model_update_status_message (ECalModel *model, const gchar *message, gdouble percent) +e_cal_model_update_status_message (ECalModel *model, + const gchar *message, + gdouble percent) { g_return_if_fail (model != NULL); @@ -2641,7 +2736,8 @@ e_cal_model_update_status_message (ECalModel *model, const gchar *message, gdoub } static void -backend_died_cb (ECalClient *client, gpointer user_data) +backend_died_cb (ECalClient *client, + gpointer user_data) { ECalModel *model; @@ -2769,7 +2865,9 @@ cal_model_retry_open_timeout_cb (gpointer user_data) } static ECalModelClient * -add_new_client (ECalModel *model, ECalClient *client, gboolean do_query) +add_new_client (ECalModel *model, + ECalClient *client, + gboolean do_query) { ECalModelPrivate *priv; ECalModelClient *client_data; @@ -2799,8 +2897,9 @@ add_new_client (ECalModel *model, ECalClient *client, gboolean do_query) priv->clients = g_list_append (priv->clients, client_data); - g_signal_connect (G_OBJECT (client_data->client), "backend_died", - G_CALLBACK (backend_died_cb), model); + g_signal_connect ( + client_data->client, "backend_died", + G_CALLBACK (backend_died_cb), model); load: if (e_client_is_opened (E_CLIENT (client))) { @@ -2824,7 +2923,8 @@ add_new_client (ECalModel *model, ECalClient *client, gboolean do_query) * e_cal_model_add_client */ void -e_cal_model_add_client (ECalModel *model, ECalClient *client) +e_cal_model_add_client (ECalModel *model, + ECalClient *client) { g_return_if_fail (E_IS_CAL_MODEL (model)); g_return_if_fail (E_IS_CAL_CLIENT (client)); @@ -2833,7 +2933,8 @@ e_cal_model_add_client (ECalModel *model, ECalClient *client) } static void -remove_client_objects (ECalModel *model, ECalModelClient *client_data) +remove_client_objects (ECalModel *model, + ECalModelClient *client_data) { gint i; @@ -2864,7 +2965,8 @@ remove_client_objects (ECalModel *model, ECalModelClient *client_data) } static void -remove_client (ECalModel *model, ECalModelClient *client_data) +remove_client (ECalModel *model, + ECalModelClient *client_data) { /* FIXME We might not want to disconnect the open signal for the default client */ g_signal_handlers_disconnect_matched (client_data->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model); @@ -2898,7 +3000,8 @@ remove_client (ECalModel *model, ECalModelClient *client_data) * e_cal_model_remove_client */ void -e_cal_model_remove_client (ECalModel *model, ECalClient *client) +e_cal_model_remove_client (ECalModel *model, + ECalClient *client) { ECalModelClient *client_data; @@ -3029,7 +3132,7 @@ redo_queries (ECalModel *model) } /* clean up the current contents, which should be done - always from the main thread, because of gtk calls during removal */ + * always from the main thread, because of gtk calls during removal */ data.model = model; data.eflag = e_flag_new (); @@ -3053,7 +3156,9 @@ redo_queries (ECalModel *model) } void -e_cal_model_get_time_range (ECalModel *model, time_t *start, time_t *end) +e_cal_model_get_time_range (ECalModel *model, + time_t *start, + time_t *end) { ECalModelPrivate *priv; @@ -3070,7 +3175,9 @@ e_cal_model_get_time_range (ECalModel *model, time_t *start, time_t *end) } void -e_cal_model_set_time_range (ECalModel *model, time_t start, time_t end) +e_cal_model_set_time_range (ECalModel *model, + time_t start, + time_t end) { ECalModelPrivate *priv; @@ -3108,7 +3215,8 @@ e_cal_model_get_search_query (ECalModel *model) * e_cal_model_set_query */ void -e_cal_model_set_search_query (ECalModel *model, const gchar *sexp) +e_cal_model_set_search_query (ECalModel *model, + const gchar *sexp) { ECalModelPrivate *priv; @@ -3131,7 +3239,10 @@ e_cal_model_set_search_query (ECalModel *model, const gchar *sexp) * e_cal_model_set_query */ void -e_cal_model_set_search_query_with_time_range (ECalModel *model, const gchar *sexp, time_t start, time_t end) +e_cal_model_set_search_query_with_time_range (ECalModel *model, + const gchar *sexp, + time_t start, + time_t end) { ECalModelPrivate *priv; gboolean do_query = FALSE; @@ -3164,7 +3275,8 @@ e_cal_model_set_search_query_with_time_range (ECalModel *model, const gchar *sex * e_cal_model_create_component_with_defaults */ icalcomponent * -e_cal_model_create_component_with_defaults (ECalModel *model, gboolean all_day) +e_cal_model_create_component_with_defaults (ECalModel *model, + gboolean all_day) { ECalModelPrivate *priv; ECalComponent *comp; @@ -3222,7 +3334,8 @@ e_cal_model_create_component_with_defaults (ECalModel *model, gboolean all_day) * e_cal_model_get_color_for_component */ const gchar * -e_cal_model_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data) +e_cal_model_get_color_for_component (ECalModel *model, + ECalModelComponent *comp_data) { ECalModelClass *model_class; const gchar *color = NULL; @@ -3244,7 +3357,11 @@ e_cal_model_get_color_for_component (ECalModel *model, ECalModelComponent *comp_ * e_cal_model_get_rgb_color_for_component */ gboolean -e_cal_model_get_rgb_color_for_component (ECalModel *model, ECalModelComponent *comp_data, double *red, double *green, double *blue) +e_cal_model_get_rgb_color_for_component (ECalModel *model, + ECalModelComponent *comp_data, + gdouble *red, + gdouble *green, + gdouble *blue) { GdkColor gdk_color; const gchar *color; @@ -3269,7 +3386,8 @@ e_cal_model_get_rgb_color_for_component (ECalModel *model, ECalModelComponent *c * e_cal_model_get_component_at */ ECalModelComponent * -e_cal_model_get_component_at (ECalModel *model, gint row) +e_cal_model_get_component_at (ECalModel *model, + gint row) { ECalModelPrivate *priv; @@ -3283,7 +3401,8 @@ e_cal_model_get_component_at (ECalModel *model, gint row) } ECalModelComponent * -e_cal_model_get_component_for_uid (ECalModel *model, const ECalComponentId *id) +e_cal_model_get_component_for_uid (ECalModel *model, + const ECalComponentId *id) { ECalModelPrivate *priv; @@ -3298,7 +3417,8 @@ e_cal_model_get_component_for_uid (ECalModel *model, const ECalComponentId *id) * e_cal_model_date_value_to_string */ gchar * -e_cal_model_date_value_to_string (ECalModel *model, gconstpointer value) +e_cal_model_date_value_to_string (ECalModel *model, + gconstpointer value) { ECalModelPrivate *priv; ECellDateEditValue *dv = (ECellDateEditValue *) value; @@ -3339,11 +3459,11 @@ static ECellDateEditValue * copy_ecdv (ECellDateEditValue *ecdv) { ECellDateEditValue *new_ecdv; - + * new_ecdv = g_new0 (ECellDateEditValue, 1); new_ecdv->tt = ecdv ? ecdv->tt : icaltime_null_time (); new_ecdv->zone = ecdv ? ecdv->zone : NULL; - + * return new_ecdv; } */ @@ -3455,8 +3575,11 @@ e_cal_model_component_get_type (void) * cb function is not called with cb_data, but with ECalModelGenerateInstancesData which contains cb_data */ void -e_cal_model_generate_instances_sync (ECalModel *model, time_t start, time_t end, - ECalRecurInstanceFn cb, gpointer cb_data) +e_cal_model_generate_instances_sync (ECalModel *model, + time_t start, + time_t end, + ECalRecurInstanceFn cb, + gpointer cb_data) { ECalModelGenerateInstancesData mdata; gint i, n; @@ -3485,7 +3608,8 @@ e_cal_model_get_object_array (ECalModel *model) } void -e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezone *zone) +e_cal_model_set_instance_times (ECalModelComponent *comp_data, + const icaltimezone *zone) { struct icaltimetype start_time, end_time; icalcomponent_kind kind; @@ -3506,9 +3630,9 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezon } else if (start_time.is_date && end_time.is_date && (icaltime_compare_date_only (start_time, end_time) == 0)) { /* If both DTSTART and DTEND are DATE values, and they are the - same day, we add 1 day to DTEND. This means that most - events created with the old Evolution behavior will still - work OK. */ + * same day, we add 1 day to DTEND. This means that most + * events created with the old Evolution behavior will still + * work OK. */ icaltime_adjust (&end_time, 1, 0, 0, 0); icalcomponent_set_dtend (comp_data->icalcomp, end_time); } @@ -3571,7 +3695,9 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezon * when user didn't fill a start date there. **/ void -e_cal_model_set_default_time_func (ECalModel *model, ECalModelDefaultTimeFunc func, gpointer user_data) +e_cal_model_set_default_time_func (ECalModel *model, + ECalModelDefaultTimeFunc func, + gpointer user_data) { g_return_if_fail (E_IS_CAL_MODEL (model)); diff --git a/calendar/gui/e-cal-model.h b/calendar/gui/e-cal-model.h index 33ffcff52d..a514c95ab2 100644 --- a/calendar/gui/e-cal-model.h +++ b/calendar/gui/e-cal-model.h @@ -73,7 +73,7 @@ G_BEGIN_DECLS typedef enum { /* If you add new items here or reorder them, you have to update the - .etspec files for the tables using this model */ + * .etspec files for the tables using this model */ E_CAL_MODEL_FIELD_CATEGORIES, E_CAL_MODEL_FIELD_CLASSIFICATION, E_CAL_MODEL_FIELD_COLOR, /* not a real field */ diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 8f87026f65..82bbea2f79 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -509,7 +509,9 @@ calendar_view_cut_clipboard (ESelectable *selectable) } static void -add_related_timezones (icalcomponent *des_icalcomp, icalcomponent *src_icalcomp, ECalClient *client) +add_related_timezones (icalcomponent *des_icalcomp, + icalcomponent *src_icalcomp, + ECalClient *client) { icalproperty_kind look_in[] = { ICAL_DTSTART_PROPERTY, @@ -944,8 +946,12 @@ e_calendar_view_popup_event (ECalendarView *calendar_view, } void -e_calendar_view_add_event (ECalendarView *cal_view, ECalClient *client, time_t dtstart, - icaltimezone *default_zone, icalcomponent *icalcomp, gboolean in_top_canvas) +e_calendar_view_add_event (ECalendarView *cal_view, + ECalClient *client, + time_t dtstart, + icaltimezone *default_zone, + icalcomponent *icalcomp, + gboolean in_top_canvas) { ECalComponent *comp; struct icaltimetype itime, old_dtstart, old_dtend; @@ -966,7 +972,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECalClient *client, time_t d tt_end = icaltime_as_timet (old_dtend); ic_dur = icaldurationtype_from_int (tt_end - tt_start); - if (icaldurationtype_as_int (ic_dur) > 60*60*24) { + if (icaldurationtype_as_int (ic_dur) > 60 *60 *24) { /* This is a long event */ start_offset = old_dtstart.hour * 60 + old_dtstart.minute; end_offset = old_dtstart.hour * 60 + old_dtend.minute; @@ -985,7 +991,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECalClient *client, time_t d if (all_day_event) { ic_dur = ic_oneday; - } else if (icaldurationtype_as_int (ic_dur) >= 60*60*24 + } else if (icaldurationtype_as_int (ic_dur) >= 60 *60 *24 && !in_top_canvas) { /* copy & paste from top canvas to main canvas */ gint time_divisions; @@ -1076,7 +1082,8 @@ e_calendar_view_get_calendar (ECalendarView *cal_view) } void -e_calendar_view_set_calendar (ECalendarView *cal_view, GnomeCalendar *calendar) +e_calendar_view_set_calendar (ECalendarView *cal_view, + GnomeCalendar *calendar) { g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view)); @@ -1099,7 +1106,8 @@ e_calendar_view_get_timezone (ECalendarView *cal_view) } void -e_calendar_view_set_timezone (ECalendarView *cal_view, icaltimezone *zone) +e_calendar_view_set_timezone (ECalendarView *cal_view, + icaltimezone *zone) { icaltimezone *old_zone; @@ -1398,9 +1406,10 @@ e_calendar_view_open_event (ECalendarView *cal_view) */ void e_calendar_view_new_appointment_for (ECalendarView *cal_view, - time_t dtstart, time_t dtend, - gboolean all_day, - gboolean meeting) + time_t dtstart, + time_t dtend, + gboolean all_day, + gboolean meeting) { ECalendarViewPrivate *priv; struct icaltimetype itt; @@ -1458,7 +1467,7 @@ e_calendar_view_new_appointment_for (ECalendarView *cal_view, itt = icaltime_from_timet_with_zone (dtend, FALSE, e_cal_model_get_timezone (cal_view->priv->model)); if (all_day) { /* We round it up to the end of the day, unless it is - already set to midnight */ + * already set to midnight */ if (itt.hour != 0 || itt.minute != 0 || itt.second != 0) { icaltime_adjust (&itt, 1, 0, 0, 0); } @@ -1575,13 +1584,17 @@ e_calendar_view_new_appointment (ECalendarView *cal_view) /* Ensures the calendar is selected */ static void -object_created_cb (CompEditor *ce, ECalendarView *cal_view) +object_created_cb (CompEditor *ce, + ECalendarView *cal_view) { e_calendar_view_emit_user_created (cal_view); } CompEditor * -e_calendar_view_open_event_with_flags (ECalendarView *cal_view, ECalClient *client, icalcomponent *icalcomp, guint32 flags) +e_calendar_view_open_event_with_flags (ECalendarView *cal_view, + ECalClient *client, + icalcomponent *icalcomp, + guint32 flags) { CompEditor *ce; const gchar *uid; @@ -1624,7 +1637,10 @@ e_calendar_view_open_event_with_flags (ECalendarView *cal_view, ECalClient *clie * object. */ void -e_calendar_view_edit_appointment (ECalendarView *cal_view, ECalClient *client, icalcomponent *icalcomp, EEditEventMode mode) +e_calendar_view_edit_appointment (ECalendarView *cal_view, + ECalClient *client, + icalcomponent *icalcomp, + EEditEventMode mode) { guint32 flags = 0; @@ -1647,10 +1663,10 @@ e_calendar_view_edit_appointment (ECalendarView *cal_view, ECalClient *client, i void e_calendar_view_modify_and_send (ECalComponent *comp, - ECalClient *client, - CalObjModType mod, - GtkWindow *toplevel, - gboolean new) + ECalClient *client, + CalObjModType mod, + GtkWindow *toplevel, + gboolean new) { gboolean only_new_attendees = FALSE; GError *error = NULL; @@ -1697,7 +1713,9 @@ e_calendar_view_modify_and_send (ECalComponent *comp, } static gboolean -tooltip_grab (GtkWidget *tooltip, GdkEventKey *event, ECalendarView *view) +tooltip_grab (GtkWidget *tooltip, + GdkEventKey *event, + ECalendarView *view) { GtkWidget *widget = (GtkWidget *) g_object_get_data (G_OBJECT (view), "tooltip-window"); @@ -1712,7 +1730,9 @@ tooltip_grab (GtkWidget *tooltip, GdkEventKey *event, ECalendarView *view) } static gchar * -get_label (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t_zone) +get_label (struct icaltimetype *tt, + icaltimezone *f_zone, + icaltimezone *t_zone) { struct tm tmp_tm; @@ -1722,7 +1742,9 @@ get_label (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t_zone) } void -e_calendar_view_move_tip (GtkWidget *widget, gint x, gint y) +e_calendar_view_move_tip (GtkWidget *widget, + gint x, + gint y) { GtkAllocation allocation; GtkRequisition requisition; @@ -1768,7 +1790,8 @@ e_calendar_view_move_tip (GtkWidget *widget, gint x, gint y) * Free returned pointer with g_free. **/ gchar * -e_calendar_view_get_attendees_status_info (ECalComponent *comp, ECalClient *client) +e_calendar_view_get_attendees_status_info (ECalComponent *comp, + ECalClient *client) { struct _values { icalparameter_partstat status; @@ -1827,7 +1850,7 @@ e_calendar_view_get_attendees_status_info (ECalComponent *comp, ECalClient *clie g_string_prepend (str, ": "); /* To Translators: 'Status' here means the state of the attendees, the resulting string will be in a form: - Status: Accepted: X Declined: Y ... */ + * Status: Accepted: X Declined: Y ... */ g_string_prepend (str, _("Status")); res = g_string_free (str, FALSE); @@ -2016,13 +2039,13 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data) gtk_frame_set_shadow_type ((GtkFrame *) frame, GTK_SHADOW_IN); gtk_window_set_type_hint (GTK_WINDOW (pevent->tooltip), GDK_WINDOW_TYPE_HINT_TOOLTIP); - gtk_window_move ((GtkWindow *) pevent->tooltip, pevent->x +16, pevent->y+16); + gtk_window_move ((GtkWindow *) pevent->tooltip, pevent->x +16, pevent->y + 16); gtk_container_add ((GtkContainer *) frame, box); gtk_container_add ((GtkContainer *) pevent->tooltip, frame); gtk_widget_show_all (pevent->tooltip); - e_calendar_view_move_tip (pevent->tooltip, pevent->x +16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x +16, pevent->y + 16); window = gtk_widget_get_window (pevent->tooltip); gdk_keyboard_grab (window, FALSE, GDK_CURRENT_TIME); @@ -2036,7 +2059,8 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data) } static gboolean -icalcomp_contains_category (icalcomponent *icalcomp, const gchar *category) +icalcomp_contains_category (icalcomponent *icalcomp, + const gchar *category) { icalproperty *property; @@ -2065,7 +2089,9 @@ icalcomp_contains_category (icalcomponent *icalcomp, const gchar *category) */ const gchar * -e_calendar_view_get_icalcomponent_summary (ECalClient *client, icalcomponent *icalcomp, gboolean *free_text) +e_calendar_view_get_icalcomponent_summary (ECalClient *client, + icalcomponent *icalcomp, + gboolean *free_text) { const gchar *summary; @@ -2108,9 +2134,12 @@ e_calendar_view_emit_user_created (ECalendarView *cal_view) } void -draw_curved_rectangle (cairo_t *cr, double x0, double y0, - gdouble rect_width, double rect_height, - gdouble radius) +draw_curved_rectangle (cairo_t *cr, + gdouble x0, + gdouble y0, + gdouble rect_width, + gdouble rect_height, + gdouble radius) { gdouble x1, y1; @@ -2121,28 +2150,28 @@ draw_curved_rectangle (cairo_t *cr, double x0, double y0, return; if (rect_width / 2 < radius) { if (rect_height / 2 < radius) { - cairo_move_to (cr, x0, (y0 + y1)/2); - cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0); - cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2); - cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1); - cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2); + cairo_move_to (cr, x0, (y0 + y1) / 2); + cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1) / 2, y0); + cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2); + cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1); + cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2); } else { cairo_move_to (cr, x0, y0 + radius); - cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0); + cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1) / 2, y0); cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius); cairo_line_to (cr, x1 , y1 - radius); - cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1); + cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1); cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius); } } else { if (rect_height / 2 < radius) { - cairo_move_to (cr, x0, (y0 + y1)/2); + cairo_move_to (cr, x0, (y0 + y1) / 2); cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0); cairo_line_to (cr, x1 - radius, y0); - cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2); + cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2); cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1); cairo_line_to (cr, x0 + radius, y1); - cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2); + cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2); } else { cairo_move_to (cr, x0, y0 + radius); cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0); @@ -2158,7 +2187,7 @@ draw_curved_rectangle (cairo_t *cr, double x0, double y0, } /* returns either light or dark yellow, based on the base_background, - which is the default background color */ + * which is the default background color */ GdkColor get_today_background (const GdkColor base_background) { @@ -2180,7 +2209,8 @@ get_today_background (const GdkColor base_background) } gboolean -is_comp_data_valid_func (ECalendarViewEvent *event, const gchar *location) +is_comp_data_valid_func (ECalendarViewEvent *event, + const gchar *location) { g_return_val_if_fail (location != NULL, FALSE); @@ -2198,7 +2228,9 @@ is_comp_data_valid_func (ECalendarViewEvent *event, const gchar *location) } gboolean -is_array_index_in_bounds_func (GArray *array, gint index, const gchar *location) +is_array_index_in_bounds_func (GArray *array, + gint index, + const gchar *location) { g_return_val_if_fail (location != NULL, FALSE); diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c index 57c2d855d8..61f6d9a3fd 100644 --- a/calendar/gui/e-cell-date-edit-text.c +++ b/calendar/gui/e-cell-date-edit-text.c @@ -120,9 +120,9 @@ cell_date_edit_text_get_text (ECellText *cell, timezone = e_cell_date_edit_text_get_timezone (ecd); /* Note that although the property may be in a different - timezone, we convert it to the current timezone to display - it in the table. If the user actually edits the value, - it will be set to the current timezone. See set_value (). */ + * timezone, we convert it to the current timezone to display + * it in the table. If the user actually edits the value, + * it will be set to the current timezone. See set_value (). */ tmp_tm = icaltimetype_to_tm_with_zone (&dv->tt, dv->zone, timezone); return e_datetime_format_format_tm ( @@ -148,7 +148,7 @@ show_date_warning (ECellDateEditText *ecd) t = time (NULL); /* We are only using this as an example, so the timezone doesn't - matter. */ + * matter. */ tmp_tm = localtime (&t); if (e_cell_date_edit_text_get_use_24_hour_format (ecd)) @@ -184,7 +184,7 @@ cell_date_edit_text_set_value (ECellText *cell, gboolean is_date = TRUE; /* Try to parse just a date first. If the value is only a date, we - use a DATE value. */ + * use a DATE value. */ status = e_time_parse_date (text, &tmp_tm); if (status == E_TIME_PARSE_INVALID) { is_date = FALSE; @@ -212,7 +212,7 @@ cell_date_edit_text_set_value (ECellText *cell, dv.tt.is_date = is_date; /* FIXME: We assume it is being set to the current timezone. - Is that OK? */ + * Is that OK? */ if (is_date) { dv.zone = NULL; } else { @@ -310,7 +310,7 @@ e_cell_date_edit_text_get_type (void) */ ECell * e_cell_date_edit_text_new (const gchar *fontname, - GtkJustification justify) + GtkJustification justify) { ECell *cell; @@ -330,7 +330,7 @@ e_cell_date_edit_text_get_timezone (ECellDateEditText *ecd) void e_cell_date_edit_text_set_timezone (ECellDateEditText *ecd, - icaltimezone *timezone) + icaltimezone *timezone) { g_return_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd)); @@ -349,7 +349,7 @@ e_cell_date_edit_text_get_use_24_hour_format (ECellDateEditText *ecd) void e_cell_date_edit_text_set_use_24_hour_format (ECellDateEditText *ecd, - gboolean use_24_hour) + gboolean use_24_hour) { g_return_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd)); @@ -359,7 +359,9 @@ e_cell_date_edit_text_set_use_24_hour_format (ECellDateEditText *ecd, } gint -e_cell_date_edit_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_cache) +e_cell_date_edit_compare_cb (gconstpointer a, + gconstpointer b, + gpointer cmp_cache) { ECellDateEditValue *dv1 = (ECellDateEditValue *) a; ECellDateEditValue *dv2 = (ECellDateEditValue *) b; diff --git a/calendar/gui/e-date-time-list.c b/calendar/gui/e-date-time-list.c index 404fac9c99..1342c0e5d7 100644 --- a/calendar/gui/e-date-time-list.c +++ b/calendar/gui/e-date-time-list.c @@ -108,7 +108,8 @@ all_rows_deleted (EDateTimeList *date_time_list) } static void -row_deleted (EDateTimeList *date_time_list, gint n) +row_deleted (EDateTimeList *date_time_list, + gint n) { GtkTreePath *path; @@ -119,7 +120,8 @@ row_deleted (EDateTimeList *date_time_list, gint n) } static void -row_added (EDateTimeList *date_time_list, gint n) +row_added (EDateTimeList *date_time_list, + gint n) { GtkTreePath *path; GtkTreeIter iter; @@ -134,7 +136,8 @@ row_added (EDateTimeList *date_time_list, gint n) } static void -row_updated (EDateTimeList *date_time_list, gint n) +row_updated (EDateTimeList *date_time_list, + gint n) { GtkTreePath *path; GtkTreeIter iter; @@ -276,7 +279,7 @@ date_time_list_get_iter (GtkTreeModel *tree_model, static GtkTreePath * date_time_list_get_path (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { EDateTimeList *date_time_list = (EDateTimeList *) tree_model; GtkTreePath *retval; @@ -372,7 +375,7 @@ date_time_list_iter_children (GtkTreeModel *tree_model, static gboolean date_time_list_iter_has_child (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { g_return_val_if_fail (IS_VALID_ITER (E_DATE_TIME_LIST (tree_model), iter), FALSE); return FALSE; @@ -483,7 +486,8 @@ e_date_time_list_new (void) } const ECalComponentDateTime * -e_date_time_list_get_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter) +e_date_time_list_get_date_time (EDateTimeList *date_time_list, + GtkTreeIter *iter) { g_return_val_if_fail (IS_VALID_ITER (date_time_list, iter), NULL); @@ -491,8 +495,9 @@ e_date_time_list_get_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter } void -e_date_time_list_set_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter, - const ECalComponentDateTime *datetime) +e_date_time_list_set_date_time (EDateTimeList *date_time_list, + GtkTreeIter *iter, + const ECalComponentDateTime *datetime) { ECalComponentDateTime *datetime_old; @@ -526,8 +531,9 @@ e_date_time_list_set_use_24_hour_format (EDateTimeList *date_time_list, } void -e_date_time_list_append (EDateTimeList *date_time_list, GtkTreeIter *iter, - const ECalComponentDateTime *datetime) +e_date_time_list_append (EDateTimeList *date_time_list, + GtkTreeIter *iter, + const ECalComponentDateTime *datetime) { g_return_if_fail (datetime != NULL); @@ -546,7 +552,8 @@ e_date_time_list_append (EDateTimeList *date_time_list, GtkTreeIter *iter, } void -e_date_time_list_remove (EDateTimeList *date_time_list, GtkTreeIter *iter) +e_date_time_list_remove (EDateTimeList *date_time_list, + GtkTreeIter *iter) { gint n; diff --git a/calendar/gui/e-day-view-layout.c b/calendar/gui/e-day-view-layout.c index a4cdece5c0..d1957b95e7 100644 --- a/calendar/gui/e-day-view-layout.c +++ b/calendar/gui/e-day-view-layout.c @@ -55,27 +55,27 @@ static void e_day_view_recalc_cols_per_row (gint rows, guint16 *group_starts); void -e_day_view_layout_long_events (GArray *events, - gint days_shown, - time_t *day_starts, - gint *rows_in_top_display) +e_day_view_layout_long_events (GArray *events, + gint days_shown, + time_t *day_starts, + gint *rows_in_top_display) { EDayViewEvent *event; gint event_num; guint8 *grid; /* This is a temporary 2-d grid which is used to place events. - Each element is 0 if the position is empty, or 1 if occupied. - We allocate the maximum size possible here, assuming that each - event will need its own row. */ + * Each element is 0 if the position is empty, or 1 if occupied. + * We allocate the maximum size possible here, assuming that each + * event will need its own row. */ grid = g_new0 (guint8, events->len * E_DAY_VIEW_MAX_DAYS); /* Reset the number of rows in the top display to 0. It will be - updated as events are layed out below. */ + * updated as events are layed out below. */ *rows_in_top_display = 0; /* Iterate over the events, finding which days they cover, and putting - them in the first free row available. */ + * them in the first free row available. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); e_day_view_layout_long_event (event, grid, @@ -89,10 +89,10 @@ e_day_view_layout_long_events (GArray *events, static void e_day_view_layout_long_event (EDayViewEvent *event, - guint8 *grid, - gint days_shown, - time_t *day_starts, - gint *rows_in_top_display) + guint8 *grid, + gint days_shown, + time_t *day_starts, + gint *rows_in_top_display) { gint start_day, end_day, free_row, day, row; @@ -130,31 +130,31 @@ e_day_view_layout_long_event (EDayViewEvent *event, /* returns maximum number of columns among all rows */ gint -e_day_view_layout_day_events (GArray *events, - gint rows, - gint mins_per_row, - guint8 *cols_per_row, - gint max_cols) +e_day_view_layout_day_events (GArray *events, + gint rows, + gint mins_per_row, + guint8 *cols_per_row, + gint max_cols) { EDayViewEvent *event; gint row, event_num, res; EBitArray **grid; /* This is a temporary array which keeps track of rows which are - connected. When an appointment spans multiple rows then the number - of columns in each of these rows must be the same (i.e. the maximum - of all of them). Each element in the array corresponds to one row - and contains the index of the first row in the group of connected - rows. */ + * connected. When an appointment spans multiple rows then the number + * of columns in each of these rows must be the same (i.e. the maximum + * of all of them). Each element in the array corresponds to one row + * and contains the index of the first row in the group of connected + * rows. */ guint16 group_starts[12 * 24]; /* This is a temporary 2-d grid which is used to place events. - Each element is 0 if the position is empty, or 1 if occupied. */ + * Each element is 0 if the position is empty, or 1 if occupied. */ grid = g_new0 (EBitArray *, rows); /* Reset the cols_per_row array, and initialize the connected rows so - that all rows are not connected - each row is the start of a new - group. */ + * that all rows are not connected - each row is the start of a new + * group. */ for (row = 0; row < rows; row++) { cols_per_row[row] = 0; group_starts[row] = row; @@ -164,9 +164,9 @@ e_day_view_layout_day_events (GArray *events, } /* Iterate over the events, finding which rows they cover, and putting - them in the first free column available. Increment the number of - events in each of the rows it covers, and make sure they are all - in one group. */ + * them in the first free column available. Increment the number of + * events in each of the rows it covers, and make sure they are all + * in one group. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); @@ -178,7 +178,7 @@ e_day_view_layout_day_events (GArray *events, e_day_view_recalc_cols_per_row (rows, cols_per_row, group_starts); /* Iterate over the events again, trying to expand events horizontally - if there is enough space. */ + * if there is enough space. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); e_day_view_expand_day_event (event, grid, cols_per_row, @@ -197,16 +197,16 @@ e_day_view_layout_day_events (GArray *events, } /* Finds the first free position to place the event in. - Increments the number of events in each of the rows it covers, and makes - sure they are all in one group. */ + * Increments the number of events in each of the rows it covers, and makes + * sure they are all in one group. */ static void e_day_view_layout_day_event (EDayViewEvent *event, - EBitArray **grid, - guint16 *group_starts, - guint8 *cols_per_row, - gint rows, - gint mins_per_row, - gint max_cols) + EBitArray **grid, + guint16 *group_starts, + guint8 *cols_per_row, + gint rows, + gint mins_per_row, + gint max_cols) { gint start_row, end_row, free_col, col, row, group_start; @@ -252,9 +252,9 @@ e_day_view_layout_day_event (EDayViewEvent *event, group_start = group_starts[start_row]; /* Increment number of events in each of the rows the event covers. - We use the cols_per_row array for this. It will be sorted out after - all the events have been layed out. Also make sure all the rows that - the event covers are in one group. */ + * We use the cols_per_row array for this. It will be sorted out after + * all the events have been layed out. Also make sure all the rows that + * the event covers are in one group. */ for (row = start_row; row <= end_row; row++) { /* resize the array if necessary */ if (e_bit_array_bit_count (grid[row]) <= free_col) @@ -276,11 +276,11 @@ e_day_view_layout_day_event (EDayViewEvent *event, } /* For each group of rows, find the max number of events in all the - rows, and set the number of cols in each of the rows to that. */ + * rows, and set the number of cols in each of the rows to that. */ static void -e_day_view_recalc_cols_per_row (gint rows, - guint8 *cols_per_row, - guint16 *group_starts) +e_day_view_recalc_cols_per_row (gint rows, + guint8 *cols_per_row, + guint16 *group_starts) { gint start_row = 0, row, next_start_row, max_events; @@ -301,9 +301,9 @@ e_day_view_recalc_cols_per_row (gint rows, /* Expands the event horizontally to fill any free space. */ static void e_day_view_expand_day_event (EDayViewEvent *event, - EBitArray **grid, - guint8 *cols_per_row, - gint mins_per_row) + EBitArray **grid, + guint8 *cols_per_row, + gint mins_per_row) { gint start_row, end_row, col, row; gboolean clashed; @@ -333,11 +333,11 @@ e_day_view_expand_day_event (EDayViewEvent *event, /* Find the start and end days for the event. */ gboolean -e_day_view_find_long_event_days (EDayViewEvent *event, - gint days_shown, - time_t *day_starts, - gint *start_day_return, - gint *end_day_return) +e_day_view_find_long_event_days (EDayViewEvent *event, + gint days_shown, + time_t *day_starts, + gint *start_day_return, + gint *end_day_return) { gint day, start_day, end_day; diff --git a/calendar/gui/e-day-view-layout.h b/calendar/gui/e-day-view-layout.h index c169a06b59..5dae66244b 100644 --- a/calendar/gui/e-day-view-layout.h +++ b/calendar/gui/e-day-view-layout.h @@ -29,7 +29,7 @@ G_BEGIN_DECLS /* I've split these functions away from EDayView so we can use them for - printing. */ + * printing. */ void e_day_view_layout_long_events (GArray *events, gint days_shown, diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 98ce4ff335..c379f2aecb 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -52,7 +52,11 @@ enum { static gpointer parent_class; static gboolean -can_draw_in_region (cairo_region_t *draw_region, gint x, gint y, gint width, gint height) +can_draw_in_region (cairo_region_t *draw_region, + gint x, + gint y, + gint width, + gint height) { GdkRectangle rect; @@ -212,7 +216,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, time_divisions = e_calendar_view_get_time_divisions (cal_view); /* If the event is currently being dragged, don't draw it. It will - be drawn in the special drag items. */ + * be drawn in the special drag items. */ if (day_view->drag_event_day == day && day_view->drag_event_num == event_num) return; @@ -241,10 +245,10 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, return; /* Fill in the event background. Note that for events in the first - column of the day, we might not want to paint over the vertical bar, - since that is used for multiple events. But then you can't see - where the event in the first column finishes. The border is drawn - along with the event using cairo*/ + * column of the day, we might not want to paint over the vertical bar, + * since that is used for multiple events. But then you can't see + * where the event in the first column finishes. The border is drawn + * along with the event using cairo */ red = day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].red; green = day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].green; @@ -260,7 +264,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, is_editing = day_view->editing_event_day == day && day_view->editing_event_num == event_num; if (event->canvas_item) - g_object_get (G_OBJECT (event->canvas_item), "x_offset", &text_x_offset, NULL); + g_object_get (event->canvas_item, "x_offset", &text_x_offset, NULL); /* Draw shadow around the event when selected */ if (is_editing && (gtk_widget_has_focus (day_view->main_canvas))) { @@ -432,7 +436,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, draw_curved_rectangle (cr, x0, y0, rect_width,rect_height, radius); cairo_set_line_width (cr, 2.); - cairo_set_source_rgb (cr, red/cc, green/cc, blue/cc); + cairo_set_source_rgb (cr, red / cc, green / cc, blue / cc); cairo_stroke (cr); cairo_restore (cr); @@ -468,19 +472,19 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, pat = cairo_pattern_create_linear (item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 7.75, item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + item_h - 7.75); if (!short_event) { - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 1/(date_fraction + (rect_height/18)), red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 1/(date_fraction + (rect_height/18)), red/cc, green/cc, blue/cc, 0.4); - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 1 / (date_fraction + (rect_height / 18)), red / cc, green / cc, blue / cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 1 / (date_fraction + (rect_height / 18)), red / cc, green / cc, blue / cc, 0.4); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); } else { - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.4); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 0, red / cc, green / cc, blue / cc, 0.4); } cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); - cairo_set_source_rgba (cr, red/cc, green/cc, blue/cc, 0.2); + cairo_set_source_rgba (cr, red / cc, green / cc, blue / cc, 0.2); cairo_set_line_width (cr, 0.5); cairo_stroke (cr); cairo_restore (cr); @@ -499,7 +503,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); /* Draw the vertical colored bar showing when the appointment - begins & ends. */ + * begins & ends. */ bar_y1 = event->start_minute * day_view->row_height / time_divisions - y; bar_y2 = event->end_minute * day_view->row_height / time_divisions - y; @@ -546,7 +550,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, end_resize_suffix); } cairo_set_font_size (cr, 14); - if ((red/cc > 0.7) || (green/cc > 0.7) || (blue/cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) cairo_set_source_rgb (cr, 0, 0, 0); else cairo_set_source_rgb (cr, 1, 1, 1); @@ -570,9 +574,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_save (cr); pat = cairo_pattern_create_linear (item_x + E_DAY_VIEW_BAR_WIDTH, item_y + 1, item_x + E_DAY_VIEW_BAR_WIDTH, item_y + item_h - 1); - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.7); - cairo_pattern_add_color_stop_rgba (pat, 0.5, red/cc, green/cc, blue/cc, 0.7); - cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.2); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.7); + cairo_pattern_add_color_stop_rgba (pat, 0.5, red / cc, green / cc, blue / cc, 0.7); + cairo_pattern_add_color_stop_rgba (pat, 0, red / cc, green / cc, blue / cc, 0.2); cairo_rectangle (cr, item_x + 1, bar_y1, E_DAY_VIEW_BAR_WIDTH - 2, bar_y2 - bar_y1); @@ -623,7 +627,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, num_icons++; } /* If the DTSTART or DTEND are in a different timezone to our current - timezone, we display the timezone icon. */ + * timezone, we display the timezone icon. */ if (event->different_timezone) { draw_timezone_icon = TRUE; num_icons++; @@ -780,7 +784,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_move_to (cr, item_x + E_DAY_VIEW_BAR_WIDTH + 10, item_y + 13); else cairo_move_to (cr, icon_x, item_y + 13); - if ((red/cc > 0.7) || (green/cc > 0.7) || (blue/cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) cairo_set_source_rgb (cr, 0, 0, 0); else cairo_set_source_rgb (cr, 1, 1, 1); @@ -849,7 +853,7 @@ day_view_main_item_draw_events_in_vbars (EDayViewMainItem *main_item, continue; /* We can skip the events in the first column since they will - draw over this anyway. */ + * draw over this anyway. */ if (event->num_columns > 0 && event->start_row_or_col == 0) { continue; } @@ -936,8 +940,8 @@ day_view_main_item_dispose (GObject *object) static void day_view_main_item_update (GnomeCanvasItem *item, - const cairo_matrix_t *i2c, - gint flags) + const cairo_matrix_t *i2c, + gint flags) { GnomeCanvasItemClass *canvas_item_class; @@ -1155,12 +1159,12 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, } /* Fill in the vertical bars corresponding to the busy times from the - long events. */ + * long events. */ day_view_main_item_draw_long_events_in_vbars ( main_item, cr, x, y, width, height, draw_region); /* Draw the event borders and backgrounds, and the vertical bars - down the left edges. */ + * down the left edges. */ for (day = 0; day < day_view->days_shown; day++) day_view_main_item_draw_day_events ( main_item, cr, x, y, diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index e65dc4d617..928a91bbfb 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -35,17 +35,17 @@ #include <libedataserver/e-data-server-util.h> /* The spacing between items in the time column. GRID_X_PAD is the space down - either side of the column, i.e. outside the main horizontal grid lines. - HOUR_L_PAD & HOUR_R_PAD are the spaces on the left & right side of the - big hour number (this is inside the horizontal grid lines). - MIN_X_PAD is the spacing either side of the minute number. The smaller - horizontal grid lines match with this. - 60_MIN_X_PAD is the space either side of the HH:MM display used when - we are displaying 60 mins per row (inside the main grid lines). - LARGE_HOUR_Y_PAD is the offset of the large hour string from the top of the - row. - SMALL_FONT_Y_PAD is the offset of the small time/minute string from the top - of the row. */ + * either side of the column, i.e. outside the main horizontal grid lines. + * HOUR_L_PAD & HOUR_R_PAD are the spaces on the left & right side of the + * big hour number (this is inside the horizontal grid lines). + * MIN_X_PAD is the spacing either side of the minute number. The smaller + * horizontal grid lines match with this. + * 60_MIN_X_PAD is the space either side of the HH:MM display used when + * we are displaying 60 mins per row (inside the main grid lines). + * LARGE_HOUR_Y_PAD is the offset of the large hour string from the top of the + * row. + * SMALL_FONT_Y_PAD is the offset of the small time/minute string from the top + * of the row. */ #define E_DVTMI_TIME_GRID_X_PAD 4 #define E_DVTMI_HOUR_L_PAD 4 #define E_DVTMI_HOUR_R_PAD 2 @@ -272,8 +272,8 @@ e_day_view_time_item_get_type (void) static void e_day_view_time_item_update (GnomeCanvasItem *item, - const cairo_matrix_t *i2c, - gint flags) + const cairo_matrix_t *i2c, + gint flags) { if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, i2c, flags); @@ -348,11 +348,11 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, if (time_divisions == 60) { /* The right edge of the complete time string in 60-min - divisions, e.g. "14:00" or "2 pm". */ + * divisions, e.g. "14:00" or "2 pm". */ minute_x2 = long_line_x2 - E_DVTMI_60_MIN_X_PAD; /* These aren't used for 60-minute divisions, but we initialize - them to keep gcc happy. */ + * them to keep gcc happy. */ short_line_x1 = 0; large_hour_x2 = 0; } else { @@ -363,7 +363,7 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, day_view->max_minute_width); /* The start of the short horizontal line between the periods - within each hour. */ + * within each hour. */ short_line_x1 = long_line_x2 - E_DVTMI_MIN_X_PAD * 2 - max_minute_or_suffix_width; @@ -434,8 +434,8 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, small_font_y_offset = E_DVTMI_SMALL_FONT_Y_PAD; /* Calculate the minimum y position of the first row we need to draw. - This is normally one row height above the 0 position, but if we - are using the large font we may have to go back a bit further. */ + * This is normally one row height above the 0 position, but if we + * are using the large font we may have to go back a bit further. */ start_y = 0 - MAX (day_view->row_height, (pango_font_metrics_get_ascent (large_font_metrics) + pango_font_metrics_get_descent (large_font_metrics)) / PANGO_SCALE + @@ -484,7 +484,7 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, } /* Step through each row, drawing the times and the horizontal lines - between them. */ + * between them. */ for (row = 0, row_y = 0 - y; row < day_view->rows && row_y < height; row++, row_y += day_view->row_height) { @@ -496,7 +496,7 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, midnight_day && midnight_month; /* If the row is above the first row we want to draw just - increment the time and skip to the next row. */ + * increment the time and skip to the next row. */ if (row_y < start_y) { e_day_view_time_item_increment_time ( &hour, &minute, time_divisions); @@ -504,15 +504,15 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, } /* Calculate the actual hour number to display. For 12-hour - format we convert 0-23 to 12-11am/12-11pm. */ + * format we convert 0-23 to 12-11am / 12 - 11pm. */ e_day_view_convert_time_to_display (day_view, hour, &display_hour, &suffix, &suffix_width); if (time_divisions == 60) { /* 60 minute intervals - draw a long horizontal line - between hours and display as one long string, - e.g. "14:00" or "2 pm". */ + * between hours and display as one long string, + * e.g. "14:00" or "2 pm". */ cairo_save (cr); gdk_cairo_set_source_color (cr, &dark); cairo_save (cr); @@ -555,8 +555,8 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, if (minute == 0) { /* On the hour - draw a long horizontal line - before the hour and display the hour in the - large font. */ + * before the hour and display the hour in the + * large font. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &dark); @@ -591,7 +591,7 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, g_object_unref (layout); } else { /* Within the hour - draw a short line before - the time. */ + * the time. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &dark); cairo_set_line_width (cr, 0.7); @@ -602,11 +602,11 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, } /* Normally we display the minute in each - interval, but when using 30-minute intervals - we don't display the '30'. */ + * interval, but when using 30-minute intervals + * we don't display the '30'. */ if (time_divisions != 30 || minute != 30) { /* In 12-hour format we display 'am' or 'pm' - instead of '00'. */ + * instead of '00'. */ if (show_midnight_date) strcpy (buffer, midnight_month); else if (minute == 0 @@ -671,32 +671,35 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, } /* Increment the time by the 5/10/15/30/60 minute interval. - Note that time_divisions is never > 60, so we never have to - worry about adding more than 60 minutes. */ + * Note that time_divisions is never > 60, so we never have to + * worry about adding more than 60 minutes. */ static void -e_day_view_time_item_increment_time (gint *hour, - gint *minute, - gint time_divisions) +e_day_view_time_item_increment_time (gint *hour, + gint *minute, + gint time_divisions) { *minute += time_divisions; if (*minute >= 60) { *minute -= 60; /* Currently we never wrap around to the next day, but - we may do if we display extra timezones. */ + * we may do if we display extra timezones. */ *hour = (*hour + 1) % 24; } } static GnomeCanvasItem * -e_day_view_time_item_point (GnomeCanvasItem *item, double x, double y, - gint cx, gint cy) +e_day_view_time_item_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gint e_day_view_time_item_event (GnomeCanvasItem *item, - GdkEvent *event) + GdkEvent *event) { EDayViewTimeItem *time_item; @@ -885,7 +888,7 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, static void e_day_view_time_item_on_set_divisions (GtkWidget *item, - EDayViewTimeItem *time_item) + EDayViewTimeItem *time_item) { EDayView *day_view; ECalendarView *cal_view; @@ -905,7 +908,7 @@ e_day_view_time_item_on_set_divisions (GtkWidget *item, static void e_day_view_time_item_on_button_press (EDayViewTimeItem *time_item, - GdkEvent *event) + GdkEvent *event) { GdkWindow *window; EDayView *day_view; @@ -939,7 +942,7 @@ e_day_view_time_item_on_button_press (EDayViewTimeItem *time_item, static void e_day_view_time_item_on_button_release (EDayViewTimeItem *time_item, - GdkEvent *event) + GdkEvent *event) { EDayView *day_view; @@ -957,7 +960,7 @@ e_day_view_time_item_on_button_release (EDayViewTimeItem *time_item, static void e_day_view_time_item_on_motion_notify (EDayViewTimeItem *time_item, - GdkEvent *event) + GdkEvent *event) { EDayView *day_view; GnomeCanvas *canvas; @@ -986,7 +989,7 @@ e_day_view_time_item_on_motion_notify (EDayViewTimeItem *time_item, /* Returns the row corresponding to the y position, or -1. */ static gint e_day_view_time_item_convert_position_to_row (EDayViewTimeItem *time_item, - gint y) + gint y) { EDayView *day_view; gint row; @@ -1028,8 +1031,8 @@ e_day_view_time_item_set_day_view (EDayViewTimeItem *time_item, } /* Returns the minimum width needed for the column, by adding up all the - maximum widths of the strings. The string widths are all calculated in - the style_set handlers of EDayView and EDayViewTimeCanvas. */ + * maximum widths of the strings. The string widths are all calculated in + * the style_set handlers of EDayView and EDayViewTimeCanvas. */ gint e_day_view_time_item_get_column_width (EDayViewTimeItem *time_item) { @@ -1066,8 +1069,8 @@ e_day_view_time_item_get_column_width (EDayViewTimeItem *time_item) } /* Calculate the width of each time column, using the maximum of the - default format with large hour numbers, and the 60-min divisions - format which uses small text. */ + * default format with large hour numbers, and the 60-min divisions + * format which uses small text. */ max_suffix_width = MAX (day_view->am_string_width, day_view->pm_string_width); diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index 201d10394b..9b22fbe339 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -53,10 +53,10 @@ enum { static gpointer parent_class; /* This draws a little triangle to indicate that an event extends past - the days visible on screen. */ + * the days visible on screen. */ static void day_view_top_item_draw_triangle (EDayViewTopItem *top_item, - cairo_t *cr, + cairo_t *cr, gint x, gint y, gint w, @@ -79,7 +79,7 @@ day_view_top_item_draw_triangle (EDayViewTopItem *top_item, points[2].y = y + h - 1; /* If the height is odd we can use the same central point for both - lines. If it is even we use different end-points. */ + * lines. If it is even we use different end-points. */ c1 = c2 = y + (h / 2); if (h % 2 == 0) c1--; @@ -128,7 +128,7 @@ day_view_top_item_draw_triangle (EDayViewTopItem *top_item, static void day_view_top_item_draw_long_event (EDayViewTopItem *top_item, gint event_num, - cairo_t *cr, + cairo_t *cr, gint x, gint y, gint width, @@ -159,7 +159,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)); /* If the event is currently being dragged, don't draw it. It will - be drawn in the special drag items. */ + * be drawn in the special drag items. */ if (day_view->drag_event_day == E_DAY_VIEW_LONG_EVENT && day_view->drag_event_num == event_num) return; @@ -225,7 +225,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, draw_curved_rectangle (cr, x0, y0, rect_width, rect_height, radius); - cairo_set_source_rgb (cr, red/cc, green/cc, blue/cc); + cairo_set_source_rgb (cr, red / cc, green / cc, blue / cc); cairo_set_line_width (cr, 1.5); cairo_stroke (cr); cairo_restore (cr); @@ -245,13 +245,13 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, pat = cairo_pattern_create_linear (item_x - x + 5.5, item_y + 2.5 - y, item_x - x + 5, item_y - y + item_h + 7.5); - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.4); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 0, red / cc, green / cc, blue / cc, 0.4); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); - cairo_set_source_rgba (cr, red/cc, green/cc, blue/cc, 0); + cairo_set_source_rgba (cr, red / cc, green / cc, blue / cc, 0); cairo_set_line_width (cr, 0.5); cairo_stroke (cr); cairo_restore (cr); @@ -287,7 +287,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, } /* If we are editing the event we don't show the icons or the start - & end times. */ + * & end times. */ if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT && day_view->editing_event_num == event_num) { g_object_unref (comp); @@ -295,8 +295,8 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, } /* Determine the position of the label, so we know where to place the - icons. Note that since the top canvas never scrolls we don't need - to take the scroll offset into account. It will always be 0. */ + * icons. Note that since the top canvas never scrolls we don't need + * to take the scroll offset into account. It will always be 0. */ text_x = event->canvas_item->x1; /* Draw the start & end times, if necessary. */ @@ -312,7 +312,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, hour = offset / 60; minute = offset % 60; /* Calculate the actual hour number to display. For 12-hour - format we convert 0-23 to 12-11am/12-11pm. */ + * format we convert 0-23 to 12-11am/12-11pm. */ e_day_view_convert_time_to_display (day_view, hour, &display_hour, &suffix, &suffix_width); @@ -658,7 +658,7 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, if (show_dates) { /* Draw the date. Set a clipping rectangle so we don't draw over the - next day. */ + * next day. */ for (day = 0; day < day_view->days_shown; day++) { e_day_view_top_item_get_day_label (day_view, day, buffer, sizeof (buffer)); clip_rect.x = day_view->day_offsets[day] - x; @@ -844,15 +844,15 @@ e_day_view_top_item_get_day_label (EDayView *day_view, if (day_view->date_format == E_DAY_VIEW_DATE_FULL) /* strftime format %A = full weekday name, %d = day of month, - %B = full month name. Don't use any other specifiers. */ + * %B = full month name. Don't use any other specifiers. */ format = _("%A %d %B"); else if (day_view->date_format == E_DAY_VIEW_DATE_ABBREVIATED) /* strftime format %a = abbreviated weekday name, %d = day of month, - %b = abbreviated month name. Don't use any other specifiers. */ + * %b = abbreviated month name. Don't use any other specifiers. */ format = _("%a %d %b"); else if (day_view->date_format == E_DAY_VIEW_DATE_NO_WEEKDAY) /* strftime format %d = day of month, %b = abbreviated month name. - Don't use any other specifiers. */ + * Don't use any other specifiers. */ format = _("%d %b"); else format = "%d"; diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 11378cc25a..efad7dbc6f 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -76,23 +76,23 @@ #define E_DAY_VIEW_AUTO_SCROLL_DELAY 5 /* The number of pixels the mouse has to be moved with the button down before - we start a drag. */ + * we start a drag. */ #define E_DAY_VIEW_DRAG_START_OFFSET 4 /* The amount we scroll the main canvas when the Page Up/Down keys are pressed, - as a fraction of the page size. */ + * as a fraction of the page size. */ #define E_DAY_VIEW_PAGE_STEP 0.5 /* The amount we scroll the main canvas when the mouse wheel buttons are - pressed, as a fraction of the page size. */ + * pressed, as a fraction of the page size. */ #define E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE 0.25 /* The timeout before we do a layout, so we don't do a layout for each event - we get from the server. */ + * we get from the server. */ #define E_DAY_VIEW_LAYOUT_TIMEOUT 100 /* How many rows can be shown at a top_canvas; there will be always + 2 for - caption item and DnD space */ + * caption item and DnD space */ #define E_DAY_VIEW_MAX_ROWS_AT_TOP 6 typedef struct { @@ -449,12 +449,12 @@ day_view_notify_time_divisions_cb (EDayView *day_view) day_view->need_layout[day] = TRUE; /* We need to update all the day event labels since the start & end - times may or may not be on row boundaries any more. */ + * times may or may not be on row boundaries any more. */ e_day_view_foreach_event (day_view, e_day_view_set_show_times_cb, NULL); /* We must layout the events before updating the scroll region, since - that will result in a redraw which would crash otherwise. */ + * that will result in a redraw which would crash otherwise. */ e_day_view_check_layout (day_view); gtk_widget_queue_draw (day_view->time_canvas); gtk_widget_queue_draw (day_view->main_canvas); @@ -664,7 +664,10 @@ e_day_view_class_init (EDayViewClass *class) } static void -time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpointer user_data) +time_range_changed_cb (ECalModel *model, + time_t start_time, + time_t end_time, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); EDayViewTimeItem *eti; @@ -673,9 +676,9 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo g_return_if_fail (E_IS_DAY_VIEW (day_view)); /* Calculate the first day that should be shown, based on start_time - and the days_shown setting. If we are showing 1 day it is just the - start of the day given by start_time, otherwise it is the previous - work-week start day. */ + * and the days_shown setting. If we are showing 1 day it is just the + * start of the day given by start_time, otherwise it is the previous + * work-week start day. */ if (!day_view->work_week_view) { lower = time_day_begin_with_zone (start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } else { @@ -706,7 +709,8 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo } static void -process_component (EDayView *day_view, ECalModelComponent *comp_data) +process_component (EDayView *day_view, + ECalModelComponent *comp_data) { const gchar *uid; gchar *rid = NULL; @@ -742,7 +746,8 @@ process_component (EDayView *day_view, ECalModelComponent *comp_data) } static void -update_row (EDayView *day_view, gint row) +update_row (EDayView *day_view, + gint row) { ECalModelComponent *comp_data; ECalModel *model; @@ -778,7 +783,9 @@ update_row (EDayView *day_view, gint row) } static void -model_row_changed_cb (ETableModel *etm, gint row, gpointer user_data) +model_row_changed_cb (ETableModel *etm, + gint row, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); @@ -792,7 +799,10 @@ model_row_changed_cb (ETableModel *etm, gint row, gpointer user_data) } static void -model_cell_changed_cb (ETableModel *etm, gint col, gint row, gpointer user_data) +model_cell_changed_cb (ETableModel *etm, + gint col, + gint row, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); @@ -806,7 +816,10 @@ model_cell_changed_cb (ETableModel *etm, gint col, gint row, gpointer user_data) } static void -model_rows_inserted_cb (ETableModel *etm, gint row, gint count, gpointer user_data) +model_rows_inserted_cb (ETableModel *etm, + gint row, + gint count, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); ECalModel *model; @@ -839,7 +852,9 @@ model_rows_inserted_cb (ETableModel *etm, gint row, gint count, gpointer user_da } static void -model_comps_deleted_cb (ETableModel *etm, gpointer data, gpointer user_data) +model_comps_deleted_cb (ETableModel *etm, + gpointer data, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); GSList *l, *list = data; @@ -879,8 +894,10 @@ model_comps_deleted_cb (ETableModel *etm, gpointer data, gpointer user_data) } static void -timezone_changed_cb (ECalModel *cal_model, icaltimezone *old_zone, - icaltimezone *new_zone, gpointer user_data) +timezone_changed_cb (ECalModel *cal_model, + icaltimezone *old_zone, + icaltimezone *new_zone, + gpointer user_data) { struct icaltimetype tt; time_t lower; @@ -900,7 +917,7 @@ timezone_changed_cb (ECalModel *cal_model, icaltimezone *old_zone, return; /* Recalculate the new start of the first day. We just use exactly - the same time, but with the new timezone. */ + * the same time, but with the new timezone. */ tt = icaltime_from_timet_with_zone (day_view->lower, FALSE, old_zone); @@ -948,8 +965,8 @@ e_day_view_init (EDayView *day_view) day_view->rows_in_top_display = 0; /* Note that these don't work yet. It would need a few fixes to the - way event->start_minute and event->end_minute are used, and there - may be problems with events that go outside the visible times. */ + * way event->start_minute and event->end_minute are used, and there + * may be problems with events that go outside the visible times. */ day_view->first_hour_shown = 0; day_view->first_minute_shown = 0; day_view->last_hour_shown = 24; @@ -1236,28 +1253,35 @@ e_day_view_init (EDayView *day_view) } static void -init_model (EDayView *day_view, ECalModel *model) +init_model (EDayView *day_view, + ECalModel *model) { /* connect to ECalModel's signals */ - g_signal_connect (G_OBJECT (model), "time_range_changed", - G_CALLBACK (time_range_changed_cb), day_view); - g_signal_connect (G_OBJECT (model), "model_row_changed", - G_CALLBACK (model_row_changed_cb), day_view); - g_signal_connect (G_OBJECT (model), "model_cell_changed", - G_CALLBACK (model_cell_changed_cb), day_view); - g_signal_connect (G_OBJECT (model), "model_rows_inserted", - G_CALLBACK (model_rows_inserted_cb), day_view); - g_signal_connect (G_OBJECT (model), "comps_deleted", - G_CALLBACK (model_comps_deleted_cb), day_view); - g_signal_connect (G_OBJECT (model), "timezone_changed", - G_CALLBACK (timezone_changed_cb), day_view); + g_signal_connect ( + model, "time_range_changed", + G_CALLBACK (time_range_changed_cb), day_view); + g_signal_connect ( + model, "model_row_changed", + G_CALLBACK (model_row_changed_cb), day_view); + g_signal_connect ( + model, "model_cell_changed", + G_CALLBACK (model_cell_changed_cb), day_view); + g_signal_connect ( + model, "model_rows_inserted", + G_CALLBACK (model_rows_inserted_cb), day_view); + g_signal_connect ( + model, "comps_deleted", + G_CALLBACK (model_comps_deleted_cb), day_view); + g_signal_connect ( + model, "timezone_changed", + G_CALLBACK (timezone_changed_cb), day_view); } /* Turn off the background of the canvas windows. This reduces flicker - considerably when scrolling. (Why isn't it in GnomeCanvas?). */ + * considerably when scrolling. (Why isn't it in GnomeCanvas?). */ static void e_day_view_on_canvas_realized (GtkWidget *widget, - EDayView *day_view) + EDayView *day_view) { GdkWindow *window; @@ -1379,7 +1403,8 @@ e_day_view_realize (GtkWidget *widget) } static void -e_day_view_set_colors (EDayView *day_view, GtkWidget *widget) +e_day_view_set_colors (EDayView *day_view, + GtkWidget *widget) { GtkStyle *style; @@ -1425,7 +1450,9 @@ e_day_view_unrealize (GtkWidget *widget) } static GdkColor -e_day_view_get_text_color (EDayView *day_view, EDayViewEvent *event, GtkWidget *widget) +e_day_view_get_text_color (EDayView *day_view, + EDayViewEvent *event, + GtkWidget *widget) { GtkStyle *style; GdkColor bg_color; @@ -1445,21 +1472,22 @@ e_day_view_get_text_color (EDayView *day_view, EDayViewEvent *event, GtkWidget * style = gtk_widget_get_style (widget); - if ((red/cc > 0.7) || (green/cc > 0.7) || (blue/cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) return style->black; else return style->white; } static void -e_day_view_update_top_scroll (EDayView *day_view, gboolean scroll_to_top) +e_day_view_update_top_scroll (EDayView *day_view, + gboolean scroll_to_top) { GtkAllocation allocation; gint top_rows, top_canvas_height; gdouble old_x2, old_y2, new_x2, new_y2; /* Set the height of the top canvas based on the row height and the - number of rows needed (min 1 + 1 for the dates + 1 space for DnD).*/ + * number of rows needed (min 1 + 1 for the dates + 1 space for DnD).*/ top_rows = MAX (1, day_view->rows_in_top_display); top_canvas_height = (top_rows + 1) * day_view->top_row_height; if (top_rows <= E_DAY_VIEW_MAX_ROWS_AT_TOP) { @@ -1494,7 +1522,7 @@ e_day_view_update_top_scroll (EDayView *day_view, gboolean scroll_to_top) static void e_day_view_style_set (GtkWidget *widget, - GtkStyle *previous_style) + GtkStyle *previous_style) { EDayView *day_view; gint hour; @@ -1699,7 +1727,7 @@ e_day_view_recalc_main_canvas_size (EDayView *day_view) e_day_view_recalc_cell_sizes (day_view); /* Scroll to the start of the working day, if this is the initial - allocation. */ + * allocation. */ if (day_view->scroll_to_work_day) { scroll_y = e_day_view_convert_time_to_position ( day_view, work_day_start_hour, work_day_start_minute); @@ -1709,7 +1737,7 @@ e_day_view_recalc_main_canvas_size (EDayView *day_view) } /* Flag that we need to reshape the events. Note that changes in height - don't matter, since the rows are always the same height. */ + * don't matter, since the rows are always the same height. */ if (need_reshape) { day_view->long_events_need_reshape = TRUE; for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++) @@ -1721,21 +1749,19 @@ e_day_view_recalc_main_canvas_size (EDayView *day_view) /* This recalculates the sizes of each column. */ static void -e_day_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +e_day_view_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { -#if 0 - g_print ("In e_day_view_size_allocate\n"); -#endif (*GTK_WIDGET_CLASS (e_day_view_parent_class)->size_allocate) (widget, allocation); e_day_view_recalc_main_canvas_size (E_DAY_VIEW (widget)); } static void -e_day_view_recalc_cell_sizes (EDayView *day_view) +e_day_view_recalc_cell_sizes (EDayView *day_view) { /* An array of dates, one for each month in the year 2000. They must - all be Sundays. */ + * all be Sundays. */ static const gint days[12] = { 23, 20, 19, 23, 21, 18, 23, 20, 17, 22, 19, 24 }; gfloat width, offset; @@ -1756,8 +1782,8 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) layout = pango_layout_new (pango_context); /* Calculate the column sizes, using floating point so that pixels - get divided evenly. Note that we use one more element than the - number of columns, to make it easy to get the column widths. */ + * get divided evenly. Note that we use one more element than the + * number of columns, to make it easy to get the column widths. */ width = allocation.width; if (day_view->days_shown == 1) width = MAX (width, day_view->max_cols * (E_DAY_VIEW_MIN_DAY_COL_WIDTH + E_DAY_VIEW_GAP_WIDTH) - E_DAY_VIEW_MIN_DAY_COL_WIDTH - 1); @@ -1774,9 +1800,9 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) } /* Determine which date format to use, based on the column widths. - We want to check the widths using the longest full or abbreviated - month name and the longest full or abbreviated weekday name, as - appropriate. */ + * We want to check the widths using the longest full or abbreviated + * month name and the longest full or abbreviated weekday name, as + * appropriate. */ max_width = day_view->day_widths[0]; memset (&date_tm, 0, sizeof (date_tm)); @@ -1789,7 +1815,7 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) date_tm.tm_wday = day_view->longest_weekday_name; date_tm.tm_isdst = -1; /* strftime format %A = full weekday name, %d = day of month, - %B = full month name. Don't use any other specifiers. */ + * %B = full month name. Don't use any other specifiers. */ e_utf8_strftime (buffer, sizeof (buffer), _("%A %d %B"), &date_tm); pango_layout_set_text (layout, buffer, -1); pango_layout_get_pixel_size (layout, &pango_width, NULL); @@ -1806,7 +1832,7 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) date_tm.tm_wday = day_view->longest_abbreviated_weekday_name; date_tm.tm_isdst = -1; /* strftime format %a = abbreviated weekday name, %d = day of month, - %b = abbreviated month name. Don't use any other specifiers. */ + * %b = abbreviated month name. Don't use any other specifiers. */ e_utf8_strftime (buffer, sizeof (buffer), _("%a %d %b"), &date_tm); pango_layout_set_text (layout, buffer, -1); pango_layout_get_pixel_size (layout, &pango_width, NULL); @@ -1822,7 +1848,7 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) date_tm.tm_wday = 0; date_tm.tm_isdst = -1; /* strftime format %d = day of month, %b = abbreviated month name. - Don't use any other specifiers. */ + * Don't use any other specifiers. */ e_utf8_strftime (buffer, sizeof (buffer), _("%d %b"), &date_tm); pango_layout_set_text (layout, buffer, -1); pango_layout_get_pixel_size (layout, &pango_width, NULL); @@ -1837,7 +1863,8 @@ exit: } static gint -e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event) +e_day_view_focus_in (GtkWidget *widget, + GdkEventFocus *event) { EDayView *day_view; @@ -1863,7 +1890,7 @@ e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event) if (e_calendar_view_get_visible_time_range (E_CALENDAR_VIEW (day_view), &my_start, &my_end) && model_start == my_start && model_end == my_end) { /* update only when the same time range is set in a view and in a model; - otherwise time range change invokes also query update */ + * otherwise time range change invokes also query update */ e_day_view_recalc_day_starts (day_view, day_view->lower); e_day_view_update_query (day_view); } @@ -1876,7 +1903,8 @@ e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event) } static gint -e_day_view_focus_out (GtkWidget *widget, GdkEventFocus *event) +e_day_view_focus_out (GtkWidget *widget, + GdkEventFocus *event) { EDayView *day_view; @@ -1899,13 +1927,13 @@ e_day_view_focus_out (GtkWidget *widget, GdkEventFocus *event) } /* This calls a given function for each event instance (in both views). - If the callback returns FALSE the iteration is stopped. - Note that it is safe for the callback to remove the event (since we - step backwards through the arrays). */ + * If the callback returns FALSE the iteration is stopped. + * Note that it is safe for the callback to remove the event (since we + * step backwards through the arrays). */ static void -e_day_view_foreach_event (EDayView *day_view, - EDayViewForeachEventCallback callback, - gpointer data) +e_day_view_foreach_event (EDayView *day_view, + EDayViewForeachEventCallback callback, + gpointer data) { gint day, event_num; @@ -1928,14 +1956,14 @@ e_day_view_foreach_event (EDayView *day_view, } /* This calls a given function for each event instance that matches the given - uid. If the callback returns FALSE the iteration is stopped. - Note that it is safe for the callback to remove the event (since we - step backwards through the arrays). */ + * uid. If the callback returns FALSE the iteration is stopped. + * Note that it is safe for the callback to remove the event (since we + * step backwards through the arrays). */ static void e_day_view_foreach_event_with_uid (EDayView *day_view, - const gchar *uid, - EDayViewForeachEventCallback callback, - gpointer data) + const gchar *uid, + EDayViewForeachEventCallback callback, + gpointer data) { EDayViewEvent *event; gint day, event_num; @@ -1978,9 +2006,9 @@ e_day_view_foreach_event_with_uid (EDayView *day_view, static gboolean e_day_view_remove_event_cb (EDayView *day_view, - gint day, - gint event_num, - gpointer data) + gint day, + gint event_num, + gpointer data) { EDayViewEvent *event; @@ -2007,7 +2035,7 @@ e_day_view_remove_event_cb (EDayView *day_view, return TRUE; /* If we were editing this event, set editing_event_day to -1 so - on_editing_stopped doesn't try to update the event. */ + * on_editing_stopped doesn't try to update the event. */ if (day_view->editing_event_num == event_num && day_view->editing_event_day == day) { day_view->editing_event_num = -1; day_view->editing_event_day = -1; @@ -2064,8 +2092,8 @@ set_text_as_bold (EDayViewEvent *event) } /* The attendee has not yet accepted the meeting, display the summary as bolded. - If the attendee is not present, it might have come through a mailing list. - In that case, we never show the meeting as bold even if it is unaccepted. */ + * If the attendee is not present, it might have come through a mailing list. + * In that case, we never show the meeting as bold even if it is unaccepted. */ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL); @@ -2075,11 +2103,11 @@ set_text_as_bold (EDayViewEvent *event) } /* This updates the text shown for an event. If the event start or end do not - lie on a row boundary, the time is displayed before the summary. */ + * lie on a row boundary, the time is displayed before the summary. */ static void e_day_view_update_event_label (EDayView *day_view, - gint day, - gint event_num) + gint day, + gint event_num) { EDayViewEvent *event; ECalendarView *cal_view; @@ -2147,7 +2175,7 @@ e_day_view_update_event_label (EDayView *day_view, static void e_day_view_update_long_event_label (EDayView *day_view, - gint event_num) + gint event_num) { EDayViewEvent *event; const gchar *summary; @@ -2178,13 +2206,13 @@ e_day_view_update_long_event_label (EDayView *day_view, } /* Finds the day and index of the event with the given canvas item. - If is is a long event, -1 is returned as the day. - Returns TRUE if the event was found. */ + * If is is a long event, -1 is returned as the day. + * Returns TRUE if the event was found. */ gboolean e_day_view_find_event_from_item (EDayView *day_view, - GnomeCanvasItem *item, - gint *day_return, - gint *event_num_return) + GnomeCanvasItem *item, + gint *day_return, + gint *event_num_return) { EDayViewEvent *event; gint day, event_num; @@ -2217,19 +2245,19 @@ e_day_view_find_event_from_item (EDayView *day_view, } /* Finds the day and index of the event with the given uid. - If is is a long event, E_DAY_VIEW_LONG_EVENT is returned as the day. - Returns TRUE if an event with the uid was found. - Note that for recurring events there may be several EDayViewEvents, one - for each instance, all with the same iCalObject and uid. So only use this - function if you know the event doesn't recur or you are just checking to - see if any events with the uid exist. */ + * If is is a long event, E_DAY_VIEW_LONG_EVENT is returned as the day. + * Returns TRUE if an event with the uid was found. + * Note that for recurring events there may be several EDayViewEvents, one + * for each instance, all with the same iCalObject and uid. So only use this + * function if you know the event doesn't recur or you are just checking to + * see if any events with the uid exist. */ static gboolean e_day_view_find_event_from_uid (EDayView *day_view, - ECalClient *client, - const gchar *uid, - const gchar *rid, - gint *day_return, - gint *event_num_return) + ECalClient *client, + const gchar *uid, + const gchar *rid, + gint *day_return, + gint *event_num_return) { EDayViewEvent *event; gint day, event_num; @@ -2294,9 +2322,9 @@ e_day_view_find_event_from_uid (EDayView *day_view, } static void -e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view, - time_t start_time, - time_t end_time) +e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view, + time_t start_time, + time_t end_time) { gint start_row, start_col, end_row, end_col; gboolean need_redraw = FALSE, start_in_grid, end_in_grid; @@ -2342,9 +2370,9 @@ e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view, } static void -e_day_view_set_selected_time_range_visible (EDayView *day_view, - time_t start_time, - time_t end_time) +e_day_view_set_selected_time_range_visible (EDayView *day_view, + time_t start_time, + time_t end_time) { ECalModel *model; gint work_day_start_hour; @@ -2369,8 +2397,8 @@ e_day_view_set_selected_time_range_visible (EDayView *day_view, &end_row); /* If either of the times isn't in the grid, or the selection covers - an entire day, we set the selection to 1 row from the start of the - working day, in the day corresponding to the start time. */ + * an entire day, we set the selection to 1 row from the start of the + * working day, in the day corresponding to the start time. */ if (!start_in_grid || !end_in_grid || (start_row == 0 && end_row == day_view->rows - 1)) { end_col = start_col; @@ -2406,8 +2434,8 @@ e_day_view_set_selected_time_range_visible (EDayView *day_view, /* Finds the start of the working week which includes the given time. */ static time_t -e_day_view_find_work_week_start (EDayView *day_view, - time_t start_time) +e_day_view_find_work_week_start (EDayView *day_view, + time_t start_time) { GDate date; ECalModel *model; @@ -2422,14 +2450,14 @@ e_day_view_find_work_week_start (EDayView *day_view, time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); /* The start of the work-week is the first working day after the - week start day. */ + * week start day. */ /* Get the weekday corresponding to start_time, 0 (Sun) to 6 (Sat). */ weekday = g_date_get_weekday (&date) % 7; /* Calculate the first working day of the week, 0 (Sun) to 6 (Sat). - It will automatically default to the week start day if no days - are set as working days. */ + * It will automatically default to the week start day if no days + * are set as working days. */ day = (week_start_day + 1) % 7; for (i = 0; i < 7; i++) { if (day_view->working_days & (1 << day)) @@ -2454,12 +2482,12 @@ e_day_view_find_work_week_start (EDayView *day_view, } /* This sets the selected time range. If the start_time & end_time are not equal - and are both visible in the view, then the selection is set to those times, - otherwise it is set to 1 hour from the start of the working day. */ + * and are both visible in the view, then the selection is set to those times, + * otherwise it is set to 1 hour from the start of the working day. */ static void -e_day_view_set_selected_time_range (ECalendarView *cal_view, - time_t start_time, - time_t end_time) +e_day_view_set_selected_time_range (ECalendarView *cal_view, + time_t start_time, + time_t end_time) { ECalModel *model; EDayView *day_view; @@ -2484,8 +2512,8 @@ e_day_view_set_selected_time_range (ECalendarView *cal_view, &end_row); /* If either of the times isn't in the grid, or the selection covers - an entire day, we set the selection to 1 row from the start of the - working day, in the day corresponding to the start time. */ + * an entire day, we set the selection to 1 row from the start of the + * working day, in the day corresponding to the start time. */ if (!start_in_grid || !end_in_grid || (start_row == 0 && end_row == day_view->rows - 1)) { end_col = start_col; @@ -2521,7 +2549,9 @@ e_day_view_set_selected_time_range (ECalendarView *cal_view, /* Returns the selected time range. */ static gboolean -e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time) +e_day_view_get_selected_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { gint start_col, start_row, end_col, end_row; time_t start, end; @@ -2540,7 +2570,7 @@ e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, } /* Check if the selection is only in the top canvas, in which case - we can simply use the day_starts array. */ + * we can simply use the day_starts array. */ if (day_view->selection_in_top_canvas) { start = day_view->day_starts[start_col]; end = day_view->day_starts[end_col + 1]; @@ -2561,9 +2591,9 @@ e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, /* Gets the visible time range. Returns FALSE if no time range has been set. */ static gboolean -e_day_view_get_visible_time_range (ECalendarView *cal_view, - time_t *start_time, - time_t *end_time) +e_day_view_get_visible_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { EDayView *day_view = E_DAY_VIEW (cal_view); @@ -2579,7 +2609,7 @@ e_day_view_get_visible_time_range (ECalendarView *cal_view, static void e_day_view_recalc_day_starts (EDayView *day_view, - time_t start_time) + time_t start_time) { gint day; gchar *str; @@ -2612,9 +2642,9 @@ e_day_view_recalc_day_starts (EDayView *day_view, } /* Whether we are displaying a work-week, in which case the display always - starts on the first day of the working week. */ + * starts on the first day of the working week. */ gboolean -e_day_view_get_work_week_view (EDayView *day_view) +e_day_view_get_work_week_view (EDayView *day_view) { g_return_val_if_fail (E_IS_DAY_VIEW (day_view), FALSE); @@ -2622,8 +2652,8 @@ e_day_view_get_work_week_view (EDayView *day_view) } void -e_day_view_set_work_week_view (EDayView *day_view, - gboolean work_week_view) +e_day_view_set_work_week_view (EDayView *day_view, + gboolean work_week_view) { g_return_if_fail (E_IS_DAY_VIEW (day_view)); @@ -2637,7 +2667,7 @@ e_day_view_set_work_week_view (EDayView *day_view, } gint -e_day_view_get_days_shown (EDayView *day_view) +e_day_view_get_days_shown (EDayView *day_view) { g_return_val_if_fail (E_IS_DAY_VIEW (day_view), -1); @@ -2645,8 +2675,8 @@ e_day_view_get_days_shown (EDayView *day_view) } void -e_day_view_set_days_shown (EDayView *day_view, - gint days_shown) +e_day_view_set_days_shown (EDayView *day_view, + gint days_shown) { g_return_if_fail (E_IS_DAY_VIEW (day_view)); g_return_if_fail (days_shown >= 1); @@ -2668,7 +2698,7 @@ e_day_view_set_days_shown (EDayView *day_view, } /* This specifies the working days in the week. The value is a bitwise - combination of day flags. Defaults to Mon-Fri. */ + * combination of day flags. Defaults to Mon-Fri. */ EDayViewDays e_day_view_get_working_days (EDayView *day_view) { @@ -2692,14 +2722,14 @@ e_day_view_set_working_days (EDayView *day_view, e_day_view_recalc_work_week (day_view); /* We have to do this, as the new working days may have no effect on - the days shown, but we still want the background color to change. */ + * the days shown, but we still want the background color to change. */ gtk_widget_queue_draw (day_view->main_canvas); g_object_notify (G_OBJECT (day_view), "working-days"); } static void -e_day_view_recalc_work_week_days_shown (EDayView *day_view) +e_day_view_recalc_work_week_days_shown (EDayView *day_view) { ECalModel *model; gint week_start_day; @@ -2728,7 +2758,7 @@ e_day_view_recalc_work_week_days_shown (EDayView *day_view) last_day = (last_day + 6) % 7; } /* Now calculate the days we need to show to include all the - working days in the week. Add 1 to make it inclusive. */ + * working days in the week. Add 1 to make it inclusive. */ days_shown = (last_day + 7 - first_day) % 7 + 1; } else { /* If no working days are set, just use 7. */ @@ -2814,7 +2844,7 @@ e_day_view_marcus_bains_set_time_bar_color (EDayView *day_view, /* Whether we display event end times in the main canvas. */ gboolean -e_day_view_get_show_event_end_times (EDayView *day_view) +e_day_view_get_show_event_end_times (EDayView *day_view) { g_return_val_if_fail (E_IS_DAY_VIEW (day_view), TRUE); @@ -2822,8 +2852,8 @@ e_day_view_get_show_event_end_times (EDayView *day_view) } void -e_day_view_set_show_event_end_times (EDayView *day_view, - gboolean show) +e_day_view_set_show_event_end_times (EDayView *day_view, + gboolean show) { g_return_if_fail (E_IS_DAY_VIEW (day_view)); @@ -2836,10 +2866,10 @@ e_day_view_set_show_event_end_times (EDayView *day_view, /* This is a callback used to update all day event labels. */ static gboolean -e_day_view_set_show_times_cb (EDayView *day_view, - gint day, - gint event_num, - gpointer data) +e_day_view_set_show_times_cb (EDayView *day_view, + gint day, + gint event_num, + gpointer data) { if (day != E_DAY_VIEW_LONG_EVENT) { e_day_view_update_event_label (day_view, day, event_num); @@ -2849,7 +2879,7 @@ e_day_view_set_show_times_cb (EDayView *day_view, } static void -e_day_view_recalc_work_week (EDayView *day_view) +e_day_view_recalc_work_week (EDayView *day_view) { time_t lower; @@ -2890,7 +2920,7 @@ e_day_view_update_scroll_regions (EDayView *day_view) day_view->time_canvas, &time_canvas_allocation); /* Set the scroll region of the time canvas to its allocated width, - but with the height the same as the main canvas. */ + * but with the height the same as the main canvas. */ gnome_canvas_get_scroll_region ( GNOME_CANVAS (day_view->time_canvas), NULL, NULL, &old_x2, &old_y2); @@ -2902,7 +2932,7 @@ e_day_view_update_scroll_regions (EDayView *day_view) 0, 0, new_x2, new_y2); /* Set the scroll region of the main canvas to its allocated width, - but with the height depending on the number of rows needed. */ + * but with the height depending on the number of rows needed. */ gnome_canvas_get_scroll_region ( GNOME_CANVAS (day_view->main_canvas), NULL, NULL, &old_x2, &old_y2); @@ -2926,9 +2956,9 @@ e_day_view_update_scroll_regions (EDayView *day_view) } /* This recalculates the number of rows to display, based on the time range - shown and the minutes per row. */ + * shown and the minutes per row. */ static void -e_day_view_recalc_num_rows (EDayView *day_view) +e_day_view_recalc_num_rows (EDayView *day_view) { ECalendarView *cal_view; gint time_divisions; @@ -2945,12 +2975,12 @@ e_day_view_recalc_num_rows (EDayView *day_view) } /* Converts an hour and minute to a row in the canvas. Note that if we aren't - showing all 24 hours of the day, the returned row may be negative or - greater than day_view->rows. */ + * showing all 24 hours of the day, the returned row may be negative or + * greater than day_view->rows. */ gint -e_day_view_convert_time_to_row (EDayView *day_view, - gint hour, - gint minute) +e_day_view_convert_time_to_row (EDayView *day_view, + gint hour, + gint minute) { ECalendarView *cal_view; gint time_divisions; @@ -2971,9 +3001,9 @@ e_day_view_convert_time_to_row (EDayView *day_view, /* Converts an hour and minute to a y coordinate in the canvas. */ gint -e_day_view_convert_time_to_position (EDayView *day_view, - gint hour, - gint minute) +e_day_view_convert_time_to_position (EDayView *day_view, + gint hour, + gint minute) { ECalendarView *cal_view; gint time_divisions; @@ -2992,8 +3022,8 @@ e_day_view_convert_time_to_position (EDayView *day_view, static gboolean e_day_view_on_top_canvas_button_press (GtkWidget *widget, - GdkEventButton *event, - EDayView *day_view) + GdkEventButton *event, + EDayView *day_view) { gint event_x, event_y, day, event_num; ECalendarViewPosition pos; @@ -3010,9 +3040,9 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, day_view->drag_event_num = -1; /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) event, window, &event_x, &event_y)) + day_view, (GdkEvent *) event, window, &event_x, &event_y)) return FALSE; pos = e_day_view_convert_position_in_top_canvas (day_view, @@ -3076,10 +3106,10 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, static gboolean e_day_view_convert_event_coords (EDayView *day_view, - GdkEvent *event, - GdkWindow *window, - gint *x_return, - gint *y_return) + GdkEvent *event, + GdkWindow *window, + gint *x_return, + gint *y_return) { gint event_x, event_y, win_x, win_y; GdkWindow *event_window;; @@ -3126,8 +3156,8 @@ e_day_view_convert_event_coords (EDayView *day_view, static gboolean e_day_view_on_main_canvas_button_press (GtkWidget *widget, - GdkEventButton *event, - EDayView *day_view) + GdkEventButton *event, + EDayView *day_view) { gint event_x, event_y, row, day, event_num; ECalendarViewPosition pos; @@ -3148,9 +3178,9 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, day_view->drag_event_num = -1; /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) event, window, &event_x, &event_y)) + day_view, (GdkEvent *) event, window, &event_x, &event_y)) return FALSE; /* Find out where the mouse is. */ @@ -3218,8 +3248,8 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, static gboolean e_day_view_on_main_canvas_scroll (GtkWidget *widget, - GdkEventScroll *scroll, - EDayView *day_view) + GdkEventScroll *scroll, + EDayView *day_view) { switch (scroll->direction) { case GDK_SCROLL_UP: @@ -3237,8 +3267,8 @@ e_day_view_on_main_canvas_scroll (GtkWidget *widget, static gboolean e_day_view_on_top_canvas_scroll (GtkWidget *widget, - GdkEventScroll *scroll, - EDayView *day_view) + GdkEventScroll *scroll, + EDayView *day_view) { switch (scroll->direction) { case GDK_SCROLL_UP: @@ -3253,9 +3283,9 @@ e_day_view_on_top_canvas_scroll (GtkWidget *widget, } static gboolean -e_day_view_on_time_canvas_scroll (GtkWidget *widget, - GdkEventScroll *scroll, - EDayView *day_view) +e_day_view_on_time_canvas_scroll (GtkWidget *widget, + GdkEventScroll *scroll, + EDayView *day_view) { GtkWidget *tool_window = g_object_get_data ((GObject *)day_view, "tooltip-window"); @@ -3277,12 +3307,12 @@ e_day_view_on_time_canvas_scroll (GtkWidget *widget, } static gboolean -e_day_view_on_long_event_button_press (EDayView *day_view, - gint event_num, - GdkEventButton *event, - ECalendarViewPosition pos, - gint event_x, - gint event_y) +e_day_view_on_long_event_button_press (EDayView *day_view, + gint event_num, + GdkEventButton *event, + ECalendarViewPosition pos, + gint event_x, + gint event_y) { if (event->button == 1) { if (event->type == GDK_BUTTON_PRESS) { @@ -3316,13 +3346,13 @@ e_day_view_on_long_event_button_press (EDayView *day_view, } static gboolean -e_day_view_on_event_button_press (EDayView *day_view, - gint day, - gint event_num, - GdkEventButton *event, - ECalendarViewPosition pos, - gint event_x, - gint event_y) +e_day_view_on_event_button_press (EDayView *day_view, + gint day, + gint event_num, + GdkEventButton *event, + ECalendarViewPosition pos, + gint event_x, + gint event_y) { if (event->button == 1) { if (event->type == GDK_BUTTON_PRESS) { @@ -3357,11 +3387,11 @@ e_day_view_on_event_button_press (EDayView *day_view, static void e_day_view_on_long_event_click (EDayView *day_view, - gint event_num, - GdkEventButton *bevent, - ECalendarViewPosition pos, - gint event_x, - gint event_y) + gint event_num, + GdkEventButton *bevent, + ECalendarViewPosition pos, + gint event_x, + gint event_y) { EDayViewEvent *event; GtkLayout *layout; @@ -3381,7 +3411,7 @@ e_day_view_on_long_event_click (EDayView *day_view, /* Ignore clicks on the EText while editing. */ if (pos == E_CALENDAR_VIEW_POS_EVENT && E_TEXT (event->canvas_item)->editing) { - GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent*) bevent); + GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent *) bevent); return; } @@ -3396,7 +3426,7 @@ e_day_view_on_long_event_click (EDayView *day_view, return; /* Grab the keyboard focus, so the event being edited is saved - and we can use the Escape key to abort the resize. */ + * and we can use the Escape key to abort the resize. */ if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) gtk_widget_grab_focus (GTK_WIDGET (day_view)); @@ -3422,7 +3452,7 @@ e_day_view_on_long_event_click (EDayView *day_view, &item_x, &item_y, &item_w, &item_h)) { /* Remember the item clicked and the mouse position, - so we can start a drag if the mouse moves. */ + * so we can start a drag if the mouse moves. */ day_view->pressed_event_day = E_DAY_VIEW_LONG_EVENT; day_view->pressed_event_num = event_num; @@ -3438,12 +3468,12 @@ e_day_view_on_long_event_click (EDayView *day_view, static void e_day_view_on_event_click (EDayView *day_view, - gint day, - gint event_num, - GdkEventButton *bevent, - ECalendarViewPosition pos, - gint event_x, - gint event_y) + gint day, + gint event_num, + GdkEventButton *bevent, + ECalendarViewPosition pos, + gint event_x, + gint event_y) { EDayViewEvent *event; ECalendarView *cal_view; @@ -3467,7 +3497,7 @@ e_day_view_on_event_click (EDayView *day_view, /* Ignore clicks on the EText while editing. */ if (pos == E_CALENDAR_VIEW_POS_EVENT && E_TEXT (event->canvas_item)->editing) { - GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent*) bevent); + GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent *) bevent); return; } @@ -3480,7 +3510,7 @@ e_day_view_on_event_click (EDayView *day_view, } /* Grab the keyboard focus, so the event being edited is saved - and we can use the Escape key to abort the resize. */ + * and we can use the Escape key to abort the resize. */ if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) gtk_widget_grab_focus (GTK_WIDGET (day_view)); @@ -3511,7 +3541,7 @@ e_day_view_on_event_click (EDayView *day_view, } else { /* Remember the item clicked and the mouse position, - so we can start a drag if the mouse moves. */ + * so we can start a drag if the mouse moves. */ day_view->pressed_event_day = day; day_view->pressed_event_num = event_num; @@ -3529,8 +3559,8 @@ e_day_view_on_event_click (EDayView *day_view, static void e_day_view_on_event_double_click (EDayView *day_view, - gint day, - gint event_num) + gint day, + gint event_num) { EDayViewEvent *event; @@ -3556,9 +3586,9 @@ e_day_view_on_event_double_click (EDayView *day_view, static void e_day_view_show_popup_menu (EDayView *day_view, - GdkEventButton *event, - gint day, - gint event_num) + GdkEventButton *event, + gint day, + gint event_num) { day_view->popup_event_day = day; day_view->popup_event_num = event_num; @@ -3660,17 +3690,17 @@ e_day_view_update_query (EDayView *day_view) static void e_day_view_on_event_right_click (EDayView *day_view, - GdkEventButton *bevent, - gint day, - gint event_num) + GdkEventButton *bevent, + gint day, + gint event_num) { e_day_view_show_popup_menu (day_view, bevent, day, event_num); } static gboolean e_day_view_on_top_canvas_button_release (GtkWidget *widget, - GdkEventButton *event, - EDayView *day_view) + GdkEventButton *event, + EDayView *day_view) { if (day_view->selection_is_being_dragged) { gdk_pointer_ungrab (event->time); @@ -3692,8 +3722,8 @@ e_day_view_on_top_canvas_button_release (GtkWidget *widget, static gboolean e_day_view_on_main_canvas_button_release (GtkWidget *widget, - GdkEventButton *event, - EDayView *day_view) + GdkEventButton *event, + EDayView *day_view) { #if 0 g_print ("In e_day_view_on_main_canvas_button_release\n"); @@ -3742,8 +3772,8 @@ e_day_view_update_calendar_selection_time (EDayView *day_view) static gboolean e_day_view_on_top_canvas_motion (GtkWidget *widget, - GdkEventMotion *mevent, - EDayView *day_view) + GdkEventMotion *mevent, + EDayView *day_view) { EDayViewEvent *event = NULL; ECalendarViewPosition pos; @@ -3759,9 +3789,9 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) mevent, window, &event_x, &event_y)) + day_view, (GdkEvent *) mevent, window, &event_x, &event_y)) return FALSE; canvas_x = event_x; @@ -3818,7 +3848,7 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, e_target_list_add_calendar_targets (target_list, 0); gtk_drag_begin (widget, target_list, GDK_ACTION_COPY | GDK_ACTION_MOVE, - 1, (GdkEvent*) mevent); + 1, (GdkEvent *) mevent); gtk_target_list_unref (target_list); } } else { @@ -3847,7 +3877,7 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, } if (event && E_IS_TEXT (event->canvas_item) && E_TEXT (event->canvas_item)->editing) { - GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent*) mevent); + GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent *) mevent); } } @@ -3856,8 +3886,8 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, static gboolean e_day_view_on_main_canvas_motion (GtkWidget *widget, - GdkEventMotion *mevent, - EDayView *day_view) + GdkEventMotion *mevent, + EDayView *day_view) { EDayViewEvent *event = NULL; ECalendarViewPosition pos; @@ -3873,9 +3903,9 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) mevent, window, &event_x, &event_y)) + day_view, (GdkEvent *) mevent, window, &event_x, &event_y)) return FALSE; canvas_x = event_x; @@ -3930,7 +3960,7 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, e_target_list_add_calendar_targets (target_list, 0); gtk_drag_begin (widget, target_list, GDK_ACTION_COPY | GDK_ACTION_MOVE, - 1, (GdkEvent*) mevent); + 1, (GdkEvent *) mevent); gtk_target_list_unref (target_list); } } else { @@ -3963,7 +3993,7 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, } if (event && E_IS_TEXT (event->canvas_item) && E_TEXT (event->canvas_item)->editing) { - GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent*) mevent); + GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent *) mevent); } } @@ -3971,12 +4001,12 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, } /* This sets the selection to a single cell. If day is -1 then the current - start day is reused. If row is -1 then the selection is in the top canvas. + * start day is reused. If row is -1 then the selection is in the top canvas. */ void e_day_view_start_selection (EDayView *day_view, - gint day, - gint row) + gint day, + gint row) { if (day == -1) { day = day_view->selection_start_day; @@ -4000,11 +4030,11 @@ e_day_view_start_selection (EDayView *day_view, } /* Updates the selection during a drag. If day is -1 the selection day is - unchanged. */ + * unchanged. */ void e_day_view_update_selection (EDayView *day_view, - gint day, - gint row) + gint day, + gint row) { gboolean need_redraw = FALSE; @@ -4075,7 +4105,7 @@ e_day_view_finish_selection (EDayView *day_view) static void e_day_view_update_long_event_resize (EDayView *day_view, - gint day) + gint day) { gint event_num; gboolean need_reshape = FALSE; @@ -4110,7 +4140,7 @@ e_day_view_update_long_event_resize (EDayView *day_view, static void e_day_view_update_resize (EDayView *day_view, - gint row) + gint row) { /* Same thing again? */ EDayViewEvent *event; @@ -4161,7 +4191,7 @@ e_day_view_update_resize (EDayView *day_view, } /* This converts the resize start or end row back to a time and updates the - event. */ + * event. */ static void e_day_view_finish_long_event_resize (EDayView *day_view) { @@ -4190,8 +4220,8 @@ e_day_view_finish_long_event_resize (EDayView *day_view) client = event->comp_data->client; /* We use a temporary copy of the comp since we don't want to - change the original comp here. Otherwise we would not detect that - the event's time had changed in the "update_event" callback. */ + * change the original comp here. Otherwise we would not detect that + * the event's time had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -4276,7 +4306,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) } /* This converts the resize start or end row back to a time and updates the - event. */ + * event. */ static void e_day_view_finish_resize (EDayView *day_view) { @@ -4308,8 +4338,8 @@ e_day_view_finish_resize (EDayView *day_view) client = event->comp_data->client; /* We use a temporary shallow copy of the ico since we don't want to - change the original ico here. Otherwise we would not detect that - the event's time had changed in the "update_event" callback. */ + * change the original ico here. Otherwise we would not detect that + * the event's time had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -4443,7 +4473,7 @@ e_day_view_free_events (EDayView *day_view) static void e_day_view_free_event_array (EDayView *day_view, - GArray *array) + GArray *array) { EDayViewEvent *event; gint event_num; @@ -4463,9 +4493,9 @@ e_day_view_free_event_array (EDayView *day_view, /* This adds one event to the view, adding it to the appropriate array. */ static gboolean e_day_view_add_event (ECalComponent *comp, - time_t start, - time_t end, - gpointer data) + time_t start, + time_t end, + gpointer data) { EDayViewEvent event; @@ -4513,7 +4543,7 @@ e_day_view_add_event (ECalComponent *comp, event.comp_data->instance_end = end; /* Calculate the start & end minute, relative to the top of the - display. */ + * display. */ offset = add_event_data->day_view->first_hour_shown * 60 + add_event_data->day_view->first_minute_shown; event.start_minute = start_tt.hour * 60 + start_tt.minute - offset; @@ -4539,12 +4569,12 @@ e_day_view_add_event (ECalComponent *comp, && end <= add_event_data->day_view->day_starts[day + 1]) { /* Special case for when the appointment ends at - midnight, i.e. the start of the next day. */ + * midnight, i.e. the start of the next day. */ if (end == add_event_data->day_view->day_starts[day + 1]) { /* If the event last the entire day, then we - skip it here so it gets added to the top - canvas. */ + * skip it here so it gets added to the top + * canvas. */ if (start == add_event_data->day_view->day_starts[day]) break; @@ -4559,7 +4589,7 @@ e_day_view_add_event (ECalComponent *comp, } /* The event wasn't within one day so it must be a long event, - i.e. shown in the top canvas. */ + * i.e. shown in the top canvas. */ g_array_append_val (add_event_data->day_view->long_events, event); add_event_data->day_view->long_events_sorted = FALSE; add_event_data->day_view->long_events_need_layout = TRUE; @@ -4567,7 +4597,7 @@ e_day_view_add_event (ECalComponent *comp, } /* This lays out the short (less than 1 day) events in the columns. - Any long events are simply skipped. */ + * Any long events are simply skipped. */ void e_day_view_check_layout (EDayView *day_view) { @@ -4666,7 +4696,7 @@ e_day_view_reshape_long_events (EDayView *day_view) static void e_day_view_reshape_long_event (EDayView *day_view, - gint event_num) + gint event_num) { EDayViewEvent *event; gint start_day, end_day, item_x, item_y, item_w, item_h; @@ -4705,7 +4735,7 @@ e_day_view_reshape_long_event (EDayView *day_view, item_h -= (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2; /* We don't show the icons while resizing, since we'd have to - draw them on top of the resize rect. Nor when editing. */ + * draw them on top of the resize rect. Nor when editing. */ num_icons = 0; comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -4770,9 +4800,9 @@ e_day_view_reshape_long_event (EDayView *day_view, } /* Calculate its position. We first calculate the ideal position which - is centered with the icons. We then make sure we haven't gone off - the left edge of the available space. Finally we make sure we don't - go off the right edge. */ + * is centered with the icons. We then make sure we haven't gone off + * the left edge of the available space. Finally we make sure we don't + * go off the right edge. */ icons_width = (E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD) * num_icons + E_DAY_VIEW_LONG_EVENT_ICON_R_PAD; time_width = e_day_view_get_time_string_width (day_view); @@ -4782,7 +4812,7 @@ e_day_view_reshape_long_event (EDayView *day_view, text_w = item_w; } else { /* Get the requested size of the label. */ - g_object_get (G_OBJECT (event->canvas_item), "text", &text, NULL); + g_object_get (event->canvas_item, "text", &text, NULL); text_width = 0; if (text) { end_of_line = strchr (text, '\n'); @@ -4828,10 +4858,10 @@ e_day_view_reshape_long_event (EDayView *day_view, } /* This creates or updates the sizes of the canvas items for one day of the - main canvas. */ + * main canvas. */ static void e_day_view_reshape_day_events (EDayView *day_view, - gint day) + gint day) { gint event_num; @@ -4863,8 +4893,8 @@ e_day_view_reshape_day_events (EDayView *day_view, static void e_day_view_reshape_day_event (EDayView *day_view, - gint day, - gint event_num) + gint day, + gint event_num) { EDayViewEvent *event; gint item_x, item_y, item_w, item_h; @@ -4891,7 +4921,7 @@ e_day_view_reshape_day_event (EDayView *day_view, item_h -= (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2; /* We don't show the icons while resizing, since we'd have to - draw them on top of the resize rect. */ + * draw them on top of the resize rect. */ icons_offset = 0; num_icons = 0; if (is_comp_data_valid (event) && (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_NONE @@ -4967,7 +4997,7 @@ e_day_view_reshape_day_event (EDayView *day_view, } /* This creates or resizes the horizontal bars used to resize events in the - main canvas. */ + * main canvas. */ static void e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view) { @@ -4979,10 +5009,10 @@ e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view) event_num = day_view->resize_bars_event_num; /* If we're not editing an event, or the event is not shown, - hide the resize bars. */ + * hide the resize bars. */ if (day != -1 && day == day_view->drag_event_day && event_num == day_view->drag_event_num) { - g_object_get (G_OBJECT (day_view->drag_rect_item), + g_object_get (day_view->drag_rect_item, "x1", &x, "y1", &y, "x2", &w, @@ -5034,12 +5064,12 @@ e_day_view_ensure_events_sorted (EDayView *day_view) gint e_day_view_event_sort_func (gconstpointer arg1, - gconstpointer arg2) + gconstpointer arg2) { EDayViewEvent *event1, *event2; - event1 = (EDayViewEvent*) arg1; - event2 = (EDayViewEvent*) arg2; + event1 = (EDayViewEvent *) arg1; + event2 = (EDayViewEvent *) arg2; if (event1->start < event2->start) return -1; @@ -5055,7 +5085,8 @@ e_day_view_event_sort_func (gconstpointer arg1, } static gboolean -e_day_view_add_new_event_in_selected_range (EDayView *day_view, GdkEventKey *key_event) +e_day_view_add_new_event_in_selected_range (EDayView *day_view, + GdkEventKey *key_event) { icalcomponent *icalcomp; ECalClient *client; @@ -5115,7 +5146,7 @@ e_day_view_add_new_event_in_selected_range (EDayView *day_view, GdkEventKey *key comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (day_view))); /* We add the event locally and start editing it. We don't send it - to the server until the user finishes editing it. */ + * to the server until the user finishes editing it. */ add_event_data.day_view = day_view; add_event_data.comp_data = NULL; e_day_view_add_event (comp, dtstart, dtend, &add_event_data); @@ -5136,7 +5167,8 @@ e_day_view_add_new_event_in_selected_range (EDayView *day_view, GdkEventKey *key } static gboolean -e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) +e_day_view_do_key_press (GtkWidget *widget, + GdkEventKey *event) { EDayView *day_view; guint keyval; @@ -5258,7 +5290,7 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) return FALSE; /* We only want to start an edit with a return key or a simple - character. */ + * character. */ if ((keyval != GDK_KEY_Return) && (((keyval >= 0x20) && (keyval <= 0xFF) && (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))) @@ -5271,7 +5303,8 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) } static gboolean -e_day_view_key_press (GtkWidget *widget, GdkEventKey *event) +e_day_view_key_press (GtkWidget *widget, + GdkEventKey *event) { gboolean handled = FALSE; handled = e_day_view_do_key_press (widget, event); @@ -5330,7 +5363,7 @@ e_day_view_goto_end_of_work_day (EDayView *day_view) else day_view->selection_start_row = e_day_view_convert_time_to_row ( - day_view, work_day_end_hour-1, work_day_end_minute+30); + day_view, work_day_end_hour - 1, work_day_end_minute + 30); day_view->selection_end_row = day_view->selection_start_row; e_day_view_ensure_rows_visible (day_view, @@ -5403,7 +5436,7 @@ e_day_view_change_duration_to_end_of_work_day (EDayView *day_view) gint work_end_row,selection_start_row; work_end_row = e_day_view_convert_time_to_row ( - day_view, work_day_end_hour-1, work_day_end_minute+30); + day_view, work_day_end_hour - 1, work_day_end_minute + 30); selection_start_row = day_view->selection_start_row; if (selection_start_row <= work_end_row) day_view->selection_end_row = work_end_row; @@ -5425,7 +5458,8 @@ e_day_view_change_duration_to_end_of_work_day (EDayView *day_view) } static void -e_day_view_cursor_key_up_shifted (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_up_shifted (EDayView *day_view, + GdkEventKey *event) { gint *row; @@ -5454,7 +5488,8 @@ e_day_view_cursor_key_up_shifted (EDayView *day_view, GdkEventKey *event) } static gboolean -e_day_view_focus (GtkWidget *widget, GtkDirectionType direction) +e_day_view_focus (GtkWidget *widget, + GtkDirectionType direction) { EDayView *day_view; gint new_day; @@ -5505,9 +5540,12 @@ e_day_view_focus (GtkWidget *widget, GtkDirectionType direction) * Return value: %TRUE, if a event found. **/ static gboolean -e_day_view_get_extreme_event (EDayView *day_view, gint start_day, - gint end_day, gboolean first, - gint *day_out, gint *event_num_out) +e_day_view_get_extreme_event (EDayView *day_view, + gint start_day, + gint end_day, + gboolean first, + gint *day_out, + gint *event_num_out) { gint loop_day; @@ -5553,8 +5591,10 @@ e_day_view_get_extreme_event (EDayView *day_view, gint start_day, * Return value: %TRUE, if a event found. **/ static gboolean -e_day_view_get_extreme_long_event (EDayView *day_view, gboolean first, - gint *day_out, gint *event_num_out) +e_day_view_get_extreme_long_event (EDayView *day_view, + gboolean first, + gint *day_out, + gint *event_num_out) { g_return_val_if_fail (day_view != NULL, FALSE); g_return_val_if_fail (day_out && event_num_out, FALSE); @@ -5589,8 +5629,10 @@ e_day_view_get_extreme_long_event (EDayView *day_view, gboolean first, * Return value: %TRUE, if a event found. **/ static gboolean -e_day_view_get_next_tab_event (EDayView *day_view, GtkDirectionType direction, - gint *day_out, gint *event_num_out) +e_day_view_get_next_tab_event (EDayView *day_view, + GtkDirectionType direction, + gint *day_out, + gint *event_num_out) { gint new_day; gint new_event_num; @@ -5707,7 +5749,8 @@ e_day_view_get_next_tab_event (EDayView *day_view, GtkDirectionType direction, } static void -e_day_view_cursor_key_down_shifted (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_down_shifted (EDayView *day_view, + GdkEventKey *event) { gint *row; @@ -5736,7 +5779,8 @@ e_day_view_cursor_key_down_shifted (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_left_shifted (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_left_shifted (EDayView *day_view, + GdkEventKey *event) { gint *day; @@ -5760,7 +5804,8 @@ e_day_view_cursor_key_left_shifted (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_right_shifted (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_right_shifted (EDayView *day_view, + GdkEventKey *event) { gint *day; @@ -5784,7 +5829,8 @@ e_day_view_cursor_key_right_shifted (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_up (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_up (EDayView *day_view, + GdkEventKey *event) { if (day_view->selection_start_day == -1) { day_view->selection_start_day = 0; @@ -5816,7 +5862,8 @@ e_day_view_cursor_key_up (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_down (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_down (EDayView *day_view, + GdkEventKey *event) { if (day_view->selection_start_day == -1) { day_view->selection_start_day = 0; @@ -5848,7 +5895,8 @@ e_day_view_cursor_key_down (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_left (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_left (EDayView *day_view, + GdkEventKey *event) { if (day_view->selection_start_day == 0) { gnome_calendar_previous (e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view))); @@ -5866,7 +5914,8 @@ e_day_view_cursor_key_left (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_right (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_right (EDayView *day_view, + GdkEventKey *event) { if (day_view->selection_end_day == day_view->days_shown - 1) { gnome_calendar_next (e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view))); @@ -5884,12 +5933,12 @@ e_day_view_cursor_key_right (EDayView *day_view, GdkEventKey *event) } /* Scrolls the main canvas up or down. The pages_to_scroll argument - is multiplied with the adjustment's page size and added to the adjustment's - value, while ensuring we stay within the bounds. A positive value will - scroll the canvas down and a negative value will scroll it up. */ + * is multiplied with the adjustment's page size and added to the adjustment's + * value, while ensuring we stay within the bounds. A positive value will + * scroll the canvas down and a negative value will scroll it up. */ static void -e_day_view_scroll (EDayView *day_view, - gfloat pages_to_scroll) +e_day_view_scroll (EDayView *day_view, + gfloat pages_to_scroll) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -5913,8 +5962,8 @@ e_day_view_scroll (EDayView *day_view, } static void -e_day_view_top_scroll (EDayView *day_view, - gfloat pages_to_scroll) +e_day_view_top_scroll (EDayView *day_view, + gfloat pages_to_scroll) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -5939,8 +5988,8 @@ e_day_view_top_scroll (EDayView *day_view, void e_day_view_ensure_rows_visible (EDayView *day_view, - gint start_row, - gint end_row) + gint start_row, + gint end_row) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -5968,9 +6017,9 @@ e_day_view_ensure_rows_visible (EDayView *day_view, static void e_day_view_start_editing_event (EDayView *day_view, - gint day, - gint event_num, - GdkEventKey *key_event) + gint day, + gint event_num, + GdkEventKey *key_event) { EDayViewEvent *event; ETextEventProcessor *event_processor = NULL; @@ -6010,9 +6059,9 @@ e_day_view_start_editing_event (EDayView *day_view, return; /* We must grab the focus before setting the initial text, since - grabbing the focus will result in a call to - e_day_view_on_editing_started (), which will reset the text to get - rid of the start and end times. */ + * grabbing the focus will result in a call to + * e_day_view_on_editing_started (), which will reset the text to get + * rid of the start and end times. */ e_canvas_item_grab_focus (event->canvas_item, TRUE); if (key_event) { @@ -6032,7 +6081,7 @@ e_day_view_start_editing_event (EDayView *day_view, } /* Try to move the cursor to the end of the text. */ - g_object_get (G_OBJECT (event->canvas_item), + g_object_get (event->canvas_item, "event_processor", &event_processor, NULL); if (event_processor) { @@ -6044,7 +6093,7 @@ e_day_view_start_editing_event (EDayView *day_view, } /* This stops the current edit. If accept is TRUE the event summary is updated, - else the edit is cancelled. */ + * else the edit is cancelled. */ static void e_day_view_stop_editing_event (EDayView *day_view) { @@ -6091,7 +6140,7 @@ cancel_editing (EDayView *day_view) /* Reset the text to what was in the component */ summary = icalcomponent_get_summary (event->comp_data->icalcomp); - g_object_set (G_OBJECT (event->canvas_item), + g_object_set (event->canvas_item, "text", summary ? summary : "", NULL); @@ -6100,7 +6149,9 @@ cancel_editing (EDayView *day_view) } static EDayViewEvent * -tooltip_get_view_event (EDayView *day_view, gint day, gint event_num) +tooltip_get_view_event (EDayView *day_view, + gint day, + gint event_num) { EDayViewEvent *pevent; @@ -6122,7 +6173,8 @@ tooltip_get_view_event (EDayView *day_view, gint day, gint event_num) } static void -tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item) +tooltip_destroy (EDayView *day_view, + GnomeCanvasItem *item) { EDayViewEvent *pevent; gint event_num = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-num")); @@ -6146,8 +6198,8 @@ tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item) static gboolean e_day_view_on_text_item_event (GnomeCanvasItem *item, - GdkEvent *event, - EDayView *day_view) + GdkEvent *event, + EDayView *day_view) { switch (event->type) { case GDK_KEY_PRESS: @@ -6156,11 +6208,11 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, day_view->resize_event_num = -1; /* We set the keyboard focus to the EDayView, so the - EText item loses it and stops the edit. */ + * EText item loses it and stops the edit. */ gtk_widget_grab_focus (GTK_WIDGET (day_view)); /* Stop the signal last or we will also stop any - other events getting to the EText item. */ + * other events getting to the EText item. */ g_signal_stop_emission_by_name (item, "event"); return TRUE; } else if (event->key.keyval == GDK_KEY_Escape) { @@ -6229,11 +6281,11 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, break; /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ layout = GTK_LAYOUT (day_view->main_canvas); window = gtk_layout_get_bin_window (layout); if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) event, + day_view, (GdkEvent *) event, window, &event_x, &event_y)) { main_canvas = FALSE; @@ -6241,7 +6293,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, layout = GTK_LAYOUT (day_view->top_canvas); window = gtk_layout_get_bin_window (layout); if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) event, + day_view, (GdkEvent *) event, window, &event_x, &event_y)) { return FALSE; } @@ -6265,7 +6317,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, break; /* even when returns position inside, or other, then the day and/or event_num - can be unknown, thus check for this here, otherwise it will crash later */ + * can be unknown, thus check for this here, otherwise it will crash later */ if (day == -1 || event_num == -1) break; @@ -6305,7 +6357,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (day_view), "tooltip-window"); if (pevent->tooltip) { - e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x + 16, pevent->y + 16); } return TRUE; @@ -6403,7 +6455,9 @@ e_day_view_event_move (ECalendarView *cal_view, } static void -e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt) +e_day_view_change_event_time (EDayView *day_view, + time_t start_dt, + time_t end_dt) { EDayViewEvent *event; gint day, event_num; @@ -6429,8 +6483,8 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt client = event->comp_data->client; /* We use a temporary shallow copy of the ico since we don't want to - change the original ico here. Otherwise we would not detect that - the event's time had changed in the "update_event" callback. */ + * change the original ico here. Otherwise we would not detect that + * the event's time had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -6441,7 +6495,7 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt date.value = &itt; /* FIXME: Should probably keep the timezone of the original start - and end times. */ + * and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); *date.value = icaltime_from_timet_with_zone (start_dt, FALSE, @@ -6569,7 +6623,7 @@ e_day_view_change_event_end_time_down (EDayView *day_view) static void e_day_view_on_editing_started (EDayView *day_view, - GnomeCanvasItem *item) + GnomeCanvasItem *item) { GtkAllocation allocation; gint day, event_num; @@ -6584,9 +6638,9 @@ e_day_view_on_editing_started (EDayView *day_view, #endif /* FIXME: This is a temporary workaround for a bug which seems to stop - us getting focus_out signals. It is not a complete fix since if we - don't get focus_out signals we don't save the appointment text so - this may be lost. */ + * us getting focus_out signals. It is not a complete fix since if we + * don't get focus_out signals we don't save the appointment text so + * this may be lost. */ if (day_view->editing_event_day == day && day_view->editing_event_num == event_num) return; @@ -6630,7 +6684,7 @@ e_day_view_on_editing_started (EDayView *day_view, static void e_day_view_on_editing_stopped (EDayView *day_view, - GnomeCanvasItem *item) + GnomeCanvasItem *item) { gint day, event_num; EDayViewEvent *event; @@ -6641,8 +6695,8 @@ e_day_view_on_editing_stopped (EDayView *day_view, gboolean on_server; /* Note: the item we are passed here isn't reliable, so we just stop - the edit of whatever item was being edited. We also receive this - event twice for some reason. */ + * the edit of whatever item was being edited. We also receive this + * event twice for some reason. */ day = day_view->editing_event_day; event_num = day_view->editing_event_num; @@ -6681,7 +6735,7 @@ e_day_view_on_editing_stopped (EDayView *day_view, day_view->resize_bars_event_num = -1; g_object_set (event->canvas_item, "handle_popup", FALSE, NULL); - g_object_get (G_OBJECT (event->canvas_item), + g_object_get (event->canvas_item, "text", &text, NULL); g_return_if_fail (text != NULL); @@ -6822,12 +6876,12 @@ e_day_view_on_editing_stopped (EDayView *day_view, } /* FIXME: It is possible that we may produce an invalid time due to daylight - saving times (i.e. when clocks go forward there is a range of time which - is not valid). I don't know the best way to handle daylight saving time. */ + * saving times (i.e. when clocks go forward there is a range of time which + * is not valid). I don't know the best way to handle daylight saving time. */ static time_t e_day_view_convert_grid_position_to_time (EDayView *day_view, - gint col, - gint row) + gint col, + gint row) { ECalendarView *cal_view; gint time_divisions; @@ -6844,7 +6898,7 @@ e_day_view_convert_grid_position_to_time (EDayView *day_view, + row * time_divisions; /* A special case for midnight, where we can use the start of the - next day. */ + * next day. */ if (minutes == 60 * 24) return day_view->day_starts[col + 1]; @@ -6861,9 +6915,9 @@ e_day_view_convert_grid_position_to_time (EDayView *day_view, static gboolean e_day_view_convert_time_to_grid_position (EDayView *day_view, - time_t time, - gint *col, - gint *row) + time_t time, + gint *col, + gint *row) { ECalendarView *cal_view; struct icaltimetype tt; @@ -6887,8 +6941,8 @@ e_day_view_convert_time_to_grid_position (EDayView *day_view, } /* To find the row we need to convert the time to an icaltimetype, - calculate the offset in minutes from the top of the display and - divide it by the mins per row setting. */ + * calculate the offset in minutes from the top of the display and + * divide it by the mins per row setting. */ tt = icaltime_from_timet_with_zone (time, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); minutes = tt.hour * 60 + tt.minute; @@ -6903,11 +6957,11 @@ e_day_view_convert_time_to_grid_position (EDayView *day_view, } /* This starts or stops auto-scrolling when dragging a selection or resizing - an event. */ + * an event. */ void e_day_view_check_auto_scroll (EDayView *day_view, - gint event_x, - gint event_y) + gint event_x, + gint event_y) { GtkAllocation allocation; gint scroll_x, scroll_y; @@ -6933,7 +6987,7 @@ e_day_view_check_auto_scroll (EDayView *day_view, static void e_day_view_start_auto_scroll (EDayView *day_view, - gboolean scroll_up) + gboolean scroll_up) { if (day_view->auto_scroll_timeout_id == 0) { day_view->auto_scroll_timeout_id = g_timeout_add (E_DAY_VIEW_AUTO_SCROLL_TIMEOUT, e_day_view_auto_scroll_handler, day_view); @@ -6993,7 +7047,7 @@ e_day_view_auto_scroll_handler (gpointer data) if (new_scroll_y != scroll_y) { /* NOTE: This reduces flicker, but only works if we don't use - canvas items which have X windows. */ + * canvas items which have X windows. */ gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas), scroll_x, new_scroll_y); } @@ -7002,8 +7056,8 @@ e_day_view_auto_scroll_handler (gpointer data) canvas_y = day_view->last_mouse_y + new_scroll_y; /* The last_mouse_x position is set to -1 when we are selecting using - the time column. In this case we set canvas_x to 0 and we ignore - the resulting day. */ + * the time column. In this case we set canvas_x to 0 and we ignore + * the resulting day. */ if (day_view->last_mouse_x == -1) canvas_x = 0; @@ -7031,10 +7085,10 @@ e_day_view_auto_scroll_handler (gpointer data) gboolean e_day_view_get_event_rows (EDayView *day_view, - gint day, - gint event_num, - gint *start_row_out, - gint *end_row_out) + gint day, + gint event_num, + gint *start_row_out, + gint *end_row_out) { ECalendarView *cal_view; EDayViewEvent *event; @@ -7065,12 +7119,12 @@ e_day_view_get_event_rows (EDayView *day_view, gboolean e_day_view_get_event_position (EDayView *day_view, - gint day, - gint event_num, - gint *item_x, - gint *item_y, - gint *item_w, - gint *item_h) + gint day, + gint event_num, + gint *item_x, + gint *item_y, + gint *item_w, + gint *item_h) { EDayViewEvent *event; gint start_row, end_row, cols_in_row, start_col, num_columns; @@ -7114,21 +7168,21 @@ e_day_view_get_event_position (EDayView *day_view, *item_h = (end_row - start_row + 1) * day_view->row_height; #else /* This makes the event end on the grid line of the next row, - which maybe looks nicer if you have 2 events on consecutive rows. */ + * which maybe looks nicer if you have 2 events on consecutive rows. */ *item_h = (end_row - start_row + 1) * day_view->row_height + 1; #endif return TRUE; } gboolean -e_day_view_get_long_event_position (EDayView *day_view, - gint event_num, - gint *start_day, - gint *end_day, - gint *item_x, - gint *item_y, - gint *item_w, - gint *item_h) +e_day_view_get_long_event_position (EDayView *day_view, + gint event_num, + gint *start_day, + gint *end_day, + gint *item_x, + gint *item_y, + gint *item_w, + gint *item_h) { EDayViewEvent *event; @@ -7173,14 +7227,14 @@ e_day_view_get_long_event_position (EDayView *day_view, } /* Converts a position within the entire top canvas to a day & event and - a place within the event if appropriate. If event_num_return is NULL, it - simply returns the grid position without trying to find the event. */ + * a place within the event if appropriate. If event_num_return is NULL, it + * simply returns the grid position without trying to find the event. */ static ECalendarViewPosition e_day_view_convert_position_in_top_canvas (EDayView *day_view, - gint x, - gint y, - gint *day_return, - gint *event_num_return) + gint x, + gint y, + gint *day_return, + gint *event_num_return) { EDayViewEvent *event; gint day, row, col; @@ -7248,15 +7302,15 @@ e_day_view_convert_position_in_top_canvas (EDayView *day_view, } /* Converts a position within the entire main canvas to a day, row, event and - a place within the event if appropriate. If event_num_return is NULL, it - simply returns the grid position without trying to find the event. */ + * a place within the event if appropriate. If event_num_return is NULL, it + * simply returns the grid position without trying to find the event. */ static ECalendarViewPosition e_day_view_convert_position_in_main_canvas (EDayView *day_view, - gint x, - gint y, - gint *day_return, - gint *row_return, - gint *event_num_return) + gint x, + gint y, + gint *day_return, + gint *row_return, + gint *event_num_return) { gint day, row, col, event_num; gint item_x, item_y, item_w, item_h; @@ -7271,7 +7325,7 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view, *event_num_return = -1; /* Check the position is inside the canvas, and determine the day - and row. */ + * and row. */ if (x < 0 || y < 0) return E_CALENDAR_VIEW_POS_OUTSIDE; @@ -7297,7 +7351,7 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view, return E_CALENDAR_VIEW_POS_NONE; /* Check the selected item first, since the horizontal resizing bars - may be above other events. */ + * may be above other events. */ if (day_view->resize_bars_event_day == day) { if (e_day_view_get_event_position (day_view, day, day_view->resize_bars_event_num, @@ -7348,12 +7402,12 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view, } static gboolean -e_day_view_on_top_canvas_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - EDayView *day_view) +e_day_view_on_top_canvas_drag_motion (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time, + EDayView *day_view) { gint scroll_x, scroll_y; @@ -7374,7 +7428,7 @@ e_day_view_reshape_top_canvas_drag_item (EDayView *day_view) gint x, y, day; /* Calculate the day & start row of the event being dragged, using - the current mouse position. */ + * the current mouse position. */ x = day_view->drag_event_x; y = day_view->drag_event_y; pos = e_day_view_convert_position_in_top_canvas (day_view, x, y, @@ -7392,7 +7446,7 @@ e_day_view_reshape_top_canvas_drag_item (EDayView *day_view) static void e_day_view_update_top_canvas_drag (EDayView *day_view, - gint day) + gint day) { EDayViewEvent *event = NULL; gint row, num_days, start_day, end_day; @@ -7400,7 +7454,7 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, gchar *text; /* Calculate the event's position. If the event is in the same - position we started in, we use the same columns. */ + * position we started in, we use the same columns. */ row = day_view->rows_in_top_display + 1; num_days = 1; @@ -7467,8 +7521,8 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, } /* Set the text, if necessary. We don't want to set the text every - time it moves, so we check if it is currently invisible and only - set the text then. */ + * time it moves, so we check if it is currently invisible and only + * set the text then. */ if (!(day_view->drag_long_event_item->flags & GNOME_CANVAS_ITEM_VISIBLE)) { const gchar *summary; @@ -7490,12 +7544,12 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, } static gboolean -e_day_view_on_main_canvas_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - EDayView *day_view) +e_day_view_on_main_canvas_drag_motion (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time, + EDayView *day_view) { gint scroll_x, scroll_y; @@ -7520,7 +7574,7 @@ e_day_view_reshape_main_canvas_drag_item (EDayView *day_view) gint x, y, day, row; /* Calculate the day & start row of the event being dragged, using - the current mouse position. */ + * the current mouse position. */ x = day_view->drag_event_x; y = day_view->drag_event_y; pos = e_day_view_convert_position_in_main_canvas (day_view, x, y, @@ -7539,8 +7593,8 @@ e_day_view_reshape_main_canvas_drag_item (EDayView *day_view) static void e_day_view_update_main_canvas_drag (EDayView *day_view, - gint row, - gint day) + gint row, + gint day) { EDayViewEvent *event = NULL; ECalendarView *cal_view; @@ -7562,7 +7616,7 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, day_view->drag_last_row = row; /* Calculate the event's position. If the event is in the same - position we started in, we use the same columns. */ + * position we started in, we use the same columns. */ cols_in_row = 1; start_row = 0; start_col = 0; @@ -7637,8 +7691,8 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, } /* Set the text, if necessary. We don't want to set the text every - time it moves, so we check if it is currently invisible and only - set the text then. */ + * time it moves, so we check if it is currently invisible and only + * set the text then. */ if (!(day_view->drag_item->flags & GNOME_CANVAS_ITEM_VISIBLE)) { const gchar *summary; @@ -7660,10 +7714,10 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, } static void -e_day_view_on_top_canvas_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - EDayView *day_view) +e_day_view_on_top_canvas_drag_leave (GtkWidget *widget, + GdkDragContext *context, + guint time, + EDayView *day_view) { day_view->drag_last_day = -1; @@ -7672,10 +7726,10 @@ e_day_view_on_top_canvas_drag_leave (GtkWidget *widget, } static void -e_day_view_on_main_canvas_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - EDayView *day_view) +e_day_view_on_main_canvas_drag_leave (GtkWidget *widget, + GdkDragContext *context, + guint time, + EDayView *day_view) { day_view->drag_last_day = -1; @@ -7692,9 +7746,9 @@ e_day_view_on_main_canvas_drag_leave (GtkWidget *widget, } static void -e_day_view_on_drag_begin (GtkWidget *widget, - GdkDragContext *context, - EDayView *day_view) +e_day_view_on_drag_begin (GtkWidget *widget, + GdkDragContext *context, + EDayView *day_view) { EDayViewEvent *event; gint day, event_num; @@ -7721,14 +7775,14 @@ e_day_view_on_drag_begin (GtkWidget *widget, } /* Hide the text item, since it will be shown in the special drag - items. */ + * items. */ gnome_canvas_item_hide (event->canvas_item); } static void -e_day_view_on_drag_end (GtkWidget *widget, - GdkDragContext *context, - EDayView *day_view) +e_day_view_on_drag_end (GtkWidget *widget, + GdkDragContext *context, + EDayView *day_view) { EDayViewEvent *event; gint day, event_num; @@ -7737,7 +7791,7 @@ e_day_view_on_drag_end (GtkWidget *widget, event_num = day_view->drag_event_num; /* If the calendar has already been updated in drag_data_received() - we just return. */ + * we just return. */ if (day == -1 || event_num == -1) return; @@ -7765,12 +7819,12 @@ e_day_view_on_drag_end (GtkWidget *widget, } static void -e_day_view_on_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - EDayView *day_view) +e_day_view_on_drag_data_get (GtkWidget *widget, + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + EDayView *day_view) { EDayViewEvent *event; icalcomponent *vcal; @@ -7831,16 +7885,16 @@ e_day_view_on_drag_data_get (GtkWidget *widget, } static void -e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - EDayView *day_view) -{ - EDayViewEvent *event=NULL; +e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + EDayView *day_view) +{ + EDayViewEvent *event = NULL; ECalendarViewPosition pos; gint day, start_day, end_day, num_days; gint start_offset, end_offset; @@ -7923,9 +7977,9 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, client = event->comp_data->client; /* We clone the event since we don't want to change - the original comp here. - Otherwise we would not detect that the event's time - had changed in the "update_event" callback. */ + * the original comp here. + * Otherwise we would not detect that the event's time + * had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -7950,7 +8004,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, date.tzid = NULL; } else { /* FIXME: Should probably keep the timezone of - the original start and end times. */ + * the original start and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } cal_comp_set_dtstart_with_oldzone (client, comp, &date); @@ -7966,7 +8020,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, date.tzid = NULL; } else { /* FIXME: Should probably keep the timezone of - the original start and end times. */ + * the original start and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } cal_comp_set_dtend_with_oldzone (client, comp, &date); @@ -7977,7 +8031,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, day_view->drag_event_day = -1; /* Show the text item again, just in case it hasn't - moved. If we don't do this it may not appear. */ + * moved. If we don't do this it may not appear. */ if (event->canvas_item) gnome_canvas_item_show (event->canvas_item); @@ -8075,14 +8129,14 @@ error: } static void -e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - EDayView *day_view) +e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + EDayView *day_view) { ECalendarView *cal_view; EDayViewEvent *event = NULL; @@ -8174,9 +8228,9 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, client = event->comp_data->client; /* We use a temporary shallow copy of comp since we - don't want to change the original comp here. - Otherwise we would not detect that the event's time - had changed in the "update_event" callback. */ + * don't want to change the original comp here. + * Otherwise we would not detect that the event's time + * had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -8204,7 +8258,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, day_view->drag_event_day = -1; /* Show the text item again, just in case it hasn't - moved. If we don't do this it may not appear. */ + * moved. If we don't do this it may not appear. */ if (event->canvas_item) gnome_canvas_item_show (event->canvas_item); @@ -8302,20 +8356,20 @@ error: } /* Converts an hour from 0-23 to the preferred time format, and returns the - suffix to add and the width of it in the normal font. */ + * suffix to add and the width of it in the normal font. */ void -e_day_view_convert_time_to_display (EDayView *day_view, - gint hour, - gint *display_hour, - const gchar **suffix, - gint *suffix_width) +e_day_view_convert_time_to_display (EDayView *day_view, + gint hour, + gint *display_hour, + const gchar **suffix, + gint *suffix_width) { ECalModel *model; model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)); /* Calculate the actual hour number to display. For 12-hour - format we convert 0-23 to 12-11am/12-11pm. */ + * format we convert 0-23 to 12-11am/12-11pm. */ *display_hour = hour; if (e_cal_model_get_use_24_hour_format (model)) { *suffix = ""; @@ -8337,7 +8391,7 @@ e_day_view_convert_time_to_display (EDayView *day_view, } gint -e_day_view_get_time_string_width (EDayView *day_view) +e_day_view_get_time_string_width (EDayView *day_view) { ECalModel *model; gint time_width; diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h index ae1cf79d56..9f43a1ad78 100644 --- a/calendar/gui/e-day-view.h +++ b/calendar/gui/e-day-view.h @@ -38,31 +38,31 @@ G_BEGIN_DECLS */ /* The maximum number of days shown. We use the week view for anything more - than about 9 days. */ + * than about 9 days. */ #define E_DAY_VIEW_MAX_DAYS 10 /* This is used as a special code to signify a long event instead of the day - of a normal event. */ + * of a normal event. */ #define E_DAY_VIEW_LONG_EVENT E_DAY_VIEW_MAX_DAYS /* The maximum number of columns of appointments within a day in multi-day - view. */ + * view. */ #define E_DAY_VIEW_MULTI_DAY_MAX_COLUMNS 6 /* minimum width of the event in one-day view in pixels */ #define E_DAY_VIEW_MIN_DAY_COL_WIDTH 60 /* The width of the gap between appointments. This should be at least - E_DAY_VIEW_BAR_WIDTH, since in the top canvas we use this space to draw - the triangle to represent continuing events. */ + * E_DAY_VIEW_BAR_WIDTH, since in the top canvas we use this space to draw + * the triangle to represent continuing events. */ #define E_DAY_VIEW_GAP_WIDTH 7 /* The width of the bars down the left of each column and appointment. - This includes the borders on each side of it. */ + * This includes the borders on each side of it. */ #define E_DAY_VIEW_BAR_WIDTH 7 /* The height of the horizontal bar above & beneath the selected event. - This includes the borders on the top and bottom. */ + * This includes the borders on the top and bottom. */ #define E_DAY_VIEW_BAR_HEIGHT 6 /* The size of the reminder & recurrence icons, and padding around them. */ @@ -97,8 +97,8 @@ G_BEGIN_DECLS #define E_DAY_VIEW_TOP_CANVAS_Y_GAP 2 /* These are used to get/set the working days in the week. The bit-flags are - combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the - day values used by localtime etc. */ + * combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the + * day values used by localtime etc. */ typedef enum { E_DAY_VIEW_SUNDAY = 1 << 0, @@ -111,7 +111,7 @@ typedef enum } EDayViewDays; /* These are used to specify the type of an appointment. They match those - used in EMeetingTimeSelector. */ + * used in EMeetingTimeSelector. */ typedef enum { E_DAY_VIEW_BUSY_TENTATIVE = 0, @@ -122,10 +122,10 @@ typedef enum } EDayViewBusyType; /* This is used to specify the format used when displaying the dates. - The full format is like 'Thursday 12 September'. The abbreviated format is - like 'Thu 12 Sep'. The no weekday format is like '12 Sep'. The short format - is like '12'. The actual format used is determined in - e_day_view_recalc_cell_sizes (), once we know the font being used. */ + * The full format is like 'Thursday 12 September'. The abbreviated format is + * like 'Thu 12 Sep'. The no weekday format is like '12 Sep'. The short format + * is like '12'. The actual format used is determined in + * e_day_view_recalc_cell_sizes (), once we know the font being used. */ typedef enum { E_DAY_VIEW_DATE_FULL, @@ -172,14 +172,14 @@ struct _EDayViewEvent { E_CALENDAR_VIEW_EVENT_FIELDS /* For events in the main canvas, this contains the start column. - For long events in the top canvas, this is its row. */ + * For long events in the top canvas, this is its row. */ guint8 start_row_or_col; /* For events in the main canvas, this is the number of columns that - it covers. For long events this is set to 1 if the event is shown. - For both types of events this is set to 0 if the event is not shown, - i.e. it couldn't fit into the display. Currently long events are - always shown as we just increase the height of the top canvas. */ + * it covers. For long events this is set to 1 if the event is shown. + * For both types of events this is set to 0 if the event is not shown, + * i.e. it couldn't fit into the display. Currently long events are + * always shown as we just increase the height of the top canvas. */ guint8 num_columns; }; @@ -243,8 +243,8 @@ struct _EDayView { gboolean work_week_view; /* The number of days we are showing. Usually 1 or 5, but can be up - to E_DAY_VIEW_MAX_DAYS, e.g. when the user selects a range of - days in the date navigator. */ + * to E_DAY_VIEW_MAX_DAYS, e.g. when the user selects a range of + * days in the date navigator. */ gint days_shown; /* The start of each day & an extra element to hold the last time. */ @@ -255,8 +255,8 @@ struct _EDayView { GArray *events[E_DAY_VIEW_MAX_DAYS]; /* These are set to FALSE whenever an event in the corresponding array - is changed. Any function that needs the events sorted calls - e_day_view_ensure_events_sorted (). */ + * is changed. Any function that needs the events sorted calls + * e_day_view_ensure_events_sorted (). */ gboolean long_events_sorted; gboolean events_sorted[E_DAY_VIEW_MAX_DAYS]; @@ -265,7 +265,7 @@ struct _EDayView { gboolean need_layout[E_DAY_VIEW_MAX_DAYS]; /* This is TRUE if we need to reshape the canvas items, but a full - layout is not necessary. */ + * layout is not necessary. */ gboolean long_events_need_reshape; gboolean need_reshape[E_DAY_VIEW_MAX_DAYS]; @@ -273,7 +273,7 @@ struct _EDayView { gint layout_timeout_id; /* The number of rows needed, depending on the times shown and the - minutes per row. */ + * minutes per row. */ gint rows; /* The height of each row. */ @@ -286,7 +286,7 @@ struct _EDayView { gint top_row_height; /* The first and last times shown in the display. The last time isn't - included in the range. Default is 0:00-24:00 */ + * included in the range. Default is 0:00-24:00 */ gint first_hour_shown; gint first_minute_shown; gint last_hour_shown; @@ -304,17 +304,17 @@ struct _EDayView { gboolean show_event_end_times; /* This is set to TRUE when the widget is created, so it scrolls to - the start of the working day when first shown. */ + * the start of the working day when first shown. */ gboolean scroll_to_work_day; /* This is the width & offset of each of the day columns in the - display. */ + * display. */ gint day_widths[E_DAY_VIEW_MAX_DAYS]; gint day_offsets[E_DAY_VIEW_MAX_DAYS + 1]; /* An array holding the number of columns in each row, in each day. - Note that there are a maximum of 12 * 24 rows (when a row is 5 mins) - but we don't always have that many rows. */ + * Note that there are a maximum of 12 * 24 rows (when a row is 5 mins) + * but we don't always have that many rows. */ guint8 cols_per_row[E_DAY_VIEW_MAX_DAYS][12 * 24]; /* The maximum number of columns from all rows in cols_per_row */ gint max_cols; @@ -330,14 +330,14 @@ struct _EDayView { EDayViewDateFormat date_format; /* These are the longest month & weekday names in the current font. - Months are 0 to 11. Weekdays are 0 (Sun) to 6 (Sat). */ + * Months are 0 to 11. Weekdays are 0 (Sun) to 6 (Sat). */ gint longest_month_name; gint longest_abbreviated_month_name; gint longest_weekday_name; gint longest_abbreviated_weekday_name; /* The large font used to display the hours. I don't think we need a - fontset since we only display numbers. */ + * fontset since we only display numbers. */ PangoFontDescription *large_font_desc; PangoFontDescription *small_font_desc; @@ -375,7 +375,7 @@ struct _EDayView { gint editing_event_num; /* This is a GnomeCanvasRect which is placed around an item while it - is being resized, so we can raise it above all other EText items. */ + * is being resized, so we can raise it above all other EText items. */ GnomeCanvasItem *resize_long_event_rect_item; GnomeCanvasItem *resize_rect_item; GnomeCanvasItem *resize_bar_item; @@ -385,26 +385,26 @@ struct _EDayView { gint popup_event_num; /* The currently selected region. If selection_start_day is -1 there is - no current selection. If start_row or end_row is -1 then the - selection is in the top canvas. */ + * no current selection. If start_row or end_row is -1 then the + * selection is in the top canvas. */ gint selection_start_day; gint selection_end_day; gint selection_start_row; gint selection_end_row; /* This is TRUE if the selection is currently being dragged using the - mouse. */ + * mouse. */ gboolean selection_is_being_dragged; /* This specifies which end of the selection is being dragged. */ EDayViewDragPosition selection_drag_pos; /* This is TRUE if the selection is in the top canvas only (i.e. if the - last motion event was in the top canvas). */ + * last motion event was in the top canvas). */ gboolean selection_in_top_canvas; /* The last mouse position, relative to the main canvas window. - Used when auto-scrolling to update the selection. */ + * Used when auto-scrolling to update the selection. */ gint last_mouse_x; gint last_mouse_y; @@ -428,13 +428,13 @@ struct _EDayView { gchar *last_edited_comp_string; /* This is the event the mouse button was pressed on. If the button - is released we start editing it, but if the mouse is dragged we set - this to -1. */ + * is released we start editing it, but if the mouse is dragged we set + * this to -1. */ gint pressed_event_day; gint pressed_event_num; /* These are used when dragging events. If drag_event_day is not -1 we - know that we are dragging one of the EDayView events around. */ + * know that we are dragging one of the EDayView events around. */ gint drag_event_day; gint drag_event_num; @@ -443,16 +443,16 @@ struct _EDayView { gint drag_event_y; /* The offset of the mouse from the top of the event, in rows. - In the top canvas this is the offset from the left, in days. */ + * In the top canvas this is the offset from the left, in days. */ gint drag_event_offset; /* The last day & row dragged to, so we know when we need to update - the dragged event's position. */ + * the dragged event's position. */ gint drag_last_day; gint drag_last_row; /* This is a GnomeCanvasRect which is placed around an item while it - is being resized, so we can raise it above all other EText items. */ + * is being resized, so we can raise it above all other EText items. */ GnomeCanvasItem *drag_long_event_rect_item; GnomeCanvasItem *drag_long_event_item; GnomeCanvasItem *drag_rect_item; @@ -466,7 +466,7 @@ struct _EDayView { gint pm_string_width; /* remember last selected interval when click and restore on double click, - if we double clicked inside that interval. */ + * if we double clicked inside that interval. */ guint32 bc_event_time; time_t before_click_dtstart; time_t before_click_dtend; @@ -483,25 +483,25 @@ GType e_day_view_get_type (void); ECalendarView * e_day_view_new (ECalModel *model); /* Whether we are displaying a work-week, in which case the display always - starts on the first day of the working week. */ + * starts on the first day of the working week. */ gboolean e_day_view_get_work_week_view (EDayView *day_view); void e_day_view_set_work_week_view (EDayView *day_view, gboolean work_week_view); /* The number of days shown in the EDayView, from 1 to 7. This is normally - either 1 or 5 (for the Work-Week view). */ + * either 1 or 5 (for the Work-Week view). */ gint e_day_view_get_days_shown (EDayView *day_view); void e_day_view_set_days_shown (EDayView *day_view, gint days_shown); /* This specifies the working days in the week. The value is a bitwise - combination of day flags. Defaults to Mon-Fri. */ + * combination of day flags. Defaults to Mon-Fri. */ EDayViewDays e_day_view_get_working_days (EDayView *day_view); void e_day_view_set_working_days (EDayView *day_view, EDayViewDays days); /* Whether we display the Marcus Bains Line in the main canvas and time - canvas. */ + * canvas. */ void e_day_view_marcus_bains_update (EDayView *day_view); gboolean e_day_view_marcus_bains_get_show_line (EDayView *day_view); void e_day_view_marcus_bains_set_show_line (EDayView *day_view, diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c index 5b101a5d61..e783195ec1 100644 --- a/calendar/gui/e-meeting-attendee.c +++ b/calendar/gui/e-meeting-attendee.c @@ -250,7 +250,8 @@ e_meeting_attendee_get_fburi (EMeetingAttendee *ia) } void -e_meeting_attendee_set_fburi (EMeetingAttendee *ia, gchar *fburi) +e_meeting_attendee_set_fburi (EMeetingAttendee *ia, + gchar *fburi) { EMeetingAttendeePrivate *priv; @@ -275,7 +276,8 @@ e_meeting_attendee_get_address (EMeetingAttendee *ia) } void -e_meeting_attendee_set_address (EMeetingAttendee *ia, gchar *address) +e_meeting_attendee_set_address (EMeetingAttendee *ia, + gchar *address) { EMeetingAttendeePrivate *priv; @@ -310,7 +312,8 @@ e_meeting_attendee_get_member (EMeetingAttendee *ia) } void -e_meeting_attendee_set_member (EMeetingAttendee *ia, gchar *member) +e_meeting_attendee_set_member (EMeetingAttendee *ia, + gchar *member) { EMeetingAttendeePrivate *priv; @@ -345,7 +348,8 @@ e_meeting_attendee_get_cutype (EMeetingAttendee *ia) } void -e_meeting_attendee_set_cutype (EMeetingAttendee *ia, icalparameter_cutype cutype) +e_meeting_attendee_set_cutype (EMeetingAttendee *ia, + icalparameter_cutype cutype) { EMeetingAttendeePrivate *priv; @@ -367,7 +371,8 @@ e_meeting_attendee_get_role (EMeetingAttendee *ia) } void -e_meeting_attendee_set_role (EMeetingAttendee *ia, icalparameter_role role) +e_meeting_attendee_set_role (EMeetingAttendee *ia, + icalparameter_role role) { EMeetingAttendeePrivate *priv; @@ -389,7 +394,8 @@ e_meeting_attendee_get_rsvp (EMeetingAttendee *ia) } void -e_meeting_attendee_set_rsvp (EMeetingAttendee *ia, gboolean rsvp) +e_meeting_attendee_set_rsvp (EMeetingAttendee *ia, + gboolean rsvp) { EMeetingAttendeePrivate *priv; @@ -411,7 +417,8 @@ e_meeting_attendee_get_delto (EMeetingAttendee *ia) } void -e_meeting_attendee_set_delto (EMeetingAttendee *ia, gchar *delto) +e_meeting_attendee_set_delto (EMeetingAttendee *ia, + gchar *delto) { EMeetingAttendeePrivate *priv; @@ -446,7 +453,8 @@ e_meeting_attendee_get_delfrom (EMeetingAttendee *ia) } void -e_meeting_attendee_set_delfrom (EMeetingAttendee *ia, gchar *delfrom) +e_meeting_attendee_set_delfrom (EMeetingAttendee *ia, + gchar *delfrom) { EMeetingAttendeePrivate *priv; @@ -481,7 +489,8 @@ e_meeting_attendee_get_status (EMeetingAttendee *ia) } void -e_meeting_attendee_set_status (EMeetingAttendee *ia, icalparameter_partstat status) +e_meeting_attendee_set_status (EMeetingAttendee *ia, + icalparameter_partstat status) { EMeetingAttendeePrivate *priv; @@ -503,7 +512,8 @@ e_meeting_attendee_get_sentby (EMeetingAttendee *ia) } void -e_meeting_attendee_set_sentby (EMeetingAttendee *ia, gchar *sentby) +e_meeting_attendee_set_sentby (EMeetingAttendee *ia, + gchar *sentby) { EMeetingAttendeePrivate *priv; @@ -538,7 +548,8 @@ e_meeting_attendee_get_cn (EMeetingAttendee *ia) } void -e_meeting_attendee_set_cn (EMeetingAttendee *ia, gchar *cn) +e_meeting_attendee_set_cn (EMeetingAttendee *ia, + gchar *cn) { EMeetingAttendeePrivate *priv; @@ -573,7 +584,8 @@ e_meeting_attendee_get_language (EMeetingAttendee *ia) } void -e_meeting_attendee_set_language (EMeetingAttendee *ia, gchar *language) +e_meeting_attendee_set_language (EMeetingAttendee *ia, + gchar *language) { EMeetingAttendeePrivate *priv; @@ -644,7 +656,7 @@ e_meeting_attendee_set_edit_level (EMeetingAttendee *ia, static gint compare_times (EMeetingTime *time1, - EMeetingTime *time2) + EMeetingTime *time2) { gint day_comparison; @@ -669,7 +681,7 @@ compare_times (EMeetingTime *time1, static gint compare_period_starts (gconstpointer arg1, - gconstpointer arg2) + gconstpointer arg2) { EMeetingFreeBusyPeriod *period1, *period2; @@ -730,7 +742,8 @@ e_meeting_attendee_get_busy_periods (EMeetingAttendee *ia) } gint -e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) +e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, + GDate *date) { EMeetingAttendeePrivate *priv; EMeetingFreeBusyPeriod *period; @@ -743,7 +756,7 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) ensure_periods_sorted (ia); /* Calculate the first day which could have a busy period which - continues onto our given date. */ + * continues onto our given date. */ tmp_date = *date; g_date_subtract_days (&tmp_date, priv->longest_period_in_days); @@ -771,7 +784,7 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) } /* There may be several busy periods on the same day so we step - backwards to the first one. */ + * backwards to the first one. */ if (cmp == 0) { while (middle > 0) { period = &g_array_index (priv->busy_periods, @@ -782,8 +795,8 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) } } else if (cmp > 0) { /* This means we couldn't find a period on the given day, and - the last one we looked at was before it, so if there are - any more periods after this one we return it. */ + * the last one we looked at was before it, so if there are + * any more periods after this one we return it. */ middle++; if (priv->busy_periods->len <= middle) return -1; @@ -794,17 +807,17 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) gboolean e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, - gint start_year, - gint start_month, - gint start_day, - gint start_hour, - gint start_minute, - gint end_year, - gint end_month, - gint end_day, - gint end_hour, - gint end_minute, - EMeetingFreeBusyType busy_type) + gint start_year, + gint start_month, + gint start_day, + gint start_hour, + gint start_minute, + gint end_year, + gint end_month, + gint end_day, + gint end_hour, + gint end_minute, + EMeetingFreeBusyType busy_type) { EMeetingAttendeePrivate *priv; EMeetingFreeBusyPeriod period; @@ -944,11 +957,11 @@ e_meeting_attendee_get_end_busy_range (EMeetingAttendee *ia) gboolean e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia, - gint start_year, - gint start_month, - gint start_day, - gint start_hour, - gint start_minute) + gint start_year, + gint start_month, + gint start_day, + gint start_hour, + gint start_minute) { EMeetingAttendeePrivate *priv; @@ -977,11 +990,11 @@ e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia, gboolean e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia, - gint end_year, - gint end_month, - gint end_day, - gint end_hour, - gint end_minute) + gint end_year, + gint end_month, + gint end_day, + gint end_hour, + gint end_minute) { EMeetingAttendeePrivate *priv; diff --git a/calendar/gui/e-meeting-attendee.h b/calendar/gui/e-meeting-attendee.h index 145e28c59b..bc2eaa046b 100644 --- a/calendar/gui/e-meeting-attendee.h +++ b/calendar/gui/e-meeting-attendee.h @@ -42,9 +42,9 @@ typedef struct _EMeetingAttendeePrivate EMeetingAttendeePrivate; typedef struct _EMeetingAttendeeClass EMeetingAttendeeClass; /* These specify the type of attendee. Either a person or a resource (e.g. a - meeting room). These are used for the Autopick options, where the user can - ask for a time when, for example, all people and one resource are free. - The default is E_MEETING_ATTENDEE_REQUIRED_PERSON. */ + * meeting room). These are used for the Autopick options, where the user can + * ask for a time when, for example, all people and one resource are free. + * The default is E_MEETING_ATTENDEE_REQUIRED_PERSON. */ typedef enum { E_MEETING_ATTENDEE_REQUIRED_PERSON, diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 5283b5e385..c27697b40f 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -119,7 +119,8 @@ e_meeting_list_view_class_init (EMeetingListViewClass *klass) } static void -add_section (ENameSelector *name_selector, const gchar *name) +add_section (ENameSelector *name_selector, + const gchar *name) { ENameSelectorModel *name_selector_model; @@ -219,7 +220,10 @@ get_status_strings (void) } static void -value_edited (GtkTreeView *view, gint col, const gchar *path, const gchar *text) +value_edited (GtkTreeView *view, + gint col, + const gchar *path, + const gchar *text) { EMeetingStore *model = E_MEETING_STORE (gtk_tree_view_get_model (view)); GtkTreePath *treepath = gtk_tree_path_new_from_string (path); @@ -247,7 +251,8 @@ get_index_from_role (icalparameter_role role) } void -e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, EMeetingAttendee *ma) +e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, + EMeetingAttendee *ma) { EDestinationStore *destination_store; ENameSelectorModel *name_selector_model; @@ -269,7 +274,8 @@ e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, EMeet } void -e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, EMeetingAttendee *ma) +e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, + EMeetingAttendee *ma) { GList *destinations, *l; EDestinationStore *destination_store; @@ -359,7 +365,11 @@ e_meeting_list_view_remove_all_attendees_from_name_selector (EMeetingListView *v } static void -attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *addresses, GList *names, GtkTreeView *view) +attendee_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + GList *addresses, + GList *names, + GtkTreeView *view) { EMeetingStore *model = E_MEETING_STORE (gtk_tree_view_get_model (view)); GtkTreePath *treepath = gtk_tree_path_new_from_string (path); @@ -458,7 +468,8 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address } static void -attendee_editing_canceled_cb (GtkCellRenderer *renderer, GtkTreeView *view) +attendee_editing_canceled_cb (GtkCellRenderer *renderer, + GtkTreeView *view) { EMeetingStore *model = E_MEETING_STORE (gtk_tree_view_get_model (view)); GtkTreePath *path; @@ -481,13 +492,19 @@ attendee_editing_canceled_cb (GtkCellRenderer *renderer, GtkTreeView *view) } static void -type_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view) +type_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + const gchar *text, + GtkTreeView *view) { value_edited (view, E_MEETING_STORE_TYPE_COL, path, text); } static void -role_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view) +role_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + const gchar *text, + GtkTreeView *view) { /* This is a little more complex than the other callbacks because * we also need to update the "Required Participants" dialog. */ @@ -506,28 +523,36 @@ role_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, } static void -rsvp_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view) +rsvp_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + const gchar *text, + GtkTreeView *view) { value_edited (view, E_MEETING_STORE_RSVP_COL, path, text); } static void -status_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view) +status_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + const gchar *text, + GtkTreeView *view) { value_edited (view, E_MEETING_STORE_STATUS_COL, path, text); } static void -ense_update (GtkWidget *w, gpointer data1, gpointer user_data) +ense_update (GtkWidget *w, + gpointer data1, + gpointer user_data) { gtk_cell_editable_editing_done ((GtkCellEditable *) w); } static void editing_started_cb (GtkCellRenderer *renderer, - GtkCellEditable *editable, - gchar *path, - gpointer user_data) + GtkCellEditable *editable, + gchar *path, + gpointer user_data) { g_signal_connect (editable, "updated", G_CALLBACK(ense_update), NULL); } @@ -548,7 +573,7 @@ build_table (EMeetingListView *lview) gtk_tree_view_set_rules_hint (view, TRUE); renderer = e_select_names_renderer_new (); - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + g_object_set (renderer, "editable", TRUE, NULL); /* The extra space is just a hack to occupy more space for Attendee */ pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Attendee "), renderer, "text", E_MEETING_STORE_ATTENDEE_COL, @@ -621,82 +646,95 @@ build_table (EMeetingListView *lview) } static void -change_edit_cols_for_user (gpointer key, gpointer value, gpointer user_data) -{ - GtkCellRenderer *renderer = (GtkCellRenderer *) value; - gint key_val = GPOINTER_TO_INT (key); - switch (key_val) - { - case E_MEETING_STORE_ATTENDEE_COL: - g_object_set (G_OBJECT (renderer), "editable", FALSE, NULL); - break; - case E_MEETING_STORE_ROLE_COL: - g_object_set (G_OBJECT (renderer), "editable", FALSE, NULL); - break; - case E_MEETING_STORE_TYPE_COL: - g_object_set (G_OBJECT (renderer), "editable", FALSE, NULL); - break; - case E_MEETING_STORE_RSVP_COL: - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); - break; - case E_MEETING_STORE_STATUS_COL: - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); - break; - } +change_edit_cols_for_user (gpointer key, + gpointer value, + gpointer user_data) +{ + GtkCellRenderer *renderer = (GtkCellRenderer *) value; + gint key_val = GPOINTER_TO_INT (key); + + switch (key_val) { + case E_MEETING_STORE_ATTENDEE_COL: + g_object_set (renderer, "editable", FALSE, NULL); + break; + case E_MEETING_STORE_ROLE_COL: + g_object_set (renderer, "editable", FALSE, NULL); + break; + case E_MEETING_STORE_TYPE_COL: + g_object_set (renderer, "editable", FALSE, NULL); + break; + case E_MEETING_STORE_RSVP_COL: + g_object_set (renderer, "editable", TRUE, NULL); + break; + case E_MEETING_STORE_STATUS_COL: + g_object_set (renderer, "editable", TRUE, NULL); + break; + } } static void -change_edit_cols_for_organizer (gpointer key, gpointer value, gpointer user_data) +change_edit_cols_for_organizer (gpointer key, + gpointer value, + gpointer user_data) { - GtkCellRenderer *renderer = (GtkCellRenderer *) value; - guint edit_level = GPOINTER_TO_INT (user_data); - g_object_set (G_OBJECT (renderer), "editable", GINT_TO_POINTER (edit_level), NULL); + GtkCellRenderer *renderer = (GtkCellRenderer *) value; + guint edit_level = GPOINTER_TO_INT (user_data); + + g_object_set (renderer, "editable", GINT_TO_POINTER (edit_level), NULL); } static void -row_activated_cb (GtkTreeSelection *selection, EMeetingListView *view) -{ - EMeetingAttendee *existing_attendee; - EMeetingListViewPrivate *priv; - gint row; - EMeetingAttendeeEditLevel el; - gint edit_level; - GtkTreeModel *model; - GtkTreePath *path = NULL; - GList *paths=NULL; - - priv = view->priv; - - if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model))) - return; - if (g_list_length (paths) > 1) - return; - path = g_list_nth_data (paths, 0); - if (!path) - return; - - row = gtk_tree_path_get_indices (path)[0]; - existing_attendee = e_meeting_store_find_attendee_at_row (priv->store, row); - el = e_meeting_attendee_get_edit_level (existing_attendee); - - switch (el) - { - case E_MEETING_ATTENDEE_EDIT_NONE: - edit_level = FALSE; - g_hash_table_foreach (priv->renderers, change_edit_cols_for_organizer, GINT_TO_POINTER (edit_level)); - break; - - case E_MEETING_ATTENDEE_EDIT_FULL: - edit_level = TRUE; - g_hash_table_foreach (priv->renderers, change_edit_cols_for_organizer, GINT_TO_POINTER (edit_level)); - break; - - case E_MEETING_ATTENDEE_EDIT_STATUS: - edit_level = FALSE; - g_hash_table_foreach (priv->renderers, change_edit_cols_for_user, GINT_TO_POINTER (edit_level)); - break; - } +row_activated_cb (GtkTreeSelection *selection, + EMeetingListView *view) +{ + EMeetingAttendee *existing_attendee; + EMeetingListViewPrivate *priv; + gint row; + EMeetingAttendeeEditLevel el; + gint edit_level; + GtkTreeModel *model; + GtkTreePath *path = NULL; + GList *paths = NULL; + priv = view->priv; + + if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model))) + return; + if (g_list_length (paths) > 1) + return; + path = g_list_nth_data (paths, 0); + if (!path) + return; + + row = gtk_tree_path_get_indices (path)[0]; + existing_attendee = e_meeting_store_find_attendee_at_row (priv->store, row); + el = e_meeting_attendee_get_edit_level (existing_attendee); + + switch (el) { + case E_MEETING_ATTENDEE_EDIT_NONE: + edit_level = FALSE; + g_hash_table_foreach ( + priv->renderers, + change_edit_cols_for_organizer, + GINT_TO_POINTER (edit_level)); + break; + + case E_MEETING_ATTENDEE_EDIT_FULL: + edit_level = TRUE; + g_hash_table_foreach ( + priv->renderers, + change_edit_cols_for_organizer, + GINT_TO_POINTER (edit_level)); + break; + + case E_MEETING_ATTENDEE_EDIT_STATUS: + edit_level = FALSE; + g_hash_table_foreach ( + priv->renderers, + change_edit_cols_for_user, + GINT_TO_POINTER (edit_level)); + break; + } } EMeetingListView * @@ -717,7 +755,9 @@ e_meeting_list_view_new (EMeetingStore *store) } void -e_meeting_list_view_column_set_visible (EMeetingListView *view, EMeetingStoreColumns column, gboolean visible) +e_meeting_list_view_column_set_visible (EMeetingListView *view, + EMeetingStoreColumns column, + gboolean visible) { GList *cols, *l; @@ -735,7 +775,8 @@ e_meeting_list_view_column_set_visible (EMeetingListView *view, EMeetingStoreCol } void -e_meeting_list_view_edit (EMeetingListView *emlv, EMeetingAttendee *attendee) +e_meeting_list_view_edit (EMeetingListView *emlv, + EMeetingAttendee *attendee) { EMeetingListViewPrivate *priv; GtkTreePath *path; @@ -758,7 +799,10 @@ e_meeting_list_view_edit (EMeetingListView *emlv, EMeetingAttendee *attendee) } static void -process_section (EMeetingListView *view, GList *destinations, icalparameter_role role, GSList **la) +process_section (EMeetingListView *view, + GList *destinations, + icalparameter_role role, + GSList **la) { EMeetingListViewPrivate *priv; GList *l; @@ -877,7 +921,8 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role } static void -add_to_list (gpointer data, gpointer u_data) +add_to_list (gpointer data, + gpointer u_data) { GSList **user_data = u_data; @@ -885,7 +930,9 @@ add_to_list (gpointer data, gpointer u_data) } static void -name_selector_dialog_close_cb (ENameSelectorDialog *dialog, gint response, gpointer data) +name_selector_dialog_close_cb (ENameSelectorDialog *dialog, + gint response, + gpointer data) { EMeetingListView *view = E_MEETING_LIST_VIEW (data); ENameSelectorModel *name_selector_model; @@ -945,7 +992,8 @@ e_meeting_list_view_invite_others_dialog (EMeetingListView *view) } void -e_meeting_list_view_set_editable (EMeetingListView *lview, gboolean set) +e_meeting_list_view_set_editable (EMeetingListView *lview, + gboolean set) { EMeetingListViewPrivate *priv = lview->priv; @@ -968,7 +1016,8 @@ e_meeting_list_view_get_name_selector (EMeetingListView *lview) } void -e_meeting_list_view_set_name_selector (EMeetingListView *lview, ENameSelector *name_selector) +e_meeting_list_view_set_name_selector (EMeetingListView *lview, + ENameSelector *name_selector) { EMeetingListViewPrivate *priv; diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index 5a9176a094..51ce798a8b 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -252,7 +252,8 @@ get_n_columns (GtkTreeModel *model) } static GType -get_column_type (GtkTreeModel *model, gint col) +get_column_type (GtkTreeModel *model, + gint col) { g_return_val_if_fail (E_IS_MEETING_STORE (model), G_TYPE_INVALID); @@ -277,7 +278,9 @@ get_column_type (GtkTreeModel *model, gint col) } static gboolean -get_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreePath *path) +get_iter (GtkTreeModel *model, + GtkTreeIter *iter, + GtkTreePath *path) { gint row; @@ -296,7 +299,8 @@ get_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreePath *path) } static GtkTreePath * -get_path (GtkTreeModel *model, GtkTreeIter *iter) +get_path (GtkTreeModel *model, + GtkTreeIter *iter) { gint row; GtkTreePath *result; @@ -314,7 +318,10 @@ get_path (GtkTreeModel *model, GtkTreeIter *iter) } static void -get_value (GtkTreeModel *model, GtkTreeIter *iter, gint col, GValue *value) +get_value (GtkTreeModel *model, + GtkTreeIter *iter, + gint col, + GValue *value) { EMeetingStore *store; EMeetingAttendee *attendee; @@ -410,7 +417,8 @@ get_value (GtkTreeModel *model, GtkTreeIter *iter, gint col, GValue *value) } static gboolean -iter_next (GtkTreeModel *model, GtkTreeIter *iter) +iter_next (GtkTreeModel *model, + GtkTreeIter *iter) { gint row; @@ -424,7 +432,9 @@ iter_next (GtkTreeModel *model, GtkTreeIter *iter) } static gboolean -iter_children (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent) +iter_children (GtkTreeModel *model, + GtkTreeIter *iter, + GtkTreeIter *parent) { EMeetingStore *store; @@ -442,13 +452,15 @@ iter_children (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent) } static gboolean -iter_has_child (GtkTreeModel *model, GtkTreeIter *iter) +iter_has_child (GtkTreeModel *model, + GtkTreeIter *iter) { return FALSE; } static gint -iter_n_children (GtkTreeModel *model, GtkTreeIter *iter) +iter_n_children (GtkTreeModel *model, + GtkTreeIter *iter) { g_return_val_if_fail (E_IS_MEETING_STORE (model), -1); @@ -461,7 +473,10 @@ iter_n_children (GtkTreeModel *model, GtkTreeIter *iter) } static gboolean -iter_nth_child (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent, gint n) +iter_nth_child (GtkTreeModel *model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n) { EMeetingStore *store; @@ -479,7 +494,9 @@ iter_nth_child (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent, gin } static gboolean -iter_parent (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *child) +iter_parent (GtkTreeModel *model, + GtkTreeIter *iter, + GtkTreeIter *child) { return FALSE; } @@ -502,7 +519,10 @@ ems_tree_model_init (GtkTreeModelIface *iface) } void -e_meeting_store_set_value (EMeetingStore *store, gint row, gint col, const gchar *val) +e_meeting_store_set_value (EMeetingStore *store, + gint row, + gint col, + const gchar *val) { icalparameter_cutype type; EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, row); @@ -555,7 +575,9 @@ struct FindAttendeeData }; static void -find_attendee_cb (gpointer key, gpointer value, gpointer user_data) +find_attendee_cb (gpointer key, + gpointer value, + gpointer user_data) { EMeetingStoreQueueData *qdata = value; struct FindAttendeeData *fad = user_data; @@ -568,7 +590,8 @@ find_attendee_cb (gpointer key, gpointer value, gpointer user_data) } static void -refresh_queue_remove (EMeetingStore *store, EMeetingAttendee *attendee) +refresh_queue_remove (EMeetingStore *store, + EMeetingAttendee *attendee) { EMeetingStorePrivate *priv; EMeetingStoreQueueData *qdata; @@ -964,7 +987,8 @@ e_meeting_store_set_week_start_day (EMeetingStore *store, } static void -attendee_changed_cb (EMeetingAttendee *attendee, gpointer data) +attendee_changed_cb (EMeetingAttendee *attendee, + gpointer data) { EMeetingStore *store = E_MEETING_STORE (data); GtkTreePath *path; @@ -989,7 +1013,8 @@ attendee_changed_cb (EMeetingAttendee *attendee, gpointer data) } void -e_meeting_store_add_attendee (EMeetingStore *store, EMeetingAttendee *attendee) +e_meeting_store_add_attendee (EMeetingStore *store, + EMeetingAttendee *attendee) { GtkTreePath *path; GtkTreeIter iter; @@ -1045,7 +1070,8 @@ e_meeting_store_add_attendee_with_defaults (EMeetingStore *store) } void -e_meeting_store_remove_attendee (EMeetingStore *store, EMeetingAttendee *attendee) +e_meeting_store_remove_attendee (EMeetingStore *store, + EMeetingAttendee *attendee) { gint i, row = -1; GtkTreePath *path; @@ -1170,7 +1196,8 @@ e_meeting_store_find_attendee (EMeetingStore *store, } EMeetingAttendee * -e_meeting_store_find_attendee_at_row (EMeetingStore *store, gint row) +e_meeting_store_find_attendee_at_row (EMeetingStore *store, + gint row) { g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL); g_return_val_if_fail (ROW_VALID (store, row), NULL); @@ -1179,7 +1206,8 @@ e_meeting_store_find_attendee_at_row (EMeetingStore *store, gint row) } GtkTreePath * -e_meeting_store_find_attendee_path (EMeetingStore *store, EMeetingAttendee *attendee) +e_meeting_store_find_attendee_path (EMeetingStore *store, + EMeetingAttendee *attendee) { GtkTreePath *path; gint row = -1, i; @@ -1217,7 +1245,8 @@ e_meeting_store_get_attendees (EMeetingStore *store) } static icaltimezone * -find_zone (icalproperty *ip, icalcomponent *tz_top_level) +find_zone (icalproperty *ip, + icalcomponent *tz_top_level) { icalparameter *param; icalcomponent *sub_comp; @@ -1284,9 +1313,9 @@ process_callbacks (EMeetingStoreQueueData *qdata) static void process_free_busy_comp (EMeetingAttendee *attendee, - icalcomponent *fb_comp, - icaltimezone *zone, - icalcomponent *tz_top_level) + icalcomponent *fb_comp, + icaltimezone *zone, + icalcomponent *tz_top_level) { icalproperty *ip; @@ -1385,7 +1414,8 @@ process_free_busy_comp (EMeetingAttendee *attendee, } static void -process_free_busy (EMeetingStoreQueueData *qdata, gchar *text) +process_free_busy (EMeetingStoreQueueData *qdata, + gchar *text) { EMeetingStore *store = qdata->store; EMeetingStorePrivate *priv; @@ -1439,7 +1469,9 @@ process_free_busy (EMeetingStoreQueueData *qdata, gchar *text) * In the returned newly allocated string. */ static gchar * -replace_string (gchar *string, const gchar *from_value, gchar *to_value) +replace_string (gchar *string, + const gchar *from_value, + gchar *to_value) { gchar *replaced; gchar **split_uri; @@ -1673,11 +1705,12 @@ refresh_busy_periods (gpointer data) } static void -refresh_queue_add (EMeetingStore *store, gint row, - EMeetingTime *start, - EMeetingTime *end, - EMeetingStoreRefreshCallback call_back, - gpointer data) +refresh_queue_add (EMeetingStore *store, + gint row, + EMeetingTime *start, + EMeetingTime *end, + EMeetingStoreRefreshCallback call_back, + gpointer data) { EMeetingStorePrivate *priv; EMeetingAttendee *attendee; @@ -1744,7 +1777,9 @@ refresh_queue_add (EMeetingStore *store, gint row, } static void -async_read (GObject *source_object, GAsyncResult *res, gpointer data) +async_read (GObject *source_object, + GAsyncResult *result, + gpointer data) { EMeetingStoreQueueData *qdata = data; GError *error = NULL; @@ -1756,7 +1791,7 @@ async_read (GObject *source_object, GAsyncResult *res, gpointer data) istream = G_INPUT_STREAM (source_object); - read = g_input_stream_read_finish (istream, res, &error); + read = g_input_stream_read_finish (istream, result, &error); if (error || read < 0) { g_warning ("Read finish failed: %s", error ? error->message : "Unknown error"); @@ -1874,7 +1909,8 @@ soup_authenticate (SoupSession *session, } static void -redirect_handler (SoupMessage *msg, gpointer user_data) +redirect_handler (SoupMessage *msg, + gpointer user_data) { if (SOUP_STATUS_IS_REDIRECTION (msg->status_code)) { SoupSession *soup_session = user_data; @@ -1901,7 +1937,9 @@ redirect_handler (SoupMessage *msg, gpointer user_data) } static void -soup_msg_ready_cb (SoupSession *session, SoupMessage *msg, gpointer user_data) +soup_msg_ready_cb (SoupSession *session, + SoupMessage *msg, + gpointer user_data) { EMeetingStoreQueueData *qdata = user_data; @@ -1926,7 +1964,8 @@ soup_msg_ready_cb (SoupSession *session, SoupMessage *msg, gpointer user_data) } static void -download_with_libsoup (const gchar *uri, EMeetingStoreQueueData *qdata) +download_with_libsoup (const gchar *uri, + EMeetingStoreQueueData *qdata) { SoupSession *session; SoupMessage *msg; @@ -1968,7 +2007,8 @@ download_with_libsoup (const gchar *uri, EMeetingStoreQueueData *qdata) } static void -start_async_read (const gchar *uri, gpointer data) +start_async_read (const gchar *uri, + gpointer data) { EMeetingStoreQueueData *qdata = data; GError *error = NULL; @@ -2011,10 +2051,10 @@ start_async_read (const gchar *uri, gpointer data) void e_meeting_store_refresh_all_busy_periods (EMeetingStore *store, - EMeetingTime *start, - EMeetingTime *end, - EMeetingStoreRefreshCallback call_back, - gpointer data) + EMeetingTime *start, + EMeetingTime *end, + EMeetingStoreRefreshCallback call_back, + gpointer data) { gint i; @@ -2026,11 +2066,11 @@ e_meeting_store_refresh_all_busy_periods (EMeetingStore *store, void e_meeting_store_refresh_busy_periods (EMeetingStore *store, - gint row, - EMeetingTime *start, - EMeetingTime *end, - EMeetingStoreRefreshCallback call_back, - gpointer data) + gint row, + EMeetingTime *start, + EMeetingTime *end, + EMeetingStoreRefreshCallback call_back, + gpointer data) { g_return_if_fail (E_IS_MEETING_STORE (store)); diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c index 01572ce359..35f3a7d743 100644 --- a/calendar/gui/e-meeting-time-sel-item.c +++ b/calendar/gui/e-meeting-time-sel-item.c @@ -34,9 +34,9 @@ #include "e-meeting-time-sel.h" /* Initially the grid lines were drawn at the bottom of cells, but this didn't - line up well with the GtkEntry widgets, which in the default theme draw a - black shadow line across the top. So I've switched our code to draw the - lines across the top of cells. */ + * line up well with the GtkEntry widgets, which in the default theme draw a + * black shadow line across the top. So I've switched our code to draw the + * lines across the top of cells. */ #define E_MEETING_TIME_SELECTOR_DRAW_GRID_LINES_AT_BOTTOM 0 static void e_meeting_time_selector_item_dispose (GObject *object); @@ -183,7 +183,9 @@ e_meeting_time_selector_item_set_property (GObject *object, } static void -e_meeting_time_selector_item_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +e_meeting_time_selector_item_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { if (GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->update) (* GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->update) (item, i2c, flags); @@ -200,8 +202,12 @@ e_meeting_time_selector_item_update (GnomeCanvasItem *item, const cairo_matrix_t */ static void -draw_strikeout_box (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, - gint x, gint y, gint width, gint height) +draw_strikeout_box (EMeetingTimeSelectorItem *mts_item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { GnomeCanvas *canvas = GNOME_CANVAS_ITEM (mts_item)->canvas; EMeetingTimeSelector *mts = mts_item->mts; @@ -219,7 +225,12 @@ draw_strikeout_box (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, } static void -e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height) +e_meeting_time_selector_item_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { EMeetingTimeSelector *mts; EMeetingTimeSelectorItem *mts_item; @@ -278,7 +289,7 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, g } /* For the main display draw the no-info pattern background for attendee's - that have no calendar information. */ + * that have no calendar information. */ if (!is_display_top) { gdk_cairo_set_source_color (cr, &mts->grid_color); row = y / mts->row_height; @@ -317,8 +328,8 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, g current_date = date; for (;;) { /* Currently we use the same GnomeCanvasItem class for the - top display and the main display. We may use separate - classes in future if necessary. */ + * top display and the main display. We may use separate + * classes in future if necessary. */ if (is_display_top) e_meeting_time_selector_item_paint_day_top (mts_item, cr, ¤t_date, day_x, y, width, height); else @@ -369,9 +380,12 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, g static void e_meeting_time_selector_item_paint_day_top (EMeetingTimeSelectorItem *mts_item, - cairo_t *cr, GDate *date, - gint x, gint scroll_y, - gint width, gint height) + cairo_t *cr, + GDate *date, + gint x, + gint scroll_y, + gint width, + gint height) { EMeetingTimeSelector *mts; gint y, grid_x; @@ -424,18 +438,18 @@ e_meeting_time_selector_item_paint_day_top (EMeetingTimeSelectorItem *mts_item, cairo_stroke (cr); /* Draw the date. Set a clipping rectangle so we don't draw over the - next day. */ + * next day. */ if (mts->date_format == E_MEETING_TIME_SELECTOR_DATE_FULL) /* This is a strftime() format string %A = full weekday name, - %B = full month name, %d = month day, %Y = full year. */ + * %B = full month name, %d = month day, %Y = full year. */ format = _("%A, %B %d, %Y"); else if (mts->date_format == E_MEETING_TIME_SELECTOR_DATE_ABBREVIATED_DAY) /* This is a strftime() format string %a = abbreviated weekday - name, %m = month number, %d = month day, %Y = full year. */ + * name, %m = month number, %d = month day, %Y = full year. */ format = _("%a %m/%d/%Y"); else /* This is a strftime() format string %m = month number, - %d = month day, %Y = full year. */ + * %d = month day, %Y = full year. */ format = _("%m/%d/%Y"); g_date_strftime (buffer, sizeof (buffer), format, date); @@ -473,10 +487,16 @@ e_meeting_time_selector_item_paint_day_top (EMeetingTimeSelectorItem *mts_item, } /* This paints the colored bars representing busy periods for the combined - list of attendees. For now we just paint the bars for each attendee of - each other. If we want to speed it up we could optimise it later. */ + * list of attendees. For now we just paint the bars for each attendee of + * each other. If we want to speed it up we could optimise it later. */ static void -e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, GDate *date, gint x, gint scroll_y, gint width, gint height) +e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelectorItem *mts_item, + cairo_t *cr, + GDate *date, + gint x, + gint scroll_y, + gint width, + gint height) { EMeetingTimeSelector *mts; EMeetingFreeBusyType busy_type; @@ -509,9 +529,12 @@ e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelec static void e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, - cairo_t *cr, GDate *date, - gint x, gint scroll_y, - gint width, gint height) + cairo_t *cr, + GDate *date, + gint x, + gint scroll_y, + gint width, + gint height) { EMeetingTimeSelector *mts; gint grid_x, grid_y, attendee_index, unused_y; @@ -522,7 +545,7 @@ e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, mts = mts_item->mts; /* Draw the grid lines. The grid lines around unused rows are drawn in - a different color. */ + * a different color. */ /* Draw the horizontal grid lines. */ attendee_index = scroll_y / mts->row_height; @@ -585,9 +608,15 @@ e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, } /* This paints the colored bars representing busy periods for the individual - attendees. */ + * attendees. */ static void -e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, GDate *date, gint x, gint scroll_y, gint width, gint height) +e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_item, + cairo_t *cr, + GDate *date, + gint x, + gint scroll_y, + gint width, + gint height) { EMeetingTimeSelector *mts; EMeetingFreeBusyType busy_type; @@ -608,8 +637,8 @@ e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_i first_period = e_meeting_time_selector_item_find_first_busy_period (mts_item, date, row); if (first_period != -1) { /* Paint the different types of busy periods, in - reverse order of precedence, so the highest - precedences are displayed. */ + * reverse order of precedence, so the highest + * precedences are displayed. */ for (busy_type = 0; busy_type < E_MEETING_FREE_BUSY_LAST; busy_type++) { @@ -623,11 +652,13 @@ e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_i } /* This subtracts the attendees longest_period_in_days from the given date, - and does a binary search of the attendee's busy periods array to find the - first one which could possible end on the given day or later. - If none are found it returns -1. */ + * and does a binary search of the attendee's busy periods array to find the + * first one which could possible end on the given day or later. + * If none are found it returns -1. */ static gint -e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *mts_item, GDate *date, gint row) +e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *mts_item, + GDate *date, + gint row) { EMeetingTimeSelector *mts; EMeetingAttendee *ia; @@ -644,7 +675,7 @@ e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *m return -1; /* Check if the period starts after the end of the current canvas - scroll area. */ + * scroll area. */ busy_periods = e_meeting_attendee_get_busy_periods (ia); period = &g_array_index (busy_periods, EMeetingFreeBusyPeriod, period_num); if (g_date_compare (&mts->last_date_shown, &period->start.date) < 0) @@ -654,10 +685,17 @@ e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *m } /* This paints the visible busy periods for one attendee which are of a certain - busy type, e.g out of office. It is passed the index of the first visible - busy period of the attendee and continues until it runs off the screen. */ + * busy type, e.g out of office. It is passed the index of the first visible + * busy period of the attendee and continues until it runs off the screen. */ static void -e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, gint x, gint y, gint width, gint row, gint first_period, EMeetingFreeBusyType busy_type) +e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorItem *mts_item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint row, + gint first_period, + EMeetingFreeBusyType busy_type) { EMeetingTimeSelector *mts; EMeetingAttendee *ia; @@ -681,7 +719,7 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt /* Convert the period start and end times to x coordinates. */ x1 = e_meeting_time_selector_calculate_time_position (mts, &period->start); /* If the period is off the right of the area being drawn, we - are finished. */ + * are finished. */ if (x1 >= x + width) return; @@ -691,10 +729,10 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt continue; /* We paint from x1 to x2 - 1, so that for example a time - from 5:00-6:00 is distinct from 6:00-7:00. - We never finish on a grid line separating days, and we only - ever paint on a normal vertical grid line if the period is - only 1 pixel wide. */ + * from 5:00-6:00 is distinct from 6:00-7:00. + * We never finish on a grid line separating days, and we only + * ever paint on a normal vertical grid line if the period is + * only 1 pixel wide. */ x2_within_day = x2 % mts->day_width; if (x2_within_day == 0) { x2 -= 2; @@ -707,8 +745,8 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt } /* Paint the rectangle. We leave a gap of 2 pixels at the - top and bottom, remembering that the grid is painted along - the top/bottom line of each row. */ + * top and bottom, remembering that the grid is painted along + * the top/bottom line of each row. */ if (x2 - x1 > 0) { #if E_MEETING_TIME_SELECTOR_DRAW_GRID_LINES_AT_BOTTOM cairo_rectangle (cr, x1 - x, y + 2, @@ -727,14 +765,18 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt */ static GnomeCanvasItem * -e_meeting_time_selector_item_point (GnomeCanvasItem *item, double x, double y, - gint cx, gint cy) +e_meeting_time_selector_item_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gint -e_meeting_time_selector_item_event (GnomeCanvasItem *item, GdkEvent *event) +e_meeting_time_selector_item_event (GnomeCanvasItem *item, + GdkEvent *event) { EMeetingTimeSelectorItem *mts_item; @@ -758,13 +800,13 @@ e_meeting_time_selector_item_event (GnomeCanvasItem *item, GdkEvent *event) } /* This handles all button press events for the item. If the cursor is over - one of the meeting time vertical bars we start a drag. If not we set the - meeting time to the nearest half-hour interval. - Note that GnomeCanvas converts the event coords to world coords, - i.e. relative to the entire canvas scroll area. */ + * one of the meeting time vertical bars we start a drag. If not we set the + * meeting time to the nearest half-hour interval. + * Note that GnomeCanvas converts the event coords to world coords, + * i.e. relative to the entire canvas scroll area. */ static gint e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, - GdkEvent *event) + GdkEvent *event) { EMeetingTimeSelector *mts; EMeetingTime start_time, end_time; @@ -784,7 +826,7 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, mts_item->resize_cursor, - event->button.time) == 0 /*Success*/) { + event->button.time) == 0 /*Success */) { mts->dragging_position = position; return TRUE; } @@ -796,7 +838,7 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, end_date = &end_time.date; /* Find the nearest half-hour or hour interval, depending on whether - zoomed_out is set. */ + * zoomed_out is set. */ if (!mts->all_day) { gint astart_year, astart_month, astart_day, astart_hour, astart_minute; gint aend_year, aend_month, aend_day, aend_hour, aend_minute; @@ -869,10 +911,10 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, } /* This handles all button release events for the item. If we were dragging, - we finish the drag. */ + * we finish the drag. */ static gint e_meeting_time_selector_item_button_release (EMeetingTimeSelectorItem *mts_item, - GdkEvent *event) + GdkEvent *event) { EMeetingTimeSelector *mts; @@ -890,12 +932,12 @@ e_meeting_time_selector_item_button_release (EMeetingTimeSelectorItem *mts_item, } /* This handles all motion notify events for the item. If button1 is pressed - we check if a drag is in progress. If not, we set the cursor if we are over - the meeting time vertical bars. Note that GnomeCanvas doesn't use motion - hints, which may affect performance. */ + * we check if a drag is in progress. If not, we set the cursor if we are over + * the meeting time vertical bars. Note that GnomeCanvas doesn't use motion + * hints, which may affect performance. */ static gint e_meeting_time_selector_item_motion_notify (EMeetingTimeSelectorItem *mts_item, - GdkEvent *event) + GdkEvent *event) { EMeetingTimeSelector *mts; EMeetingTimeSelectorPosition position; @@ -940,7 +982,8 @@ e_meeting_time_selector_item_motion_notify (EMeetingTimeSelectorItem *mts_item, static EMeetingTimeSelectorPosition e_meeting_time_selector_item_get_drag_position (EMeetingTimeSelectorItem *mts_item, - gint x, gint y) + gint x, + gint y) { EMeetingTimeSelector *mts; gboolean is_display_top; @@ -967,11 +1010,11 @@ e_meeting_time_selector_item_get_drag_position (EMeetingTimeSelectorItem *mts_it static gboolean e_meeting_time_selector_item_calculate_busy_range (EMeetingTimeSelector *mts, - gint row, - gint x, - gint width, - gint *start_x, - gint *end_x) + gint row, + gint x, + gint width, + gint *start_x, + gint *end_x) { EMeetingAttendee *ia; EMeetingTime busy_periods_start; diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index ebe9bd05c0..9afdfd7a22 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -74,7 +74,7 @@ const gchar *EMeetingTimeSelectorHours12[24] = { #define E_MEETING_TIME_SELECTOR_FB_DAYS_AFTER 28 /* This is the number of pixels between the mouse has to move before the - scroll speed is incremented. */ + * scroll speed is incremented. */ #define E_MEETING_TIME_SELECTOR_SCROLL_INCREMENT_WIDTH 10 /* This is the maximum scrolling speed. */ @@ -150,22 +150,22 @@ static void e_meeting_time_selector_on_next_button_clicked (GtkWidget *button, EMeetingTimeSelector *mts); static void e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, gboolean forward); -static void e_meeting_time_selector_calculate_time_difference (EMeetingTime*start, - EMeetingTime*end, +static void e_meeting_time_selector_calculate_time_difference (EMeetingTime *start, + EMeetingTime *end, gint *days, gint *hours, gint *minutes); static void e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, - EMeetingTime*start_time, - EMeetingTime*end_time, + EMeetingTime *start_time, + EMeetingTime *end_time, gint days, gint hours, gint mins); static void e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mts, EMeetingTime *start_time, EMeetingTime *end_time, gint days, gint hours, gint mins); -static void e_meeting_time_selector_adjust_time (EMeetingTime*mtstime, +static void e_meeting_time_selector_adjust_time (EMeetingTime *mtstime, gint days, gint hours, gint minutes); -static EMeetingFreeBusyPeriod* e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, +static EMeetingFreeBusyPeriod * e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, EMeetingAttendee *attendee, EMeetingTime *start_time, EMeetingTime *end_time); @@ -175,7 +175,7 @@ static void e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mt static void e_meeting_time_selector_save_position (EMeetingTimeSelector *mts, EMeetingTime *mtstime); static void e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts, - EMeetingTime*mtstime); + EMeetingTime *mtstime); static void e_meeting_time_selector_on_start_time_changed (GtkWidget *widget, EMeetingTimeSelector *mts); static void e_meeting_time_selector_on_end_time_changed (GtkWidget *widget, @@ -298,7 +298,7 @@ meeting_time_selector_dispose (GObject *object) } static void -e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * class) +e_meeting_time_selector_class_init (EMeetingTimeSelectorClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; @@ -359,7 +359,7 @@ e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * class) } static void -e_meeting_time_selector_init (EMeetingTimeSelector * mts) +e_meeting_time_selector_init (EMeetingTimeSelector *mts) { mts->priv = G_TYPE_INSTANCE_GET_PRIVATE ( mts, E_TYPE_MEETING_TIME_SELECTOR, @@ -387,7 +387,8 @@ e_meeting_time_selector_init (EMeetingTimeSelector * mts) } void -e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *ems) +e_meeting_time_selector_construct (EMeetingTimeSelector *mts, + EMeetingStore *ems) { GtkWidget *hbox, *vbox, *separator, *label, *table, *sw; GtkWidget *alignment, *child_hbox, *arrow, *menuitem; @@ -401,7 +402,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em AtkObject *a11y_label, *a11y_date_edit; /* The default meeting time is the nearest half-hour interval in the - future, in working hours. */ + * future, in working hours. */ meeting_start_time = time (NULL); g_date_clear (&mts->meeting_start_time.date, 1); g_date_set_time_t (&mts->meeting_start_time.date, meeting_start_time); @@ -859,11 +860,12 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em } /* This adds a color to the color key beneath the main display. If color is - NULL, it displays the No Info pattern instead. */ + * NULL, it displays the No Info pattern instead. */ static void -e_meeting_time_selector_add_key_color (EMeetingTimeSelector * mts, - GtkWidget *hbox, - gchar *label_text, GdkColor *color) +e_meeting_time_selector_add_key_color (EMeetingTimeSelector *mts, + GtkWidget *hbox, + gchar *label_text, + GdkColor *color) { GtkWidget *child_hbox, *darea, *label; @@ -888,7 +890,9 @@ e_meeting_time_selector_add_key_color (EMeetingTimeSelector * mts, } static gint -e_meeting_time_selector_draw_key_color (GtkWidget *darea, cairo_t *cr, GdkColor *color) +e_meeting_time_selector_draw_key_color (GtkWidget *darea, + cairo_t *cr, + GdkColor *color) { EMeetingTimeSelector * mts; GtkAllocation allocation; @@ -918,8 +922,9 @@ e_meeting_time_selector_draw_key_color (GtkWidget *darea, cairo_t *cr, GdkColor } static void -e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector * mts, - const gchar *name, GdkColor *c) +e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector *mts, + const gchar *name, + GdkColor *c) { g_return_if_fail (name != NULL); g_return_if_fail (c != NULL); @@ -930,7 +935,7 @@ e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector * mts, static void e_meeting_time_selector_options_menu_detacher (GtkWidget *widget, - GtkMenu *menu) + GtkMenu *menu) { EMeetingTimeSelector *mts; @@ -938,14 +943,14 @@ e_meeting_time_selector_options_menu_detacher (GtkWidget *widget, g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (widget)); mts = E_MEETING_TIME_SELECTOR (widget); - g_return_if_fail (mts->options_menu == (GtkWidget*) menu); + g_return_if_fail (mts->options_menu == (GtkWidget *) menu); mts->options_menu = NULL; } static void e_meeting_time_selector_autopick_menu_detacher (GtkWidget *widget, - GtkMenu *menu) + GtkMenu *menu) { EMeetingTimeSelector *mts; @@ -953,7 +958,7 @@ e_meeting_time_selector_autopick_menu_detacher (GtkWidget *widget, g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (widget)); mts = E_MEETING_TIME_SELECTOR (widget); - g_return_if_fail (mts->autopick_menu == (GtkWidget*) menu); + g_return_if_fail (mts->autopick_menu == (GtkWidget *) menu); mts->autopick_menu = NULL; } @@ -1149,12 +1154,12 @@ style_change_idle_func (EMeetingTimeSelector *mts) * FIXME: I can't find a way to get the treeview header heights * other than the below but it isn't nice to realize that widget here * - + * gtk_widget_realize (mts->list_view); gdk_window_get_position (gtk_tree_view_get_bin_window (GTK_TREE_VIEW (mts->list_view)), NULL, &maxheight); gtk_widget_set_size_request (mts->attendees_vbox_spacer, 1, mts->row_height * 3 - maxheight); - + * */ gtk_widget_set_size_request (mts->attendees_vbox_spacer, 1, mts->row_height * 2 - 6); @@ -1177,7 +1182,7 @@ style_change_idle_func (EMeetingTimeSelector *mts) static void e_meeting_time_selector_style_set (GtkWidget *widget, - GtkStyle *previous_style) + GtkStyle *previous_style) { EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (widget); @@ -1191,7 +1196,8 @@ e_meeting_time_selector_style_set (GtkWidget *widget, /* This draws a shadow around the top display and main display. */ static gint -e_meeting_time_selector_draw (GtkWidget *widget, cairo_t *cr) +e_meeting_time_selector_draw (GtkWidget *widget, + cairo_t *cr) { EMeetingTimeSelector *mts; @@ -1206,7 +1212,8 @@ e_meeting_time_selector_draw (GtkWidget *widget, cairo_t *cr) } static void -e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts, cairo_t *cr) +e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts, + cairo_t *cr) { GtkAllocation allocation; GtkStyle *style; @@ -1233,7 +1240,7 @@ e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts, cairo_t *cr) /* When the main canvas scrolls, we scroll the other canvases. */ static void e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { GtkAdjustment *hadjustment; GtkScrollable *scrollable; @@ -1248,7 +1255,7 @@ e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment, static void e_meeting_time_selector_vadjustment_changed (GtkAdjustment *adjustment, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { GtkAdjustment *vadjustment; GtkTreeView *tree_view; @@ -1263,16 +1270,16 @@ e_meeting_time_selector_vadjustment_changed (GtkAdjustment *adjustment, void e_meeting_time_selector_get_meeting_time (EMeetingTimeSelector *mts, - gint *start_year, - gint *start_month, - gint *start_day, - gint *start_hour, - gint *start_minute, - gint *end_year, - gint *end_month, - gint *end_day, - gint *end_hour, - gint *end_minute) + gint *start_year, + gint *start_month, + gint *start_day, + gint *start_hour, + gint *start_minute, + gint *end_year, + gint *end_month, + gint *end_day, + gint *end_hour, + gint *end_minute) { *start_year = g_date_get_year (&mts->meeting_start_time.date); *start_month = g_date_get_month (&mts->meeting_start_time.date); @@ -1289,16 +1296,16 @@ e_meeting_time_selector_get_meeting_time (EMeetingTimeSelector *mts, gboolean e_meeting_time_selector_set_meeting_time (EMeetingTimeSelector *mts, - gint start_year, - gint start_month, - gint start_day, - gint start_hour, - gint start_minute, - gint end_year, - gint end_month, - gint end_day, - gint end_hour, - gint end_minute) + gint start_year, + gint start_month, + gint start_day, + gint start_hour, + gint start_minute, + gint end_year, + gint end_month, + gint end_day, + gint end_hour, + gint end_minute) { g_return_val_if_fail (E_IS_MEETING_TIME_SELECTOR (mts), FALSE); @@ -1336,7 +1343,7 @@ e_meeting_time_selector_set_meeting_time (EMeetingTimeSelector *mts, void e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts, - gboolean all_day) + gboolean all_day) { EMeetingTime saved_time; @@ -1358,7 +1365,7 @@ e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts, void e_meeting_time_selector_set_working_hours_only (EMeetingTimeSelector *mts, - gboolean working_hours_only) + gboolean working_hours_only) { EMeetingTime saved_time; @@ -1380,10 +1387,10 @@ e_meeting_time_selector_set_working_hours_only (EMeetingTimeSelector *mts, void e_meeting_time_selector_set_working_hours (EMeetingTimeSelector *mts, - gint day_start_hour, - gint day_start_minute, - gint day_end_hour, - gint day_end_minute) + gint day_start_hour, + gint day_start_minute, + gint day_end_hour, + gint day_end_minute) { EMeetingTime saved_time; @@ -1418,7 +1425,7 @@ e_meeting_time_selector_set_working_hours (EMeetingTimeSelector *mts, void e_meeting_time_selector_set_zoomed_out (EMeetingTimeSelector *mts, - gboolean zoomed_out) + gboolean zoomed_out) { EMeetingTime saved_time; @@ -1469,7 +1476,9 @@ e_meeting_time_selector_refresh_cb (gpointer data) } void -e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, gint row, gboolean all) +e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, + gint row, + gboolean all) { EMeetingTime start, end; @@ -1547,7 +1556,7 @@ e_meeting_time_selector_get_autopick_option (EMeetingTimeSelector *mts) void e_meeting_time_selector_set_autopick_option (EMeetingTimeSelector *mts, - EMeetingTimeSelectorAutopickOption autopick_option) + EMeetingTimeSelectorAutopickOption autopick_option) { g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); @@ -1566,26 +1575,10 @@ e_meeting_time_selector_set_autopick_option (EMeetingTimeSelector *mts, break; } } -#if 0 -void -e_meeting_time_selector_attendee_set_send_meeting_to (EMeetingTimeSelector *mts, - gint row, - gboolean send_meeting_to) -{ - EMeetingTimeSelectorAttendee *attendee; - - g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); - g_return_if_fail (row >= 0); - g_return_if_fail (row < mts->attendees->len); - - attendee = &g_array_index (mts->attendees, - EMeetingTimeSelectorAttendee, row); - attendee->send_meeting_to = send_meeting_to; -} -#endif void -e_meeting_time_selector_set_read_only (EMeetingTimeSelector *mts, gboolean read_only) +e_meeting_time_selector_set_read_only (EMeetingTimeSelector *mts, + gboolean read_only) { g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); @@ -1651,9 +1644,9 @@ e_meeting_time_selector_dump (EMeetingTimeSelector *mts) } /* This formats a EMeetingTimein a string and returns it. - Note that it uses a static buffer. */ + * Note that it uses a static buffer. */ gchar * -e_meeting_time_selector_dump_time (EMeetingTime*mtstime) +e_meeting_time_selector_dump_time (EMeetingTime *mtstime) { static gchar buffer[128]; @@ -1670,7 +1663,7 @@ e_meeting_time_selector_dump_time (EMeetingTime*mtstime) } /* This formats a GDate in a string and returns it. - Note that it uses a static buffer. */ + * Note that it uses a static buffer. */ gchar * e_meeting_time_selector_dump_date (GDate *date) { @@ -1685,14 +1678,14 @@ e_meeting_time_selector_dump_date (GDate *date) static void e_meeting_time_selector_on_invite_others_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { e_meeting_list_view_invite_others_dialog (mts->list_view); } static void e_meeting_time_selector_on_options_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gtk_menu_popup (GTK_MENU (mts->options_menu), NULL, NULL, e_meeting_time_selector_options_menu_position_callback, @@ -1701,10 +1694,10 @@ e_meeting_time_selector_on_options_button_clicked (GtkWidget *button, static void e_meeting_time_selector_options_menu_position_callback (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) { EMeetingTimeSelector *mts; GtkRequisition menu_requisition; @@ -1733,10 +1726,10 @@ e_meeting_time_selector_options_menu_position_callback (GtkMenu *menu, static void e_meeting_time_selector_on_update_free_busy (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { /* Make sure the menu pops down, which doesn't happen by default if - keyboard accelerators are used. */ + * keyboard accelerators are used. */ if (gtk_widget_get_visible (mts->options_menu)) gtk_menu_popdown (GTK_MENU (mts->options_menu)); @@ -1745,7 +1738,7 @@ e_meeting_time_selector_on_update_free_busy (GtkWidget *button, static void e_meeting_time_selector_on_autopick_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gtk_menu_popup (GTK_MENU (mts->autopick_menu), NULL, NULL, e_meeting_time_selector_autopick_menu_position_callback, @@ -1754,10 +1747,10 @@ e_meeting_time_selector_on_autopick_button_clicked (GtkWidget *button, static void e_meeting_time_selector_autopick_menu_position_callback (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) { EMeetingTimeSelector *mts; GtkRequisition menu_requisition; @@ -1786,33 +1779,33 @@ e_meeting_time_selector_autopick_menu_position_callback (GtkMenu *menu, static void e_meeting_time_selector_on_autopick_option_toggled (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { /* Make sure the menu pops down, which doesn't happen by default if - keyboard accelerators are used. */ + * keyboard accelerators are used. */ if (gtk_widget_get_visible (mts->autopick_menu)) gtk_menu_popdown (GTK_MENU (mts->autopick_menu)); } static void e_meeting_time_selector_on_prev_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { e_meeting_time_selector_autopick (mts, FALSE); } static void e_meeting_time_selector_on_next_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { e_meeting_time_selector_autopick (mts, TRUE); } /* This tries to find the previous or next meeting time for which all - attendees will be available. */ + * attendees will be available. */ static void e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, - gboolean forward) + gboolean forward) { EMeetingTime start_time, end_time, *resource_free; EMeetingAttendee *attendee; @@ -1833,7 +1826,7 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, e_meeting_time_selector_find_nearest_interval_backward (mts, &start_time, &end_time, duration_days, duration_hours, duration_minutes); /* Determine if we can skip optional people and if we only need one - resource based on the autopick option. */ + * resource based on the autopick option. */ autopick_option = e_meeting_time_selector_get_autopick_option (mts); if (autopick_option == E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE || autopick_option == E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE_AND_ONE_RESOURCE) @@ -1843,14 +1836,14 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, need_one_resource = TRUE; /* Keep moving forward or backward until we find a possible meeting - time. */ + * time. */ for (;;) { meeting_time_ok = TRUE; found_resource = FALSE; resource_free = NULL; /* Step through each attendee, checking if the meeting time - intersects one of the attendees busy periods. */ + * intersects one of the attendees busy periods. */ for (row = 0; row < e_meeting_store_count_actual_attendees (mts->model); row++) { attendee = e_meeting_store_find_attendee_at_row (mts->model, row); @@ -1863,9 +1856,9 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, if (need_one_resource && e_meeting_attendee_get_atype (attendee) == E_MEETING_ATTENDEE_RESOURCE) { if (period) { /* We want to remember the closest - prev/next time that one resource is - available, in case we don't find any - free resources. */ + * prev/next time that one resource is + * available, in case we don't find any + * free resources. */ if (forward) { if (!resource_free || e_meeting_time_compare_times (resource_free, &period->end) > 0) resource_free = &period->end; @@ -1891,9 +1884,9 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, } /* Check that we found one resource if necessary. If not, skip - to the closest time that a resource is free. Note that if - there are no resources, resource_free will never get set, - so we assume the meeting time is OK. */ + * to the closest time that a resource is free. Note that if + * there are no resources, resource_free will never get set, + * so we assume the meeting time is OK. */ if (meeting_time_ok && need_one_resource && !found_resource && resource_free) { if (forward) { @@ -1933,11 +1926,11 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, } static void -e_meeting_time_selector_calculate_time_difference (EMeetingTime*start, - EMeetingTime*end, - gint *days, - gint *hours, - gint *minutes) +e_meeting_time_selector_calculate_time_difference (EMeetingTime *start, + EMeetingTime *end, + gint *days, + gint *hours, + gint *minutes) { *days = g_date_get_julian (&end->date) - g_date_get_julian (&start->date); *hours = end->hour - start->hour; @@ -1953,12 +1946,14 @@ e_meeting_time_selector_calculate_time_difference (EMeetingTime*start, } /* This moves the given time forward to the next suitable start of a meeting. - If zoomed_out is set, this means every hour. If not every half-hour. */ + * If zoomed_out is set, this means every hour. If not every half-hour. */ static void e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, - EMeetingTime*start_time, - EMeetingTime*end_time, - gint days, gint hours, gint mins) + EMeetingTime *start_time, + EMeetingTime *end_time, + gint days, + gint hours, + gint mins) { gint minutes_shown; gboolean set_to_start_of_working_day = FALSE; @@ -1982,7 +1977,7 @@ e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, e_meeting_time_selector_adjust_time (end_time, days, hours, mins); /* Check if the interval is less than a day as seen in the display. - If it isn't we don't worry about the working day. */ + * If it isn't we don't worry about the working day. */ if (!mts->working_hours_only || days > 0) return; minutes_shown = (mts->day_end_hour - mts->day_start_hour) * 60; @@ -1991,8 +1986,8 @@ e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, return; /* If the meeting time finishes past the end of the working day, move - onto the start of the next working day. If the meeting time starts - before the working day, move it on as well. */ + * onto the start of the next working day. If the meeting time starts + * before the working day, move it on as well. */ if (start_time->hour > mts->day_end_hour || (start_time->hour == mts->day_end_hour && start_time->minute > mts->day_end_minute) @@ -2029,12 +2024,14 @@ e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, } /* This moves the given time backward to the next suitable start of a meeting. - If zoomed_out is set, this means every hour. If not every half-hour. */ + * If zoomed_out is set, this means every hour. If not every half-hour. */ static void e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mts, - EMeetingTime*start_time, - EMeetingTime*end_time, - gint days, gint hours, gint mins) + EMeetingTime *start_time, + EMeetingTime *end_time, + gint days, + gint hours, + gint mins) { gint new_hour, minutes_shown; gboolean set_to_end_of_working_day = FALSE; @@ -2069,7 +2066,7 @@ e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mt e_meeting_time_selector_adjust_time (end_time, days, hours, mins); /* Check if the interval is less than a day as seen in the display. - If it isn't we don't worry about the working day. */ + * If it isn't we don't worry about the working day. */ if (!mts->working_hours_only || days > 0) return; minutes_shown = (mts->day_end_hour - mts->day_start_hour) * 60; @@ -2078,9 +2075,9 @@ e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mt return; /* If the meeting time finishes past the end of the working day, move - back to the end of the working day. If the meeting time starts - before the working day, move it back to the end of the previous - working day. */ + * back to the end of the working day. If the meeting time starts + * before the working day, move it back to the end of the previous + * working day. */ if (start_time->hour > mts->day_end_hour || (start_time->hour == mts->day_end_hour && start_time->minute > mts->day_end_minute) @@ -2113,17 +2110,19 @@ e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mt } /* This adds on the given days, hours & minutes to a EMeetingTimeSelectorTime. - It is used to calculate the end of a period given a start & duration. - Days, hours & minutes can be negative, to move backwards, but they should - be within normal ranges, e.g. hours should be between -23 and 23. */ + * It is used to calculate the end of a period given a start & duration. + * Days, hours & minutes can be negative, to move backwards, but they should + * be within normal ranges, e.g. hours should be between -23 and 23. */ static void -e_meeting_time_selector_adjust_time (EMeetingTime*mtstime, - gint days, gint hours, gint minutes) +e_meeting_time_selector_adjust_time (EMeetingTime *mtstime, + gint days, + gint hours, + gint minutes) { gint new_hours, new_minutes; /* We have to handle negative values for hous and minutes here, since - EMeetingTimeuses guint8s to store them. */ + * EMeetingTimeuses guint8s to store them. */ new_minutes = mtstime->minute + minutes; if (new_minutes < 0) { new_minutes += 60; @@ -2144,12 +2143,12 @@ e_meeting_time_selector_adjust_time (EMeetingTime*mtstime, } /* This looks for any busy period of the given attendee which clashes with - the start and end time. It uses a binary search. */ + * the start and end time. It uses a binary search. */ static EMeetingFreeBusyPeriod * e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, - EMeetingAttendee *attendee, - EMeetingTime*start_time, - EMeetingTime*end_time) + EMeetingAttendee *attendee, + EMeetingTime *start_time, + EMeetingTime *end_time) { EMeetingFreeBusyPeriod *period; const GArray *busy_periods; @@ -2162,19 +2161,19 @@ e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, return NULL; /* Step forward through the busy periods until we find a clash or we - go past the end_time. */ + * go past the end_time. */ while (period_num < busy_periods->len) { period = &g_array_index (busy_periods, EMeetingFreeBusyPeriod, period_num); /* If the period starts at or after the end time, there is no - clash and we are finished. The busy periods are sorted by - their start times, so all the rest will be later. */ + * clash and we are finished. The busy periods are sorted by + * their start times, so all the rest will be later. */ if (e_meeting_time_compare_times (&period->start, end_time) >= 0) return NULL; /* If the period ends after the start time, we have found a - clash. From the above test we already know the busy period - isn't completely after the meeting time. */ + * clash. From the above test we already know the busy period + * isn't completely after the meeting time. */ if (e_meeting_time_compare_times (&period->end, start_time) > 0) return period; @@ -2186,12 +2185,12 @@ e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, static void e_meeting_time_selector_on_zoomed_out_toggled (GtkCheckMenuItem *menuitem, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gboolean active; /* Make sure the menu pops down, which doesn't happen by default if - keyboard accelerators are used. */ + * keyboard accelerators are used. */ if (gtk_widget_get_visible (mts->options_menu)) gtk_menu_popdown (GTK_MENU (mts->options_menu)); @@ -2202,12 +2201,12 @@ e_meeting_time_selector_on_zoomed_out_toggled (GtkCheckMenuItem *menuitem, static void e_meeting_time_selector_on_working_hours_toggled (GtkCheckMenuItem *menuitem, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gboolean active; /* Make sure the menu pops down, which doesn't happen by default if - keyboard accelerators are used. */ + * keyboard accelerators are used. */ if (gtk_widget_get_visible (mts->options_menu)) gtk_menu_popdown (GTK_MENU (mts->options_menu)); @@ -2257,7 +2256,7 @@ e_meeting_time_selector_recalc_grid (EMeetingTimeSelector *mts) /* This saves the first visible time in the given EMeetingTimeSelectorTime. */ static void e_meeting_time_selector_save_position (EMeetingTimeSelector *mts, - EMeetingTime*mtstime) + EMeetingTime *mtstime) { gint scroll_x, scroll_y; @@ -2269,7 +2268,7 @@ e_meeting_time_selector_save_position (EMeetingTimeSelector *mts, /* This restores a saved position. */ static void e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts, - EMeetingTime*mtstime) + EMeetingTime *mtstime) { gint scroll_x, scroll_y, new_scroll_x; @@ -2282,13 +2281,13 @@ e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts, } /* This returns the x pixel coords of the meeting time in the entire scroll - region. It recalculates them if they have been marked as invalid. - If it returns FALSE then no meeting time is set or the meeting time is - not visible in the current scroll area. */ + * region. It recalculates them if they have been marked as invalid. + * If it returns FALSE then no meeting time is set or the meeting time is + * not visible in the current scroll area. */ gboolean e_meeting_time_selector_get_meeting_time_positions (EMeetingTimeSelector *mts, - gint *start_x, - gint *end_x) + gint *start_x, + gint *end_x) { if (mts->meeting_positions_valid) { if (mts->meeting_positions_in_scroll_area) { @@ -2317,12 +2316,12 @@ e_meeting_time_selector_get_meeting_time_positions (EMeetingTimeSelector *mts, } /* This recalculates the date format to used, by computing the width of the - longest date strings in the widget's font and seeing if they fit. */ + * longest date strings in the widget's font and seeing if they fit. */ static void e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) { /* An array of dates, one for each month in the year 2000. They must - all be Sundays. */ + * all be Sundays. */ static const gint days[12] = { 23, 20, 19, 23, 21, 18, 23, 20, 17, 22, 19, 24 }; GDate date; @@ -2341,7 +2340,7 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) max_date_width = mts->day_width - 2; /* Find the biggest full weekday name. We start on a particular - Monday and go through seven days. */ + * Monday and go through seven days. */ g_date_clear (&date, 1); g_date_set_dmy (&date, 3, 1, 2000); /* Monday 3rd Jan 2000. */ longest_weekday_width = 0; @@ -2370,13 +2369,13 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) } /* See if we can use the full date. We want to use a date with a - month day > 20 and also the longest weekday. We use a - pre-calculated array of days for each month and add on the - weekday (which is 1 (Mon) to 7 (Sun). */ + * month day > 20 and also the longest weekday. We use a + * pre-calculated array of days for each month and add on the + * weekday (which is 1 (Mon) to 7 (Sun). */ g_date_set_dmy (&date, days[longest_month - 1] + longest_weekday, longest_month, 2000); /* This is a strftime() format string %A = full weekday name, - %B = full month name, %d = month day, %Y = full year. */ + * %B = full month name, %d = month day, %Y = full year. */ g_date_strftime (buffer, sizeof (buffer), _("%A, %B %d, %Y"), &date); #if 0 @@ -2407,7 +2406,7 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) g_date_set_dmy (&date, days[longest_month - 1] + longest_weekday, longest_month, 2000); /* This is a strftime() format string %a = abbreviated weekday name, - %m = month number, %d = month day, %Y = full year. */ + * %m = month number, %d = month day, %Y = full year. */ g_date_strftime (buffer, sizeof (buffer), _("%a %m/%d/%Y"), &date); #if 0 @@ -2426,10 +2425,10 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) } /* Turn off the background of the canvas windows. This reduces flicker - considerably when scrolling. (Why isn't it in GnomeCanvas?). */ + * considerably when scrolling. (Why isn't it in GnomeCanvas?). */ static void e_meeting_time_selector_on_canvas_realized (GtkWidget *widget, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { GdkWindow *window; @@ -2438,12 +2437,12 @@ e_meeting_time_selector_on_canvas_realized (GtkWidget *widget, } /* This is called when the meeting start time GnomeDateEdit is changed, - either via the "date_changed". "time_changed" or "activate" signals on one - of the GtkEntry widgets. So don't use the widget parameter since it may be - one of the child GtkEntry widgets. */ + * either via the "date_changed". "time_changed" or "activate" signals on one + * of the GtkEntry widgets. So don't use the widget parameter since it may be + * one of the child GtkEntry widgets. */ static void e_meeting_time_selector_on_start_time_changed (GtkWidget *widget, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gint duration_days, duration_hours, duration_minutes; EMeetingTime mtstime; @@ -2484,12 +2483,12 @@ e_meeting_time_selector_on_start_time_changed (GtkWidget *widget, } /* This is called when the meeting end time GnomeDateEdit is changed, - either via the "date_changed", "time_changed" or "activate" signals on one - of the GtkEntry widgets. So don't use the widget parameter since it may be - one of the child GtkEntry widgets. */ + * either via the "date_changed", "time_changed" or "activate" signals on one + * of the GtkEntry widgets. So don't use the widget parameter since it may be + * one of the child GtkEntry widgets. */ static void e_meeting_time_selector_on_end_time_changed (GtkWidget *widget, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { EMeetingTime mtstime; gint hour = 0, minute = 0; @@ -2517,7 +2516,7 @@ e_meeting_time_selector_on_end_time_changed (GtkWidget *widget, /* If the start time is after the end time, set it to the same time. */ if (e_meeting_time_compare_times (&mtstime, &mts->meeting_start_time) <= 0) { /* We set it first, before updating the widget, so the signal - handler will just return. */ + * handler will just return. */ mts->meeting_start_time = mtstime; if (mts->all_day) g_date_subtract_days (&mts->meeting_start_time.date, 1); @@ -2533,7 +2532,7 @@ e_meeting_time_selector_on_end_time_changed (GtkWidget *widget, } /* This updates the ranges shown in the GnomeDateEdit popup menus, according - to working_hours_only etc. */ + * to working_hours_only etc. */ static void e_meeting_time_selector_update_date_popup_menus (EMeetingTimeSelector *mts) { @@ -2557,8 +2556,8 @@ e_meeting_time_selector_update_date_popup_menus (EMeetingTimeSelector *mts) static void e_meeting_time_selector_on_canvas_size_allocate (GtkWidget *widget, - GtkAllocation *allocation, - EMeetingTimeSelector *mts) + GtkAllocation *allocation, + EMeetingTimeSelector *mts) { e_meeting_time_selector_update_main_canvas_scroll_region (mts); @@ -2566,7 +2565,9 @@ e_meeting_time_selector_on_canvas_size_allocate (GtkWidget *widget, } static gboolean -e_meeting_time_selector_on_canvas_scroll_event (GtkWidget *widget, GdkEventScroll *event, EMeetingTimeSelector *mts) +e_meeting_time_selector_on_canvas_scroll_event (GtkWidget *widget, + GdkEventScroll *event, + EMeetingTimeSelector *mts) { gboolean return_val = FALSE; @@ -2577,8 +2578,8 @@ e_meeting_time_selector_on_canvas_scroll_event (GtkWidget *widget, GdkEventScrol } /* This updates the canvas scroll regions according to the number of attendees. - If the total height needed is less than the height of the canvas, we must - use the height of the canvas, or it causes problems. */ + * If the total height needed is less than the height of the canvas, we must + * use the height of the canvas, or it causes problems. */ static void e_meeting_time_selector_update_main_canvas_scroll_region (EMeetingTimeSelector *mts) { @@ -2596,13 +2597,13 @@ e_meeting_time_selector_update_main_canvas_scroll_region (EMeetingTimeSelector * } /* This changes the meeting time based on the given x coordinate and whether - we are dragging the start or end bar. It returns the new position, which - will be swapped if the start bar is dragged past the end bar or vice versa. - It make sure the meeting time is never dragged outside the visible canvas - area. */ + * we are dragging the start or end bar. It returns the new position, which + * will be swapped if the start bar is dragged past the end bar or vice versa. + * It make sure the meeting time is never dragged outside the visible canvas + * area. */ void e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, - gint x) + gint x) { EMeetingTime first_time, last_time, drag_time, *time_to_set; gint scroll_x, scroll_y, canvas_width; @@ -2635,7 +2636,7 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, } /* Calculate the minimum & maximum times we can use, based on the - scroll offsets and whether zoomed_out is set. */ + * scroll offsets and whether zoomed_out is set. */ e_meeting_time_selector_calculate_time (mts, scroll_x, &first_time); e_meeting_time_selector_calculate_time (mts, scroll_x + canvas_width - 1, &last_time); @@ -2665,7 +2666,7 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, e_meeting_time_selector_calculate_time (mts, x, &drag_time); /* Calculate the nearest half-hour or hour, depending on whether - zoomed_out is set. */ + * zoomed_out is set. */ if (!mts->all_day) { if (mts->zoomed_out) { if (drag_time.minute > 30) @@ -2749,8 +2750,8 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, } /* This is the timeout function which handles auto-scrolling when the user is - dragging one of the meeting time vertical bars outside the left or right - edge of the canvas. */ + * dragging one of the meeting time vertical bars outside the left or right + * edge of the canvas. */ static gboolean e_meeting_time_selector_timeout_handler (gpointer data) { @@ -2797,7 +2798,7 @@ e_meeting_time_selector_timeout_handler (gpointer data) scroll_x = CLAMP (scroll_x, 0, max_scroll_x); /* Calculate the minimum or maximum visible time in the canvas, which - we will now set the dragged time to. */ + * we will now set the dragged time to. */ if (scroll_offset > 0) { e_meeting_time_selector_calculate_time (mts, scroll_x + canvas_width - 1, @@ -2890,9 +2891,9 @@ e_meeting_time_selector_timeout_handler (gpointer data) scroll: /* Redraw the canvases. We freeze and thaw the layouts so that they - get redrawn completely. Otherwise the pixels get scrolled left or - right which is not good for us (since our vertical bars have been - moved) and causes flicker. */ + * get redrawn completely. Otherwise the pixels get scrolled left or + * right which is not good for us (since our vertical bars have been + * moved) and causes flicker. */ gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main), scroll_x, scroll_y); gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_top), @@ -2943,7 +2944,7 @@ e_meeting_time_selector_update_end_date_edit (EMeetingTimeSelector *mts) } /* This ensures that the meeting time is shown on screen, by scrolling the - canvas and possibly by changing the range of dates shown in the canvas. */ + * canvas and possibly by changing the range of dates shown in the canvas. */ static void e_meeting_time_selector_ensure_meeting_time_shown (EMeetingTimeSelector *mts) { @@ -2983,7 +2984,7 @@ e_meeting_time_selector_ensure_meeting_time_shown (EMeetingTimeSelector *mts) } /* This updates the range of dates shown in the canvas, to make sure that the - currently selected meeting time is in the range. */ + * currently selected meeting time is in the range. */ static void e_meeting_time_selector_update_dates_shown (EMeetingTimeSelector *mts) { @@ -2997,10 +2998,10 @@ e_meeting_time_selector_update_dates_shown (EMeetingTimeSelector *mts) } /* This checks if the time's hour is over 24 or its minute is over 60 and if - so it updates the day/hour appropriately. Note that hours and minutes are - stored in guint8's so they can't overflow by much. */ + * so it updates the day/hour appropriately. Note that hours and minutes are + * stored in guint8's so they can't overflow by much. */ void -e_meeting_time_selector_fix_time_overflows (EMeetingTime*mtstime) +e_meeting_time_selector_fix_time_overflows (EMeetingTime *mtstime) { gint hours_to_add, days_to_add; @@ -3023,16 +3024,16 @@ e_meeting_time_selector_fix_time_overflows (EMeetingTime*mtstime) */ /* This takes an x pixel coordinate within the entire canvas scroll region and - returns the date in which it falls. If day_position is not NULL it also - returns the x coordinate within the date, relative to the visible part of - the canvas. It is used when painting the days in the item_draw function. - Note that it must handle negative x coordinates in case we are dragging off - the edge of the canvas. */ + * returns the date in which it falls. If day_position is not NULL it also + * returns the x coordinate within the date, relative to the visible part of + * the canvas. It is used when painting the days in the item_draw function. + * Note that it must handle negative x coordinates in case we are dragging off + * the edge of the canvas. */ void e_meeting_time_selector_calculate_day_and_position (EMeetingTimeSelector *mts, - gint x, - GDate *date, - gint *day_position) + gint x, + GDate *date, + gint *day_position) { gint days_from_first_shown; @@ -3052,9 +3053,12 @@ e_meeting_time_selector_calculate_day_and_position (EMeetingTimeSelector *mts, } /* This takes an x pixel coordinate within a day, and converts it to hours - and minutes, depending on working_hours_only and zoomed_out. */ + * and minutes, depending on working_hours_only and zoomed_out. */ void -e_meeting_time_selector_convert_day_position_to_hours_and_mins (EMeetingTimeSelector *mts, gint day_position, guint8 *hours, guint8 *minutes) +e_meeting_time_selector_convert_day_position_to_hours_and_mins (EMeetingTimeSelector *mts, + gint day_position, + guint8 *hours, + guint8 *minutes) { if (mts->zoomed_out) day_position *= 3; @@ -3068,14 +3072,14 @@ e_meeting_time_selector_convert_day_position_to_hours_and_mins (EMeetingTimeSele } /* This takes an x pixel coordinate within the entire canvas scroll region and - returns the time in which it falls. Note that it won't be extremely - accurate since hours may only be a few pixels wide in the display. - With zoomed_out set each pixel may represent 5 minutes or more, depending - on how small the font is. */ + * returns the time in which it falls. Note that it won't be extremely + * accurate since hours may only be a few pixels wide in the display. + * With zoomed_out set each pixel may represent 5 minutes or more, depending + * on how small the font is. */ void e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, - gint x, - EMeetingTime*time) + gint x, + EMeetingTime *time) { gint day_position; @@ -3093,23 +3097,23 @@ e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, } /* This takes a EMeetingTime and calculates the x pixel coordinate - within the entire canvas scroll region. It is used to draw the selected - meeting time and all the busy periods. */ + * within the entire canvas scroll region. It is used to draw the selected + * meeting time and all the busy periods. */ gint e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts, - EMeetingTime *mtstime) + EMeetingTime *mtstime) { gint x, date_offset, day_offset; /* Calculate the number of days since the first date shown in the - entire canvas scroll region. */ + * entire canvas scroll region. */ date_offset = g_date_get_julian (&mtstime->date) - g_date_get_julian (&mts->first_date_shown); /* Calculate the x pixel coordinate of the start of the day. */ x = date_offset * mts->day_width; /* Add on the hours and minutes, depending on whether zoomed_out and - working_hours_only are set. */ + * working_hours_only are set. */ day_offset = (mtstime->hour - mts->first_hour_shown) * 60 + mtstime->minute; /* The day width includes an extra vertical grid line so subtract 1. */ @@ -3123,7 +3127,10 @@ e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts, } static void -row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) +row_inserted_cb (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) { EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data); gint row = gtk_tree_path_get_indices (path)[0]; @@ -3139,7 +3146,10 @@ row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpoi } static void -row_changed_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) +row_changed_cb (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) { EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data); gint row = gtk_tree_path_get_indices (path)[0]; @@ -3149,7 +3159,9 @@ row_changed_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpoin } static void -row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data) +row_deleted_cb (GtkTreeModel *model, + GtkTreePath *path, + gpointer data) { EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data); diff --git a/calendar/gui/e-meeting-time-sel.h b/calendar/gui/e-meeting-time-sel.h index 051901c0ee..7f45242006 100644 --- a/calendar/gui/e-meeting-time-sel.h +++ b/calendar/gui/e-meeting-time-sel.h @@ -68,10 +68,10 @@ G_BEGIN_DECLS /* This is used to specify the format used when displaying the dates. - The full format is like 'Sunday, September 12, 1999'. The abbreviated format - is like 'Sun 12/9/99'. The short format is like '12/9/99'. The actual - format used is determined in e_meeting_time_selector_style_set (), once we - know the font being used. */ + * The full format is like 'Sunday, September 12, 1999'. The abbreviated format + * is like 'Sun 12/9/99'. The short format is like '12/9/99'. The actual + * format used is determined in e_meeting_time_selector_style_set (), once we + * know the font being used. */ typedef enum { E_MEETING_TIME_SELECTOR_DATE_FULL, @@ -80,7 +80,7 @@ typedef enum } EMeetingTimeSelectorDateFormat; /* This is used to specify a position regarding the vertical bars around the - current meeting time, so we know which one is being dragged. */ + * current meeting time, so we know which one is being dragged. */ typedef enum { E_MEETING_TIME_SELECTOR_POS_NONE, @@ -89,7 +89,7 @@ typedef enum } EMeetingTimeSelectorPosition; /* This is used to specify the autopick option, which determines how we choose - the previous/next appropriate meeting time. */ + * the previous/next appropriate meeting time. */ typedef enum { E_MEETING_TIME_SELECTOR_ALL_PEOPLE_AND_RESOURCES, @@ -109,7 +109,7 @@ typedef struct _EMeetingTimeSelectorPrivate EMeetingTimeSelectorPrivate; struct _EMeetingTimeSelector { /* We subclass a GtkTable which makes it easy to add extra widgets - if neccesary. */ + * if neccesary. */ GtkTable table; EMeetingTimeSelectorPrivate *priv; @@ -119,12 +119,12 @@ struct _EMeetingTimeSelector { */ /* This contains our keyboard accelerators, which need to be added to - the toplevel window. */ + * the toplevel window. */ GtkAccelGroup *accel_group; /* The vbox in the top-left corner, containing the 'All Attendees' - title bar packed at the end. Extra widgets can be added here - with PACK_START if necessary. */ + * title bar packed at the end. Extra widgets can be added here + * with PACK_START if necessary. */ GtkWidget *attendees_vbox; GtkWidget *attendees_vbox_spacer; @@ -133,13 +133,13 @@ struct _EMeetingTimeSelector { EMeetingListView *list_view; /* The canvas displaying the dates, times, and the summary - 'All Attendees' free/busy display. */ + * 'All Attendees' free/busy display. */ GtkWidget *display_top; GnomeCanvasItem *item_top; /* The canvas containing the free/busy displays of individual - attendees. This is separate from display_top since it also scrolls - vertically. */ + * attendees. This is separate from display_top since it also scrolls + * vertically. */ GtkWidget *display_main; GnomeCanvasItem *item_main; @@ -197,7 +197,7 @@ struct _EMeetingTimeSelector { gboolean all_day; /* If this is TRUE we only show hours between day_start_hour and - day_end_hour, defaults to TRUE (9am-6pm). */ + * day_end_hour, defaults to TRUE (9am-6pm). */ gboolean working_hours_only; gint day_start_hour; gint day_start_minute; @@ -205,7 +205,7 @@ struct _EMeetingTimeSelector { gint day_end_minute; /* If TRUE, view is compressed, with one cell for every 3 hours rather - than every hour. Defaults to FALSE. */ + * than every hour. Defaults to FALSE. */ gboolean zoomed_out; /* @@ -213,7 +213,7 @@ struct _EMeetingTimeSelector { */ /* These are the first & last dates shown in the current scroll area. - We show E_MEETING_TIME_SELECTOR_DAYS_SHOWN days at a time. */ + * We show E_MEETING_TIME_SELECTOR_DAYS_SHOWN days at a time. */ GDate first_date_shown; GDate last_date_shown; @@ -222,25 +222,25 @@ struct _EMeetingTimeSelector { EMeetingTime meeting_end_time; /* These are the x pixel coordinates in the entire scroll region of - the start and end times. Set to meeting_positions_valid to FALSE to - invalidate. They will then be recomputed when needed. Always access - with e_meeting_time_selector_get_meeting_time_positions (). */ + * the start and end times. Set to meeting_positions_valid to FALSE to + * invalidate. They will then be recomputed when needed. Always access + * with e_meeting_time_selector_get_meeting_time_positions (). */ gint meeting_positions_valid; gint meeting_positions_in_scroll_area; gint meeting_start_x; gint meeting_end_x; /* These are the width and height of the cells, including the grid - lines which are displayed on the right and top or bottom of cells.*/ + * lines which are displayed on the right and top or bottom of cells.*/ gint row_height; gint col_width; /* This is the width of a day in the display, which depends on - col_width, working_hours_only and zoomed_out. */ + * col_width, working_hours_only and zoomed_out. */ gint day_width; /* These are the first and last hour of each day we display, depending - on working_hours_only and zoomed_out. */ + * on working_hours_only and zoomed_out. */ gint first_hour_shown; gint last_hour_shown; @@ -248,12 +248,12 @@ struct _EMeetingTimeSelector { guint auto_scroll_timeout_id; /* This specifies if we are dragging one of the vertical bars around - the meeting time. */ + * the meeting time. */ EMeetingTimeSelectorPosition dragging_position; /* The last x coordinate of the mouse, relative to either the left or - right edge of the canvas. Used in the auto_scroll_timeout function - to determine which way to scroll and how fast. */ + * right edge of the canvas. Used in the auto_scroll_timeout function + * to determine which way to scroll and how fast. */ gint last_drag_x; /* This is used to determine the delay between scrolls. */ @@ -300,9 +300,9 @@ void e_meeting_time_selector_set_week_start_day gint week_start_day); /* This returns the currently selected meeting time. - Note that months are 1-12 and days are 1-31. The start time is guaranteed to - be before or equal to the end time. You may want to check if they are equal - if that if it is a problem. */ + * Note that months are 1-12 and days are 1-31. The start time is guaranteed to + * be before or equal to the end time. You may want to check if they are equal + * if that if it is a problem. */ void e_meeting_time_selector_get_meeting_time (EMeetingTimeSelector *mts, gint *start_year, @@ -389,8 +389,8 @@ gboolean e_meeting_time_selector_attendee_add_busy_period */ /* This returns the x pixel coordinates of the meeting start and end times, - in the entire canvas scroll area. If it returns FALSE, then the meeting - time isn't in the current scroll area (which shouldn't really happen). */ + * in the entire canvas scroll area. If it returns FALSE, then the meeting + * time isn't in the current scroll area (which shouldn't really happen). */ gboolean e_meeting_time_selector_get_meeting_time_positions (EMeetingTimeSelector *mts, gint *start_x, @@ -404,7 +404,7 @@ void e_meeting_time_selector_remove_timeout (EMeetingTimeSelector *mts); void e_meeting_time_selector_fix_time_overflows - (EMeetingTime*mtstime); + (EMeetingTime *mtstime); void e_meeting_time_selector_calculate_day_and_position (EMeetingTimeSelector *mts, @@ -419,7 +419,7 @@ void e_meeting_time_selector_convert_day_position_to_hours_and_mins void e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, gint x, - EMeetingTime*time); + EMeetingTime *time); gint e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts, EMeetingTime *mtstime); diff --git a/calendar/gui/e-meeting-types.h b/calendar/gui/e-meeting-types.h index 6e7115cad9..50964f1619 100644 --- a/calendar/gui/e-meeting-types.h +++ b/calendar/gui/e-meeting-types.h @@ -34,10 +34,10 @@ typedef struct _EMeetingTime EMeetingTime; typedef struct _EMeetingFreeBusyPeriod EMeetingFreeBusyPeriod; /* These are used to specify whether an attendee is free or busy at a - particular time. We'll probably replace this with a global calendar type. - These should be ordered in increasing order of preference. Higher precedence - busy periods will be painted over lower precedence ones. These are also - used as for loop counters, so they should start at 0 and be ordered. */ + * particular time. We'll probably replace this with a global calendar type. + * These should be ordered in increasing order of preference. Higher precedence + * busy periods will be painted over lower precedence ones. These are also + * used as for loop counters, so they should start at 0 and be ordered. */ typedef enum { E_MEETING_FREE_BUSY_TENTATIVE = 0, @@ -49,7 +49,7 @@ typedef enum } EMeetingFreeBusyType; /* This is our representation of a time. We use a GDate to store the day, - and guint8s for the hours and minutes. */ + * and guint8s for the hours and minutes. */ struct _EMeetingTime { GDate date; diff --git a/calendar/gui/e-meeting-utils.c b/calendar/gui/e-meeting-utils.c index ac11881bf4..369e819fc3 100644 --- a/calendar/gui/e-meeting-utils.c +++ b/calendar/gui/e-meeting-utils.c @@ -28,8 +28,8 @@ #include "e-meeting-utils.h" gint -e_meeting_time_compare_times (EMeetingTime*time1, - EMeetingTime*time2) +e_meeting_time_compare_times (EMeetingTime *time1, + EMeetingTime *time2) { gint day_comparison; diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index d8388d066b..872408c8da 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -121,8 +121,8 @@ memo_table_emit_status_message (EMemoTable *memo_table, } /* Returns the current time, for the ECellDateEdit items. - FIXME: Should probably use the timezone of the item rather than the - current timezone, though that may be difficult to get from here. */ + * FIXME: Should probably use the timezone of the item rather than the + * current timezone, though that may be difficult to get from here. */ static struct tm memo_table_get_current_time (ECellDateEdit *ecde, gpointer user_data) @@ -765,7 +765,8 @@ memo_table_cut_clipboard (ESelectable *selectable) /* Helper for memo_table_copy_clipboard() */ static void -copy_row_cb (gint model_row, gpointer data) +copy_row_cb (gint model_row, + gpointer data) { EMemoTable *memo_table; ECalModelComponent *comp_data; @@ -976,7 +977,8 @@ memo_table_paste_clipboard (ESelectable *selectable) * gint pointed to by the closure data. */ static void -get_selected_row_cb (gint model_row, gpointer data) +get_selected_row_cb (gint model_row, + gpointer data) { gint *row; @@ -1261,7 +1263,8 @@ struct get_selected_uids_closure { /* Used from e_table_selected_row_foreach(), builds a list of the selected UIDs */ static void -add_uid_cb (gint model_row, gpointer data) +add_uid_cb (gint model_row, + gpointer data) { struct get_selected_uids_closure *closure; ECalModelComponent *comp_data; diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c index 6b541e170a..040993595a 100644 --- a/calendar/gui/e-select-names-editable.c +++ b/calendar/gui/e-select-names-editable.c @@ -158,7 +158,7 @@ e_select_names_editable_get_emails (ESelectNamesEditable *esne) if (e_destination_get_contact (destination) && e_contact_get (e_destination_get_contact (destination), E_CONTACT_IS_LIST)) { /* If its a contact_list which is not expanded, it wont have a email id, - so we can use the name as the email id */ + * so we can use the name as the email id */ result = g_list_append (result, g_strdup (e_destination_get_name (destination))); } else @@ -227,7 +227,9 @@ e_select_names_editable_get_names (ESelectNamesEditable *esne) } void -e_select_names_editable_set_address (ESelectNamesEditable *esne, const gchar *name, const gchar *email) +e_select_names_editable_set_address (ESelectNamesEditable *esne, + const gchar *name, + const gchar *email) { EDestinationStore *destination_store; GList *destinations; diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c index 3e92636b4b..e5326c108f 100644 --- a/calendar/gui/e-select-names-renderer.c +++ b/calendar/gui/e-select-names-renderer.c @@ -53,7 +53,8 @@ static gint signals[LAST_SIGNAL]; G_DEFINE_TYPE (ESelectNamesRenderer, e_select_names_renderer, GTK_TYPE_CELL_RENDERER_TEXT) static void -e_select_names_renderer_editing_done (GtkCellEditable *editable, ESelectNamesRenderer *cell) +e_select_names_renderer_editing_done (GtkCellEditable *editable, + ESelectNamesRenderer *cell) { GList *addresses = NULL, *names = NULL, *a, *n; gboolean editing_canceled; @@ -101,8 +102,13 @@ e_select_names_renderer_editing_done (GtkCellEditable *editable, ESelectNamesRen } static GtkCellEditable * -e_select_names_renderer_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, - const GdkRectangle *bg_area, const GdkRectangle *cell_area, GtkCellRendererState flags) +e_select_names_renderer_start_editing (GtkCellRenderer *cell, + GdkEvent *event, + GtkWidget *widget, + const gchar *path, + const GdkRectangle *bg_area, + const GdkRectangle *cell_area, + GtkCellRendererState flags) { ESelectNamesRenderer *sn_cell = E_SELECT_NAMES_RENDERER (cell); GtkCellRendererText *text_cell = GTK_CELL_RENDERER_TEXT (cell); @@ -128,7 +134,7 @@ e_select_names_renderer_start_editing (GtkCellRenderer *cell, GdkEvent *event, G g_signal_connect (editable, "editing_done", G_CALLBACK (e_select_names_renderer_editing_done), sn_cell); /* Removed focus-out-event. focus out event already listen by base class. - We don't need to listen for the focus out event any more */ + * We don't need to listen for the focus out event any more */ sn_cell->priv->editable = g_object_ref (editable); sn_cell->priv->path = g_strdup (path); @@ -137,11 +143,14 @@ e_select_names_renderer_start_editing (GtkCellRenderer *cell, GdkEvent *event, G } static void -e_select_names_renderer_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_select_names_renderer_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ESelectNamesRenderer *esnr = E_SELECT_NAMES_RENDERER (object); - switch (prop_id) { + switch (property_id) { case PROP_NAME: g_value_set_string (value, esnr->priv->name); break; @@ -154,11 +163,14 @@ e_select_names_renderer_get_property (GObject *object, guint prop_id, GValue *va } static void -e_select_names_renderer_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_select_names_renderer_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ESelectNamesRenderer *esnr = E_SELECT_NAMES_RENDERER (object); - switch (prop_id) { + switch (property_id) { case PROP_NAME: g_free (esnr->priv->name); esnr->priv->name = g_strdup (g_value_get_string (value)); diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index 9125206196..ec49cd1478 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -128,7 +128,9 @@ task_table_emit_status_message (ETaskTable *task_table, } static gint -task_table_percent_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_cache) +task_table_percent_compare_cb (gconstpointer a, + gconstpointer b, + gpointer cmp_cache) { gint percent1 = GPOINTER_TO_INT (a); gint percent2 = GPOINTER_TO_INT (b); @@ -137,7 +139,9 @@ task_table_percent_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_ca } static gint -task_table_priority_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_cache) +task_table_priority_compare_cb (gconstpointer a, + gconstpointer b, + gpointer cmp_cache) { gint priority1, priority2; @@ -155,7 +159,8 @@ task_table_priority_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_c } static const gchar * -get_cache_str (gpointer cmp_cache, const gchar *str) +get_cache_str (gpointer cmp_cache, + const gchar *str) { const gchar *value; @@ -175,7 +180,9 @@ get_cache_str (gpointer cmp_cache, const gchar *str) } static gboolean -same_cache_string (gpointer cmp_cache, const gchar *str_a, const gchar *str_b) +same_cache_string (gpointer cmp_cache, + const gchar *str_a, + const gchar *str_b) { if (!cmp_cache) return g_utf8_collate (str_a, str_b) == 0; @@ -189,7 +196,9 @@ same_cache_string (gpointer cmp_cache, const gchar *str_a, const gchar *str_b) } static gint -task_table_status_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_cache) +task_table_status_compare_cb (gconstpointer a, + gconstpointer b, + gpointer cmp_cache) { const gchar *string_a = a; const gchar *string_b = b; @@ -502,7 +511,7 @@ task_table_constructed (GObject *object) /* Priority field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, @@ -527,7 +536,7 @@ task_table_constructed (GObject *object) /* Percent field. */ cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, @@ -540,8 +549,8 @@ task_table_constructed (GObject *object) strings = NULL; for (percent = 0; percent <= 100; percent += 10) { /* Translators: "%d%%" is the percentage of a task done. - %d is the actual value, %% is replaced with a percent sign. - Result values will be 0%, 10%, 20%, ... 100% + * %d is the actual value, %% is replaced with a percent sign. + * Result values will be 0%, 10%, 20%, ... 100% */ strings = g_list_append (strings, g_strdup_printf (_("%d%%"), percent)); } @@ -556,7 +565,7 @@ task_table_constructed (GObject *object) /* Transparency field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, @@ -579,7 +588,7 @@ task_table_constructed (GObject *object) /* Status field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, @@ -998,7 +1007,8 @@ task_table_cut_clipboard (ESelectable *selectable) /* Helper for task_table_copy_clipboard() */ static void -copy_row_cb (gint model_row, gpointer data) +copy_row_cb (gint model_row, + gpointer data) { ETaskTable *task_table; ECalModelComponent *comp_data; @@ -1209,7 +1219,8 @@ task_table_paste_clipboard (ESelectable *selectable) * gint pointed to by the closure data. */ static void -get_selected_row_cb (gint model_row, gpointer data) +get_selected_row_cb (gint model_row, + gpointer data) { gint *row; @@ -1240,7 +1251,8 @@ get_selected_comp (ETaskTable *task_table) } static void -add_retract_data (ECalComponent *comp, const gchar *retract_comment) +add_retract_data (ECalComponent *comp, + const gchar *retract_comment) { icalcomponent *icalcomp = NULL; icalproperty *icalprop = NULL; @@ -1255,7 +1267,8 @@ add_retract_data (ECalComponent *comp, const gchar *retract_comment) } static gboolean -check_for_retract (ECalComponent *comp, ECalClient *client) +check_for_retract (ECalComponent *comp, + ECalClient *client) { ECalComponentOrganizer org; gchar *email = NULL; @@ -1567,7 +1580,8 @@ struct get_selected_uids_closure { /* Used from e_table_selected_row_foreach(), builds a list of the selected UIDs */ static void -add_uid_cb (gint model_row, gpointer data) +add_uid_cb (gint model_row, + gpointer data) { struct get_selected_uids_closure *closure = data; ECalModelComponent *comp_data; @@ -1748,10 +1762,11 @@ show_completed_rows (ECalModel *model, } /* Returns the current time, for the ECellDateEdit items. - FIXME: Should probably use the timezone of the item rather than the - current timezone, though that may be difficult to get from here. */ + * FIXME: Should probably use the timezone of the item rather than the + * current timezone, though that may be difficult to get from here. */ static struct tm -e_task_table_get_current_time (ECellDateEdit *ecde, gpointer data) +e_task_table_get_current_time (ECellDateEdit *ecde, + gpointer data) { ETaskTable *task_table = data; ECalModel *model; diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index 3318e666db..a3288b1115 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -38,14 +38,14 @@ struct _ETimezoneEntryPrivate { /* The current timezone, set in e_timezone_entry_set_timezone() - or from the timezone dialog. Note that we don't copy it or - use a ref count - we assume it is never destroyed for the - lifetime of this widget. */ + * or from the timezone dialog. Note that we don't copy it or + * use a ref count - we assume it is never destroyed for the + * lifetime of this widget. */ icaltimezone *timezone; /* This can be set to the default timezone. If the current timezone - setting in the ETimezoneEntry matches this, then the entry field - is hidden. This makes the user interface simpler. */ + * setting in the ETimezoneEntry matches this, then the entry field + * is hidden. This makes the user interface simpler. */ icaltimezone *default_zone; GtkWidget *entry; @@ -85,8 +85,8 @@ timezone_entry_update_entry (ETimezoneEntry *timezone_entry) display_name = icaltimezone_get_display_name (timezone); /* We check if it is one of our builtin timezone - names, in which case we call gettext to translate - it. If it isn't a builtin timezone name, we don't. */ + * names, in which case we call gettext to translate + * it. If it isn't a builtin timezone name, we don't. */ if (icaltimezone_get_builtin_timezone (display_name)) display_name = _(display_name); } else @@ -150,7 +150,7 @@ timezone_entry_add_relation (ETimezoneEntry *timezone_entry) } /* The arrow button beside the date field has been clicked, so we show the - popup with the ECalendar in. */ + * popup with the ECalendar in. */ static void timezone_entry_button_clicked_cb (ETimezoneEntry *timezone_entry) { diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 917d7de46d..8aa50a99e2 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -217,7 +217,7 @@ week_view_event_item_button_press (EWeekViewEventItem *event_item, return FALSE; /* Remember the item clicked and the mouse position, - so we can start a drag if the mouse moves. */ + * so we can start a drag if the mouse moves. */ week_view->drag_event_x = bevent->button.x; week_view->drag_event_y = bevent->button.y; @@ -239,7 +239,7 @@ week_view_event_item_button_press (EWeekViewEventItem *event_item, week_view, event->start, event->end); e_week_view_show_popup_menu ( - week_view, (GdkEventButton*) bevent, + week_view, (GdkEventButton *) bevent, event_item->priv->event_num); g_signal_stop_emission_by_name ( item->canvas, "button_press_event"); @@ -500,7 +500,7 @@ week_view_event_item_draw_icons (EWeekViewEventItem *event_item, } /* This draws a little triangle to indicate that an event extends past - the days visible on screen. */ + * the days visible on screen. */ static void week_view_event_item_draw_triangle (EWeekViewEventItem *event_item, cairo_t *cr, @@ -574,7 +574,7 @@ week_view_event_item_draw_triangle (EWeekViewEventItem *event_item, cr, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]); /* If the height is odd we can use the same central point for both - lines. If it is even we use different end-points. */ + * lines. If it is even we use different end-points. */ c1 = c2 = y + (h / 2); if (h % 2 == 0) c1--; @@ -811,7 +811,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); cairo_set_line_width (cr, 2.0); - cairo_set_source_rgb (cr, red/cc, green/cc, blue/cc); + cairo_set_source_rgb (cr, red / cc, green / cc, blue / cc); cairo_stroke (cr); cairo_restore (cr); } @@ -833,13 +833,13 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, pat = cairo_pattern_create_linear ( rect_x + 2, y1 + 1, rect_x + 2, y2 - 7.25); cairo_pattern_add_color_stop_rgba ( - pat, 1, red/cc, green/cc, blue/cc, 0.8); + pat, 1, red / cc, green / cc, blue / cc, 0.8); cairo_pattern_add_color_stop_rgba ( - pat, 0, red/cc, green/cc, blue/cc, 0.4); + pat, 0, red / cc, green / cc, blue / cc, 0.4); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); - cairo_set_source_rgba (cr, red/cc, green/cc, blue/cc, 0.2); + cairo_set_source_rgba (cr, red / cc, green / cc, blue / cc, 0.2); cairo_set_line_width (cr, 0.5); cairo_stroke (cr); cairo_restore (cr); @@ -900,9 +900,9 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, - E_WEEK_VIEW_EVENT_R_PAD + 1; /* Draw the triangles at the start & end, if needed. - They also use the first few pixels at the edge of the - event so we update rect_x & rect_w so we don't draw over - them. */ + * They also use the first few pixels at the edge of the + * event so we update rect_x & rect_w so we don't draw over + * them. */ if (event->start < week_view->day_starts[span->start_day]) { draw_start_triangle = TRUE; rect_x += 2; @@ -928,7 +928,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); cairo_set_line_width (cr, 2.0); - cairo_set_source_rgb (cr, red/cc, green/cc, blue/cc); + cairo_set_source_rgb (cr, red / cc, green / cc, blue / cc); cairo_stroke (cr); cairo_restore (cr); } @@ -950,13 +950,13 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, pat = cairo_pattern_create_linear ( rect_x + 2, y1 + 1, rect_x + 2, y2 - 7.25); cairo_pattern_add_color_stop_rgba ( - pat, 1, red/cc, green/cc, blue/cc, 0.8); + pat, 1, red / cc, green / cc, blue / cc, 0.8); cairo_pattern_add_color_stop_rgba ( - pat, 0, red/cc, green/cc, blue/cc, 0.4); + pat, 0, red / cc, green / cc, blue / cc, 0.4); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); - cairo_set_source_rgba (cr, red/cc, green/cc, blue/cc, 0.2); + cairo_set_source_rgba (cr, red / cc, green / cc, blue / cc, 0.2); cairo_set_line_width (cr, 0.5); cairo_stroke (cr); cairo_restore (cr); @@ -1009,12 +1009,12 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, editing_span = TRUE; /* Draw the start & end times, if they are not on day - boundaries. The start time would always be shown if it was - needed, though it may be clipped as the window shrinks. - The end time is only displayed if there is enough room. - We calculate the minimum position for the end time, which - depends on whether the start time is displayed. If the end - time doesn't fit, then we don't draw it. */ + * boundaries. The start time would always be shown if it was + * needed, though it may be clipped as the window shrinks. + * The end time is only displayed if there is enough room. + * We calculate the minimum position for the end time, which + * depends on whether the start time is displayed. If the end + * time doesn't fit, then we don't draw it. */ min_end_time_x = x1 + E_WEEK_VIEW_EVENT_L_PAD + E_WEEK_VIEW_EVENT_BORDER_WIDTH + E_WEEK_VIEW_EVENT_EDGE_X_PAD; @@ -1040,7 +1040,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_restore (cr); /* We don't want the end time to be drawn over the - start time, so we increase the minimum position. */ + * start time, so we increase the minimum position. */ min_end_time_x += time_width + E_WEEK_VIEW_EVENT_TIME_X_PAD; } @@ -1059,7 +1059,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, - time_width; /* Draw the end time, if the position is greater than - the minimum calculated above. */ + * the minimum calculated above. */ if (time_x >= min_end_time_x) { week_view_draw_time ( week_view, cr, time_x, diff --git a/calendar/gui/e-week-view-layout.c b/calendar/gui/e-week-view-layout.c index 0b776adcfa..b2fc7ca158 100644 --- a/calendar/gui/e-week-view-layout.c +++ b/calendar/gui/e-week-view-layout.c @@ -47,15 +47,15 @@ static gint e_week_view_find_span_end (gboolean multi_week_view, gint display_start_day, gint day); -GArray* -e_week_view_layout_events (GArray *events, - GArray *old_spans, - gboolean multi_week_view, - gint weeks_shown, - gboolean compress_weekend, - gint start_weekday, - time_t *day_starts, - gint *rows_per_day) +GArray * +e_week_view_layout_events (GArray *events, + GArray *old_spans, + gboolean multi_week_view, + gint weeks_shown, + gboolean compress_weekend, + gint start_weekday, + time_t *day_starts, + gint *rows_per_day) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -64,9 +64,9 @@ e_week_view_layout_events (GArray *events, GArray *spans; /* This is a temporary 2-d grid which is used to place events. - Each element is 0 if the position is empty, or 1 if occupied. - We allocate the maximum size possible here, assuming that each - event will need its own row. */ + * Each element is 0 if the position is empty, or 1 if occupied. + * We allocate the maximum size possible here, assuming that each + * event will need its own row. */ grid = g_new0 (guint8, E_WEEK_VIEW_MAX_ROWS_PER_CELL * 7 * E_WEEK_VIEW_MAX_WEEKS); @@ -80,7 +80,7 @@ e_week_view_layout_events (GArray *events, } /* Iterate over the events, finding which weeks they cover, and putting - them in the first free row available. */ + * them in the first free row available. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EWeekViewEvent, event_num); e_week_view_layout_event (event, grid, spans, old_spans, @@ -110,16 +110,16 @@ e_week_view_layout_events (GArray *events, } static void -e_week_view_layout_event (EWeekViewEvent *event, - guint8 *grid, - GArray *spans, - GArray *old_spans, - gboolean multi_week_view, - gint weeks_shown, - gboolean compress_weekend, - gint start_weekday, - time_t *day_starts, - gint *rows_per_day) +e_week_view_layout_event (EWeekViewEvent *event, + guint8 *grid, + GArray *spans, + GArray *old_spans, + gboolean multi_week_view, + gint weeks_shown, + gboolean compress_weekend, + gint start_weekday, + time_t *day_starts, + gint *rows_per_day) { gint start_day, end_day, span_start_day, span_end_day, rows_per_cell; gint free_row, row, day, span_num, spans_index, num_spans, days_shown; @@ -139,7 +139,7 @@ e_week_view_layout_event (EWeekViewEvent *event, #endif /* Iterate through each of the spans of the event, where each span - is a sequence of 1 or more days displayed next to each other. */ + * is a sequence of 1 or more days displayed next to each other. */ span_start_day = start_day; rows_per_cell = E_WEEK_VIEW_MAX_ROWS_PER_CELL; span_num = 0; @@ -156,7 +156,7 @@ e_week_view_layout_event (EWeekViewEvent *event, span_end_day); #endif /* Try each row until we find a free one or we fall off the - bottom of the available rows. */ + * bottom of the available rows. */ row = 0; free_row = -1; while (free_row == -1 && row < rows_per_cell) { @@ -184,7 +184,7 @@ e_week_view_layout_event (EWeekViewEvent *event, span_start_day, span_end_day, free_row); #endif /* Add the span to the array, and try to reuse any - canvas items from the old spans. */ + * canvas items from the old spans. */ span.start_day = span_start_day; span.num_days = span_end_day - span_start_day + 1; span.row = free_row; @@ -214,14 +214,14 @@ e_week_view_layout_event (EWeekViewEvent *event, } /* Finds the day containing the given time. - If include_midnight_in_prev_day is TRUE then if the time exactly - matches the start of a day the previous day is returned. This is useful - when calculating the end day of an event. */ + * If include_midnight_in_prev_day is TRUE then if the time exactly + * matches the start of a day the previous day is returned. This is useful + * when calculating the end day of an event. */ static gint -e_week_view_find_day (time_t time_to_find, - gboolean include_midnight_in_prev_day, - gint days_shown, - time_t *day_starts) +e_week_view_find_day (time_t time_to_find, + gboolean include_midnight_in_prev_day, + gint days_shown, + time_t *day_starts) { gint day; @@ -243,16 +243,16 @@ e_week_view_find_day (time_t time_to_find, } /* This returns the last possible day in the same span as the given day. - A span is all the days which are displayed next to each other from left to - right. In the week view all spans are only 1 day, since Tuesday is below - Monday rather than beside it etc. In the month view, if the weekends are not - compressed then each week is a span, otherwise we have to break a span up - on Saturday, use a separate span for Sunday, and start again on Monday. */ + * A span is all the days which are displayed next to each other from left to + * right. In the week view all spans are only 1 day, since Tuesday is below + * Monday rather than beside it etc. In the month view, if the weekends are not + * compressed then each week is a span, otherwise we have to break a span up + * on Saturday, use a separate span for Sunday, and start again on Monday. */ static gint -e_week_view_find_span_end (gboolean multi_week_view, - gboolean compress_weekend, - gint display_start_day, - gint day) +e_week_view_find_span_end (gboolean multi_week_view, + gboolean compress_weekend, + gint display_start_day, + gint day) { gint week, col, sat_col, end_col; @@ -264,7 +264,7 @@ e_week_view_find_span_end (gboolean multi_week_view, end_col = 6; /* If the weekend is compressed we must end any spans on - Saturday and Sunday. */ + * Saturday and Sunday. */ if (compress_weekend) { sat_col = (5 + 7 - display_start_day) % 7; if (col <= sat_col) @@ -280,14 +280,14 @@ e_week_view_find_span_end (gboolean multi_week_view, } void -e_week_view_layout_get_day_position (gint day, - gboolean multi_week_view, - gint weeks_shown, - gint display_start_day, - gboolean compress_weekend, - gint *day_x, - gint *day_y, - gint *rows) +e_week_view_layout_get_day_position (gint day, + gboolean multi_week_view, + gint weeks_shown, + gint display_start_day, + gboolean compress_weekend, + gint *day_x, + gint *day_y, + gint *rows) { gint week, day_of_week, col, weekend_col; @@ -302,8 +302,8 @@ e_week_view_layout_get_day_position (gint day, day_of_week = (display_start_day + day) % 7; if (compress_weekend && day_of_week >= 5) { /* In the compressed view Saturday is above Sunday and - both have just one row as opposed to 2 for all the - other days. */ + * both have just one row as opposed to 2 for all the + * other days. */ if (day_of_week == 5) { *day_y = week * 2; *rows = 1; @@ -316,10 +316,10 @@ e_week_view_layout_get_day_position (gint day, *day_x = col; } else { /* If the weekend is compressed and the day is after - the weekend we have to move back a column. */ + * the weekend we have to move back a column. */ if (compress_weekend) { /* Calculate where the weekend column is. - Note that 5 is Saturday. */ + * Note that 5 is Saturday. */ weekend_col = (5 + 7 - display_start_day) % 7; if (col > weekend_col) col--; @@ -412,20 +412,20 @@ e_week_view_layout_get_day_position (gint day, } /* Returns TRUE if the event span is visible or FALSE if it isn't. - It also returns the number of days of the span that are visible. - Usually this can easily be determined by the start & end days and row of - the span, which are set in e_week_view_layout_event (). Though we need a - special case for the weekends when they are compressed, since the span may - not fit. */ + * It also returns the number of days of the span that are visible. + * Usually this can easily be determined by the start & end days and row of + * the span, which are set in e_week_view_layout_event (). Though we need a + * special case for the weekends when they are compressed, since the span may + * not fit. */ gboolean -e_week_view_layout_get_span_position (EWeekViewEvent *event, - EWeekViewEventSpan *span, - gint rows_per_cell, - gint rows_per_compressed_cell, - gint display_start_day, - gboolean multi_week_view, - gboolean compress_weekend, - gint *span_num_days) +e_week_view_layout_get_span_position (EWeekViewEvent *event, + EWeekViewEventSpan *span, + gint rows_per_cell, + gint rows_per_compressed_cell, + gint display_start_day, + gboolean multi_week_view, + gboolean compress_weekend, + gint *span_num_days) { gint end_day_of_week; @@ -440,9 +440,9 @@ e_week_view_layout_get_span_position (EWeekViewEvent *event, if (multi_week_view) { if (compress_weekend) { /* If it ends on a Saturday and is 1 day glong - we skip it, else we shorten it. If it ends - on a Sunday it must be 1 day long and we - skip it. */ + * we skip it, else we shorten it. If it ends + * on a Sunday it must be 1 day long and we + * skip it. */ if (end_day_of_week == 5) { /* Sat */ if (*span_num_days == 1) { return FALSE; diff --git a/calendar/gui/e-week-view-layout.h b/calendar/gui/e-week-view-layout.h index 98bf1ccb3a..5f1e2870d4 100644 --- a/calendar/gui/e-week-view-layout.h +++ b/calendar/gui/e-week-view-layout.h @@ -29,9 +29,9 @@ G_BEGIN_DECLS /* I've split these functions away from EWeekView so we can use them for - printing. */ + * printing. */ -GArray* e_week_view_layout_events (GArray *events, +GArray * e_week_view_layout_events (GArray *events, GArray *old_spans, gboolean multi_week_view, gint weeks_shown, @@ -41,8 +41,8 @@ GArray* e_week_view_layout_events (GArray *events, gint *rows_per_day); /* Returns which 'cell' in the table the day appears in. Note that most days - have a height of 2 rows, but Sat/Sun are sometimes compressed so they have - a height of only 1 row. */ + * have a height of 2 rows, but Sat/Sun are sometimes compressed so they have + * a height of only 1 row. */ void e_week_view_layout_get_day_position (gint day, gboolean multi_week_view, gint weeks_shown, diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index 03cf3b56d4..bca3343b67 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -121,10 +121,10 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, working_days = calendar_config_get_working_days (); /* Draw the background of the day. In the month view odd months are - one color and even months another, so you can easily see when each - month starts (defaults are white for odd - January, March, ... and - light gray for even). In the week view the background is always the - same color, the color used for the odd months in the month view. */ + * one color and even months another, so you can easily see when each + * month starts (defaults are white for odd - January, March, ... and + * light gray for even). In the week view the background is always the + * same color, the color used for the odd months in the month view. */ if (today) bg_color = &week_view->colors[E_WEEK_VIEW_COLOR_TODAY_BACKGROUND]; else if ((working_days & day_of_week) == 0) @@ -141,8 +141,8 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, cairo_restore (cr); /* Draw the lines on the right and bottom of the cell. The canvas is - sized so that the lines on the right & bottom edges will be off the - edge of the canvas, so we don't have to worry about them. */ + * sized so that the lines on the right & bottom edges will be off the + * edge of the canvas, so we don't have to worry about them. */ right_edge = x + width - 1; bottom_edge = y + height - 1; @@ -188,10 +188,10 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, cairo_restore (cr); /* Display the date in the top of the cell. - In the week view, display the long format "10 January" in all cells, - or abbreviate it to "10 Jan" or "10" if that doesn't fit. - In the month view, only use the long format for the first cell and - the 1st of each month, otherwise use "10". */ + * In the week view, display the long format "10 January" in all cells, + * or abbreviate it to "10 Jan" or "10" if that doesn't fit. + * In the month view, only use the long format for the first cell and + * the 1st of each month, otherwise use "10". */ show_day_name = FALSE; show_month_name = FALSE; if (!week_view->multi_week_view) { @@ -209,32 +209,32 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, + week_view->space_width * 2 + week_view->month_widths[month - 1] < max_width) /* strftime format %A = full weekday name, %d = day of - month, %B = full month name. You can change the - order but don't change the specifiers or add - anything. */ + * month, %B = full month name. You can change the + * order but don't change the specifiers or add + * anything. */ format_string = _("%A %d %B"); else if (week_view->max_abbr_day_width + week_view->digit_width * 2 + week_view->space_width * 2 + week_view->abbr_month_widths[month - 1] < max_width) /* strftime format %a = abbreviated weekday name, - %d = day of month, %b = abbreviated month name. - You can change the order but don't change the - specifiers or add anything. */ + * %d = day of month, %b = abbreviated month name. + * You can change the order but don't change the + * specifiers or add anything. */ format_string = _("%a %d %b"); } if (!format_string && show_month_name) { if (week_view->digit_width * 2 + week_view->space_width + week_view->month_widths[month - 1] < max_width) /* strftime format %d = day of month, %B = full - month name. You can change the order but don't - change the specifiers or add anything. */ + * month name. You can change the order but don't + * change the specifiers or add anything. */ format_string = _("%d %B"); else if (week_view->digit_width * 2 + week_view->space_width + week_view->abbr_month_widths[month - 1] < max_width) /* strftime format %d = day of month, %b = abbreviated - month name. You can change the order but don't - change the specifiers or add anything. */ + * month name. You can change the order but don't + * change the specifiers or add anything. */ format_string = _("%d %b"); } diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c index f808e693b1..66f9930534 100644 --- a/calendar/gui/e-week-view-titles-item.c +++ b/calendar/gui/e-week-view-titles-item.c @@ -157,11 +157,11 @@ week_view_titles_item_draw (GnomeCanvasItem *canvas_item, abbreviated = (week_view->max_day_width + 2 >= col_width); /* Shift right one pixel to account for the shadow around the main - canvas. */ + * canvas. */ x--; /* Draw the date. Set a clipping rectangle so we don't draw over the - next day. */ + * next day. */ weekday = week_view->display_start_day; for (col = 0; col < week_view->columns; col++) { if (weekday == 5 && week_view->compress_weekend) diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 2385b9f189..a98ff42776 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -75,7 +75,7 @@ #define E_WEEK_VIEW_JUMP_BUTTON_NO_FOCUS -1 /* The timeout before we do a layout, so we don't do a layout for each event - we get from the server. */ + * we get from the server. */ #define E_WEEK_VIEW_LAYOUT_TIMEOUT 100 typedef struct { @@ -236,7 +236,8 @@ week_view_process_component (EWeekView *week_view, } static void -week_view_update_row (EWeekView *week_view, gint row) +week_view_update_row (EWeekView *week_view, + gint row) { ECalModelComponent *comp_data; ECalModel *model; @@ -384,11 +385,11 @@ week_view_time_range_changed_cb (EWeekView *week_view, week_start_offset = (weekday + 7 - week_view->display_start_day) % 7; /* Set the day_offset to the result, so we move back to the - start of the week. */ + * start of the week. */ day_offset = week_start_offset; /* Calculate the base date, i.e. the first day shown when the - scrollbar adjustment value is 0. */ + * scrollbar adjustment value is 0. */ base_date = date; g_date_subtract_days (&base_date, day_offset); @@ -411,8 +412,8 @@ week_view_time_range_changed_cb (EWeekView *week_view, } /* Reset the adjustment value to 0 if the base address has changed. - Note that we do this after updating first_day_shown so that our - signal handler will not try to reload the events. */ + * Note that we do this after updating first_day_shown so that our + * signal handler will not try to reload the events. */ if (update_adjustment_value) { GtkRange *range; GtkAdjustment *adjustment; @@ -460,7 +461,7 @@ timezone_changed_cb (ECalModel *cal_model, return; /* Recalculate the new start of the first week. We just use exactly - the same time, but with the new timezone. */ + * the same time, but with the new timezone. */ tt.year = g_date_get_year (&week_view->first_day_shown); tt.month = g_date_get_month (&week_view->first_day_shown); tt.day = g_date_get_day (&week_view->first_day_shown); @@ -854,8 +855,10 @@ e_week_view_new (ECalModel *model) view = g_object_new (E_TYPE_WEEK_VIEW, "model", model, NULL); - g_signal_connect (G_OBJECT (model), "timezone_changed", - G_CALLBACK (timezone_changed_cb), view); + g_signal_connect ( + model, "timezone_changed", + G_CALLBACK (timezone_changed_cb), view); + return view; } @@ -923,7 +926,8 @@ e_week_view_realize (GtkWidget *widget) } static GdkColor -color_inc (GdkColor c, gint amount) +color_inc (GdkColor c, + gint amount) { #define dec(x) \ if (x + amount >= 0 \ @@ -944,7 +948,8 @@ color_inc (GdkColor c, gint amount) } static void -e_week_view_set_colors (EWeekView *week_view, GtkWidget *widget) +e_week_view_set_colors (EWeekView *week_view, + GtkWidget *widget) { GtkStyle *style; @@ -988,7 +993,8 @@ e_week_view_unrealize (GtkWidget *widget) } static gint -get_string_width (PangoLayout *layout, const gchar *string) +get_string_width (PangoLayout *layout, + const gchar *string) { gint width; @@ -1022,7 +1028,9 @@ get_digit_width (PangoLayout *layout) } static GdkColor -e_week_view_get_text_color (EWeekView *week_view, EWeekViewEvent *event, GtkWidget *widget) +e_week_view_get_text_color (EWeekView *week_view, + EWeekViewEvent *event, + GtkWidget *widget) { GtkStyle *style; GdkColor bg_color; @@ -1042,7 +1050,7 @@ e_week_view_get_text_color (EWeekView *week_view, EWeekViewEvent *event, GtkWidg style = gtk_widget_get_style (widget); - if ((red/cc > 0.7) || (green/cc > 0.7) || (blue/cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) return style->black; else return style->white; @@ -1050,7 +1058,7 @@ e_week_view_get_text_color (EWeekView *week_view, EWeekViewEvent *event, GtkWidg static void e_week_view_style_set (GtkWidget *widget, - GtkStyle *previous_style) + GtkStyle *previous_style) { EWeekView *week_view; GtkStyle *style; @@ -1099,7 +1107,7 @@ e_week_view_style_set (GtkWidget *widget, week_view->row_height = MAX (week_view->row_height, E_WEEK_VIEW_ICON_HEIGHT + E_WEEK_VIEW_ICON_Y_PAD + E_WEEK_VIEW_EVENT_BORDER_HEIGHT * 2); /* Check that the small font is smaller than the default font. - If it isn't, we won't use it. */ + * If it isn't, we won't use it. */ if (week_view->small_font_desc) { if (PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) @@ -1114,7 +1122,7 @@ e_week_view_style_set (GtkWidget *widget, PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) + 5); /* Save the sizes of various strings in the font, so we can quickly - decide which date formats to use. */ + * decide which date formats to use. */ max_day_width = 0; max_abbr_day_width = 0; @@ -1169,7 +1177,8 @@ e_week_view_style_set (GtkWidget *widget, /* This recalculates the sizes of each column. */ static void -e_week_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +e_week_view_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { EWeekView *week_view; GtkAllocation canvas_allocation; @@ -1195,7 +1204,7 @@ e_week_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) 0, 0, new_x2, new_y2); /* Set the scroll region of the main canvas to its allocated width, - but with the height depending on the number of rows needed. */ + * but with the height depending on the number of rows needed. */ gnome_canvas_get_scroll_region ( GNOME_CANVAS (week_view->main_canvas), NULL, NULL, &old_x2, &old_y2); @@ -1239,10 +1248,10 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) gtk_widget_get_allocation (week_view->main_canvas, &allocation); /* Calculate the column sizes, using floating point so that pixels - get divided evenly. Note that we use one more element than the - number of columns, to make it easy to get the column widths. - We also add one to the width so that the right border of the last - column is off the edge of the displayed area. */ + * get divided evenly. Note that we use one more element than the + * number of columns, to make it easy to get the column widths. + * We also add one to the width so that the right border of the last + * column is off the edge of the displayed area. */ canvas_width = allocation.width + 1; canvas_width /= week_view->columns; offset = 0; @@ -1286,7 +1295,7 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) pango_context_get_language (pango_context)); /* Calculate the number of rows of events in each cell, for the large - cells and the compressed weekend cells. */ + * cells and the compressed weekend cells. */ if (week_view->multi_week_view) { week_view->events_y_offset = E_WEEK_VIEW_DATE_T_PAD + + PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) @@ -1313,7 +1322,7 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) E_WEEK_VIEW_MAX_ROWS_PER_CELL); /* Determine which time format to use, based on the width of the cells. - We only allow the time to take up about half of the width. */ + * We only allow the time to take up about half of the width. */ width = week_view->col_widths[0]; time_width = e_week_view_get_time_string_width (week_view); @@ -1337,7 +1346,8 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) } static gint -e_week_view_focus_in (GtkWidget *widget, GdkEventFocus *event) +e_week_view_focus_in (GtkWidget *widget, + GdkEventFocus *event) { EWeekView *week_view; @@ -1363,7 +1373,7 @@ e_week_view_focus_in (GtkWidget *widget, GdkEventFocus *event) if (e_calendar_view_get_visible_time_range (E_CALENDAR_VIEW (week_view), &my_start, &my_end) && model_start == my_start && model_end == my_end) { /* update only when the same time range is set in a view and in a model; - otherwise time range change invokes also query update */ + * otherwise time range change invokes also query update */ e_week_view_update_query (week_view); } } @@ -1374,7 +1384,8 @@ e_week_view_focus_in (GtkWidget *widget, GdkEventFocus *event) } static gint -e_week_view_focus_out (GtkWidget *widget, GdkEventFocus *event) +e_week_view_focus_out (GtkWidget *widget, + GdkEventFocus *event) { EWeekView *week_view; @@ -1406,11 +1417,11 @@ e_week_view_focus_out (GtkWidget *widget, GdkEventFocus *event) **/ static gboolean e_week_view_get_next_tab_event (EWeekView *week_view, - GtkDirectionType direction, - gint current_event_num, - gint current_span_num, - gint *next_event_num, - gint *next_span_num) + GtkDirectionType direction, + gint current_event_num, + gint current_span_num, + gint *next_event_num, + gint *next_span_num) { gint event_num; @@ -1453,7 +1464,8 @@ e_week_view_get_next_tab_event (EWeekView *week_view, } static gboolean -e_week_view_focus (GtkWidget *widget, GtkDirectionType direction) +e_week_view_focus (GtkWidget *widget, + GtkDirectionType direction) { EWeekView *week_view; gint new_event_num; @@ -1600,12 +1612,12 @@ e_week_view_update_query (EWeekView *week_view) } /* This sets the selected time range. The EWeekView will show the corresponding - month and the days between start_time and end_time will be selected. - To select a single day, use the same value for start_time & end_time. */ + * month and the days between start_time and end_time will be selected. + * To select a single day, use the same value for start_time & end_time. */ static void -e_week_view_set_selected_time_range (ECalendarView *cal_view, - time_t start_time, - time_t end_time) +e_week_view_set_selected_time_range (ECalendarView *cal_view, + time_t start_time, + time_t end_time) { GDate date, end_date; gint num_days; @@ -1644,8 +1656,8 @@ e_week_view_set_selected_time_range (ECalendarView *cal_view, num_days); /* Reset the adjustment value to 0 if the base address has changed. - Note that we do this after updating first_day_shown so that our - signal handler will not try to reload the events. */ + * Note that we do this after updating first_day_shown so that our + * signal handler will not try to reload the events. */ if (update_adjustment_value) { GtkRange *range; GtkAdjustment *adjustment; @@ -1659,9 +1671,9 @@ e_week_view_set_selected_time_range (ECalendarView *cal_view, } void -e_week_view_set_selected_time_range_visible (EWeekView *week_view, - time_t start_time, - time_t end_time) +e_week_view_set_selected_time_range_visible (EWeekView *week_view, + time_t start_time, + time_t end_time) { GDate date, end_date; gint num_days; @@ -1697,9 +1709,9 @@ e_week_view_set_selected_time_range_visible (EWeekView *week_view, /* Returns the selected time range. */ static gboolean -e_week_view_get_selected_time_range (ECalendarView *cal_view, - time_t *start_time, - time_t *end_time) +e_week_view_get_selected_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { gint start_day, end_day; EWeekView *week_view = E_WEEK_VIEW (cal_view); @@ -1723,9 +1735,9 @@ e_week_view_get_selected_time_range (ECalendarView *cal_view, /* Gets the visible time range. Returns FALSE if no time range has been set. */ static gboolean -e_week_view_get_visible_time_range (ECalendarView *cal_view, - time_t *start_time, - time_t *end_time) +e_week_view_get_visible_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { gint num_days; EWeekView *week_view = E_WEEK_VIEW (cal_view); @@ -1743,17 +1755,17 @@ e_week_view_get_visible_time_range (ECalendarView *cal_view, /* Note that the returned date may be invalid if no date has been set yet. */ void -e_week_view_get_first_day_shown (EWeekView *week_view, - GDate *date) +e_week_view_get_first_day_shown (EWeekView *week_view, + GDate *date) { *date = week_view->first_day_shown; } /* This sets the first day shown in the view. It will be rounded down to the - nearest week. */ + * nearest week. */ void -e_week_view_set_first_day_shown (EWeekView *week_view, - GDate *date) +e_week_view_set_first_day_shown (EWeekView *week_view, + GDate *date) { GDate base_date; gint weekday, day_offset, num_days; @@ -1781,7 +1793,7 @@ e_week_view_set_first_day_shown (EWeekView *week_view, day_offset = (weekday + 7 - week_view->display_start_day) % 7; /* Calculate the base date, i.e. the first day shown when the - scrollbar adjustment value is 0. */ + * scrollbar adjustment value is 0. */ base_date = *date; g_date_subtract_days (&base_date, day_offset); @@ -1809,7 +1821,7 @@ e_week_view_set_first_day_shown (EWeekView *week_view, } /* Try to keep the previous selection, but if it is no longer shown - just select the first day. */ + * just select the first day. */ if (week_view->selection_start_day != -1) { week_view->selection_start_day = old_selection_start_julian - g_date_get_julian (&base_date); @@ -1829,8 +1841,8 @@ e_week_view_set_first_day_shown (EWeekView *week_view, } /* Reset the adjustment value to 0 if the base address has changed. - Note that we do this after updating first_day_shown so that our - signal handler will not try to reload the events. */ + * Note that we do this after updating first_day_shown so that our + * signal handler will not try to reload the events. */ if (update_adjustment_value) { GtkRange *range; GtkAdjustment *adjustment; @@ -1847,7 +1859,7 @@ e_week_view_set_first_day_shown (EWeekView *week_view, /* Recalculates the time_t corresponding to the start of each day. */ static void e_week_view_recalc_day_starts (EWeekView *week_view, - time_t lower) + time_t lower) { gint num_days, day; time_t tmp_time; @@ -1864,7 +1876,10 @@ e_week_view_recalc_day_starts (EWeekView *week_view, } static void -month_scrol_by_week_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) +month_scrol_by_week_changed_cb (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) { EWeekView *week_view = user_data; @@ -1878,7 +1893,7 @@ month_scrol_by_week_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry * } gboolean -e_week_view_get_multi_week_view (EWeekView *week_view) +e_week_view_get_multi_week_view (EWeekView *week_view) { g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE); @@ -1886,8 +1901,8 @@ e_week_view_get_multi_week_view (EWeekView *week_view) } void -e_week_view_set_multi_week_view (EWeekView *week_view, - gboolean multi_week_view) +e_week_view_set_multi_week_view (EWeekView *week_view, + gboolean multi_week_view) { GtkRange *range; GtkAdjustment *adjustment; @@ -1946,7 +1961,8 @@ e_week_view_get_update_base_date (EWeekView *week_view) } void -e_week_view_set_update_base_date (EWeekView *week_view, gboolean update_base_date) +e_week_view_set_update_base_date (EWeekView *week_view, + gboolean update_base_date) { g_return_if_fail (E_IS_WEEK_VIEW (week_view)); @@ -1954,7 +1970,7 @@ e_week_view_set_update_base_date (EWeekView *week_view, gboolean update_base_dat } gint -e_week_view_get_weeks_shown (EWeekView *week_view) +e_week_view_get_weeks_shown (EWeekView *week_view) { g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), 1); @@ -1962,8 +1978,8 @@ e_week_view_get_weeks_shown (EWeekView *week_view) } void -e_week_view_set_weeks_shown (EWeekView *week_view, - gint weeks_shown) +e_week_view_set_weeks_shown (EWeekView *week_view, + gint weeks_shown) { GtkRange *range; GtkAdjustment *adjustment; @@ -2031,8 +2047,8 @@ e_week_view_set_compress_weekend (EWeekView *week_view, need_reload = e_week_view_recalc_display_start_day (week_view); /* If the display_start_day has changed we need to recalculate the - date range shown and reload all events, otherwise we only need to - do a reshape. */ + * date range shown and reload all events, otherwise we only need to + * do a reshape. */ if (need_reload) { /* Recalculate the days shown and reload if necessary. */ if (g_date_valid (&week_view->first_day_shown)) @@ -2078,7 +2094,7 @@ e_week_view_set_show_event_end_times (EWeekView *week_view, } static gboolean -e_week_view_recalc_display_start_day (EWeekView *week_view) +e_week_view_recalc_display_start_day (EWeekView *week_view) { ECalModel *model; gint week_start_day; @@ -2088,8 +2104,8 @@ e_week_view_recalc_display_start_day (EWeekView *week_view) week_start_day = e_cal_model_get_week_start_day (model); /* The display start day defaults to week_start_day, but we have - to use Saturday if the weekend is compressed and week_start_day - is Sunday. */ + * to use Saturday if the weekend is compressed and week_start_day + * is Sunday. */ display_start_day = week_start_day; if (display_start_day == 6 @@ -2106,7 +2122,8 @@ e_week_view_recalc_display_start_day (EWeekView *week_view) /* Checks if the users participation status is NEEDS-ACTION and shows the summary as bold text */ static void -set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) +set_text_as_bold (EWeekViewEvent *event, + EWeekViewEventSpan *span) { ECalComponent *comp; GSList *attendees = NULL, *l; @@ -2131,8 +2148,8 @@ set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) } /* The attendee has not yet accepted the meeting, display the summary as bolded. - If the attendee is not present, it might have come through a mailing list. - In that case, we never show the meeting as bold even if it is unaccepted. */ + * If the attendee is not present, it might have come through a mailing list. + * In that case, we never show the meeting as bold even if it is unaccepted. */ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) gnome_canvas_item_set (span->text_item, "bold", TRUE, NULL); @@ -2142,13 +2159,13 @@ set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) } /* This calls a given function for each event instance that matches the given - uid. Note that it is safe for the callback to remove the event (since we - step backwards through the arrays). */ + * uid. Note that it is safe for the callback to remove the event (since we + * step backwards through the arrays). */ static void e_week_view_foreach_event_with_uid (EWeekView *week_view, - const gchar *uid, - EWeekViewForeachEventCallback callback, - gpointer data) + const gchar *uid, + EWeekViewForeachEventCallback callback, + gpointer data) { EWeekViewEvent *event; gint event_num; @@ -2174,8 +2191,8 @@ e_week_view_foreach_event_with_uid (EWeekView *week_view, static gboolean e_week_view_remove_event_cb (EWeekView *week_view, - gint event_num, - gpointer data) + gint event_num, + gpointer data) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -2189,7 +2206,7 @@ e_week_view_remove_event_cb (EWeekView *week_view, return TRUE; /* If we were editing this event, set editing_event_num to -1 so - on_editing_stopped doesn't try to update the event. */ + * on_editing_stopped doesn't try to update the event. */ if (week_view->editing_event_num == event_num) week_view->editing_event_num = -1; @@ -2202,7 +2219,7 @@ e_week_view_remove_event_cb (EWeekView *week_view, if (week_view->spans) { /* We leave the span elements in the array, but set the canvas item - pointers to NULL. */ + * pointers to NULL. */ for (span_num = 0; span_num < event->num_spans; span_num++) { if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num)) break; @@ -2246,12 +2263,12 @@ e_week_view_remove_event_cb (EWeekView *week_view, } void -e_week_view_get_day_position (EWeekView *week_view, - gint day, - gint *day_x, - gint *day_y, - gint *day_w, - gint *day_h) +e_week_view_get_day_position (EWeekView *week_view, + gint day, + gint *day_x, + gint *day_y, + gint *day_w, + gint *day_h) { gint cell_x, cell_y, cell_h; @@ -2276,20 +2293,20 @@ e_week_view_get_day_position (EWeekView *week_view, } /* Returns the bounding box for a span of an event. Usually this can easily - be determined by the start & end days and row of the span, which are set in - e_week_view_layout_event (). Though we need a special case for the weekends - when they are compressed, since the span may not fit. - The bounding box includes the entire width of the days in the view (but - not the vertical line down the right of the last day), though the displayed - event doesn't normally extend to the edges of the day. - It returns FALSE if the span isn't visible. */ + * be determined by the start & end days and row of the span, which are set in + * e_week_view_layout_event (). Though we need a special case for the weekends + * when they are compressed, since the span may not fit. + * The bounding box includes the entire width of the days in the view (but + * not the vertical line down the right of the last day), though the displayed + * event doesn't normally extend to the edges of the day. + * It returns FALSE if the span isn't visible. */ gboolean -e_week_view_get_span_position (EWeekView *week_view, - gint event_num, - gint span_num, - gint *span_x, - gint *span_y, - gint *span_w) +e_week_view_get_span_position (EWeekView *week_view, + gint event_num, + gint span_num, + gint *span_x, + gint *span_y, + gint *span_w) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -2340,7 +2357,8 @@ e_week_view_get_span_position (EWeekView *week_view, } static gboolean -ewv_pass_gdkevent_to_etext (EWeekView *week_view, GdkEvent *gevent) +ewv_pass_gdkevent_to_etext (EWeekView *week_view, + GdkEvent *gevent) { g_return_val_if_fail (week_view != NULL, FALSE); g_return_val_if_fail (gevent != NULL, FALSE); @@ -2370,8 +2388,8 @@ ewv_pass_gdkevent_to_etext (EWeekView *week_view, GdkEvent *gevent) static gboolean e_week_view_on_button_press (GtkWidget *widget, - GdkEventButton *event, - EWeekView *week_view) + GdkEventButton *event, + EWeekView *week_view) { gint x, y, day; @@ -2453,8 +2471,8 @@ e_week_view_on_button_press (GtkWidget *widget, static gboolean e_week_view_on_button_release (GtkWidget *widget, - GdkEventButton *event, - EWeekView *week_view) + GdkEventButton *event, + EWeekView *week_view) { #if 0 g_print ("In e_week_view_on_button_release\n"); @@ -2472,8 +2490,8 @@ e_week_view_on_button_release (GtkWidget *widget, static gboolean e_week_view_on_scroll (GtkWidget *widget, - GdkEventScroll *scroll, - EWeekView *week_view) + GdkEventScroll *scroll, + EWeekView *week_view) { GtkRange *range; GtkAdjustment *adjustment; @@ -2525,8 +2543,8 @@ e_week_view_on_scroll (GtkWidget *widget, static gboolean e_week_view_on_motion (GtkWidget *widget, - GdkEventMotion *mevent, - EWeekView *week_view) + GdkEventMotion *mevent, + EWeekView *week_view) { gint x, y, day; @@ -2552,11 +2570,11 @@ e_week_view_on_motion (GtkWidget *widget, } /* Converts a position in the canvas window to a day offset from the first - day displayed. Returns -1 if the position is outside the grid. */ + * day displayed. Returns -1 if the position is outside the grid. */ static gint e_week_view_convert_position_to_day (EWeekView *week_view, - gint x, - gint y) + gint x, + gint y) { gint col, row, grid_x = -1, grid_y = -1, week, day; gint weekend_col; @@ -2612,7 +2630,7 @@ e_week_view_convert_position_to_day (EWeekView *week_view, static void e_week_view_update_selection (EWeekView *week_view, - gint day) + gint day) { gint tmp_day; gboolean need_redraw = FALSE; @@ -2704,10 +2722,10 @@ e_week_view_free_events (EWeekView *week_view) /* This adds one event to the view, adding it to the appropriate array. */ static gboolean e_week_view_add_event (ECalComponent *comp, - time_t start, - time_t end, - gboolean prepend, - gpointer data) + time_t start, + time_t end, + gboolean prepend, + gpointer data) { AddEventData *add_event_data; @@ -2823,12 +2841,12 @@ e_week_view_ensure_events_sorted (EWeekView *week_view) gint e_week_view_event_sort_func (gconstpointer arg1, - gconstpointer arg2) + gconstpointer arg2) { EWeekViewEvent *event1, *event2; - event1 = (EWeekViewEvent*) arg1; - event2 = (EWeekViewEvent*) arg2; + event1 = (EWeekViewEvent *) arg1; + event2 = (EWeekViewEvent *) arg2; if (event1->start < event2->start) return -1; @@ -2919,7 +2937,9 @@ e_week_view_reshape_events (EWeekView *week_view) } static EWeekViewEvent * -tooltip_get_view_event (EWeekView *week_view, gint day, gint event_num) +tooltip_get_view_event (EWeekView *week_view, + gint day, + gint event_num) { EWeekViewEvent *pevent; @@ -2932,7 +2952,8 @@ tooltip_get_view_event (EWeekView *week_view, gint day, gint event_num) } static void -tooltip_destroy (EWeekView *week_view, GnomeCanvasItem *item) +tooltip_destroy (EWeekView *week_view, + GnomeCanvasItem *item) { gint event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; @@ -2957,8 +2978,8 @@ tooltip_destroy (EWeekView *week_view, GnomeCanvasItem *item) static gboolean tooltip_event_cb (GnomeCanvasItem *item, - GdkEvent *event, - EWeekView *view) + GdkEvent *event, + EWeekView *view) { gint event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; @@ -2996,7 +3017,7 @@ tooltip_event_cb (GnomeCanvasItem *item, pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (view), "tooltip-window"); if (pevent->tooltip) { - e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x + 16, pevent->y + 16); } return TRUE; @@ -3010,7 +3031,9 @@ tooltip_event_cb (GnomeCanvasItem *item, } static const gchar * -get_comp_summary (ECalClient *client, icalcomponent *icalcomp, gboolean *free_text) +get_comp_summary (ECalClient *client, + icalcomponent *icalcomp, + gboolean *free_text) { const gchar *my_summary, *location; const gchar *summary; @@ -3037,8 +3060,8 @@ get_comp_summary (ECalClient *client, icalcomponent *icalcomp, gboolean *free_te static void e_week_view_reshape_event_span (EWeekView *week_view, - gint event_num, - gint span_num) + gint event_num, + gint span_num) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -3074,7 +3097,7 @@ e_week_view_reshape_event_span (EWeekView *week_view, one_day_event = e_week_view_is_one_day_event (week_view, event_num); /* If the span will not be visible destroy the canvas items and - return. */ + * return. */ if (!e_week_view_get_span_position (week_view, event_num, span_num, &span_x, &span_y, &span_w)) { if (span->background_item) @@ -3096,7 +3119,7 @@ e_week_view_reshape_event_span (EWeekView *week_view, layout = pango_layout_new (pango_context); /* If we are editing a long event we don't show the icons and the EText - item uses the maximum width available. */ + * item uses the maximum width available. */ if (!one_day_event && week_view->editing_event_num == event_num && week_view->editing_span_num == span_num) { show_icons = FALSE; @@ -3178,11 +3201,11 @@ e_week_view_reshape_event_span (EWeekView *week_view, } /* Calculate the position of the text item. - For events < 1 day it starts after the times & icons and ends at the - right edge of the span. - For events >= 1 day we need to determine whether times are shown at - the start and end of the span, then try to center the text item with - the icons in the middle, but making sure we don't go over the times. + * For events < 1 day it starts after the times & icons and ends at the + * right edge of the span. + * For events >= 1 day we need to determine whether times are shown at + * the start and end of the span, then try to center the text item with + * the icons in the middle, but making sure we don't go over the times. */ /* Calculate the space necessary to display a time, e.g. "13:00". */ @@ -3202,16 +3225,16 @@ e_week_view_reshape_event_span (EWeekView *week_view, if (one_day_event) { /* Note that 1-day events don't have a border. Although we - still use the border height to position the events - vertically so they still line up neatly (see above), - we don't use the border width or edge padding at all. */ + * still use the border height to position the events + * vertically so they still line up neatly (see above), + * we don't use the border width or edge padding at all. */ text_x = span_x + E_WEEK_VIEW_EVENT_L_PAD; switch (week_view->time_format) { case E_WEEK_VIEW_TIME_BOTH_SMALL_MIN: case E_WEEK_VIEW_TIME_BOTH: /* These have 2 time strings with a small space between - them and some space before the EText item. */ + * them and some space before the EText item. */ text_x += time_width * 2 + E_WEEK_VIEW_EVENT_TIME_SPACING + E_WEEK_VIEW_EVENT_TIME_X_PAD; @@ -3219,7 +3242,7 @@ e_week_view_reshape_event_span (EWeekView *week_view, case E_WEEK_VIEW_TIME_START_SMALL_MIN: case E_WEEK_VIEW_TIME_START: /* These have just 1 time string with some space - before the EText item. */ + * before the EText item. */ text_x += time_width + E_WEEK_VIEW_EVENT_TIME_X_PAD; break; case E_WEEK_VIEW_TIME_NONE: @@ -3230,13 +3253,13 @@ e_week_view_reshape_event_span (EWeekView *week_view, text_x += icons_width; /* The width of the EText item extends right to the edge of the - event, just inside the border. */ + * event, just inside the border. */ text_w = span_x + span_w - E_WEEK_VIEW_EVENT_R_PAD - text_x; } else { if (use_max_width) { /* When we are editing the event we use all the - available width. */ + * available width. */ text_x = span_x + E_WEEK_VIEW_EVENT_L_PAD + E_WEEK_VIEW_EVENT_BORDER_WIDTH + E_WEEK_VIEW_EVENT_EDGE_X_PAD; @@ -3246,13 +3269,13 @@ e_week_view_reshape_event_span (EWeekView *week_view, } else { text = NULL; /* Get the width of the text of the event. This is a - bit of a hack. It would be better if EText could - tell us this. */ - g_object_get (G_OBJECT (span->text_item), "text", &text, NULL); + * bit of a hack. It would be better if EText could + * tell us this. */ + g_object_get (span->text_item, "text", &text, NULL); text_width = 0; if (text) { /* It should only have one line of text in it. - I'm not sure we need this any more. */ + * I'm not sure we need this any more. */ end_of_line = strchr (text, '\n'); if (end_of_line) line_len = end_of_line - text; @@ -3265,28 +3288,28 @@ e_week_view_reshape_event_span (EWeekView *week_view, } /* Add on the width of the icons and find the default - position, which centers the icons + text. */ + * position, which centers the icons + text. */ width = text_width + icons_width; text_x = span_x + (span_w - width) / 2; /* Now calculate the left-most valid position, and make - sure we don't go to the left of that. */ + * sure we don't go to the left of that. */ min_text_x = span_x + E_WEEK_VIEW_EVENT_L_PAD + E_WEEK_VIEW_EVENT_BORDER_WIDTH + E_WEEK_VIEW_EVENT_EDGE_X_PAD; /* See if we will want to display the start time, and - if so take that into account. */ + * if so take that into account. */ if (event->start > week_view->day_starts[span->start_day]) min_text_x += time_width + E_WEEK_VIEW_EVENT_TIME_X_PAD; /* Now make sure we don't go to the left of the minimum - position. */ + * position. */ text_x = MAX (text_x, min_text_x); /* Now calculate the largest valid width, using the - calculated x position, and make sure we don't - exceed that. */ + * calculated x position, and make sure we don't + * exceed that. */ max_text_w = span_x + span_w - E_WEEK_VIEW_EVENT_R_PAD - E_WEEK_VIEW_EVENT_BORDER_WIDTH - E_WEEK_VIEW_EVENT_EDGE_X_PAD - text_x; @@ -3319,9 +3342,9 @@ e_week_view_reshape_event_span (EWeekView *week_view, gboolean e_week_view_start_editing_event (EWeekView *week_view, - gint event_num, - gint span_num, - gchar *initial_text) + gint event_num, + gint span_num, + gchar *initial_text) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -3403,7 +3426,7 @@ e_week_view_start_editing_event (EWeekView *week_view, span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + span_num); /* Try to move the cursor to the end of the text. */ - g_object_get (G_OBJECT (span->text_item), "event_processor", &event_processor, NULL); + g_object_get (span->text_item, "event_processor", &event_processor, NULL); if (event_processor) { command.action = E_TEP_MOVE; command.position = E_TEP_END_OF_BUFFER; @@ -3459,7 +3482,7 @@ cancel_editing (EWeekView *week_view) /* Reset the text to what was in the component */ summary = icalcomponent_get_summary (event->comp_data->icalcomp); - g_object_set (G_OBJECT (span->text_item), "text", summary ? summary : "", NULL); + g_object_set (span->text_item, "text", summary ? summary : "", NULL); /* Stop editing */ e_week_view_stop_editing_event (week_view); @@ -3467,8 +3490,8 @@ cancel_editing (EWeekView *week_view) static gboolean e_week_view_on_text_item_event (GnomeCanvasItem *item, - GdkEvent *gdkevent, - EWeekView *week_view) + GdkEvent *gdkevent, + EWeekView *week_view) { EWeekViewEvent *event; gint event_num, span_num; @@ -3486,11 +3509,11 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, tooltip_destroy (week_view, item); if (!E_TEXT (item)->preedit_len && gdkevent && gdkevent->key.keyval == GDK_KEY_Return) { /* We set the keyboard focus to the EDayView, so the - EText item loses it and stops the edit. */ + * EText item loses it and stops the edit. */ gtk_widget_grab_focus (GTK_WIDGET (week_view)); /* Stop the signal last or we will also stop any - other events getting to the EText item. */ + * other events getting to the EText item. */ g_signal_stop_emission_by_name (G_OBJECT (item), "event"); return TRUE; } else if (gdkevent->key.keyval == GDK_KEY_Escape) { @@ -3516,7 +3539,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, return FALSE; /* if we started to editing new item on the canvas, then do not open editing dialog until it's saved, - because the save of the event recalculates event numbers and you can edit different one */ + * because the save of the event recalculates event numbers and you can edit different one */ if (!is_icalcomp_on_the_server (event->comp_data->icalcomp, event->comp_data->client)) return TRUE; @@ -3552,7 +3575,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, e_week_view_set_selected_time_range_visible (week_view, e->start, e->end); e_week_view_show_popup_menu (week_view, - (GdkEventButton*) gdkevent, + (GdkEventButton *) gdkevent, event_num); g_signal_stop_emission_by_name (G_OBJECT (item->canvas), @@ -3576,7 +3599,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, g_warning ("No GdkEvent"); /* FIXME: Remember the day offset from the start of - the event, for DnD. */ + * the event, for DnD. */ return TRUE; } @@ -3601,7 +3624,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, } /* Stop the signal last or we will also stop any - other events getting to the EText item. */ + * other events getting to the EText item. */ g_signal_stop_emission_by_name (G_OBJECT (item), "event"); return TRUE; } @@ -3648,7 +3671,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (week_view), "tooltip-window"); if (pevent->tooltip) { - e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x + 16, pevent->y + 16); } return TRUE; case GDK_FOCUS_CHANGE: @@ -3746,7 +3769,8 @@ static gboolean e_week_view_event_move (ECalendarView *cal_view, ECalViewMoveDir } static gint -e_week_view_get_day_offset_of_event (EWeekView *week_view, time_t event_time) +e_week_view_get_day_offset_of_event (EWeekView *week_view, + time_t event_time) { time_t first_day = week_view->day_starts[0]; @@ -3757,7 +3781,8 @@ e_week_view_get_day_offset_of_event (EWeekView *week_view, time_t event_time) } void -e_week_view_scroll_a_step (EWeekView *week_view, ECalViewMoveDirection direction) +e_week_view_scroll_a_step (EWeekView *week_view, + ECalViewMoveDirection direction) { GtkAdjustment *adjustment; GtkRange *range; @@ -3799,7 +3824,10 @@ e_week_view_scroll_a_step (EWeekView *week_view, ECalViewMoveDirection direction } static void -e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end_dt, gboolean is_all_day) +e_week_view_change_event_time (EWeekView *week_view, + time_t start_dt, + time_t end_dt, + gboolean is_all_day) { EWeekViewEvent *event; gint event_num; @@ -3827,13 +3855,13 @@ e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end client = event->comp_data->client; /* We use a temporary shallow copy of the ico since we don't want to - change the original ico here. Otherwise we would not detect that - the event's time had changed in the "update_event" callback. */ + * change the original ico here. Otherwise we would not detect that + * the event's time had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); date.value = &itt; /* FIXME: Should probably keep the timezone of the original start - and end times. */ + * and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); *date.value = icaltime_from_timet_with_zone (start_dt, is_all_day, @@ -3881,7 +3909,7 @@ out: static void e_week_view_on_editing_started (EWeekView *week_view, - GnomeCanvasItem *item) + GnomeCanvasItem *item) { gint event_num, span_num; @@ -3897,7 +3925,7 @@ e_week_view_on_editing_started (EWeekView *week_view, week_view->editing_span_num = span_num; /* We need to reshape long events so the whole width is used while - editing. */ + * editing. */ if (!e_week_view_is_one_day_event (week_view, event_num)) { e_week_view_reshape_event_span (week_view, event_num, span_num); @@ -3908,7 +3936,7 @@ e_week_view_on_editing_started (EWeekView *week_view, static void e_week_view_on_editing_stopped (EWeekView *week_view, - GnomeCanvasItem *item) + GnomeCanvasItem *item) { gint event_num, span_num; EWeekViewEvent *event; @@ -3921,8 +3949,8 @@ e_week_view_on_editing_stopped (EWeekView *week_view, gboolean on_server; /* Note: the item we are passed here isn't reliable, so we just stop - the edit of whatever item was being edited. We also receive this - event twice for some reason. */ + * the edit of whatever item was being edited. We also receive this + * event twice for some reason. */ event_num = week_view->editing_event_num; span_num = week_view->editing_span_num; @@ -3954,7 +3982,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, text = NULL; g_object_set (span->text_item, "handle_popup", FALSE, NULL); - g_object_get (G_OBJECT (span->text_item), "text", &text, NULL); + g_object_get (span->text_item, "text", &text, NULL); comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -3980,7 +4008,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, const gchar *summary; summary = get_comp_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text); - g_object_set (G_OBJECT (span->text_item), "text", summary ? summary : "", NULL); + g_object_set (span->text_item, "text", summary ? summary : "", NULL); if (free_text) g_free ((gchar *) summary); @@ -4097,10 +4125,10 @@ e_week_view_on_editing_stopped (EWeekView *week_view, } gboolean -e_week_view_find_event_from_item (EWeekView *week_view, - GnomeCanvasItem *item, - gint *event_num_return, - gint *span_num_return) +e_week_view_find_event_from_item (EWeekView *week_view, + GnomeCanvasItem *item, + gint *event_num_return, + gint *span_num_return) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -4129,17 +4157,17 @@ e_week_view_find_event_from_item (EWeekView *week_view, } /* Finds the index of the event with the given uid. - Returns TRUE if an event with the uid was found. - Note that for recurring events there may be several EWeekViewEvents, one - for each instance, all with the same iCalObject and uid. So only use this - function if you know the event doesn't recur or you are just checking to - see if any events with the uid exist. */ + * Returns TRUE if an event with the uid was found. + * Note that for recurring events there may be several EWeekViewEvents, one + * for each instance, all with the same iCalObject and uid. So only use this + * function if you know the event doesn't recur or you are just checking to + * see if any events with the uid exist. */ static gboolean -e_week_view_find_event_from_uid (EWeekView *week_view, - ECalClient *client, - const gchar *uid, - const gchar *rid, - gint *event_num_return) +e_week_view_find_event_from_uid (EWeekView *week_view, + ECalClient *client, + const gchar *uid, + const gchar *rid, + gint *event_num_return) { EWeekViewEvent *event; gint event_num, num_events; @@ -4184,8 +4212,8 @@ e_week_view_find_event_from_uid (EWeekView *week_view, } gboolean -e_week_view_is_one_day_event (EWeekView *week_view, - gint event_num) +e_week_view_is_one_day_event (EWeekView *week_view, + gint event_num) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -4260,7 +4288,8 @@ e_week_view_cursor_key_right (EWeekView *week_view) } static gboolean -e_week_view_add_new_event_in_selected_range (EWeekView *week_view, const gchar *initial_text) +e_week_view_add_new_event_in_selected_range (EWeekView *week_view, + const gchar *initial_text) { ECalClient *client; ECalModel *model; @@ -4314,7 +4343,7 @@ e_week_view_add_new_event_in_selected_range (EWeekView *week_view, const gchar * comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (week_view))); /* We add the event locally and start editing it. We don't send it - to the server until the user finishes editing it. */ + * to the server until the user finishes editing it. */ add_event_data.week_view = week_view; add_event_data.comp_data = NULL; e_week_view_add_event (comp, dtstart, dtend, TRUE, &add_event_data); @@ -4356,7 +4385,8 @@ e_week_view_add_new_event_in_selected_range (EWeekView *week_view, const gchar * } static gboolean -e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) +e_week_view_do_key_press (GtkWidget *widget, + GdkEventKey *event) { EWeekView *week_view; gchar *initial_text; @@ -4437,7 +4467,7 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) return FALSE; /* We only want to start an edit with a return key or a simple - character. */ + * character. */ if (event->keyval == GDK_KEY_Return) { initial_text = NULL; } else if (((event->keyval >= 0x20) && (event->keyval <= 0xFF) @@ -4457,7 +4487,8 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) } static gint -e_week_view_get_adjust_days_for_move_up (EWeekView *week_view,gint current_day) +e_week_view_get_adjust_days_for_move_up (EWeekView *week_view, + gint current_day) { if (week_view->multi_week_view) return -7; @@ -4466,7 +4497,8 @@ e_week_view_get_adjust_days_for_move_up (EWeekView *week_view,gint current_day) } static gint -e_week_view_get_adjust_days_for_move_down (EWeekView *week_view,gint current_day) +e_week_view_get_adjust_days_for_move_down (EWeekView *week_view, + gint current_day) { if (week_view->multi_week_view) return 7; @@ -4475,19 +4507,22 @@ e_week_view_get_adjust_days_for_move_down (EWeekView *week_view,gint current_day } static gint -e_week_view_get_adjust_days_for_move_left (EWeekView *week_view,gint current_day) +e_week_view_get_adjust_days_for_move_left (EWeekView *week_view, + gint current_day) { return -1; } static gint -e_week_view_get_adjust_days_for_move_right (EWeekView *week_view,gint current_day) +e_week_view_get_adjust_days_for_move_right (EWeekView *week_view, + gint current_day) { return 1; } static gboolean -e_week_view_key_press (GtkWidget *widget, GdkEventKey *event) +e_week_view_key_press (GtkWidget *widget, + GdkEventKey *event) { gboolean handled = FALSE; handled = e_week_view_do_key_press (widget, event); @@ -4499,9 +4534,9 @@ e_week_view_key_press (GtkWidget *widget, GdkEventKey *event) } void -e_week_view_show_popup_menu (EWeekView *week_view, - GdkEventButton *bevent, - gint event_num) +e_week_view_show_popup_menu (EWeekView *week_view, + GdkEventButton *bevent, + gint event_num) { week_view->popup_event_num = event_num; @@ -4518,7 +4553,8 @@ e_week_view_popup_menu (GtkWidget *widget) } void -e_week_view_jump_to_button_item (EWeekView *week_view, GnomeCanvasItem *item) +e_week_view_jump_to_button_item (EWeekView *week_view, + GnomeCanvasItem *item) { gint day; GnomeCalendar *calendar; @@ -4539,8 +4575,8 @@ e_week_view_jump_to_button_item (EWeekView *week_view, GnomeCanvasItem *item) static gboolean e_week_view_on_jump_button_event (GnomeCanvasItem *item, - GdkEvent *event, - EWeekView *week_view) + GdkEvent *event, + EWeekView *week_view) { gint day; @@ -4594,20 +4630,20 @@ e_week_view_on_jump_button_event (GnomeCanvasItem *item, } /* Converts an hour from 0-23 to the preferred time format, and returns the - suffix to add and the width of it in the normal font. */ + * suffix to add and the width of it in the normal font. */ void -e_week_view_convert_time_to_display (EWeekView *week_view, - gint hour, - gint *display_hour, - const gchar **suffix, - gint *suffix_width) +e_week_view_convert_time_to_display (EWeekView *week_view, + gint hour, + gint *display_hour, + const gchar **suffix, + gint *suffix_width) { ECalModel *model; model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)); /* Calculate the actual hour number to display. For 12-hour - format we convert 0-23 to 12-11am/12-11pm. */ + * format we convert 0-23 to 12-11am/12-11pm. */ *display_hour = hour; if (e_cal_model_get_use_24_hour_format (model)) { *suffix = ""; @@ -4629,7 +4665,7 @@ e_week_view_convert_time_to_display (EWeekView *week_view, } gint -e_week_view_get_time_string_width (EWeekView *week_view) +e_week_view_get_time_string_width (EWeekView *week_view) { ECalModel *model; gint time_width; @@ -4691,7 +4727,8 @@ e_week_view_get_num_events_selected (EWeekView *week_view) } gboolean -e_week_view_is_jump_button_visible (EWeekView *week_view, gint day) +e_week_view_is_jump_button_visible (EWeekView *week_view, + gint day) { g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE); diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h index 9525b87c02..5a1f2e6d22 100644 --- a/calendar/gui/e-week-view.h +++ b/calendar/gui/e-week-view.h @@ -53,12 +53,12 @@ ((obj), E_TYPE_WEEK_VIEW, EWeekViewClass)) /* The maximum number of weeks we show. 5 is usually enough for 1 month, - but we allow 6 for longer selections. */ + * but we allow 6 for longer selections. */ #define E_WEEK_VIEW_MAX_WEEKS 6 /* The size of the reminder & recurrence icons, and padding around them. - X_PAD is the padding between icons. R_PAD is the padding on the right of - the last icon, before the event text. */ + * X_PAD is the padding between icons. R_PAD is the padding on the right of + * the last icon, before the event text. */ #define E_WEEK_VIEW_ICON_WIDTH 16 #define E_WEEK_VIEW_ICON_HEIGHT 16 #define E_WEEK_VIEW_ICON_X_PAD 1 @@ -66,7 +66,7 @@ #define E_WEEK_VIEW_ICON_R_PAD 8 /* The space on the left & right outside of the event. (The triangle to - indicate the event continues is displayed in this space). */ + * indicate the event continues is displayed in this space). */ #define E_WEEK_VIEW_EVENT_L_PAD 2 #define E_WEEK_VIEW_EVENT_R_PAD 2 @@ -90,12 +90,12 @@ #define E_WEEK_VIEW_EVENT_EDGE_X_PAD 2 /* The padding above and on the right of the date string at the top of each - cell. */ + * cell. */ #define E_WEEK_VIEW_DATE_T_PAD 2 #define E_WEEK_VIEW_DATE_R_PAD 4 /* The padding above and below the line under the date string, in the Week - view, and also the space on the left of it. */ + * view, and also the space on the left of it. */ #define E_WEEK_VIEW_DATE_LINE_T_PAD 1 #define E_WEEK_VIEW_DATE_LINE_B_PAD 1 #define E_WEEK_VIEW_DATE_LINE_L_PAD 10 @@ -104,8 +104,8 @@ #define E_WEEK_VIEW_DATE_B_PAD 1 /* We use a 7-bit field to store row numbers in EWeekViewEventSpan, so the - maximum number or rows we can allow is 127. It is very unlikely to be - reached anyway. */ + * maximum number or rows we can allow is 127. It is very unlikely to be + * reached anyway. */ #define E_WEEK_VIEW_MAX_ROWS_PER_CELL 127 G_BEGIN_DECLS @@ -139,7 +139,7 @@ typedef enum } EWeekViewDragPosition; /* These specify which times are shown for the 1-day events. We use the small - font for the minutes if it can be loaded and the option is on. */ + * font for the minutes if it can be loaded and the option is on. */ typedef enum { E_WEEK_VIEW_TIME_NONE, @@ -195,8 +195,8 @@ struct _EWeekView { gint layout_timeout_id; /* An array of EWeekViewEventSpan elements. Each event has its own - space within this array, and uses the spans_index and num_spans - fields of the EWeekViewEvent struct to access it. */ + * space within this array, and uses the spans_index and num_spans + * fields of the EWeekViewEvent struct to access it. */ GArray *spans; /* The start of each day displayed. */ @@ -209,7 +209,7 @@ struct _EWeekView { GDate first_day_shown; /* If we are displaying multiple weeks in rows. If this is FALSE only - one week is shown, with a different layout. */ + * one week is shown, with a different layout. */ gboolean multi_week_view; /* TRUE when requires scrolling by a week in a multi_week_view */ @@ -219,11 +219,11 @@ struct _EWeekView { gboolean update_base_date; /* How many weeks we are showing. This is only relevant if - display_month is TRUE. */ + * display_month is TRUE. */ gint weeks_shown; /* If Sat & Sun are compressed. Only applicable in month view, since - they are always compressed into 1 cell in the week view. */ + * they are always compressed into 1 cell in the week view. */ gboolean compress_weekend; /* Whether we use show event end times. */ @@ -233,8 +233,8 @@ struct _EWeekView { gint week_start_day; /* The first day of the week we display, 0 (Monday) to 6 (Sunday). - This will usually be week_start_day, but if the weekend is - compressed, and week_start_day is Sunday we have to use Saturday. */ + * This will usually be week_start_day, but if the weekend is + * compressed, and week_start_day is Sunday we have to use Saturday. */ gint display_start_day; /* The vertical offset of the events from the top of the cells. */ @@ -257,7 +257,7 @@ struct _EWeekView { PangoFontDescription *small_font_desc; /* The widths of various pieces of text, used to determine which of - several date formats to display, set in e_week_view_style_set (). */ + * several date formats to display, set in e_week_view_style_set (). */ gint space_width; /* One space character ' '. */ gint colon_width; /* Size of ':' in the font. */ gint slash_width; /* Size of '/' in the font. */ @@ -273,10 +273,10 @@ struct _EWeekView { gint max_abbr_month_width; /* The size of the main grid of days and of the cells. A row - corresponds to a compressed day, so normal days usually take - up 2 rows. Note that the offsets arrays have one more element - than the widths/heights arrays since they also contain the - right/bottom edge. */ + * corresponds to a compressed day, so normal days usually take + * up 2 rows. Note that the offsets arrays have one more element + * than the widths/heights arrays since they also contain the + * right/bottom edge. */ gint rows; gint columns; gint col_widths[7]; @@ -285,7 +285,7 @@ struct _EWeekView { gint row_offsets[E_WEEK_VIEW_MAX_WEEKS * 2 + 1]; /* This specifies which times we are showing for the events, depending - on how much room is available. */ + * on how much room is available. */ EWeekViewTimeFormat time_format; /* The icons. */ @@ -307,22 +307,22 @@ struct _EWeekView { GdkCursor *last_cursor_set; /* The currently selected region, in days from the first day shown. - If selection_start_day is -1 there is no current selection. */ + * If selection_start_day is -1 there is no current selection. */ gint selection_start_day; gint selection_end_day; /* This specifies which end of the selection is being dragged, or is - E_WEEK_VIEW_DRAG_NONE if the selection isn't being dragged. */ + * E_WEEK_VIEW_DRAG_NONE if the selection isn't being dragged. */ EWeekViewDragPosition selection_drag_pos; /* This is the event the mouse button was pressed on. If the button - is released we start editing it, but if the mouse is dragged we set - this to -1. */ + * is released we start editing it, but if the mouse is dragged we set + * this to -1. */ gint pressed_event_num; gint pressed_span_num; /* The event span currently being edited. The num is -1 if no event is - being edited. */ + * being edited. */ gint editing_event_num; gint editing_span_num; @@ -344,7 +344,7 @@ struct _EWeekView { gboolean event_destroyed; /* remember last selected interval when click and restore on double click, - if we double clicked inside that interval. */ + * if we double clicked inside that interval. */ guint32 bc_event_time; time_t before_click_dtstart; time_t before_click_dtend; @@ -365,16 +365,16 @@ GType e_week_view_get_type (void); ECalendarView * e_week_view_new (ECalModel *model); /* The first day shown. Note that it will be rounded down to the start of a - week when set. The returned value will be invalid if no date has been set - yet. */ + * week when set. The returned value will be invalid if no date has been set + * yet. */ void e_week_view_get_first_day_shown (EWeekView *week_view, GDate *date); void e_week_view_set_first_day_shown (EWeekView *week_view, GDate *date); /* The selected time range. The EWeekView will show the corresponding - month and the days between start_time and end_time will be selected. - To select a single day, use the same value for start_time & end_time. */ + * month and the days between start_time and end_time will be selected. + * To select a single day, use the same value for start_time & end_time. */ void e_week_view_set_selected_time_range_visible (EWeekView *week_view, time_t start_time, @@ -396,7 +396,7 @@ void e_week_view_set_weeks_shown (EWeekView *week_view, gint weeks_shown); /* Whether the weekend (Sat/Sun) should be compressed into 1 cell in the Month - view. In the Week view they are always compressed. */ + * view. In the Week view they are always compressed. */ gboolean e_week_view_get_compress_weekend (EWeekView *week_view); void e_week_view_set_compress_weekend (EWeekView *week_view, gboolean compress_weekend); diff --git a/calendar/gui/ea-cal-view-event.c b/calendar/gui/ea-cal-view-event.c index f3716d7623..5111d6d27f 100644 --- a/calendar/gui/ea-cal-view-event.c +++ b/calendar/gui/ea-cal-view-event.c @@ -176,7 +176,7 @@ static void ea_cal_view_finalize (GObject *object) } #endif -AtkObject* +AtkObject * ea_cal_view_event_new (GObject *obj) { AtkObject *atk_obj = NULL; @@ -386,7 +386,7 @@ ea_cal_view_event_get_index_in_parent (AtkObject *accessible) --event_num) { day_view_event = &g_array_index (day_view->long_events, EDayViewEvent, event_num); - if (cal_view_event == (ECalendarViewEvent*) day_view_event) + if (cal_view_event == (ECalendarViewEvent *) day_view_event) return event_num; } @@ -397,7 +397,7 @@ ea_cal_view_event_get_index_in_parent (AtkObject *accessible) --event_num) { day_view_event = &g_array_index (day_view->events[day], EDayViewEvent, event_num); - if (cal_view_event == (ECalendarViewEvent*) day_view_event) + if (cal_view_event == (ECalendarViewEvent *) day_view_event) return num_before + event_num; } num_before += day_view->events[day]->len; @@ -447,12 +447,12 @@ atk_component_interface_init (AtkComponentIface *iface) } static void -ea_cal_view_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) +ea_cal_view_get_extents (AtkComponent *component, + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; GnomeCanvasItem *canvas_item; @@ -568,7 +568,8 @@ atk_action_interface_init (AtkActionIface *iface) } static gboolean -ea_cal_view_event_do_action (AtkAction *action, gint i) +ea_cal_view_event_do_action (AtkAction *action, + gint i) { AtkGObjectAccessible *atk_gobj; AtkComponent *atk_comp; @@ -591,7 +592,8 @@ ea_cal_view_event_get_n_actions (AtkAction *action) } static const gchar * -ea_cal_view_event_action_get_name (AtkAction *action, gint i) +ea_cal_view_event_action_get_name (AtkAction *action, + gint i) { if (i >= 0 && i < CAL_VIEW_EVENT_ACTION_NUM) return action_name[i]; diff --git a/calendar/gui/ea-cal-view.c b/calendar/gui/ea-cal-view.c index 5b93469450..e6c3d65b9b 100644 --- a/calendar/gui/ea-cal-view.c +++ b/calendar/gui/ea-cal-view.c @@ -33,7 +33,7 @@ static void ea_cal_view_class_init (EaCalViewClass *klass); -static AtkObject* ea_cal_view_get_parent (AtkObject *accessible); +static AtkObject * ea_cal_view_get_parent (AtkObject *accessible); static void ea_cal_view_real_initialize (AtkObject *accessible, gpointer data); static void ea_cal_view_event_changed_cb (ECalendarView *cal_view, @@ -50,11 +50,17 @@ static void atk_action_interface_init (AtkActionIface *iface); static gboolean action_interface_do_action (AtkAction *action, gint i); static gint action_interface_get_n_actions (AtkAction *action); static const gchar * -action_interface_get_description (AtkAction *action, gint i); + action_interface_get_description + (AtkAction *action, + gint i); static const gchar * -action_interface_get_keybinding (AtkAction *action, gint i); + action_interface_get_keybinding + (AtkAction *action, + gint i); static const gchar * -action_interface_action_get_name (AtkAction *action, gint i); + action_interface_action_get_name + (AtkAction *action, + gint i); static gpointer parent_class = NULL; @@ -119,7 +125,7 @@ ea_cal_view_class_init (EaCalViewClass *klass) class->initialize = ea_cal_view_real_initialize; } -AtkObject* +AtkObject * ea_cal_view_new (GtkWidget *widget) { GObject *object; @@ -136,7 +142,8 @@ ea_cal_view_new (GtkWidget *widget) } static void -ea_cal_view_real_initialize (AtkObject *accessible, gpointer data) +ea_cal_view_real_initialize (AtkObject *accessible, + gpointer data) { ECalendarView *cal_view; GnomeCalendar *gcal; @@ -156,10 +163,12 @@ ea_cal_view_real_initialize (AtkObject *accessible, gpointer data) * of the event is removed, the cal_view_event will go to the state * of "defunct" (changed by weak ref callback of atkgobjectaccessible */ - g_signal_connect (G_OBJECT(cal_view), "event_changed", - G_CALLBACK (ea_cal_view_event_changed_cb), NULL); - g_signal_connect (G_OBJECT(cal_view), "event_added", - G_CALLBACK (ea_cal_view_event_added_cb), NULL); + g_signal_connect ( + cal_view, "event_changed", + G_CALLBACK (ea_cal_view_event_changed_cb), NULL); + g_signal_connect ( + cal_view, "event_added", + G_CALLBACK (ea_cal_view_event_added_cb), NULL); /* listen for date changes of calendar */ gcal = e_calendar_view_get_calendar (cal_view); @@ -170,7 +179,7 @@ ea_cal_view_real_initialize (AtkObject *accessible, gpointer data) accessible); } -static AtkObject* +static AtkObject * ea_cal_view_get_parent (AtkObject *accessible) { ECalendarView *cal_view; @@ -188,7 +197,8 @@ ea_cal_view_get_parent (AtkObject *accessible) } static void -ea_cal_view_event_changed_cb (ECalendarView *cal_view, ECalendarViewEvent *event, +ea_cal_view_event_changed_cb (ECalendarView *cal_view, + ECalendarViewEvent *event, gpointer data) { AtkObject *atk_obj; @@ -225,7 +235,8 @@ ea_cal_view_event_changed_cb (ECalendarView *cal_view, ECalendarViewEvent *event } static void -ea_cal_view_event_added_cb (ECalendarView *cal_view, ECalendarViewEvent *event, +ea_cal_view_event_added_cb (ECalendarView *cal_view, + ECalendarViewEvent *event, gpointer data) { AtkObject *atk_obj; @@ -290,7 +301,8 @@ idle_dates_changed (gpointer data) } static void -ea_cal_view_dates_change_cb (GnomeCalendar *gcal, gpointer data) +ea_cal_view_dates_change_cb (GnomeCalendar *gcal, + gpointer data) { g_idle_add (idle_dates_changed, data); } @@ -320,7 +332,8 @@ atk_action_interface_init (AtkActionIface *iface) } static gboolean -action_interface_do_action (AtkAction *action, gint index) +action_interface_do_action (AtkAction *action, + gint index) { GtkWidget *widget; gboolean return_value = TRUE; @@ -381,13 +394,15 @@ action_interface_get_n_actions (AtkAction *action) } static const gchar * -action_interface_get_description (AtkAction *action, gint index) +action_interface_get_description (AtkAction *action, + gint index) { return action_interface_action_get_name (action, index); } static const gchar * -action_interface_get_keybinding (AtkAction *action, gint index) +action_interface_get_keybinding (AtkAction *action, + gint index) { GtkWidget *widget; @@ -424,7 +439,8 @@ action_interface_get_keybinding (AtkAction *action, gint index) } static const gchar * -action_interface_action_get_name (AtkAction *action, gint i) +action_interface_action_get_name (AtkAction *action, + gint i) { if (i >= 0 && i < CAL_VIEW_ACTION_NUM) return action_name[i]; diff --git a/calendar/gui/ea-cal-view.h b/calendar/gui/ea-cal-view.h index 959f7816b5..d0363025e0 100644 --- a/calendar/gui/ea-cal-view.h +++ b/calendar/gui/ea-cal-view.h @@ -51,7 +51,7 @@ struct _EaCalViewClass GtkAccessibleClass parent_class; }; -AtkObject* ea_cal_view_new (GtkWidget *widget); +AtkObject * ea_cal_view_new (GtkWidget *widget); G_END_DECLS diff --git a/calendar/gui/ea-calendar.c b/calendar/gui/ea-calendar.c index 423e2dfbd7..cbea6ded02 100644 --- a/calendar/gui/ea-calendar.c +++ b/calendar/gui/ea-calendar.c @@ -50,9 +50,9 @@ EA_FACTORY_GOBJECT ( EA_FACTORY (EA_TYPE_GNOME_CALENDAR, ea_gnome_calendar, ea_gnome_calendar_new) static gboolean ea_calendar_focus_watcher (GSignalInvocationHint *ihint, - guint n_param_values, - const GValue *param_values, - gpointer data); + guint n_param_values, + const GValue *param_values, + gpointer data); static gpointer e_text_type, pixbuf_type, e_day_view_type, e_week_view_type; static gpointer e_day_view_main_item_type, e_week_view_main_item_type; diff --git a/calendar/gui/ea-day-view-cell.c b/calendar/gui/ea-day-view-cell.c index a94a9d193f..4fe1c5bedb 100644 --- a/calendar/gui/ea-day-view-cell.c +++ b/calendar/gui/ea-day-view-cell.c @@ -69,7 +69,9 @@ e_day_view_cell_class_init (EDayViewCellClass *class) } EDayViewCell * -e_day_view_cell_new (EDayView *day_view, gint row, gint column) +e_day_view_cell_new (EDayView *day_view, + gint row, + gint column) { GObject *object; EDayViewCell *cell; @@ -95,7 +97,7 @@ static void ea_day_view_cell_class_init (EaDayViewCellClass *klass); static const gchar * ea_day_view_cell_get_name (AtkObject *accessible); static const gchar * ea_day_view_cell_get_description (AtkObject *accessible); -static AtkStateSet* ea_day_view_cell_ref_state_set (AtkObject *obj); +static AtkStateSet * ea_day_view_cell_ref_state_set (AtkObject *obj); static AtkObject * ea_day_view_cell_get_parent (AtkObject *accessible); static gint ea_day_view_cell_get_index_in_parent (AtkObject *accessible); @@ -168,7 +170,7 @@ ea_day_view_cell_class_init (EaDayViewCellClass *klass) class->get_index_in_parent = ea_day_view_cell_get_index_in_parent; } -AtkObject* +AtkObject * ea_day_view_cell_new (GObject *obj) { gpointer object; @@ -240,7 +242,7 @@ ea_day_view_cell_get_description (AtkObject *accessible) return ea_day_view_cell_get_name (accessible); } -static AtkStateSet* +static AtkStateSet * ea_day_view_cell_ref_state_set (AtkObject *obj) { AtkStateSet *state_set; @@ -326,8 +328,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *atk_obj; diff --git a/calendar/gui/ea-day-view-cell.h b/calendar/gui/ea-day-view-cell.h index 669fb1abae..2b2f6dddc5 100644 --- a/calendar/gui/ea-day-view-cell.h +++ b/calendar/gui/ea-day-view-cell.h @@ -78,7 +78,7 @@ struct _EaDayViewCellClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_day_view_cell_new (GObject *gobj); +AtkObject * ea_day_view_cell_new (GObject *gobj); G_END_DECLS diff --git a/calendar/gui/ea-day-view-main-item.c b/calendar/gui/ea-day-view-main-item.c index 1274cb7b72..1ced61b7ad 100644 --- a/calendar/gui/ea-day-view-main-item.c +++ b/calendar/gui/ea-day-view-main-item.c @@ -43,7 +43,7 @@ static const gchar * (AtkObject *accessible); static gint ea_day_view_main_item_get_n_children (AtkObject *obj); -static AtkObject* ea_day_view_main_item_ref_child (AtkObject *obj, +static AtkObject * ea_day_view_main_item_ref_child (AtkObject *obj, gint i); static AtkObject * ea_day_view_main_item_get_parent (AtkObject *accessible); static gint ea_day_view_main_item_get_index_in_parent (AtkObject *accessible); @@ -67,7 +67,7 @@ static gint table_interface_get_column_at_index (AtkTable *table, gint index); static gint table_interface_get_row_at_index (AtkTable *table, gint index); -static AtkObject* table_interface_ref_at (AtkTable *table, +static AtkObject * table_interface_ref_at (AtkTable *table, gint row, gint column); static gint table_interface_get_n_rows (AtkTable *table); @@ -97,25 +97,29 @@ static gboolean table_interface_add_column_selection (AtkTable *table, gint column); static gboolean table_interface_remove_column_selection (AtkTable *table, gint column); -static AtkObject* table_interface_get_row_header (AtkTable *table, gint row); -static AtkObject* table_interface_get_column_header (AtkTable *table, +static AtkObject * table_interface_get_row_header (AtkTable *table, gint row); +static AtkObject * table_interface_get_column_header (AtkTable *table, gint in_col); -static AtkObject* table_interface_get_caption (AtkTable *table); +static AtkObject * table_interface_get_caption (AtkTable *table); static const gchar * -table_interface_get_column_description (AtkTable *table, gint in_col); + table_interface_get_column_description + (AtkTable *table, + gint in_col); static const gchar * -table_interface_get_row_description (AtkTable *table, gint row); + table_interface_get_row_description + (AtkTable *table, + gint row); -static AtkObject* table_interface_get_summary (AtkTable *table); +static AtkObject * table_interface_get_summary (AtkTable *table); /* atk selection interface */ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, +static AtkObject * selection_interface_ref_selection (AtkSelection *selection, gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, @@ -130,17 +134,19 @@ ea_day_view_main_item_destory_cell_data (EaDayViewMainItem *ea_main_item); static gint ea_day_view_main_item_get_child_index_at (EaDayViewMainItem *ea_main_item, - gint row, gint column); + gint row, + gint column); static gint ea_day_view_main_item_get_row_at_index (EaDayViewMainItem *ea_main_item, - gint index); + gint index); static gint ea_day_view_main_item_get_column_at_index (EaDayViewMainItem *ea_main_item, - gint index); + gint index); static gint ea_day_view_main_item_get_row_label (EaDayViewMainItem *ea_main_item, - gint row, gchar *buffer, - gint buffer_size); + gint row, + gchar *buffer, + gint buffer_size); #ifdef ACC_DEBUG static gint n_ea_day_view_main_item_created = 0; @@ -233,7 +239,7 @@ ea_day_view_main_item_class_init (EaDayViewMainItemClass *klass) class->get_index_in_parent = ea_day_view_main_item_get_index_in_parent; } -AtkObject* +AtkObject * ea_day_view_main_item_new (GObject *obj) { AtkObject *accessible; @@ -334,7 +340,8 @@ ea_day_view_main_item_get_n_children (AtkObject *accessible) } static AtkObject * -ea_day_view_main_item_ref_child (AtkObject *accessible, gint index) +ea_day_view_main_item_ref_child (AtkObject *accessible, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -418,7 +425,8 @@ ea_day_view_main_item_get_index_in_parent (AtkObject *accessible) /* callbacks */ static void -ea_day_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data) +ea_day_view_main_item_dates_change_cb (GnomeCalendar *gcal, + gpointer data) { EaDayViewMainItem *ea_main_item; @@ -436,7 +444,8 @@ ea_day_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data) } static void -ea_day_view_main_item_time_change_cb (EDayView *day_view, gpointer data) +ea_day_view_main_item_time_change_cb (EDayView *day_view, + gpointer data) { EaDayViewMainItem *ea_main_item; AtkObject *item_cell = NULL; @@ -474,7 +483,8 @@ ea_day_view_main_item_time_change_cb (EDayView *day_view, gpointer data) static gint ea_day_view_main_item_get_child_index_at (EaDayViewMainItem *ea_main_item, - gint row, gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -499,7 +509,7 @@ ea_day_view_main_item_get_child_index_at (EaDayViewMainItem *ea_main_item, static gint ea_day_view_main_item_get_row_at_index (EaDayViewMainItem *ea_main_item, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -525,7 +535,7 @@ ea_day_view_main_item_get_row_at_index (EaDayViewMainItem *ea_main_item, static gint ea_day_view_main_item_get_column_at_index (EaDayViewMainItem *ea_main_item, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -551,7 +561,9 @@ ea_day_view_main_item_get_column_at_index (EaDayViewMainItem *ea_main_item, static gint ea_day_view_main_item_get_row_label (EaDayViewMainItem *ea_main_item, - gint row, gchar *buffer, gint buffer_size) + gint row, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -645,8 +657,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *ea_canvas; @@ -704,14 +719,14 @@ atk_table_interface_init (AtkTableIface *iface) iface->get_column_description = table_interface_get_column_description; } -static AtkObject* +static AtkObject * table_interface_ref_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { gint index; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); index = ea_day_view_main_item_get_child_index_at (ea_main_item, row, column); return ea_day_view_main_item_ref_child (ATK_OBJECT (ea_main_item), index); @@ -724,7 +739,7 @@ table_interface_get_n_rows (AtkTable *table) GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -744,7 +759,7 @@ table_interface_get_n_columns (AtkTable *table) GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -759,39 +774,39 @@ table_interface_get_n_columns (AtkTable *table) static gint table_interface_get_index_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); return ea_day_view_main_item_get_child_index_at (ea_main_item, row, column); } static gint table_interface_get_column_at_index (AtkTable *table, - gint index) + gint index) { - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); return ea_day_view_main_item_get_column_at_index (ea_main_item, index); } static gint table_interface_get_row_at_index (AtkTable *table, - gint index) + gint index) { - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); return ea_day_view_main_item_get_row_at_index (ea_main_item, index); } static gint -table_interface_get_column_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_column_extent_at (AtkTable *table, + gint row, + gint column) { gint index; gint width = 0, height = 0; AtkObject *child; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); index = ea_day_view_main_item_get_child_index_at (ea_main_item, row, column); @@ -805,14 +820,14 @@ table_interface_get_column_extent_at (AtkTable *table, } static gint -table_interface_get_row_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_row_extent_at (AtkTable *table, + gint row, + gint column) { gint index; gint width = 0, height = 0; AtkObject *child; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); index = ea_day_view_main_item_get_child_index_at (ea_main_item, row, column); @@ -827,13 +842,13 @@ table_interface_get_row_extent_at (AtkTable *table, static gboolean table_interface_is_row_selected (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -857,8 +872,8 @@ table_interface_is_row_selected (AtkTable *table, static gboolean table_interface_is_selected (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { return table_interface_is_row_selected (table, row) && table_interface_is_column_selected (table, column); @@ -866,13 +881,13 @@ table_interface_is_selected (AtkTable *table, static gboolean table_interface_is_column_selected (AtkTable *table, - gint column) + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -890,13 +905,13 @@ table_interface_is_column_selected (AtkTable *table, static gint table_interface_get_selected_rows (AtkTable *table, - gint **rows_selected) + gint **rows_selected) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); gint start_row = -1, n_rows = 0; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -931,13 +946,13 @@ table_interface_get_selected_rows (AtkTable *table, static gint table_interface_get_selected_columns (AtkTable *table, - gint **columns_selected) + gint **columns_selected) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); gint start_column = -1, n_columns = 0; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -965,13 +980,13 @@ table_interface_get_selected_columns (AtkTable *table, static gboolean table_interface_add_row_selection (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -998,20 +1013,20 @@ table_interface_add_row_selection (AtkTable *table, static gboolean table_interface_remove_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_add_column_selection (AtkTable *table, - gint column) + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1035,44 +1050,44 @@ table_interface_add_column_selection (AtkTable *table, static gboolean table_interface_remove_column_selection (AtkTable *table, - gint column) + gint column) { /* FIXME: NOT IMPLEMENTED */ return FALSE; } -static AtkObject* +static AtkObject * table_interface_get_row_header (AtkTable *table, - gint row) + gint row) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* +static AtkObject * table_interface_get_column_header (AtkTable *table, - gint in_col) + gint in_col) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* -table_interface_get_caption (AtkTable *table) +static AtkObject * +table_interface_get_caption (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; } static const gchar * -table_interface_get_column_description (AtkTable *table, - gint in_col) +table_interface_get_column_description (AtkTable *table, + gint in_col) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); const gchar *description; EaCellTable *cell_data; @@ -1101,12 +1116,12 @@ table_interface_get_column_description (AtkTable *table, } static const gchar * -table_interface_get_row_description (AtkTable *table, - gint row) +table_interface_get_row_description (AtkTable *table, + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); const gchar *description; EaCellTable *cell_data; @@ -1133,8 +1148,8 @@ table_interface_get_row_description (AtkTable *table, return description; } -static AtkObject* -table_interface_get_summary (AtkTable *table) +static AtkObject * +table_interface_get_summary (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; @@ -1155,13 +1170,14 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint i) +selection_interface_add_selection (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); gint column, row; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -1199,7 +1215,7 @@ selection_interface_clear_selection (AtkSelection *selection) GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1220,14 +1236,15 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { gint count; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); gint start_index; count = selection_interface_get_selection_count (selection); @@ -1253,7 +1270,7 @@ selection_interface_get_selection_count (AtkSelection *selection) GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); gint start_index, end_index; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -1278,13 +1295,14 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint i) +selection_interface_is_child_selected (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); gint column, row; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); diff --git a/calendar/gui/ea-day-view-main-item.h b/calendar/gui/ea-day-view-main-item.h index c782e6acc8..b3ef6a0160 100644 --- a/calendar/gui/ea-day-view-main-item.h +++ b/calendar/gui/ea-day-view-main-item.h @@ -51,7 +51,7 @@ struct _EaDayViewMainItemClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_day_view_main_item_new (GObject *obj); +AtkObject * ea_day_view_main_item_new (GObject *obj); G_END_DECLS diff --git a/calendar/gui/ea-day-view.c b/calendar/gui/ea-day-view.c index 72f3e5ba61..89e9c4b8a0 100644 --- a/calendar/gui/ea-day-view.c +++ b/calendar/gui/ea-day-view.c @@ -36,7 +36,7 @@ static void ea_day_view_class_init (EaDayViewClass *klass); static const gchar * ea_day_view_get_name (AtkObject *accessible); static const gchar * ea_day_view_get_description (AtkObject *accessible); static gint ea_day_view_get_n_children (AtkObject *obj); -static AtkObject* ea_day_view_ref_child (AtkObject *obj, +static AtkObject * ea_day_view_ref_child (AtkObject *obj, gint i); static gpointer parent_class = NULL; @@ -99,7 +99,7 @@ ea_day_view_class_init (EaDayViewClass *klass) class->ref_child = ea_day_view_ref_child; } -AtkObject* +AtkObject * ea_day_view_new (GtkWidget *widget) { GObject *object; @@ -233,7 +233,8 @@ ea_day_view_get_n_children (AtkObject *accessible) } static AtkObject * -ea_day_view_ref_child (AtkObject *accessible, gint index) +ea_day_view_ref_child (AtkObject *accessible, + gint index) { EDayView *day_view; gint child_num; diff --git a/calendar/gui/ea-day-view.h b/calendar/gui/ea-day-view.h index 33399f6600..3e6d6154ef 100644 --- a/calendar/gui/ea-day-view.h +++ b/calendar/gui/ea-day-view.h @@ -50,7 +50,7 @@ struct _EaDayViewClass EaCalViewClass parent_class; }; -AtkObject* ea_day_view_new (GtkWidget *widget); +AtkObject * ea_day_view_new (GtkWidget *widget); G_END_DECLS diff --git a/calendar/gui/ea-gnome-calendar.c b/calendar/gui/ea-gnome-calendar.c index 0983de84b9..e1826355b5 100644 --- a/calendar/gui/ea-gnome-calendar.c +++ b/calendar/gui/ea-gnome-calendar.c @@ -35,7 +35,7 @@ static void ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass); -static gint ea_gnome_calendar_get_n_children (AtkObject* obj); +static gint ea_gnome_calendar_get_n_children (AtkObject * obj); static AtkObject * ea_gnome_calendar_ref_child (AtkObject *obj, gint i); static void ea_gcal_dates_change_cb (GnomeCalendar *gcal, gpointer data); @@ -114,7 +114,7 @@ ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass) class->ref_child = ea_gnome_calendar_ref_child; } -AtkObject* +AtkObject * ea_gnome_calendar_new (GtkWidget *widget) { GObject *object; @@ -253,7 +253,7 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) } static gint -ea_gnome_calendar_get_n_children (AtkObject* obj) +ea_gnome_calendar_get_n_children (AtkObject *obj) { g_return_val_if_fail (EA_IS_GNOME_CALENDAR (obj), 0); @@ -264,7 +264,8 @@ ea_gnome_calendar_get_n_children (AtkObject* obj) } static AtkObject * -ea_gnome_calendar_ref_child (AtkObject *obj, gint i) +ea_gnome_calendar_ref_child (AtkObject *obj, + gint i) { AtkObject * child = NULL; GnomeCalendar * calendarWidget; @@ -309,7 +310,8 @@ ea_gnome_calendar_ref_child (AtkObject *obj, gint i) } static void -ea_gcal_dates_change_cb (GnomeCalendar *gcal, gpointer data) +ea_gcal_dates_change_cb (GnomeCalendar *gcal, + gpointer data) { const gchar *new_name; diff --git a/calendar/gui/ea-gnome-calendar.h b/calendar/gui/ea-gnome-calendar.h index db9acdb47e..953db4a2d5 100644 --- a/calendar/gui/ea-gnome-calendar.h +++ b/calendar/gui/ea-gnome-calendar.h @@ -50,7 +50,7 @@ struct _EaGnomeCalendarClass GtkAccessibleClass parent_class; }; -AtkObject* ea_gnome_calendar_new (GtkWidget *widget); +AtkObject * ea_gnome_calendar_new (GtkWidget *widget); const gchar * ea_gnome_calendar_get_label_description (GnomeCalendar *gcal); diff --git a/calendar/gui/ea-jump-button.c b/calendar/gui/ea-jump-button.c index e19b1037a0..34a7b32ad0 100644 --- a/calendar/gui/ea-jump-button.c +++ b/calendar/gui/ea-jump-button.c @@ -112,7 +112,7 @@ ea_jump_button_class_init (EaJumpButtonClass *klass) class->get_description = ea_jump_button_get_description; } -AtkObject* +AtkObject * ea_jump_button_new (GObject *obj) { AtkObject *atk_obj = NULL; @@ -171,7 +171,7 @@ atk_action_interface_init (AtkActionIface *iface) static gboolean jump_button_do_action (AtkAction *action, - gint i) + gint i) { gboolean return_value = TRUE; AtkGObjectAccessible *atk_gobj; @@ -209,7 +209,7 @@ jump_button_get_n_actions (AtkAction *action) static const gchar * jump_button_get_keybinding (AtkAction *action, - gint i) + gint i) { const gchar *return_value = NULL; diff --git a/calendar/gui/ea-week-view-cell.c b/calendar/gui/ea-week-view-cell.c index 506a5f5724..fce7a9def1 100644 --- a/calendar/gui/ea-week-view-cell.c +++ b/calendar/gui/ea-week-view-cell.c @@ -69,7 +69,9 @@ e_week_view_cell_class_init (EWeekViewCellClass *class) } EWeekViewCell * -e_week_view_cell_new (EWeekView *week_view, gint row, gint column) +e_week_view_cell_new (EWeekView *week_view, + gint row, + gint column) { GObject *object; EWeekViewCell *cell; @@ -95,7 +97,7 @@ static void ea_week_view_cell_class_init (EaWeekViewCellClass *klass); static const gchar * ea_week_view_cell_get_name (AtkObject *accessible); static const gchar * ea_week_view_cell_get_description (AtkObject *accessible); -static AtkStateSet* ea_week_view_cell_ref_state_set (AtkObject *obj); +static AtkStateSet * ea_week_view_cell_ref_state_set (AtkObject *obj); static AtkObject * ea_week_view_cell_get_parent (AtkObject *accessible); static gint ea_week_view_cell_get_index_in_parent (AtkObject *accessible); @@ -169,7 +171,7 @@ ea_week_view_cell_class_init (EaWeekViewCellClass *klass) } -AtkObject* +AtkObject * ea_week_view_cell_new (GObject *obj) { gpointer object; @@ -252,7 +254,7 @@ ea_week_view_cell_get_description (AtkObject *accessible) return ea_week_view_cell_get_name (accessible); } -static AtkStateSet* +static AtkStateSet * ea_week_view_cell_ref_state_set (AtkObject *obj) { AtkStateSet *state_set; @@ -336,8 +338,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *atk_obj; diff --git a/calendar/gui/ea-week-view-cell.h b/calendar/gui/ea-week-view-cell.h index 1524e9d3a8..afef4d1302 100644 --- a/calendar/gui/ea-week-view-cell.h +++ b/calendar/gui/ea-week-view-cell.h @@ -78,7 +78,7 @@ struct _EaWeekViewCellClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_week_view_cell_new (GObject *gobj); +AtkObject * ea_week_view_cell_new (GObject *gobj); G_END_DECLS diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c index cdeefa0138..f7a5a2a7fe 100644 --- a/calendar/gui/ea-week-view-main-item.c +++ b/calendar/gui/ea-week-view-main-item.c @@ -147,7 +147,7 @@ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, +static AtkObject * selection_interface_ref_selection (AtkSelection *selection, gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, @@ -268,7 +268,7 @@ ea_week_view_main_item_class_init (EaWeekViewMainItemClass *klass) class->get_index_in_parent = ea_week_view_main_item_get_index_in_parent; } -AtkObject* +AtkObject * ea_week_view_main_item_new (GObject *obj) { AtkObject *accessible; @@ -369,7 +369,8 @@ ea_week_view_main_item_get_n_children (AtkObject *accessible) } static AtkObject * -ea_week_view_main_item_ref_child (AtkObject *accessible, gint index) +ea_week_view_main_item_ref_child (AtkObject *accessible, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -453,7 +454,8 @@ ea_week_view_main_item_get_index_in_parent (AtkObject *accessible) /* callbacks */ static void -ea_week_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data) +ea_week_view_main_item_dates_change_cb (GnomeCalendar *gcal, + gpointer data) { EaWeekViewMainItem *ea_main_item; @@ -471,7 +473,8 @@ ea_week_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data) } static void -ea_week_view_main_item_time_change_cb (EWeekView *week_view, gpointer data) +ea_week_view_main_item_time_change_cb (EWeekView *week_view, + gpointer data) { EaWeekViewMainItem *ea_main_item; AtkObject *item_cell = NULL; @@ -507,7 +510,8 @@ ea_week_view_main_item_time_change_cb (EWeekView *week_view, gpointer data) static gint ea_week_view_main_item_get_child_index_at (EaWeekViewMainItem *ea_main_item, - gint row, gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -533,7 +537,7 @@ ea_week_view_main_item_get_child_index_at (EaWeekViewMainItem *ea_main_item, static gint ea_week_view_main_item_get_row_at_index (EaWeekViewMainItem *ea_main_item, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -554,7 +558,7 @@ ea_week_view_main_item_get_row_at_index (EaWeekViewMainItem *ea_main_item, static gint ea_week_view_main_item_get_column_at_index (EaWeekViewMainItem *ea_main_item, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -575,7 +579,9 @@ ea_week_view_main_item_get_column_at_index (EaWeekViewMainItem *ea_main_item, static gint ea_week_view_main_item_get_row_label (EaWeekViewMainItem *ea_main_item, - gint row, gchar *buffer, gint buffer_size) + gint row, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -649,8 +655,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *ea_canvas; @@ -708,14 +717,14 @@ atk_table_interface_init (AtkTableIface *iface) iface->get_column_description = table_interface_get_column_description; } -static AtkObject* +static AtkObject * table_interface_ref_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { gint index; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); index = ea_week_view_main_item_get_child_index_at (ea_main_item, row, column); return ea_week_view_main_item_ref_child (ATK_OBJECT (ea_main_item), index); @@ -728,7 +737,7 @@ table_interface_get_n_rows (AtkTable *table) GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -746,7 +755,7 @@ table_interface_get_n_columns (AtkTable *table) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -758,39 +767,39 @@ table_interface_get_n_columns (AtkTable *table) static gint table_interface_get_index_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); return ea_week_view_main_item_get_child_index_at (ea_main_item, row, column); } static gint table_interface_get_column_at_index (AtkTable *table, - gint index) + gint index) { - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); return ea_week_view_main_item_get_column_at_index (ea_main_item, index); } static gint table_interface_get_row_at_index (AtkTable *table, - gint index) + gint index) { - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); return ea_week_view_main_item_get_row_at_index (ea_main_item, index); } static gint -table_interface_get_column_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_column_extent_at (AtkTable *table, + gint row, + gint column) { gint index; gint width = 0, height = 0; AtkObject *child; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); index = ea_week_view_main_item_get_child_index_at (ea_main_item, row, column); @@ -804,14 +813,14 @@ table_interface_get_column_extent_at (AtkTable *table, } static gint -table_interface_get_row_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_row_extent_at (AtkTable *table, + gint row, + gint column) { gint index; gint width = 0, height = 0; AtkObject *child; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); index = ea_week_view_main_item_get_child_index_at (ea_main_item, row, column); @@ -826,13 +835,13 @@ table_interface_get_row_extent_at (AtkTable *table, static gboolean table_interface_is_row_selected (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -845,7 +854,7 @@ table_interface_is_row_selected (AtkTable *table, if (week_view->selection_start_day == -1) /* no selection */ return FALSE; - if ((row < 0)&&(row + 1 > week_view->weeks_shown )) + if ((row < 0) && (row + 1 > week_view->weeks_shown )) return FALSE; if (((week_view->selection_start_day < row * 7) && (week_view->selection_end_day < row * 7)) || @@ -858,8 +867,8 @@ table_interface_is_row_selected (AtkTable *table, static gboolean table_interface_is_selected (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { return table_interface_is_row_selected (table, row) && table_interface_is_column_selected (table, column); @@ -867,13 +876,13 @@ table_interface_is_selected (AtkTable *table, static gboolean table_interface_is_column_selected (AtkTable *table, - gint column) + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -883,13 +892,13 @@ table_interface_is_column_selected (AtkTable *table, main_item = E_WEEK_VIEW_MAIN_ITEM (g_obj); week_view = e_week_view_main_item_get_week_view (main_item); - if ((column <0)||(column >6)) + if ((column <0) || (column >6)) return FALSE; else { gint i; - for (i=0;i<week_view->weeks_shown;i++) - if ((column + i*7>= week_view->selection_start_day ) && - (column + i*7<= week_view->selection_end_day)) + for (i = 0; i < week_view->weeks_shown; i++) + if ((column + i *7>= week_view->selection_start_day ) && + (column + i *7<= week_view->selection_end_day)) return TRUE; return FALSE; } @@ -897,13 +906,13 @@ table_interface_is_column_selected (AtkTable *table, static gint table_interface_get_selected_rows (AtkTable *table, - gint **rows_selected) + gint **rows_selected) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); gint start_row = -1, n_rows = 0; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -932,13 +941,13 @@ table_interface_get_selected_rows (AtkTable *table, static gint table_interface_get_selected_columns (AtkTable *table, - gint **columns_selected) + gint **columns_selected) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); gint start_column = -1, n_columns = 0; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -970,13 +979,13 @@ table_interface_get_selected_columns (AtkTable *table, static gboolean table_interface_add_row_selection (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -997,20 +1006,20 @@ table_interface_add_row_selection (AtkTable *table, static gboolean table_interface_remove_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_add_column_selection (AtkTable *table, - gint column) + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1023,7 +1032,7 @@ table_interface_add_column_selection (AtkTable *table, /* FIXME: we need multi-selection */ week_view->selection_start_day = column; - week_view->selection_end_day = (week_view->weeks_shown - 1)*7+column; + week_view->selection_end_day = (week_view->weeks_shown - 1) * 7 + column; gtk_widget_queue_draw (week_view->main_canvas); return TRUE; @@ -1031,42 +1040,42 @@ table_interface_add_column_selection (AtkTable *table, static gboolean table_interface_remove_column_selection (AtkTable *table, - gint column) + gint column) { /* FIXME: NOT IMPLEMENTED */ return FALSE; } -static AtkObject* +static AtkObject * table_interface_get_row_header (AtkTable *table, - gint row) + gint row) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* +static AtkObject * table_interface_get_column_header (AtkTable *table, - gint in_col) + gint in_col) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* -table_interface_get_caption (AtkTable *table) +static AtkObject * +table_interface_get_caption (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; } static const gchar * -table_interface_get_column_description (AtkTable *table, - gint in_col) +table_interface_get_column_description (AtkTable *table, + gint in_col) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); const gchar *description; EaCellTable *cell_data; @@ -1118,14 +1127,14 @@ table_interface_get_column_description (AtkTable *table, } static const gchar * -table_interface_get_row_description (AtkTable *table, - gint row) +table_interface_get_row_description (AtkTable *table, + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); const gchar *description; EaCellTable *cell_data; @@ -1155,8 +1164,8 @@ table_interface_get_row_description (AtkTable *table, return description; } -static AtkObject* -table_interface_get_summary (AtkTable *table) +static AtkObject * +table_interface_get_summary (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; @@ -1177,13 +1186,14 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint i) +selection_interface_add_selection (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1211,7 +1221,7 @@ selection_interface_clear_selection (AtkSelection *selection) GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1229,14 +1239,15 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { gint count; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); gint start_index; count = selection_interface_get_selection_count (selection); @@ -1262,7 +1273,7 @@ selection_interface_get_selection_count (AtkSelection *selection) GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1280,13 +1291,14 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint i) +selection_interface_is_child_selected (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1296,7 +1308,7 @@ selection_interface_is_child_selected (AtkSelection *selection, gint i) main_item = E_WEEK_VIEW_MAIN_ITEM (g_obj); week_view = e_week_view_main_item_get_week_view (main_item); - if ((week_view->selection_start_day <= i)&&(week_view->selection_end_day >= i)) + if ((week_view->selection_start_day <= i) && (week_view->selection_end_day >= i)) return TRUE; else return FALSE; diff --git a/calendar/gui/ea-week-view-main-item.h b/calendar/gui/ea-week-view-main-item.h index d9110160c4..f8598c9a1f 100644 --- a/calendar/gui/ea-week-view-main-item.h +++ b/calendar/gui/ea-week-view-main-item.h @@ -52,7 +52,7 @@ struct _EaWeekViewMainItemClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_week_view_main_item_new (GObject *obj); +AtkObject * ea_week_view_main_item_new (GObject *obj); G_END_DECLS diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c index c431f2ce14..15fe1cb09f 100644 --- a/calendar/gui/ea-week-view.c +++ b/calendar/gui/ea-week-view.c @@ -36,7 +36,7 @@ static void ea_week_view_class_init (EaWeekViewClass *klass); static const gchar * ea_week_view_get_name (AtkObject *accessible); static const gchar * ea_week_view_get_description (AtkObject *accessible); static gint ea_week_view_get_n_children (AtkObject *obj); -static AtkObject* ea_week_view_ref_child (AtkObject *obj, +static AtkObject * ea_week_view_ref_child (AtkObject *obj, gint i); static gpointer parent_class = NULL; @@ -101,7 +101,7 @@ ea_week_view_class_init (EaWeekViewClass *klass) class->ref_child = ea_week_view_ref_child; } -AtkObject* +AtkObject * ea_week_view_new (GtkWidget *widget) { GObject *object; @@ -256,7 +256,8 @@ ea_week_view_get_n_children (AtkObject *accessible) } static AtkObject * -ea_week_view_ref_child (AtkObject *accessible, gint index) +ea_week_view_ref_child (AtkObject *accessible, + gint index) { EWeekView *week_view; gint child_num, max_count; diff --git a/calendar/gui/ea-week-view.h b/calendar/gui/ea-week-view.h index 09409ec4cf..d6184f08c4 100644 --- a/calendar/gui/ea-week-view.h +++ b/calendar/gui/ea-week-view.h @@ -51,7 +51,7 @@ struct _EaWeekViewClass EaCalViewClass parent_class; }; -AtkObject* ea_week_view_new (GtkWidget *widget); +AtkObject * ea_week_view_new (GtkWidget *widget); G_END_DECLS diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index aca2d05068..cf1a12deab 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -99,8 +99,8 @@ struct _GnomeCalendarPrivate { guint update_marcus_bains_line_timeout; /* This is the view currently shown. We use it to keep track of the - positions of the panes. range_selected is TRUE if a range of dates - was selected in the date navigator to show the view. */ + * positions of the panes. range_selected is TRUE if a range of dates + * was selected in the date navigator to show the view. */ ECalendarView *views[GNOME_CAL_LAST_VIEW]; GnomeCalendarViewType current_view_type; GList *notifications; @@ -108,8 +108,8 @@ struct _GnomeCalendarPrivate { gboolean range_selected; /* These are the saved positions of the panes. They are multiples of - calendar month widths & heights in the date navigator, so that they - will work OK after theme changes. */ + * calendar month widths & heights in the date navigator, so that they + * will work OK after theme changes. */ gint hpane_pos; gint hpane_pos_month_view; @@ -117,8 +117,8 @@ struct _GnomeCalendarPrivate { guint day_selected_id; /* The dates currently shown. If they are -1 then we have no dates - shown. We only use these to check if we need to emit a - 'dates-shown-changed' signal.*/ + * shown. We only use these to check if we need to emit a + * 'dates-shown-changed' signal.*/ time_t visible_start; time_t visible_end; gboolean updating; @@ -204,7 +204,9 @@ message_push (Message *msg) G_DEFINE_TYPE (GnomeCalendar, gnome_calendar, G_TYPE_OBJECT) static void -gcal_update_status_message (GnomeCalendar *gcal, const gchar *message, gdouble percent) +gcal_update_status_message (GnomeCalendar *gcal, + const gchar *message, + gdouble percent) { ECalModel *model; @@ -301,9 +303,9 @@ view_progress_cb (ECalModel *model, static void view_complete_cb (ECalModel *model, - const GError *error, - ECalClientSourceType type, - GnomeCalendar *gcal) + const GError *error, + ECalClientSourceType type, + GnomeCalendar *gcal) { gcal_update_status_message (gcal, NULL, -1); } @@ -878,7 +880,7 @@ get_times_for_views (GnomeCalendar *gcal, time_to_gdate_with_zone (&date, *start_time, timezone); /* The start of the work-week is the first working day after the - week start day. */ + * week start day. */ /* Get the weekday corresponding to start_time, 0 (Sun) to 6 (Sat). */ weekday = g_date_get_weekday (&date) % 7; @@ -902,7 +904,7 @@ get_times_for_views (GnomeCalendar *gcal, last_day = (last_day + 6) % 7; } /* Now calculate the days we need to show to include all the - working days in the week. Add 1 to make it inclusive. */ + * working days in the week. Add 1 to make it inclusive. */ days_shown = (last_day + 7 - first_day) % 7 + 1; } else { /* If no working days are set, just use 7. */ @@ -974,7 +976,9 @@ get_times_for_views (GnomeCalendar *gcal, /* Computes the range of time that the date navigator is showing */ static void -get_date_navigator_range (GnomeCalendar *gcal, time_t *start_time, time_t *end_time) +get_date_navigator_range (GnomeCalendar *gcal, + time_t *start_time, + time_t *end_time) { ECalModel *model; gint start_year, start_month, start_day; @@ -1014,7 +1018,8 @@ get_date_navigator_range (GnomeCalendar *gcal, time_t *start_time, time_t *end_t /* Adjusts a given query sexp with the time range of the date navigator */ static gchar * -adjust_client_view_sexp (GnomeCalendar *gcal, const gchar *sexp) +adjust_client_view_sexp (GnomeCalendar *gcal, + const gchar *sexp) { time_t start_time, end_time; gchar *start, *end; @@ -1550,7 +1555,7 @@ notify_selected_time_changed (GnomeCalendar *gcal) static void gnome_calendar_goto_date (GnomeCalendar *gcal, - GnomeCalendarGotoDateType goto_date) + GnomeCalendarGotoDateType goto_date) { ECalModel *model; time_t new_time = 0; @@ -1566,7 +1571,7 @@ gnome_calendar_goto_date (GnomeCalendar *gcal, switch (goto_date) { /* GNOME_CAL_GOTO_TODAY and GNOME_CAL_GOTO_DATE are - currently not used + * currently not used */ case GNOME_CAL_GOTO_TODAY: break; @@ -1625,7 +1630,8 @@ gnome_calendar_goto_date (GnomeCalendar *gcal, } void -gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time) +gnome_calendar_goto (GnomeCalendar *gcal, + time_t new_time) { GnomeCalendarPrivate *priv; gint i; @@ -1676,7 +1682,8 @@ gnome_calendar_update_view_times (GnomeCalendar *gcal, } static void -gnome_calendar_direction (GnomeCalendar *gcal, gint direction) +gnome_calendar_direction (GnomeCalendar *gcal, + gint direction) { ECalModel *model; icaltimezone *timezone; @@ -1724,7 +1731,8 @@ gnome_calendar_previous (GnomeCalendar *gcal) } void -gnome_calendar_dayjump (GnomeCalendar *gcal, time_t time) +gnome_calendar_dayjump (GnomeCalendar *gcal, + time_t time) { ECalModel *model; icaltimezone *timezone; @@ -1866,16 +1874,18 @@ gnome_calendar_display_view (GnomeCalendar *gcal, gnome_calendar_set_range_selected (gcal, range_selected); /* For the week & month views we want the selection in the date - navigator to be rounded to the nearest week when the arrow buttons - are pressed to move to the previous/next month. */ + * navigator to be rounded to the nearest week when the arrow buttons + * are pressed to move to the previous/next month. */ g_object_set ( gcal->priv->date_navigator->calitem, "preserve_day_when_moving", preserve_day, NULL); /* keep week days selected as before for a work week view */ - g_object_set (G_OBJECT (gcal->priv->date_navigator->calitem), - "keep_wdays_on_weeknum_click", view_type == GNOME_CAL_WORK_WEEK_VIEW, - NULL); + g_object_set ( + gcal->priv->date_navigator->calitem, + "keep_wdays_on_weeknum_click", + view_type == GNOME_CAL_WORK_WEEK_VIEW, + NULL); if (!gcal->priv->base_view_time) start_time = time (NULL); @@ -1931,7 +1941,8 @@ gnome_calendar_get_memo_table (GnomeCalendar *gcal) } void -gnome_calendar_set_memo_table (GnomeCalendar *gcal, GtkWidget *memo_table) +gnome_calendar_set_memo_table (GnomeCalendar *gcal, + GtkWidget *memo_table) { g_return_if_fail (GNOME_IS_CALENDAR (gcal)); @@ -1957,7 +1968,8 @@ gnome_calendar_get_task_table (GnomeCalendar *gcal) } void -gnome_calendar_set_task_table (GnomeCalendar *gcal, GtkWidget *task_table) +gnome_calendar_set_task_table (GnomeCalendar *gcal, + GtkWidget *task_table) { g_return_if_fail (GNOME_IS_CALENDAR (gcal)); @@ -2009,7 +2021,7 @@ gnome_calendar_set_range_selected (GnomeCalendar *gcal, void gnome_calendar_set_selected_time_range (GnomeCalendar *gcal, - time_t start_time) + time_t start_time) { gnome_calendar_update_view_times (gcal, start_time); gnome_calendar_update_date_navigator (gcal); @@ -2026,7 +2038,9 @@ gnome_calendar_set_selected_time_range (GnomeCalendar *gcal, **/ #if 0 /* KILL-BONOBO */ void -gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) +gnome_calendar_new_task (GnomeCalendar *gcal, + time_t *dtstart, + time_t *dtend) { GnomeCalendarPrivate *priv; ECal *ecal; @@ -2080,12 +2094,12 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) #endif /* Returns the selected time range for the current view. Note that this may be - different from the fields in the GnomeCalendar, since the view may clip - this or choose a more appropriate time. */ + * different from the fields in the GnomeCalendar, since the view may clip + * this or choose a more appropriate time. */ void gnome_calendar_get_current_time_range (GnomeCalendar *gcal, - time_t *start_time, - time_t *end_time) + time_t *start_time, + time_t *end_time) { GnomeCalendarViewType view_type; ECalendarView *view; @@ -2097,7 +2111,7 @@ gnome_calendar_get_current_time_range (GnomeCalendar *gcal, } /* This updates the month shown and the days selected in the calendar, if - necessary. */ + * necessary. */ static void gnome_calendar_update_date_navigator (GnomeCalendar *gcal) { @@ -2165,8 +2179,8 @@ gnome_calendar_notify_dates_shown_changed (GnomeCalendar *gcal) return; /* We check if the visible date range has changed, and only emit the - signal if it has. (This makes sure we only change the folder title - bar label in the shell when we need to.) */ + * signal if it has. (This makes sure we only change the folder title + * bar label in the shell when we need to.) */ if (priv->visible_start != start_time || priv->visible_end != end_time) { priv->visible_start = start_time; @@ -2206,9 +2220,9 @@ struct purge_data { static gboolean check_instance_cb (ECalComponent *comp, - time_t instance_start, - time_t instance_end, - gpointer data) + time_t instance_start, + time_t instance_end, + gpointer data) { struct purge_data *pd = data; @@ -2219,7 +2233,8 @@ check_instance_cb (ECalComponent *comp, } void -gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) +gnome_calendar_purge (GnomeCalendar *gcal, + time_t older_than) { gchar *sexp, *start, *end; GList *clients, *l; diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index 58130399f4..bc65fe2316 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -166,8 +166,8 @@ void gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtend); /* Returns the selected time range for the current view. Note that this may be - different from the fields in the GnomeCalendar, since the view may clip - this or choose a more appropriate time. */ + * different from the fields in the GnomeCalendar, since the view may clip + * this or choose a more appropriate time. */ void gnome_calendar_get_current_time_range (GnomeCalendar *gcal, time_t *start_time, diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 19f01614c6..c2fa19ba68 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -397,7 +397,8 @@ typedef struct { } ItipUtilTZData; static void -foreach_tzid_callback (icalparameter *param, gpointer data) +foreach_tzid_callback (icalparameter *param, + gpointer data) { ItipUtilTZData *tz_data = data; const gchar *tzid; @@ -1057,7 +1058,8 @@ comp_limit_attendees (ECalComponent *comp) } static void -comp_sentby (ECalComponent *comp, ECalClient *cal_client) +comp_sentby (ECalComponent *comp, + ECalClient *cal_client) { ECalComponentOrganizer organizer; GSList * attendees, *l; @@ -1109,7 +1111,8 @@ comp_sentby (ECalComponent *comp, ECalClient *cal_client) } } static ECalComponent * -comp_minimal (ECalComponent *comp, gboolean attendee) +comp_minimal (ECalComponent *comp, + gboolean attendee) { ECalComponent *clone; icalcomponent *icomp, *icomp_clone; @@ -1827,15 +1830,16 @@ itip_publish_begin (ECalComponent *pub_comp, } static void -fb_sort (struct icalperiodtype *ipt, gint fb_count) +fb_sort (struct icalperiodtype *ipt, + gint fb_count) { gint i,j; if (ipt == NULL || fb_count == 0) return; - for (i = 0; i < fb_count-1; i++) { - for (j = i+1; j < fb_count; j++) { + for (i = 0; i < fb_count - 1; i++) { + for (j = i + 1; j < fb_count; j++) { struct icalperiodtype temp; if (icaltime_compare (ipt[i].start, ipt[j].start) < 0) @@ -1880,7 +1884,7 @@ comp_fb_normalize (icalcomponent *icomp) fb_count = icalcomponent_count_properties (icomp, ICAL_FREEBUSY_PROPERTY); - ipt = g_new0 (struct icalperiodtype, fb_count+1); + ipt = g_new0 (struct icalperiodtype, fb_count + 1); for (prop = icalcomponent_get_first_property (icomp, ICAL_FREEBUSY_PROPERTY); @@ -1894,7 +1898,7 @@ comp_fb_normalize (icalcomponent *icomp) fb_sort (ipt, fb_count); - for (j = 0; j <= fb_count-1; j++) { + for (j = 0; j <= fb_count - 1; j++) { icalparameter *param; prop = icalproperty_new_freebusy (ipt[j]); diff --git a/calendar/gui/misc.c b/calendar/gui/misc.c index 29de491df8..f3bacef89b 100644 --- a/calendar/gui/misc.c +++ b/calendar/gui/misc.c @@ -86,7 +86,8 @@ get_uri_without_password (const gchar *full_uri) } gint -get_position_in_array (GPtrArray *objects, gpointer item) +get_position_in_array (GPtrArray *objects, + gpointer item) { gint i; @@ -99,7 +100,8 @@ get_position_in_array (GPtrArray *objects, gpointer item) } gchar * -calculate_time (time_t start, time_t end) +calculate_time (time_t start, + time_t end) { time_t difference = end - start; gchar *str; diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 2c17b05c86..6d37168fc1 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -68,10 +68,10 @@ struct PrintCalItem { time_t start; }; -static double +static gdouble evo_calendar_print_renderer_get_width (GtkPrintContext *context, - PangoFontDescription *font, - const gchar *text) + PangoFontDescription *font, + const gchar *text) { PangoLayout *layout; gint layout_width, layout_height; @@ -90,8 +90,8 @@ evo_calendar_print_renderer_get_width (GtkPrintContext *context, static gdouble evo_calendar_print_renderer_get_height (GtkPrintContext *context, - PangoFontDescription *font, - const gchar *text) + PangoFontDescription *font, + const gchar *text) { PangoLayout *layout; gint layout_width, layout_height; @@ -108,7 +108,7 @@ evo_calendar_print_renderer_get_height (GtkPrintContext *context, return pango_units_to_double (layout_height); } -static double +static gdouble get_font_size (PangoFontDescription *font) { g_return_val_if_fail (font, 0.0); @@ -139,17 +139,17 @@ get_font_size (PangoFontDescription *font) #define MONTH_NORMAL_FONT_SIZE 8 /* The height of the header bar across the top of the Day, Week & Month views, - which contains the dates shown and the 2 small calendar months. */ + * which contains the dates shown and the 2 small calendar months. */ #define HEADER_HEIGHT 80 /* The width of the small calendar months, the space from the right edge of - the header rectangle, and the space between the months. */ + * the header rectangle, and the space between the months. */ #define MIN_SMALL_MONTH_WIDTH 100 #define SMALL_MONTH_PAD 5 #define SMALL_MONTH_SPACING 20 /* The minimum number of rows we leave space for for the long events in the - day view. */ + * day view. */ #define DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY 2 /* The row height for long events in the day view. */ @@ -170,7 +170,7 @@ get_font_size (PangoFontDescription *font) #define EPSILON 0.01 /* The weird month of September 1752, where 3 Sep through 13 Sep were - eliminated due to the Gregorian reformation. */ + * eliminated due to the Gregorian reformation. */ static const gint sept_1752[42] = { 0, 0, 1, 2, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -222,7 +222,7 @@ struct psinfo }; /* Convenience function to help the transition to timezone functions. - It converts a time_t to a struct tm. */ + * It converts a time_t to a struct tm. */ static void convert_timet_to_struct_tm (time_t time, icaltimezone *zone, @@ -282,7 +282,7 @@ build_month (ECalModel *model, d_week = time_day_of_week (1, month, year); /* Get the configuration setting specifying which weekday we put on - the left column, 0=Sun to 6=Sat. */ + * the left column, 0=Sun to 6=Sat. */ week_start_day = e_cal_model_get_week_start_day (model); /* Figure out which square we want to put the 1 in. */ @@ -299,7 +299,8 @@ build_month (ECalModel *model, } static PangoFontDescription * -get_font_for_size (double height, PangoWeight weight) +get_font_for_size (gdouble height, + PangoWeight weight) { PangoFontDescription *desc; gint size; @@ -316,19 +317,23 @@ get_font_for_size (double height, PangoWeight weight) } /* Prints a rectangle, with or without a border, filled or outline, and - possibly with triangular arrows at one or both horizontal edges. - width = width of border, -ve means no border. - red,green,blue = bgcolor to fill, -ve means no fill. - left_triangle_width, right_triangle_width = width from edge of rectangle to - point of triangle, or -ve for no triangle. */ + * possibly with triangular arrows at one or both horizontal edges. + * width = width of border, -ve means no border. + * red,green,blue = bgcolor to fill, -ve means no fill. + * left_triangle_width, right_triangle_width = width from edge of rectangle to + * point of triangle, or -ve for no triangle. */ static void print_border_with_triangles (GtkPrintContext *pc, - gdouble x1, gdouble x2, - gdouble y1, gdouble y2, - gdouble line_width, - gdouble red, gdouble green, gdouble blue, - gdouble left_triangle_width, - gdouble right_triangle_width) + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2, + gdouble line_width, + gdouble red, + gdouble green, + gdouble blue, + gdouble left_triangle_width, + gdouble right_triangle_width) { cairo_t *cr = gtk_print_context_get_cairo_context (pc); @@ -385,14 +390,18 @@ print_border_with_triangles (GtkPrintContext *pc, } /* Prints a rectangle, with or without a border, and filled or outline. - width = width of border, -ve means no border. - fillcolor = shade of fill, -ve means no fill. */ + * width = width of border, -ve means no border. + * fillcolor = shade of fill, -ve means no fill. */ static void print_border_rgb (GtkPrintContext *pc, - gdouble x1, gdouble x2, - gdouble y1, gdouble y2, - gdouble line_width, - gdouble red, gdouble green, gdouble blue) + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2, + gdouble line_width, + gdouble red, + gdouble green, + gdouble blue) { print_border_with_triangles ( pc, x1, x2, y1, y2, line_width, @@ -401,10 +410,12 @@ print_border_rgb (GtkPrintContext *pc, static void print_border (GtkPrintContext *pc, - gdouble x1, gdouble x2, - gdouble y1, gdouble y2, - gdouble line_width, - gdouble fillcolor) + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2, + gdouble line_width, + gdouble fillcolor) { print_border_rgb ( pc, x1, x2, y1, y2, line_width, @@ -413,9 +424,13 @@ print_border (GtkPrintContext *pc, static void print_rectangle (GtkPrintContext *context, - gdouble x, gdouble y, - gdouble width, gdouble height, - gdouble red, gdouble green, gdouble blue) + gdouble x, + gdouble y, + gdouble width, + gdouble height, + gdouble red, + gdouble green, + gdouble blue) { cairo_t *cr = gtk_print_context_get_cairo_context (context); @@ -429,12 +444,17 @@ print_rectangle (GtkPrintContext *context, } /* Prints 1 line of aligned text in a box. It is centered vertically, and - the horizontal alignment can be either PANGO_ALIGN_LEFT, PANGO_ALIGN_RIGHT, - or PANGO_ALIGN_CENTER. */ -static double -print_text (GtkPrintContext *context, PangoFontDescription *desc, - const gchar *text, PangoAlignment alignment, - gdouble x1, gdouble x2, gdouble y1, gdouble y2) + * the horizontal alignment can be either PANGO_ALIGN_LEFT, PANGO_ALIGN_RIGHT, + * or PANGO_ALIGN_CENTER. */ +static gdouble +print_text (GtkPrintContext *context, + PangoFontDescription *desc, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { PangoLayout *layout; gint layout_width, layout_height; @@ -475,10 +495,14 @@ print_text (GtkPrintContext *context, PangoFontDescription *desc, } /* gets/frees the font for you, as a normal font */ -static double -print_text_size (GtkPrintContext *context, const gchar *text, - PangoAlignment alignment, gdouble x1, gdouble x2, - gdouble y1, gdouble y2) +static gdouble +print_text_size (GtkPrintContext *context, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { PangoFontDescription *font; gdouble w; @@ -491,10 +515,14 @@ print_text_size (GtkPrintContext *context, const gchar *text, } /* gets/frees the font for you, as a bold font */ -static double -print_text_size_bold (GtkPrintContext *context, const gchar *text, - PangoAlignment alignment, gdouble x1, gdouble x2, - gdouble y1, gdouble y2) +static gdouble +print_text_size_bold (GtkPrintContext *context, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { PangoFontDescription *font; gdouble w; @@ -507,10 +535,15 @@ print_text_size_bold (GtkPrintContext *context, const gchar *text, } static void -titled_box (GtkPrintContext *context, const gchar *text, - PangoFontDescription *font, PangoAlignment alignment, - gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2, - gdouble linewidth) +titled_box (GtkPrintContext *context, + const gchar *text, + PangoFontDescription *font, + PangoAlignment alignment, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2, + gdouble linewidth) { gdouble size; @@ -572,17 +605,17 @@ format_date (struct tm *tm, if (flags & DATE_DAY) { if (flags & DATE_DAYNAME) strcat(fmt, " "); - strcat (fmt, gettext (days[tm->tm_mday-1])); + strcat (fmt, gettext (days[tm->tm_mday - 1])); } if (flags & DATE_MONTH) { - if (flags & (DATE_DAY|DATE_DAYNAME)) + if (flags & (DATE_DAY | DATE_DAYNAME)) strcat(fmt, " "); strcat(fmt, "%B"); - if ((flags & (DATE_DAY|DATE_YEAR)) == (DATE_DAY|DATE_YEAR)) + if ((flags & (DATE_DAY | DATE_YEAR)) == (DATE_DAY | DATE_YEAR)) strcat(fmt, ","); } if (flags & DATE_YEAR) { - if (flags & (DATE_DAY|DATE_DAYNAME|DATE_MONTH)) + if (flags & (DATE_DAY | DATE_DAYNAME | DATE_MONTH)) strcat(fmt, " "); strcat(fmt, "%Y"); } @@ -612,7 +645,8 @@ const gchar *daynames[] = N_("Th"), N_("Fr"), N_("Sa") }; static gdouble -calc_small_month_width (GtkPrintContext *context, gdouble for_height) +calc_small_month_width (GtkPrintContext *context, + gdouble for_height) { PangoFontDescription *font_bold; @@ -643,10 +677,17 @@ calc_small_month_width (GtkPrintContext *context, gdouble for_height) print out the month small, embolden any days with events. */ static void -print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, - gdouble x1, gdouble y1, gdouble x2, gdouble y2, - gint titleflags, time_t greystart, time_t greyend, - gint bordertitle) +print_month_small (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t month, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gint titleflags, + time_t greystart, + time_t greyend, + gint bordertitle) { icaltimezone *zone; PangoFontDescription *font, *font_bold, *font_normal; @@ -685,11 +726,11 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, col_width = (x2 - x1) / (7 + (week_numbers ? 1 : 0)); /* The top row with the day abbreviations gets an extra bit of - vertical space around it. */ + * vertical space around it. */ row_height = ABS (y2 - y1) / 7.4; /* First we need to calculate a reasonable font size. We start with a - rough guess of just under the height of each row. */ + * rough guess of just under the height of each row. */ font_size = row_height; /* get month days */ @@ -700,8 +741,8 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, font_bold = get_font_for_size (font_size, PANGO_WEIGHT_BOLD); /* Get a reasonable estimate of the largest number we will need, - and use it to calculate the offset from the right edge of the - cell that we should put the numbers. */ + * and use it to calculate the offset from the right edge of the + * cell that we should put the numbers. */ w = evo_calendar_print_renderer_get_width (context, font_bold, "23"); text_xpad = (col_width - w) / 2; @@ -732,9 +773,9 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, if (week_numbers) { cell_left = x1; /* We add a 0.05 to make sure the cells meet up with - each other. Otherwise you sometimes get lines - between them which looks bad. Maybe I'm not using - coords in the way gnome-print expects. */ + * each other. Otherwise you sometimes get lines + * between them which looks bad. Maybe I'm not using + * coords in the way gnome-print expects. */ cell_right = cell_left + col_width + 0.05; text_right = cell_right - text_xpad; @@ -774,9 +815,9 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, cell_left = x1 + (x + (week_numbers ? 1 : 0)) * col_width; /* We add a 0.05 to make sure the cells meet up with - each other. Otherwise you sometimes get lines - between them which looks bad. Maybe I'm not using - coords in the way gnome-print expects. */ + * each other. Otherwise you sometimes get lines + * between them which looks bad. Maybe I'm not using + * coords in the way gnome-print expects. */ cell_right = cell_left + col_width + 0.05; text_right = cell_right - text_xpad; @@ -813,13 +854,18 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, } /* wraps text into the print context, not taking up more than its allowed space */ -static double +static gdouble bound_text (GtkPrintContext *context, PangoFontDescription *font, - const gchar *text, gint len, - gdouble x1, gdouble y1, - gdouble x2, gdouble y2, - gboolean can_wrap, gdouble *last_page_start, gint *pages) + const gchar *text, + gint len, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gboolean can_wrap, + gdouble *last_page_start, + gint *pages) { PangoLayout *layout; gint layout_width, layout_height; @@ -871,9 +917,14 @@ bound_text (GtkPrintContext *context, /* Draw the borders, lines, and times down the left of the day view. */ static void -print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, - time_t whence, struct pdinfo *pdi, - double left, double right, double top, double bottom) +print_day_background (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + struct pdinfo *pdi, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { ECalModel *model; PangoFontDescription *font_hour, *font_minute; @@ -969,7 +1020,7 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, cairo_stroke (cr); /* Draw the horizontal line for the 1/2-hours, across the - entire width except for part of the time column. */ + * entire width except for part of the time column. */ cairo_move_to (cr, left + width * 0.6, y - yinc / 2); cairo_line_to (cr, right, y - yinc / 2); cairo_set_line_width (cr, 1); @@ -984,13 +1035,13 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, /* This adds one event to the view, adding it to the appropriate array. */ static gint print_day_add_event (ECalModelComponent *comp_data, - time_t start, - time_t end, - icaltimezone *zone, - gint days_shown, - time_t *day_starts, - GArray *long_events, - GArray **events) + time_t start, + time_t end, + icaltimezone *zone, + gint days_shown, + time_t *day_starts, + GArray *long_events, + GArray **events) { EDayViewEvent event; @@ -1018,7 +1069,7 @@ print_day_add_event (ECalModelComponent *comp_data, event.canvas_item = NULL; /* Calculate the start & end minute, relative to the top of the - display. */ + * display. */ /*offset = day_view->first_hour_shown * 60 + day_view->first_minute_shown;*/ offset = 0; @@ -1033,12 +1084,12 @@ print_day_add_event (ECalModelComponent *comp_data, if (start >= day_starts[day] && end <= day_starts[day + 1]) { /* Special case for when the appointment ends at - midnight, i.e. the start of the next day. */ + * midnight, i.e. the start of the next day. */ if (end == day_starts[day + 1]) { /* If the event last the entire day, then we - skip it here so it gets added to the top - canvas. */ + * skip it here so it gets added to the top + * canvas. */ if (start == day_starts[day]) break; @@ -1050,14 +1101,16 @@ print_day_add_event (ECalModelComponent *comp_data, } /* The event wasn't within one day so it must be a long event, - i.e. shown in the top canvas. */ + * i.e. shown in the top canvas. */ g_array_append_val (long_events, event); return E_DAY_VIEW_LONG_EVENT; } static gboolean -print_day_details_cb (ECalComponent *comp, time_t istart, time_t iend, - gpointer data) +print_day_details_cb (ECalComponent *comp, + time_t istart, + time_t iend, + gpointer data) { ECalModelGenerateInstancesData *mdata = (ECalModelGenerateInstancesData *) data; struct pdinfo *pdi = (struct pdinfo *) mdata->cb_data; @@ -1118,10 +1171,17 @@ get_role_as_string (icalparameter_role role) return res; } -static double -print_attendees (GtkPrintContext *context, PangoFontDescription *font, cairo_t *cr, - double left, double right, double top, double bottom, - ECalComponent *comp, gint page_nr, gint *pages) +static gdouble +print_attendees (GtkPrintContext *context, + PangoFontDescription *font, + cairo_t *cr, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom, + ECalComponent *comp, + gint page_nr, + gint *pages) { GSList *attendees = NULL, *l; @@ -1222,13 +1282,13 @@ print_day_long_event (GtkPrintContext *context, return; /* If the event starts before the first day being printed, draw a - triangle. (Note that I am assuming we are just showing 1 day at - the moment.) */ + * triangle. (Note that I am assuming we are just showing 1 day at + * the moment.) */ if (event->start < pdi->day_starts[0]) left_triangle_width = 4; /* If the event ends after the last day being printed, draw a - triangle. */ + * triangle. */ if (event->end > pdi->day_starts[1]) right_triangle_width = 4; @@ -1244,7 +1304,7 @@ print_day_long_event (GtkPrintContext *context, right_triangle_width); /* If the event starts after the first day being printed, we need to - print the start time. */ + * print the start time. */ if (event->start > pdi->day_starts[0]) { date_tm.tm_year = 2001; date_tm.tm_mon = 0; @@ -1262,7 +1322,7 @@ print_day_long_event (GtkPrintContext *context, } /* If the event ends before the end of the last day being printed, - we need to print the end time. */ + * we need to print the end time. */ if (event->end < pdi->day_starts[1]) { date_tm.tm_year = 2001; date_tm.tm_mon = 0; @@ -1290,9 +1350,15 @@ print_day_long_event (GtkPrintContext *context, } static void -print_day_event (GtkPrintContext *context, PangoFontDescription *font, - double left, double right, double top, double bottom, - EDayViewEvent *event, struct pdinfo *pdi, ECalModel *model) +print_day_event (GtkPrintContext *context, + PangoFontDescription *font, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom, + EDayViewEvent *event, + struct pdinfo *pdi, + ECalModel *model) { gdouble x1, x2, y1, y2, col_width, row_height; gint start_offset, end_offset, start_row, end_row; @@ -1373,8 +1439,13 @@ print_day_event (GtkPrintContext *context, PangoFontDescription *font, } static void -print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, - double left, double right, double top, double bottom) +print_day_details (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { ECalModel *model; icaltimezone *zone; @@ -1448,12 +1519,12 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); /* We always leave space for DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY in the - top display, but we may have more rows than that, in which case - the main display area will be compressed. */ + * top display, but we may have more rows than that, in which case + * the main display area will be compressed. */ /* Limit long day event to half the height of the panel */ rows_in_top_display = MIN (MAX (rows_in_top_display, DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY), - (bottom-top)*0.5/DAY_VIEW_ROW_HEIGHT); + (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT); if (rows_in_top_display > pdi.long_events->len) rows_in_top_display = pdi.long_events->len; @@ -1475,7 +1546,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, const gchar **xpm = (const gchar **) jump_xpm; /* this ugly thing is here only to get rid of compiler warning - about unused 'jump_xpm_focused' */ + * about unused 'jump_xpm_focused' */ if (pixbuf) xpm = (const gchar **) jump_xpm_focused; @@ -1485,7 +1556,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, /* Right align - 10 comes from print_day_long_event too */ x = right - gdk_pixbuf_get_width (pixbuf) * 0.5 - 10; /* Placing '...' over the last all day event entry printed. '-1 -1' comes - from print_long_day_event (top/bottom spacing in each cell) */ + from print_long_day_event (top / bottom spacing in each cell) */ y = top + LONG_DAY_EVENTS_TOP_SPACING + DAY_VIEW_ROW_HEIGHT * (i - 1) + (DAY_VIEW_ROW_HEIGHT - 1 - 1) * 0.5; @@ -1552,8 +1623,8 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, /* Returns TRUE if the event is a one-day event (i.e. not a long event). */ static gboolean print_is_one_day_week_event (EWeekViewEvent *event, - EWeekViewEventSpan *span, - time_t *day_starts) + EWeekViewEventSpan *span, + time_t *day_starts) { if (event->start == day_starts[span->start_day] && event->end == day_starts[span->start_day + 1]) @@ -1568,23 +1639,31 @@ print_is_one_day_week_event (EWeekViewEvent *event, } static void -print_week_long_event (GtkPrintContext *context, PangoFontDescription *font, - struct psinfo *psi, - double x1, double x2, double y1, double row_height, - EWeekViewEvent *event, EWeekViewEventSpan *span, - gchar *text, double red, double green, double blue) +print_week_long_event (GtkPrintContext *context, + PangoFontDescription *font, + struct psinfo *psi, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble row_height, + EWeekViewEvent *event, + EWeekViewEventSpan *span, + gchar *text, + gdouble red, + gdouble green, + gdouble blue) { gdouble left_triangle_width = -1.0, right_triangle_width = -1.0; struct tm date_tm; gchar buffer[32]; /* If the event starts before the first day of the span, draw a - triangle to indicate it continues. */ + * triangle to indicate it continues. */ if (event->start < psi->day_starts[span->start_day]) left_triangle_width = 4; /* If the event ends after the last day of the span, draw a - triangle. */ + * triangle. */ if (event->end > psi->day_starts[span->start_day + span->num_days]) right_triangle_width = 4; @@ -1593,7 +1672,7 @@ print_week_long_event (GtkPrintContext *context, PangoFontDescription *font, left_triangle_width, right_triangle_width); /* If the event starts after the first day being printed, we need to - print the start time. */ + * print the start time. */ if (event->start > psi->day_starts[span->start_day]) { date_tm.tm_year = 2001; date_tm.tm_mon = 0; @@ -1613,7 +1692,7 @@ print_week_long_event (GtkPrintContext *context, PangoFontDescription *font, } /* If the event ends before the end of the last day being printed, - we need to print the end time. */ + * we need to print the end time. */ if (event->end < psi->day_starts[span->start_day + span->num_days]) { date_tm.tm_year = 2001; date_tm.tm_mon = 0; @@ -1638,11 +1717,19 @@ print_week_long_event (GtkPrintContext *context, PangoFontDescription *font, } static void -print_week_day_event (GtkPrintContext *context, PangoFontDescription *font, - struct psinfo *psi, - double x1, double x2, double y1, double row_height, - EWeekViewEvent *event, EWeekViewEventSpan *span, - gchar *text, double red, double green, double blue) +print_week_day_event (GtkPrintContext *context, + PangoFontDescription *font, + struct psinfo *psi, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble row_height, + EWeekViewEvent *event, + EWeekViewEventSpan *span, + gchar *text, + gdouble red, + gdouble green, + gdouble blue) { struct tm date_tm; gchar buffer[32]; @@ -1681,12 +1768,16 @@ print_week_day_event (GtkPrintContext *context, PangoFontDescription *font, } static void -print_week_event (GtkPrintContext *context, PangoFontDescription *font, - struct psinfo *psi, - double left, double top, - double cell_width, double cell_height, - ECalModel *model, - EWeekViewEvent *event, GArray *spans) +print_week_event (GtkPrintContext *context, + PangoFontDescription *font, + struct psinfo *psi, + gdouble left, + gdouble top, + gdouble cell_width, + gdouble cell_height, + ECalModel *model, + EWeekViewEvent *event, + GArray *spans) { EWeekViewEventSpan *span; gint span_num; @@ -1790,7 +1881,7 @@ print_week_event (GtkPrintContext *context, PangoFontDescription *font, const gchar **xpm = (const gchar **) jump_xpm; /* this ugly thing is here only to get rid of compiler warning - about unused 'jump_xpm_focused' */ + * about unused 'jump_xpm_focused' */ if (pixbuf) xpm = (const gchar **) jump_xpm_focused; @@ -1817,9 +1908,11 @@ print_week_event (GtkPrintContext *context, PangoFontDescription *font, static void print_week_view_background (GtkPrintContext *context, PangoFontDescription *font, - struct psinfo *psi, - double left, double top, - double cell_width, double cell_height) + struct psinfo *psi, + gdouble left, + gdouble top, + gdouble cell_width, + gdouble cell_height) { struct tm tm; gint day, day_x, day_y, day_h; @@ -1844,7 +1937,7 @@ print_week_view_background (GtkPrintContext *context, convert_timet_to_struct_tm (psi->day_starts[day], psi->zone, &tm); /* In the month view we draw a grey background for the end - of the previous month and the start of the following. */ + * of the previous month and the start of the following. */ fillcolor = -1.0; if (psi->multi_week_view && (tm.tm_mon != psi->month)) fillcolor = 0.9; @@ -1869,9 +1962,9 @@ print_week_view_background (GtkPrintContext *context, cairo_stroke (cr); /* strftime format %A = full weekday name, %d = day of - month, %B = full month name. You can change the - order but don't change the specifiers or add - anything. */ + * month, %B = full month name. You can change the + * order but don't change the specifiers or add + * anything. */ format_string = _("%A %d %B"); } @@ -1886,9 +1979,9 @@ print_week_view_background (GtkPrintContext *context, /* This adds one event to the view, adding it to the appropriate array. */ static gboolean print_week_summary_cb (ECalComponent *comp, - time_t start, - time_t end, - gpointer data) + time_t start, + time_t end, + gpointer data) { EWeekViewEvent event; @@ -1929,10 +2022,17 @@ print_week_summary_cb (ECalComponent *comp, } static void -print_week_summary (GtkPrintContext *context, GnomeCalendar *gcal, - time_t whence, gboolean multi_week_view, gint weeks_shown, - gint month, double font_size, - double left, double right, double top, double bottom) +print_week_summary (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + gboolean multi_week_view, + gint weeks_shown, + gint month, + gdouble font_size, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { icaltimezone *zone; EWeekViewEvent *event; @@ -2000,7 +2100,7 @@ print_week_summary (GtkPrintContext *context, GnomeCalendar *gcal, } /* Calculate the row height, using the normal font and with room for - space or a rectangle around it. */ + * space or a rectangle around it. */ psi.row_height = font_size * 1.2; psi.header_row_height = font_size * 1.5; @@ -2081,7 +2181,7 @@ print_month_summary (GtkPrintContext *context, month = tt.month - 1; /* Find the start of the month, and then the start of the week on - or before that day. */ + * or before that day. */ if (!date) date = time_month_begin_with_zone (whence, zone); date = time_week_begin_with_zone (date, weekday, zone); @@ -2093,9 +2193,9 @@ print_month_summary (GtkPrintContext *context, /* do day names ... */ /* We are only interested in outputting the weekday here, but we want - to be able to step through the week without worrying about - overflows making strftime choke, so we move near to the start of - the month. */ + * to be able to step through the week without worrying about + * overflows making strftime choke, so we move near to the start of + * the month. */ convert_timet_to_struct_tm (date, zone, &tm); tm.tm_mday = (tm.tm_mday % 7) + 7; @@ -2137,9 +2237,14 @@ print_month_summary (GtkPrintContext *context, } static void -print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal, - time_t start, time_t end, - double left, double right, double top, double bottom) +print_todo_details (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t start, + time_t end, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { PangoFontDescription *font_summary; gdouble y, yend, x, xend; @@ -2151,7 +2256,7 @@ print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal, cairo_t *cr; /* We get the tasks directly from the TaskPad ETable. This means we - get them filtered & sorted for free. */ + * get them filtered & sorted for free. */ task_table = gnome_calendar_get_task_table (gcal); table = E_TABLE (task_table); g_return_if_fail (table != NULL); @@ -2220,7 +2325,7 @@ print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal, y = bound_text (context, font_summary, summary.value, -1, x + 14, y + 4, xend, yend, FALSE, NULL, NULL); - y += get_font_size (font_summary)-5; + y += get_font_size (font_summary) - 5; cr = gtk_print_context_get_cairo_context (context); cairo_move_to (cr, x, y); cairo_line_to (cr, xend, y); @@ -2234,7 +2339,9 @@ print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal, } static void -print_day_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) +print_day_view (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t date) { ECalModel *model; GtkPageSetup *setup; @@ -2309,9 +2416,14 @@ print_day_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) } static void -print_work_week_background (GtkPrintContext *context, GnomeCalendar *gcal, - time_t whence, struct pdinfo *pdi, double left, - double right, double top, double bottom) +print_work_week_background (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + struct pdinfo *pdi, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { ECalModel *model; PangoFontDescription *font_hour, *font_minute; @@ -2424,7 +2536,7 @@ print_work_week_background (GtkPrintContext *context, GnomeCalendar *gcal, cairo_stroke (cr); /* Draw the horizontal line for the 1/2-hours, across the - entire width except for part of the time column. */ + * entire width except for part of the time column. */ cairo_move_to (cr, left + width * 0.6, y - yinc / 2); cairo_line_to (cr, right, y - yinc / 2); cairo_set_line_width (cr, 1); @@ -2433,7 +2545,7 @@ print_work_week_background (GtkPrintContext *context, GnomeCalendar *gcal, } /* Draw the vertical lines for the days */ - day_width = (right - left - 2*width) / pdi->days_shown; + day_width = (right - left - 2 *width) / pdi->days_shown; for (i = 0; i < pdi->days_shown - 1; ++i) { cr = gtk_print_context_get_cairo_context (context); cairo_move_to (cr, left + width + day_width * (i + 1), top); @@ -2456,9 +2568,14 @@ print_work_week_background (GtkPrintContext *context, GnomeCalendar *gcal, } static void -print_work_week_day_details (GtkPrintContext *context, GnomeCalendar *gcal, - time_t whence, double left, double right, - double top, double bottom, struct pdinfo *_pdi) +print_work_week_day_details (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom, + struct pdinfo *_pdi) { ECalModel *model; icaltimezone *zone; @@ -2536,12 +2653,12 @@ print_work_week_day_details (GtkPrintContext *context, GnomeCalendar *gcal, font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); /* We always leave space for DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY in the - top display, but we may have more rows than that, in which case - the main display area will be compressed. */ + * top display, but we may have more rows than that, in which case + * the main display area will be compressed. */ /* Limit long day event to half the height of the panel */ rows_in_top_display = MIN (MAX (rows_in_top_display, DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY), - (bottom-top)*0.5/DAY_VIEW_ROW_HEIGHT); + (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT); if (rows_in_top_display > pdi.long_events->len) rows_in_top_display = pdi.long_events->len; @@ -2563,7 +2680,7 @@ print_work_week_day_details (GtkPrintContext *context, GnomeCalendar *gcal, const gchar **xpm = (const gchar **) jump_xpm; /* this ugly thing is here only to get rid of compiler warning - about unused 'jump_xpm_focused' */ + * about unused 'jump_xpm_focused' */ if (pixbuf) xpm = (const gchar **) jump_xpm_focused; @@ -2573,7 +2690,7 @@ print_work_week_day_details (GtkPrintContext *context, GnomeCalendar *gcal, /* Right align - 10 comes from print_day_long_event too */ x = right - gdk_pixbuf_get_width (pixbuf) * 0.5 - 10; /* Placing '...' over the last all day event entry printed. '-1 -1' comes - from print_long_day_event (top/bottom spacing in each cell) */ + from print_long_day_event (top / bottom spacing in each cell) */ y = top + LONG_DAY_EVENTS_TOP_SPACING + DAY_VIEW_ROW_HEIGHT * (i - 1) + (DAY_VIEW_ROW_HEIGHT - 1 - 1) * 0.5; @@ -2653,7 +2770,9 @@ print_work_week_view_cb (ECalComponent *comp, } static void -print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) +print_work_week_view (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t date) { GtkPageSetup *setup; icaltimezone *zone; @@ -2728,7 +2847,7 @@ print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date 24 + 3, 24 + 3 + 24); /* Now print each days' events */ - day_width = (width - 2*DAY_VIEW_TIME_COLUMN_WIDTH) / days; + day_width = (width - 2 *DAY_VIEW_TIME_COLUMN_WIDTH) / days; when = start; for (i = 0; i < days; ++i) { day_x = DAY_VIEW_TIME_COLUMN_WIDTH + day_width * i; @@ -2749,7 +2868,9 @@ print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date } static void -print_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) +print_week_view (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t date) { GtkPageSetup *setup; ECalModel *model; @@ -2776,7 +2897,7 @@ print_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) when = time_week_begin_with_zone (date, week_start_day, zone); /* If the week starts on a Sunday, we have to show the Saturday first, - since the weekend is compressed. */ + * since the weekend is compressed. */ if (week_start_day == 0) { if (tm.tm_wday == 6) when = time_add_day_with_zone (when, 6, zone); @@ -2830,7 +2951,9 @@ print_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) } static void -print_month_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) +print_month_view (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t date) { ECalModel *model; GtkPageSetup *setup; @@ -2879,7 +3002,9 @@ print_month_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) } static gboolean -same_date (struct tm tm1, time_t t2, icaltimezone *zone) +same_date (struct tm tm1, + time_t t2, + icaltimezone *zone) { struct tm tm2; @@ -2922,13 +3047,14 @@ write_label_piece (time_t t, strcat (buffer, etext); } -static icaltimezone* -get_zone_from_tzid (ECalClient *client, const gchar *tzid) +static icaltimezone * +get_zone_from_tzid (ECalClient *client, + const gchar *tzid) { icaltimezone *zone; /* Note that the timezones may not be on the server, so we try to get - the builtin timezone with the TZID first. */ + * the builtin timezone with the TZID first. */ zone = icaltimezone_get_builtin_timezone_from_tzid (tzid); if (!zone && tzid) { GError *error = NULL; @@ -3404,8 +3530,8 @@ print_comp_draw_page (GtkPrintOperation *operation, static void print_comp_begin_print (GtkPrintOperation *operation, - GtkPrintContext *context, - PrintCompItem *pci) + GtkPrintContext *context, + PrintCompItem *pci) { gint pages; @@ -3448,7 +3574,9 @@ print_comp (ECalComponent *comp, } static void -print_title (GtkPrintContext *context, const gchar *text, gdouble page_width) +print_title (GtkPrintContext *context, + const gchar *text, + gdouble page_width) { PangoFontDescription *desc; PangoLayout *layout; @@ -3509,8 +3637,10 @@ print_table_draw_page (GtkPrintOperation *operation, } void -print_table (ETable *table, const gchar *dialog_title, - const gchar *print_header, GtkPrintOperationAction action) +print_table (ETable *table, + const gchar *dialog_title, + const gchar *print_header, + GtkPrintOperationAction action) { GtkPrintOperation *operation; EPrintable *printable; diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c index 82eae30c83..6a0fdcce1f 100644 --- a/calendar/gui/tag-calendar.c +++ b/calendar/gui/tag-calendar.c @@ -94,9 +94,9 @@ prepare_tag (ECalendar *ecal, * called from e_cal_generate_instances() */ static gboolean tag_calendar_cb (ECalComponent *comp, - time_t istart, - time_t iend, - gpointer data) + time_t istart, + time_t iend, + gpointer data) { struct calendar_tag_closure *c = data; struct icaltimetype start_tt, end_tt; @@ -104,7 +104,7 @@ tag_calendar_cb (ECalComponent *comp, guint8 style = 0; /* If we are skipping TRANSPARENT events, return if the event is - transparent. */ + * transparent. */ e_cal_component_get_transparency (comp, &transparency); if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT) { if (c->skip_transparent_events) @@ -153,7 +153,7 @@ get_recur_events_italic (void) void tag_calendar_by_client (ECalendar *ecal, ECalClient *client, - GCancellable *cancellable) + GCancellable *cancellable) { struct calendar_tag_closure *c; @@ -182,9 +182,9 @@ tag_calendar_by_client (ECalendar *ecal, } /* Resolves TZIDs for the recurrence generator, for when the comp is not on - the server. We need to try to use builtin timezones first, as they may not - be added to the server yet. */ -static icaltimezone* + * the server. We need to try to use builtin timezones first, as they may not + * be added to the server yet. */ +static icaltimezone * resolve_tzid_cb (const gchar *tzid, gpointer data) { diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index a9cd687169..d1a9a2835a 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -380,7 +380,8 @@ weekday_picker_class_init (WeekdayPickerClass *class) } static void -day_clicked (WeekdayPicker *wp, gint index) +day_clicked (WeekdayPicker *wp, + gint index) { WeekdayPickerPrivate *priv = wp->priv; guint8 day_mask; @@ -397,7 +398,8 @@ day_clicked (WeekdayPicker *wp, gint index) } static gint -handle_key_press_event (WeekdayPicker *wp, GdkEvent *event) +handle_key_press_event (WeekdayPicker *wp, + GdkEvent *event) { WeekdayPickerPrivate *priv = wp->priv; guint keyval = event->key.keyval; @@ -434,7 +436,9 @@ handle_key_press_event (WeekdayPicker *wp, GdkEvent *event) /* Event handler for the day items */ static gint -day_event_cb (GnomeCanvasItem *item, GdkEvent *event, gpointer data) +day_event_cb (GnomeCanvasItem *item, + GdkEvent *event, + gpointer data) { WeekdayPicker *wp; WeekdayPickerPrivate *priv; @@ -530,7 +534,8 @@ weekday_picker_new (void) * Sunday is bit 0, Monday is bit 1, etc. **/ void -weekday_picker_set_days (WeekdayPicker *wp, guint8 day_mask) +weekday_picker_set_days (WeekdayPicker *wp, + guint8 day_mask) { WeekdayPickerPrivate *priv; @@ -576,7 +581,8 @@ weekday_picker_get_days (WeekdayPicker *wp) * weekday_picker_set_days(). **/ void -weekday_picker_set_blocked_days (WeekdayPicker *wp, guint8 blocked_day_mask) +weekday_picker_set_blocked_days (WeekdayPicker *wp, + guint8 blocked_day_mask) { WeekdayPickerPrivate *priv; @@ -618,7 +624,8 @@ weekday_picker_get_blocked_days (WeekdayPicker *wp) * Sets the day that defines the start of the week for a weekday picker. **/ void -weekday_picker_set_week_start_day (WeekdayPicker *wp, gint week_start_day) +weekday_picker_set_week_start_day (WeekdayPicker *wp, + gint week_start_day) { WeekdayPickerPrivate *priv; diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index 585d423921..739a23cf1d 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -115,7 +115,8 @@ ivcal_import_done (ICalImporter *ici) /* This removes all components except VEVENTs and VTIMEZONEs from the toplevel */ static void -prepare_events (icalcomponent *icalcomp, GList **vtodos) +prepare_events (icalcomponent *icalcomp, + GList **vtodos) { icalcomponent *subcomp; icalcompiter iter; @@ -143,10 +144,11 @@ prepare_events (icalcomponent *icalcomp, GList **vtodos) } /* This removes all components except VTODOs and VTIMEZONEs from the toplevel - icalcomponent, and adds the given list of VTODO components. The list is - freed afterwards. */ + * icalcomponent, and adds the given list of VTODO components. The list is + * freed afterwards. */ static void -prepare_tasks (icalcomponent *icalcomp, GList *vtodos) +prepare_tasks (icalcomponent *icalcomp, + GList *vtodos) { icalcomponent *subcomp; GList *elem; @@ -203,7 +205,11 @@ receive_objects_ready_cb (GObject *source_object, } static void -update_objects (ECalClient *cal_client, icalcomponent *icalcomp, GCancellable *cancellable, void (*done_cb)(gpointer user_data), gpointer user_data) +update_objects (ECalClient *cal_client, + icalcomponent *icalcomp, + GCancellable *cancellable, + void (*done_cb) (gpointer user_data), + gpointer user_data) { icalcomponent_kind kind; icalcomponent *vcal; @@ -246,7 +252,8 @@ struct _selector_data { }; static void -button_toggled_cb (GtkWidget *widget, struct _selector_data *sd) +button_toggled_cb (GtkWidget *widget, + struct _selector_data *sd) { g_datalist_set_data_full(&sd->target->data, "primary-source", g_object_ref (e_source_selector_get_primary_selection ((ESourceSelector *) sd->selector)), @@ -256,7 +263,8 @@ button_toggled_cb (GtkWidget *widget, struct _selector_data *sd) } static void -primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) +primary_selection_changed_cb (ESourceSelector *selector, + EImportTarget *target) { g_datalist_set_data_full(&target->data, "primary-source", g_object_ref (e_source_selector_get_primary_selection (selector)), @@ -264,7 +272,9 @@ primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) } static GtkWidget * -ivcal_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +ivcal_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *vbox, *hbox, *first = NULL; GSList *group = NULL; @@ -318,7 +328,9 @@ ivcal_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) sd->notebook = nb; sd->page = i; g_object_set_data_full((GObject *)rb, "selector-data", sd, g_free); - g_signal_connect(G_OBJECT (rb), "toggled", G_CALLBACK (button_toggled_cb), sd); + g_signal_connect ( + rb, "toggled", + G_CALLBACK (button_toggled_cb), sd); if (!group) group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rb)); @@ -403,7 +415,9 @@ ivcal_opened (GObject *source_object, } static void -ivcal_import (EImport *ei, EImportTarget *target, icalcomponent *icalcomp) +ivcal_import (EImport *ei, + EImportTarget *target, + icalcomponent *icalcomp) { EClientSourceType type; ICalImporter *ici = g_malloc0 (sizeof (*ici)); @@ -426,7 +440,9 @@ ivcal_import (EImport *ei, EImportTarget *target, icalcomponent *icalcomp) } static void -ivcal_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +ivcal_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { ICalImporter *ici = g_datalist_get_data(&target->data, "ivcal-data"); @@ -440,7 +456,9 @@ ivcal_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) */ static gboolean -ical_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +ical_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; gchar *contents; @@ -482,7 +500,9 @@ ical_supported (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -ical_import (EImport *ei, EImportTarget *target, EImportImporter *im) +ical_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; gchar *contents; @@ -512,7 +532,9 @@ ical_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -ivcal_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +ivcal_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; EImportTargetURI *s = (EImportTargetURI *) target; @@ -570,7 +592,9 @@ ical_importer_peek (void) */ static gboolean -vcal_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +vcal_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; gchar *contents; @@ -601,8 +625,8 @@ vcal_supported (EImport *ei, EImportTarget *target, EImportImporter *im) if (icalcomp && is_icalcomp_usable (icalcomp)) { /* If we can create proper iCalendar from the file, then - rather use ics importer, because it knows to read more - information than older version, the vCalendar. */ + * rather use ics importer, because it knows to read more + * information than older version, the vCalendar. */ ret = FALSE; g_free (contents); } else { @@ -631,8 +655,8 @@ vcal_supported (EImport *ei, EImportTarget *target, EImportImporter *im) } /* This tries to load in a vCalendar file and convert it to an icalcomponent. - It returns NULL on failure. */ -static icalcomponent* + * It returns NULL on failure. */ +static icalcomponent * load_vcalendar_file (const gchar *filename) { icalvcal_defaults defaults = { NULL }; @@ -667,7 +691,9 @@ load_vcalendar_file (const gchar *filename) } static void -vcal_import (EImport *ei, EImportTarget *target, EImportImporter *im) +vcal_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; icalcomponent *icalcomp; @@ -688,7 +714,9 @@ vcal_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -vcal_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +vcal_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; EImportTargetURI *s = (EImportTargetURI *) target; @@ -736,7 +764,9 @@ vcal_importer_peek (void) /* ********************************************************************** */ static gboolean -gnome_calendar_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +gnome_calendar_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; gboolean res; @@ -800,7 +830,11 @@ default_source_opened_cb (GObject *source_object, } static void -open_default_source (ICalIntelligentImporter *ici, ECalClientSourceType source_type, void (* opened_cb) (ECalClient *cal_client, const GError *error, ICalIntelligentImporter *ici)) +open_default_source (ICalIntelligentImporter *ici, + ECalClientSourceType source_type, + void (* opened_cb) (ECalClient *cal_client, + const GError *error, + ICalIntelligentImporter *ici)) { ESource *source; ECalClient *cal_client; @@ -912,7 +946,9 @@ gc_import_events (ECalClient *cal_client, } static void -gnome_calendar_import (EImport *ei, EImportTarget *target, EImportImporter *im) +gnome_calendar_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { icalcomponent *icalcomp = NULL; gchar *filename; @@ -920,7 +956,7 @@ gnome_calendar_import (EImport *ei, EImportTarget *target, EImportImporter *im) ICalIntelligentImporter *ici; /* This is pretty shitty, everything runs in the gui thread and can block - for quite some time */ + * for quite some time */ do_calendar = GPOINTER_TO_INT(g_datalist_get_data(&target->data, "gnomecal-do-cal")); do_tasks = GPOINTER_TO_INT(g_datalist_get_data(&target->data, "gnomecal-do-tasks")); @@ -967,19 +1003,23 @@ gnome_calendar_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -calendar_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +calendar_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data(&target->data, "gnomecal-do-cal", GINT_TO_POINTER(gtk_toggle_button_get_active(tb))); } static void -tasks_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +tasks_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data(&target->data, "gnomecal-do-tasks", GINT_TO_POINTER(gtk_toggle_button_get_active(tb))); } static GtkWidget * -gnome_calendar_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +gnome_calendar_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *hbox, *w; GConfClient *gconf; @@ -1011,7 +1051,9 @@ gnome_calendar_getwidget (EImport *ei, EImportTarget *target, EImportImporter *i } static void -gnome_calendar_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +gnome_calendar_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { ICalIntelligentImporter *ici = g_datalist_get_data(&target->data, "gnomecal-data"); @@ -1041,7 +1083,9 @@ gnome_calendar_importer_peek (void) /* ********************************************************************** */ static gchar * -format_dt (const ECalComponentDateTime *dt, GHashTable *timezones, icaltimezone *users_zone) +format_dt (const ECalComponentDateTime *dt, + GHashTable *timezones, + icaltimezone *users_zone) { struct tm tm; @@ -1076,7 +1120,8 @@ strip_mailto (const gchar *str) } static void -preview_comp (EWebViewPreview *preview, ECalComponent *comp) +preview_comp (EWebViewPreview *preview, + ECalComponent *comp) { ECalComponentText text = { 0 }; ECalComponentDateTime dt; @@ -1293,7 +1338,8 @@ preview_comp (EWebViewPreview *preview, ECalComponent *comp) } static void -preview_selection_changed_cb (GtkTreeSelection *selection, EWebViewPreview *preview) +preview_selection_changed_cb (GtkTreeSelection *selection, + EWebViewPreview *preview) { GtkTreeIter iter; GtkTreeModel *model = NULL; diff --git a/capplet/anjal-settings-main.c b/capplet/anjal-settings-main.c index 5a03ec685c..2bc3268b58 100644 --- a/capplet/anjal-settings-main.c +++ b/capplet/anjal-settings-main.c @@ -101,7 +101,8 @@ create_default_shell (void) } gint -main (gint argc, gchar *argv[]) +main (gint argc, + gchar *argv[]) { GError *error = NULL; @@ -122,7 +123,7 @@ main (gint argc, gchar *argv[]) p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy"); if (p_SetProcessDEPPolicy) - (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); + (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); } #endif diff --git a/capplet/settings/anjal-mail-view.c b/capplet/settings/anjal-mail-view.c index eb8a06e56d..c0926536cb 100644 --- a/capplet/settings/anjal-mail-view.c +++ b/capplet/settings/anjal-mail-view.c @@ -39,7 +39,7 @@ struct _AnjalMailViewPrivate { G_DEFINE_TYPE (AnjalMailView, anjal_mail_view, GTK_TYPE_NOTEBOOK) static void -anjal_mail_view_init (AnjalMailView *shell) +anjal_mail_view_init (AnjalMailView *shell) { shell->priv = g_new0 (AnjalMailViewPrivate, 1); shell->priv->started = TRUE; @@ -57,25 +57,32 @@ anjal_mail_view_finalize (GObject *object) } static void -view_set_folder_uri (AnjalMailView *mail_view, const gchar *uri) +view_set_folder_uri (AnjalMailView *mail_view, + const gchar *uri) { } + static void -view_set_folder_tree_widget (AnjalMailView *mail_view, GtkWidget *tree) +view_set_folder_tree_widget (AnjalMailView *mail_view, + GtkWidget *tree) { } + static void -view_set_folder_tree (AnjalMailView *mail_view, EMFolderTree *tree) +view_set_folder_tree (AnjalMailView *mail_view, + EMFolderTree *tree) { } static void -view_set_search (AnjalMailView *mail_view, const gchar *search) +view_set_search (AnjalMailView *mail_view, + const gchar *search) { } static void -view_init_search (AnjalMailView *mail_view, GtkWidget *search) +view_init_search (AnjalMailView *mail_view, + GtkWidget *search) { } diff --git a/capplet/settings/mail-account-view.c b/capplet/settings/mail-account-view.c index e579e6a070..3e35276361 100644 --- a/capplet/settings/mail-account-view.c +++ b/capplet/settings/mail-account-view.c @@ -82,7 +82,7 @@ struct _dialog_errors { static guint signals[LAST_SIGNAL] = { 0 }; static void -mail_account_view_init (MailAccountView *shell) +mail_account_view_init (MailAccountView *shell) { shell->priv = g_new0 (MailAccountViewPrivate, 1); @@ -144,7 +144,7 @@ check_servers (gchar *server) { gint len = G_N_ELEMENTS (std_server), i; - for (i=0; i<len; i++) { + for (i = 0; i < len; i++) { if (strstr (server, std_server[i].key) != NULL) return i; } @@ -204,7 +204,7 @@ static gboolean is_email (const gchar *address) { /* This is supposed to check if the address's domain could be - an FQDN but alas, it's not worth the pain and suffering. */ + * an FQDN but alas, it's not worth the pain and suffering. */ const gchar *at; at = strchr (address, '@'); @@ -414,7 +414,7 @@ setup_google_accounts (MailAccountView *mav) sources = e_source_group_peek_sources (sgrp); for (; sources; sources = sources->next) { - ESource *existing = (ESource*) sources->data; + ESource *existing = (ESource *) sources->data; if (!g_strcmp0 (e_source_peek_relative_uri (existing), mav->priv->username)) { @@ -482,25 +482,25 @@ create_review (MailAccountView *view) g_free (buff); gtk_widget_show (label); PACK_BOXF (label) - gtk_table_attach ((GtkTable *) table, box, 0, 1, 0, 1, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Name:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 1, 2, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_NAME)); gtk_widget_show (entry); PACK_BOX (entry) - gtk_table_attach ((GtkTable *) table, box, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Email address:")); gtk_widget_show (label); PACK_BOX (label) - gtk_table_attach ((GtkTable *) table, box, 0, 1, 2, 3, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_ADDRESS)); gtk_widget_show (entry); PACK_BOX (entry) - gtk_table_attach ((GtkTable *) table, box, 1, 2, 2, 3, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (NULL); buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Details:")); @@ -508,7 +508,7 @@ create_review (MailAccountView *view) g_free (buff); gtk_widget_show (label); PACK_BOXF (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (NULL); buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Receiving")); @@ -516,44 +516,44 @@ create_review (MailAccountView *view) g_free (buff); gtk_widget_show (label); PACK_BOXF (label); - gtk_table_attach ((GtkTable *) table, box, 1, 2, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Server type:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 4, 5, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->protocol); gtk_widget_show (entry); PACK_BOX (entry) - gtk_table_attach ((GtkTable *) table, box, 1, 2, 4, 5, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Server address:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 5, 6, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->host); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 1, 2, 5, 6, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Username:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 6, 7, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->user); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 1, 2, 6, 7, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Use encryption:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 7, 8, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 7, 8, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); enc = (gchar *)camel_url_get_param(url, "security-method"); entry = gtk_label_new (enc ? enc : _("never")); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 1, 2, 7, 8, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); view->priv->username = g_strdup (url->user); camel_url_free (url); @@ -567,28 +567,28 @@ create_review (MailAccountView *view) g_free (buff); gtk_widget_show (label); PACK_BOXF (label); - gtk_table_attach ((GtkTable *) table, box, 2, 3, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->protocol); gtk_widget_show (entry); PACK_BOX (entry) - gtk_table_attach ((GtkTable *) table, box, 2, 3, 4, 5, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 4, 5, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->host); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 2, 3, 5, 6, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 5, 6, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->user); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 2, 3, 6, 7, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 6, 7, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); enc = (gchar *)camel_url_get_param(url, "security-method"); entry = gtk_label_new (enc ? enc : _("never")); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 2, 3, 7, 8, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 7, 8, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); /* label = gtk_label_new (_("Organization:")); @@ -596,7 +596,7 @@ create_review (MailAccountView *view) entry = gtk_entry_new (); gtk_widget_show (entry); gtk_table_attach (table, label, 0, 1, 3, 4, GTK_SHRINK, GTK_SHRINK, INDENTATION, 0); - gtk_table_attach (table, entry, 1, 2, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach (table, entry, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); */ gtk_widget_show (table); @@ -638,13 +638,14 @@ struct _page_text { }; static void -mav_next_pressed (GtkButton *button, MailAccountView *mav) +mav_next_pressed (GtkButton *button, + MailAccountView *mav) { if (mail_account_pages[mav->current_page].validate_page) { gint ret = (*mail_account_pages[mav->current_page].validate_page) (mav); MAVPage *page = mav->pages[mav->current_page]; if (ret) { - gtk_label_set_text ((GtkLabel *) page->error_label, _(dialog_errors[ret-1].detail)); + gtk_label_set_text ((GtkLabel *) page->error_label, _(dialog_errors[ret - 1].detail)); gtk_widget_show (page->error); return; } @@ -847,7 +848,8 @@ mav_next_pressed (GtkButton *button, MailAccountView *mav) } static void -mav_prev_pressed (GtkButton *button, MailAccountView *mav) +mav_prev_pressed (GtkButton *button, + MailAccountView *mav) { if (mav->current_page == 0) return; @@ -863,7 +865,8 @@ mav_prev_pressed (GtkButton *button, MailAccountView *mav) } static GtkWidget * -mav_construct_page (MailAccountView *view, MAVPageType type) +mav_construct_page (MailAccountView *view, + MAVPageType type) { MAVPage *page = g_new0 (MAVPage, 1); GtkWidget *box, *tmp, *error_box; @@ -927,7 +930,7 @@ mav_construct_page (MailAccountView *view, MAVPageType type) page->prev = gtk_button_new (); gtk_container_add ((GtkContainer *) page->prev, box); gtk_widget_show_all (page->prev); - g_signal_connect(page->prev, "clicked", G_CALLBACK(mav_prev_pressed), view); + g_signal_connect (page->prev, "clicked", G_CALLBACK(mav_prev_pressed), view); } if ((view->original && mail_account_pages[type].next_edit) || mail_account_pages[type].next) { @@ -944,7 +947,7 @@ mav_construct_page (MailAccountView *view, MAVPageType type) G_CALLBACK (gtk_widget_grab_default), NULL); gtk_container_add ((GtkContainer *) page->next, box); gtk_widget_show_all (page->next); - g_signal_connect(page->next, "clicked", G_CALLBACK(mav_next_pressed), view); + g_signal_connect (page->next, "clicked", G_CALLBACK(mav_next_pressed), view); } box = gtk_hbox_new (FALSE, 0); @@ -1043,7 +1046,8 @@ emae_check_servers (const gchar *email) } static void -next_page (GtkWidget *entry, MailAccountView *mav) +next_page (GtkWidget *entry, + MailAccountView *mav) { mav_next_pressed (NULL, mav); } @@ -1062,7 +1066,7 @@ mail_account_view_construct (MailAccountView *view, gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *) view->scroll, view->page_widget); gtk_widget_show_all (view->scroll); gtk_widget_set_size_request ((GtkWidget *) view, -1, 300); - for (i=0; i<MAV_LAST; i++) { + for (i = 0; i < MAV_LAST; i++) { view->pages[i] = (MAVPage *) mav_construct_page (view, i); view->pages[i]->done = FALSE; view->wpages[i] = view->pages[i]->box; @@ -1099,7 +1103,7 @@ mail_account_view_construct (MailAccountView *view, gtk_widget_show (label); gtk_widget_show (pwd); gtk_table_attach ((GtkTable *) table, label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); - gtk_table_attach ((GtkTable *) table, pwd, 1, 2, 2, 3, GTK_FILL|GTK_EXPAND, 0, 0, 0); + gtk_table_attach ((GtkTable *) table, pwd, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, 0, 0, 0); view->password = pwd; } @@ -1123,7 +1127,8 @@ mail_account_view_new (EAccount *account, } static void -mav_close (GtkButton *w, MailAccountView *mfv) +mav_close (GtkButton *w, + MailAccountView *mfv) { g_signal_emit (mfv, signals[VIEW_CLOSE], 0); } @@ -1150,7 +1155,7 @@ mail_account_view_get_tab_widget (MailAccountView *mcv) gtk_container_add ((GtkContainer *) tool, box); gtk_widget_show_all (tool); gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (tool) , GTK_ICON_SIZE_MENU, &w, &h); - gtk_widget_set_size_request (tool, w+2, h+2); + gtk_widget_set_size_request (tool, w + 2, h + 2); box = gtk_label_new (_("Account Wizard")); tab_label = gtk_hbox_new (FALSE, 0); @@ -1163,11 +1168,15 @@ mail_account_view_get_tab_widget (MailAccountView *mcv) } void -mail_account_view_activate (MailAccountView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, gboolean act) +mail_account_view_activate (MailAccountView *mcv, + GtkWidget *tree, + GtkWidget *folder_tree, + GtkWidget *check_mail, + GtkWidget *sort_by, + gboolean act) { if (!check_mail || !sort_by) return; - //gtk_widget_hide (folder_tree); gtk_widget_set_sensitive (check_mail, TRUE); gtk_widget_set_sensitive (sort_by, FALSE); } diff --git a/capplet/settings/mail-account-view.h b/capplet/settings/mail-account-view.h index 1b04533403..0a582c4a13 100644 --- a/capplet/settings/mail-account-view.h +++ b/capplet/settings/mail-account-view.h @@ -39,7 +39,7 @@ typedef struct _MailAccountViewPrivate MailAccountViewPrivate; typedef struct _MailAccountService MailAccountService; typedef enum { - MAV_IDENTITY_PAGE=0, + MAV_IDENTITY_PAGE = 0, MAV_RECV_PAGE, MAV_RECV_OPT_PAGE, MAV_SEND_PAGE, diff --git a/capplet/settings/mail-capplet-shell.c b/capplet/settings/mail-capplet-shell.c index 75e2e11fff..47956cd782 100644 --- a/capplet/settings/mail-capplet-shell.c +++ b/capplet/settings/mail-capplet-shell.c @@ -91,7 +91,7 @@ G_DEFINE_TYPE (MailCappletShell, mail_capplet_shell, GTK_TYPE_WINDOW) static void setup_abooks (void); static void -mail_capplet_shell_init (MailCappletShell *shell) +mail_capplet_shell_init (MailCappletShell *shell) { shell->priv = g_new0 (MailCappletShellPrivate, 1); shell->priv->settings_view = NULL; @@ -184,15 +184,15 @@ mail_capplet_shell_quit (MailCappletShell *shell) static void ms_delete_event (MailCappletShell *shell, - GdkEvent *event G_GNUC_UNUSED, - gpointer data G_GNUC_UNUSED) + GdkEvent *event G_GNUC_UNUSED, + gpointer data G_GNUC_UNUSED) { mail_capplet_shell_quit (shell); } static void ms_show_post_druid (MailViewChild *mfv G_GNUC_UNUSED, - MailCappletShell *shell) + MailCappletShell *shell) { gtk_widget_destroy (GTK_WIDGET (shell)); } @@ -200,7 +200,10 @@ ms_show_post_druid (MailViewChild *mfv G_GNUC_UNUSED, #define PACK_IN_TOOL(wid,icon) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, gtk_image_new_from_icon_name(icon, GTK_ICON_SIZE_BUTTON), FALSE, FALSE, 0); wid = (GtkWidget *)gtk_tool_button_new (tbox, NULL); } static void -mail_capplet_shell_construct (MailCappletShell *shell, gint socket_id, gboolean just_druid, gboolean main_loop) +mail_capplet_shell_construct (MailCappletShell *shell, + gint socket_id, + gboolean just_druid, + gboolean main_loop) { MailCappletShellPrivate *priv = shell->priv; GtkStyle *style = gtk_widget_get_default_style (); @@ -292,7 +295,9 @@ mail_capplet_shell_construct (MailCappletShell *shell, gint socket_id, gboolean } GtkWidget * -mail_capplet_shell_new (gint socket_id, gboolean just_druid, gboolean main_loop) +mail_capplet_shell_new (gint socket_id, + gboolean just_druid, + gboolean main_loop) { MailCappletShell *shell = g_object_new (MAIL_CAPPLET_SHELL_TYPE, NULL); mail_capplet_shell_construct (shell, socket_id, just_druid, main_loop); @@ -351,7 +356,7 @@ setup_abooks (void) if (on_this_computer) { /* make sure "Personal" shows up as a source under - this group */ + * this group */ GSList *sources = e_source_group_peek_sources (on_this_computer); GSList *s; for (s = sources; s; s = s->next) { diff --git a/capplet/settings/mail-guess-servers.c b/capplet/settings/mail-guess-servers.c index 307aeeec1c..0b144940e9 100644 --- a/capplet/settings/mail-guess-servers.c +++ b/capplet/settings/mail-guess-servers.c @@ -50,7 +50,8 @@ #include "mail-guess-servers.h" static gchar * -xml_to_gchar (xmlChar *xml, EmailProvider *provider) +xml_to_gchar (xmlChar *xml, + EmailProvider *provider) { gchar *gxml = NULL; gchar *tmp; @@ -89,7 +90,8 @@ xml_to_gchar (xmlChar *xml, EmailProvider *provider) } static SoupMessage * -get_url (SoupSession *session, const gchar *url) +get_url (SoupSession *session, + const gchar *url) { SoupMessage *msg; const gchar *header; @@ -175,7 +177,9 @@ handle_outgoing (xmlNodePtr head, } static gboolean -parse_message (const gchar *msg, gint length, EmailProvider *provider) +parse_message (const gchar *msg, + gint length, + EmailProvider *provider) { xmlDocPtr doc; xmlNodePtr node; @@ -227,7 +231,8 @@ parse_message (const gchar *msg, gint length, EmailProvider *provider) } static gboolean -parse_soup_message (SoupMessage *msg, EmailProvider *provider) +parse_soup_message (SoupMessage *msg, + EmailProvider *provider) { return parse_message ( msg->response_body->data, @@ -334,7 +339,8 @@ mail_guess_servers (EmailProvider *provider) #ifdef TEST gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { EmailProvider *provider; g_thread_init (NULL); diff --git a/capplet/settings/mail-settings-view.c b/capplet/settings/mail-settings-view.c index 3ae2c6d30c..a699dca9ea 100644 --- a/capplet/settings/mail-settings-view.c +++ b/capplet/settings/mail-settings-view.c @@ -52,7 +52,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; static void msv_regen_view (MailSettingsView *acview); static void -mail_settings_view_init (MailSettingsView *shell) +mail_settings_view_init (MailSettingsView *shell) { shell->priv = g_new0 (MailSettingsViewPrivate, 1); @@ -94,7 +94,8 @@ mail_settings_view_class_init (MailSettingsViewClass *klass) } static void -msv_edit_account (GtkButton *button, MailSettingsView *msv) +msv_edit_account (GtkButton *button, + MailSettingsView *msv) { EAccount *acc = g_object_get_data((GObject *)button, "account"); @@ -102,7 +103,8 @@ msv_edit_account (GtkButton *button, MailSettingsView *msv) } static void -msv_delete_account (GtkButton *button, MailSettingsView *msv) +msv_delete_account (GtkButton *button, + MailSettingsView *msv) { EAccount *account = g_object_get_data((GObject *)button, "account"); EAccountList *account_list = e_get_account_list (); @@ -116,7 +118,9 @@ msv_delete_account (GtkButton *button, MailSettingsView *msv) } static void -msv_account_added (EAccountList *al, EAccount *account, MailSettingsView *msv) +msv_account_added (EAccountList *al, + EAccount *account, + MailSettingsView *msv) { msv_regen_view (msv); } @@ -124,7 +128,8 @@ msv_account_added (EAccountList *al, EAccount *account, MailSettingsView *msv) #define PACK_BOX(w,s) box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start((GtkBox *)box, w, FALSE, FALSE, s); gtk_widget_show(box); gtk_widget_show(w); gtk_box_pack_start((GtkBox *)acview->priv->box, box, FALSE, FALSE, 3); static void -build_account_button (MailSettingsView *acview, EAccount *account) +build_account_button (MailSettingsView *acview, + EAccount *account) { GtkWidget *box, *box1, *label, *tbox, *tlabel; gchar *tmp; @@ -153,7 +158,7 @@ build_account_button (MailSettingsView *acview, EAccount *account) gtk_widget_show (tbox); gtk_container_add ((GtkContainer *) label, tbox); g_object_set_data ((GObject *)label, "account", account); - g_signal_connect(label, "clicked", G_CALLBACK(msv_edit_account), acview); + g_signal_connect (label, "clicked", G_CALLBACK(msv_edit_account), acview); gtk_box_pack_start ((GtkBox *) box1, label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -171,7 +176,7 @@ build_account_button (MailSettingsView *acview, EAccount *account) static void msv_regen_view (MailSettingsView *acview) { - struct _EAccount *account; + EAccount *account; EAccountList *accounts = acview->priv->accounts; EIterator *node; GtkWidget *box, *label; @@ -226,7 +231,8 @@ mail_settings_view_new () } static void -msv_close (GtkButton *w, MailSettingsView *mfv) +msv_close (GtkButton *w, + MailSettingsView *mfv) { g_signal_emit (mfv, signals[VIEW_CLOSE], 0); } @@ -253,7 +259,7 @@ mail_settings_view_get_tab_widget (MailSettingsView *mcv) gtk_container_add ((GtkContainer *) tool, box); gtk_widget_show_all (tool); gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (tool) , GTK_ICON_SIZE_MENU, &w, &h); - gtk_widget_set_size_request (tool, w+2, h+2); + gtk_widget_set_size_request (tool, w + 2, h + 2); box = gtk_label_new (_("Settings")); tab_label = gtk_hbox_new (FALSE, 0); @@ -268,12 +274,16 @@ mail_settings_view_get_tab_widget (MailSettingsView *mcv) } void -mail_settings_view_activate (MailSettingsView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, GtkWidget *slider, gboolean act) +mail_settings_view_activate (MailSettingsView *mcv, + GtkWidget *tree, + GtkWidget *folder_tree, + GtkWidget *check_mail, + GtkWidget *sort_by, + GtkWidget *slider, + gboolean act) { if (!check_mail || !sort_by) return; - //if (!GTK_WIDGET_VISIBLE (folder_tree)) - // gtk_widget_show (slider); gtk_widget_set_sensitive (check_mail, TRUE); gtk_widget_set_sensitive (sort_by, FALSE); } diff --git a/capplet/settings/mail-view.c b/capplet/settings/mail-view.c index 279b83c2d5..53daf3fd08 100644 --- a/capplet/settings/mail-view.c +++ b/capplet/settings/mail-view.c @@ -72,7 +72,7 @@ static MailConvView * mv_switch_message_view (MailView *mv, const gchar *uri); void anjal_shell_view_restore_state (EShellView *view, const gchar *uri); static void -mail_view_init (MailView *shell) +mail_view_init (MailView *shell) { shell->priv = g_new0 (MailViewPrivate, 1); shell->priv->children = NULL; @@ -95,7 +95,8 @@ mail_view_finalize (GObject *object) } static void -mv_set_folder_uri (AnjalMailView *mv, const gchar *uri) +mv_set_folder_uri (AnjalMailView *mv, + const gchar *uri) { #ifndef ANJAL_SETTINGS mail_view_set_folder_uri ((MailView *) mv, uri); @@ -108,7 +109,8 @@ static void set_folder_tree (AnjalMailView *mv, EMFolderTree *tree) } static void -set_search (AnjalMailView *mv, const gchar *search) +set_search (AnjalMailView *mv, + const gchar *search) { #ifndef ANJAL_SETTINGS mail_view_set_search ((MailView *) mv, search); @@ -138,7 +140,10 @@ mail_view_class_init (MailViewClass *klass) }; static void -mv_switch (GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data) +mv_switch (GtkNotebook *notebook, + GtkWidget *page, + guint page_num, + gpointer user_data) { MailView *shell = (MailView *) notebook; MailViewPrivate *priv = shell->priv; @@ -192,21 +197,23 @@ mail_view_new () } static gint -mv_get_page_number (GtkNotebook *note, GtkWidget *widget) +mv_get_page_number (GtkNotebook *note, + GtkWidget *widget) { gint i, total; total = gtk_notebook_get_n_pages (note); - for (i=0; i<total; i++) { + for (i = 0; i < total; i++) { if (gtk_notebook_get_nth_page (note, i) == widget) return i; } - return total-1; + return total - 1; } static void -mv_close_mcv (MailViewChild *mfv, MailView *mv) +mv_close_mcv (MailViewChild *mfv, + MailView *mv) { gint n = mv_get_page_number ((GtkNotebook *) mv, (GtkWidget *) mfv); gint pos = gtk_notebook_get_current_page ((GtkNotebook *) mv); @@ -279,7 +286,10 @@ mv_close_mcv (MailViewChild *mfv, MailView *mv) #ifndef ANJAL_SETTINGS static void -mv_message_new (MailFolderView *mfv, gpointer data, gchar *umid, MailView *mv) +mv_message_new (MailFolderView *mfv, + gpointer data, + gchar *umid, + MailView *mv) { MailConvView *conv = (MailConvView *) mv_switch_message_view (mv, umid); *(MailConvView **)data = conv; @@ -291,20 +301,24 @@ mv_message_new (MailFolderView *mfv, gpointer data, gchar *umid, MailView *mv) } static void -mv_search_set (MailFolderView *mfv, MailView *mv) +mv_search_set (MailFolderView *mfv, + MailView *mv) { anjal_shell_view_restore_state (mv->shell_view, ((MailViewChild *) mfv)->uri); } static void -mv_folder_loaded (MailFolderView *mfv, MailView *mv) +mv_folder_loaded (MailFolderView *mfv, + MailView *mv) { g_signal_handlers_block_by_func (mfv, mv_folder_loaded, mv); g_signal_emit (mv, signals[VIEW_NEW], 0); } static MailViewChild * -mail_view_add_folder (MailView *mv, gpointer data, gboolean block) +mail_view_add_folder (MailView *mv, + gpointer data, + gboolean block) { MailFolderView *mfv = mail_folder_view_new (); gint position = 0; @@ -330,7 +344,9 @@ mail_view_add_folder (MailView *mv, gpointer data, gboolean block) } static MailViewChild * -mail_view_add_composer (MailView *mv, gpointer data, gboolean block) +mail_view_add_composer (MailView *mv, + gpointer data, + gboolean block) { MailComposerView *mcv; gint position = 0; @@ -338,7 +354,7 @@ mail_view_add_composer (MailView *mv, gpointer data, gboolean block) if (!data) mcv = mail_composer_view_new (); - else if (data == (gpointer)-1) { + else if (data == (gpointer) - 1) { special = TRUE; data = NULL; } else @@ -351,7 +367,7 @@ mail_view_add_composer (MailView *mv, gpointer data, gboolean block) position = gtk_notebook_append_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mcv->tab_label); else { gint position = gtk_notebook_get_current_page ((GtkNotebook *) mv); - gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mcv->tab_label, position+1); + gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mcv->tab_label, position + 1); } gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, TRUE); @@ -368,7 +384,9 @@ mail_view_add_composer (MailView *mv, gpointer data, gboolean block) } static MailViewChild * -mail_view_add_message (MailView *mv, gpointer data, gboolean block) +mail_view_add_message (MailView *mv, + gpointer data, + gboolean block) { MailConvView *mcv = mail_conv_view_new (); gint position = 0; @@ -380,11 +398,11 @@ mail_view_add_message (MailView *mv, gpointer data, gboolean block) mv->priv->children = block ? g_list_append (mv->priv->children, mcv) : g_list_prepend (mv->priv->children, mcv); position = gtk_notebook_get_current_page ((GtkNotebook *) mv); - gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mail_conv_view_get_tab_widget (mcv), position+1); + gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mail_conv_view_get_tab_widget (mcv), position + 1); gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, TRUE); gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, FALSE); if (!block) - gtk_notebook_set_current_page ((GtkNotebook *) mv, position+1); + gtk_notebook_set_current_page ((GtkNotebook *) mv, position + 1); if (!block) mail_conv_view_activate (mcv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE); @@ -397,13 +415,17 @@ mail_view_add_message (MailView *mv, gpointer data, gboolean block) #endif static void -mv_show_acc_mcv (MailViewChild *mfv, EAccount *account, MailView *mv) +mv_show_acc_mcv (MailViewChild *mfv, + EAccount *account, + MailView *mv) { mail_view_add_page (mv, MAIL_VIEW_ACCOUNT, account); } static MailViewChild * -mail_view_add_settings (MailView *mv, gpointer data, gboolean block) +mail_view_add_settings (MailView *mv, + gpointer data, + gboolean block) { MailSettingsView *msv = mail_settings_view_new (); gint position = 0; @@ -452,7 +474,9 @@ mail_view_add_account (MailView *mv, } MailViewChild * -mail_view_add_page (MailView *mv, guint16 type, gpointer data) +mail_view_add_page (MailView *mv, + guint16 type, + gpointer data) { MailViewChild *child = NULL, *current_child; gboolean block = FALSE; @@ -493,11 +517,12 @@ mail_view_add_page (MailView *mv, guint16 type, gpointer data) #ifndef ANJAL_SETTINGS static void -mv_switch_folder_view (MailView *mv, const gchar *uri) +mv_switch_folder_view (MailView *mv, + const gchar *uri) { - gint i=0, len = g_list_length (mv->priv->children); + gint i = 0, len = g_list_length (mv->priv->children); GList *tmp = mv->priv->children; - while (i<len) { + while (i < len) { MailViewChild *child = (MailViewChild *) gtk_notebook_get_nth_page ((GtkNotebook *) mv, i); if (child->type == MAIL_VIEW_FOLDER && !strcmp (uri, child->uri)) { @@ -515,9 +540,10 @@ mv_switch_folder_view (MailView *mv, const gchar *uri) } static MailConvView * -mv_switch_message_view (MailView *mv, const gchar *uri) +mv_switch_message_view (MailView *mv, + const gchar *uri) { - gint i=0; + gint i = 0; GList *tmp = mv->priv->children; while (tmp) { MailViewChild *child = tmp->data; @@ -535,7 +561,8 @@ mv_switch_message_view (MailView *mv, const gchar *uri) } void -mail_view_set_folder_uri (MailView *mv, const gchar *uri) +mail_view_set_folder_uri (MailView *mv, + const gchar *uri) { mv_switch_folder_view (mv, uri); @@ -551,21 +578,24 @@ mail_view_close_view (MailView *mv) } void -mail_view_set_folder_tree (MailView *mv, GtkWidget *tree) +mail_view_set_folder_tree (MailView *mv, + GtkWidget *tree) { mv->tree = tree; } #ifndef ANJAL_SETTINGS static void -mv_spinner_done (CamelFolder *f, gpointer data) +mv_spinner_done (CamelFolder *f, + gpointer data) { MailView *mv = (MailView *) data; mv_spinner_show (mv, FALSE); } void -mail_view_set_search (MailView *mv, const gchar *search) +mail_view_set_search (MailView *mv, + const gchar *search) { MailViewChild *child = (MailViewChild *) mv->priv->current_view; @@ -578,7 +608,8 @@ mail_view_set_search (MailView *mv, const gchar *search) #endif void -mail_view_set_shell_view (MailView *mv, EShellView *shell) +mail_view_set_shell_view (MailView *mv, + EShellView *shell) { mv->shell_view = shell; } diff --git a/capplet/settings/mail-view.h b/capplet/settings/mail-view.h index 6f814fd81e..3295cdb61c 100644 --- a/capplet/settings/mail-view.h +++ b/capplet/settings/mail-view.h @@ -36,7 +36,7 @@ #define MAIL_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MAIL_VIEW_TYPE, MailViewClass)) enum { - MAIL_VIEW_FOLDER=1, + MAIL_VIEW_FOLDER = 1, MAIL_VIEW_COMPOSER, MAIL_VIEW_MESSAGE, MAIL_VIEW_ACCOUNT, @@ -60,12 +60,12 @@ typedef struct _MailView { typedef struct _MailViewClass { AnjalMailViewClass parent_class; - void (* view_new) (MailView*); + void (* view_new) (MailView *); } MailViewClass; typedef enum { - MAIL_VIEW_HOLD_FOCUS=1, + MAIL_VIEW_HOLD_FOCUS = 1, } MailViewFlags; typedef struct _MailViewChild { diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 6f608ab302..157f9b6387 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -225,18 +225,19 @@ emcu_remove_xevolution_headers (CamelMimeMessage *message) { struct _camel_header_raw *scan, *list = NULL; - for (scan = ((CamelMimePart *) message)->headers;scan;scan=scan->next) + for (scan = ((CamelMimePart *) message)->headers; scan; scan = scan->next) if (!strncmp(scan->name, "X-Evolution", 11)) camel_header_raw_append (&list, scan->name, scan->value, scan->offset); - for (scan=list;scan;scan=scan->next) + for (scan = list; scan; scan = scan->next) camel_medium_remove_header ((CamelMedium *) message, scan->name); return list; } -static EDestination** -destination_list_to_vector_sized (GList *list, gint n) +static EDestination ** +destination_list_to_vector_sized (GList *list, + gint n) { EDestination **destv; gint i = 0; @@ -259,7 +260,7 @@ destination_list_to_vector_sized (GList *list, gint n) return destv; } -static EDestination** +static EDestination ** destination_list_to_vector (GList *list) { return destination_list_to_vector_sized (list, -1); @@ -268,7 +269,8 @@ destination_list_to_vector (GList *list) #define LINE_LEN 72 static gboolean -text_requires_quoted_printable (const gchar *text, gsize len) +text_requires_quoted_printable (const gchar *text, + gsize len) { const gchar *p; gsize pos; @@ -291,7 +293,8 @@ text_requires_quoted_printable (const gchar *text, gsize len) } static CamelTransferEncoding -best_encoding (GByteArray *buf, const gchar *charset) +best_encoding (GByteArray *buf, + const gchar *charset) { gchar *in, *out, outbuf[256], *ch; gsize inlen, outlen; @@ -385,7 +388,8 @@ e_msg_composer_clear_inlined_table (EMsgComposer *composer) } static void -add_inlined_images (EMsgComposer *composer, CamelMultipart *multipart) +add_inlined_images (EMsgComposer *composer, + CamelMultipart *multipart) { EMsgComposerPrivate *p = composer->priv; @@ -2720,7 +2724,7 @@ add_attachments_handle_mime_part (EMsgComposer *composer, static void add_attachments_from_multipart (EMsgComposer *composer, CamelMultipart *multipart, - gboolean just_inlines, + gboolean just_inlines, gint depth) { /* find appropriate message attachments to add to the composer */ @@ -2999,7 +3003,7 @@ handle_multipart_alternative (EMsgComposer *composer, break; } else if (camel_content_type_is (content_type, "text", "*")) { /* anyt text part not text/html is second rate so the first - text part we find isn't necessarily the one we'll use. */ + * text part we find isn't necessarily the one we'll use. */ if (!text_part) text_part = mime_part; } else { @@ -3334,7 +3338,7 @@ e_msg_composer_new_with_message (EShell *shell, format++; flags = g_strsplit (format, ", ", 0); - for (i=0;flags[i];i++) { + for (i = 0; flags[i]; i++) { if (g_ascii_strcasecmp (flags[i], "text/html") == 0) gtkhtml_editor_set_html_mode ( GTKHTML_EDITOR (composer), TRUE); @@ -3911,7 +3915,8 @@ e_msg_composer_print (EMsgComposer *composer, } static GList * -add_recipients (GList *list, const gchar *recips) +add_recipients (GList *list, + const gchar *recips) { CamelInternetAddress *cia; const gchar *name, *addr; @@ -4505,7 +4510,7 @@ e_msg_composer_add_inline_image_from_file (EMsgComposer *composer, * be wrapped in a multipart/related. **/ void -e_msg_composer_add_inline_image_from_mime_part (EMsgComposer *composer, +e_msg_composer_add_inline_image_from_mime_part (EMsgComposer *composer, CamelMimePart *part) { gchar *url; diff --git a/e-util/e-alert.c b/e-util/e-alert.c index 5ef7c577e8..88dbb7189d 100644 --- a/e-util/e-alert.c +++ b/e-util/e-alert.c @@ -149,17 +149,17 @@ map_type (const gchar *nick) } /* - XML format: - - <error id="error-id" type="info|warning|question|error"? - response="default_response"? > - <primary>Primary error text.</primary>? - <secondary>Secondary error text.</secondary>? - <button stock="stock-button-id"? label="button label"? - response="response_id"? /> * - </error> + * XML format: + * + * <error id="error-id" type="info|warning|question|error"? + * response="default_response"? > + * <primary> Primary error text.</primary>? + * <secondary> Secondary error text.</secondary>? + * <button stock="stock-button-id"? label="button label"? + * response="response_id"? /> * + * </error> + */ -*/ static void e_alert_load (const gchar *path) { @@ -211,7 +211,7 @@ e_alert_load (const gchar *path) g_warning("Error file '%s', domain '%s' already used, merging", path, tmp); xmlFree (tmp); - for (error = root->children;error;error = error->next) { + for (error = root->children; error; error = error->next) { if (!strcmp((gchar *)error->name, "error")) { tmp = (gchar *)xmlGetProp(error, (const guchar *)"id"); if (tmp == NULL) @@ -221,7 +221,7 @@ e_alert_load (const gchar *path) e->id = g_strdup (tmp); xmlFree (tmp); - lastbutton = (EAlertButton *)&e->buttons; + lastbutton = (EAlertButton *) &e->buttons; tmp = (gchar *)xmlGetProp(error, (const guchar *)"type"); e->message_type = map_type (tmp); @@ -234,7 +234,7 @@ e_alert_load (const gchar *path) xmlFree (tmp); } - for (scan = error->children;scan;scan=scan->next) { + for (scan = error->children; scan; scan = scan->next) { if (!strcmp((gchar *)scan->name, "primary")) { if ((tmp = (gchar *) xmlNodeGetContent (scan))) { e->primary_text = g_strdup ( @@ -373,7 +373,7 @@ alert_format_string (const gchar *format, while (format && (newstart = strchr (format, '{')) - && (end = strchr (newstart+1, '}'))) { + && (end = strchr (newstart + 1, '}'))) { g_string_append_len (string, format, newstart - format); id = atoi (newstart + 1); if (id < args->len) { @@ -435,7 +435,7 @@ alert_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - EAlert *alert = (EAlert*) object; + EAlert *alert = (EAlert *) object; switch (property_id) { case PROP_TAG: @@ -476,7 +476,7 @@ alert_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - EAlert *alert = (EAlert*) object; + EAlert *alert = (EAlert *) object; switch (property_id) { case PROP_TAG: @@ -703,7 +703,8 @@ e_alert_init (EAlert *alert) * Returns: a new #EAlert **/ EAlert * -e_alert_new (const gchar *tag, ...) +e_alert_new (const gchar *tag, + ...) { EAlert *e; va_list va; @@ -716,7 +717,8 @@ e_alert_new (const gchar *tag, ...) } EAlert * -e_alert_new_valist (const gchar *tag, va_list va) +e_alert_new_valist (const gchar *tag, + va_list va) { EAlert *alert; GPtrArray *args; @@ -738,7 +740,8 @@ e_alert_new_valist (const gchar *tag, va_list va) } EAlert * -e_alert_new_array (const gchar *tag, GPtrArray *args) +e_alert_new_array (const gchar *tag, + GPtrArray *args) { return g_object_new (E_TYPE_ALERT, "tag", tag, "args", args, NULL); } diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c index 476118284d..62156e9063 100644 --- a/e-util/e-bit-array.c +++ b/e-util/e-bit-array.c @@ -44,7 +44,8 @@ G_DEFINE_TYPE ( G_TYPE_OBJECT) static void -e_bit_array_insert_real (EBitArray *eba, gint row) +e_bit_array_insert_real (EBitArray *eba, + gint row) { gint box; gint i; @@ -73,7 +74,9 @@ e_bit_array_insert_real (EBitArray *eba, gint row) } static void -e_bit_array_delete_real (EBitArray *eba, gint row, gboolean move_selection_mode) +e_bit_array_delete_real (EBitArray *eba, + gint row, + gboolean move_selection_mode) { gint box; gint i; @@ -120,7 +123,9 @@ e_bit_array_delete_real (EBitArray *eba, gint row, gboolean move_selection_mode) /* FIXME : Improve efficiency here. */ void -e_bit_array_delete (EBitArray *eba, gint row, gint count) +e_bit_array_delete (EBitArray *eba, + gint row, + gint count) { gint i; for (i = 0; i < count; i++) @@ -129,7 +134,9 @@ e_bit_array_delete (EBitArray *eba, gint row, gint count) /* FIXME : Improve efficiency here. */ void -e_bit_array_delete_single_mode (EBitArray *eba, gint row, gint count) +e_bit_array_delete_single_mode (EBitArray *eba, + gint row, + gint count) { gint i; for (i = 0; i < count; i++) @@ -138,7 +145,9 @@ e_bit_array_delete_single_mode (EBitArray *eba, gint row, gint count) /* FIXME : Improve efficiency here. */ void -e_bit_array_insert (EBitArray *eba, gint row, gint count) +e_bit_array_insert (EBitArray *eba, + gint row, + gint count) { gint i; for (i = 0; i < count; i++) @@ -147,7 +156,9 @@ e_bit_array_insert (EBitArray *eba, gint row, gint count) /* FIXME: Implement this more efficiently. */ void -e_bit_array_move_row (EBitArray *eba, gint old_row, gint new_row) +e_bit_array_move_row (EBitArray *eba, + gint old_row, + gint new_row) { e_bit_array_delete_real (eba, old_row, FALSE); e_bit_array_insert_real (eba, new_row); @@ -179,7 +190,7 @@ eba_dispose (GObject *object) */ gboolean e_bit_array_value_at (EBitArray *eba, - gint n) + gint n) { if (eba->bit_count < n || eba->bit_count == 0) return 0; @@ -198,8 +209,8 @@ e_bit_array_value_at (EBitArray *eba, */ void e_bit_array_foreach (EBitArray *eba, - EForeachFunc callback, - gpointer closure) + EForeachFunc callback, + gpointer closure) { gint i; gint last = (eba->bit_count + 31) / 32; @@ -274,7 +285,7 @@ e_bit_array_select_all (EBitArray *eba) } /* need to zero out the bits corresponding to the rows not - selected in the last full 32 bit mask */ + * selected in the last full 32 bit mask */ if (eba->bit_count % 32) { gint unselected_mask = 0; gint num_unselected_in_last_byte = 32 - eba->bit_count % 32; @@ -317,7 +328,9 @@ e_bit_array_bit_count (EBitArray *eba) (((object)->data[(i)]) &= (mask))) void -e_bit_array_change_one_row (EBitArray *eba, gint row, gboolean grow) +e_bit_array_change_one_row (EBitArray *eba, + gint row, + gboolean grow) { gint i; i = BOX (row); @@ -326,7 +339,10 @@ e_bit_array_change_one_row (EBitArray *eba, gint row, gboolean grow) } void -e_bit_array_change_range (EBitArray *eba, gint start, gint end, gboolean grow) +e_bit_array_change_range (EBitArray *eba, + gint start, + gint end, + gboolean grow) { gint i, last; if (start != end) { @@ -351,7 +367,8 @@ e_bit_array_change_range (EBitArray *eba, gint start, gint end, gboolean grow) } void -e_bit_array_select_single_row (EBitArray *eba, gint row) +e_bit_array_select_single_row (EBitArray *eba, + gint row) { gint i; for (i = 0; i < ((eba->bit_count + 31) / 32); i++) { @@ -367,7 +384,8 @@ e_bit_array_select_single_row (EBitArray *eba, gint row) } void -e_bit_array_toggle_single_row (EBitArray *eba, gint row) +e_bit_array_toggle_single_row (EBitArray *eba, + gint row) { if (eba->data[BOX (row)] & BITMASK (row)) eba->data[BOX (row)] &= ~BITMASK (row); diff --git a/e-util/e-categories-config.c b/e-util/e-categories-config.c index b8d772c9b5..5ca20f8e74 100644 --- a/e-util/e-categories-config.c +++ b/e-util/e-categories-config.c @@ -37,7 +37,8 @@ static GHashTable *pixbufs_cache = NULL; static void -categories_changed_cb (gpointer object, gpointer user_data) +categories_changed_cb (gpointer object, + gpointer user_data) { if (pixbufs_cache) g_hash_table_remove_all (pixbufs_cache); @@ -62,7 +63,8 @@ free_pixbuf_cb (gpointer ptr) * Returns: the icon configured for the given category */ gboolean -e_categories_config_get_icon_for (const gchar *category, GdkPixbuf **pixbuf) +e_categories_config_get_icon_for (const gchar *category, + GdkPixbuf **pixbuf) { const gchar *icon_file; diff --git a/e-util/e-config.c b/e-util/e-config.c index 18b707092d..a19bbafb3d 100644 --- a/e-util/e-config.c +++ b/e-util/e-config.c @@ -242,7 +242,9 @@ e_config_init (EConfig *config) * Return value: @ep is returned. **/ EConfig * -e_config_construct (EConfig *ep, gint type, const gchar *id) +e_config_construct (EConfig *ep, + gint type, + const gchar *id) { g_return_val_if_fail (type == E_CONFIG_BOOK || type == E_CONFIG_ASSISTANT, NULL); @@ -301,7 +303,10 @@ e_config_add_items (EConfig *ec, * the assistant to continue or the notebook to close. **/ void -e_config_add_page_check (EConfig *ec, const gchar *pageid, EConfigCheckFunc check, gpointer data) +e_config_add_page_check (EConfig *ec, + const gchar *pageid, + EConfigCheckFunc check, + gpointer data) { struct _check_node *cn; @@ -314,7 +319,8 @@ e_config_add_page_check (EConfig *ec, const gchar *pageid, EConfigCheckFunc chec } static struct _finish_page_node * -find_page_finish (EConfig *config, const gchar *pageid) +find_page_finish (EConfig *config, + const gchar *pageid) { GList *link; @@ -341,7 +347,9 @@ find_page_finish (EConfig *config, const gchar *pageid) * With is_finish set on the pageid the page is treated as the last page in an assistant. **/ void -e_config_set_page_is_finish (EConfig *ec, const gchar *pageid, gboolean is_finish) +e_config_set_page_is_finish (EConfig *ec, + const gchar *pageid, + gboolean is_finish) { struct _finish_page_node *fp; @@ -378,7 +386,8 @@ ec_add_static_items (EConfig *config) } static gint -ep_cmp (gconstpointer ap, gconstpointer bp) +ep_cmp (gconstpointer ap, + gconstpointer bp) { struct _widget_node *a = *((gpointer *) ap); struct _widget_node *b = *((gpointer *) bp); @@ -387,7 +396,9 @@ ep_cmp (gconstpointer ap, gconstpointer bp) } static GList * -ec_assistant_find_page (EConfig *ec, GtkWidget *page, gint *page_index) +ec_assistant_find_page (EConfig *ec, + GtkWidget *page, + gint *page_index) { struct _widget_node *node = NULL; GList *link; @@ -493,7 +504,8 @@ ec_assistant_check_current (EConfig *ec) } static gint -ec_assistant_forward (gint current_page, gpointer user_data) +ec_assistant_forward (gint current_page, + gpointer user_data) { GtkAssistant *assistant; EConfig *ec = user_data; @@ -645,10 +657,10 @@ ec_rebuild (EConfig *emp) case E_CONFIG_BOOK: case E_CONFIG_ASSISTANT: /* Only one of BOOK or ASSISTANT may be define, it - is used by the defining code to mark the - type of the config window. It is - cross-checked with the code's defined - type. */ + * is used by the defining code to mark the + * type of the config window. It is + * cross-checked with the code's defined + * type. */ if (root != NULL) { g_warning("EConfig book/assistant redefined at: %s", item->path); break; @@ -776,9 +788,9 @@ ec_rebuild (EConfig *emp) case E_CONFIG_PAGE: case E_CONFIG_PAGE_PROGRESS: /* CONFIG_PAGEs depend on the config type. - E_CONFIG_BOOK: + * E_CONFIG_BOOK: The page is a VBox, stored in the notebook. - E_CONFIG_ASSISTANT + * E_CONFIG_ASSISTANT The page is a VBox, stored in the GtkAssistant, any sections automatically added inside it. */ sectionno = 0; @@ -848,12 +860,12 @@ ec_rebuild (EConfig *emp) sectionnode = NULL; wn->widget = page; if (page) - g_signal_connect(page, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget); + g_signal_connect (page, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget); break; case E_CONFIG_SECTION: case E_CONFIG_SECTION_TABLE: /* The section factory is always called with - the parent vbox object. Even for assistant pages. */ + * the parent vbox object. Even for assistant pages. */ if (page == NULL) { /*g_warning("EConfig section '%s' has no parent page", item->path);*/ section = NULL; @@ -950,7 +962,7 @@ ec_rebuild (EConfig *emp) sectionno++; wn->widget = section; if (section) - g_signal_connect(section, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget); + g_signal_connect (section, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget); sectionnode = wn; break; case E_CONFIG_ITEM: @@ -960,8 +972,8 @@ ec_rebuild (EConfig *emp) wn->widget = NULL; /* ITEMs are called with the section parent. - The type depends on the section type, - either a GtkTable, or a GtkVBox */ + * The type depends on the section type, + * either a GtkTable, or a GtkVBox */ w = NULL; if (section == NULL) { wn->widget = NULL; @@ -989,7 +1001,7 @@ ec_rebuild (EConfig *emp) wn->widget = w; if (w) { - g_signal_connect(w, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget); + g_signal_connect (w, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget); itemno++; if (gtk_widget_get_visible (w)) @@ -1062,14 +1074,16 @@ ec_rebuild (EConfig *emp) * initiate a e_config_target_changed() call where appropriate. **/ void -e_config_set_target (EConfig *emp, EConfigTarget *target) +e_config_set_target (EConfig *emp, + EConfigTarget *target) { if (emp->target != target) ((EConfigClass *) G_OBJECT_GET_CLASS (emp))->set_target (emp, target); } static void -ec_widget_destroy (GtkWidget *w, EConfig *ec) +ec_widget_destroy (GtkWidget *w, + EConfig *ec) { if (ec->target) { e_config_target_free (ec, ec->target); @@ -1115,7 +1129,7 @@ e_config_create_widget (EConfig *emp) while (link != NULL) { struct _menu_node *mnode = link->data; - for (l=mnode->menu; l; l = l->next) { + for (l = mnode->menu; l; l = l->next) { struct _EConfigItem *item = l->data; struct _widget_node *wn = g_malloc0 (sizeof (*wn)); @@ -1130,14 +1144,14 @@ e_config_create_widget (EConfig *emp) qsort (items->pdata, items->len, sizeof (items->pdata[0]), ep_cmp); - for (i=0;i<items->len;i++) + for (i = 0; i < items->len; i++) p->widgets = g_list_append (p->widgets, items->pdata[i]); g_ptr_array_free (items, TRUE); ec_rebuild (emp); /* auto-unref it */ - g_signal_connect(emp->widget, "destroy", G_CALLBACK(ec_widget_destroy), emp); + g_signal_connect (emp->widget, "destroy", G_CALLBACK(ec_widget_destroy), emp); /* FIXME: for some reason ec_rebuild puts the widget on page 1, this is just to override that */ if (emp->type == E_CONFIG_BOOK) @@ -1151,7 +1165,9 @@ e_config_create_widget (EConfig *emp) } static void -ec_dialog_response (GtkWidget *d, gint id, EConfig *ec) +ec_dialog_response (GtkWidget *d, + gint id, + EConfig *ec) { if (id == GTK_RESPONSE_OK) e_config_commit (ec); @@ -1179,7 +1195,9 @@ ec_dialog_response (GtkWidget *d, gint id, EConfig *ec) * Return value: The window widget. This is also stored in @emp.window. **/ GtkWidget * -e_config_create_window (EConfig *emp, GtkWindow *parent, const gchar *title) +e_config_create_window (EConfig *emp, + GtkWindow *parent, + const gchar *title) { GtkWidget *window; @@ -1236,7 +1254,7 @@ ec_call_page_check (EConfig *emp) static gboolean ec_idle_handler_for_rebuild (gpointer data) { - EConfig *emp = (EConfig*) data; + EConfig *emp = (EConfig *) data; ec_rebuild (emp); ec_call_page_check (emp); @@ -1258,7 +1276,8 @@ ec_idle_handler_for_rebuild (gpointer data) * button for the Notebook mode. **/ void -e_config_target_changed (EConfig *emp, e_config_target_change_t how) +e_config_target_changed (EConfig *emp, + e_config_target_change_t how) { if (how == E_CONFIG_TARGET_CHANGED_REBUILD) { g_idle_add (ec_idle_handler_for_rebuild, emp); @@ -1312,7 +1331,8 @@ e_config_commit (EConfig *config) * Return value: FALSE if the data is inconsistent/incomplete. **/ gboolean -e_config_page_check (EConfig *config, const gchar *pageid) +e_config_page_check (EConfig *config, + const gchar *pageid) { GList *link; @@ -1345,7 +1365,8 @@ e_config_page_check (EConfig *config, const gchar *pageid) * container or the GtkVBox object inside the assistant. **/ GtkWidget * -e_config_page_get (EConfig *ec, const gchar *pageid) +e_config_page_get (EConfig *ec, + const gchar *pageid) { GList *link; @@ -1380,13 +1401,14 @@ e_config_page_get (EConfig *ec, const gchar *pageid) * last configured and visible page. **/ const gchar * -e_config_page_next (EConfig *ec, const gchar *pageid) +e_config_page_next (EConfig *ec, + const gchar *pageid) { GList *link; gint found; link = g_list_first (ec->priv->widgets); - found = pageid == NULL ? 1:0; + found = pageid == NULL ? 1 : 0; while (link != NULL) { struct _widget_node *wn = link->data; @@ -1420,13 +1442,14 @@ e_config_page_next (EConfig *ec, const gchar *pageid) * first configured and visible page. **/ const gchar * -e_config_page_prev (EConfig *ec, const gchar *pageid) +e_config_page_prev (EConfig *ec, + const gchar *pageid) { GList *link; gint found; link = g_list_last (ec->priv->widgets); - found = pageid == NULL ? 1:0; + found = pageid == NULL ? 1 : 0; while (link != NULL) { struct _widget_node *wn = link->data; @@ -1542,7 +1565,8 @@ gpointer e_config_target_new (EConfig *ep, gint type, gsize size) * free custom targets. **/ void -e_config_target_free (EConfig *ep, gpointer o) +e_config_target_free (EConfig *ep, + gpointer o) { EConfigTarget *t = o; @@ -1554,27 +1578,26 @@ e_config_target_free (EConfig *ep, gpointer o) /* Config menu plugin handler */ /* -<e-plugin - class="org.gnome.mail.plugin.config:1.0" - id="org.gnome.mail.plugin.config.item:1.0" - type="shlib" - location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" - name="imap" - description="IMAP4 and IMAP4v1 mail store"> - <hook class="org.gnome.mail.configMenu:1.0" - handler="HandleConfig"> - <menu id="any" target="select"> - <item - type="item|toggle|radio|image|submenu|bar" - active - path="foo/bar" - label="label" - icon="foo" - activate="ep_view_emacs"/> - </menu> - </extension> - -*/ + * <e-plugin + * class="org.gnome.mail.plugin.config:1.0" + * id="org.gnome.mail.plugin.config.item:1.0" + * type="shlib" + * location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" + * name="imap" + * description="IMAP4 and IMAP4v1 mail store"> + * <hook class="org.gnome.mail.configMenu:1.0" + * handler="HandleConfig"> + * <menu id="any" target="select"> + * <item + * type="item|toggle|radio|image|submenu|bar" + * active + * path="foo/bar" + * label="label" + * icon="foo" + * activate="ep_view_emacs"/> + * </menu> + * </e-plugin> + */ #define emph ((EConfigHook *)eph) @@ -1614,7 +1637,9 @@ ech_abort (EConfig *ec, } static gboolean -ech_check (EConfig *ec, const gchar *pageid, gpointer data) +ech_check (EConfig *ec, + const gchar *pageid, + gpointer data) { EConfigHookGroup *group = data; EConfigHookPageCheckData hdata; @@ -1630,7 +1655,8 @@ ech_check (EConfig *ec, const gchar *pageid, gpointer data) } static void -ech_config_factory (EConfig *emp, gpointer data) +ech_config_factory (EConfig *emp, + gpointer data) { EConfigHookGroup *group = data; @@ -1771,7 +1797,10 @@ ech_config_section_factory (EConfig *config, } static struct _EConfigItem * -emph_construct_item (EPluginHook *eph, EConfigHookGroup *menu, xmlNodePtr root, EConfigHookTargetMap *map) +emph_construct_item (EPluginHook *eph, + EConfigHookGroup *menu, + xmlNodePtr root, + EConfigHookTargetMap *map) { struct _EConfigItem *item; @@ -1804,7 +1833,8 @@ error: } static EConfigHookGroup * -emph_construct_menu (EPluginHook *eph, xmlNodePtr root) +emph_construct_menu (EPluginHook *eph, + xmlNodePtr root) { EConfigHookGroup *menu; xmlNodePtr node; @@ -1853,7 +1883,9 @@ error: } static gint -emph_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) +emph_construct (EPluginHook *eph, + EPlugin *ep, + xmlNodePtr root) { xmlNodePtr node; EConfigClass *class; diff --git a/e-util/e-config.h b/e-util/e-config.h index c2bdffb080..0535895b99 100644 --- a/e-util/e-config.h +++ b/e-util/e-config.h @@ -78,12 +78,12 @@ typedef GtkWidget * gpointer data); /* ok so this is all a bit bogussy - we need to map to glade stuff instead */ + * we need to map to glade stuff instead */ /* Add types? - if no factory, setup appropriate container ? - if factory, then assume that returns the right sort of object? - what about pages ? + * if no factory, setup appropriate container ? + * if factory, then assume that returns the right sort of object? + * what about pages ? */ /** @@ -318,7 +318,7 @@ void e_config_target_free (EConfig *config, /* config plugin target, they are closely integrated */ /* To implement a basic config plugin, you just need to subclass - this and initialise the class target type tables */ + * this and initialise the class target type tables */ #include "e-util/e-plugin.h" diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c index 53a0439068..c21d025794 100644 --- a/e-util/e-datetime-format.c +++ b/e-util/e-datetime-format.c @@ -101,7 +101,8 @@ ensure_loaded (void) } static const gchar * -get_default_format (DTFormatKind kind, const gchar *key) +get_default_format (DTFormatKind kind, + const gchar *key) { const gchar *res = NULL; @@ -139,7 +140,8 @@ get_default_format (DTFormatKind kind, const gchar *key) } static const gchar * -get_format_internal (const gchar *key, DTFormatKind kind) +get_format_internal (const gchar *key, + DTFormatKind kind) { const gchar *res; @@ -156,7 +158,9 @@ get_format_internal (const gchar *key, DTFormatKind kind) } static void -set_format_internal (const gchar *key, const gchar *fmt, GKeyFile *keyfile) +set_format_internal (const gchar *key, + const gchar *fmt, + GKeyFile *keyfile) { ensure_loaded (); @@ -174,7 +178,10 @@ set_format_internal (const gchar *key, const gchar *fmt, GKeyFile *keyfile) } static gchar * -format_relative_date (time_t tvalue, time_t ttoday, const struct tm *value, const struct tm *today) +format_relative_date (time_t tvalue, + time_t ttoday, + const struct tm *value, + const struct tm *today) { gchar *res = g_strdup (get_default_format (DTFormatKindDate, NULL)); GDate now, val; @@ -215,44 +222,44 @@ format_relative_date (time_t tvalue, time_t ttoday, const struct tm *value, cons switch (g_date_get_weekday (&val)) { case 1: /* Translators: This is used for abbreviated days in the future. - You can use strftime modifiers here too, like "Next %a", to avoid - repeated translation of the abbreviated day name. */ + * You can use strftime modifiers here too, like "Next %a", to avoid + * repeated translation of the abbreviated day name. */ res = g_strdup (C_ ("DateFmt", "Next Mon")); break; case 2: /* Translators: This is used for abbreviated days in the future. - You can use strftime modifiers here too, like "Next %a", to avoid - repeated translation of the abbreviated day name. */ + * You can use strftime modifiers here too, like "Next %a", to avoid + * repeated translation of the abbreviated day name. */ res = g_strdup (C_ ("DateFmt", "Next Tue")); break; case 3: /* Translators: This is used for abbreviated days in the future. - You can use strftime modifiers here too, like "Next %a", to avoid - repeated translation of the abbreviated day name. */ + * You can use strftime modifiers here too, like "Next %a", to avoid + * repeated translation of the abbreviated day name. */ res = g_strdup (C_ ("DateFmt", "Next Wed")); break; case 4: /* Translators: This is used for abbreviated days in the future. - You can use strftime modifiers here too, like "Next %a", to avoid - repeated translation of the abbreviated day name. */ + * You can use strftime modifiers here too, like "Next %a", to avoid + * repeated translation of the abbreviated day name. */ res = g_strdup (C_ ("DateFmt", "Next Thu")); break; case 5: /* Translators: This is used for abbreviated days in the future. - You can use strftime modifiers here too, like "Next %a", to avoid - repeated translation of the abbreviated day name. */ + * You can use strftime modifiers here too, like "Next %a", to avoid + * repeated translation of the abbreviated day name. */ res = g_strdup (C_ ("DateFmt", "Next Fri")); break; case 6: /* Translators: This is used for abbreviated days in the future. - You can use strftime modifiers here too, like "Next %a", to avoid - repeated translation of the abbreviated day name. */ + * You can use strftime modifiers here too, like "Next %a", to avoid + * repeated translation of the abbreviated day name. */ res = g_strdup (C_ ("DateFmt", "Next Sat")); break; case 7: /* Translators: This is used for abbreviated days in the future. - You can use strftime modifiers here too, like "Next %a", to avoid - repeated translation of the abbreviated day name. */ + * You can use strftime modifiers here too, like "Next %a", to avoid + * repeated translation of the abbreviated day name. */ res = g_strdup (C_ ("DateFmt", "Next Sun")); break; default: @@ -269,7 +276,10 @@ format_relative_date (time_t tvalue, time_t ttoday, const struct tm *value, cons } static gchar * -format_internal (const gchar *key, DTFormatKind kind, time_t tvalue, struct tm *tm_value) +format_internal (const gchar *key, + DTFormatKind kind, + time_t tvalue, + struct tm *tm_value) { const gchar *fmt; gchar buff[129]; @@ -332,7 +342,9 @@ format_internal (const gchar *key, DTFormatKind kind, time_t tvalue, struct tm * } static void -fill_combo_formats (GtkWidget *combo, const gchar *key, DTFormatKind kind) +fill_combo_formats (GtkWidget *combo, + const gchar *key, + DTFormatKind kind) { const gchar *date_items[] = { N_ ("Use locale default"), @@ -449,7 +461,8 @@ update_preview_widget (GtkWidget *combo) } static void -format_combo_changed_cb (GtkWidget *combo, gpointer user_data) +format_combo_changed_cb (GtkWidget *combo, + gpointer user_data) { const gchar *key; DTFormatKind kind; @@ -478,12 +491,14 @@ format_combo_changed_cb (GtkWidget *combo, gpointer user_data) update_preview_widget (combo); /* save on every change only because 'unref_setup_keyfile' is never called :( - how about in kill-bonobo? */ + * how about in kill - bonobo? */ save_keyfile (keyfile); } static gchar * -gen_key (const gchar *component, const gchar *part, DTFormatKind kind) +gen_key (const gchar *component, + const gchar *part, + DTFormatKind kind) { const gchar *kind_str = NULL; @@ -538,7 +553,12 @@ unref_setup_keyfile (gpointer ptr) * on user's changes. **/ void -e_datetime_format_add_setup_widget (GtkWidget *table, gint row, const gchar *component, const gchar *part, DTFormatKind kind, const gchar *caption) +e_datetime_format_add_setup_widget (GtkWidget *table, + gint row, + const gchar *component, + const gchar *part, + DTFormatKind kind, + const gchar *caption) { GtkListStore *store; GtkWidget *label, *combo, *preview, *align; @@ -601,7 +621,10 @@ e_datetime_format_add_setup_widget (GtkWidget *table, gint row, const gchar *com } gchar * -e_datetime_format_format (const gchar *component, const gchar *part, DTFormatKind kind, time_t value) +e_datetime_format_format (const gchar *component, + const gchar *part, + DTFormatKind kind, + time_t value) { gchar *key, *res; @@ -619,7 +642,10 @@ e_datetime_format_format (const gchar *component, const gchar *part, DTFormatKin } gchar * -e_datetime_format_format_tm (const gchar *component, const gchar *part, DTFormatKind kind, struct tm *tm_time) +e_datetime_format_format_tm (const gchar *component, + const gchar *part, + DTFormatKind kind, + struct tm *tm_time) { gchar *key, *res; diff --git a/e-util/e-dialog-utils.c b/e-util/e-dialog-utils.c index 620719665b..fabd1951d3 100644 --- a/e-util/e-dialog-utils.c +++ b/e-util/e-dialog-utils.c @@ -38,7 +38,10 @@ * button. **/ void -e_notice (gpointer parent, GtkMessageType type, const gchar *format, ...) +e_notice (gpointer parent, + GtkMessageType type, + const gchar *format, + ...) { GtkWidget *dialog; va_list args; diff --git a/e-util/e-dialog-widgets.c b/e-util/e-dialog-widgets.c index 60867315b0..12034f96f2 100644 --- a/e-util/e-dialog-widgets.c +++ b/e-util/e-dialog-widgets.c @@ -37,7 +37,8 @@ * values for the items are provided as a -1-terminated array. */ static gint -value_to_index (const gint *value_map, gint value) +value_to_index (const gint *value_map, + gint value) { gint i; @@ -52,7 +53,8 @@ value_to_index (const gint *value_map, gint value) * function above. */ static gint -index_to_value (const gint *value_map, gint index) +index_to_value (const gint *value_map, + gint index) { gint i; @@ -75,7 +77,8 @@ index_to_value (const gint *value_map, gint index) * Sets the string value inside a #GtkEditable-derived widget. **/ void -e_dialog_editable_set (GtkWidget *widget, const gchar *value) +e_dialog_editable_set (GtkWidget *widget, + const gchar *value) { gint pos = 0; @@ -116,7 +119,9 @@ e_dialog_editable_get (GtkWidget *widget) * indices. **/ void -e_dialog_combo_box_set (GtkWidget *widget, gint value, const gint *value_map) +e_dialog_combo_box_set (GtkWidget *widget, + gint value, + const gint *value_map) { gint i; @@ -146,7 +151,8 @@ e_dialog_combo_box_set (GtkWidget *widget, gint value, const gint *value_map) * combo box. **/ gint -e_dialog_combo_box_get (GtkWidget *widget, const gint *value_map) +e_dialog_combo_box_get (GtkWidget *widget, + const gint *value_map) { gint active; gint i; diff --git a/e-util/e-event.c b/e-util/e-event.c index 4611995c91..ca978820e9 100644 --- a/e-util/e-event.c +++ b/e-util/e-event.c @@ -175,7 +175,8 @@ e_event_add_items (EEvent *event, * added, and may only be removed once. **/ void -e_event_remove_items (EEvent *event, gpointer handle) +e_event_remove_items (EEvent *event, + gpointer handle) { struct _event_node *node = handle; @@ -193,7 +194,8 @@ e_event_remove_items (EEvent *event, gpointer handle) } static gint -ee_cmp (gconstpointer ap, gconstpointer bp) +ee_cmp (gconstpointer ap, + gconstpointer bp) { gint a = ((struct _event_info **) ap)[0]->item->priority; gint b = ((struct _event_info **) bp)[0]->item->priority; @@ -217,7 +219,9 @@ ee_cmp (gconstpointer ap, gconstpointer bp) * emission is complete. **/ void -e_event_emit (EEvent *event, const gchar *id, EEventTarget *target) +e_event_emit (EEvent *event, + const gchar *id, + EEventTarget *target) { EEventPrivate *p = event->priv; GSList *events; @@ -238,7 +242,7 @@ e_event_emit (EEvent *event, const gchar *id, EEventTarget *target) struct _event_node *node = link->data; GSList *l = node->events; - for (;l;l=g_slist_next (l)) { + for (; l; l = g_slist_next (l)) { struct _event_info *info; info = g_malloc0 (sizeof (*info)); @@ -253,7 +257,7 @@ e_event_emit (EEvent *event, const gchar *id, EEventTarget *target) p->sorted = events = g_slist_sort (events, ee_cmp); } - for (;events;events=g_slist_next (events)) { + for (; events; events = g_slist_next (events)) { struct _event_info *info = events->data; EEventItem *item = info->item; @@ -325,42 +329,42 @@ e_event_target_free (EEvent *event, /* Event menu plugin handler */ /* -<e-plugin - class="org.gnome.mail.plugin.event:1.0" - id="org.gnome.mail.plugin.event.item:1.0" - type="shlib" - location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" - name="imap" - description="IMAP4 and IMAP4v1 mail store"> - <hook class="org.gnome.mail.eventMenu:1.0" - handler="HandleEvent"> - <menu id="any" target="select"> - <item - type="item|toggle|radio|image|submenu|bar" - active - path="foo/bar" - label="label" - icon="foo" - mask="select_one" - activate="ep_view_emacs"/> - </menu> - </extension> - - <hook class="org.gnome.evolution.mail.events:1.0"> - <event id=".folder.changed" - target="" - priority="0" - handle="gotevent" - enable="new" - /> - <event id=".message.read" - priority="0" - handle="gotevent" - mask="new" - /> - </hook> - -*/ + * <e-plugin + * class="org.gnome.mail.plugin.event:1.0" + * id="org.gnome.mail.plugin.event.item:1.0" + * type="shlib" + * location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" + * name="imap" + * description="IMAP4 and IMAP4v1 mail store"> + * <hook class="org.gnome.mail.eventMenu:1.0" + * handler="HandleEvent"> + * <menu id="any" target="select"> + * <item + * type="item|toggle|radio|image|submenu|bar" + * active + * path="foo/bar" + * label="label" + * icon="foo" + * mask="select_one" + * activate="ep_view_emacs"/> + * </menu> + * </hook> + * + * <hook class="org.gnome.evolution.mail.events:1.0"> + * <event id=".folder.changed" + * target="" + * priority="0" + * handle="gotevent" + * enable="new" + * /> + * <event id=".message.read" + * priority="0" + * handle="gotevent" + * mask="new" + * /> + * </hook> + * + */ #define emph ((EEventHook *)eph) @@ -377,7 +381,9 @@ G_DEFINE_TYPE ( E_TYPE_PLUGIN_HOOK) static void -emph_event_handle (EEvent *ee, EEventItem *item, gpointer data) +emph_event_handle (EEvent *ee, + EEventItem *item, + gpointer data) { EEventHook *hook = data; @@ -399,7 +405,9 @@ emph_free_item (EEventItem *item) } static void -emph_free_items (EEvent *ee, GSList *items, gpointer data) +emph_free_items (EEvent *ee, + GSList *items, + gpointer data) { /*EPluginHook *eph = data;*/ @@ -408,7 +416,9 @@ emph_free_items (EEvent *ee, GSList *items, gpointer data) } static EEventItem * -emph_construct_item (EPluginHook *eph, xmlNodePtr root, EEventHookClass *class) +emph_construct_item (EPluginHook *eph, + xmlNodePtr root, + EEventHookClass *class) { EEventItem *item; EEventHookTargetMap *map; @@ -444,7 +454,9 @@ error: } static gint -emph_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) +emph_construct (EPluginHook *eph, + EPlugin *ep, + xmlNodePtr root) { xmlNodePtr node; EEventHookClass *class; diff --git a/e-util/e-event.h b/e-util/e-event.h index e7999dc5c2..90a3b735fb 100644 --- a/e-util/e-event.h +++ b/e-util/e-event.h @@ -21,9 +21,7 @@ * */ -/* - This a bit 'whipped together', so is likely to change mid-term -*/ +/* This a bit 'whipped together', so is likely to change mid-term */ #ifndef E_EVENT_H #define E_EVENT_H @@ -194,10 +192,10 @@ void e_event_target_free (EEvent *event, /* event plugin target, they are closely integrated */ /* To implement a basic event menu plugin, you just need to subclass - this and initialise the class target type tables */ + * this and initialise the class target type tables */ /* For events, the plugin item talks to a specific instance, rather than - a set of instances of the hook handler */ + * a set of instances of the hook handler */ #include "e-util/e-plugin.h" diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index 10e3519865..3a863da096 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -31,7 +31,10 @@ #include "e-html-utils.h" static gchar * -check_size (gchar **buffer, gint *buffer_size, gchar *out, gint len) +check_size (gchar **buffer, + gint *buffer_size, + gchar *out, + gint len) { if (out + len + 1> *buffer + *buffer_size) { gint index = out - *buffer; @@ -72,7 +75,8 @@ static gint special_chars[] = { /* www\.[A-Za-z0-9.-]+(/([^ "|]*[^ ,.!?;:>)\]}`'"|_-])+) */ static gchar * -url_extract (const guchar **text, gboolean full_url) +url_extract (const guchar **text, + gboolean full_url) { const guchar *end = *text, *p; gchar *out; @@ -99,13 +103,15 @@ url_extract (const guchar **text, gboolean full_url) return NULL; } - out = g_strndup ((gchar *)*text, end - *text); + out = g_strndup ((gchar *) * text, end - *text); *text = end; return out; } static gchar * -email_address_extract (const guchar **cur, gchar **out, const guchar *linestart) +email_address_extract (const guchar **cur, + gchar **out, + const guchar *linestart) { const guchar *start, *end, *dot; gchar *addr; @@ -141,7 +147,8 @@ email_address_extract (const guchar **cur, gchar **out, const guchar *linestart) } static gboolean -is_citation (const guchar *c, gboolean saw_citation) +is_citation (const guchar *c, + gboolean saw_citation) { const guchar *p; @@ -218,7 +225,9 @@ is_citation (const guchar *c, gboolean saw_citation) * Returns: a newly-allocated string containing HTML **/ gchar * -e_text_to_html_full (const gchar *input, guint flags, guint32 color) +e_text_to_html_full (const gchar *input, + guint flags, + guint32 color) { const guchar *cur, *next, *linestart; gchar *buffer = NULL; @@ -436,7 +445,8 @@ e_text_to_html_full (const gchar *input, guint flags, guint32 color) } gchar * -e_text_to_html (const gchar *input, guint flags) +e_text_to_html (const gchar *input, + guint flags) { return e_text_to_html_full (input, flags, 0); } @@ -506,7 +516,8 @@ struct { gint num_url_tests = G_N_ELEMENTS (url_tests); gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { gint i, errors = 0; gchar *html, *url, *p; diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c index afb879a4c2..894382e047 100644 --- a/e-util/e-icon-factory.c +++ b/e-util/e-icon-factory.c @@ -136,7 +136,9 @@ e_icon_factory_get_icon (const gchar *icon_name, * Returns: a scaled #GdkPixbuf **/ GdkPixbuf * -e_icon_factory_pixbuf_scale (GdkPixbuf *pixbuf, gint width, gint height) +e_icon_factory_pixbuf_scale (GdkPixbuf *pixbuf, + gint width, + gint height) { g_return_val_if_fail (pixbuf != NULL, NULL); diff --git a/e-util/e-import.c b/e-util/e-import.c index 4b55895e66..ab3afc9f33 100644 --- a/e-util/e-import.c +++ b/e-util/e-import.c @@ -257,7 +257,8 @@ e_import_status (EImport *import, * no longer needed. **/ GSList * -e_import_get_importers (EImport *emp, EImportTarget *target) +e_import_get_importers (EImport *emp, + EImportTarget *target) { GSList *importers = NULL; GList *link; @@ -328,7 +329,9 @@ e_import_class_add_importer (EImportClass *class, * classes will define the actual content of the target. **/ gpointer -e_import_target_new (EImport *ep, gint type, gsize size) +e_import_target_new (EImport *ep, + gint type, + gsize size) { EImportTarget *t; @@ -355,7 +358,8 @@ e_import_target_new (EImport *ep, gint type, gsize size) * free custom targets. **/ void -e_import_target_free (EImport *ep, gpointer o) +e_import_target_free (EImport *ep, + gpointer o) { EImportTarget *t = o; @@ -388,27 +392,26 @@ e_import_target_new_home (EImport *import) /* Import menu plugin handler */ /* -<e-plugin - class="org.gnome.mail.plugin.import:1.0" - id="org.gnome.mail.plugin.import.item:1.0" - type="shlib" - location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" - name="imap" - description="IMAP4 and IMAP4v1 mail store"> - <hook class="org.gnome.mail.importMenu:1.0" - handler="HandleImport"> - <menu id="any" target="select"> - <item - type="item|toggle|radio|image|submenu|bar" - active - path="foo/bar" - label="label" - icon="foo" - activate="ep_view_emacs"/> - </menu> - </extension> - -*/ + * <e-plugin + * class="org.gnome.mail.plugin.import:1.0" + * id="org.gnome.mail.plugin.import.item:1.0" + * type="shlib" + * location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" + * name="imap" + * description="IMAP4 and IMAP4v1 mail store"> + * <hook class="org.gnome.mail.importMenu:1.0" + * handler="HandleImport"> + * <menu id="any" target="select"> + * <item + * type="item|toggle|radio|image|submenu|bar" + * active + * path="foo/bar" + * label="label" + * icon="foo" + * activate="ep_view_emacs"/> + * </menu> + * </e-plugin> + */ #define emph ((EImportHook *)eph) @@ -472,7 +475,8 @@ eih_cancel (EImport *ei, } static void -eih_free_importer (EImportImporter *im, gpointer data) +eih_free_importer (EImportImporter *im, + gpointer data) { EImportHookImporter *ihook = (EImportHookImporter *) im; @@ -483,7 +487,8 @@ eih_free_importer (EImportImporter *im, gpointer data) } static struct _EImportHookImporter * -emph_construct_importer (EPluginHook *eph, xmlNodePtr root) +emph_construct_importer (EPluginHook *eph, + xmlNodePtr root) { struct _EImportHookImporter *item; EImportHookTargetMap *map; @@ -530,7 +535,9 @@ error: } static gint -emph_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) +emph_construct (EPluginHook *eph, + EPlugin *ep, + xmlNodePtr root) { xmlNodePtr node; EImportClass *class; diff --git a/e-util/e-import.h b/e-util/e-import.h index 4fc3294e3b..9d0eb5127a 100644 --- a/e-util/e-import.h +++ b/e-util/e-import.h @@ -242,7 +242,7 @@ EImportTargetHome * /* import plugin target, they are closely integrated */ /* To implement a basic import plugin, you just need to subclass - this and initialise the class target type tables */ + * this and initialise the class target type tables */ #include "e-util/e-plugin.h" diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index 2ce5a6717c..af9327f471 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -49,7 +49,8 @@ #define TEMP_SCAN (60) static gint -expire_dir_rec (const gchar *base, time_t now) +expire_dir_rec (const gchar *base, + time_t now) { GDir *dir; const gchar *d; @@ -157,7 +158,7 @@ get_dir (gboolean make) d(printf("temp dir '%s'\n", path ? path->str : "(null)")); /* fire off an expiry attempt no more often than TEMP_SCAN seconds */ - if (path && (last+TEMP_SCAN) < now) { + if (path && (last + TEMP_SCAN) < now) { last = now; expire_dir_rec (path->str, now); } diff --git a/e-util/e-plugin-util.c b/e-util/e-plugin-util.c index aa1b233754..7fd343d4b1 100644 --- a/e-util/e-plugin-util.c +++ b/e-util/e-plugin-util.c @@ -35,7 +35,8 @@ #define EPU_CHECK_FALSE "epu-check-false-value" static gboolean -epu_is_uri_proto (const gchar *uri, const gchar *protocol) +epu_is_uri_proto (const gchar *uri, + const gchar *protocol) { gboolean res; @@ -60,7 +61,8 @@ epu_is_uri_proto (const gchar *uri, const gchar *protocol) * Returns: whether given source's uri is of the given protocol. **/ gboolean -e_plugin_util_is_source_proto (ESource *source, const gchar *protocol) +e_plugin_util_is_source_proto (ESource *source, + const gchar *protocol) { gchar *uri; gboolean res; @@ -85,7 +87,8 @@ e_plugin_util_is_source_proto (ESource *source, const gchar *protocol) * Returns: whether given groups' base uri is of the given protocol. **/ gboolean -e_plugin_util_is_group_proto (ESourceGroup *group, const gchar *protocol) +e_plugin_util_is_group_proto (ESourceGroup *group, + const gchar *protocol) { g_return_val_if_fail (E_IS_SOURCE_GROUP (group), FALSE); g_return_val_if_fail (protocol != NULL, FALSE); @@ -158,7 +161,9 @@ e_plugin_util_uri_no_proto (SoupURI *uri) } static void -epu_update_source_property (ESource *source, GObject *object, const gchar *value) +epu_update_source_property (ESource *source, + GObject *object, + const gchar *value) { const gchar *property_name; @@ -172,7 +177,8 @@ epu_update_source_property (ESource *source, GObject *object, const gchar *value } static void -epu_entry_changed_cb (GObject *entry, ESource *source) +epu_entry_changed_cb (GObject *entry, + ESource *source) { g_return_if_fail (GTK_IS_ENTRY (entry)); @@ -180,7 +186,8 @@ epu_entry_changed_cb (GObject *entry, ESource *source) } static void -epu_check_toggled_cb (GObject *button, ESource *source) +epu_check_toggled_cb (GObject *button, + ESource *source) { const gchar *true_value, *false_value; @@ -208,7 +215,10 @@ epu_check_toggled_cb (GObject *button, ESource *source) * Returns: pointer to newly added #GtkEntry **/ GtkWidget * -e_plugin_util_add_entry (GtkWidget *parent, const gchar *label, ESource *source, const gchar *source_property) +e_plugin_util_add_entry (GtkWidget *parent, + const gchar *label, + ESource *source, + const gchar *source_property) { GtkWidget *entry, *lbl = NULL; const gchar *value; @@ -254,7 +264,9 @@ e_plugin_util_add_entry (GtkWidget *parent, const gchar *label, ESource *source, if (source) { g_object_set_data_full (G_OBJECT (entry), EPU_SP_NAME, g_strdup (source_property), g_free); - g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (epu_entry_changed_cb), source); + g_signal_connect ( + entry, "changed", + G_CALLBACK (epu_entry_changed_cb), source); } return entry; @@ -278,7 +290,12 @@ e_plugin_util_add_entry (GtkWidget *parent, const gchar *label, ESource *source, * Returns: pointer to newly added #GtkCheckButton **/ GtkWidget * -e_plugin_util_add_check (GtkWidget *parent, const gchar *label, ESource *source, const gchar *source_property, const gchar *true_value, const gchar *false_value) +e_plugin_util_add_check (GtkWidget *parent, + const gchar *label, + ESource *source, + const gchar *source_property, + const gchar *true_value, + const gchar *false_value) { GtkWidget *check; const gchar *value; @@ -318,14 +335,18 @@ e_plugin_util_add_check (GtkWidget *parent, const gchar *label, ESource *source, g_object_set_data_full (G_OBJECT (check), EPU_SP_NAME, g_strdup (source_property), g_free); g_object_set_data_full (G_OBJECT (check), EPU_CHECK_TRUE, g_strdup (true_value), g_free); g_object_set_data_full (G_OBJECT (check), EPU_CHECK_FALSE, g_strdup (false_value), g_free); - g_signal_connect (G_OBJECT (check), "toggled", G_CALLBACK (epu_check_toggled_cb), source); + g_signal_connect ( + check, "toggled", + G_CALLBACK (epu_check_toggled_cb), source); } return check; } static void -epu_update_refresh_value (GtkWidget *spin, GtkWidget *combobox, ESource *source) +epu_update_refresh_value (GtkWidget *spin, + GtkWidget *combobox, + ESource *source) { gchar *value; gint setting = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin)); @@ -356,7 +377,8 @@ epu_update_refresh_value (GtkWidget *spin, GtkWidget *combobox, ESource *source) } static void -epu_refresh_spin_changed_cb (GtkWidget *spin, ESource *source) +epu_refresh_spin_changed_cb (GtkWidget *spin, + ESource *source) { g_return_if_fail (spin != NULL); g_return_if_fail (GTK_IS_SPIN_BUTTON (spin)); @@ -365,7 +387,8 @@ epu_refresh_spin_changed_cb (GtkWidget *spin, ESource *source) } static void -epu_refresh_combo_changed_cb (GtkWidget *combobox, ESource *source) +epu_refresh_combo_changed_cb (GtkWidget *combobox, + ESource *source) { g_return_if_fail (combobox != NULL); g_return_if_fail (GTK_IS_COMBO_BOX (combobox)); @@ -387,7 +410,10 @@ epu_refresh_combo_changed_cb (GtkWidget *combobox, ESource *source) * Returns: a new refresh control widget **/ GtkWidget * -e_plugin_util_add_refresh (GtkWidget *parent, const gchar *label, ESource *source, const gchar *source_property) +e_plugin_util_add_refresh (GtkWidget *parent, + const gchar *label, + ESource *source, + const gchar *source_property) { GtkWidget *lbl = NULL, *hbox, *spin, *combo; const gchar *value; @@ -457,8 +483,12 @@ e_plugin_util_add_refresh (GtkWidget *parent, const gchar *label, ESource *sourc g_object_set_data (G_OBJECT (spin), "refresh-combo", combo); g_object_set_data (G_OBJECT (hbox), "refresh-spin", spin); g_object_set_data (G_OBJECT (hbox), "refresh-combo", combo); - g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (epu_refresh_combo_changed_cb), source); - g_signal_connect (G_OBJECT (spin), "value-changed", G_CALLBACK (epu_refresh_spin_changed_cb), source); + g_signal_connect ( + combo, "changed", + G_CALLBACK (epu_refresh_combo_changed_cb), source); + g_signal_connect ( + spin, "value-changed", + G_CALLBACK (epu_refresh_spin_changed_cb), source); if (parent) gtk_table_attach (GTK_TABLE (parent), hbox, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c index 52bbe101cb..17650f045a 100644 --- a/e-util/e-plugin.c +++ b/e-util/e-plugin.c @@ -40,29 +40,29 @@ #define phd(x) /* -<camel-plugin - class="org.gnome.camel.plugin.provider:1.0" - id="org.gnome.camel.provider.imap:1.0" - type="shlib" - location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" - factory="camel_imap_provider_new"> - <name>imap</name> - <description>IMAP4 and IMAP4v1 mail store</description> - <class-data class="org.gnome.camel.plugin.provider:1.0" - protocol="imap" - domain="mail" - flags="remote,source,storage,ssl"/> -</camel-plugin> - -<camel-plugin - class="org.gnome.camel.plugin.sasl:1.0" - id="org.gnome.camel.sasl.plain:1.0" - type="shlib" - location="/opt/gnome2/lib/camel/1.0/libcamelsasl.so" - factory="camel_sasl_plain_new"> - <name>PLAIN</name> - <description>SASL PLAIN authentication mechanism</description> -</camel-plugin> + * <camel-plugin + * class="org.gnome.camel.plugin.provider:1.0" + * id="org.gnome.camel.provider.imap:1.0" + * type="shlib" + * location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" + * factory="camel_imap_provider_new"> + * <name>imap</name> + * <description>IMAP4 and IMAP4v1 mail store</description> + * <class-data class="org.gnome.camel.plugin.provider:1.0" + * protocol="imap" + * domain="mail" + * flags="remote,source,storage,ssl"/> + * </camel-plugin> + * + * <camel-plugin + * class="org.gnome.camel.plugin.sasl:1.0" + * id="org.gnome.camel.sasl.plain:1.0" + * type="shlib" + * location="/opt/gnome2/lib/camel/1.0/libcamelsasl.so" + * factory="camel_sasl_plain_new"> + * <name>PLAIN</name> + * <description>SASL PLAIN authentication mechanism</description> + * </camel-plugin> */ /* EPlugin stuff */ @@ -105,7 +105,8 @@ ep_check_enabled (const gchar *id) } static void -ep_set_enabled (const gchar *id, gint state) +ep_set_enabled (const gchar *id, + gint state) { GConfClient *client; @@ -133,7 +134,8 @@ ep_set_enabled (const gchar *id, gint state) } static gint -ep_construct (EPlugin *ep, xmlNodePtr root) +ep_construct (EPlugin *ep, + xmlNodePtr root) { xmlNodePtr node; gint res = -1; @@ -159,7 +161,7 @@ ep_construct (EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { if (strcmp((gchar *)node->name, "hook") == 0) { - struct _EPluginHook *hook; + EPluginHook *hook; EPluginHookClass *type; gchar *class = e_plugin_xml_prop(node, "class"); @@ -213,7 +215,8 @@ fail: } static void -ep_enable (EPlugin *ep, gint state) +ep_enable (EPlugin *ep, + gint state) { GSList *iter; @@ -328,7 +331,8 @@ e_plugin_init (EPlugin *ep) } static EPlugin * -ep_load_plugin (xmlNodePtr root, struct _plugin_doc *pdoc) +ep_load_plugin (xmlNodePtr root, + struct _plugin_doc *pdoc) { gchar *prop, *id; EPluginClass *class; @@ -375,7 +379,8 @@ ep_load_plugin (xmlNodePtr root, struct _plugin_doc *pdoc) } static gint -ep_load (const gchar *filename, gint load_level) +ep_load (const gchar *filename, + gint load_level) { xmlDocPtr doc; xmlNodePtr root; @@ -545,8 +550,8 @@ e_plugin_load_plugins (void) GCONF_VALUE_STRING, NULL); g_object_unref (client); - for (i=0; i < 3; i++) { - for (l = ep_path;l;l = g_slist_next (l)) { + for (i = 0; i < 3; i++) { + for (l = ep_path; l; l = g_slist_next (l)) { GDir *dir; const gchar *d; gchar *path = l->data; @@ -577,7 +582,9 @@ e_plugin_load_plugins (void) } static void -ep_list_plugin (gpointer key, gpointer val, gpointer dat) +ep_list_plugin (gpointer key, + gpointer val, + gpointer dat) { GSList **l = (GSList **) dat; @@ -615,7 +622,8 @@ e_plugin_list_plugins (void) * Return value: The return from the construct virtual method. **/ gint -e_plugin_construct (EPlugin *ep, xmlNodePtr root) +e_plugin_construct (EPlugin *ep, + xmlNodePtr root) { EPluginClass *class; @@ -641,7 +649,9 @@ e_plugin_construct (EPlugin *ep, xmlNodePtr root) * Return value: The return of the plugin invocation. **/ gpointer -e_plugin_invoke (EPlugin *ep, const gchar *name, gpointer data) +e_plugin_invoke (EPlugin *ep, + const gchar *name, + gpointer data) { EPluginClass *class; @@ -668,7 +678,8 @@ e_plugin_invoke (EPlugin *ep, const gchar *name, gpointer data) * Return value: the symbol value, or %NULL if not found **/ gpointer -e_plugin_get_symbol (EPlugin *ep, const gchar *name) +e_plugin_get_symbol (EPlugin *ep, + const gchar *name) { EPluginClass *class; @@ -690,7 +701,8 @@ e_plugin_get_symbol (EPlugin *ep, const gchar *name) * THIS IS NOT FULLY IMPLEMENTED YET **/ void -e_plugin_enable (EPlugin *ep, gint state) +e_plugin_enable (EPlugin *ep, + gint state) { EPluginClass *class; @@ -741,7 +753,8 @@ e_plugin_get_configure_widget (EPlugin *ep) * such property exists. **/ gchar * -e_plugin_xml_prop (xmlNodePtr node, const gchar *id) +e_plugin_xml_prop (xmlNodePtr node, + const gchar *id) { xmlChar *xml_prop; gchar *glib_prop = NULL; @@ -769,7 +782,9 @@ e_plugin_xml_prop (xmlNodePtr node, const gchar *id) * such property exists. **/ gchar * -e_plugin_xml_prop_domain (xmlNodePtr node, const gchar *id, const gchar *domain) +e_plugin_xml_prop_domain (xmlNodePtr node, + const gchar *id, + const gchar *domain) { gchar *p, *out; @@ -797,7 +812,9 @@ e_plugin_xml_prop_domain (xmlNodePtr node, const gchar *id, const gchar *domain) * Return value: The value if set, or @def if not. **/ gint -e_plugin_xml_int (xmlNodePtr node, const gchar *id, gint def) +e_plugin_xml_int (xmlNodePtr node, + const gchar *id, + gint def) { gchar *p = (gchar *) xmlGetProp (node, (const guchar *) id); @@ -845,7 +862,8 @@ e_plugin_xml_content (xmlNodePtr node) * Return value: The node content, allocated in GLib memory. **/ gchar * -e_plugin_xml_content_domain (xmlNodePtr node, const gchar *domain) +e_plugin_xml_content_domain (xmlNodePtr node, + const gchar *domain) { gchar *p, *out; @@ -867,7 +885,9 @@ G_DEFINE_TYPE ( G_TYPE_OBJECT) static gint -eph_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) +eph_construct (EPluginHook *eph, + EPlugin *ep, + xmlNodePtr root) { eph->plugin = ep; @@ -875,7 +895,8 @@ eph_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) } static void -eph_enable (EPluginHook *eph, gint state) +eph_enable (EPluginHook *eph, + gint state) { /* NOOP */ } @@ -903,7 +924,8 @@ e_plugin_hook_init (EPluginHook *hook) * THIS IS NOT FULY IMEPLEMENTED YET **/ void -e_plugin_hook_enable (EPluginHook *eph, gint state) +e_plugin_hook_enable (EPluginHook *eph, + gint state) { EPluginHookClass *class; @@ -932,7 +954,7 @@ e_plugin_hook_enable (EPluginHook *eph, gint state) **/ guint32 e_plugin_hook_mask (xmlNodePtr root, - const struct _EPluginHookTargetKey *map, + const EPluginHookTargetKey *map, const gchar *prop) { gchar *val, *p, *start, c; @@ -952,7 +974,7 @@ e_plugin_hook_mask (xmlNodePtr root, if (start != p) { gint i; - for (i=0;map[i].key;i++) { + for (i = 0; map[i].key; i++) { if (!strcmp (map[i].key, start)) { mask |= map[i].value; break; @@ -985,7 +1007,7 @@ e_plugin_hook_mask (xmlNodePtr root, **/ guint32 e_plugin_hook_id (xmlNodePtr root, - const struct _EPluginHookTargetKey *map, + const EPluginHookTargetKey *map, const gchar *prop) { gchar *val; @@ -995,7 +1017,7 @@ e_plugin_hook_id (xmlNodePtr root, if (val == NULL) return ~0; - for (i=0;map[i].key;i++) { + for (i = 0; map[i].key; i++) { if (!strcmp (map[i].key, val)) { xmlFree (val); return map[i].value; diff --git a/e-util/e-plugin.h b/e-util/e-plugin.h index 057e80d743..1815665134 100644 --- a/e-util/e-plugin.h +++ b/e-util/e-plugin.h @@ -89,7 +89,7 @@ struct _EPlugin { guint32 flags; - guint enabled:1; + guint enabled : 1; }; /** @@ -273,8 +273,8 @@ guint32 e_plugin_hook_id (xmlNodePtr root, const gchar *prop); /* README: Currently there is only one flag. - But we may need more in the future and hence makes - sense to keep as an enum */ + * But we may need more in the future and hence makes + * sense to keep as an enum */ typedef enum _EPluginFlags { E_PLUGIN_FLAGS_SYSTEM_PLUGIN = 1 << 0 diff --git a/e-util/e-poolv.c b/e-util/e-poolv.c index b30149d617..ca95286f69 100644 --- a/e-util/e-poolv.c +++ b/e-util/e-poolv.c @@ -87,7 +87,10 @@ e_poolv_new (guint size) * Returns: @poolv **/ EPoolv * -e_poolv_set (EPoolv *poolv, gint index, gchar *str, gint freeit) +e_poolv_set (EPoolv *poolv, + gint index, + gchar *str, + gint freeit) { g_return_val_if_fail (poolv != NULL, NULL); g_return_val_if_fail (index >= 0 && index < poolv->length, NULL); @@ -126,7 +129,8 @@ e_poolv_set (EPoolv *poolv, gint index, gchar *str, gint freeit) * Returns: string at that index. **/ const gchar * -e_poolv_get (EPoolv *poolv, gint index) +e_poolv_get (EPoolv *poolv, + gint index) { g_return_val_if_fail (poolv != NULL, NULL); g_return_val_if_fail (index >= 0 && index < poolv->length, NULL); diff --git a/e-util/e-signature-list.c b/e-util/e-signature-list.c index 43c943ac05..1f03cd3305 100644 --- a/e-util/e-signature-list.c +++ b/e-util/e-signature-list.c @@ -117,7 +117,8 @@ e_signature_list_init (ESignatureList *signature_list) } static GSList * -add_autogen (ESignatureList *list, GSList *new_sigs) +add_autogen (ESignatureList *list, + GSList *new_sigs) { ESignature *autogen; @@ -241,7 +242,8 @@ gconf_signatures_changed (GConfClient *client, } static gpointer -copy_func (gconstpointer data, gpointer closure) +copy_func (gconstpointer data, + gpointer closure) { GObject *object = (GObject *) data; @@ -251,7 +253,8 @@ copy_func (gconstpointer data, gpointer closure) } static void -free_func (gpointer data, gpointer closure) +free_func (gpointer data, + gpointer closure) { g_object_unref (data); } @@ -285,7 +288,8 @@ e_signature_list_new (GConfClient *gconf) } void -e_signature_list_construct (ESignatureList *signature_list, GConfClient *gconf) +e_signature_list_construct (ESignatureList *signature_list, + GConfClient *gconf) { g_return_if_fail (GCONF_IS_CLIENT (gconf)); @@ -359,7 +363,8 @@ e_signature_list_save (ESignatureList *signature_list) * event. **/ void -e_signature_list_add (ESignatureList *signature_list, ESignature *signature) +e_signature_list_add (ESignatureList *signature_list, + ESignature *signature) { e_list_append ((EList *) signature_list, signature); g_signal_emit (signature_list, signals[SIGNATURE_ADDED], 0, signature); @@ -373,7 +378,8 @@ e_signature_list_add (ESignatureList *signature_list, ESignature *signature) * Signal that the details of an signature have changed. **/ void -e_signature_list_change (ESignatureList *signature_list, ESignature *signature) +e_signature_list_change (ESignatureList *signature_list, + ESignature *signature) { /* maybe the signature should do this itself ... */ g_signal_emit (signature_list, signals[SIGNATURE_CHANGED], 0, signature); @@ -389,7 +395,8 @@ e_signature_list_change (ESignatureList *signature_list, ESignature *signature) * then reset the default to the first signature. **/ void -e_signature_list_remove (ESignatureList *signature_list, ESignature *signature) +e_signature_list_remove (ESignatureList *signature_list, + ESignature *signature) { /* not sure if need to ref but no harm */ g_object_ref (signature); @@ -417,7 +424,7 @@ e_signature_list_find_by_name (ESignatureList *signature_list, g_return_val_if_fail (E_IS_SIGNATURE_LIST (signature_list), NULL); /* this could use a callback for more flexibility ... - ... but this makes the common cases easier */ + * ... but this makes the common cases easier */ if (signature_name == NULL) return NULL; @@ -461,7 +468,7 @@ e_signature_list_find_by_uid (ESignatureList *signature_list, g_return_val_if_fail (E_IS_SIGNATURE_LIST (signature_list), NULL); /* this could use a callback for more flexibility ... - ... but this makes the common cases easier */ + * ... but this makes the common cases easier */ if (signature_uid == NULL) return NULL; diff --git a/e-util/e-signature.c b/e-util/e-signature.c index 434ba1c4b4..185378d565 100644 --- a/e-util/e-signature.c +++ b/e-util/e-signature.c @@ -404,7 +404,8 @@ e_signature_uid_from_xml (const gchar *xml) * Returns: %TRUE if the signature was loaded or %FALSE otherwise **/ gboolean -e_signature_set_from_xml (ESignature *signature, const gchar *xml) +e_signature_set_from_xml (ESignature *signature, + const gchar *xml) { gboolean changed = FALSE; xmlNodePtr node, cur; diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c index 074d45d639..b36eb06007 100644 --- a/e-util/e-sorter-array.c +++ b/e-util/e-sorter-array.c @@ -55,7 +55,9 @@ static gboolean esa_needs_sorting (ESorter *esa); #define ESA_NEEDS_SORTING(esa) (((ESorterArray *) (esa))->compare != NULL) static gint -esort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) +esort_callback (gconstpointer data1, + gconstpointer data2, + gpointer user_data) { ESorterArray *esa = user_data; gint ret_val; @@ -125,7 +127,8 @@ esa_backsort (ESorterArray *esa) } static gint -esa_model_to_sorted (ESorter *es, gint row) +esa_model_to_sorted (ESorter *es, + gint row) { ESorterArray *esa = E_SORTER_ARRAY (es); @@ -142,7 +145,8 @@ esa_model_to_sorted (ESorter *es, gint row) } static gint -esa_sorted_to_model (ESorter *es, gint row) +esa_sorted_to_model (ESorter *es, + gint row) { ESorterArray *esa = (ESorterArray *) es; @@ -159,7 +163,9 @@ esa_sorted_to_model (ESorter *es, gint row) } static void -esa_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) +esa_get_model_to_sorted_array (ESorter *es, + gint **array, + gint *count) { ESorterArray *esa = E_SORTER_ARRAY (es); if (array || count) { @@ -173,7 +179,9 @@ esa_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) } static void -esa_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) +esa_get_sorted_to_model_array (ESorter *es, + gint **array, + gint *count) { ESorterArray *esa = E_SORTER_ARRAY (es); if (array || count) { @@ -204,14 +212,16 @@ e_sorter_array_clean (ESorterArray *esa) } void -e_sorter_array_set_count (ESorterArray *esa, gint count) +e_sorter_array_set_count (ESorterArray *esa, + gint count) { e_sorter_array_clean (esa); esa->rows = count; } void -e_sorter_array_append (ESorterArray *esa, gint count) +e_sorter_array_append (ESorterArray *esa, + gint count) { gint i; g_free (esa->backsorted); @@ -239,10 +249,10 @@ e_sorter_array_append (ESorterArray *esa, gint count) } ESorterArray * -e_sorter_array_construct (ESorterArray *esa, - ECreateCmpCacheFunc create_cmp_cache, - ECompareRowsFunc compare, - gpointer closure) +e_sorter_array_construct (ESorterArray *esa, + ECreateCmpCacheFunc create_cmp_cache, + ECompareRowsFunc compare, + gpointer closure) { esa->create_cmp_cache = create_cmp_cache; esa->compare = compare; diff --git a/e-util/e-sorter.c b/e-util/e-sorter.c index 9e255e89f2..de10916634 100644 --- a/e-util/e-sorter.c +++ b/e-util/e-sorter.c @@ -69,24 +69,30 @@ e_sorter_new (void) } static gint -es_model_to_sorted (ESorter *es, gint row) +es_model_to_sorted (ESorter *es, + gint row) { return row; } static gint -es_sorted_to_model (ESorter *es, gint row) +es_sorted_to_model (ESorter *es, + gint row) { return row; } static void -es_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) +es_get_model_to_sorted_array (ESorter *es, + gint **array, + gint *count) { } static void -es_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) +es_get_sorted_to_model_array (ESorter *es, + gint **array, + gint *count) { } @@ -97,7 +103,8 @@ es_needs_sorting (ESorter *es) } gint -e_sorter_model_to_sorted (ESorter *es, gint row) +e_sorter_model_to_sorted (ESorter *es, + gint row) { g_return_val_if_fail (es != NULL, -1); g_return_val_if_fail (row >= 0, -1); @@ -109,7 +116,8 @@ e_sorter_model_to_sorted (ESorter *es, gint row) } gint -e_sorter_sorted_to_model (ESorter *es, gint row) +e_sorter_sorted_to_model (ESorter *es, + gint row) { g_return_val_if_fail (es != NULL, -1); g_return_val_if_fail (row >= 0, -1); @@ -121,7 +129,9 @@ e_sorter_sorted_to_model (ESorter *es, gint row) } void -e_sorter_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) +e_sorter_get_model_to_sorted_array (ESorter *es, + gint **array, + gint *count) { g_return_if_fail (es != NULL); @@ -130,7 +140,9 @@ e_sorter_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) } void -e_sorter_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) +e_sorter_get_sorted_to_model_array (ESorter *es, + gint **array, + gint *count) { g_return_if_fail (es != NULL); diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c index 84e7c9e148..d5267d5b30 100644 --- a/e-util/e-text-event-processor-emacs-like.c +++ b/e-util/e-text-event-processor-emacs-like.c @@ -111,7 +111,7 @@ e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass { ETextEventProcessorClass *processor_class; - processor_class = (ETextEventProcessorClass*) klass; + processor_class = (ETextEventProcessorClass *) klass; processor_class->event = e_text_event_processor_emacs_like_event; } @@ -131,9 +131,9 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, /* Warning from the Intel compiler here: * e-text-event-processor-emacs-like.c(136): warning #589: * transfer of control bypasses initialization of: - * variable "key" (declared at line 194) - * switch (event->type) { - * ^ + * * variable "key" (declared at line 194) + * * switch (event->type) { + * * ^ */ switch (event->type) { case GDK_BUTTON_PRESS: diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c index e5624f917a..e8594620c2 100644 --- a/e-util/e-text-event-processor.c +++ b/e-util/e-text-event-processor.c @@ -30,11 +30,11 @@ #include "e-util.h" static void e_text_event_processor_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec); static void e_text_event_processor_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec); @@ -61,7 +61,7 @@ e_text_event_processor_class_init (ETextEventProcessorClass *klass) { GObjectClass *object_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; object_class->set_property = e_text_event_processor_set_property; object_class->get_property = e_text_event_processor_get_property; @@ -107,13 +107,13 @@ e_text_event_processor_handle_event (ETextEventProcessor *tep, /* Set_arg handler for the text item */ static void e_text_event_processor_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETextEventProcessor *tep = E_TEXT_EVENT_PROCESSOR (object); - switch (prop_id) { + switch (property_id) { case PROP_ALLOW_NEWLINES: tep->allow_newlines = g_value_get_boolean (value); break; @@ -125,18 +125,18 @@ e_text_event_processor_set_property (GObject *object, /* Get_arg handler for the text item */ static void e_text_event_processor_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETextEventProcessor *tep = E_TEXT_EVENT_PROCESSOR (object); - switch (prop_id) { + switch (property_id) { case PROP_ALLOW_NEWLINES: g_value_set_boolean (value, tep->allow_newlines); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/e-util/e-unicode.c b/e-util/e-unicode.c index de22525898..d92244107a 100644 --- a/e-util/e-unicode.c +++ b/e-util/e-unicode.c @@ -49,7 +49,9 @@ /* FIXME: this has not been ported fully yet - non ASCII people beware. */ gchar * -e_utf8_from_gtk_event_key (GtkWidget *widget, guint keyval, const gchar *string) +e_utf8_from_gtk_event_key (GtkWidget *widget, + guint keyval, + const gchar *string) { gint unival; gchar *utf; @@ -73,7 +75,9 @@ e_utf8_from_gtk_event_key (GtkWidget *widget, guint keyval, const gchar *string) } gchar * -e_utf8_from_iconv_string_sized (iconv_t ic, const gchar *string, gint bytes) +e_utf8_from_iconv_string_sized (iconv_t ic, + const gchar *string, + gint bytes) { gchar *new, *ob; const gchar *ib; @@ -85,7 +89,7 @@ e_utf8_from_iconv_string_sized (iconv_t ic, const gchar *string, gint bytes) gint i; /* iso-8859-1 */ ib = (gchar *) string; - new = ob = (gchar *) g_new (unsigned char, bytes * 2 + 1); + new = ob = (gchar *) g_new (guchar, bytes * 2 + 1); for (i = 0; i < (bytes); i++) { ob += e_unichar_to_utf8 (ib[i], ob); } @@ -124,7 +128,9 @@ e_utf8_from_iconv_string_sized (iconv_t ic, const gchar *string, gint bytes) } gchar * -e_utf8_to_iconv_string_sized (iconv_t ic, const gchar *string, gint bytes) +e_utf8_to_iconv_string_sized (iconv_t ic, + const gchar *string, + gint bytes) { gchar *new, *ob; const gchar *ib; @@ -137,7 +143,7 @@ e_utf8_to_iconv_string_sized (iconv_t ic, const gchar *string, gint bytes) const gchar *u; gunichar uc; - new = (gchar *) g_new (unsigned char, bytes * 4 + 1); + new = (gchar *) g_new (guchar, bytes * 4 + 1); u = string; len = 0; @@ -201,7 +207,8 @@ e_utf8_to_charset_string_sized (const gchar *charset, } gchar * -e_utf8_from_locale_string_sized (const gchar *string, gint bytes) +e_utf8_from_locale_string_sized (const gchar *string, + gint bytes) { iconv_t ic; gchar *ret; @@ -256,7 +263,8 @@ e_utf8_ensure_valid (const gchar *string) **/ gint -e_unichar_to_utf8 (gint c, gchar *outbuf) +e_unichar_to_utf8 (gint c, + gchar *outbuf) { gsize len = 0; gint first; @@ -307,10 +315,11 @@ e_unichar_to_utf8 (gint c, gchar *outbuf) } gchar * -e_unicode_get_utf8 (const gchar *text, gunichar *out) +e_unicode_get_utf8 (const gchar *text, + gunichar *out) { *out = g_utf8_get_char (text); - return (*out == (gunichar)-1) ? NULL : g_utf8_next_char (text); + return (*out == (gunichar) - 1) ? NULL : g_utf8_next_char (text); } gchar * diff --git a/e-util/e-util.c b/e-util/e-util.c index 4b47f64918..8ededeeb9d 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -566,7 +566,8 @@ e_str_without_underscores (const gchar *string) } gint -e_str_compare (gconstpointer x, gconstpointer y) +e_str_compare (gconstpointer x, + gconstpointer y) { if (x == NULL || y == NULL) { if (x == y) @@ -579,7 +580,8 @@ e_str_compare (gconstpointer x, gconstpointer y) } gint -e_str_case_compare (gconstpointer x, gconstpointer y) +e_str_case_compare (gconstpointer x, + gconstpointer y) { gchar *cx, *cy; gint res; @@ -603,7 +605,8 @@ e_str_case_compare (gconstpointer x, gconstpointer y) } gint -e_collate_compare (gconstpointer x, gconstpointer y) +e_collate_compare (gconstpointer x, + gconstpointer y) { if (x == NULL || y == NULL) { if (x == y) @@ -616,7 +619,8 @@ e_collate_compare (gconstpointer x, gconstpointer y) } gint -e_int_compare (gconstpointer x, gconstpointer y) +e_int_compare (gconstpointer x, + gconstpointer y) { gint nx = GPOINTER_TO_INT (x); gint ny = GPOINTER_TO_INT (y); @@ -727,13 +731,13 @@ e_format_number (gint number) } /* Perform a binary search for key in base which has nmemb elements - of size bytes each. The comparisons are done by (*compare)(). */ + * of size bytes each. The comparisons are done by (*compare)(). */ void e_bsearch (gconstpointer key, gconstpointer base, gsize nmemb, gsize size, - ESortCompareFunc compare, + ESortCompareFunc compare, gpointer closure, gsize *start, gsize *end) @@ -813,7 +817,9 @@ e_bsearch (gconstpointer key, */ gsize -e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, +e_strftime_fix_am_pm (gchar *str, + gsize max, + const gchar *fmt, const struct tm *tm) { gchar buf[10]; @@ -823,7 +829,7 @@ e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, if (strstr(fmt, "%p")==NULL && strstr(fmt, "%P")==NULL) { /* No AM/PM involved - can use the fmt string directly */ - ret=e_strftime (str, max, fmt, tm); + ret = e_strftime (str, max, fmt, tm); } else { /* Get the AM/PM symbol from the locale */ e_strftime (buf, 10, "%p", tm); @@ -831,11 +837,11 @@ e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, if (buf[0]) { /* AM/PM have been defined in the locale * so we can use the fmt string directly. */ - ret=e_strftime (str, max, fmt, tm); + ret = e_strftime (str, max, fmt, tm); } else { /* No AM/PM defined by locale * must change to 24 hour clock. */ - ffmt=g_strdup (fmt); + ffmt = g_strdup (fmt); for (sp=ffmt; (sp=strstr(sp, "%l")); sp++) { /* Maybe this should be 'k', but I have never * seen a 24 clock actually use that format. */ @@ -844,7 +850,7 @@ e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, for (sp=ffmt; (sp=strstr(sp, "%I")); sp++) { sp[1]='H'; } - ret=e_strftime (str, max, ffmt, tm); + ret = e_strftime (str, max, ffmt, tm); g_free (ffmt); } } @@ -853,7 +859,9 @@ e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, } gsize -e_utf8_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, +e_utf8_strftime_fix_am_pm (gchar *str, + gsize max, + const gchar *fmt, const struct tm *tm) { gsize sz, ret; @@ -1004,7 +1012,8 @@ e_get_weekday_name (GDateWeekday weekday, * Returns: the gdouble value **/ gdouble -e_flexible_strtod (const gchar *nptr, gchar **endptr) +e_flexible_strtod (const gchar *nptr, + gchar **endptr) { gchar *fail_pos; gdouble val; @@ -1032,7 +1041,7 @@ e_flexible_strtod (const gchar *nptr, gchar **endptr) p = nptr; /* Skip leading space */ - while (isspace ((guchar)*p)) + while (isspace ((guchar) * p)) p++; /* Skip leading optional sign */ @@ -1044,40 +1053,40 @@ e_flexible_strtod (const gchar *nptr, gchar **endptr) p += 2; /* HEX - find the (optional) decimal point */ - while (isxdigit ((guchar)*p)) + while (isxdigit ((guchar) * p)) p++; if (*p == '.') { decimal_point_pos = p++; - while (isxdigit ((guchar)*p)) + while (isxdigit ((guchar) * p)) p++; if (*p == 'p' || *p == 'P') p++; if (*p == '+' || *p == '-') p++; - while (isdigit ((guchar)*p)) + while (isdigit ((guchar) * p)) p++; end = p; } else if (strncmp (p, decimal_point, decimal_point_len) == 0) { return strtod (nptr, endptr); } } else { - while (isdigit ((guchar)*p)) + while (isdigit ((guchar) * p)) p++; if (*p == '.') { decimal_point_pos = p++; - while (isdigit ((guchar)*p)) + while (isdigit ((guchar) * p)) p++; if (*p == 'e' || *p == 'E') p++; if (*p == '+' || *p == '-') p++; - while (isdigit ((guchar)*p)) + while (isdigit ((guchar) * p)) p++; end = p; } else if (strncmp (p, decimal_point, decimal_point_len) == 0) { @@ -1143,7 +1152,10 @@ e_flexible_strtod (const gchar *nptr, gchar **endptr) * Returns: the pointer to the buffer with the converted string **/ gchar * -e_ascii_dtostr (gchar *buffer, gint buf_len, const gchar *format, gdouble d) +e_ascii_dtostr (gchar *buffer, + gint buf_len, + const gchar *format, + gdouble d) { struct lconv *locale_data; const gchar *decimal_point; @@ -1188,15 +1200,15 @@ e_ascii_dtostr (gchar *buffer, gint buf_len, const gchar *format, gdouble d) if (*p == '+' || *p == '-') p++; - while (isdigit ((guchar)*p)) + while (isdigit ((guchar) * p)) p++; if (strncmp (p, decimal_point, decimal_point_len) == 0) { *p = '.'; p++; if (decimal_point_len > 1) { - rest_len = strlen (p + (decimal_point_len-1)); - memmove (p, p + (decimal_point_len-1), + rest_len = strlen (p + (decimal_point_len - 1)); + memmove (p, p + (decimal_point_len - 1), rest_len); p[rest_len] = 0; } @@ -1274,7 +1286,8 @@ e_file_lock_exists (void) * not be determined **/ gchar * -e_util_guess_mime_type (const gchar *filename, gboolean localfile) +e_util_guess_mime_type (const gchar *filename, + gboolean localfile) { gchar *mime_type = NULL; diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c index 653b44eb5d..0247f91e27 100644 --- a/e-util/e-xml-utils.c +++ b/e-util/e-xml-utils.c @@ -151,7 +151,7 @@ e_xml_get_child_by_name_by_lang_list (const xmlNode *parent, language_names = g_get_language_names (); while (*language_names != NULL) lang_list = g_list_append ( - (GList *) lang_list, (gchar *)*language_names++); + (GList *) lang_list, (gchar *) * language_names++); } return e_xml_get_child_by_name_by_lang_list_with_score (parent,name, @@ -374,7 +374,8 @@ e_xml_set_double_prop_by_name (xmlNode *parent, } gchar * -e_xml_get_string_prop_by_name (const xmlNode *parent, const xmlChar *prop_name) +e_xml_get_string_prop_by_name (const xmlNode *parent, + const xmlChar *prop_name) { g_return_val_if_fail (parent != NULL, NULL); g_return_val_if_fail (prop_name != NULL, NULL); diff --git a/e-util/gconf-bridge.c b/e-util/gconf-bridge.c index 9b0e609560..3de48b6e01 100644 --- a/e-util/gconf-bridge.c +++ b/e-util/gconf-bridge.c @@ -183,7 +183,7 @@ new_id (void) /* Syncs a value from GConf to an object property */ static void prop_binding_sync_pref_to_prop (PropBinding *binding, - GConfValue *pref_value) + GConfValue *pref_value) { GValue src_value, value; @@ -370,9 +370,9 @@ done: /* Called when a GConf value bound to an object property has changed */ static void prop_binding_pref_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) { GConfValue *gconf_value; PropBinding *binding; @@ -419,8 +419,8 @@ prop_binding_perform_scheduled_sync (PropBinding *binding) /* Called when an object property has changed */ static void -prop_binding_prop_changed (GObject *object, - GParamSpec *param_spec, +prop_binding_prop_changed (GObject *object, + GParamSpec *param_spec, PropBinding *binding) { if (binding->delayed_mode) { @@ -482,10 +482,10 @@ prop_binding_object_destroyed (gpointer user_data, **/ guint gconf_bridge_bind_property_full (GConfBridge *bridge, - const gchar *key, - GObject *object, - const gchar *prop, - gboolean delayed_sync) + const gchar *key, + GObject *object, + const gchar *prop, + gboolean delayed_sync) { GParamSpec *pspec; PropBinding *binding; @@ -582,7 +582,7 @@ prop_binding_unblock_cb (gpointer hkey, } void -gconf_bridge_block_property_bindings (GConfBridge *bridge, +gconf_bridge_block_property_bindings (GConfBridge *bridge, const gchar *key) { g_return_if_fail (bridge != NULL); @@ -594,7 +594,7 @@ gconf_bridge_block_property_bindings (GConfBridge *bridge, } void -gconf_bridge_unblock_property_bindings (GConfBridge *bridge, +gconf_bridge_unblock_property_bindings (GConfBridge *bridge, const gchar *key) { g_return_if_fail (bridge != NULL); @@ -702,9 +702,9 @@ window_binding_perform_scheduled_sync (WindowBinding *binding) /* Called when the window han been resized or moved */ static gboolean -window_binding_configure_event_cb (GtkWindow *window, +window_binding_configure_event_cb (GtkWindow *window, GdkEventConfigure *event, - WindowBinding *binding) + WindowBinding *binding) { /* re-postpone by cancel of the previous request */ if (binding->sync_timeout_id > 0) @@ -720,9 +720,9 @@ window_binding_configure_event_cb (GtkWindow *window, /* Called when the window state is being changed */ static gboolean -window_binding_state_event_cb (GtkWindow *window, +window_binding_state_event_cb (GtkWindow *window, GdkEventWindowState *event, - WindowBinding *binding) + WindowBinding *binding) { if (binding->sync_timeout_id > 0) g_source_remove (binding->sync_timeout_id); @@ -731,7 +731,7 @@ window_binding_state_event_cb (GtkWindow *window, && (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) != 0 && (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) == 0) { /* the window was restored from a maximized state; make sure its - width and height is the one user stored before maximization */ + * width and height is the one user stored before maximization */ gint width, height; width = GPOINTER_TO_INT (g_object_get_data ( @@ -760,7 +760,7 @@ window_binding_state_event_cb (GtkWindow *window, /* Called when the window is being unmapped */ static gboolean -window_binding_unmap_cb (GtkWindow *window, +window_binding_unmap_cb (GtkWindow *window, WindowBinding *binding) { /* Force sync */ @@ -814,10 +814,10 @@ window_binding_window_destroyed (gpointer user_data, **/ guint gconf_bridge_bind_window (GConfBridge *bridge, - const gchar *key_prefix, - GtkWindow *window, - gboolean bind_size, - gboolean bind_pos) + const gchar *key_prefix, + GtkWindow *window, + gboolean bind_size, + gboolean bind_pos) { WindowBinding *binding; @@ -985,7 +985,7 @@ window_binding_unbind (WindowBinding *binding) /* Fills a GtkListStore with the string list from @value */ static void list_store_binding_sync_pref_to_store (ListStoreBinding *binding, - GConfValue *value) + GConfValue *value) { GSList *list, *l; GtkTreeIter iter; @@ -1071,9 +1071,9 @@ list_store_binding_sync_store_to_pref (ListStoreBinding *binding) /* Pref changed: sync */ static void list_store_binding_pref_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) { GConfValue *gconf_value; ListStoreBinding *binding; @@ -1144,8 +1144,8 @@ list_store_binding_store_changed_cb (ListStoreBinding *binding) * Return value: The ID of the new binding. **/ guint -gconf_bridge_bind_string_list_store (GConfBridge *bridge, - const gchar *key, +gconf_bridge_bind_string_list_store (GConfBridge *bridge, + const gchar *key, GtkListStore *list_store) { GtkTreeModel *tree_model; @@ -1301,7 +1301,7 @@ unbind (Binding *binding) **/ void gconf_bridge_unbind (GConfBridge *bridge, - guint binding_id) + guint binding_id) { g_return_if_fail (bridge != NULL); g_return_if_fail (binding_id > 0); @@ -1319,7 +1319,7 @@ gconf_bridge_unbind (GConfBridge *bridge, /* This is the same dialog as used in eel */ static void error_handler (GConfClient *client, - GError *error) + GError *error) { static gboolean shown_dialog = FALSE; diff --git a/em-format/em-format-quote.c b/em-format/em-format-quote.c index c11476a6d5..e6e71187c1 100644 --- a/em-format/em-format-quote.c +++ b/em-format/em-format-quote.c @@ -321,7 +321,8 @@ static gchar *i18n_hdrs[] = { #endif static void -emfq_format_address (GString *out, struct _camel_header_address *a) +emfq_format_address (GString *out, + struct _camel_header_address *a) { guint32 flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES; gchar *name, *mailto, *addr; @@ -581,7 +582,8 @@ emfq_format_message (EMFormat *emf, /* Decodes inline encoded parts of 'part'. The returned pointer, * if not NULL, should be unreffed with g_object_unref(). */ static CamelMimePart * -decode_inline_parts (CamelMimePart *part, GCancellable *cancellable) +decode_inline_parts (CamelMimePart *part, + GCancellable *cancellable) { CamelMultipart *mp; CamelStream *null; diff --git a/em-format/em-format.c b/em-format/em-format.c index f1aea4b00d..40f9baa3d5 100644 --- a/em-format/em-format.c +++ b/em-format/em-format.c @@ -45,10 +45,10 @@ struct _EMFormatPrivate { }; /* Used to cache various data/info for redraws - The validity stuff could be cached at a higher level but this is easier - This absolutely relies on the partid being _globally unique_ - This is still kind of yucky, we should maintian a full tree of all this data, - along with/as part of the puri tree */ + * The validity stuff could be cached at a higher level but this is easier + * This absolutely relies on the partid being _globally unique_ + * This is still kind of yucky, we should maintian a full tree of all this data, + * along with/as part of the puri tree */ struct _EMFormatCache { CamelCipherValidity *valid; /* validity copy */ CamelMimePart *secured; /* encrypted subpart */ @@ -83,11 +83,12 @@ emf_free_cache (EMFormatCache *efc) } static EMFormatCache * -emf_insert_cache (EMFormat *emf, const gchar *partid) +emf_insert_cache (EMFormat *emf, + const gchar *partid) { EMFormatCache *new; - new = g_malloc0 (sizeof (*new)+strlen (partid)); + new = g_malloc0 (sizeof (*new) + strlen (partid)); strcpy (new->partid, partid); g_hash_table_insert (emf->inline_table, new->partid, new); @@ -95,7 +96,9 @@ emf_insert_cache (EMFormat *emf, const gchar *partid) } static void -emf_clone_inlines (gpointer key, gpointer val, gpointer data) +emf_clone_inlines (gpointer key, + gpointer val, + gpointer data) { EMFormatCache *emfc = val, *new; @@ -262,8 +265,8 @@ emf_format_secure (EMFormat *emf, gint len; /* Note that this also requires support from higher up in the class chain - - validity needs to be cleared when you start output - - also needs to be cleared (but saved) whenever you start a new message. */ + * - validity needs to be cleared when you start output + * - also needs to be cleared (but saved) whenever you start a new message. */ if (emf->valid == NULL) { emf->valid = valid; @@ -437,7 +440,9 @@ struct _class_handlers { }; static void -merge_missing (gpointer key, gpointer value, gpointer userdata) +merge_missing (gpointer key, + gpointer value, + gpointer userdata) { struct _class_handlers *classes = (struct _class_handlers *) userdata; EMFormatHandler *info; @@ -451,7 +456,8 @@ merge_missing (gpointer key, gpointer value, gpointer userdata) } void -em_format_merge_handler (EMFormat *new, EMFormat *old) +em_format_merge_handler (EMFormat *new, + EMFormat *old) { EMFormatClass *oldc = (EMFormatClass *) G_OBJECT_GET_CLASS (old); EMFormatClass *newc = (EMFormatClass *) G_OBJECT_GET_CLASS (new); @@ -543,9 +549,9 @@ em_format_fallback_handler (EMFormat *emf, if (s == NULL) mime = (gchar *) mime_type; else { - gsize len = (s-mime_type)+1; + gsize len = (s - mime_type) + 1; - mime = g_alloca (len+2); + mime = g_alloca (len + 2); strncpy (mime, mime_type, len); strcpy(mime+len, "*"); } @@ -809,7 +815,7 @@ em_format_part_as (EMFormat *emf, emf->snoop_mime_type = NULL; /* RFC 2110, we keep track of content-base, and absolute content-location headers - This is actually only required for html, but, *shrug* */ + * This is actually only required for html, but, *shrug * */ tmp = camel_medium_get_header((CamelMedium *)part, "Content-Base"); if (tmp == NULL) { tmp = camel_mime_part_get_content_location (part); @@ -1211,7 +1217,7 @@ em_format_set_inline (EMFormat *emf, } else if (emfc->state != INLINE_UNSET && (emfc->state & 1) == state) return; - emfc->state = state?INLINE_ON:INLINE_OFF; + emfc->state = state ? INLINE_ON : INLINE_OFF; if (emf->message) em_format_queue_redraw (emf); @@ -1765,7 +1771,7 @@ emf_multipart_encrypted (EMFormat *emf, return; } - mpe = (CamelMultipartEncrypted*) camel_medium_get_content ((CamelMedium *) part); + mpe = (CamelMultipartEncrypted *) camel_medium_get_content ((CamelMedium *) part); if (!CAMEL_IS_MULTIPART_ENCRYPTED (mpe)) { em_format_format_error ( emf, stream, _("Could not parse MIME message. " @@ -1827,7 +1833,8 @@ emf_multipart_encrypted (EMFormat *emf, } static CamelMimePart * -get_related_display_part (CamelMimePart *part, gint *out_displayid) +get_related_display_part (CamelMimePart *part, + gint *out_displayid) { CamelMultipart *mp; CamelMimePart *body_part, *display_part = NULL; @@ -1872,7 +1879,8 @@ get_related_display_part (CamelMimePart *part, gint *out_displayid) } static gboolean -related_display_part_is_attachment (EMFormat *emf, CamelMimePart *part) +related_display_part_is_attachment (EMFormat *emf, + CamelMimePart *part) { CamelMimePart *display_part; @@ -2480,5 +2488,5 @@ em_format_snoop_type (CamelMimePart *part) return res; /* We used to load parts to check their type, we dont anymore, - see bug #11778 for some discussion */ + * see bug #11778 for some discussion */ } diff --git a/em-format/em-format.h b/em-format/em-format.h index d78cfee9ee..cf214d81a5 100644 --- a/em-format/em-format.h +++ b/em-format/em-format.h @@ -81,8 +81,8 @@ typedef enum { * **/ typedef enum { - EM_FORMAT_HANDLER_INLINE = 1<<0, - EM_FORMAT_HANDLER_INLINE_DISPOSITION = 1<<1 + EM_FORMAT_HANDLER_INLINE = 1 << 0, + EM_FORMAT_HANDLER_INLINE_DISPOSITION = 1 << 1 } EMFormatHandlerFlags; /** @@ -145,7 +145,7 @@ struct _EMFormatPURI { }; struct _EMFormatHeader { - guint32 flags; /* E_FORMAT_HEADER_* */ + guint32 flags; /* E_FORMAT_HEADER_ * */ gchar name[1]; }; @@ -320,7 +320,7 @@ void em_format_add_header (EMFormat *emf, guint32 flags); /* FIXME: Need a 'clone' api to copy details about the current view (inlines etc) - Or maybe it should live with sub-classes? */ + * Or maybe it should live with sub-classes? */ gint em_format_is_attachment (EMFormat *emf, CamelMimePart *part); diff --git a/em-format/em-inline-filter.c b/em-format/em-inline-filter.c index 1f9639540e..f70915148f 100644 --- a/em-format/em-inline-filter.c +++ b/em-format/em-inline-filter.c @@ -46,17 +46,27 @@ static const struct { const gchar *type; const gchar *subtype; CamelTransferEncoding encoding; - guint plain:1; + guint plain : 1; } emif_types[] = { - { "text", "plain", CAMEL_TRANSFER_ENCODING_DEFAULT, 1, }, - { "application", "mac-binhex40", CAMEL_TRANSFER_ENCODING_7BIT, 0, }, - { "application", "postscript", CAMEL_TRANSFER_ENCODING_7BIT, 0, }, - { "application", "x-inlinepgp-signed", CAMEL_TRANSFER_ENCODING_DEFAULT, 0, }, - { "application", "x-inlinepgp-encrypted", CAMEL_TRANSFER_ENCODING_DEFAULT, 0, }, + { "text", "plain", + CAMEL_TRANSFER_ENCODING_DEFAULT, 1 }, + + { "application", "mac-binhex40", + CAMEL_TRANSFER_ENCODING_7BIT, 0 }, + + { "application", "postscript", + CAMEL_TRANSFER_ENCODING_7BIT, 0 }, + + { "application", "x-inlinepgp-signed", + CAMEL_TRANSFER_ENCODING_DEFAULT, 0 }, + + { "application", "x-inlinepgp-encrypted", + CAMEL_TRANSFER_ENCODING_DEFAULT, 0 } }; static CamelMimePart * -construct_part_from_stream (CamelStream *mem, const GByteArray *data) +construct_part_from_stream (CamelStream *mem, + const GByteArray *data) { CamelMimePart *part = NULL; CamelMimeParser *parser; @@ -85,7 +95,9 @@ construct_part_from_stream (CamelStream *mem, const GByteArray *data) } static void -inline_filter_add_part (EMInlineFilter *emif, const gchar *data, gint len) +inline_filter_add_part (EMInlineFilter *emif, + const gchar *data, + gint len) { CamelTransferEncoding encoding; CamelContentType *content_type; @@ -189,10 +201,13 @@ inline_filter_add_part (EMInlineFilter *emif, const gchar *data, gint len) } static gint -inline_filter_scan (CamelMimeFilter *f, gchar *in, gsize len, gint final) +inline_filter_scan (CamelMimeFilter *f, + gchar *in, + gsize len, + gint final) { EMInlineFilter *emif = (EMInlineFilter *) f; - gchar *inptr = in, *inend = in+len; + gchar *inptr = in, *inend = in + len; gchar *data_start = in; gchar *start = in; @@ -207,7 +222,7 @@ inline_filter_scan (CamelMimeFilter *f, gchar *in, gsize len, gint final) if (inptr == inend && start == inptr) { if (!final) { - camel_mime_filter_backup (f, start, inend-start); + camel_mime_filter_backup (f, start, inend - start); inend = start; } break; @@ -225,31 +240,31 @@ inline_filter_scan (CamelMimeFilter *f, gchar *in, gsize len, gint final) case EMIF_PLAIN: if (rest_len >= 45 && strncmp (start, "(This file must be converted with BinHex 4.0)", 45) == 0) { restore_inptr (); - inline_filter_add_part (emif, data_start, start-data_start); + inline_filter_add_part (emif, data_start, start - data_start); data_start = start; emif->state = EMIF_BINHEX; } else if (rest_len >= 11 && strncmp (start, "%!PS-Adobe-", 11) == 0) { restore_inptr (); - inline_filter_add_part (emif, data_start, start-data_start); + inline_filter_add_part (emif, data_start, start - data_start); data_start = start; emif->state = EMIF_POSTSCRIPT; } else if (rest_len >= 34 && strncmp (start, "-----BEGIN PGP SIGNED MESSAGE-----", 34) == 0) { restore_inptr (); - inline_filter_add_part (emif, data_start, start-data_start); + inline_filter_add_part (emif, data_start, start - data_start); data_start = start; emif->state = EMIF_PGPSIGNED; } else if (rest_len >= 27 && strncmp (start, "-----BEGIN PGP MESSAGE-----", 27) == 0) { restore_inptr (); - inline_filter_add_part (emif, data_start, start-data_start); + inline_filter_add_part (emif, data_start, start - data_start); data_start = start; emif->state = EMIF_PGPENCRYPTED; } break; case EMIF_BINHEX: - if (inptr > (start+1) && inptr[-2] == ':') { + if (inptr > (start + 1) && inptr[-2] == ':') { restore_inptr (); - inline_filter_add_part (emif, data_start, inptr-data_start); + inline_filter_add_part (emif, data_start, inptr - data_start); data_start = inptr; emif->state = EMIF_PLAIN; emif->found_any = TRUE; @@ -258,7 +273,7 @@ inline_filter_scan (CamelMimeFilter *f, gchar *in, gsize len, gint final) case EMIF_POSTSCRIPT: if (rest_len >= 5 && strncmp (start, "%%EOF", 5) == 0) { restore_inptr (); - inline_filter_add_part (emif, data_start, inptr-data_start); + inline_filter_add_part (emif, data_start, inptr - data_start); data_start = inptr; emif->state = EMIF_PLAIN; emif->found_any = TRUE; @@ -267,7 +282,7 @@ inline_filter_scan (CamelMimeFilter *f, gchar *in, gsize len, gint final) case EMIF_PGPSIGNED: if (rest_len >= 27 && strncmp (start, "-----END PGP SIGNATURE-----", 27) == 0) { restore_inptr (); - inline_filter_add_part (emif, data_start, inptr-data_start); + inline_filter_add_part (emif, data_start, inptr - data_start); data_start = inptr; emif->state = EMIF_PLAIN; emif->found_any = TRUE; @@ -276,7 +291,7 @@ inline_filter_scan (CamelMimeFilter *f, gchar *in, gsize len, gint final) case EMIF_PGPENCRYPTED: if (rest_len >= 25 && strncmp (start, "-----END PGP MESSAGE-----", 25) == 0) { restore_inptr (); - inline_filter_add_part (emif, data_start, inptr-data_start); + inline_filter_add_part (emif, data_start, inptr - data_start); data_start = inptr; emif->state = EMIF_PLAIN; emif->found_any = TRUE; @@ -409,7 +424,8 @@ em_inline_filter_init (EMInlineFilter *emif) * Return value: **/ EMInlineFilter * -em_inline_filter_new (CamelTransferEncoding base_encoding, CamelContentType *base_type) +em_inline_filter_new (CamelTransferEncoding base_encoding, + CamelContentType *base_type) { EMInlineFilter *emif; diff --git a/em-format/em-stripsig-filter.h b/em-format/em-stripsig-filter.h index 5ca4491b4f..47017f79fe 100644 --- a/em-format/em-stripsig-filter.h +++ b/em-format/em-stripsig-filter.h @@ -52,8 +52,8 @@ typedef struct _EMStripSigFilterClass EMStripSigFilterClass; struct _EMStripSigFilter { CamelMimeFilter parent; - guint32 midline:1; - guint32 text_plain_only:1; + guint32 midline : 1; + guint32 text_plain_only : 1; }; struct _EMStripSigFilterClass { diff --git a/filter/e-filter-code.c b/filter/e-filter-code.c index 02d8c0cccf..0476f0678c 100644 --- a/filter/e-filter-code.c +++ b/filter/e-filter-code.c @@ -26,6 +26,7 @@ #endif #include "e-filter-code.h" +#include "e-filter-part.h" G_DEFINE_TYPE ( EFilterCode, @@ -36,7 +37,7 @@ G_DEFINE_TYPE ( static void filter_code_build_code (EFilterElement *element, GString *out, - struct _EFilterPart *part) + EFilterPart *part) { GList *l; EFilterInput *fi = (EFilterInput *) element; diff --git a/filter/e-filter-color.c b/filter/e-filter-color.c index 64272d8f30..bf80fbb778 100644 --- a/filter/e-filter-color.c +++ b/filter/e-filter-color.c @@ -36,7 +36,8 @@ G_DEFINE_TYPE ( E_TYPE_FILTER_ELEMENT) static void -set_color (GtkColorButton *color_button, EFilterColor *fc) +set_color (GtkColorButton *color_button, + EFilterColor *fc) { gtk_color_button_get_color (color_button, &fc->color); } diff --git a/filter/e-filter-datespec.c b/filter/e-filter-datespec.c index a7c2aa2f61..ef264d6205 100644 --- a/filter/e-filter-datespec.c +++ b/filter/e-filter-datespec.c @@ -109,7 +109,7 @@ get_best_span (time_t val) { gint i; - for (i=G_N_ELEMENTS (timespans)-1;i>=0;i--) { + for (i = G_N_ELEMENTS (timespans) - 1; i >= 0; i--) { if (val % timespans[i].seconds == 0) return i; } @@ -205,7 +205,7 @@ set_values (EFilterDatespec *fds) EFilterDatespecPrivate *p = fds->priv; - p->type = fds->type==FDST_UNKNOWN ? FDST_NOW : fds->type; + p->type = fds->type == FDST_UNKNOWN ? FDST_NOW : fds->type; note_type = p->type==FDST_X_FUTURE ? FDST_X_AGO : p->type; /* FUTURE and AGO use the same notebook pages/etc. */ @@ -219,43 +219,46 @@ set_values (EFilterDatespec *fds) struct tm tm; localtime_r (&fds->value, &tm); - gtk_calendar_select_month ((GtkCalendar*) p->calendar_specify, tm.tm_mon, tm.tm_year + 1900); - gtk_calendar_select_day ((GtkCalendar*) p->calendar_specify, tm.tm_mday); + gtk_calendar_select_month ((GtkCalendar *) p->calendar_specify, tm.tm_mon, tm.tm_year + 1900); + gtk_calendar_select_day ((GtkCalendar *) p->calendar_specify, tm.tm_mday); break; } case FDST_X_AGO: p->span = get_best_span (fds->value); - gtk_spin_button_set_value ((GtkSpinButton*) p->spin_relative, fds->value/timespans[p->span].seconds); + gtk_spin_button_set_value ((GtkSpinButton *) p->spin_relative, fds->value / timespans[p->span].seconds); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 0); break; case FDST_X_FUTURE: p->span = get_best_span (fds->value); - gtk_spin_button_set_value ((GtkSpinButton*) p->spin_relative, fds->value/timespans[p->span].seconds); + gtk_spin_button_set_value ((GtkSpinButton *) p->spin_relative, fds->value / timespans[p->span].seconds); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 1); break; } - gtk_notebook_set_current_page ((GtkNotebook*) p->notebook_type, note_type); + gtk_notebook_set_current_page ((GtkNotebook *) p->notebook_type, note_type); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_type), note_type); } static void -set_combobox_type (GtkComboBox *combobox, EFilterDatespec *fds) +set_combobox_type (GtkComboBox *combobox, + EFilterDatespec *fds) { fds->priv->type = gtk_combo_box_get_active (combobox); - gtk_notebook_set_current_page ((GtkNotebook*) fds->priv->notebook_type, fds->priv->type); + gtk_notebook_set_current_page ((GtkNotebook *) fds->priv->notebook_type, fds->priv->type); } static void -set_combobox_relative (GtkComboBox *combobox, EFilterDatespec *fds) +set_combobox_relative (GtkComboBox *combobox, + EFilterDatespec *fds) { fds->priv->span = gtk_combo_box_get_active (combobox); } static void -set_combobox_past_future (GtkComboBox *combobox, EFilterDatespec *fds) +set_combobox_past_future (GtkComboBox *combobox, + EFilterDatespec *fds) { if (gtk_combo_box_get_active (combobox) == 0) fds->type = fds->priv->type = FDST_X_AGO; @@ -264,7 +267,8 @@ set_combobox_past_future (GtkComboBox *combobox, EFilterDatespec *fds) } static void -button_clicked (GtkButton *button, EFilterDatespec *fds) +button_clicked (GtkButton *button, + EFilterDatespec *fds) { EFilterDatespecPrivate *p = fds->priv; GtkWidget *content_area; diff --git a/filter/e-filter-input.c b/filter/e-filter-input.c index 9842a5d5ea..10fa1f1765 100644 --- a/filter/e-filter-input.c +++ b/filter/e-filter-input.c @@ -96,7 +96,7 @@ filter_input_validate (EFilterElement *element, gchar *regmsg; /* regerror gets called twice to get the full error string - length to do proper posix error reporting */ + * length to do proper posix error reporting */ reglen = regerror (regerr, ®expat, 0, 0); regmsg = g_malloc0 (reglen + 1); regerror (regerr, ®expat, regmsg, reglen); @@ -178,7 +178,8 @@ filter_input_xml_encode (EFilterElement *element) } static gint -filter_input_xml_decode (EFilterElement *element, xmlNodePtr node) +filter_input_xml_decode (EFilterElement *element, + xmlNodePtr node) { EFilterInput *input = (EFilterInput *) element; gchar *name, *str, *type; diff --git a/filter/e-filter-part.c b/filter/e-filter-part.c index 521c0781aa..0b31097d7c 100644 --- a/filter/e-filter-part.c +++ b/filter/e-filter-part.c @@ -280,7 +280,7 @@ e_filter_part_copy_values (EFilterPart *dst_part, /* NOTE: we go backwards, it just works better that way */ /* for each source type, search the dest type for - a matching type in the same order */ + * a matching type in the same order */ src_link = g_list_last (src_part->elements); dst_link = g_list_last (dst_part->elements); @@ -491,7 +491,7 @@ e_filter_part_expand_code (EFilterPart *part, namelen = (len + 1) * 2; name = g_alloca (namelen); } - memcpy (name, newstart+2, len); + memcpy (name, newstart + 2, len); name[len] = 0; element = e_filter_part_find_element (part, name); diff --git a/filter/e-filter-rule.c b/filter/e-filter-rule.c index aa4d641270..f40f3b3d07 100644 --- a/filter/e-filter-rule.c +++ b/filter/e-filter-rule.c @@ -105,7 +105,7 @@ part_combobox_changed (GtkComboBox *combobox, return; /* here we do a widget shuffle, throw away the old widget/rulepart, - and create another */ + * and create another */ if (data->partwidget) gtk_container_remove (GTK_CONTAINER (data->container), data->partwidget); @@ -203,7 +203,8 @@ less_parts (GtkWidget *button, static void attach_rule (GtkWidget *rule, FilterRuleData *data, - EFilterPart *part, gint row) + EFilterPart *part, + gint row) { GtkWidget *remove; @@ -611,7 +612,8 @@ filter_rule_build_code (EFilterRule *rule, } static void -filter_rule_copy (EFilterRule *dest, EFilterRule *src) +filter_rule_copy (EFilterRule *dest, + EFilterRule *src) { GList *node; @@ -658,7 +660,7 @@ filter_rule_get_widget (EFilterRule *rule, gint rows, i; /* this stuff should probably be a table, but the - rule parts need to be a vbox */ + * rule parts need to be a vbox */ vbox = gtk_vbox_new (FALSE, 6); label = gtk_label_new_with_mnemonic (_("R_ule name:")); @@ -723,7 +725,7 @@ filter_rule_get_widget (EFilterRule *rule, label = gtk_label_new_with_mnemonic (_("_Find items:")); combobox = gtk_combo_box_text_new (); - for (i=0;i<2;i++) { + for (i = 0; i < 2; i++) { gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (combobox), _(thread_types[i])); @@ -759,7 +761,7 @@ filter_rule_get_widget (EFilterRule *rule, label = gtk_label_new_with_mnemonic (_("I_nclude threads:")); combobox = gtk_combo_box_text_new (); - for (i=0;i<5;i++) { + for (i = 0; i < 5; i++) { gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (combobox), _(thread_types[i])); @@ -1107,7 +1109,7 @@ e_filter_rule_next_list (GList *list, } EFilterRule * -e_filter_rule_find_list (GList * list, +e_filter_rule_find_list (GList *list, const gchar *name, const gchar *source) { diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c index 712ecfa039..2f3daca6e7 100644 --- a/filter/e-rule-context.c +++ b/filter/e-rule-context.c @@ -280,7 +280,7 @@ rule_context_load (ERuleContext *context, /* now load actual rules */ if (userdoc) { root = xmlDocGetRootElement (userdoc); - set = root?root->children:NULL; + set = root ? root->children : NULL; while (set) { rule_map = g_hash_table_lookup (context->rule_set_map, set->name); if (rule_map) { @@ -373,7 +373,7 @@ rule_context_revert (ERuleContext *context, /* setup stuff we have now */ /* Note that we assume there is only 1 set of rules in a given rule context, - although other parts of the code dont assume this */ + * although other parts of the code dont assume this */ frule = NULL; while ((frule = e_rule_context_next_rule (context, frule, NULL))) { rest_data = g_hash_table_lookup (source_hash, frule->source); @@ -387,7 +387,7 @@ rule_context_revert (ERuleContext *context, /* make what we have, match what we load */ set = xmlDocGetRootElement (userdoc); - set = set?set->children:NULL; + set = set ? set->children : NULL; while (set) { rule_map = g_hash_table_lookup (context->rule_set_map, set->name); if (rule_map) { diff --git a/filter/e-rule-editor.c b/filter/e-rule-editor.c index 3fdf5c40bc..eb52691c5b 100644 --- a/filter/e-rule-editor.c +++ b/filter/e-rule-editor.c @@ -127,7 +127,8 @@ rule_editor_play_undo (ERuleEditor *editor) } static void -dialog_rule_changed (EFilterRule *fr, GtkWidget *dialog) +dialog_rule_changed (EFilterRule *fr, + GtkWidget *dialog) { g_return_if_fail (dialog != NULL); @@ -135,7 +136,9 @@ dialog_rule_changed (EFilterRule *fr, GtkWidget *dialog) } static void -add_editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) +add_editor_response (GtkWidget *dialog, + gint button, + ERuleEditor *editor) { GtkTreeSelection *selection; GtkTreePath *path; @@ -211,7 +214,8 @@ update_selected_rule (ERuleEditor *editor) } static void -cursor_changed (GtkTreeView *treeview, ERuleEditor *editor) +cursor_changed (GtkTreeView *treeview, + ERuleEditor *editor) { if (update_selected_rule (editor)) { g_return_if_fail (editor->current); @@ -221,7 +225,9 @@ cursor_changed (GtkTreeView *treeview, ERuleEditor *editor) } static void -editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) +editor_response (GtkWidget *dialog, + gint button, + ERuleEditor *editor) { if (button == GTK_RESPONSE_CANCEL) { if (enable_undo) @@ -242,7 +248,8 @@ editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) } static void -rule_add (GtkWidget *widget, ERuleEditor *editor) +rule_add (GtkWidget *widget, + ERuleEditor *editor) { GtkWidget *rules; GtkWidget *content_area; @@ -281,7 +288,9 @@ rule_add (GtkWidget *widget, ERuleEditor *editor) } static void -edit_editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) +edit_editor_response (GtkWidget *dialog, + gint button, + ERuleEditor *editor) { EFilterRule *rule; GtkTreePath *path; @@ -326,7 +335,8 @@ edit_editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) } static void -rule_edit (GtkWidget *widget, ERuleEditor *editor) +rule_edit (GtkWidget *widget, + ERuleEditor *editor) { GtkWidget *rules; GtkWidget *content_area; @@ -367,7 +377,8 @@ rule_edit (GtkWidget *widget, ERuleEditor *editor) } static void -rule_delete (GtkWidget *widget, ERuleEditor *editor) +rule_delete (GtkWidget *widget, + ERuleEditor *editor) { GtkTreeSelection *selection; GtkTreePath *path; @@ -422,7 +433,9 @@ rule_delete (GtkWidget *widget, ERuleEditor *editor) } static void -rule_move (ERuleEditor *editor, gint from, gint to) +rule_move (ERuleEditor *editor, + gint from, + gint to) { GtkTreeSelection *selection; GtkTreePath *path; @@ -466,7 +479,8 @@ rule_move (ERuleEditor *editor, gint from, gint to) } static void -rule_top (GtkWidget *widget, ERuleEditor *editor) +rule_top (GtkWidget *widget, + ERuleEditor *editor) { gint pos; @@ -479,7 +493,8 @@ rule_top (GtkWidget *widget, ERuleEditor *editor) } static void -rule_up (GtkWidget *widget, ERuleEditor *editor) +rule_up (GtkWidget *widget, + ERuleEditor *editor) { gint pos; @@ -492,7 +507,8 @@ rule_up (GtkWidget *widget, ERuleEditor *editor) } static void -rule_down (GtkWidget *widget, ERuleEditor *editor) +rule_down (GtkWidget *widget, + ERuleEditor *editor) { gint pos; @@ -505,7 +521,8 @@ rule_down (GtkWidget *widget, ERuleEditor *editor) } static void -rule_bottom (GtkWidget *widget, ERuleEditor *editor) +rule_bottom (GtkWidget *widget, + ERuleEditor *editor) { gint pos; gint count = 0; @@ -720,7 +737,10 @@ e_rule_editor_create_rule (ERuleEditor *editor) } static void -double_click (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, ERuleEditor *editor) +double_click (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + ERuleEditor *editor) { GtkTreeSelection *selection; GtkTreeModel *model; diff --git a/libgnomecanvas/gailcanvas.c b/libgnomecanvas/gailcanvas.c index ca60f26b1a..47501c7d1c 100644 --- a/libgnomecanvas/gailcanvas.c +++ b/libgnomecanvas/gailcanvas.c @@ -38,13 +38,13 @@ static void gail_canvas_real_initialize (AtkObject *obj, gpointer data); static gint gail_canvas_get_n_children (AtkObject *obj); -static AtkObject* gail_canvas_ref_child (AtkObject *obj, +static AtkObject * gail_canvas_ref_child (AtkObject *obj, gint i); static void adjustment_changed (GtkAdjustment *adjustment, GnomeCanvas *canvas); -static AtkObject* gail_canvas_factory_create_accessible (GObject *obj); +static AtkObject * gail_canvas_factory_create_accessible (GObject *obj); static GType gail_canvas_factory_get_accessible_type (void); @@ -67,8 +67,8 @@ gail_canvas_factory_class_init (GailCanvasFactoryClass *klass) class->get_accessible_type = gail_canvas_factory_get_accessible_type; } -static AtkObject* -gail_canvas_factory_create_accessible (GObject *obj) +static AtkObject * +gail_canvas_factory_create_accessible (GObject *obj) { return gail_canvas_new (GTK_WIDGET (obj)); } @@ -156,7 +156,7 @@ gail_canvas_class_init (GailCanvasClass *klass) class->initialize = gail_canvas_real_initialize; } -AtkObject* +AtkObject * gail_canvas_new (GtkWidget *widget) { GObject *object; @@ -174,7 +174,7 @@ gail_canvas_new (GtkWidget *widget) static void gail_canvas_real_initialize (AtkObject *obj, - gpointer data) + gpointer data) { GnomeCanvas *canvas; GtkAdjustment *adj; @@ -199,7 +199,7 @@ gail_canvas_real_initialize (AtkObject *obj, } static gint -gail_canvas_get_n_children (AtkObject* obj) +gail_canvas_get_n_children (AtkObject *obj) { GtkAccessible *accessible; GtkWidget *widget; @@ -222,9 +222,9 @@ gail_canvas_get_n_children (AtkObject* obj) return 1; } -static AtkObject* +static AtkObject * gail_canvas_ref_child (AtkObject *obj, - gint i) + gint i) { GtkAccessible *accessible; GtkWidget *widget; @@ -255,7 +255,7 @@ gail_canvas_ref_child (AtkObject *obj, static void adjustment_changed (GtkAdjustment *adjustment, - GnomeCanvas *canvas) + GnomeCanvas *canvas) { AtkObject *atk_obj; diff --git a/libgnomecanvas/gailcanvas.h b/libgnomecanvas/gailcanvas.h index 707ddc3b63..3f0b7767bc 100644 --- a/libgnomecanvas/gailcanvas.h +++ b/libgnomecanvas/gailcanvas.h @@ -62,7 +62,7 @@ struct _GailCanvas; struct _GailCanvasClass; -AtkObject* gail_canvas_new (GtkWidget *widget); +AtkObject * gail_canvas_new (GtkWidget *widget); void gail_canvas_init (void); diff --git a/libgnomecanvas/gailcanvasgroup.c b/libgnomecanvas/gailcanvasgroup.c index 5de58370a2..7de8ed3eba 100644 --- a/libgnomecanvas/gailcanvasgroup.c +++ b/libgnomecanvas/gailcanvasgroup.c @@ -26,7 +26,7 @@ #include "gailcanvasgroup.h" static gint gail_canvas_group_get_n_children (AtkObject *obj); -static AtkObject* gail_canvas_group_ref_child (AtkObject *obj, +static AtkObject * gail_canvas_group_ref_child (AtkObject *obj, gint i); G_DEFINE_TYPE (GailCanvasGroup, @@ -39,7 +39,7 @@ gail_canvas_group_init (GailCanvasGroup *foo) ; } -AtkObject* +AtkObject * gail_canvas_group_new (GObject *obj) { gpointer object; @@ -79,7 +79,7 @@ gail_canvas_group_get_n_children (AtkObject *obj) static AtkObject * gail_canvas_group_ref_child (AtkObject *obj, - gint i) + gint i) { AtkGObjectAccessible *atk_gobject; GnomeCanvasGroup *group; diff --git a/libgnomecanvas/gailcanvasgroup.h b/libgnomecanvas/gailcanvasgroup.h index 4f50b9da26..a79631821b 100644 --- a/libgnomecanvas/gailcanvasgroup.h +++ b/libgnomecanvas/gailcanvasgroup.h @@ -48,7 +48,7 @@ struct _GailCanvasGroupClass GailCanvasItemClass parent_class; }; -AtkObject* gail_canvas_group_new (GObject *obj); +AtkObject * gail_canvas_group_new (GObject *obj); G_END_DECLS diff --git a/libgnomecanvas/gailcanvasgroupfactory.c b/libgnomecanvas/gailcanvasgroupfactory.c index 8c208f8c80..ed36c916e7 100644 --- a/libgnomecanvas/gailcanvasgroupfactory.c +++ b/libgnomecanvas/gailcanvasgroupfactory.c @@ -68,8 +68,8 @@ gail_canvas_group_factory_class_init (GailCanvasGroupFactoryClass *klass) class->get_accessible_type = gail_canvas_group_factory_get_accessible_type; } -static AtkObject* -gail_canvas_group_factory_create_accessible (GObject *obj) +static AtkObject * +gail_canvas_group_factory_create_accessible (GObject *obj) { return gail_canvas_group_new (obj); } diff --git a/libgnomecanvas/gailcanvasitem.c b/libgnomecanvas/gailcanvasitem.c index 377c6fe221..ce98ee0b40 100644 --- a/libgnomecanvas/gailcanvasitem.c +++ b/libgnomecanvas/gailcanvasitem.c @@ -30,9 +30,9 @@ static void gail_canvas_item_initialize (AtkObject *obj, gpointer data); -static AtkObject* gail_canvas_item_get_parent (AtkObject *obj); +static AtkObject * gail_canvas_item_get_parent (AtkObject *obj); static gint gail_canvas_item_get_index_in_parent (AtkObject *obj); -static AtkStateSet* gail_canvas_item_ref_state_set (AtkObject *obj); +static AtkStateSet * gail_canvas_item_ref_state_set (AtkObject *obj); static void gail_canvas_item_component_interface_init (AtkComponentIface *iface); static guint gail_canvas_item_add_focus_handler (AtkComponent *component, @@ -67,7 +67,7 @@ gail_canvas_item_init (GailCanvasItem *foo) ; } -AtkObject* +AtkObject * gail_canvas_item_new (GObject *obj) { gpointer object; @@ -82,8 +82,8 @@ gail_canvas_item_new (GObject *obj) } static void -gail_canvas_item_initialize (AtkObject *obj, - gpointer data) +gail_canvas_item_initialize (AtkObject *obj, + gpointer data) { ATK_OBJECT_CLASS (parent_class)->initialize (obj, data); @@ -174,8 +174,8 @@ gail_canvas_item_get_index_in_parent (AtkObject *obj) } } -static AtkStateSet* -gail_canvas_item_ref_state_set (AtkObject *obj) +static AtkStateSet * +gail_canvas_item_ref_state_set (AtkObject *obj) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -232,7 +232,7 @@ gail_canvas_item_component_interface_init (AtkComponentIface *iface) } static guint -gail_canvas_item_add_focus_handler (AtkComponent *component, +gail_canvas_item_add_focus_handler (AtkComponent *component, AtkFocusHandler handler) { GSignalMatchType match_type; @@ -261,10 +261,10 @@ gail_canvas_item_add_focus_handler (AtkComponent *component, static void gail_canvas_item_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, + gint *x, + gint *y, + gint *width, + gint *height, AtkCoordType coord_type) { AtkGObjectAccessible *atk_gobj; @@ -321,7 +321,7 @@ gail_canvas_item_get_mdi_zorder (AtkComponent *component) } static gboolean -gail_canvas_item_grab_focus (AtkComponent *component) +gail_canvas_item_grab_focus (AtkComponent *component) { AtkGObjectAccessible *atk_gobj; GObject *obj; @@ -348,7 +348,7 @@ gail_canvas_item_grab_focus (AtkComponent *component) static void gail_canvas_item_remove_focus_handler (AtkComponent *component, - guint handler_id) + guint handler_id) { g_signal_handler_disconnect (ATK_OBJECT (component), handler_id); } @@ -363,8 +363,8 @@ is_item_on_screen (GnomeCanvasItem *item) } static void -get_item_extents (GnomeCanvasItem *item, - GdkRectangle *extents) +get_item_extents (GnomeCanvasItem *item, + GdkRectangle *extents) { double x1, x2, y1, y2; cairo_matrix_t i2c; @@ -387,7 +387,7 @@ get_item_extents (GnomeCanvasItem *item, } static gboolean -is_item_in_window (GnomeCanvasItem *item, +is_item_in_window (GnomeCanvasItem *item, const GdkRectangle *extents) { GtkWidget *widget; diff --git a/libgnomecanvas/gailcanvasitem.h b/libgnomecanvas/gailcanvasitem.h index 9f89d7bbc3..526dd754fe 100644 --- a/libgnomecanvas/gailcanvasitem.h +++ b/libgnomecanvas/gailcanvasitem.h @@ -47,7 +47,7 @@ struct _GailCanvasItemClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* gail_canvas_item_new (GObject *obj); +AtkObject * gail_canvas_item_new (GObject *obj); G_END_DECLS diff --git a/libgnomecanvas/gailcanvasitemfactory.c b/libgnomecanvas/gailcanvasitemfactory.c index 66435d2878..4a3030d2a9 100644 --- a/libgnomecanvas/gailcanvasitemfactory.c +++ b/libgnomecanvas/gailcanvasitemfactory.c @@ -25,7 +25,7 @@ #include "gailcanvasitemfactory.h" #include "gailcanvasitem.h" -static AtkObject* gail_canvas_item_factory_create_accessible (GObject *obj); +static AtkObject * gail_canvas_item_factory_create_accessible (GObject *obj); static GType gail_canvas_item_factory_get_accessible_type (void); @@ -48,8 +48,8 @@ gail_canvas_item_factory_class_init (GailCanvasItemFactoryClass *klass) class->get_accessible_type = gail_canvas_item_factory_get_accessible_type; } -static AtkObject* -gail_canvas_item_factory_create_accessible (GObject *obj) +static AtkObject * +gail_canvas_item_factory_create_accessible (GObject *obj) { return gail_canvas_item_new (obj); } diff --git a/libgnomecanvas/gailcanvastext.c b/libgnomecanvas/gailcanvastext.c index 6d070d5e97..cb2cd77846 100644 --- a/libgnomecanvas/gailcanvastext.c +++ b/libgnomecanvas/gailcanvastext.c @@ -72,12 +72,12 @@ static void gail_canvas_text_get_character_extents (AtkText gint *width, gint *height, AtkCoordType coords); -static AtkAttributeSet* +static AtkAttributeSet * gail_canvas_text_get_run_attributes (AtkText *text, gint offset, gint *start_offset, gint *end_offset); -static AtkAttributeSet* +static AtkAttributeSet * gail_canvas_text_get_default_attributes (AtkText *text); static gint gail_canvas_text_get_n_selections (AtkText *text); static gchar * gail_canvas_text_get_selection (AtkText *text, @@ -112,7 +112,7 @@ gail_canvas_text_init (GailCanvasText *foo) ; } -AtkObject* +AtkObject * gail_canvas_text_new (GObject *obj) { gpointer object; @@ -173,8 +173,8 @@ gail_canvas_text_text_interface_init (AtkTextIface *iface) static gchar * gail_canvas_text_get_text (AtkText *text, - gint start_offset, - gint end_offset) + gint start_offset, + gint end_offset) { GailCanvasText *gail_text; GtkTextBuffer *buffer; @@ -192,11 +192,11 @@ gail_canvas_text_get_text (AtkText *text, } static gchar * -gail_canvas_text_get_text_after_offset (AtkText *text, - gint offset, +gail_canvas_text_get_text_after_offset (AtkText *text, + gint offset, AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) + gint *start_offset, + gint *end_offset) { return get_text_near_offset (text, GAIL_AFTER_OFFSET, boundary_type, offset, @@ -204,11 +204,11 @@ gail_canvas_text_get_text_after_offset (AtkText *text, } static gchar * -gail_canvas_text_get_text_at_offset (AtkText *text, - gint offset, +gail_canvas_text_get_text_at_offset (AtkText *text, + gint offset, AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) + gint *start_offset, + gint *end_offset) { return get_text_near_offset (text, GAIL_AT_OFFSET, boundary_type, offset, @@ -216,11 +216,11 @@ gail_canvas_text_get_text_at_offset (AtkText *text, } static gchar * -gail_canvas_text_get_text_before_offset (AtkText *text, - gint offset, +gail_canvas_text_get_text_before_offset (AtkText *text, + gint offset, AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) + gint *start_offset, + gint *end_offset) { return get_text_near_offset (text, GAIL_BEFORE_OFFSET, boundary_type, offset, @@ -229,7 +229,7 @@ gail_canvas_text_get_text_before_offset (AtkText *text, static gunichar gail_canvas_text_get_character_at_offset (AtkText *text, - gint offset) + gint offset) { GailCanvasText *gail_item; GtkTextIter start, end; @@ -286,7 +286,7 @@ gail_canvas_text_get_caret_offset (AtkText *text) static gboolean gail_canvas_text_set_caret_offset (AtkText *text, - gint offset) + gint offset) { GailCanvasText *gail_text; GtkTextBuffer *buffer; @@ -302,31 +302,31 @@ gail_canvas_text_set_caret_offset (AtkText *text, } static gint -gail_canvas_text_get_offset_at_point (AtkText *text, - gint x, - gint y, +gail_canvas_text_get_offset_at_point (AtkText *text, + gint x, + gint y, AtkCoordType coords) { return -1; } static void -gail_canvas_text_get_character_extents (AtkText *text, - gint offset, - gint *x, - gint *y, - gint *width, - gint *height, +gail_canvas_text_get_character_extents (AtkText *text, + gint offset, + gint *x, + gint *y, + gint *width, + gint *height, AtkCoordType coords) { return; } -static AtkAttributeSet* +static AtkAttributeSet * gail_canvas_text_get_run_attributes (AtkText *text, - gint offset, - gint *start_offset, - gint *end_offset) + gint offset, + gint *start_offset, + gint *end_offset) { GailCanvasText *gail_text; @@ -338,7 +338,7 @@ gail_canvas_text_get_run_attributes (AtkText *text, offset, start_offset, end_offset); } -static AtkAttributeSet* +static AtkAttributeSet * gail_canvas_text_get_default_attributes (AtkText *text) { return NULL; @@ -369,9 +369,9 @@ gail_canvas_text_get_n_selections (AtkText *text) static gchar * gail_canvas_text_get_selection (AtkText *text, - gint selection_num, - gint *start_pos, - gint *end_pos) + gint selection_num, + gint *start_pos, + gint *end_pos) { GailCanvasText *gail_text; GtkTextBuffer *buffer; @@ -400,8 +400,8 @@ gail_canvas_text_get_selection (AtkText *text, static gboolean gail_canvas_text_add_selection (AtkText *text, - gint start_pos, - gint end_pos) + gint start_pos, + gint end_pos) { GailCanvasText *gail_text; GtkTextBuffer *buffer; @@ -435,7 +435,7 @@ gail_canvas_text_add_selection (AtkText *text, static gboolean gail_canvas_text_remove_selection (AtkText *text, - gint selection_num) + gint selection_num) { GailCanvasText *gail_text; GtkTextBuffer *buffer; @@ -473,9 +473,9 @@ gail_canvas_text_remove_selection (AtkText *text, static gboolean gail_canvas_text_set_selection (AtkText *text, - gint selection_num, - gint start_pos, - gint end_pos) + gint selection_num, + gint start_pos, + gint end_pos) { GailCanvasText *gail_text; GtkTextBuffer *buffer; @@ -511,12 +511,12 @@ gail_canvas_text_set_selection (AtkText *text, } static gchar * -get_text_near_offset (AtkText *text, - GailOffsetType function, - AtkTextBoundary boundary_type, - gint offset, - gint *start_offset, - gint *end_offset) +get_text_near_offset (AtkText *text, + GailOffsetType function, + AtkTextBoundary boundary_type, + gint offset, + gint *start_offset, + gint *end_offset) { return gail_text_util_get_text (GAIL_CANVAS_TEXT (text)->textutil, NULL, function, boundary_type, offset, diff --git a/libgnomecanvas/gailcanvastext.h b/libgnomecanvas/gailcanvastext.h index 54a0239cc2..bd6ff90e57 100644 --- a/libgnomecanvas/gailcanvastext.h +++ b/libgnomecanvas/gailcanvastext.h @@ -45,7 +45,7 @@ struct _GailCanvasTextClass GailCanvasItemClass parent_class; }; -AtkObject* gail_canvas_text_new (GObject *obj); +AtkObject * gail_canvas_text_new (GObject *obj); G_END_DECLS diff --git a/libgnomecanvas/gailcanvastextfactory.c b/libgnomecanvas/gailcanvastextfactory.c index 1fe39abfac..0b7195d7f1 100644 --- a/libgnomecanvas/gailcanvastextfactory.c +++ b/libgnomecanvas/gailcanvastextfactory.c @@ -48,8 +48,8 @@ gail_canvas_text_factory_class_init (GailCanvasTextFactoryClass *klass) class->get_accessible_type = gail_canvas_text_factory_get_accessible_type; } -static AtkObject* -gail_canvas_text_factory_create_accessible (GObject *obj) +static AtkObject * +gail_canvas_text_factory_create_accessible (GObject *obj) { return gail_canvas_text_new (obj); } diff --git a/libgnomecanvas/gailcanvaswidget.c b/libgnomecanvas/gailcanvaswidget.c index cc5e7faac2..19abbecb1c 100644 --- a/libgnomecanvas/gailcanvaswidget.c +++ b/libgnomecanvas/gailcanvaswidget.c @@ -42,7 +42,7 @@ gail_canvas_widget_init (GailCanvasWidget *foo) ; } -AtkObject* +AtkObject * gail_canvas_widget_new (GObject *obj) { gpointer object; @@ -89,7 +89,7 @@ gail_canvas_widget_get_n_children (AtkObject *obj) static AtkObject * gail_canvas_widget_ref_child (AtkObject *obj, - gint i) + gint i) { AtkGObjectAccessible *atk_gobj; GnomeCanvasWidget *canvas_widget; diff --git a/libgnomecanvas/gailcanvaswidget.h b/libgnomecanvas/gailcanvaswidget.h index 016c7a7313..43b56c44a9 100644 --- a/libgnomecanvas/gailcanvaswidget.h +++ b/libgnomecanvas/gailcanvaswidget.h @@ -48,7 +48,7 @@ struct _GailCanvasWidgetClass GailCanvasItemClass parent_class; }; -AtkObject* gail_canvas_widget_new (GObject *obj); +AtkObject * gail_canvas_widget_new (GObject *obj); G_END_DECLS diff --git a/libgnomecanvas/gailcanvaswidgetfactory.c b/libgnomecanvas/gailcanvaswidgetfactory.c index d636de9b0a..2460e69f8c 100644 --- a/libgnomecanvas/gailcanvaswidgetfactory.c +++ b/libgnomecanvas/gailcanvaswidgetfactory.c @@ -47,8 +47,8 @@ gail_canvas_widget_factory_class_init (GailCanvasWidgetFactoryClass *klass) class->get_accessible_type = gail_canvas_widget_factory_get_accessible_type; } -static AtkObject* -gail_canvas_widget_factory_create_accessible (GObject *obj) +static AtkObject * +gail_canvas_widget_factory_create_accessible (GObject *obj) { return gail_canvas_widget_new (obj); } diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 31f348c517..091db2a72a 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -132,10 +132,10 @@ gnome_canvas_pixbuf_dispose (GnomeCanvasItem *object) /* Set_property handler for the pixbuf canvas item */ static void -gnome_canvas_pixbuf_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) +gnome_canvas_pixbuf_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; GnomeCanvasPixbuf *gcp; @@ -170,10 +170,10 @@ gnome_canvas_pixbuf_set_property (GObject *object, /* Get_property handler for the pixbuf canvasi item */ static void -gnome_canvas_pixbuf_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) +gnome_canvas_pixbuf_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec) { GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; @@ -263,8 +263,12 @@ gnome_canvas_pixbuf_update (GnomeCanvasItem *item, /* Draw handler for the pixbuf canvas item */ static void -gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, - gint x, gint y, gint width, gint height) +gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; diff --git a/libgnomecanvas/gnome-canvas-rect.c b/libgnomecanvas/gnome-canvas-rect.c index 42fc617d5b..35453506b5 100644 --- a/libgnomecanvas/gnome-canvas-rect.c +++ b/libgnomecanvas/gnome-canvas-rect.c @@ -16,7 +16,7 @@ */ /* These includes are set up for standalone compile. If/when this codebase - is integrated into libgnomeui, the includes will need to change. */ + * is integrated into libgnomeui, the includes will need to change. */ #ifdef HAVE_CONFIG_H #include <config.h> diff --git a/libgnomecanvas/gnome-canvas-rich-text.c b/libgnomecanvas/gnome-canvas-rich-text.c index 036cce89ea..7cb39b28fd 100644 --- a/libgnomecanvas/gnome-canvas-rich-text.c +++ b/libgnomecanvas/gnome-canvas-rich-text.c @@ -409,8 +409,10 @@ gnome_canvas_rich_text_init (GnomeCanvasRichText *text) } /* gnome_canvas_rich_text_init */ static void -gnome_canvas_rich_text_set_property (GObject *object, guint property_id, - const GValue *value, GParamSpec *pspec) +gnome_canvas_rich_text_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (object); @@ -575,8 +577,10 @@ gnome_canvas_rich_text_set_property (GObject *object, guint property_id, } static void -gnome_canvas_rich_text_get_property (GObject *object, guint property_id, - GValue *value, GParamSpec *pspec) +gnome_canvas_rich_text_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (object); @@ -663,7 +667,8 @@ gnome_canvas_rich_text_unrealize (GnomeCanvasItem *item) static void gnome_canvas_rich_text_move_iter_by_lines (GnomeCanvasRichText *text, - GtkTextIter *newplace, gint count) + GtkTextIter *newplace, + gint count) { while (count < 0) { gtk_text_layout_move_iter_to_previous_line ( @@ -695,8 +700,9 @@ gnome_canvas_rich_text_get_cursor_x_position (GnomeCanvasRichText *text) static void gnome_canvas_rich_text_move_cursor (GnomeCanvasRichText *text, - GtkMovementStep step, - gint count, gboolean extend_selection) + GtkMovementStep step, + gint count, + gboolean extend_selection) { GtkTextIter insert, newplace; @@ -783,20 +789,23 @@ gnome_canvas_rich_text_move_cursor (GnomeCanvasRichText *text, } /* gnome_canvas_rich_text_move_cursor */ static gboolean -whitespace (gunichar ch, gpointer user_data) +whitespace (gunichar ch, + gpointer user_data) { return (ch == ' ' || ch == '\t'); } /* whitespace */ static gboolean -not_whitespace (gunichar ch, gpointer user_data) +not_whitespace (gunichar ch, + gpointer user_data) { return !whitespace (ch, user_data); } /* not_whitespace */ static gboolean find_whitespace_region (const GtkTextIter *center, - GtkTextIter *start, GtkTextIter *end) + GtkTextIter *start, + GtkTextIter *end) { *start = *center; *end = *center; @@ -811,13 +820,13 @@ find_whitespace_region (const GtkTextIter *center, static void gnome_canvas_rich_text_delete_from_cursor (GnomeCanvasRichText *text, - GtkDeleteType type, - gint count) + GtkDeleteType type, + gint count) { GtkTextIter insert, start, end; /* Special case: If the user wants to delete a character and there is - a selection, then delete the selection and return */ + * a selection, then delete the selection and return */ if (type == GTK_DELETE_CHARS) { if (gtk_text_buffer_delete_selection (get_buffer (text), TRUE, text->_priv->editable)) @@ -887,8 +896,9 @@ gnome_canvas_rich_text_delete_from_cursor (GnomeCanvasRichText *text, } /* gnome_canvas_rich_text_delete_from_cursor */ static gint -selection_motion_event_handler (GnomeCanvasRichText *text, GdkEvent *event, - gpointer data) +selection_motion_event_handler (GnomeCanvasRichText *text, + GdkEvent *event, + gpointer data) { GtkTextIter newplace; GtkTextMark *mark; @@ -910,8 +920,8 @@ selection_motion_event_handler (GnomeCanvasRichText *text, GdkEvent *event, static void gnome_canvas_rich_text_start_selection_drag (GnomeCanvasRichText *text, - const GtkTextIter *iter, - GdkEventButton *button) + const GtkTextIter *iter, + GdkEventButton *button) { GtkTextIter newplace; @@ -933,7 +943,7 @@ gnome_canvas_rich_text_start_selection_drag (GnomeCanvasRichText *text, static gboolean gnome_canvas_rich_text_end_selection_drag (GnomeCanvasRichText *text, - GdkEventButton *event) + GdkEventButton *event) { if (text->_priv->selection_drag_handler == 0) return FALSE; @@ -950,14 +960,14 @@ gnome_canvas_rich_text_end_selection_drag (GnomeCanvasRichText *text, static void gnome_canvas_rich_text_emit_tag_changed (GnomeCanvasRichText *text, - GtkTextTag *tag) + GtkTextTag *tag) { g_signal_emit (G_OBJECT (text), signals[TAG_CHANGED], 0, tag); } /* gnome_canvas_rich_text_emit_tag_changed */ static gint gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, - GdkEventKey *event) + GdkEventKey *event) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item); gboolean extend_selection = FALSE; @@ -1192,7 +1202,7 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, static gint gnome_canvas_rich_text_key_release_event (GnomeCanvasItem *item, - GdkEventKey *event) + GdkEventKey *event) { return FALSE; } /* gnome_canvas_rich_text_key_release_event */ @@ -1210,7 +1220,7 @@ _click (gpointer data) static gint gnome_canvas_rich_text_button_press_event (GnomeCanvasItem *item, - GdkEventButton *event) + GdkEventButton *event) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item); GtkTextIter iter; @@ -1223,7 +1233,7 @@ gnome_canvas_rich_text_button_press_event (GnomeCanvasItem *item, gtk_text_layout_get_iter_at_pixel (text->_priv->layout, &iter, newx, newy); /* The canvas doesn't give us double- or triple-click events, so - we have to synthesize them ourselves. Yay. */ + * we have to synthesize them ourselves. Yay. */ event_type = event->type; if (event_type == GDK_BUTTON_PRESS) { text->_priv->clicks++; @@ -1341,7 +1351,7 @@ gnome_canvas_rich_text_button_press_event (GnomeCanvasItem *item, static gint gnome_canvas_rich_text_button_release_event (GnomeCanvasItem *item, - GdkEventButton *event) + GdkEventButton *event) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item); gdouble newx, newy; @@ -1378,7 +1388,7 @@ gnome_canvas_rich_text_button_release_event (GnomeCanvasItem *item, static gint gnome_canvas_rich_text_focus_in_event (GnomeCanvasItem *item, - GdkEventFocus *event) + GdkEventFocus *event) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item); @@ -1392,7 +1402,7 @@ gnome_canvas_rich_text_focus_in_event (GnomeCanvasItem *item, static gint gnome_canvas_rich_text_focus_out_event (GnomeCanvasItem *item, - GdkEventFocus *event) + GdkEventFocus *event) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item); @@ -1405,7 +1415,9 @@ gnome_canvas_rich_text_focus_out_event (GnomeCanvasItem *item, } /* gnome_canvas_rich_text_focus_out_event */ static gboolean -get_event_coordinates (GdkEvent *event, gint *x, gint *y) +get_event_coordinates (GdkEvent *event, + gint *x, + gint *y) { g_return_val_if_fail (event, FALSE); @@ -1428,8 +1440,9 @@ get_event_coordinates (GdkEvent *event, gint *x, gint *y) } /* get_event_coordinates */ static void -emit_event_on_tags (GnomeCanvasRichText *text, GdkEvent *event, - GtkTextIter *iter) +emit_event_on_tags (GnomeCanvasRichText *text, + GdkEvent *event, + GtkTextIter *iter) { GSList *tags; GSList *i; @@ -1443,7 +1456,7 @@ emit_event_on_tags (GnomeCanvasRichText *text, GdkEvent *event, gtk_text_tag_event (tag, G_OBJECT (text), event, iter); /* The cursor has been moved to within this tag. Emit the - tag_changed signal */ + * tag_changed signal */ if (event->type == GDK_BUTTON_RELEASE || event->type == GDK_KEY_PRESS || event->type == GDK_KEY_RELEASE) { @@ -1458,7 +1471,8 @@ emit_event_on_tags (GnomeCanvasRichText *text, GdkEvent *event, } /* emit_event_on_tags */ static gint -gnome_canvas_rich_text_event (GnomeCanvasItem *item, GdkEvent *event) +gnome_canvas_rich_text_event (GnomeCanvasItem *item, + GdkEvent *event) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item); gint x, y; @@ -1610,7 +1624,7 @@ blink_cb (gpointer data) static void gnome_canvas_rich_text_start_cursor_blink (GnomeCanvasRichText *text, - gboolean with_delay) + gboolean with_delay) { if (!text->_priv->layout) return; @@ -1653,7 +1667,7 @@ gnome_canvas_rich_text_stop_cursor_blink (GnomeCanvasRichText *text) } /* gnome_canvas_rich_text_stop_cursor_blink */ /* We have to request updates this way because the update cycle is not - re-entrant. This will fire off a request in an idle loop. */ + * re-entrant. This will fire off a request in an idle loop. */ static gboolean request_update (gpointer data) { @@ -1665,7 +1679,8 @@ request_update (gpointer data) } /* request_update */ static void -invalidated_handler (GtkTextLayout *layout, gpointer data) +invalidated_handler (GtkTextLayout *layout, + gpointer data) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (data); @@ -1676,12 +1691,13 @@ invalidated_handler (GtkTextLayout *layout, gpointer data) gtk_text_layout_validate (text->_priv->layout, 2000); /* We are called from the update cycle; gotta put this in an idle - loop. */ + * loop. */ g_idle_add (request_update, text); } /* invalidated_handler */ static void -scale_fonts (GtkTextTag *tag, gpointer data) +scale_fonts (GtkTextTag *tag, + gpointer data) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (data); @@ -1699,8 +1715,11 @@ scale_fonts (GtkTextTag *tag, gpointer data) } /* scale_fonts */ static void -changed_handler (GtkTextLayout *layout, gint start_y, - gint old_height, gint new_height, gpointer data) +changed_handler (GtkTextLayout *layout, + gint start_y, + gint old_height, + gint new_height, + gpointer data) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (data); @@ -1729,7 +1748,7 @@ changed_handler (GtkTextLayout *layout, gint start_y, } /* We are called from the update cycle; gotta put this in an idle - loop. */ + * loop. */ g_idle_add (request_update, text); } /* changed_handler */ @@ -1742,7 +1761,7 @@ changed_handler (GtkTextLayout *layout, gint start_y, **/ void gnome_canvas_rich_text_set_buffer (GnomeCanvasRichText *text, - GtkTextBuffer *buffer) + GtkTextBuffer *buffer) { g_return_if_fail (GNOME_IS_CANVAS_RICH_TEXT (text)); g_return_if_fail (buffer == NULL || GTK_IS_TEXT_BUFFER (buffer)); @@ -1807,8 +1826,8 @@ gnome_canvas_rich_text_get_buffer (GnomeCanvasRichText *text) **/ void gnome_canvas_rich_text_get_iter_location (GnomeCanvasRichText *text, - const GtkTextIter *iter, - GdkRectangle *location) + const GtkTextIter *iter, + GdkRectangle *location) { g_return_if_fail (GNOME_IS_CANVAS_RICH_TEXT (text)); g_return_if_fail (gtk_text_iter_get_buffer (iter) == text->_priv->buffer); @@ -1827,9 +1846,9 @@ gnome_canvas_rich_text_get_iter_location (GnomeCanvasRichText *text, **/ void gnome_canvas_rich_text_get_iter_at_location (GnomeCanvasRichText *text, - GtkTextIter *iter, - gint x, - gint y) + GtkTextIter *iter, + gint x, + gint y) { g_return_if_fail (GNOME_IS_CANVAS_RICH_TEXT (text)); g_return_if_fail (iter != NULL); @@ -1843,8 +1862,8 @@ gnome_canvas_rich_text_get_iter_at_location (GnomeCanvasRichText *text, static void gnome_canvas_rich_text_set_attributes_from_style (GnomeCanvasRichText *text, - GtkTextAttributes *values, - GtkStyle *style) + GtkTextAttributes *values, + GtkStyle *style) { values->appearance.bg_color = style->base[GTK_STATE_NORMAL]; values->appearance.fg_color = style->fg[GTK_STATE_NORMAL]; @@ -1940,8 +1959,11 @@ gnome_canvas_rich_text_destroy_layout (GnomeCanvasRichText *text) } /* gnome_canvas_rich_text_destroy_layout */ static void -get_bounds (GnomeCanvasRichText *text, gdouble *px1, gdouble *py1, - gdouble *px2, gdouble *py2) +get_bounds (GnomeCanvasRichText *text, + gdouble *px1, + gdouble *py1, + gdouble *px2, + gdouble *py2) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (text); gdouble x, y; @@ -1979,8 +2001,9 @@ gnome_canvas_rich_text_get_bounds (GnomeCanvasItem *item, } static void -gnome_canvas_rich_text_update (GnomeCanvasItem *item, const cairo_matrix_t *matrix, - gint flags) +gnome_canvas_rich_text_update (GnomeCanvasItem *item, + const cairo_matrix_t *matrix, + gint flags) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item); gdouble x1, y1, x2, y2; @@ -2000,8 +2023,11 @@ gnome_canvas_rich_text_update (GnomeCanvasItem *item, const cairo_matrix_t *matr } /* gnome_canvas_rich_text_update */ static GnomeCanvasItem * -gnome_canvas_rich_text_point (GnomeCanvasItem *item, gdouble x, gdouble y, - gint cx, gint cy) +gnome_canvas_rich_text_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item); gdouble ax, ay; @@ -2060,9 +2086,12 @@ gnome_canvas_rich_text_draw (GnomeCanvasItem *item, #if 0 static GtkTextTag * -gnome_canvas_rich_text_add_tag (GnomeCanvasRichText *text, gchar *tag_name, - gint start_offset, gint end_offset, - const gchar *first_property_name, ...) +gnome_canvas_rich_text_add_tag (GnomeCanvasRichText *text, + gchar *tag_name, + gint start_offset, + gint end_offset, + const gchar *first_property_name, + ...) { GtkTextTag *tag; GtkTextIter start, end; diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c index adb01548fc..70b7142ac0 100644 --- a/libgnomecanvas/gnome-canvas-text.c +++ b/libgnomecanvas/gnome-canvas-text.c @@ -595,9 +595,9 @@ get_bounds (GnomeCanvasText *text, } static PangoFontMask -get_property_font_set_mask (guint prop_id) +get_property_font_set_mask (guint property_id) { - switch (prop_id) + switch (property_id) { case PROP_FAMILY_SET: return PANGO_FONT_MASK_FAMILY; @@ -625,10 +625,10 @@ ensure_font (GnomeCanvasText *text) /* Set_arg handler for the text item */ static void -gnome_canvas_text_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) +gnome_canvas_text_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; GnomeCanvasText *text; @@ -900,10 +900,10 @@ gnome_canvas_text_set_property (GObject *object, /* Get_arg handler for the text item */ static void -gnome_canvas_text_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) +gnome_canvas_text_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec) { GnomeCanvasText *text; @@ -1115,8 +1115,8 @@ gnome_canvas_text_apply_font_desc (GnomeCanvasText *text) } static void -add_attr (PangoAttrList *attr_list, - PangoAttribute *attr) +add_attr (PangoAttrList *attr_list, + PangoAttribute *attr) { attr->start_index = 0; attr->end_index = G_MAXINT; @@ -1147,8 +1147,8 @@ gnome_canvas_text_apply_attributes (GnomeCanvasText *text) } static void -gnome_canvas_text_set_font_desc (GnomeCanvasText *text, - PangoFontDescription *font_desc) +gnome_canvas_text_set_font_desc (GnomeCanvasText *text, + PangoFontDescription *font_desc) { if (text->font_desc) pango_font_description_free (text->font_desc); @@ -1164,7 +1164,7 @@ gnome_canvas_text_set_font_desc (GnomeCanvasText *text, /* Setting the text from a Pango markup string */ static void gnome_canvas_text_set_markup (GnomeCanvasText *textitem, - const gchar *markup) + const gchar *markup) { PangoAttrList *attr_list = NULL; gchar *text = NULL; @@ -1217,8 +1217,12 @@ gnome_canvas_text_update (GnomeCanvasItem *item, /* Draw handler for the text item */ static void -gnome_canvas_text_draw (GnomeCanvasItem *item, cairo_t *cr, - gint x, gint y, gint width, gint height) +gnome_canvas_text_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { GnomeCanvasText *text = GNOME_CANVAS_TEXT (item); @@ -1250,8 +1254,11 @@ gnome_canvas_text_draw (GnomeCanvasItem *item, cairo_t *cr, /* Point handler for the text item */ static GnomeCanvasItem * -gnome_canvas_text_point (GnomeCanvasItem *item, gdouble x, gdouble y, - gint cx, gint cy) +gnome_canvas_text_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { GnomeCanvasText *text; PangoLayoutIter *iter; diff --git a/libgnomecanvas/gnome-canvas-text.h b/libgnomecanvas/gnome-canvas-text.h index aebad84013..a706ce35eb 100644 --- a/libgnomecanvas/gnome-canvas-text.h +++ b/libgnomecanvas/gnome-canvas-text.h @@ -120,7 +120,7 @@ struct _GnomeCanvasText { gdouble xofs, yofs; /* Text offset distance from anchor position */ - gdouble affine[6]; /* The item -> canvas affine */ /*AA*/ + gdouble affine[6]; /* The item -> canvas affine */ /*AA */ GtkJustification justification; /* Justification for text */ @@ -130,7 +130,7 @@ struct _GnomeCanvasText { gint max_width; /* Maximum width of text lines */ gint height; /* Rendered text height in pixels */ - guint32 rgba; /* RGBA color for text */ /*AA*/ + guint32 rgba; /* RGBA color for text */ /*AA */ guint clip : 1; /* Use clip rectangle? */ diff --git a/libgnomecanvas/gnome-canvas-util.c b/libgnomecanvas/gnome-canvas-util.c index eb19baa6ec..00e76daae9 100644 --- a/libgnomecanvas/gnome-canvas-util.c +++ b/libgnomecanvas/gnome-canvas-util.c @@ -74,7 +74,11 @@ gnome_canvas_item_reset_bounds (GnomeCanvasItem *item) * Sets the bbox to the new value, requesting full repaint. **/ void -gnome_canvas_update_bbox (GnomeCanvasItem *item, gint x1, gint y1, gint x2, gint y2) +gnome_canvas_update_bbox (GnomeCanvasItem *item, + gint x1, + gint y1, + gint x2, + gint y2) { gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2); item->x1 = x1; @@ -118,7 +122,10 @@ gnome_canvas_cairo_create_scratch (void) **/ void gnome_canvas_matrix_transform_rect (const cairo_matrix_t *matrix, - double *x1, double *y1, double *x2, double *y2) + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2) { gdouble maxx, maxy, minx, miny; gdouble tmpx, tmpy; diff --git a/libgnomecanvas/gnome-canvas-widget.c b/libgnomecanvas/gnome-canvas-widget.c index fd5693cd98..ef516eb5b2 100644 --- a/libgnomecanvas/gnome-canvas-widget.c +++ b/libgnomecanvas/gnome-canvas-widget.c @@ -170,7 +170,8 @@ gnome_canvas_widget_class_init (GnomeCanvasWidgetClass *class) } static void -do_destroy (gpointer data, GObject *gone_object) +do_destroy (gpointer data, + GObject *gone_object) { GnomeCanvasWidget *witem; @@ -244,10 +245,10 @@ recalc_bounds (GnomeCanvasWidget *witem) } static void -gnome_canvas_widget_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) +gnome_canvas_widget_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; GnomeCanvasWidget *witem; @@ -336,10 +337,10 @@ gnome_canvas_widget_set_property (GObject *object, } static void -gnome_canvas_widget_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) +gnome_canvas_widget_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec) { GnomeCanvasWidget *witem; @@ -406,9 +407,11 @@ gnome_canvas_widget_update (GnomeCanvasItem *item, static void gnome_canvas_widget_draw (GnomeCanvasItem *item, - cairo_t *cr, - gint x, gint y, - gint width, gint height) + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { #if 0 GnomeCanvasWidget *witem; @@ -421,8 +424,11 @@ gnome_canvas_widget_draw (GnomeCanvasItem *item, } static GnomeCanvasItem * -gnome_canvas_widget_point (GnomeCanvasItem *item, gdouble x, gdouble y, - gint cx, gint cy) +gnome_canvas_widget_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { GnomeCanvasWidget *witem; gdouble x1, y1, x2, y2; diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index 8e0cd2d921..176c990561 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -233,8 +233,10 @@ item_post_create_setup (GnomeCanvasItem *item) /* Set_property handler for canvas items */ static void -gnome_canvas_item_set_property (GObject *gobject, guint param_id, - const GValue *value, GParamSpec *pspec) +gnome_canvas_item_set_property (GObject *gobject, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; @@ -242,7 +244,7 @@ gnome_canvas_item_set_property (GObject *gobject, guint param_id, item = GNOME_CANVAS_ITEM (gobject); - switch (param_id) { + switch (property_id) { case ITEM_PROP_PARENT: if (item->parent != NULL) { g_warning ("Cannot set `parent' argument after item has " @@ -254,15 +256,17 @@ gnome_canvas_item_set_property (GObject *gobject, guint param_id, } break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, param_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } /* Get_property handler for canvas items */ static void -gnome_canvas_item_get_property (GObject *gobject, guint param_id, - GValue *value, GParamSpec *pspec) +gnome_canvas_item_get_property (GObject *gobject, + guint property_id, + GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; @@ -270,13 +274,13 @@ gnome_canvas_item_get_property (GObject *gobject, guint param_id, item = GNOME_CANVAS_ITEM (gobject); - switch (param_id) { + switch (property_id) { case ITEM_PROP_PARENT: g_value_set_object (value, item->parent); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, param_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } @@ -291,8 +295,10 @@ gnome_canvas_item_get_property (GObject *gobject, guint param_id, * Constructs a canvas item; meant for use only by item implementations. **/ void -gnome_canvas_item_construct (GnomeCanvasItem *item, GnomeCanvasGroup *parent, - const gchar *first_arg_name, va_list args) +gnome_canvas_item_construct (GnomeCanvasItem *item, + GnomeCanvasGroup *parent, + const gchar *first_arg_name, + va_list args) { g_return_if_fail (GNOME_IS_CANVAS_GROUP (parent)); g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); @@ -364,7 +370,7 @@ gnome_canvas_item_dispose (GObject *object) G_OBJECT_CLASS (item_parent_class)->dispose (object); /* items should remove any reference to item->canvas after the - first ::dispose */ + * first ::dispose */ item->canvas = NULL; } @@ -501,7 +507,9 @@ gnome_canvas_item_invoke_point (GnomeCanvasItem *item, * specified values, and the item is repainted as appropriate. **/ void -gnome_canvas_item_set (GnomeCanvasItem *item, const gchar *first_arg_name, ...) +gnome_canvas_item_set (GnomeCanvasItem *item, + const gchar *first_arg_name, + ...) { va_list args; @@ -540,7 +548,8 @@ gnome_canvas_item_set_valist (GnomeCanvasItem *item, * transformation. **/ void -gnome_canvas_item_transform (GnomeCanvasItem *item, const cairo_matrix_t *matrix) +gnome_canvas_item_transform (GnomeCanvasItem *item, + const cairo_matrix_t *matrix) { cairo_matrix_t i2p; @@ -562,7 +571,8 @@ gnome_canvas_item_transform (GnomeCanvasItem *item, const cairo_matrix_t *matrix * matrix. NULL is treated as identity. **/ void -gnome_canvas_item_set_matrix (GnomeCanvasItem *item, const cairo_matrix_t *matrix) +gnome_canvas_item_set_matrix (GnomeCanvasItem *item, + const cairo_matrix_t *matrix) { g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); @@ -593,7 +603,9 @@ gnome_canvas_item_set_matrix (GnomeCanvasItem *item, const cairo_matrix_t *matri * most probably does not do, what you want. **/ void -gnome_canvas_item_move (GnomeCanvasItem *item, gdouble dx, gdouble dy) +gnome_canvas_item_move (GnomeCanvasItem *item, + gdouble dx, + gdouble dy) { cairo_matrix_t translate; @@ -608,7 +620,8 @@ gnome_canvas_item_move (GnomeCanvasItem *item, gdouble dx, gdouble dy) * specified link after the "before" link. Returns TRUE if the list was changed. */ static gboolean -put_item_after (GList *link, GList *before) +put_item_after (GList *link, + GList *before) { GnomeCanvasGroup *parent; GList *old_before, *old_after; @@ -666,7 +679,8 @@ put_item_after (GList *link, GList *before) * stack, then the item is put at the top. **/ void -gnome_canvas_item_raise (GnomeCanvasItem *item, gint positions) +gnome_canvas_item_raise (GnomeCanvasItem *item, + gint positions) { GList *link, *before; GnomeCanvasGroup *parent; @@ -703,7 +717,8 @@ gnome_canvas_item_raise (GnomeCanvasItem *item, gint positions) * stack, then the item is put at the bottom. **/ void -gnome_canvas_item_lower (GnomeCanvasItem *item, gint positions) +gnome_canvas_item_lower (GnomeCanvasItem *item, + gint positions) { GList *link, *before; GnomeCanvasGroup *parent; @@ -894,7 +909,8 @@ gnome_canvas_item_grab (GnomeCanvasItem *item, * mouse. **/ void -gnome_canvas_item_ungrab (GnomeCanvasItem *item, guint32 etime) +gnome_canvas_item_ungrab (GnomeCanvasItem *item, + guint32 etime) { g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); @@ -907,7 +923,8 @@ gnome_canvas_item_ungrab (GnomeCanvasItem *item, guint32 etime) } void -gnome_canvas_item_i2w_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) +gnome_canvas_item_i2w_matrix (GnomeCanvasItem *item, + cairo_matrix_t *matrix) { g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); g_return_if_fail (matrix != NULL); @@ -922,7 +939,8 @@ gnome_canvas_item_i2w_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) } void -gnome_canvas_item_w2i_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) +gnome_canvas_item_w2i_matrix (GnomeCanvasItem *item, + cairo_matrix_t *matrix) { cairo_status_t status; @@ -944,7 +962,9 @@ gnome_canvas_item_w2i_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) * coordinates. **/ void -gnome_canvas_item_w2i (GnomeCanvasItem *item, gdouble *x, gdouble *y) +gnome_canvas_item_w2i (GnomeCanvasItem *item, + gdouble *x, + gdouble *y) { cairo_matrix_t matrix; @@ -966,7 +986,9 @@ gnome_canvas_item_w2i (GnomeCanvasItem *item, gdouble *x, gdouble *y) * coordinates. **/ void -gnome_canvas_item_i2w (GnomeCanvasItem *item, gdouble *x, gdouble *y) +gnome_canvas_item_i2w (GnomeCanvasItem *item, + gdouble *x, + gdouble *y) { cairo_matrix_t matrix; @@ -987,7 +1009,8 @@ gnome_canvas_item_i2w (GnomeCanvasItem *item, gdouble *x, gdouble *y) * canvas pixel coordinates. **/ void -gnome_canvas_item_i2c_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) +gnome_canvas_item_i2c_matrix (GnomeCanvasItem *item, + cairo_matrix_t *matrix) { cairo_matrix_t i2w, w2c; @@ -998,7 +1021,8 @@ gnome_canvas_item_i2c_matrix (GnomeCanvasItem *item, cairo_matrix_t *matrix) /* Returns whether the item is an inferior of or is equal to the parent. */ static gint -is_descendant (GnomeCanvasItem *item, GnomeCanvasItem *parent) +is_descendant (GnomeCanvasItem *item, + GnomeCanvasItem *parent) { for (; item; item = item->parent) if (item == parent) @@ -1017,7 +1041,8 @@ is_descendant (GnomeCanvasItem *item, GnomeCanvasItem *parent) * its absolute position within the canvas. **/ void -gnome_canvas_item_reparent (GnomeCanvasItem *item, GnomeCanvasGroup *new_group) +gnome_canvas_item_reparent (GnomeCanvasItem *item, + GnomeCanvasGroup *new_group) { g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); g_return_if_fail (GNOME_IS_CANVAS_GROUP (new_group)); @@ -1184,11 +1209,11 @@ enum { static void gnome_canvas_group_class_init (GnomeCanvasGroupClass *class); static void gnome_canvas_group_init (GnomeCanvasGroup *group); static void gnome_canvas_group_set_property (GObject *object, - guint param_id, + guint property_id, const GValue *value, GParamSpec *pspec); static void gnome_canvas_group_get_property (GObject *object, - guint param_id, + guint property_id, GValue *value, GParamSpec *pspec); @@ -1298,8 +1323,10 @@ gnome_canvas_group_init (GnomeCanvasGroup *group) /* Set_property handler for canvas groups */ static void -gnome_canvas_group_set_property (GObject *gobject, guint param_id, - const GValue *value, GParamSpec *pspec) +gnome_canvas_group_set_property (GObject *gobject, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; @@ -1307,7 +1334,7 @@ gnome_canvas_group_set_property (GObject *gobject, guint param_id, item = GNOME_CANVAS_ITEM (gobject); - switch (param_id) { + switch (property_id) { case GROUP_PROP_X: item->matrix.x0 = g_value_get_double (value); break; @@ -1317,15 +1344,17 @@ gnome_canvas_group_set_property (GObject *gobject, guint param_id, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, param_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } /* Get_property handler for canvas groups */ static void -gnome_canvas_group_get_property (GObject *gobject, guint param_id, - GValue *value, GParamSpec *pspec) +gnome_canvas_group_get_property (GObject *gobject, + guint property_id, + GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; @@ -1333,7 +1362,7 @@ gnome_canvas_group_get_property (GObject *gobject, guint param_id, item = GNOME_CANVAS_ITEM (gobject); - switch (param_id) { + switch (property_id) { case GROUP_PROP_X: g_value_set_double (value, item->matrix.x0); break; @@ -1343,7 +1372,7 @@ gnome_canvas_group_get_property (GObject *gobject, guint param_id, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, param_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); break; } } @@ -1627,7 +1656,8 @@ gnome_canvas_group_bounds (GnomeCanvasItem *item, /* Adds an item to a group */ static void -group_add (GnomeCanvasGroup *group, GnomeCanvasItem *item) +group_add (GnomeCanvasGroup *group, + GnomeCanvasItem *item) { g_object_ref_sink (G_OBJECT (item)); @@ -1648,7 +1678,8 @@ group_add (GnomeCanvasGroup *group, GnomeCanvasItem *item) /* Removes an item from a group */ static void -group_remove (GnomeCanvasGroup *group, GnomeCanvasItem *item) +group_remove (GnomeCanvasGroup *group, + GnomeCanvasItem *item) { GList *children; @@ -1826,33 +1857,33 @@ gnome_canvas_get_type (void) } static void -gnome_canvas_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) +gnome_canvas_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { - switch (prop_id) { + switch (property_id) { case PROP_FOCUSED_ITEM: g_value_set_object (value, GNOME_CANVAS (object)->focused_item); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -gnome_canvas_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) +gnome_canvas_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { - switch (prop_id) { + switch (property_id) { case PROP_FOCUSED_ITEM: GNOME_CANVAS (object)->focused_item = g_value_get_object (value); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1914,7 +1945,8 @@ gnome_canvas_class_init (GnomeCanvasClass *klass) * never ever do this, so we panic if this happens. */ G_GNUC_NORETURN static void -panic_root_finalized (gpointer data, GObject *gone_object) +panic_root_finalized (gpointer data, + GObject *gone_object) { g_error ("Eeeek, root item %p of canvas %p was destroyed!", gone_object, data); } @@ -2127,7 +2159,9 @@ gnome_canvas_unrealize (GtkWidget *widget) * keep as much as possible of the canvas scrolling region in view. */ static void -scroll_to (GnomeCanvas *canvas, gint cx, gint cy) +scroll_to (GnomeCanvas *canvas, + gint cx, + gint cy) { GtkWidget *widget; GtkAllocation allocation; @@ -2219,7 +2253,8 @@ scroll_to (GnomeCanvas *canvas, gint cx, gint cy) /* Size allocation handler for the canvas */ static void -gnome_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +gnome_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { GtkScrollable *scrollable; GtkAdjustment *hadjustment; @@ -2312,7 +2347,8 @@ gnome_canvas_draw (GtkWidget *widget, */ static gint -emit_event (GnomeCanvas *canvas, GdkEvent *event) +emit_event (GnomeCanvas *canvas, + GdkEvent *event) { GdkEvent *ev; gint finished; @@ -2443,7 +2479,8 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event) * Also emits enter/leave events for items as appropriate. */ static gint -pick_current_item (GnomeCanvas *canvas, GdkEvent *event) +pick_current_item (GnomeCanvas *canvas, + GdkEvent *event) { gint button_down; gdouble x, y; @@ -2586,7 +2623,8 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) /* Button event handler for the canvas */ static gint -gnome_canvas_button (GtkWidget *widget, GdkEventButton *event) +gnome_canvas_button (GtkWidget *widget, + GdkEventButton *event) { GnomeCanvas *canvas; GtkLayout *layout; @@ -2665,7 +2703,8 @@ gnome_canvas_button (GtkWidget *widget, GdkEventButton *event) /* Motion event handler for the canvas */ static gint -gnome_canvas_motion (GtkWidget *widget, GdkEventMotion *event) +gnome_canvas_motion (GtkWidget *widget, + GdkEventMotion *event) { GnomeCanvas *canvas; GtkLayout *layout; @@ -2689,7 +2728,8 @@ gnome_canvas_motion (GtkWidget *widget, GdkEventMotion *event) /* Key event handler for the canvas */ static gboolean -gnome_canvas_key (GtkWidget *widget, GdkEventKey *event) +gnome_canvas_key (GtkWidget *widget, + GdkEventKey *event) { GnomeCanvas *canvas; @@ -2719,7 +2759,8 @@ gnome_canvas_key (GtkWidget *widget, GdkEventKey *event) /* Crossing event handler for the canvas */ static gint -gnome_canvas_crossing (GtkWidget *widget, GdkEventCrossing *event) +gnome_canvas_crossing (GtkWidget *widget, + GdkEventCrossing *event) { GnomeCanvas *canvas; GtkLayout *layout; @@ -2749,7 +2790,8 @@ gnome_canvas_crossing (GtkWidget *widget, GdkEventCrossing *event) /* Focus in handler for the canvas */ static gint -gnome_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event) +gnome_canvas_focus_in (GtkWidget *widget, + GdkEventFocus *event) { GnomeCanvas *canvas; @@ -2769,7 +2811,8 @@ gnome_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event) /* Focus out handler for the canvas */ static gint -gnome_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event) +gnome_canvas_focus_out (GtkWidget *widget, + GdkEventFocus *event) { GnomeCanvas *canvas; @@ -2830,10 +2873,10 @@ update_again: } /* it is possible that during picking we emitted an event in which - the user then called some function which then requested update - of something. Without this we'd be left in a state where - need_update would have been left TRUE and the canvas would have - been left unpainted. */ + * the user then called some function which then requested update + * of something. Without this we'd be left in a state where + * need_update would have been left TRUE and the canvas would have + * been left unpainted. */ if (canvas->need_update) { goto update_again; } @@ -2999,7 +3042,9 @@ gnome_canvas_get_scroll_region (GnomeCanvas *canvas, * scrollbars to the canvas layout's scrolling adjusments. **/ void -gnome_canvas_scroll_to (GnomeCanvas *canvas, gint cx, gint cy) +gnome_canvas_scroll_to (GnomeCanvas *canvas, + gint cx, + gint cy) { g_return_if_fail (GNOME_IS_CANVAS (canvas)); @@ -3016,7 +3061,9 @@ gnome_canvas_scroll_to (GnomeCanvas *canvas, gint cx, gint cy) * pixel units. **/ void -gnome_canvas_get_scroll_offsets (GnomeCanvas *canvas, gint *cx, gint *cy) +gnome_canvas_get_scroll_offsets (GnomeCanvas *canvas, + gint *cx, + gint *cy) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -3049,7 +3096,9 @@ gnome_canvas_get_scroll_offsets (GnomeCanvas *canvas, gint *cx, gint *cy) * coordinates. **/ GnomeCanvasItem * -gnome_canvas_get_item_at (GnomeCanvas *canvas, gdouble x, gdouble y) +gnome_canvas_get_item_at (GnomeCanvas *canvas, + gdouble x, + gdouble y) { gint cx, cy; @@ -3079,7 +3128,8 @@ gnome_canvas_request_update_real (GnomeCanvas *canvas) } static inline void -get_visible_rect (GnomeCanvas *canvas, GdkRectangle *visible) +get_visible_rect (GnomeCanvas *canvas, + GdkRectangle *visible) { GtkAllocation allocation; GtkScrollable *scrollable; @@ -3116,7 +3166,11 @@ get_visible_rect (GnomeCanvas *canvas, GdkRectangle *visible) * be used only by item implementations. **/ void -gnome_canvas_request_redraw (GnomeCanvas *canvas, gint x1, gint y1, gint x2, gint y2) +gnome_canvas_request_redraw (GnomeCanvas *canvas, + gint x1, + gint y1, + gint x2, + gint y2) { GdkRectangle area, clip; @@ -3147,7 +3201,8 @@ gnome_canvas_request_redraw (GnomeCanvas *canvas, gint x1, gint y1, gint x2, gin * pixel coordinates. **/ void -gnome_canvas_w2c_matrix (GnomeCanvas *canvas, cairo_matrix_t *matrix) +gnome_canvas_w2c_matrix (GnomeCanvas *canvas, + cairo_matrix_t *matrix) { g_return_if_fail (GNOME_IS_CANVAS (canvas)); g_return_if_fail (matrix != NULL); @@ -3165,7 +3220,8 @@ gnome_canvas_w2c_matrix (GnomeCanvas *canvas, cairo_matrix_t *matrix) * world coordinates. **/ void -gnome_canvas_c2w_matrix (GnomeCanvas *canvas, cairo_matrix_t *matrix) +gnome_canvas_c2w_matrix (GnomeCanvas *canvas, + cairo_matrix_t *matrix) { g_return_if_fail (GNOME_IS_CANVAS (canvas)); g_return_if_fail (matrix != NULL); @@ -3185,7 +3241,11 @@ gnome_canvas_c2w_matrix (GnomeCanvas *canvas, cairo_matrix_t *matrix) * Converts world coordinates into canvas pixel coordinates. **/ void -gnome_canvas_w2c (GnomeCanvas *canvas, gdouble wx, gdouble wy, gint *cx, gint *cy) +gnome_canvas_w2c (GnomeCanvas *canvas, + gdouble wx, + gdouble wy, + gint *cx, + gint *cy) { cairo_matrix_t w2c; @@ -3243,7 +3303,11 @@ gnome_canvas_w2c_d (GnomeCanvas *canvas, * Converts canvas pixel coordinates to world coordinates. **/ void -gnome_canvas_c2w (GnomeCanvas *canvas, gint cx, gint cy, gdouble *wx, gdouble *wy) +gnome_canvas_c2w (GnomeCanvas *canvas, + gint cx, + gint cy, + gdouble *wx, + gdouble *wy) { cairo_matrix_t c2w; gdouble x, y; @@ -3274,8 +3338,11 @@ gnome_canvas_c2w (GnomeCanvas *canvas, gint cx, gint cy, gdouble *wx, gdouble *w * example. **/ void -gnome_canvas_window_to_world (GnomeCanvas *canvas, gdouble winx, gdouble winy, - gdouble *worldx, gdouble *worldy) +gnome_canvas_window_to_world (GnomeCanvas *canvas, + gdouble winx, + gdouble winy, + gdouble *worldx, + gdouble *worldy) { g_return_if_fail (GNOME_IS_CANVAS (canvas)); @@ -3297,8 +3364,11 @@ gnome_canvas_window_to_world (GnomeCanvas *canvas, gdouble winx, gdouble winy, * Converts world coordinates into window-relative coordinates. **/ void -gnome_canvas_world_to_window (GnomeCanvas *canvas, gdouble worldx, gdouble worldy, - gdouble *winx, gdouble *winy) +gnome_canvas_world_to_window (GnomeCanvas *canvas, + gdouble worldx, + gdouble worldy, + gdouble *winx, + gdouble *winy) { g_return_if_fail (GNOME_IS_CANVAS (canvas)); @@ -3311,9 +3381,9 @@ gnome_canvas_world_to_window (GnomeCanvas *canvas, gdouble worldx, gdouble world static gboolean boolean_handled_accumulator (GSignalInvocationHint *ihint, - GValue *return_accu, - const GValue *handler_return, - gpointer dummy) + GValue *return_accu, + const GValue *handler_return, + gpointer dummy) { gboolean continue_emission; gboolean signal_handled; diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index db5150bebd..95084c6d28 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -270,9 +270,11 @@ mail_browser_message_selected_cb (EMailBrowser *browser, EMailReader *reader; EWebView *web_view; const gchar *title; + guint32 state; reader = E_MAIL_READER (browser); - e_mail_reader_update_actions (reader, e_mail_reader_check_state (reader)); + state = e_mail_reader_check_state (reader); + e_mail_reader_update_actions (reader, state); if (uid == NULL) return; @@ -293,7 +295,8 @@ mail_browser_message_selected_cb (EMailBrowser *browser, gtk_window_set_title (GTK_WINDOW (browser), title); gtk_widget_grab_focus (GTK_WIDGET (web_view)); - camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); + camel_message_info_set_flags ( + info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); camel_folder_free_message_info (folder, info); } diff --git a/mail/e-mail-folder-utils.c b/mail/e-mail-folder-utils.c index 72afb08c6f..7c84957f6a 100644 --- a/mail/e-mail-folder-utils.c +++ b/mail/e-mail-folder-utils.c @@ -767,7 +767,8 @@ mail_folder_remove_recursive (CamelStore *store, } static void -follow_cancel_cb (GCancellable *cancellable, GCancellable *transparent_cancellable) +follow_cancel_cb (GCancellable *cancellable, + GCancellable *transparent_cancellable) { g_cancellable_cancel (transparent_cancellable); } diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c index 6ac8f89b7f..07b2a8bb2c 100644 --- a/mail/e-mail-migrate.c +++ b/mail/e-mail-migrate.c @@ -124,7 +124,8 @@ static GtkLabel *label; static GtkProgressBar *progress; static void -em_migrate_setup_progress_dialog (const gchar *title, const gchar *desc) +em_migrate_setup_progress_dialog (const gchar *title, + const gchar *desc) { GtkWidget *vbox, *hbox, *w; gchar *markup; @@ -238,7 +239,10 @@ static gint open_flags[3] = { }; static gboolean -cp (const gchar *src, const gchar *dest, gboolean show_progress, gint mode) +cp (const gchar *src, + const gchar *dest, + gboolean show_progress, + gint mode) { guchar readbuf[65536]; gssize nread, nwritten; @@ -417,7 +421,8 @@ emm_setup_initial (const gchar *data_dir) } static gboolean -is_in_plugs_list (GSList *list, const gchar *value) +is_in_plugs_list (GSList *list, + const gchar *value) { GSList *l; @@ -636,7 +641,8 @@ migrate_folders (CamelStore *store, /* This could be in CamelStore.ch */ static void -count_folders (CamelFolderInfo *fi, gint *count) +count_folders (CamelFolderInfo *fi, + gint *count) { while (fi) { *count = *count + 1; @@ -697,7 +703,7 @@ migrate_to_db (EShellBackend *shell_backend) EMailBackend *mail_backend; EMailSession *mail_session; EIterator *iter; - gint i=0, len; + gint i = 0, len; CamelStore *store = NULL; CamelFolderInfo *info; CamelURL *url; @@ -724,7 +730,7 @@ migrate_to_db (EShellBackend *shell_backend) "folders has been moved to SQLite since Evolution 2.24.\n\nPlease be " "patient while Evolution migrates your folders...")); - em_migrate_set_progress ( (double) i/(len+1)); + em_migrate_set_progress ( (double) i / (len + 1)); store = setup_local_store (shell_backend, session); url = camel_service_get_camel_url (CAMEL_SERVICE (store)); @@ -753,14 +759,14 @@ migrate_to_db (EShellBackend *shell_backend) g_main_context_iteration (NULL, TRUE); } i++; - em_migrate_set_progress ( (double) i/(len+1)); + em_migrate_set_progress ( (double) i / (len + 1)); while (e_iterator_is_valid (iter)) { EAccount *account = (EAccount *) e_iterator_get (iter); EAccountService *service; service = account->source; - em_migrate_set_progress ( (double) i/(len+1)); + em_migrate_set_progress ( (double) i / (len + 1)); if (account->enabled && service->url != NULL && service->url[0] && strncmp (service->url, "mbox:", 5) != 0) { @@ -796,8 +802,6 @@ migrate_to_db (EShellBackend *shell_backend) } - //camel_session_set_online ((CamelSession *) session, TRUE); - g_object_unref (iter); em_migrate_close_progress_dialog (); diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c index 1d158fd398..e737b88bfe 100644 --- a/mail/e-mail-notebook-view.c +++ b/mail/e-mail-notebook-view.c @@ -100,7 +100,7 @@ emnv_get_page_num (EMailNotebookView *view, n = gtk_notebook_get_n_pages (priv->book); - for (i=0; i<n; i++) { + for (i = 0; i < n; i++) { GtkWidget *curr = gtk_notebook_get_nth_page (priv->book, i); if (curr == widget) return i; @@ -164,8 +164,8 @@ fix_tab_picker_width (GtkWidget *widget, { ClutterActor *stage = g_object_get_data ((GObject *)actor, "stage"); - clutter_actor_set_size (actor, allocation->width-1, -1); - clutter_actor_set_size (stage, allocation->width-1, -1); + clutter_actor_set_size (actor, allocation->width - 1, -1); + clutter_actor_set_size (stage, allocation->width - 1, -1); } static void @@ -230,8 +230,8 @@ tab_picker_preview_mode_notify (EMailTabPicker *picker, static void mnv_tab_anim_frame_cb (ClutterTimeline *timeline, - gint frame_num, - EMailTab *tab) + gint frame_num, + EMailTab *tab) { if (!clutter_actor_get_parent (CLUTTER_ACTOR (tab))) { clutter_timeline_stop (timeline); @@ -246,7 +246,7 @@ mnv_tab_anim_frame_cb (ClutterTimeline *timeline, static void mnv_tab_anim_complete_cb (ClutterTimeline *timeline, - EMailTab *tab) + EMailTab *tab) { e_mail_tab_set_width (tab, 200); g_object_unref (tab); @@ -261,7 +261,7 @@ struct _tab_data { static void mnv_tab_closed_cb (ClutterTimeline *timeline, - struct _tab_data *data) + struct _tab_data *data) { EMailView *page = g_object_get_data ((GObject *)data->tab, "page"); EMailView *prev; @@ -291,7 +291,8 @@ mnv_tab_closed_cb (ClutterTimeline *timeline, } static void -mnv_tab_closed (EMailTab *tab, EMailNotebookView *view) +mnv_tab_closed (EMailTab *tab, + EMailNotebookView *view) { EMailNotebookViewPrivate *priv = view->priv; gint page, cur; @@ -327,8 +328,8 @@ mnv_tab_closed (EMailTab *tab, EMailNotebookView *view) static void tab_activated_cb (EMailTabPicker *picker, - EMailTab *tab, - EMailNotebookView *view) + EMailTab *tab, + EMailNotebookView *view) { EMailView *page = g_object_get_data ((GObject *)tab, "page"); gint num = emnv_get_page_num (view, (GtkWidget *) page); @@ -339,7 +340,7 @@ tab_activated_cb (EMailTabPicker *picker, static void tab_remove_gtk_cb (GtkWidget *button, - EMailNotebookView *view) + EMailNotebookView *view) { EMailView *page = g_object_get_data ((GObject *)button, "page"); EMailView *prev; @@ -370,8 +371,8 @@ tab_remove_gtk_cb (GtkWidget *button, static void adjust_label_size_request (GtkWidget *view, - GtkAllocation *allocation, - GtkWidget *label) + GtkAllocation *allocation, + GtkWidget *label) { GtkRequisition requisition; gint max_width = allocation->width / 2; @@ -387,7 +388,7 @@ adjust_label_size_request (GtkWidget *view, static void disconnect_label_adjusting (EMailNotebookView *view, - GtkWidget *label) + GtkWidget *label) { g_signal_handlers_disconnect_by_func ( view, @@ -397,8 +398,8 @@ disconnect_label_adjusting (EMailNotebookView *view, static GtkWidget * create_tab_label (EMailNotebookView *view, - EMailView *page, - const gchar *str) + EMailView *page, + const gchar *str) { GtkWidget *container, *widget; GtkAllocation allocation; @@ -468,11 +469,12 @@ fix_clutter_embed_width (GtkWidget *widget, GtkAllocation galoc; gtk_widget_get_allocation (embed, &galoc); - clutter_actor_set_size (actor, allocation->width-1, galoc.height); + clutter_actor_set_size (actor, allocation->width - 1, galoc.height); } static GtkWidget * -create_under_clutter (GtkWidget *widget, GtkWidget *paned) +create_under_clutter (GtkWidget *widget, + GtkWidget *paned) { GtkWidget *embed; ClutterActor *stage, *actor; @@ -941,7 +943,8 @@ mail_notebook_view_get_window (EMailReader *reader) } static void -reconnect_changed_event (EMailReader *child, EMailReader *parent) +reconnect_changed_event (EMailReader *child, + EMailReader *parent) { g_signal_emit_by_name (parent, "changed"); } @@ -1023,7 +1026,7 @@ mail_netbook_view_open_mail (EMailView *view, e_mail_tab_set_preview_actor (tab, clone); e_mail_tab_set_can_close (tab, TRUE); - e_mail_tab_picker_add_tab (priv->tab_picker, tab, pos+1); + e_mail_tab_picker_add_tab (priv->tab_picker, tab, pos + 1); e_mail_tab_enable_drag (tab, TRUE); page = e_mail_tab_picker_get_tab_no (priv->tab_picker, tab); @@ -1062,7 +1065,8 @@ mail_netbook_view_open_mail (EMailView *view, #if HAVE_CLUTTER static ClutterActor * -build_histogram (GtkWidget *widget, CamelFolder *folder) +build_histogram (GtkWidget *widget, + CamelFolder *folder) { gint week_time = 60 * 60 * 24 * 7; gint weeks[54]; @@ -1075,7 +1079,7 @@ build_histogram (GtkWidget *widget, CamelFolder *folder) gint x = 0; time_t now = time (NULL); - for (i=0; i<54; i++) + for (i = 0; i < 54; i++) weeks[i] = 0; uids = camel_folder_get_uids (folder); @@ -1098,12 +1102,12 @@ build_histogram (GtkWidget *widget, CamelFolder *folder) } } - for (i=0; i< 53; i++) { + for (i = 0; i< 53; i++) { if (weeks[i] > max) max = weeks[i]; } - ratio = 50.0/max; + ratio = 50.0 / max; camel_folder_free_uids (folder, uids); @@ -1119,7 +1123,7 @@ build_histogram (GtkWidget *widget, CamelFolder *folder) cairo_set_source_rgba (cr, 0.3, 0.2, 0.4, 1.0); - for (i=51; i>=0; i--) { + for (i = 51; i >= 0; i--) { x+=3; cairo_line_to (cr, x, 50 - (weeks[i]*ratio)); @@ -1131,7 +1135,7 @@ build_histogram (GtkWidget *widget, CamelFolder *folder) cairo_save (cr); cairo_set_source_rgba (cr, 0.8, 0.5, 0.3, 1.0); - cairo_arc (cr, x, 50 - (weeks[0] * ratio), 3, 0, 2*M_PI); + cairo_arc (cr, x, 50 - (weeks[0] * ratio), 3, 0, 2 *M_PI); cairo_fill (cr); cairo_restore (cr); @@ -1409,7 +1413,7 @@ e_mail_notebook_view_reader_init (EMailReaderInterface *interface) } static void -e_mail_notebook_view_init (EMailNotebookView *view) +e_mail_notebook_view_init (EMailNotebookView *view) { view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( view, E_TYPE_MAIL_NOTEBOOK_VIEW, EMailNotebookViewPrivate); @@ -1419,7 +1423,8 @@ e_mail_notebook_view_init (EMailNotebookView *view) } static void -emnv_show_folder (EMailNotebookView *view, gpointer not_used) +emnv_show_folder (EMailNotebookView *view, + gpointer not_used) { gint pos; EMailNotebookViewPrivate *priv = view->priv; @@ -1438,7 +1443,8 @@ emnv_show_folder (EMailNotebookView *view, gpointer not_used) } static void -emnv_show_prevtab (EMailNotebookView *view, gpointer not_used) +emnv_show_prevtab (EMailNotebookView *view, + gpointer not_used) { gint pos; EMailNotebookViewPrivate *priv = view->priv; @@ -1450,19 +1456,20 @@ emnv_show_prevtab (EMailNotebookView *view, gpointer not_used) #if HAVE_CLUTTER pos = e_mail_tab_picker_get_current_tab (priv->tab_picker); if (pos > 0) { - e_mail_tab_picker_set_current_tab (priv->tab_picker, pos-1); - mnv_set_current_tab (E_MAIL_NOTEBOOK_VIEW (view), pos-1); + e_mail_tab_picker_set_current_tab (priv->tab_picker, pos - 1); + mnv_set_current_tab (E_MAIL_NOTEBOOK_VIEW (view), pos - 1); } #else pos = gtk_notebook_get_current_page (priv->book); if (pos > 0 ) - gtk_notebook_set_current_page (priv->book, pos-1); + gtk_notebook_set_current_page (priv->book, pos - 1); #endif } static void -emnv_show_nexttab (EMailNotebookView *view, gpointer not_used) +emnv_show_nexttab (EMailNotebookView *view, + gpointer not_used) { gint pos; EMailNotebookViewPrivate *priv = view->priv; @@ -1470,20 +1477,21 @@ emnv_show_nexttab (EMailNotebookView *view, gpointer not_used) #if HAVE_CLUTTER pos = e_mail_tab_picker_get_current_tab (priv->tab_picker); - if (pos < (gtk_notebook_get_n_pages (priv->book)-1)) { - e_mail_tab_picker_set_current_tab (priv->tab_picker, pos+1); - mnv_set_current_tab (E_MAIL_NOTEBOOK_VIEW (view), pos+1); + if (pos < (gtk_notebook_get_n_pages (priv->book) - 1)) { + e_mail_tab_picker_set_current_tab (priv->tab_picker, pos + 1); + mnv_set_current_tab (E_MAIL_NOTEBOOK_VIEW (view), pos + 1); } #else pos = gtk_notebook_get_current_page (priv->book); - if (pos < (gtk_notebook_get_n_pages (priv->book)-1)) - gtk_notebook_set_current_page (priv->book, pos+1); + if (pos < (gtk_notebook_get_n_pages (priv->book) - 1)) + gtk_notebook_set_current_page (priv->book, pos + 1); #endif } static void -emnv_close_tab (EMailNotebookView *view, gpointer not_used) +emnv_close_tab (EMailNotebookView *view, + gpointer not_used) { EMailNotebookViewPrivate *priv = view->priv; diff --git a/mail/e-mail-pane.c b/mail/e-mail-pane.c index 6fa88afd0f..c982ab0267 100644 --- a/mail/e-mail-pane.c +++ b/mail/e-mail-pane.c @@ -37,7 +37,7 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; static void -e_mail_pane_init (EMailPane *shell) +e_mail_pane_init (EMailPane *shell) { shell->priv = g_new0 (EMailPanePrivate, 1); } diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index d9c44efd2c..c9ebb8a050 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -1052,7 +1052,8 @@ e_mail_paned_view_get_preview (EMailPanedView *view) } void -e_mail_paned_view_set_enable_show_folder (EMailPanedView *view, gboolean set) +e_mail_paned_view_set_enable_show_folder (EMailPanedView *view, + gboolean set) { view->priv->enable_show_folder = set ? 1 : 0; } diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index adc5110851..4cc9465c7d 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -347,7 +347,8 @@ e_mail_reader_mark_selected (EMailReader *reader, return ii; } static void -copy_tree_state (EMailReader *src_reader, EMailReader *des_reader) +copy_tree_state (EMailReader *src_reader, + EMailReader *des_reader) { GtkWidget *src_mlist, *des_mlist; gchar *state; diff --git a/mail/e-mail-reader-utils.h b/mail/e-mail-reader-utils.h index da27112cd7..b566da16a7 100644 --- a/mail/e-mail-reader-utils.h +++ b/mail/e-mail-reader-utils.h @@ -32,8 +32,8 @@ typedef struct _EMailReaderHeader EMailReaderHeader; struct _EMailReaderHeader { gchar *name; - guint enabled:1; - guint is_default:1; + guint enabled : 1; + guint is_default : 1; }; gboolean e_mail_reader_confirm_delete (EMailReader *reader); diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 0408d9539b..430f71dc4f 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -1511,7 +1511,7 @@ action_mail_reply_sender_cb (GtkAction *action, static void action_mail_reply_recipient_cb (GtkAction *action, - EMailReader *reader) + EMailReader *reader) { e_mail_reader_reply_to_message (reader, NULL, E_MAIL_REPLY_TO_RECIPIENT); check_close_browser_reader (reader); @@ -2538,7 +2538,7 @@ mail_reader_message_loaded_cb (CamelFolder *folder, if (!message_list) { /* for cases where message fetching took so long that - user closed the message window before this was called */ + * user closed the message window before this was called */ goto exit; } diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c index ffcbb57e58..1003086d5b 100644 --- a/mail/e-mail-session.c +++ b/mail/e-mail-session.c @@ -125,9 +125,9 @@ struct _user_message_msg { gchar *prompt; EFlag *done; - guint allow_cancel:1; - guint result:1; - guint ismain:1; + guint allow_cancel : 1; + guint result : 1; + guint ismain : 1; }; static void user_message_exec (struct _user_message_msg *m, @@ -462,7 +462,7 @@ set_socks_proxy_from_gconf (CamelSession *session) } static void -proxy_gconf_notify_cb (GConfClient* client, +proxy_gconf_notify_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) @@ -850,7 +850,7 @@ mail_session_get_password (CamelSession *session, config_service = account->transport; } - remember = config_service?config_service->save_passwd:FALSE; + remember = config_service ? config_service->save_passwd : FALSE; if (!config_service || (config_service && !config_service->get_password_canceled)) { diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c index 7c79e1ca54..ea44e4238b 100644 --- a/mail/e-mail-store.c +++ b/mail/e-mail-store.c @@ -285,7 +285,7 @@ e_mail_store_add_by_account (EMailSession *session, transport_only = !account->source || !account->source->url || !*account->source->url; if (transport_only) goto handle_transport; - + /* Load the service, but don't connect. Check its provider, * and if this belongs in the folder tree model, add it. */ diff --git a/mail/e-mail-tab-picker.c b/mail/e-mail-tab-picker.c index 160a03df6a..cc257284dc 100644 --- a/mail/e-mail-tab-picker.c +++ b/mail/e-mail-tab-picker.c @@ -153,7 +153,7 @@ e_mail_tab_picker_drop (MxDroppable *droppable, } /* The same check for dragging left instead of right */ - if ((event_x < props->position + props->width + priv->scroll_offset)&& + if ((event_x < props->position + props->width + priv->scroll_offset) && (tab->position >= props->position) && !mx_draggable_is_enabled (MX_DRAGGABLE (props->tab))) break; @@ -802,9 +802,7 @@ e_mail_tab_picker_class_init (EMailTabPickerClass *class) "in preview mode.", FALSE, G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); + G_PARAM_STATIC_STRINGS)); g_object_class_override_property ( object_class, @@ -924,7 +922,8 @@ e_mail_tab_picker_init (EMailTabPicker *self) } static gint -e_mail_tab_picker_find_tab_cb (gconstpointer a, gconstpointer b) +e_mail_tab_picker_find_tab_cb (gconstpointer a, + gconstpointer b) { EMailTabPickerProps *props = (EMailTabPickerProps *) a; EMailTab *tab = (EMailTab *) b; @@ -933,7 +932,8 @@ e_mail_tab_picker_find_tab_cb (gconstpointer a, gconstpointer b) } static void -e_mail_tab_picker_tab_clicked_cb (EMailTab *tab, EMailTabPicker *self) +e_mail_tab_picker_tab_clicked_cb (EMailTab *tab, + EMailTabPicker *self) { EMailTabPickerPrivate *priv = self->priv; EMailTab *old_tab; @@ -1037,7 +1037,8 @@ e_mail_tab_picker_add_tab (EMailTabPicker *picker, } void -e_mail_tab_picker_remove_tab (EMailTabPicker *picker, EMailTab *tab) +e_mail_tab_picker_remove_tab (EMailTabPicker *picker, + EMailTab *tab) { GList *tab_link; EMailTabPickerPrivate *priv = picker->priv; @@ -1098,14 +1099,16 @@ e_mail_tab_picker_get_tabs (EMailTabPicker *picker) } EMailTab * -e_mail_tab_picker_get_tab (EMailTabPicker *picker, gint tab) +e_mail_tab_picker_get_tab (EMailTabPicker *picker, + gint tab) { EMailTabPickerProps *props = g_list_nth_data (picker->priv->tabs, tab); return props->tab; } gint -e_mail_tab_picker_get_tab_no (EMailTabPicker *picker, EMailTab *tab) +e_mail_tab_picker_get_tab_no (EMailTabPicker *picker, + EMailTab *tab) { GList *tab_link; @@ -1123,7 +1126,8 @@ e_mail_tab_picker_get_current_tab (EMailTabPicker *picker) } void -e_mail_tab_picker_set_current_tab (EMailTabPicker *picker, gint tab_no) +e_mail_tab_picker_set_current_tab (EMailTabPicker *picker, + gint tab_no) { EMailTabPickerPrivate *priv = picker->priv; EMailTabPickerProps *props; @@ -1223,7 +1227,8 @@ preview_completed_cb (ClutterTimeline *timeline, } void -e_mail_tab_picker_set_preview_mode (EMailTabPicker *picker, gboolean preview) +e_mail_tab_picker_set_preview_mode (EMailTabPicker *picker, + gboolean preview) { GList *t; @@ -1305,7 +1310,8 @@ e_mail_tab_picker_get_preview_mode (EMailTabPicker *picker) } void -e_mail_tab_picker_enable_drop (EMailTabPicker *picker, gboolean enable) +e_mail_tab_picker_enable_drop (EMailTabPicker *picker, + gboolean enable) { EMailTabPickerPrivate *priv = picker->priv; diff --git a/mail/e-mail-tab.c b/mail/e-mail-tab.c index 213e545da7..cb461c28f3 100644 --- a/mail/e-mail-tab.c +++ b/mail/e-mail-tab.c @@ -29,43 +29,38 @@ static void mx_draggable_iface_init (MxDraggableIface *iface); -G_DEFINE_TYPE_WITH_CODE (EMailTab, - e_mail_tab, - MX_TYPE_WIDGET, - G_IMPLEMENT_INTERFACE (MX_TYPE_DRAGGABLE, - mx_draggable_iface_init)) - -enum -{ - PROP_0, - - PROP_ICON, - PROP_TEXT, - PROP_CAN_CLOSE, - PROP_TAB_WIDTH, - PROP_DOCKING, - PROP_PREVIEW, - PROP_PREVIEW_MODE, - PROP_PREVIEW_DURATION, - PROP_SPACING, - PROP_PRIVATE, - PROP_ACTIVE, - - PROP_DRAG_THRESHOLD, - PROP_DRAG_AXIS, - // PROP_DRAG_CONTAINMENT_TYPE, - PROP_DRAG_CONTAINMENT_AREA, - PROP_DRAG_ENABLED, - PROP_DRAG_ACTOR, +G_DEFINE_TYPE_WITH_CODE ( + EMailTab, + e_mail_tab, + MX_TYPE_WIDGET, + G_IMPLEMENT_INTERFACE ( + MX_TYPE_DRAGGABLE, mx_draggable_iface_init)) + +enum { + PROP_0, + PROP_ICON, + PROP_TEXT, + PROP_CAN_CLOSE, + PROP_TAB_WIDTH, + PROP_DOCKING, + PROP_PREVIEW, + PROP_PREVIEW_MODE, + PROP_PREVIEW_DURATION, + PROP_SPACING, + PROP_PRIVATE, + PROP_ACTIVE, + PROP_DRAG_THRESHOLD, + PROP_DRAG_AXIS, + PROP_DRAG_CONTAINMENT_AREA, + PROP_DRAG_ENABLED, + PROP_DRAG_ACTOR, }; -enum -{ - CLICKED, - CLOSED, - TRANSITION_COMPLETE, - - LAST_SIGNAL +enum { + CLICKED, + CLOSED, + TRANSITION_COMPLETE, + LAST_SIGNAL }; /* Animation stage lengths */ @@ -76,1825 +71,1834 @@ static guint signals[LAST_SIGNAL] = { 0, }; static void e_mail_tab_close_clicked_cb (MxButton *button, EMailTab *self); -struct _EMailTabPrivate -{ - ClutterActor *icon; - ClutterActor *default_icon; - ClutterActor *label; - ClutterActor *close_button; - gboolean can_close; - gint width; - gboolean docking; - gfloat spacing; - gboolean private; - guint alert_count; - guint alert_source; - gboolean has_text; - - guint active : 1; - guint pressed : 1; - guint hover : 1; - - ClutterActor *preview; - gboolean preview_mode; - ClutterTimeline *preview_timeline; - gdouble preview_height_progress; - guint anim_length; - - ClutterActor *old_bg; - - ClutterActor *drag_actor; - ClutterActorBox drag_area; - gboolean drag_enabled; - MxDragAxis drag_axis; - // MxDragContainment containment; - gint drag_threshold; - gulong drag_threshold_handler; - gfloat press_x; - gfloat press_y; - gboolean in_drag; +struct _EMailTabPrivate { + ClutterActor *icon; + ClutterActor *default_icon; + ClutterActor *label; + ClutterActor *close_button; + gboolean can_close; + gint width; + gboolean docking; + gfloat spacing; + gboolean private; + guint alert_count; + guint alert_source; + gboolean has_text; + + guint active : 1; + guint pressed : 1; + guint hover : 1; + + ClutterActor *preview; + gboolean preview_mode; + ClutterTimeline *preview_timeline; + gdouble preview_height_progress; + guint anim_length; + + ClutterActor *old_bg; + + ClutterActor *drag_actor; + ClutterActorBox drag_area; + gboolean drag_enabled; + MxDragAxis drag_axis; + gint drag_threshold; + gulong drag_threshold_handler; + gfloat press_x; + gfloat press_y; + gboolean in_drag; }; static void -e_mail_tab_drag_begin (MxDraggable *draggable, - gfloat event_x, - gfloat event_y, - gint event_button, - ClutterModifierType modifiers) -{ - gfloat x, y; - - EMailTabPrivate *priv = E_MAIL_TAB (draggable)->priv; - ClutterActor *self = CLUTTER_ACTOR (draggable); - ClutterActor *actor = mx_draggable_get_drag_actor (draggable); - ClutterActor *stage = clutter_actor_get_stage (self); - - priv->in_drag = TRUE; - - clutter_actor_get_transformed_position (self, &x, &y); - clutter_actor_set_position (actor, x, y); - - /* Start up animation */ - if (CLUTTER_IS_TEXTURE (actor)) - { - /* TODO: Some neat deformation effect? */ - } - else - { - /* Fade in */ - clutter_actor_set_opacity (actor, 0x00); - clutter_actor_animate (actor, CLUTTER_LINEAR, 150, - "opacity", 0xff, - NULL); - } - clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); +e_mail_tab_drag_begin (MxDraggable *draggable, + gfloat event_x, + gfloat event_y, + gint event_button, + ClutterModifierType modifiers) +{ + gfloat x, y; + + EMailTabPrivate *priv = E_MAIL_TAB (draggable)->priv; + ClutterActor *self = CLUTTER_ACTOR (draggable); + ClutterActor *actor = mx_draggable_get_drag_actor (draggable); + ClutterActor *stage = clutter_actor_get_stage (self); + + priv->in_drag = TRUE; + + clutter_actor_get_transformed_position (self, &x, &y); + clutter_actor_set_position (actor, x, y); + + /* Start up animation */ + if (CLUTTER_IS_TEXTURE (actor)) { + /* TODO: Some neat deformation effect? */ + } else { + /* Fade in */ + clutter_actor_set_opacity (actor, 0x00); + clutter_actor_animate ( + actor, CLUTTER_LINEAR, 150, + "opacity", 0xff, + NULL); + } + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); } static void e_mail_tab_drag_motion (MxDraggable *draggable, - gfloat delta_x, - gfloat delta_y) + gfloat delta_x, + gfloat delta_y) { - ClutterActor *actor = mx_draggable_get_drag_actor (draggable); - clutter_actor_move_by (actor, delta_x, delta_y); + ClutterActor *actor = mx_draggable_get_drag_actor (draggable); + clutter_actor_move_by (actor, delta_x, delta_y); } static void e_mail_tab_drag_end_anim_cb (ClutterAnimation *animation, - EMailTab *tab) + EMailTab *tab) { - ClutterActor *actor = - CLUTTER_ACTOR (clutter_animation_get_object (animation)); - ClutterActor *parent = clutter_actor_get_parent (actor); + ClutterActor *actor = + CLUTTER_ACTOR (clutter_animation_get_object (animation)); + ClutterActor *parent = clutter_actor_get_parent (actor); - if (parent) - clutter_container_remove_actor (CLUTTER_CONTAINER (parent), actor); + if (parent) + clutter_container_remove_actor ( + CLUTTER_CONTAINER (parent), actor); } static void e_mail_tab_drag_end (MxDraggable *draggable, - gfloat event_x, - gfloat event_y) -{ - EMailTab *self = E_MAIL_TAB (draggable); - EMailTabPrivate *priv = self->priv; - - priv->in_drag = FALSE; - - if (priv->drag_actor) - { - ClutterActor *parent = clutter_actor_get_parent (priv->drag_actor); - if (parent) - { - /* Animate drop */ - if (CLUTTER_IS_TEXTURE (priv->drag_actor)) - { - /* TODO: Some neat deformation effect? */ - clutter_container_remove_actor (CLUTTER_CONTAINER (parent), - priv->drag_actor); - } - else - { - clutter_actor_animate (priv->drag_actor, CLUTTER_LINEAR, 150, - "opacity", 0x00, - "signal::completed", - G_CALLBACK (e_mail_tab_drag_end_anim_cb), - self, - NULL); - } + gfloat event_x, + gfloat event_y) +{ + EMailTab *self = E_MAIL_TAB (draggable); + EMailTabPrivate *priv = self->priv; + + priv->in_drag = FALSE; + + if (priv->drag_actor) { + ClutterActor *parent = clutter_actor_get_parent (priv->drag_actor); + if (parent) { + /* Animate drop */ + if (CLUTTER_IS_TEXTURE (priv->drag_actor)) { + /* TODO: Some neat deformation effect? */ + clutter_container_remove_actor ( + CLUTTER_CONTAINER (parent), + priv->drag_actor); + } else { + clutter_actor_animate ( + priv->drag_actor, + CLUTTER_LINEAR, 150, + "opacity", 0x00, + "signal::completed", + G_CALLBACK (e_mail_tab_drag_end_anim_cb), + self, NULL); + } + } + + g_object_unref (priv->drag_actor); + priv->drag_actor = NULL; } - g_object_unref (priv->drag_actor); - priv->drag_actor = NULL; - } } static void mx_draggable_iface_init (MxDraggableIface *iface) { - iface->drag_begin = e_mail_tab_drag_begin; - iface->drag_motion = e_mail_tab_drag_motion; - iface->drag_end = e_mail_tab_drag_end; + iface->drag_begin = e_mail_tab_drag_begin; + iface->drag_motion = e_mail_tab_drag_motion; + iface->drag_end = e_mail_tab_drag_end; } static void -e_mail_tab_get_property (GObject *object, guint property_id, - GValue *value, GParamSpec *pspec) -{ - EMailTab *tab = E_MAIL_TAB (object); - EMailTabPrivate *priv = tab->priv; - - switch (property_id) - { - case PROP_ICON: - g_value_set_object (value, e_mail_tab_get_icon (tab)); - break; - - case PROP_TEXT: - g_value_set_string (value, e_mail_tab_get_text (tab)); - break; - - case PROP_CAN_CLOSE: - g_value_set_boolean (value, e_mail_tab_get_can_close (tab)); - break; - - case PROP_TAB_WIDTH: - g_value_set_int (value, e_mail_tab_get_width (tab)); - break; - - case PROP_DOCKING: - g_value_set_boolean (value, e_mail_tab_get_docking (tab)); - break; - - case PROP_PREVIEW: - g_value_set_object (value, e_mail_tab_get_preview_actor (tab)); - break; - - case PROP_PREVIEW_MODE: - g_value_set_boolean (value, e_mail_tab_get_preview_mode (tab)); - break; - - case PROP_PREVIEW_DURATION: - g_value_set_uint (value, e_mail_tab_get_preview_duration (tab)); - break; - - case PROP_SPACING: - g_value_set_float (value, e_mail_tab_get_spacing (tab)); - break; - - case PROP_PRIVATE: - g_value_set_boolean (value, e_mail_tab_get_private (tab)); - break; - - case PROP_ACTIVE: - g_value_set_boolean (value, e_mail_tab_get_active (tab)); - break; - - case PROP_DRAG_THRESHOLD: - g_value_set_uint (value, (guint) priv->drag_threshold); - break; - - case PROP_DRAG_AXIS: - g_value_set_enum (value, priv->drag_axis); - break; - -// case PROP_DRAG_CONTAINMENT_TYPE: - // g_value_set_enum (value, priv->containment); - // break; - - case PROP_DRAG_CONTAINMENT_AREA: - g_value_set_boxed (value, &priv->drag_area); - break; - - case PROP_DRAG_ENABLED: - g_value_set_boolean (value, priv->drag_enabled); - break; - - case PROP_DRAG_ACTOR: - if (!priv->drag_actor) - { - ClutterActor *fbo = - /*clutter_texture_new_from_actor (CLUTTER_ACTOR (tab));*/ - NULL; - if (fbo) - { - /* This is where we'd setup deformations, or something along - * those lines. - */ - priv->drag_actor = g_object_ref_sink (fbo); - } - else - priv->drag_actor = - g_object_ref_sink (clutter_clone_new (CLUTTER_ACTOR (tab))); - } - g_value_set_object (value, priv->drag_actor); - break; +e_mail_tab_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + EMailTab *tab = E_MAIL_TAB (object); + EMailTabPrivate *priv = tab->priv; + + switch (property_id) { + case PROP_ICON: + g_value_set_object (value, e_mail_tab_get_icon (tab)); + break; + + case PROP_TEXT: + g_value_set_string (value, e_mail_tab_get_text (tab)); + break; + + case PROP_CAN_CLOSE: + g_value_set_boolean (value, e_mail_tab_get_can_close (tab)); + break; + + case PROP_TAB_WIDTH: + g_value_set_int (value, e_mail_tab_get_width (tab)); + break; + + case PROP_DOCKING: + g_value_set_boolean (value, e_mail_tab_get_docking (tab)); + break; + + case PROP_PREVIEW: + g_value_set_object (value, e_mail_tab_get_preview_actor (tab)); + break; + + case PROP_PREVIEW_MODE: + g_value_set_boolean (value, e_mail_tab_get_preview_mode (tab)); + break; + + case PROP_PREVIEW_DURATION: + g_value_set_uint (value, e_mail_tab_get_preview_duration (tab)); + break; + + case PROP_SPACING: + g_value_set_float (value, e_mail_tab_get_spacing (tab)); + break; + + case PROP_PRIVATE: + g_value_set_boolean (value, e_mail_tab_get_private (tab)); + break; + + case PROP_ACTIVE: + g_value_set_boolean (value, e_mail_tab_get_active (tab)); + break; + + case PROP_DRAG_THRESHOLD: + g_value_set_uint (value, (guint) priv->drag_threshold); + break; + + case PROP_DRAG_AXIS: + g_value_set_enum (value, priv->drag_axis); + break; + + case PROP_DRAG_CONTAINMENT_AREA: + g_value_set_boxed (value, &priv->drag_area); + break; + + case PROP_DRAG_ENABLED: + g_value_set_boolean (value, priv->drag_enabled); + break; + + case PROP_DRAG_ACTOR: + if (!priv->drag_actor) + priv->drag_actor = g_object_ref_sink ( + clutter_clone_new (CLUTTER_ACTOR (tab))); + g_value_set_object (value, priv->drag_actor); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } +static void +e_mail_tab_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + EMailTab *tab = E_MAIL_TAB (object); + EMailTabPrivate *priv = tab->priv; + + switch (property_id) { + case PROP_ICON: + e_mail_tab_set_icon ( + tab, g_value_get_object (value)); + break; + + case PROP_TEXT: + e_mail_tab_set_text ( + tab, g_value_get_string (value)); + break; + + case PROP_CAN_CLOSE: + e_mail_tab_set_can_close ( + tab, g_value_get_boolean (value)); + + case PROP_TAB_WIDTH: + e_mail_tab_set_width ( + tab, g_value_get_int (value)); + break; + + case PROP_DOCKING: + e_mail_tab_set_docking ( + tab, g_value_get_boolean (value)); + break; + + case PROP_PREVIEW: + e_mail_tab_set_preview_actor ( + tab, g_value_get_object (value)); + break; + + case PROP_PREVIEW_MODE: + e_mail_tab_set_preview_mode ( + tab, g_value_get_boolean (value)); + break; + + case PROP_PREVIEW_DURATION: + e_mail_tab_set_preview_duration ( + tab, g_value_get_uint (value)); + break; + + case PROP_SPACING: + e_mail_tab_set_spacing ( + tab, g_value_get_float (value)); + break; + + case PROP_PRIVATE: + e_mail_tab_set_private ( + tab, g_value_get_boolean (value)); + break; + + case PROP_ACTIVE: + e_mail_tab_set_active ( + tab, g_value_get_boolean (value)); + break; + + case PROP_DRAG_THRESHOLD: + break; + + case PROP_DRAG_AXIS: + priv->drag_axis = g_value_get_enum (value); + break; + + case PROP_DRAG_CONTAINMENT_AREA: + { + ClutterActorBox *box = g_value_get_boxed (value); + + if (box) + priv->drag_area = *box; + else + memset ( + &priv->drag_area, 0, + sizeof (ClutterActorBox)); + break; + } + + case PROP_DRAG_ENABLED: + priv->drag_enabled = g_value_get_boolean (value); + break; + + case PROP_DRAG_ACTOR: + { + ClutterActor *new_actor = g_value_get_object (value); + + if (priv->drag_actor) { + ClutterActor *parent; + + parent = clutter_actor_get_parent (priv->drag_actor); + + /* We know it's a container because we added it ourselves */ + if (parent) + clutter_container_remove_actor ( + CLUTTER_CONTAINER (parent), + priv->drag_actor); + + g_object_unref (priv->drag_actor); + priv->drag_actor = NULL; + } + + if (new_actor) + priv->drag_actor = g_object_ref_sink (new_actor); + + break; + } + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } } static void -e_mail_tab_set_property (GObject *object, guint property_id, - const GValue *value, GParamSpec *pspec) +e_mail_tab_dispose_old_bg (EMailTab *tab) { - EMailTab *tab = E_MAIL_TAB (object); - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - switch (property_id) - { - case PROP_ICON: - e_mail_tab_set_icon (tab, g_value_get_object (value)); - break; + if (priv->old_bg) { + ClutterActor *parent; - case PROP_TEXT: - e_mail_tab_set_text (tab, g_value_get_string (value)); - break; - - case PROP_CAN_CLOSE: - e_mail_tab_set_can_close (tab, g_value_get_boolean (value)); - - case PROP_TAB_WIDTH: - e_mail_tab_set_width (tab, g_value_get_int (value)); - break; - - case PROP_DOCKING: - e_mail_tab_set_docking (tab, g_value_get_boolean (value)); - break; - - case PROP_PREVIEW: - e_mail_tab_set_preview_actor (tab, - CLUTTER_ACTOR (g_value_get_object (value))); - break; - - case PROP_PREVIEW_MODE: - e_mail_tab_set_preview_mode (tab, g_value_get_boolean (value)); - break; - - case PROP_PREVIEW_DURATION: - e_mail_tab_set_preview_duration (tab, g_value_get_uint (value)); - break; - - case PROP_SPACING: - e_mail_tab_set_spacing (tab, g_value_get_float (value)); - break; - - case PROP_PRIVATE: - e_mail_tab_set_private (tab, g_value_get_boolean (value)); - break; - - case PROP_ACTIVE: - e_mail_tab_set_active (tab, g_value_get_boolean (value)); - break; - - case PROP_DRAG_THRESHOLD: - break; + parent = clutter_actor_get_parent (priv->old_bg); + if (parent == (ClutterActor *) tab) + clutter_actor_unparent (priv->old_bg); + g_object_unref (priv->old_bg); + priv->old_bg = NULL; + } +} - case PROP_DRAG_AXIS: - priv->drag_axis = g_value_get_enum (value); - break; +static void +e_mail_tab_dispose (GObject *object) +{ + EMailTab *tab = E_MAIL_TAB (object); + EMailTabPrivate *priv = tab->priv; -// case PROP_DRAG_CONTAINMENT_TYPE: - // priv->containment = g_value_get_enum (value); - // break; + e_mail_tab_dispose_old_bg (tab); - case PROP_DRAG_CONTAINMENT_AREA: - { - ClutterActorBox *box = g_value_get_boxed (value); + if (priv->icon) { + clutter_actor_unparent (priv->icon); + priv->icon = NULL; + } - if (box) - priv->drag_area = *box; - else - memset (&priv->drag_area, 0, sizeof (ClutterActorBox)); + if (priv->default_icon) { + g_object_unref (priv->default_icon); + priv->default_icon = NULL; + } - break; - } + if (priv->label) { + clutter_actor_unparent (CLUTTER_ACTOR (priv->label)); + priv->label = NULL; + } - case PROP_DRAG_ENABLED: - priv->drag_enabled = g_value_get_boolean (value); - break; + if (priv->close_button) { + clutter_actor_unparent (CLUTTER_ACTOR (priv->close_button)); + priv->close_button = NULL; + } - case PROP_DRAG_ACTOR: - { - ClutterActor *new_actor = g_value_get_object (value); + if (priv->preview) { + clutter_actor_unparent (priv->preview); + priv->preview = NULL; + } - if (priv->drag_actor) - { - ClutterActor *parent = clutter_actor_get_parent (priv->drag_actor); + if (priv->alert_source) { + g_source_remove (priv->alert_source); + priv->alert_source = 0; + } - /* We know it's a container because we added it ourselves */ - if (parent) - clutter_container_remove_actor (CLUTTER_CONTAINER (parent), - priv->drag_actor); + if (priv->drag_actor) { + ClutterActor *parent; - g_object_unref (priv->drag_actor); - priv->drag_actor = NULL; - } + parent = clutter_actor_get_parent (priv->drag_actor); + if (parent) + clutter_container_remove_actor ( + CLUTTER_CONTAINER (parent), + priv->drag_actor); - if (new_actor) - priv->drag_actor = g_object_ref_sink (new_actor); + g_object_unref (priv->drag_actor); + priv->drag_actor = NULL; + } - break; - } + if (priv->drag_threshold_handler) + g_signal_handler_disconnect ( + gtk_settings_get_default (), + priv->drag_threshold_handler); + priv->drag_threshold_handler = 0; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - } + G_OBJECT_CLASS (e_mail_tab_parent_class)->dispose (object); } static void -e_mail_tab_dispose_old_bg (EMailTab *tab) -{ - EMailTabPrivate *priv = tab->priv; - - if (priv->old_bg) - { - if (clutter_actor_get_parent (priv->old_bg) == (ClutterActor *) tab) - clutter_actor_unparent (priv->old_bg); - g_object_unref (priv->old_bg); - priv->old_bg = NULL; - } +e_mail_tab_get_preferred_width (ClutterActor *actor, + gfloat for_height, + gfloat *min_width_p, + gfloat *natural_width_p) +{ + MxPadding padding; + EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; + + /* Get padding */ + mx_widget_get_padding (MX_WIDGET (actor), &padding); + if (min_width_p) + *min_width_p = padding.left + padding.right; + if (natural_width_p) + *natural_width_p = padding.left + padding.right; + + if (priv->width >= 0) { + if (natural_width_p) + *natural_width_p += priv->width; + } else { + gfloat min_width, nat_width, acc_min_width, acc_nat_width; + + acc_min_width = acc_nat_width = 0; + + if (priv->has_text) + clutter_actor_get_preferred_size ( + CLUTTER_ACTOR (priv->label), + &acc_min_width, NULL, + &acc_nat_width, NULL); + + if (priv->icon) + clutter_actor_get_preferred_size ( + priv->icon, + &min_width, NULL, + &nat_width, NULL); + acc_min_width += min_width; + acc_nat_width += nat_width; + + if (priv->can_close) + clutter_actor_get_preferred_size ( + CLUTTER_ACTOR (priv->close_button), + &min_width, NULL, + &nat_width, NULL); + acc_min_width += min_width; + acc_nat_width += nat_width; + + if (priv->preview && priv->preview_mode) { + clutter_actor_get_preferred_size ( + priv->preview, + &min_width, NULL, + &nat_width, NULL); + + if (min_width > acc_min_width) + acc_min_width = min_width; + if (nat_width > acc_nat_width) + acc_nat_width = nat_width; + } + + if (min_width_p) + *min_width_p += acc_min_width; + if (natural_width_p) + *natural_width_p += acc_nat_width; + } } -static void -e_mail_tab_dispose (GObject *object) -{ - EMailTab *tab = E_MAIL_TAB (object); - EMailTabPrivate *priv = tab->priv; - - e_mail_tab_dispose_old_bg (tab); - - if (priv->icon) - { - clutter_actor_unparent (priv->icon); - priv->icon = NULL; - } - - if (priv->default_icon) - { - g_object_unref (priv->default_icon); - priv->default_icon = NULL; - } - - if (priv->label) - { - clutter_actor_unparent (CLUTTER_ACTOR (priv->label)); - priv->label = NULL; - } - - if (priv->close_button) - { - clutter_actor_unparent (CLUTTER_ACTOR (priv->close_button)); - priv->close_button = NULL; - } - - if (priv->preview) - { - clutter_actor_unparent (priv->preview); - priv->preview = NULL; - } - - if (priv->alert_source) - { - g_source_remove (priv->alert_source); - priv->alert_source = 0; - } - - if (priv->drag_actor) - { - ClutterActor *parent = clutter_actor_get_parent (priv->drag_actor); - if (parent) - clutter_container_remove_actor (CLUTTER_CONTAINER (parent), - priv->drag_actor); - g_object_unref (priv->drag_actor); - priv->drag_actor = NULL; - } - - if (priv->drag_threshold_handler) - { - g_signal_handler_disconnect (gtk_settings_get_default (), - priv->drag_threshold_handler); - priv->drag_threshold_handler = 0; - } - - G_OBJECT_CLASS (e_mail_tab_parent_class)->dispose (object); +void +e_mail_tab_get_height_no_preview (EMailTab *tab, + gfloat for_width, + gfloat *min_height_p, + gfloat *natural_height_p) +{ + MxPadding padding; + gfloat min_height, nat_height, tmp_min_height, tmp_nat_height; + + ClutterActor *actor = CLUTTER_ACTOR (tab); + EMailTabPrivate *priv = tab->priv; + + /* Get padding */ + mx_widget_get_padding (MX_WIDGET (actor), &padding); + if (min_height_p) + *min_height_p = padding.top + padding.bottom; + if (natural_height_p) + *natural_height_p = padding.top + padding.bottom; + + min_height = nat_height = 0; + if (priv->has_text) + clutter_actor_get_preferred_height ( + CLUTTER_ACTOR (priv->label), -1, + &min_height, &nat_height); + + if (priv->icon) { + clutter_actor_get_preferred_height ( + priv->icon, -1, &tmp_min_height, &tmp_nat_height); + if (tmp_min_height > min_height) + min_height = tmp_min_height; + if (tmp_nat_height > nat_height) + nat_height = tmp_nat_height; + } + + if (priv->can_close) { + clutter_actor_get_preferred_height ( + CLUTTER_ACTOR (priv->close_button), + -1, &tmp_min_height, &tmp_nat_height); + + if (tmp_min_height > min_height) + min_height = tmp_min_height; + if (tmp_nat_height > nat_height) + nat_height = tmp_nat_height; + } + + if (min_height_p) + *min_height_p += min_height; + if (natural_height_p) + *natural_height_p += nat_height; } static void -e_mail_tab_finalize (GObject *object) -{ - G_OBJECT_CLASS (e_mail_tab_parent_class)->finalize (object); +e_mail_tab_get_preferred_height (ClutterActor *actor, + gfloat for_width, + gfloat *min_height_p, + gfloat *natural_height_p) +{ + EMailTab *tab = E_MAIL_TAB (actor); + EMailTabPrivate *priv = tab->priv; + + e_mail_tab_get_height_no_preview ( + tab, for_width, min_height_p, natural_height_p); + + if (priv->preview) { + MxPadding padding; + gfloat min_height, nat_height; + gfloat label_min_height, label_nat_height; + + /* Get preview + padding height */ + mx_widget_get_padding (MX_WIDGET (actor), &padding); + + clutter_actor_get_preferred_height ( + priv->preview, + (gfloat) priv->width, + &min_height, &nat_height); + + /* Add label height */ + clutter_actor_get_preferred_height ( + CLUTTER_ACTOR (priv->label), -1, + &label_min_height, &label_nat_height); + + min_height = + (min_height * priv->preview_height_progress) + + padding.top + padding.bottom + priv->spacing + + label_min_height; + + nat_height = + (nat_height * priv->preview_height_progress) + + padding.top + padding.bottom + priv->spacing + + label_nat_height; + + /* Sometimes the preview's natural height will be nan due to + * keeping of the aspect ratio. This guards against that and + * stops Clutter from warning that the natural height is less + * than the minimum height. */ + if (isnan (nat_height)) + nat_height = min_height; + + if (min_height_p && (min_height > *min_height_p)) + *min_height_p = min_height; + if (natural_height_p && (nat_height > *natural_height_p)) + *natural_height_p = nat_height; + } } static void -e_mail_tab_get_preferred_width (ClutterActor *actor, - gfloat for_height, - gfloat *min_width_p, - gfloat *natural_width_p) -{ - MxPadding padding; - EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; - - /* Get padding */ - mx_widget_get_padding (MX_WIDGET (actor), &padding); - if (min_width_p) - *min_width_p = padding.left + padding.right; - if (natural_width_p) - *natural_width_p = padding.left + padding.right; - - if (priv->width >= 0) - { - if (natural_width_p) - *natural_width_p += priv->width; - } - else - { - gfloat min_width, nat_width, acc_min_width, acc_nat_width; - - acc_min_width = acc_nat_width = 0; - - if (priv->has_text) - clutter_actor_get_preferred_size (CLUTTER_ACTOR (priv->label), - &acc_min_width, NULL, - &acc_nat_width, NULL); - - if (priv->icon) - { - clutter_actor_get_preferred_size (priv->icon, - &min_width, NULL, - &nat_width, NULL); - acc_min_width += min_width; - acc_nat_width += nat_width; +e_mail_tab_allocate (ClutterActor *actor, + const ClutterActorBox *box, + ClutterAllocationFlags flags) +{ + MxPadding padding; + ClutterActorBox child_box; + gfloat icon_width, icon_height; + gfloat label_width, label_height; + gfloat close_width, close_height; + gfloat preview_width, preview_height; + + EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; + + /* Chain up to store box */ + CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->allocate (actor, box, flags); + + /* Possibly synchronise an axis if we're dragging */ + if (priv->in_drag) { + ClutterActor *drag_actor = + mx_draggable_get_drag_actor (MX_DRAGGABLE (actor)); + + if (drag_actor) { + gfloat x, y; + clutter_actor_get_transformed_position (actor, &x, &y); + + switch (mx_draggable_get_axis (MX_DRAGGABLE (actor))) { + case MX_DRAG_AXIS_X : + /* Synchronise y axis */ + clutter_actor_set_y (drag_actor, y); + break; + case MX_DRAG_AXIS_Y : + /* Synchronise x axis */ + clutter_actor_set_x (drag_actor, x); + break; + default: + break; + } + } } - if (priv->can_close) - { - clutter_actor_get_preferred_size (CLUTTER_ACTOR (priv->close_button), - &min_width, NULL, - &nat_width, NULL); - acc_min_width += min_width; - acc_nat_width += nat_width; + /* Allocate old background texture */ + if (priv->old_bg) { + child_box.x1 = 0; + child_box.y1 = 0; + child_box.x2 = box->x2 - box->x1; + child_box.y2 = box->y2 - box->y1; + clutter_actor_allocate (priv->old_bg, &child_box, flags); } - if (priv->preview && priv->preview_mode) - { - clutter_actor_get_preferred_size (priv->preview, - &min_width, NULL, - &nat_width, NULL); - if (min_width > acc_min_width) - acc_min_width = min_width; - if (nat_width > acc_nat_width) - acc_nat_width = nat_width; + mx_widget_get_padding (MX_WIDGET (actor), &padding); + + /* Get the preferred width/height of the icon, + * label and close-button first. */ + if (priv->icon) + clutter_actor_get_preferred_size ( + priv->icon, NULL, NULL, + &icon_width, &icon_height); + + clutter_actor_get_preferred_size ( + CLUTTER_ACTOR (priv->label), NULL, NULL, + &label_width, &label_height); + + if (priv->can_close) + clutter_actor_get_preferred_size ( + CLUTTER_ACTOR (priv->close_button), + NULL, NULL, &close_width, &close_height); + + /* Allocate for icon */ + if (priv->icon) { + child_box.x1 = padding.left; + child_box.x2 = child_box.x1 + icon_width; + child_box.y1 = E_MAIL_PIXBOUND ((box->y2 - box->y1) / 2 - icon_height / 2); + child_box.y2 = child_box.y1 + icon_height; + clutter_actor_allocate (priv->icon, &child_box, flags); } - if (min_width_p) - *min_width_p += acc_min_width; - if (natural_width_p) - *natural_width_p += acc_nat_width; - } -} - -void -e_mail_tab_get_height_no_preview (EMailTab *tab, - gfloat for_width, - gfloat *min_height_p, - gfloat *natural_height_p) -{ - MxPadding padding; - gfloat min_height, nat_height, tmp_min_height, tmp_nat_height; - - ClutterActor *actor = CLUTTER_ACTOR (tab); - EMailTabPrivate *priv = tab->priv; - - /* Get padding */ - mx_widget_get_padding (MX_WIDGET (actor), &padding); - if (min_height_p) - *min_height_p = padding.top + padding.bottom; - if (natural_height_p) - *natural_height_p = padding.top + padding.bottom; - - min_height = nat_height = 0; - if (priv->has_text) - clutter_actor_get_preferred_height (CLUTTER_ACTOR (priv->label), -1, - &min_height, &nat_height); - - if (priv->icon) - { - clutter_actor_get_preferred_height (priv->icon, -1, - &tmp_min_height, &tmp_nat_height); - if (tmp_min_height > min_height) - min_height = tmp_min_height; - if (tmp_nat_height > nat_height) - nat_height = tmp_nat_height; - } - - if (priv->can_close) - { - clutter_actor_get_preferred_height (CLUTTER_ACTOR (priv->close_button), - -1, &tmp_min_height, &tmp_nat_height); - if (tmp_min_height > min_height) - min_height = tmp_min_height; - if (tmp_nat_height > nat_height) - nat_height = tmp_nat_height; - } - - if (min_height_p) - *min_height_p += min_height; - if (natural_height_p) - *natural_height_p += nat_height; -} + /* Allocate for close button */ + if (priv->can_close) { + child_box.x2 = box->x2 - box->x1 - padding.right; + child_box.x1 = child_box.x2 - close_width; + child_box.y1 = E_MAIL_PIXBOUND ((box->y2 - box->y1) / 2 - close_height / 2); + child_box.y2 = child_box.y1 + close_height; + clutter_actor_allocate ( + CLUTTER_ACTOR (priv->close_button), + &child_box, flags); + } -static void -e_mail_tab_get_preferred_height (ClutterActor *actor, - gfloat for_width, - gfloat *min_height_p, - gfloat *natural_height_p) -{ - EMailTab *tab = E_MAIL_TAB (actor); - EMailTabPrivate *priv = tab->priv; - - e_mail_tab_get_height_no_preview (tab, for_width, - min_height_p, natural_height_p); - - if (priv->preview) - { - MxPadding padding; - gfloat min_height, nat_height, label_min_height, label_nat_height; - - /* Get preview + padding height */ - mx_widget_get_padding (MX_WIDGET (actor), &padding); - - clutter_actor_get_preferred_height (priv->preview, - (gfloat) priv->width, - &min_height, - &nat_height); - - /* Add label height */ - clutter_actor_get_preferred_height (CLUTTER_ACTOR (priv->label), -1, - &label_min_height, &label_nat_height); - - min_height = (min_height * priv->preview_height_progress) + - padding.top + padding.bottom + priv->spacing + - label_min_height; - nat_height = (nat_height * priv->preview_height_progress) + - padding.top + padding.bottom + priv->spacing + - label_nat_height; - - /* Sometimes the preview's natural height will be nan due to - * keeping of the aspect ratio. This guards against that and stops - * Clutter from warning that the natural height is less than the - * minimum height. - */ - if (isnan (nat_height)) - nat_height = min_height; - - if (min_height_p && (min_height > *min_height_p)) - *min_height_p = min_height; - if (natural_height_p && (nat_height > *natural_height_p)) - *natural_height_p = nat_height; - } -} + /* Allocate for preview widget */ + preview_height = 0; + if (priv->preview) { + preview_width = + (box->x2 - box->x1 - + padding.left - padding.right); + preview_height = + (box->y2 - box->y1 - + padding.top - padding.bottom - + priv->spacing - label_height); + + child_box.x1 = E_MAIL_PIXBOUND (padding.left); + child_box.y1 = E_MAIL_PIXBOUND (padding.top); + child_box.x2 = child_box.x1 + preview_width; + child_box.y2 = child_box.y1 + preview_height; + + clutter_actor_allocate (priv->preview, &child_box, flags); + } -static void -e_mail_tab_allocate (ClutterActor *actor, - const ClutterActorBox *box, - ClutterAllocationFlags flags) -{ - MxPadding padding; - ClutterActorBox child_box; - gfloat icon_width, icon_height, label_width, label_height, - close_width, close_height, preview_width, preview_height; - - EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; - - /* Chain up to store box */ - CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->allocate (actor, box, flags); - - /* Possibly synchronise an axis if we're dragging */ - if (priv->in_drag) - { - ClutterActor *drag_actor = - mx_draggable_get_drag_actor (MX_DRAGGABLE (actor)); - - if (drag_actor) - { - gfloat x, y; - clutter_actor_get_transformed_position (actor, &x, &y); - switch (mx_draggable_get_axis (MX_DRAGGABLE (actor))) - { - case MX_DRAG_AXIS_X : - /* Synchronise y axis */ - clutter_actor_set_y (drag_actor, y); - break; - case MX_DRAG_AXIS_Y : - /* Synchronise x axis */ - clutter_actor_set_x (drag_actor, x); - break; - default : - break; - } + /* Allocate for label */ + if ((priv->preview_height_progress <= TAB_S1_ANIM) || (!priv->preview)) { + if (priv->icon) + child_box.x1 = E_MAIL_PIXBOUND (padding.left + icon_width + priv->spacing); + else + child_box.x1 = E_MAIL_PIXBOUND (padding.left); + child_box.x2 = (box->x2 - box->x1 - padding.right); + child_box.y1 = E_MAIL_PIXBOUND ((box->y2 - box->y1) / 2 - label_height / 2); + child_box.y2 = child_box.y1 + label_height; + + /* If close button is visible, don't overlap it */ + if (priv->can_close) + child_box.x2 -= close_width + priv->spacing; + } else { + /* Put label underneath preview */ + child_box.x1 = E_MAIL_PIXBOUND (padding.left); + child_box.x2 = (box->x2 - box->x1 - padding.right); + child_box.y1 = E_MAIL_PIXBOUND ( + padding.top + preview_height + priv->spacing); + child_box.y2 = child_box.y1 + label_height; } - } - - /* Allocate old background texture */ - if (priv->old_bg) - { - child_box.x1 = 0; - child_box.y1 = 0; - child_box.x2 = box->x2 - box->x1; - child_box.y2 = box->y2 - box->y1; - clutter_actor_allocate (priv->old_bg, &child_box, flags); - } - - mx_widget_get_padding (MX_WIDGET (actor), &padding); - - /* Get the preferred width/height of the icon, label and close-button first */ - if (priv->icon) - clutter_actor_get_preferred_size (priv->icon, NULL, NULL, - &icon_width, &icon_height); - clutter_actor_get_preferred_size (CLUTTER_ACTOR (priv->label), NULL, NULL, - &label_width, &label_height); - if (priv->can_close) - clutter_actor_get_preferred_size (CLUTTER_ACTOR (priv->close_button), - NULL, NULL, &close_width, &close_height); - - /* Allocate for icon */ - if (priv->icon) - { - child_box.x1 = padding.left; - child_box.x2 = child_box.x1 + icon_width; - child_box.y1 = E_MAIL_PIXBOUND ((box->y2 - box->y1)/2 - icon_height/2); - child_box.y2 = child_box.y1 + icon_height; - clutter_actor_allocate (priv->icon, &child_box, flags); - } - - /* Allocate for close button */ - if (priv->can_close) - { - child_box.x2 = box->x2 - box->x1 - padding.right; - child_box.x1 = child_box.x2 - close_width; - child_box.y1 = E_MAIL_PIXBOUND ((box->y2 - box->y1)/2 - close_height/2); - child_box.y2 = child_box.y1 + close_height; - clutter_actor_allocate (CLUTTER_ACTOR (priv->close_button), - &child_box, - flags); - } - - /* Allocate for preview widget */ - preview_height = 0; - if (priv->preview) - { - preview_width = (box->x2 - box->x1 - padding.left - padding.right); - preview_height = (box->y2 - box->y1 - padding.top - padding.bottom - - priv->spacing - label_height); - - child_box.x1 = E_MAIL_PIXBOUND (padding.left); - child_box.y1 = E_MAIL_PIXBOUND (padding.top); - child_box.x2 = child_box.x1 + preview_width; - child_box.y2 = child_box.y1 + preview_height; - clutter_actor_allocate (priv->preview, &child_box, flags); - } - - /* Allocate for label */ - if ((priv->preview_height_progress <= TAB_S1_ANIM) || (!priv->preview)) - { - if (priv->icon) - child_box.x1 = E_MAIL_PIXBOUND (padding.left + icon_width + priv->spacing); - else - child_box.x1 = E_MAIL_PIXBOUND (padding.left); - child_box.x2 = (box->x2 - box->x1 - padding.right); - child_box.y1 = E_MAIL_PIXBOUND ((box->y2 - box->y1)/2 - label_height/2); - child_box.y2 = child_box.y1 + label_height; - - /* If close button is visible, don't overlap it */ - if (priv->can_close) - child_box.x2 -= close_width + priv->spacing; - } - else - { - /* Put label underneath preview */ - child_box.x1 = E_MAIL_PIXBOUND (padding.left); - child_box.x2 = (box->x2 - box->x1 - padding.right); - child_box.y1 = E_MAIL_PIXBOUND (padding.top + preview_height + - priv->spacing); - child_box.y2 = child_box.y1 + label_height; - } - - clutter_actor_allocate (CLUTTER_ACTOR (priv->label), &child_box, flags); - - /* If we're in preview mode, re-allocate the background so it doesn't - * encompass the label. (A bit hacky?) - */ - if (priv->preview && CLUTTER_ACTOR_IS_VISIBLE (priv->preview)) - { - gfloat max_height = padding.top + padding.bottom + preview_height; - if (box->y2 - box->y1 > max_height) - { - MxWidget *widget = MX_WIDGET (actor); - ClutterActor *background = mx_widget_get_border_image (widget); - - if (!background) - background = mx_widget_get_background_image (widget); - - child_box.x1 = 0; - child_box.x2 = box->x2 - box->x1; - child_box.y1 = 0; - child_box.y2 = max_height; - - if (background) - clutter_actor_allocate (background, &child_box, flags); - if (priv->old_bg && (priv->old_bg != background)) - clutter_actor_allocate (priv->old_bg, &child_box, flags); + + clutter_actor_allocate (CLUTTER_ACTOR (priv->label), &child_box, flags); + + /* If we're in preview mode, re-allocate the background so it doesn't + * encompass the label. (A bit hacky?) + */ + if (priv->preview && CLUTTER_ACTOR_IS_VISIBLE (priv->preview)) { + gfloat max_height = padding.top + padding.bottom + preview_height; + if (box->y2 - box->y1 > max_height) { + MxWidget *widget = MX_WIDGET (actor); + ClutterActor *background = mx_widget_get_border_image (widget); + + if (!background) + background = mx_widget_get_background_image (widget); + + child_box.x1 = 0; + child_box.x2 = box->x2 - box->x1; + child_box.y1 = 0; + child_box.y2 = max_height; + + if (background) + clutter_actor_allocate ( + background, &child_box, flags); + + if (priv->old_bg && (priv->old_bg != background)) + clutter_actor_allocate ( + priv->old_bg, &child_box, flags); + } } - } } static void e_mail_tab_paint (ClutterActor *actor) { - EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; + EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; - /* Chain up to paint background */ - CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->paint (actor); + /* Chain up to paint background */ + CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->paint (actor); - if (priv->old_bg) - clutter_actor_paint (priv->old_bg); + if (priv->old_bg) + clutter_actor_paint (priv->old_bg); - if (priv->icon) - clutter_actor_paint (priv->icon); + if (priv->icon) + clutter_actor_paint (priv->icon); - clutter_actor_paint (CLUTTER_ACTOR (priv->label)); + clutter_actor_paint (CLUTTER_ACTOR (priv->label)); - if (priv->can_close) - clutter_actor_paint (CLUTTER_ACTOR (priv->close_button)); + if (priv->can_close) + clutter_actor_paint (CLUTTER_ACTOR (priv->close_button)); - if (priv->preview) - clutter_actor_paint (CLUTTER_ACTOR (priv->preview)); + if (priv->preview) + clutter_actor_paint (CLUTTER_ACTOR (priv->preview)); } static void -e_mail_tab_pick (ClutterActor *actor, const ClutterColor *c) +e_mail_tab_pick (ClutterActor *actor, + const ClutterColor *c) { - CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->pick (actor, c); + CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->pick (actor, c); - if (clutter_actor_should_pick_paint (actor)) - e_mail_tab_paint (actor); + if (clutter_actor_should_pick_paint (actor)) + e_mail_tab_paint (actor); } static void e_mail_tab_map (ClutterActor *actor) { - EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; - - CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->map (actor); - - clutter_actor_map (CLUTTER_ACTOR (priv->label)); - clutter_actor_map (CLUTTER_ACTOR (priv->close_button)); - if (priv->icon) - clutter_actor_map (priv->icon); - if (priv->preview) - clutter_actor_map (priv->preview); - if (priv->old_bg) - clutter_actor_map (priv->old_bg); + EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; + + CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->map (actor); + + clutter_actor_map (CLUTTER_ACTOR (priv->label)); + clutter_actor_map (CLUTTER_ACTOR (priv->close_button)); + + if (priv->icon) + clutter_actor_map (priv->icon); + if (priv->preview) + clutter_actor_map (priv->preview); + if (priv->old_bg) + clutter_actor_map (priv->old_bg); } static void e_mail_tab_unmap (ClutterActor *actor) { - EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; - - CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->unmap (actor); - - clutter_actor_unmap (CLUTTER_ACTOR (priv->label)); - clutter_actor_unmap (CLUTTER_ACTOR (priv->close_button)); - if (priv->icon) - clutter_actor_unmap (priv->icon); - if (priv->preview) - clutter_actor_unmap (priv->preview); - if (priv->old_bg) - clutter_actor_unmap (priv->old_bg); + EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; + + CLUTTER_ACTOR_CLASS (e_mail_tab_parent_class)->unmap (actor); + + clutter_actor_unmap (CLUTTER_ACTOR (priv->label)); + clutter_actor_unmap (CLUTTER_ACTOR (priv->close_button)); + + if (priv->icon) + clutter_actor_unmap (priv->icon); + if (priv->preview) + clutter_actor_unmap (priv->preview); + if (priv->old_bg) + clutter_actor_unmap (priv->old_bg); } static gboolean -e_mail_tab_button_press_event (ClutterActor *actor, - ClutterButtonEvent *event) +e_mail_tab_button_press_event (ClutterActor *actor, + ClutterButtonEvent *event) { - EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; + EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; - if (event->button == 1) - { - mx_stylable_set_style_pseudo_class (MX_STYLABLE (actor), "active"); - clutter_grab_pointer (actor); - priv->pressed = TRUE; + if (event->button == 1) { + mx_stylable_set_style_pseudo_class ( + MX_STYLABLE (actor), "active"); + clutter_grab_pointer (actor); + priv->pressed = TRUE; - priv->press_x = event->x; - priv->press_y = event->y; - } + priv->press_x = event->x; + priv->press_y = event->y; + } - /* We have to always return false, or dragging won't work */ - return FALSE; + /* We have to always return false, or dragging won't work */ + return FALSE; } static gboolean -e_mail_tab_button_release_event (ClutterActor *actor, - ClutterButtonEvent *event) +e_mail_tab_button_release_event (ClutterActor *actor, + ClutterButtonEvent *event) { - EMailTab *tab = E_MAIL_TAB (actor); - EMailTabPrivate *priv = tab->priv; - - if (priv->pressed) - { - clutter_ungrab_pointer (); - priv->pressed = FALSE; - - /* Note, no need to set the pseudo class here as clicking always results - * in being set active. - */ - if (priv->hover) - { - if (!priv->active) - e_mail_tab_set_active (tab, TRUE); - - g_signal_emit (actor, signals[CLICKED], 0); + EMailTab *tab = E_MAIL_TAB (actor); + EMailTabPrivate *priv = tab->priv; + + if (priv->pressed) { + clutter_ungrab_pointer (); + priv->pressed = FALSE; + + /* Note, no need to set the pseudo class here as clicking + * always results in being set active. */ + if (priv->hover) { + if (!priv->active) + e_mail_tab_set_active (tab, TRUE); + + g_signal_emit (actor, signals[CLICKED], 0); + } } - } - return FALSE; + return FALSE; } static gboolean -e_mail_tab_motion_event (ClutterActor *actor, - ClutterMotionEvent *event) -{ - EMailTab *tab = E_MAIL_TAB (actor); - EMailTabPrivate *priv = tab->priv; - - if (priv->pressed && priv->drag_enabled) - { - if ((ABS (event->x - priv->press_x) >= priv->drag_threshold) || - (ABS (event->y - priv->press_y) >= priv->drag_threshold)) - { - /* Ungrab the pointer so that the MxDraggable code can take over */ - clutter_ungrab_pointer (); - priv->pressed = FALSE; - if (!priv->active) - { - if (priv->hover) - mx_stylable_set_style_pseudo_class (MX_STYLABLE (actor), - "hover"); - else - mx_stylable_set_style_pseudo_class (MX_STYLABLE (actor), NULL); - } +e_mail_tab_motion_event (ClutterActor *actor, + ClutterMotionEvent *event) +{ + EMailTab *tab = E_MAIL_TAB (actor); + EMailTabPrivate *priv = tab->priv; + + if (priv->pressed && priv->drag_enabled) { + if ((ABS (event->x - priv->press_x) >= priv->drag_threshold) || + (ABS (event->y - priv->press_y) >= priv->drag_threshold)) { + /* Ungrab the pointer so that the MxDraggable code can take over */ + clutter_ungrab_pointer (); + priv->pressed = FALSE; + if (!priv->active) { + if (priv->hover) + mx_stylable_set_style_pseudo_class ( + MX_STYLABLE (actor), "hover"); + else + mx_stylable_set_style_pseudo_class ( + MX_STYLABLE (actor), NULL); + } + } } - } - return FALSE; + return FALSE; } static gboolean -e_mail_tab_enter_event (ClutterActor *actor, - ClutterCrossingEvent *event) +e_mail_tab_enter_event (ClutterActor *actor, + ClutterCrossingEvent *event) { - EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; + EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; - if (event->source != actor) - return FALSE; + if (event->source != actor) + return FALSE; - priv->hover = TRUE; + priv->hover = TRUE; - if (priv->pressed) - mx_stylable_set_style_pseudo_class (MX_STYLABLE (actor), "active"); - else if (!priv->active) - mx_stylable_set_style_pseudo_class (MX_STYLABLE (actor), "hover"); + if (priv->pressed) + mx_stylable_set_style_pseudo_class ( + MX_STYLABLE (actor), "active"); + else if (!priv->active) + mx_stylable_set_style_pseudo_class ( + MX_STYLABLE (actor), "hover"); - return FALSE; + return FALSE; } static gboolean -e_mail_tab_leave_event (ClutterActor *actor, - ClutterCrossingEvent *event) +e_mail_tab_leave_event (ClutterActor *actor, + ClutterCrossingEvent *event) { - EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; + EMailTabPrivate *priv = E_MAIL_TAB (actor)->priv; - if ((event->source != actor) || - (event->related == (ClutterActor *) priv->close_button)) - return FALSE; + if ((event->source != actor) || + (event->related == (ClutterActor *) priv->close_button)) + return FALSE; - priv->hover = FALSE; + priv->hover = FALSE; - if (!priv->active) - mx_stylable_set_style_pseudo_class (MX_STYLABLE (actor), NULL); + if (!priv->active) + mx_stylable_set_style_pseudo_class (MX_STYLABLE (actor), NULL); - return FALSE; + return FALSE; } static void -e_mail_tab_class_init (EMailTabClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - - g_type_class_add_private (klass, sizeof (EMailTabPrivate)); - - object_class->get_property = e_mail_tab_get_property; - object_class->set_property = e_mail_tab_set_property; - object_class->dispose = e_mail_tab_dispose; - object_class->finalize = e_mail_tab_finalize; - - actor_class->get_preferred_width = e_mail_tab_get_preferred_width; - actor_class->get_preferred_height = e_mail_tab_get_preferred_height; - actor_class->button_press_event = e_mail_tab_button_press_event; - actor_class->button_release_event = e_mail_tab_button_release_event; - actor_class->motion_event = e_mail_tab_motion_event; - actor_class->enter_event = e_mail_tab_enter_event; - actor_class->leave_event = e_mail_tab_leave_event; - actor_class->allocate = e_mail_tab_allocate; - actor_class->paint = e_mail_tab_paint; - actor_class->pick = e_mail_tab_pick; - actor_class->map = e_mail_tab_map; - actor_class->unmap = e_mail_tab_unmap; - - g_object_class_install_property (object_class, - PROP_ICON, - g_param_spec_object ("icon", - "Icon", - "Icon actor.", - CLUTTER_TYPE_ACTOR, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_TEXT, - g_param_spec_string ("text", - "Text", - "Tab text.", - "", - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_CAN_CLOSE, - g_param_spec_boolean ("can-close", - "Can close", - "Whether the tab can " - "close.", - TRUE, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_TAB_WIDTH, - g_param_spec_int ("tab-width", - "Tab width", - "Tab width.", - -1, G_MAXINT, -1, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_DOCKING, - g_param_spec_boolean ("docking", - "Docking", - "Whether the tab " - "should dock to edges " - "when scrolled.", - FALSE, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_PREVIEW, - g_param_spec_object ("preview", - "Preview actor", - "ClutterActor used " - "when in preview mode.", - CLUTTER_TYPE_ACTOR, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_PREVIEW_MODE, - g_param_spec_boolean ("preview-mode", - "Preview mode", - "Whether to display " - "in preview mode.", - FALSE, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_PREVIEW_DURATION, - g_param_spec_uint ("preview-duration", - "Preview duration", - "How long the transition " - "between preview mode " - "states lasts, in ms.", - 0, G_MAXUINT, 200, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_SPACING, - g_param_spec_float ("spacing", - "Spacing", - "Spacing between " - "tab elements.", - 0, G_MAXFLOAT, - 6.0, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_PRIVATE, - g_param_spec_boolean ("private", - "Private", - "Set if the tab is " - "'private'.", - FALSE, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, - PROP_ACTIVE, - g_param_spec_boolean ("active", - "Active", - "Set if the tab is " - "active.", - FALSE, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); - - g_object_class_override_property (object_class, - PROP_DRAG_THRESHOLD, - "drag-threshold"); - g_object_class_override_property (object_class, - PROP_DRAG_AXIS, - "axis"); - // g_object_class_override_property (object_class, - // PROP_DRAG_CONTAINMENT_TYPE, - // "containment-type"); - g_object_class_override_property (object_class, - PROP_DRAG_CONTAINMENT_AREA, - "containment-area"); - g_object_class_override_property (object_class, - PROP_DRAG_ENABLED, - "drag-enabled"); - g_object_class_override_property (object_class, - PROP_DRAG_ACTOR, - "drag-actor"); - - signals[CLICKED] = - g_signal_new ("clicked", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMailTabClass, clicked), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[CLOSED] = - g_signal_new ("closed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMailTabClass, closed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[TRANSITION_COMPLETE] = - g_signal_new ("transition-complete", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMailTabClass, transition_complete), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); +e_mail_tab_class_init (EMailTabClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (class); + + g_type_class_add_private (class, sizeof (EMailTabPrivate)); + + object_class->get_property = e_mail_tab_get_property; + object_class->set_property = e_mail_tab_set_property; + object_class->dispose = e_mail_tab_dispose; + + actor_class->get_preferred_width = e_mail_tab_get_preferred_width; + actor_class->get_preferred_height = e_mail_tab_get_preferred_height; + actor_class->button_press_event = e_mail_tab_button_press_event; + actor_class->button_release_event = e_mail_tab_button_release_event; + actor_class->motion_event = e_mail_tab_motion_event; + actor_class->enter_event = e_mail_tab_enter_event; + actor_class->leave_event = e_mail_tab_leave_event; + actor_class->allocate = e_mail_tab_allocate; + actor_class->paint = e_mail_tab_paint; + actor_class->pick = e_mail_tab_pick; + actor_class->map = e_mail_tab_map; + actor_class->unmap = e_mail_tab_unmap; + + g_object_class_install_property ( + object_class, + PROP_ICON, + g_param_spec_object ( + "icon", + "Icon", + "Icon actor.", + CLUTTER_TYPE_ACTOR, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_TEXT, + g_param_spec_string ( + "text", + "Text", + "Tab text.", + "", + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_CAN_CLOSE, + g_param_spec_boolean ( + "can-close", + "Can close", + "Whether the tab can " + "close.", + TRUE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_TAB_WIDTH, + g_param_spec_int ( + "tab-width", + "Tab width", + "Tab width.", + -1, G_MAXINT, -1, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_DOCKING, + g_param_spec_boolean ( + "docking", + "Docking", + "Whether the tab should dock to edges when scrolled.", + FALSE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_PREVIEW, + g_param_spec_object ( + "preview", + "Preview actor", + "ClutterActor used " + "when in preview mode.", + CLUTTER_TYPE_ACTOR, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_PREVIEW_MODE, + g_param_spec_boolean ( + "preview-mode", + "Preview mode", + "Whether to display " + "in preview mode.", + FALSE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_PREVIEW_DURATION, + g_param_spec_uint ( + "preview-duration", + "Preview duration", + "How long the transition " + "between preview mode " + "states lasts, in ms.", + 0, G_MAXUINT, 200, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_SPACING, + g_param_spec_float ( + "spacing", + "Spacing", + "Spacing between " + "tab elements.", + 0, G_MAXFLOAT, + 6.0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_PRIVATE, + g_param_spec_boolean ( + "private", + "Private", + "Set if the tab is " + "'private'.", + FALSE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_ACTIVE, + g_param_spec_boolean ( + "active", + "Active", + "Set if the tab is " + "active.", + FALSE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_override_property ( + object_class, + PROP_DRAG_THRESHOLD, + "drag-threshold"); + + g_object_class_override_property ( + object_class, + PROP_DRAG_AXIS, + "axis"); + + g_object_class_override_property ( + object_class, + PROP_DRAG_CONTAINMENT_AREA, + "containment-area"); + + g_object_class_override_property ( + object_class, + PROP_DRAG_ENABLED, + "drag-enabled"); + + g_object_class_override_property ( + object_class, + PROP_DRAG_ACTOR, + "drag-actor"); + + signals[CLICKED] = g_signal_new ( + "clicked", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMailTabClass, clicked), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[CLOSED] = g_signal_new ( + "closed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMailTabClass, closed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[TRANSITION_COMPLETE] = g_signal_new ( + "transition-complete", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMailTabClass, transition_complete), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static void -e_mail_tab_close_clicked_cb (MxButton *button, EMailTab *self) +e_mail_tab_close_clicked_cb (MxButton *button, + EMailTab *self) { - g_signal_emit (self, signals[CLOSED], 0); + g_signal_emit (self, signals[CLOSED], 0); } static void e_mail_tab_anim_completed_cb (ClutterAnimation *animation, - EMailTab *tab) + EMailTab *tab) { - e_mail_tab_dispose_old_bg (tab); + e_mail_tab_dispose_old_bg (tab); } static void e_mail_tab_style_changed_cb (MxWidget *widget) { - EMailTabPrivate *priv = E_MAIL_TAB (widget)->priv; - - /* Don't transition on hover */ - if (g_strcmp0 (mx_stylable_get_style_pseudo_class (MX_STYLABLE (widget)), - "hover") == 0) - return; - - if (priv->old_bg) - { - if (!clutter_actor_get_parent (priv->old_bg)) - { - ClutterActorBox box; - ClutterActor *background; - ClutterActor *actor = CLUTTER_ACTOR (widget); - - clutter_actor_set_parent (priv->old_bg, actor); - - /* Try to allocate the same size as the background widget, - * otherwise allocate the same size as the widget itself. - */ - background = mx_widget_get_border_image (widget); - if (!background) - background = mx_widget_get_background_image (widget); - - if (background) - clutter_actor_get_allocation_box (background, &box); - else - { - clutter_actor_get_allocation_box (actor, &box); - box.x2 -= box.x1; - box.y2 -= box.y1; - box.x1 = 0; - box.y1 = 0; - } - - clutter_actor_allocate (priv->old_bg, &box, 0); + EMailTabPrivate *priv = E_MAIL_TAB (widget)->priv; + + /* Don't transition on hover */ + if (g_strcmp0 (mx_stylable_get_style_pseudo_class ( + MX_STYLABLE (widget)), "hover") == 0) + return; + + if (priv->old_bg) { + if (!clutter_actor_get_parent (priv->old_bg)) { + ClutterActorBox box; + ClutterActor *background; + ClutterActor *actor = CLUTTER_ACTOR (widget); + + clutter_actor_set_parent (priv->old_bg, actor); + + /* Try to allocate the same size as the background + * widget, otherwise allocate the same size as the + * widget itself. */ + background = mx_widget_get_border_image (widget); + if (!background) + background = mx_widget_get_background_image (widget); + + if (background) + clutter_actor_get_allocation_box (background, &box); + else { + clutter_actor_get_allocation_box (actor, &box); + box.x2 -= box.x1; + box.y2 -= box.y1; + box.x1 = 0; + box.y1 = 0; + } + + clutter_actor_allocate (priv->old_bg, &box, 0); + } + + clutter_actor_animate ( + priv->old_bg, CLUTTER_LINEAR, 150, + "opacity", 0, "signal::completed", + G_CALLBACK (e_mail_tab_anim_completed_cb), + widget, NULL); } - - clutter_actor_animate (priv->old_bg, - CLUTTER_LINEAR, - 150, - "opacity", 0, - "signal::completed", - G_CALLBACK (e_mail_tab_anim_completed_cb), - widget, - NULL); - } } static void e_mail_tab_stylable_changed_cb (MxStylable *stylable) { - EMailTab *tab = E_MAIL_TAB (stylable); - EMailTabPrivate *priv = tab->priv; + EMailTab *tab = E_MAIL_TAB (stylable); + EMailTabPrivate *priv = tab->priv; - e_mail_tab_dispose_old_bg (tab); + e_mail_tab_dispose_old_bg (tab); - priv->old_bg = mx_widget_get_border_image (MX_WIDGET (tab)); - if (priv->old_bg) - g_object_ref (priv->old_bg); + priv->old_bg = mx_widget_get_border_image (MX_WIDGET (tab)); + if (priv->old_bg) + g_object_ref (priv->old_bg); } static void -e_mail_tab_dnd_notify_cb (GObject *settings, - GParamSpec *pspec, - EMailTab *tab) +e_mail_tab_dnd_notify_cb (GObject *settings, + GParamSpec *pspec, + EMailTab *tab) { - g_object_get (settings, - "gtk-dnd-drag-threshold", &tab->priv->drag_threshold, + g_object_get ( + settings, + "gtk-dnd-drag-threshold", &tab->priv->drag_threshold, NULL); } static void e_mail_tab_init (EMailTab *self) { - ClutterActor *text; - GtkSettings *settings; - EMailTabPrivate *priv; + ClutterActor *text; + GtkSettings *settings; + EMailTabPrivate *priv; - priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE ( self, E_MAIL_TYPE_TAB, EMailTabPrivate); - priv->width = -1; - priv->anim_length = 200; - priv->spacing = 6.0; - priv->can_close = TRUE; - - priv->label = mx_label_new (); - g_object_set (G_OBJECT (priv->label), "clip-to-allocation", TRUE, NULL); - text = mx_label_get_clutter_text (MX_LABEL (priv->label)); - clutter_text_set_ellipsize (CLUTTER_TEXT (text), PANGO_ELLIPSIZE_END); - clutter_actor_set_parent (CLUTTER_ACTOR (priv->label), - CLUTTER_ACTOR (self)); - - priv->close_button = mx_button_new (); - clutter_actor_set_name (CLUTTER_ACTOR (priv->close_button), - "tab-close-button"); - clutter_actor_set_parent (CLUTTER_ACTOR (priv->close_button), - CLUTTER_ACTOR (self)); - - g_signal_connect (priv->close_button, "clicked", - G_CALLBACK (e_mail_tab_close_clicked_cb), self); - - /* Connect up styling signals */ - g_signal_connect (self, "style-changed", - G_CALLBACK (e_mail_tab_style_changed_cb), NULL); - g_signal_connect (self, "stylable-changed", - G_CALLBACK (e_mail_tab_stylable_changed_cb), NULL); - - clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE); - - settings = gtk_settings_get_default (); - priv->drag_threshold_handler = - g_signal_connect (settings, "notify::gtk-dnd-drag-threshold", - G_CALLBACK (e_mail_tab_dnd_notify_cb), self); - g_object_get (G_OBJECT (settings), - "gtk-dnd-drag-threshold", &priv->drag_threshold, + priv->width = -1; + priv->anim_length = 200; + priv->spacing = 6.0; + priv->can_close = TRUE; + + priv->label = mx_label_new (); + g_object_set (priv->label, "clip-to-allocation", TRUE, NULL); + text = mx_label_get_clutter_text (MX_LABEL (priv->label)); + clutter_text_set_ellipsize (CLUTTER_TEXT (text), PANGO_ELLIPSIZE_END); + clutter_actor_set_parent ( + CLUTTER_ACTOR (priv->label), CLUTTER_ACTOR (self)); + + priv->close_button = mx_button_new (); + clutter_actor_set_name ( + CLUTTER_ACTOR (priv->close_button), "tab-close-button"); + clutter_actor_set_parent ( + CLUTTER_ACTOR (priv->close_button), CLUTTER_ACTOR (self)); + + g_signal_connect ( + priv->close_button, "clicked", + G_CALLBACK (e_mail_tab_close_clicked_cb), self); + + /* Connect up styling signals */ + g_signal_connect ( + self, "style-changed", + G_CALLBACK (e_mail_tab_style_changed_cb), NULL); + g_signal_connect ( + self, "stylable-changed", + G_CALLBACK (e_mail_tab_stylable_changed_cb), NULL); + + clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE); + + settings = gtk_settings_get_default (); + priv->drag_threshold_handler = g_signal_connect ( + settings, "notify::gtk-dnd-drag-threshold", + G_CALLBACK (e_mail_tab_dnd_notify_cb), self); + g_object_get ( + G_OBJECT (settings), + "gtk-dnd-drag-threshold", &priv->drag_threshold, NULL); } ClutterActor * e_mail_tab_new (void) { - return g_object_new (E_MAIL_TYPE_TAB, NULL); + return g_object_new (E_MAIL_TYPE_TAB, NULL); } ClutterActor * -e_mail_tab_new_full (const gchar *text, ClutterActor *icon, gint width) -{ - return g_object_new (E_MAIL_TYPE_TAB, - "text", text, - "icon", icon, - "tab-width", width, NULL); +e_mail_tab_new_full (const gchar *text, + ClutterActor *icon, + gint width) +{ + return g_object_new ( + E_MAIL_TYPE_TAB, + "text", text, + "icon", icon, + "tab-width", width, + NULL); } void -e_mail_tab_set_text (EMailTab *tab, const gchar *text) +e_mail_tab_set_text (EMailTab *tab, + const gchar *text) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (!text) - text = ""; + if (!text) + text = ""; - priv->has_text = (text[0] != '\0'); + priv->has_text = (text[0] != '\0'); - if (priv->label) - mx_label_set_text (MX_LABEL (priv->label), text); + if (priv->label) + mx_label_set_text (MX_LABEL (priv->label), text); - g_object_notify (G_OBJECT (tab), "text"); + g_object_notify (G_OBJECT (tab), "text"); } void -e_mail_tab_set_default_icon (EMailTab *tab, - ClutterActor *icon) +e_mail_tab_set_default_icon (EMailTab *tab, + ClutterActor *icon) { - EMailTabPrivate *priv = tab->priv; - gboolean changed = !priv->icon || (priv->icon == priv->default_icon); + EMailTabPrivate *priv = tab->priv; + gboolean changed = !priv->icon || (priv->icon == priv->default_icon); - if (icon) - g_object_ref_sink (icon); + if (icon) + g_object_ref_sink (icon); - if (priv->default_icon) - g_object_unref (priv->default_icon); + if (priv->default_icon) + g_object_unref (priv->default_icon); - priv->default_icon = icon; + priv->default_icon = icon; - if (changed) - e_mail_tab_set_icon (tab, NULL); + if (changed) + e_mail_tab_set_icon (tab, NULL); } void -e_mail_tab_set_icon (EMailTab *tab, ClutterActor *icon) +e_mail_tab_set_icon (EMailTab *tab, + ClutterActor *icon) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - /* passing NULL for icon will use default icon if available */ + /* passing NULL for icon will use default icon if available */ - if (priv->icon) - clutter_actor_unparent (priv->icon); + if (priv->icon) + clutter_actor_unparent (priv->icon); - if (icon) - priv->icon = icon; - else - priv->icon = priv->default_icon; + if (icon) + priv->icon = icon; + else + priv->icon = priv->default_icon; - if (priv->icon) - { - clutter_actor_set_parent (priv->icon, CLUTTER_ACTOR (tab)); - } + if (priv->icon) + clutter_actor_set_parent (priv->icon, CLUTTER_ACTOR (tab)); - clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); + clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); - g_object_notify (G_OBJECT (tab), "icon"); + g_object_notify (G_OBJECT (tab), "icon"); } const gchar * e_mail_tab_get_text (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->label) - return mx_label_get_text (MX_LABEL (priv->label)); - else - return NULL; + if (priv->label) + return mx_label_get_text (MX_LABEL (priv->label)); + else + return NULL; } ClutterActor * e_mail_tab_get_icon (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - return priv->icon == priv->default_icon ? NULL : priv->icon; + EMailTabPrivate *priv = tab->priv; + return priv->icon == priv->default_icon ? NULL : priv->icon; } void -e_mail_tab_set_can_close (EMailTab *tab, gboolean can_close) +e_mail_tab_set_can_close (EMailTab *tab, + gboolean can_close) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->can_close == can_close) - return; + if (priv->can_close == can_close) + return; - priv->can_close = can_close; + priv->can_close = can_close; - clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); + clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); - g_object_notify (G_OBJECT (tab), "can-close"); + g_object_notify (G_OBJECT (tab), "can-close"); } gboolean e_mail_tab_get_can_close (EMailTab *tab) { - return tab->priv->can_close; + return tab->priv->can_close; } void e_mail_tab_set_width (EMailTab *tab, - gint width) + gint width) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->width == width) - return; + if (priv->width == width) + return; - priv->width = width; + priv->width = width; - clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); + clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); - g_object_notify (G_OBJECT (tab), "tab-width"); + g_object_notify (G_OBJECT (tab), "tab-width"); } gint e_mail_tab_get_width (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - return priv->width; + EMailTabPrivate *priv = tab->priv; + return priv->width; } void -e_mail_tab_set_docking (EMailTab *tab, - gboolean docking) +e_mail_tab_set_docking (EMailTab *tab, + gboolean docking) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->docking == docking) - return; + if (priv->docking == docking) + return; - priv->docking = docking; + priv->docking = docking; - clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); + clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); - g_object_notify (G_OBJECT (tab), "docking"); + g_object_notify (G_OBJECT (tab), "docking"); } gboolean e_mail_tab_get_docking (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - return priv->docking; + EMailTabPrivate *priv = tab->priv; + return priv->docking; } void -e_mail_tab_set_preview_actor (EMailTab *tab, ClutterActor *actor) +e_mail_tab_set_preview_actor (EMailTab *tab, + ClutterActor *actor) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->preview) - clutter_actor_unparent (priv->preview); + if (priv->preview) + clutter_actor_unparent (priv->preview); - priv->preview = actor; + priv->preview = actor; - if (actor) - { - clutter_actor_set_parent (actor, CLUTTER_ACTOR (tab)); + if (actor) { + clutter_actor_set_parent (actor, CLUTTER_ACTOR (tab)); - clutter_actor_set_opacity (actor, priv->preview_mode ? 0xff : 0x00); - if (!priv->preview_mode) - clutter_actor_hide (actor); - } + clutter_actor_set_opacity ( + actor, priv->preview_mode ? 0xff : 0x00); + if (!priv->preview_mode) + clutter_actor_hide (actor); + } - clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); + clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); - g_object_notify (G_OBJECT (tab), "preview"); + g_object_notify (G_OBJECT (tab), "preview"); } ClutterActor * e_mail_tab_get_preview_actor (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - return priv->preview; + EMailTabPrivate *priv = tab->priv; + return priv->preview; } static void preview_new_frame_cb (ClutterTimeline *timeline, - guint msecs, - EMailTab *tab) -{ - gboolean forwards; - EMailTabPrivate *priv = tab->priv; - - forwards = (clutter_timeline_get_direction (timeline) == - CLUTTER_TIMELINE_FORWARD) ? TRUE : FALSE; - if (priv->preview_mode) - forwards = !forwards; - - priv->preview_height_progress = clutter_timeline_get_progress (timeline); - if (forwards) - priv->preview_height_progress = 1.0 - priv->preview_height_progress; - - if (priv->preview) - clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); + guint msecs, + EMailTab *tab) +{ + gboolean forwards; + EMailTabPrivate *priv = tab->priv; + + forwards = + (clutter_timeline_get_direction (timeline) == + CLUTTER_TIMELINE_FORWARD); + if (priv->preview_mode) + forwards = !forwards; + + priv->preview_height_progress = + clutter_timeline_get_progress (timeline); + if (forwards) + priv->preview_height_progress = + 1.0 - priv->preview_height_progress; + + if (priv->preview) + clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); } static void preview_completed_cb (ClutterTimeline *timeline, - EMailTab *tab) -{ - EMailTabPrivate *priv = tab->priv; - - if (priv->preview_timeline) - { - clutter_timeline_stop (priv->preview_timeline); - g_object_unref (priv->preview_timeline); - priv->preview_timeline = NULL; - - if (priv->preview_mode) - priv->preview_height_progress = 1.0; - else - { - priv->preview_height_progress = 0.0; - if (priv->preview) - clutter_actor_hide (priv->preview); - if (priv->can_close) - clutter_actor_set_reactive (CLUTTER_ACTOR (priv->close_button), + EMailTab *tab) +{ + EMailTabPrivate *priv = tab->priv; + + if (priv->preview_timeline) { + clutter_timeline_stop (priv->preview_timeline); + g_object_unref (priv->preview_timeline); + priv->preview_timeline = NULL; + + if (priv->preview_mode) + priv->preview_height_progress = 1.0; + else { + priv->preview_height_progress = 0.0; + if (priv->preview) + clutter_actor_hide (priv->preview); + if (priv->can_close) + clutter_actor_set_reactive ( + CLUTTER_ACTOR (priv->close_button), TRUE); + } + + /* Remove style hint if we're not in preview mode */ + if (priv->preview) { + if (!priv->preview_mode) + clutter_actor_set_name ( + CLUTTER_ACTOR (tab), + priv->private ? "private-tab" : NULL); + } else { + /* If there's no preview actor, disable the tab */ + clutter_actor_set_reactive ( + CLUTTER_ACTOR (tab), !priv->preview_mode); + } + + if (priv->preview) + clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); + + g_signal_emit (tab, signals[TRANSITION_COMPLETE], 0); } - - /* Remove style hint if we're not in preview mode */ - if (priv->preview) - { - if (!priv->preview_mode) - clutter_actor_set_name (CLUTTER_ACTOR (tab), - priv->private ? "private-tab" : NULL); - } - else - { - /* If there's no preview actor, disable the tab */ - clutter_actor_set_reactive (CLUTTER_ACTOR (tab), !priv->preview_mode); - } - - if (priv->preview) - clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); - - g_signal_emit (tab, signals[TRANSITION_COMPLETE], 0); - } } static void preview_s1_started_cb (ClutterTimeline *timeline, - EMailTab *tab) + EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - - if (!priv->preview) - clutter_actor_animate_with_timeline (CLUTTER_ACTOR (priv->label), - CLUTTER_EASE_IN_OUT_QUAD, - timeline, - "opacity", 0xff, - NULL); + EMailTabPrivate *priv = tab->priv; + + if (!priv->preview) + clutter_actor_animate_with_timeline ( + CLUTTER_ACTOR (priv->label), + CLUTTER_EASE_IN_OUT_QUAD, + timeline, + "opacity", 0xff, + NULL); } static void preview_s2_started_cb (ClutterTimeline *timeline, - EMailTab *tab) + EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - - if (priv->preview) - clutter_actor_animate_with_timeline (CLUTTER_ACTOR (priv->label), - CLUTTER_EASE_IN_OUT_QUAD, - timeline, - "opacity", 0xff, - NULL); + EMailTabPrivate *priv = tab->priv; + + if (priv->preview) + clutter_actor_animate_with_timeline ( + CLUTTER_ACTOR (priv->label), + CLUTTER_EASE_IN_OUT_QUAD, + timeline, + "opacity", 0xff, + NULL); } void -e_mail_tab_set_preview_mode (EMailTab *tab, gboolean preview) +e_mail_tab_set_preview_mode (EMailTab *tab, + gboolean preview) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->preview_mode != preview) - { - ClutterTimeline *timeline, *timeline2; - gdouble progress, total_duration, duration1, duration2; + if (priv->preview_mode != preview) { + ClutterTimeline *timeline, *timeline2; + gdouble progress, total_duration, duration1, duration2; - priv->preview_mode = preview; + priv->preview_mode = preview; - /* Disable the close button in preview mode */ - if (preview && priv->can_close) - clutter_actor_set_reactive (CLUTTER_ACTOR (priv->close_button), FALSE); + /* Disable the close button in preview mode */ + if (preview && priv->can_close) + clutter_actor_set_reactive (CLUTTER_ACTOR (priv->close_button), FALSE); #define DEBUG_MULT 1 - if (priv->preview_timeline) - { - progress = 1.0 - - clutter_timeline_get_progress (priv->preview_timeline); - clutter_timeline_stop (priv->preview_timeline); - g_object_unref (priv->preview_timeline); - } - else - progress = 0.0; - - total_duration = priv->anim_length * (1.0 - progress) * DEBUG_MULT; - duration1 = total_duration * TAB_S1_ANIM; - duration2 = total_duration * TAB_S2_ANIM; - - priv->preview_timeline = - clutter_timeline_new (priv->anim_length * DEBUG_MULT); - clutter_timeline_skip (priv->preview_timeline, - clutter_timeline_get_duration (priv->preview_timeline) * progress); - - g_signal_connect (priv->preview_timeline, "completed", + if (priv->preview_timeline) { + progress = 1.0 - clutter_timeline_get_progress ( + priv->preview_timeline); + clutter_timeline_stop (priv->preview_timeline); + g_object_unref (priv->preview_timeline); + } else + progress = 0.0; + + total_duration = priv->anim_length * (1.0 - progress) * DEBUG_MULT; + duration1 = total_duration * TAB_S1_ANIM; + duration2 = total_duration * TAB_S2_ANIM; + + priv->preview_timeline = + clutter_timeline_new (priv->anim_length * DEBUG_MULT); + clutter_timeline_skip ( + priv->preview_timeline, clutter_timeline_get_duration ( + priv->preview_timeline) * progress); + + g_signal_connect ( + priv->preview_timeline, "completed", G_CALLBACK (preview_completed_cb), tab); - clutter_timeline_start (priv->preview_timeline); + clutter_timeline_start (priv->preview_timeline); - if (!priv->preview) - { - clutter_actor_animate_with_timeline (CLUTTER_ACTOR (tab), - CLUTTER_EASE_IN_OUT_QUAD, - priv->preview_timeline, - "opacity", preview ? 0x00 : 0xff, - NULL); - return; - } + if (!priv->preview) { + clutter_actor_animate_with_timeline ( + CLUTTER_ACTOR (tab), + CLUTTER_EASE_IN_OUT_QUAD, + priv->preview_timeline, + "opacity", preview ? 0x00 : 0xff, + NULL); + return; + } - g_signal_connect (priv->preview_timeline, "new-frame", + g_signal_connect ( + priv->preview_timeline, "new-frame", G_CALLBACK (preview_new_frame_cb), tab); - timeline = clutter_timeline_new ((guint) duration1); - timeline2 = clutter_timeline_new ((guint) duration2); + timeline = clutter_timeline_new ((guint) duration1); + timeline2 = clutter_timeline_new ((guint) duration2); - g_signal_connect (timeline, "started", + g_signal_connect ( + timeline, "started", G_CALLBACK (preview_s1_started_cb), tab); - g_signal_connect (timeline2, "started", + g_signal_connect ( + timeline2, "started", G_CALLBACK (preview_s2_started_cb), tab); - if (preview) - clutter_timeline_set_delay (timeline2, duration1); - else - clutter_timeline_set_delay (timeline, duration2); - - /* clutter_actor_animate_with_timeline will start the timelines */ - clutter_actor_animate_with_timeline (CLUTTER_ACTOR (priv->label), - CLUTTER_EASE_IN_OUT_QUAD, - preview ? timeline : timeline2, - "opacity", 0x00, - NULL); - if (priv->icon) - clutter_actor_animate_with_timeline (priv->icon, - CLUTTER_EASE_IN_OUT_QUAD, - timeline, - "opacity", preview ? 0x00 : 0xff, - NULL); - if (priv->can_close) - clutter_actor_animate_with_timeline (CLUTTER_ACTOR (priv->close_button), - CLUTTER_EASE_IN_OUT_QUAD, - timeline, - "opacity", preview ? 0x00 : 0xff, - NULL); - - if (priv->preview) - { - clutter_actor_show (priv->preview); - clutter_actor_animate_with_timeline (priv->preview, - CLUTTER_EASE_IN_OUT_QUAD, - timeline2, - "opacity", preview ? 0xff : 0x00, - NULL); + if (preview) + clutter_timeline_set_delay (timeline2, duration1); + else + clutter_timeline_set_delay (timeline, duration2); + + /* clutter_actor_animate_with_timeline will start the timelines */ + clutter_actor_animate_with_timeline ( + CLUTTER_ACTOR (priv->label), + CLUTTER_EASE_IN_OUT_QUAD, + preview ? timeline : timeline2, + "opacity", 0x00, NULL); + + if (priv->icon) + clutter_actor_animate_with_timeline ( + priv->icon, + CLUTTER_EASE_IN_OUT_QUAD, + timeline, + "opacity", preview ? 0x00 : 0xff, + NULL); + + if (priv->can_close) + clutter_actor_animate_with_timeline ( + CLUTTER_ACTOR (priv->close_button), + CLUTTER_EASE_IN_OUT_QUAD, + timeline, + "opacity", preview ? 0x00 : 0xff, + NULL); + + if (priv->preview) + clutter_actor_show (priv->preview); + clutter_actor_animate_with_timeline ( + priv->preview, + CLUTTER_EASE_IN_OUT_QUAD, + timeline2, + "opacity", preview ? 0xff : 0x00, + NULL); + + /* The animations have references on these, drop ours */ + g_object_unref (timeline); + g_object_unref (timeline2); + + /* Add an actor name, for style */ + clutter_actor_set_name ( + CLUTTER_ACTOR (tab), + priv->private ? "private-preview-tab" : + "preview-tab"); } - - /* The animations have references on these, drop ours */ - g_object_unref (timeline); - g_object_unref (timeline2); - - /* Add an actor name, for style */ - clutter_actor_set_name (CLUTTER_ACTOR (tab), - priv->private ? "private-preview-tab" : - "preview-tab"); - } } gboolean e_mail_tab_get_preview_mode (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - return priv->preview_mode; + EMailTabPrivate *priv = tab->priv; + return priv->preview_mode; } void -e_mail_tab_set_preview_duration (EMailTab *tab, guint duration) +e_mail_tab_set_preview_duration (EMailTab *tab, + guint duration) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->anim_length != duration) - { - priv->anim_length = duration; - g_object_notify (G_OBJECT (tab), "preview-duration"); - } + if (priv->anim_length != duration) { + priv->anim_length = duration; + g_object_notify (G_OBJECT (tab), "preview-duration"); + } } guint e_mail_tab_get_preview_duration (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - return priv->anim_length; + EMailTabPrivate *priv = tab->priv; + return priv->anim_length; } void -e_mail_tab_set_spacing (EMailTab *tab, gfloat spacing) +e_mail_tab_set_spacing (EMailTab *tab, + gfloat spacing) { - EMailTabPrivate *priv = tab->priv; - - if (priv->spacing != spacing) - { - priv->spacing = spacing; - g_object_notify (G_OBJECT (tab), "spacing"); - clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); - } + EMailTabPrivate *priv = tab->priv; + + if (priv->spacing != spacing) { + priv->spacing = spacing; + g_object_notify (G_OBJECT (tab), "spacing"); + clutter_actor_queue_relayout (CLUTTER_ACTOR (tab)); + } } gfloat e_mail_tab_get_spacing (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - return priv->spacing; + EMailTabPrivate *priv = tab->priv; + return priv->spacing; } void -e_mail_tab_set_private (EMailTab *tab, gboolean private) +e_mail_tab_set_private (EMailTab *tab, + gboolean private) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->private == private) - return; + if (priv->private == private) + return; - priv->private = private; + priv->private = private; - if (!priv->preview_mode) - clutter_actor_set_name (CLUTTER_ACTOR (tab), - private ? "private-tab" : NULL); + if (!priv->preview_mode) + clutter_actor_set_name ( + CLUTTER_ACTOR (tab), private ? "private-tab" : NULL); - g_object_notify (G_OBJECT (tab), "private"); + g_object_notify (G_OBJECT (tab), "private"); } gboolean e_mail_tab_get_private (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - return priv->private; + EMailTabPrivate *priv = tab->priv; + return priv->private; } void -e_mail_tab_set_active (EMailTab *tab, gboolean active) +e_mail_tab_set_active (EMailTab *tab, + gboolean active) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->active == active) - return; + if (priv->active == active) + return; - priv->active = active; + priv->active = active; - g_object_notify (G_OBJECT (tab), "active"); + g_object_notify (G_OBJECT (tab), "active"); - if (active) - mx_stylable_set_style_pseudo_class (MX_STYLABLE (tab), "active"); - else if (!priv->pressed) - { - if (priv->hover) - mx_stylable_set_style_pseudo_class (MX_STYLABLE (tab), "hover"); - else - mx_stylable_set_style_pseudo_class (MX_STYLABLE (tab), NULL); - } + if (active) + mx_stylable_set_style_pseudo_class (MX_STYLABLE (tab), "active"); + else if (!priv->pressed) { + if (priv->hover) + mx_stylable_set_style_pseudo_class (MX_STYLABLE (tab), "hover"); + else + mx_stylable_set_style_pseudo_class (MX_STYLABLE (tab), NULL); + } } gboolean e_mail_tab_get_active (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - return priv->active; + EMailTabPrivate *priv = tab->priv; + return priv->active; } static gboolean e_mail_tab_alert_cb (EMailTab *tab) { - const gchar *name; - EMailTabPrivate *priv = tab->priv; + const gchar *name; + EMailTabPrivate *priv = tab->priv; - /* FIXME: Work in preview mode */ + /* FIXME: Work in preview mode */ - /* Alternate between private mode and non-private to alert */ - name = (priv->private ^ (priv->alert_count % 2)) ? NULL : "private-tab"; - if (!priv->preview_mode) - clutter_actor_set_name (CLUTTER_ACTOR (tab), name); - priv->alert_count++; + /* Alternate between private mode and non-private to alert */ + name = (priv->private ^ (priv->alert_count % 2)) ? NULL : "private-tab"; + if (!priv->preview_mode) + clutter_actor_set_name (CLUTTER_ACTOR (tab), name); + priv->alert_count++; - if (priv->alert_count < 4) - return TRUE; + if (priv->alert_count < 4) + return TRUE; - /* This call isn't needed, it should be in the correct state as long as - * the above check always checks for < (an even number) - */ - /*if (!priv->preview_mode) - clutter_actor_set_name (CLUTTER_ACTOR (tab), - priv->private ? "private-tab" : NULL);*/ - priv->alert_source = 0; + /* This call isn't needed, it should be in the correct state as long as + * the above check always checks for < (an even number) + */ + /*if (!priv->preview_mode) + clutter_actor_set_name (CLUTTER_ACTOR (tab), + priv->private ? "private-tab" : NULL);*/ + priv->alert_source = 0; - return FALSE; + return FALSE; } void e_mail_tab_alert (EMailTab *tab) { - EMailTabPrivate *priv = tab->priv; - - priv->alert_count = 0; - if (!priv->alert_source) - priv->alert_source = - g_timeout_add_full (G_PRIORITY_HIGH, - 500, - (GSourceFunc) e_mail_tab_alert_cb, - tab, - NULL); + EMailTabPrivate *priv = tab->priv; + + priv->alert_count = 0; + if (!priv->alert_source) + priv->alert_source = + g_timeout_add_full (G_PRIORITY_HIGH, + 500, + (GSourceFunc) e_mail_tab_alert_cb, + tab, + NULL); } void -e_mail_tab_enable_drag (EMailTab *tab, gboolean enable) +e_mail_tab_enable_drag (EMailTab *tab, + gboolean enable) { - EMailTabPrivate *priv = tab->priv; + EMailTabPrivate *priv = tab->priv; - if (priv->drag_enabled == enable) - return; + if (priv->drag_enabled == enable) + return; - priv->drag_enabled = enable; - if (enable) - mx_draggable_enable (MX_DRAGGABLE (tab)); - else - mx_draggable_disable (MX_DRAGGABLE (tab)); + priv->drag_enabled = enable; + if (enable) + mx_draggable_enable (MX_DRAGGABLE (tab)); + else + mx_draggable_disable (MX_DRAGGABLE (tab)); } diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 93e61a2d9f..b9589d51c3 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -23,16 +23,15 @@ */ /* - work before merge can occur: - - verify behaviour. - work out what to do with the startup assistant. - - also need to work out: - how to remove unecessary items from a service url once - configured (removing settings from other types). - -*/ + * work before merge can occur: + * + * verify behaviour. + * work out what to do with the startup assistant. + * + * also need to work out: + * how to remove unecessary items from a service url once + * configured (removing settings from other types). + */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -105,7 +104,7 @@ struct _receive_options_item { EMConfigItem item; /* Only CAMEL_PROVIDER_CONF_ENTRYs GtkEntrys are stored here. - The auto-detect camel provider code will probably be removed */ + * The auto-detect camel provider code will probably be removed */ GHashTable *extra_table; }; @@ -216,10 +215,10 @@ struct _EMAccountEditorPrivate { GHashTable *widgets; /* for assistant page preparation */ - guint identity_set:1; - guint receive_set:1; - guint send_set:1; - guint management_set:1; + guint identity_set : 1; + guint receive_set : 1; + guint send_set : 1; + guint management_set : 1; ServerData *selected_server; }; @@ -586,7 +585,7 @@ static gboolean is_email (const gchar *address) { /* This is supposed to check if the address's domain could be - an FQDN but alas, it's not worth the pain and suffering. */ + * an FQDN but alas, it's not worth the pain and suffering. */ const gchar *at; at = strchr (address, '@'); @@ -598,7 +597,8 @@ is_email (const gchar *address) } static CamelURL * -emae_account_url (EMAccountEditor *emae, gint urlid) +emae_account_url (EMAccountEditor *emae, + gint urlid) { EAccount *account; CamelURL *url = NULL; @@ -621,7 +621,8 @@ emae_account_url (EMAccountEditor *emae, gint urlid) /* ********************************************************************** */ static void -default_folders_clicked (GtkButton *button, gpointer user_data) +default_folders_clicked (GtkButton *button, + gpointer user_data) { EMAccountEditor *emae = user_data; const gchar *uri; @@ -639,10 +640,12 @@ default_folders_clicked (GtkButton *button, gpointer user_data) } /* The camel provider auto-detect interface should be deprecated. - But it still needs to be replaced with something of similar functionality. - Just using the normal econfig plugin mechanism should be adequate. */ + * But it still needs to be replaced with something of similar functionality. + * Just using the normal econfig plugin mechanism should be adequate. */ static void -emae_auto_detect_free (gpointer key, gpointer value, gpointer user_data) +emae_auto_detect_free (gpointer key, + gpointer value, + gpointer user_data) { g_free (key); g_free (value); @@ -686,7 +689,7 @@ emae_auto_detect (EMAccountEditor *emae) g_return_if_fail (entries[i].type == CAMEL_PROVIDER_CONF_ENTRY); w = NULL; - for (l = emae->priv->extra_items;l;l=g_slist_next (l)) { + for (l = emae->priv->extra_items; l; l = g_slist_next (l)) { item = l->data; if (item->extra_table && (w = g_hash_table_lookup (item->extra_table, entries[i].name))) break; @@ -700,7 +703,8 @@ emae_auto_detect (EMAccountEditor *emae) } static gint -provider_compare (const CamelProvider *p1, const CamelProvider *p2) +provider_compare (const CamelProvider *p1, + const CamelProvider *p2) { /* sort providers based on "location" (ie. local or remote) */ if (p1->flags & CAMEL_PROVIDER_IS_REMOTE) { @@ -715,7 +719,9 @@ provider_compare (const CamelProvider *p1, const CamelProvider *p2) } static void -emae_signature_added (ESignatureList *signatures, ESignature *sig, EMAccountEditor *emae) +emae_signature_added (ESignatureList *signatures, + ESignature *sig, + EMAccountEditor *emae) { GtkTreeModel *model; GtkTreeIter iter; @@ -730,11 +736,16 @@ emae_signature_added (ESignatureList *signatures, ESignature *sig, EMAccountEdit gtk_list_store_append ((GtkListStore *) model, &iter); gtk_list_store_set ((GtkListStore *) model, &iter, 0, name, 1, uid, -1); - gtk_combo_box_set_active (emae->priv->signatures_dropdown, gtk_tree_model_iter_n_children (model, NULL)-1); + gtk_combo_box_set_active ( + emae->priv->signatures_dropdown, + gtk_tree_model_iter_n_children (model, NULL) - 1); } static gint -emae_signature_get_iter (EMAccountEditor *emae, ESignature *sig, GtkTreeModel **modelp, GtkTreeIter *iter) +emae_signature_get_iter (EMAccountEditor *emae, + ESignature *sig, + GtkTreeModel **modelp, + GtkTreeIter *iter) { GtkTreeModel *model; gint found = 0; @@ -760,7 +771,9 @@ emae_signature_get_iter (EMAccountEditor *emae, ESignature *sig, GtkTreeModel ** } static void -emae_signature_removed (ESignatureList *signatures, ESignature *sig, EMAccountEditor *emae) +emae_signature_removed (ESignatureList *signatures, + ESignature *sig, + EMAccountEditor *emae) { GtkTreeIter iter; GtkTreeModel *model; @@ -770,7 +783,9 @@ emae_signature_removed (ESignatureList *signatures, ESignature *sig, EMAccountEd } static void -emae_signature_changed (ESignatureList *signatures, ESignature *sig, EMAccountEditor *emae) +emae_signature_changed (ESignatureList *signatures, + ESignature *sig, + EMAccountEditor *emae) { GtkTreeIter iter; GtkTreeModel *model; @@ -783,7 +798,8 @@ emae_signature_changed (ESignatureList *signatures, ESignature *sig, EMAccountEd } static void -emae_signaturetype_changed (GtkComboBox *dropdown, EMAccountEditor *emae) +emae_signaturetype_changed (GtkComboBox *dropdown, + EMAccountEditor *emae) { EAccount *account; gint id = gtk_combo_box_get_active (dropdown); @@ -804,7 +820,8 @@ emae_signaturetype_changed (GtkComboBox *dropdown, EMAccountEditor *emae) } static void -emae_signature_new (GtkWidget *widget, EMAccountEditor *emae) +emae_signature_new (GtkWidget *widget, + EMAccountEditor *emae) { GtkWidget *editor; gpointer parent; @@ -818,14 +835,15 @@ emae_signature_new (GtkWidget *widget, EMAccountEditor *emae) } static GtkWidget * -emae_setup_signatures (EMAccountEditor *emae, GtkBuilder *builder) +emae_setup_signatures (EMAccountEditor *emae, + GtkBuilder *builder) { EMAccountEditorPrivate *p = emae->priv; EAccount *account; GtkComboBox *dropdown = (GtkComboBox *)e_builder_get_widget (builder, "signature_dropdown"); GtkCellRenderer *cell = gtk_cell_renderer_text_new (); GtkListStore *store; - gint i, active=0; + gint i, active = 0; GtkTreeIter iter; ESignatureList *signatures; EIterator *it; @@ -890,7 +908,8 @@ emae_setup_signatures (EMAccountEditor *emae, GtkBuilder *builder) } static void -emae_receipt_policy_changed (GtkComboBox *dropdown, EMAccountEditor *emae) +emae_receipt_policy_changed (GtkComboBox *dropdown, + EMAccountEditor *emae) { EAccount *account; gint id = gtk_combo_box_get_active (dropdown); @@ -910,7 +929,8 @@ emae_receipt_policy_changed (GtkComboBox *dropdown, EMAccountEditor *emae) } static GtkWidget * -emae_setup_receipt_policy (EMAccountEditor *emae, GtkBuilder *builder) +emae_setup_receipt_policy (EMAccountEditor *emae, + GtkBuilder *builder) { EAccount *account; GtkComboBox *dropdown = (GtkComboBox *)e_builder_get_widget (builder, "receipt_policy_dropdown"); @@ -960,7 +980,8 @@ emae_setup_receipt_policy (EMAccountEditor *emae, GtkBuilder *builder) } static void -emae_account_entry_changed (GtkEntry *entry, EMAccountEditor *emae) +emae_account_entry_changed (GtkEntry *entry, + EMAccountEditor *emae) { EAccount *account; gchar *text; @@ -978,7 +999,10 @@ emae_account_entry_changed (GtkEntry *entry, EMAccountEditor *emae) } static GtkEntry * -emae_account_entry (EMAccountEditor *emae, const gchar *name, gint item, GtkBuilder *builder) +emae_account_entry (EMAccountEditor *emae, + const gchar *name, + gint item, + GtkBuilder *builder) { EAccount *account; GtkEntry *entry; @@ -997,7 +1021,8 @@ emae_account_entry (EMAccountEditor *emae, const gchar *name, gint item, GtkBuil } static void -emae_account_toggle_changed (GtkToggleButton *toggle, EMAccountEditor *emae) +emae_account_toggle_changed (GtkToggleButton *toggle, + EMAccountEditor *emae) { EAccount *account; gboolean active; @@ -1011,7 +1036,9 @@ emae_account_toggle_changed (GtkToggleButton *toggle, EMAccountEditor *emae) } static void -emae_account_toggle_widget (EMAccountEditor *emae, GtkToggleButton *toggle, gint item) +emae_account_toggle_widget (EMAccountEditor *emae, + GtkToggleButton *toggle, + gint item) { EAccount *account; gboolean active; @@ -1035,7 +1062,10 @@ emae_account_toggle_widget (EMAccountEditor *emae, GtkToggleButton *toggle, gint } static GtkToggleButton * -emae_account_toggle (EMAccountEditor *emae, const gchar *name, gint item, GtkBuilder *builder) +emae_account_toggle (EMAccountEditor *emae, + const gchar *name, + gint item, + GtkBuilder *builder) { GtkToggleButton *toggle; @@ -1046,7 +1076,8 @@ emae_account_toggle (EMAccountEditor *emae, const gchar *name, gint item, GtkBui } static void -emae_account_spinint_changed (GtkSpinButton *spin, EMAccountEditor *emae) +emae_account_spinint_changed (GtkSpinButton *spin, + EMAccountEditor *emae) { EAccount *account; gpointer data; @@ -1060,7 +1091,9 @@ emae_account_spinint_changed (GtkSpinButton *spin, EMAccountEditor *emae) } static void -emae_account_spinint_widget (EMAccountEditor *emae, GtkSpinButton *spin, gint item) +emae_account_spinint_widget (EMAccountEditor *emae, + GtkSpinButton *spin, + gint item) { EAccount *account; gboolean writable; @@ -1083,21 +1116,9 @@ emae_account_spinint_widget (EMAccountEditor *emae, GtkSpinButton *spin, gint it G_CALLBACK (emae_account_spinint_changed), emae); } -#if 0 -static GtkSpinButton * -emae_account_spinint (EMAccountEditor *emae, const gchar *name, gint item) -{ - GtkSpinButton *spin; - - spin = (GtkSpinButton *) e_builder_get_widget (emae->priv->xml, name); - emae_account_spinint_widget (emae, spin, item); - - return spin; -} -#endif - static void -emae_account_folder_changed (EMFolderSelectionButton *folder, EMAccountEditor *emae) +emae_account_folder_changed (EMFolderSelectionButton *folder, + EMAccountEditor *emae) { EAccount *account; gpointer data; @@ -1111,7 +1132,11 @@ emae_account_folder_changed (EMFolderSelectionButton *folder, EMAccountEditor *e } static EMFolderSelectionButton * -emae_account_folder (EMAccountEditor *emae, const gchar *name, gint item, gint deffolder, GtkBuilder *builder) +emae_account_folder (EMAccountEditor *emae, + const gchar *name, + gint item, + gint deffolder, + GtkBuilder *builder) { EAccount *account; EMFolderSelectionButton *folder; @@ -1168,7 +1193,9 @@ smime_changed (EMAccountEditor *emae) } static void -smime_sign_key_selected (GtkWidget *dialog, const gchar *key, EMAccountEditor *emae) +smime_sign_key_selected (GtkWidget *dialog, + const gchar *key, + EMAccountEditor *emae) { EMAccountEditorPrivate *priv = emae->priv; @@ -1181,7 +1208,8 @@ smime_sign_key_selected (GtkWidget *dialog, const gchar *key, EMAccountEditor *e } static void -smime_sign_key_select (GtkWidget *button, EMAccountEditor *emae) +smime_sign_key_select (GtkWidget *button, + EMAccountEditor *emae) { EMAccountEditorPrivate *priv = emae->priv; GtkWidget *w; @@ -1194,7 +1222,8 @@ smime_sign_key_select (GtkWidget *button, EMAccountEditor *emae) } static void -smime_sign_key_clear (GtkWidget *w, EMAccountEditor *emae) +smime_sign_key_clear (GtkWidget *w, + EMAccountEditor *emae) { EMAccountEditorPrivate *priv = emae->priv; @@ -1203,7 +1232,9 @@ smime_sign_key_clear (GtkWidget *w, EMAccountEditor *emae) } static void -smime_encrypt_key_selected (GtkWidget *dialog, const gchar *key, EMAccountEditor *emae) +smime_encrypt_key_selected (GtkWidget *dialog, + const gchar *key, + EMAccountEditor *emae) { EMAccountEditorPrivate *priv = emae->priv; @@ -1216,7 +1247,8 @@ smime_encrypt_key_selected (GtkWidget *dialog, const gchar *key, EMAccountEditor } static void -smime_encrypt_key_select (GtkWidget *button, EMAccountEditor *emae) +smime_encrypt_key_select (GtkWidget *button, + EMAccountEditor *emae) { EMAccountEditorPrivate *priv = emae->priv; GtkWidget *w; @@ -1229,7 +1261,8 @@ smime_encrypt_key_select (GtkWidget *button, EMAccountEditor *emae) } static void -smime_encrypt_key_clear (GtkWidget *w, EMAccountEditor *emae) +smime_encrypt_key_clear (GtkWidget *w, + EMAccountEditor *emae) { EMAccountEditorPrivate *priv = emae->priv; @@ -1239,7 +1272,8 @@ smime_encrypt_key_clear (GtkWidget *w, EMAccountEditor *emae) #endif static void -emae_url_set_host (CamelURL *url, const gchar *txt) +emae_url_set_host (CamelURL *url, + const gchar *txt) { gchar *host; @@ -1252,15 +1286,16 @@ emae_url_set_host (CamelURL *url, const gchar *txt) } static void -emae_url_set_port (CamelURL *url, const gchar *port) +emae_url_set_port (CamelURL *url, + const gchar *port) { if (port && *port) camel_url_set_port (url, atoi (port)); } /* This is used to map a funciton which will set on the url a string value. - if widgets[0] is set, it is the entry which will be called against setval () - We need our own function for host:port decoding, as above */ + * if widgets[0] is set, it is the entry which will be called against setval () + * We need our own function for host:port decoding, as above */ struct _provider_host_info { guint32 flag; void (*setval)(CamelURL *, const gchar *); @@ -1393,7 +1428,8 @@ static struct _service_info { }; static void -emae_uri_changed (EMAccountEditorService *service, CamelURL *url) +emae_uri_changed (EMAccountEditorService *service, + CamelURL *url) { EAccount *account; gchar *uri; @@ -1413,7 +1449,9 @@ emae_uri_changed (EMAccountEditorService *service, CamelURL *url) } static void -emae_service_url_changed (EMAccountEditorService *service, void (*setval)(CamelURL *, const gchar *), GtkWidget *entry) +emae_service_url_changed (EMAccountEditorService *service, + void (*setval)(CamelURL *, const gchar *), + GtkWidget *entry) { GtkComboBox *dropdown; gint id; @@ -1433,7 +1471,7 @@ emae_service_url_changed (EMAccountEditorService *service, void (*setval)(CamelU g_strstrip (text); - setval (url, (text && text[0])?text:NULL); + setval (url, (text && text[0]) ? text : NULL); if (text && text[0] && setval == camel_url_set_user) { dropdown = service->authtype; @@ -1456,7 +1494,9 @@ emae_service_url_changed (EMAccountEditorService *service, void (*setval)(CamelU } static void -emae_service_url_path_changed (EMAccountEditorService *service, void (*setval)(CamelURL *, const gchar *), GtkWidget *widget) +emae_service_url_path_changed (EMAccountEditorService *service, + void (*setval)(CamelURL *, const gchar *), + GtkWidget *widget) { GtkComboBox *dropdown; gint id; @@ -1467,7 +1507,7 @@ emae_service_url_path_changed (EMAccountEditorService *service, void (*setval)(C CamelURL *url = emae_account_url (service->emae, emae_service_info[service->type].account_uri_key); const gchar *text = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget)); - setval (url, (text && text[0])?text:NULL); + setval (url, (text && text[0]) ? text : NULL); if (text && text[0] && setval == camel_url_set_user) { dropdown = service->authtype; @@ -1489,25 +1529,29 @@ emae_service_url_path_changed (EMAccountEditorService *service, void (*setval)(C } static void -emae_hostname_changed (GtkEntry *entry, EMAccountEditorService *service) +emae_hostname_changed (GtkEntry *entry, + EMAccountEditorService *service) { emae_service_url_changed (service, emae_url_set_host, GTK_WIDGET (entry)); } static void -emae_port_changed (EPortEntry *pentry, EMAccountEditorService *service) +emae_port_changed (EPortEntry *pentry, + EMAccountEditorService *service) { emae_service_url_changed (service, emae_url_set_port, GTK_WIDGET (pentry)); } static void -emae_username_changed (GtkEntry *entry, EMAccountEditorService *service) +emae_username_changed (GtkEntry *entry, + EMAccountEditorService *service) { emae_service_url_changed (service, camel_url_set_user, GTK_WIDGET (entry)); } static void -emae_path_changed (GtkWidget *widget, EMAccountEditorService *service) +emae_path_changed (GtkWidget *widget, + EMAccountEditorService *service) { emae_service_url_path_changed (service, camel_url_set_path, widget); } @@ -1587,7 +1631,8 @@ emae_setup_settings (EMAccountEditorService *service) config = E_CONFIG (service->emae->priv->config); target = (EMConfigTargetAccount *) config->target; - em_config_target_new_account_update_settings (config, target, service->emae->priv->source.settings); + em_config_target_new_account_update_settings ( + config, target, service->emae->priv->source.settings); } static void @@ -1624,16 +1669,16 @@ emae_service_provider_changed (EMAccountEditorService *service) if (service->port && service->provider->port_entries) e_port_entry_set_camel_entries (service->port, service->provider->port_entries); - for (i=0;emae_service_info[service->type].host_info[i].flag;i++) { + for (i = 0; emae_service_info[service->type].host_info[i].flag; i++) { GtkWidget *w; gint hide; struct _provider_host_info *info = &emae_service_info[service->type].host_info[i]; enable = CAMEL_PROVIDER_ALLOWS (service->provider, info->flag); hide = CAMEL_PROVIDER_HIDDEN (service->provider, info->flag); - show = (enable && !hide)?gtk_widget_show:gtk_widget_hide; + show = (enable && !hide) ? gtk_widget_show : gtk_widget_hide; - for (j=0; j < G_N_ELEMENTS (info->widgets); j++) { + for (j = 0; j < G_N_ELEMENTS (info->widgets); j++) { if (info->widgets[j] && (w = G_STRUCT_MEMBER (GtkWidget *, service, info->widgets[j]))) { show (w); if (j == 0) { @@ -1642,10 +1687,10 @@ emae_service_provider_changed (EMAccountEditorService *service) if (info->setval && !hide) { if (GTK_IS_ENTRY (w)) - info->setval (url, enable?gtk_entry_get_text ((GtkEntry *) w):NULL); + info->setval (url, enable ? gtk_entry_get_text ((GtkEntry *) w) : NULL); else if (E_IS_PORT_ENTRY (w)) info->setval (url, enable?g_strdup_printf("%i", - e_port_entry_get_port (E_PORT_ENTRY (w))):NULL); + e_port_entry_get_port (E_PORT_ENTRY (w))) : NULL); } } } @@ -1661,7 +1706,7 @@ emae_service_provider_changed (EMAccountEditorService *service) /* try to keep the authmech from the current url, or clear it */ if (url->authmech) { if (service->provider->authtypes) { - for (ll = service->provider->authtypes;ll;ll = g_list_next (ll)) + for (ll = service->provider->authtypes; ll; ll = g_list_next (ll)) if (!strcmp (url->authmech, ((CamelServiceAuthType *) ll->data)->authproto)) break; if (ll == NULL) @@ -1695,8 +1740,8 @@ emae_service_provider_changed (EMAccountEditorService *service) #endif /* This must be done AFTER use_ssl is set; changing use_ssl overwrites - the old port, which could be SSL port, but also could be some special - port and we would otherwise lost it */ + * the old port, which could be SSL port, but also could be some special + * port and we would otherwise lost it */ if (url->port && service->provider->port_entries) e_port_entry_set_port (service->port, old_port); @@ -1716,7 +1761,8 @@ emae_service_provider_changed (EMAccountEditorService *service) } static void -emae_provider_changed (GtkComboBox *dropdown, EMAccountEditorService *service) +emae_provider_changed (GtkComboBox *dropdown, + EMAccountEditorService *service) { gint id = gtk_combo_box_get_active (dropdown); GtkTreeModel *model; @@ -1740,7 +1786,8 @@ emae_provider_changed (GtkComboBox *dropdown, EMAccountEditorService *service) } static void -emae_refresh_providers (EMAccountEditor *emae, EMAccountEditorService *service) +emae_refresh_providers (EMAccountEditor *emae, + EMAccountEditorService *service) { EAccount *account; GtkListStore *store; @@ -1765,8 +1812,8 @@ emae_refresh_providers (EMAccountEditor *emae, EMAccountEditorService *service) gint len; if (colon) { - len = colon-uri; - current = g_alloca (len+1); + len = colon - uri; + current = g_alloca (len + 1); memcpy (current, uri, len); current[len] = 0; } @@ -1787,7 +1834,7 @@ emae_refresh_providers (EMAccountEditor *emae, EMAccountEditorService *service) i++; } - for (l=emae->priv->providers; l; l=l->next) { + for (l = emae->priv->providers; l; l = l->next) { CamelProvider *provider = l->data; if (!((strcmp (provider->domain, "mail") == 0 @@ -1841,7 +1888,8 @@ emae_refresh_providers (EMAccountEditor *emae, EMAccountEditorService *service) } static void -emae_authtype_changed (GtkComboBox *dropdown, EMAccountEditorService *service) +emae_authtype_changed (GtkComboBox *dropdown, + EMAccountEditorService *service) { EAccount *account; gint id = gtk_combo_box_get_active (dropdown); @@ -1879,7 +1927,8 @@ emae_authtype_changed (GtkComboBox *dropdown, EMAccountEditorService *service) } static void -emae_needs_auth (GtkToggleButton *toggle, EMAccountEditorService *service) +emae_needs_auth (GtkToggleButton *toggle, + EMAccountEditorService *service) { gint need = gtk_toggle_button_get_active (toggle); @@ -1899,7 +1948,8 @@ emae_needs_auth (GtkToggleButton *toggle, EMAccountEditorService *service) static void emae_check_authtype (GtkWidget *w, EMAccountEditorService *service); static void -emae_refresh_authtype (EMAccountEditor *emae, EMAccountEditorService *service) +emae_refresh_authtype (EMAccountEditor *emae, + EMAccountEditorService *service) { EAccount *account; GtkListStore *store; @@ -1924,13 +1974,13 @@ emae_refresh_authtype (EMAccountEditor *emae, EMAccountEditorService *service) url = camel_url_new (uri, NULL); if (service->provider) { - for (i=0, l=service->provider->authtypes; l; l=l->next, i++) { + for (i = 0, l = service->provider->authtypes; l; l = l->next, i++) { CamelServiceAuthType *authtype = l->data; gint avail; /* if we have some already shown */ if (service->auth_types) { - for (ll = service->auth_types;ll;ll = g_list_next (ll)) + for (ll = service->auth_types; ll; ll = g_list_next (ll)) if (!strcmp (authtype->authproto, ((CamelServiceAuthType *) ll->data)->authproto)) break; avail = ll != NULL; @@ -2046,7 +2096,9 @@ emae_check_authtype (GtkWidget *w, session = e_mail_backend_get_session (backend); uid = g_strdup_printf ("emae-check-authtype-%p", service); - url = camel_url_new (e_account_get_string (account, emae_service_info[service->type].account_uri_key), NULL); + url_string = (gchar *) e_account_get_string ( + account, emae_service_info[service->type].account_uri_key); + url = camel_url_new (url_string, NULL); if (service->settings) camel_settings_save_to_url (service->settings, url); url_string = camel_url_to_string (url, 0); @@ -2196,7 +2248,7 @@ emae_setup_service (EMAccountEditor *emae, emae_refresh_authtype (emae, service); /* Set the port after SSL is set, because it would overwrite the - port value (through emae_ssl_changed signal) */ + * port value (through emae_ssl_changed signal) */ if (url->port && service->provider->port_entries) { e_port_entry_set_port (service->port, url->port); } @@ -2287,7 +2339,10 @@ static struct { }; static void -emae_queue_widgets (EMAccountEditor *emae, GtkBuilder *builder, const gchar *first, ...) +emae_queue_widgets (EMAccountEditor *emae, + GtkBuilder *builder, + const gchar *first, + ...) { va_list ap; @@ -2328,7 +2383,7 @@ emae_identity_page (EConfig *ec, e_load_ui_builder_definition (builder, "mail-config.ui"); /* Management & Identity fields, in the assistant the management frame is relocated to the last page later on */ - for (i=0;i<G_N_ELEMENTS (emae_identity_entries);i++) + for (i = 0; i < G_N_ELEMENTS (emae_identity_entries); i++) priv->identity_entries[i] = emae_account_entry (emae, emae_identity_entries[i].name, emae_identity_entries[i].item, builder); priv->management_frame = e_builder_get_widget (builder, "management-section"); @@ -2799,7 +2854,7 @@ emae_receive_options_item (EConfig *ec, gtk_widget_show_all (box); - gtk_table_attach ((GtkTable *) parent, box, 0, 2, row, row+1, GTK_EXPAND|GTK_FILL, 0, 0, 0); + gtk_table_attach ((GtkTable *) parent, box, 0, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); return box; } @@ -2867,7 +2922,7 @@ section: table = GTK_TABLE (parent); g_object_get (table, "n-rows", &row, NULL); - for (;entries[ii].type != CAMEL_PROVIDER_CONF_END && entries[ii].type != CAMEL_PROVIDER_CONF_SECTION_END; ii++) { + for (; entries[ii].type != CAMEL_PROVIDER_CONF_END && entries[ii].type != CAMEL_PROVIDER_CONF_SECTION_END; ii++) { switch (entries[ii].type) { case CAMEL_PROVIDER_CONF_SECTION_START: case CAMEL_PROVIDER_CONF_SECTION_END: @@ -2996,7 +3051,7 @@ emae_send_page (EConfig *ec, /* no transport options page at all for these types of providers */ if (priv->source.provider && CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (priv->source.provider)) { - memset (&priv->transport.frame, 0, ((gchar *)&priv->transport.check_dialog)-((gchar *)&priv->transport.frame)); + memset (&priv->transport.frame, 0, ((gchar *) &priv->transport.check_dialog) - ((gchar *) &priv->transport.frame)); return NULL; } @@ -3052,7 +3107,10 @@ emae_real_url_toggled (GtkToggleButton *check, } static void -set_real_folder_path (GtkButton *folder_button, CamelSettings *settings, const gchar *settings_prop, EAccount *account) +set_real_folder_path (GtkButton *folder_button, + CamelSettings *settings, + const gchar *settings_prop, + EAccount *account) { gchar *path = NULL, *uri; gchar *encoded_name; @@ -3092,7 +3150,9 @@ set_real_folder_path (GtkButton *folder_button, CamelSettings *settings, const g } static void -update_real_folder_cb (GtkButton *folder_button, GParamSpec *par_spec, EMAccountEditor *emae) +update_real_folder_cb (GtkButton *folder_button, + GParamSpec *par_spec, + EMAccountEditor *emae) { EMFolderSelectionButton *sel_button; CamelSettings *settings; @@ -3333,7 +3393,8 @@ emae_defaults_page (EConfig *ec, } static void -emae_account_hash_algo_combo_changed_cb (GtkComboBox *combobox, EMAccountEditor *emae) +emae_account_hash_algo_combo_changed_cb (GtkComboBox *combobox, + EMAccountEditor *emae) { EAccount *account; gpointer data; @@ -3359,7 +3420,10 @@ emae_account_hash_algo_combo_changed_cb (GtkComboBox *combobox, EMAccountEditor } static GtkComboBox * -emae_account_hash_algo_combo (EMAccountEditor *emae, const gchar *name, gint item, GtkBuilder *builder) +emae_account_hash_algo_combo (EMAccountEditor *emae, + const gchar *name, + gint item, + GtkBuilder *builder) { EAccount *account; GtkComboBox *combobox; @@ -3468,7 +3532,8 @@ emae_security_page (EConfig *ec, * Allow some level of post creation customisation in plugins. */ GtkWidget * -em_account_editor_get_widget (EMAccountEditor *emae, const gchar *name) +em_account_editor_get_widget (EMAccountEditor *emae, + const gchar *name) { GtkWidget *wid; @@ -3612,17 +3677,21 @@ static EMConfigItem emae_assistant_items[] = { static gboolean emae_assistant_items_translated = FALSE; static void -emae_free (EConfig *ec, GSList *items, gpointer data) +emae_free (EConfig *ec, + GSList *items, + gpointer data) { g_slist_free (items); } static void -emae_free_auto (EConfig *ec, GSList *items, gpointer data) +emae_free_auto (EConfig *ec, + GSList *items, + gpointer data) { GSList *l, *n; - for (l=items;l;) { + for (l = items; l;) { struct _receive_options_item *item = l->data; n = g_slist_next (l); @@ -3636,7 +3705,8 @@ emae_free_auto (EConfig *ec, GSList *items, gpointer data) } static gboolean -emae_service_complete (EMAccountEditor *emae, EMAccountEditorService *service) +emae_service_complete (EMAccountEditor *emae, + EMAccountEditorService *service) { EAccount *account; CamelURL *url; @@ -3683,7 +3753,7 @@ emae_check_servers (const gchar *email) server++; - for (i=0; i<len; i++) { + for (i = 0; i < len; i++) { if (strstr (server, mail_servers[i].key) != NULL) return &mail_servers[i]; } @@ -3692,7 +3762,8 @@ emae_check_servers (const gchar *email) } static void -emae_check_set_authtype (GtkComboBox *dropdown, const gchar *auth) +emae_check_set_authtype (GtkComboBox *dropdown, + const gchar *auth) { GtkTreeModel *model; GtkTreeIter iter; @@ -3715,7 +3786,9 @@ emae_check_set_authtype (GtkComboBox *dropdown, const gchar *auth) } static gboolean -emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) +emae_check_complete (EConfig *ec, + const gchar *pageid, + gpointer data) { EMAccountEditor *emae = data; EAccount *account; @@ -3731,7 +3804,7 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) new_account = (original_account == NULL); /* We use the page-check of various pages to 'prepare' or - pre-load their values, only in the assistant */ + * pre-load their values, only in the assistant */ if (pageid && ((EConfig *) emae->priv->config)->type == E_CONFIG_ASSISTANT) { if (!strcmp (pageid, "00.identity")) { @@ -3759,9 +3832,9 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) emae->priv->receive_set = 1; tmp = (gchar *) e_account_get_string (account, E_ACCOUNT_ID_ADDRESS); at = strchr (tmp, '@'); - user = g_alloca (at-tmp+1); - memcpy (user, tmp, at-tmp); - user[at-tmp] = 0; + user = g_alloca (at - tmp + 1); + memcpy (user, tmp, at - tmp); + user[at - tmp] = 0; at++; sdata = emae->priv->selected_server = emae->emae_check_servers (tmp); @@ -3812,9 +3885,9 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) emae->priv->send_set = 1; tmp = e_account_get_string (account, E_ACCOUNT_ID_ADDRESS); at = strchr (tmp, '@'); - user = g_alloca (at-tmp+1); - memcpy (user, tmp, at-tmp); - user[at-tmp] = 0; + user = g_alloca (at - tmp + 1); + memcpy (user, tmp, at - tmp); + user[at - tmp] = 0; at++; sdata = emae->priv->selected_server; @@ -3879,9 +3952,9 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) } /* - Setting a flag on the Account if it is marked as default. It is done in this way instead of - using a temporary variable so as to keep track of which account is marked as default in case of - editing multiple accounts at a time + * Setting a flag on the Account if it is marked as default. It is done in this way instead of + * using a temporary variable so as to keep track of which account is marked as default in case of + * editing multiple accounts at a time */ if (gtk_toggle_button_get_active (emae->priv->default_account)) g_object_set_data (G_OBJECT (account), "default_flagged", GINT_TO_POINTER(1)); @@ -3936,13 +4009,17 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data) } gboolean -em_account_editor_check (EMAccountEditor *emae, const gchar *page) +em_account_editor_check (EMAccountEditor *emae, + const gchar *page) { return emae_check_complete ((EConfig *) emae->config, page, emae); } static void -forget_password_if_needed (EAccount *original_account, EAccount *modified_account, e_account_item_t save_pass_itm, e_account_item_t url_itm) +forget_password_if_needed (EAccount *original_account, + EAccount *modified_account, + e_account_item_t save_pass_itm, + e_account_item_t url_itm) { const gchar *orig_url, *modif_url; @@ -4026,7 +4103,7 @@ emae_commit (EConfig *ec, account = modified_account; /* HACK: this will add the account to the folder tree. - We should just be listening to the account list directly for changed events */ + * We should just be listening to the account list directly for changed events */ if (account->enabled && emae->priv->source.provider && (emae->priv->source.provider->flags & CAMEL_PROVIDER_IS_STORAGE)) { @@ -4076,7 +4153,7 @@ em_account_editor_construct (EMAccountEditor *emae, ec = em_config_new (E_CONFIG_BOOK, id); items = emae_editor_items; if (!emae_editor_items_translated) { - for (i=0;items[i].path;i++) { + for (i = 0; items[i].path; i++) { if (items[i].label) items[i].label = gettext (items[i].label); } @@ -4086,7 +4163,7 @@ em_account_editor_construct (EMAccountEditor *emae, ec = em_config_new (E_CONFIG_ASSISTANT, id); items = emae_assistant_items; if (!emae_assistant_items_translated) { - for (i=0;items[i].path;i++) { + for (i = 0; items[i].path; i++) { if (items[i].label) items[i].label = _(items[i].label); } @@ -4101,7 +4178,7 @@ em_account_editor_construct (EMAccountEditor *emae, emae->config = priv->config = ec; l = NULL; - for (i=0;items[i].path;i++) + for (i = 0; items[i].path; i++) l = g_slist_prepend (l, &items[i]); e_config_add_items ((EConfig *) ec, l, emae_free, emae); @@ -4109,10 +4186,10 @@ em_account_editor_construct (EMAccountEditor *emae, l = NULL; have = g_hash_table_new (g_str_hash, g_str_equal); index = 20; - for (prov=priv->providers;prov;prov=g_list_next (prov)) { + for (prov = priv->providers; prov; prov = g_list_next (prov)) { CamelProviderConfEntry *entries = ((CamelProvider *) prov->data)->extra_conf; - for (i=0;entries && entries[i].type != CAMEL_PROVIDER_CONF_END;i++) { + for (i = 0; entries && entries[i].type != CAMEL_PROVIDER_CONF_END; i++) { struct _receive_options_item *item; const gchar *name = entries[i].name; gint myindex = index; diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 12fdd96490..8c98040ada 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -179,10 +179,10 @@ ask_confirm_for_only_bcc (EMsgComposer *composer, gboolean hidden_list_case) { /* If the user is mailing a hidden contact list, it is possible for - them to create a message with only Bcc recipients without really - realizing it. To try to avoid being totally confusing, I've changed - this dialog to provide slightly different text in that case, to - better explain what the hell is going on. */ + * them to create a message with only Bcc recipients without really + * realizing it. To try to avoid being totally confusing, I've changed + * this dialog to provide slightly different text in that case, to + * better explain what the hell is going on. */ return em_utils_prompt_user ( GTK_WINDOW (composer), @@ -1028,7 +1028,9 @@ em_utils_compose_new_message_with_mailto (EShell *shell, } static gboolean -replace_variables (GSList *clues, CamelMimeMessage *message, gchar **pstr) +replace_variables (GSList *clues, + CamelMimeMessage *message, + gchar **pstr) { gint i; gboolean string_changed = FALSE, count1 = FALSE; @@ -1057,7 +1059,7 @@ replace_variables (GSList *clues, CamelMimeMessage *message, gchar **pstr) for (list = clues; list; list = g_slist_next (list)) { gchar **temp = g_strsplit (list->data, "=", 2); - if (!g_ascii_strcasecmp (temp[0], out+1)) { + if (!g_ascii_strcasecmp (temp[0], out + 1)) { g_free (str); str = g_strconcat (temp_str[0], temp[1], temp_str[1], NULL); count1 = TRUE; @@ -1068,7 +1070,7 @@ replace_variables (GSList *clues, CamelMimeMessage *message, gchar **pstr) } if (!count1) { - if (getenv (out+1)) { + if (getenv (out + 1)) { g_free (str); str = g_strconcat ( temp_str[0], @@ -1113,7 +1115,9 @@ replace_variables (GSList *clues, CamelMimeMessage *message, gchar **pstr) } static void -traverse_parts (GSList *clues, CamelMimeMessage *message, CamelDataWrapper *content) +traverse_parts (GSList *clues, + CamelMimeMessage *message, + CamelDataWrapper *content) { g_return_if_fail (message != NULL); @@ -1401,7 +1405,8 @@ em_utils_edit_messages (EMailReader *reader, } static void -emu_update_composers_security (EMsgComposer *composer, guint32 validity_found) +emu_update_composers_security (EMsgComposer *composer, + guint32 validity_found) { GtkToggleAction *action; @@ -1426,7 +1431,8 @@ emu_update_composers_security (EMsgComposer *composer, guint32 validity_found) } static void -real_update_forwarded_flag (gpointer uid, gpointer folder) +real_update_forwarded_flag (gpointer uid, + gpointer folder) { if (uid && folder) camel_folder_set_message_flags ( @@ -1788,8 +1794,8 @@ redirect_get_composer (EShell *shell, medium = CAMEL_MEDIUM (message); /* QMail will refuse to send a message if it finds one of - it's Delivered-To headers in the message, so remove all - Delivered-To headers. Fixes bug #23635. */ + * it's Delivered-To headers in the message, so remove all + * Delivered-To headers. Fixes bug #23635. */ while (camel_medium_get_header (medium, "Delivered-To")) camel_medium_remove_header (medium, "Delivered-To"); @@ -2204,7 +2210,7 @@ reply_get_composer (EShell *shell, store_url = camel_url_to_string ( url, CAMEL_URL_HIDE_ALL); if (store_url[strlen (store_url) - 1] == '/') - store_url[strlen (store_url)-1] = '\0'; + store_url[strlen (store_url) - 1] = '\0'; } post = camel_address_encode ((CamelAddress *) postto); @@ -2245,7 +2251,8 @@ reply_get_composer (EShell *shell, } static gboolean -get_reply_list (CamelMimeMessage *message, CamelInternetAddress *to) +get_reply_list (CamelMimeMessage *message, + CamelInternetAddress *to) { const gchar *header, *p; gchar *addr; @@ -2571,7 +2578,9 @@ typedef void (*AttribFormatter) (GString *str, CamelMimeMessage *message); static void -format_sender (GString *str, const gchar *attr, CamelMimeMessage *message) +format_sender (GString *str, + const gchar *attr, + CamelMimeMessage *message) { CamelInternetAddress *sender; const gchar *name, *addr = NULL; @@ -2821,8 +2830,8 @@ composer_set_body (EMsgComposer *composer, const gchar *key; /* If we are placing signature on top, then move cursor to the end, - otherwise try to find the signature place and place cursor just - before the signature. We added there an empty line already. */ + * otherwise try to find the signature place and place cursor just + * before the signature. We added there an empty line already. */ gtkhtml_editor_run_command (editor, "block-selection"); gtkhtml_editor_run_command (editor, "cursor-bod"); @@ -2844,7 +2853,8 @@ composer_set_body (EMsgComposer *composer, } gchar * -em_utils_construct_composer_text (CamelMimeMessage *message, EMFormat *source) +em_utils_construct_composer_text (CamelMimeMessage *message, + EMFormat *source) { gchar *text, *credits; gboolean start_bottom = 0; @@ -2882,7 +2892,7 @@ em_utils_reply_to_message (EShell *shell, EMailReplyType type, EMailReplyStyle style, EMFormat *source_formatter, - CamelInternetAddress *address) + CamelInternetAddress *address) { CamelInternetAddress *to, *cc; CamelNNTPAddress *postto = NULL; diff --git a/mail/em-config.c b/mail/em-config.c index 464c9d814b..c9bcf0a7a4 100644 --- a/mail/em-config.c +++ b/mail/em-config.c @@ -45,7 +45,9 @@ struct _EMConfigPrivate { }; static void -emp_account_changed (struct _EAccount *ea, gint id, EMConfig *emc) +emp_account_changed (EAccount *ea, + gint id, + EMConfig *emc) { e_config_target_changed ((EConfig *) emc, E_CONFIG_TARGET_CHANGED_STATE); } @@ -86,7 +88,8 @@ em_config_set_target (EConfig *ep, s->modified_account, "changed", G_CALLBACK (emp_account_changed), ep); - em_config_target_new_account_update_settings (ep, s, s->settings); + em_config_target_new_account_update_settings ( + ep, s, s->settings); break; } } } @@ -239,7 +242,9 @@ em_config_target_new_account (EMConfig *emp, } void -em_config_target_new_account_update_settings (EConfig *ep, EMConfigTargetAccount *target, CamelSettings *settings) +em_config_target_new_account_update_settings (EConfig *ep, + EMConfigTargetAccount *target, + CamelSettings *settings) { g_return_if_fail (ep != NULL); g_return_if_fail (target != NULL); @@ -248,7 +253,8 @@ em_config_target_new_account_update_settings (EConfig *ep, EMConfigTargetAccount g_object_ref (settings); if (target->settings != NULL) { - g_signal_handlers_disconnect_by_func (target->settings, G_CALLBACK (emp_account_changed), ep); + g_signal_handlers_disconnect_by_func ( + target->settings, emp_account_changed, ep); g_object_unref (target->settings); } diff --git a/mail/em-event.c b/mail/em-event.c index 3fb3176aab..7a99618727 100644 --- a/mail/em-event.c +++ b/mail/em-event.c @@ -35,7 +35,8 @@ static EMEvent *em_event; G_DEFINE_TYPE (EMEvent, em_event, E_TYPE_EVENT) static void -eme_target_free (EEvent *ep, EEventTarget *t) +eme_target_free (EEvent *ep, + EEventTarget *t) { switch (t->type) { case EM_EVENT_TARGET_FOLDER: { diff --git a/mail/em-filter-editor.c b/mail/em-filter-editor.c index 1efdca622a..b92e202b96 100644 --- a/mail/em-filter-editor.c +++ b/mail/em-filter-editor.c @@ -139,7 +139,8 @@ free_sources (gpointer data) } static void -select_source (GtkComboBox *combobox, EMFilterEditor *fe) +select_source (GtkComboBox *combobox, + EMFilterEditor *fe) { gchar *source; gint idx; diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c index 7fec5abccd..6cd287b0ea 100644 --- a/mail/em-filter-rule.c +++ b/mail/em-filter-rule.c @@ -45,7 +45,7 @@ static GtkWidget *get_widget (EFilterRule *fr, ERuleContext *rc); static void em_filter_rule_class_init (EMFilterRuleClass *klass); static void em_filter_rule_init (EMFilterRule *ff); -static void em_filter_rule_finalise (GObject *obj); +static void em_filter_rule_finalize (GObject *obj); static EFilterRuleClass *parent_class = NULL; @@ -81,7 +81,7 @@ em_filter_rule_class_init (EMFilterRuleClass *klass) parent_class = g_type_class_ref (E_TYPE_FILTER_RULE); - object_class->finalize = em_filter_rule_finalise; + object_class->finalize = em_filter_rule_finalize; /* override methods */ fr_class->validate = validate; @@ -109,7 +109,7 @@ unref_list (GList *l) } static void -em_filter_rule_finalise (GObject *obj) +em_filter_rule_finalize (GObject *obj) { EMFilterRule *ff =(EMFilterRule *) obj; @@ -133,7 +133,8 @@ em_filter_rule_new (void) } void -em_filter_rule_add_action (EMFilterRule *fr, EFilterPart *fp) +em_filter_rule_add_action (EMFilterRule *fr, + EFilterPart *fp) { fr->actions = g_list_append (fr->actions, fp); @@ -141,7 +142,8 @@ em_filter_rule_add_action (EMFilterRule *fr, EFilterPart *fp) } void -em_filter_rule_remove_action (EMFilterRule *fr, EFilterPart *fp) +em_filter_rule_remove_action (EMFilterRule *fr, + EFilterPart *fp) { fr->actions = g_list_remove (fr->actions, fp); @@ -149,7 +151,9 @@ em_filter_rule_remove_action (EMFilterRule *fr, EFilterPart *fp) } void -em_filter_rule_replace_action (EMFilterRule *fr, EFilterPart *fp, EFilterPart *new) +em_filter_rule_replace_action (EMFilterRule *fr, + EFilterPart *fp, + EFilterPart *new) { GList *l; @@ -164,7 +168,8 @@ em_filter_rule_replace_action (EMFilterRule *fr, EFilterPart *fp, EFilterPart *n } void -em_filter_rule_build_action (EMFilterRule *fr, GString *out) +em_filter_rule_build_action (EMFilterRule *fr, + GString *out) { g_string_append(out, "(begin\n"); e_filter_part_build_code_list (fr->actions, out); @@ -172,7 +177,8 @@ em_filter_rule_build_action (EMFilterRule *fr, GString *out) } static gint -validate (EFilterRule *fr, EAlert **alert) +validate (EFilterRule *fr, + EAlert **alert) { EMFilterRule *ff =(EMFilterRule *) fr; GList *parts; @@ -191,7 +197,8 @@ validate (EFilterRule *fr, EAlert **alert) } static gint -list_eq (GList *al, GList *bl) +list_eq (GList *al, + GList *bl) { gint truth = TRUE; @@ -207,7 +214,8 @@ list_eq (GList *al, GList *bl) } static gint -filter_eq (EFilterRule *fr, EFilterRule *cm) +filter_eq (EFilterRule *fr, + EFilterRule *cm) { return E_FILTER_RULE_CLASS (parent_class)->eq (fr, cm) && list_eq (((EMFilterRule *) fr)->actions,((EMFilterRule *) cm)->actions); @@ -236,7 +244,9 @@ xml_encode (EFilterRule *fr) } static void -load_set (xmlNodePtr node, EMFilterRule *ff, ERuleContext *rc) +load_set (xmlNodePtr node, + EMFilterRule *ff, + ERuleContext *rc) { xmlNodePtr work; gchar *rulename; @@ -263,7 +273,9 @@ load_set (xmlNodePtr node, EMFilterRule *ff, ERuleContext *rc) } static gint -xml_decode (EFilterRule *fr, xmlNodePtr node, ERuleContext *rc) +xml_decode (EFilterRule *fr, + xmlNodePtr node, + ERuleContext *rc) { EMFilterRule *ff =(EMFilterRule *) fr; xmlNodePtr work; @@ -285,7 +297,8 @@ xml_decode (EFilterRule *fr, xmlNodePtr node, ERuleContext *rc) } static void -rule_copy (EFilterRule *dest, EFilterRule *src) +rule_copy (EFilterRule *dest, + EFilterRule *src) { EMFilterRule *fdest, *fsrc; GList *node; @@ -324,7 +337,8 @@ struct _part_data { }; static void -part_combobox_changed (GtkComboBox *combobox, struct _part_data *data) +part_combobox_changed (GtkComboBox *combobox, + struct _part_data *data) { EFilterPart *part = NULL; EFilterPart *newpart; @@ -345,7 +359,7 @@ part_combobox_changed (GtkComboBox *combobox, struct _part_data *data) return; /* here we do a widget shuffle, throw away the old widget/rulepart, - and create another */ + * and create another */ if (data->partwidget) gtk_container_remove (GTK_CONTAINER (data->container), data->partwidget); @@ -362,7 +376,9 @@ part_combobox_changed (GtkComboBox *combobox, struct _part_data *data) } static GtkWidget * -get_rule_part_widget (EMFilterContext *f, EFilterPart *newpart, EFilterRule *fr) +get_rule_part_widget (EMFilterContext *f, + EFilterPart *newpart, + EFilterRule *fr) { EFilterPart *part = NULL; GtkWidget *combobox; @@ -416,7 +432,8 @@ struct _rule_data { }; static void -less_parts (GtkWidget *button, struct _rule_data *data) +less_parts (GtkWidget *button, + struct _rule_data *data) { EFilterPart *part; GtkWidget *rule; @@ -444,7 +461,10 @@ less_parts (GtkWidget *button, struct _rule_data *data) } static void -attach_rule (GtkWidget *rule, struct _rule_data *data, EFilterPart *part, gint row) +attach_rule (GtkWidget *rule, + struct _rule_data *data, + EFilterPart *part, + gint row) { GtkWidget *remove; @@ -454,14 +474,15 @@ attach_rule (GtkWidget *rule, struct _rule_data *data, EFilterPart *part, gint r remove = gtk_button_new_from_stock (GTK_STOCK_REMOVE); g_object_set_data((GObject *)remove, "rule", rule); /*gtk_button_set_relief(GTK_BUTTON(remove), GTK_RELIEF_NONE);*/ - g_signal_connect(remove, "clicked", G_CALLBACK(less_parts), data); + g_signal_connect (remove, "clicked", G_CALLBACK(less_parts), data); gtk_table_attach (GTK_TABLE (data->parts), remove, 1, 2, row, row + 1, 0, 0, 0, 0); gtk_widget_show (remove); } static void -do_grab_focus_cb (GtkWidget *widget, gpointer data) +do_grab_focus_cb (GtkWidget *widget, + gpointer data) { gboolean *done = (gboolean *) data; @@ -477,7 +498,8 @@ do_grab_focus_cb (GtkWidget *widget, gpointer data) } static void -more_parts (GtkWidget *button, struct _rule_data *data) +more_parts (GtkWidget *button, + struct _rule_data *data) { EFilterPart *new; @@ -519,7 +541,8 @@ more_parts (GtkWidget *button, struct _rule_data *data) } static GtkWidget * -get_widget (EFilterRule *fr, ERuleContext *rc) +get_widget (EFilterRule *fr, + ERuleContext *rc) { GtkWidget *widget, *hbox, *add, *label; GtkWidget *parts, *inframe, *w; @@ -570,7 +593,7 @@ get_widget (EFilterRule *fr, ERuleContext *rc) gtk_button_set_image ( GTK_BUTTON (add), gtk_image_new_from_stock ( GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON)); - g_signal_connect(add, "clicked", G_CALLBACK(more_parts), data); + g_signal_connect (add, "clicked", G_CALLBACK(more_parts), data); gtk_box_pack_start (GTK_BOX (hbox), add, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (inframe), hbox, FALSE, FALSE, 3); diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c index 059ce867d7..a89abcd036 100644 --- a/mail/em-folder-properties.c +++ b/mail/em-folder-properties.c @@ -71,7 +71,9 @@ async_context_free (AsyncContext *context) } static void -emfp_free (EConfig *ec, GSList *items, gpointer data) +emfp_free (EConfig *ec, + GSList *items, + gpointer data) { g_slist_free (items); } @@ -103,7 +105,7 @@ add_numbered_row (GtkTable *table, gtk_widget_show (label); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); gtk_table_attach ( - table, label, 1, 2, row, row+1, + table, label, 1, 2, row, row + 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); g_free (str); @@ -276,7 +278,7 @@ emfp_dialog_run (AsyncContext *context) g_object_unref (client); /* - Do the calculation only for those accounts that support VTRASHes + * Do the calculation only for those accounts that support VTRASHes */ if (parent_store->flags & CAMEL_STORE_VTRASH) { if (CAMEL_IS_VTRASH_FOLDER (context->folder)) diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c index d8acab7f5f..94f83c2b0e 100644 --- a/mail/em-folder-selector.c +++ b/mail/em-folder-selector.c @@ -212,7 +212,9 @@ em_folder_selector_init (EMFolderSelector *emfs) } static void -emfs_response (GtkWidget *dialog, gint response, EMFolderSelector *emfs) +emfs_response (GtkWidget *dialog, + gint response, + EMFolderSelector *emfs) { EMFolderTree *folder_tree; EMailBackend *backend; @@ -234,7 +236,8 @@ emfs_response (GtkWidget *dialog, gint response, EMFolderSelector *emfs) } static void -emfs_create_name_changed (GtkEntry *entry, EMFolderSelector *emfs) +emfs_create_name_changed (GtkEntry *entry, + EMFolderSelector *emfs) { EMFolderTree *folder_tree; gchar *path; @@ -386,7 +389,8 @@ em_folder_selector_new (GtkWindow *parent, } static void -emfs_create_name_activate (GtkEntry *entry, EMFolderSelector *emfs) +emfs_create_name_activate (GtkEntry *entry, + EMFolderSelector *emfs) { if (gtk_entry_get_text_length (emfs->name_entry) > 0) { EMFolderTree *folder_tree; diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 6c9fc55338..eb26ad5fff 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -856,7 +856,7 @@ folder_subscribed_cb (CamelStore *store, return; /* Get our parent folder's path. */ - dirname = g_alloca (strlen (fi->full_name)+1); + dirname = g_alloca (strlen (fi->full_name) + 1); strcpy (dirname, fi->full_name); p = strrchr (dirname, '/'); if (p == NULL) { diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 85a0acbcb1..061c3540f7 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -689,7 +689,8 @@ exit: } static gboolean -subdirs_contain_unread (GtkTreeModel *model, GtkTreeIter *root) +subdirs_contain_unread (GtkTreeModel *model, + GtkTreeIter *root) { guint unread; GtkTreeIter iter; @@ -2011,9 +2012,9 @@ struct _DragDataReceivedAsync { guint32 action; guint info; - guint move:1; - guint moved:1; - guint aborted:1; + guint move : 1; + guint moved : 1; + guint aborted : 1; }; static void @@ -2318,7 +2319,7 @@ folder_tree_drop_target (EMFolderTree *folder_tree, COL_UINT_FLAGS, &src_flags, -1); /* can't dnd onto itself or below itself - bad things happen, - no point dragging to where we were either */ + * no point dragging to where we were either */ if (gtk_tree_path_compare (path, src_path) == 0 || gtk_tree_path_is_descendant (path, src_path) || (gtk_tree_path_is_ancestor (path, src_path) @@ -2716,10 +2717,10 @@ em_folder_tree_enable_drag_and_drop (EMFolderTree *folder_tree) tree_view = GTK_TREE_VIEW (folder_tree); if (!setup) { - for (i=0; i<NUM_DRAG_TYPES; i++) + for (i = 0; i < NUM_DRAG_TYPES; i++) drag_atoms[i] = gdk_atom_intern (drag_types[i].target, FALSE); - for (i=0; i<NUM_DROP_TYPES; i++) + for (i = 0; i < NUM_DROP_TYPES; i++) drop_atoms[i] = gdk_atom_intern (drop_types[i].target, FALSE); setup = 1; @@ -2759,7 +2760,8 @@ em_folder_tree_enable_drag_and_drop (EMFolderTree *folder_tree) } void -em_folder_tree_set_excluded (EMFolderTree *folder_tree, guint32 flags) +em_folder_tree_set_excluded (EMFolderTree *folder_tree, + guint32 flags) { g_return_if_fail (EM_IS_FOLDER_TREE (folder_tree)); @@ -2798,7 +2800,7 @@ em_folder_tree_get_selected_uris (EMFolderTree *folder_tree) } rows = gtk_tree_selection_get_selected_rows (selection, &model); - for (l=rows; l; l=g_list_next (l)) { + for (l = rows; l; l = g_list_next (l)) { GtkTreeIter iter; GtkTreePath *path = l->data; @@ -2860,7 +2862,7 @@ em_folder_tree_set_selected_list (EMFolderTree *folder_tree, if (!expand_only) folder_tree_clear_selected_list (folder_tree); - for (;list;list = list->next) { + for (; list; list = list->next) { CamelStore *store; struct _selected_uri *u; const gchar *folder_uri; @@ -2911,7 +2913,8 @@ em_folder_tree_set_selected_list (EMFolderTree *folder_tree, #if 0 static void -dump_fi (CamelFolderInfo *fi, gint depth) +dump_fi (CamelFolderInfo *fi, + gint depth) { gint i; @@ -2946,7 +2949,8 @@ em_folder_tree_set_selected (EMFolderTree *folder_tree, } void -em_folder_tree_select_next_path (EMFolderTree *folder_tree, gboolean skip_read_folders) +em_folder_tree_select_next_path (EMFolderTree *folder_tree, + gboolean skip_read_folders) { GtkTreeView *tree_view; GtkTreeSelection *selection; @@ -3212,7 +3216,8 @@ em_folder_tree_get_selected (EMFolderTree *folder_tree, } gboolean -em_folder_tree_store_root_selected (EMFolderTree *folder_tree, CamelStore **out_store) +em_folder_tree_store_root_selected (EMFolderTree *folder_tree, + CamelStore **out_store) { GtkTreeView *tree_view; GtkTreeSelection *selection; @@ -3317,14 +3322,16 @@ em_folder_tree_get_selected_store (EMFolderTree *folder_tree) } void -em_folder_tree_set_skip_double_click (EMFolderTree *folder_tree, gboolean skip) +em_folder_tree_set_skip_double_click (EMFolderTree *folder_tree, + gboolean skip) { folder_tree->priv->skip_double_click = skip; } /* stores come first, then by uri */ static gint -sort_by_store_and_uri (gconstpointer name1, gconstpointer name2) +sort_by_store_and_uri (gconstpointer name1, + gconstpointer name2) { const gchar *n1 = name1, *n2 = name2; gboolean is_store1, is_store2; diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index 346bd978a1..f693212c60 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -108,7 +108,8 @@ struct _EMCopyFolders { }; static gchar * -emft_copy_folders__desc (struct _EMCopyFolders *m, gint complete) +emft_copy_folders__desc (struct _EMCopyFolders *m, + gint complete) { if (m->delete) return g_strdup_printf (_("Moving folder %s"), m->frombase); @@ -132,7 +133,7 @@ emft_copy_folders__exec (struct _EMCopyFolders *m, CAMEL_STORE_FOLDER_INFO_SUBSCRIBED; /* If we're copying, then we need to copy every subfolder. If we're - *moving*, though, then we only need to rename the top-level folder */ + * *moving*, though, then we only need to rename the top-level folder */ if (!m->delete) flags |= CAMEL_STORE_FOLDER_INFO_RECURSIVE; @@ -164,8 +165,8 @@ emft_copy_folders__exec (struct _EMCopyFolders *m, gint deleted = 0; /* We still get immediate children even without the - CAMEL_STORE_FOLDER_INFO_RECURSIVE flag. But we only - want to process the children too if we're *copying* */ + * CAMEL_STORE_FOLDER_INFO_RECURSIVE flag. But we only + * want to process the children too if we're *copying * */ if (info->child && !m->delete) pending = g_list_append (pending, info->child); @@ -260,8 +261,8 @@ emft_copy_folders__exec (struct _EMCopyFolders *m, d(printf ("deleting folder '%s'\n", info->full_name)); /* FIXME: we need to do something with the exception - since otherwise the users sees a failed operation - with no error message or even any warnings */ + * since otherwise the users sees a failed operation + * with no error message or even any warnings */ if (CAMEL_IS_SUBSCRIBABLE (m->fromstore)) camel_subscribable_unsubscribe_folder_sync ( CAMEL_SUBSCRIBABLE (m->fromstore), diff --git a/mail/em-format-hook.c b/mail/em-format-hook.c index f49c370a6e..51608ca07d 100644 --- a/mail/em-format-hook.c +++ b/mail/em-format-hook.c @@ -39,15 +39,14 @@ static GHashTable *emfh_types; /* Mail formatter handler plugin */ /* - <hook class="org.gnome.evolution.mail.format:1.0"> - <group id="EMFormatHTML"> - <item flags="inline,inline_disposition" - mime_type="text/vcard" - format="format_vcard"/> - </group> - </hook> - -*/ + * <hook class="org.gnome.evolution.mail.format:1.0"> + * <group id="EMFormatHTML"> + * <item flags="inline,inline_disposition" + * mime_type="text/vcard" + * format="format_vcard"/> + * </group> + * </hook> + */ static gpointer emfh_parent_class; #define emfh ((EMFormatHook *)eph) @@ -103,7 +102,9 @@ emfh_free_group (struct _EMFormatHookGroup *group) } static struct _EMFormatHookItem * -emfh_construct_item (EPluginHook *eph, EMFormatHookGroup *group, xmlNodePtr root) +emfh_construct_item (EPluginHook *eph, + EMFormatHookGroup *group, + xmlNodePtr root) { struct _EMFormatHookItem *item; @@ -130,7 +131,8 @@ error: } static struct _EMFormatHookGroup * -emfh_construct_group (EPluginHook *eph, xmlNodePtr root) +emfh_construct_group (EPluginHook *eph, + xmlNodePtr root) { struct _EMFormatHookGroup *group; xmlNodePtr node; @@ -161,7 +163,9 @@ error: } static gint -emfh_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) +emfh_construct (EPluginHook *eph, + EPlugin *ep, + xmlNodePtr root) { xmlNodePtr node; @@ -183,7 +187,7 @@ emfh_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) && (klass = g_hash_table_lookup (emfh_types, group->id))) { GSList *l = group->items; - for (;l;l=g_slist_next (l)) { + for (; l; l = g_slist_next (l)) { EMFormatHookItem *item = l->data; /* TODO: only add handlers if enabled? */ /* Well, disabling is handled by the callback, @@ -209,7 +213,8 @@ emfh_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) } static void -emfh_enable (EPluginHook *eph, gint state) +emfh_enable (EPluginHook *eph, + gint state) { GSList *g, *l; EMFormatClass *klass; @@ -218,11 +223,11 @@ emfh_enable (EPluginHook *eph, gint state) if (emfh_types == NULL) return; - for (;g;g=g_slist_next (g)) { + for (; g; g = g_slist_next (g)) { struct _EMFormatHookGroup *group = g->data; klass = g_hash_table_lookup (emfh_types, group->id); - for (l=group->items;l;l=g_slist_next (l)) { + for (l = group->items; l; l = g_slist_next (l)) { EMFormatHookItem *item = l->data; if (state) @@ -234,7 +239,7 @@ emfh_enable (EPluginHook *eph, gint state) } static void -emfh_finalise (GObject *o) +emfh_finalize (GObject *o) { EPluginHook *eph = (EPluginHook *) o; @@ -247,7 +252,7 @@ emfh_finalise (GObject *o) static void emfh_class_init (EPluginHookClass *klass) { - ((GObjectClass *) klass)->finalize = emfh_finalise; + ((GObjectClass *) klass)->finalize = emfh_finalize; klass->construct = emfh_construct; klass->enable = emfh_enable; klass->id = "org.gnome.evolution.mail.format:1.0"; diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 65fa9e522f..dcaafed57d 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -124,7 +124,7 @@ struct _attach_puri { GtkWidget *forward, *down; /* currently no way to correlate this data to the frame :( */ GtkHTML *frame; - guint shown:1; + guint shown : 1; /* Embedded Frame */ GtkHTMLEmbedded *html; @@ -193,7 +193,7 @@ efhd_xpkcs7mime_viewcert_clicked (GtkWidget *button, /* oddly enough certificate_viewer_show doesn't ... */ gtk_widget_show (w); - g_signal_connect(w, "response", G_CALLBACK(gtk_widget_destroy), NULL); + g_signal_connect (w, "response", G_CALLBACK(gtk_widget_destroy), NULL); if (w && po->widget) gtk_window_set_transient_for ((GtkWindow *) w, (GtkWindow *) po->widget); @@ -236,12 +236,12 @@ efhd_xpkcs7mime_add_cert_table (GtkWidget *vbox, w = gtk_label_new (l); gtk_misc_set_alignment ((GtkMisc *) w, 0.0, 0.5); g_free (la); - gtk_table_attach (table, w, 0, 1, n, n+1, GTK_FILL, GTK_FILL, 3, 3); + gtk_table_attach (table, w, 0, 1, n, n + 1, GTK_FILL, GTK_FILL, 3, 3); #if defined (HAVE_NSS) && defined (ENABLE_SMIME) w = gtk_button_new_with_mnemonic(_("_View Certificate")); - gtk_table_attach (table, w, 1, 2, n, n+1, 0, 0, 3, 3); + gtk_table_attach (table, w, 1, 2, n, n + 1, 0, 0, 3, 3); g_object_set_data((GObject *)w, "e-cert-info", info); - g_signal_connect(w, "clicked", G_CALLBACK(efhd_xpkcs7mime_viewcert_clicked), po); + g_signal_connect (w, "clicked", G_CALLBACK(efhd_xpkcs7mime_viewcert_clicked), po); if (info->cert_data) ec = e_cert_new (CERT_DupCertificate (info->cert_data)); @@ -252,7 +252,7 @@ efhd_xpkcs7mime_add_cert_table (GtkWidget *vbox, g_object_unref (ec); #else w = gtk_label_new (_("This certificate is not viewable")); - gtk_table_attach (table, w, 1, 2, n, n+1, 0, 0, 3, 3); + gtk_table_attach (table, w, 1, 2, n, n + 1, 0, 0, 3, 3); #endif n++; } @@ -346,7 +346,7 @@ efhd_xpkcs7mime_validity_clicked (GtkWidget *button, g_object_unref (builder); - g_signal_connect(po->widget, "response", G_CALLBACK(efhd_xpkcs7mime_info_response), po); + g_signal_connect (po->widget, "response", G_CALLBACK(efhd_xpkcs7mime_info_response), po); gtk_widget_show (po->widget); } @@ -386,25 +386,35 @@ efhd_xpkcs7mime_button (EMFormatHTML *efh, } static gboolean -remove_attachment_view_cb (gpointer message_part_id, gpointer attachment_view, gpointer gone_attachment_view) +remove_attachment_view_cb (gpointer message_part_id, + gpointer attachment_view, + gpointer gone_attachment_view) { return attachment_view == gone_attachment_view; } static void -efhd_attachment_view_gone_cb (gpointer efh, GObject *gone_attachment_view) +efhd_attachment_view_gone_cb (gpointer efh, + GObject *gone_attachment_view) { EMFormatHTMLDisplay *efhd = EM_FORMAT_HTML_DISPLAY (efh); g_return_if_fail (efhd != NULL); - g_hash_table_foreach_remove (efhd->priv->attachment_views, remove_attachment_view_cb, gone_attachment_view); + g_hash_table_foreach_remove ( + efhd->priv->attachment_views, + remove_attachment_view_cb, + gone_attachment_view); } static void -weak_unref_attachment_view_cb (gpointer message_part_id, gpointer attachment_view, gpointer efh) +weak_unref_attachment_view_cb (gpointer message_part_id, + gpointer attachment_view, + gpointer efh) { - g_object_weak_unref (G_OBJECT (attachment_view), efhd_attachment_view_gone_cb, efh); + g_object_weak_unref ( + G_OBJECT (attachment_view), + efhd_attachment_view_gone_cb, efh); } static void @@ -1106,7 +1116,9 @@ attachment_button_realized (GtkWidget *widget) /* attachment button callback */ static gboolean -efhd_attachment_button (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) +efhd_attachment_button (EMFormatHTML *efh, + GtkHTMLEmbedded *eb, + EMFormatHTMLPObject *pobject) { EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *) efh; struct _attach_puri *info; @@ -1134,7 +1146,7 @@ efhd_attachment_button (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObj size = ci->size; /* what if its not encoded in base64 ? is it a case to consider? */ if (ci->encoding && !g_ascii_strcasecmp (ci->encoding, "base64")) - size = size/1.37; + size = size / 1.37; } camel_message_info_free (mi); } @@ -1222,7 +1234,9 @@ efhd_attachment_frame (EMFormat *emf, } static void -set_size_request_cb (gpointer message_part_id, gpointer widget, gpointer width) +set_size_request_cb (gpointer message_part_id, + gpointer widget, + gpointer width) { gtk_widget_set_size_request (widget, GPOINTER_TO_INT (width), -1); } @@ -1311,7 +1325,8 @@ efhd_message_add_bar (EMFormat *emf, } static void -efhd_optional_button_show (GtkWidget *widget, GtkWidget *w) +efhd_optional_button_show (GtkWidget *widget, + GtkWidget *w) { GtkWidget *label = g_object_get_data (G_OBJECT (widget), "text-label"); @@ -1325,7 +1340,9 @@ efhd_optional_button_show (GtkWidget *widget, GtkWidget *w) } static void -efhd_resize (GtkWidget *w, GtkAllocation *event, EMFormatHTML *efh) +efhd_resize (GtkWidget *w, + GtkAllocation *event, + EMFormatHTML *efh) { EWebView *web_view; GtkAllocation allocation; @@ -1337,7 +1354,9 @@ efhd_resize (GtkWidget *w, GtkAllocation *event, EMFormatHTML *efh) /* optional render attachment button callback */ static gboolean -efhd_attachment_optional (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) +efhd_attachment_optional (EMFormatHTML *efh, + GtkHTMLEmbedded *eb, + EMFormatHTMLPObject *pobject) { struct _attach_puri *info; GtkWidget *hbox, *vbox, *button, *mainbox, *scroll, *label, *img; @@ -1371,7 +1390,9 @@ efhd_attachment_optional (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPO gtk_widget_show_all (hbox); gtk_container_add (GTK_CONTAINER (button), GTK_WIDGET (hbox)); if (info->handle) - g_signal_connect(G_OBJECT (button), "clicked", G_CALLBACK(efhd_optional_button_show), scroll); + g_signal_connect ( + button, "clicked", + G_CALLBACK (efhd_optional_button_show), scroll); else { gtk_widget_set_sensitive (button, FALSE); gtk_widget_set_can_focus (button, FALSE); @@ -1450,7 +1471,8 @@ efhd_free_attach_puri_data (EMFormatPURI *puri) /* returned object owned by html_display, thus do not unref it */ EAttachmentView * -em_format_html_display_get_attachment_view (EMFormatHTMLDisplay *html_display, const gchar *message_part_id) +em_format_html_display_get_attachment_view (EMFormatHTMLDisplay *html_display, + const gchar *message_part_id) { gpointer aview; diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c index e6da0c983a..dbfe011759 100644 --- a/mail/em-format-html-print.c +++ b/mail/em-format-html-print.c @@ -84,7 +84,7 @@ efhp_init (GObject *o) web_view = em_format_html_get_web_view (EM_FORMAT_HTML (efhp)); /* gtk widgets don't like to be realized outside top level widget - so we put new html widget into gtk window */ + * so we put new html widget into gtk window */ efhp->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_add (GTK_CONTAINER (efhp->window), GTK_WIDGET (web_view)); gtk_widget_realize (GTK_WIDGET (web_view)); diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 797f7194d9..a1be319390 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -262,7 +262,7 @@ efh_format_exec (struct _format_msg *m, if (m->estream) { /* Closing this base stream can queue more jobs, so we need - to check the list again after we've finished */ + * to check the list again after we've finished */ d(printf("out of jobs, closing root stream\n")); camel_stream_write_string ( (CamelStream *) m->estream, @@ -413,7 +413,8 @@ efh_free_cache (struct _EMFormatHTMLCache *efhc) } static void -efh_gtkhtml_destroy (GtkHTML *html, EMFormatHTML *efh) +efh_gtkhtml_destroy (GtkHTML *html, + EMFormatHTML *efh) { if (efh->priv->format_timeout_id != 0) { g_source_remove (efh->priv->format_timeout_id); @@ -433,7 +434,8 @@ efh_gtkhtml_destroy (GtkHTML *html, EMFormatHTML *efh) } static struct _EMFormatHTMLCache * -efh_insert_cache (EMFormatHTML *efh, const gchar *partid) +efh_insert_cache (EMFormatHTML *efh, + const gchar *partid) { struct _EMFormatHTMLCache *efhc; @@ -994,14 +996,14 @@ efh_class_init (EMFormatHTMLClass *class) user_cache_dir = e_get_user_cache_dir (); emfh_http_cache = camel_data_cache_new (user_cache_dir, NULL); if (emfh_http_cache) { - camel_data_cache_set_expire_age (emfh_http_cache, 24*60*60); - camel_data_cache_set_expire_access (emfh_http_cache, 2*60*60); + camel_data_cache_set_expire_age (emfh_http_cache, 24 *60 *60); + camel_data_cache_set_expire_access (emfh_http_cache, 2 *60 *60); } } static void efh_init (EMFormatHTML *efh, - EMFormatHTMLClass *class) + EMFormatHTMLClass *class) { EWebView *web_view; GdkColor *color; @@ -1303,7 +1305,7 @@ em_format_html_get_headers_state (EMFormatHTML *efh) void em_format_html_set_headers_state (EMFormatHTML *efh, - EMFormatHTMLHeadersState state) + EMFormatHTMLHeadersState state) { g_return_if_fail (EM_IS_FORMAT_HTML (efh)); @@ -1322,7 +1324,7 @@ em_format_html_get_headers_collapsable (EMFormatHTML *efh) void em_format_html_set_headers_collapsable (EMFormatHTML *efh, - gboolean collapsable) + gboolean collapsable) { g_return_if_fail (EM_IS_FORMAT_HTML (efh)); @@ -1365,7 +1367,11 @@ em_format_html_file_part (EMFormatHTML *efh, /* all this api is a pain in the bum ... */ EMFormatHTMLPObject * -em_format_html_add_pobject (EMFormatHTML *efh, gsize size, const gchar *classid, CamelMimePart *part, EMFormatHTMLPObjectFunc func) +em_format_html_add_pobject (EMFormatHTML *efh, + gsize size, + const gchar *classid, + CamelMimePart *part, + EMFormatHTMLPObjectFunc func) { EMFormatHTMLPObject *pobj; @@ -1466,7 +1472,8 @@ em_format_html_clear_pobject (EMFormatHTML *emf) struct _EMFormatHTMLJob * em_format_html_job_new (EMFormatHTML *emfh, - void (*callback) (struct _EMFormatHTMLJob *job, GCancellable *cancellable), + void (*callback) (struct _EMFormatHTMLJob *job, + GCancellable *cancellable), gpointer data) { struct _EMFormatHTMLJob *job = g_malloc0 (sizeof (*job)); @@ -1482,7 +1489,8 @@ em_format_html_job_new (EMFormatHTML *emfh, } void -em_format_html_job_queue (EMFormatHTML *emfh, struct _EMFormatHTMLJob *job) +em_format_html_job_queue (EMFormatHTML *emfh, + struct _EMFormatHTMLJob *job) { g_mutex_lock (emfh->priv->lock); g_queue_push_tail (&emfh->priv->pending_jobs, job); @@ -1533,9 +1541,12 @@ emfh_gethttp (struct _EMFormatHTMLJob *job, || policy == E_MAIL_IMAGE_LOADING_POLICY_ALWAYS || (policy == E_MAIL_IMAGE_LOADING_POLICY_SOMETIMES && em_utils_in_addressbook ((CamelInternetAddress *) camel_mime_message_get_from (job->format->parent.message), FALSE)))) { - /* TODO: Ideally we would put the http requests into another queue and only send them out - if the user selects 'load images', when they do. The problem is how to maintain this - state with multiple renderings, and how to adjust the thread dispatch/setup routine to handle it */ + /* TODO: Ideally we would put the http requests into + * another queue and only send them out if the user + * selects 'load images', when they do. The problem + * is how to maintain this state with multiple + * renderings, and how to adjust the thread + * dispatch/setup routine to handle it */ camel_url_free (url); goto done; } @@ -1590,7 +1601,7 @@ emfh_gethttp (struct _EMFormatHTMLJob *job, camel_stream_write (job->stream, buffer, n, cancellable, NULL); } - } while (n>0); + } while (n > 0); /* indicates success */ if (n == 0) @@ -1613,7 +1624,10 @@ badurl: /* ********************************************************************** */ static void -efh_url_requested (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, EMFormatHTML *efh) +efh_url_requested (GtkHTML *html, + const gchar *url, + GtkHTMLStream *handle, + EMFormatHTML *efh) { EMFormatPURI *puri; struct _EMFormatHTMLJob *job = NULL; @@ -1623,14 +1637,14 @@ efh_url_requested (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, EMFor puri = em_format_find_visible_puri ((EMFormat *) efh, url); if (puri) { CamelDataWrapper *dw = camel_medium_get_content ((CamelMedium *) puri->part); - CamelContentType *ct = dw?dw->mime_type:NULL; + CamelContentType *ct = dw ? dw->mime_type : NULL; /* GtkHTML only handles text and images. - application/octet-stream parts are the only ones - which are snooped for other content. So only try - to pass these to it - any other types are badly - formed or intentionally malicious emails. They - will still show as attachments anyway */ + * application/octet-stream parts are the only ones + * which are snooped for other content. So only try + * to pass these to it - any other types are badly + * formed or intentionally malicious emails. They + * will still show as attachments anyway */ if (ct && (camel_content_type_is(ct, "text", "*") || camel_content_type_is(ct, "image", "*") @@ -1676,7 +1690,9 @@ efh_url_requested (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, EMFor } static gboolean -efh_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, EMFormatHTML *efh) +efh_object_requested (GtkHTML *html, + GtkHTMLEmbedded *eb, + EMFormatHTML *efh) { EMFormatHTMLPObject *pobject; gint res = FALSE; @@ -1725,7 +1741,7 @@ static const gchar *smime_sign_colour[4] = { }; /* TODO: this could probably be virtual on em-format-html - then we only need one version of each type handler */ + * then we only need one version of each type handler */ static void efh_format_secure (EMFormat *emf, CamelStream *stream, @@ -1740,9 +1756,9 @@ efh_format_secure (EMFormat *emf, format_class->format_secure (emf, stream, part, valid, cancellable); /* To explain, if the validity is the same, then we are the - base validity and now have a combined sign/encrypt validity - we can display. Primarily a new verification context is - created when we have an embeded message. */ + * base validity and now have a combined sign/encrypt validity + * we can display. Primarily a new verification context is + * created when we have an embeded message. */ if (emf->valid == valid && (valid->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE || valid->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE)) { @@ -1844,15 +1860,15 @@ efh_text_plain (EMFormat *emf, flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED; /* This scans the text part for inline-encoded data, creates - a multipart of all the parts inside it. */ + * a multipart of all the parts inside it. */ /* FIXME: We should discard this multipart if it only contains - the original text, but it makes this hash lookup more complex */ + * the original text, but it makes this hash lookup more complex */ /* TODO: We could probably put this in the superclass, since - no knowledge of html is required - but this messes with - filters a bit. Perhaps the superclass should just deal with - html anyway and be done with it ... */ + * no knowledge of html is required - but this messes with + * filters a bit. Perhaps the superclass should just deal with + * html anyway and be done with it ... */ efhc = g_hash_table_lookup ( efh->priv->text_inline_parts, @@ -1914,7 +1930,7 @@ efh_text_plain (EMFormat *emf, len = emf->part_id->len; count = camel_multipart_get_number (mp); - for (i=0;i<count;i++) { + for (i = 0; i < count; i++) { CamelMimePart *newpart = camel_multipart_get_part (mp, i); if (!newpart) @@ -2068,9 +2084,9 @@ efh_text_html (EMFormat *emf, /* TODO: perhaps we don't need to calculate this anymore now base is handled better */ /* calculate our own location string so add_puri doesn't do it - for us. our iframes are special cases, we need to use the - proper base url to access them, but other children parts - shouldn't blindly inherit the container's location. */ + * for us. our iframes are special cases, we need to use the + * proper base url to access them, but other children parts + * shouldn't blindly inherit the container's location. */ location = camel_mime_part_get_content_location (part); if (location == NULL) { if (emf->base) @@ -2187,7 +2203,7 @@ efh_message_external (EMFormat *emf, s = d = url; while (*s) { /* FIXME: use camel_isspace */ - if (!isspace ((guchar)*s)) + if (!isspace ((guchar) * s)) *d++ = *s; s++; } @@ -2341,7 +2357,7 @@ efh_multipart_related (EMFormat *emf, nparts = camel_multipart_get_number (mp); content_type = camel_mime_part_get_content_type (part); start = camel_content_type_param (content_type, "start"); - if (start && strlen (start)>2) { + if (start && strlen (start) > 2) { gint len; const gchar *cid; @@ -2349,7 +2365,7 @@ efh_multipart_related (EMFormat *emf, len = strlen (start) - 2; start++; - for (i=0; i<nparts; i++) { + for (i = 0; i < nparts; i++) { body_part = camel_multipart_get_part (mp, i); cid = camel_mime_part_get_content_id (body_part); @@ -2469,8 +2485,8 @@ static EMFormatHandler type_builtin_table[] = { { (gchar *) "multipart/related", efh_multipart_related }, /* This is where one adds those busted, non-registered types, - that some idiot mailer writers out there decide to pull out - of their proverbials at random. */ + * that some idiot mailer writers out there decide to pull out + * of their proverbials at random. */ { (gchar *) "image/jpg", efh_image }, { (gchar *) "image/pjpeg", efh_image }, @@ -2560,11 +2576,14 @@ static const gchar *addrspec_hdrs[] = { }; static gchar * -efh_format_address (EMFormatHTML *efh, GString *out, struct _camel_header_address *a, gchar *field) +efh_format_address (EMFormatHTML *efh, + GString *out, + struct _camel_header_address *a, + gchar *field) { guint32 flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES; gchar *name, *mailto, *addr; - gint i=0; + gint i = 0; gboolean wrap = FALSE; gchar *str = NULL; gint limit = mail_config_get_address_count (); @@ -2632,7 +2651,7 @@ efh_format_address (EMFormatHTML *efh, GString *out, struct _camel_header_addres g_string_append (out, ", "); /* Let us add a '...' if we have more addresses */ - if (limit > 0 && wrap && a && (i>(limit-1))) { + if (limit > 0 && wrap && a && (i > (limit - 1))) { gchar *evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); if (!strcmp (field, _("To"))) { @@ -2656,7 +2675,7 @@ efh_format_address (EMFormatHTML *efh, GString *out, struct _camel_header_addres } - if (limit > 0 && i>(limit)) { + if (limit > 0 && i > (limit)) { gchar *evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); if (!strcmp (field, _("To"))) { @@ -2715,7 +2734,7 @@ efh_format_header (EMFormat *emf, gchar *str_field = NULL; gint i; - name = g_alloca (strlen (header->name)+1); + name = g_alloca (strlen (header->name) + 1); strcpy (name, header->name); canon_header_name (name); @@ -2802,8 +2821,8 @@ efh_format_header (EMFormat *emf, if (hide_real_date) { /* Show only the local-formatted date, losing all timezone - information like Outlook does. Should we attempt to show - it somehow? */ + * information like Outlook does. Should we attempt to show + * it somehow? */ txt = value = date_str; } else { txt = value = g_strdup_printf ("%s (<I>%s</I>)", html, date_str); @@ -2838,7 +2857,7 @@ efh_format_header (EMFormat *emf, txt = html->str; g_string_free (html, FALSE); - flags |= EM_FORMAT_HEADER_BOLD|EM_FORMAT_HTML_HEADER_HTML; + flags |= EM_FORMAT_HEADER_BOLD | EM_FORMAT_HTML_HEADER_HTML; } else if (!strcmp (name, "Received") || !strncmp (name, "X-", 2)) { /* don't unfold Received nor extension headers */ txt = value = camel_header_decode_string (header->value, charset); @@ -3331,7 +3350,8 @@ em_format_html_format_cert_infos (CamelCipherCertInfo *first_cinfo) /* unref returned pointer with g_object_unref(), if not NULL */ CamelStream * -em_format_html_get_cached_image (EMFormatHTML *efh, const gchar *image_uri) +em_format_html_get_cached_image (EMFormatHTML *efh, + const gchar *image_uri) { g_return_val_if_fail (efh != NULL, NULL); g_return_val_if_fail (image_uri != NULL, NULL); diff --git a/mail/em-format-html.h b/mail/em-format-html.h index d544201df0..ab66504cec 100644 --- a/mail/em-format-html.h +++ b/mail/em-format-html.h @@ -59,9 +59,9 @@ typedef struct _EMFormatHTMLClass EMFormatHTMLClass; typedef struct _EMFormatHTMLPrivate EMFormatHTMLPrivate; enum _em_format_html_header_flags { - EM_FORMAT_HTML_HEADER_TO = 1<<0, - EM_FORMAT_HTML_HEADER_CC = 1<<1, - EM_FORMAT_HTML_HEADER_BCC = 1<<2 + EM_FORMAT_HTML_HEADER_TO = 1 << 0, + EM_FORMAT_HTML_HEADER_CC = 1 << 1, + EM_FORMAT_HTML_HEADER_BCC = 1 << 2 }; typedef enum { @@ -85,8 +85,8 @@ typedef enum { } EMFormatHTMLColorType; /* A HTMLJob will be executed in another thread, in sequence. - It's job is to write to its stream, close it if successful, - then exit. */ + * It's job is to write to its stream, close it if successful, + * then exit. */ typedef struct _EMFormatHTMLJob EMFormatHTMLJob; @@ -119,7 +119,7 @@ struct _EMFormatHTMLJob { CamelStream *stream; /* We need to track the state of the visibility tree at - the point this uri was generated */ + * the point this uri was generated */ GNode *puri_level; CamelURL *base; diff --git a/mail/em-html-stream.c b/mail/em-html-stream.c index ccc9f82eba..a633946541 100644 --- a/mail/em-html-stream.c +++ b/mail/em-html-stream.c @@ -63,7 +63,7 @@ html_stream_dispose (GObject *object) EMHTMLStream *emhs = EM_HTML_STREAM (object); if (emhs->html_stream) { - /* set 'in finalise' flag */ + /* set 'in finalize' flag */ camel_stream_close (CAMEL_STREAM (emhs), NULL, NULL); } } @@ -150,7 +150,7 @@ em_html_stream_init (EMHTMLStream *emhs) } /* TODO: Could pass NULL for html_stream, and do a gtk_html_begin - on first data -> less flashing */ + * on first data -> less flashing */ CamelStream * em_html_stream_new (GtkHTML *html, GtkHTMLStream *html_stream) @@ -173,7 +173,8 @@ em_html_stream_new (GtkHTML *html, } void -em_html_stream_set_flags (EMHTMLStream *emhs, GtkHTMLBeginFlags flags) +em_html_stream_set_flags (EMHTMLStream *emhs, + GtkHTMLBeginFlags flags) { g_return_if_fail (EM_IS_HTML_STREAM (emhs)); diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c index baaeb34b3b..e2452d70bf 100644 --- a/mail/em-subscription-editor.c +++ b/mail/em-subscription-editor.c @@ -147,7 +147,7 @@ static void subscription_editor_populate (EMSubscriptionEditor *editor, CamelFolderInfo *folder_info, GtkTreeIter *parent, - GSList **expand_paths) + GSList **expand_paths) { GtkListStore *list_store; GtkTreeStore *tree_store; @@ -202,7 +202,8 @@ subscription_editor_populate (EMSubscriptionEditor *editor, } static void -expand_paths_cb (gpointer path, gpointer tree_view) +expand_paths_cb (gpointer path, + gpointer tree_view) { gtk_tree_view_expand_to_path (tree_view, path); } diff --git a/mail/em-sync-stream.c b/mail/em-sync-stream.c index 9c52cd703b..06f96ecd83 100644 --- a/mail/em-sync-stream.c +++ b/mail/em-sync-stream.c @@ -234,7 +234,8 @@ em_sync_stream_init (EMSyncStream *emss) } void -em_sync_stream_set_buffer_size (EMSyncStream *emss, gsize size) +em_sync_stream_set_buffer_size (EMSyncStream *emss, + gsize size) { if (emss->buffer != NULL) g_string_free (emss->buffer, TRUE); diff --git a/mail/em-utils.c b/mail/em-utils.c index 3b42e9b200..968165385a 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -249,7 +249,9 @@ em_utils_check_user_can_send_mail (void) static GtkWidget *filter_editor = NULL; static void -em_filter_editor_response (GtkWidget *dialog, gint button, gpointer user_data) +em_filter_editor_response (GtkWidget *dialog, + gint button, + gpointer user_data) { EMFilterContext *fc; @@ -366,7 +368,7 @@ em_filename_make_safe (gchar *string) * written? */ if (!g_unichar_isprint (c) || ( c < 0xff && strchr (unsafe_chars, c&0xff ))) { - while (ts<p) + while (ts < p) *ts++ = '_'; } } @@ -592,7 +594,7 @@ em_utils_write_messages_to_stream (CamelFolder *folder, CAMEL_STREAM_FILTER (filtered_stream), from_filter); g_object_unref (from_filter); - for (i=0; i<uids->len; i++) { + for (i = 0; i < uids->len; i++) { CamelMimeMessage *message; gchar *from; @@ -793,8 +795,8 @@ em_utils_selection_set_uidlist (GtkSelectionData *selection_data, g_byte_array_append ( array, (guchar *) folder_uri, strlen (folder_uri) + 1); - for (i=0; i<uids->len; i++) - g_byte_array_append (array, uids->pdata[i], strlen (uids->pdata[i])+1); + for (i = 0; i < uids->len; i++) + g_byte_array_append (array, uids->pdata[i], strlen (uids->pdata[i]) + 1); target = gtk_selection_data_get_target (selection_data); gtk_selection_data_set ( @@ -849,7 +851,7 @@ em_utils_selection_get_uidlist (GtkSelectionData *selection_data, inptr++; if (start > (gchar *) data) - g_ptr_array_add (uids, g_strndup (start, inptr-start)); + g_ptr_array_add (uids, g_strndup (start, inptr - start)); inptr++; } @@ -975,7 +977,7 @@ em_utils_selection_get_urilist (GtkSelectionData *selection_data, uris = gtk_selection_data_get_uris (selection_data); - for (i=0;res == 0 && uris[i];i++) { + for (i = 0; res == 0 && uris[i]; i++) { g_strstrip (uris[i]); if (uris[i][0] == '#') continue; @@ -1793,7 +1795,8 @@ search_address_in_addressbooks (const gchar *address, } gboolean -em_utils_in_addressbook (CamelInternetAddress *iaddr, gboolean local_only) +em_utils_in_addressbook (CamelInternetAddress *iaddr, + gboolean local_only) { const gchar *addr; @@ -1805,7 +1808,8 @@ em_utils_in_addressbook (CamelInternetAddress *iaddr, gboolean local_only) } static gboolean -extract_photo_data (EContact *contact, gpointer user_data) +extract_photo_data (EContact *contact, + gpointer user_data) { EContactPhoto **photo = user_data; @@ -1841,7 +1845,8 @@ G_LOCK_DEFINE_STATIC (photos_cache); static GSList *photos_cache = NULL; /* list of PhotoInfo-s */ CamelMimePart * -em_utils_contact_photo (CamelInternetAddress *cia, gboolean local_only) +em_utils_contact_photo (CamelInternetAddress *cia, + gboolean local_only) { const gchar *addr = NULL; CamelMimePart *part = NULL; @@ -1914,8 +1919,8 @@ em_utils_contact_photo (CamelInternetAddress *cia, gboolean local_only) return part; } -/* list of email addresses (strings) to remove from local cache of photos and contacts, - but only if the photo doesn't exist or is an not-found contact */ +/* list of email addresses (strings) to remove from local cache of photos and + * contacts, but only if the photo doesn't exist or is an not-found contact */ void emu_remove_from_mail_cache (const GSList *addresses) { diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c index 4c3a150081..be18f2c248 100644 --- a/mail/em-vfolder-rule.c +++ b/mail/em-vfolder-rule.c @@ -236,7 +236,7 @@ em_vfolder_rule_find_source (EMVFolderRule *rule, g_return_val_if_fail (EM_IS_VFOLDER_RULE (rule), NULL); /* only does a simple string or address comparison, should - probably do a decoded url comparison */ + * probably do a decoded url comparison */ link = g_queue_find_custom ( &rule->sources, uri, (GCompareFunc) strcmp); @@ -279,7 +279,8 @@ em_vfolder_rule_next_source (EMVFolderRule *rule, } static gint -validate (EFilterRule *fr, EAlert **alert) +validate (EFilterRule *fr, + EAlert **alert) { g_return_val_if_fail (fr != NULL, 0); g_warn_if_fail (alert == NULL || *alert == NULL); @@ -291,7 +292,7 @@ validate (EFilterRule *fr, EAlert **alert) } /* We have to have at least one source set in the "specific" case. - Do not translate this string! */ + * Do not translate this string! */ if (((EMVFolderRule *) fr)->with == EM_VFOLDER_RULE_WITH_SPECIFIC && g_queue_is_empty (&((EMVFolderRule *) fr)->sources)) { if (alert) @@ -303,7 +304,8 @@ validate (EFilterRule *fr, EAlert **alert) } static gint -queue_eq (GQueue *queue_a, GQueue *queue_b) +queue_eq (GQueue *queue_a, + GQueue *queue_b) { GList *link_a; GList *link_b; @@ -326,7 +328,8 @@ queue_eq (GQueue *queue_a, GQueue *queue_b) } static gint -vfolder_eq (EFilterRule *fr, EFilterRule *cm) +vfolder_eq (EFilterRule *fr, + EFilterRule *cm) { return E_FILTER_RULE_CLASS (em_vfolder_rule_parent_class)->eq (fr, cm) && queue_eq ( @@ -362,7 +365,8 @@ xml_encode (EFilterRule *fr) } static void -set_with (EMVFolderRule *vr, const gchar *name) +set_with (EMVFolderRule *vr, + const gchar *name) { gint i; @@ -377,7 +381,9 @@ set_with (EMVFolderRule *vr, const gchar *name) } static gint -xml_decode (EFilterRule *fr, xmlNodePtr node, struct _ERuleContext *f) +xml_decode (EFilterRule *fr, + xmlNodePtr node, + ERuleContext *f) { xmlNodePtr set, work; gint result; @@ -422,7 +428,8 @@ xml_decode (EFilterRule *fr, xmlNodePtr node, struct _ERuleContext *f) } static void -rule_copy (EFilterRule *dest, EFilterRule *src) +rule_copy (EFilterRule *dest, + EFilterRule *src) { EMVFolderRule *vdest, *vsrc; GList *head, *link; @@ -483,7 +490,8 @@ set_sensitive (struct _source_data *data) } static void -select_source (GtkWidget *list, struct _source_data *data) +select_source (GtkWidget *list, + struct _source_data *data) { GtkTreeViewColumn *column; GtkTreePath *path; @@ -499,7 +507,8 @@ select_source (GtkWidget *list, struct _source_data *data) } static void -select_source_with_changed (GtkWidget *widget, struct _source_data *data) +select_source_with_changed (GtkWidget *widget, + struct _source_data *data) { em_vfolder_rule_with_t with = 0; GSList *group = NULL; @@ -510,7 +519,7 @@ select_source_with_changed (GtkWidget *widget, struct _source_data *data) group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget)); - for (i=0; i< g_slist_length (group); i++) { + for (i = 0; i< g_slist_length (group); i++) { if (g_slist_nth_data (group, with = i) == widget) break; } @@ -587,7 +596,8 @@ vfr_folder_response (EMFolderSelector *selector, } static void -source_add (GtkWidget *widget, struct _source_data *data) +source_add (GtkWidget *widget, + struct _source_data *data) { EMFolderTree *folder_tree; EMFolderTreeModel *model; @@ -620,7 +630,8 @@ source_add (GtkWidget *widget, struct _source_data *data) } static void -source_remove (GtkWidget *widget, struct _source_data *data) +source_remove (GtkWidget *widget, + struct _source_data *data) { GtkTreeSelection *selection; const gchar *source; @@ -672,7 +683,8 @@ source_remove (GtkWidget *widget, struct _source_data *data) } static GtkWidget * -get_widget (EFilterRule *fr, ERuleContext *rc) +get_widget (EFilterRule *fr, + ERuleContext *rc) { EMVFolderRule *vr =(EMVFolderRule *) fr; GtkWidget *widget, *frame; @@ -701,7 +713,7 @@ get_widget (EFilterRule *fr, ERuleContext *rc) for (i = 0; i < BUTTON_LAST; i++) { data->buttons[i] =(GtkButton *) e_builder_get_widget (builder, edit_buttons[i].name); - g_signal_connect(data->buttons[i], "clicked", edit_buttons[i].func, data); + g_signal_connect (data->buttons[i], "clicked", edit_buttons[i].func, data); } object = gtk_builder_get_object (builder, "source_list"); @@ -718,7 +730,7 @@ get_widget (EFilterRule *fr, ERuleContext *rc) g_free (nice); } - g_signal_connect(data->list, "cursor-changed", G_CALLBACK(select_source), data); + g_signal_connect (data->list, "cursor-changed", G_CALLBACK(select_source), data); rb = (GtkRadioButton *)e_builder_get_widget (builder, "local_rb"); g_signal_connect ( diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c index 75cf996e14..832bf749ea 100644 --- a/mail/importers/elm-importer.c +++ b/mail/importers/elm-importer.c @@ -122,7 +122,8 @@ parse_elm_rc (const gchar *elmrc) } static gchar * -elm_get_rc (EImport *ei, const gchar *name) +elm_get_rc (EImport *ei, + const gchar *name) { GHashTable *prefs; gchar *elmrc; @@ -142,7 +143,9 @@ elm_get_rc (EImport *ei, const gchar *name) } static gboolean -elm_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +elm_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { const gchar *maildir; gchar *elmdir; @@ -246,7 +249,10 @@ elm_import_free (struct _elm_import_msg *m) } static void -elm_status (CamelOperation *op, const gchar *what, gint pc, gpointer data) +elm_status (CamelOperation *op, + const gchar *what, + gint pc, + gpointer data) { struct _elm_import_msg *importer = data; @@ -288,7 +294,8 @@ static MailMsgInfo elm_import_info = { }; static gint -mail_importer_elm_import (EImport *ei, EImportTarget *target) +mail_importer_elm_import (EImport *ei, + EImportTarget *target) { struct _elm_import_msg *m; gint id; @@ -314,7 +321,8 @@ mail_importer_elm_import (EImport *ei, EImportTarget *target) } static void -checkbox_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +checkbox_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data ( &target->data, "elm-do-mail", @@ -322,7 +330,9 @@ checkbox_toggle_cb (GtkToggleButton *tb, EImportTarget *target) } static GtkWidget * -elm_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +elm_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *box, *w; GConfClient *gconf; @@ -340,7 +350,7 @@ elm_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) w = gtk_check_button_new_with_label(_("Mail")); gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_mail); - g_signal_connect(w, "toggled", G_CALLBACK(checkbox_toggle_cb), target); + g_signal_connect (w, "toggled", G_CALLBACK(checkbox_toggle_cb), target); gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 0); gtk_widget_show_all (box); @@ -349,7 +359,9 @@ elm_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -elm_import (EImport *ei, EImportTarget *target, EImportImporter *im) +elm_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { if (GPOINTER_TO_INT(g_datalist_get_data(&target->data, "elm-do-mail"))) mail_importer_elm_import (ei, target); @@ -358,7 +370,9 @@ elm_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -elm_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +elm_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { struct _elm_import_msg *m = g_datalist_get_data(&target->data, "elm-msg"); diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index 4b3a258e18..3c97bd953b 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -71,14 +71,17 @@ typedef struct { } MboxImporter; static void -folder_selected (EMFolderSelectionButton *button, EImportTargetURI *target) +folder_selected (EMFolderSelectionButton *button, + EImportTargetURI *target) { g_free (target->uri_dest); target->uri_dest = g_strdup (em_folder_selection_button_get_folder_uri (button)); } static GtkWidget * -mbox_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { EShell *shell; EShellBackend *shell_backend; @@ -159,7 +162,9 @@ mbox_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) } static gboolean -mbox_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar signature[6]; gboolean ret = FALSE; @@ -190,7 +195,10 @@ mbox_supported (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -mbox_status (CamelOperation *op, const gchar *what, gint pc, gpointer data) +mbox_status (CamelOperation *op, + const gchar *what, + gint pc, + gpointer data) { MboxImporter *importer = data; @@ -224,7 +232,8 @@ mbox_status_timeout (gpointer data) } static void -mbox_import_done (gpointer data, GError **error) +mbox_import_done (gpointer data, + GError **error) { MboxImporter *importer = data; @@ -238,7 +247,9 @@ mbox_import_done (gpointer data, GError **error) } static void -mbox_import (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { EShell *shell; EShellBackend *shell_backend; @@ -276,7 +287,9 @@ mbox_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -mbox_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { MboxImporter *importer = g_datalist_get_data(&target->data, "mbox-data"); @@ -296,7 +309,8 @@ mbox_importer_set_preview_funcs (MboxImporterCreatePreviewFunc create_func, } static void -preview_selection_changed_cb (GtkTreeSelection *selection, EWebViewPreview *preview) +preview_selection_changed_cb (GtkTreeSelection *selection, + EWebViewPreview *preview) { GtkTreeIter iter; GtkTreeModel *model = NULL; @@ -325,7 +339,9 @@ preview_selection_changed_cb (GtkTreeSelection *selection, EWebViewPreview *prev } static GtkWidget * -mbox_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview = NULL; EImportTargetURI *s = (EImportTargetURI *) target; @@ -345,7 +361,7 @@ mbox_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) return NULL; } - fd = g_open (filename, O_RDONLY|O_BINARY, 0); + fd = g_open (filename, O_RDONLY | O_BINARY, 0); if (fd == -1) { g_warning ( "Cannot find source file to import '%s': %s", diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index c2619e08a1..e28de37b3c 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -95,7 +95,7 @@ decode_status (const gchar *status) static guint32 decode_mozilla_status (const gchar *tmp) { - unsigned long status = strtoul (tmp, NULL, 16); + gulong status = strtoul (tmp, NULL, 16); guint32 flags = 0; gint i; @@ -134,7 +134,7 @@ import_mbox_exec (struct _import_mbox_msg *m, return; if (S_ISREG (st.st_mode)) { - fd = g_open (m->path, O_RDONLY|O_BINARY, 0); + fd = g_open (m->path, O_RDONLY | O_BINARY, 0); if (fd == -1) { g_warning ( "cannot find source file to import '%s': %s", @@ -242,7 +242,8 @@ mail_importer_import_mbox (EMailSession *session, const gchar *path, const gchar *folderuri, GCancellable *cancellable, - void (*done)(gpointer data, GError **), + void (*done) (gpointer data, + GError **error), gpointer data) { struct _import_mbox_msg *m; @@ -290,7 +291,7 @@ struct _import_folders_data { EMailSession *session; GCancellable *cancellable; - guint elmfmt:1; + guint elmfmt : 1; }; static void @@ -315,7 +316,7 @@ import_folders_rec (struct _import_folders_data *m, camel_operation_push_message (m->cancellable, _("Scanning %s"), utf8_filename); g_free (utf8_filename); - while ( (d=g_dir_read_name (dir))) { + while ( (d = g_dir_read_name (dir))) { if (d[0] == '.') continue; @@ -333,7 +334,7 @@ import_folders_rec (struct _import_folders_data *m, if (folderparent == NULL) { gint i; - for (i=0;m->special_folders[i].orig;i++) + for (i = 0; m->special_folders[i].orig; i++) if (strcmp (m->special_folders[i].orig, folder) == 0) { folder = m->special_folders[i].new; break; diff --git a/mail/importers/mail-importer.h b/mail/importers/mail-importer.h index 93d1897877..d66ed464ec 100644 --- a/mail/importers/mail-importer.h +++ b/mail/importers/mail-importer.h @@ -34,7 +34,7 @@ typedef void (*MboxImporterCreatePreviewFunc)(GObject *preview, GtkWidget **prev typedef void (*MboxImporterFillPreviewFunc)(GObject *preview, CamelMimeMessage *msg); /* 'create_func' is a function to create a view. 'fill_func' is to fill view with a preview of a message 'msg' - (mail importer cannot link to em-format-html-display directly) */ + * (mail importer cannot link to em-format-html-display directly) */ void mbox_importer_set_preview_funcs (MboxImporterCreatePreviewFunc create_func, MboxImporterFillPreviewFunc fill_func); EImportImporter *elm_importer_peek (void); diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index 9be96ba182..710e02b40e 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -64,7 +64,9 @@ struct _pine_import_msg { }; static gboolean -pine_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +pine_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *maildir, *addrfile; gboolean md_exists, addr_exists; @@ -84,21 +86,22 @@ pine_supported (EImport *ei, EImportTarget *target, EImportImporter *im) } /* -See: http://www.washington.edu/pine/tech-notes/low-level.html - -addressbook line is: - <nickname>TAB<fullname>TAB<address>TAB<fcc>TAB<comments> -lists, address is: - "(" <address>, <address>, <address>, ... ")" - -<address> is rfc822 address, or alias address. -if rfc822 address includes a phrase, then that overrides <fullname> - -FIXME: we dont handle aliases in lists. -*/ + * See: http://www.washington.edu/pine/tech-notes/low-level.html + * + * addressbook line is: + * <nickname>TAB<fullname>TAB<address>TAB<fcc>TAB<comments> + * lists, address is: + * "(" <address>, <address>, <address>, ... ")" + * + * <address> is rfc822 address, or alias address. + * if rfc822 address includes a phrase, then that overrides <fullname> + * + * FIXME: we dont handle aliases in lists. + */ static void -import_contact (EBookClient *book_client, gchar *line) +import_contact (EBookClient *book_client, + gchar *line) { gchar **strings, *addr, **addrs; gint i; @@ -118,16 +121,16 @@ import_contact (EBookClient *book_client, gchar *line) addr = strings[2]; len = strlen (addr); - if (addr[0] == '(' && addr[len-1] == ')') { + if (addr[0] == '(' && addr[len - 1] == ')') { addr[0] = 0; - addr[len-1] = 0; + addr[len - 1] = 0; addrs = g_strsplit(addr+1, ",", 0); list = NULL; /* XXX So ... this api is just insane ... we set * plain strings as the contact email if it * is a normal contact, but need to do this * XML crap for mailing lists. */ - for (i=0;addrs[i];i++) { + for (i = 0; addrs[i]; i++) { EDestination *d; EVCardAttribute *attr; @@ -228,15 +231,15 @@ import_contacts (void) line = g_string_new(""); g_string_set_size (line, 256); offset = 0; - while (fgets (line->str+offset, 256, fp)) { + while (fgets (line->str + offset, 256, fp)) { gsize len; - len = strlen (line->str+offset)+offset; - if (line->str[len-1] == '\n') - g_string_truncate (line, len-1); + len = strlen (line->str + offset) + offset; + if (line->str[len - 1] == '\n') + g_string_truncate (line, len - 1); else if (!feof (fp)) { offset = len; - g_string_set_size (line, len+256); + g_string_set_size (line, len + 256); continue; } else { g_string_truncate (line, len); @@ -428,7 +431,9 @@ checkbox_addr_toggle_cb (GtkToggleButton *tb, } static GtkWidget * -pine_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +pine_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *box, *w; GConfClient *gconf; @@ -452,12 +457,12 @@ pine_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) w = gtk_check_button_new_with_label(_("Mail")); gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_mail); - g_signal_connect(w, "toggled", G_CALLBACK(checkbox_mail_toggle_cb), target); + g_signal_connect (w, "toggled", G_CALLBACK(checkbox_mail_toggle_cb), target); gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 0); w = gtk_check_button_new_with_label(_("Address Book")); gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_addr); - g_signal_connect(w, "toggled", G_CALLBACK(checkbox_addr_toggle_cb), target); + g_signal_connect (w, "toggled", G_CALLBACK(checkbox_addr_toggle_cb), target); gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 0); gtk_widget_show_all (box); @@ -466,7 +471,9 @@ pine_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -pine_import (EImport *ei, EImportTarget *target, EImportImporter *im) +pine_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { if (GPOINTER_TO_INT(g_datalist_get_data(&target->data, "pine-do-mail")) || GPOINTER_TO_INT(g_datalist_get_data(&target->data, "pine-do-addr"))) @@ -476,7 +483,9 @@ pine_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -pine_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +pine_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { struct _pine_import_msg *m = g_datalist_get_data(&target->data, "pine-msg"); diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c index 45b074d6cf..3fc90d5f94 100644 --- a/mail/mail-autofilter.c +++ b/mail/mail-autofilter.c @@ -90,7 +90,7 @@ strip_re (const gchar *subject) break; if ((s[0] == 'r' || s[0] == 'R') && (s[1] == 'e' || s[1] == 'E')) { - p = s+2; + p = s + 2; while (isdigit (*p) || (ispunct (*p) && (*p != ':'))) p++; if (*p == ':') { @@ -104,26 +104,10 @@ strip_re (const gchar *subject) return (gchar *) s; } -#if 0 -gint -reg_match (gchar *str, gchar *regstr) -{ - regex_t reg; - gint error; - gint ret; - - error = regcomp (®, regstr, REG_EXTENDED|REG_ICASE|REG_NOSUB); - if (error != 0) { - return 0; - } - error = regexec (®, str, 0, NULL, 0); - regfree (®); - return (error == 0); -} -#endif - static void -rule_add_subject (ERuleContext *context, EFilterRule *rule, const gchar *text) +rule_add_subject (ERuleContext *context, + EFilterRule *rule, + const gchar *text) { EFilterPart *part; EFilterElement *element; @@ -140,7 +124,9 @@ rule_add_subject (ERuleContext *context, EFilterRule *rule, const gchar *text) } static void -rule_add_sender (ERuleContext *context, EFilterRule *rule, const gchar *text) +rule_add_sender (ERuleContext *context, + EFilterRule *rule, + const gchar *text) { EFilterPart *part; EFilterElement *element; @@ -157,9 +143,11 @@ rule_add_sender (ERuleContext *context, EFilterRule *rule, const gchar *text) } /* do a bunch of things on the subject to try and detect mailing lists, remove - unneeded stuff, etc */ + * unneeded stuff, etc */ static void -rule_match_subject (ERuleContext *context, EFilterRule *rule, const gchar *subject) +rule_match_subject (ERuleContext *context, + EFilterRule *rule, + const gchar *subject) { const gchar *s; const gchar *s1, *s2; @@ -186,11 +174,11 @@ rule_match_subject (ERuleContext *context, EFilterRule *rule, const gchar *subje s1 = strchr (s, ':'); if (s1) { tmp = g_alloca (s1 - s + 1); - memcpy (tmp, s, s1-s); + memcpy (tmp, s, s1 - s); tmp[s1 - s] = 0; g_strstrip (tmp); rule_add_subject (context, rule, tmp); - s = s1+1; + s = s1 + 1; } /* just lump the rest together */ @@ -201,7 +189,9 @@ rule_match_subject (ERuleContext *context, EFilterRule *rule, const gchar *subje } static void -rule_match_mlist (ERuleContext *context, EFilterRule *rule, const gchar *mlist) +rule_match_mlist (ERuleContext *context, + EFilterRule *rule, + const gchar *mlist) { EFilterPart *part; EFilterElement *element; diff --git a/mail/mail-config.c b/mail/mail-config.c index 2428c4bfae..7356772e99 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -215,7 +215,8 @@ mail_config_get_sync_timeout (void) } gchar * -mail_config_folder_to_cachename (CamelFolder *folder, const gchar *prefix) +mail_config_folder_to_cachename (CamelFolder *folder, + const gchar *prefix) { gchar *folder_uri, *basename, *filename; const gchar *config_dir; diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index e8f183f339..0e1ac98413 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -358,7 +358,7 @@ folder_changed_cb (CamelFolder *folder, && folder != local_sent && changes && (changes->uid_added->len > 0)) { /* for each added message, check to see that it is - brand new, not junk and not already deleted */ + * brand new, not junk and not already deleted */ for (i = 0; i < changes->uid_added->len; i++) { info = camel_folder_get_message_info ( folder, changes->uid_added->pdata[i]); @@ -451,7 +451,9 @@ free_folder_info (struct _folder_info *mfi) } static void -setup_folder (MailFolderCache *self, CamelFolderInfo *fi, struct _store_info *si) +setup_folder (MailFolderCache *self, + CamelFolderInfo *fi, + struct _store_info *si) { struct _folder_info *mfi; struct _folder_update *up; @@ -482,7 +484,9 @@ setup_folder (MailFolderCache *self, CamelFolderInfo *fi, struct _store_info *si } static void -create_folders (MailFolderCache *self, CamelFolderInfo *fi, struct _store_info *si) +create_folders (MailFolderCache *self, + CamelFolderInfo *fi, + struct _store_info *si) { while (fi) { setup_folder (self, fi, si); @@ -600,7 +604,7 @@ rename_folders (MailFolderCache *self, } up->full_name = g_strdup (mfi->full_name); - up->unread = fi->unread==-1?0:fi->unread; + up->unread = fi->unread==-1 ? 0 : fi->unread; up->store = g_object_ref (si->store); if ((fi->flags & CAMEL_FOLDER_NOSELECT) == 0) @@ -638,7 +642,8 @@ rename_folders (MailFolderCache *self, } static void -get_folders (CamelFolderInfo *fi, GPtrArray *folders) +get_folders (CamelFolderInfo *fi, + GPtrArray *folders) { while (fi) { g_ptr_array_add (folders, fi); @@ -651,7 +656,8 @@ get_folders (CamelFolderInfo *fi, GPtrArray *folders) } static gint -folder_cmp (gconstpointer ap, gconstpointer bp) +folder_cmp (gconstpointer ap, + gconstpointer bp) { const CamelFolderInfo *a = ((CamelFolderInfo **) ap)[0]; const CamelFolderInfo *b = ((CamelFolderInfo **) bp)[0]; @@ -675,12 +681,12 @@ store_folder_renamed_cb (CamelStore *store, gint i; /* Ok, so for some reason the folderinfo we have comes in all messed up from - imap, should find out why ... this makes it workable */ + * imap, should find out why ... this makes it workable */ get_folders (info, folders); qsort (folders->pdata, folders->len, sizeof (folders->pdata[0]), folder_cmp); top = folders->pdata[0]; - for (i=0;i<folders->len;i++) { + for (i = 0; i < folders->len; i++) { rename_folders (self, si, old_name, top->full_name, folders->pdata[i]); } @@ -698,14 +704,18 @@ struct _update_data { }; static void -unset_folder_info_hash (gchar *path, struct _folder_info *mfi, gpointer data) +unset_folder_info_hash (gchar *path, + struct _folder_info *mfi, + gpointer data) { - MailFolderCache *self = (MailFolderCache*) data; + MailFolderCache *self = (MailFolderCache *) data; unset_folder_info (self, mfi, FALSE, FALSE); } static void -free_folder_info_hash (gchar *path, struct _folder_info *mfi, gpointer data) +free_folder_info_hash (gchar *path, + struct _folder_info *mfi, + gpointer data) { free_folder_info (mfi); } @@ -902,7 +912,7 @@ storeinfo_find_folder_info (CamelStore *store, static void mail_folder_cache_finalize (GObject *object) { - MailFolderCache *cache = (MailFolderCache*) object; + MailFolderCache *cache = (MailFolderCache *) object; g_hash_table_destroy (cache->priv->stores); g_mutex_free (cache->priv->stores_mutex); @@ -1350,7 +1360,7 @@ mail_folder_cache_get_folder_info_flags (MailFolderCache *self, } /* Returns whether folder 'folder' has children based on folder_info->child property. - If not found returns FALSE and sets 'found' to FALSE, if not NULL. */ + * If not found returns FALSE and sets 'found' to FALSE, if not NULL. */ gboolean mail_folder_cache_get_folder_has_children (MailFolderCache *self, CamelFolder *folder, diff --git a/mail/mail-mt.c b/mail/mail-mt.c index 724498c359..d904eed546 100644 --- a/mail/mail-mt.c +++ b/mail/mail-mt.c @@ -303,7 +303,8 @@ mail_msg_active (void) static GHookList cancel_hook_list; GHook * -mail_cancel_hook_add (GHookFunc func, gpointer data) +mail_cancel_hook_add (GHookFunc func, + gpointer data) { GHook *hook; @@ -440,7 +441,8 @@ mail_msg_init (void) } static gint -mail_msg_compare (const MailMsg *msg1, const MailMsg *msg2) +mail_msg_compare (const MailMsg *msg1, + const MailMsg *msg2) { gint priority1 = msg1->priority; gint priority2 = msg2->priority; @@ -598,7 +600,9 @@ static MailMsgInfo mail_call_info = { }; gpointer -mail_call_main (mail_call_t type, MailMainFunc func, ...) +mail_call_main (mail_call_t type, + MailMainFunc func, + ...) { GCancellable *cancellable; struct _call_msg *m; diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 8bfc050149..bf57a97ca7 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -301,7 +301,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m, if (fm->delete && (!error || !*error)) { /* not keep on server - just delete all * the actual messages on the server */ - for (i=0;i<folder_uids->len;i++) { + for (i = 0; i < folder_uids->len; i++) { camel_folder_delete_message ( folder, folder_uids->pdata[i]); } @@ -321,15 +321,15 @@ fetch_mail_exec (struct _fetch_mail_msg *m, } /* we unref the source folder here since we - may now block in finalize (we try to - disconnect cleanly) */ + * may now block in finalize (we try to + * disconnect cleanly) */ g_object_unref (fm->source_folder); fm->source_folder = NULL; } fail: /* we unref this here as it may have more work to do (syncing - folders and whatnot) before we are really done */ + * folders and whatnot) before we are really done */ /* should this be cancellable too? (i.e. above unregister above) */ if (fm->driver) { g_object_unref (fm->driver); @@ -337,7 +337,7 @@ fail: } /* also disconnect if not a local delivery mbox; - there is no need to keep the connection alive forever */ + * there is no need to keep the connection alive forever */ if (!is_local_delivery) em_utils_disconnect_service_sync ( CAMEL_SERVICE (m->store), TRUE, cancellable, NULL); @@ -595,7 +595,7 @@ mail_send_message (struct _send_queue_msg *m, info = camel_message_info_new (NULL); camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, ~0); - for (header = xev;header;header=header->next) { + for (header = xev; header; header = header->next) { gchar *uri; if (strcmp(header->name, "X-Evolution-PostTo") != 0) @@ -822,7 +822,7 @@ send_queue_exec (struct _send_queue_msg *m, send_uids->len); camel_operation_progress ( - cancellable, (i+1) * 100 / send_uids->len); + cancellable, (i + 1) * 100 / send_uids->len); mail_send_message ( m, m->queue, send_uids->pdata[i], m->transport, @@ -1064,7 +1064,8 @@ mail_transfer_messages (EMailSession *session, gboolean delete_from_source, const gchar *dest_uri, guint32 dest_flags, - void (*done) (gboolean ok, gpointer data), + void (*done) (gboolean ok, + gpointer data), gpointer data) { struct _transfer_msg *m; @@ -1140,7 +1141,8 @@ static MailMsgInfo sync_folder_info = { void mail_sync_folder (CamelFolder *folder, - void (*done) (CamelFolder *folder, gpointer data), + void (*done) (CamelFolder *folder, + gpointer data), gpointer data) { struct _sync_folder_msg *m; @@ -1216,7 +1218,8 @@ static MailMsgInfo sync_store_info = { void mail_sync_store (CamelStore *store, gint expunge, - void (*done) (CamelStore *store, gpointer data), + void (*done) (CamelStore *store, + gpointer data), gpointer data) { struct _sync_store_msg *m; @@ -1260,7 +1263,8 @@ static MailMsgInfo refresh_folder_info = { void mail_refresh_folder (CamelFolder *folder, - void (*done) (CamelFolder *folder, gpointer data), + void (*done) (CamelFolder *folder, + gpointer data), gpointer data) { struct _sync_folder_msg *m; diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 2446c1c92e..5fda76d103 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -64,7 +64,7 @@ /* This stuff below is independent of the stuff above */ /* this stuff is used to keep track of which folders filters have accessed, and - what not. the thaw/refreeze thing doesn't really seem to work though */ + * what not. the thaw/refreeze thing doesn't really seem to work though */ struct _folder_info { gchar *uri; CamelFolder *folder; @@ -187,7 +187,8 @@ setup_send_data (void) } static void -receive_cancel (GtkButton *button, struct _send_info *info) +receive_cancel (GtkButton *button, + struct _send_info *info) { if (info->state == SEND_ACTIVE) { camel_operation_cancel (CAMEL_OPERATION (info->cancellable)); @@ -223,13 +224,17 @@ free_send_data (void) } static void -cancel_send_info (gpointer key, struct _send_info *info, gpointer data) +cancel_send_info (gpointer key, + struct _send_info *info, + gpointer data) { receive_cancel (GTK_BUTTON (info->cancel_button), info); } static void -hide_send_info (gpointer key, struct _send_info *info, gpointer data) +hide_send_info (gpointer key, + struct _send_info *info, + gpointer data) { info->cancel_button = NULL; info->progress_bar = NULL; @@ -242,7 +247,8 @@ hide_send_info (gpointer key, struct _send_info *info, gpointer data) } static void -dialog_destroy_cb (struct _send_data *data, GObject *deadbeef) +dialog_destroy_cb (struct _send_data *data, + GObject *deadbeef) { g_hash_table_foreach (data->active, (GHFunc) hide_send_info, NULL); data->gd = NULL; @@ -250,7 +256,9 @@ dialog_destroy_cb (struct _send_data *data, GObject *deadbeef) } static void -dialog_response (GtkDialog *gd, gint button, struct _send_data *data) +dialog_response (GtkDialog *gd, + gint button, + struct _send_data *data) { switch (button) { case GTK_RESPONSE_CANCEL: @@ -310,7 +318,9 @@ operation_status_timeout (gpointer data) } static void -set_send_status (struct _send_info *info, const gchar *desc, gint pc) +set_send_status (struct _send_info *info, + const gchar *desc, + gint pc) { g_static_mutex_lock (&status_lock); @@ -322,7 +332,8 @@ set_send_status (struct _send_info *info, const gchar *desc, gint pc) } static void -set_send_account (struct _send_info *info, const gchar *account_url) +set_send_account (struct _send_info *info, + const gchar *account_url) { g_static_mutex_lock (&status_lock); @@ -391,7 +402,7 @@ get_receive_type (CamelURL *url) CamelProvider *provider; /* mbox pointing to a file is a 'Local delivery' source - which requires special processing */ + * which requires special processing */ if (em_utils_is_local_delivery_mbox_file (url)) return SEND_RECEIVE; @@ -592,19 +603,19 @@ build_dialog (GtkWindow *parent, gtk_table_attach ( GTK_TABLE (table), recv_icon, - 0, 1, row, row+2, 0, 0, 0, 0); + 0, 1, row, row + 2, 0, 0, 0, 0); gtk_table_attach ( GTK_TABLE (table), label, - 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_table_attach ( GTK_TABLE (table), progress_bar, - 2, 3, row, row+2, 0, 0, 0, 0); + 2, 3, row, row + 2, 0, 0, 0, 0); gtk_table_attach ( GTK_TABLE (table), cancel_button, - 3, 4, row, row+2, 0, 0, 0, 0); + 3, 4, row, row + 2, 0, 0, 0, 0); gtk_table_attach ( GTK_TABLE (table), status_label, - 1, 2, row+1, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + 1, 2, row + 1, row + 2, GTK_EXPAND | GTK_FILL, 0, 0, 0); info->progress_bar = progress_bar; info->status_label = status_label; @@ -686,19 +697,19 @@ build_dialog (GtkWindow *parent, gtk_table_attach ( GTK_TABLE (table), send_icon, - 0, 1, row, row+2, 0, 0, 0, 0); + 0, 1, row, row + 2, 0, 0, 0, 0); gtk_table_attach ( GTK_TABLE (table), label, - 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_table_attach ( GTK_TABLE (table), progress_bar, - 2, 3, row, row+2, 0, 0, 0, 0); + 2, 3, row, row + 2, 0, 0, 0, 0); gtk_table_attach ( GTK_TABLE (table), cancel_button, - 3, 4, row, row+2, 0, 0, 0, 0); + 3, 4, row, row + 2, 0, 0, 0, 0); gtk_table_attach ( GTK_TABLE (table), status_label, - 1, 2, row+1, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + 1, 2, row + 1, row + 2, GTK_EXPAND | GTK_FILL, 0, 0, 0); info->progress_bar = progress_bar; info->cancel_button = cancel_button; @@ -726,7 +737,9 @@ build_dialog (GtkWindow *parent, } static void -update_folders (gchar *uri, struct _folder_info *info, gpointer data) +update_folders (gchar *uri, + struct _folder_info *info, + gpointer data) { time_t now = *((time_t *) data); @@ -734,7 +747,7 @@ update_folders (gchar *uri, struct _folder_info *info, gpointer data) /* let it flow through to the folders every 10 seconds */ /* we back off slowly as we progress */ - if (now > info->update+10+info->count*5) { + if (now > info->update + 10 + info->count *5) { d(printf("upating a folder: %s\n", info->uri)); /*camel_folder_thaw(info->folder); camel_folder_freeze (info->folder);*/ @@ -756,7 +769,7 @@ receive_status (CamelFilterDriver *driver, /* let it flow through to the folder, every now and then too? */ g_hash_table_foreach (info->data->folders, (GHFunc) update_folders, &now); - if (info->data->inbox && now > info->data->inbox_update+20) { + if (info->data->inbox && now > info->data->inbox_update + 20) { d(printf("updating inbox too\n")); /* this doesn't seem to work right :( */ /*camel_folder_thaw(info->data->inbox); @@ -765,8 +778,8 @@ receive_status (CamelFilterDriver *driver, } /* we just pile them onto the port, assuming it can handle it. - We could also have a receiver port and see if they've been processed - yet, so if this is necessary its not too hard to add */ + * We could also have a receiver port and see if they've been processed + * yet, so if this is necessary its not too hard to add */ /* the mail_gui_port receiver will free everything for us */ switch (status) { case CAMEL_FILTER_STATUS_START: @@ -851,9 +864,9 @@ receive_done (gpointer data) } /* although we dont do anythign smart here yet, there is no need for this interface to - be available to anyone else. - This can also be used to hook into which folders are being updated, and occasionally - let them refresh */ + * be available to anyone else. + * This can also be used to hook into which folders are being updated, and occasionally + * let them refresh */ static CamelFolder * receive_get_folder (CamelFilterDriver *d, const gchar *uri, @@ -904,7 +917,9 @@ receive_get_folder (CamelFilterDriver *d, /* ********************************************************************** */ static void -get_folders (CamelStore *store, GPtrArray *folders, CamelFolderInfo *info) +get_folders (CamelStore *store, + GPtrArray *folders, + CamelFolderInfo *info) { while (info) { if (camel_store_can_refresh_folder (store, info, NULL)) { @@ -923,7 +938,8 @@ get_folders (CamelStore *store, GPtrArray *folders, CamelFolderInfo *info) } static void -main_op_cancelled_cb (GCancellable *main_op, GCancellable *refresh_op) +main_op_cancelled_cb (GCancellable *main_op, + GCancellable *refresh_op) { g_cancellable_cancel (refresh_op); } @@ -962,7 +978,7 @@ refresh_folders_exec (struct _refresh_folders_msg *m, camel_operation_push_message (m->info->cancellable, _("Updating...")); - for (i=0;i<m->folders->len;i++) { + for (i = 0; i < m->folders->len; i++) { folder = e_mail_session_uri_to_folder_sync ( m->info->session, m->folders->pdata[i], 0, @@ -1003,7 +1019,7 @@ refresh_folders_free (struct _refresh_folders_msg *m) { gint i; - for (i=0;i<m->folders->len;i++) + for (i = 0; i < m->folders->len; i++) g_free (m->folders->pdata[i]); g_ptr_array_free (m->folders, TRUE); @@ -1068,7 +1084,9 @@ receive_update_got_store (CamelStore *store, } static GtkWidget * -send_receive (GtkWindow *parent, EMailSession *session, gboolean allow_send) +send_receive (GtkWindow *parent, + EMailSession *session, + gboolean allow_send) { CamelFolder *local_outbox; struct _send_data *data; @@ -1142,13 +1160,15 @@ send_receive (GtkWindow *parent, EMailSession *session, gboolean allow_send) } GtkWidget * -mail_send_receive (GtkWindow *parent, EMailSession *session) +mail_send_receive (GtkWindow *parent, + EMailSession *session) { return send_receive (parent, session, TRUE); } GtkWidget * -mail_receive (GtkWindow *parent, EMailSession *session) +mail_receive (GtkWindow *parent, + EMailSession *session) { return send_receive (parent, session, FALSE); } @@ -1174,7 +1194,9 @@ auto_timeout (gpointer data) } static void -auto_account_removed (EAccountList *eal, EAccount *ea, gpointer dummy) +auto_account_removed (EAccountList *eal, + EAccount *ea, + gpointer dummy) { struct _auto_data *info = g_object_get_data((GObject *)ea, "mail-autoreceive"); @@ -1187,7 +1209,7 @@ auto_account_removed (EAccountList *eal, EAccount *ea, gpointer dummy) } static void -auto_account_finalised (struct _auto_data *info) +auto_account_finalized (struct _auto_data *info) { if (info->session != NULL) g_object_unref (info->session); @@ -1204,7 +1226,7 @@ auto_account_commit (struct _auto_data *info) check = info->account->enabled && e_account_get_bool (info->account, E_ACCOUNT_SOURCE_AUTO_CHECK) && e_account_get_string (info->account, E_ACCOUNT_SOURCE_URL); - period = e_account_get_int (info->account, E_ACCOUNT_SOURCE_AUTO_CHECK_TIME)*60; + period = e_account_get_int (info->account, E_ACCOUNT_SOURCE_AUTO_CHECK_TIME) * 60; period = MAX (60, period); if (info->timeout_id @@ -1230,12 +1252,14 @@ auto_account_added (EAccountList *eal, info->session = g_object_ref (session); g_object_set_data_full ( G_OBJECT (ea), "mail-autoreceive", info, - (GDestroyNotify) auto_account_finalised); + (GDestroyNotify) auto_account_finalized); auto_account_commit (info); } static void -auto_account_changed (EAccountList *eal, EAccount *ea, gpointer dummy) +auto_account_changed (EAccountList *eal, + EAccount *ea, + gpointer dummy) { struct _auto_data *info = g_object_get_data((GObject *)ea, "mail-autoreceive"); diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 476ed67fdb..9ef758f06f 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -180,11 +180,11 @@ mail_tool_remove_xevolution_headers (CamelMimeMessage *message) { struct _camel_header_raw *scan, *list = NULL; - for (scan = ((CamelMimePart *) message)->headers;scan;scan=scan->next) + for (scan = ((CamelMimePart *) message)->headers; scan; scan = scan->next) if (!strncmp(scan->name, "X-Evolution", 11)) camel_header_raw_append (&list, scan->name, scan->value, scan->offset); - for (scan=list;scan;scan=scan->next) + for (scan = list; scan; scan = scan->next) camel_medium_remove_header ((CamelMedium *) message, scan->name); return list; @@ -198,7 +198,7 @@ mail_tool_restore_xevolution_headers (CamelMimeMessage *message, medium = CAMEL_MEDIUM (message); - for (;xev;xev=xev->next) + for (; xev; xev = xev->next) camel_medium_add_header (medium, xev->name, xev->value); } diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index 71431e3fe0..78d0863e0c 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -68,7 +68,7 @@ static GQueue source_folders_local = G_QUEUE_INIT; static GHashTable *vfolder_hash; /* This is a slightly hacky solution to shutting down, we poll this variable in various - loops, and just quit processing if it is set. */ + * loops, and just quit processing if it is set. */ static volatile gint vfolder_shutdown; /* are we shutting down? */ static void rule_changed (EFilterRule *rule, CamelFolder *folder); @@ -347,7 +347,8 @@ mv_find_folder (GQueue *queue, } static gint -uri_is_ignore (EMailBackend *backend, const gchar *uri) +uri_is_ignore (EMailBackend *backend, + const gchar *uri) { EMailSession *session; CamelSession *camel_session; @@ -608,7 +609,7 @@ mail_vfolder_delete_folder (EMailBackend *backend, source = NULL; while ((source = em_vfolder_rule_next_source (vf_rule, source))) { /* Remove all sources that match, ignore changed events though - because the adduri call above does the work async */ + * because the adduri call above does the work async */ if (e_mail_folder_uri_equal (CAMEL_SESSION (session), uri, source)) { vf = g_hash_table_lookup ( vfolder_hash, rule->name); @@ -739,7 +740,7 @@ mail_vfolder_rename_folder (CamelStore *store, source = NULL; while ((source = em_vfolder_rule_next_source (vf_rule, source))) { /* Remove all sources that match, ignore changed events though - because the adduri call above does the work async */ + * because the adduri call above does the work async */ if (e_mail_folder_uri_equal (session, old_uri, source)) { vf = g_hash_table_lookup (vfolder_hash, rule->name); if (!vf) { @@ -832,7 +833,8 @@ rule_add_sources (EMailSession *session, } static void -rule_changed (EFilterRule *rule, CamelFolder *folder) +rule_changed (EFilterRule *rule, + CamelFolder *folder) { EMailBackend *backend; EMailSession *session; @@ -915,7 +917,7 @@ context_rule_added (ERuleContext *ctx, folder = camel_store_get_folder_sync ( vfolder_store, rule->name, 0, NULL, NULL); if (folder) { - g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), folder); + g_signal_connect (rule, "changed", G_CALLBACK(rule_changed), folder); G_LOCK (vfolder); g_hash_table_insert (vfolder_hash, g_strdup (rule->name), folder); @@ -1025,10 +1027,10 @@ store_folder_renamed_cb (CamelStore *store, } g_signal_handlers_disconnect_matched ( - rule, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, + rule, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, rule_changed, folder); e_filter_rule_set_name (rule, info->full_name); - g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), folder); + g_signal_connect (rule, "changed", G_CALLBACK(rule_changed), folder); config_dir = mail_session_get_config_dir (); user = g_build_filename (config_dir, "vfolders.xml", NULL); @@ -1251,7 +1253,9 @@ vfolder_edit (EShellView *shell_view) } static void -vfolder_edit_response_cb (GtkWidget *dialog, gint response_id, gpointer user_data) +vfolder_edit_response_cb (GtkWidget *dialog, + gint response_id, + gpointer user_data) { if (response_id == GTK_RESPONSE_OK) { EFilterRule *rule = g_object_get_data (G_OBJECT (dialog), "vfolder-rule"); @@ -1335,7 +1339,9 @@ vfolder_edit_rule (EMailBackend *backend, } static void -new_rule_clicked (GtkWidget *w, gint button, gpointer data) +new_rule_clicked (GtkWidget *w, + gint button, + gpointer data) { if (button == GTK_RESPONSE_OK) { const gchar *config_dir; @@ -1369,7 +1375,8 @@ new_rule_clicked (GtkWidget *w, gint button, gpointer data) } static void -new_rule_changed_cb (EFilterRule *rule, GtkDialog *dialog) +new_rule_changed_cb (EFilterRule *rule, + GtkDialog *dialog) { g_return_if_fail (rule != NULL); g_return_if_fail (dialog != NULL); @@ -1387,7 +1394,8 @@ vfolder_create_part (const gchar *name) /* clones a filter/search rule into a matching vfolder rule * (assuming the same system definitions) */ EFilterRule * -vfolder_clone_rule (EMailBackend *backend, EFilterRule *in) +vfolder_clone_rule (EMailBackend *backend, + EFilterRule *in) { EFilterRule *rule; xmlNodePtr xml; @@ -1429,9 +1437,9 @@ vfolder_gui_add_rule (EMVFolderRule *rule) gtk_box_pack_start (GTK_BOX (container), w, TRUE, TRUE, 0); gtk_widget_show ((GtkWidget *) gd); g_object_set_data_full(G_OBJECT(gd), "rule", rule, (GDestroyNotify)g_object_unref); - g_signal_connect(rule, "changed", G_CALLBACK (new_rule_changed_cb), gd); - new_rule_changed_cb ((EFilterRule*) rule, gd); - g_signal_connect(gd, "response", G_CALLBACK(new_rule_clicked), NULL); + g_signal_connect (rule, "changed", G_CALLBACK (new_rule_changed_cb), gd); + new_rule_changed_cb ((EFilterRule *) rule, gd); + g_signal_connect (gd, "response", G_CALLBACK(new_rule_clicked), NULL); gtk_widget_show ((GtkWidget *) gd); } @@ -1445,7 +1453,7 @@ vfolder_gui_add_from_message (EMailSession *session, g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message)); - rule = (EMVFolderRule*) em_vfolder_rule_from_message ( + rule = (EMVFolderRule *) em_vfolder_rule_from_message ( context, message, flags, folder); vfolder_gui_add_rule (rule); } @@ -1460,13 +1468,15 @@ vfolder_gui_add_from_address (EMailSession *session, g_return_if_fail (addr != NULL); - rule = (EMVFolderRule*) em_vfolder_rule_from_address ( + rule = (EMVFolderRule *) em_vfolder_rule_from_address ( context, addr, flags, folder); vfolder_gui_add_rule (rule); } static void -vfolder_foreach_cb (gpointer key, gpointer data, gpointer user_data) +vfolder_foreach_cb (gpointer key, + gpointer data, + gpointer user_data) { CamelFolder *folder = CAMEL_FOLDER (data); diff --git a/mail/message-list.c b/mail/message-list.c index 2529e10e7f..1c634b91b8 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -309,7 +309,8 @@ e_mail_address_free (EMailAddress *addr) } static gint -e_mail_address_compare (gconstpointer address1, gconstpointer address2) +e_mail_address_compare (gconstpointer address1, + gconstpointer address2) { const EMailAddress *addr1 = address1; const EMailAddress *addr2 = address2; @@ -368,7 +369,9 @@ e_mail_address_compare (gconstpointer address1, gconstpointer address2) #endif /* SMART_ADDRESS_COMPARE */ static gint -address_compare (gconstpointer address1, gconstpointer address2, gpointer cmp_cache) +address_compare (gconstpointer address1, + gconstpointer address2, + gpointer cmp_cache) { #ifdef SMART_ADDRESS_COMPARE EMailAddress *addr1, *addr2; @@ -411,7 +414,8 @@ filter_size (gint size) /* Gets the uid of the message displayed at a given view row */ static const gchar * -get_message_uid (MessageList *message_list, ETreePath node) +get_message_uid (MessageList *message_list, + ETreePath node) { CamelMessageInfo *info; @@ -427,7 +431,8 @@ get_message_uid (MessageList *message_list, ETreePath node) * view row. */ static CamelMessageInfo * -get_message_info (MessageList *message_list, ETreePath node) +get_message_info (MessageList *message_list, + ETreePath node) { CamelMessageInfo *info; @@ -439,7 +444,9 @@ get_message_info (MessageList *message_list, ETreePath node) } static const gchar * -get_normalised_string (MessageList *message_list, CamelMessageInfo *info, gint col) +get_normalised_string (MessageList *message_list, + CamelMessageInfo *info, + gint col) { const gchar *string, *str; gchar *normalised; @@ -517,7 +524,8 @@ get_normalised_string (MessageList *message_list, CamelMessageInfo *info, gint c } static void -clear_selection (MessageList *ml, struct _MLSelection *selection) +clear_selection (MessageList *ml, + struct _MLSelection *selection) { if (selection->uids) { em_utils_uids_free (selection->uids); @@ -530,7 +538,11 @@ clear_selection (MessageList *ml, struct _MLSelection *selection) } static ETreePath -ml_search_forward (MessageList *ml, gint start, gint end, guint32 flags, guint32 mask) +ml_search_forward (MessageList *ml, + gint start, + gint end, + guint32 flags, + guint32 mask) { ETreePath path; gint row; @@ -551,7 +563,11 @@ ml_search_forward (MessageList *ml, gint start, gint end, guint32 flags, guint32 } static ETreePath -ml_search_backward (MessageList *ml, gint start, gint end, guint32 flags, guint32 mask) +ml_search_backward (MessageList *ml, + gint start, + gint end, + guint32 flags, + guint32 mask) { ETreePath path; gint row; @@ -572,7 +588,10 @@ ml_search_backward (MessageList *ml, gint start, gint end, guint32 flags, guint3 } static ETreePath -ml_search_path (MessageList *ml, MessageListSelectDirection direction, guint32 flags, guint32 mask) +ml_search_path (MessageList *ml, + MessageListSelectDirection direction, + guint32 flags, + guint32 mask) { ETreePath node; gint row, count; @@ -592,20 +611,21 @@ ml_search_path (MessageList *ml, MessageListSelectDirection direction, guint32 f if ((direction & MESSAGE_LIST_SELECT_DIRECTION) == MESSAGE_LIST_SELECT_NEXT) node = ml_search_forward (ml, row + 1, count - 1, flags, mask); else - node = ml_search_backward (ml, row-1, 0, flags, mask); + node = ml_search_backward (ml, row - 1, 0, flags, mask); if (node == NULL && (direction & MESSAGE_LIST_SELECT_WRAP)) { if ((direction & MESSAGE_LIST_SELECT_DIRECTION) == MESSAGE_LIST_SELECT_NEXT) node = ml_search_forward (ml, 0, row, flags, mask); else - node = ml_search_backward (ml, count-1, row, flags, mask); + node = ml_search_backward (ml, count - 1, row, flags, mask); } return node; } static void -select_path (MessageList *ml, ETreePath path) +select_path (MessageList *ml, + ETreePath path) { ETree *tree; ETreeTableAdapter *etta; @@ -643,7 +663,10 @@ select_path (MessageList *ml, ETreePath path) * Returns %TRUE if a new message has been selected or %FALSE otherwise. **/ gboolean -message_list_select (MessageList *ml, MessageListSelectDirection direction, guint32 flags, guint32 mask) +message_list_select (MessageList *ml, + MessageListSelectDirection direction, + guint32 flags, + guint32 mask) { ETreePath path; @@ -673,7 +696,10 @@ message_list_select (MessageList *ml, MessageListSelectDirection direction, guin * Return value: **/ gboolean -message_list_can_select (MessageList *ml, MessageListSelectDirection direction, guint32 flags, guint32 mask) +message_list_can_select (MessageList *ml, + MessageListSelectDirection direction, + guint32 flags, + guint32 mask) { return ml_search_path (ml, direction, flags, mask) != NULL; } @@ -771,7 +797,7 @@ message_list_select_next_thread (MessageList *ml) count = e_table_model_row_count ((ETableModel *) etta); /* find the next node which has a root parent (i.e. toplevel node) */ - for (i=row+1;i<count-1;i++) { + for (i = row + 1; i < count - 1; i++) { node = e_tree_table_adapter_node_at_row (etta, i); if (node && e_tree_model_node_is_root (ml->model, e_tree_model_node_get_parent (ml->model, node))) { @@ -862,16 +888,20 @@ typedef struct thread_select_info { } thread_select_info_t; static gboolean -select_node (ETreeModel *model, ETreePath path, gpointer user_data) +select_node (ETreeModel *model, + ETreePath path, + gpointer user_data) { thread_select_info_t *tsi = (thread_select_info_t *) user_data; g_ptr_array_add (tsi->paths, path); - return FALSE; /*not done yet*/ + return FALSE; /*not done yet */ } static void -select_thread (MessageList *message_list, void (*selector)(ETreePath, gpointer)) +select_thread (MessageList *message_list, + void (*selector) (ETreePath, + gpointer)) { ETree *tree; ETreeSelectionModel *etsm; @@ -891,7 +921,8 @@ select_thread (MessageList *message_list, void (*selector)(ETreePath, gpointer)) } static void -thread_select_foreach (ETreePath path, gpointer user_data) +thread_select_foreach (ETreePath path, + gpointer user_data) { thread_select_info_t *tsi = (thread_select_info_t *) user_data; ETreeModel *model = tsi->ml->model; @@ -922,7 +953,8 @@ message_list_select_thread (MessageList *message_list) } static void -subthread_select_foreach (ETreePath path, gpointer user_data) +subthread_select_foreach (ETreePath path, + gpointer user_data) { thread_select_info_t *tsi = (thread_select_info_t *) user_data; ETreeModel *model = tsi->ml->model; @@ -959,7 +991,8 @@ message_list_invert_selection (MessageList *message_list) } void -message_list_copy (MessageList *ml, gboolean cut) +message_list_copy (MessageList *ml, + gboolean cut) { MessageListPrivate *p = ml->priv; GPtrArray *uids; @@ -973,7 +1006,7 @@ message_list_copy (MessageList *ml, gboolean cut) gint i; camel_folder_freeze (ml->folder); - for (i=0;i<uids->len;i++) + for (i = 0; i < uids->len; i++) camel_folder_set_message_flags ( ml->folder, uids->pdata[i], CAMEL_MESSAGE_SEEN | @@ -1005,7 +1038,8 @@ message_list_paste (MessageList *ml) * SimpleTableModel::col_count */ static gint -ml_column_count (ETreeModel *etm, gpointer data) +ml_column_count (ETreeModel *etm, + gpointer data) { return COL_LAST; } @@ -1014,7 +1048,8 @@ ml_column_count (ETreeModel *etm, gpointer data) * SimpleTableModel::has_save_id */ static gboolean -ml_has_save_id (ETreeModel *etm, gpointer data) +ml_has_save_id (ETreeModel *etm, + gpointer data) { return TRUE; } @@ -1023,7 +1058,9 @@ ml_has_save_id (ETreeModel *etm, gpointer data) * SimpleTableModel::get_save_id */ static gchar * -ml_get_save_id (ETreeModel *etm, ETreePath path, gpointer data) +ml_get_save_id (ETreeModel *etm, + ETreePath path, + gpointer data) { CamelMessageInfo *info; @@ -1031,7 +1068,7 @@ ml_get_save_id (ETreeModel *etm, ETreePath path, gpointer data) return g_strdup("root"); /* Note: etable can ask for the save_id while we're clearing it, - which is the only time data should be null */ + * which is the only time data should be null */ info = e_tree_memory_node_get_data (E_TREE_MEMORY (etm), path); if (info == NULL) return NULL; @@ -1043,7 +1080,8 @@ ml_get_save_id (ETreeModel *etm, ETreePath path, gpointer data) * SimpleTableModel::has_save_id */ static gboolean -ml_has_get_node_by_id (ETreeModel *etm, gpointer data) +ml_has_get_node_by_id (ETreeModel *etm, + gpointer data) { return TRUE; } @@ -1052,7 +1090,9 @@ ml_has_get_node_by_id (ETreeModel *etm, gpointer data) * SimpleTableModel::get_save_id */ static ETreePath -ml_get_node_by_id (ETreeModel *etm, const gchar *save_id, gpointer data) +ml_get_node_by_id (ETreeModel *etm, + const gchar *save_id, + gpointer data) { MessageList *ml; @@ -1065,7 +1105,10 @@ ml_get_node_by_id (ETreeModel *etm, const gchar *save_id, gpointer data) } static gpointer -ml_duplicate_value (ETreeModel *etm, gint col, gconstpointer value, gpointer data) +ml_duplicate_value (ETreeModel *etm, + gint col, + gconstpointer value, + gpointer data) { switch (col) { case COL_MESSAGE_STATUS: @@ -1099,7 +1142,10 @@ ml_duplicate_value (ETreeModel *etm, gint col, gconstpointer value, gpointer dat } static void -ml_free_value (ETreeModel *etm, gint col, gpointer value, gpointer data) +ml_free_value (ETreeModel *etm, + gint col, + gpointer value, + gpointer data) { switch (col) { case COL_MESSAGE_STATUS: @@ -1138,7 +1184,9 @@ ml_free_value (ETreeModel *etm, gint col, gpointer value, gpointer data) } static gpointer -ml_initialize_value (ETreeModel *etm, gint col, gpointer data) +ml_initialize_value (ETreeModel *etm, + gint col, + gpointer data) { switch (col) { case COL_MESSAGE_STATUS: @@ -1173,7 +1221,10 @@ ml_initialize_value (ETreeModel *etm, gint col, gpointer data) } static gboolean -ml_value_is_empty (ETreeModel *etm, gint col, gconstpointer value, gpointer data) +ml_value_is_empty (ETreeModel *etm, + gint col, + gconstpointer value, + gpointer data) { switch (col) { case COL_MESSAGE_STATUS: @@ -1226,7 +1277,10 @@ static const gchar *score_map[] = { }; static gchar * -ml_value_to_string (ETreeModel *etm, gint col, gconstpointer value, gpointer data) +ml_value_to_string (ETreeModel *etm, + gint col, + gconstpointer value, + gpointer data) { guint i; @@ -1276,15 +1330,20 @@ ml_value_to_string (ETreeModel *etm, gint col, gconstpointer value, gpointer dat } static GdkPixbuf * -ml_tree_icon_at (ETreeModel *etm, ETreePath path, gpointer model_data) +ml_tree_icon_at (ETreeModel *etm, + ETreePath path, + gpointer model_data) { /* we dont really need an icon ... */ return NULL; } static void -for_node_and_subtree_if_collapsed (MessageList *ml, ETreePath node, CamelMessageInfo *mi, - ETreePathFunc func, gpointer data) +for_node_and_subtree_if_collapsed (MessageList *ml, + ETreePath node, + CamelMessageInfo *mi, + ETreePathFunc func, + gpointer data) { ETreeModel *etm = ml->model; ETreePath child; @@ -1300,7 +1359,9 @@ for_node_and_subtree_if_collapsed (MessageList *ml, ETreePath node, CamelMessage } static gboolean -unread_foreach (ETreeModel *etm, ETreePath node, gpointer data) +unread_foreach (ETreeModel *etm, + ETreePath node, + gpointer data) { gboolean *saw_unread = data; CamelMessageInfo *info; @@ -1323,7 +1384,9 @@ struct LatestData { }; static gboolean -latest_foreach (ETreeModel *etm, ETreePath node, gpointer data) +latest_foreach (ETreeModel *etm, + ETreePath node, + gpointer data) { struct LatestData *ld = data; CamelMessageInfo *info; @@ -1393,7 +1456,8 @@ struct LabelsData { }; static void -add_label_if_known (struct LabelsData *ld, const gchar *tag) +add_label_if_known (struct LabelsData *ld, + const gchar *tag) { GtkTreeIter label_defn; @@ -1406,7 +1470,9 @@ add_label_if_known (struct LabelsData *ld, const gchar *tag) } static gboolean -add_all_labels_foreach (ETreeModel *etm, ETreePath node, gpointer data) +add_all_labels_foreach (ETreeModel *etm, + ETreePath node, + gpointer data) { struct LabelsData *ld = data; CamelMessageInfo *msg_info; @@ -1554,7 +1620,7 @@ ml_tree_value_at_ex (ETreeModel *etm, const gchar *tag, *cmp; /* FIXME: this all should be methods off of message-tag-followup class, - FIXME: the tag names should be namespaced :( */ + * FIXME: the tag names should be namespaced :( */ tag = camel_message_info_user_tag(msg_info, "follow-up"); cmp = camel_message_info_user_tag(msg_info, "completed-on"); if (tag && tag[0]) { @@ -1768,7 +1834,10 @@ ml_tree_value_at_ex (ETreeModel *etm, } static gpointer -ml_tree_value_at (ETreeModel *etm, ETreePath path, gint col, gpointer model_data) +ml_tree_value_at (ETreeModel *etm, + ETreePath path, + gint col, + gpointer model_data) { MessageList *message_list = model_data; CamelMessageInfo *msg_info; @@ -1784,7 +1853,10 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, gint col, gpointer model_data } static gpointer -ml_tree_sort_value_at (ETreeModel *etm, ETreePath path, gint col, gpointer model_data) +ml_tree_sort_value_at (ETreeModel *etm, + ETreePath path, + gint col, + gpointer model_data) { MessageList *message_list = model_data; struct LatestData ld; @@ -1806,14 +1878,20 @@ ml_tree_sort_value_at (ETreeModel *etm, ETreePath path, gint col, gpointer model } static void -ml_tree_set_value_at (ETreeModel *etm, ETreePath path, gint col, - gconstpointer val, gpointer model_data) +ml_tree_set_value_at (ETreeModel *etm, + ETreePath path, + gint col, + gconstpointer val, + gpointer model_data) { g_warning ("This shouldn't be reached\n"); } static gboolean -ml_tree_is_cell_editable (ETreeModel *etm, ETreePath path, gint col, gpointer model_data) +ml_tree_is_cell_editable (ETreeModel *etm, + ETreePath path, + gint col, + gpointer model_data) { return FALSE; } @@ -1905,13 +1983,13 @@ static ECell * create_composite_cell (gint col) cell_date = e_cell_date_new (NULL, GTK_JUSTIFY_RIGHT); e_cell_date_set_format_component (E_CELL_DATE (cell_date), "mail"); - g_object_set (G_OBJECT (cell_date), + g_object_set (cell_date, "bold_column", COL_UNREAD, "color_column", COL_COLOUR, NULL); cell_from = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell_from), + g_object_set (cell_from, "bold_column", COL_UNREAD, "color_column", COL_COLOUR, NULL); @@ -1923,9 +2001,8 @@ static ECell * create_composite_cell (gint col) g_object_unref (cell_attach); g_object_unref (cell_date); - cell_sub = e_cell_text_new (fixed_name? fixed_name:NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell_sub), -/* "bold_column", COL_UNREAD, */ + cell_sub = e_cell_text_new (fixed_name? fixed_name : NULL, GTK_JUSTIFY_LEFT); + g_object_set (cell_sub, "color_column", COL_COLOUR, NULL); cell_tree = e_cell_tree_new (TRUE, cell_sub); @@ -1945,10 +2022,11 @@ static ECell * create_composite_cell (gint col) } static void -composite_cell_set_strike_col (ECell *cell, gint col) +composite_cell_set_strike_col (ECell *cell, + gint col) { - g_object_set (G_OBJECT (g_object_get_data(G_OBJECT (cell), "cell_date")), "strikeout_column", col, NULL); - g_object_set (G_OBJECT (g_object_get_data(G_OBJECT (cell), "cell_from")), "strikeout_column", col, NULL); + g_object_set (g_object_get_data(G_OBJECT (cell), "cell_date"), "strikeout_column", col, NULL); + g_object_set (g_object_get_data(G_OBJECT (cell), "cell_from"), "strikeout_column", col, NULL); } static ETableExtras * @@ -1994,7 +2072,7 @@ message_list_create_extras (void) /* date cell */ cell = e_cell_date_new (NULL, GTK_JUSTIFY_LEFT); e_cell_date_set_format_component (E_CELL_DATE (cell), "mail"); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "bold_column", COL_UNREAD, "color_column", COL_COLOUR, NULL); @@ -2003,7 +2081,7 @@ message_list_create_extras (void) /* text cell */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "bold_column", COL_UNREAD, "color_column", COL_COLOUR, NULL); @@ -2016,7 +2094,7 @@ message_list_create_extras (void) /* size cell */ cell = e_cell_size_new (NULL, GTK_JUSTIFY_RIGHT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "bold_column", COL_UNREAD, "color_column", COL_COLOUR, NULL); @@ -2055,7 +2133,8 @@ save_tree_state (MessageList *ml) } static void -load_tree_state (MessageList *ml, xmlDoc *expand_state) +load_tree_state (MessageList *ml, + xmlDoc *expand_state) { if (ml->folder == NULL) return; @@ -2081,7 +2160,8 @@ message_list_save_state (MessageList *ml) } static void -message_list_setup_etree (MessageList *message_list, gboolean outgoing) +message_list_setup_etree (MessageList *message_list, + gboolean outgoing) { /* build the spec based on the folder, and possibly from a saved file */ /* otherwise, leave default */ @@ -2100,7 +2180,11 @@ message_list_setup_etree (MessageList *message_list, gboolean outgoing) } static void -ml_selection_get (GtkWidget *widget, GtkSelectionData *data, guint info, guint time_stamp, MessageList *ml) +ml_selection_get (GtkWidget *widget, + GtkSelectionData *data, + guint info, + guint time_stamp, + MessageList *ml) { struct _MLSelection *selection; @@ -2121,7 +2205,9 @@ ml_selection_get (GtkWidget *widget, GtkSelectionData *data, guint info, guint t } static gboolean -ml_selection_clear_event (GtkWidget *widget, GdkEventSelection *event, MessageList *ml) +ml_selection_clear_event (GtkWidget *widget, + GdkEventSelection *event, + MessageList *ml) { MessageListPrivate *p = ml->priv; @@ -2157,9 +2243,15 @@ ml_selection_received (GtkWidget *widget, } static void -ml_tree_drag_data_get (ETree *tree, gint row, ETreePath path, gint col, - GdkDragContext *context, GtkSelectionData *data, - guint info, guint time, MessageList *ml) +ml_tree_drag_data_get (ETree *tree, + gint row, + ETreePath path, + gint col, + GdkDragContext *context, + GtkSelectionData *data, + guint info, + guint time, + MessageList *ml) { GPtrArray *uids; @@ -2195,9 +2287,9 @@ struct _drop_msg { guint32 action; guint info; - guint move:1; - guint moved:1; - guint aborted:1; + guint move : 1; + guint moved : 1; + guint aborted : 1; }; static gchar * @@ -2324,7 +2416,8 @@ struct search_child_struct { }; static void -search_child_cb (GtkWidget *widget, gpointer data) +search_child_cb (GtkWidget *widget, + gpointer data) { struct search_child_struct *search = (struct search_child_struct *) data; @@ -2332,7 +2425,8 @@ search_child_cb (GtkWidget *widget, gpointer data) } static gboolean -is_tree_widget_children (ETree *tree, gconstpointer widget) +is_tree_widget_children (ETree *tree, + gconstpointer widget) { struct search_child_struct search; @@ -2345,7 +2439,12 @@ is_tree_widget_children (ETree *tree, gconstpointer widget) } static gboolean -ml_tree_drag_motion (ETree *tree, GdkDragContext *context, gint x, gint y, guint time, MessageList *ml) +ml_tree_drag_motion (ETree *tree, + GdkDragContext *context, + gint x, + gint y, + guint time, + MessageList *ml) { GList *targets; GdkDragAction action, actions = 0; @@ -2399,13 +2498,16 @@ ml_tree_drag_motion (ETree *tree, GdkDragContext *context, gint x, gint y, guint } static void -on_model_row_changed (ETableModel *model, gint row, MessageList *ml) +on_model_row_changed (ETableModel *model, + gint row, + MessageList *ml) { ml->priv->any_row_changed = TRUE; } static gboolean -ml_tree_sorting_changed (ETreeTableAdapter *adapter, MessageList *ml) +ml_tree_sorting_changed (ETreeTableAdapter *adapter, + MessageList *ml) { g_return_val_if_fail (ml != NULL, FALSE); @@ -2479,9 +2581,9 @@ message_list_init (MessageList *message_list) gtk_selection_add_target (p->invisible, GDK_SELECTION_CLIPBOARD, matom, 0); gtk_selection_add_target (p->invisible, GDK_SELECTION_CLIPBOARD, GDK_SELECTION_TYPE_STRING, 2); - g_signal_connect(p->invisible, "selection_get", G_CALLBACK(ml_selection_get), message_list); - g_signal_connect(p->invisible, "selection_clear_event", G_CALLBACK(ml_selection_clear_event), message_list); - g_signal_connect(p->invisible, "selection_received", G_CALLBACK(ml_selection_received), message_list); + g_signal_connect (p->invisible, "selection_get", G_CALLBACK(ml_selection_get), message_list); + g_signal_connect (p->invisible, "selection_clear_event", G_CALLBACK(ml_selection_clear_event), message_list); + g_signal_connect (p->invisible, "selection_received", G_CALLBACK(ml_selection_received), message_list); /* FIXME This is currently unused. */ target_list = gtk_target_list_new (NULL, 0); @@ -2729,7 +2831,9 @@ message_list_selectable_init (ESelectableInterface *interface) } static gboolean -read_boolean_with_default (GConfClient *gconf, const gchar *key, gboolean def_value) +read_boolean_with_default (GConfClient *gconf, + const gchar *key, + gboolean def_value) { GConfValue *value; gboolean res; @@ -2828,7 +2932,7 @@ message_list_construct (MessageList *message_list) e_tree_drag_source_set ( E_TREE (message_list), GDK_BUTTON1_MASK, ml_drag_types, G_N_ELEMENTS (ml_drag_types), - GDK_ACTION_MOVE|GDK_ACTION_COPY); + GDK_ACTION_MOVE | GDK_ACTION_COPY); g_signal_connect ( message_list, "tree_drag_data_get", @@ -2837,7 +2941,7 @@ message_list_construct (MessageList *message_list) e_tree_drag_dest_set ( E_TREE (message_list), GTK_DEST_DEFAULT_ALL, ml_drop_types, G_N_ELEMENTS (ml_drop_types), - GDK_ACTION_MOVE|GDK_ACTION_COPY); + GDK_ACTION_MOVE | GDK_ACTION_COPY); g_signal_connect ( message_list, "tree_drag_data_received", @@ -2920,7 +3024,9 @@ message_list_get_backend (MessageList *message_list) } static void -clear_info (gchar *key, ETreePath *node, MessageList *ml) +clear_info (gchar *key, + ETreePath *node, + MessageList *ml) { CamelMessageInfo *info; @@ -2930,13 +3036,14 @@ clear_info (gchar *key, ETreePath *node, MessageList *ml) } static void -clear_tree (MessageList *ml, gboolean tfree) +clear_tree (MessageList *ml, + gboolean tfree) { ETreeModel *etm = ml->model; #ifdef TIMEIT struct timeval start, end; - unsigned long diff; + gulong diff; printf("Clearing tree\n"); gettimeofday (&start, NULL); @@ -2963,8 +3070,8 @@ clear_tree (MessageList *ml, gboolean tfree) e_tree_model_rebuilt (E_TREE_MODEL (etm)); #ifdef TIMEIT gettimeofday (&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; + diff = end.tv_sec * 1000 + end.tv_usec / 1000; + diff -= start.tv_sec * 1000 + start.tv_usec / 1000; printf("Clearing tree took %ld.%03ld seconds\n", diff / 1000, diff % 1000); #endif @@ -2987,7 +3094,8 @@ folder_store_supports_vjunk_folder (CamelFolder *folder) /* Check if the given node is selectable in the current message list, * which depends on the type of the folder (normal, junk, trash). */ static gboolean -is_node_selectable (MessageList *ml, CamelMessageInfo *info) +is_node_selectable (MessageList *ml, + CamelMessageInfo *info) { gboolean is_junk_folder; gboolean is_trash_folder; @@ -3073,7 +3181,7 @@ find_next_selectable (MessageList *ml) } /* We didn't find any undeleted entries _below_ the currently selected one - * so let's try to find one _above_ */ + * * so let's try to find one _above_ */ vrow = vrow_orig - 1; while (vrow >= 0) { @@ -3164,7 +3272,9 @@ static void build_subtree (MessageList *ml, ETreePath parent, CamelFolderThreadN static void build_subtree_diff (MessageList *ml, ETreePath parent, ETreePath path, CamelFolderThreadNode *c, gint *row); static void -build_tree (MessageList *ml, CamelFolderThread *thread, CamelFolderChangeInfo *changes) +build_tree (MessageList *ml, + CamelFolderThread *thread, + CamelFolderChangeInfo *changes) { gint row = 0; ETreeModel *etm = ml->model; @@ -3177,7 +3287,7 @@ build_tree (MessageList *ml, CamelFolderThread *thread, CamelFolderChangeInfo *c #endif #ifdef TIMEIT struct timeval start, end; - unsigned long diff; + gulong diff; printf("Building tree\n"); gettimeofday (&start, NULL); @@ -3185,8 +3295,8 @@ build_tree (MessageList *ml, CamelFolderThread *thread, CamelFolderChangeInfo *c #ifdef TIMEIT gettimeofday (&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; + diff = end.tv_sec * 1000 + end.tv_usec / 1000; + diff -= start.tv_sec * 1000 + start.tv_usec / 1000; printf("Loading tree state took %ld.%03ld seconds\n", diff / 1000, diff % 1000); #endif @@ -3238,18 +3348,21 @@ build_tree (MessageList *ml, CamelFolderThread *thread, CamelFolderChangeInfo *c #ifdef TIMEIT gettimeofday (&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; + diff = end.tv_sec * 1000 + end.tv_usec / 1000; + diff -= start.tv_sec * 1000 + start.tv_usec / 1000; printf("Building tree took %ld.%03ld seconds\n", diff / 1000, diff % 1000); #endif } /* this is about 20% faster than build_subtree_diff, - entirely because e_tree_model_node_insert (xx, -1 xx) - is faster than inserting to the right row :( */ + * entirely because e_tree_model_node_insert (xx, -1 xx) + * is faster than inserting to the right row :( */ /* Otherwise, this code would probably go as it does the same thing essentially */ static void -build_subtree (MessageList *ml, ETreePath parent, CamelFolderThreadNode *c, gint *row) +build_subtree (MessageList *ml, + ETreePath parent, + CamelFolderThreadNode *c, + gint *row) { ETreePath node; @@ -3272,15 +3385,17 @@ build_subtree (MessageList *ml, ETreePath parent, CamelFolderThreadNode *c, gint } /* compares a thread tree node with the etable tree node to see if they point to - the same object */ + * the same object */ static gint -node_equal (ETreeModel *etm, ETreePath ap, CamelFolderThreadNode *bp) +node_equal (ETreeModel *etm, + ETreePath ap, + CamelFolderThreadNode *bp) { CamelMessageInfo *info; info = e_tree_memory_node_get_data (E_TREE_MEMORY (etm), ap); - if (bp->message && strcmp (camel_message_info_uid (info), camel_message_info_uid (bp->message))==0) + if (bp->message && strcmp (camel_message_info_uid (info), camel_message_info_uid (bp->message)) == 0) return 1; return 0; @@ -3289,7 +3404,9 @@ node_equal (ETreeModel *etm, ETreePath ap, CamelFolderThreadNode *bp) #ifndef BROKEN_ETREE /* debug function - compare the two trees to see if they are the same */ static gint -tree_equal (ETreeModel *etm, ETreePath ap, CamelFolderThreadNode *bp) +tree_equal (ETreeModel *etm, + ETreePath ap, + CamelFolderThreadNode *bp) { CamelMessageInfo *info; @@ -3329,7 +3446,12 @@ tree_equal (ETreeModel *etm, ETreePath ap, CamelFolderThreadNode *bp) /* adds a single node, retains save state, and handles adding children if required */ static void -add_node_diff (MessageList *ml, ETreePath parent, ETreePath path, CamelFolderThreadNode *c, gint *row, gint myrow) +add_node_diff (MessageList *ml, + ETreePath parent, + ETreePath path, + CamelFolderThreadNode *c, + gint *row, + gint myrow) { CamelMessageInfo *info; ETreePath node; @@ -3351,7 +3473,9 @@ add_node_diff (MessageList *ml, ETreePath parent, ETreePath path, CamelFolderThr /* removes node, children recursively and all associated data */ static void -remove_node_diff (MessageList *ml, ETreePath node, gint depth) +remove_node_diff (MessageList *ml, + ETreePath node, + gint depth) { ETreeModel *etm = ml->model; ETreePath cp, cn; @@ -3363,7 +3487,7 @@ remove_node_diff (MessageList *ml, ETreePath node, gint depth) cp = e_tree_model_node_get_first_child (etm, node); while (cp) { cn = e_tree_model_node_get_next (etm, cp); - remove_node_diff (ml, cp, depth+1); + remove_node_diff (ml, cp, depth + 1); cp = cn; } @@ -3379,9 +3503,13 @@ remove_node_diff (MessageList *ml, ETreePath node, gint depth) } /* applies a new tree structure to an existing tree, but only by changing things - that have changed */ + * that have changed */ static void -build_subtree_diff (MessageList *ml, ETreePath parent, ETreePath path, CamelFolderThreadNode *c, gint *row) +build_subtree_diff (MessageList *ml, + ETreePath parent, + ETreePath path, + CamelFolderThreadNode *c, + gint *row) { ETreeModel *etm = ml->model; ETreePath ap, *ai, *at, *tmp; @@ -3435,15 +3563,15 @@ build_subtree_diff (MessageList *ml, ETreePath parent, ETreePath path, CamelFold /* we have to scan each side for a match */ bi = bp->next; ai = e_tree_model_node_get_next (etm, ap); - for (i=1;bi!=NULL;i++,bi=bi->next) { + for (i = 1; bi != NULL; i++,bi = bi->next) { if (node_equal (etm, ap, bi)) break; } - for (j=1;ai!=NULL;j++,ai=e_tree_model_node_get_next (etm, ai)) { + for (j = 1; ai != NULL; j++,ai = e_tree_model_node_get_next (etm, ai)) { if (node_equal (etm, ai, bp)) break; } - if (i<j) { + if (i < j) { /* smaller run of new nodes - must be nodes to add */ if (bi) { bt = bp; @@ -3494,7 +3622,9 @@ static void build_flat_diff (MessageList *ml, CamelFolderChangeInfo *changes); #endif static void -build_flat (MessageList *ml, GPtrArray *summary, CamelFolderChangeInfo *changes) +build_flat (MessageList *ml, + GPtrArray *summary, + CamelFolderChangeInfo *changes) { ETreeModel *etm = ml->model; gchar *saveuid = NULL; @@ -3504,7 +3634,7 @@ build_flat (MessageList *ml, GPtrArray *summary, CamelFolderChangeInfo *changes) #endif #ifdef TIMEIT struct timeval start, end; - unsigned long diff; + gulong diff; printf("Building flat\n"); gettimeofday (&start, NULL); @@ -3549,15 +3679,16 @@ build_flat (MessageList *ml, GPtrArray *summary, CamelFolderChangeInfo *changes) #ifdef TIMEIT gettimeofday (&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; + diff = end.tv_sec * 1000 + end.tv_usec / 1000; + diff -= start.tv_sec * 1000 + start.tv_usec / 1000; printf("Building flat took %ld.%03ld seconds\n", diff / 1000, diff % 1000); #endif } static void -message_list_change_first_visible_parent (MessageList *ml, ETreePath node) +message_list_change_first_visible_parent (MessageList *ml, + ETreePath node) { ETreePath first_visible = NULL; @@ -3575,7 +3706,8 @@ message_list_change_first_visible_parent (MessageList *ml, ETreePath node) #ifndef BROKEN_ETREE static void -build_flat_diff (MessageList *ml, CamelFolderChangeInfo *changes) +build_flat_diff (MessageList *ml, + CamelFolderChangeInfo *changes) { gint i; ETreePath node; @@ -3583,7 +3715,7 @@ build_flat_diff (MessageList *ml, CamelFolderChangeInfo *changes) #ifdef TIMEIT struct timeval start, end; - unsigned long diff; + gulong diff; gettimeofday (&start, NULL); #endif @@ -3592,7 +3724,7 @@ build_flat_diff (MessageList *ml, CamelFolderChangeInfo *changes) /* remove individual nodes? */ d(printf("Removing messages from view:\n")); - for (i=0;i<changes->uid_removed->len;i++) { + for (i = 0; i < changes->uid_removed->len; i++) { node = g_hash_table_lookup (ml->uid_nodemap, changes->uid_removed->pdata[i]); if (node) { info = e_tree_memory_node_get_data (E_TREE_MEMORY (ml->model), node); @@ -3603,7 +3735,7 @@ build_flat_diff (MessageList *ml, CamelFolderChangeInfo *changes) /* add new nodes? - just append to the end */ d(printf("Adding messages to view:\n")); - for (i=0;i<changes->uid_added->len;i++) { + for (i = 0; i < changes->uid_added->len; i++) { info = camel_folder_get_message_info (ml->folder, changes->uid_added->pdata[i]); if (info) { d(printf(" %s\n", (gchar *)changes->uid_added->pdata[i])); @@ -3625,8 +3757,8 @@ build_flat_diff (MessageList *ml, CamelFolderChangeInfo *changes) #ifdef TIMEIT gettimeofday (&end, NULL); - diff = end.tv_sec * 1000 + end.tv_usec/1000; - diff -= start.tv_sec * 1000 + start.tv_usec/1000; + diff = end.tv_sec * 1000 + end.tv_usec / 1000; + diff -= start.tv_sec * 1000 + start.tv_usec / 1000; printf("Inserting changes took %ld.%03ld seconds\n", diff / 1000, diff % 1000); #endif @@ -3898,7 +4030,10 @@ on_cursor_activated_idle (gpointer data) } static void -on_cursor_activated_cmd (ETree *tree, gint row, ETreePath path, gpointer user_data) +on_cursor_activated_cmd (ETree *tree, + gint row, + ETreePath path, + gpointer user_data) { MessageList *message_list = MESSAGE_LIST (user_data); const gchar *new_uid; @@ -3908,11 +4043,12 @@ on_cursor_activated_cmd (ETree *tree, gint row, ETreePath path, gpointer user_da else new_uid = get_message_uid (message_list, path); - /* Do not check the cursor_uid and the new_uid values, because the selected item - (set in on_selection_changed_cmd) can be different from the one with a cursor - (when selecting with Ctrl, for example). This has a little side-effect, when - keeping list it that state, then changing folders forth and back will select - and move cursor to that selected item. Does anybody consider it as a bug? */ + /* Do not check the cursor_uid and the new_uid values, because the + * selected item (set in on_selection_changed_cmd) can be different + * from the one with a cursor (when selecting with Ctrl, for example). + * This has a little side-effect, when keeping list it that state, + * then changing folders forth and back will select and move cursor + * to that selected item. Does anybody consider it as a bug? */ if ((message_list->cursor_uid == NULL && new_uid == NULL) || (message_list->last_sel_single && message_list->cursor_uid != NULL && new_uid != NULL)) return; @@ -3928,14 +4064,15 @@ on_cursor_activated_cmd (ETree *tree, gint row, ETreePath path, gpointer user_da } static void -on_selection_changed_cmd (ETree *tree, MessageList *ml) +on_selection_changed_cmd (ETree *tree, + MessageList *ml) { GPtrArray *uids; const gchar *newuid; ETreePath cursor; /* not sure if we could just ignore this for the cursor, i think sometimes you - only get a selection changed when you should also get a cursor activated? */ + * only get a selection changed when you should also get a cursor activated? */ uids = message_list_get_selected (ml); if (uids->len == 1) newuid = g_ptr_array_index (uids, 0); @@ -3945,8 +4082,8 @@ on_selection_changed_cmd (ETree *tree, MessageList *ml) newuid = NULL; /* If the selection isn't empty, then we ignore the no-uid check, since this event - is also used for other updating. If it is empty, it might just be a setup event - from etree which we do need to ignore */ + * is also used for other updating. If it is empty, it might just be a setup event + * from etree which we do need to ignore */ if ((newuid == NULL && ml->cursor_uid == NULL && uids->len == 0) || (ml->last_sel_single && uids->len == 1 && newuid != NULL && ml->cursor_uid != NULL && !strcmp (ml->cursor_uid, newuid))) { /* noop */ @@ -3963,7 +4100,12 @@ on_selection_changed_cmd (ETree *tree, MessageList *ml) } static gint -on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, MessageList *list) +on_click (ETree *tree, + gint row, + ETreePath path, + gint col, + GdkEvent *event, + MessageList *list) { CamelMessageInfo *info; gboolean folder_is_trash; @@ -4053,7 +4195,8 @@ struct _ml_selected_data { }; static void -ml_getselected_cb (ETreePath path, gpointer user_data) +ml_getselected_cb (ETreePath path, + gpointer user_data) { struct _ml_selected_data *data = user_data; const gchar *uid; @@ -4099,7 +4242,8 @@ message_list_get_selected (MessageList *ml) } void -message_list_set_selected (MessageList *ml, GPtrArray *uids) +message_list_set_selected (MessageList *ml, + GPtrArray *uids) { gint i; ETreeSelectionModel *etsm; @@ -4107,7 +4251,7 @@ message_list_set_selected (MessageList *ml, GPtrArray *uids) GPtrArray *paths = g_ptr_array_new (); etsm = (ETreeSelectionModel *) e_tree_get_selection_model (E_TREE (ml)); - for (i=0; i<uids->len; i++) { + for (i = 0; i < uids->len; i++) { node = g_hash_table_lookup (ml->uid_nodemap, uids->pdata[i]); if (node) g_ptr_array_add (paths, node); @@ -4123,7 +4267,8 @@ struct ml_count_data { }; static void -ml_getcount_cb (ETreePath path, gpointer user_data) +ml_getcount_cb (ETreePath path, + gpointer user_data) { struct ml_count_data *data = user_data; @@ -4187,7 +4332,8 @@ message_list_set_threaded_collapse_all (MessageList *ml) } void -message_list_set_threaded (MessageList *ml, gboolean threaded) +message_list_set_threaded (MessageList *ml, + gboolean threaded) { if (ml->threaded != threaded) { ml->threaded = threaded; @@ -4198,7 +4344,8 @@ message_list_set_threaded (MessageList *ml, gboolean threaded) } void -message_list_set_hidedeleted (MessageList *ml, gboolean hidedeleted) +message_list_set_hidedeleted (MessageList *ml, + gboolean hidedeleted) { if (ml->hidedeleted != hidedeleted) { ml->hidedeleted = hidedeleted; @@ -4209,7 +4356,8 @@ message_list_set_hidedeleted (MessageList *ml, gboolean hidedeleted) } void -message_list_set_search (MessageList *ml, const gchar *search) +message_list_set_search (MessageList *ml, + const gchar *search) { #if HAVE_CLUTTER if (ml->priv->timeline == NULL) { @@ -4290,7 +4438,8 @@ message_list_set_search (MessageList *ml, const gchar *search) /* will ensure that the message with UID uid will be in the message list after the next rebuild */ void -message_list_ensure_message (MessageList *ml, const gchar *uid) +message_list_ensure_message (MessageList *ml, + const gchar *uid) { g_return_if_fail (ml != NULL); @@ -4317,7 +4466,9 @@ struct sort_array_data { }; static gint -cmp_array_uids (gconstpointer a, gconstpointer b, gpointer user_data) +cmp_array_uids (gconstpointer a, + gconstpointer b, + gpointer user_data) { const gchar *uid1 = *(const gchar **) a; const gchar *uid2 = *(const gchar **) b; @@ -4373,11 +4524,13 @@ cmp_array_uids (gconstpointer a, gconstpointer b, gpointer user_data) } static void -free_message_info_data (gpointer uid, struct sort_message_info_data *data, struct sort_array_data *sort_data) +free_message_info_data (gpointer uid, + struct sort_message_info_data *data, + struct sort_array_data *sort_data) { if (data->values) { /* values in this array are not newly allocated, even ml_tree_value_at_ex - returns gpointer, not a gconstpointer */ + * returns gpointer, not a gconstpointer */ g_ptr_array_free (data->values, TRUE); } @@ -4386,7 +4539,8 @@ free_message_info_data (gpointer uid, struct sort_message_info_data *data, struc } static void -ml_sort_uids_by_tree (MessageList *ml, GPtrArray *uids) +ml_sort_uids_by_tree (MessageList *ml, + GPtrArray *uids) { ETreeTableAdapter *adapter; ETableSortInfo *sort_info; @@ -4492,13 +4646,12 @@ struct _regen_list_msg { }; /* - maintain copy of summary - - any new messages added - any removed removed, etc. - - use vfolder to implement searches ??? - + * maintain copy of summary + * + * any new messages added + * any removed removed, etc. + * + * use vfolder to implement searches ??? */ static gchar * @@ -4566,8 +4719,8 @@ regen_list_exec (struct _regen_list_msg *m, searchuids = uids = camel_folder_search_by_expression ( m->folder, expr, &local_error); /* If m->changes is not NULL, then it means we are called from folder_changed event, - thus we will keep the selected message to be sure it doesn't disappear because - it no longer belong to our search filter. */ + * thus we will keep the selected message to be sure it doesn't disappear because + * it no longer belong to our search filter. */ if (uids && ((m->changes && m->ml->cursor_uid) || m->ml->ensure_uid)) { const gchar *looking_for = m->ml->cursor_uid; /* ensure_uid has precedence of cursor_uid */ @@ -4588,10 +4741,10 @@ regen_list_exec (struct _regen_list_msg *m, gboolean is_junk = store_has_vjunk && (camel_message_info_flags (looking_info) & CAMEL_MESSAGE_JUNK) != 0; /* I would really like to check for CAMEL_MESSAGE_FOLDER_FLAGGED on a message, - so I would know whether it was changed locally, and then just check the changes - struct whether change came from the server, but with periodical save it doesn't - matter. So here just check whether the file was deleted and we show it based - on the flag whether we can view deleted messages or not. */ + * so I would know whether it was changed locally, and then just check the changes + * struct whether change came from the server, but with periodical save it doesn't + * matter. So here just check whether the file was deleted and we show it based + * on the flag whether we can view deleted messages or not. */ if ((!is_deleted || (is_deleted && !m->hidedel)) && (!is_junk || (is_junk && !m->hidejunk))) g_ptr_array_add (uids, (gpointer) camel_pstring_strdup (looking_for)); @@ -4860,7 +5013,11 @@ mail_regen_cancel (MessageList *ml) } static void -mail_regen_list (MessageList *ml, const gchar *search, const gchar *hideexpr, CamelFolderChangeInfo *changes, gboolean scroll_to_cursor) +mail_regen_list (MessageList *ml, + const gchar *search, + const gchar *hideexpr, + CamelFolderChangeInfo *changes, + gboolean scroll_to_cursor) { struct _regen_list_msg *m; GConfClient *client; @@ -4931,7 +5088,7 @@ mail_regen_list (MessageList *ml, const gchar *search, const gchar *hideexpr, Ca } } else if (ml->priv->any_row_changed && m->dotree && !ml->just_set_folder && (!ml->search || g_str_equal (ml->search, " "))) { /* there has been some change on any row, if it was an expand state change, - then let it save; if not, then nothing happen. */ + * then let it save; if not, then nothing happen. */ message_list_save_state (ml); } else if (m->dotree && !ml->just_set_folder) { /* remember actual expand state and restore it after regen */ diff --git a/mail/message-list.h b/mail/message-list.h index f4a8150e1f..d0c8a55303 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -135,7 +135,7 @@ struct _MessageList { guint hidejunk : 1; /* frozen count */ - guint frozen:16; + guint frozen : 16; /* Where the ETree cursor is. */ gchar *cursor_uid; diff --git a/modules/addressbook/addressbook-config.c b/modules/addressbook/addressbook-config.c index a41651459a..f075372540 100644 --- a/modules/addressbook/addressbook-config.c +++ b/modules/addressbook/addressbook-config.c @@ -215,7 +215,12 @@ ldap_get_ssl_tooltip (AddressbookLDAPSSLType ssl_type) } static gboolean -source_to_uri_parts (ESource *source, gchar **host, gchar **rootdn, AddressbookLDAPScopeType *scope, gchar **search_filter, gint *port) +source_to_uri_parts (ESource *source, + gchar **host, + gchar **rootdn, + AddressbookLDAPScopeType *scope, + gchar **search_filter, + gint *port) { gchar *uri; LDAPURLDesc *lud; @@ -256,7 +261,8 @@ source_group_is_remote (ESourceGroup *group) /* ldap api foo */ static LDAP * -addressbook_ldap_init (GtkWidget *window, ESource *source) +addressbook_ldap_init (GtkWidget *window, + ESource *source) { LDAP *ldap; gchar *host; @@ -284,7 +290,8 @@ addressbook_ldap_init (GtkWidget *window, ESource *source) } static gint -addressbook_ldap_auth (GtkWidget *window, LDAP *ldap) +addressbook_ldap_auth (GtkWidget *window, + LDAP *ldap) { gint ldap_error; @@ -297,8 +304,10 @@ addressbook_ldap_auth (GtkWidget *window, LDAP *ldap) } static gint -addressbook_root_dse_query (AddressbookSourceDialog *dialog, LDAP *ldap, - const gchar **attrs, LDAPMessage **resp) +addressbook_root_dse_query (AddressbookSourceDialog *dialog, + LDAP *ldap, + const gchar **attrs, + LDAPMessage **resp) { GtkAdjustment *adjustment; GtkRange *range; @@ -322,7 +331,9 @@ addressbook_root_dse_query (AddressbookSourceDialog *dialog, LDAP *ldap, } static gboolean -do_ldap_root_dse_query (AddressbookSourceDialog *sdialog, GtkListStore *model, ESource *source) +do_ldap_root_dse_query (AddressbookSourceDialog *sdialog, + GtkListStore *model, + ESource *source) { LDAP *ldap; const gchar *attrs[2]; @@ -369,7 +380,8 @@ do_ldap_root_dse_query (AddressbookSourceDialog *sdialog, GtkListStore *model, E } static void -search_base_selection_model_changed (GtkTreeSelection *selection, GtkWidget *dialog) +search_base_selection_model_changed (GtkTreeSelection *selection, + GtkWidget *dialog) { gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, @@ -377,7 +389,8 @@ search_base_selection_model_changed (GtkTreeSelection *selection, GtkWidget *dia } static void -query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) +query_for_supported_bases (GtkWidget *button, + AddressbookSourceDialog *sdialog) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -427,7 +440,7 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) #endif /* HAVE_LDAP */ -GtkWidget* +GtkWidget * addressbook_config_create_new_source (GtkWidget *parent) { return addressbook_config_edit_source (parent, NULL); @@ -436,7 +449,8 @@ addressbook_config_create_new_source (GtkWidget *parent) /* ********************************************************************** */ static void -eabc_type_changed (GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) +eabc_type_changed (GtkComboBox *dropdown, + AddressbookSourceDialog *sdialog) { gint id = gtk_combo_box_get_active (dropdown); GtkTreeModel *model; @@ -454,7 +468,7 @@ eabc_type_changed (GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) e_source_set_group (sdialog->source, sdialog->source_group); /* BIG HACK: We load the defaults for each type here. - I guess plugins will have to use the do it in their factory callbacks */ + * I guess plugins will have to use the do it in their factory callbacks */ if (!strncmp(e_source_group_peek_base_uri(sdialog->source_group), "groupwise:", 10)) { GSList *l; ESource *source; @@ -520,7 +534,7 @@ eabc_general_type (EConfig *ec, cell = gtk_cell_renderer_text_new (); store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); i = 0; - for (l=sdialog->menu_source_groups;l;l=g_slist_next (l)) { + for (l = sdialog->menu_source_groups; l; l = g_slist_next (l)) { ESourceGroup *group = l->data; gtk_list_store_append (store, &iter); @@ -535,7 +549,7 @@ eabc_general_type (EConfig *ec, gtk_combo_box_set_model (dropdown, (GtkTreeModel *) store); gtk_combo_box_set_active (dropdown, -1); gtk_combo_box_set_active (dropdown, row); - g_signal_connect(dropdown, "changed", G_CALLBACK(eabc_type_changed), sdialog); + g_signal_connect (dropdown, "changed", G_CALLBACK(eabc_type_changed), sdialog); gtk_widget_show ((GtkWidget *) dropdown); gtk_box_pack_start ((GtkBox *) w, (GtkWidget *) dropdown, TRUE, TRUE, 0); gtk_label_set_mnemonic_widget ((GtkLabel *) label, (GtkWidget *) dropdown); @@ -548,7 +562,8 @@ eabc_general_type (EConfig *ec, } static void -name_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +name_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { const gchar *text; gchar *stripped_name; @@ -583,7 +598,7 @@ eabc_general_name (EConfig *ec, gtk_box_pack_start ((GtkBox *) parent, w, FALSE, FALSE, 0); sdialog->display_name = e_builder_get_widget (builder, "account-editor-display-name-entry"); - g_signal_connect(sdialog->display_name, "changed", G_CALLBACK(name_changed_cb), sdialog); + g_signal_connect (sdialog->display_name, "changed", G_CALLBACK(name_changed_cb), sdialog); gtk_entry_set_text ((GtkEntry *) sdialog->display_name, e_source_peek_name (sdialog->source)); /* Hardcoded: groupwise can't edit the name (or anything else) */ @@ -601,7 +616,8 @@ eabc_general_name (EConfig *ec, /* TODO: This should be moved to plugins if B&A calendar setup is moved there */ static void -use_in_cal_changed_cb (GtkWidget *widget, AddressbookSourceDialog *sdialog) +use_in_cal_changed_cb (GtkWidget *widget, + AddressbookSourceDialog *sdialog) { e_source_set_property (sdialog->source, "use-in-contacts-calendar", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? "1" : "0"); } @@ -640,7 +656,8 @@ eabc_general_use_in_cal (EConfig *ec, } static void -offline_status_changed_cb (GtkWidget *widget, AddressbookSourceDialog *sdialog) +offline_status_changed_cb (GtkWidget *widget, + AddressbookSourceDialog *sdialog) { e_source_set_property (sdialog->source, "offline_sync", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? "1" : "0"); } @@ -684,7 +701,7 @@ form_ldap_search_filter (GtkWidget *w) const gchar *search_filter = gtk_entry_get_text ((GtkEntry *) w); /* this function can be used to format the search filter entered */ - if ((strlen (search_filter) !=0) && *search_filter != '(' && *(search_filter + (strlen (search_filter-1))) != ')') + if ((strlen (search_filter) !=0) && *search_filter != '(' && *(search_filter + (strlen (search_filter - 1))) != ')') filter = g_strdup_printf ("(%s)", search_filter); else filter = g_strdup_printf ("%s", search_filter); @@ -710,13 +727,15 @@ url_changed (AddressbookSourceDialog *sdialog) } static void -host_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +host_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { url_changed (sdialog); } static void -port_entry_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +port_entry_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { const gchar *port = gtk_entry_get_text ((GtkEntry *) w); @@ -732,7 +751,8 @@ port_entry_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) } static void -ssl_combobox_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +ssl_combobox_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { sdialog->ssl = gtk_combo_box_get_active (GTK_COMBO_BOX (w)); e_source_set_property (sdialog->source, "ssl", ldap_unparse_ssl (sdialog->ssl)); @@ -798,7 +818,8 @@ eabc_general_host (EConfig *ec, } static void -auth_entry_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +auth_entry_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { const gchar *principal = gtk_entry_get_text ((GtkEntry *) w); @@ -821,7 +842,8 @@ auth_entry_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) } static void -auth_combobox_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +auth_combobox_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { sdialog->auth = gtk_combo_box_get_active (GTK_COMBO_BOX (w)); e_source_set_property (sdialog->source, "auth", ldap_unparse_auth (sdialog->auth)); @@ -882,19 +904,22 @@ eabc_general_auth (EConfig *ec, } static void -rootdn_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +rootdn_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { url_changed (sdialog); } static void -search_filter_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +search_filter_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { url_changed (sdialog); } static void -scope_combobox_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +scope_combobox_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { sdialog->scope = gtk_combo_box_get_active (GTK_COMBO_BOX (w)); url_changed (sdialog); @@ -968,7 +993,8 @@ eabc_details_search (EConfig *ec, } static void -timeout_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +timeout_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { GtkAdjustment *adjustment; GtkRange *range; @@ -982,7 +1008,8 @@ timeout_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) } static void -limit_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) +limit_changed_cb (GtkWidget *w, + AddressbookSourceDialog *sdialog) { gchar limit[16]; @@ -991,7 +1018,8 @@ limit_changed_cb (GtkWidget *w, AddressbookSourceDialog *sdialog) } static void -canbrowse_toggled_cb (GtkWidget *toggle_button, ESource *source) +canbrowse_toggled_cb (GtkWidget *toggle_button, + ESource *source) { if (!source || !toggle_button) return; @@ -1027,14 +1055,14 @@ eabc_details_limit (EConfig *ec, range = GTK_RANGE (sdialog->timeout_scale); adjustment = gtk_range_get_adjustment (range); tmp = e_source_get_property(sdialog->source, "timeout"); - gtk_adjustment_set_value (adjustment, tmp?g_strtod (tmp, NULL):3.0); + gtk_adjustment_set_value (adjustment, tmp ? g_strtod (tmp, NULL) : 3.0); g_signal_connect ( adjustment, "value_changed", G_CALLBACK (timeout_changed_cb), sdialog); sdialog->limit_spinbutton = e_builder_get_widget (builder, "download-limit-spinbutton"); tmp = e_source_get_property(sdialog->source, "limit"); - gtk_spin_button_set_value ((GtkSpinButton *) sdialog->limit_spinbutton, tmp?g_strtod (tmp, NULL):100.0); + gtk_spin_button_set_value ((GtkSpinButton *) sdialog->limit_spinbutton, tmp ? g_strtod (tmp, NULL) : 100.0); g_signal_connect (sdialog->limit_spinbutton, "value_changed", G_CALLBACK (limit_changed_cb), sdialog); sdialog->canbrowsecheck = e_builder_get_widget (builder, "canbrowsecheck"); @@ -1110,7 +1138,9 @@ eabc_commit (EConfig *ec, } static void -eabc_free (EConfig *ec, GSList *items, gpointer data) +eabc_free (EConfig *ec, + GSList *items, + gpointer data) { AddressbookSourceDialog *sdialog = data; @@ -1129,7 +1159,9 @@ eabc_free (EConfig *ec, GSList *items, gpointer data) } static gboolean -eabc_check_complete (EConfig *ec, const gchar *pageid, gpointer data) +eabc_check_complete (EConfig *ec, + const gchar *pageid, + gpointer data) { AddressbookSourceDialog *sdialog = data; gint valid = TRUE; @@ -1187,7 +1219,8 @@ eabc_check_complete (EConfig *ec, const gchar *pageid, gpointer data) /* debug only: */ #if d(!)0 static void -source_changed (ESource *source, AddressbookSourceDialog *sdialog) +source_changed (ESource *source, + AddressbookSourceDialog *sdialog) { gchar *xml; @@ -1197,8 +1230,9 @@ source_changed (ESource *source, AddressbookSourceDialog *sdialog) } #endif -GtkWidget* -addressbook_config_edit_source (GtkWidget *parent, ESource *source) +GtkWidget * +addressbook_config_edit_source (GtkWidget *parent, + ESource *source) { AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1); EABConfig *ec; @@ -1234,12 +1268,12 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source) sdialog->menu_source_groups = g_slist_copy (l); #ifndef HAVE_LDAP - for (;l;l = g_slist_next (l)) + for (; l; l = g_slist_next (l)) if (!strncmp("ldap:", e_source_group_peek_base_uri(l->data), 5)) sdialog->menu_source_groups = g_slist_remove (sdialog->menu_source_groups, l->data); #endif sdialog->source_group = (ESourceGroup *) sdialog->menu_source_groups->data; - for (i=0;eabc_new_items[i].path;i++) + for (i = 0; eabc_new_items[i].path; i++) items = g_slist_prepend (items, &eabc_new_items[i]); g_object_unref (gconf); } @@ -1251,12 +1285,12 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source) xml = e_source_to_standalone_xml (sdialog->source); printf("but working standalone xml: %s\n", xml); g_free (xml); - g_signal_connect(sdialog->source, "changed", source_changed, sdialog); + g_signal_connect (sdialog->source, "changed", source_changed, sdialog); #endif sdialog->config = ec = eab_config_new(E_CONFIG_BOOK, "com.novell.evolution.addressbook.config.accountEditor"); - for (i=0;eabc_items[i].path;i++) { + for (i = 0; eabc_items[i].path; i++) { if (eabc_items[i].label) eabc_items[i].label = gettext (eabc_items[i].label); items = g_slist_prepend (items, &eabc_items[i]); diff --git a/modules/addressbook/addressbook-config.h b/modules/addressbook/addressbook-config.h index d9fefb7e82..e316392497 100644 --- a/modules/addressbook/addressbook-config.h +++ b/modules/addressbook/addressbook-config.h @@ -47,7 +47,7 @@ typedef enum { ADDRESSBOOK_LDAP_SSL_NEVER /* No encryption */ } AddressbookLDAPSSLType; -GtkWidget* addressbook_config_edit_source (GtkWidget *parent, ESource *source); -GtkWidget* addressbook_config_create_new_source (GtkWidget *parent); +GtkWidget * addressbook_config_edit_source (GtkWidget *parent, ESource *source); +GtkWidget * addressbook_config_create_new_source (GtkWidget *parent); #endif /* __ADDRESSBOOK_CONFIG_H__ */ diff --git a/modules/addressbook/autocompletion-config.c b/modules/addressbook/autocompletion-config.c index d4124193a6..020ad1dc81 100644 --- a/modules/addressbook/autocompletion-config.c +++ b/modules/addressbook/autocompletion-config.c @@ -61,7 +61,7 @@ source_selection_changed_cb (ESourceSelector *source_selector) } /* then we loop over the selector's selection, setting the - property on those sources */ + * property on those sources */ selection = e_source_selector_get_selection (source_selector); for (l = selection; l; l = l->next) { ESource *source = E_SOURCE (l->data); @@ -134,7 +134,12 @@ add_section (GtkWidget *container, } static GtkWidget * -acc_get_toplevel_notebook (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gint position, gpointer data) +acc_get_toplevel_notebook (EConfig *ec, + EConfigItem *item, + GtkWidget *parent, + GtkWidget *old, + gint position, + gpointer data) { if (old) return old; @@ -146,7 +151,12 @@ acc_get_toplevel_notebook (EConfig *ec, EConfigItem *item, GtkWidget *parent, Gt } static GtkWidget * -acc_get_general_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gint position, gpointer data) +acc_get_general_page (EConfig *ec, + EConfigItem *item, + GtkWidget *parent, + GtkWidget *old, + gint position, + gpointer data) { EShellSettings *shell_settings; ESourceList *source_list; @@ -227,7 +237,9 @@ static EConfigItem acc_items[] = { }; static void -acc_free (EConfig *ec, GSList *items, gpointer data) +acc_free (EConfig *ec, + GSList *items, + gpointer data) { g_slist_free (items); } diff --git a/modules/addressbook/e-book-shell-migrate.c b/modules/addressbook/e-book-shell-migrate.c index a88219348a..9b3c52c52b 100644 --- a/modules/addressbook/e-book-shell-migrate.c +++ b/modules/addressbook/e-book-shell-migrate.c @@ -53,8 +53,8 @@ typedef struct { /* this hash table maps old folder uris to new uids. It's - build in migrate_contact_folder and it's used in - migrate_completion_folders. */ + * build in migrate_contact_folder and it's used in + * migrate_completion_folders. */ GHashTable *folder_uid_map; ESourceList *source_list; @@ -73,9 +73,9 @@ typedef struct { static void create_groups (MigrationContext *context, - ESourceGroup **on_this_computer, - ESourceGroup **on_ldap_servers, - ESource **personal_source) + ESourceGroup **on_this_computer, + ESourceGroup **on_ldap_servers, + ESource **personal_source) { GSList *groups; ESourceGroup *group; @@ -115,7 +115,7 @@ create_groups (MigrationContext *context, if (*on_this_computer) { /* make sure "Personal" shows up as a source under - this group */ + * this group */ GSList *sources = e_source_group_peek_sources (*on_this_computer); GSList *s; for (s = sources; s; s = s->next) { @@ -207,8 +207,8 @@ e_book_shell_backend_migrate (EShellBackend *shell_backend, context = migration_context_new (data_dir); /* we call this unconditionally now - create_groups either - creates the groups/sources or it finds the necessary - groups/sources. */ + * creates the groups/sources or it finds the necessary + * groups/sources. */ create_groups (context, &on_this_computer, &on_ldap_servers, &personal_source); if (on_this_computer) diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 52d8243ead..a6aebe08a2 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -218,9 +218,9 @@ action_address_book_properties_cb (GtkAction *action, #ifdef WITH_CONTACT_MAPS static void contact_editor_contact_modified_cb (EABEditor *editor, - const GError *error, - EContact *contact, - gpointer user_data) + const GError *error, + EContact *contact, + gpointer user_data) { EContactMapWindow *window = user_data; EContactMap *map; @@ -241,8 +241,8 @@ contact_editor_contact_modified_cb (EABEditor *editor, static void map_window_show_contact_editor_cb (EContactMapWindow *window, - const gchar *contact_uid, - gpointer user_data) + const gchar *contact_uid, + gpointer user_data) { EShell *shell = e_shell_get_default (); EBookShellView *book_shell_view = user_data; @@ -291,7 +291,7 @@ map_window_show_contact_editor_cb (EContactMapWindow *window, /* We need this function to he defined all the time. */ static void action_address_book_map_cb (GtkAction *action, - EBookShellView *book_shell_view) + EBookShellView *book_shell_view) { #ifdef WITH_CONTACT_MAPS EContactMapWindow *map_window; diff --git a/modules/addressbook/eab-composer-util.c b/modules/addressbook/eab-composer-util.c index 215dacea05..9f17dd34d5 100644 --- a/modules/addressbook/eab-composer-util.c +++ b/modules/addressbook/eab-composer-util.c @@ -95,7 +95,9 @@ eab_send_as_to (EShell *shell, } static const gchar * -get_email (EContact *contact, EContactField field_id, gchar **to_free) +get_email (EContact *contact, + EContactField field_id, + gchar **to_free) { gchar *name = NULL, *mail = NULL; const gchar *value = e_contact_get_const (contact, field_id); diff --git a/modules/addressbook/openldap-extract.h b/modules/addressbook/openldap-extract.h index eb8457fe0e..d838e8b49b 100644 --- a/modules/addressbook/openldap-extract.h +++ b/modules/addressbook/openldap-extract.h @@ -193,12 +193,12 @@ get_token (const gchar **sp, (*sp)++; if (**sp == '\'') { q = *sp; - res = LDAP_MALLOC (q-p+1); + res = LDAP_MALLOC (q - p + 1); if (!res) { kind = TK_OUTOFMEM; } else { - strncpy (res,p,q-p); - res[q-p] = '\0'; + strncpy (res,p,q - p); + res[q - p] = '\0'; *token_val = res; } (*sp)++; @@ -217,12 +217,12 @@ get_token (const gchar **sp, **sp != '\0') (*sp)++; q = *sp; - res = LDAP_MALLOC (q-p+1); + res = LDAP_MALLOC (q - p + 1); if (!res) { kind = TK_OUTOFMEM; } else { - strncpy (res,p,q-p); - res[q-p] = '\0'; + strncpy (res,p,q - p); + res[q - p] = '\0'; *token_val = res; } break; @@ -287,7 +287,7 @@ ldap_int_parse_numericoid (const gchar **sp, gint *code, const gint flags) if (flags & LDAP_SCHEMA_SKIP) { res = (gchar *) start; } else { - res = LDAP_MALLOC (len+1); + res = LDAP_MALLOC (len + 1); if (!res) { *code = LDAP_SCHERR_OUTOFMEM; return (NULL); @@ -326,9 +326,9 @@ parse_qdescrs (const gchar **sp, gint *code) if (kind == TK_RIGHTPAREN) break; if (kind == TK_QDESCR) { - if (pos == size-2) { + if (pos == size - 2) { size++; - res1 = LDAP_REALLOC (res,size*sizeof (gchar *)); + res1 = LDAP_REALLOC (res,size *sizeof (gchar *)); if (!res1) { LDAP_VFREE (res); LDAP_FREE (sval); @@ -417,9 +417,9 @@ parse_oids (const gchar **sp, gint *code, const gint allow_quoted) if (kind == TK_BAREWORD || (allow_quoted && kind == TK_QDSTRING)) { - if (pos == size-2) { + if (pos == size - 2) { size++; - res1 = LDAP_REALLOC (res,size*sizeof (gchar *)); + res1 = LDAP_REALLOC (res,size *sizeof (gchar *)); if (!res1) { LDAP_FREE (sval); LDAP_VFREE (res); @@ -551,8 +551,8 @@ ldap_str2objectclass (LDAP_CONST gchar *s, } else if (flags & LDAP_SCHEMA_ALLOW_OID_MACRO) { /* Non-numerical OID, ignore */ - gint len = ss-savepos; - oc->oc_oid = LDAP_MALLOC (len+1); + gint len = ss - savepos; + oc->oc_oid = LDAP_MALLOC (len + 1); strncpy (oc->oc_oid, savepos, len); oc->oc_oid[len] = 0; } @@ -1124,7 +1124,7 @@ ldap_url_parse_ext (LDAP_CONST gchar *url_in, } if (enclosed) { - p = &url[strlen (url)-1]; + p = &url[strlen (url) - 1]; if (*p != '>') { LDAP_FREE (url); @@ -1391,7 +1391,7 @@ ldap_url_parse_ext (LDAP_CONST gchar *url_in, return LDAP_URL_ERR_BADEXTS; } - for (i=0; ludp->lud_exts[i] != NULL; i++) { + for (i = 0; ludp->lud_exts[i] != NULL; i++) { ldap_pvt_hex_unescape (ludp->lud_exts[i]); if (*ludp->lud_exts[i] == '!') { diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index b4297b9fcd..81fc76b3cb 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -303,7 +303,8 @@ cal_shell_content_dispose (GObject *object) } static time_t -gc_get_default_time (ECalModel *model, gpointer user_data) +gc_get_default_time (ECalModel *model, + gpointer user_data) { GnomeCalendar *gcal = user_data; time_t res = 0, end; @@ -321,8 +322,8 @@ cal_shell_content_constructed (GObject *object) { ECalShellContentPrivate *priv; ECalendarView *calendar_view; - ECalModel *memo_model=NULL; - ECalModel *task_model=NULL; + ECalModel *memo_model = NULL; + ECalModel *task_model = NULL; EShell *shell; EShellContent *shell_content; EShellView *shell_view; diff --git a/modules/calendar/e-cal-shell-migrate.c b/modules/calendar/e-cal-shell-migrate.c index 3c9f79a309..dd76049171 100644 --- a/modules/calendar/e-cal-shell-migrate.c +++ b/modules/calendar/e-cal-shell-migrate.c @@ -75,11 +75,11 @@ create_calendar_contact_source (ESourceList *source_list) static void create_calendar_sources (EShellBackend *shell_backend, - ESourceList *source_list, - ESourceGroup **on_this_computer, - ESource **personal_source, - ESourceGroup **on_the_web, - ESourceGroup **contacts) + ESourceList *source_list, + ESourceGroup **on_this_computer, + ESource **personal_source, + ESourceGroup **on_the_web, + ESourceGroup **contacts) { EShell *shell; EShellSettings *shell_settings; @@ -134,7 +134,7 @@ create_calendar_sources (EShellBackend *shell_backend, if (*on_this_computer) { /* make sure "Personal" shows up as a source under - this group */ + * this group */ GSList *sources = e_source_group_peek_sources (*on_this_computer); GSList *s; for (s = sources; s; s = s->next) { @@ -224,8 +224,8 @@ e_cal_shell_backend_migrate (EShellBackend *shell_backend, g_object_get (shell_backend, "source-list", &source_list, NULL); /* we call this unconditionally now - create_groups either - creates the groups/sources or it finds the necessary - groups/sources. */ + * creates the groups/sources or it finds the necessary + * groups/sources. */ create_calendar_sources ( shell_backend, source_list, &on_this_computer, &personal_source, &on_the_web, &contacts); diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 53b2a0e6c7..21472453ef 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -1205,7 +1205,8 @@ exit: } static void -edit_event_as (ECalShellView *cal_shell_view, gboolean as_meeting) +edit_event_as (ECalShellView *cal_shell_view, + gboolean as_meeting) { ECalShellContent *cal_shell_content; GnomeCalendarViewType view_type; diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 7a9fdaac69..c2f39c5f9b 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -828,7 +828,8 @@ struct ForeachTzidData }; static void -add_timezone_to_cal_cb (icalparameter *param, gpointer data) +add_timezone_to_cal_cb (icalparameter *param, + gpointer data) { struct ForeachTzidData *ftd = data; icaltimezone *tz = NULL; diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c index 03914f1793..61a2d9c27a 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -227,7 +227,8 @@ cal_shell_view_execute_search (EShellView *shell_view) } static icalproperty * -get_attendee_prop (icalcomponent *icalcomp, const gchar *address) +get_attendee_prop (icalcomponent *icalcomp, + const gchar *address) { icalproperty *prop; @@ -252,7 +253,8 @@ get_attendee_prop (icalcomponent *icalcomp, const gchar *address) } static gboolean -is_delegated (icalcomponent *icalcomp, const gchar *user_email) +is_delegated (icalcomponent *icalcomp, + const gchar *user_email) { icalproperty *prop; icalparameter *param; diff --git a/modules/calendar/e-calendar-preferences.c b/modules/calendar/e-calendar-preferences.c index 115226dcf3..85eddd9736 100644 --- a/modules/calendar/e-calendar-preferences.c +++ b/modules/calendar/e-calendar-preferences.c @@ -191,7 +191,8 @@ update_day_second_zone_caption (ECalendarPreferences *prefs) } static void -on_set_day_second_zone (GtkWidget *item, ECalendarPreferences *prefs) +on_set_day_second_zone (GtkWidget *item, + ECalendarPreferences *prefs) { if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item))) return; @@ -201,7 +202,8 @@ on_set_day_second_zone (GtkWidget *item, ECalendarPreferences *prefs) } static void -on_select_day_second_zone (GtkWidget *item, ECalendarPreferences *prefs) +on_select_day_second_zone (GtkWidget *item, + ECalendarPreferences *prefs) { g_return_if_fail (prefs != NULL); @@ -210,7 +212,8 @@ on_select_day_second_zone (GtkWidget *item, ECalendarPreferences *prefs) } static void -day_second_zone_clicked (GtkWidget *widget, ECalendarPreferences *prefs) +day_second_zone_clicked (GtkWidget *widget, + ECalendarPreferences *prefs) { GtkWidget *menu, *item; GSList *group = NULL, *recent_zones, *s; @@ -263,7 +266,8 @@ day_second_zone_clicked (GtkWidget *widget, ECalendarPreferences *prefs) } static void -start_of_day_changed (GtkWidget *widget, ECalendarPreferences *prefs) +start_of_day_changed (GtkWidget *widget, + ECalendarPreferences *prefs) { gint start_hour, start_minute, end_hour, end_minute; EDateEdit *start, *end; @@ -292,7 +296,8 @@ start_of_day_changed (GtkWidget *widget, ECalendarPreferences *prefs) } static void -end_of_day_changed (GtkWidget *widget, ECalendarPreferences *prefs) +end_of_day_changed (GtkWidget *widget, + ECalendarPreferences *prefs) { gint start_hour, start_minute, end_hour, end_minute; EDateEdit *start, *end; @@ -321,7 +326,8 @@ end_of_day_changed (GtkWidget *widget, ECalendarPreferences *prefs) } static void -notify_with_tray_toggled (GtkToggleButton *toggle, ECalendarPreferences *prefs) +notify_with_tray_toggled (GtkToggleButton *toggle, + ECalendarPreferences *prefs) { GConfClient *gconf; @@ -333,7 +339,8 @@ notify_with_tray_toggled (GtkToggleButton *toggle, ECalendarPreferences *prefs) } static void -alarms_selection_changed (ESourceSelector *selector, ECalendarPreferences *prefs) +alarms_selection_changed (ESourceSelector *selector, + ECalendarPreferences *prefs) { ESourceList *source_list = prefs->alarms_list; GSList *selection; @@ -358,7 +365,7 @@ alarms_selection_changed (ESourceSelector *selector, ECalendarPreferences *prefs } /* then we loop over the selector's selection, setting the - property on those sources */ + * property on those sources */ selection = e_source_selector_get_selection (selector); for (l = selection; l; l = l->next) { source = E_SOURCE (l->data); @@ -402,17 +409,30 @@ update_system_tz_widgets (EShellSettings *shell_settings, static void setup_changes (ECalendarPreferences *prefs) { - g_signal_connect (G_OBJECT (prefs->day_second_zone), "clicked", G_CALLBACK (day_second_zone_clicked), prefs); + g_signal_connect ( + prefs->day_second_zone, "clicked", + G_CALLBACK (day_second_zone_clicked), prefs); - g_signal_connect (G_OBJECT (prefs->start_of_day), "changed", G_CALLBACK (start_of_day_changed), prefs); - g_signal_connect (G_OBJECT (prefs->end_of_day), "changed", G_CALLBACK (end_of_day_changed), prefs); + g_signal_connect ( + prefs->start_of_day, "changed", + G_CALLBACK (start_of_day_changed), prefs); - g_signal_connect (G_OBJECT (prefs->notify_with_tray), "toggled", G_CALLBACK (notify_with_tray_toggled), prefs); - g_signal_connect (G_OBJECT (prefs->alarm_list_widget), "selection_changed", G_CALLBACK (alarms_selection_changed), prefs); + g_signal_connect ( + prefs->end_of_day, "changed", + G_CALLBACK (end_of_day_changed), prefs); + + g_signal_connect ( + prefs->notify_with_tray, "toggled", + G_CALLBACK (notify_with_tray_toggled), prefs); + + g_signal_connect ( + prefs->alarm_list_widget, "selection_changed", + G_CALLBACK (alarms_selection_changed), prefs); } static void -initialize_selection (ESourceSelector *selector, ESourceList *source_list) +initialize_selection (ESourceSelector *selector, + ESourceList *source_list) { GSList *groups; @@ -497,7 +517,9 @@ static ECalConfigItem eccp_items[] = { }; static void -eccp_free (EConfig *ec, GSList *items, gpointer data) +eccp_free (EConfig *ec, + GSList *items, + gpointer data) { g_slist_free (items); } diff --git a/modules/calendar/e-memo-shell-migrate.c b/modules/calendar/e-memo-shell-migrate.c index 55f57996cb..6402cf1e0a 100644 --- a/modules/calendar/e-memo-shell-migrate.c +++ b/modules/calendar/e-memo-shell-migrate.c @@ -89,7 +89,7 @@ create_memo_sources (EShellBackend *shell_backend, if (*on_this_computer) { /* make sure "Personal" shows up as a source under - this group */ + * this group */ GSList *sources = e_source_group_peek_sources (*on_this_computer); GSList *s; for (s = sources; s; s = s->next) { @@ -172,8 +172,8 @@ e_memo_shell_backend_migrate (EShellBackend *shell_backend, g_object_get (shell_backend, "source-list", &source_list, NULL); /* we call this unconditionally now - create_groups either - creates the groups/sources or it finds the necessary - groups/sources. */ + * creates the groups/sources or it finds the necessary + * groups/sources. */ create_memo_sources ( shell_backend, source_list, &on_this_computer, &on_the_web, &personal_source); diff --git a/modules/calendar/e-task-shell-migrate.c b/modules/calendar/e-task-shell-migrate.c index bf2d07ed8b..60499d673f 100644 --- a/modules/calendar/e-task-shell-migrate.c +++ b/modules/calendar/e-task-shell-migrate.c @@ -101,7 +101,7 @@ create_task_sources (EShellBackend *shell_backend, if (*on_this_computer) { /* make sure "Personal" shows up as a source under - this group */ + * this group */ GSList *sources = e_source_group_peek_sources (*on_this_computer); GSList *s; for (s = sources; s; s = s->next) { @@ -183,8 +183,8 @@ e_task_shell_backend_migrate (EShellBackend *shell_backend, g_object_get (shell_backend, "source-list", &source_list, NULL); /* we call this unconditionally now - create_groups either - creates the groups/sources or it finds the necessary - groups/sources. */ + * creates the groups/sources or it finds the necessary + * groups/sources. */ create_task_sources ( shell_backend, source_list, &on_this_computer, &on_the_web, &personal_source); diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c index 93500279e7..5eb5ce9f53 100644 --- a/modules/mail/e-mail-shell-backend.c +++ b/modules/mail/e-mail-shell-backend.c @@ -709,7 +709,8 @@ e_mail_labels_get_filter_options (void) /* utility functions for mbox importer */ static void -mbox_create_preview_cb (GObject *preview, GtkWidget **preview_widget) +mbox_create_preview_cb (GObject *preview, + GtkWidget **preview_widget) { EMFormatHTMLDisplay *format; EWebView *web_view; @@ -726,7 +727,8 @@ mbox_create_preview_cb (GObject *preview, GtkWidget **preview_widget) } static void -mbox_fill_preview_cb (GObject *preview, CamelMimeMessage *msg) +mbox_fill_preview_cb (GObject *preview, + CamelMimeMessage *msg) { EMFormatHTMLDisplay *format; diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 72994449b3..a7309904bd 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -487,8 +487,8 @@ mail_shell_view_reader_changed_cb (EMailShellView *mail_shell_view, static void mail_shell_view_reader_update_actions_cb (EMailReader *reader, - guint32 state, - EMailShellView *mail_shell_view) + guint32 state, + EMailShellView *mail_shell_view) { EMailShellContent *mail_shell_content; @@ -722,7 +722,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) mail_shell_view, G_CONNECT_SWAPPED); g_signal_connect_object ( - e_mail_shell_content_get_mail_view (mail_shell_content), "update-actions", + mail_view, "update-actions", G_CALLBACK (mail_shell_view_reader_update_actions_cb), mail_shell_view, 0); diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c index d5b1c6697d..fb49352357 100644 --- a/modules/mail/em-composer-prefs.c +++ b/modules/mail/em-composer-prefs.c @@ -303,7 +303,9 @@ static EMConfigItem emcp_items[] = { }; static void -emcp_free (EConfig *ec, GSList *items, gpointer data) +emcp_free (EConfig *ec, + GSList *items, + gpointer data) { /* the prefs data is freed automagically */ g_slist_free (items); diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c index 6d7322803b..290e189e4b 100644 --- a/modules/mail/em-mailer-prefs.c +++ b/modules/mail/em-mailer-prefs.c @@ -164,7 +164,8 @@ jh_tree_refill (EMMailerPrefs *prefs) } static void -jh_dialog_entry_changed_cb (GtkEntry *entry, gpointer user_data) +jh_dialog_entry_changed_cb (GtkEntry *entry, + gpointer user_data) { GtkBuilder *builder = GTK_BUILDER (user_data); GtkWidget *ok_button, *entry1, *entry2; @@ -181,7 +182,8 @@ jh_dialog_entry_changed_cb (GtkEntry *entry, gpointer user_data) } static void -jh_add_cb (GtkWidget *widget, gpointer user_data) +jh_add_cb (GtkWidget *widget, + gpointer user_data) { GtkWidget *dialog; GtkWidget *entry; @@ -222,7 +224,8 @@ jh_add_cb (GtkWidget *widget, gpointer user_data) } static void -jh_remove_cb (GtkWidget *widget, gpointer user_data) +jh_remove_cb (GtkWidget *widget, + gpointer user_data) { EMMailerPrefs *prefs = user_data; GtkTreeSelection *selection; @@ -233,14 +236,14 @@ jh_remove_cb (GtkWidget *widget, gpointer user_data) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (prefs->junk_header_tree)); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gchar *name=NULL, *value=NULL; + gchar *name = NULL, *value = NULL; GSList *prev = NULL, *node, *list = gconf_client_get_list (prefs->gconf, "/apps/evolution/mail/junk/custom_header", GCONF_VALUE_STRING, NULL); gtk_tree_model_get (model, &iter, JH_LIST_COLUMN_NAME, &name, JH_LIST_COLUMN_VALUE, &value, -1); node = list; while (node) { gchar *test; gint len = strlen (name); - test = strncmp (node->data, name, len) == 0 ? (gchar *) node->data+len:NULL; + test = strncmp (node->data, name, len) == 0 ? (gchar *) node->data + len : NULL; if (test) { test++; @@ -274,7 +277,8 @@ jh_remove_cb (GtkWidget *widget, gpointer user_data) } static GtkListStore * -init_junk_tree (GtkWidget *label_tree, EMMailerPrefs *prefs) +init_junk_tree (GtkWidget *label_tree, + EMMailerPrefs *prefs) { GtkListStore *store; GtkCellRenderer *renderer; @@ -287,11 +291,11 @@ init_junk_tree (GtkWidget *label_tree, EMMailerPrefs *prefs) renderer = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (label_tree), -1, _("Header"), renderer, "text", JH_LIST_COLUMN_NAME, NULL); - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + g_object_set (renderer, "editable", TRUE, NULL); renderer = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (label_tree), -1, _("Contains Value"), renderer, "text", JH_LIST_COLUMN_VALUE, NULL); - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + g_object_set (renderer, "editable", TRUE, NULL); return store; } @@ -304,8 +308,8 @@ emmp_header_remove_sensitivity (EMMailerPrefs *prefs) gboolean is_default; /* remove button should be sensitive if the currenlty selected entry in the list view - is not a default header. if there are no entries, or none is selected, it should be - disabled + * is not a default header. if there are no entries, or none is selected, it should be + * disabled */ if (gtk_tree_selection_get_selected (selection, NULL, &iter)) { gtk_tree_model_get (GTK_TREE_MODEL (prefs->header_list_store), &iter, @@ -341,8 +345,8 @@ emmp_header_add_sensitivity (EMMailerPrefs *prefs) gboolean valid; /* the add header button should be sensitive if the text box contains - a valid header string, that is not a duplicate with something already - in the list view + * a valid header string, that is not a duplicate with something already + * in the list view */ entry_contents = gtk_entry_get_text (GTK_ENTRY (prefs->entry_header)); if (!emmp_header_is_valid (entry_contents)) { @@ -402,7 +406,9 @@ emmp_save_headers (EMMailerPrefs *prefs) } static void -emmp_header_list_enabled_toggled (GtkCellRendererToggle *cell, const gchar *path_string, EMMailerPrefs *prefs) +emmp_header_list_enabled_toggled (GtkCellRendererToggle *cell, + const gchar *path_string, + EMMailerPrefs *prefs) { GtkTreeModel *model = GTK_TREE_MODEL (prefs->header_list_store); GtkTreePath *path = gtk_tree_path_new_from_string (path_string); @@ -420,7 +426,8 @@ emmp_header_list_enabled_toggled (GtkCellRendererToggle *cell, const gchar *path } static void -emmp_header_add_header (GtkWidget *widget, EMMailerPrefs *prefs) +emmp_header_add_header (GtkWidget *widget, + EMMailerPrefs *prefs) { GtkTreeModel *model = GTK_TREE_MODEL (prefs->header_list_store); GtkTreeIter iter; @@ -428,7 +435,7 @@ emmp_header_add_header (GtkWidget *widget, EMMailerPrefs *prefs) g_strstrip ((gchar *) text); - if (text && (strlen (text)>0)) { + if (text && (strlen (text) > 0)) { gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, HEADER_LIST_NAME_COLUMN, text, @@ -445,7 +452,8 @@ emmp_header_add_header (GtkWidget *widget, EMMailerPrefs *prefs) } static void -emmp_header_remove_header (GtkWidget *button, gpointer user_data) +emmp_header_remove_header (GtkWidget *button, + gpointer user_data) { EMMailerPrefs *prefs = (EMMailerPrefs *) user_data; GtkTreeModel *model = GTK_TREE_MODEL (prefs->header_list_store); @@ -462,7 +470,8 @@ emmp_header_remove_header (GtkWidget *button, gpointer user_data) } static void -emmp_header_list_row_selected (GtkTreeSelection *selection, gpointer user_data) +emmp_header_list_row_selected (GtkTreeSelection *selection, + gpointer user_data) { EMMailerPrefs *prefs = (EMMailerPrefs *) user_data; @@ -470,7 +479,8 @@ emmp_header_list_row_selected (GtkTreeSelection *selection, gpointer user_data) } static void -emmp_header_entry_changed (GtkWidget *entry, gpointer user_data) +emmp_header_entry_changed (GtkWidget *entry, + gpointer user_data) { EMMailerPrefs *prefs = (EMMailerPrefs *) user_data; @@ -478,7 +488,8 @@ emmp_header_entry_changed (GtkWidget *entry, gpointer user_data) } static void -toggle_button_toggled (GtkToggleButton *toggle, EMMailerPrefs *prefs) +toggle_button_toggled (GtkToggleButton *toggle, + EMMailerPrefs *prefs) { const gchar *key; @@ -487,14 +498,16 @@ toggle_button_toggled (GtkToggleButton *toggle, EMMailerPrefs *prefs) } static void -junk_book_lookup_button_toggled (GtkToggleButton *toggle, EMMailerPrefs *prefs) +junk_book_lookup_button_toggled (GtkToggleButton *toggle, + EMMailerPrefs *prefs) { toggle_button_toggled (toggle, prefs); gtk_widget_set_sensitive (GTK_WIDGET (prefs->junk_lookup_local_only), gtk_toggle_button_get_active (toggle)); } static void -custom_junk_button_toggled (GtkToggleButton *toggle, EMMailerPrefs *prefs) +custom_junk_button_toggled (GtkToggleButton *toggle, + EMMailerPrefs *prefs) { toggle_button_toggled (toggle, prefs); if (gtk_toggle_button_get_active (toggle)) { @@ -510,7 +523,11 @@ custom_junk_button_toggled (GtkToggleButton *toggle, EMMailerPrefs *prefs) } static void -toggle_button_init (EMMailerPrefs *prefs, GtkToggleButton *toggle, gint not, const gchar *key, GCallback toggled) +toggle_button_init (EMMailerPrefs *prefs, + GtkToggleButton *toggle, + gint not, + const gchar *key, + GCallback toggled) { gboolean bool; @@ -623,7 +640,8 @@ emmp_empty_junk_init (EMMailerPrefs *prefs, } static void -http_images_changed (GtkWidget *widget, EMMailerPrefs *prefs) +http_images_changed (GtkWidget *widget, + EMMailerPrefs *prefs) { EMailImageLoadingPolicy policy; @@ -669,7 +687,9 @@ static EMConfigItem emmp_items[] = { }; static void -emmp_free (EConfig *ec, GSList *items, gpointer data) +emmp_free (EConfig *ec, + GSList *items, + gpointer data) { /* the prefs data is freed automagically */ @@ -957,8 +977,8 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs, NULL); /* populated the listview with entries; firstly we add all the default headers, and then - we add read header configuration out of gconf. If a header in gconf is a default header, - we update the enabled flag accordingly + * we add read header configuration out of gconf. If a header in gconf is a default header, + * we update the enabled flag accordingly */ header_add_list = NULL; default_header_hash = g_hash_table_new (g_str_hash, g_str_equal); @@ -1086,8 +1106,12 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs, custom_junk_button_toggled (prefs->junk_header_check, prefs); jh_tree_refill (prefs); - g_signal_connect (G_OBJECT (prefs->junk_header_add), "clicked", G_CALLBACK (jh_add_cb), prefs); - g_signal_connect (G_OBJECT (prefs->junk_header_remove), "clicked", G_CALLBACK (jh_remove_cb), prefs); + g_signal_connect ( + prefs->junk_header_add, "clicked", + G_CALLBACK (jh_add_cb), prefs); + g_signal_connect ( + prefs->junk_header_remove, "clicked", + G_CALLBACK (jh_remove_cb), prefs); /* get our toplevel widget */ target = em_config_target_new_prefs (ec, prefs->gconf); diff --git a/modules/mail/em-network-prefs.c b/modules/mail/em-network-prefs.c index e12bb3c9c2..242c84993e 100644 --- a/modules/mail/em-network-prefs.c +++ b/modules/mail/em-network-prefs.c @@ -77,7 +77,8 @@ em_network_prefs_init (EMNetworkPrefs *prefs) } static void -toggle_button_toggled (GtkToggleButton *toggle, EMNetworkPrefs *prefs) +toggle_button_toggled (GtkToggleButton *toggle, + EMNetworkPrefs *prefs) { const gchar *key; @@ -93,7 +94,9 @@ toggle_button_toggled (GtkToggleButton *toggle, EMNetworkPrefs *prefs) } static void -toggle_button_init (EMNetworkPrefs *prefs, GtkToggleButton *toggle, const gchar *key) +toggle_button_init (EMNetworkPrefs *prefs, + GtkToggleButton *toggle, + const gchar *key) { gboolean bool; @@ -121,7 +124,9 @@ emnp_widget_glade (EConfig *ec, } static void -emnp_set_sensitiveness (EMNetworkPrefs *prefs, NetworkConfigProxyType type, gboolean sensitivity) +emnp_set_sensitiveness (EMNetworkPrefs *prefs, + NetworkConfigProxyType type, + gboolean sensitivity) { #if 0 if (type == NETWORK_PROXY_AUTOCONFIG) { @@ -160,7 +165,8 @@ emnp_set_sensitiveness (EMNetworkPrefs *prefs, NetworkConfigProxyType type, gboo } static void -notify_proxy_type_changed (GtkWidget *widget, EMNetworkPrefs *prefs) +notify_proxy_type_changed (GtkWidget *widget, + EMNetworkPrefs *prefs) { gint type; @@ -199,7 +205,8 @@ notify_proxy_type_changed (GtkWidget *widget, EMNetworkPrefs *prefs) } static void -widget_entry_changed_cb (GtkWidget *widget, gpointer data) +widget_entry_changed_cb (GtkWidget *widget, + gpointer data) { const gchar *value; gint port = -1; @@ -208,8 +215,8 @@ widget_entry_changed_cb (GtkWidget *widget, gpointer data) client = gconf_client_get_default (); /* - Do not change the order of comparison - - GtkSpinButton is an extended form of GtkEntry + * Do not change the order of comparison - + * GtkSpinButton is an extended form of GtkEntry */ if (GTK_IS_SPIN_BUTTON (widget)) { port = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (widget)); @@ -225,7 +232,8 @@ widget_entry_changed_cb (GtkWidget *widget, gpointer data) } static void -ignore_hosts_entry_changed_cb (GtkWidget *widget, const gchar *key) +ignore_hosts_entry_changed_cb (GtkWidget *widget, + const gchar *key) { const gchar *value; GSList *lst = NULL; @@ -280,7 +288,9 @@ static EMConfigItem emnp_items[] = { }; static void -emnp_free (EConfig *ec, GSList *items, gpointer data) +emnp_free (EConfig *ec, + GSList *items, + gpointer data) { /* the prefs data is freed automagically */ @@ -369,7 +379,7 @@ em_network_prefs_construct (EMNetworkPrefs *prefs) gtk_toggle_button_set_active (prefs->auto_proxy, val == NETWORK_PROXY_AUTOCONFIG); - g_signal_connect(prefs->auto_proxy_url, "changed", G_CALLBACK(widget_entry_changed_cb), GCONF_E_AUTOCONFIG_URL_KEY); + g_signal_connect (prefs->auto_proxy_url, "changed", G_CALLBACK(widget_entry_changed_cb), GCONF_E_AUTOCONFIG_URL_KEY); if (locked) gtk_widget_set_sensitive ((GtkWidget *) prefs->auto_proxy, FALSE); #endif diff --git a/modules/mailto-handler/evolution-mailto-handler.c b/modules/mailto-handler/evolution-mailto-handler.c index 797b4297f3..fdc3841f38 100644 --- a/modules/mailto-handler/evolution-mailto-handler.c +++ b/modules/mailto-handler/evolution-mailto-handler.c @@ -68,7 +68,7 @@ mailto_handler_get_shell (EMailtoHandler *extension) } static gboolean -mailto_handler_is_evolution (/*const*/ GAppInfo *app_info) +mailto_handler_is_evolution (/*const */ GAppInfo *app_info) { gint argc; gchar **argv; diff --git a/modules/plugin-lib/e-plugin-lib.c b/modules/plugin-lib/e-plugin-lib.c index e962835ca2..8ca0fed570 100644 --- a/modules/plugin-lib/e-plugin-lib.c +++ b/modules/plugin-lib/e-plugin-lib.c @@ -35,15 +35,15 @@ static gpointer parent_class; static GType plugin_lib_type; /* TODO: - We need some way to manage lifecycle. - We need some way to manage state. - - Maybe just the g module init method will do, or we could add - another which returns context. - - There is also the question of per-instance context, e.g. for config - pages. -*/ + * We need some way to manage lifecycle. + * We need some way to manage state. + * + * Maybe just the g module init method will do, or we could add + * another which returns context. + * + * There is also the question of per-instance context, e.g. for config + * pages. + */ static gint plugin_lib_loadmodule (EPlugin *plugin) @@ -93,7 +93,8 @@ plugin_lib_loadmodule (EPlugin *plugin) } static gpointer -plugin_lib_get_symbol (EPlugin *plugin, const gchar *name) +plugin_lib_get_symbol (EPlugin *plugin, + const gchar *name) { EPluginLib *plugin_lib = E_PLUGIN_LIB (plugin); gpointer symbol; @@ -108,7 +109,9 @@ plugin_lib_get_symbol (EPlugin *plugin, const gchar *name) } static gpointer -plugin_lib_invoke (EPlugin *plugin, const gchar *name, gpointer data) +plugin_lib_invoke (EPlugin *plugin, + const gchar *name, + gpointer data) { EPluginLib *plugin_lib = E_PLUGIN_LIB (plugin); EPluginLibFunc func; @@ -131,7 +134,8 @@ plugin_lib_invoke (EPlugin *plugin, const gchar *name, gpointer data) } static gint -plugin_lib_construct (EPlugin *plugin, xmlNodePtr root) +plugin_lib_construct (EPlugin *plugin, + xmlNodePtr root) { EPluginLib *plugin_lib = E_PLUGIN_LIB (plugin); @@ -191,7 +195,8 @@ plugin_lib_get_configure_widget (EPlugin *plugin) } static void -plugin_lib_enable (EPlugin *plugin, gint state) +plugin_lib_enable (EPlugin *plugin, + gint state) { EPluginLib *plugin_lib = E_PLUGIN_LIB (plugin); EPluginLibEnableFunc enable; diff --git a/modules/plugin-manager/evolution-plugin-manager.c b/modules/plugin-manager/evolution-plugin-manager.c index 582f1736c6..29dba6c160 100644 --- a/modules/plugin-manager/evolution-plugin-manager.c +++ b/modules/plugin-manager/evolution-plugin-manager.c @@ -96,7 +96,8 @@ GType e_plugin_manager_get_type (void); G_DEFINE_DYNAMIC_TYPE (EPluginManager, e_plugin_manager, E_TYPE_EXTENSION) static void -eppm_set_label (GtkLabel *l, const gchar *v) +eppm_set_label (GtkLabel *l, + const gchar *v) { gtk_label_set_label(l, v?v:_("Unknown")); } @@ -171,7 +172,8 @@ eppm_show_plugin (Manager *m, } static void -eppm_selection_changed (GtkTreeSelection *selection, Manager *m) +eppm_selection_changed (GtkTreeSelection *selection, + Manager *m) { GtkTreeModel *model; GtkTreeIter iter; diff --git a/modules/plugin-mono/e-plugin-mono.c b/modules/plugin-mono/e-plugin-mono.c index bd5424921d..1c4113504d 100644 --- a/modules/plugin-mono/e-plugin-mono.c +++ b/modules/plugin-mono/e-plugin-mono.c @@ -50,7 +50,8 @@ static gpointer parent_class; static GType plugin_mono_type; static gchar * -get_xml_prop (xmlNodePtr node, const gchar *id) +get_xml_prop (xmlNodePtr node, + const gchar *id) { xmlChar *prop; gchar *out = NULL; @@ -82,7 +83,8 @@ plugin_mono_finalize (GObject *object) } static gint -plugin_mono_construct (EPlugin *plugin, xmlNodePtr root) +plugin_mono_construct (EPlugin *plugin, + xmlNodePtr root) { EPluginMono *plugin_mono; @@ -99,11 +101,11 @@ plugin_mono_construct (EPlugin *plugin, xmlNodePtr root) /* Two approaches: - You can have a Evolution.Plugin implementation which has every - callback as methods on it. Or you can just use static methods - for everything. - - All methods take a single (structured) argument. + * You can have a Evolution.Plugin implementation which has every + * callback as methods on it. Or you can just use static methods + * for everything. + * + * All methods take a single (structured) argument. */ static gpointer @@ -155,7 +157,7 @@ plugin_mono_invoke (EPlugin *plugin, if (m == NULL) { if (priv->class) { /* class method */ - MonoMethod* mono_method; + MonoMethod * mono_method; gpointer iter = NULL; d = mono_method_desc_new (name, FALSE); @@ -194,7 +196,7 @@ plugin_mono_invoke (EPlugin *plugin, g_hash_table_insert (priv->methods, g_strdup (name), m); } - params = g_malloc0 (sizeof (*params)*1); + params = g_malloc0 (sizeof (*params) * 1); params[0] = &data; res = mono_runtime_invoke (m, priv->plugin, params, &x); /* do i need to free params?? */ diff --git a/modules/plugin-python/e-plugin-python.c b/modules/plugin-python/e-plugin-python.c index aaa6fb2b66..a00e629068 100644 --- a/modules/plugin-python/e-plugin-python.c +++ b/modules/plugin-python/e-plugin-python.c @@ -44,7 +44,8 @@ static gpointer parent_class; static GType plugin_python_type; static gchar * -get_xml_prop (xmlNodePtr node, const gchar *id) +get_xml_prop (xmlNodePtr node, + const gchar *id) { xmlChar *prop; gchar *out = NULL; @@ -77,7 +78,8 @@ plugin_python_finalize (GObject *object) } static gint -plugin_python_construct (EPlugin *plugin, xmlNodePtr root) +plugin_python_construct (EPlugin *plugin, + xmlNodePtr root) { EPluginPython *plugin_python; @@ -124,7 +126,7 @@ plugin_python_invoke (EPlugin *plugin, priv->pModule = PyImport_Import (pModuleName); - Py_DECREF (pModuleName); //Free + Py_DECREF (pModuleName); if (priv->pModule == NULL) { PyErr_Print (); diff --git a/modules/startup-wizard/evolution-startup-wizard.c b/modules/startup-wizard/evolution-startup-wizard.c index 3cfca9318a..75ef5d8d99 100644 --- a/modules/startup-wizard/evolution-startup-wizard.c +++ b/modules/startup-wizard/evolution-startup-wizard.c @@ -82,7 +82,8 @@ GType e_startup_wizard_get_type (void); G_DEFINE_DYNAMIC_TYPE (EStartupWizard, e_startup_wizard, E_TYPE_EXTENSION) G_GNUC_NORETURN static void -startup_wizard_terminate (void) { +startup_wizard_terminate (void) +{ gtk_main_quit (); _exit (0); } diff --git a/modules/windows-sens/evolution-windows-sens.c b/modules/windows-sens/evolution-windows-sens.c index d974422cd5..d2154590b1 100644 --- a/modules/windows-sens/evolution-windows-sens.c +++ b/modules/windows-sens/evolution-windows-sens.c @@ -257,22 +257,22 @@ typedef struct ESensNetworkListener { EWindowsSENS *ews_ptr; } ESensNetworkListener; -static void e_sens_network_listener_init (ESensNetworkListener**,EWindowsSENS*); +static void e_sens_network_listener_init (ESensNetworkListener **,EWindowsSENS *); /* Functions to implement ISensNetwork interface */ -static HRESULT WINAPI e_sens_network_listener_queryinterface (ISensNetwork*,REFIID,PVOID *); -static ULONG WINAPI e_sens_network_listener_addref (ISensNetwork*); -static ULONG WINAPI e_sens_network_listener_release (ISensNetwork*); -static HRESULT WINAPI e_sens_network_listener_gettypeinfocount (ISensNetwork*, UINT*); -static HRESULT WINAPI e_sens_network_listener_gettypeinfo (ISensNetwork*,UINT,LCID,ITypeInfo**); -static HRESULT WINAPI e_sens_network_listener_getidsofnames (ISensNetwork*,REFIID,LPOLESTR*,UINT,LCID, DISPID*); -static HRESULT WINAPI e_sens_network_listener_invoke (ISensNetwork*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*); -static HRESULT WINAPI e_sens_network_listener_connectionmade (ISensNetwork*,BSTR,ULONG,LPSENS_QOCINFO); -static HRESULT WINAPI e_sens_network_listener_connectionmadenoqocinfo (ISensNetwork*,BSTR,ULONG); -static HRESULT WINAPI e_sens_network_listener_connectionlost (ISensNetwork*,BSTR,ULONG); -static HRESULT WINAPI e_sens_network_listener_destinationreachable (ISensNetwork*,BSTR,BSTR,ULONG,LPSENS_QOCINFO); -static HRESULT WINAPI e_sens_network_listener_destinationreachablenoqocinfo (ISensNetwork*,BSTR,BSTR,ULONG); +static HRESULT WINAPI e_sens_network_listener_queryinterface (ISensNetwork *,REFIID,PVOID *); +static ULONG WINAPI e_sens_network_listener_addref (ISensNetwork *); +static ULONG WINAPI e_sens_network_listener_release (ISensNetwork *); +static HRESULT WINAPI e_sens_network_listener_gettypeinfocount (ISensNetwork *, UINT *); +static HRESULT WINAPI e_sens_network_listener_gettypeinfo (ISensNetwork *,UINT,LCID,ITypeInfo **); +static HRESULT WINAPI e_sens_network_listener_getidsofnames (ISensNetwork *,REFIID,LPOLESTR *,UINT,LCID, DISPID *); +static HRESULT WINAPI e_sens_network_listener_invoke (ISensNetwork *,DISPID,REFIID,LCID,WORD,DISPPARAMS *,VARIANT *,EXCEPINFO *,UINT *); +static HRESULT WINAPI e_sens_network_listener_connectionmade (ISensNetwork *,BSTR,ULONG,LPSENS_QOCINFO); +static HRESULT WINAPI e_sens_network_listener_connectionmadenoqocinfo (ISensNetwork *,BSTR,ULONG); +static HRESULT WINAPI e_sens_network_listener_connectionlost (ISensNetwork *,BSTR,ULONG); +static HRESULT WINAPI e_sens_network_listener_destinationreachable (ISensNetwork *,BSTR,BSTR,ULONG,LPSENS_QOCINFO); +static HRESULT WINAPI e_sens_network_listener_destinationreachablenoqocinfo (ISensNetwork *,BSTR,BSTR,ULONG); /* Initializing the VTable of our ESensNetworkListener object */ @@ -293,12 +293,12 @@ static ISensNetworkVtbl ESensNetworkListenerVtbl = { static HRESULT WINAPI e_sens_network_listener_queryinterface (ISensNetwork *This, - REFIID iid, - void **ppv) + REFIID iid, + gpointer *ppv) { if (IsEqualIID (iid, &IID_IUnknown) || IsEqualIID (iid, &IID_IDispatch) || IsEqualIID (iid, &IID_ISensNetwork)) { *ppv = This; - ((LPUNKNOWN)*ppv)->lpVtbl->AddRef ((LPUNKNOWN)*ppv); + ((LPUNKNOWN) * ppv)->lpVtbl->AddRef ((LPUNKNOWN) * ppv); return S_OK; } *ppv = NULL; @@ -308,67 +308,67 @@ e_sens_network_listener_queryinterface (ISensNetwork *This, static ULONG WINAPI e_sens_network_listener_addref (ISensNetwork *This) { - ESensNetworkListener *esnl_ptr=(ESensNetworkListener*) This; + ESensNetworkListener *esnl_ptr = (ESensNetworkListener *) This; return InterlockedIncrement (&(esnl_ptr->ref)); } static ULONG WINAPI e_sens_network_listener_release (ISensNetwork *This) { - ESensNetworkListener *esnl_ptr=(ESensNetworkListener*) This; + ESensNetworkListener *esnl_ptr = (ESensNetworkListener *) This; ULONG tmp = InterlockedDecrement (&(esnl_ptr->ref)); return tmp; } static HRESULT WINAPI e_sens_network_listener_gettypeinfocount (ISensNetwork *This, - UINT *pctinfo) + UINT *pctinfo) { return E_NOTIMPL; } static HRESULT WINAPI e_sens_network_listener_gettypeinfo (ISensNetwork *This, - UINT iTInfo, - LCID lcid, - ITypeInfo **ppTInfo) + UINT iTInfo, + LCID lcid, + ITypeInfo **ppTInfo) { return E_NOTIMPL; } static HRESULT WINAPI e_sens_network_listener_getidsofnames (ISensNetwork *This, - REFIID riid, - LPOLESTR *rgszNames, - UINT cNames, - LCID lcid, - DISPID *rgDispId) + REFIID riid, + LPOLESTR *rgszNames, + UINT cNames, + LCID lcid, + DISPID *rgDispId) { return E_NOTIMPL; } static HRESULT WINAPI e_sens_network_listener_invoke (ISensNetwork *This, - DISPID dispIdMember, - REFIID riid, - LCID lcid, - WORD wFlags, - DISPPARAMS *pDispParams, - VARIANT *pVarResult, - EXCEPINFO *pExcepInfo, - UINT *puArgErr) + DISPID dispIdMember, + REFIID riid, + LCID lcid, + WORD wFlags, + DISPPARAMS *pDispParams, + VARIANT *pVarResult, + EXCEPINFO *pExcepInfo, + UINT *puArgErr) { return E_NOTIMPL; } static HRESULT WINAPI -e_sens_network_listener_connectionmade (ISensNetwork *This, - BSTR bstrConnection, - ULONG ulType, +e_sens_network_listener_connectionmade (ISensNetwork *This, + BSTR bstrConnection, + ULONG ulType, LPSENS_QOCINFO lpQOCInfo) { if (ulType) { - ESensNetworkListener *esnl_ptr=(ESensNetworkListener*) This; + ESensNetworkListener *esnl_ptr = (ESensNetworkListener *) This; EShell *shell = windows_sens_get_shell (esnl_ptr->ews_ptr); /* Wait a second so that the connection stabilizes */ g_usleep (G_USEC_PER_SEC); @@ -379,20 +379,19 @@ e_sens_network_listener_connectionmade (ISensNetwork *This, static HRESULT WINAPI e_sens_network_listener_connectionmadenoqocinfo (ISensNetwork *This, - BSTR bstrConnection, - ULONG ulType) + BSTR bstrConnection, + ULONG ulType) { - //Always followed by ConnectionMade return S_OK; } static HRESULT WINAPI e_sens_network_listener_connectionlost (ISensNetwork *This, - BSTR bstrConnection, - ULONG ulType) + BSTR bstrConnection, + ULONG ulType) { if (ulType) { - ESensNetworkListener *esnl_ptr=(ESensNetworkListener*) This; + ESensNetworkListener *esnl_ptr = (ESensNetworkListener *) This; EShell *shell = windows_sens_get_shell (esnl_ptr->ews_ptr); e_shell_set_network_available (shell, FALSE); } @@ -400,14 +399,14 @@ e_sens_network_listener_connectionlost (ISensNetwork *This, } static HRESULT WINAPI -e_sens_network_listener_destinationreachable (ISensNetwork *This, - BSTR bstrDestination, - BSTR bstrConnection, - ULONG ulType, +e_sens_network_listener_destinationreachable (ISensNetwork *This, + BSTR bstrDestination, + BSTR bstrConnection, + ULONG ulType, LPSENS_QOCINFO lpQOCInfo) { if (ulType) { - ESensNetworkListener *esnl_ptr=(ESensNetworkListener*) This; + ESensNetworkListener *esnl_ptr = (ESensNetworkListener *) This; EShell *shell = windows_sens_get_shell (esnl_ptr->ews_ptr); /* Wait a second so that the connection stabilizes */ g_usleep (G_USEC_PER_SEC); @@ -418,16 +417,16 @@ e_sens_network_listener_destinationreachable (ISensNetwork *This, static HRESULT WINAPI e_sens_network_listener_destinationreachablenoqocinfo (ISensNetwork *This, - BSTR bstrDestination, - BSTR bstrConnection, - ULONG ulType) + BSTR bstrDestination, + BSTR bstrConnection, + ULONG ulType) { return S_OK; } static void e_sens_network_listener_init (ESensNetworkListener **esnl_ptr, - EWindowsSENS *ews) + EWindowsSENS *ews) { (*esnl_ptr) = g_new0 (ESensNetworkListener,1); (*esnl_ptr)->lpVtbl = &ESensNetworkListenerVtbl; @@ -436,7 +435,7 @@ e_sens_network_listener_init (ESensNetworkListener **esnl_ptr, } static BSTR -_mb2wchar (const gchar * a) +_mb2wchar (const gchar *a) { static WCHAR b[64]; MultiByteToWideChar (0, 0, a, -1, b, 64); @@ -451,7 +450,7 @@ static const gchar * add_curly_braces_to_uuid (const gchar * string_uuid) return NULL; lstrcpy(curly_braced_uuid_string,"{"); i = strlen (curly_braced_uuid_string); - lstrcat (curly_braced_uuid_string+i,string_uuid); + lstrcat (curly_braced_uuid_string + i,string_uuid); i = strlen (curly_braced_uuid_string); lstrcat(curly_braced_uuid_string+i,"}"); return curly_braced_uuid_string; @@ -464,7 +463,7 @@ windows_sens_constructed (GObject *object) { HRESULT res; static IEventSystem *pEventSystem =0; - static IEventSubscription* pEventSubscription = 0; + static IEventSubscription * pEventSubscription = 0; static ESensNetworkListener *pESensNetworkListener = 0; static const gchar * eventclassid="{D5978620-5B9F-11D1-8DD2-00AA004ABD5E}"; static const gchar * methods[]={ @@ -488,51 +487,51 @@ windows_sens_constructed (GObject *object) CoInitialize (0); - res=CoCreateInstance (&CLSID_CEventSystem, 0,CLSCTX_SERVER,&IID_IEventSystem,(LPVOID*)&pEventSystem); + res = CoCreateInstance (&CLSID_CEventSystem, 0,CLSCTX_SERVER,&IID_IEventSystem,(LPVOID *) &pEventSystem); if (res == S_OK && pEventSystem) { - unsigned i; + guint i; - for (i=0; i<G_N_ELEMENTS (methods); i++) { + for (i = 0; i < G_N_ELEMENTS (methods); i++) { - res=CoCreateInstance (&CLSID_CEventSubscription, 0, CLSCTX_SERVER, &IID_IEventSubscription, (LPVOID*)&pEventSubscription); + res = CoCreateInstance (&CLSID_CEventSubscription, 0, CLSCTX_SERVER, &IID_IEventSubscription, (LPVOID *) &pEventSubscription); if (res == S_OK && pEventSubscription) { UUID tmp_uuid; UuidCreate (&tmp_uuid); UuidToString (&tmp_uuid, &subids[i]); - res=pEventSubscription->lpVtbl->put_SubscriptionID (pEventSubscription, _mb2wchar (add_curly_braces_to_uuid ((gchar *) subids[i]))); + res = pEventSubscription->lpVtbl->put_SubscriptionID (pEventSubscription, _mb2wchar (add_curly_braces_to_uuid ((gchar *) subids[i]))); if (res) { RpcStringFree (&subids[i]); break; } RpcStringFree (&subids[i]); - res=pEventSubscription->lpVtbl->put_SubscriptionName (pEventSubscription, _mb2wchar (names[i])); + res = pEventSubscription->lpVtbl->put_SubscriptionName (pEventSubscription, _mb2wchar (names[i])); if (res) break; - res=pEventSubscription->lpVtbl->put_MethodName (pEventSubscription, _mb2wchar (methods[i])); + res = pEventSubscription->lpVtbl->put_MethodName (pEventSubscription, _mb2wchar (methods[i])); if (res) break; - res=pEventSubscription->lpVtbl->put_EventClassID (pEventSubscription, _mb2wchar (eventclassid)); + res = pEventSubscription->lpVtbl->put_EventClassID (pEventSubscription, _mb2wchar (eventclassid)); if (res) break; - res=pEventSubscription->lpVtbl->put_SubscriberInterface (pEventSubscription, (IUnknown*) pESensNetworkListener); + res = pEventSubscription->lpVtbl->put_SubscriberInterface (pEventSubscription, (IUnknown *) pESensNetworkListener); if (res) break; /* Make the subscription receive the event only if the owner of the subscription * is logged on to the same computer as the publisher. This makes this module * work with normal user account without administrative privileges. */ - res=pEventSubscription->lpVtbl->put_PerUser (pEventSubscription, TRUE); + res = pEventSubscription->lpVtbl->put_PerUser (pEventSubscription, TRUE); if (res) break; - res=pEventSystem->lpVtbl->Store (pEventSystem, (BSTR) PROGID_EventSubscription, (IUnknown*) pEventSubscription); + res = pEventSystem->lpVtbl->Store (pEventSystem, (BSTR) PROGID_EventSubscription, (IUnknown *) pEventSubscription); if (res) break; pEventSubscription->lpVtbl->Release (pEventSubscription); - pEventSubscription=0; + pEventSubscription = 0; } } if (pEventSubscription) @@ -545,7 +544,7 @@ windows_sens_constructed (GObject *object) */ if (res == S_OK) { - typedef BOOL (WINAPI* IsNetworkAlive_t) (LPDWORD); + typedef BOOL (WINAPI * IsNetworkAlive_t) (LPDWORD); BOOL alive = TRUE; EShell *shell = windows_sens_get_shell (extension); @@ -571,11 +570,11 @@ windows_sens_constructed (GObject *object) strcat (buf, G_DIR_SEPARATOR_S); strcat (buf, SENSAPI_DLL); - hDLL=LoadLibrary (buf); + hDLL = LoadLibrary (buf); if ((pIsNetworkAlive=(IsNetworkAlive_t) GetProcAddress (hDLL, "IsNetworkAlive"))) { DWORD Network; - alive=pIsNetworkAlive (&Network); + alive = pIsNetworkAlive (&Network); } FreeLibrary (hDLL); diff --git a/plugins/addressbook-file/addressbook-file.c b/plugins/addressbook-file/addressbook-file.c index 6c8922788e..37ed087c01 100644 --- a/plugins/addressbook-file/addressbook-file.c +++ b/plugins/addressbook-file/addressbook-file.c @@ -32,7 +32,8 @@ gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } @@ -40,7 +41,8 @@ e_plugin_lib_enable (EPlugin *ep, gint enable) GtkWidget *e_book_file_dummy (EPlugin *epl, EConfigHookItemFactoryData *data); GtkWidget * -e_book_file_dummy (EPlugin *epl, EConfigHookItemFactoryData *data) +e_book_file_dummy (EPlugin *epl, + EConfigHookItemFactoryData *data) { EABConfigTargetSource *t = (EABConfigTargetSource *) data->target; ESource *source = t->source; diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 5c842d156d..7a6a9fce55 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -66,7 +66,7 @@ gint e_plugin_lib_enable (EPlugin *ep, gint enable); GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *plugin); void org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t); -GtkWidget* org_gnome_attachment_reminder_config_option (EPlugin *plugin, struct _EConfigHookItemFactoryData *data); +GtkWidget * org_gnome_attachment_reminder_config_option (EPlugin *plugin, struct _EConfigHookItemFactoryData *data); static gboolean ask_for_missing_attachment (EPlugin *ep, GtkWindow *widget); static gboolean check_for_attachment_clues (gchar *msg); @@ -75,13 +75,15 @@ static gchar * strip_text_msg (gchar *msg); static void commit_changes (UIData *ui); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } void -org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t) +org_gnome_evolution_attachment_reminder (EPlugin *ep, + EMEventTargetComposer *t) { GByteArray *raw_msg_barray; @@ -107,7 +109,8 @@ org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t) } static gboolean -ask_for_missing_attachment (EPlugin *ep, GtkWindow *window) +ask_for_missing_attachment (EPlugin *ep, + GtkWindow *window) { GtkWidget *check; GtkWidget *dialog; @@ -157,7 +160,7 @@ check_for_attachment_clues (gchar *msg) g_object_unref (gconf); msg_length = strlen (msg); - for (list = clue_list;list && !ret_val;list=g_slist_next (list)) { + for (list = clue_list; list && !ret_val; list = g_slist_next (list)) { gchar *needle = g_utf8_strdown (list->data, -1); if (g_strstr_len (msg, msg_length, needle)) { ret_val = TRUE; @@ -191,7 +194,7 @@ strip_text_msg (gchar *msg) { gchar **lines = g_strsplit ( msg, "\n", -1); gchar *stripped_msg = g_strdup (" "); - guint i=0; + guint i = 0; gchar *temp; /* Note : HTML Signatures won't work. Depends on Bug #522784 */ @@ -273,7 +276,8 @@ cell_editing_canceled_cb (GtkCellRenderer *cell, } static void -clue_add_clicked (GtkButton *button, UIData *ui) +clue_add_clicked (GtkButton *button, + UIData *ui) { GtkTreeModel *model; GtkTreeView *tree_view; @@ -294,7 +298,8 @@ clue_add_clicked (GtkButton *button, UIData *ui) } static void -clue_remove_clicked (GtkButton *button, UIData *ui) +clue_remove_clicked (GtkButton *button, + UIData *ui) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -337,7 +342,8 @@ clue_remove_clicked (GtkButton *button, UIData *ui) } static void -clue_edit_clicked (GtkButton *button, UIData *ui) +clue_edit_clicked (GtkButton *button, + UIData *ui) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -359,7 +365,8 @@ clue_edit_clicked (GtkButton *button, UIData *ui) } static void -selection_changed (GtkTreeSelection *selection, UIData *ui) +selection_changed (GtkTreeSelection *selection, + UIData *ui) { GtkTreeModel *model; GtkTreeIter iter; @@ -456,7 +463,7 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) renderer = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"), renderer, "text", CLUE_KEYWORD_COLUMN, NULL); - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + g_object_set (renderer, "editable", TRUE, NULL); g_signal_connect ( renderer, "edited", G_CALLBACK (cell_edited_cb), ui); @@ -466,18 +473,26 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), ui); + g_signal_connect ( + selection, "changed", + G_CALLBACK (selection_changed), ui); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ui->treeview), TRUE); ui->clue_add = clue_add; - g_signal_connect (G_OBJECT (ui->clue_add), "clicked", G_CALLBACK (clue_add_clicked), ui); + g_signal_connect ( + ui->clue_add, "clicked", + G_CALLBACK (clue_add_clicked), ui); ui->clue_remove = clue_remove; - g_signal_connect (G_OBJECT (ui->clue_remove), "clicked", G_CALLBACK (clue_remove_clicked), ui); + g_signal_connect ( + ui->clue_remove, "clicked", + G_CALLBACK (clue_remove_clicked), ui); gtk_widget_set_sensitive (ui->clue_remove, FALSE); ui->clue_edit = clue_edit; - g_signal_connect (G_OBJECT (ui->clue_edit), "clicked", G_CALLBACK (clue_edit_clicked), ui); + g_signal_connect ( + ui->clue_edit, "clicked", + G_CALLBACK (clue_edit_clicked), ui); gtk_widget_set_sensitive (ui->clue_edit, FALSE); /* Populate tree view with values from gconf */ diff --git a/plugins/audio-inline/audio-inline.c b/plugins/audio-inline/audio-inline.c index 07b1bd679b..a5e7ccd68c 100644 --- a/plugins/audio-inline/audio-inline.c +++ b/plugins/audio-inline/audio-inline.c @@ -37,7 +37,8 @@ gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } @@ -104,7 +105,8 @@ org_gnome_audio_inline_pobject_free (EMFormatHTMLPObject *o) } static void -org_gnome_audio_inline_pause_clicked (GtkWidget *button, EMFormatHTMLPObject *pobject) +org_gnome_audio_inline_pause_clicked (GtkWidget *button, + EMFormatHTMLPObject *pobject) { struct _org_gnome_audio_inline_pobject *po = (struct _org_gnome_audio_inline_pobject *) pobject; @@ -115,7 +117,8 @@ org_gnome_audio_inline_pause_clicked (GtkWidget *button, EMFormatHTMLPObject *po } static void -org_gnome_audio_inline_stop_clicked (GtkWidget *button, EMFormatHTMLPObject *pobject) +org_gnome_audio_inline_stop_clicked (GtkWidget *button, + EMFormatHTMLPObject *pobject) { struct _org_gnome_audio_inline_pobject *po = (struct _org_gnome_audio_inline_pobject *) pobject; @@ -143,7 +146,9 @@ org_gnome_audio_inline_set_audiosink (GstElement *playbin) } static gboolean -org_gnome_audio_inline_gst_callback (GstBus * bus, GstMessage * message, gpointer data) +org_gnome_audio_inline_gst_callback (GstBus *bus, + GstMessage *message, + gpointer data) { struct _org_gnome_audio_inline_pobject *po = (struct _org_gnome_audio_inline_pobject *) data; GstMessageType msg_type; @@ -189,7 +194,8 @@ org_gnome_audio_inline_gst_callback (GstBus * bus, GstMessage * message, gpointe } static void -org_gnome_audio_inline_play_clicked (GtkWidget *button, EMFormatHTMLPObject *pobject) +org_gnome_audio_inline_play_clicked (GtkWidget *button, + EMFormatHTMLPObject *pobject) { struct _org_gnome_audio_inline_pobject *po = (struct _org_gnome_audio_inline_pobject *) pobject; GstState cur_state; @@ -230,7 +236,7 @@ org_gnome_audio_inline_play_clicked (GtkWidget *button, EMFormatHTMLPObject *pob } uri = g_filename_to_uri (po->filename, NULL, NULL); - g_object_set (G_OBJECT (po->playbin), "uri", uri, NULL); + g_object_set (po->playbin, "uri", uri, NULL); g_free (uri); org_gnome_audio_inline_set_audiosink (po->playbin); @@ -257,7 +263,11 @@ org_gnome_audio_inline_play_clicked (GtkWidget *button, EMFormatHTMLPObject *pob } static GtkWidget * -org_gnome_audio_inline_add_button (GtkWidget *box, const gchar *stock_icon, GCallback cb, gpointer data, gboolean sensitive) +org_gnome_audio_inline_add_button (GtkWidget *box, + const gchar *stock_icon, + GCallback cb, + gpointer data, + gboolean sensitive) { GtkWidget *button; @@ -272,7 +282,9 @@ org_gnome_audio_inline_add_button (GtkWidget *box, const gchar *stock_icon, GCal } static gboolean -org_gnome_audio_inline_button_panel (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) +org_gnome_audio_inline_button_panel (EMFormatHTML *efh, + GtkHTMLEmbedded *eb, + EMFormatHTMLPObject *pobject) { GtkWidget *box; struct _org_gnome_audio_inline_pobject *po = (struct _org_gnome_audio_inline_pobject *) pobject; @@ -291,7 +303,8 @@ org_gnome_audio_inline_button_panel (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMF } void -org_gnome_audio_inline_format (gpointer ep, EMFormatHookTarget *t) +org_gnome_audio_inline_format (gpointer ep, + EMFormatHookTarget *t) { struct _org_gnome_audio_inline_pobject *pobj; gchar *classid; diff --git a/plugins/backup-restore/backup-restore.c b/plugins/backup-restore/backup-restore.c index d6e1b05076..f558b19c71 100644 --- a/plugins/backup-restore/backup-restore.c +++ b/plugins/backup-restore/backup-restore.c @@ -55,20 +55,22 @@ void backup_restore_commit (EPlugin *ep, EMConfigTargetAccount *target); void backup_restore_abort (EPlugin *ep, EMConfigTargetAccount *target); typedef enum _br_flags { - BR_OK = 1<<0, - BR_START = 1<<1 + BR_OK = 1 << 0, + BR_START = 1 << 1 }br_flags; gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } static void -backup (const gchar *filename, gboolean restart) +backup (const gchar *filename, + gboolean restart) { if (restart) execl (EVOLUTION_TOOLSDIR "/evolution-backup", "evolution-backup", "--gui", "--backup", "--restart", filename, (gchar *)NULL); @@ -77,7 +79,8 @@ backup (const gchar *filename, gboolean restart) } static void -restore (const gchar *filename, gboolean restart) +restore (const gchar *filename, + gboolean restart) { if (restart) execl (EVOLUTION_TOOLSDIR "/evolution-backup", "evolution-backup", "--gui", "--restore", "--restart", filename, (gchar *)NULL); @@ -111,7 +114,10 @@ sanity_check (const gchar *filename) } static guint32 -dialog_prompt_user (GtkWindow *parent, const gchar *string, const gchar *tag, ...) +dialog_prompt_user (GtkWindow *parent, + const gchar *string, + const gchar *tag, + ...) { GtkWidget *dialog; GtkWidget *check = NULL; @@ -270,7 +276,8 @@ action_settings_restore_cb (GtkAction *action, } static void -check_toggled (GtkToggleButton *button, GtkAssistant *assistant) +check_toggled (GtkToggleButton *button, + GtkAssistant *assistant) { GtkWidget *box = g_object_get_data ((GObject *)button, "box"); gboolean state = gtk_toggle_button_get_active ((GtkToggleButton *) button); @@ -283,7 +290,8 @@ check_toggled (GtkToggleButton *button, GtkAssistant *assistant) } static void -file_changed (GtkFileChooser *chooser, GtkAssistant *assistant) +file_changed (GtkFileChooser *chooser, + GtkAssistant *assistant) { gchar *file = NULL, *prevfile = NULL; @@ -296,7 +304,9 @@ file_changed (GtkFileChooser *chooser, GtkAssistant *assistant) } static gboolean -backup_restore_check (EConfig *ec, const gchar *pageid, gpointer data) +backup_restore_check (EConfig *ec, + const gchar *pageid, + gpointer data) { GtkAssistant *assistant = data; gint do_restore; @@ -314,7 +324,8 @@ backup_restore_check (EConfig *ec, const gchar *pageid, gpointer data) } GtkWidget * -backup_restore_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data) +backup_restore_page (EPlugin *ep, + EConfigHookItemFactoryData *hook_data) { GtkWidget *page, *hbox, *label, *cbox, *button; GtkAssistant *assistant = GTK_ASSISTANT (hook_data->parent); @@ -359,7 +370,8 @@ backup_restore_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data) return GTK_WIDGET (page); } void -backup_restore_commit (EPlugin *ep, EMConfigTargetAccount *target) +backup_restore_commit (EPlugin *ep, + EMConfigTargetAccount *target) { GtkWidget *assistant = target->target.config->widget; gboolean state = GPOINTER_TO_INT (g_object_get_data ((GObject *)assistant, "restore")) ? TRUE : FALSE; @@ -377,7 +389,8 @@ backup_restore_commit (EPlugin *ep, EMConfigTargetAccount *target) } void -backup_restore_abort (EPlugin *ep, EMConfigTargetAccount *target) +backup_restore_abort (EPlugin *ep, + EMConfigTargetAccount *target) { /* Nothing really */ } diff --git a/plugins/backup-restore/backup.c b/plugins/backup-restore/backup.c index f813b2ca55..370608ac2a 100644 --- a/plugins/backup-restore/backup.c +++ b/plugins/backup-restore/backup.c @@ -95,7 +95,9 @@ static GOptionEntry options[] = { static gboolean check (const gchar *filename, gboolean *is_new_format); static GString * -replace_string (const gchar *text, const gchar *find, const gchar *replace) +replace_string (const gchar *text, + const gchar *find, + const gchar *replace) { const gchar *p, *next; GString *str; @@ -183,7 +185,9 @@ replace_variables (const gchar *str) } static void -replace_in_file (const gchar *filename, const gchar *find, const gchar *replace) +replace_in_file (const gchar *filename, + const gchar *find, + const gchar *replace) { gchar *content = NULL; GError *error = NULL; @@ -338,7 +342,9 @@ backup (const gchar *filename, } static void -extract_backup_dirs (const gchar *filename, gchar **data_dir, gchar **config_dir) +extract_backup_dirs (const gchar *filename, + gchar **data_dir, + gchar **config_dir) { GKeyFile *key_file; GError *error = NULL; @@ -524,7 +530,8 @@ restore (const gchar *filename, } static gboolean -check (const gchar *filename, gboolean *is_new_format) +check (const gchar *filename, + gboolean *is_new_format) { gchar *command; gchar *quotedfname; @@ -650,7 +657,8 @@ dlg_response (GtkWidget *dlg, } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GCancellable *cancellable; gchar *file = NULL, *oper = NULL; @@ -674,7 +682,7 @@ main (gint argc, gchar **argv) p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy"); if (p_SetProcessDEPPolicy) - (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); + (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); } #endif #endif @@ -770,7 +778,7 @@ main (gint argc, gchar **argv) txt2 = _("Please wait while Evolution is restoring your data."); } else { /* do not translate these two, it's just a fallback when something goes wrong, - we should never get here anyway. */ + * we should never get here anyway. */ txt = "Oops, doing nothing..."; txt2 = "Should not be here now, really..."; } diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c index 2c53eaf56c..d24e75480c 100644 --- a/plugins/bbdb/bbdb.c +++ b/plugins/bbdb/bbdb.c @@ -67,7 +67,8 @@ static GtkWidget *create_addressbook_combo_box (struct bbdb_stuff *stuff, gint t static void cleanup_cb (GObject *o, gpointer data); static ESource * -find_esource_by_uri (ESourceList *source_list, const gchar *target_uri) +find_esource_by_uri (ESourceList *source_list, + const gchar *target_uri) { GSList *groups; @@ -135,7 +136,8 @@ get_check_interval (void) } gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { static guint update_source = 0; @@ -229,7 +231,8 @@ bbdb_do_in_thread (gpointer data) } static void -bbdb_do_thread (const gchar *name, const gchar *email) +bbdb_do_thread (const gchar *name, + const gchar *email) { todo_struct *td; @@ -243,7 +246,7 @@ bbdb_do_thread (const gchar *name, const gchar *email) G_LOCK (todo); if (todo) { /* the list isn't empty, which means there is a thread taking - care of that, thus just add it to the queue */ + * care of that, thus just add it to the queue */ todo = g_slist_append (todo, td); } else { GError *error = NULL; @@ -303,7 +306,8 @@ walk_destinations_and_free (EDestination **dests) } void -bbdb_handle_send (EPlugin *ep, EMEventTargetComposer *target) +bbdb_handle_send (EPlugin *ep, + EMEventTargetComposer *target) { EComposerHeaderTable *table; GConfClient *gconf; @@ -325,7 +329,9 @@ bbdb_handle_send (EPlugin *ep, EMEventTargetComposer *target) } static void -bbdb_do_it (EBookClient *client, const gchar *name, const gchar *email) +bbdb_do_it (EBookClient *client, + const gchar *name, + const gchar *email) { gchar *query_string, *delim, *temp_name = NULL, *uid; GSList *contacts = NULL; @@ -377,8 +383,8 @@ bbdb_do_it (EBookClient *client, const gchar *name, const gchar *email) g_free (query_string); if (contacts != NULL || !status) { /* FIXME: If there's more than one contact with this - name, just give up; we're not smart enough for - this. */ + * name, just give up; we're not smart enough for + * this. */ if (!status || contacts->next != NULL) { e_client_util_free_object_slist (contacts); g_free (temp_name); @@ -492,7 +498,8 @@ bbdb_check_gaim_enabled (void) } static void -add_email_to_contact (EContact *contact, const gchar *email) +add_email_to_contact (EContact *contact, + const gchar *email) { GList *emails; @@ -504,7 +511,8 @@ add_email_to_contact (EContact *contact, const gchar *email) /* Code to implement the configuration user interface follows */ static void -enable_toggled_cb (GtkWidget *widget, gpointer data) +enable_toggled_cb (GtkWidget *widget, + gpointer data) { struct bbdb_stuff *stuff = (struct bbdb_stuff *) data; gboolean active; @@ -543,7 +551,8 @@ enable_toggled_cb (GtkWidget *widget, gpointer data) } static void -enable_gaim_toggled_cb (GtkWidget *widget, gpointer data) +enable_gaim_toggled_cb (GtkWidget *widget, + gpointer data) { struct bbdb_stuff *stuff = (struct bbdb_stuff *) data; gboolean active; @@ -613,7 +622,8 @@ gaim_source_changed_cb (ESourceComboBox *source_combo_box, } static GtkWidget * -create_addressbook_combo_box (struct bbdb_stuff *stuff, gint type) +create_addressbook_combo_box (struct bbdb_stuff *stuff, + gint type) { GtkWidget *combo_box; ESourceList *source_list; @@ -645,7 +655,8 @@ create_addressbook_combo_box (struct bbdb_stuff *stuff, gint type) } GtkWidget * -bbdb_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) +bbdb_page_factory (EPlugin *ep, + EConfigHookItemFactoryData *hook_data) { struct bbdb_stuff *stuff; EABConfigTargetPrefs *target = (EABConfigTargetPrefs *) hook_data->config->target; @@ -762,7 +773,8 @@ bbdb_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) } static void -cleanup_cb (GObject *o, gpointer data) +cleanup_cb (GObject *o, + gpointer data) { struct bbdb_stuff *stuff = data; diff --git a/plugins/bbdb/bbdb.h b/plugins/bbdb/bbdb.h index cbeb4ebb42..82951a7566 100644 --- a/plugins/bbdb/bbdb.h +++ b/plugins/bbdb/bbdb.h @@ -42,11 +42,11 @@ /* bbdb.c */ /* creates an EBookClient for a given type (gaim or contacts), but doesn't open it; - this function should be called in a main thread. */ + * this function should be called in a main thread. */ EBookClient *bbdb_create_book_client (gint type); /* opens an EBookClient. Returns false if it fails, and unrefs the book too; - this function can be called in any thread */ + * this function can be called in any thread */ gboolean bbdb_open_book_client (EBookClient *client); gboolean bbdb_check_gaim_enabled (void); diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c index 7e42066638..d2e3c0016c 100644 --- a/plugins/bbdb/gaimbuddies.c +++ b/plugins/bbdb/gaimbuddies.c @@ -250,8 +250,8 @@ bbdb_sync_buddy_list_in_thread (gpointer data) if (contacts != NULL) { /* FIXME: If there's more than one contact with this - name, just give up; we're not smart enough for - this. */ + * name, just give up; we're not smart enough for + * this. */ if (contacts->next != NULL) { e_client_util_free_object_slist (contacts); continue; @@ -360,7 +360,8 @@ bbdb_sync_buddy_list (void) } static gboolean -im_list_contains_buddy (GList *ims, GaimBuddy *b) +im_list_contains_buddy (GList *ims, + GaimBuddy *b) { GList *l; @@ -375,7 +376,9 @@ im_list_contains_buddy (GList *ims, GaimBuddy *b) } static gboolean -bbdb_merge_buddy_to_contact (EBookClient *client, GaimBuddy *b, EContact *c) +bbdb_merge_buddy_to_contact (EBookClient *client, + GaimBuddy *b, + EContact *c) { EContactField field; GList *ims; @@ -450,7 +453,8 @@ proto_to_contact_field (const gchar *proto) } static void -get_all_blocked (xmlNodePtr node, GSList **blocked) +get_all_blocked (xmlNodePtr node, + GSList **blocked) { xmlNodePtr child; @@ -578,7 +582,9 @@ get_buddy_icon_from_setting (xmlNodePtr setting) } static void -parse_contact (xmlNodePtr contact, GList **buddies, GSList *blocked) +parse_contact (xmlNodePtr contact, + GList **buddies, + GSList *blocked) { xmlNodePtr child; xmlNodePtr buddy = NULL; @@ -631,7 +637,9 @@ parse_contact (xmlNodePtr contact, GList **buddies, GSList *blocked) } static void -parse_buddy_group (xmlNodePtr group, GList **buddies, GSList *blocked) +parse_buddy_group (xmlNodePtr group, + GList **buddies, + GSList *blocked) { xmlNodePtr child; diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c index 3ebd0aaf61..e2cce51de6 100644 --- a/plugins/caldav/caldav-browse-server.c +++ b/plugins/caldav/caldav-browse-server.c @@ -65,8 +65,9 @@ typedef void (*process_message_cb) (GObject *dialog, const gchar *msg_path, guin static void send_xml_message (xmlDocPtr doc, gboolean depth_1, const gchar *url, GObject *dialog, process_message_cb cb, gpointer cb_user_data, const gchar *info); -static gchar * -xpath_get_string (xmlXPathContextPtr xpctx, const gchar *path_format, ...) +static gchar * xpath_get_string (xmlXPathContextPtr xpctx, + const gchar *path_format, + ...) { gchar *res = NULL, *path, *tmp; va_list args; @@ -101,7 +102,10 @@ xpath_get_string (xmlXPathContextPtr xpctx, const gchar *path_format, ...) } static gboolean -xpath_exists (xmlXPathContextPtr xpctx, xmlXPathObjectPtr *resobj, const gchar *path_format, ...) +xpath_exists (xmlXPathContextPtr xpctx, + xmlXPathObjectPtr *resobj, + const gchar *path_format, + ...) { gchar *path; va_list args; @@ -131,7 +135,8 @@ xpath_exists (xmlXPathContextPtr xpctx, xmlXPathObjectPtr *resobj, const gchar * } static gchar * -change_url_path (const gchar *base_url, const gchar *new_path) +change_url_path (const gchar *base_url, + const gchar *new_path) { SoupURI *suri; gchar *url; @@ -153,7 +158,9 @@ change_url_path (const gchar *base_url, const gchar *new_path) } static void -report_error (GObject *dialog, gboolean is_fatal, const gchar *msg) +report_error (GObject *dialog, + gboolean is_fatal, + const gchar *msg) { g_return_if_fail (dialog != NULL); g_return_if_fail (GTK_IS_DIALOG (dialog)); @@ -192,7 +199,11 @@ report_error (GObject *dialog, gboolean is_fatal, const gchar *msg) } static gboolean -check_soup_status (GObject *dialog, guint status_code, const gchar *reason_phrase, const gchar *msg_body, gboolean is_fatal) +check_soup_status (GObject *dialog, + guint status_code, + const gchar *reason_phrase, + const gchar *msg_body, + gboolean is_fatal) { gchar *msg; @@ -222,7 +233,10 @@ struct test_exists_data { }; static gboolean -test_href_exists_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data) +test_href_exists_cb (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer user_data) { struct test_exists_data *ted = user_data; gchar *href = NULL; @@ -242,7 +256,9 @@ test_href_exists_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, } static void -add_collection_node_to_tree (GtkTreeStore *store, GtkTreeIter *parent_iter, const gchar *href) +add_collection_node_to_tree (GtkTreeStore *store, + GtkTreeIter *parent_iter, + const gchar *href) { SoupURI *suri; const gchar *path; @@ -319,7 +335,12 @@ add_collection_node_to_tree (GtkTreeStore *store, GtkTreeIter *parent_iter, cons /* called with "caldav-thread-mutex" unlocked; 'user_data' is parent tree iter, NULL for "User's calendars" */ static void -traverse_users_calendars_cb (GObject *dialog, const gchar *msg_path, guint status_code, const gchar *reason_phrase, const gchar *msg_body, gpointer user_data) +traverse_users_calendars_cb (GObject *dialog, + const gchar *msg_path, + guint status_code, + const gchar *reason_phrase, + const gchar *msg_body, + gpointer user_data) { xmlDocPtr doc; xmlXPathContextPtr xpctx; @@ -512,7 +533,10 @@ traverse_users_calendars_cb (GObject *dialog, const gchar *msg_path, guint statu } static void -fetch_folder_content (GObject *dialog, const gchar *relative_path, const GtkTreeIter *parent_iter, const gchar *op_info) +fetch_folder_content (GObject *dialog, + const gchar *relative_path, + const GtkTreeIter *parent_iter, + const gchar *op_info) { xmlDocPtr doc; xmlNodePtr root, node; @@ -604,7 +628,9 @@ mail_account_configured (const gchar *email) } static void -add_usermail (GtkComboBoxText *usermail_combo, const gchar *email, gboolean is_first) +add_usermail (GtkComboBoxText *usermail_combo, + const gchar *email, + gboolean is_first) { GtkTreeModel *model; GtkTreeIter iter; @@ -642,7 +668,12 @@ add_usermail (GtkComboBoxText *usermail_combo, const gchar *email, gboolean is_f /* called with "caldav-thread-mutex" unlocked; user_data is not NULL when called second time on principal */ static void -find_users_calendar_cb (GObject *dialog, const gchar *msg_path, guint status_code, const gchar *reason_phrase, const gchar *msg_body, gpointer user_data) +find_users_calendar_cb (GObject *dialog, + const gchar *msg_path, + guint status_code, + const gchar *reason_phrase, + const gchar *msg_body, + gpointer user_data) { xmlDocPtr doc; xmlXPathContextPtr xpctx; @@ -775,7 +806,8 @@ find_users_calendar_cb (GObject *dialog, const gchar *msg_path, guint status_cod } static void -redirect_handler (SoupMessage *msg, gpointer user_data) +redirect_handler (SoupMessage *msg, + gpointer user_data) { if (SOUP_STATUS_IS_REDIRECTION (msg->status_code)) { SoupSession *soup_session = user_data; @@ -802,7 +834,8 @@ redirect_handler (SoupMessage *msg, gpointer user_data) } static void -send_and_handle_redirection (SoupSession *soup_session, SoupMessage *msg) +send_and_handle_redirection (SoupSession *soup_session, + SoupMessage *msg) { soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT); soup_message_add_header_handler (msg, "got_body", "Location", G_CALLBACK (redirect_handler), soup_session); @@ -876,7 +909,11 @@ caldav_browse_server_thread (gpointer data) } static void -soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gboolean retrying, gpointer data) +soup_authenticate (SoupSession *session, + SoupMessage *msg, + SoupAuth *auth, + gboolean retrying, + gpointer data) { GObject *dialog = data; const gchar *username, *password; @@ -936,7 +973,9 @@ soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gbool /* the dialog is about to die, so cancel any pending operations to close the thread too */ static void -dialog_response_cb (GObject *dialog, gint response_id, gpointer user_data) +dialog_response_cb (GObject *dialog, + gint response_id, + gpointer user_data) { GCond *cond; GMutex *mutex; @@ -958,7 +997,9 @@ dialog_response_cb (GObject *dialog, gint response_id, gpointer user_data) } static gboolean -check_message (GtkWindow *dialog, SoupMessage *message, const gchar *url) +check_message (GtkWindow *dialog, + SoupMessage *message, + const gchar *url) { g_return_val_if_fail (dialog != NULL, FALSE); g_return_val_if_fail (GTK_IS_DIALOG (dialog), FALSE); @@ -970,7 +1011,8 @@ check_message (GtkWindow *dialog, SoupMessage *message, const gchar *url) } static void -indicate_busy (GObject *dialog, gboolean is_busy) +indicate_busy (GObject *dialog, + gboolean is_busy) { GtkWidget *spinner = g_object_get_data (dialog, "caldav-spinner"); @@ -1064,7 +1106,13 @@ poll_for_message_sent_cb (gpointer data) } static void -send_xml_message (xmlDocPtr doc, gboolean depth_1, const gchar *url, GObject *dialog, process_message_cb cb, gpointer cb_user_data, const gchar *info) +send_xml_message (xmlDocPtr doc, + gboolean depth_1, + const gchar *url, + GObject *dialog, + process_message_cb cb, + gpointer cb_user_data, + const gchar *info) { GCond *cond; GMutex *mutex; @@ -1136,7 +1184,8 @@ send_xml_message (xmlDocPtr doc, gboolean depth_1, const gchar *url, GObject *di } static void -url_entry_changed (GtkEntry *entry, GObject *dialog) +url_entry_changed (GtkEntry *entry, + GObject *dialog) { const gchar *url; @@ -1149,7 +1198,8 @@ url_entry_changed (GtkEntry *entry, GObject *dialog) } static void -tree_selection_changed_cb (GtkTreeSelection *selection, GtkEntry *url_entry) +tree_selection_changed_cb (GtkTreeSelection *selection, + GtkEntry *url_entry) { gboolean ok = FALSE; GtkTreeModel *model = NULL; @@ -1179,7 +1229,10 @@ tree_selection_changed_cb (GtkTreeSelection *selection, GtkEntry *url_entry) } static void -tree_row_expanded_cb (GtkTreeView *tree, GtkTreeIter *iter, GtkTreePath *path, GObject *dialog) +tree_row_expanded_cb (GtkTreeView *tree, + GtkTreeIter *iter, + GtkTreePath *path, + GObject *dialog) { GtkTreeModel *model; gboolean is_loaded = TRUE; @@ -1217,7 +1270,15 @@ tree_row_expanded_cb (GtkTreeView *tree, GtkTreeIter *iter, GtkTreePath *path, G } static void -init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, GtkWidget **new_usermail_combo, GtkWidget **new_autoschedule_check, const gchar *url, const gchar *username, const gchar *usermail, gboolean autoschedule, gint source_type) +init_dialog (GtkDialog *dialog, + GtkWidget **new_url_entry, + GtkWidget **new_usermail_combo, + GtkWidget **new_autoschedule_check, + const gchar *url, + const gchar *username, + const gchar *usermail, + gboolean autoschedule, + gint source_type) { GtkBox *content_area; GtkWidget *label, *info_box, *spinner, *info_label, *hbox; @@ -1251,7 +1312,9 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, GtkWidget **new_userm *new_url_entry = gtk_entry_new (); gtk_box_pack_start (content_area, *new_url_entry, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (*new_url_entry), "changed", G_CALLBACK (url_entry_changed), dialog); + g_signal_connect ( + *new_url_entry, "changed", + G_CALLBACK (url_entry_changed), dialog); *new_usermail_combo = gtk_combo_box_text_new (); if (usermail && *usermail) { @@ -1438,7 +1501,8 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, GtkWidget **new_userm } static gchar * -prepare_url (const gchar *server_url, gboolean use_ssl) +prepare_url (const gchar *server_url, + gboolean use_ssl) { gchar *url; gint len; @@ -1502,7 +1566,13 @@ prepare_url (const gchar *server_url, gboolean use_ssl) } gchar * -caldav_browse_server (GtkWindow *parent, const gchar *server_url, const gchar *username, gboolean use_ssl, gchar **new_usermail, gboolean *new_autoschedule, gint source_type) +caldav_browse_server (GtkWindow *parent, + const gchar *server_url, + const gchar *username, + gboolean use_ssl, + gchar **new_usermail, + gboolean *new_autoschedule, + gint source_type) { GtkWidget *dialog, *new_url_entry, *new_usermail_combo, *new_autoschedule_check; gchar *url, *new_url = NULL; diff --git a/plugins/caldav/caldav-browse-server.h b/plugins/caldav/caldav-browse-server.h index 0936761bba..6a275f1726 100644 --- a/plugins/caldav/caldav-browse-server.h +++ b/plugins/caldav/caldav-browse-server.h @@ -25,7 +25,7 @@ #include <gtk/gtk.h> /* Opens a window with a list of available calendars for a given server; - Returns server URL of a calendar user chose, or NULL to let it be as is. */ + * Returns server URL of a calendar user chose, or NULL to let it be as is. */ gchar *caldav_browse_server (GtkWindow *parent, const gchar *server_url, const gchar *username, gboolean use_ssl, gchar **new_usermail, gboolean *new_autoschedule, gint source_type); #endif /* CALDAV_BROWSE_SERVER_H */ diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c index c9c44fb470..9b318bca2f 100644 --- a/plugins/caldav/caldav-source.c +++ b/plugins/caldav/caldav-source.c @@ -69,7 +69,8 @@ ensure_caldav_source_group (ECalClientSourceType source_type) } gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { if (enable) { @@ -85,7 +86,8 @@ e_plugin_lib_enable (EPlugin *ep, gint enable) /*****************************************************************************/ static void -location_changed_cb (GtkEntry *editable, ESource *source) +location_changed_cb (GtkEntry *editable, + ESource *source) { SoupURI *suri; gchar *ruri; @@ -110,7 +112,8 @@ location_changed_cb (GtkEntry *editable, ESource *source) } static void -user_changed_cb (GtkEntry *editable, ESource *source) +user_changed_cb (GtkEntry *editable, + ESource *source) { SoupURI *suri; gchar *uri, *ruri; @@ -145,7 +148,8 @@ user_changed_cb (GtkEntry *editable, ESource *source) } static void -browse_cal_clicked_cb (GtkButton *button, gpointer user_data) +browse_cal_clicked_cb (GtkButton *button, + gpointer user_data) { GtkEntry *url, *username, *usermail; GtkToggleButton *ssl, *autoschedule; @@ -197,8 +201,8 @@ browse_cal_clicked_cb (GtkButton *button, gpointer user_data) } GtkWidget * -oge_caldav (EPlugin *epl, - EConfigHookItemFactoryData *data) +oge_caldav (EPlugin *epl, + EConfigHookItemFactoryData *data) { ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; ESource *source; diff --git a/plugins/calendar-file/calendar-file.c b/plugins/calendar-file/calendar-file.c index a7b821d285..6aa1483c3f 100644 --- a/plugins/calendar-file/calendar-file.c +++ b/plugins/calendar-file/calendar-file.c @@ -34,13 +34,15 @@ gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } static void -location_changed (GtkFileChooserButton *widget, ESource *source) +location_changed (GtkFileChooserButton *widget, + ESource *source) { gchar *filename; @@ -53,7 +55,8 @@ location_changed (GtkFileChooserButton *widget, ESource *source) } static void -maincheck_toggled (GtkToggleButton *check, ESource *source) +maincheck_toggled (GtkToggleButton *check, + ESource *source) { GtkWidget *w; gboolean enabled = gtk_toggle_button_get_active (check); @@ -78,7 +81,8 @@ maincheck_toggled (GtkToggleButton *check, ESource *source) } static void -refresh_type_changed (GtkComboBox *refresh_type, ESource *source) +refresh_type_changed (GtkComboBox *refresh_type, + ESource *source) { GtkWidget *refresh_hbox; gint active = gtk_combo_box_get_active (refresh_type); @@ -102,7 +106,8 @@ refresh_type_changed (GtkComboBox *refresh_type, ESource *source) GtkWidget *e_calendar_file_customs (EPlugin *epl, EConfigHookItemFactoryData *data); GtkWidget * -e_calendar_file_customs (EPlugin *epl, EConfigHookItemFactoryData *data) +e_calendar_file_customs (EPlugin *epl, + EConfigHookItemFactoryData *data) { ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; ESource *source = t->source; @@ -186,8 +191,12 @@ e_calendar_file_customs (EPlugin *epl, EConfigHookItemFactoryData *data) } maincheck_toggled (GTK_TOGGLE_BUTTON (maincheck), NULL); - g_signal_connect (G_OBJECT (w2), "file-set", G_CALLBACK (location_changed), source); - g_signal_connect (G_OBJECT (maincheck), "toggled", G_CALLBACK (maincheck_toggled), source); + g_signal_connect ( + w2, "file-set", + G_CALLBACK (location_changed), source); + g_signal_connect ( + maincheck, "toggled", + G_CALLBACK (maincheck_toggled), source); box2 = gtk_hbox_new (FALSE, 2); gtk_box_pack_start ((GtkBox *) box1, box2, FALSE, TRUE, 2); @@ -212,7 +221,9 @@ e_calendar_file_customs (EPlugin *epl, EConfigHookItemFactoryData *data) g_object_set_data (G_OBJECT (w1), "refresh-hbox", w2); - g_signal_connect (G_OBJECT (w1), "changed", G_CALLBACK (refresh_type_changed), source); + g_signal_connect ( + w1, "changed", + G_CALLBACK (refresh_type_changed), source); w2 = e_plugin_util_add_check (NULL, _("Force read _only"), source, "custom-file-readonly", "1", NULL); gtk_box_pack_start ((GtkBox *) box1, w2, TRUE, TRUE, 2); @@ -220,7 +231,7 @@ e_calendar_file_customs (EPlugin *epl, EConfigHookItemFactoryData *data) gtk_widget_show_all (mainbox); /* w1 is a refresh-type combobox, and it hides widgets, - thus should be called after show_all call */ + * thus should be called after show_all call */ refresh_type_changed (GTK_COMBO_BOX (w1), source); return mainbox; diff --git a/plugins/calendar-http/calendar-http.c b/plugins/calendar-http/calendar-http.c index 9e1acfa02e..fcf7002ab5 100644 --- a/plugins/calendar-http/calendar-http.c +++ b/plugins/calendar-http/calendar-http.c @@ -41,13 +41,15 @@ GtkWidget *e_calendar_http_auth (EPlugin *epl, EConfigHookItemFactoryData *data) gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } static void -url_changed (GtkEntry *entry, ESource *source) +url_changed (GtkEntry *entry, + ESource *source) { SoupURI *uri; gchar *relative_uri; @@ -74,7 +76,8 @@ url_changed (GtkEntry *entry, ESource *source) } GtkWidget * -e_calendar_http_url (EPlugin *epl, EConfigHookItemFactoryData *data) +e_calendar_http_url (EPlugin *epl, + EConfigHookItemFactoryData *data) { GtkWidget *entry; ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; @@ -103,14 +106,17 @@ e_calendar_http_url (EPlugin *epl, EConfigHookItemFactoryData *data) entry = e_plugin_util_add_entry (data->parent, _("_URL:"), NULL, NULL); gtk_entry_set_text (GTK_ENTRY (entry), uri_text); - g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (url_changed), t->source); + g_signal_connect ( + entry, "changed", + G_CALLBACK (url_changed), t->source); g_free (uri_text); return entry; } GtkWidget * -e_calendar_http_refresh (EPlugin *epl, EConfigHookItemFactoryData *data) +e_calendar_http_refresh (EPlugin *epl, + EConfigHookItemFactoryData *data) { ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; @@ -124,7 +130,8 @@ e_calendar_http_refresh (EPlugin *epl, EConfigHookItemFactoryData *data) } GtkWidget * -e_calendar_http_secure (EPlugin *epl, EConfigHookItemFactoryData *data) +e_calendar_http_secure (EPlugin *epl, + EConfigHookItemFactoryData *data) { ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; GtkWidget *secure_setting; @@ -144,7 +151,8 @@ e_calendar_http_secure (EPlugin *epl, EConfigHookItemFactoryData *data) } static void -username_changed (GtkEntry *entry, ESource *source) +username_changed (GtkEntry *entry, + ESource *source) { const gchar *username; gchar *uri; @@ -181,7 +189,8 @@ username_changed (GtkEntry *entry, ESource *source) } GtkWidget * -e_calendar_http_auth (EPlugin *epl, EConfigHookItemFactoryData *data) +e_calendar_http_auth (EPlugin *epl, + EConfigHookItemFactoryData *data) { ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; GtkWidget *entry; @@ -197,13 +206,16 @@ e_calendar_http_auth (EPlugin *epl, EConfigHookItemFactoryData *data) entry = e_plugin_util_add_entry (data->parent, _("Userna_me:"), NULL, NULL); gtk_entry_set_text (GTK_ENTRY (entry), username ? username : ""); - g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (username_changed), t->source); + g_signal_connect ( + entry, "changed", + G_CALLBACK (username_changed), t->source); return entry; } gboolean -e_calendar_http_check (EPlugin *epl, EConfigHookPageCheckData *data) +e_calendar_http_check (EPlugin *epl, + EConfigHookPageCheckData *data) { /* FIXME - check pageid */ ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; diff --git a/plugins/calendar-weather/calendar-weather.c b/plugins/calendar-weather/calendar-weather.c index 5095106254..93f1c0ae50 100644 --- a/plugins/calendar-weather/calendar-weather.c +++ b/plugins/calendar-weather/calendar-weather.c @@ -51,7 +51,8 @@ gint e_plugin_lib_enable (EPlugin *epl, gint enable); #define WEATHER_BASE_URI "weather://" gint -e_plugin_lib_enable (EPlugin *epl, gint enable) +e_plugin_lib_enable (EPlugin *epl, + gint enable) { GList *l, *saved_cats; const gchar *tmp; @@ -100,7 +101,8 @@ exit: } void -e_calendar_weather_migrate (EPlugin *epl, ECalEventTargetBackend *data) +e_calendar_weather_migrate (EPlugin *epl, + ECalEventTargetBackend *data) { /* Perform a migration step here. This allows us to keep the weather calendar completely * separate from evolution. If the plugin isn't built, the weather source group won't @@ -135,7 +137,8 @@ e_calendar_weather_migrate (EPlugin *epl, ECalEventTargetBackend *data) } static void -selection_changed (GtkTreeSelection *selection, GtkDialog *dialog) +selection_changed (GtkTreeSelection *selection, + GtkDialog *dialog) { GtkTreeModel *model; GtkTreeIter iter; @@ -157,7 +160,10 @@ static struct } find_data; static gboolean -find_location_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *node, gpointer data) +find_location_func (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *node, + gpointer data) { WeatherLocation *wl = NULL; @@ -173,7 +179,8 @@ find_location_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *node, g } static GtkTreeIter * -find_location (GtkTreeModel *model, gchar *relative_url) +find_location (GtkTreeModel *model, + gchar *relative_url) { /* old URL uses type/code/name, but new uses only code/name */ if (strncmp (relative_url, "ccf/", 4) == 0) { @@ -191,7 +198,9 @@ find_location (GtkTreeModel *model, gchar *relative_url) } static gboolean -treeview_clicked (GtkTreeView *treeview, GdkEventButton *event, GtkDialog *dialog) +treeview_clicked (GtkTreeView *treeview, + GdkEventButton *event, + GtkDialog *dialog) { if (event->type == GDK_2BUTTON_PRESS) { GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview); @@ -242,7 +251,9 @@ create_source_selector (ESource *source) gtk_widget_show (treeview); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolledwindow), treeview); gtk_widget_add_events (treeview, GDK_BUTTON_PRESS); - g_signal_connect (G_OBJECT (treeview), "button-press-event", G_CALLBACK (treeview_clicked), dialog); + g_signal_connect ( + treeview, "button-press-event", + G_CALLBACK (treeview_clicked), dialog); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); @@ -259,7 +270,9 @@ create_source_selector (ESource *source) if (suri) soup_uri_free (suri); - g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), dialog); + g_signal_connect ( + selection, "changed", + G_CALLBACK (selection_changed), dialog); g_object_set_data (G_OBJECT (dialog), "treeview", treeview); text = gtk_cell_renderer_text_new (); @@ -296,7 +309,8 @@ build_location_path (GtkTreeIter *iter) } static void -location_clicked (GtkButton *button, ESource *source) +location_clicked (GtkButton *button, + ESource *source) { GtkDialog *dialog = create_source_selector (source); gint response; @@ -341,7 +355,8 @@ location_clicked (GtkButton *button, ESource *source) } GtkWidget * -e_calendar_weather_location (EPlugin *epl, EConfigHookItemFactoryData *data) +e_calendar_weather_location (EPlugin *epl, + EConfigHookItemFactoryData *data) { GtkWidget *button, *parent, *text, *label; guint row; @@ -366,10 +381,12 @@ e_calendar_weather_location (EPlugin *epl, EConfigHookItemFactoryData *data) label = gtk_label_new_with_mnemonic (_("_Location:")); gtk_widget_show (label); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row + 1, GTK_FILL, 0, 0, 0); button = gtk_button_new (); - g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (location_clicked), source); + g_signal_connect ( + button, "clicked", + G_CALLBACK (location_clicked), source); gtk_widget_show (button); if (suri && suri->path && *suri->path) { @@ -387,13 +404,14 @@ e_calendar_weather_location (EPlugin *epl, EConfigHookItemFactoryData *data) soup_uri_free (suri); g_free (uri_text); - gtk_table_attach (GTK_TABLE (parent), button, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), button, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); return button; } GtkWidget * -e_calendar_weather_refresh (EPlugin *epl, EConfigHookItemFactoryData *data) +e_calendar_weather_refresh (EPlugin *epl, + EConfigHookItemFactoryData *data) { ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; @@ -404,7 +422,8 @@ e_calendar_weather_refresh (EPlugin *epl, EConfigHookItemFactoryData *data) } static void -set_units (ESource *source, GtkWidget *combobox) +set_units (ESource *source, + GtkWidget *combobox) { const gchar *format = e_source_get_property (source, "units"); if (format == NULL) { @@ -429,7 +448,8 @@ set_units (ESource *source, GtkWidget *combobox) } static void -units_changed (GtkComboBox *combobox, ECalConfigTargetSource *t) +units_changed (GtkComboBox *combobox, + ECalConfigTargetSource *t) { gint choice = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox)); if (choice == 0) @@ -439,7 +459,8 @@ units_changed (GtkComboBox *combobox, ECalConfigTargetSource *t) } GtkWidget * -e_calendar_weather_units (EPlugin *epl, EConfigHookItemFactoryData *data) +e_calendar_weather_units (EPlugin *epl, + EConfigHookItemFactoryData *data) { GtkWidget *combobox, *parent, *label; guint row; @@ -456,7 +477,7 @@ e_calendar_weather_units (EPlugin *epl, EConfigHookItemFactoryData *data) label = gtk_label_new_with_mnemonic (_("_Units:")); gtk_widget_show (label); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row + 1, GTK_FILL, 0, 0, 0); combobox = gtk_combo_box_text_new (); gtk_widget_show (combobox); @@ -468,14 +489,17 @@ e_calendar_weather_units (EPlugin *epl, EConfigHookItemFactoryData *data) _("Imperial (Fahrenheit, inches, etc)")); set_units (source, combobox); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combobox); - g_signal_connect (G_OBJECT (combobox), "changed", G_CALLBACK (units_changed), t); - gtk_table_attach (GTK_TABLE (parent), combobox, 1, 2, row, row+1, GTK_FILL, 0, 0, 0); + g_signal_connect ( + combobox, "changed", + G_CALLBACK (units_changed), t); + gtk_table_attach (GTK_TABLE (parent), combobox, 1, 2, row, row + 1, GTK_FILL, 0, 0, 0); return combobox; } gboolean -e_calendar_weather_check (EPlugin *epl, EConfigHookPageCheckData *data) +e_calendar_weather_check (EPlugin *epl, + EConfigHookPageCheckData *data) { /* FIXME - check pageid */ ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index 0a25169189..b838bdf953 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -100,8 +100,8 @@ gint e_plugin_lib_enable (EPlugin *ep, /* em-folder-selection-button.h is private, even though other internal * evo plugins use it! - so declare the functions here - TODO: sort out whether this should really be private + * so declare the functions here + * TODO: sort out whether this should really be private */ typedef struct { @@ -121,7 +121,6 @@ typedef struct { gchar *uri; gint dbx_fd; - // dbx_file dbx; CamelOperation *cancel; CamelFolder *folder; @@ -145,7 +144,8 @@ static guchar oe4_mbox_sig[8] = { }; gboolean -org_gnome_evolution_readdbx_supported (EPlugin *epl, EImportTarget *target) +org_gnome_evolution_readdbx_supported (EPlugin *epl, + EImportTarget *target) { gchar signature[16]; gboolean ret = FALSE; @@ -189,7 +189,8 @@ org_gnome_evolution_readdbx_supported (EPlugin *epl, EImportTarget *target) } static void -folder_selected (EMFolderSelectionButton *button, EImportTargetURI *target) +folder_selected (EMFolderSelectionButton *button, + EImportTargetURI *target) { g_free (target->uri_dest); target->uri_dest = g_strdup (em_folder_selection_button_get_folder_uri (button)); @@ -277,7 +278,8 @@ org_gnome_evolution_readdbx_getwidget (EImport *ei, } static gchar * -dbx_import_describe (DbxImporter *m, gint complete) +dbx_import_describe (DbxImporter *m, + gint complete) { return g_strdup (_("Importing Outlook Express data")); } @@ -437,10 +439,12 @@ static gboolean dbx_load_indices (DbxImporter *m) } static gboolean -dbx_read_mail_body (DbxImporter *m, guint32 offset, gint bodyfd) +dbx_read_mail_body (DbxImporter *m, + guint32 offset, + gint bodyfd) { /* FIXME: We really ought to set up CamelStream that we can feed to the - MIME parser, rather than using a temporary file */ + * MIME parser, rather than using a temporary file */ struct _dbx_block_hdrstruct hdr; guint32 buflen = 0x200; @@ -502,7 +506,10 @@ dbx_read_mail_body (DbxImporter *m, guint32 offset, gint bodyfd) } static gboolean -dbx_read_email (DbxImporter *m, guint32 offset, gint bodyfd, gint *flags) +dbx_read_email (DbxImporter *m, + guint32 offset, + gint bodyfd, + gint *flags) { struct _dbx_email_headerstruct hdr; guchar *buffer; @@ -538,8 +545,8 @@ dbx_read_email (DbxImporter *m, guint32 offset, gint bodyfd, gint *flags) } for (i = 0; i < hdr.count; i++) { - guchar type = buffer[i*4]; - gint val = buffer[i*4 + 1] + (buffer[i*4 + 2] << 8) + (buffer[i*4 + 3] << 16); + guchar type = buffer[i *4]; + gint val = buffer[i *4 + 1] + (buffer[i *4 + 2] << 8) + (buffer[i *4 + 3] << 16); switch (type) { case 0x01: @@ -551,7 +558,7 @@ dbx_read_email (DbxImporter *m, guint32 offset, gint bodyfd, gint *flags) d(printf("Got type 0x81 flags %02x\n", *flags)); break; case 0x04: - dataptr = GUINT32_FROM_LE (*(guint32 *)(buffer + hdr.count*4 + val)); + dataptr = GUINT32_FROM_LE (*(guint32 *)(buffer + hdr.count *4 + val)); d(printf("Got type 0x04 data pointer %x\n", dataptr)); break; case 0x84: @@ -766,7 +773,10 @@ dbx_status_timeout (gpointer data) } static void -dbx_status (CamelOperation *op, const gchar *what, gint pc, gpointer data) +dbx_status (CamelOperation *op, + const gchar *what, + gint pc, + gpointer data) { DbxImporter *importer = data; @@ -820,7 +830,8 @@ org_gnome_evolution_readdbx_cancel (EImport *ei, } gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } diff --git a/plugins/default-source/default-source.c b/plugins/default-source/default-source.c index 02a0d42baa..26cb305413 100644 --- a/plugins/default-source/default-source.c +++ b/plugins/default-source/default-source.c @@ -44,13 +44,15 @@ void commit_default_book (EPlugin *epl, EConfigTarget *target); gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } void -commit_default_calendar (EPlugin *epl, EConfigTarget *target) +commit_default_calendar (EPlugin *epl, + EConfigTarget *target) { ECalConfigTargetSource *cal_target; ESource *source; @@ -62,7 +64,8 @@ commit_default_calendar (EPlugin *epl, EConfigTarget *target) } void -commit_default_book (EPlugin *epl, EConfigTarget *target) +commit_default_book (EPlugin *epl, + EConfigTarget *target) { EABConfigTargetSource *book_target; ESource *source; @@ -75,7 +78,8 @@ commit_default_book (EPlugin *epl, EConfigTarget *target) } GtkWidget * -org_gnome_default_book (EPlugin *epl, EConfigHookItemFactoryData *data) +org_gnome_default_book (EPlugin *epl, + EConfigHookItemFactoryData *data) { EABConfigTargetSource *book_target; @@ -88,7 +92,8 @@ org_gnome_default_book (EPlugin *epl, EConfigHookItemFactoryData *data) } GtkWidget * -org_gnome_autocomplete_book (EPlugin *epl, EConfigHookItemFactoryData *data) +org_gnome_autocomplete_book (EPlugin *epl, + EConfigHookItemFactoryData *data) { EABConfigTargetSource *book_target; @@ -118,7 +123,8 @@ get_calendar_option_caption (ECalClientSourceType source_type) GtkWidget *org_gnome_default_cal (EPlugin *epl, EConfigHookItemFactoryData *data); GtkWidget * -org_gnome_default_cal (EPlugin *epl, EConfigHookItemFactoryData *data) +org_gnome_default_cal (EPlugin *epl, + EConfigHookItemFactoryData *data) { ECalConfigTargetSource *cal_target; diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index eb0ab3fb2f..ab352d61d2 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -78,10 +78,11 @@ static void commit_changes (ConfigData *cd); gint e_plugin_lib_enable (EPlugin *ep, gint enable); GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl); gboolean e_plugin_ui_init (GtkUIManager *ui_manager, EMsgComposer *composer); -GtkWidget *org_gnome_email_custom_header_config_option (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data); +GtkWidget *org_gnome_email_custom_header_config_option (EPlugin *epl, struct _EConfigHookItemFactoryData *data); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } @@ -138,7 +139,7 @@ epech_fill_widgets_with_data (CustomHeaderOptionsDialog *mch) priv->help_section = g_strdup ("usage-mail"); for (set_index_column = 0; - set_index_column < priv->email_custom_header_details->len;set_index_column++) { + set_index_column < priv->email_custom_header_details->len; set_index_column++) { sub_combo_box_fill = &g_array_index (priv->combo_box_header_value, HeaderValueComboBox,set_index_column); if (priv->flag == 0) { @@ -187,7 +188,9 @@ epech_dialog_get_type (void) } static void -epech_header_options_cb (GtkDialog *dialog, gint state, gpointer func_data) +epech_header_options_cb (GtkDialog *dialog, + gint state, + gpointer func_data) { EmailCustomHeaderOptionsDialogPrivate *priv; CustomHeaderOptionsDialog *mch; @@ -214,7 +217,8 @@ epech_header_options_cb (GtkDialog *dialog, gint state, gpointer func_data) } static gboolean -epech_dialog_run (CustomHeaderOptionsDialog *mch, GtkWidget *parent) +epech_dialog_run (CustomHeaderOptionsDialog *mch, + GtkWidget *parent) { EmailCustomHeaderOptionsDialogPrivate *priv; GtkWidget *toplevel; @@ -259,7 +263,9 @@ epech_get_header_list (CustomHeaderOptionsDialog *mch) } static void -epech_load_from_gconf (GConfClient *client,const gchar *path,CustomHeaderOptionsDialog *mch) +epech_load_from_gconf (GConfClient *client, + const gchar *path, + CustomHeaderOptionsDialog *mch) { EmailCustomHeaderOptionsDialogPrivate *priv; EmailCustomHeaderDetails temp_header_details= {-1, -1, NULL, NULL}; @@ -284,11 +290,11 @@ epech_load_from_gconf (GConfClient *client,const gchar *path,CustomHeaderOptions g_string_assign (temp_header_details.header_type_value, parse_header_list[0]); } - for (index = 0; parse_header_list[index+1] ; ++index) { + for (index = 0; parse_header_list[index + 1] ; ++index) { temp_header_value_details.sub_header_string_value = g_string_new(""); if (temp_header_value_details.sub_header_string_value) { - g_string_assign (temp_header_value_details.sub_header_string_value, parse_header_list[index+1]); + g_string_assign (temp_header_value_details.sub_header_string_value, parse_header_list[index + 1]); } g_array_append_val (temp_header_details.sub_header_type_value, temp_header_value_details); @@ -375,7 +381,7 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) } /* Translators: "None" as an email custom header option in a dialog invoked by Insert->Custom Header from Composer, - indicating the header will not be added to a mail message */ + * indicating the header will not be added to a mail message */ gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT ( sub_combo_box_ptr->header_value_combo_box), @@ -453,7 +459,9 @@ epech_dialog_dispose (GObject *object) } static void -epech_append_to_custom_header (CustomHeaderOptionsDialog *dialog, gint state, gpointer data) +epech_append_to_custom_header (CustomHeaderOptionsDialog *dialog, + gint state, + gpointer data) { EMsgComposer *composer; EmailCustomHeaderOptionsDialogPrivate *priv; @@ -483,7 +491,8 @@ epech_append_to_custom_header (CustomHeaderOptionsDialog *dialog, gint state, gp } static void -epech_custom_header_options_commit (EMsgComposer *comp, gpointer user_data) +epech_custom_header_options_commit (EMsgComposer *comp, + gpointer user_data) { EMsgComposer *composer; EmailCustomHeaderWindow *new_email_custom_header_window = NULL; @@ -512,7 +521,8 @@ epech_custom_header_options_commit (EMsgComposer *comp, gpointer user_data) } static gint -epech_check_existing_composer_window (gconstpointer compowindow, gconstpointer other_compowindow) +epech_check_existing_composer_window (gconstpointer compowindow, + gconstpointer other_compowindow) { if ((compowindow) && (other_compowindow)) { if (((EmailCustomHeaderWindow *) compowindow)->epech_window == (GdkWindow *) other_compowindow) { @@ -682,7 +692,8 @@ cell_value_edited_cb (GtkCellRendererText *cell, } static void -header_add_clicked (GtkButton *button, ConfigData *cd) +header_add_clicked (GtkButton *button, + ConfigData *cd) { GtkTreeModel *model; GtkTreeView *tree_view; @@ -703,7 +714,8 @@ header_add_clicked (GtkButton *button, ConfigData *cd) } static void -header_remove_clicked (GtkButton *button, ConfigData *cd) +header_remove_clicked (GtkButton *button, + ConfigData *cd) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -746,7 +758,8 @@ header_remove_clicked (GtkButton *button, ConfigData *cd) } static void -header_edit_clicked (GtkButton *button, ConfigData *cd) +header_edit_clicked (GtkButton *button, + ConfigData *cd) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -768,7 +781,8 @@ header_edit_clicked (GtkButton *button, ConfigData *cd) } static void -selection_changed (GtkTreeSelection *selection, ConfigData *cd) +selection_changed (GtkTreeSelection *selection, + ConfigData *cd) { GtkTreeModel *model; GtkTreeIter iter; @@ -891,7 +905,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) gtk_tree_view_column_set_reorderable (col, TRUE); g_object_set (col, "min-width", 50, NULL); - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + g_object_set (renderer, "editable", TRUE, NULL); g_signal_connect ( renderer, "edited", G_CALLBACK (cell_edited_cb), cd); @@ -905,7 +919,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) col = gtk_tree_view_get_column (GTK_TREE_VIEW (cd->treeview), col_pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + g_object_set (renderer, "editable", TRUE, NULL); g_signal_connect ( renderer, "edited", @@ -913,18 +927,26 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cd->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), cd); + g_signal_connect ( + selection, "changed", + G_CALLBACK (selection_changed), cd); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (cd->treeview), TRUE); cd->header_add = header_add; - g_signal_connect (G_OBJECT (cd->header_add), "clicked", G_CALLBACK (header_add_clicked), cd); + g_signal_connect ( + cd->header_add, "clicked", + G_CALLBACK (header_add_clicked), cd); cd->header_remove = header_remove; - g_signal_connect (G_OBJECT (cd->header_remove), "clicked", G_CALLBACK (header_remove_clicked), cd); + g_signal_connect ( + cd->header_remove, "clicked", + G_CALLBACK (header_remove_clicked), cd); gtk_widget_set_sensitive (cd->header_remove, FALSE); cd->header_edit = header_edit; - g_signal_connect (G_OBJECT (cd->header_edit), "clicked", G_CALLBACK (header_edit_clicked), cd); + g_signal_connect ( + cd->header_edit, "clicked", + G_CALLBACK (header_edit_clicked), cd); gtk_widget_set_sensitive (cd->header_edit, FALSE); /* Populate tree view with values from gconf */ @@ -940,8 +962,8 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) gtk_list_store_set (cd->store, &iter, HEADER_KEY_COLUMN, parse_header_list[0], -1); - for (index = 0; parse_header_list[index+1] ; ++index) { - gtk_list_store_set (cd->store, &iter, HEADER_VALUE_COLUMN, parse_header_list[index+1], -1); + for (index = 0; parse_header_list[index + 1] ; ++index) { + gtk_list_store_set (cd->store, &iter, HEADER_VALUE_COLUMN, parse_header_list[index + 1], -1); } } @@ -965,7 +987,8 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) /* Configuration in Mail Prefs Page goes here */ GtkWidget * -org_gnome_email_custom_header_config_option (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data) +org_gnome_email_custom_header_config_option (EPlugin *epl, + struct _EConfigHookItemFactoryData *data) { /* This function and the hook needs to be removed, once the configure code is thoroughly tested */ diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index 938215945e..b9386caa87 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -72,7 +72,8 @@ static GThread *editor_thread; gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } @@ -153,7 +154,8 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) } static void -enable_disable_composer (EMsgComposer *composer, gboolean enable) +enable_disable_composer (EMsgComposer *composer, + gboolean enable) { GtkhtmlEditor *editor; GtkAction *action; @@ -233,7 +235,8 @@ run_error_dialog (struct run_error_dialog_data *data) } static gint -numlines (const gchar *text, gint pos) +numlines (const gchar *text, + gint pos) { gint ctr = 0; gint lineno = 0; @@ -292,8 +295,8 @@ async_external_editor (EMsgComposer *composer) if (!editor_cmd) { if (!(editor_cmd = g_strdup (g_getenv ("EDITOR"))) ) /* Make gedit the default external editor, - if the default schemas are not installed - and no $EDITOR is set. */ + * if the default schemas are not installed + * and no $EDITOR is set. */ editor_cmd = g_strdup ("gedit"); } g_object_unref (gconf); @@ -403,7 +406,9 @@ static GtkActionEntry entries[] = { }; static gboolean -key_press_cb (GtkWidget * widget, GdkEventKey * event, EMsgComposer *composer) +key_press_cb (GtkWidget *widget, + GdkEventKey *event, + EMsgComposer *composer) { GConfClient *gconf; gboolean immediately; @@ -433,7 +438,8 @@ key_press_cb (GtkWidget * widget, GdkEventKey * event, EMsgComposer *composer) } static void -editor_running_thread_func (GThread *thread, gpointer running) +editor_running_thread_func (GThread *thread, + gpointer running) { if (thread == editor_thread) *(gboolean*)running = TRUE; @@ -451,7 +457,8 @@ editor_running (void) } static gboolean -delete_cb (GtkWidget *widget, EMsgComposer *composer) +delete_cb (GtkWidget *widget, + EMsgComposer *composer) { if (editor_running ()) { e_alert_run_dialog_for_args ( @@ -464,7 +471,8 @@ delete_cb (GtkWidget *widget, EMsgComposer *composer) } gboolean -e_plugin_ui_init (GtkUIManager *manager, EMsgComposer *composer) +e_plugin_ui_init (GtkUIManager *manager, + EMsgComposer *composer) { GtkhtmlEditor *editor; EWebView *web_view; diff --git a/plugins/face/face.c b/plugins/face/face.c index 8f50f16d68..df9eafcd5a 100644 --- a/plugins/face/face.c +++ b/plugins/face/face.c @@ -90,7 +90,8 @@ get_face_base64 (void) } static void -set_face_raw (gchar *content, gsize length) +set_face_raw (gchar *content, + gsize length) { gchar *filename = get_filename (); @@ -150,7 +151,11 @@ get_active_face (void) } static gboolean -prepare_image (const gchar *image_filename, gchar **file_contents, gsize *length, GdkPixbuf **use_pixbuf, gboolean can_claim) +prepare_image (const gchar *image_filename, + gchar **file_contents, + gsize *length, + GdkPixbuf **use_pixbuf, + gboolean can_claim) { gboolean res = FALSE; @@ -249,7 +254,8 @@ prepare_image (const gchar *image_filename, gchar **file_contents, gsize *length } static void -update_preview_cb (GtkFileChooser *file_chooser, gpointer data) +update_preview_cb (GtkFileChooser *file_chooser, + gpointer data) { GtkWidget *preview; gchar *filename, *file_contents = NULL; @@ -322,7 +328,8 @@ choose_new_face (void) } static void -toggled_check_include_by_default_cb (GtkWidget *widget, gpointer data) +toggled_check_include_by_default_cb (GtkWidget *widget, + gpointer data) { set_include_face_by_default (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))); } @@ -373,7 +380,8 @@ get_cfg_widget (void) } static void -action_toggle_face_cb (GtkToggleAction *action, EMsgComposer *composer) +action_toggle_face_cb (GtkToggleAction *action, + EMsgComposer *composer) { if (gtk_toggle_action_get_active (action)) { gchar *face = get_face_base64 (); @@ -403,14 +411,15 @@ void face_handle_send (EPlugin *ep, EMEventTargetComposer *target); /* ----------------------------------------------------------------- */ gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } gboolean e_plugin_ui_init (GtkUIManager *ui_manager, - EMsgComposer *composer) + EMsgComposer *composer) { GtkhtmlEditor *editor; @@ -450,7 +459,8 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) } void -face_handle_send (EPlugin *ep, EMEventTargetComposer *target) +face_handle_send (EPlugin *ep, + EMEventTargetComposer *target) { GtkhtmlEditor *editor; GtkAction *action; diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c index 1516082b05..c9127d6861 100644 --- a/plugins/google-account-setup/google-contacts-source.c +++ b/plugins/google-account-setup/google-contacts-source.c @@ -85,7 +85,8 @@ remove_google_contacts_source_group (void) } static void -on_username_entry_changed (GtkEntry *entry, gpointer user_data) +on_username_entry_changed (GtkEntry *entry, + gpointer user_data) { ESource *source = user_data; const gchar *text; @@ -108,7 +109,8 @@ on_username_entry_changed (GtkEntry *entry, gpointer user_data) } static void -on_ssl_cb_toggled (GtkToggleButton *tb, gpointer user_data) +on_ssl_cb_toggled (GtkToggleButton *tb, + gpointer user_data) { ESource *source = user_data; @@ -127,7 +129,9 @@ typedef enum { } IntervalType; static void -seconds_to_interval (guint seconds, IntervalType *type, gint *time) +seconds_to_interval (guint seconds, + IntervalType *type, + gint *time) { gint minutes = seconds / 60; @@ -146,7 +150,8 @@ seconds_to_interval (guint seconds, IntervalType *type, gint *time) } static guint -interval_to_seconds (IntervalType type, gint time) +interval_to_seconds (IntervalType type, + gint time) { switch (type) { case MINUTES: @@ -165,7 +170,8 @@ interval_to_seconds (IntervalType type, gint time) } static void -on_interval_sb_value_changed (GtkSpinButton *sb, gpointer user_data) +on_interval_sb_value_changed (GtkSpinButton *sb, + gpointer user_data) { ESource *source = user_data; gdouble time; @@ -187,7 +193,8 @@ on_interval_sb_value_changed (GtkSpinButton *sb, gpointer user_data) } static void -on_interval_combo_changed (GtkComboBox *combo, gpointer user_data) +on_interval_combo_changed (GtkComboBox *combo, + gpointer user_data) { ESource *source = user_data; gdouble time; @@ -234,7 +241,8 @@ check_username_filled (ESource *source) } gpointer -plugin_google_contacts_check (EPlugin *epl, EConfigHookPageCheckData *data) +plugin_google_contacts_check (EPlugin *epl, + EConfigHookPageCheckData *data) { EABConfigTargetSource *t; diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c index 5b12759f08..e8d3f5a410 100644 --- a/plugins/google-account-setup/google-source.c +++ b/plugins/google-account-setup/google-source.c @@ -89,7 +89,8 @@ ensure_google_source_group (void) } gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { if (enable) { @@ -125,7 +126,7 @@ static gboolean is_email (const gchar *address) { /* This is supposed to check if the address's domain could be - an FQDN but alas, it's not worth the pain and suffering. */ + * an FQDN but alas, it's not worth the pain and suffering. */ const gchar *at; at = strchr (address, '@'); @@ -159,7 +160,8 @@ sanitize_user_mail (const gchar *user) } static gchar * -construct_default_uri (const gchar *username, gboolean is_ssl) +construct_default_uri (const gchar *username, + gboolean is_ssl) { gchar *user, *uri; @@ -172,7 +174,8 @@ construct_default_uri (const gchar *username, gboolean is_ssl) /* checks whether the given_uri is pointing to the default user's calendar or not */ static gboolean -is_default_uri (const gchar *given_uri, const gchar *username) +is_default_uri (const gchar *given_uri, + const gchar *username) { gchar *uri, *at; gint ats, i; @@ -217,7 +220,8 @@ is_default_uri (const gchar *given_uri, const gchar *username) } static void -update_source_uris (ESource *source, const gchar *uri) +update_source_uris (ESource *source, + const gchar *uri) { gchar *abs_uri, *tmp, *user_sanitized, *slash; const gchar *user, *feeds; @@ -255,7 +259,8 @@ update_source_uris (ESource *source, const gchar *uri) static void init_combo_values (GtkComboBox *combo, const gchar *deftitle, const gchar *defuri); static void -update_user_in_source (ESource *source, const gchar *new_user) +update_user_in_source (ESource *source, + const gchar *new_user) { gchar *uri, *eml, *user; const gchar *ssl; @@ -264,8 +269,8 @@ update_user_in_source (ESource *source, const gchar *new_user) user = g_strdup (new_user); /* two reasons why set readonly to FALSE: - a) the e_source_set_relative_uri does nothing for readonly sources - b) we are going to set default uri, which should be always writeable */ + * a) the e_source_set_relative_uri does nothing for readonly sources + * b) we are going to set default uri, which should be always writeable */ e_source_set_readonly (source, FALSE); if (user && *user) { @@ -287,7 +292,7 @@ update_user_in_source (ESource *source, const gchar *new_user) g_free (uri); /* "setup-username" is used to this plugin only, to keep what user wrote, - not what uses the backend */ + * not what uses the backend */ e_source_set_property (source, "setup-username", user); e_source_set_property (source, "auth", (user && *user) ? "1" : NULL); e_source_set_property (source, "googlename", NULL); @@ -301,12 +306,13 @@ update_user_in_source (ESource *source, const gchar *new_user) } static void -user_changed (GtkEntry *editable, ESource *source) +user_changed (GtkEntry *editable, + ESource *source) { update_user_in_source (source, gtk_entry_get_text (GTK_ENTRY (editable))); /* we changed user, thus reset the chosen calendar combo too, because - other user means other calendars subscribed */ + * other user means other calendars subscribed */ init_combo_values (GTK_COMBO_BOX (g_object_get_data (G_OBJECT (editable), "CalendarCombo")), _("Default"), NULL); } @@ -319,7 +325,9 @@ enum { }; static void -init_combo_values (GtkComboBox *combo, const gchar *deftitle, const gchar *defuri) +init_combo_values (GtkComboBox *combo, + const gchar *deftitle, + const gchar *defuri) { GtkTreeIter iter; GtkListStore *store; @@ -343,7 +351,8 @@ init_combo_values (GtkComboBox *combo, const gchar *deftitle, const gchar *defur } static void -cal_combo_changed (GtkComboBox *combo, ESource *source) +cal_combo_changed (GtkComboBox *combo, + ESource *source) { GtkListStore *store; GtkTreeIter iter; @@ -386,7 +395,8 @@ cal_combo_changed (GtkComboBox *combo, ESource *source) } static void -claim_error (GtkWindow *parent, const gchar *error) +claim_error (GtkWindow *parent, + const gchar *error) { GtkWidget *dialog; @@ -401,7 +411,8 @@ claim_error (GtkWindow *parent, const gchar *error) } static void -update_proxy_settings (GDataService *service, const gchar *uri) +update_proxy_settings (GDataService *service, + const gchar *uri) { EProxy *proxy; SoupURI *proxy_uri = NULL; @@ -419,7 +430,8 @@ update_proxy_settings (GDataService *service, const gchar *uri) } static void -retrieve_list_clicked (GtkButton *button, GtkComboBox *combo) +retrieve_list_clicked (GtkButton *button, + GtkComboBox *combo) { ESource *source; #ifdef HAVE_LIBGDATA_0_9 @@ -591,7 +603,8 @@ retrieve_list_sensitize (GtkEntry *username_entry, } gpointer -plugin_google_check (EPlugin *epl, EConfigHookPageCheckData *data) +plugin_google_check (EPlugin *epl, + EConfigHookPageCheckData *data) { ECalConfigTargetSource *t; @@ -605,8 +618,8 @@ plugin_google_check (EPlugin *epl, EConfigHookPageCheckData *data) } GtkWidget * -plugin_google (EPlugin *epl, - EConfigHookItemFactoryData *data) +plugin_google (EPlugin *epl, + EConfigHookItemFactoryData *data) { ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; ESource *source; @@ -655,10 +668,9 @@ plugin_google (EPlugin *epl, user = e_plugin_util_add_entry (parent, _("User_name:"), NULL, NULL); gtk_entry_set_text (GTK_ENTRY (user), username ? username : ""); - g_signal_connect (G_OBJECT (user), - "changed", - G_CALLBACK (user_changed), - source); + g_signal_connect ( + user, "changed", + G_CALLBACK (user_changed), source); e_plugin_util_add_refresh (parent, _("Re_fresh:"), source, "refresh"); @@ -713,7 +725,8 @@ plugin_google (EPlugin *epl, } void -e_calendar_google_migrate (EPlugin *epl, ECalEventTargetBackend *data) +e_calendar_google_migrate (EPlugin *epl, + ECalEventTargetBackend *data) { ESourceList *source_list; ESourceGroup *google = NULL; diff --git a/plugins/image-inline/image-inline.c b/plugins/image-inline/image-inline.c index 73a630a259..cfb05a1b00 100644 --- a/plugins/image-inline/image-inline.c +++ b/plugins/image-inline/image-inline.c @@ -444,7 +444,8 @@ org_gnome_image_inline_embed (EMFormatHTML *format, } void -org_gnome_image_inline_format (gpointer ep, EMFormatHookTarget *target) +org_gnome_image_inline_format (gpointer ep, + EMFormatHookTarget *target) { ImageInlinePObject *image_object; gchar *classid; diff --git a/plugins/imap-features/imap-headers.c b/plugins/imap-features/imap-headers.c index 5e079086da..a496106372 100644 --- a/plugins/imap-features/imap-headers.c +++ b/plugins/imap-features/imap-headers.c @@ -61,19 +61,22 @@ GtkWidget * org_gnome_imap_headers (EPlugin *epl, EConfigHookItemFactoryData *da gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } void -imap_headers_abort (EPlugin *efp, EConfigHookItemFactoryData *data) +imap_headers_abort (EPlugin *efp, + EConfigHookItemFactoryData *data) { /* Nothing to do here */ } void -imap_headers_commit (EPlugin *efp, EConfigHookItemFactoryData *data) +imap_headers_commit (EPlugin *efp, + EConfigHookItemFactoryData *data) { EMConfigTargetAccount *target_account; CamelFetchHeadersType fetch_headers; @@ -178,7 +181,8 @@ epif_add_sensitivity (EPImapFeaturesData *ui) } static void -epif_add_header (GtkButton *button, EPImapFeaturesData *ui) +epif_add_header (GtkButton *button, + EPImapFeaturesData *ui) { GtkTreeModel *model; GtkTreeIter iter; @@ -196,7 +200,8 @@ epif_add_header (GtkButton *button, EPImapFeaturesData *ui) } static void -epif_tv_selection_changed (GtkTreeSelection *selection, GtkWidget *button) +epif_tv_selection_changed (GtkTreeSelection *selection, + GtkWidget *button) { g_return_if_fail (selection != NULL); g_return_if_fail (button != NULL); @@ -205,7 +210,8 @@ epif_tv_selection_changed (GtkTreeSelection *selection, GtkWidget *button) } static void -epif_remove_header_clicked (GtkButton *button, EPImapFeaturesData *ui) +epif_remove_header_clicked (GtkButton *button, + EPImapFeaturesData *ui) { GtkTreeSelection *select; GtkTreeModel *model; @@ -233,13 +239,15 @@ epif_remove_header_clicked (GtkButton *button, EPImapFeaturesData *ui) } static void -epif_entry_changed (GtkWidget *entry, EPImapFeaturesData *ui) +epif_entry_changed (GtkWidget *entry, + EPImapFeaturesData *ui) { epif_add_sensitivity (ui); } GtkWidget * -org_gnome_imap_headers (EPlugin *epl, EConfigHookItemFactoryData *data) +org_gnome_imap_headers (EPlugin *epl, + EConfigHookItemFactoryData *data) { EMConfigTargetAccount *target_account; CamelSettings *settings; diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 09f59a7919..189362c102 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -155,13 +155,15 @@ typedef struct { static gboolean check_is_instance (icalcomponent *icalcomp); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } static icalproperty * -find_attendee (icalcomponent *ical_comp, const gchar *address) +find_attendee (icalcomponent *ical_comp, + const gchar *address) { icalproperty *prop; @@ -194,7 +196,8 @@ find_attendee (icalcomponent *ical_comp, const gchar *address) } static icalproperty * -find_attendee_if_sentby (icalcomponent *ical_comp, const gchar *address) +find_attendee_if_sentby (icalcomponent *ical_comp, + const gchar *address) { icalproperty *prop; @@ -230,7 +233,9 @@ find_attendee_if_sentby (icalcomponent *ical_comp, const gchar *address) } static void -find_to_address (struct _itip_puri *pitip, icalcomponent *ical_comp, icalparameter_partstat *status) +find_to_address (struct _itip_puri *pitip, + icalcomponent *ical_comp, + icalparameter_partstat *status) { EIterator *it; @@ -352,7 +357,8 @@ find_to_address (struct _itip_puri *pitip, icalcomponent *ical_comp, icalparamet } static void -find_from_address (struct _itip_puri *pitip, icalcomponent *ical_comp) +find_from_address (struct _itip_puri *pitip, + icalcomponent *ical_comp) { EIterator *it; icalproperty *prop; @@ -439,7 +445,8 @@ get_real_item (struct _itip_puri *pitip) } static void -adjust_item (struct _itip_puri *pitip, ECalComponent *comp) +adjust_item (struct _itip_puri *pitip, + ECalComponent *comp) { ECalComponent *real_comp; @@ -477,7 +484,9 @@ set_buttons_sensitive (struct _itip_puri *pitip) } static void -add_failed_to_load_msg (ItipView *view, ESource *source, const GError *error) +add_failed_to_load_msg (ItipView *view, + ESource *source, + const GError *error) { gchar *msg; @@ -486,7 +495,7 @@ add_failed_to_load_msg (ItipView *view, ESource *source, const GError *error) g_return_if_fail (error != NULL); /* Translators: The first '%s' is replaced with a calendar name, - the second '%s' with an error message */ + * the second '%s' with an error message */ msg = g_strdup_printf (_("Failed to load the calendar '%s' (%s)"), e_source_peek_name (source), error->message); itip_view_add_lower_info_item (view, ITIP_VIEW_INFO_ITEM_TYPE_WARNING, msg); @@ -595,7 +604,9 @@ start_calendar_server (struct _itip_puri *pitip, } static void -start_calendar_server_by_uid (struct _itip_puri *pitip, const gchar *uid, ECalClientSourceType type) +start_calendar_server_by_uid (struct _itip_puri *pitip, + const gchar *uid, + ECalClientSourceType type) { gint i; @@ -613,7 +624,9 @@ start_calendar_server_by_uid (struct _itip_puri *pitip, const gchar *uid, ECalCl } static void -source_selected_cb (ItipView *view, ESource *source, gpointer data) +source_selected_cb (ItipView *view, + ESource *source, + gpointer data) { struct _itip_puri *pitip = data; @@ -625,7 +638,8 @@ source_selected_cb (ItipView *view, ESource *source, gpointer data) } static void -find_cal_update_ui (FormatItipFindData *fd, ECalClient *cal_client) +find_cal_update_ui (FormatItipFindData *fd, + ECalClient *cal_client) { struct _itip_puri *pitip; ESource *source; @@ -711,8 +725,8 @@ decrease_find_data (FormatItipFindData *fd) /* * Only allow replies if backend doesn't do that automatically. - * Only enable it for forwarded invitiations (PUBLISH) or direct - * invitiations (REQUEST), but not replies (REPLY). + * * Only enable it for forwarded invitiations (PUBLISH) or direct + * * invitiations (REQUEST), but not replies (REPLY). * Replies only make sense for events with an organizer. */ if (pitip->current_client && !e_cal_client_check_save_schedules (pitip->current_client) && @@ -1003,7 +1017,8 @@ find_cal_opened_cb (GObject *source_object, } static void -find_server (struct _itip_puri *pitip, ECalComponent *comp) +find_server (struct _itip_puri *pitip, + ECalComponent *comp) { FormatItipFindData *fd = NULL; GSList *groups, *l, *sources_conflict = NULL, *all_sources = NULL; @@ -1115,7 +1130,9 @@ find_server (struct _itip_puri *pitip, ECalComponent *comp) } static gboolean -change_status (icalcomponent *ical_comp, const gchar *address, icalparameter_partstat status) +change_status (icalcomponent *ical_comp, + const gchar *address, + icalparameter_partstat status) { icalproperty *prop; @@ -1161,7 +1178,8 @@ change_status (icalcomponent *ical_comp, const gchar *address, icalparameter_par } static void -message_foreach_part (CamelMimePart *part, GSList **part_list) +message_foreach_part (CamelMimePart *part, + GSList **part_list) { CamelDataWrapper *containee; gint parts, i; @@ -1294,7 +1312,8 @@ get_uri_for_part (CamelMimePart *mime_part) } static gboolean -update_item (struct _itip_puri *pitip, ItipViewResponse response) +update_item (struct _itip_puri *pitip, + ItipViewResponse response) { struct icaltimetype stamp; icalproperty *prop; @@ -1473,7 +1492,8 @@ update_item (struct _itip_puri *pitip, ItipViewResponse response) /* TODO These operations should be available in e-cal-component.c */ static void -set_attendee (ECalComponent *comp, const gchar *address) +set_attendee (ECalComponent *comp, + const gchar *address) { icalproperty *prop; icalcomponent *icalcomp; @@ -1517,7 +1537,11 @@ set_attendee (ECalComponent *comp, const gchar *address) } static gboolean -send_comp_to_attendee (ECalComponentItipMethod method, ECalComponent *comp, const gchar *user, ECalClient *client, const gchar *comment) +send_comp_to_attendee (ECalComponentItipMethod method, + ECalComponent *comp, + const gchar *user, + ECalClient *client, + const gchar *comment) { gboolean status; ECalComponent *send_comp = e_cal_component_clone (comp); @@ -1546,7 +1570,10 @@ send_comp_to_attendee (ECalComponentItipMethod method, ECalComponent *comp, cons } static void -remove_delegate (struct _itip_puri *pitip, const gchar *delegate, const gchar *delegator, ECalComponent *comp) +remove_delegate (struct _itip_puri *pitip, + const gchar *delegate, + const gchar *delegator, + ECalComponent *comp) { gboolean status; gchar *comment = g_strdup_printf (_("Organizer has removed the delegate %s "), itip_strip_mailto (delegate)); @@ -1565,7 +1592,8 @@ remove_delegate (struct _itip_puri *pitip, const gchar *delegate, const gchar *d } static void -update_x (ECalComponent *pitip_comp, ECalComponent *comp) +update_x (ECalComponent *pitip_comp, + ECalComponent *comp) { icalcomponent *itip_icalcomp = e_cal_component_get_icalcomponent (pitip_comp); icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp); @@ -1800,7 +1828,8 @@ attachment_load_finish (EAttachment *attachment, } static void -save_vcalendar_cb (GtkWidget *button, struct _itip_puri *pitip) +save_vcalendar_cb (GtkWidget *button, + struct _itip_puri *pitip) { EAttachment *attachment; EShell *shell; @@ -1832,7 +1861,10 @@ save_vcalendar_cb (GtkWidget *button, struct _itip_puri *pitip) } static GtkWidget * -set_itip_error (struct _itip_puri *pitip, GtkContainer *container, const gchar *primary, const gchar *secondary) +set_itip_error (struct _itip_puri *pitip, + GtkContainer *container, + const gchar *primary, + const gchar *secondary) { GtkWidget *vbox, *label; gchar *message; @@ -1859,7 +1891,9 @@ set_itip_error (struct _itip_puri *pitip, GtkContainer *container, const gchar * } static gboolean -extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean *have_alarms) +extract_itip_data (struct _itip_puri *pitip, + GtkContainer *container, + gboolean *have_alarms) { EShell *shell; EShellSettings *shell_settings; @@ -2130,7 +2164,8 @@ struct _opencal_msg { }; static gchar * -open_calendar__desc (struct _opencal_msg *m, gint complete) +open_calendar__desc (struct _opencal_msg *m, + gint complete) { return g_strdup (_("Opening calendar")); } @@ -2180,7 +2215,9 @@ idle_open_cb (gpointer data) } static void -view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) +view_response_cb (GtkWidget *widget, + ItipViewResponse response, + gpointer data) { struct _itip_puri *pitip = data; gboolean status = FALSE, delete_invitation_from_cache = FALSE; @@ -2473,7 +2510,9 @@ in_proper_folder (CamelFolder *folder) } static gboolean -format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) +format_itip_object (EMFormatHTML *efh, + GtkHTMLEmbedded *eb, + EMFormatHTMLPObject *pobject) { EShell *shell; EShellSettings *shell_settings; @@ -2516,7 +2555,7 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject gtk_container_add (GTK_CONTAINER (eb), info->view); gtk_widget_show (info->view); - response_enabled = in_proper_folder (((EMFormat*) efh)->folder); + response_enabled = in_proper_folder (((EMFormat *) efh)->folder); if (!response_enabled) { itip_view_set_mode (ITIP_VIEW (info->view), ITIP_VIEW_MODE_HIDE_ALL); @@ -2746,7 +2785,7 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject if (datetime.value->is_date) { /* RFC says the DTEND is not inclusive, thus subtract one day - if we have a date */ + * if we have a date */ icaltime_adjust (datetime.value, -1, 0, 0, 0); } @@ -2797,7 +2836,7 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject static void puri_free (EMFormatPURI *puri) { - struct _itip_puri *pitip = (struct _itip_puri*) puri; + struct _itip_puri *pitip = (struct _itip_puri *) puri; gint i; g_cancellable_cancel (pitip->cancellable); @@ -2852,7 +2891,8 @@ puri_free (EMFormatPURI *puri) } void -format_itip (EPlugin *ep, EMFormatHookTarget *target) +format_itip (EPlugin *ep, + EMFormatHookTarget *target) { GConfClient *gconf; gchar *classid; @@ -2913,7 +2953,8 @@ format_itip (EPlugin *ep, EMFormatHookTarget *target) } static void -delete_toggled_cb (GtkWidget *widget, gpointer data) +delete_toggled_cb (GtkWidget *widget, + gpointer data) { EMConfigTargetPrefs *target = data; @@ -2921,7 +2962,8 @@ delete_toggled_cb (GtkWidget *widget, gpointer data) } static void -initialize_selection (ESourceSelector *selector, ESourceList *source_list) +initialize_selection (ESourceSelector *selector, + ESourceList *source_list) { GSList *groups; @@ -2938,7 +2980,8 @@ initialize_selection (ESourceSelector *selector, ESourceList *source_list) } static void -source_selection_changed (ESourceSelector *selector, gpointer data) +source_selection_changed (ESourceSelector *selector, + gpointer data) { ESourceList *source_list = data; GSList *selection; @@ -2957,7 +3000,7 @@ source_selection_changed (ESourceSelector *selector, gpointer data) } /* then we loop over the selector's selection, setting the - property on those sources */ + * property on those sources */ selection = e_source_selector_get_selection (selector); for (l = selection; l; l = l->next) { e_source_set_property (E_SOURCE (l->data), "conflict", "true"); @@ -2969,7 +3012,8 @@ source_selection_changed (ESourceSelector *selector, gpointer data) } GtkWidget * -itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) +itip_formatter_page_factory (EPlugin *ep, + EConfigHookItemFactoryData *hook_data) { EMConfigTargetPrefs *target = (EMConfigTargetPrefs *) hook_data->config->target; GtkWidget *page; diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index 86dc15b1b6..149e01b185 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -139,14 +139,14 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; static void -format_date_and_time_x (struct tm *date_tm, - struct tm *current_tm, - gboolean use_24_hour_format, - gboolean show_midnight, - gboolean show_zero_seconds, - gboolean is_date, - gchar *buffer, - gint buffer_size) +format_date_and_time_x (struct tm *date_tm, + struct tm *current_tm, + gboolean use_24_hour_format, + gboolean show_midnight, + gboolean show_zero_seconds, + gboolean is_date, + gchar *buffer, + gint buffer_size) { gchar *format; struct tm tomorrow_tm, week_tm; @@ -192,20 +192,20 @@ format_date_and_time_x (struct tm *date_tm, } else if (use_24_hour_format) { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a time, - in 24-hour format, without seconds. */ + * in 24-hour format, without seconds. */ format = _("Today %H:%M"); else /* strftime format of a time, - in 24-hour format. */ + * in 24-hour format. */ format = _("Today %H:%M:%S"); } else { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a time, - in 12-hour format, without seconds. */ + * in 12-hour format, without seconds. */ format = _("Today %l:%M %p"); else /* strftime format of a time, - in 12-hour format. */ + * in 12-hour format. */ format = _("Today %l:%M:%S %p"); } @@ -220,20 +220,20 @@ format_date_and_time_x (struct tm *date_tm, } else if (use_24_hour_format) { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a time, - in 24-hour format, without seconds. */ + * in 24-hour format, without seconds. */ format = _("Tomorrow %H:%M"); else /* strftime format of a time, - in 24-hour format. */ + * in 24-hour format. */ format = _("Tomorrow %H:%M:%S"); } else { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a time, - in 12-hour format, without seconds. */ + * in 12-hour format, without seconds. */ format = _("Tomorrow %l:%M %p"); else /* strftime format of a time, - in 12-hour format. */ + * in 12-hour format. */ format = _("Tomorrow %l:%M:%S %p"); } @@ -257,20 +257,20 @@ format_date_and_time_x (struct tm *date_tm, } else if (use_24_hour_format) { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a weekday and a - time, in 24-hour format, without seconds. */ + * time, in 24-hour format, without seconds. */ format = _("%A %H:%M"); else /* strftime format of a weekday and a - time, in 24-hour format. */ + * time, in 24-hour format. */ format = _("%A %H:%M:%S"); } else { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a weekday and a - time, in 12-hour format, without seconds. */ + * time, in 12-hour format, without seconds. */ format = _("%A %l:%M %p"); else /* strftime format of a weekday and a - time, in 12-hour format. */ + * time, in 12-hour format. */ format = _("%A %l:%M:%S %p"); } @@ -279,26 +279,26 @@ format_date_and_time_x (struct tm *date_tm, if (is_date || (!show_midnight && date_tm->tm_hour == 0 && date_tm->tm_min == 0 && date_tm->tm_sec == 0)) { /* strftime format of a weekday and a date - without a year. */ + * without a year. */ format = _("%A, %B %e"); } else if (use_24_hour_format) { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a weekday, a date - without a year and a time, - in 24-hour format, without seconds. */ + * without a year and a time, + * in 24-hour format, without seconds. */ format = _("%A, %B %e %H:%M"); else /* strftime format of a weekday, a date without a year - and a time, in 24-hour format. */ + * and a time, in 24-hour format. */ format = _("%A, %B %e %H:%M:%S"); } else { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a weekday, a date without a year - and a time, in 12-hour format, without seconds. */ + * and a time, in 12-hour format, without seconds. */ format = _("%A, %B %e %l:%M %p"); else /* strftime format of a weekday, a date without a year - and a time, in 12-hour format. */ + * and a time, in 12-hour format. */ format = _("%A, %B %e %l:%M:%S %p"); } } else { @@ -309,32 +309,34 @@ format_date_and_time_x (struct tm *date_tm, } else if (use_24_hour_format) { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a weekday, a date and a - time, in 24-hour format, without seconds. */ + * time, in 24-hour format, without seconds. */ format = _("%A, %B %e, %Y %H:%M"); else /* strftime format of a weekday, a date and a - time, in 24-hour format. */ + * time, in 24-hour format. */ format = _("%A, %B %e, %Y %H:%M:%S"); } else { if (!show_zero_seconds && date_tm->tm_sec == 0) /* strftime format of a weekday, a date and a - time, in 12-hour format, without seconds. */ + * time, in 12-hour format, without seconds. */ format = _("%A, %B %e, %Y %l:%M %p"); else /* strftime format of a weekday, a date and a - time, in 12-hour format. */ + * time, in 12-hour format. */ format = _("%A, %B %e, %Y %l:%M:%S %p"); } } /* strftime returns 0 if the string doesn't fit, and leaves the buffer - undefined, so we set it to the empty string in that case. */ + * undefined, so we set it to the empty string in that case. */ if (e_utf8_strftime_fix_am_pm (buffer, buffer_size, format, date_tm) == 0) buffer[0] = '\0'; } static gchar * -dupe_first_bold (const gchar *format, const gchar *first, const gchar *second) +dupe_first_bold (const gchar *format, + const gchar *first, + const gchar *second) { gchar *f, *s, *res; @@ -721,7 +723,8 @@ update_start_end_times (ItipView *view) } static void -set_info_items (GtkWidget *info_box, GSList *info_items) +set_info_items (GtkWidget *info_box, + GSList *info_items) { GSList *l; @@ -790,7 +793,8 @@ set_lower_info_items (ItipView *view) #define DATA_RESPONSE_KEY "ItipView::button_response" static void -button_clicked_cb (GtkWidget *widget, gpointer data) +button_clicked_cb (GtkWidget *widget, + gpointer data) { ItipViewResponse response; @@ -949,7 +953,8 @@ itip_view_class_init (ItipViewClass *klass) } static void -rsvp_toggled_cb (GtkWidget *widget, gpointer data) +rsvp_toggled_cb (GtkWidget *widget, + gpointer data) { ItipView *view = data; ItipViewPrivate *priv; @@ -964,7 +969,8 @@ rsvp_toggled_cb (GtkWidget *widget, gpointer data) } static void -recur_toggled_cb (GtkWidget *widget, gpointer data) +recur_toggled_cb (GtkWidget *widget, + gpointer data) { ItipView *view = data; ItipViewPrivate *priv; @@ -979,7 +985,8 @@ recur_toggled_cb (GtkWidget *widget, gpointer data) check1 was changed, so make the second available based on state of the first check. */ static void -alarm_check_toggled_cb (GtkWidget *check1, GtkWidget *check2) +alarm_check_toggled_cb (GtkWidget *check1, + GtkWidget *check2) { g_return_if_fail (check1 != NULL); g_return_if_fail (check2 != NULL); @@ -1204,7 +1211,8 @@ itip_view_new (void) } void -itip_view_set_mode (ItipView *view, ItipViewMode mode) +itip_view_set_mode (ItipView *view, + ItipViewMode mode) { ItipViewPrivate *priv; @@ -1233,7 +1241,8 @@ itip_view_get_mode (ItipView *view) } void -itip_view_set_item_type (ItipView *view, ECalClientSourceType type) +itip_view_set_item_type (ItipView *view, + ECalClientSourceType type) { ItipViewPrivate *priv; @@ -1261,7 +1270,8 @@ itip_view_get_item_type (ItipView *view) } void -itip_view_set_organizer (ItipView *view, const gchar *organizer) +itip_view_set_organizer (ItipView *view, + const gchar *organizer) { ItipViewPrivate *priv; @@ -1292,7 +1302,8 @@ itip_view_get_organizer (ItipView *view) } void -itip_view_set_organizer_sentby (ItipView *view, const gchar *sentby) +itip_view_set_organizer_sentby (ItipView *view, + const gchar *sentby) { ItipViewPrivate *priv; @@ -1323,7 +1334,8 @@ itip_view_get_organizer_sentby (ItipView *view) } void -itip_view_set_attendee (ItipView *view, const gchar *attendee) +itip_view_set_attendee (ItipView *view, + const gchar *attendee) { ItipViewPrivate *priv; @@ -1354,7 +1366,8 @@ itip_view_get_attendee (ItipView *view) } void -itip_view_set_attendee_sentby (ItipView *view, const gchar *sentby) +itip_view_set_attendee_sentby (ItipView *view, + const gchar *sentby) { ItipViewPrivate *priv; @@ -1385,7 +1398,8 @@ itip_view_get_attendee_sentby (ItipView *view) } void -itip_view_set_proxy (ItipView *view, const gchar *proxy) +itip_view_set_proxy (ItipView *view, + const gchar *proxy) { ItipViewPrivate *priv; @@ -1416,7 +1430,8 @@ itip_view_get_proxy (ItipView *view) } void -itip_view_set_delegator (ItipView *view, const gchar *delegator) +itip_view_set_delegator (ItipView *view, + const gchar *delegator) { ItipViewPrivate *priv; @@ -1447,7 +1462,8 @@ itip_view_get_delegator (ItipView *view) } void -itip_view_set_summary (ItipView *view, const gchar *summary) +itip_view_set_summary (ItipView *view, + const gchar *summary) { ItipViewPrivate *priv; @@ -1478,7 +1494,8 @@ itip_view_get_summary (ItipView *view) } void -itip_view_set_location (ItipView *view, const gchar *location) +itip_view_set_location (ItipView *view, + const gchar *location) { ItipViewPrivate *priv; @@ -1509,7 +1526,8 @@ itip_view_get_location (ItipView *view) } void -itip_view_set_status (ItipView *view, const gchar *status) +itip_view_set_status (ItipView *view, + const gchar *status) { ItipViewPrivate *priv; @@ -1540,7 +1558,8 @@ itip_view_get_status (ItipView *view) } void -itip_view_set_comment (ItipView *view, const gchar *comment) +itip_view_set_comment (ItipView *view, + const gchar *comment) { ItipViewPrivate *priv; @@ -1571,7 +1590,8 @@ itip_view_get_comment (ItipView *view) } void -itip_view_set_description (ItipView *view, const gchar *description) +itip_view_set_description (ItipView *view, + const gchar *description) { ItipViewPrivate *priv; @@ -1602,7 +1622,9 @@ itip_view_get_description (ItipView *view) } void -itip_view_set_start (ItipView *view, struct tm *start, gboolean is_date) +itip_view_set_start (ItipView *view, + struct tm *start, + gboolean is_date) { ItipViewPrivate *priv; @@ -1627,7 +1649,8 @@ itip_view_set_start (ItipView *view, struct tm *start, gboolean is_date) } const struct tm * -itip_view_get_start (ItipView *view, gboolean *is_date) +itip_view_get_start (ItipView *view, + gboolean *is_date) { ItipViewPrivate *priv; @@ -1643,7 +1666,9 @@ itip_view_get_start (ItipView *view, gboolean *is_date) } void -itip_view_set_end (ItipView *view, struct tm *end, gboolean is_date) +itip_view_set_end (ItipView *view, + struct tm *end, + gboolean is_date) { ItipViewPrivate *priv; @@ -1668,7 +1693,8 @@ itip_view_set_end (ItipView *view, struct tm *end, gboolean is_date) } const struct tm * -itip_view_get_end (ItipView *view, gboolean *is_date) +itip_view_get_end (ItipView *view, + gboolean *is_date) { ItipViewPrivate *priv; @@ -1684,7 +1710,9 @@ itip_view_get_end (ItipView *view, gboolean *is_date) } guint -itip_view_add_upper_info_item (ItipView *view, ItipViewInfoItemType type, const gchar *message) +itip_view_add_upper_info_item (ItipView *view, + ItipViewInfoItemType type, + const gchar *message) { ItipViewPrivate *priv; ItipViewInfoItem *item; @@ -1708,7 +1736,10 @@ itip_view_add_upper_info_item (ItipView *view, ItipViewInfoItemType type, const } guint -itip_view_add_upper_info_item_printf (ItipView *view, ItipViewInfoItemType type, const gchar *format, ...) +itip_view_add_upper_info_item_printf (ItipView *view, + ItipViewInfoItemType type, + const gchar *format, + ...) { va_list args; gchar *message; @@ -1728,7 +1759,8 @@ itip_view_add_upper_info_item_printf (ItipView *view, ItipViewInfoItemType type, } void -itip_view_remove_upper_info_item (ItipView *view, guint id) +itip_view_remove_upper_info_item (ItipView *view, + guint id) { ItipViewPrivate *priv; GSList *l; @@ -1779,7 +1811,9 @@ itip_view_clear_upper_info_items (ItipView *view) } guint -itip_view_add_lower_info_item (ItipView *view, ItipViewInfoItemType type, const gchar *message) +itip_view_add_lower_info_item (ItipView *view, + ItipViewInfoItemType type, + const gchar *message) { ItipViewPrivate *priv; ItipViewInfoItem *item; @@ -1803,7 +1837,10 @@ itip_view_add_lower_info_item (ItipView *view, ItipViewInfoItemType type, const } guint -itip_view_add_lower_info_item_printf (ItipView *view, ItipViewInfoItemType type, const gchar *format, ...) +itip_view_add_lower_info_item_printf (ItipView *view, + ItipViewInfoItemType type, + const gchar *format, + ...) { va_list args; gchar *message; @@ -1823,7 +1860,8 @@ itip_view_add_lower_info_item_printf (ItipView *view, ItipViewInfoItemType type, } void -itip_view_remove_lower_info_item (ItipView *view, guint id) +itip_view_remove_lower_info_item (ItipView *view, + guint id) { ItipViewPrivate *priv; GSList *l; @@ -1874,7 +1912,8 @@ itip_view_clear_lower_info_items (ItipView *view) } static void -source_changed_cb (ESourceComboBox *escb, ItipView *view) +source_changed_cb (ESourceComboBox *escb, + ItipView *view) { ESource *source; @@ -1884,7 +1923,8 @@ source_changed_cb (ESourceComboBox *escb, ItipView *view) } void -itip_view_set_source_list (ItipView *view, ESourceList *source_list) +itip_view_set_source_list (ItipView *view, + ESourceList *source_list) { ItipViewPrivate *priv; @@ -1949,7 +1989,8 @@ itip_view_get_source_list (ItipView *view) } void -itip_view_set_source (ItipView *view, ESource *source) +itip_view_set_source (ItipView *view, + ESource *source) { ItipViewPrivate *priv; @@ -1983,7 +2024,8 @@ itip_view_get_source (ItipView *view) } void -itip_view_set_rsvp (ItipView *view, gboolean rsvp) +itip_view_set_rsvp (ItipView *view, + gboolean rsvp) { ItipViewPrivate *priv; @@ -2012,7 +2054,8 @@ itip_view_get_rsvp (ItipView *view) } void -itip_view_set_show_rsvp (ItipView *view, gboolean rsvp) +itip_view_set_show_rsvp (ItipView *view, + gboolean rsvp) { ItipViewPrivate *priv; @@ -2040,7 +2083,8 @@ itip_view_get_show_rsvp (ItipView *view) } void -itip_view_set_update (ItipView *view, gboolean update) +itip_view_set_update (ItipView *view, + gboolean update) { ItipViewPrivate *priv; @@ -2066,7 +2110,8 @@ itip_view_get_update (ItipView *view) } void -itip_view_set_show_update (ItipView *view, gboolean update) +itip_view_set_show_update (ItipView *view, + gboolean update) { ItipViewPrivate *priv; @@ -2094,7 +2139,8 @@ itip_view_get_show_update (ItipView *view) } void -itip_view_set_rsvp_comment (ItipView *view, const gchar *comment) +itip_view_set_rsvp_comment (ItipView *view, + const gchar *comment) { ItipViewPrivate *priv; @@ -2120,7 +2166,8 @@ itip_view_get_rsvp_comment (ItipView *view) } void -itip_view_set_needs_decline (ItipView *view, gboolean needs_decline) +itip_view_set_needs_decline (ItipView *view, + gboolean needs_decline) { ItipViewPrivate *priv; @@ -2133,7 +2180,8 @@ itip_view_set_needs_decline (ItipView *view, gboolean needs_decline) } void -itip_view_set_buttons_sensitive (ItipView *view, gboolean sensitive) +itip_view_set_buttons_sensitive (ItipView *view, + gboolean sensitive) { ItipViewPrivate *priv; @@ -2167,7 +2215,8 @@ itip_view_get_recur_check_state (ItipView *view) } void -itip_view_set_show_recur_check (ItipView *view, gboolean show) +itip_view_set_show_recur_check (ItipView *view, + gboolean show) { g_return_if_fail (view != NULL); g_return_if_fail (ITIP_IS_VIEW (view)); @@ -2181,7 +2230,8 @@ itip_view_set_show_recur_check (ItipView *view, gboolean show) } void -itip_view_set_show_free_time_check (ItipView *view, gboolean show) +itip_view_set_show_free_time_check (ItipView *view, + gboolean show) { g_return_if_fail (view != NULL); g_return_if_fail (ITIP_IS_VIEW (view)); @@ -2203,7 +2253,8 @@ itip_view_get_free_time_check_state (ItipView *view) } void -itip_view_set_show_keep_alarm_check (ItipView *view, gboolean show) +itip_view_set_show_keep_alarm_check (ItipView *view, + gboolean show) { g_return_if_fail (view != NULL); g_return_if_fail (ITIP_IS_VIEW (view)); @@ -2226,7 +2277,8 @@ itip_view_get_keep_alarm_check_state (ItipView *view) } void -itip_view_set_show_inherit_alarm_check (ItipView *view, gboolean show) +itip_view_set_show_inherit_alarm_check (ItipView *view, + gboolean show) { g_return_if_fail (view != NULL); g_return_if_fail (ITIP_IS_VIEW (view)); diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index 99224eb288..9639bc6908 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -512,7 +512,9 @@ static ca_context *mailnotification = NULL; #endif static void -do_play_sound (gboolean beep, gboolean use_theme, const gchar *file) +do_play_sound (gboolean beep, + gboolean use_theme, + const gchar *file) { if (!beep) { #ifdef HAVE_CANBERRA @@ -537,7 +539,8 @@ struct _SoundConfigureWidgets { }; static void -sound_file_set_cb (GtkFileChooser *file_chooser, gpointer data) +sound_file_set_cb (GtkFileChooser *file_chooser, + gpointer data) { gchar *file; GConfClient *client; @@ -828,7 +831,8 @@ gint e_plugin_lib_enable (EPlugin *ep, gint enable); GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl); void -org_gnome_mail_new_notify (EPlugin *ep, EMEventTargetFolder *t) +org_gnome_mail_new_notify (EPlugin *ep, + EMEventTargetFolder *t) { g_return_if_fail (t != NULL); @@ -852,7 +856,8 @@ org_gnome_mail_new_notify (EPlugin *ep, EMEventTargetFolder *t) } void -org_gnome_mail_read_notify (EPlugin *ep, EMEventTargetMessage *t) +org_gnome_mail_read_notify (EPlugin *ep, + EMEventTargetMessage *t) { g_return_if_fail (t != NULL); @@ -875,7 +880,8 @@ org_gnome_mail_read_notify (EPlugin *ep, EMEventTargetMessage *t) } gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { if (enable) { enable_dbus (enable); diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 61eb5fb2f3..eb9e762b75 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -70,7 +70,7 @@ gboolean mail_browser_init (GtkUIManager *ui_manager, gboolean mail_shell_view_init (GtkUIManager *ui_manager, EShellView *shell_view); -static CompEditor* +static CompEditor * get_component_editor (EShell *shell, ECalClient *client, ECalComponent *comp, @@ -144,7 +144,9 @@ get_component_editor (EShell *shell, } static void -set_attendees (ECalComponent *comp, CamelMimeMessage *message, const gchar *organizer) +set_attendees (ECalComponent *comp, + CamelMimeMessage *message, + const gchar *organizer) { GSList *attendees = NULL, *to_free = NULL; ECalComponentAttendee *ca; @@ -214,7 +216,8 @@ set_attendees (ECalComponent *comp, CamelMimeMessage *message, const gchar *orga } static const gchar * -prepend_from (CamelMimeMessage *message, gchar **text) +prepend_from (CamelMimeMessage *message, + gchar **text) { gchar *res, *tmp, *addr = NULL; const gchar *name = NULL, *eml = NULL; @@ -245,7 +248,8 @@ prepend_from (CamelMimeMessage *message, gchar **text) } static void -set_description (ECalComponent *comp, CamelMimeMessage *message) +set_description (ECalComponent *comp, + CamelMimeMessage *message) { CamelDataWrapper *content; CamelStream *stream; @@ -308,7 +312,8 @@ set_description (ECalComponent *comp, CamelMimeMessage *message) } static gchar * -set_organizer (ECalComponent *comp, CamelFolder *folder) +set_organizer (ECalComponent *comp, + CamelFolder *folder) { EAccount *account = NULL; const gchar *str, *name; @@ -380,7 +385,9 @@ attachment_save_finished (EAttachmentStore *store, } static void -set_attachments (ECalClient *client, ECalComponent *comp, CamelMimeMessage *message) +set_attachments (ECalClient *client, + ECalComponent *comp, + CamelMimeMessage *message) { /* XXX Much of this is copied from CompEditor::get_attachment_list(). * Perhaps it should be split off as a separate utility? */ @@ -480,7 +487,8 @@ set_attachments (ECalClient *client, ECalComponent *comp, CamelMimeMessage *mess } static void -set_priority (ECalComponent *comp, CamelMimePart *part) +set_priority (ECalComponent *comp, + CamelMimePart *part) { const gchar *prio; @@ -515,7 +523,8 @@ do_report_error (struct _report_error *err) } static void -report_error_idle (const gchar *format, const gchar *param) +report_error_idle (const gchar *format, + const gchar *param) { struct _report_error *err = g_new (struct _report_error, 1); @@ -559,7 +568,8 @@ free_manage_comp_struct (struct _manage_comp *mc) } static gint -do_ask (const gchar *text, gboolean is_create_edit_add) +do_ask (const gchar *text, + gboolean is_create_edit_add) { gint res; GtkWidget *dialog = gtk_message_dialog_new (NULL, @@ -631,8 +641,8 @@ get_question_add_all_mails (ECalClientSourceType source_type) static void comp_editor_closed (CompEditor *editor, - gboolean accepted, - struct _manage_comp *mc) + gboolean accepted, + struct _manage_comp *mc) { if (!mc) return; @@ -641,7 +651,7 @@ comp_editor_closed (CompEditor *editor, mc->can_continue = (do_ask (_("Do you wish to continue converting remaining mails?"), FALSE) == GTK_RESPONSE_YES); /* Signal the do_mail_to_event thread that editor was closed and editor - for next event can be displayed (if any) */ + * for next event can be displayed (if any) */ g_cond_signal (mc->cond); } @@ -653,8 +663,8 @@ comp_editor_closed (CompEditor *editor, */ static void comp_editor_title_changed (GtkWidget *widget, - GParamSpec *pspec, - struct _manage_comp *mc) + GParamSpec *pspec, + struct _manage_comp *mc) { GtkWindow *editor = GTK_WINDOW (widget); const gchar *title = gtk_window_get_title (editor); @@ -679,8 +689,8 @@ comp_editor_title_changed (GtkWidget *widget, comp_name, mc->mails_done, mc->mails_count, task_name); /* Remember the new title, so that when gtk_window_set_title() causes - this handler to be recursively called, we can recognize that and - prevent endless recursion */ + * this handler to be recursively called, we can recognize that and + * prevent endless recursion */ if (mc->editor_title) g_free (mc->editor_title); mc->editor_title = new_title; @@ -996,12 +1006,13 @@ do_mail_to_event (AsyncData *data) } static gboolean -text_contains_nonwhitespace (const gchar *text, gint len) +text_contains_nonwhitespace (const gchar *text, + gint len) { const gchar *p; gunichar c = 0; - if (!text || len<=0) + if (!text || len <= 0) return FALSE; p = text; diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c index 1a34608150..e9d2dda7ee 100644 --- a/plugins/mailing-list-actions/mailing-list-actions.c +++ b/plugins/mailing-list-actions/mailing-list-actions.c @@ -92,7 +92,8 @@ gboolean mail_shell_view_init (GtkUIManager *ui_manager, gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c index 81e220c19d..4fe19cf71b 100644 --- a/plugins/mark-all-read/mark-all-read.c +++ b/plugins/mark-all-read/mark-all-read.c @@ -59,7 +59,8 @@ enum { gboolean e_plugin_ui_init (GtkUIManager *ui_manager, EShellView *shell_view); -gint e_plugin_lib_enable (EPlugin *ep, gint enable); +gint e_plugin_lib_enable (EPlugin *ep, + gint enable); static void async_context_free (AsyncContext *context) @@ -75,7 +76,8 @@ async_context_free (AsyncContext *context) } gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } @@ -207,8 +209,8 @@ prompt_user (gboolean has_subfolders) gtk_widget_show (widget); /* To Translators: It's a response button caption on a question - "Do you want to mark messages as read in the current folder - only, or in the current folder as well as all subfolders?" */ + * "Do you want to mark messages as read in the current folder + * only, or in the current folder as well as all subfolders?" */ widget = gtk_button_new_with_mnemonic ( _("In Current Folder and _Subfolders")); g_object_set_data ( @@ -221,8 +223,8 @@ prompt_user (gboolean has_subfolders) gtk_widget_show (widget); /* To Translators: It's a response button caption on a question - "Do you want to mark messages as read in the current folder - only, or in the current folder as well as all subfolders?" */ + * "Do you want to mark messages as read in the current folder + * only, or in the current folder as well as all subfolders?" */ widget = gtk_button_new_with_mnemonic ( _("In Current _Folder Only")); g_object_set_data ( @@ -252,7 +254,7 @@ static gboolean scan_folder_tree_for_unread_helper (GtkTreeModel *model, GtkTreeIter *iter, GtkTreePath *path, - gboolean is_first_node, + gboolean is_first_node, gint initial_depth, gint *relative_depth) { diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c index ce51ffeefd..55f62f8e3d 100644 --- a/plugins/prefer-plain/prefer-plain.c +++ b/plugins/prefer-plain/prefer-plain.c @@ -36,7 +36,7 @@ void org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t); void org_gnome_prefer_plain_text_html (gpointer ep, EMFormatHookTarget *t); -GtkWidget *org_gnome_prefer_plain_config_mode (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data); +GtkWidget *org_gnome_prefer_plain_config_mode (EPlugin *epl, struct _EConfigHookItemFactoryData *data); enum { EPP_NORMAL, @@ -49,7 +49,10 @@ static gint epp_mode = -1; static gboolean epp_show_suppressed = TRUE; static void -make_part_attachment (EMFormat *format, CamelStream *stream, CamelMimePart *part, gint i) +make_part_attachment (EMFormat *format, + CamelStream *stream, + CamelMimePart *part, + gint i) { gint partidlen = format->part_id->len; @@ -72,7 +75,7 @@ make_part_attachment (EMFormat *format, CamelStream *stream, CamelMimePart *part "application/octet-stream", NULL); } else if (i == -1 && CAMEL_IS_MIME_MESSAGE (part)) { /* message was asked to be formatted as text/html; - might be for cases where message itself is a text/html part */ + * might be for cases where message itself is a text/html part */ CamelMimePart *new_part; CamelDataWrapper *content; @@ -94,7 +97,8 @@ make_part_attachment (EMFormat *format, CamelStream *stream, CamelMimePart *part } void -org_gnome_prefer_plain_text_html (gpointer ep, EMFormatHookTarget *t) +org_gnome_prefer_plain_text_html (gpointer ep, + EMFormatHookTarget *t) { /* In text-only mode, all html output is suppressed for the first processing */ if (epp_mode != EPP_TEXT @@ -109,7 +113,10 @@ org_gnome_prefer_plain_text_html (gpointer ep, EMFormatHookTarget *t) } static void -export_as_attachments (CamelMultipart *mp, EMFormat *format, CamelStream *stream, CamelMimePart *except) +export_as_attachments (CamelMultipart *mp, + EMFormat *format, + CamelStream *stream, + CamelMimePart *except) { gint i, nparts; CamelMimePart *part; @@ -134,7 +141,8 @@ export_as_attachments (CamelMultipart *mp, EMFormat *format, CamelStream *stream } void -org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t) +org_gnome_prefer_plain_multipart_alternative (gpointer ep, + EMFormatHookTarget *t) { CamelMultipart *mp = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) t->part); CamelMimePart *part, *display_part = NULL, *calendar_part = NULL; @@ -146,11 +154,12 @@ org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t if (epp_mode == EPP_NORMAL) { gboolean have_plain = FALSE; - /* Try to find text/html part even when not as last and force to show it. - Old handler will show the last part of multipart/alternate, but if we - can offer HTML, then offer it, regardless of position in multipart. - But do this when have only text/plain and text/html parts, not more. - */ + /* Try to find text/html part even when not as last and force + * to show it. Old handler will show the last part of + * multipart/alternate, but if we can offer HTML, then + * offer it, regardless of position in multipart. But do + * this when have only text/plain and text/html parts, + * not more. */ nparts = camel_multipart_get_number (mp); for (i = 0; i < nparts; i++) { CamelContentType *content_type; @@ -196,7 +205,7 @@ org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t } nparts = camel_multipart_get_number (mp); - for (i=0; i<nparts; i++) { + for (i = 0; i < nparts; i++) { CamelContentType *ct; part = camel_multipart_get_part (mp, i); @@ -238,13 +247,24 @@ static struct { const gchar *label; const gchar *description; } epp_options[] = { - { "normal", N_("Show HTML if present"), N_("Let Evolution choose the best part to show.") }, - { "prefer_plain", N_("Show plain text if present"), N_("Show plain text part, if present, otherwise let Evolution choose the best part to show.") }, - { "only_plain", N_("Only ever show plain text"), N_("Always show plain text part and make attachments from other parts, if requested.") }, + { "normal", + N_("Show HTML if present"), + N_("Let Evolution choose the best part to show.") }, + + { "prefer_plain", + N_("Show plain text if present"), + N_("Show plain text part, if present, otherwise " + "let Evolution choose the best part to show.") }, + + { "only_plain", + N_("Only ever show plain text"), + N_("Always show plain text part and make attachments " + "from other parts, if requested.") }, }; static void -update_info_label (GtkWidget *info_label, guint mode) +update_info_label (GtkWidget *info_label, + guint mode) { gchar *str = g_strconcat ("<i>", _(epp_options[mode > 2 ? 0 : mode].description), "</i>", NULL); @@ -254,7 +274,8 @@ update_info_label (GtkWidget *info_label, guint mode) } static void -epp_mode_changed (GtkComboBox *dropdown, GtkWidget *info_label) +epp_mode_changed (GtkComboBox *dropdown, + GtkWidget *info_label) { epp_mode = gtk_combo_box_get_active (dropdown); if (epp_mode > 2) @@ -265,7 +286,8 @@ epp_mode_changed (GtkComboBox *dropdown, GtkWidget *info_label) } static void -epp_show_suppressed_toggled (GtkToggleButton *check, gpointer data) +epp_show_suppressed_toggled (GtkToggleButton *check, + gpointer data) { g_return_if_fail (check != NULL); @@ -274,7 +296,8 @@ epp_show_suppressed_toggled (GtkToggleButton *check, gpointer data) } GtkWidget * -org_gnome_prefer_plain_config_mode (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data) +org_gnome_prefer_plain_config_mode (EPlugin *epl, + struct _EConfigHookItemFactoryData *data) { /*EMConfigTargetPrefs *ep = (EMConfigTargetPrefs *)data->target;*/ GtkComboBox *dropdown; @@ -334,7 +357,8 @@ org_gnome_prefer_plain_config_mode (struct _EPlugin *epl, struct _EConfigHookIte gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { gchar *key; gint i; diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index 3f14ce0f9b..b330a371ba 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -103,8 +103,8 @@ void org_credativ_evolution_readpst_cancel (EImport *ei, EImportTarget *target, gint e_plugin_lib_enable (EPlugin *ep, gint enable); /* em-folder-selection-button.h is private, even though other internal evo plugins use it! - so declare the functions here - TODO: sort out whether this should really be private + * so declare the functions here + * TODO: sort out whether this should really be private */ static guchar pst_signature[] = { '!', 'B', 'D', 'N' }; @@ -141,7 +141,8 @@ struct _PstImporter { }; gboolean -org_credativ_evolution_readpst_supported (EPlugin *epl, EImportTarget *target) +org_credativ_evolution_readpst_supported (EPlugin *epl, + EImportTarget *target) { gchar signature[sizeof (pst_signature)]; gboolean ret = FALSE; @@ -177,37 +178,43 @@ org_credativ_evolution_readpst_supported (EPlugin *epl, EImportTarget *target) } static void -checkbox_mail_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +checkbox_mail_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data (&target->data, "pst-do-mail", GINT_TO_POINTER (gtk_toggle_button_get_active (tb))); } static void -checkbox_addr_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +checkbox_addr_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data (&target->data, "pst-do-addr", GINT_TO_POINTER (gtk_toggle_button_get_active (tb))); } static void -checkbox_appt_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +checkbox_appt_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data (&target->data, "pst-do-appt", GINT_TO_POINTER (gtk_toggle_button_get_active (tb))); } static void -checkbox_task_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +checkbox_task_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data (&target->data, "pst-do-task", GINT_TO_POINTER (gtk_toggle_button_get_active (tb))); } static void -checkbox_journal_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +checkbox_journal_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data (&target->data, "pst-do-journal", GINT_TO_POINTER (gtk_toggle_button_get_active (tb))); } static void -folder_selected (EMFolderSelectionButton *button, EImportTargetURI *target) +folder_selected (EMFolderSelectionButton *button, + EImportTargetURI *target) { g_free (target->uri_dest); target->uri_dest = g_strdup (em_folder_selection_button_get_folder_uri (button)); @@ -276,12 +283,12 @@ get_suggested_foldername (EImportTargetURI *target) if (!foldername) { /* Suggest a folder that is in the same mail storage as the users' inbox, - with a name derived from the .PST file */ + * with a name derived from the .PST file */ inbox = e_mail_local_get_folder_uri (E_MAIL_LOCAL_FOLDER_INBOX); delim = g_strrstr (inbox, "#"); if (delim != NULL) { - foldername = g_string_new_len (inbox, delim-inbox); + foldername = g_string_new_len (inbox, delim - inbox); } else { foldername = g_string_new (inbox); } @@ -317,7 +324,7 @@ get_suggested_foldername (EImportTargetURI *target) gint i, len; len = foldername->len; - for (i=1; i<10000; i++) { + for (i = 1; i < 10000; i++) { g_string_truncate (foldername, len); g_string_append_printf (foldername, "_%d", i); /* FIXME Not passing a GCancellable or GError here. */ @@ -338,7 +345,8 @@ get_suggested_foldername (EImportTargetURI *target) } static void -widget_sanitizer_cb (GtkToggleButton *button, GtkWidget *source_combo) +widget_sanitizer_cb (GtkToggleButton *button, + GtkWidget *source_combo) { g_return_if_fail (button != NULL); g_return_if_fail (source_combo != NULL); @@ -372,7 +380,11 @@ get_source_combo_key (EClientSourceType source_type) } static void -add_source_list_with_check (GtkWidget *frame, const gchar *caption, EClientSourceType source_type, GCallback toggle_callback, EImportTarget *target) +add_source_list_with_check (GtkWidget *frame, + const gchar *caption, + EClientSourceType source_type, + GCallback toggle_callback, + EImportTarget *target) { GtkWidget *check, *hbox; ESourceList *source_list = NULL; @@ -416,7 +428,9 @@ add_source_list_with_check (GtkWidget *frame, const gchar *caption, EClientSourc } GtkWidget * -org_credativ_evolution_readpst_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +org_credativ_evolution_readpst_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { EShell *shell; EShellBackend *shell_backend; @@ -471,7 +485,9 @@ org_credativ_evolution_readpst_getwidget (EImport *ei, EImportTarget *target, EI } static void -client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +client_opened_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { PstImporter *m = user_data; GError *error = NULL; @@ -520,7 +536,8 @@ client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_da } static void -open_client (PstImporter *m, EClientSourceType source_type) +open_client (PstImporter *m, + EClientSourceType source_type) { ESourceComboBox *combo; ESource *source; @@ -562,7 +579,8 @@ pst_prepare_run (PstImporter *m) } static gchar * -pst_import_describe (PstImporter *m, gint complete) +pst_import_describe (PstImporter *m, + gint complete) { return g_strdup (_("Importing Outlook data")); } @@ -576,7 +594,8 @@ pst_import_import (PstImporter *m, } static void -count_items (PstImporter *m, pst_desc_tree *topitem) +count_items (PstImporter *m, + pst_desc_tree *topitem) { pst_desc_tree *d_ptr; @@ -671,7 +690,8 @@ pst_import_file (PstImporter *m) } static void -pst_import_folders (PstImporter *m, pst_desc_tree *topitem) +pst_import_folders (PstImporter *m, + pst_desc_tree *topitem) { CamelOperation *co = CAMEL_OPERATION (m->cancellable); GHashTable *node_to_folderuri; /* pointers of hierarchy nodes, to them associated folder uris */ @@ -744,7 +764,9 @@ pst_import_folders (PstImporter *m, pst_desc_tree *topitem) } static void -pst_process_item (PstImporter *m, pst_desc_tree *d_ptr, gchar **previous_folder) +pst_process_item (PstImporter *m, + pst_desc_tree *d_ptr, + gchar **previous_folder) { pst_item *item = NULL; @@ -851,7 +873,8 @@ foldername_to_utf8 (const gchar *pstname) } static void -pst_process_folder (PstImporter *m, pst_item *item) +pst_process_folder (PstImporter *m, + pst_item *item) { gchar *uri; g_free (m->folder_name); @@ -951,7 +974,8 @@ pst_create_folder (PstImporter *m) * Returns: #CamelMimePart containing data and mime type */ static CamelMimePart * -attachment_to_part (PstImporter *m, pst_item_attach *attach) +attachment_to_part (PstImporter *m, + pst_item_attach *attach) { CamelMimePart *part; const gchar *mimetype; @@ -986,7 +1010,8 @@ attachment_to_part (PstImporter *m, pst_item_attach *attach) } static void -pst_process_email (PstImporter *m, pst_item *item) +pst_process_email (PstImporter *m, + pst_item *item) { CamelMimeMessage *msg; CamelInternetAddress *addr; @@ -1222,7 +1247,9 @@ pst_process_email (PstImporter *m, pst_item *item) } static void -contact_set_string (EContact *contact, EContactField id, gchar *string) +contact_set_string (EContact *contact, + EContactField id, + gchar *string) { if (string != NULL) { e_contact_set (contact, id, string); @@ -1230,7 +1257,10 @@ contact_set_string (EContact *contact, EContactField id, gchar *string) } static void -unknown_field (EContact *contact, GString *notes, const gchar *name, gchar *string) +unknown_field (EContact *contact, + GString *notes, + const gchar *name, + gchar *string) { /* Field could not be mapped directly so add to notes field */ if (string != NULL) { @@ -1239,7 +1269,15 @@ unknown_field (EContact *contact, GString *notes, const gchar *name, gchar *stri } static void -contact_set_address (EContact *contact, EContactField id, gchar *address, gchar *city, gchar *country, gchar *po_box, gchar *postal_code, gchar *state, gchar *street) +contact_set_address (EContact *contact, + EContactField id, + gchar *address, + gchar *city, + gchar *country, + gchar *po_box, + gchar *postal_code, + gchar *state, + gchar *street) { EContactAddress *eaddress; @@ -1275,7 +1313,9 @@ contact_set_address (EContact *contact, EContactField id, gchar *address, gchar } void -contact_set_date (EContact *contact, EContactField id, FILETIME *date) +contact_set_date (EContact *contact, + EContactField id, + FILETIME *date) { if (date && (date->dwLowDateTime || date->dwHighDateTime) ) { time_t t1; @@ -1295,7 +1335,8 @@ contact_set_date (EContact *contact, EContactField id, FILETIME *date) } static void -pst_process_contact (PstImporter *m, pst_item *item) +pst_process_contact (PstImporter *m, + pst_item *item) { pst_item_contact *c; EContact *ec; @@ -1462,7 +1503,8 @@ pst_process_contact (PstImporter *m, pst_item *item) * Returns: converted date */ struct icaltimetype -get_ical_date (FILETIME *date, gboolean is_date) +get_ical_date (FILETIME *date, + gboolean is_date) { if (date && (date->dwLowDateTime || date->dwHighDateTime) ) { time_t t; @@ -1475,7 +1517,10 @@ get_ical_date (FILETIME *date, gboolean is_date) } static void -set_cal_attachments (ECalClient *cal, ECalComponent *ec, PstImporter *m, pst_item_attach *attach) +set_cal_attachments (ECalClient *cal, + ECalComponent *ec, + PstImporter *m, + pst_item_attach *attach) { GSList *list = NULL; const gchar *uid; @@ -1572,7 +1617,10 @@ set_cal_attachments (ECalClient *cal, ECalComponent *ec, PstImporter *m, pst_ite } static void -fill_calcomponent (PstImporter *m, pst_item *item, ECalComponent *ec, const gchar *type) +fill_calcomponent (PstImporter *m, + pst_item *item, + ECalComponent *ec, + const gchar *type) { pst_item_appointment *a; pst_item_email *e; @@ -1683,7 +1731,7 @@ fill_calcomponent (PstImporter *m, pst_item *item, ECalComponent *ec, const gcha if (a->alarm_minutes) { trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START; - trigger.u.rel_duration = icaldurationtype_from_int (- (a->alarm_minutes)*60); + trigger.u.rel_duration = icaldurationtype_from_int (- (a->alarm_minutes) * 60); e_cal_component_alarm_set_trigger (alarm, trigger); } @@ -1773,7 +1821,10 @@ fill_calcomponent (PstImporter *m, pst_item *item, ECalComponent *ec, const gcha } static void -pst_process_component (PstImporter *m, pst_item *item, const gchar *comp_type, ECalClient *cal) +pst_process_component (PstImporter *m, + pst_item *item, + const gchar *comp_type, + ECalClient *cal) { ECalComponent *ec; gchar *uid = NULL; @@ -1799,26 +1850,30 @@ pst_process_component (PstImporter *m, pst_item *item, const gchar *comp_type, E } static void -pst_process_appointment (PstImporter *m, pst_item *item) +pst_process_appointment (PstImporter *m, + pst_item *item) { pst_process_component (m, item, "appointment", m->calendar); } static void -pst_process_task (PstImporter *m, pst_item *item) +pst_process_task (PstImporter *m, + pst_item *item) { pst_process_component (m, item, "task", m->tasks); } static void -pst_process_journal (PstImporter *m, pst_item *item) +pst_process_journal (PstImporter *m, + pst_item *item) { pst_process_component (m, item, "journal", m->journal); } /* Print an error message - maybe later bring up an error dialog? */ static void -pst_error_msg (const gchar *fmt, ...) +pst_error_msg (const gchar *fmt, + ...) { va_list ap; @@ -1889,7 +1944,10 @@ pst_status_timeout (gpointer data) } static void -pst_status (CamelOperation *op, const gchar *what, gint pc, gpointer data) +pst_status (CamelOperation *op, + const gchar *what, + gint pc, + gpointer data) { PstImporter *importer = data; @@ -1901,7 +1959,8 @@ pst_status (CamelOperation *op, const gchar *what, gint pc, gpointer data) } static void -pst_import (EImport *ei, EImportTarget *target) +pst_import (EImport *ei, + EImportTarget *target) { PstImporter *m; @@ -1934,7 +1993,9 @@ pst_import (EImport *ei, EImportTarget *target) /* Start the main import operation */ void -org_credativ_evolution_readpst_import (EImport *ei, EImportTarget *target, EImportImporter *im) +org_credativ_evolution_readpst_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { if (GPOINTER_TO_INT (g_datalist_get_data (&target->data, "pst-do-mail")) || GPOINTER_TO_INT (g_datalist_get_data (&target->data, "pst-do-addr")) @@ -1948,7 +2009,9 @@ org_credativ_evolution_readpst_import (EImport *ei, EImportTarget *target, EImpo } void -org_credativ_evolution_readpst_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +org_credativ_evolution_readpst_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { PstImporter *m = g_datalist_get_data (&target->data, "pst-msg"); @@ -1958,7 +2021,8 @@ org_credativ_evolution_readpst_cancel (EImport *ei, EImportTarget *target, EImpo } gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } @@ -1973,7 +2037,8 @@ e_plugin_lib_enable (EPlugin *ep, gint enable) * Returns: 0 for sucess, -1 for failure */ gint -pst_init (pst_file *pst, gchar *filename) +pst_init (pst_file *pst, + gchar *filename) { #if 0 @@ -2013,7 +2078,8 @@ pst_init (pst_file *pst, gchar *filename) * or %NULL if error */ gchar * -get_pst_rootname (pst_file *pst, gchar *filename) +get_pst_rootname (pst_file *pst, + gchar *filename) { pst_item *item = NULL; gchar *rootname = NULL; diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index 8fad76f79f..c55782985c 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -97,7 +97,8 @@ remove_notification (gpointer data) } static void -update_publish_notification (GtkMessageType msg_type, const gchar *msg_text) +update_publish_notification (GtkMessageType msg_type, + const gchar *msg_text) { static GString *actual_msg = NULL; #ifdef HAVE_LIBNOTIFY @@ -194,7 +195,10 @@ publish_uri_async (EPublishUri *uri) } static void -publish_online (EPublishUri *uri, GFile *file, GError **perror, gboolean can_report_success) +publish_online (EPublishUri *uri, + GFile *file, + GError **perror, + gboolean can_report_success) { GOutputStream *stream; GError *error = NULL; @@ -242,14 +246,16 @@ publish_online (EPublishUri *uri, GFile *file, GError **perror, gboolean can_rep } static void -unmount_done_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) +unmount_done_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { GError *error = NULL; #if GLIB_CHECK_VERSION(2,21,3) - g_mount_unmount_with_operation_finish (G_MOUNT (source_object), res, &error); + g_mount_unmount_with_operation_finish (G_MOUNT (source_object), result, &error); #else - g_mount_unmount_finish (G_MOUNT (source_object), res, &error); + g_mount_unmount_finish (G_MOUNT (source_object), result, &error); #endif if (error) { @@ -268,13 +274,15 @@ struct mnt_struct { }; static void -mount_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) +mount_ready_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { struct mnt_struct *ms = (struct mnt_struct *) user_data; GError *error = NULL; GMount *mount; - g_file_mount_enclosing_volume_finish (G_FILE (source_object), res, &error); + g_file_mount_enclosing_volume_finish (G_FILE (source_object), result, &error); if (error) { error_queue_add (g_strdup_printf (_("Mount of %s failed:"), ms->uri->location), error); @@ -307,7 +315,12 @@ mount_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) } static void -ask_password (GMountOperation *op, const gchar *message, const gchar *default_user, const gchar *default_domain, GAskPasswordFlags flags, gpointer user_data) +ask_password (GMountOperation *op, + const gchar *message, + const gchar *default_user, + const gchar *default_domain, + GAskPasswordFlags flags, + gpointer user_data) { struct mnt_struct *ms = (struct mnt_struct *) user_data; gchar *username, *password; @@ -330,7 +343,7 @@ ask_password (GMountOperation *op, const gchar *message, const gchar *default_us gboolean remember = FALSE; password = e_passwords_ask_password (_("Enter password"), NULL, ms->uri->location, message, - E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET|E_PASSWORDS_ONLINE, + E_PASSWORDS_REMEMBER_FOREVER | E_PASSWORDS_SECRET | E_PASSWORDS_ONLINE, &remember, NULL); @@ -357,7 +370,9 @@ ask_password (GMountOperation *op, const gchar *message, const gchar *default_us } static void -ask_question (GMountOperation *op, const gchar *message, const gchar *choices[]) +ask_question (GMountOperation *op, + const gchar *message, + const gchar *choices[]) { /* this has been stolen from file-chooser */ GtkWidget *dialog; @@ -408,7 +423,9 @@ ask_question (GMountOperation *op, const gchar *message, const gchar *choices[]) } static void -mount_first (EPublishUri *uri, GFile *file, gboolean can_report_success) +mount_first (EPublishUri *uri, + GFile *file, + gboolean can_report_success) { struct mnt_struct *ms = g_malloc (sizeof (struct mnt_struct)); @@ -424,7 +441,8 @@ mount_first (EPublishUri *uri, GFile *file, gboolean can_report_success) } static void -publish (EPublishUri *uri, gboolean can_report_success) +publish (EPublishUri *uri, + gboolean can_report_success) { if (online) { GError *error = NULL; @@ -592,7 +610,8 @@ url_list_changed (PublishUIData *ui) } static void -update_url_enable_button (EPublishUri *url, GtkWidget *url_enable) +update_url_enable_button (EPublishUri *url, + GtkWidget *url_enable) { g_return_if_fail (url_enable != NULL); g_return_if_fail (GTK_IS_BUTTON (url_enable)); @@ -602,8 +621,8 @@ update_url_enable_button (EPublishUri *url, GtkWidget *url_enable) static void url_list_enable_toggled (GtkCellRendererToggle *renderer, - const gchar *path_string, - PublishUIData *ui) + const gchar *path_string, + PublishUIData *ui) { EPublishUri *url = NULL; GtkTreeModel *model; @@ -629,7 +648,8 @@ url_list_enable_toggled (GtkCellRendererToggle *renderer, } static void -selection_changed (GtkTreeSelection *selection, PublishUIData *ui) +selection_changed (GtkTreeSelection *selection, + PublishUIData *ui) { GtkTreeModel *model; GtkTreeIter iter; @@ -650,7 +670,8 @@ selection_changed (GtkTreeSelection *selection, PublishUIData *ui) } static void -url_add_clicked (GtkButton *button, PublishUIData *ui) +url_add_clicked (GtkButton *button, + PublishUIData *ui) { GtkTreeModel *model; GtkTreeIter iter; @@ -664,10 +685,11 @@ url_add_clicked (GtkButton *button, PublishUIData *ui) uri = URL_EDITOR_DIALOG (url_editor)->uri; if (uri->location) { gtk_list_store_append (GTK_LIST_STORE (model), &iter); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - URL_LIST_ENABLED_COLUMN, uri->enabled, - URL_LIST_LOCATION_COLUMN, uri->location, - URL_LIST_URL_COLUMN, uri, -1); + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + URL_LIST_ENABLED_COLUMN, uri->enabled, + URL_LIST_LOCATION_COLUMN, uri->location, + URL_LIST_URL_COLUMN, uri, -1); url_list_changed (ui); publish_uris = g_slist_prepend (publish_uris, uri); add_timeout (uri); @@ -680,7 +702,8 @@ url_add_clicked (GtkButton *button, PublishUIData *ui) } static void -url_edit_clicked (GtkButton *button, PublishUIData *ui) +url_edit_clicked (GtkButton *button, + PublishUIData *ui) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -714,16 +737,17 @@ url_edit_clicked (GtkButton *button, PublishUIData *ui) } static void -url_list_double_click (GtkTreeView *treeview, - GtkTreePath *path, - GtkTreeViewColumn *column, - PublishUIData *ui) +url_list_double_click (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + PublishUIData *ui) { url_edit_clicked (NULL, ui); } static void -url_remove_clicked (GtkButton *button, PublishUIData *ui) +url_remove_clicked (GtkButton *button, + PublishUIData *ui) { EPublishUri *url = NULL; GtkTreeSelection *selection; @@ -775,7 +799,8 @@ url_remove_clicked (GtkButton *button, PublishUIData *ui) } static void -url_enable_clicked (GtkButton *button, PublishUIData *ui) +url_enable_clicked (GtkButton *button, + PublishUIData *ui) { EPublishUri *url = NULL; GtkTreeSelection *selection; @@ -805,7 +830,8 @@ online_state_changed (EShell *shell) } GtkWidget * -publish_calendar_locations (EPlugin *epl, EConfigHookItemFactoryData *data) +publish_calendar_locations (EPlugin *epl, + EConfigHookItemFactoryData *data) { GtkBuilder *builder; GtkCellRenderer *renderer; @@ -827,28 +853,42 @@ publish_calendar_locations (EPlugin *epl, EConfigHookItemFactoryData *data) gtk_tree_view_set_model (GTK_TREE_VIEW (ui->treeview), GTK_TREE_MODEL (store)); renderer = gtk_cell_renderer_toggle_new (); - g_object_set (G_OBJECT (renderer), "activatable", TRUE, NULL); + g_object_set (renderer, "activatable", TRUE, NULL); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Enabled"), renderer, "active", URL_LIST_ENABLED_COLUMN, NULL); - g_signal_connect (G_OBJECT (renderer), "toggled", G_CALLBACK (url_list_enable_toggled), ui); + g_signal_connect ( + renderer, "toggled", + G_CALLBACK (url_list_enable_toggled), ui); renderer = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Location"), renderer, "text", URL_LIST_LOCATION_COLUMN, NULL); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), ui); + g_signal_connect ( + selection, "changed", + G_CALLBACK (selection_changed), ui); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ui->treeview), TRUE); - g_signal_connect (G_OBJECT (ui->treeview), "row-activated", G_CALLBACK (url_list_double_click), ui); + g_signal_connect ( + ui->treeview, "row-activated", + G_CALLBACK (url_list_double_click), ui); ui->url_add = e_builder_get_widget (builder, "url add"); ui->url_edit = e_builder_get_widget (builder, "url edit"); ui->url_remove = e_builder_get_widget (builder, "url remove"); ui->url_enable = e_builder_get_widget (builder, "url enable"); update_url_enable_button (NULL, ui->url_enable); - g_signal_connect (G_OBJECT (ui->url_add), "clicked", G_CALLBACK (url_add_clicked), ui); - g_signal_connect (G_OBJECT (ui->url_edit), "clicked", G_CALLBACK (url_edit_clicked), ui); - g_signal_connect (G_OBJECT (ui->url_remove), "clicked", G_CALLBACK (url_remove_clicked), ui); - g_signal_connect (G_OBJECT (ui->url_enable), "clicked", G_CALLBACK (url_enable_clicked), ui); + g_signal_connect ( + ui->url_add, "clicked", + G_CALLBACK (url_add_clicked), ui); + g_signal_connect ( + ui->url_edit, "clicked", + G_CALLBACK (url_edit_clicked), ui); + g_signal_connect ( + ui->url_remove, "clicked", + G_CALLBACK (url_remove_clicked), ui); + g_signal_connect ( + ui->url_enable, "clicked", + G_CALLBACK (url_enable_clicked), ui); gtk_widget_set_sensitive (GTK_WIDGET (ui->url_edit), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (ui->url_remove), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (ui->url_enable), FALSE); @@ -926,7 +966,8 @@ publish_uris_set_timeout (GSList *uris) } gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { GSList *uris; GConfClient *client; @@ -1024,7 +1065,8 @@ error_queue_show_idle (gpointer user_data) } void -error_queue_add (gchar *description, GError *error) +error_queue_add (gchar *description, + GError *error) { struct eq_data *data; @@ -1052,8 +1094,8 @@ action_calendar_publish_cb (GtkAction *action, thread = g_thread_create ((GThreadFunc) publish_urls, NULL, FALSE, &error); if (!thread) { /* To Translators: This is shown to a user when creation of a new thread, - where the publishing should be done, fails. Basically, this shouldn't - ever happen, and if so, then something is really wrong. */ + * where the publishing should be done, fails. Basically, this shouldn't + * ever happen, and if so, then something is really wrong. */ error_queue_add (g_strdup (_("Could not create publish thread.")), error); } } diff --git a/plugins/publish-calendar/publish-format-fb.c b/plugins/publish-calendar/publish-format-fb.c index 65762e0c8a..1059e1d5be 100644 --- a/plugins/publish-calendar/publish-format-fb.c +++ b/plugins/publish-calendar/publish-format-fb.c @@ -37,7 +37,9 @@ #include "publish-format-fb.h" static void -free_busy_data_cb (ECalClient *client, const GSList *free_busy_ecalcomps, GSList **pobjects) +free_busy_data_cb (ECalClient *client, + const GSList *free_busy_ecalcomps, + GSList **pobjects) { const GSList *iter; @@ -52,7 +54,12 @@ free_busy_data_cb (ECalClient *client, const GSList *free_busy_ecalcomps, GSList } static gboolean -write_calendar (const gchar *uid, ESourceList *source_list, GOutputStream *stream, gint dur_type, gint dur_value, GError **error) +write_calendar (const gchar *uid, + ESourceList *source_list, + GOutputStream *stream, + gint dur_type, + gint dur_value, + GError **error) { ESource *source; ECalClient *client = NULL; @@ -133,7 +140,9 @@ write_calendar (const gchar *uid, ESourceList *source_list, GOutputStream *strea } void -publish_calendar_as_fb (GOutputStream *stream, EPublishUri *uri, GError **error) +publish_calendar_as_fb (GOutputStream *stream, + EPublishUri *uri, + GError **error) { GSList *l; ESourceList *source_list; diff --git a/plugins/publish-calendar/publish-format-ical.c b/plugins/publish-calendar/publish-format-ical.c index de6b342c3d..b28a57aceb 100644 --- a/plugins/publish-calendar/publish-format-ical.c +++ b/plugins/publish-calendar/publish-format-ical.c @@ -40,7 +40,8 @@ typedef struct { } CompTzData; static void -insert_tz_comps (icalparameter *param, gpointer cb_data) +insert_tz_comps (icalparameter *param, + gpointer cb_data) { const gchar *tzid; CompTzData *tdata = cb_data; @@ -64,13 +65,18 @@ insert_tz_comps (icalparameter *param, gpointer cb_data) } static void -append_tz_to_comp (gpointer key, gpointer value, icalcomponent *toplevel) +append_tz_to_comp (gpointer key, + gpointer value, + icalcomponent *toplevel) { icalcomponent_add_component (toplevel, (icalcomponent *) value); } static gboolean -write_calendar (const gchar *uid, ESourceList *source_list, GOutputStream *stream, GError **error) +write_calendar (const gchar *uid, + ESourceList *source_list, + GOutputStream *stream, + GError **error) { ESource *source; ECalClient *client = NULL; @@ -128,7 +134,9 @@ write_calendar (const gchar *uid, ESourceList *source_list, GOutputStream *strea } void -publish_calendar_as_ical (GOutputStream *stream, EPublishUri *uri, GError **error) +publish_calendar_as_ical (GOutputStream *stream, + EPublishUri *uri, + GError **error) { GSList *l; ESourceList *source_list; diff --git a/plugins/publish-calendar/publish-location.c b/plugins/publish-calendar/publish-location.c index f864d8a9ae..4bb4271037 100644 --- a/plugins/publish-calendar/publish-location.c +++ b/plugins/publish-calendar/publish-location.c @@ -33,7 +33,8 @@ #include <string.h> static EPublishUri * -migrateURI (const gchar *xml, xmlDocPtr doc) +migrateURI (const gchar *xml, + xmlDocPtr doc) { GConfClient *client; GSList *uris, *l, *events = NULL; diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c index c2e68b9069..9467705040 100644 --- a/plugins/publish-calendar/url-editor-dialog.c +++ b/plugins/publish-calendar/url-editor-dialog.c @@ -151,13 +151,15 @@ fail: } static void -source_selection_changed (ESourceSelector *selector, UrlEditorDialog *dialog) +source_selection_changed (ESourceSelector *selector, + UrlEditorDialog *dialog) { check_input (dialog); } static void -publish_service_changed (GtkComboBox *combo, UrlEditorDialog *dialog) +publish_service_changed (GtkComboBox *combo, + UrlEditorDialog *dialog) { gint selected = gtk_combo_box_get_active (combo); EPublishUri *uri; @@ -226,7 +228,8 @@ publish_service_changed (GtkComboBox *combo, UrlEditorDialog *dialog) } static void -type_selector_changed (GtkComboBox *combo, UrlEditorDialog *dialog) +type_selector_changed (GtkComboBox *combo, + UrlEditorDialog *dialog) { gint selected = gtk_combo_box_get_active (combo); EPublishUri *uri; @@ -238,7 +241,8 @@ type_selector_changed (GtkComboBox *combo, UrlEditorDialog *dialog) } static void -frequency_changed_cb (GtkComboBox *combo, UrlEditorDialog *dialog) +frequency_changed_cb (GtkComboBox *combo, + UrlEditorDialog *dialog) { gint selected = gtk_combo_box_get_active (combo); @@ -249,34 +253,40 @@ frequency_changed_cb (GtkComboBox *combo, UrlEditorDialog *dialog) } static void -server_entry_changed (GtkEntry *entry, UrlEditorDialog *dialog) +server_entry_changed (GtkEntry *entry, + UrlEditorDialog *dialog) { check_input (dialog); } static void -file_entry_changed (GtkEntry *entry, UrlEditorDialog *dialog) +file_entry_changed (GtkEntry *entry, + UrlEditorDialog *dialog) { check_input (dialog); } static void -port_entry_changed (GtkEntry *entry, UrlEditorDialog *dialog) +port_entry_changed (GtkEntry *entry, + UrlEditorDialog *dialog) { } static void -username_entry_changed (GtkEntry *entry, UrlEditorDialog *dialog) +username_entry_changed (GtkEntry *entry, + UrlEditorDialog *dialog) { } static void -password_entry_changed (GtkEntry *entry, UrlEditorDialog *dialog) +password_entry_changed (GtkEntry *entry, + UrlEditorDialog *dialog) { } static void -remember_pw_toggled (GtkToggleButton *toggle, UrlEditorDialog *dialog) +remember_pw_toggled (GtkToggleButton *toggle, + UrlEditorDialog *dialog) { } @@ -455,17 +465,37 @@ url_editor_dialog_construct (UrlEditorDialog *dialog) frequency_changed_cb (GTK_COMBO_BOX (dialog->publish_frequency), dialog); publish_service_changed (GTK_COMBO_BOX (dialog->publish_service), dialog); - g_signal_connect (G_OBJECT (dialog->publish_service), "changed", G_CALLBACK (publish_service_changed), dialog); - g_signal_connect (G_OBJECT (dialog->type_selector), "changed", G_CALLBACK (type_selector_changed), dialog); - g_signal_connect (G_OBJECT (dialog->publish_frequency), "changed", G_CALLBACK (frequency_changed_cb), dialog); - g_signal_connect (G_OBJECT (dialog->events_selector), "selection_changed", G_CALLBACK (source_selection_changed), dialog); - - g_signal_connect (G_OBJECT (dialog->server_entry), "changed", G_CALLBACK (server_entry_changed), dialog); - g_signal_connect (G_OBJECT (dialog->file_entry), "changed", G_CALLBACK (file_entry_changed), dialog); - g_signal_connect (G_OBJECT (dialog->port_entry), "changed", G_CALLBACK (port_entry_changed), dialog); - g_signal_connect (G_OBJECT (dialog->username_entry), "changed", G_CALLBACK (username_entry_changed), dialog); - g_signal_connect (G_OBJECT (dialog->password_entry), "changed", G_CALLBACK (password_entry_changed), dialog); - g_signal_connect (G_OBJECT (dialog->remember_pw), "toggled", G_CALLBACK (remember_pw_toggled), dialog); + g_signal_connect ( + dialog->publish_service, "changed", + G_CALLBACK (publish_service_changed), dialog); + g_signal_connect ( + dialog->type_selector, "changed", + G_CALLBACK (type_selector_changed), dialog); + g_signal_connect ( + dialog->publish_frequency, "changed", + G_CALLBACK (frequency_changed_cb), dialog); + g_signal_connect ( + dialog->events_selector, "selection_changed", + G_CALLBACK (source_selection_changed), dialog); + + g_signal_connect ( + dialog->server_entry, "changed", + G_CALLBACK (server_entry_changed), dialog); + g_signal_connect ( + dialog->file_entry, "changed", + G_CALLBACK (file_entry_changed), dialog); + g_signal_connect ( + dialog->port_entry, "changed", + G_CALLBACK (port_entry_changed), dialog); + g_signal_connect ( + dialog->username_entry, "changed", + G_CALLBACK (username_entry_changed), dialog); + g_signal_connect ( + dialog->password_entry,"changed", + G_CALLBACK (password_entry_changed), dialog); + g_signal_connect ( + dialog->remember_pw, "toggled", + G_CALLBACK (remember_pw_toggled), dialog); g_object_unref (gconf); @@ -475,7 +505,8 @@ url_editor_dialog_construct (UrlEditorDialog *dialog) } GtkWidget * -url_editor_dialog_new (GtkTreeModel *url_list_model, EPublishUri *uri) +url_editor_dialog_new (GtkTreeModel *url_list_model, + EPublishUri *uri) { UrlEditorDialog *dialog; diff --git a/plugins/save-calendar/csv-format.c b/plugins/save-calendar/csv-format.c index b4e95bbef7..d80ee25753 100644 --- a/plugins/save-calendar/csv-format.c +++ b/plugins/save-calendar/csv-format.c @@ -53,7 +53,8 @@ struct _CsvPluginData }; static void -display_error_message (GtkWidget *parent, GError *error) +display_error_message (GtkWidget *parent, + GError *error) { GtkWidget *dialog; @@ -73,7 +74,10 @@ enum { /* CSV helper enum */ /* Some helpers for the csv stuff */ static GString * -add_list_to_csv (GString *line, GSList *list_in, CsvConfig *config, gint type) +add_list_to_csv (GString *line, + GSList *list_in, + CsvConfig *config, + gint type) { /* @@ -87,7 +91,7 @@ add_list_to_csv (GString *line, GSList *list_in, CsvConfig *config, gint type) gboolean needquotes = FALSE; GSList *list = list_in; GString *tmp = NULL; - gint cnt=0; + gint cnt = 0; while (list) { const gchar *str = NULL; if (cnt == 0) @@ -96,10 +100,10 @@ add_list_to_csv (GString *line, GSList *list_in, CsvConfig *config, gint type) needquotes = TRUE; switch (type) { case ECALCOMPONENTATTENDEE: - str = ((ECalComponentAttendee*) list->data)->value; + str = ((ECalComponentAttendee *) list->data)->value; break; case ECALCOMPONENTTEXT: - str = ((ECalComponentText*) list->data)->value; + str = ((ECalComponentText *) list->data)->value; break; case CONSTCHAR: default: @@ -128,7 +132,9 @@ add_list_to_csv (GString *line, GSList *list_in, CsvConfig *config, gint type) } static GString * -add_nummeric_to_csv (GString *line, gint *nummeric, CsvConfig *config) +add_nummeric_to_csv (GString *line, + gint *nummeric, + CsvConfig *config) { /* @@ -146,7 +152,9 @@ add_nummeric_to_csv (GString *line, gint *nummeric, CsvConfig *config) } static GString * -add_time_to_csv (GString *line, icaltimetype *time, CsvConfig *config) +add_time_to_csv (GString *line, + icaltimetype *time, + CsvConfig *config) { if (time) { @@ -179,7 +187,8 @@ add_time_to_csv (GString *line, icaltimetype *time, CsvConfig *config) } static gboolean -string_needsquotes (const gchar *value, CsvConfig *config) +string_needsquotes (const gchar *value, + CsvConfig *config) { /* This is the actual need for quotes-checker */ @@ -191,12 +200,12 @@ string_needsquotes (const gchar *value, CsvConfig *config) * Will be written as {"Mom, can you please do that for me?"} */ - gboolean needquotes = strstr (value, config->delimiter) ? TRUE:FALSE; + gboolean needquotes = strstr (value, config->delimiter) ? TRUE : FALSE; if (!needquotes) { - needquotes = strstr (value, config->newline) ? TRUE:FALSE; + needquotes = strstr (value, config->newline) ? TRUE : FALSE; if (!needquotes) - needquotes = strstr (value, config->quote) ? TRUE:FALSE; + needquotes = strstr (value, config->quote) ? TRUE : FALSE; } /* @@ -217,16 +226,16 @@ string_needsquotes (const gchar *value, CsvConfig *config) if (!needquotes) { gint len = strlen (config->delimiter); if ((len == 2) && (config->delimiter[1] == ' ')) { - needquotes = strchr (value, config->delimiter[0])?TRUE:FALSE; + needquotes = strchr (value, config->delimiter[0]) ? TRUE : FALSE; if (!needquotes) { len = strlen (config->newline); if ((len == 2) && (config->newline[1] == ' ')) { - needquotes = strchr (value, config->newline[0])?TRUE:FALSE; + needquotes = strchr (value, config->newline[0]) ? TRUE : FALSE; if (!needquotes) { len = strlen (config->quote); if ((len == 2) && (config->quote[1] == ' ')) { needquotes = strchr - (value, config->quote[0])?TRUE:FALSE; + (value, config->quote[0]) ? TRUE : FALSE; } } } @@ -238,11 +247,13 @@ string_needsquotes (const gchar *value, CsvConfig *config) } static GString * -add_string_to_csv (GString *line, const gchar *value, CsvConfig *config) +add_string_to_csv (GString *line, + const gchar *value, + CsvConfig *config) { /* Will add a string to the record and will check for the need for quotes */ - if ((value) && (strlen (value)>0)) { + if ((value) && (strlen (value) > 0)) { gboolean needquotes = string_needsquotes (value, config); if (needquotes) @@ -260,13 +271,13 @@ static gchar * userstring_to_systemstring (const gchar *userstring) { const gchar *text = userstring; - gint i=0, len = strlen (text); + gint i = 0, len = strlen (text); GString *str = g_string_new (""); gchar *retval = NULL; while (i < len) { if (text[i] == '\\') { - switch (text[i+1]) { + switch (text[i + 1]) { case 'n': str = g_string_append_c (str, '\n'); i++; @@ -365,7 +376,7 @@ do_save_calendar_csv (FormatHandler *handler, if (config->header) { - gint i=0; + gint i = 0; static const gchar *labels[] = { N_("UID"), @@ -388,8 +399,8 @@ do_save_calendar_csv (FormatHandler *handler, }; line = g_string_new (""); - for (i=0;i<G_N_ELEMENTS (labels);i++) { - if (i>0) + for (i = 0; i < G_N_ELEMENTS (labels); i++) { + if (i > 0) g_string_append (line, config->delimiter); g_string_append (line, _(labels[i])); } diff --git a/plugins/save-calendar/ical-format.c b/plugins/save-calendar/ical-format.c index 039fdd8d55..f323fed99a 100644 --- a/plugins/save-calendar/ical-format.c +++ b/plugins/save-calendar/ical-format.c @@ -37,7 +37,8 @@ #include "format-handler.h" static void -display_error_message (GtkWidget *parent, const gchar *message) +display_error_message (GtkWidget *parent, + const gchar *message) { GtkWidget *dialog; @@ -52,7 +53,8 @@ typedef struct { } CompTzData; static void -insert_tz_comps (icalparameter *param, gpointer cb_data) +insert_tz_comps (icalparameter *param, + gpointer cb_data) { const gchar *tzid; CompTzData *tdata = cb_data; @@ -76,13 +78,18 @@ insert_tz_comps (icalparameter *param, gpointer cb_data) } static void -append_tz_to_comp (gpointer key, gpointer value, icalcomponent *toplevel) +append_tz_to_comp (gpointer key, + gpointer value, + icalcomponent *toplevel) { icalcomponent_add_component (toplevel, (icalcomponent *) value); } static void -do_save_calendar_ical (FormatHandler *handler, ESourceSelector *selector, ECalClientSourceType type, gchar *dest_uri) +do_save_calendar_ical (FormatHandler *handler, + ESourceSelector *selector, + ECalClientSourceType type, + gchar *dest_uri) { ESource *primary_source; ECalClient *source_client; diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c index 37a936c132..c93eb1fb59 100644 --- a/plugins/save-calendar/rdf-format.c +++ b/plugins/save-calendar/rdf-format.c @@ -41,8 +41,9 @@ #include "format-handler.h" -static void -add_string_to_rdf (xmlNodePtr node, const gchar *tag, const gchar *value); +static void add_string_to_rdf (xmlNodePtr node, + const gchar *tag, + const gchar *value); /* Use { */ @@ -79,7 +80,8 @@ enum { /* XML helper enum */ }; static void -display_error_message (GtkWidget *parent, GError *error) +display_error_message (GtkWidget *parent, + GError *error) { GtkWidget *dialog; @@ -91,7 +93,10 @@ display_error_message (GtkWidget *parent, GError *error) /* Some helpers for the xml stuff */ static void -add_list_to_rdf (xmlNodePtr node, const gchar *tag, GSList *list_in, gint type) +add_list_to_rdf (xmlNodePtr node, + const gchar *tag, + GSList *list_in, + gint type) { if (list_in) { GSList *list = list_in; @@ -101,10 +106,10 @@ add_list_to_rdf (xmlNodePtr node, const gchar *tag, GSList *list_in, gint type) switch (type) { case ECALCOMPONENTATTENDEE: - str = ((ECalComponentAttendee*) list->data)->value; + str = ((ECalComponentAttendee *) list->data)->value; break; case ECALCOMPONENTTEXT: - str = ((ECalComponentText*) list->data)->value; + str = ((ECalComponentText *) list->data)->value; break; case CONSTCHAR: default: @@ -120,7 +125,9 @@ add_list_to_rdf (xmlNodePtr node, const gchar *tag, GSList *list_in, gint type) } static void -add_nummeric_to_rdf (xmlNodePtr node, const gchar *tag, gint *nummeric) +add_nummeric_to_rdf (xmlNodePtr node, + const gchar *tag, + gint *nummeric) { if (nummeric) { gchar *value = g_strdup_printf ("%d", *nummeric); @@ -131,7 +138,9 @@ add_nummeric_to_rdf (xmlNodePtr node, const gchar *tag, gint *nummeric) } static void -add_time_to_rdf (xmlNodePtr node, const gchar *tag, icaltimetype *time) +add_time_to_rdf (xmlNodePtr node, + const gchar *tag, + icaltimetype *time) { if (time) { xmlNodePtr cur_node = NULL; @@ -159,7 +168,9 @@ add_time_to_rdf (xmlNodePtr node, const gchar *tag, icaltimetype *time) } static void -add_string_to_rdf (xmlNodePtr node, const gchar *tag, const gchar *value) +add_string_to_rdf (xmlNodePtr node, + const gchar *tag, + const gchar *value) { if (value) { xmlNodePtr cur_node = NULL; @@ -169,7 +180,10 @@ add_string_to_rdf (xmlNodePtr node, const gchar *tag, const gchar *value) } static void -do_save_calendar_rdf (FormatHandler *handler, ESourceSelector *selector, ECalClientSourceType type, gchar *dest_uri) +do_save_calendar_rdf (FormatHandler *handler, + ESourceSelector *selector, + ECalClientSourceType type, + gchar *dest_uri) { /* @@ -211,7 +225,7 @@ do_save_calendar_rdf (FormatHandler *handler, ESourceSelector *selector, ECalCli if (stream && e_cal_client_get_object_list_as_comps_sync (source_client, "#t", &objects, NULL, NULL)) { GSList *iter; - xmlBufferPtr buffer=xmlBufferCreate (); + xmlBufferPtr buffer = xmlBufferCreate (); xmlDocPtr doc = xmlNewDoc((xmlChar *) "1.0"); xmlNodePtr fnode; diff --git a/plugins/save-calendar/save-calendar.c b/plugins/save-calendar/save-calendar.c index a1a48be7cf..40ec512131 100644 --- a/plugins/save-calendar/save-calendar.c +++ b/plugins/save-calendar/save-calendar.c @@ -54,7 +54,8 @@ gboolean task_list_save_as_init (GtkUIManager *ui_manager, gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } @@ -67,14 +68,16 @@ enum { /* GtkComboBox enum */ }; static void -extra_widget_foreach_hide (GtkWidget *widget, gpointer data) +extra_widget_foreach_hide (GtkWidget *widget, + gpointer data) { if (widget != data) gtk_widget_hide (widget); } static void -on_type_combobox_changed (GtkComboBox *combobox, gpointer data) +on_type_combobox_changed (GtkComboBox *combobox, + gpointer data) { FormatHandler *handler = NULL; GtkWidget *extra_widget = data; @@ -99,7 +102,8 @@ on_type_combobox_changed (GtkComboBox *combobox, gpointer data) } static void -format_handlers_foreach_free (gpointer data, gpointer user_data) +format_handlers_foreach_free (gpointer data, + gpointer user_data) { FormatHandler *handler = data; @@ -113,7 +117,8 @@ format_handlers_foreach_free (gpointer data, gpointer user_data) } static void -ask_destination_and_save (ESourceSelector *selector, ECalClientSourceType type) +ask_destination_and_save (ESourceSelector *selector, + ECalClientSourceType type) { FormatHandler *handler = NULL; @@ -123,7 +128,7 @@ ask_destination_and_save (ESourceSelector *selector, ECalClientSourceType type) GtkComboBox *combo = GTK_COMBO_BOX (gtk_combo_box_new ()); GtkTreeModel *model = GTK_TREE_MODEL (gtk_list_store_new (N_DEST_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER)); - GtkCellRenderer *renderer=NULL; + GtkCellRenderer *renderer = NULL; GtkListStore *store = GTK_LIST_STORE (model); GtkTreeIter iter; GtkWidget *dialog = NULL; @@ -176,7 +181,8 @@ ask_destination_and_save (ESourceSelector *selector, ECalClientSourceType type) format_handlers = g_list_next (format_handlers); } - g_signal_connect (G_OBJECT(combo), "changed", + g_signal_connect ( + combo, "changed", G_CALLBACK (on_type_combobox_changed), extra_widget); g_object_set_data (G_OBJECT (combo), "format-box", hbox); @@ -229,11 +235,13 @@ ask_destination_and_save (ESourceSelector *selector, ECalClientSourceType type) } /* Returns output stream for the uri, or NULL on any error. - When done with the stream, just g_output_stream_close and g_object_unref it. - It will ask for overwrite if file already exists. + * When done with the stream, just g_output_stream_close and g_object_unref it. + * It will ask for overwrite if file already exists. */ GOutputStream * -open_for_writing (GtkWindow *parent, const gchar *uri, GError **error) +open_for_writing (GtkWindow *parent, + const gchar *uri, + GError **error) { GFile *file; GFileOutputStream *fostream; diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 71343e8536..f68cfc1b26 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -126,7 +126,8 @@ async_context_free (AsyncContext *context) } static void -selection_changed (GtkTreeSelection *selection, UIData *ui) +selection_changed (GtkTreeSelection *selection, + UIData *ui) { GtkTreeModel *model; GtkTreeIter iter; @@ -186,7 +187,10 @@ commit_changes (UIData *ui) } static void -clue_check_isempty (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, UIData *ui) +clue_check_isempty (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + UIData *ui) { GtkTreeSelection *selection; gchar *keyword = NULL; @@ -216,7 +220,10 @@ clue_check_isempty (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, U } static gboolean -clue_foreach_check_isempty (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, UIData *ui) +clue_foreach_check_isempty (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + UIData *ui) { gboolean valid; @@ -238,9 +245,9 @@ clue_foreach_check_isempty (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter static void key_cell_edited_callback (GtkCellRendererText *cell, - gchar *path_string, - gchar *new_text, - UIData *ui) + gchar *path_string, + gchar *new_text, + UIData *ui) { GtkTreeModel *model; GtkTreeIter iter; @@ -259,9 +266,9 @@ key_cell_edited_callback (GtkCellRendererText *cell, static void value_cell_edited_callback (GtkCellRendererText *cell, - gchar *path_string, - gchar *new_text, - UIData *ui) + gchar *path_string, + gchar *new_text, + UIData *ui) { GtkTreeModel *model; GtkTreeIter iter; @@ -280,7 +287,8 @@ value_cell_edited_callback (GtkCellRendererText *cell, } static void -clue_add_clicked (GtkButton *button, UIData *ui) +clue_add_clicked (GtkButton *button, + UIData *ui) { GtkTreeModel *model; GtkTreeIter iter; @@ -310,11 +318,14 @@ clue_add_clicked (GtkButton *button, UIData *ui) } /* We have done our job, connect back to the signal */ - g_signal_connect(G_OBJECT(model), "row-changed", G_CALLBACK(clue_check_isempty), ui); + g_signal_connect ( + model, "row-changed", + G_CALLBACK (clue_check_isempty), ui); } static void -clue_remove_clicked (GtkButton *button, UIData *ui) +clue_remove_clicked (GtkButton *button, + UIData *ui) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -357,7 +368,8 @@ clue_remove_clicked (GtkButton *button, UIData *ui) } static void -clue_edit_clicked (GtkButton *button, UIData *ui) +clue_edit_clicked (GtkButton *button, + UIData *ui) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -449,33 +461,43 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) renderer_key = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"), renderer_key, "text", CLUE_KEYWORD_COLUMN, NULL); - g_object_set (G_OBJECT (renderer_key), "editable", TRUE, NULL); - g_signal_connect(renderer_key, "edited", (GCallback) key_cell_edited_callback, ui); + g_object_set (renderer_key, "editable", TRUE, NULL); + g_signal_connect (renderer_key, "edited", (GCallback) key_cell_edited_callback, ui); renderer_value = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Values"), renderer_value, "text", CLUE_VALUE_COLUMN, NULL); - g_object_set (G_OBJECT (renderer_value), "editable", TRUE, NULL); - g_signal_connect(renderer_value, "edited", (GCallback) value_cell_edited_callback, ui); + g_object_set (renderer_value, "editable", TRUE, NULL); + g_signal_connect (renderer_value, "edited", (GCallback) value_cell_edited_callback, ui); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), ui); + g_signal_connect ( + selection, "changed", + G_CALLBACK (selection_changed), ui); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ui->treeview), TRUE); ui->clue_add = clue_add; - g_signal_connect (G_OBJECT (ui->clue_add), "clicked", G_CALLBACK (clue_add_clicked), ui); + g_signal_connect ( + ui->clue_add, "clicked", + G_CALLBACK (clue_add_clicked), ui); ui->clue_remove = clue_remove; - g_signal_connect (G_OBJECT (ui->clue_remove), "clicked", G_CALLBACK (clue_remove_clicked), ui); + g_signal_connect ( + ui->clue_remove, "clicked", + G_CALLBACK (clue_remove_clicked), ui); gtk_widget_set_sensitive (ui->clue_remove, FALSE); ui->clue_edit = clue_edit; - g_signal_connect (G_OBJECT (ui->clue_edit), "clicked", G_CALLBACK (clue_edit_clicked), ui); + g_signal_connect ( + ui->clue_edit, "clicked", + G_CALLBACK (clue_edit_clicked), ui); gtk_widget_set_sensitive (ui->clue_edit, FALSE); model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview)); - g_signal_connect(G_OBJECT(model), "row-changed", G_CALLBACK(clue_check_isempty), ui); + g_signal_connect ( + model, "row-changed", + G_CALLBACK (clue_check_isempty), ui); /* Populate tree view with values from gconf */ clue_list = gconf_client_get_list ( gconf, GCONF_KEY_TEMPLATE_PLACEHOLDERS, GCONF_VALUE_STRING, NULL ); @@ -506,7 +528,8 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) /* Case insensitive version of strstr */ static gchar * -strstr_nocase (const gchar * haystack, const gchar *needle) +strstr_nocase (const gchar *haystack, + const gchar *needle) { /* When _GNU_SOURCE is available, use the nonstandard extension of libc */ #ifdef _GNU_SOURCE @@ -528,7 +551,7 @@ strstr_nocase (const gchar * haystack, const gchar *needle) pos = strstr (l_haystack, l_needle); /* Get actual position of the needle in the haystack instead of l_haystack or - leave it NULL */ + * leave it NULL */ if (pos) pos = (gchar *)(haystack + (pos - l_haystack)); @@ -541,7 +564,9 @@ strstr_nocase (const gchar * haystack, const gchar *needle) /* Replaces $ORIG[variable] in given template by given replacement from the original message */ static void -replace_template_variable (GString *text, const gchar *variable, const gchar *replacement) +replace_template_variable (GString *text, + const gchar *variable, + const gchar *replacement) { const gchar *p, *next; GString *str; @@ -573,7 +598,9 @@ replace_template_variable (GString *text, const gchar *variable, const gchar *re } static void -replace_email_addresses (GString *template, CamelInternetAddress *internet_address, const gchar *variable) +replace_email_addresses (GString *template, + CamelInternetAddress *internet_address, + const gchar *variable) { gint address_index = 0; GString *emails = g_string_new (""); @@ -598,8 +625,9 @@ replace_email_addresses (GString *template, CamelInternetAddress *internet_addre g_string_free (emails, TRUE); } -static CamelMimePart* -fill_template (CamelMimeMessage *message, CamelMimePart *template) +static CamelMimePart * +fill_template (CamelMimeMessage *message, + CamelMimePart *template) { struct _camel_header_raw *header; CamelContentType *ct; @@ -666,7 +694,7 @@ fill_template (CamelMimeMessage *message, CamelMimePart *template) } /* Now manually replace the *subject* header. The header->value for subject header could be - base64 encoded, so let camel_mime_message to decode it for us if needed */ + * base64 encoded, so let camel_mime_message to decode it for us if needed */ replace_template_variable (template_body, "subject", camel_mime_message_get_subject (message)); /* Replace TO and FROM modifiers. */ @@ -783,7 +811,7 @@ create_new_message (CamelFolder *folder, dw = camel_medium_get_content (CAMEL_MEDIUM (template)); /* If template is a multipart, then try to use HTML. When no HTML part is available, use plaintext. Every other - add as an attachment */ + * add as an attachment */ if (CAMEL_IS_MULTIPART (dw)) { for (i = 0; i < camel_multipart_get_number (CAMEL_MULTIPART (dw)); i++) { CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (dw), i); @@ -815,14 +843,14 @@ create_new_message (CamelFolder *folder, out_part = fill_template (message, template_part); /* Assigning part directly to mime_message causes problem with "Content-type" header displaying - in the HTML message (camel parsing bug?) */ + * in the HTML message (camel parsing bug?) */ camel_multipart_add_part (new_multipart, out_part); g_object_unref (out_part); camel_medium_set_content (CAMEL_MEDIUM (new), CAMEL_DATA_WRAPPER (new_multipart)); /* Add the headers from the message we are replying to, so CC and that - stuff is preserved. Also replace any $ORIG[header-name] modifiers ignoring - 'content-*' headers */ + * stuff is preserved. Also replace any $ORIG[header-name] modifiers ignoring + * 'content-*' headers */ header = CAMEL_MIME_PART (message)->headers; while (header) { if (g_ascii_strncasecmp (header->name, "content-", 8) != 0) { @@ -1017,7 +1045,7 @@ build_template_menus_recurse (GtkUIManager *ui_manager, action_name, GTK_UI_MANAGER_MENU, FALSE); /* Disconnect previous connection to avoid possible multiple calls because - folder is a persistent structure */ + * folder is a persistent structure */ g_signal_handlers_disconnect_by_func (folder, G_CALLBACK (templates_folder_msg_changed_cb), shell_window); g_signal_connect (folder, "changed", G_CALLBACK (templates_folder_msg_changed_cb), shell_window); @@ -1172,7 +1200,7 @@ static GtkActionEntry composer_entries[] = { static void build_menu (EShellWindow *shell_window, - GtkActionGroup *action_group) + GtkActionGroup *action_group) { EShellView *shell_view; CamelFolder *folder; @@ -1210,7 +1238,8 @@ build_menu (EShellWindow *shell_window, } static void -update_actions_cb (EShellView *shell_view, GtkActionGroup *action_group) +update_actions_cb (EShellView *shell_view, + GtkActionGroup *action_group) { GList *list; gint length; @@ -1269,16 +1298,16 @@ rebuild_template_menu (EShellWindow *shell_window) static void templates_folder_msg_changed_cb (CamelFolder *folder, - CamelFolderChangeInfo *change_info, - EShellWindow *shell_window) + CamelFolderChangeInfo *change_info, + EShellWindow *shell_window) { rebuild_template_menu (shell_window); } static void templates_folder_changed_cb (CamelStore *store, - CamelFolderInfo *folder_info, - EShellWindow *shell_window) + CamelFolderInfo *folder_info, + EShellWindow *shell_window) { if (folder_info->full_name && strstr (folder_info->full_name, _("Templates")) != NULL) rebuild_template_menu (shell_window); @@ -1286,9 +1315,9 @@ templates_folder_changed_cb (CamelStore *store, static void templates_folder_renamed_cb (CamelStore *store, - const gchar *old_name, - CamelFolderInfo *folder_info, - EShellWindow *shell_window) + const gchar *old_name, + CamelFolderInfo *folder_info, + EShellWindow *shell_window) { if (folder_info->full_name && strstr (folder_info->full_name, _("Templates")) != NULL) rebuild_template_menu (shell_window); diff --git a/plugins/tnef-attachments/tnef-plugin.c b/plugins/tnef-attachments/tnef-plugin.c index 1e600ff405..5ef2f270b4 100644 --- a/plugins/tnef-attachments/tnef-plugin.c +++ b/plugins/tnef-attachments/tnef-plugin.c @@ -82,7 +82,8 @@ sanitize_filename (const gchar *filename) } void -org_gnome_format_tnef (gpointer ep, EMFormatHookTarget *t) +org_gnome_format_tnef (gpointer ep, + EMFormatHookTarget *t) { gchar *tmpdir, *name; CamelStream *out; @@ -100,7 +101,7 @@ org_gnome_format_tnef (gpointer ep, EMFormatHookTarget *t) name = g_build_filename(tmpdir, ".evo-attachment.tnef", NULL); - out = camel_stream_fs_new_with_name (name, O_RDWR|O_CREAT, 0666, NULL); + out = camel_stream_fs_new_with_name (name, O_RDWR | O_CREAT, 0666, NULL); if (out == NULL) goto fail; content = camel_medium_get_content ((CamelMedium *) t->part); @@ -210,7 +211,8 @@ org_gnome_format_tnef (gpointer ep, EMFormatHookTarget *t) gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { if (loaded) return 0; @@ -220,7 +222,10 @@ e_plugin_lib_enable (EPlugin *ep, gint enable) return 0; } -void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { +void +processTnef (TNEFStruct *tnef, + const gchar *tmpdir) +{ variableLength *filename; variableLength *filedata; Attachment *p; @@ -229,7 +234,7 @@ void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { gchar *ifilename = NULL; gchar *absfilename, *file; gint count; - gint foundCal=0; + gint foundCal = 0; FILE *fptr; @@ -237,55 +242,55 @@ void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { /* ie: it's a Contact Card, Task, or Meeting request (vCal/vCard) */ if (tnef->messageClass[0] != 0) { if (strcmp(tnef->messageClass, "IPM.Contact") == 0) { - saveVCard (tnef, tmpdir); - } + saveVCard (tnef, tmpdir); + } if (strcmp(tnef->messageClass, "IPM.Task") == 0) { - saveVTask (tnef, tmpdir); - } + saveVTask (tnef, tmpdir); + } if (strcmp(tnef->messageClass, "IPM.Appointment") == 0) { - saveVCalendar (tnef, tmpdir); - foundCal = 1; - } + saveVCalendar (tnef, tmpdir); + foundCal = 1; + } } if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), - PROP_TAG (PT_STRING8,0x24))) != MAPI_UNDEFINED) { + PROP_TAG (PT_STRING8,0x24))) != MAPI_UNDEFINED) { if (strcmp(filename->data, "IPM.Appointment") == 0) { /* If it's "indicated" twice, we don't want to save 2 calendar entries. */ - if (foundCal == 0) { - saveVCalendar (tnef, tmpdir); - } - } + if (foundCal == 0) { + saveVCalendar (tnef, tmpdir); + } + } } if (strcmp(tnef->messageClass, "IPM.Microsoft Mail.Note") == 0) { - if ((saveRTF == 1) && (tnef->subject.size > 0)) { + if ((saveRTF == 1) && (tnef->subject.size > 0)) { /* Description */ - if ((filename=MAPIFindProperty (&(tnef->MapiProperties), + if ((filename = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_BINARY, PR_RTF_COMPRESSED))) - != MAPI_UNDEFINED) { - variableLength buf; - if ((buf.data = (gchar *) DecompressRTF (filename, &buf.size)) != NULL) { - file = sanitize_filename (tnef->subject.data); + != MAPI_UNDEFINED) { + variableLength buf; + if ((buf.data = (gchar *) DecompressRTF (filename, &buf.size)) != NULL) { + file = sanitize_filename (tnef->subject.data); if (!file) return; absfilename = g_strconcat (file, ".rtf", NULL); - ifilename = g_build_filename (tmpdir, file, NULL); + ifilename = g_build_filename (tmpdir, file, NULL); g_free (absfilename); g_free (file); if ((fptr = fopen(ifilename, "wb"))==NULL) { printf("ERROR: Error writing file to disk!"); - } else { - fwrite (buf.data, - sizeof (BYTE), - buf.size, - fptr); - fclose (fptr); - } - free (buf.data); - } - } + } else { + fwrite (buf.data, + sizeof (BYTE), + buf.size, + fptr); + fclose (fptr); + } + free (buf.data); + } + } } } @@ -293,82 +298,82 @@ void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { p = tnef->starting_attach.next; count = 0; while (p != NULL) { - count++; + count++; /* Make sure it has a size. */ - if (p->FileData.size > 0) { - object = 1; + if (p->FileData.size > 0) { + object = 1; /* See if the contents are stored as "attached data" */ /* Inside the MAPI blocks. */ - if ((filedata = MAPIFindProperty (&(p->MAPI), - PROP_TAG (PT_OBJECT, PR_ATTACH_DATA_OBJ))) - == MAPI_UNDEFINED) { - if ((filedata = MAPIFindProperty (&(p->MAPI), - PROP_TAG (PT_BINARY, PR_ATTACH_DATA_OBJ))) + if ((filedata = MAPIFindProperty (&(p->MAPI), + PROP_TAG (PT_OBJECT, PR_ATTACH_DATA_OBJ))) + == MAPI_UNDEFINED) { + if ((filedata = MAPIFindProperty (&(p->MAPI), + PROP_TAG (PT_BINARY, PR_ATTACH_DATA_OBJ))) == MAPI_UNDEFINED) { /* Nope, standard TNEF stuff. */ - filedata = &(p->FileData); - object = 0; - } - } + filedata = &(p->FileData); + object = 0; + } + } /* See if this is an embedded TNEF stream. */ - RealAttachment = 1; - if (object == 1) { + RealAttachment = 1; + if (object == 1) { /* This is an "embedded object", so skip the */ /* 16-byte identifier first. */ - TNEFStruct emb_tnef; - DWORD signature; - memcpy (&signature, filedata->data+16, sizeof (DWORD)); - if (TNEFCheckForSignature (signature) == 0) { + TNEFStruct emb_tnef; + DWORD signature; + memcpy (&signature, filedata->data + 16, sizeof (DWORD)); + if (TNEFCheckForSignature (signature) == 0) { /* Has a TNEF signature, so process it. */ - TNEFInitialize (&emb_tnef); - emb_tnef.Debug = tnef->Debug; - if (TNEFParseMemory ((guchar *) filedata->data+16, - filedata->size-16, &emb_tnef) != -1) { - processTnef (&emb_tnef, tmpdir); - RealAttachment = 0; - } - TNEFFree (&emb_tnef); - } - } else { - TNEFStruct emb_tnef; - DWORD signature; - memcpy (&signature, filedata->data, sizeof (DWORD)); - if (TNEFCheckForSignature (signature) == 0) { + TNEFInitialize (&emb_tnef); + emb_tnef.Debug = tnef->Debug; + if (TNEFParseMemory ((guchar *) filedata->data + 16, + filedata->size - 16, &emb_tnef) != -1) { + processTnef (&emb_tnef, tmpdir); + RealAttachment = 0; + } + TNEFFree (&emb_tnef); + } + } else { + TNEFStruct emb_tnef; + DWORD signature; + memcpy (&signature, filedata->data, sizeof (DWORD)); + if (TNEFCheckForSignature (signature) == 0) { /* Has a TNEF signature, so process it. */ - TNEFInitialize (&emb_tnef); - emb_tnef.Debug = tnef->Debug; - if (TNEFParseMemory ((guchar *) filedata->data, - filedata->size, &emb_tnef) != -1) { - processTnef (&emb_tnef, tmpdir); - RealAttachment = 0; - } - TNEFFree (&emb_tnef); - } - } - if ((RealAttachment == 1) || (saveintermediate == 1)) { + TNEFInitialize (&emb_tnef); + emb_tnef.Debug = tnef->Debug; + if (TNEFParseMemory ((guchar *) filedata->data, + filedata->size, &emb_tnef) != -1) { + processTnef (&emb_tnef, tmpdir); + RealAttachment = 0; + } + TNEFFree (&emb_tnef); + } + } + if ((RealAttachment == 1) || (saveintermediate == 1)) { gchar tmpname[20]; /* Ok, it's not an embedded stream, so now we */ /* process it. */ - if ((filename = MAPIFindProperty (&(p->MAPI), - PROP_TAG (PT_STRING8, PR_ATTACH_LONG_FILENAME))) - == MAPI_UNDEFINED) { - if ((filename = MAPIFindProperty (&(p->MAPI), - PROP_TAG (PT_STRING8, PR_DISPLAY_NAME))) - == MAPI_UNDEFINED) { - filename = &(p->Title); - } - } - if (filename->size == 1) { - filename->size = 20; + if ((filename = MAPIFindProperty (&(p->MAPI), + PROP_TAG (PT_STRING8, PR_ATTACH_LONG_FILENAME))) + == MAPI_UNDEFINED) { + if ((filename = MAPIFindProperty (&(p->MAPI), + PROP_TAG (PT_STRING8, PR_DISPLAY_NAME))) + == MAPI_UNDEFINED) { + filename = &(p->Title); + } + } + if (filename->size == 1) { + filename->size = 20; g_sprintf(tmpname, "file_%03i.dat", count); - filename->data = tmpname; - } - absfilename = sanitize_filename (filename->data); + filename->data = tmpname; + } + absfilename = sanitize_filename (filename->data); if (!absfilename) return; ifilename = g_build_filename (tmpdir, absfilename, NULL); - g_free (absfilename); + g_free (absfilename); if ((fptr = fopen(ifilename, "wb"))==NULL) { printf("ERROR: Error writing file to disk!"); @@ -386,16 +391,19 @@ void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { } fclose (fptr); } - } - } /* if size>0 */ - p=p->next; + } + } /* if size>0 */ + p = p->next; } /* while p!= null */ g_free (ifilename); } -void saveVCard (TNEFStruct *tnef, const gchar *tmpdir) { +void +saveVCard (TNEFStruct *tnef, + const gchar *tmpdir) +{ gchar *ifilename; - gchar *absfilename, *file=NULL; + gchar *absfilename, *file = NULL; FILE *fptr; variableLength *vl; variableLength *pobox, *street, *city, *state, *zip, *country; @@ -403,22 +411,22 @@ void saveVCard (TNEFStruct *tnef, const gchar *tmpdir) { gint boolean; if ((vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_DISPLAY_NAME))) == MAPI_UNDEFINED) { - if ((vl=MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_COMPANY_NAME))) == MAPI_UNDEFINED) { - if (tnef->subject.size > 0) { + if ((vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_COMPANY_NAME))) == MAPI_UNDEFINED) { + if (tnef->subject.size > 0) { file = sanitize_filename (tnef->subject.data); if (!file) return; absfilename = g_strconcat (file, ".vcard", NULL); - } else + } else absfilename = g_strdup ("unknown.vcard"); } else { - file = sanitize_filename (vl->data); + file = sanitize_filename (vl->data); if (!file) return; absfilename = g_strconcat (file, ".vcard", NULL); - } + } } else { - file = sanitize_filename (vl->data); + file = sanitize_filename (vl->data); if (!file) return; absfilename = g_strconcat (file, ".vcard", NULL); @@ -433,9 +441,9 @@ void saveVCard (TNEFStruct *tnef, const gchar *tmpdir) { } else { fprintf(fptr, "BEGIN:VCARD\n"); fprintf(fptr, "VERSION:2.1\n"); - if (vl != MAPI_UNDEFINED) { + if (vl != MAPI_UNDEFINED) { fprintf(fptr, "FN:%s\n", vl->data); - } + } fprintProperty(tnef, fptr, PT_STRING8, PR_NICKNAME, "NICKNAME:%s\n"); fprintUserProp(tnef, fptr, PT_STRING8, 0x8554, "MAILER:Microsoft Outlook %s\n"); fprintProperty(tnef, fptr, PT_STRING8, PR_SPOUSE_NAME, "X-EVOLUTION-SPOUSE:%s\n"); @@ -443,182 +451,182 @@ void saveVCard (TNEFStruct *tnef, const gchar *tmpdir) { fprintProperty(tnef, fptr, PT_STRING8, PR_ASSISTANT, "X-EVOLUTION-ASSISTANT:%s\n"); /* Organizational */ - if ((vl=MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_COMPANY_NAME))) != MAPI_UNDEFINED) { - if (vl->size > 0) { - if ((vl->size == 1) && (vl->data[0] == 0)) { - } else { + if ((vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_COMPANY_NAME))) != MAPI_UNDEFINED) { + if (vl->size > 0) { + if ((vl->size == 1) && (vl->data[0] == 0)) { + } else { fprintf(fptr,"ORG:%s", vl->data); - if ((vl=MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_DEPARTMENT_NAME))) != MAPI_UNDEFINED) { + if ((vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_DEPARTMENT_NAME))) != MAPI_UNDEFINED) { fprintf(fptr,";%s", vl->data); - } + } fprintf(fptr, "\n"); - } - } - } + } + } + } fprintProperty(tnef, fptr, PT_STRING8, PR_OFFICE_LOCATION, "X-EVOLUTION-OFFICE:%s\n"); fprintProperty(tnef, fptr, PT_STRING8, PR_TITLE, "TITLE:%s\n"); fprintProperty(tnef, fptr, PT_STRING8, PR_PROFESSION, "ROLE:%s\n"); fprintProperty(tnef, fptr, PT_STRING8, PR_BODY, "NOTE:%s\n"); - if (tnef->body.size > 0) { + if (tnef->body.size > 0) { fprintf(fptr, "NOTE;QUOTED-PRINTABLE:"); - quotedfprint (fptr, &(tnef->body)); + quotedfprint (fptr, &(tnef->body)); fprintf(fptr,"\n"); - } + } /* Business Address */ - boolean = 0; - if ((pobox = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_POST_OFFICE_BOX))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((street = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_STREET_ADDRESS))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((city = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_LOCALITY))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((state = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_STATE_OR_PROVINCE))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((zip = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_POSTAL_CODE))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((country = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_COUNTRY))) != MAPI_UNDEFINED) { - boolean = 1; - } - if (boolean == 1) { + boolean = 0; + if ((pobox = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_POST_OFFICE_BOX))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((street = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_STREET_ADDRESS))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((city = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_LOCALITY))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((state = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_STATE_OR_PROVINCE))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((zip = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_POSTAL_CODE))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((country = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_COUNTRY))) != MAPI_UNDEFINED) { + boolean = 1; + } + if (boolean == 1) { fprintf(fptr, "ADR;QUOTED-PRINTABLE;WORK:"); - if (pobox != MAPI_UNDEFINED) { - quotedfprint (fptr, pobox); - } + if (pobox != MAPI_UNDEFINED) { + quotedfprint (fptr, pobox); + } fprintf(fptr, ";;"); - if (street != MAPI_UNDEFINED) { - quotedfprint (fptr, street); - } + if (street != MAPI_UNDEFINED) { + quotedfprint (fptr, street); + } fprintf(fptr, ";"); - if (city != MAPI_UNDEFINED) { - quotedfprint (fptr, city); - } + if (city != MAPI_UNDEFINED) { + quotedfprint (fptr, city); + } fprintf(fptr, ";"); - if (state != MAPI_UNDEFINED) { - quotedfprint (fptr, state); - } + if (state != MAPI_UNDEFINED) { + quotedfprint (fptr, state); + } fprintf(fptr, ";"); - if (zip != MAPI_UNDEFINED) { - quotedfprint (fptr, zip); - } + if (zip != MAPI_UNDEFINED) { + quotedfprint (fptr, zip); + } fprintf(fptr, ";"); - if (country != MAPI_UNDEFINED) { - quotedfprint (fptr, country); - } + if (country != MAPI_UNDEFINED) { + quotedfprint (fptr, country); + } fprintf(fptr,"\n"); - if ((vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x801b))) != MAPI_UNDEFINED) { + if ((vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x801b))) != MAPI_UNDEFINED) { fprintf(fptr, "LABEL;QUOTED-PRINTABLE;WORK:"); - quotedfprint (fptr, vl); + quotedfprint (fptr, vl); fprintf(fptr,"\n"); - } - } + } + } /* Home Address */ - boolean = 0; - if ((pobox = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_POST_OFFICE_BOX))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((street = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_STREET))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((city = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_CITY))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((state = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_STATE_OR_PROVINCE))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((zip = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_POSTAL_CODE))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((country = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_COUNTRY))) != MAPI_UNDEFINED) { - boolean = 1; - } - if (boolean == 1) { + boolean = 0; + if ((pobox = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_POST_OFFICE_BOX))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((street = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_STREET))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((city = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_CITY))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((state = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_STATE_OR_PROVINCE))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((zip = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_POSTAL_CODE))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((country = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_HOME_ADDRESS_COUNTRY))) != MAPI_UNDEFINED) { + boolean = 1; + } + if (boolean == 1) { fprintf(fptr, "ADR;QUOTED-PRINTABLE;HOME:"); - if (pobox != MAPI_UNDEFINED) { - quotedfprint (fptr, pobox); - } + if (pobox != MAPI_UNDEFINED) { + quotedfprint (fptr, pobox); + } fprintf(fptr, ";;"); - if (street != MAPI_UNDEFINED) { - quotedfprint (fptr, street); - } + if (street != MAPI_UNDEFINED) { + quotedfprint (fptr, street); + } fprintf(fptr, ";"); - if (city != MAPI_UNDEFINED) { - quotedfprint (fptr, city); - } + if (city != MAPI_UNDEFINED) { + quotedfprint (fptr, city); + } fprintf(fptr, ";"); - if (state != MAPI_UNDEFINED) { - quotedfprint (fptr, state); - } + if (state != MAPI_UNDEFINED) { + quotedfprint (fptr, state); + } fprintf(fptr, ";"); - if (zip != MAPI_UNDEFINED) { - quotedfprint (fptr, zip); - } + if (zip != MAPI_UNDEFINED) { + quotedfprint (fptr, zip); + } fprintf(fptr, ";"); - if (country != MAPI_UNDEFINED) { - quotedfprint (fptr, country); - } + if (country != MAPI_UNDEFINED) { + quotedfprint (fptr, country); + } fprintf(fptr,"\n"); - if ((vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x801a))) != MAPI_UNDEFINED) { + if ((vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x801a))) != MAPI_UNDEFINED) { fprintf(fptr, "LABEL;QUOTED-PRINTABLE;WORK:"); - quotedfprint (fptr, vl); + quotedfprint (fptr, vl); fprintf(fptr,"\n"); - } - } + } + } /* Other Address */ - boolean = 0; - if ((pobox = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_POST_OFFICE_BOX))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((street = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_STREET))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((city = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_CITY))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((state = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_STATE_OR_PROVINCE))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((zip = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_POSTAL_CODE))) != MAPI_UNDEFINED) { - boolean = 1; - } - if ((country = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_COUNTRY))) != MAPI_UNDEFINED) { - boolean = 1; - } - if (boolean == 1) { + boolean = 0; + if ((pobox = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_POST_OFFICE_BOX))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((street = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_STREET))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((city = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_CITY))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((state = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_STATE_OR_PROVINCE))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((zip = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_POSTAL_CODE))) != MAPI_UNDEFINED) { + boolean = 1; + } + if ((country = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_OTHER_ADDRESS_COUNTRY))) != MAPI_UNDEFINED) { + boolean = 1; + } + if (boolean == 1) { fprintf(fptr, "ADR;QUOTED-PRINTABLE;OTHER:"); - if (pobox != MAPI_UNDEFINED) { - quotedfprint (fptr, pobox); - } + if (pobox != MAPI_UNDEFINED) { + quotedfprint (fptr, pobox); + } fprintf(fptr, ";;"); - if (street != MAPI_UNDEFINED) { - quotedfprint (fptr, street); - } + if (street != MAPI_UNDEFINED) { + quotedfprint (fptr, street); + } fprintf(fptr, ";"); - if (city != MAPI_UNDEFINED) { - quotedfprint (fptr, city); - } + if (city != MAPI_UNDEFINED) { + quotedfprint (fptr, city); + } fprintf(fptr, ";"); - if (state != MAPI_UNDEFINED) { - quotedfprint (fptr, state); - } + if (state != MAPI_UNDEFINED) { + quotedfprint (fptr, state); + } fprintf(fptr, ";"); - if (zip != MAPI_UNDEFINED) { - quotedfprint (fptr, zip); - } + if (zip != MAPI_UNDEFINED) { + quotedfprint (fptr, zip); + } fprintf(fptr, ";"); - if (country != MAPI_UNDEFINED) { - quotedfprint (fptr, country); - } + if (country != MAPI_UNDEFINED) { + quotedfprint (fptr, country); + } fprintf(fptr,"\n"); - } + } fprintProperty(tnef, fptr, PT_STRING8, PR_CALLBACK_TELEPHONE_NUMBER, "TEL;X-EVOLUTION-CALLBACK:%s\n"); fprintProperty(tnef, fptr, PT_STRING8, PR_PRIMARY_TELEPHONE_NUMBER, "TEL;PREF:%s\n"); @@ -641,46 +649,46 @@ void saveVCard (TNEFStruct *tnef, const gchar *tmpdir) { fprintProperty(tnef, fptr, PT_STRING8, PR_HOME_FAX_NUMBER, "TEL;HOME;FAX:%s\n"); /* Email addresses */ - if ((vl=MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8083))) == MAPI_UNDEFINED) { - vl=MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8084)); - } - if (vl != MAPI_UNDEFINED) { - if (vl->size > 0) + if ((vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8083))) == MAPI_UNDEFINED) { + vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8084)); + } + if (vl != MAPI_UNDEFINED) { + if (vl->size > 0) fprintf(fptr, "EMAIL:%s\n", vl->data); - } - if ((vl=MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8093))) == MAPI_UNDEFINED) { - vl=MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8094)); - } - if (vl != MAPI_UNDEFINED) { - if (vl->size > 0) + } + if ((vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8093))) == MAPI_UNDEFINED) { + vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8094)); + } + if (vl != MAPI_UNDEFINED) { + if (vl->size > 0) fprintf(fptr, "EMAIL:%s\n", vl->data); - } - if ((vl=MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x80a3))) == MAPI_UNDEFINED) { - vl=MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x80a4)); - } - if (vl != MAPI_UNDEFINED) { - if (vl->size > 0) + } + if ((vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x80a3))) == MAPI_UNDEFINED) { + vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x80a4)); + } + if (vl != MAPI_UNDEFINED) { + if (vl->size > 0) fprintf(fptr, "EMAIL:%s\n", vl->data); - } + } fprintProperty(tnef, fptr, PT_STRING8, PR_BUSINESS_HOME_PAGE, "URL:%s\n"); fprintUserProp(tnef, fptr, PT_STRING8, 0x80d8, "FBURL:%s\n"); /* Birthday */ - if ((vl=MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_SYSTIME, PR_BIRTHDAY))) != MAPI_UNDEFINED) { + if ((vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_SYSTIME, PR_BIRTHDAY))) != MAPI_UNDEFINED) { fprintf(fptr, "BDAY:"); - MAPISysTimetoDTR ((guchar *) vl->data, &thedate); + MAPISysTimetoDTR ((guchar *) vl->data, &thedate); fprintf(fptr, "%i-%02i-%02i\n", thedate.wYear, thedate.wMonth, thedate.wDay); - } + } /* Anniversary */ - if ((vl=MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_SYSTIME, PR_WEDDING_ANNIVERSARY))) != MAPI_UNDEFINED) { + if ((vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_SYSTIME, PR_WEDDING_ANNIVERSARY))) != MAPI_UNDEFINED) { fprintf(fptr, "X-EVOLUTION-ANNIVERSARY:"); - MAPISysTimetoDTR ((guchar *) vl->data, &thedate); + MAPISysTimetoDTR ((guchar *) vl->data, &thedate); fprintf(fptr, "%i-%02i-%02i\n", thedate.wYear, thedate.wMonth, thedate.wDay); - } + } fprintf(fptr, "END:VCARD\n"); - fclose (fptr); + fclose (fptr); } g_free (ifilename); } @@ -808,7 +816,7 @@ void printRrule (FILE *fptr, gchar *recur_data, gint size, TNEFStruct *tnef) if (recur_data[0x16] == 0x23 || recur_data[0x16] == 0x22 || recur_data[0x16] == 0x21) { - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_I2, 0x0011))) != MAPI_UNDEFINED) { fprintf(fptr, ";INTERVAL=%d", *(filename->data)); } @@ -884,8 +892,8 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { } else { fprintf(fptr, "BEGIN:VCALENDAR\n"); if (tnef->messageClass[0] != 0) { - charptr2=tnef->messageClass; - charptr=charptr2; + charptr2 = tnef->messageClass; + charptr = charptr2; while (*charptr != 0) { if (*charptr == '.') { charptr2 = charptr; @@ -904,23 +912,23 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { fprintf(fptr, "BEGIN:VEVENT\n"); /* UID - After alot of comparisons, I'm reasonably sure this is totally - wrong. But it's not really necessary. */ + * After alot of comparisons, I'm reasonably sure this is totally + * wrong. But it's not really necessary. */ /* I think it only exists to connect future modification entries to - this entry. so as long as it's incorrectly interpreted the same way - every time, it should be ok :) */ + * this entry. so as long as it's incorrectly interpreted the same way + * every time, it should be ok :) */ filename = NULL; - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_BINARY, 0x3))) == MAPI_UNDEFINED) { - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_BINARY, 0x23))) == MAPI_UNDEFINED) { filename = NULL; } } - if (filename!=NULL) { + if (filename != NULL) { fprintf(fptr, "UID:"); - for (index=0;index<filename->size;index++) { + for (index = 0; index < filename->size; index++) { fprintf(fptr,"%02X", (guchar)filename->data[index]); } fprintf(fptr,"\n"); @@ -928,12 +936,12 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { /* Sequence */ filename = NULL; - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_LONG, 0x8201))) != MAPI_UNDEFINED) { - dword_ptr = (DWORD*) filename->data; + dword_ptr = (DWORD *) filename->data; fprintf(fptr, "SEQUENCE:%i\n", (gint) *dword_ptr); } - if ((filename=MAPIFindProperty (&(tnef->MapiProperties), + if ((filename = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_BINARY, PR_SENDER_SEARCH_KEY))) != MAPI_UNDEFINED) { charptr = filename->data; @@ -952,7 +960,7 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { /* We have a list of required participants, so write them out. */ if (filename->size > 1) { - charptr = filename->data-1; + charptr = filename->data - 1; while (charptr != NULL) { charptr++; charptr2 = strstr(charptr, ";"); @@ -973,7 +981,7 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { PROP_TAG (PT_STRING8, 0x823c))) != MAPI_UNDEFINED) { /* The list of optional participants */ if (filename->size > 1) { - charptr = filename->data-1; + charptr = filename->data - 1; while (charptr != NULL) { charptr++; charptr2 = strstr(charptr, ";"); @@ -993,7 +1001,7 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { } else if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8238))) != MAPI_UNDEFINED) { if (filename->size > 1) { - charptr = filename->data-1; + charptr = filename->data - 1; while (charptr != NULL) { charptr++; charptr2 = strstr(charptr, ";"); @@ -1013,7 +1021,7 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { } /* Summary */ filename = NULL; - if ((filename=MAPIFindProperty (&(tnef->MapiProperties), + if ((filename = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_CONVERSATION_TOPIC))) != MAPI_UNDEFINED) { fprintf(fptr, "SUMMARY:"); @@ -1022,7 +1030,7 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { } /* Description */ - if ((filename=MAPIFindProperty (&(tnef->MapiProperties), + if ((filename = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_BINARY, PR_RTF_COMPRESSED))) != MAPI_UNDEFINED) { variableLength buf; @@ -1036,9 +1044,9 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { /* Location */ filename = NULL; - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x0002))) == MAPI_UNDEFINED) { - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x8208))) == MAPI_UNDEFINED) { filename = NULL; } @@ -1048,11 +1056,11 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { } /* Date Start */ filename = NULL; - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_SYSTIME, 0x820d))) == MAPI_UNDEFINED) { - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_SYSTIME, 0x8516))) == MAPI_UNDEFINED) { - filename=NULL; + filename = NULL; } } if (filename != NULL) { @@ -1064,11 +1072,11 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { } /* Date End */ filename = NULL; - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_SYSTIME, 0x820e))) == MAPI_UNDEFINED) { - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_SYSTIME, 0x8517))) == MAPI_UNDEFINED) { - filename=NULL; + filename = NULL; } } if (filename != NULL) { @@ -1080,7 +1088,7 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { } /* Date Stamp */ filename = NULL; - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_SYSTIME, 0x8202))) != MAPI_UNDEFINED) { fprintf(fptr, "CREATED:"); MAPISysTimetoDTR ((guchar *) filename->data, &thedate); @@ -1090,9 +1098,9 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { } /* Class */ filename = NULL; - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_BOOLEAN, 0x8506))) != MAPI_UNDEFINED) { - dword_ptr = (DWORD*) filename->data; + dword_ptr = (DWORD *) filename->data; fprintf(fptr, "CLASS:" ); if (*dword_ptr == 1) { fprintf(fptr,"PRIVATE\n"); @@ -1102,7 +1110,7 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { } /* Recurrence */ filename = NULL; - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_BINARY, 0x8216))) != MAPI_UNDEFINED) { printRrule (fptr, filename->data, filename->size, tnef); } @@ -1168,7 +1176,7 @@ void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, 0x811f)); } if ((filename != MAPI_UNDEFINED) && (filename->size > 1)) { - charptr = filename->data-1; + charptr = filename->data - 1; while (charptr != NULL) { charptr++; charptr2 = strstr(charptr, ";"); @@ -1226,7 +1234,7 @@ void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { filename = MAPIFindUserProp (&(tnef->MapiProperties), \ PROP_TAG (PT_BOOLEAN, 0x8506)); if (filename != MAPI_UNDEFINED) { - dword_ptr = (DWORD*) filename->data; + dword_ptr = (DWORD *) filename->data; fprintf(fptr, "CLASS:" ); if (*dword_ptr == 1) { fprintf(fptr,"PRIVATE\n"); @@ -1243,7 +1251,7 @@ void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { void fprintProperty (TNEFStruct *tnef, FILE *fptr, DWORD proptype, DWORD propid, const gchar text[]) { variableLength *vl; - if ((vl=MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (proptype, propid))) != MAPI_UNDEFINED) { + if ((vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (proptype, propid))) != MAPI_UNDEFINED) { if (vl->size > 0) { if ((vl->size == 1) && (vl->data[0] == 0)) { } else { @@ -1255,7 +1263,7 @@ void fprintProperty (TNEFStruct *tnef, FILE *fptr, DWORD proptype, DWORD propid, void fprintUserProp (TNEFStruct *tnef, FILE *fptr, DWORD proptype, DWORD propid, const gchar text[]) { variableLength *vl; - if ((vl=MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (proptype, propid))) != MAPI_UNDEFINED) { + if ((vl = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (proptype, propid))) != MAPI_UNDEFINED) { if (vl->size > 0) { if ((vl->size == 1) && (vl->data[0] == 0)) { } else { @@ -1268,7 +1276,7 @@ void fprintUserProp (TNEFStruct *tnef, FILE *fptr, DWORD proptype, DWORD propid, void quotedfprint (FILE *fptr, variableLength *vl) { gint index; - for (index=0;index<vl->size-1; index++) { + for (index = 0; index < vl->size - 1; index++) { if (vl->data[index] == '\n') { fprintf(fptr, "=0A"); } else if (vl->data[index] == '\r') { @@ -1281,7 +1289,7 @@ void quotedfprint (FILE *fptr, variableLength *vl) { void cstylefprint (FILE *fptr, variableLength *vl) { gint index; - for (index=0;index<vl->size-1; index++) { + for (index = 0; index < vl->size - 1; index++) { if (vl->data[index] == '\n') { fprintf(fptr, "\\n"); } else if (vl->data[index] == '\r') { @@ -1307,7 +1315,7 @@ void printRtf (FILE *fptr, variableLength *vl) { key = 0; brace_ct = 0; - for (index = 0, byte=vl->data; index < vl->size; index++, byte++) { + for (index = 0, byte = vl->data; index < vl->size; index++, byte++) { if (*byte == '}') { brace_ct--; key = 0; diff --git a/plugins/vcard-inline/vcard-inline.c b/plugins/vcard-inline/vcard-inline.c index 24e551afe9..1b72958712 100644 --- a/plugins/vcard-inline/vcard-inline.c +++ b/plugins/vcard-inline/vcard-inline.c @@ -54,7 +54,8 @@ void org_gnome_vcard_inline_format (gpointer ep, EMFormatHookTarget *target); gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } @@ -161,7 +162,7 @@ org_gnome_vcard_inline_save_cb (VCardInlinePObject *vcard_object) { ESource *source; GSList *contact_list; - GtkWidget*dialog; + GtkWidget *dialog; g_return_if_fail (vcard_object->source_list != NULL); @@ -315,7 +316,8 @@ org_gnome_vcard_inline_embed (EMFormatHTML *format, } void -org_gnome_vcard_inline_format (gpointer ep, EMFormatHookTarget *target) +org_gnome_vcard_inline_format (gpointer ep, + EMFormatHookTarget *target) { VCardInlinePObject *vcard_object; gchar *classid; diff --git a/plugins/webdav-account-setup/webdav-contacts-source.c b/plugins/webdav-account-setup/webdav-contacts-source.c index ed716d3e89..a71eac36f1 100644 --- a/plugins/webdav-account-setup/webdav-contacts-source.c +++ b/plugins/webdav-account-setup/webdav-contacts-source.c @@ -47,11 +47,12 @@ typedef struct { GtkToggleButton *avoid_ifmatch_toggle; } ui_data; -GtkWidget * -plugin_webdav_contacts (EPlugin *epl, EConfigHookItemFactoryData *data); +GtkWidget * plugin_webdav_contacts (EPlugin *epl, + EConfigHookItemFactoryData *data); gint -e_plugin_lib_enable (EPlugin *ep, gint enable); +e_plugin_lib_enable (EPlugin *ep, + gint enable); static void ensure_webdav_contacts_source_group (void) @@ -204,7 +205,8 @@ destroy_ui_data (gpointer data) } GtkWidget * -plugin_webdav_contacts (EPlugin *epl, EConfigHookItemFactoryData *data) +plugin_webdav_contacts (EPlugin *epl, + EConfigHookItemFactoryData *data) { EABConfigTargetSource *t = (EABConfigTargetSource *) data->target; ESource *source; @@ -298,7 +300,8 @@ plugin_webdav_contacts (EPlugin *epl, EConfigHookItemFactoryData *data) } gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { if (enable) { ensure_webdav_contacts_source_group (); diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c index 6b5c0f22d0..1f1e3ee25e 100644 --- a/shell/e-shell-meego.c +++ b/shell/e-shell-meego.c @@ -54,9 +54,9 @@ e_shell_detect_meego (gboolean *is_meego, */ struct { gint (*XFree) (gpointer); - gint (*XGetWindowProperty) (Display*, XID, Atom, long, long, Bool, - Atom, Atom *, gint *, unsigned long*, - unsigned long*, guchar **); + gint (*XGetWindowProperty) (Display *, XID, Atom, long, long, Bool, + Atom, Atom *, gint *, gulong *, + gulong *, guchar **); } fns = { 0, 0 }; *is_meego = *small_screen = FALSE; @@ -67,7 +67,7 @@ e_shell_detect_meego (gboolean *is_meego, GdkDisplay *display; GdkAtom wm_win, mob_atom; Atom dummy_t; - unsigned long dummy_l; + gulong dummy_l; gint dummy_i; if (!gdk_display_get_default ()) diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index f5e1174729..89f94b0f83 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -798,7 +798,8 @@ fix_folder_permissions (const gchar *data_dir) } static void -merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) +merge_duplicate_local_sources (GConfClient *client, + const gchar *gconf_key) { ESourceList *source_list; GSList *iter, *to_remove = NULL; @@ -933,12 +934,12 @@ e_shell_migrate_attempt (EShell *shell) fix_folder_permissions (e_get_user_data_dir ()); /* Attempt to run migration all the time and let the backend - make the choice */ + * make the choice */ if (!shell_migrate_attempt (shell, major, minor, micro)) _exit (EXIT_SUCCESS); /* The 2.32.x (except of 2.32.2) lefts duplicate On This Computer/Personal sources, - thus clean the mess up */ + * thus clean the mess up */ merge_duplicate_local_sources (client, "/apps/evolution/addressbook/sources"); merge_duplicate_local_sources (client, "/apps/evolution/calendar/sources"); merge_duplicate_local_sources (client, "/apps/evolution/tasks/sources"); diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index f70697b8bc..1bfe01ef25 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -248,8 +248,8 @@ shell_switcher_dispose (GObject *object) static void shell_switcher_get_preferred_width (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { EShellSwitcherPrivate *priv; GtkWidget *child; @@ -283,8 +283,8 @@ shell_switcher_get_preferred_width (GtkWidget *widget, static void shell_switcher_get_preferred_height (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { EShellSwitcherPrivate *priv; GtkWidget *child; @@ -601,9 +601,9 @@ tool_item_get_button (GtkWidget *widget) } static gboolean -tool_item_button_cb (GtkWidget *internal_widget, - GdkEventButton *event, - GtkAction *action) +tool_item_button_cb (GtkWidget *internal_widget, + GdkEventButton *event, + GtkAction *action) { g_return_val_if_fail (GTK_IS_ACTION (action), FALSE); @@ -629,8 +629,8 @@ tool_item_button_cb (GtkWidget *internal_widget, **/ void e_shell_switcher_add_action (EShellSwitcher *switcher, - GtkAction *switch_action, - GtkAction *new_window_action) + GtkAction *switch_action, + GtkAction *new_window_action) { GtkWidget *widget; GtkButton *button; diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index 749eb22bd5..740960f555 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -160,7 +160,7 @@ GFile * e_shell_run_save_dialog (EShell *shell, const gchar *title, const gchar *suggestion, - const gchar *filters, + const gchar *filters, GtkCallback customize_func, gpointer customize_data) { diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 10842014d4..49e05baf36 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -247,7 +247,8 @@ shell_view_save_state_done_cb (GFile *file, } static EActivity * -shell_view_save_state (EShellView *shell_view, gboolean immediately) +shell_view_save_state (EShellView *shell_view, + gboolean immediately) { EShellBackend *shell_backend; SaveStateData *data; diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 2700a5152f..f389b4ea00 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1255,7 +1255,7 @@ action_switcher_cb (GtkRadioAction *action, static void action_new_view_window_cb (GtkAction *action, - EShellWindow *shell_window) + EShellWindow *shell_window) { EShell *shell; const gchar *view_name; @@ -2097,20 +2097,25 @@ e_shell_window_create_new_menu (EShellWindow *shell_window) } static GtkAction * -e_shell_window_create_switcher_action (GType type, EShellViewClass *class, - const gchar *name, const gchar *tooltip, - const gchar *view_name) +e_shell_window_create_switcher_action (GType type, + EShellViewClass *class, + const gchar *name, + const gchar *tooltip, + const gchar *view_name) { GtkAction *action; - action = g_object_new (type, "name", name, - "label", class->label, - "tooltip", tooltip, - "icon-name", class->icon_name, - NULL); + action = g_object_new ( + type, + "name", name, + "label", class->label, + "tooltip", tooltip, + "icon-name", class->icon_name, + NULL); - g_object_set_data (G_OBJECT (action), "view-name", - (gpointer) view_name); + g_object_set_data ( + G_OBJECT (action), + "view-name", (gpointer) view_name); return action; } @@ -2188,17 +2193,19 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) tooltip = g_strdup_printf (_("Switch to %s"), class->label); - s_action_name = g_strdup_printf (E_SHELL_SWITCHER_FORMAT, view_name); + s_action_name = g_strdup_printf ( + E_SHELL_SWITCHER_FORMAT, view_name); /* Note, we have to set "icon-name" separately because * gtk_radio_action_new() expects a "stock-id". Sadly, * GTK+ still distinguishes between the two. */ s_action = GTK_RADIO_ACTION ( - e_shell_window_create_switcher_action (GTK_TYPE_RADIO_ACTION, - class, s_action_name, - tooltip, view_name)); - g_object_set (G_OBJECT (s_action), "value", ii++, NULL); + e_shell_window_create_switcher_action ( + GTK_TYPE_RADIO_ACTION, + class, s_action_name, + tooltip, view_name)); + g_object_set (s_action, "value", ii++, NULL); gtk_radio_action_set_group (s_action, group); group = gtk_radio_action_get_group (s_action); @@ -2221,16 +2228,19 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) g_free (s_action_name); /* Create in new window actions */ - n_action_name = g_strdup_printf (E_SHELL_NEW_WINDOW_FORMAT, view_name); - n_action = e_shell_window_create_switcher_action (GTK_TYPE_ACTION, - class, n_action_name, - tooltip, view_name); - g_signal_connect (G_OBJECT (n_action), "activate", - G_CALLBACK (action_new_view_window_cb), - shell_window); + n_action_name = g_strdup_printf ( + E_SHELL_NEW_WINDOW_FORMAT, view_name); + n_action = e_shell_window_create_switcher_action ( + GTK_TYPE_ACTION, + class, n_action_name, + tooltip, view_name); + g_signal_connect ( + n_action, "activate", + G_CALLBACK (action_new_view_window_cb), shell_window); gtk_action_group_add_action (n_action_group, n_action); - e_shell_switcher_add_action (switcher, GTK_ACTION (s_action), n_action); + e_shell_switcher_add_action ( + switcher, GTK_ACTION (s_action), n_action); g_free (n_action_name); g_free (tooltip); diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 25dfe43660..8e9f39c5ce 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -190,8 +190,8 @@ shell_window_set_shell (EShellWindow *shell_window, static void shell_window_set_property (GObject *object, guint property_id, - const GValue *value, - GParamSpec *pspec) + const GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_ACTIVE_VIEW: @@ -249,8 +249,8 @@ shell_window_set_property (GObject *object, static void shell_window_get_property (GObject *object, guint property_id, - GValue *value, - GParamSpec *pspec) + GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_ACTIVE_VIEW: diff --git a/shell/es-event.c b/shell/es-event.c index 9d31f390e9..f6920e5d09 100644 --- a/shell/es-event.c +++ b/shell/es-event.c @@ -88,7 +88,10 @@ ESEvent *es_event_peek (void) } ESEventTargetUpgrade * -es_event_target_new_upgrade (ESEvent *eme, gint major, gint minor, gint revision) +es_event_target_new_upgrade (ESEvent *eme, + gint major, + gint minor, + gint revision) { ESEventTargetUpgrade *t; @@ -112,7 +115,7 @@ static const EEventHookTargetMap emeh_targets[] = { }; static void -emeh_finalise (GObject *o) +emeh_finalize (GObject *o) { /*EPluginHook *eph = (EPluginHook *)o;*/ @@ -131,10 +134,10 @@ emeh_class_init (EPluginHookClass *class) * A hook for events coming from the shell. **/ - ((GObjectClass *) class)->finalize = emeh_finalise; + ((GObjectClass *) class)->finalize = emeh_finalize; ((EPluginHookClass *)class)->id = "org.gnome.evolution.shell.events:1.0"; - for (i=0;emeh_targets[i].type;i++) + for (i = 0; emeh_targets[i].type; i++) e_event_hook_class_add_target_map ( (EEventHookClass *) class, &emeh_targets[i]); diff --git a/shell/killev.c b/shell/killev.c index 948523dccb..f444fad0b8 100644 --- a/shell/killev.c +++ b/shell/killev.c @@ -107,7 +107,8 @@ kill_factories (void) } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GFile *pid_file; GFileMonitor *monitor; diff --git a/shell/main.c b/shell/main.c index 8e1d533546..fd0b0508e6 100644 --- a/shell/main.c +++ b/shell/main.c @@ -431,7 +431,8 @@ create_default_shell (void) } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { EShell *shell; GConfClient *client; diff --git a/smclient/eggdesktopfile.c b/smclient/eggdesktopfile.c index 9020a2626d..19dc355273 100644 --- a/smclient/eggdesktopfile.c +++ b/smclient/eggdesktopfile.c @@ -53,7 +53,8 @@ struct EggDesktopFile { * Return value: the new #EggDesktopFile, or %NULL on error. **/ EggDesktopFile * -egg_desktop_file_new (const gchar *desktop_file_path, GError **error) +egg_desktop_file_new (const gchar *desktop_file_path, + GError **error) { GKeyFile *key_file; @@ -80,8 +81,8 @@ egg_desktop_file_new (const gchar *desktop_file_path, GError **error) * Return value: the new #EggDesktopFile, or %NULL on error. **/ EggDesktopFile * -egg_desktop_file_new_from_data_dirs (const gchar *desktop_file_path, - GError **error) +egg_desktop_file_new_from_data_dirs (const gchar *desktop_file_path, + GError **error) { EggDesktopFile *desktop_file; GKeyFile *key_file; @@ -115,9 +116,9 @@ egg_desktop_file_new_from_data_dirs (const gchar *desktop_file_path, * Return value: the new #EggDesktopFile, or %NULL on error. **/ EggDesktopFile * -egg_desktop_file_new_from_dirs (const gchar *desktop_file_path, - const gchar **search_dirs, - GError **error) +egg_desktop_file_new_from_dirs (const gchar *desktop_file_path, + const gchar **search_dirs, + GError **error) { EggDesktopFile *desktop_file; GKeyFile *key_file; @@ -151,9 +152,9 @@ egg_desktop_file_new_from_dirs (const gchar *desktop_file_path, * Return value: the new #EggDesktopFile, or %NULL on error. **/ EggDesktopFile * -egg_desktop_file_new_from_key_file (GKeyFile *key_file, - const gchar *source, - GError **error) +egg_desktop_file_new_from_key_file (GKeyFile *key_file, + const gchar *source, + GError **error) { EggDesktopFile *desktop_file; gchar *version, *type; @@ -381,9 +382,9 @@ egg_desktop_file_get_icon (EggDesktopFile *desktop_file) } gboolean -egg_desktop_file_has_key (EggDesktopFile *desktop_file, - const gchar *key, - GError **error) +egg_desktop_file_has_key (EggDesktopFile *desktop_file, + const gchar *key, + GError **error) { return g_key_file_has_key (desktop_file->key_file, EGG_DESKTOP_FILE_GROUP, key, @@ -391,9 +392,9 @@ egg_desktop_file_has_key (EggDesktopFile *desktop_file, } gchar * -egg_desktop_file_get_string (EggDesktopFile *desktop_file, - const gchar *key, - GError **error) +egg_desktop_file_get_string (EggDesktopFile *desktop_file, + const gchar *key, + GError **error) { return g_key_file_get_string (desktop_file->key_file, EGG_DESKTOP_FILE_GROUP, key, @@ -401,10 +402,10 @@ egg_desktop_file_get_string (EggDesktopFile *desktop_file, } gchar * -egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, - const gchar *key, - const gchar *locale, - GError **error) +egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, + const gchar *key, + const gchar *locale, + GError **error) { return g_key_file_get_locale_string (desktop_file->key_file, EGG_DESKTOP_FILE_GROUP, key, locale, @@ -412,9 +413,9 @@ egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, } gboolean -egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, - const gchar *key, - GError **error) +egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, + const gchar *key, + GError **error) { return g_key_file_get_boolean (desktop_file->key_file, EGG_DESKTOP_FILE_GROUP, key, @@ -422,9 +423,9 @@ egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, } gdouble -egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, - const gchar *key, - GError **error) +egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, + const gchar *key, + GError **error) { return g_key_file_get_double (desktop_file->key_file, EGG_DESKTOP_FILE_GROUP, key, @@ -432,10 +433,10 @@ egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, } gchar ** -egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, - const gchar *key, - gsize *length, - GError **error) +egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, + const gchar *key, + gsize *length, + GError **error) { return g_key_file_get_string_list (desktop_file->key_file, EGG_DESKTOP_FILE_GROUP, key, length, @@ -443,11 +444,11 @@ egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, } gchar ** -egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, - const gchar *key, - const gchar *locale, - gsize *length, - GError **error) +egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, + const gchar *key, + const gchar *locale, + gsize *length, + GError **error) { return g_key_file_get_locale_string_list (desktop_file->key_file, EGG_DESKTOP_FILE_GROUP, key, @@ -477,7 +478,7 @@ egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, **/ gboolean egg_desktop_file_can_launch (EggDesktopFile *desktop_file, - const gchar *desktop_environment) + const gchar *desktop_environment) { gchar *try_exec, *found_program; gchar **only_show_in, **not_show_in; @@ -599,10 +600,10 @@ egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file) } static void -append_quoted_word (GString *str, - const gchar *s, - gboolean in_single_quotes, - gboolean in_double_quotes) +append_quoted_word (GString *str, + const gchar *s, + gboolean in_single_quotes, + gboolean in_double_quotes) { const gchar *p; @@ -632,11 +633,11 @@ append_quoted_word (GString *str, static void do_percent_subst (EggDesktopFile *desktop_file, - gchar code, - GString *str, - GSList **documents, - gboolean in_single_quotes, - gboolean in_double_quotes) + gchar code, + GString *str, + GSList **documents, + gboolean in_single_quotes, + gboolean in_double_quotes) { GSList *d; gchar *doc; @@ -710,9 +711,9 @@ do_percent_subst (EggDesktopFile *desktop_file, } static gchar * -parse_exec (EggDesktopFile *desktop_file, - GSList **documents, - GError **error) +parse_exec (EggDesktopFile *desktop_file, + GSList **documents, + GError **error) { gchar *exec, *p, *command; gboolean escape, single_quot, double_quot; @@ -803,7 +804,8 @@ parse_exec (EggDesktopFile *desktop_file, } static GSList * -translate_document_list (EggDesktopFile *desktop_file, GSList *documents) +translate_document_list (EggDesktopFile *desktop_file, + GSList *documents) { gboolean accepts_uris = egg_desktop_file_accepts_uris (desktop_file); GSList *ret, *d; @@ -863,9 +865,9 @@ free_document_list (GSList *documents) * Return value: the parsed Exec string **/ gchar * -egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, - GSList *documents, - GError **error) +egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, + GSList *documents, + GError **error) { GSList *translated, *docs; gchar *command; @@ -878,10 +880,10 @@ egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, } static gboolean -parse_link (EggDesktopFile *desktop_file, - EggDesktopFile **app_desktop_file, - GSList **documents, - GError **error) +parse_link (EggDesktopFile *desktop_file, + EggDesktopFile **app_desktop_file, + GSList **documents, + GError **error) { gchar *url; GKeyFile *key_file; @@ -910,12 +912,12 @@ parse_link (EggDesktopFile *desktop_file, } static gchar * -start_startup_notification (GdkDisplay *display, - EggDesktopFile *desktop_file, - const gchar *argv0, - gint screen, - gint workspace, - guint32 launch_time) +start_startup_notification (GdkDisplay *display, + EggDesktopFile *desktop_file, + const gchar *argv0, + gint screen, + gint workspace, + guint32 launch_time) { static gint sequence = 0; gchar *startup_id; @@ -944,15 +946,15 @@ start_startup_notification (GdkDisplay *display, return NULL; } - if (launch_time == (guint32)-1) + if (launch_time == (guint32) - 1) launch_time = gdk_x11_display_get_user_time (display); startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu", g_get_prgname (), - (unsigned long) getpid (), + (gulong) getpid (), g_get_host_name (), argv0, sequence++, - (unsigned long) launch_time); + (gulong) launch_time); description = g_strdup_printf (_("Starting %s"), desktop_file->name); screen_str = g_strdup_printf ("%d", screen); @@ -979,7 +981,7 @@ start_startup_notification (GdkDisplay *display, static void end_startup_notification (GdkDisplay *display, - const gchar *startup_id) + const gchar *startup_id) { gdk_x11_display_broadcast_startup_message (display, "remove", "ID", startup_id, @@ -1008,7 +1010,7 @@ startup_notification_timeout (gpointer data) static void set_startup_notification_timeout (GdkDisplay *display, - const gchar *startup_id) + const gchar *startup_id) { StartupNotificationData *sn_data; @@ -1021,7 +1023,8 @@ set_startup_notification_timeout (GdkDisplay *display, } static GPtrArray * -array_putenv (GPtrArray *env, gchar *variable) +array_putenv (GPtrArray *env, + gchar *variable) { guint i, keylen; @@ -1066,8 +1069,9 @@ array_putenv (GPtrArray *env, gchar *variable) static gboolean egg_desktop_file_launchv (EggDesktopFile *desktop_file, - GSList *documents, va_list args, - GError **error) + GSList *documents, + va_list args, + GError **error) { EggDesktopFileLaunchOption option; GSList *translated_documents = NULL, *docs = NULL; @@ -1082,7 +1086,7 @@ egg_desktop_file_launchv (EggDesktopFile *desktop_file, GdkScreen *screen = NULL; gint workspace = -1; const gchar *directory = NULL; - guint32 launch_time = (guint32)-1; + guint32 launch_time = (guint32) - 1; GSpawnFlags flags = G_SPAWN_SEARCH_PATH; GSpawnChildSetupFunc setup_func = NULL; gpointer setup_data = NULL; @@ -1341,8 +1345,9 @@ egg_desktop_file_launchv (EggDesktopFile *desktop_file, **/ gboolean egg_desktop_file_launch (EggDesktopFile *desktop_file, - GSList *documents, GError **error, - ...) + GSList *documents, + GError **error, + ...) { va_list args; gboolean success; diff --git a/smclient/eggsmclient-xsmp.c b/smclient/eggsmclient-xsmp.c index c643284701..3622d95d89 100644 --- a/smclient/eggsmclient-xsmp.c +++ b/smclient/eggsmclient-xsmp.c @@ -176,7 +176,7 @@ static gboolean process_ice_messages (IceConn ice_conn); static void smc_error_handler (SmcConn smc_conn, Bool swap, gint offending_minor_opcode, - unsigned long offending_sequence, + gulong offending_sequence, gint error_class, gint severity, SmPointer values); @@ -323,7 +323,7 @@ sm_client_xsmp_disconnect (EggSMClientXSMP *xsmp) static void sm_client_xsmp_startup (EggSMClient *client, - const gchar *client_id) + const gchar *client_id) { EggSMClientXSMP *xsmp = (EggSMClientXSMP *) client; SmcCallbacks callbacks; @@ -399,9 +399,9 @@ sm_client_xsmp_startup (EggSMClient *client, } static void -sm_client_xsmp_set_restart_command (EggSMClient *client, - gint argc, - const gchar **argv) +sm_client_xsmp_set_restart_command (EggSMClient *client, + gint argc, + const gchar **argv) { EggSMClientXSMP *xsmp = (EggSMClientXSMP *) client; gint i; @@ -418,7 +418,7 @@ sm_client_xsmp_set_restart_command (EggSMClient *client, static void sm_client_xsmp_will_quit (EggSMClient *client, - gboolean will_quit) + gboolean will_quit) { EggSMClientXSMP *xsmp = (EggSMClientXSMP *) client; @@ -455,9 +455,9 @@ sm_client_xsmp_will_quit (EggSMClient *client, } static gboolean -sm_client_xsmp_end_session (EggSMClient *client, - EggSMClientEndStyle style, - gboolean request_confirmation) +sm_client_xsmp_end_session (EggSMClient *client, + EggSMClientEndStyle style, + gboolean request_confirmation) { EggSMClientXSMP *xsmp = (EggSMClientXSMP *) client; gint save_type; @@ -603,9 +603,10 @@ update_pending_events (EggSMClientXSMP *xsmp) } static void -fix_broken_state (EggSMClientXSMP *xsmp, const gchar *message, - gboolean send_interact_done, - gboolean send_save_yourself_done) +fix_broken_state (EggSMClientXSMP *xsmp, + const gchar *message, + gboolean send_interact_done, + gboolean send_save_yourself_done) { g_warning ("Received XSMP %s message in state %s: client or server error", message, EGG_SM_CLIENT_XSMP_STATE (xsmp)); @@ -626,12 +627,12 @@ fix_broken_state (EggSMClientXSMP *xsmp, const gchar *message, /* SM callbacks */ static void -xsmp_save_yourself (SmcConn smc_conn, - SmPointer client_data, - gint save_type, - Bool shutdown, - gint interact_style, - Bool fast) +xsmp_save_yourself (SmcConn smc_conn, + SmPointer client_data, + gint save_type, + Bool shutdown, + gint interact_style, + Bool fast) { EggSMClientXSMP *xsmp = client_data; gboolean wants_quit_requested; @@ -946,8 +947,8 @@ save_state (EggSMClientXSMP *xsmp) } static void -xsmp_interact (SmcConn smc_conn, - SmPointer client_data) +xsmp_interact (SmcConn smc_conn, + SmPointer client_data) { EggSMClientXSMP *xsmp = client_data; EggSMClient *client = client_data; @@ -966,8 +967,8 @@ xsmp_interact (SmcConn smc_conn, } static void -xsmp_die (SmcConn smc_conn, - SmPointer client_data) +xsmp_die (SmcConn smc_conn, + SmPointer client_data) { EggSMClientXSMP *xsmp = client_data; EggSMClient *client = client_data; @@ -980,8 +981,8 @@ xsmp_die (SmcConn smc_conn, } static void -xsmp_save_complete (SmcConn smc_conn, - SmPointer client_data) +xsmp_save_complete (SmcConn smc_conn, + SmPointer client_data) { EggSMClientXSMP *xsmp = client_data; @@ -995,8 +996,8 @@ xsmp_save_complete (SmcConn smc_conn, } static void -xsmp_shutdown_cancelled (SmcConn smc_conn, - SmPointer client_data) +xsmp_shutdown_cancelled (SmcConn smc_conn, + SmPointer client_data) { EggSMClientXSMP *xsmp = client_data; EggSMClient *client = client_data; @@ -1059,8 +1060,9 @@ xsmp_shutdown_cancelled (SmcConn smc_conn, * then free the array, but not its contents. */ static GPtrArray * -generate_command (gchar **restart_command, const gchar *client_id, - const gchar *state_file) +generate_command (gchar **restart_command, + const gchar *client_id, + const gchar *state_file) { GPtrArray *cmd; gint i; @@ -1091,7 +1093,8 @@ generate_command (gchar **restart_command, const gchar *client_id, * frees them. */ static void -set_properties (EggSMClientXSMP *xsmp, ...) +set_properties (EggSMClientXSMP *xsmp, + ...) { GPtrArray *props; SmProp *prop; @@ -1122,7 +1125,8 @@ set_properties (EggSMClientXSMP *xsmp, ...) /* Takes a NULL-terminated list of property names and deletes them. */ static void -delete_properties (EggSMClientXSMP *xsmp, ...) +delete_properties (EggSMClientXSMP *xsmp, + ...) { GPtrArray *props; gchar *prop; @@ -1149,7 +1153,8 @@ delete_properties (EggSMClientXSMP *xsmp, ...) * until you're done with the SmProp. */ static SmProp * -array_prop (const gchar *name, ...) +array_prop (const gchar *name, + ...) { SmProp *prop; SmPropValue pv; @@ -1184,7 +1189,8 @@ array_prop (const gchar *name, ...) * remain valid until you're done with the SmProp. */ static SmProp * -ptrarray_prop (const gchar *name, GPtrArray *values) +ptrarray_prop (const gchar *name, + GPtrArray *values) { SmProp *prop; SmPropValue pv; @@ -1217,7 +1223,8 @@ ptrarray_prop (const gchar *name, GPtrArray *values) * done with the SmProp. */ static SmProp * -string_prop (const gchar *name, const gchar *value) +string_prop (const gchar *name, + const gchar *value) { SmProp *prop; @@ -1236,7 +1243,8 @@ string_prop (const gchar *name, const gchar *value) /* Takes a gchar and creates a CARD8 property. */ static SmProp * -card8_prop (const gchar *name, guchar value) +card8_prop (const gchar *name, + guchar value) { SmProp *prop; gchar *card8val; @@ -1277,7 +1285,7 @@ card8_prop (const gchar *name, guchar value) static void ice_error_handler (IceConn ice_conn, Bool swap, gint offending_minor_opcode, - unsigned long offending_sequence, + gulong offending_sequence, gint error_class, gint severity, IcePointer values); @@ -1322,18 +1330,18 @@ process_ice_messages (IceConn ice_conn) } static gboolean -ice_iochannel_watch (GIOChannel *channel, - GIOCondition condition, - gpointer client_data) +ice_iochannel_watch (GIOChannel *channel, + GIOCondition condition, + gpointer client_data) { return process_ice_messages (client_data); } static void -ice_connection_watch (IceConn ice_conn, - IcePointer client_data, - Bool opening, - IcePointer *watch_data) +ice_connection_watch (IceConn ice_conn, + IcePointer client_data, + Bool opening, + IcePointer *watch_data) { guint watch_id; @@ -1358,13 +1366,13 @@ ice_connection_watch (IceConn ice_conn, } static void -ice_error_handler (IceConn ice_conn, - Bool swap, - gint offending_minor_opcode, - unsigned long offending_sequence, - gint error_class, - gint severity, - IcePointer values) +ice_error_handler (IceConn ice_conn, + Bool swap, + gint offending_minor_opcode, + gulong offending_sequence, + gint error_class, + gint severity, + IcePointer values) { /* Do nothing */ } @@ -1376,13 +1384,13 @@ ice_io_error_handler (IceConn ice_conn) } static void -smc_error_handler (SmcConn smc_conn, - Bool swap, - gint offending_minor_opcode, - unsigned long offending_sequence, - gint error_class, - gint severity, - SmPointer values) +smc_error_handler (SmcConn smc_conn, + Bool swap, + gint offending_minor_opcode, + gulong offending_sequence, + gint error_class, + gint severity, + SmPointer values) { /* Do nothing */ } diff --git a/smclient/eggsmclient.c b/smclient/eggsmclient.c index bbe352625b..91720c2832 100644 --- a/smclient/eggsmclient.c +++ b/smclient/eggsmclient.c @@ -182,10 +182,10 @@ static gchar *sm_client_id = NULL; static gchar *sm_config_prefix = NULL; static gboolean -sm_client_post_parse_func (GOptionContext *context, - GOptionGroup *group, - gpointer data, - GError **error) +sm_client_post_parse_func (GOptionContext *context, + GOptionGroup *group, + gpointer data, + GError **error) { EggSMClient *client = egg_sm_client_get (); @@ -435,9 +435,9 @@ egg_sm_client_get_state_file (EggSMClient *client) * a list of filenames to open when the application is resumed.) **/ void -egg_sm_client_set_restart_command (EggSMClient *client, - gint argc, - const gchar **argv) +egg_sm_client_set_restart_command (EggSMClient *client, + gint argc, + const gchar **argv) { g_return_if_fail (EGG_IS_SM_CLIENT (client)); @@ -465,7 +465,7 @@ egg_sm_client_set_restart_command (EggSMClient *client, **/ void egg_sm_client_will_quit (EggSMClient *client, - gboolean will_quit) + gboolean will_quit) { g_return_if_fail (EGG_IS_SM_CLIENT (client)); @@ -490,8 +490,8 @@ egg_sm_client_will_quit (EggSMClient *client, * be (eg, because it could not connect to the session manager). **/ gboolean -egg_sm_client_end_session (EggSMClientEndStyle style, - gboolean request_confirmation) +egg_sm_client_end_session (EggSMClientEndStyle style, + gboolean request_confirmation) { EggSMClient *client = egg_sm_client_get (); @@ -576,9 +576,9 @@ egg_sm_client_quit (EggSMClient *client) static void egg_sm_client_debug_handler (const gchar *log_domain, - GLogLevelFlags log_level, - const gchar *message, - gpointer user_data) + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data) { static gint debug = -1; diff --git a/smime/gui/ca-trust-dialog.c b/smime/gui/ca-trust-dialog.c index 887af30277..df2a1f825a 100644 --- a/smime/gui/ca-trust-dialog.c +++ b/smime/gui/ca-trust-dialog.c @@ -54,7 +54,9 @@ free_data (gpointer data) } static void -catd_response (GtkWidget *w, guint id, CATrustDialogData *data) +catd_response (GtkWidget *w, + guint id, + CATrustDialogData *data) { switch (id) { case GTK_RESPONSE_ACCEPT: { @@ -68,8 +70,9 @@ catd_response (GtkWidget *w, guint id, CATrustDialogData *data) } } -GtkWidget* -ca_trust_dialog_show (ECert *cert, gboolean importing) +GtkWidget * +ca_trust_dialog_show (ECert *cert, + gboolean importing) { CATrustDialogData *ctd_data; GtkDialog *dialog; @@ -113,7 +116,10 @@ ca_trust_dialog_show (ECert *cert, gboolean importing) } void -ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboolean objsign) +ca_trust_dialog_set_trust (GtkWidget *widget, + gboolean ssl, + gboolean email, + gboolean objsign) { CATrustDialogData *ctd_data; @@ -127,7 +133,10 @@ ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboo } void -ca_trust_dialog_get_trust (GtkWidget *widget, gboolean *ssl, gboolean *email, gboolean *objsign) +ca_trust_dialog_get_trust (GtkWidget *widget, + gboolean *ssl, + gboolean *email, + gboolean *objsign) { CATrustDialogData *ctd_data; diff --git a/smime/gui/ca-trust-dialog.h b/smime/gui/ca-trust-dialog.h index ec7979d818..8b7d945c00 100644 --- a/smime/gui/ca-trust-dialog.h +++ b/smime/gui/ca-trust-dialog.h @@ -27,7 +27,7 @@ #include <gtk/gtk.h> #include "e-cert.h" -GtkWidget* ca_trust_dialog_show (ECert *cert, gboolean importing); +GtkWidget * ca_trust_dialog_show (ECert *cert, gboolean importing); void ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboolean objsign); void ca_trust_dialog_get_trust (GtkWidget *widget, gboolean *ssl, gboolean *email, gboolean *objsign); diff --git a/smime/gui/cert-trust-dialog.c b/smime/gui/cert-trust-dialog.c index 7c76b01b88..d4d6648b32 100644 --- a/smime/gui/cert-trust-dialog.c +++ b/smime/gui/cert-trust-dialog.c @@ -60,7 +60,9 @@ free_data (gpointer data) } static void -ctd_response (GtkWidget *w, guint id, CertTrustDialogData *data) +ctd_response (GtkWidget *w, + guint id, + CertTrustDialogData *data) { CERTCertTrust trust; CERTCertificate *icert; @@ -109,7 +111,7 @@ ctd_response (GtkWidget *w, guint id, CertTrustDialogData *data) } } -GtkWidget* +GtkWidget * cert_trust_dialog_show (ECert *cert) { CertTrustDialogData *ctd_data; @@ -128,7 +130,7 @@ cert_trust_dialog_show (ECert *cert) ctd_data->label = e_builder_get_widget(ctd_data->builder, "trust-label"); - g_signal_connect(ctd_data->dialog, "response", G_CALLBACK(ctd_response), ctd_data); + g_signal_connect (ctd_data->dialog, "response", G_CALLBACK(ctd_response), ctd_data); g_object_set_data_full (G_OBJECT (ctd_data->dialog), "CertTrustDialogData", ctd_data, free_data); diff --git a/smime/gui/cert-trust-dialog.h b/smime/gui/cert-trust-dialog.h index c4852aac66..20a076b7e9 100644 --- a/smime/gui/cert-trust-dialog.h +++ b/smime/gui/cert-trust-dialog.h @@ -28,7 +28,7 @@ G_BEGIN_DECLS -GtkWidget* cert_trust_dialog_show (ECert *cert); +GtkWidget * cert_trust_dialog_show (ECert *cert); G_END_DECLS diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index 3795c20923..5e23e1d865 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -64,7 +64,7 @@ enum { typedef struct { GType type; const gchar *column_title; - const gchar * (*get_cert_data_func) (ECert *cert); /* Prototype to e_cert_get_* functions */ + const gchar * (*get_cert_data_func) (ECert *cert); /* Prototype to e_cert_get_ * functions */ gboolean visible; /* Default visibility of column */ } CertTreeColumn; @@ -82,7 +82,7 @@ static CertTreeColumn yourcerts_columns[] = { { G_TYPE_STRING, N_("Expires"), e_cert_get_expires_on, TRUE }, { G_TYPE_STRING, N_("SHA1 Fingerprint"), e_cert_get_sha1_fingerprint, FALSE }, { G_TYPE_STRING, N_("MD5 Fingerprint"), e_cert_get_md5_fingerprint, FALSE }, - { G_TYPE_OBJECT, NULL, NULL, FALSE } /* Hidden column for ECert* object */ + { G_TYPE_OBJECT, NULL, NULL, FALSE } /* Hidden column for ECert * object */ }; static const gchar* yourcerts_mime_types[] = { "application/x-x509-user-cert", "application/x-pkcs12", NULL }; @@ -189,7 +189,7 @@ save_treeview_state (GtkTreeView *treeview) tree_name = gtk_widget_get_name (GTK_WIDGET (treeview)); sortable = GTK_TREE_SORTABLE (model); - columns_count = gtk_tree_model_get_n_columns (model) - 1; /* Ignore the last column - the ECert* holder */ + columns_count = gtk_tree_model_get_n_columns (model) - 1; /* Ignore the last column - the ECert * holder */ list = g_new0 (gint, columns_count); for (i = 0; i < columns_count; i++) { @@ -304,7 +304,9 @@ load_treeview_state (GtkTreeView *treeview) } static void -report_and_free_error (CertPage *cp, const gchar *where, GError *error) +report_and_free_error (CertPage *cp, + const gchar *where, + GError *error) { g_return_if_fail (cp != NULL); @@ -409,7 +411,7 @@ treeview_add_column (CertPage *cp, G_CALLBACK (treeview_header_clicked), cp->popup_menu); /* The first column should not be concealable so there's no point in displaying - it in the popup menu */ + * it in the popup menu */ if (column_index == 0) return; @@ -430,7 +432,10 @@ struct find_cert_data { }; static gboolean -find_cert_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) +find_cert_cb (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) { struct find_cert_data *fcd = data; ECert *cert = NULL; @@ -645,9 +650,9 @@ delete_cert (GtkWidget *button, gtk_tree_store_remove (cp->treemodel, &child_iter); /* we need two unrefs here, one to unref the - gtk_tree_model_get above, and one to unref - the initial ref when we created the cert - and added it to the tree */ + * gtk_tree_model_get above, and one to unref + * the initial ref when we created the cert + * and added it to the tree */ g_object_unref (cert); g_object_unref (cert); } @@ -656,7 +661,8 @@ delete_cert (GtkWidget *button, } static void -add_cert (CertPage *cp, ECert *cert) +add_cert (CertPage *cp, + ECert *cert) { GtkTreeIter iter; GtkTreeIter *parent_iter = NULL; @@ -674,7 +680,7 @@ add_cert (CertPage *cp, ECert *cert) 0, organization, -1); /* now copy it off into parent_iter and insert it into - the hashtable */ + * the hashtable */ parent_iter = gtk_tree_iter_copy (&iter); g_hash_table_insert (cp->root_hash, g_strdup (organization), parent_iter); } @@ -746,7 +752,7 @@ load_certs (CertPage *cp) for (node = CERT_LIST_HEAD (certList); !CERT_LIST_END (node, certList); node = CERT_LIST_NEXT (node)) { - ECert *cert = e_cert_new (CERT_DupCertificate ((CERTCertificate*) node->cert)); + ECert *cert = e_cert_new (CERT_DupCertificate ((CERTCertificate *) node->cert)); ECertType ct = e_cert_get_cert_type (cert); /* show everything else in a contact tab */ @@ -920,7 +926,7 @@ cert_manager_config_set_property (GObject *object, case PROP_PREFERENCES_WINDOW: ecmc->priv->pref_window = g_value_get_object (value); /* When the preferences window is "closed" (= hidden), save - state of all treeviews. */ + * state of all treeviews. */ g_signal_connect_swapped (ecmc->priv->pref_window, "hide", G_CALLBACK (cert_manager_config_window_hide), ecmc); return; @@ -1029,7 +1035,7 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc) g_idle_add ((GSourceFunc) populate_ui, ecmc); /* Disconnect cert-manager-notebook from it's window and attach it - to this ECertManagerConfig */ + * to this ECertManagerConfig */ widget = e_builder_get_widget (priv->builder, "cert-manager-notebook"); parent = gtk_widget_get_parent (widget); gtk_container_remove (GTK_CONTAINER (parent), widget); diff --git a/smime/gui/certificate-viewer.c b/smime/gui/certificate-viewer.c index 78a160b707..89f7d1fd8d 100644 --- a/smime/gui/certificate-viewer.c +++ b/smime/gui/certificate-viewer.c @@ -45,7 +45,8 @@ typedef struct { } CertificateViewerData; static void -free_data (gpointer data, GObject *where_the_object_was) +free_data (gpointer data, + GObject *where_the_object_was) { CertificateViewerData *cvm = data; @@ -59,7 +60,8 @@ free_data (gpointer data, GObject *where_the_object_was) #define NOT_PART_OF_CERT_MARKUP "<i><Not part of certificate></i>" static void -fill_in_general (CertificateViewerData *cvm_data, ECert *cert) +fill_in_general (CertificateViewerData *cvm_data, + ECert *cert) { GtkWidget *label; const gchar *text; @@ -149,7 +151,9 @@ fill_in_general (CertificateViewerData *cvm_data, ECert *cert) } static void -populate_fields_tree (CertificateViewerData *cvm_data, EASN1Object *asn1, GtkTreeIter *root) +populate_fields_tree (CertificateViewerData *cvm_data, + EASN1Object *asn1, + GtkTreeIter *root) { GtkTreeIter new_iter; @@ -175,7 +179,8 @@ populate_fields_tree (CertificateViewerData *cvm_data, EASN1Object *asn1, GtkTre } static void -hierarchy_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cvm_data) +hierarchy_selection_changed (GtkTreeSelection *selection, + CertificateViewerData *cvm_data) { GtkTreeIter iter; GtkTreeModel *model; @@ -214,7 +219,8 @@ hierarchy_selection_changed (GtkTreeSelection *selection, CertificateViewerData } static void -fields_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cvm_data) +fields_selection_changed (GtkTreeSelection *selection, + CertificateViewerData *cvm_data) { GtkTreeIter iter; GtkTreeModel *model; @@ -250,7 +256,8 @@ fields_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cv } static void -fill_in_details (CertificateViewerData *cvm_data, ECert *cert) +fill_in_details (CertificateViewerData *cvm_data, + ECert *cert) { GList *l; GtkTreeIter *root = NULL; @@ -283,7 +290,7 @@ fill_in_details (CertificateViewerData *cvm_data, ECert *cert) cvm_data->field_text = e_builder_get_widget (cvm_data->builder, "cert-field-value-textview"); /* set the font of the field value viewer to be some fixed - width font to the hex display doesn't look like ass. */ + * width font to the hex display doesn't look like ass. */ cvm_data->text_tag = gtk_text_buffer_create_tag (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), "mono", "font", "Mono", @@ -313,7 +320,7 @@ fill_in_details (CertificateViewerData *cvm_data, ECert *cert) gtk_tree_view_expand_all (GTK_TREE_VIEW (cvm_data->hierarchy_tree)); } -GtkWidget* +GtkWidget * certificate_viewer_show (ECert *cert) { CertificateViewerData *cvm_data; diff --git a/smime/gui/certificate-viewer.h b/smime/gui/certificate-viewer.h index 6cfa7f63ab..d452b76c2c 100644 --- a/smime/gui/certificate-viewer.h +++ b/smime/gui/certificate-viewer.h @@ -26,6 +26,6 @@ #include <gtk/gtk.h> #include "e-cert.h" -GtkWidget* certificate_viewer_show (ECert *cert); +GtkWidget * certificate_viewer_show (ECert *cert); #endif /* _CERTIFICATE_VIEWER_H_ */ diff --git a/smime/gui/component.c b/smime/gui/component.c index fbd6d75a78..091ebeefe8 100644 --- a/smime/gui/component.c +++ b/smime/gui/component.c @@ -36,7 +36,11 @@ #include "pk11func.h" static gboolean -smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **passwd, gpointer arg) +smime_pk11_passwd (ECertDB *db, + PK11SlotInfo *slot, + gboolean retry, + gchar **passwd, + gpointer arg) { gchar *prompt; gchar *slot_name = g_strdup (PK11_GetSlotName (slot)); @@ -48,7 +52,7 @@ smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **pass *passwd = e_passwords_ask_password (_("Enter password"), NULL, "", prompt, - E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, NULL); g_free (prompt); @@ -58,7 +62,10 @@ smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **pass } static gboolean -smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpointer arg) +smime_pk11_change_passwd (ECertDB *db, + gchar **old_passwd, + gchar **passwd, + gpointer arg) { gchar *prompt; @@ -70,7 +77,7 @@ smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpoin *passwd = e_passwords_ask_password (_("Enter new password"), NULL, "", prompt, - E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, NULL); } else { @@ -83,7 +90,12 @@ smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpoin } static gboolean -smime_confirm_ca_cert_import (ECertDB *db, ECert *cert, gboolean *trust_ssl, gboolean *trust_email, gboolean *trust_objsign, gpointer arg) +smime_confirm_ca_cert_import (ECertDB *db, + ECert *cert, + gboolean *trust_ssl, + gboolean *trust_email, + gboolean *trust_objsign, + gpointer arg) { GtkWidget *dialog = ca_trust_dialog_show (cert, TRUE); gint response; diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c index c88f044e9b..24cc9b374a 100644 --- a/smime/gui/e-cert-selector.c +++ b/smime/gui/e-cert-selector.c @@ -53,14 +53,14 @@ static guint ecs_signals[ECS_LAST_SIGNAL]; G_DEFINE_TYPE (ECertSelector, e_cert_selector, GTK_TYPE_DIALOG) /* (this is what mozilla shows) -Issued to: - Subject: E=notzed@ximian.com, CN=notzed@ximian.com, O=My Company Ltd, L=Adelaide, ST=SA, C=AU - Serial Number: 03 - Valid from 23/10/03 06:35:29 to 22/10/04 06:35:29 - Purposes: Sign,Encrypt -Issued by: - Subject: E=notzed@ximian.com, O=company, L=there, ST=Here, C=AU -*/ + * Issued to: + * Subject: E=notzed@ximian.com, CN=notzed@ximian.com, O=My Company Ltd, L=Adelaide, ST=SA, C=AU + * Serial Number: 03 + * Valid from 23/10/03 06:35:29 to 22/10/04 06:35:29 + * Purposes: Sign,Encrypt + * Issued by: + * Subject: E=notzed@ximian.com, O=company, L=there, ST=Here, C=AU + */ static CERTCertListNode * ecs_find_current (ECertSelector *ecs) @@ -74,7 +74,7 @@ ecs_find_current (ECertSelector *ecs) n = gtk_combo_box_get_active (GTK_COMBO_BOX (p->combobox)); node = CERT_LIST_HEAD (p->certlist); - while (n>0 && !CERT_LIST_END (node, p->certlist)) { + while (n > 0 && !CERT_LIST_END (node, p->certlist)) { n--; node = CERT_LIST_NEXT (node); } @@ -85,7 +85,8 @@ ecs_find_current (ECertSelector *ecs) } static void -e_cert_selector_response (GtkDialog *dialog, gint button) +e_cert_selector_response (GtkDialog *dialog, + gint button) { CERTCertListNode *node; @@ -98,11 +99,12 @@ e_cert_selector_response (GtkDialog *dialog, gint button) break; } - g_signal_emit (dialog, ecs_signals[ECS_SELECTED], 0, node?node->cert->nickname:NULL); + g_signal_emit (dialog, ecs_signals[ECS_SELECTED], 0, node ? node->cert->nickname : NULL); } static void -ecs_cert_changed (GtkWidget *w, ECertSelector *ecs) +ecs_cert_changed (GtkWidget *w, + ECertSelector *ecs) { struct _ECertSelectorPrivate *p = ecs->priv; CERTCertListNode *node; @@ -140,7 +142,8 @@ ecs_cert_changed (GtkWidget *w, ECertSelector *ecs) * Return value: A dialogue to be shown. **/ GtkWidget * -e_cert_selector_new (gint type, const gchar *currentid) +e_cert_selector_new (gint type, + const gchar *currentid) { ECertSelector *ecs; struct _ECertSelectorPrivate *p; @@ -152,7 +155,7 @@ e_cert_selector_new (gint type, const gchar *currentid) GtkWidget *w; GtkListStore *store; GtkTreeIter iter; - gint n=0, active=0; + gint n = 0, active = 0; ecs = g_object_new (e_cert_selector_get_type (), NULL); p = ecs->priv; @@ -189,7 +192,7 @@ e_cert_selector_new (gint type, const gchar *currentid) if (node->cert->nickname || node->cert->emailAddr) { gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, - 0, node->cert->nickname?node->cert->nickname:node->cert->emailAddr, + 0, node->cert->nickname ? node->cert->nickname : node->cert->emailAddr, -1); if (currentid != NULL @@ -226,7 +229,7 @@ e_cert_selector_init (ECertSelector *ecs) } static void -e_cert_selector_finalise (GObject *o) +e_cert_selector_finalize (GObject *o) { ECertSelector *ecs = (ECertSelector *) o; @@ -241,7 +244,7 @@ e_cert_selector_finalise (GObject *o) static void e_cert_selector_class_init (ECertSelectorClass *klass) { - ((GObjectClass *) klass)->finalize = e_cert_selector_finalise; + ((GObjectClass *) klass)->finalize = e_cert_selector_finalize; ((GtkDialogClass *) klass)->response = e_cert_selector_response; ecs_signals[ECS_SELECTED] = diff --git a/smime/lib/e-asn1-object.c b/smime/lib/e-asn1-object.c index a717a6942a..28c3aa7c85 100644 --- a/smime/lib/e-asn1-object.c +++ b/smime/lib/e-asn1-object.c @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* The following is the mozilla license blurb, as the bodies some of - these functions were derived from the mozilla source. */ + * these functions were derived from the mozilla source. */ /* * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -131,14 +131,15 @@ e_asn1_object_get_type (void) /* This function is used to interpret an integer that - was encoded in a DER buffer. This function is used - when converting a DER buffer into a nsIASN1Object - structure. This interprets the buffer in data - as defined by the DER (Distinguised Encoding Rules) of - ASN1. + * was encoded in a DER buffer. This function is used + * when converting a DER buffer into a nsIASN1Object + * structure. This interprets the buffer in data + * as defined by the DER (Distinguised Encoding Rules) of + * ASN1. */ static gint -get_integer_256 (guchar *data, guint nb) +get_integer_256 (guchar *data, + guint nb) { gint val; @@ -163,17 +164,19 @@ get_integer_256 (guchar *data, guint nb) } /* This function is used to retrieve the lenght of a DER encoded - item. It looks to see if this a multibyte length and then - interprets the buffer accordingly to get the actual length value. - This funciton is used mostly while parsing the DER headers. - - A DER encoded item has the following structure: - - <tag><length<data consisting of lenght bytes> -*/ + * item. It looks to see if this a multibyte length and then + * interprets the buffer accordingly to get the actual length value. + * This funciton is used mostly while parsing the DER headers. + * + * A DER encoded item has the following structure: + * + * <tag><length<data consisting of lenght bytes> + */ static guint32 -get_der_item_length (guchar *data, guchar *end, - unsigned long *bytesUsed, gboolean *indefinite) +get_der_item_length (guchar *data, + guchar *end, + gulong *bytesUsed, + gboolean *indefinite) { guchar lbyte = *data++; PRInt32 length = -1; @@ -181,13 +184,13 @@ get_der_item_length (guchar *data, guchar *end, *indefinite = FALSE; if (lbyte >= 0x80) { /* Multibyte length */ - unsigned nb = (unsigned) (lbyte & 0x7f); + guint nb = (guint) (lbyte & 0x7f); if (nb > 4) { return -1; } if (nb > 0) { - if ((data+nb) > end) { + if ((data + nb) > end) { return -1; } length = get_integer_256 (data, nb); @@ -206,9 +209,11 @@ get_der_item_length (guchar *data, guchar *end, } static gboolean -build_from_der (EASN1Object *parent, gchar *data, gchar *end) +build_from_der (EASN1Object *parent, + gchar *data, + gchar *end) { - unsigned long bytesUsed; + gulong bytesUsed; gboolean indefinite; PRInt32 len; PRUint32 type; @@ -219,13 +224,13 @@ build_from_der (EASN1Object *parent, gchar *data, gchar *end) return TRUE; /* - A DER item has the form of |tag|len|data - tag is one byte and describes the type of elment - we are dealing with. - len is a DER encoded gint telling us how long the data is - data is a buffer that is len bytes long and has to be - interpreted according to its type. - */ + * A DER item has the form of |tag|len|data + * tag is one byte and describes the type of elment + * we are dealing with. + * len is a DER encoded gint telling us how long the data is + * data is a buffer that is len bytes long and has to be + * interpreted according to its type. + */ while (data < end) { code = *data; @@ -242,7 +247,7 @@ build_from_der (EASN1Object *parent, gchar *data, gchar *end) (guchar *) data, (guchar *) end, &bytesUsed, &indefinite); data += bytesUsed; - if ((len < 0) || ((data+len) > end)) + if ((len < 0) || ((data + len) > end)) return FALSE; if (code & SEC_ASN1_CONSTRUCTED) { @@ -292,8 +297,9 @@ build_from_der (EASN1Object *parent, gchar *data, gchar *end) return TRUE; } -EASN1Object* -e_asn1_object_new_from_der (gchar *data, guint32 len) +EASN1Object * +e_asn1_object_new_from_der (gchar *data, + guint32 len) { EASN1Object *obj = g_object_new (E_TYPE_ASN1_OBJECT, NULL); @@ -305,14 +311,15 @@ e_asn1_object_new_from_der (gchar *data, guint32 len) return obj; } -EASN1Object* +EASN1Object * e_asn1_object_new (void) { return E_ASN1_OBJECT (g_object_new (E_TYPE_ASN1_OBJECT, NULL)); } void -e_asn1_object_set_valid_container (EASN1Object *obj, gboolean flag) +e_asn1_object_set_valid_container (EASN1Object *obj, + gboolean flag) { obj->priv->valid_container = flag; } @@ -335,7 +342,7 @@ e_asn1_object_get_asn1_tag (EASN1Object *obj) return obj->priv->tag; } -GList* +GList * e_asn1_object_get_children (EASN1Object *obj) { GList *children = g_list_copy (obj->priv->children); @@ -346,14 +353,16 @@ e_asn1_object_get_children (EASN1Object *obj) } void -e_asn1_object_append_child (EASN1Object *parent, EASN1Object *child) +e_asn1_object_append_child (EASN1Object *parent, + EASN1Object *child) { parent->priv->children = g_list_append ( parent->priv->children, g_object_ref (child)); } void -e_asn1_object_set_display_name (EASN1Object *obj, const gchar *name) +e_asn1_object_set_display_name (EASN1Object *obj, + const gchar *name) { g_free (obj->priv->display_name); obj->priv->display_name = g_strdup (name); @@ -366,7 +375,8 @@ e_asn1_object_get_display_name (EASN1Object *obj) } void -e_asn1_object_set_display_value (EASN1Object *obj, const gchar *value) +e_asn1_object_set_display_value (EASN1Object *obj, + const gchar *value) { g_free (obj->priv->value); obj->priv->value = g_strdup (value); @@ -379,7 +389,9 @@ e_asn1_object_get_display_value (EASN1Object *obj) } void -e_asn1_object_get_data (EASN1Object *obj, gchar **data, guint32 *len) +e_asn1_object_get_data (EASN1Object *obj, + gchar **data, + guint32 *len) { *data = obj->priv->data; *len = obj->priv->data_len; diff --git a/smime/lib/e-cert-db.c b/smime/lib/e-cert-db.c index a5fbbbed23..7fdd20f6e7 100644 --- a/smime/lib/e-cert-db.c +++ b/smime/lib/e-cert-db.c @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* The following is the mozilla license blurb, as the bodies some of - these functions were derived from the mozilla source. */ + * these functions were derived from the mozilla source. */ /* e-cert-db.c * * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -315,7 +315,9 @@ set_nss_error (GError **error) } static SECStatus PR_CALLBACK -collect_certs (gpointer arg, SECItem **certs, gint numcerts) +collect_certs (gpointer arg, + SECItem **certs, + gint numcerts) { CERTDERCerts *collectArgs; SECItem *cert; @@ -342,10 +344,10 @@ collect_certs (gpointer arg, SECItem **certs, gint numcerts) return (SECSuccess); } -static CERTDERCerts* +static CERTDERCerts * e_cert_db_get_certs_from_package (PRArenaPool *arena, - gchar *data, - guint32 length) + gchar *data, + guint32 length) { /*nsNSSShutDownPreventionLock locker;*/ CERTDERCerts *collectArgs = @@ -386,19 +388,21 @@ e_cert_db_dispose (GObject *object) #ifdef notyet PRBool ucs2_ascii_conversion_fn (PRBool toUnicode, - guchar *inBuf, - guint inBufLen, - guchar *outBuf, - guint maxOutBufLen, - guint *outBufLen, - PRBool swapBytes) + guchar *inBuf, + guint inBufLen, + guchar *outBuf, + guint maxOutBufLen, + guint *outBufLen, + PRBool swapBytes) { printf ("in ucs2_ascii_conversion_fn\n"); } #endif static gchar * PR_CALLBACK -pk11_password (PK11SlotInfo* slot, PRBool retry, gpointer arg) +pk11_password (PK11SlotInfo *slot, + PRBool retry, + gpointer arg) { gchar *pwd; gchar *nsspwd; @@ -497,9 +501,9 @@ install_loadable_roots (void) if (!RootsModule) { #ifndef G_OS_WIN32 /* grovel in various places for mozilla's built-in - cert module. - - XXX yes this is gross. *sigh* + * cert module. + * + * XXX yes this is gross. *sigh * */ const gchar *paths_to_check[] = { #ifdef MOZILLA_NSS_LIB_DIR @@ -617,7 +621,7 @@ e_cert_db_get_type (void) GStaticMutex init_mutex = G_STATIC_MUTEX_INIT; static ECertDB *cert_db = NULL; -ECertDB* +ECertDB * e_cert_db_peek (void) { g_static_mutex_lock (&init_mutex); @@ -635,10 +639,10 @@ e_cert_db_shutdown (void) } /* searching for certificates */ -ECert* +ECert * e_cert_db_find_cert_by_nickname (ECertDB *certdb, - const gchar *nickname, - GError **error) + const gchar *nickname, + GError **error) { /* nsNSSShutDownPreventionLock locker;*/ CERTCertificate *cert = NULL; @@ -661,16 +665,16 @@ e_cert_db_find_cert_by_nickname (ECertDB *certdb, } #ifdef notyet -ECert* +ECert * e_cert_db_find_cert_by_key (ECertDB *certdb, - const gchar *db_key, - GError **error) + const gchar *db_key, + GError **error) { /* nsNSSShutDownPreventionLock locker;*/ SECItem keyItem = {siBuffer, NULL, 0}; SECItem *dummy; CERTIssuerAndSN issuerSN; - unsigned long moduleID,slotID; + gulong moduleID,slotID; CERTCertificate *cert; if (!db_key) { @@ -686,10 +690,10 @@ e_cert_db_find_cert_by_key (ECertDB *certdb, slotID = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG]); /* build the issuer/SN structure*/ - issuerSN.serialNumber.len = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG*2]); - issuerSN.derIssuer.len = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG*3]); - issuerSN.serialNumber.data= &keyItem.data[NS_NSS_LONG*4]; - issuerSN.derIssuer.data= &keyItem.data[NS_NSS_LONG*4+ + issuerSN.serialNumber.len = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG *2]); + issuerSN.derIssuer.len = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG *3]); + issuerSN.serialNumber.data= &keyItem.data[NS_NSS_LONG *4]; + issuerSN.derIssuer.data= &keyItem.data[NS_NSS_LONG *4+ issuerSN.serialNumber.len]; cert = CERT_FindCertByIssuerAndSN (CERT_GetDefaultCertDB (), &issuerSN); @@ -703,32 +707,32 @@ e_cert_db_find_cert_by_key (ECertDB *certdb, return NULL; } -GList* -e_cert_db_get_cert_nicknames (ECertDB *certdb, - ECertType cert_type, - GError **error) +GList * +e_cert_db_get_cert_nicknames (ECertDB *certdb, + ECertType cert_type, + GError **error) { } -ECert* +ECert * e_cert_db_find_email_encryption_cert (ECertDB *certdb, - const gchar *nickname, - GError **error) + const gchar *nickname, + GError **error) { } -ECert* +ECert * e_cert_db_find_email_signing_cert (ECertDB *certdb, - const gchar *nickname, - GError **error) + const gchar *nickname, + GError **error) { } #endif -ECert* +ECert * e_cert_db_find_cert_by_email_address (ECertDB *certdb, - const gchar *email, - GError **error) + const gchar *email, + GError **error) { /* nsNSSShutDownPreventionLock locker; */ ECert *cert; @@ -803,7 +807,9 @@ confirm_download_ca_cert (ECertDB *cert_db, } static gboolean -handle_ca_cert_download (ECertDB *cert_db, GList *certs, GError **error) +handle_ca_cert_download (ECertDB *cert_db, + GList *certs, + GError **error) { ECert *certToShow; SECItem der; @@ -811,18 +817,18 @@ handle_ca_cert_download (ECertDB *cert_db, GList *certs, GError **error) CERTCertificate *tmpCert; /* First thing we have to do is figure out which certificate - we're gonna present to the user. The CA may have sent down - a list of certs which may or may not be a chained list of - certs. Until the day we can design some solid UI for the - general case, we'll code to the > 90% case. That case is - where a CA sends down a list that is a chain up to its root - in either ascending or descending order. What we're gonna - do is compare the first 2 entries, if the first was signed - by the second, we assume the leaf cert is the first cert - and display it. If the second cert was signed by the first - cert, then we assume the first cert is the root and the - last cert in the array is the leaf. In this case we - display the last cert. + * we're gonna present to the user. The CA may have sent down + * a list of certs which may or may not be a chained list of + * certs. Until the day we can design some solid UI for the + * general case, we'll code to the > 90% case. That case is + * where a CA sends down a list that is a chain up to its root + * in either ascending or descending order. What we're gonna + * do is compare the first 2 entries, if the first was signed + * by the second, we assume the leaf cert is the first cert + * and display it. If the second cert was signed by the first + * cert, then we assume the first cert is the root and the + * last cert in the array is the leaf. In this case we + * display the last cert. */ /* nsNSSShutDownPreventionLock locker;*/ @@ -855,17 +861,17 @@ handle_ca_cert_download (ECertDB *cert_db, GList *certs, GError **error) if (!strcmp (cert1IssuerName, cert0SubjectName)) { /* In this case, the first cert in the list signed the second, - so the first cert is the root. Let's display the last cert - in the list. */ + * so the first cert is the root. Let's display the last cert + * in the list. */ certToShow = E_CERT (g_list_last (certs)->data); } else if (!strcmp (cert0IssuerName, cert1SubjectName)) { /* In this case the second cert has signed the first cert. The - first cert is the leaf, so let's display it. */ + * first cert is the leaf, so let's display it. */ certToShow = cert0; } else { /* It's not a chain, so let's just show the first one in the - downloaded list. */ + * downloaded list. */ certToShow = cert0; } } @@ -967,17 +973,17 @@ handle_ca_cert_download (ECertDB *cert_db, GList *certs, GError **error) #if 0 /* Now it's time to add the rest of the certs we just downloaded. - Since we didn't prompt the user about any of these certs, we - won't set any trust bits for them. */ + * Since we didn't prompt the user about any of these certs, we + * won't set any trust bits for them. */ e_cert_trust_init (&trust); e_cert_trust_set_valid_ca (&trust); e_cert_trusts_add_ca_trust (&trust, 0, 0, 0); - for (PRUint32 i=0; i<numCerts; i++) { + for (PRUint32 i = 0; i < numCerts; i++) { if (i == selCertIndex) continue; certToShow = do_QueryElementAt (x509Certs, i); - certToShow->GetRawDER (&der.len, (PRUint8 **)&der.data); + certToShow->GetRawDER (&der.len, (PRUint8 **) &der.data); CERTCertificate *tmpCert2 = CERT_NewTempCertificate (certdb, &der, nsnull, PR_FALSE, PR_TRUE); @@ -1019,10 +1025,10 @@ gboolean e_cert_db_change_cert_trust (CERTCertificate *cert, CERTCertTrust *trus /* deleting certificates */ gboolean e_cert_db_delete_cert (ECertDB *certdb, - ECert *ecert) + ECert *ecert) { /* nsNSSShutDownPreventionLock locker; - nsNSSCertificate *nssCert = NS_STATIC_CAST (nsNSSCertificate*, aCert); */ + * nsNSSCertificate *nssCert = NS_STATIC_CAST (nsNSSCertificate *, aCert); */ CERTCertificate *cert; @@ -1051,10 +1057,11 @@ e_cert_db_delete_cert (ECertDB *certdb, /* importing certificates */ gboolean e_cert_db_import_certs (ECertDB *certdb, - gchar *data, guint32 length, - ECertType cert_type, - GSList **imported_certs, - GError **error) + gchar *data, + guint32 length, + ECertType cert_type, + GSList **imported_certs, + GError **error) { /*nsNSSShutDownPreventionLock locker;*/ PRArenaPool *arena = PORT_NewArena (DER_DEFAULT_CHUNKSIZE); @@ -1070,7 +1077,7 @@ e_cert_db_import_certs (ECertDB *certdb, } /* Now let's create some certs to work with */ - for (i=0; i<certCollection->numcerts; i++) { + for (i = 0; i < certCollection->numcerts; i++) { SECItem *currItem = &certCollection->rawCerts[i]; ECert *cert; @@ -1117,9 +1124,10 @@ e_cert_db_import_certs (ECertDB *certdb, gboolean e_cert_db_import_email_cert (ECertDB *certdb, - gchar *data, guint32 length, - GSList **imported_certs, - GError **error) + gchar *data, + guint32 length, + GSList **imported_certs, + GError **error) { /*nsNSSShutDownPreventionLock locker;*/ SECStatus srv = SECFailure; @@ -1198,9 +1206,9 @@ default_nickname (CERTCertificate *cert) gchar *nickname = NULL; gchar *tmp = NULL; gint count; - const gchar *nickFmt=NULL; + const gchar *nickFmt = NULL; CERTCertificate *dummycert; - PK11SlotInfo *slot=NULL; + PK11SlotInfo *slot = NULL; CK_OBJECT_HANDLE keyHandle; CERTCertDBHandle *defaultcertdb = CERT_GetDefaultCertDB (); @@ -1316,8 +1324,9 @@ default_nickname (CERTCertificate *cert) gboolean e_cert_db_import_user_cert (ECertDB *certdb, - gchar *data, guint32 length, - GError **error) + gchar *data, + guint32 length, + GError **error) { /* nsNSSShutDownPreventionLock locker;*/ PK11SlotInfo *slot; @@ -1327,7 +1336,7 @@ e_cert_db_import_user_cert (ECertDB *certdb, SECItem *CACerts; CERTDERCerts * collectArgs; PRArenaPool *arena; - CERTCertificate * cert=NULL; + CERTCertificate * cert = NULL; arena = PORT_NewArena (DER_DEFAULT_CHUNKSIZE); if (arena == NULL) { @@ -1376,7 +1385,7 @@ e_cert_db_import_user_cert (ECertDB *certdb, numCACerts = collectArgs->numcerts - 1; if (numCACerts) { - CACerts = collectArgs->rawCerts+1; + CACerts = collectArgs->rawCerts + 1; if (!CERT_ImportCAChain (CACerts, numCACerts, certUsageUserCertImport)) { rv = TRUE; } @@ -1394,21 +1403,22 @@ e_cert_db_import_user_cert (ECertDB *certdb, gboolean e_cert_db_import_server_cert (ECertDB *certdb, - gchar *data, guint32 length, - GSList **imported_certs, - GError **error) + gchar *data, + guint32 length, + GSList **imported_certs, + GError **error) { /* not c&p'ing this over at the moment, as we don't have a UI - for server certs anyway */ + * for server certs anyway */ return FALSE; } gboolean e_cert_db_import_certs_from_file (ECertDB *cert_db, - const gchar *file_path, - ECertType cert_type, - GSList **imported_certs, - GError **error) + const gchar *file_path, + ECertType cert_type, + GSList **imported_certs, + GError **error) { gboolean rv; gint fd; @@ -1429,7 +1439,7 @@ e_cert_db_import_certs_from_file (ECertDB *cert_db, return FALSE; } - fd = g_open (file_path, O_RDONLY|O_BINARY, 0); + fd = g_open (file_path, O_RDONLY | O_BINARY, 0); if (fd == -1) { set_nss_error (error); return FALSE; @@ -1484,8 +1494,8 @@ e_cert_db_import_certs_from_file (ECertDB *cert_db, gboolean e_cert_db_import_pkcs12_file (ECertDB *cert_db, - const gchar *file_path, - GError **error) + const gchar *file_path, + GError **error) { EPKCS12 *pkcs12 = e_pkcs12_new (); GError *e = NULL; @@ -1501,16 +1511,16 @@ e_cert_db_import_pkcs12_file (ECertDB *cert_db, #ifdef notyet gboolean e_cert_db_export_pkcs12_file (ECertDB *cert_db, - const gchar *file_path, - GList *certs, - GError **error) + const gchar *file_path, + GList *certs, + GError **error) { } #endif gboolean e_cert_db_login_to_slot (ECertDB *cert_db, - PK11SlotInfo *slot) + PK11SlotInfo *slot) { if (PK11_NeedLogin (slot)) { PK11_Logout (slot); diff --git a/smime/lib/e-cert-db.h b/smime/lib/e-cert-db.h index 6e1bc5a7c5..26d0a25c2a 100644 --- a/smime/lib/e-cert-db.h +++ b/smime/lib/e-cert-db.h @@ -66,34 +66,34 @@ struct _ECertDBClass { GType e_cert_db_get_type (void); /* single instance */ -ECertDB* e_cert_db_peek (void); +ECertDB * e_cert_db_peek (void); void e_cert_db_shutdown (void); /* searching for certificates */ -ECert* e_cert_db_find_cert_by_nickname (ECertDB *certdb, +ECert * e_cert_db_find_cert_by_nickname (ECertDB *certdb, const gchar *nickname, GError **error); #ifdef notyet -ECert* e_cert_db_find_cert_by_key (ECertDB *certdb, +ECert * e_cert_db_find_cert_by_key (ECertDB *certdb, const gchar *db_key, GError **error); -GList* e_cert_db_get_cert_nicknames (ECertDB *certdb, +GList * e_cert_db_get_cert_nicknames (ECertDB *certdb, ECertType cert_type, GError **error); -ECert* e_cert_db_find_email_encryption_cert (ECertDB *certdb, +ECert * e_cert_db_find_email_encryption_cert (ECertDB *certdb, const gchar *nickname, GError **error); -ECert* e_cert_db_find_email_signing_cert (ECertDB *certdb, +ECert * e_cert_db_find_email_signing_cert (ECertDB *certdb, const gchar *nickname, GError **error); #endif -ECert* e_cert_db_find_cert_by_email_address (ECertDB *certdb, +ECert * e_cert_db_find_cert_by_email_address (ECertDB *certdb, const gchar *nickname, GError **error); diff --git a/smime/lib/e-cert-trust.c b/smime/lib/e-cert-trust.c index 5bb13318a8..e1c7124e41 100644 --- a/smime/lib/e-cert-trust.c +++ b/smime/lib/e-cert-trust.c @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* The following is the mozilla license blurb, as the bodies some of - these functions were derived from the mozilla source. */ + * these functions were derived from the mozilla source. */ /* * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -442,13 +442,15 @@ e_cert_trust_has_trusted_peer (CERTCertTrust *trust, } void -e_cert_trust_add_trust (guint *t, guint v) +e_cert_trust_add_trust (guint *t, + guint v) { *t |= v; } PRBool -e_cert_trust_has_trust (guint t, guint v) +e_cert_trust_has_trust (guint t, + guint v) { return (t & v); } diff --git a/smime/lib/e-cert.c b/smime/lib/e-cert.c index 6d00ffb20c..e7aecc10c8 100644 --- a/smime/lib/e-cert.c +++ b/smime/lib/e-cert.c @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* The following is the mozilla license blurb, as the bodies some of - these functions were derived from the mozilla source. */ + * these functions were derived from the mozilla source. */ /* * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -59,7 +59,7 @@ struct _ECertPrivate { CERTCertificate *cert; /* pointers we cache since the nss implementation allocs the - string */ + * string */ gchar *org_name; gchar *org_unit_name; gchar *cn; @@ -134,8 +134,8 @@ e_cert_dispose (GObject *object) PK11_DeleteTokenCertAndKey (ec->priv->cert, NULL); } else if (!PK11_IsReadOnly (ec->priv->cert->slot)) { /* If the list of built-ins does contain a non-removable - copy of this certificate, our call will not remove - the certificate permanently, but rather remove all trust. */ + * copy of this certificate, our call will not remove + * the certificate permanently, but rather remove all trust. */ SEC_DeletePermCertificate (ec->priv->cert); } } @@ -258,7 +258,7 @@ e_cert_populate (ECert *cert) cert->priv->md5_fingerprint = CERT_Hexify (&fpItem, TRUE); } -ECert* +ECert * e_cert_new (CERTCertificate *cert) { ECert *ecert = E_CERT (g_object_new (E_TYPE_CERT, NULL)); @@ -271,8 +271,9 @@ e_cert_new (CERTCertificate *cert) return ecert; } -ECert* -e_cert_new_from_der (gchar *data, guint32 len) +ECert * +e_cert_new_from_der (gchar *data, + guint32 len) { CERTCertificate *cert = CERT_DecodeCertFromPackage (data, len); @@ -287,7 +288,7 @@ e_cert_new_from_der (gchar *data, guint32 len) -CERTCertificate* +CERTCertificate * e_cert_get_internal_cert (ECert *cert) { /* XXX should this refcnt it? */ @@ -295,11 +296,13 @@ e_cert_get_internal_cert (ECert *cert) } gboolean -e_cert_get_raw_der (ECert *cert, gchar **data, guint32 *len) +e_cert_get_raw_der (ECert *cert, + gchar **data, + guint32 *len) { /* XXX do we really need to check if cert->priv->cert is NULL - here? it should always be non-null if we have the - ECert.. */ + * here? it should always be non - null if we have the + * ECert.. */ if (cert->priv->cert) { *data = (gchar *)cert->priv->cert->derCert.data; *len = (guint32)cert->priv->cert->derCert.len; @@ -312,7 +315,7 @@ e_cert_get_raw_der (ECert *cert, gchar **data, guint32 *len) } const gchar * -e_cert_get_window_title (ECert *cert) +e_cert_get_window_title (ECert *cert) { if (cert->priv->cert->nickname) return cert->priv->cert->nickname; @@ -329,13 +332,13 @@ e_cert_get_nickname (ECert *cert) } const gchar * -e_cert_get_email (ECert *cert) +e_cert_get_email (ECert *cert) { return cert->priv->cert->emailAddr; } const gchar * -e_cert_get_org (ECert *cert) +e_cert_get_org (ECert *cert) { return cert->priv->org_name; } @@ -347,7 +350,7 @@ e_cert_get_org_unit (ECert *cert) } const gchar * -e_cert_get_cn (ECert *cert) +e_cert_get_cn (ECert *cert) { return cert->priv->cn; } @@ -383,7 +386,7 @@ e_cert_get_subject_name (ECert *cert) } PRTime -e_cert_get_issued_on_time (ECert *cert) +e_cert_get_issued_on_time (ECert *cert) { return cert->priv->issued_on; } @@ -395,7 +398,7 @@ e_cert_get_issued_on (ECert *cert) } PRTime -e_cert_get_expires_on_time (ECert *cert) +e_cert_get_expires_on_time (ECert *cert) { return cert->priv->expires_on; } @@ -451,12 +454,12 @@ e_cert_get_sha1_fingerprint (ECert *cert) } const gchar * -e_cert_get_md5_fingerprint (ECert *cert) +e_cert_get_md5_fingerprint (ECert *cert) { return cert->priv->md5_fingerprint; } -GList* +GList * e_cert_get_chain (ECert *ecert) { GList *l = NULL; @@ -506,7 +509,7 @@ e_cert_get_ca_cert (ECert *ecert) static gboolean get_int_value (SECItem *versionItem, - unsigned long *version) + gulong *version) { SECStatus srv; srv = SEC_ASN1DecodeInteger (versionItem,version); @@ -518,11 +521,11 @@ get_int_value (SECItem *versionItem, } static gboolean -process_version (SECItem *versionItem, - EASN1Object **retItem) +process_version (SECItem *versionItem, + EASN1Object **retItem) { EASN1Object *item = e_asn1_object_new (); - unsigned long version; + gulong version; e_asn1_object_set_display_name (item, _("Version")); @@ -533,7 +536,7 @@ process_version (SECItem *versionItem, return FALSE; } else { /* If there is no version present in the cert, then rfc2459 - says we default to v1 (0) */ + * says we default to v1 (0) */ version = 0; } @@ -557,8 +560,8 @@ process_version (SECItem *versionItem, } static gboolean -process_serial_number_der (SECItem *serialItem, - EASN1Object **retItem) +process_serial_number_der (SECItem *serialItem, + EASN1Object **retItem) { gchar *serialNumber; EASN1Object *item = e_asn1_object_new (); @@ -576,13 +579,13 @@ process_serial_number_der (SECItem *serialItem, static gboolean get_default_oid_format (SECItem *oid, - gchar **text) + gchar **text) { gchar buf[300]; guint len; gint written; - unsigned long val = oid->data[0]; + gulong val = oid->data[0]; guint i = val % 40; val /= 40; written = PR_snprintf(buf, 300, "%lu %u ", val, i); @@ -593,13 +596,13 @@ get_default_oid_format (SECItem *oid, val = 0; for (i = 1; i < oid->len; ++i) { /* In this loop, we have to parse a DER formatted - If the first bit is a 1, then the integer is - represented by more than one byte. If the - first bit is set then we continue on and add - the values of the later bytes until we get - a byte without the first bit set. + * If the first bit is a 1, then the integer is + * represented by more than one byte. If the + * first bit is set then we continue on and add + * the values of the later bytes until we get + * a byte without the first bit set. */ - unsigned long j; + gulong j; j = oid->data[i]; val = (val << 7) | (j & 0x7f); @@ -620,7 +623,8 @@ get_default_oid_format (SECItem *oid, } static gboolean -get_oid_text (SECItem *oid, gchar **text) +get_oid_text (SECItem *oid, + gchar **text) { SECOidTag oidTag = SECOID_FindOIDTag (oid); gchar *temp; @@ -699,22 +703,23 @@ get_oid_text (SECItem *oid, gchar **text) } static gboolean -process_raw_bytes (SECItem *data, gchar **text) +process_raw_bytes (SECItem *data, + gchar **text) { /* This function is used to display some DER bytes - that we have not added support for decoding. - It prints the value of the byte out into a - string that can later be displayed as a byte - string. We place a new line after 24 bytes - to break up extermaly long sequence of bytes. + * that we have not added support for decoding. + * It prints the value of the byte out into a + * string that can later be displayed as a byte + * string. We place a new line after 24 bytes + * to break up extermaly long sequence of bytes. */ GString *str = g_string_new (""); PRUint32 i; gchar buffer[5]; - for (i=0; i<data->len; i++) { + for (i = 0; i < data->len; i++) { PR_snprintf(buffer, 5, "%02x ", data->data[i]); g_string_append (str, buffer); - if ((i+1)%16 == 0) { + if ((i + 1) % 16 == 0) { g_string_append (str, "\n"); } } @@ -723,8 +728,8 @@ process_raw_bytes (SECItem *data, gchar **text) } static gboolean -process_sec_algorithm_id (SECAlgorithmID *algID, - EASN1Object **retSequence) +process_sec_algorithm_id (SECAlgorithmID *algID, + EASN1Object **retSequence) { EASN1Object *sequence = e_asn1_object_new (); gchar *text; @@ -763,7 +768,7 @@ process_sec_algorithm_id (SECAlgorithmID *algID, static gboolean process_subject_public_key_info (CERTSubjectPublicKeyInfo *spki, - EASN1Object *parentSequence) + EASN1Object *parentSequence) { EASN1Object *spkiSequence = e_asn1_object_new (); EASN1Object *sequenceItem; @@ -781,8 +786,8 @@ process_subject_public_key_info (CERTSubjectPublicKeyInfo *spki, e_asn1_object_append_child (spkiSequence, sequenceItem); /* The subjectPublicKey field is encoded as a bit string. - ProcessRawBytes expects the lenght to be in bytes, so - let's convert the lenght into a temporary SECItem. + * ProcessRawBytes expects the lenght to be in bytes, so + * let's convert the lenght into a temporary SECItem. */ data.data = spki->subjectPublicKey.data; data.len = spki->subjectPublicKey.len / 8; @@ -802,8 +807,8 @@ process_subject_public_key_info (CERTSubjectPublicKeyInfo *spki, } static gboolean -process_ns_cert_type_extensions (SECItem *extData, - GString *text) +process_ns_cert_type_extensions (SECItem *extData, + GString *text) { SECItem decoded; guchar nsCertType; @@ -852,7 +857,8 @@ process_ns_cert_type_extensions (SECItem *extData, } static gboolean -process_key_usage_extensions (SECItem *extData, GString *text) +process_key_usage_extensions (SECItem *extData, + GString *text) { SECItem decoded; guchar keyUsage; @@ -901,8 +907,9 @@ process_key_usage_extensions (SECItem *extData, GString *text) } static gboolean -process_extension_data (SECOidTag oidTag, SECItem *extData, - GString *str) +process_extension_data (SECOidTag oidTag, + SECItem *extData, + GString *str) { gboolean rv; switch (oidTag) { @@ -925,7 +932,7 @@ process_extension_data (SECOidTag oidTag, SECItem *extData, static gboolean process_single_extension (CERTCertExtension *extension, - EASN1Object **retExtension) + EASN1Object **retExtension) { GString *str = g_string_new (""); gchar *text; @@ -962,14 +969,14 @@ process_single_extension (CERTCertExtension *extension, static gboolean process_extensions (CERTCertExtension **extensions, - EASN1Object *parentSequence) + EASN1Object *parentSequence) { EASN1Object *extensionSequence = e_asn1_object_new (); PRInt32 i; e_asn1_object_set_display_name (extensionSequence, _("Extensions")); - for (i=0; extensions[i] != NULL; i++) { + for (i = 0; extensions[i] != NULL; i++) { EASN1Object *newExtension; if (!process_single_extension (extensions[i], @@ -983,12 +990,13 @@ process_extensions (CERTCertExtension **extensions, } static gboolean -process_name (CERTName *name, gchar **value) +process_name (CERTName *name, + gchar **value) { - CERTRDN** rdns; - CERTRDN** rdn; - CERTAVA** avas; - CERTAVA* ava; + CERTRDN ** rdns; + CERTRDN ** rdn; + CERTAVA ** avas; + CERTAVA * ava; SECItem *decodeItem = NULL; GString *final_string = g_string_new (""); @@ -1057,7 +1065,8 @@ process_name (CERTName *name, gchar **value) } static gboolean -create_tbs_certificate_asn1_struct (ECert *cert, EASN1Object **seq) +create_tbs_certificate_asn1_struct (ECert *cert, + EASN1Object **seq) { /* ** TBSCertificate ::= SEQUENCE { @@ -1113,14 +1122,14 @@ create_tbs_certificate_asn1_struct (ECert *cert, EASN1Object **seq) g_object_unref (subitem); #ifdef notyet - nsCOMPtr<nsIASN1Sequence> validitySequence = new nsNSSASN1Sequence (); + nsCOMPtr < nsIASN1Sequence> validitySequence = new nsNSSASN1Sequence (); nssComponent->GetPIPNSSBundleString(NS_LITERAL_STRING("CertDumpValidity").get(), text); validitySequence->SetDisplayName (text); asn1Objects->AppendElement (validitySequence, PR_FALSE); nssComponent->GetPIPNSSBundleString(NS_LITERAL_STRING("CertDumpNotBefore").get(), text); - nsCOMPtr<nsIX509CertValidity> validityData; + nsCOMPtr < nsIX509CertValidity> validityData; GetValidity (getter_AddRefs (validityData)); PRTime notBefore, notAfter; @@ -1154,9 +1163,9 @@ create_tbs_certificate_asn1_struct (ECert *cert, EASN1Object **seq) /* Is there an issuerUniqueID? */ if (cert->priv->cert->issuerID.data) { /* The issuerID is encoded as a bit string. - The function ProcessRawBytes expects the - length to be in bytes, so let's convert the - length in a temporary SECItem + * The function ProcessRawBytes expects the + * length to be in bytes, so let's convert the + * length in a temporary SECItem */ data.data = cert->priv->cert->issuerID.data; data.len = cert->priv->cert->issuerID.len / 8; @@ -1173,9 +1182,9 @@ create_tbs_certificate_asn1_struct (ECert *cert, EASN1Object **seq) if (cert->priv->cert->subjectID.data) { /* The subjectID is encoded as a bit string. - The function ProcessRawBytes expects the - length to be in bytes, so let's convert the - length in a temporary SECItem + * The function ProcessRawBytes expects the + * length to be in bytes, so let's convert the + * length in a temporary SECItem */ data.data = cert->priv->cert->issuerID.data; data.len = cert->priv->cert->issuerID.len / 8; @@ -1211,7 +1220,7 @@ create_asn1_struct (ECert *cert) e_asn1_object_set_display_name (cert->priv->asn1, e_cert_get_window_title (cert)); /* This sequence will be contain the tbsCertificate, signatureAlgorithm, - and signatureValue. */ + * and signatureValue. */ if (!create_tbs_certificate_asn1_struct (cert, &sequence)) return FALSE; @@ -1231,9 +1240,9 @@ create_asn1_struct (ECert *cert) sequence, _("Certificate Signature Value")); /* The signatureWrap is encoded as a bit string. - The function ProcessRawBytes expects the - length to be in bytes, so let's convert the - length in a temporary SECItem */ + * The function ProcessRawBytes expects the + * length to be in bytes, so let's convert the + * length in a temporary SECItem */ temp.data = cert->priv->cert->signatureWrap.signature.data; temp.len = cert->priv->cert->signatureWrap.signature.len / 8; process_raw_bytes (&temp, &text); @@ -1244,7 +1253,7 @@ create_asn1_struct (ECert *cert) return TRUE; } -EASN1Object* +EASN1Object * e_cert_get_asn1_struct (ECert *cert) { if (!cert->priv->asn1) @@ -1260,7 +1269,7 @@ e_cert_mark_for_deletion (ECert *cert) #if 0 /* make sure user is logged in to the token */ - nsCOMPtr<nsIInterfaceRequestor> ctx = new PipUIContext (); + nsCOMPtr < nsIInterfaceRequestor> ctx = new PipUIContext (); #endif if (PK11_NeedLogin (cert->priv->cert->slot) diff --git a/smime/lib/e-cert.h b/smime/lib/e-cert.h index 3a092a71d4..4159c40cb9 100644 --- a/smime/lib/e-cert.h +++ b/smime/lib/e-cert.h @@ -66,10 +66,10 @@ struct _ECertClass { GType e_cert_get_type (void); -ECert* e_cert_new (CERTCertificate *cert); -ECert* e_cert_new_from_der (gchar *data, guint32 len); +ECert * e_cert_new (CERTCertificate *cert); +ECert * e_cert_new_from_der (gchar *data, guint32 len); -CERTCertificate* e_cert_get_internal_cert (ECert *cert); +CERTCertificate * e_cert_get_internal_cert (ECert *cert); gboolean e_cert_get_raw_der (ECert *cert, gchar **data, guint32 *len); const gchar * e_cert_get_window_title (ECert *cert); @@ -95,9 +95,9 @@ const gchar * e_cert_get_serial_number (ECert *cert); const gchar * e_cert_get_sha1_fingerprint (ECert *cert); const gchar * e_cert_get_md5_fingerprint (ECert *cert); -GList* e_cert_get_chain (ECert *cert); +GList * e_cert_get_chain (ECert *cert); ECert * e_cert_get_ca_cert (ECert *ecert); -EASN1Object* e_cert_get_asn1_struct (ECert *cert); +EASN1Object * e_cert_get_asn1_struct (ECert *cert); gboolean e_cert_mark_for_deletion (ECert *cert); diff --git a/smime/lib/e-pkcs12.c b/smime/lib/e-pkcs12.c index f4fa995207..959924e69d 100644 --- a/smime/lib/e-pkcs12.c +++ b/smime/lib/e-pkcs12.c @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* The following is the mozilla license blurb, as the bodies some of - these functions were derived from the mozilla source. */ + * these functions were derived from the mozilla source. */ /* * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -145,7 +145,7 @@ e_pkcs12_get_type (void) -EPKCS12* +EPKCS12 * e_pkcs12_new (void) { EPKCS12 *pk = E_PKCS12 (g_object_new (E_TYPE_PKCS12, NULL)); @@ -154,7 +154,9 @@ e_pkcs12_new (void) } static gboolean -input_to_decoder (SEC_PKCS12DecoderContext *dcx, const gchar *path, GError **error) +input_to_decoder (SEC_PKCS12DecoderContext *dcx, + const gchar *path, + GError **error) { /* nsNSSShutDownPreventionLock locker; */ SECStatus srv; @@ -194,15 +196,17 @@ input_to_decoder (SEC_PKCS12DecoderContext *dcx, const gchar *path, GError **err } /* XXX toshok - this needs to be done using a signal as in the - e_cert_db_login_to_slot stuff, instead of a direct gui dep here.. - for now, though, it stays. */ + * e_cert_db_login_to_slot stuff, instead of a direct gui dep here.. + * for now, though, it stays. */ static gboolean -prompt_for_password (gchar *title, gchar *prompt, SECItem *pwd) +prompt_for_password (gchar *title, + gchar *prompt, + SECItem *pwd) { gchar *passwd; passwd = e_passwords_ask_password (title, NULL, "", prompt, - E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, NULL); if (passwd) { @@ -232,8 +236,11 @@ prompt_for_password (gchar *title, gchar *prompt, SECItem *pwd) } static gboolean -import_from_file_helper (EPKCS12 *pkcs12, PK11SlotInfo *slot, - const gchar *path, gboolean *aWantRetry, GError **error) +import_from_file_helper (EPKCS12 *pkcs12, + PK11SlotInfo *slot, + const gchar *path, + gboolean *aWantRetry, + GError **error) { /*nsNSSShutDownPreventionLock locker; */ gboolean rv; @@ -294,8 +301,8 @@ import_from_file_helper (EPKCS12 *pkcs12, PK11SlotInfo *slot, handle_error (PKCS12_RESTORE_OK); finish: /* If srv != SECSuccess, NSS probably set a specific error code. - We should use that error code instead of inventing a new one - for every error possible. */ + * We should use that error code instead of inventing a new one + * for every error possible. */ if (srv != SECSuccess) { if (SEC_ERROR_BAD_PASSWORD == PORT_GetError ()) { *aWantRetry = TRUE; @@ -311,7 +318,9 @@ import_from_file_helper (EPKCS12 *pkcs12, PK11SlotInfo *slot, } gboolean -e_pkcs12_import_from_file (EPKCS12 *pkcs12, const gchar *path, GError **error) +e_pkcs12_import_from_file (EPKCS12 *pkcs12, + const gchar *path, + GError **error) { /*nsNSSShutDownPreventionLock locker;*/ gboolean rv = TRUE; @@ -342,9 +351,11 @@ e_pkcs12_export_to_file (EPKCS12 *pkcs12, } /* what to do when the nickname collides with one already in the db. - TODO: not handled, throw a dialog allowing the nick to be changed? */ + * TODO: not handled, throw a dialog allowing the nick to be changed? */ static SECItem * PR_CALLBACK -nickname_collision (SECItem *oldNick, PRBool *cancel, gpointer wincx) +nickname_collision (SECItem *oldNick, + PRBool *cancel, + gpointer wincx) { /* nsNSSShutDownPreventionLock locker; */ gint count = 1; @@ -356,32 +367,32 @@ nickname_collision (SECItem *oldNick, PRBool *cancel, gpointer wincx) printf ("nickname_collision\n"); /* The user is trying to import a PKCS#12 file that doesn't have the - attribute we use to set the nickname. So in order to reduce the - number of interactions we require with the user, we'll build a nickname - for the user. The nickname isn't prominently displayed in the UI, - so it's OK if we generate one on our own here. - XXX If the NSS API were smarter and actually passed a pointer to - the CERTCertificate* we're importing we could actually just - call default_nickname (which is what the issuance code path - does) and come up with a reasonable nickname. Alas, the NSS - API limits our ability to produce a useful nickname without - bugging the user. :( + * attribute we use to set the nickname. So in order to reduce the + * number of interactions we require with the user, we'll build a nickname + * for the user. The nickname isn't prominently displayed in the UI, + * so it's OK if we generate one on our own here. + * XXX If the NSS API were smarter and actually passed a pointer to + * the CERTCertificate * we're importing we could actually just + * call default_nickname (which is what the issuance code path + * does) and come up with a reasonable nickname. Alas, the NSS + * API limits our ability to produce a useful nickname without + * bugging the user. :( */ while (1) { CERTCertificate *cert; /* If we've gotten this far, that means there isn't a certificate - in the database that has the same subject name as the cert we're - trying to import. So we need to come up with a "nickname" to - satisfy the NSS requirement or fail in trying to import. - Basically we use a default nickname from a properties file and - see if a certificate exists with that nickname. If there isn't, then - create update the count by one and append the string '#1' Or - whatever the count currently is, and look for a cert with - that nickname. Keep updating the count until we find a nickname - without a corresponding cert. - XXX If a user imports *many* certs without the 'friendly name' - attribute, then this may take a long time. :( + * in the database that has the same subject name as the cert we're + * trying to import. So we need to come up with a "nickname" to + * satisfy the NSS requirement or fail in trying to import. + * Basically we use a default nickname from a properties file and + * see if a certificate exists with that nickname. If there isn't, then + * create update the count by one and append the string '#1' Or + * whatever the count currently is, and look for a cert with + * that nickname. Keep updating the count until we find a nickname + * without a corresponding cert. + * XXX If a user imports *many * certs without the 'friendly name' + * attribute, then this may take a long time. :( */ if (count > 1) { g_free (nickname); diff --git a/smime/lib/e-pkcs12.h b/smime/lib/e-pkcs12.h index 6e98fdb0cb..940187bc18 100644 --- a/smime/lib/e-pkcs12.h +++ b/smime/lib/e-pkcs12.h @@ -53,12 +53,12 @@ struct _EPKCS12Class { GType e_pkcs12_get_type (void); -EPKCS12* e_pkcs12_new (void); +EPKCS12 * e_pkcs12_new (void); #if 0 /* XXX we're not going to support additional slots in the initial ssl - stuff, so we just always default to the internal token (and thus - don't need this function yet. */ + * stuff, so we just always default to the internal token (and thus + * don't need this function yet. */ gboolean e_pkcs12_set_token (void); #endif diff --git a/smime/tests/import-cert.c b/smime/tests/import-cert.c index 850590789a..dfd368da46 100644 --- a/smime/tests/import-cert.c +++ b/smime/tests/import-cert.c @@ -24,7 +24,8 @@ #include "e-pkcs12.h" gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { ECertDB *db; EPKCS12 *pkcs12; diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c index 26cfdea4ec..f4acb61c29 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/widgets/e-timezone-dialog/e-timezone-dialog.c @@ -56,7 +56,7 @@ struct _ETimezoneDialogPrivate { /* The selected timezone. May be NULL for a 'local time' (i.e. when - the displayed name is ""). */ + * the displayed name is ""). */ icaltimezone *zone; GtkBuilder *builder; @@ -95,7 +95,7 @@ static gboolean on_map_button_pressed (GtkWidget *w, GdkEventButton *event, gpointer data); -static icaltimezone* get_zone_from_point (ETimezoneDialog *etd, +static icaltimezone * get_zone_from_point (ETimezoneDialog *etd, EMapPoint *point); static void set_map_timezone (ETimezoneDialog *etd, icaltimezone *zone); @@ -348,7 +348,7 @@ get_local_offset (void) } #endif -static icaltimezone* +static icaltimezone * get_local_timezone (void) { icaltimezone *zone; @@ -411,8 +411,8 @@ e_timezone_dialog_new (void) } static void -format_utc_offset (gint utc_offset, - gchar *buffer) +format_utc_offset (gint utc_offset, + gchar *buffer) { const gchar *sign = "+"; gint hours, minutes, seconds; @@ -503,13 +503,15 @@ on_map_timeout (gpointer data) } static gboolean -on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) +on_map_motion (GtkWidget *widget, + GdkEventMotion *event, + gpointer data) { ETimezoneDialog *etd; ETimezoneDialogPrivate *priv; gdouble longitude, latitude; icaltimezone *new_zone; - gchar *display=NULL; + gchar *display = NULL; etd = E_TIMEZONE_DIALOG (data); priv = etd->priv; @@ -539,7 +541,9 @@ on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) } static gboolean -on_map_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer data) +on_map_leave (GtkWidget *widget, + GdkEventCrossing *event, + gpointer data) { ETimezoneDialog *etd; ETimezoneDialogPrivate *priv; @@ -548,8 +552,8 @@ on_map_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer data) priv = etd->priv; /* We only want to reset the hover point if this is a normal leave - event. For some reason we are getting leave events when the - button is pressed in the map, which causes problems. */ + * event. For some reason we are getting leave events when the + * button is pressed in the map, which causes problems. */ if (event->mode != GDK_CROSSING_NORMAL) return FALSE; @@ -567,8 +571,9 @@ on_map_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer data) } static gboolean -on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, - gpointer data) +on_map_visibility_changed (GtkWidget *w, + GdkEventVisibility *event, + gpointer data) { ETimezoneDialog *etd; ETimezoneDialogPrivate *priv; @@ -578,7 +583,7 @@ on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, if (event->state != GDK_VISIBILITY_FULLY_OBSCURED) { /* Map is visible, at least partly, so make sure we flash the - selected point. */ + * selected point. */ if (!priv->timeout_id) priv->timeout_id = g_timeout_add (100, on_map_timeout, etd); } else { @@ -593,7 +598,9 @@ on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, } static gboolean -on_map_button_pressed (GtkWidget *w, GdkEventButton *event, gpointer data) +on_map_button_pressed (GtkWidget *w, + GdkEventButton *event, + gpointer data) { ETimezoneDialog *etd; ETimezoneDialogPrivate *priv; @@ -627,10 +634,10 @@ on_map_button_pressed (GtkWidget *w, GdkEventButton *event, gpointer data) } /* Returns the translated timezone location of the given EMapPoint, - e.g. "Europe/London". */ + * e.g. "Europe/London". */ static icaltimezone * get_zone_from_point (ETimezoneDialog *etd, - EMapPoint *point) + EMapPoint *point) { icalarray *zones; gdouble longitude, latitude; @@ -695,7 +702,7 @@ e_timezone_dialog_get_timezone (ETimezoneDialog *etd) void e_timezone_dialog_set_timezone (ETimezoneDialog *etd, - icaltimezone *zone) + icaltimezone *zone) { ETimezoneDialogPrivate *priv; gchar *display = NULL; @@ -722,7 +729,7 @@ e_timezone_dialog_set_timezone (ETimezoneDialog *etd, } GtkWidget * -e_timezone_dialog_get_toplevel (ETimezoneDialog *etd) +e_timezone_dialog_get_toplevel (ETimezoneDialog *etd) { ETimezoneDialogPrivate *priv; @@ -735,7 +742,8 @@ e_timezone_dialog_get_toplevel (ETimezoneDialog *etd) } static void -set_map_timezone (ETimezoneDialog *etd, icaltimezone *zone) +set_map_timezone (ETimezoneDialog *etd, + icaltimezone *zone) { ETimezoneDialogPrivate *priv; EMapPoint *point; @@ -761,7 +769,8 @@ set_map_timezone (ETimezoneDialog *etd, icaltimezone *zone) } static void -on_combo_changed (GtkComboBox *combo_box, ETimezoneDialog *etd) +on_combo_changed (GtkComboBox *combo_box, + ETimezoneDialog *etd) { ETimezoneDialogPrivate *priv; const gchar *new_zone_name; @@ -797,7 +806,8 @@ on_combo_changed (GtkComboBox *combo_box, ETimezoneDialog *etd) } static void -timezone_combo_get_active_text (GtkComboBox *combo, const gchar **zone_name) +timezone_combo_get_active_text (GtkComboBox *combo, + const gchar **zone_name) { GtkTreeModel *list_store; GtkTreeIter iter; @@ -812,7 +822,8 @@ timezone_combo_get_active_text (GtkComboBox *combo, const gchar **zone_name) } static gboolean -timezone_combo_set_active_text (GtkComboBox *combo, const gchar *zone_name) +timezone_combo_set_active_text (GtkComboBox *combo, + const gchar *zone_name) { GtkTreeModel *list_store; GHashTable *index; @@ -830,7 +841,8 @@ timezone_combo_set_active_text (GtkComboBox *combo, const gchar *zone_name) } static void -map_destroy_cb (gpointer data, GObject *where_object_was) +map_destroy_cb (gpointer data, + GObject *where_object_was) { ETimezoneDialogPrivate *priv = data; diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index ec31c44162..1c4ff5172e 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -34,8 +34,8 @@ #include "gal-define-views-model.h" #include "gal-view-new-dialog.h" -static void gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gal_define_views_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void gal_define_views_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void gal_define_views_dialog_dispose (GObject *object); /* The properties we support */ @@ -65,7 +65,7 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass) { GObjectClass *object_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; object_class->set_property = gal_define_views_dialog_set_property; object_class->get_property = gal_define_views_dialog_get_property; @@ -82,7 +82,9 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass) /* Button callbacks */ static void -gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialog *dialog) +gdvd_button_new_dialog_callback (GtkWidget *widget, + gint id, + GalDefineViewsDialog *dialog) { gchar *name; GtkTreeIter iter; @@ -103,7 +105,7 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialo view = gal_view_factory_new_view (factory, name); gal_view_collection_append (dialog->collection, view); - item = dialog->collection->view_data[dialog->collection->view_count-1]; + item = dialog->collection->view_data[dialog->collection->view_count - 1]; gtk_list_store_append (GTK_LIST_STORE (dialog->model), &iter); gtk_list_store_set (GTK_LIST_STORE (dialog->model), &iter, COL_GALVIEW_NAME, name, @@ -123,7 +125,8 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialo } static void -gdvd_button_new_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) +gdvd_button_new_callback (GtkWidget *widget, + GalDefineViewsDialog *dialog) { GtkWidget *view_new_dialog = gal_view_new_dialog_new (dialog->collection); gtk_window_set_transient_for (GTK_WINDOW (view_new_dialog), GTK_WINDOW (dialog)); @@ -133,7 +136,8 @@ gdvd_button_new_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) } static void -gdvd_button_modify_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) +gdvd_button_modify_callback (GtkWidget *widget, + GalDefineViewsDialog *dialog) { GtkTreeIter iter; GalViewCollectionItem *item; @@ -150,7 +154,8 @@ gdvd_button_modify_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) } static void -gdvd_button_delete_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) +gdvd_button_delete_callback (GtkWidget *widget, + GalDefineViewsDialog *dialog) { gint row; GtkTreeIter iter; @@ -167,7 +172,7 @@ gdvd_button_delete_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) g_return_if_fail (item && !item->built_in); - for (row=0; row<dialog->collection->view_count; row++) { + for (row = 0; row < dialog->collection->view_count; row++) { if (item == dialog->collection->view_data[row]) { gal_view_collection_delete_view (dialog->collection, row); path = gtk_tree_model_get_path (dialog->model, &iter); @@ -187,7 +192,8 @@ gdvd_button_delete_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) } static void -gdvd_selection_changed_callback (GtkTreeSelection *selection, GalDefineViewsDialog *dialog) +gdvd_selection_changed_callback (GtkTreeSelection *selection, + GalDefineViewsDialog *dialog) { GtkWidget *button; GtkTreeIter iter; @@ -209,7 +215,10 @@ gdvd_selection_changed_callback (GtkTreeSelection *selection, GalDefineViewsDial } static void -gdvd_connect_signal (GalDefineViewsDialog *dialog, const gchar *widget_name, const gchar *signal, GCallback handler) +gdvd_connect_signal (GalDefineViewsDialog *dialog, + const gchar *widget_name, + const gchar *signal, + GCallback handler) { GtkWidget *widget; @@ -220,7 +229,9 @@ gdvd_connect_signal (GalDefineViewsDialog *dialog, const gchar *widget_name, con } static void -dialog_response (GalDefineViewsDialog *dialog, gint response_id, gpointer data) +dialog_response (GalDefineViewsDialog *dialog, + gint response_id, + gpointer data) { gal_view_collection_save (dialog->collection); } @@ -293,7 +304,7 @@ gal_define_views_dialog_dispose (GObject *object) static void gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, - GalViewCollection *collection) + GalViewCollection *collection) { gint i; GtkListStore *store; @@ -302,7 +313,7 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); - for (i=0; i<collection->view_count; i++) { + for (i = 0; i < collection->view_count; i++) { GalViewCollectionItem *item = collection->view_data[i]; GtkTreeIter iter; @@ -368,7 +379,7 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, * * Returns: The GalDefineViewsDialog. */ -GtkWidget* +GtkWidget * gal_define_views_dialog_new (GalViewCollection *collection) { GtkWidget *widget = g_object_new (GAL_TYPE_DEFINE_VIEWS_DIALOG, NULL); @@ -377,13 +388,16 @@ gal_define_views_dialog_new (GalViewCollection *collection) } static void -gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +gal_define_views_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GalDefineViewsDialog *dialog; dialog = GAL_DEFINE_VIEWS_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_COLLECTION: if (g_value_get_object (value)) gal_define_views_dialog_set_collection (dialog, GAL_VIEW_COLLECTION (g_value_get_object (value))); @@ -392,24 +406,27 @@ gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GVal break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); return; } } static void -gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +gal_define_views_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { GalDefineViewsDialog *dialog; dialog = GAL_DEFINE_VIEWS_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_COLLECTION: g_value_set_object (value, dialog->collection); default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index 14031caf2b..7c69bce720 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -126,7 +126,9 @@ gdvm_row_count (ETableModel *etc) /* This function returns the value at a particular point in our ETableModel. */ static gpointer -gdvm_value_at (ETableModel *etc, gint col, gint row) +gdvm_value_at (ETableModel *etc, + gint col, + gint row) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); const gchar *value; @@ -138,7 +140,10 @@ gdvm_value_at (ETableModel *etc, gint col, gint row) /* This function sets the value at a particular point in our ETableModel. */ static void -gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) +gdvm_set_value_at (ETableModel *etc, + gint col, + gint row, + gconstpointer val) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); if (views->editable) { @@ -154,44 +159,57 @@ gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) /* This function returns whether a particular cell is editable. */ static gboolean -gdvm_is_cell_editable (ETableModel *etc, gint col, gint row) +gdvm_is_cell_editable (ETableModel *etc, + gint col, + gint row) { return GAL_DEFINE_VIEWS_MODEL (etc)->editable; } static void -gdvm_append_row (ETableModel *etm, ETableModel *source, gint row) +gdvm_append_row (ETableModel *etm, + ETableModel *source, + gint row) { } /* This function duplicates the value passed to it. */ static gpointer -gdvm_duplicate_value (ETableModel *etc, gint col, gconstpointer value) +gdvm_duplicate_value (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } /* This function frees the value passed to it. */ static void -gdvm_free_value (ETableModel *etc, gint col, gpointer value) +gdvm_free_value (ETableModel *etc, + gint col, + gpointer value) { g_free (value); } static gpointer -gdvm_initialize_value (ETableModel *etc, gint col) +gdvm_initialize_value (ETableModel *etc, + gint col) { return g_strdup(""); } static gboolean -gdvm_value_is_empty (ETableModel *etc, gint col, gconstpointer value) +gdvm_value_is_empty (ETableModel *etc, + gint col, + gconstpointer value) { return !(value && *(gchar *) value); } static gchar * -gdvm_value_to_string (ETableModel *etc, gint col, gconstpointer value) +gdvm_value_to_string (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } @@ -205,7 +223,7 @@ gdvm_value_to_string (ETableModel *etc, gint col, gconstpointer value) */ void gal_define_views_model_append (GalDefineViewsModel *model, - GalView *view) + GalView *view) { ETableModel *etm = E_TABLE_MODEL (model); @@ -287,7 +305,7 @@ gal_define_views_model_new (void) */ GalView * gal_define_views_model_get_view (GalDefineViewsModel *model, - gint n) + gint n) { return gal_view_collection_get_view (model->collection, n); } @@ -301,7 +319,7 @@ gal_define_views_model_get_view (GalDefineViewsModel *model, */ void gal_define_views_model_delete_view (GalDefineViewsModel *model, - gint n) + gint n) { e_table_model_pre_change (E_TABLE_MODEL (model)); gal_view_collection_delete_view (model->collection, n); @@ -317,7 +335,7 @@ gal_define_views_model_delete_view (GalDefineViewsModel *model, */ void gal_define_views_model_copy_view (GalDefineViewsModel *model, - gint n) + gint n) { ETableModel *etm = E_TABLE_MODEL (model); e_table_model_pre_change (etm); diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index 39ce216ce1..1d565d7c21 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -58,11 +58,9 @@ static guint gal_view_collection_signals[LAST_SIGNAL] = { 0, }; */ void gal_view_collection_display_view (GalViewCollection *collection, - GalView *view) + GalView *view) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); - g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); g_signal_emit (collection, @@ -73,7 +71,6 @@ gal_view_collection_display_view (GalViewCollection *collection, static void gal_view_collection_changed (GalViewCollection *collection) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_signal_emit (collection, @@ -95,8 +92,8 @@ gal_view_collection_item_free (GalViewCollectionItem *item) static gchar * gal_view_generate_string (GalViewCollection *collection, - GalView *view, - gint which) + GalView *view, + gint which) { gchar *ret_val; gchar *pointer; @@ -117,7 +114,7 @@ gal_view_generate_string (GalViewCollection *collection, static gint gal_view_check_string (GalViewCollection *collection, - gchar *string) + gchar *string) { gint i; @@ -137,7 +134,7 @@ gal_view_check_string (GalViewCollection *collection, static gchar * gal_view_generate_id (GalViewCollection *collection, - GalView *view) + GalView *view) { gint i; for (i = 1; TRUE; i++) { @@ -247,14 +244,14 @@ gal_view_collection_init (GalViewCollection *collection) * A collection of views and view factories. */ GalViewCollection * -gal_view_collection_new (void) +gal_view_collection_new (void) { return g_object_new (GAL_VIEW_COLLECTION_TYPE, NULL); } void gal_view_collection_set_title (GalViewCollection *collection, - const gchar *title) + const gchar *title) { g_free (collection->title); collection->title = g_strdup (title); @@ -269,11 +266,10 @@ gal_view_collection_set_title (GalViewCollection *collection, * Sets up the GalViewCollection. */ void -gal_view_collection_set_storage_directories (GalViewCollection *collection, - const gchar *system_dir, - const gchar *local_dir) +gal_view_collection_set_storage_directories (GalViewCollection *collection, + const gchar *system_dir, + const gchar *local_dir) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (system_dir != NULL); g_return_if_fail (local_dir != NULL); @@ -297,12 +293,10 @@ gal_view_collection_set_storage_directories (GalViewCollection *collection, * user tries to create a new view. */ void -gal_view_collection_add_factory (GalViewCollection *collection, - GalViewFactory *factory) +gal_view_collection_add_factory (GalViewCollection *collection, + GalViewFactory *factory) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); - g_return_if_fail (factory != NULL); g_return_if_fail (GAL_IS_VIEW_FACTORY (factory)); g_object_ref (factory); @@ -311,7 +305,7 @@ gal_view_collection_add_factory (GalViewCollection *collection, static void view_changed (GalView *view, - GalViewCollectionItem *item) + GalViewCollectionItem *item) { item->changed = TRUE; item->ever_changed = TRUE; @@ -323,7 +317,11 @@ view_changed (GalView *view, /* Use factory list to load a GalView file. */ static GalView * -gal_view_collection_real_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *title, const gchar *dir, const gchar *filename) +gal_view_collection_real_load_view_from_file (GalViewCollection *collection, + const gchar *type, + const gchar *title, + const gchar *dir, + const gchar *filename) { GalViewFactory *factory; GList *factories; @@ -347,16 +345,18 @@ gal_view_collection_real_load_view_from_file (GalViewCollection *collection, con } GalView * -gal_view_collection_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *filename) +gal_view_collection_load_view_from_file (GalViewCollection *collection, + const gchar *type, + const gchar *filename) { return gal_view_collection_real_load_view_from_file (collection, type, "", collection->local_dir, filename); } static GalViewCollectionItem * load_single_file (GalViewCollection *collection, - gchar *dir, - gboolean local, - xmlNode *node) + gchar *dir, + gboolean local, + xmlNode *node) { GalViewCollectionItem *item; item = g_new (GalViewCollectionItem, 1); @@ -377,7 +377,7 @@ load_single_file (GalViewCollection *collection, g_free (fullpath); if (item->view) { item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); } } @@ -386,8 +386,8 @@ load_single_file (GalViewCollection *collection, static void load_single_dir (GalViewCollection *collection, - gchar *dir, - gboolean local) + gchar *dir, + gboolean local) { xmlDoc *doc = NULL; xmlNode *root; @@ -477,9 +477,8 @@ load_single_dir (GalViewCollection *collection, * other parts of gal_view. */ void -gal_view_collection_load (GalViewCollection *collection) +gal_view_collection_load (GalViewCollection *collection) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (collection->local_dir != NULL); g_return_if_fail (collection->system_dir != NULL); @@ -504,14 +503,13 @@ gal_view_collection_load (GalViewCollection *collection) * gal_view. */ void -gal_view_collection_save (GalViewCollection *collection) +gal_view_collection_save (GalViewCollection *collection) { gint i; xmlDoc *doc; xmlNode *root; gchar *filename; - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (collection->local_dir != NULL); @@ -571,7 +569,6 @@ gal_view_collection_save (GalViewCollection *collection) gint gal_view_collection_get_count (GalViewCollection *collection) { - g_return_val_if_fail (collection != NULL, -1); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), -1); return collection->view_count; @@ -586,9 +583,8 @@ gal_view_collection_get_count (GalViewCollection *collection) */ GalView * gal_view_collection_get_view (GalViewCollection *collection, - gint n) + gint n) { - g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); g_return_val_if_fail (n < collection->view_count, NULL); g_return_val_if_fail (n >= 0, NULL); @@ -605,9 +601,8 @@ gal_view_collection_get_view (GalViewCollection *collection, */ GalViewCollectionItem * gal_view_collection_get_view_item (GalViewCollection *collection, - gint n) + gint n) { - g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); g_return_val_if_fail (n < collection->view_count, NULL); g_return_val_if_fail (n >= 0, NULL); @@ -616,7 +611,8 @@ gal_view_collection_get_view_item (GalViewCollection *collection, } gint -gal_view_collection_get_view_index_by_id (GalViewCollection *collection, const gchar *view_id) +gal_view_collection_get_view_index_by_id (GalViewCollection *collection, + const gchar *view_id) { gint i; for (i = 0; i < collection->view_count; i++) { @@ -627,9 +623,9 @@ gal_view_collection_get_view_index_by_id (GalViewCollection *collection, con } gchar * -gal_view_collection_get_view_id_by_index (GalViewCollection *collection, gint n) +gal_view_collection_get_view_id_by_index (GalViewCollection *collection, + gint n) { - g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); g_return_val_if_fail (n < collection->view_count, NULL); g_return_val_if_fail (n >= 0, NULL); @@ -638,14 +634,12 @@ gal_view_collection_get_view_id_by_index (GalViewCollection *collection, gint n) } void -gal_view_collection_append (GalViewCollection *collection, - GalView *view) +gal_view_collection_append (GalViewCollection *collection, + GalView *view) { GalViewCollectionItem *item; - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); - g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); item = g_new (GalViewCollectionItem, 1); @@ -661,7 +655,7 @@ gal_view_collection_append (GalViewCollection *collection, g_object_ref (view); item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); @@ -672,12 +666,11 @@ gal_view_collection_append (GalViewCollection *collection, } void -gal_view_collection_delete_view (GalViewCollection *collection, - gint i) +gal_view_collection_delete_view (GalViewCollection *collection, + gint i) { GalViewCollectionItem *item; - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (i >= 0 && i < collection->view_count); @@ -699,13 +692,12 @@ gal_view_collection_delete_view (GalViewCollection *collection, } void -gal_view_collection_copy_view (GalViewCollection *collection, - gint i) +gal_view_collection_copy_view (GalViewCollection *collection, + gint i) { GalViewCollectionItem *item; GalView *view; - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (i >= 0 && i < collection->view_count); @@ -723,7 +715,7 @@ gal_view_collection_copy_view (GalViewCollection *collection, item->collection = collection; item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); @@ -740,13 +732,13 @@ gal_view_collection_loaded (GalViewCollection *collection) } const gchar * -gal_view_collection_append_with_title (GalViewCollection *collection, const gchar *title, GalView *view) +gal_view_collection_append_with_title (GalViewCollection *collection, + const gchar *title, + GalView *view) { GalViewCollectionItem *item; - g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); - g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW (view), NULL); gal_view_set_title (view, title); @@ -766,7 +758,7 @@ gal_view_collection_append_with_title (GalViewCollection *collection, const gcha g_object_ref (view); item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); @@ -778,13 +770,13 @@ gal_view_collection_append_with_title (GalViewCollection *collection, const gcha } const gchar * -gal_view_collection_set_nth_view (GalViewCollection *collection, gint i, GalView *view) +gal_view_collection_set_nth_view (GalViewCollection *collection, + gint i, + GalView *view) { GalViewCollectionItem *item; - g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); - g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW (view), NULL); g_return_val_if_fail (i >= 0, NULL); g_return_val_if_fail (i < collection->view_count, NULL); @@ -807,7 +799,7 @@ gal_view_collection_set_nth_view (GalViewCollection *collection, gint i, GalView item->type = g_strdup (gal_view_get_type_code (view)); item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); gal_view_collection_changed (collection); @@ -821,7 +813,8 @@ gal_view_collection_get_default_view (GalViewCollection *collection) } void -gal_view_collection_set_default_view (GalViewCollection *collection, const gchar *id) +gal_view_collection_set_default_view (GalViewCollection *collection, + const gchar *id) { g_free (collection->default_view); collection->default_view = g_strdup (id); diff --git a/widgets/menus/gal-view-collection.h b/widgets/menus/gal-view-collection.h index a8dc3124e0..143bee53d1 100644 --- a/widgets/menus/gal-view-collection.h +++ b/widgets/menus/gal-view-collection.h @@ -129,7 +129,7 @@ GalView *gal_view_collection_load_view_from_file (GalViewColl const gchar *filename); /* Returns id of the new view. These functions are used for - GalViewInstanceSaveAsDialog. */ + * GalViewInstanceSaveAsDialog. */ const gchar *gal_view_collection_append_with_title (GalViewCollection *collection, const gchar *title, GalView *view); diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index 4a3a3fb35c..c1fa5daf8b 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -59,7 +59,8 @@ detach_tree (GalViewEtable *view) } static void -config_changed (ETableConfig *config, GalViewEtable *view) +config_changed (ETableConfig *config, + GalViewEtable *view) { ETableState *state; if (view->state) @@ -74,7 +75,8 @@ config_changed (ETableConfig *config, GalViewEtable *view) } static void -gal_view_etable_edit (GalView *view, GtkWindow *parent) +gal_view_etable_edit (GalView *view, + GtkWindow *parent) { GalViewEtable *etable_view = GAL_VIEW_ETABLE (view); ETableConfig *config; @@ -84,33 +86,33 @@ gal_view_etable_edit (GalView *view, GtkWindow *parent) etable_view->state, parent); - g_signal_connect(config, "changed", + g_signal_connect (config, "changed", G_CALLBACK (config_changed), view); } static void -gal_view_etable_load (GalView *view, - const gchar *filename) +gal_view_etable_load (GalView *view, + const gchar *filename) { e_table_state_load_from_file (GAL_VIEW_ETABLE (view)->state, filename); } static void -gal_view_etable_save (GalView *view, - const gchar *filename) +gal_view_etable_save (GalView *view, + const gchar *filename) { e_table_state_save_to_file (GAL_VIEW_ETABLE (view)->state, filename); } static const gchar * -gal_view_etable_get_title (GalView *view) +gal_view_etable_get_title (GalView *view) { return GAL_VIEW_ETABLE (view)->title; } static void gal_view_etable_set_title (GalView *view, - const gchar *title) + const gchar *title) { g_free (GAL_VIEW_ETABLE (view)->title); GAL_VIEW_ETABLE (view)->title = g_strdup (title); @@ -123,7 +125,7 @@ gal_view_etable_get_type_code (GalView *view) } static GalView * -gal_view_etable_clone (GalView *view) +gal_view_etable_clone (GalView *view) { GalViewEtable *gve, *new; @@ -140,7 +142,7 @@ gal_view_etable_clone (GalView *view) } static void -gal_view_etable_dispose (GObject *object) +gal_view_etable_dispose (GObject *object) { GalViewEtable *view = GAL_VIEW_ETABLE (object); @@ -162,7 +164,7 @@ gal_view_etable_dispose (GObject *object) } static void -gal_view_etable_class_init (GalViewEtableClass *klass) +gal_view_etable_class_init (GalViewEtableClass *klass) { GalViewClass *gal_view_class = GAL_VIEW_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -179,7 +181,7 @@ gal_view_etable_class_init (GalViewEtableClass *klass) } static void -gal_view_etable_init (GalViewEtable *gve) +gal_view_etable_init (GalViewEtable *gve) { gve->spec = NULL; gve->state = e_table_state_new (); @@ -198,7 +200,7 @@ gal_view_etable_init (GalViewEtable *gve) */ GalView * gal_view_etable_new (ETableSpecification *spec, - const gchar *title) + const gchar *title) { GalViewEtable *view; @@ -221,9 +223,9 @@ gal_view_etable_new (ETableSpecification *spec, * Returns: The GalViewEtable. */ GalView * -gal_view_etable_construct (GalViewEtable *view, - ETableSpecification *spec, - const gchar *title) +gal_view_etable_construct (GalViewEtable *view, + ETableSpecification *spec, + const gchar *title) { g_return_val_if_fail (GAL_IS_VIEW_ETABLE (view), NULL); g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (spec), NULL); @@ -242,7 +244,8 @@ gal_view_etable_construct (GalViewEtable *view, } void -gal_view_etable_set_state (GalViewEtable *view, ETableState *state) +gal_view_etable_set_state (GalViewEtable *view, + ETableState *state) { g_return_if_fail (GAL_IS_VIEW_ETABLE (view)); g_return_if_fail (E_IS_TABLE_STATE (state)); @@ -255,7 +258,8 @@ gal_view_etable_set_state (GalViewEtable *view, ETableState *state) } static void -table_state_changed (ETable *table, GalViewEtable *view) +table_state_changed (ETable *table, + GalViewEtable *view) { ETableState *state; @@ -267,7 +271,8 @@ table_state_changed (ETable *table, GalViewEtable *view) } static void -tree_state_changed (ETree *tree, GalViewEtable *view) +tree_state_changed (ETree *tree, + GalViewEtable *view) { ETableState *state; @@ -279,7 +284,8 @@ tree_state_changed (ETree *tree, GalViewEtable *view) } void -gal_view_etable_attach_table (GalViewEtable *view, ETable *table) +gal_view_etable_attach_table (GalViewEtable *view, + ETable *table) { g_return_if_fail (GAL_IS_VIEW_ETABLE (view)); g_return_if_fail (E_IS_TABLE (table)); @@ -291,12 +297,13 @@ gal_view_etable_attach_table (GalViewEtable *view, ETable *table) e_table_set_state_object (view->table, view->state); g_object_ref (view->table); view->table_state_changed_id = - g_signal_connect(view->table, "state_change", + g_signal_connect (view->table, "state_change", G_CALLBACK (table_state_changed), view); } void -gal_view_etable_attach_tree (GalViewEtable *view, ETree *tree) +gal_view_etable_attach_tree (GalViewEtable *view, + ETree *tree) { g_return_if_fail (GAL_IS_VIEW_ETABLE (view)); g_return_if_fail (E_IS_TREE (tree)); @@ -308,7 +315,7 @@ gal_view_etable_attach_tree (GalViewEtable *view, ETree *tree) e_tree_set_state_object (view->tree, view->state); g_object_ref (view->tree); view->tree_state_changed_id = - g_signal_connect(view->tree, "state_change", + g_signal_connect (view->tree, "state_change", G_CALLBACK (tree_state_changed), view); } diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index 49a0838833..a098e094b8 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -48,7 +48,7 @@ enum { /* Static functions */ static void gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dialog, - GalViewInstance *instance) + GalViewInstance *instance) { gint i; GtkListStore *store; @@ -57,7 +57,7 @@ gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dial store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); - for (i=0; i<instance->collection->view_count; i++) { + for (i = 0; i < instance->collection->view_count; i++) { GalViewCollectionItem *item = instance->collection->view_data[i]; GtkTreeIter iter; gchar *title = NULL; @@ -145,26 +145,31 @@ gvisad_setup_radio_buttons (GalViewInstanceSaveAsDialog *dialog) } static void -gvisad_radio_toggled (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog) +gvisad_radio_toggled (GtkWidget *widget, + GalViewInstanceSaveAsDialog *dialog) { gvisad_setup_radio_buttons (dialog); } static void -gvisad_entry_changed (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog) +gvisad_entry_changed (GtkWidget *widget, + GalViewInstanceSaveAsDialog *dialog) { gvisad_setup_validate_button (dialog); } /* Method override implementations */ static void -gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +gal_view_instance_save_as_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GalViewInstanceSaveAsDialog *dialog; dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_INSTANCE: if (g_value_get_object (value)) gal_view_instance_save_as_dialog_set_instance (dialog, GAL_VIEW_INSTANCE (g_value_get_object (value))); @@ -178,19 +183,22 @@ gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, c } static void -gal_view_instance_save_as_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +gal_view_instance_save_as_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { GalViewInstanceSaveAsDialog *dialog; dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_INSTANCE: g_value_set_object (value, dialog->instance); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -214,7 +222,7 @@ gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *k { GObjectClass *object_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; object_class->set_property = gal_view_instance_save_as_dialog_set_property; object_class->get_property = gal_view_instance_save_as_dialog_get_property; @@ -312,7 +320,7 @@ gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog) if (gtk_tree_selection_get_selected (selection, &dialog->model, &iter)) { gtk_tree_model_get (dialog->model, &iter, COL_GALVIEW_DATA, &item, -1); - for (n=0; n<dialog->instance->collection->view_count; n++) { + for (n = 0; n < dialog->instance->collection->view_count; n++) { if (item == dialog->instance->collection->view_data[n]) { id = gal_view_collection_set_nth_view (dialog->instance->collection, n, view); gal_view_collection_save (dialog->instance->collection); diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index 22557082e4..f127868ab3 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -70,7 +70,8 @@ gal_view_instance_changed (GalViewInstance *instance) } static void -gal_view_instance_display_view (GalViewInstance *instance, GalView *view) +gal_view_instance_display_view (GalViewInstance *instance, + GalView *view) { g_return_if_fail (instance != NULL); g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); @@ -101,7 +102,8 @@ save_current_view (GalViewInstance *instance) } static void -view_changed (GalView *view, GalViewInstance *instance) +view_changed (GalView *view, + GalViewInstance *instance) { if (instance->current_id != NULL) { g_free (instance->current_id); @@ -133,7 +135,8 @@ disconnect_view (GalViewInstance *instance) } static void -connect_view (GalViewInstance *instance, GalView *view) +connect_view (GalViewInstance *instance, + GalView *view) { if (instance->current_view) disconnect_view (instance); @@ -142,7 +145,7 @@ connect_view (GalViewInstance *instance, GalView *view) instance->current_title = g_strdup (gal_view_get_title (view)); instance->current_type = g_strdup (gal_view_get_type_code (view)); instance->view_changed_id = - g_signal_connect(instance->current_view, "changed", + g_signal_connect (instance->current_view, "changed", G_CALLBACK (view_changed), instance); gal_view_instance_display_view (instance, instance->current_view); @@ -234,7 +237,8 @@ gal_view_instance_init (GalViewInstance *instance) } static void -collection_changed (GalView *view, GalViewInstance *instance) +collection_changed (GalView *view, + GalViewInstance *instance) { if (instance->current_id) { gchar *view_id = instance->current_id; @@ -316,7 +320,8 @@ load_current_view (GalViewInstance *instance) * Return value: The new %GalViewInstance. **/ GalViewInstance * -gal_view_instance_new (GalViewCollection *collection, const gchar *instance_id) +gal_view_instance_new (GalViewCollection *collection, + const gchar *instance_id) { GalViewInstance *instance = g_object_new (GAL_VIEW_INSTANCE_TYPE, NULL); if (gal_view_instance_construct (instance, collection, instance_id)) @@ -328,7 +333,9 @@ gal_view_instance_new (GalViewCollection *collection, const gchar *instance_id) } GalViewInstance * -gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, const gchar *instance_id) +gal_view_instance_construct (GalViewInstance *instance, + GalViewCollection *collection, + const gchar *instance_id) { gchar *filename; gchar *safe_id; @@ -374,7 +381,8 @@ gal_view_instance_get_current_view_id (GalViewInstance *instance) } void -gal_view_instance_set_current_view_id (GalViewInstance *instance, const gchar *view_id) +gal_view_instance_set_current_view_id (GalViewInstance *instance, + const gchar *view_id) { GalView *view; gint index; @@ -408,7 +416,8 @@ gal_view_instance_get_current_view (GalViewInstance *instance) } void -gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view) +gal_view_instance_set_custom_view (GalViewInstance *instance, + GalView *view) { g_free (instance->current_id); instance->current_id = NULL; @@ -421,7 +430,9 @@ gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view) } static void -dialog_response (GtkWidget *dialog, gint id, GalViewInstance *instance) +dialog_response (GtkWidget *dialog, + gint id, + GalViewInstance *instance) { if (id == GTK_RESPONSE_OK) { gal_view_instance_save_as_dialog_save (GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (dialog)); @@ -437,7 +448,7 @@ gal_view_instance_save_as (GalViewInstance *instance) g_return_if_fail (instance != NULL); dialog = gal_view_instance_save_as_dialog_new (instance); - g_signal_connect(dialog, "response", + g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), instance); gtk_widget_show (dialog); } @@ -464,7 +475,8 @@ gal_view_instance_get_default_view (GalViewInstance *instance) } void -gal_view_instance_set_default_view (GalViewInstance *instance, const gchar *id) +gal_view_instance_set_default_view (GalViewInstance *instance, + const gchar *id) { g_free (instance->default_view); instance->default_view = g_strdup (id); diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index 4428cf6012..c26619f2bd 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -33,8 +33,8 @@ #include "gal-define-views-model.h" #include "gal-view-new-dialog.h" -static void gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gal_view_new_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void gal_view_new_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void gal_view_new_dialog_dispose (GObject *object); /* The arguments we take */ @@ -51,7 +51,7 @@ gal_view_new_dialog_class_init (GalViewNewDialogClass *klass) { GObjectClass *object_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; object_class->set_property = gal_view_new_dialog_set_property; object_class->get_property = gal_view_new_dialog_get_property; @@ -124,7 +124,7 @@ gal_view_new_dialog_dispose (GObject *object) G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose (object); } -GtkWidget* +GtkWidget * gal_view_new_dialog_new (GalViewCollection *collection) { GtkWidget *widget = @@ -150,11 +150,11 @@ sensitize_ok_response (GalViewNewDialog *dialog) } static gboolean -selection_func (GtkTreeSelection *selection, - GtkTreeModel *model, - GtkTreePath *path, - gboolean path_currently_selected, - gpointer data) +selection_func (GtkTreeSelection *selection, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + gpointer data) { GtkTreeIter iter; GalViewNewDialog *dialog = data; @@ -164,7 +164,7 @@ selection_func (GtkTreeSelection *selection, gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store), &iter, - (GtkTreePath*) path); + (GtkTreePath *) path); gtk_tree_model_get (GTK_TREE_MODEL (dialog->list_store), &iter, @@ -179,16 +179,17 @@ selection_func (GtkTreeSelection *selection, } static void -entry_changed (GtkWidget *entry, gpointer data) +entry_changed (GtkWidget *entry, + gpointer data) { GalViewNewDialog *dialog = data; sensitize_ok_response (dialog); } -GtkWidget* -gal_view_new_dialog_construct (GalViewNewDialog *dialog, - GalViewCollection *collection) +GtkWidget * +gal_view_new_dialog_construct (GalViewNewDialog *dialog, + GalViewCollection *collection) { GList *iterator; GtkTreeSelection *selection; @@ -239,14 +240,17 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog, } static void -gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +gal_view_new_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GalViewNewDialog *dialog; GtkWidget *entry; dialog = GAL_VIEW_NEW_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_NAME: entry = e_builder_get_widget(dialog->builder, "entry-name"); if (entry && GTK_IS_ENTRY (entry)) { @@ -254,20 +258,23 @@ gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue * } break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); return; } } static void -gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +gal_view_new_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { GalViewNewDialog *dialog; GtkWidget *entry; dialog = GAL_VIEW_NEW_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_NAME: entry = e_builder_get_widget(dialog->builder, "entry-name"); if (entry && GTK_IS_ENTRY (entry)) { @@ -278,7 +285,7 @@ gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, g_value_set_object (value, dialog->selected_factory); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/misc/e-action-combo-box.c b/widgets/misc/e-action-combo-box.c index d34409b5fd..cd99c346fb 100644 --- a/widgets/misc/e-action-combo-box.c +++ b/widgets/misc/e-action-combo-box.c @@ -253,7 +253,7 @@ action_combo_box_update_model (EActionComboBox *combo_box) g_free (stock_id); gtk_list_store_append (list_store, &iter); - g_object_get (G_OBJECT (action), "value", &value, NULL); + g_object_get (action, "value", &value, NULL); gtk_list_store_set ( list_store, &iter, COLUMN_ACTION, list->data, COLUMN_SORT, (gfloat) value, -1); @@ -395,7 +395,7 @@ action_combo_box_changed (GtkComboBox *combo_box) model = gtk_combo_box_get_model (combo_box); gtk_tree_model_get (model, &iter, COLUMN_ACTION, &action, -1); - g_object_get (G_OBJECT (action), "value", &value, NULL); + g_object_get (action, "value", &value, NULL); gtk_radio_action_set_current_value (action, value); } diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index 5073d582fc..ccd135e5a0 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -101,7 +101,8 @@ G_DEFINE_TYPE ( G_TYPE_OBJECT) static gboolean -create_system_thumbnail (EAttachment *attachment, GIcon **icon) +create_system_thumbnail (EAttachment *attachment, + GIcon **icon) { GFile *file; GFile *icon_file; diff --git a/widgets/misc/e-buffer-tagger.c b/widgets/misc/e-buffer-tagger.c index cf2944fde8..bc05525737 100644 --- a/widgets/misc/e-buffer-tagger.c +++ b/widgets/misc/e-buffer-tagger.c @@ -134,13 +134,16 @@ get_state (GtkTextBuffer *buffer) } static void -set_state (GtkTextBuffer *buffer, guint32 state) +set_state (GtkTextBuffer *buffer, + guint32 state) { g_object_set_data (G_OBJECT (buffer), E_BUFFER_TAGGER_DATA_STATE, GINT_TO_POINTER (state)); } static void -update_state (GtkTextBuffer *buffer, guint32 value, gboolean do_set) +update_state (GtkTextBuffer *buffer, + guint32 value, + gboolean do_set) { guint32 state; @@ -158,7 +161,10 @@ update_state (GtkTextBuffer *buffer, guint32 value, gboolean do_set) } static gboolean -get_tag_bounds (GtkTextIter *iter, GtkTextTag *tag, GtkTextIter *start, GtkTextIter *end) +get_tag_bounds (GtkTextIter *iter, + GtkTextTag *tag, + GtkTextIter *start, + GtkTextIter *end) { gboolean res = FALSE; @@ -184,7 +190,8 @@ get_tag_bounds (GtkTextIter *iter, GtkTextTag *tag, GtkTextIter *start, GtkTextI } static gchar * -get_url_at_iter (GtkTextBuffer *buffer, GtkTextIter *iter) +get_url_at_iter (GtkTextBuffer *buffer, + GtkTextIter *iter) { GtkTextTagTable *tag_table; GtkTextTag *tag; @@ -204,7 +211,8 @@ get_url_at_iter (GtkTextBuffer *buffer, GtkTextIter *iter) } static gboolean -invoke_link_if_present (GtkTextBuffer *buffer, GtkTextIter *iter) +invoke_link_if_present (GtkTextBuffer *buffer, + GtkTextIter *iter) { gboolean res; gchar *url; @@ -223,7 +231,8 @@ invoke_link_if_present (GtkTextBuffer *buffer, GtkTextIter *iter) } static void -remove_tag_if_present (GtkTextBuffer *buffer, GtkTextIter *where) +remove_tag_if_present (GtkTextBuffer *buffer, + GtkTextIter *where) { GtkTextTagTable *tag_table; GtkTextTag *tag; @@ -241,14 +250,21 @@ remove_tag_if_present (GtkTextBuffer *buffer, GtkTextIter *where) } static void -buffer_insert_text (GtkTextBuffer *buffer, GtkTextIter *location, gchar *text, gint len, gpointer user_data) +buffer_insert_text (GtkTextBuffer *buffer, + GtkTextIter *location, + gchar *text, + gint len, + gpointer user_data) { update_state (buffer, E_BUFFER_TAGGER_STATE_INSDEL, TRUE); remove_tag_if_present (buffer, location); } static void -buffer_delete_range (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end, gpointer user_data) +buffer_delete_range (GtkTextBuffer *buffer, + GtkTextIter *start, + GtkTextIter *end, + gpointer user_data) { update_state (buffer, E_BUFFER_TAGGER_STATE_INSDEL, TRUE); remove_tag_if_present (buffer, start); @@ -256,7 +272,8 @@ buffer_delete_range (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end } static void -buffer_cursor_position (GtkTextBuffer *buffer, gpointer user_data) +buffer_cursor_position (GtkTextBuffer *buffer, + gpointer user_data) { guint32 state; @@ -275,7 +292,9 @@ buffer_cursor_position (GtkTextBuffer *buffer, gpointer user_data) } static void -update_mouse_cursor (GtkTextView *text_view, gint x, gint y) +update_mouse_cursor (GtkTextView *text_view, + gint x, + gint y) { static GdkCursor *hand_cursor = NULL; static GdkCursor *regular_cursor = NULL; @@ -330,7 +349,12 @@ update_mouse_cursor (GtkTextView *text_view, gint x, gint y) } static gboolean -textview_query_tooltip (GtkTextView *text_view, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data) +textview_query_tooltip (GtkTextView *text_view, + gint x, + gint y, + gboolean keyboard_mode, + GtkTooltip *tooltip, + gpointer user_data) { GtkTextBuffer *buffer; guint32 state; @@ -373,7 +397,8 @@ textview_query_tooltip (GtkTextView *text_view, gint x, gint y, gboolean keyboar /* Links can be activated by pressing Enter. */ static gboolean -textview_key_press_event (GtkWidget *text_view, GdkEventKey *event) +textview_key_press_event (GtkWidget *text_view, + GdkEventKey *event) { GtkTextIter iter; GtkTextBuffer *buffer; @@ -398,7 +423,8 @@ textview_key_press_event (GtkWidget *text_view, GdkEventKey *event) } static void -update_ctrl_state (GtkTextView *textview, gboolean ctrl_is_down) +update_ctrl_state (GtkTextView *textview, + gboolean ctrl_is_down) { GtkTextBuffer *buffer; gint x, y; @@ -417,7 +443,8 @@ update_ctrl_state (GtkTextView *textview, gboolean ctrl_is_down) /* Links can also be activated by clicking. */ static gboolean -textview_event_after (GtkTextView *textview, GdkEvent *ev) +textview_event_after (GtkTextView *textview, + GdkEvent *ev) { GtkTextIter start, end, iter; GtkTextBuffer *buffer; @@ -477,7 +504,8 @@ textview_event_after (GtkTextView *textview, GdkEvent *ev) } static gboolean -textview_motion_notify_event (GtkTextView *textview, GdkEventMotion *event) +textview_motion_notify_event (GtkTextView *textview, + GdkEventMotion *event) { gint x, y; @@ -493,7 +521,8 @@ textview_motion_notify_event (GtkTextView *textview, GdkEventMotion *event) } static gboolean -textview_visibility_notify_event (GtkTextView *textview, GdkEventVisibility *event) +textview_visibility_notify_event (GtkTextView *textview, + GdkEventVisibility *event) { gint wx, wy, bx, by; diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index 400fbe2c64..d3f42fd359 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -594,7 +594,7 @@ e_calendar_item_init (ECalendarItem *calitem) } static void -e_calendar_item_dispose (GObject *object) +e_calendar_item_dispose (GObject *object) { ECalendarItem *calitem; @@ -855,7 +855,7 @@ e_calendar_item_set_property (GObject *object, } static void -e_calendar_item_realize (GnomeCanvasItem *item) +e_calendar_item_realize (GnomeCanvasItem *item) { ECalendarItem *calitem; @@ -870,7 +870,7 @@ e_calendar_item_realize (GnomeCanvasItem *item) } static void -e_calendar_item_unmap (GnomeCanvasItem *item) +e_calendar_item_unmap (GnomeCanvasItem *item) { ECalendarItem *calitem; @@ -886,9 +886,9 @@ e_calendar_item_unmap (GnomeCanvasItem *item) } static void -e_calendar_item_update (GnomeCanvasItem *item, - const cairo_matrix_t *i2c, - gint flags) +e_calendar_item_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { GnomeCanvasItemClass *item_class; ECalendarItem *calitem; @@ -924,7 +924,7 @@ e_calendar_item_update (GnomeCanvasItem *item, */ /* Make sure the minimum row width & cell height and the widths of - all the digits and characters are up to date. */ + * all the digits and characters are up to date. */ e_calendar_item_recalc_sizes (calitem); /* Calculate how many rows & cols we can fit in. */ @@ -957,9 +957,9 @@ e_calendar_item_update (GnomeCanvasItem *item, calitem->cols = cols; /* Split up the empty space according to the configuration. - If the calendar is set to expand, we divide the space between the - cells and the spaces around the calendar, otherwise we place the - calendars in the center of the available area. */ + * If the calendar is set to expand, we divide the space between the + * cells and the spaces around the calendar, otherwise we place the + * calendars in the center of the available area. */ char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1020,12 +1020,12 @@ e_calendar_item_update (GnomeCanvasItem *item, * DRAWING ROUTINES - functions to paint the canvas item. */ static void -e_calendar_item_draw (GnomeCanvasItem *canvas_item, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height) +e_calendar_item_draw (GnomeCanvasItem *canvas_item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { ECalendarItem *calitem; GtkStyle *style; @@ -1083,7 +1083,7 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, for (row = 0; row < calitem->rows; row++) { /* Draw the background for the title bars and the shadow around - it, and the vertical lines between columns. */ + * it, and the vertical lines between columns. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &bg); @@ -1126,7 +1126,9 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, } static void -layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, gint day_index) +layout_set_day_text (ECalendarItem *calitem, + PangoLayout *layout, + gint day_index) { const gchar *abbr_name; @@ -1136,14 +1138,14 @@ layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, gint day_index } static void -e_calendar_item_draw_month (ECalendarItem *calitem, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height, - gint row, - gint col) +e_calendar_item_draw_month (ECalendarItem *calitem, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height, + gint row, + gint col) { GnomeCanvasItem *item; GtkWidget *widget; @@ -1189,7 +1191,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, /* Calculate the top-left position of the entire month display. */ month_x = item->x1 + xthickness + calitem->x_offset + ( (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - ? (calitem->cols-1 - col) : col ) * calitem->month_width - x; + ? (calitem->cols - 1 - col) : col ) * calitem->month_width - x; month_w = item->x2 - item->x1 - xthickness * 2; month_w = MIN (month_w, calitem->month_width); month_y = item->y1 + ythickness + row * calitem->month_height - y; @@ -1206,7 +1208,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, month %= 12; /* Draw the month name & year, with clipping. Note that the top row - needs extra space around it for the buttons. */ + * needs extra space around it for the buttons. */ layout = gtk_widget_create_pango_layout (widget, NULL); @@ -1250,7 +1252,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, pango_layout_set_text (layout, buffer, -1); /* Ideally we place the text centered in the month, but we - won't go to the left of the minimum x position. */ + * won't go to the left of the minimum x position. */ pango_layout_get_pixel_size (layout, &text_width, NULL); text_x = (calitem->month_width - text_width) / 2; text_x = MAX (min_x, text_x); @@ -1315,7 +1317,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, day_index = calitem->week_start_day; pango_layout_set_font_description (layout, font_desc); if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - text_x += (7-1) * calitem->cell_width; + text_x += (7 - 1) * calitem->cell_width; gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_ACTIVE]); for (day = 0; day < 7; day++) { cairo_save (cr); @@ -1351,7 +1353,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, } static const gchar * -get_digit_fomat () +get_digit_fomat (void) { #ifdef HAVE_GNU_GET_LIBC_VERSION @@ -1379,17 +1381,17 @@ get_digit_fomat () } static void -e_calendar_item_draw_day_numbers (ECalendarItem *calitem, - cairo_t *cr, - gint width, - gint height, - gint row, - gint col, - gint year, - gint month, - gint start_weekday, - gint cells_x, - gint cells_y) +e_calendar_item_draw_day_numbers (ECalendarItem *calitem, + cairo_t *cr, + gint width, + gint height, + gint row, + gint col, + gint year, + gint month, + gint start_weekday, + gint cells_x, + gint cells_y) { GnomeCanvasItem *item; GtkWidget *widget; @@ -1437,7 +1439,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, layout = pango_cairo_create_layout (cr); /* Calculate the number of days in the previous, current, and next - months. */ + * months. */ years[0] = years[1] = years[2] = year; months[0] = month - 1; months[1] = month; @@ -1456,7 +1458,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, days_in_month[2] = DAYS_IN_MONTH (years[2], months[2]); /* Mon 0 is the previous month, which we may show the end of. Mon 1 is - the current month, and mon 2 is the next month. */ + * the current month, and mon 2 is the next month. */ mon = 0; month_offset = row * calitem->cols + col - 1; @@ -1464,8 +1466,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, days_from_week_start = (start_weekday + 7 - calitem->week_start_day) % 7; /* For the top-left month we show the end of the previous month, and - if the new month starts on the first day of the week we show a - complete week from the previous month. */ + * if the new month starts on the first day of the week we show a + * complete week from the previous month. */ if (days_from_week_start == 0) { if (row == 0 && col == 0) { day_num -= 6; @@ -1490,7 +1492,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, today_mday = today_tm.tm_mday; /* We usually skip the last days of the previous month (mon = 0), - except for the top-left month displayed. */ + * except for the top-left month displayed. */ draw_day = (mon == 1 || (row == 0 && col == 0)); for (drow = 0; drow < 6; drow++) { @@ -1531,7 +1533,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, if (draw_day) { day_x = cells_x + ( (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - ? 7-1 - dcol : dcol ) * calitem->cell_width; + ? 7 - 1 - dcol : dcol ) * calitem->cell_width; day_y = cells_y + drow * calitem->cell_height; @@ -1671,7 +1673,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, month_offset++; mon++; /* We only draw the start of the next month - for the bottom-right month displayed. */ + * for the bottom-right month displayed. */ if (mon == 2 && (row != calitem->rows - 1 || col != calitem->cols - 1)) { /* Set a flag so we exit the loop. */ @@ -1700,10 +1702,10 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, } gint -e_calendar_item_get_week_number (ECalendarItem *calitem, - gint day, - gint month, - gint year) +e_calendar_item_get_week_number (ECalendarItem *calitem, + gint day, + gint month, + gint year) { GDate date; guint weekday, yearday; @@ -1717,7 +1719,7 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, if (weekday > 0) { /* we want always point to nearest Monday, as the first day of the week, - regardless of the calendar's week_start_day */ + * regardless of the calendar's week_start_day */ if (weekday >= 3) g_date_add_days (&date, 7 - weekday); else @@ -1728,7 +1730,7 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, yearday = g_date_get_day_of_year (&date) - 1; /* If the week starts on or after 29th December, it is week 1 of the - next year, since there are 4 days in the next year. */ + * next year, since there are 4 days in the next year. */ if (g_date_get_month (&date) == 12 && g_date_get_day (&date) >= 29) return 1; @@ -1736,7 +1738,7 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, week_num = yearday / 7; /* If the first week starts on or after Jan 5th, then we need to add - 1 since the previous week will really be the first week. */ + * 1 since the previous week will really be the first week. */ if (yearday % 7 >= 4) week_num++; @@ -1745,17 +1747,21 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, } /* This is supposed to return the nearest item the the point and the distance. - Since we are the only item we just return ourself and 0 for the distance. - This is needed so that we get button/motion events. */ + * Since we are the only item we just return ourself and 0 for the distance. + * This is needed so that we get button/motion events. */ static GnomeCanvasItem * -e_calendar_item_point (GnomeCanvasItem *item, gdouble x, gdouble y, - gint cx, gint cy) +e_calendar_item_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static void -e_calendar_item_stop_selecting (ECalendarItem *calitem, guint32 time) +e_calendar_item_stop_selecting (ECalendarItem *calitem, + guint32 time) { if (!calitem->selecting) return; @@ -1765,8 +1771,8 @@ e_calendar_item_stop_selecting (ECalendarItem *calitem, guint32 time) calitem->selecting = FALSE; /* If the user selects the grayed dates before the first month or - after the last month, we move backwards or forwards one month. - The set_month () call should take care of updating the selection. */ + * after the last month, we move backwards or forwards one month. + * The set_month () call should take care of updating the selection. */ if (calitem->selection_end_month_offset == -1) e_calendar_item_set_first_month (calitem, calitem->year, calitem->month - 1); @@ -1785,8 +1791,9 @@ e_calendar_item_stop_selecting (ECalendarItem *calitem, guint32 time) } static void -e_calendar_item_selection_add_days (ECalendarItem *calitem, gint n_days, - gboolean multi_selection) +e_calendar_item_selection_add_days (ECalendarItem *calitem, + gint n_days, + gboolean multi_selection) { GDate gdate_start, gdate_end; @@ -1846,7 +1853,8 @@ e_calendar_item_selection_add_days (ECalendarItem *calitem, gint n_days, } static gint -e_calendar_item_key_press_event (ECalendarItem *calitem, GdkEvent *event) +e_calendar_item_key_press_event (ECalendarItem *calitem, + GdkEvent *event) { guint keyval = event->key.keyval; gboolean multi_selection = FALSE; @@ -1884,7 +1892,8 @@ e_calendar_item_key_press_event (ECalendarItem *calitem, GdkEvent *event) } static gint -e_calendar_item_event (GnomeCanvasItem *item, GdkEvent *event) +e_calendar_item_event (GnomeCanvasItem *item, + GdkEvent *event) { ECalendarItem *calitem; @@ -1909,8 +1918,11 @@ e_calendar_item_event (GnomeCanvasItem *item, GdkEvent *event) } static void -e_calendar_item_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, - gdouble *x2, gdouble *y2) +e_calendar_item_bounds (GnomeCanvasItem *item, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2) { ECalendarItem *calitem; @@ -1924,9 +1936,9 @@ e_calendar_item_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, } /* This checks if any fonts have changed, and if so it recalculates the - text sizes and the minimum month size. */ + * text sizes and the minimum month size. */ static void -e_calendar_item_recalc_sizes (ECalendarItem *calitem) +e_calendar_item_recalc_sizes (ECalendarItem *calitem) { GnomeCanvasItem *canvas_item; GtkStyle *style; @@ -2028,21 +2040,21 @@ e_calendar_item_recalc_sizes (ECalendarItem *calitem) } static void -e_calendar_item_get_day_style (ECalendarItem *calitem, - gint year, - gint month, - gint day, - gint day_style, - gboolean today, - gboolean prev_or_next_month, - gboolean selected, - gboolean has_focus, - gboolean drop_target, - GdkColor **bg_color, - GdkColor **fg_color, - GdkColor **box_color, - gboolean *bold, - gboolean *italic) +e_calendar_item_get_day_style (ECalendarItem *calitem, + gint year, + gint month, + gint day, + gint day_style, + gboolean today, + gboolean prev_or_next_month, + gboolean selected, + gboolean has_focus, + gboolean drop_target, + GdkColor **bg_color, + GdkColor **fg_color, + GdkColor **box_color, + gboolean *bold, + gboolean *italic) { GtkWidget *widget; GtkStyle *style; @@ -2075,8 +2087,8 @@ e_calendar_item_get_day_style (ECalendarItem *calitem, } static gboolean -e_calendar_item_button_press (ECalendarItem *calitem, - GdkEvent *event) +e_calendar_item_button_press (ECalendarItem *calitem, + GdkEvent *event) { gint month_offset, day, add_days = 0; gboolean all_week, round_up_end = FALSE, round_down_start = FALSE; @@ -2099,7 +2111,7 @@ e_calendar_item_button_press (ECalendarItem *calitem, if (event->button.button == 3 && day == -1 && e_calendar_item_get_display_popup (calitem)) { e_calendar_item_show_popup_menu (calitem, - (GdkEventButton*) event, + (GdkEventButton *) event, month_offset); return TRUE; } @@ -2187,16 +2199,16 @@ e_calendar_item_button_press (ECalendarItem *calitem, } static gboolean -e_calendar_item_button_release (ECalendarItem *calitem, - GdkEvent *event) +e_calendar_item_button_release (ECalendarItem *calitem, + GdkEvent *event) { e_calendar_item_stop_selecting (calitem, event->button.time); return FALSE; } static gboolean -e_calendar_item_motion (ECalendarItem *calitem, - GdkEvent *event) +e_calendar_item_motion (ECalendarItem *calitem, + GdkEvent *event) { gint start_month, start_day, end_month, end_day, month_offset, day; gint tmp_month, tmp_day, days_in_selection; @@ -2251,13 +2263,13 @@ e_calendar_item_motion (ECalendarItem *calitem, } /* If we are over a week number and we are dragging the end of the - selection, we round up to the end of this week. */ + * selection, we round up to the end of this week. */ if (all_week && calitem->selection_dragging_end) round_up_end = TRUE; /* If the selection was started from a week number and we are dragging - the start of the selection, we need to round up the end to include - all of the original week selected. */ + * the start of the selection, we need to round up the end to include + * all of the original week selected. */ if (calitem->selection_from_full_week && !calitem->selection_dragging_end) round_up_end = TRUE; @@ -2307,11 +2319,11 @@ e_calendar_item_motion (ECalendarItem *calitem, } static void -e_calendar_item_check_selection_end (ECalendarItem *calitem, - gint start_month, - gint start_day, - gint *end_month, - gint *end_day) +e_calendar_item_check_selection_end (ECalendarItem *calitem, + gint start_month, + gint start_day, + gint *end_month, + gint *end_day) { gint year, month, max_month, max_day, days_in_month; @@ -2347,11 +2359,11 @@ e_calendar_item_check_selection_end (ECalendarItem *calitem, } static void -e_calendar_item_check_selection_start (ECalendarItem *calitem, - gint *start_month, - gint *start_day, - gint end_month, - gint end_day) +e_calendar_item_check_selection_start (ECalendarItem *calitem, + gint *start_month, + gint *start_day, + gint end_month, + gint end_day) { gint year, month, min_month, min_day, days_in_month; @@ -2385,19 +2397,19 @@ e_calendar_item_check_selection_start (ECalendarItem *calitem, } /* Converts a position within the item to a month & day. - The month returned is 0 for the top-left month displayed. - If the position is over the month heading -1 is returned for the day. - If the position is over a week number the first day of the week is returned - and entire_week is set to TRUE. - It returns FALSE if the position is completely outside all months. */ + * The month returned is 0 for the top-left month displayed. + * If the position is over the month heading -1 is returned for the day. + * If the position is over a week number the first day of the week is returned + * and entire_week is set to TRUE. + * It returns FALSE if the position is completely outside all months. */ static gboolean -e_calendar_item_convert_position_to_day (ECalendarItem *calitem, - gint event_x, - gint event_y, - gboolean round_empty_positions, - gint *month_offset, - gint *day, - gboolean *entire_week) +e_calendar_item_convert_position_to_day (ECalendarItem *calitem, + gint event_x, + gint event_y, + gboolean round_empty_positions, + gint *month_offset, + gint *day, + gboolean *entire_week) { GnomeCanvasItem *item; GtkWidget *widget; @@ -2443,7 +2455,7 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, if (row >= calitem->rows || col >= calitem->cols) return FALSE; if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - col = calitem->cols-1 - col; + col = calitem->cols - 1 - col; *month_offset = row * calitem->cols + col; @@ -2489,7 +2501,7 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, return FALSE; day_col = x / calitem->cell_width; if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - day_col = E_CALENDAR_COLS_PER_MONTH-1 - day_col; + day_col = E_CALENDAR_COLS_PER_MONTH - 1 - day_col; if (day_col >= E_CALENDAR_COLS_PER_MONTH) return FALSE; } @@ -2529,12 +2541,12 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, } static void -e_calendar_item_get_month_info (ECalendarItem *calitem, - gint row, - gint col, - gint *first_day_offset, - gint *days_in_month, - gint *days_in_prev_month) +e_calendar_item_get_month_info (ECalendarItem *calitem, + gint row, + gint col, + gint *first_day_offset, + gint *days_in_month, + gint *days_in_prev_month) { gint year, month, start_weekday, first_day_of_month; struct tm tmp_tm = { 0 }; @@ -2567,19 +2579,19 @@ e_calendar_item_get_month_info (ECalendarItem *calitem, } void -e_calendar_item_get_first_month (ECalendarItem *calitem, - gint *year, - gint *month) +e_calendar_item_get_first_month (ECalendarItem *calitem, + gint *year, + gint *month) { *year = calitem->year; *month = calitem->month; } static void -e_calendar_item_preserve_day_selection (ECalendarItem *calitem, - gint selected_day, - gint *month_offset, - gint *day) +e_calendar_item_preserve_day_selection (ECalendarItem *calitem, + gint selected_day, + gint *month_offset, + gint *day) { gint year, month, weekday, days, days_in_month; struct tm tmp_tm = { 0 }; @@ -2615,9 +2627,9 @@ e_calendar_item_preserve_day_selection (ECalendarItem *calitem, /* This also handles values of month < 0 or > 11 by updating the year. */ void -e_calendar_item_set_first_month (ECalendarItem *calitem, - gint year, - gint month) +e_calendar_item_set_first_month (ECalendarItem *calitem, + gint year, + gint month) { gint new_year, new_month, months_diff, num_months; gint old_days_in_selection, new_days_in_selection; @@ -2673,7 +2685,7 @@ e_calendar_item_set_first_month (ECalendarItem *calitem, } /* We want to ensure that the same number of days are - selected after we have moved the selection. */ + * selected after we have moved the selection. */ calitem->year = new_year; calitem->month = new_month; @@ -2704,9 +2716,9 @@ e_calendar_item_set_first_month (ECalendarItem *calitem, new_days_in_selection); /* Flag that we need to emit the "selection_changed" - signal. We don't want to emit it here since setting - the "year" and "month" args would result in 2 - signals emitted. */ + * signal. We don't want to emit it here since setting + * the "year" and "month" args would result in 2 + * signals emitted. */ calitem->selection_changed = TRUE; } } else { @@ -2720,15 +2732,15 @@ e_calendar_item_set_first_month (ECalendarItem *calitem, /* Get the maximum number of days selectable */ gint -e_calendar_item_get_max_days_sel (ECalendarItem *calitem) +e_calendar_item_get_max_days_sel (ECalendarItem *calitem) { return calitem->max_days_selected; } /* Set the maximum number of days selectable */ void -e_calendar_item_set_max_days_sel (ECalendarItem *calitem, - gint days) +e_calendar_item_set_max_days_sel (ECalendarItem *calitem, + gint days) { calitem->max_days_selected = MAX (0, days); gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (calitem)); @@ -2736,38 +2748,38 @@ e_calendar_item_set_max_days_sel (ECalendarItem *calitem, /* Get the maximum number of days before whole weeks are selected */ gint -e_calendar_item_get_days_start_week_sel (ECalendarItem *calitem) +e_calendar_item_get_days_start_week_sel (ECalendarItem *calitem) { return calitem->days_to_start_week_selection; } /* Set the maximum number of days before whole weeks are selected */ void -e_calendar_item_set_days_start_week_sel (ECalendarItem *calitem, - gint days) +e_calendar_item_set_days_start_week_sel (ECalendarItem *calitem, + gint days) { calitem->days_to_start_week_selection = days; } gboolean -e_calendar_item_get_display_popup (ECalendarItem *calitem) +e_calendar_item_get_display_popup (ECalendarItem *calitem) { return calitem->display_popup; } void -e_calendar_item_set_display_popup (ECalendarItem *calitem, - gboolean display) +e_calendar_item_set_display_popup (ECalendarItem *calitem, + gboolean display) { calitem->display_popup = display; } /* This will make sure that the given year & month are valid, i.e. if month - is < 0 or > 11 the year and month will be updated accordingly. */ + * is < 0 or > 11 the year and month will be updated accordingly. */ void -e_calendar_item_normalize_date (ECalendarItem *calitem, - gint *year, - gint *month) +e_calendar_item_normalize_date (ECalendarItem *calitem, + gint *year, + gint *month) { if (*month >= 0) { *year += *month / 12; @@ -2781,11 +2793,11 @@ e_calendar_item_normalize_date (ECalendarItem *calitem, } /* Adds or subtracts days from the selection. It is used when we switch months - and the selection extends past the end of a month but we want to keep the - number of days selected the same. days should not be more than 30. */ + * and the selection extends past the end of a month but we want to keep the + * number of days selected the same. days should not be more than 30. */ static void -e_calendar_item_add_days_to_selection (ECalendarItem *calitem, - gint days) +e_calendar_item_add_days_to_selection (ECalendarItem *calitem, + gint days) { gint year, month, days_in_month; @@ -2809,17 +2821,17 @@ e_calendar_item_add_days_to_selection (ECalendarItem *calitem, } /* Gets the range of dates actually shown. Months are 0 to 11. - This also includes the last days of the previous month and the first days - of the following month, which are normally shown in gray. - It returns FALSE if no dates are currently shown. */ + * This also includes the last days of the previous month and the first days + * of the following month, which are normally shown in gray. + * It returns FALSE if no dates are currently shown. */ gboolean -e_calendar_item_get_date_range (ECalendarItem *calitem, - gint *start_year, - gint *start_month, - gint *start_day, - gint *end_year, - gint *end_month, - gint *end_day) +e_calendar_item_get_date_range (ECalendarItem *calitem, + gint *start_year, + gint *start_month, + gint *start_day, + gint *end_year, + gint *end_month, + gint *end_day) { gint first_day_offset, days_in_month, days_in_prev_month; @@ -2827,7 +2839,7 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, return FALSE; /* Calculate the first day shown. This will be one of the greyed-out - days before the first full month begins. */ + * days before the first full month begins. */ e_calendar_item_get_month_info (calitem, 0, 0, &first_day_offset, &days_in_month, &days_in_prev_month); *start_year = calitem->year; @@ -2839,7 +2851,7 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, *start_day = days_in_prev_month + 1 - first_day_offset; /* Calculate the last day shown. This will be one of the greyed-out - days after the last full month ends. */ + * days after the last full month ends. */ e_calendar_item_get_month_info (calitem, calitem->rows - 1, calitem->cols - 1, &first_day_offset, &days_in_month, &days_in_prev_month); @@ -2853,9 +2865,9 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, } /* Simple way to mark days so they appear bold. - A more flexible interface may be added later. */ + * A more flexible interface may be added later. */ void -e_calendar_item_clear_marks (ECalendarItem *calitem) +e_calendar_item_clear_marks (ECalendarItem *calitem) { GnomeCanvasItem *item; @@ -2870,12 +2882,12 @@ e_calendar_item_clear_marks (ECalendarItem *calitem) /* add_day_style - whether bit-or with the actual style or change the style fully */ void -e_calendar_item_mark_day (ECalendarItem *calitem, - gint year, - gint month, - gint day, - guint8 day_style, - gboolean add_day_style) +e_calendar_item_mark_day (ECalendarItem *calitem, + gint year, + gint month, + gint day, + guint8 day_style, + gboolean add_day_style) { gint month_offset; gint index; @@ -2895,15 +2907,15 @@ e_calendar_item_mark_day (ECalendarItem *calitem, } void -e_calendar_item_mark_days (ECalendarItem *calitem, - gint start_year, - gint start_month, - gint start_day, - gint end_year, - gint end_month, - gint end_day, - guint8 day_style, - gboolean add_day_style) +e_calendar_item_mark_days (ECalendarItem *calitem, + gint start_year, + gint start_month, + gint start_day, + gint end_year, + gint end_month, + gint end_day, + guint8 day_style, + gboolean add_day_style) { gint month_offset, end_month_offset, day; @@ -2964,9 +2976,9 @@ e_calendar_item_mark_days (ECalendarItem *calitem, /* Rounds up the given day to the end of the week. */ static void -e_calendar_item_round_up_selection (ECalendarItem *calitem, - gint *month_offset, - gint *day) +e_calendar_item_round_up_selection (ECalendarItem *calitem, + gint *month_offset, + gint *day) { gint year, month, weekday, days, days_in_month; struct tm tmp_tm = { 0 }; @@ -2997,9 +3009,9 @@ e_calendar_item_round_up_selection (ECalendarItem *calitem, /* Rounds down the given day to the start of the week. */ static void -e_calendar_item_round_down_selection (ECalendarItem *calitem, - gint *month_offset, - gint *day) +e_calendar_item_round_down_selection (ECalendarItem *calitem, + gint *month_offset, + gint *day) { gint year, month, weekday, days, days_in_month; struct tm tmp_tm = { 0 }; @@ -3034,11 +3046,11 @@ e_calendar_item_round_down_selection (ECalendarItem *calitem, } static gint -e_calendar_item_get_inclusive_days (ECalendarItem *calitem, - gint start_month_offset, - gint start_day, - gint end_month_offset, - gint end_day) +e_calendar_item_get_inclusive_days (ECalendarItem *calitem, + gint start_month_offset, + gint start_day, + gint end_month_offset, + gint end_day) { gint start_year, start_month, end_year, end_month, days = 0; @@ -3065,11 +3077,11 @@ e_calendar_item_get_inclusive_days (ECalendarItem *calitem, } /* If the day is off the end of the month it is set to the last day of the - month. */ + * month. */ static void -e_calendar_item_ensure_valid_day (ECalendarItem *calitem, - gint *month_offset, - gint *day) +e_calendar_item_ensure_valid_day (ECalendarItem *calitem, + gint *month_offset, + gint *day) { gint year, month, days_in_month; @@ -3083,9 +3095,9 @@ e_calendar_item_ensure_valid_day (ECalendarItem *calitem, } gboolean -e_calendar_item_get_selection (ECalendarItem *calitem, - GDate *start_date, - GDate *end_date) +e_calendar_item_get_selection (ECalendarItem *calitem, + GDate *start_date, + GDate *end_date) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -3113,10 +3125,10 @@ e_calendar_item_get_selection (ECalendarItem *calitem, } static void -e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, - const GDate *start_date, - const GDate *end_date, - gboolean emission) +e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, + const GDate *start_date, + const GDate *end_date, + gboolean emission) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -3127,7 +3139,7 @@ e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, g_return_if_fail (E_IS_CALENDAR_ITEM (calitem)); /* If start_date is NULL, we clear the selection without changing the - month shown. */ + * month shown. */ if (start_date == NULL) { calitem->selection_set = FALSE; calitem->selection_changed = TRUE; @@ -3192,7 +3204,8 @@ e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, } void -e_calendar_item_style_set (GtkWidget *widget, ECalendarItem *calitem) +e_calendar_item_style_set (GtkWidget *widget, + ECalendarItem *calitem) { GtkStyle *style; GdkColor *color; @@ -3216,9 +3229,9 @@ e_calendar_item_style_set (GtkWidget *widget, ECalendarItem *calitem) } void -e_calendar_item_set_selection (ECalendarItem *calitem, - const GDate *start_date, - const GDate *end_date) +e_calendar_item_set_selection (ECalendarItem *calitem, + const GDate *start_date, + const GDate *end_date) { /* If the user is in the middle of a selection, we must abort it. */ if (calitem->selecting) { @@ -3233,18 +3246,18 @@ e_calendar_item_set_selection (ECalendarItem *calitem, } /* This tries to ensure that the given time range is visible. If the range - given is longer than we can show, only the start of it will be visible. - Note that this will not update the selection. That should be done somewhere - else. It returns TRUE if the visible range has been changed. */ + * given is longer than we can show, only the start of it will be visible. + * Note that this will not update the selection. That should be done somewhere + * else. It returns TRUE if the visible range has been changed. */ static gboolean -e_calendar_item_ensure_days_visible (ECalendarItem *calitem, - gint start_year, - gint start_month, - gint start_day, - gint end_year, - gint end_month, - gint end_day, - gboolean emission) +e_calendar_item_ensure_days_visible (ECalendarItem *calitem, + gint start_year, + gint start_month, + gint start_day, + gint end_year, + gint end_month, + gint end_day, + gboolean emission) { gint current_end_year, current_end_month; gint months_shown; @@ -3264,7 +3277,7 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, current_end_month == 11 && end_month == 0) || (end_year == current_end_year && end_month == current_end_month + 1)) { /* See if the end of the selection will fit in the - leftover days of the month after the last one shown. */ + * leftover days of the month after the last one shown. */ calitem->month += (months_shown - 1); e_calendar_item_normalize_date (calitem, &calitem->year, &calitem->month); @@ -3301,14 +3314,14 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, } /* Now try to ensure that the start month is shown. We do this after - the end month so that the start month will always be shown. */ + * the end month so that the start month will always be shown. */ if (start_year < calitem->year || (start_year == calitem->year && start_month < calitem->month)) { need_update = TRUE; /* First we see if the start of the selection will fit in the - leftover days of the month before the first one shown. */ + * leftover days of the month before the first one shown. */ calitem->year = start_year; calitem->month = start_month + 1; e_calendar_item_normalize_date (calitem, &calitem->year, @@ -3348,9 +3361,9 @@ deactivate_menu_cb (GtkWidget *menu) } static void -e_calendar_item_show_popup_menu (ECalendarItem *calitem, - GdkEventButton *event, - gint month_offset) +e_calendar_item_show_popup_menu (ECalendarItem *calitem, + GdkEventButton *event, + gint month_offset) { GtkWidget *menu, *submenu, *menuitem, *label; gint year, month; @@ -3388,7 +3401,7 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem, g_object_set_data(G_OBJECT(menuitem), "month", GINT_TO_POINTER (month)); - g_signal_connect((menuitem), "activate", + g_signal_connect ((menuitem), "activate", G_CALLBACK (e_calendar_item_on_menu_item_activate), calitem); } } @@ -3400,8 +3413,8 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem, } static void -e_calendar_item_on_menu_item_activate (GtkWidget *menuitem, - ECalendarItem *calitem) +e_calendar_item_on_menu_item_activate (GtkWidget *menuitem, + ECalendarItem *calitem) { GtkWidget *parent; gint year, month_offset, month; @@ -3424,11 +3437,11 @@ e_calendar_item_on_menu_item_activate (GtkWidget *menuitem, } static void -e_calendar_item_position_menu (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) +e_calendar_item_position_menu (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) { GtkRequisition requisition; gint screen_width, screen_height; @@ -3449,10 +3462,10 @@ e_calendar_item_position_menu (GtkMenu *menu, /* Sets the function to call to get the colors to use for a particular day. */ void -e_calendar_item_set_style_callback (ECalendarItem *calitem, - ECalendarItemStyleCallback cb, - gpointer data, - GDestroyNotify destroy) +e_calendar_item_set_style_callback (ECalendarItem *calitem, + ECalendarItemStyleCallback cb, + gpointer data, + GDestroyNotify destroy) { g_return_if_fail (E_IS_CALENDAR_ITEM (calitem)); @@ -3465,7 +3478,7 @@ e_calendar_item_set_style_callback (ECalendarItem *calitem, } static void -e_calendar_item_date_range_changed (ECalendarItem *calitem) +e_calendar_item_date_range_changed (ECalendarItem *calitem) { g_free (calitem->styles); calitem->styles = NULL; @@ -3474,7 +3487,7 @@ e_calendar_item_date_range_changed (ECalendarItem *calitem) } static void -e_calendar_item_queue_signal_emission (ECalendarItem *calitem) +e_calendar_item_queue_signal_emission (ECalendarItem *calitem) { if (calitem->signal_emission_idle_id == 0) { calitem->signal_emission_idle_id = g_idle_add_full ( @@ -3485,7 +3498,7 @@ e_calendar_item_queue_signal_emission (ECalendarItem *calitem) } static gboolean -e_calendar_item_signal_emission_idle_cb (gpointer data) +e_calendar_item_signal_emission_idle_cb (gpointer data) { ECalendarItem *calitem; @@ -3498,7 +3511,7 @@ e_calendar_item_signal_emission_idle_cb (gpointer data) calitem->signal_emission_idle_id = 0; /* We ref the calitem & check in case it gets destroyed, since we - were getting a free memory write here. */ + * were getting a free memory write here. */ g_object_ref ((calitem)); if (calitem->date_range_changed) { @@ -3518,13 +3531,13 @@ e_calendar_item_signal_emission_idle_cb (gpointer data) } /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void -e_calendar_item_set_get_time_callback (ECalendarItem *calitem, - ECalendarItemGetTimeCallback cb, - gpointer data, - GDestroyNotify destroy) +e_calendar_item_set_get_time_callback (ECalendarItem *calitem, + ECalendarItemGetTimeCallback cb, + gpointer data, + GDestroyNotify destroy) { g_return_if_fail (E_IS_CALENDAR_ITEM (calitem)); diff --git a/widgets/misc/e-calendar-item.h b/widgets/misc/e-calendar-item.h index 0b07cc7b25..19f096c5b2 100644 --- a/widgets/misc/e-calendar-item.h +++ b/widgets/misc/e-calendar-item.h @@ -86,7 +86,7 @@ typedef struct _ECalendarItem ECalendarItem; typedef struct _ECalendarItemClass ECalendarItemClass; /* The type of the callback function optionally used to get the colors to - use for each day. */ + * use for each day. */ typedef void (*ECalendarItemStyleCallback) (ECalendarItem *calitem, gint year, gint month, @@ -137,10 +137,10 @@ struct _ECalendarItem gint month; /* 0 to 11 */ /* Points to an array of styles, one gchar for each day. We use 32 - chars for each month, with n + 2 months, where n is the number of - complete months shown (since we show some days before the first - month and after the last month grayes out). - A value of 0 is the default, and 1 is bold. */ + * chars for each month, with n + 2 months, where n is the number of + * complete months shown (since we show some days before the first + * month and after the last month grayes out). + * A value of 0 is the default, and 1 is bold. */ guint8 *styles; /* @@ -148,8 +148,8 @@ struct _ECalendarItem */ /* The minimum & maximum number of rows & columns of months. - If the maximum values are -1 then there is no maximum. - The minimum valies default to 1. The maximum values to -1. */ + * If the maximum values are -1 then there is no maximum. + * The minimum valies default to 1. The maximum values to -1. */ gint min_rows; gint min_cols; gint max_rows; @@ -174,16 +174,16 @@ struct _ECalendarItem gint max_days_selected; /* The number of days selected before we switch to selecting whole - weeks, or -1 if we never switch. Defaults to -1. */ + * weeks, or -1 if we never switch. Defaults to -1. */ gint days_to_start_week_selection; /* Whether the selection is moved when we move back/forward one month. - Used for things like the EDateEdit which only want the selection to - be changed when the user explicitly selects a day. */ + * Used for things like the EDateEdit which only want the selection to + * be changed when the user explicitly selects a day. */ gboolean move_selection_when_moving; /* Whether the selection day is preserved when we move back/forward - one month. Used for the work week and week view. */ + * one month. Used for the work week and week view. */ gboolean preserve_day_when_moving; /* Whether to display the pop-up, TRUE by default */ @@ -216,8 +216,8 @@ struct _ECalendarItem gint cell_height; /* The current selection. The month offsets are from 0, which is the - top-left calendar month view. Note that -1 is used for the last days - from the previous month. The days are real month days. */ + * top-left calendar month view. Note that -1 is used for the last days + * from the previous month. The days are real month days. */ gboolean selecting; GDate *selecting_axis; gboolean selection_dragging_end; @@ -242,7 +242,7 @@ struct _ECalendarItem gint max_week_number_digit_width; /* Fonts for drawing text. If font isn't set it uses the font from the - canvas widget. If week_number_font isn't set it uses font. */ + * canvas widget. If week_number_font isn't set it uses font. */ PangoFontDescription *font_desc; PangoFontDescription *week_number_font_desc; @@ -261,9 +261,9 @@ struct _ECalendarItem gint signal_emission_idle_id; /* A flag to indicate that the selection or date range has changed. - When set the idle function will emit the signal and reset it to - FALSE. This is so we don't emit it several times when args are set - etc. */ + * When set the idle function will emit the signal and reset it to + * FALSE. This is so we don't emit it several times when args are set + * etc. */ gboolean selection_changed; gboolean date_range_changed; }; @@ -311,9 +311,9 @@ void e_calendar_item_set_display_popup (ECalendarItem *calitem, gboolean display); /* Gets the range of dates actually shown. Months are 0 to 11. - This also includes the last days of the previous month and the first days - of the following month, which are normally shown in gray. - It returns FALSE if no dates are currently shown. */ + * This also includes the last days of the previous month and the first days + * of the following month, which are normally shown in gray. + * It returns FALSE if no dates are currently shown. */ gboolean e_calendar_item_get_date_range (ECalendarItem *calitem, gint *start_year, @@ -324,22 +324,22 @@ gboolean gint *end_day); /* Returns the selected date range. It returns FALSE if no days are currently - selected. */ + * selected. */ gboolean e_calendar_item_get_selection (ECalendarItem *calitem, GDate *start_date, GDate *end_date); /* Sets the selected date range, and changes the date range shown so at least - the start of the selection is shown. If start_date is NULL it clears the - selection. */ + * the start of the selection is shown. If start_date is NULL it clears the + * selection. */ void e_calendar_item_set_selection (ECalendarItem *calitem, const GDate *start_date, const GDate *end_date); /* Marks a particular day. Passing E_CALENDAR_ITEM_MARK_BOLD as the day style - will result in the day being shown as bold by default. The style callback - could support more day_styles, or the style callback could determine the - colors itself, without needing to mark days. */ + * will result in the day being shown as bold by default. The style callback + * could support more day_styles, or the style callback could determine the + * colors itself, without needing to mark days. */ void e_calendar_item_clear_marks (ECalendarItem *calitem); void e_calendar_item_mark_day (ECalendarItem *calitem, gint year, @@ -349,7 +349,7 @@ void e_calendar_item_mark_day (ECalendarItem *calitem, gboolean add_day_style); /* Mark a range of days. Any days outside the currently shown range are - ignored. */ + * ignored. */ void e_calendar_item_mark_days (ECalendarItem *calitem, gint start_year, gint start_month, @@ -367,8 +367,8 @@ void e_calendar_item_set_style_callback (ECalendarItem *calitem, GDestroyNotify destroy); /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void e_calendar_item_set_get_time_callback (ECalendarItem *calitem, ECalendarItemGetTimeCallback cb, gpointer data, diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index 2c0c6ab9c0..1899d7c61f 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -51,7 +51,7 @@ #define E_CALENDAR_ARROW_BUTTON_Y_PAD 0 /* Vertical padding. The padding above the button includes the space for the - horizontal line. */ + * horizontal line. */ #define E_CALENDAR_YPAD_ABOVE_LOWER_BUTTONS 4 #define E_CALENDAR_YPAD_BELOW_LOWER_BUTTONS 3 @@ -60,8 +60,8 @@ #define E_CALENDAR_XPAD_BUTTONS 8 /* The time between steps when the prev/next buttons is pressed, in 1/1000ths - of a second, and the number of timeouts we skip before we start - automatically moving back/forward. */ + * of a second, and the number of timeouts we skip before we start + * automatically moving back/forward. */ #define E_CALENDAR_AUTO_MOVE_TIMEOUT 150 #define E_CALENDAR_AUTO_MOVE_TIMEOUT_DELAY 2 @@ -216,7 +216,7 @@ e_calendar_init (ECalendar *cal) * Creates a new #ECalendar. **/ GtkWidget * -e_calendar_new (void) +e_calendar_new (void) { GtkWidget *cal; AtkObject *a11y; @@ -229,7 +229,7 @@ e_calendar_new (void) } static void -e_calendar_dispose (GObject *object) +e_calendar_dispose (GObject *object) { ECalendar *cal; @@ -256,15 +256,15 @@ e_calendar_realize (GtkWidget *widget) (*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. */ + * or the arrow buttons are not displayed properly. */ 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 -e_calendar_style_set (GtkWidget *widget, - GtkStyle *previous_style) +e_calendar_style_set (GtkWidget *widget, + GtkStyle *previous_style) { ECalendar *e_calendar; @@ -274,7 +274,7 @@ e_calendar_style_set (GtkWidget *widget, previous_style); /* Set the background of the canvas window to the normal color, - or the arrow buttons are not displayed properly. */ + * or the arrow buttons are not displayed properly. */ if (gtk_widget_get_realized (widget)) { GtkStyle *style; GdkWindow *window; @@ -288,8 +288,8 @@ e_calendar_style_set (GtkWidget *widget, static void e_calendar_get_preferred_width (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { ECalendar *cal; GtkStyle *style; @@ -305,8 +305,8 @@ e_calendar_get_preferred_width (GtkWidget *widget, static void e_calendar_get_preferred_height (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { ECalendar *cal; GtkStyle *style; @@ -321,8 +321,8 @@ e_calendar_get_preferred_height (GtkWidget *widget, } static void -e_calendar_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) +e_calendar_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { ECalendar *cal; GtkStyle *style; @@ -398,9 +398,9 @@ e_calendar_size_allocate (GtkWidget *widget, } void -e_calendar_set_minimum_size (ECalendar *cal, - gint rows, - gint cols) +e_calendar_set_minimum_size (ECalendar *cal, + gint rows, + gint cols) { g_return_if_fail (E_IS_CALENDAR (cal)); @@ -416,9 +416,9 @@ e_calendar_set_minimum_size (ECalendar *cal, } void -e_calendar_set_maximum_size (ECalendar *cal, - gint rows, - gint cols) +e_calendar_set_maximum_size (ECalendar *cal, + gint rows, + gint cols) { g_return_if_fail (E_IS_CALENDAR (cal)); @@ -435,11 +435,11 @@ e_calendar_set_maximum_size (ECalendar *cal, /* Returns the border size on each side of the month displays. */ void -e_calendar_get_border_size (ECalendar *cal, - gint *top, - gint *bottom, - gint *left, - gint *right) +e_calendar_get_border_size (ECalendar *cal, + gint *top, + gint *bottom, + gint *left, + gint *right) { GtkStyle *style; @@ -458,20 +458,20 @@ e_calendar_get_border_size (ECalendar *cal, } static void -e_calendar_on_prev_pressed (ECalendar *cal) +e_calendar_on_prev_pressed (ECalendar *cal) { e_calendar_start_auto_move (cal, FALSE); } static void -e_calendar_on_next_pressed (ECalendar *cal) +e_calendar_on_next_pressed (ECalendar *cal) { e_calendar_start_auto_move (cal, TRUE); } static void -e_calendar_start_auto_move (ECalendar *cal, - gboolean moving_forward) +e_calendar_start_auto_move (ECalendar *cal, + gboolean moving_forward) { if (cal->timeout_id == 0) { cal->timeout_id = g_timeout_add (E_CALENDAR_AUTO_MOVE_TIMEOUT, @@ -484,7 +484,7 @@ e_calendar_start_auto_move (ECalendar *cal, } static gboolean -e_calendar_auto_move_handler (gpointer data) +e_calendar_auto_move_handler (gpointer data) { ECalendar *cal; ECalendarItem *calitem; @@ -510,19 +510,19 @@ e_calendar_auto_move_handler (gpointer data) } static void -e_calendar_on_prev_released (ECalendar *cal) +e_calendar_on_prev_released (ECalendar *cal) { e_calendar_stop_auto_move (cal); } static void -e_calendar_on_next_released (ECalendar *cal) +e_calendar_on_next_released (ECalendar *cal) { e_calendar_stop_auto_move (cal); } static void -e_calendar_stop_auto_move (ECalendar *cal) +e_calendar_stop_auto_move (ECalendar *cal) { if (cal->timeout_id != 0) { g_source_remove (cal->timeout_id); @@ -531,45 +531,38 @@ e_calendar_stop_auto_move (ECalendar *cal) } static void -e_calendar_on_prev_clicked (ECalendar *cal) +e_calendar_on_prev_clicked (ECalendar *cal) { e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, cal->calitem->month - 1); } static void -e_calendar_on_next_clicked (ECalendar *cal) +e_calendar_on_next_clicked (ECalendar *cal) { e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, cal->calitem->month + 1); } static gint -e_calendar_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time) +e_calendar_drag_motion (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time) { -#if 0 - g_print ("In e_calendar_drag_motion\n"); -#endif - return FALSE; } static void -e_calendar_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time) +e_calendar_drag_leave (GtkWidget *widget, + GdkDragContext *context, + guint time) { -#if 0 - g_print ("In e_calendar_drag_leave\n"); -#endif } static gboolean -e_calendar_button_has_focus (ECalendar *cal) +e_calendar_button_has_focus (ECalendar *cal) { GtkWidget *prev_widget, *next_widget; gboolean ret_val; @@ -584,7 +577,8 @@ e_calendar_button_has_focus (ECalendar *cal) } static gboolean -e_calendar_focus (GtkWidget *widget, GtkDirectionType direction) +e_calendar_focus (GtkWidget *widget, + GtkDirectionType direction) { #define E_CALENDAR_FOCUS_CHILDREN_NUM 3 ECalendar *cal; @@ -641,7 +635,8 @@ e_calendar_focus (GtkWidget *widget, GtkDirectionType direction) } void -e_calendar_set_focusable (ECalendar *cal, gboolean focusable) +e_calendar_set_focusable (ECalendar *cal, + gboolean focusable) { GtkWidget *widget; GtkWidget *prev_widget, *next_widget; diff --git a/widgets/misc/e-calendar.h b/widgets/misc/e-calendar.h index a3d979c07e..027a1c1fc3 100644 --- a/widgets/misc/e-calendar.h +++ b/widgets/misc/e-calendar.h @@ -74,8 +74,8 @@ struct _ECalendar { gint max_cols; /* These are all used when the prev/next buttons are held down. - moving_forward is TRUE if we are moving forward in time, i.e. the - next button is pressed. */ + * moving_forward is TRUE if we are moving forward in time, i.e. the + * next button is pressed. */ gint timeout_id; gint timeout_delay; gboolean moving_forward; diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index dc415777d9..ea45aab4d5 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -68,7 +68,11 @@ enum { }; static void -ecb_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2) +ecb_bounds (GnomeCanvasItem *item, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2) { *x1 = -G_MAXDOUBLE; *y1 = -G_MAXDOUBLE; @@ -77,7 +81,9 @@ ecb_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdoubl } static void -ecb_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +ecb_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { gdouble x1, y1, x2, y2; @@ -112,9 +118,9 @@ ecb_dispose (GObject *object) static void ecb_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECanvasBackground *ecb; @@ -123,7 +129,7 @@ ecb_set_property (GObject *object, ecb = E_CANVAS_BACKGROUND (object); - switch (prop_id) { + switch (property_id) { case PROP_FILL_COLOR: if (g_value_get_string (value)) gdk_color_parse (g_value_get_string (value), &color); @@ -157,20 +163,20 @@ ecb_set_property (GObject *object, static void ecb_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ECanvasBackground *ecb; ecb = E_CANVAS_BACKGROUND (object); - switch (prop_id) { + switch (property_id) { case PROP_FILL_COLOR_RGBA: g_value_set_uint (value, ecb->priv->rgba); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -202,7 +208,11 @@ ecb_draw (GnomeCanvasItem *item, } static GnomeCanvasItem * -ecb_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +ecb_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } diff --git a/widgets/misc/e-canvas-utils.c b/widgets/misc/e-canvas-utils.c index 4a697f8ed2..ec3aad3858 100644 --- a/widgets/misc/e-canvas-utils.c +++ b/widgets/misc/e-canvas-utils.c @@ -28,7 +28,9 @@ #include "e-canvas-utils.h" void -e_canvas_item_move_absolute (GnomeCanvasItem *item, gdouble dx, gdouble dy) +e_canvas_item_move_absolute (GnomeCanvasItem *item, + gdouble dx, + gdouble dy) { cairo_matrix_t translate; @@ -40,7 +42,10 @@ e_canvas_item_move_absolute (GnomeCanvasItem *item, gdouble dx, gdouble dy) } static double -compute_offset (gint top, gint bottom, gint page_top, gint page_bottom) +compute_offset (gint top, + gint bottom, + gint page_top, + gint page_bottom) { gint size = bottom - top; gint offset = 0; @@ -67,7 +72,11 @@ compute_offset (gint top, gint bottom, gint page_top, gint page_bottom) } static void -e_canvas_show_area (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gdouble y2) +e_canvas_show_area (GnomeCanvas *canvas, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { GtkAdjustment *h, *v; gint dx = 0, dy = 0; @@ -99,7 +108,11 @@ e_canvas_show_area (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gdo } void -e_canvas_item_show_area (GnomeCanvasItem *item, gdouble x1, gdouble y1, gdouble x2, gdouble y2) +e_canvas_item_show_area (GnomeCanvasItem *item, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { g_return_if_fail (item != NULL); g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); @@ -111,7 +124,11 @@ e_canvas_item_show_area (GnomeCanvasItem *item, gdouble x1, gdouble y1, gdouble } static gboolean -e_canvas_area_shown (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gdouble y2) +e_canvas_area_shown (GnomeCanvas *canvas, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { GtkAdjustment *h, *v; gint dx = 0, dy = 0; @@ -144,7 +161,11 @@ e_canvas_area_shown (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gd } gboolean -e_canvas_item_area_shown (GnomeCanvasItem *item, gdouble x1, gdouble y1, gdouble x2, gdouble y2) +e_canvas_item_area_shown (GnomeCanvasItem *item, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { g_return_val_if_fail (item != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CANVAS_ITEM (item), FALSE); @@ -175,7 +196,12 @@ show_area_timeout (gpointer data) } void -e_canvas_item_show_area_delayed (GnomeCanvasItem *item, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gint delay) +e_canvas_item_show_area_delayed (GnomeCanvasItem *item, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gint delay) { DoubsAndCanvas *dac; diff --git a/widgets/misc/e-canvas-utils.h b/widgets/misc/e-canvas-utils.h index 8f7600e72d..0843ba8f17 100644 --- a/widgets/misc/e-canvas-utils.h +++ b/widgets/misc/e-canvas-utils.h @@ -42,8 +42,8 @@ void e_canvas_item_show_area_delayed (GnomeCanvasItem *item, gdouble y2, gint delay); /* Returns TRUE if the area is already shown on the screen (including - spacing.) This is equivelent to returning FALSE iff show_area - would do anything. */ + * spacing.) This is equivelent to returning FALSE iff show_area + * would do anything. */ gboolean e_canvas_item_area_shown (GnomeCanvasItem *item, gdouble x1, gdouble y1, diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c index 1513e44eb2..1b7e6ac900 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/widgets/misc/e-canvas-vbox.c @@ -36,8 +36,8 @@ #include "e-canvas-utils.h" #include "e-canvas-vbox.h" -static void e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_canvas_vbox_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_canvas_vbox_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_canvas_vbox_dispose (GObject *object); static gint e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event); @@ -69,7 +69,7 @@ e_canvas_vbox_class_init (ECanvasVboxClass *klass) GObjectClass *object_class; GnomeCanvasItemClass *item_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; item_class = (GnomeCanvasItemClass *) klass; klass->add_item = e_canvas_vbox_real_add_item; @@ -123,7 +123,10 @@ e_canvas_vbox_init (ECanvasVbox *vbox) } static void -e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_canvas_vbox_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; ECanvasVbox *e_canvas_vbox; @@ -131,7 +134,7 @@ e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, item = GNOME_CANVAS_ITEM (object); e_canvas_vbox = E_CANVAS_VBOX (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: case PROP_MINIMUM_WIDTH: e_canvas_vbox->minimum_width = g_value_get_double (value); @@ -146,13 +149,16 @@ e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, } static void -e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_canvas_vbox_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ECanvasVbox *e_canvas_vbox; e_canvas_vbox = E_CANVAS_VBOX (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, e_canvas_vbox->width); break; @@ -166,14 +172,15 @@ e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GPara g_value_set_double (value, e_canvas_vbox->spacing); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } /* Used from g_list_foreach(); disconnects from an item's signals */ static void -disconnect_item_cb (gpointer data, gpointer user_data) +disconnect_item_cb (gpointer data, + gpointer user_data) { ECanvasVbox *vbox; GnomeCanvasItem *item; @@ -202,7 +209,8 @@ e_canvas_vbox_dispose (GObject *object) } static gint -e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event) +e_canvas_vbox_event (GnomeCanvasItem *item, + GdkEvent *event) { gint return_val = TRUE; @@ -249,14 +257,16 @@ e_canvas_vbox_realize (GnomeCanvasItem *item) } static void -e_canvas_vbox_remove_item (gpointer data, GObject *where_object_was) +e_canvas_vbox_remove_item (gpointer data, + GObject *where_object_was) { ECanvasVbox *vbox = data; vbox->items = g_list_remove (vbox->items, where_object_was); } static void -e_canvas_vbox_real_add_item (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) +e_canvas_vbox_real_add_item (ECanvasVbox *e_canvas_vbox, + GnomeCanvasItem *item) { e_canvas_vbox->items = g_list_append (e_canvas_vbox->items, item); g_object_weak_ref (G_OBJECT (item), @@ -270,7 +280,8 @@ e_canvas_vbox_real_add_item (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) } static void -e_canvas_vbox_real_add_item_start (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) +e_canvas_vbox_real_add_item_start (ECanvasVbox *e_canvas_vbox, + GnomeCanvasItem *item) { e_canvas_vbox->items = g_list_prepend (e_canvas_vbox->items, item); g_object_weak_ref (G_OBJECT (item), @@ -299,7 +310,8 @@ e_canvas_vbox_resize_children (GnomeCanvasItem *item) } static void -e_canvas_vbox_reflow ( GnomeCanvasItem *item, gint flags ) +e_canvas_vbox_reflow (GnomeCanvasItem *item, + gint flags) { ECanvasVbox *e_canvas_vbox = E_CANVAS_VBOX (item); if (item->flags & GNOME_CANVAS_ITEM_REALIZED) { @@ -361,14 +373,16 @@ e_canvas_vbox_reflow ( GnomeCanvasItem *item, gint flags ) } void -e_canvas_vbox_add_item (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) +e_canvas_vbox_add_item (ECanvasVbox *e_canvas_vbox, + GnomeCanvasItem *item) { if (E_CANVAS_VBOX_CLASS (G_OBJECT_GET_CLASS (e_canvas_vbox))->add_item) (E_CANVAS_VBOX_CLASS (G_OBJECT_GET_CLASS (e_canvas_vbox))->add_item) (e_canvas_vbox, item); } void -e_canvas_vbox_add_item_start (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) +e_canvas_vbox_add_item_start (ECanvasVbox *e_canvas_vbox, + GnomeCanvasItem *item) { if (E_CANVAS_VBOX_CLASS (G_OBJECT_GET_CLASS (e_canvas_vbox))->add_item_start) (E_CANVAS_VBOX_CLASS (G_OBJECT_GET_CLASS (e_canvas_vbox))->add_item_start) (e_canvas_vbox, item); diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index b27b7182d7..5e6889fa8e 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -195,7 +195,8 @@ gnome_canvas_item_invoke_point (GnomeCanvasItem *item, #define DISPLAY_X1(canvas) (GNOME_CANVAS (canvas)->layout.xoffset) #define DISPLAY_Y1(canvas) (GNOME_CANVAS (canvas)->layout.yoffset) static gint -pick_current_item (GnomeCanvas *canvas, GdkEvent *event) +pick_current_item (GnomeCanvas *canvas, + GdkEvent *event) { gint button_down; gdouble x, y; diff --git a/widgets/misc/e-cell-renderer-combo.c b/widgets/misc/e-cell-renderer-combo.c index 5994c075c5..07382b9225 100644 --- a/widgets/misc/e-cell-renderer-combo.c +++ b/widgets/misc/e-cell-renderer-combo.c @@ -44,7 +44,8 @@ G_DEFINE_TYPE ( GTK_TYPE_CELL_RENDERER_TEXT) static void -ecrc_editing_done (GtkCellEditable *editable, ECellRendererCombo *cell) +ecrc_editing_done (GtkCellEditable *editable, + ECellRendererCombo *cell) { const gchar *new_text; @@ -59,8 +60,13 @@ ecrc_editing_done (GtkCellEditable *editable, ECellRendererCombo *cell) } static GtkCellEditable * -ecrc_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, - const GdkRectangle *bg_area, const GdkRectangle *cell_area, GtkCellRendererState flags) +ecrc_start_editing (GtkCellRenderer *cell, + GdkEvent *event, + GtkWidget *widget, + const gchar *path, + const GdkRectangle *bg_area, + const GdkRectangle *cell_area, + GtkCellRendererState flags) { ECellRendererCombo *combo_cell = E_CELL_RENDERER_COMBO (cell); GtkCellRendererText *text_cell = GTK_CELL_RENDERER_TEXT (cell); @@ -91,8 +97,13 @@ ecrc_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, c } static void -ecrc_get_size (GtkCellRenderer *cell, GtkWidget *widget, const GdkRectangle *cell_area, - gint *x_offset, gint *y_offset, gint *width, gint *height) +ecrc_get_size (GtkCellRenderer *cell, + GtkWidget *widget, + const GdkRectangle *cell_area, + gint *x_offset, + gint *y_offset, + gint *width, + gint *height) { GtkWidget *btn; GtkRequisition req; @@ -108,11 +119,14 @@ ecrc_get_size (GtkCellRenderer *cell, GtkWidget *widget, const GdkRectangle *cel } static void -ecrc_get_prop (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +ecrc_get_prop (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellRendererCombo *ecrc = E_CELL_RENDERER_COMBO (object); - switch (prop_id) { + switch (property_id) { case PROP_LIST: g_value_set_pointer (value, ecrc->priv->list); break; @@ -122,11 +136,14 @@ ecrc_get_prop (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) } static void -ecrc_set_prop (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +ecrc_set_prop (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellRendererCombo *ecrc = E_CELL_RENDERER_COMBO (object); - switch (prop_id) { + switch (property_id) { case PROP_LIST: ecrc->priv->list = g_value_get_pointer (value); break; diff --git a/widgets/misc/e-combo-cell-editable.c b/widgets/misc/e-combo-cell-editable.c index 49ce7ce733..00a8382833 100644 --- a/widgets/misc/e-combo-cell-editable.c +++ b/widgets/misc/e-combo-cell-editable.c @@ -61,7 +61,9 @@ kill_popup (EComboCellEditable *ecce) } static gboolean -popup_key_press_cb (GtkWidget *widget, GdkEventKey *event, EComboCellEditable *ecce) +popup_key_press_cb (GtkWidget *widget, + GdkEventKey *event, + EComboCellEditable *ecce) { switch (event->keyval) { case GDK_KEY_Escape: @@ -83,7 +85,9 @@ popup_key_press_cb (GtkWidget *widget, GdkEventKey *event, EComboCellEditable *e } static gboolean -popup_button_press_cb (GtkWidget *widget, GdkEventButton *event, EComboCellEditable *ecce) +popup_button_press_cb (GtkWidget *widget, + GdkEventButton *event, + EComboCellEditable *ecce) { GtkAllocation alloc; GdkWindow *window; @@ -110,14 +114,17 @@ popup_button_press_cb (GtkWidget *widget, GdkEventButton *event, EComboCellEdita } static gboolean -tree_button_release_cb (GtkWidget *widget, GdkEventButton *event, EComboCellEditable *ecce) +tree_button_release_cb (GtkWidget *widget, + GdkEventButton *event, + EComboCellEditable *ecce) { kill_popup (ecce); return TRUE; } static void -selection_changed_cb (GtkTreeSelection *selection, EComboCellEditable *ecce) +selection_changed_cb (GtkTreeSelection *selection, + EComboCellEditable *ecce) { GtkTreeModel *model; GtkTreeIter iter; @@ -179,7 +186,8 @@ build_popup (EComboCellEditable *ecce) } static gint -lookup_row (GList *list, const gchar *text) +lookup_row (GList *list, + const gchar *text) { GList *l; gint result = 0; @@ -192,7 +200,8 @@ lookup_row (GList *list, const gchar *text) } static void -set_cursor (GtkTreeView *tree_view, gint index) +set_cursor (GtkTreeView *tree_view, + gint index) { GtkTreePath *path = gtk_tree_path_new (); gtk_tree_path_append_index (path, index); @@ -210,7 +219,10 @@ grab_popup (GdkWindow *popup) } static void -position_popup (EComboCellEditable *ecce, gint x, gint y, gint offset) +position_popup (EComboCellEditable *ecce, + gint x, + gint y, + gint offset) { GtkRequisition req; @@ -258,7 +270,8 @@ show_popup (EComboCellEditable *ecce) } static void -button_clicked_cb (GtkButton *btn, EComboCellEditable *ecce) +button_clicked_cb (GtkButton *btn, + EComboCellEditable *ecce) { if (ecce->priv->popup) { kill_popup (ecce); @@ -269,14 +282,17 @@ button_clicked_cb (GtkButton *btn, EComboCellEditable *ecce) } static void -entry_activated_cb (GtkEntry *entry, EComboCellEditable *widget) +entry_activated_cb (GtkEntry *entry, + EComboCellEditable *widget) { gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (widget)); gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (widget)); } static gboolean -entry_key_press_event_cb (GtkEntry *entry, GdkEventKey *key_event, EComboCellEditable *ecce) +entry_key_press_event_cb (GtkEntry *entry, + GdkEventKey *key_event, + EComboCellEditable *ecce) { if (key_event->keyval == GDK_KEY_Escape) { ecce->priv->cancelled = TRUE; @@ -297,7 +313,8 @@ entry_key_press_event_cb (GtkEntry *entry, GdkEventKey *key_event, EComboCellEdi } static void -ecce_start_editing (GtkCellEditable *cell_editable, GdkEvent *event) +ecce_start_editing (GtkCellEditable *cell_editable, + GdkEvent *event) { EComboCellEditable *ecce = E_COMBO_CELL_EDITABLE (cell_editable); @@ -383,7 +400,8 @@ e_combo_cell_editable_get_list (EComboCellEditable *ecce) } void -e_combo_cell_editable_set_list (EComboCellEditable *ecce, GList *list) +e_combo_cell_editable_set_list (EComboCellEditable *ecce, + GList *list) { g_return_if_fail (E_IS_COMBO_CELL_EDITABLE (ecce)); @@ -399,7 +417,8 @@ e_combo_cell_editable_get_text (EComboCellEditable *ecce) } void -e_combo_cell_editable_set_text (EComboCellEditable *ecce, const gchar *text) +e_combo_cell_editable_set_text (EComboCellEditable *ecce, + const gchar *text) { g_return_if_fail (E_IS_COMBO_CELL_EDITABLE (ecce)); diff --git a/widgets/misc/e-contact-map-window.c b/widgets/misc/e-contact-map-window.c index 2984d4094d..9612f0d6ac 100644 --- a/widgets/misc/e-contact-map-window.c +++ b/widgets/misc/e-contact-map-window.c @@ -99,7 +99,7 @@ book_contacts_received_cb (GObject *source_object, for (p = contacts; p; p = p->next) e_contact_map_add_contact ( - window->priv->map, (EContact*) p->data); + window->priv->map, (EContact *) p->data); e_client_util_free_object_slist (contacts); g_object_unref (client); @@ -254,7 +254,7 @@ contact_map_window_entry_key_pressed_cb (GtkWidget *entry, static gboolean entry_completion_match_selected_cb (GtkEntryCompletion *widget, - GtkTreeModel* model, + GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { @@ -456,7 +456,7 @@ e_contact_map_window_load_addressbook (EContactMapWindow *map, g_return_if_fail (E_IS_BOOK_CLIENT (book_client)); /* Reference book, so that it does not get deleted before the callback is - involved. The book is unrefed in the callback */ + * involved. The book is unrefed in the callback */ g_object_ref (book_client); book_query = e_book_query_field_exists (E_CONTACT_ADDRESS); @@ -470,7 +470,7 @@ e_contact_map_window_load_addressbook (EContactMapWindow *map, g_free (query_string); } -EContactMap* +EContactMap * e_contact_map_window_get_map (EContactMapWindow *window) { g_return_val_if_fail (E_IS_CONTACT_MAP_WINDOW (window), NULL); diff --git a/widgets/misc/e-contact-map-window.h b/widgets/misc/e-contact-map-window.h index ea92d75c46..a73ce47e46 100644 --- a/widgets/misc/e-contact-map-window.h +++ b/widgets/misc/e-contact-map-window.h @@ -65,12 +65,12 @@ struct _EContactMapWindowClass { }; GType e_contact_map_window_get_type (void) G_GNUC_CONST; -EContactMapWindow* e_contact_map_window_new (void); +EContactMapWindow * e_contact_map_window_new (void); void e_contact_map_window_load_addressbook (EContactMapWindow *window, EBookClient *book); -EContactMap* e_contact_map_window_get_map (EContactMapWindow *window); +EContactMap * e_contact_map_window_get_map (EContactMapWindow *window); G_END_DECLS diff --git a/widgets/misc/e-contact-map.c b/widgets/misc/e-contact-map.c index dfe5454011..500600de7c 100644 --- a/widgets/misc/e-contact-map.c +++ b/widgets/misc/e-contact-map.c @@ -83,13 +83,13 @@ contact_map_geocode_address (EContactAddress *address) static void contact_map_address_resolved_cb (GeoclueGeocode *geocode, - GeocluePositionFields fields, - double latitude, - double longitude, - double altitude, - GeoclueAccuracy *accuracy, - GError *error, - struct GeoclueCallbackData *data) + GeocluePositionFields fields, + double latitude, + double longitude, + double altitude, + GeoclueAccuracy *accuracy, + GError *error, + struct GeoclueCallbackData *data) { EContactMapPrivate *priv; gpointer marker_ptr; @@ -101,8 +101,8 @@ contact_map_address_resolved_cb (GeoclueGeocode *geocode, g_return_if_fail (data->marker && E_IS_CONTACT_MARKER (data->marker)); /* If the marker_layer does not exist anymore, the map has probably been destroyed before this - callback was launched. It's not a failure, just silently clean up what was left behind - a pretend nothing happend */ + * callback was launched. It's not a failure, just silently clean up what was left behind + * a pretend nothing happend */ if (!data->map->priv->marker_layer || !CHAMPLAIN_IS_MARKER_LAYER (data->map->priv->marker_layer)) { goto exit; @@ -150,8 +150,8 @@ exit: static void resolve_marker_position (EContactMap *map, - EContactMarker *marker, - EContactAddress *address) + EContactMarker *marker, + EContactAddress *address) { GHashTable *details; @@ -166,7 +166,7 @@ resolve_marker_position (EContactMap *map, callback_data->marker = marker; /* Make sure the map won't cease to exist before the address - is resolved */ + * is resolved */ g_object_ref (map); geocoder = geoclue_geocode_new ("org.freedesktop.Geoclue.Providers.Yahoo", @@ -268,7 +268,7 @@ e_contact_map_init (EContactMap *map) map->priv->marker_layer = layer; } -GtkWidget* +GtkWidget * e_contact_map_new (void) { return g_object_new ( @@ -277,7 +277,7 @@ e_contact_map_new (void) void e_contact_map_add_contact (EContactMap *map, - EContact *contact) + EContact *contact) { EContactAddress *address; EContactPhoto *photo; @@ -312,10 +312,10 @@ e_contact_map_add_contact (EContactMap *map, void e_contact_map_add_marker (EContactMap *map, - const gchar *name, - const gchar *contact_uid, - EContactAddress *address, - EContactPhoto *photo) + const gchar *name, + const gchar *contact_uid, + EContactAddress *address, + EContactPhoto *photo) { EContactMarker *marker; @@ -335,7 +335,7 @@ e_contact_map_add_marker (EContactMap *map, */ void e_contact_map_remove_contact (EContactMap *map, - const gchar *name) + const gchar *name) { ChamplainMarker *marker; @@ -353,7 +353,7 @@ e_contact_map_remove_contact (EContactMap *map, void e_contact_map_remove_marker (EContactMap *map, - ClutterActor *marker) + ClutterActor *marker) { const gchar *name; @@ -367,7 +367,7 @@ e_contact_map_remove_marker (EContactMap *map, void e_contact_map_zoom_on_marker (EContactMap *map, - ClutterActor *marker) + ClutterActor *marker) { ChamplainView *view; gdouble lat, lng; @@ -384,7 +384,7 @@ e_contact_map_zoom_on_marker (EContactMap *map, champlain_view_set_zoom_level (view, 15); } -ChamplainView* +ChamplainView * e_contact_map_get_view (EContactMap *map) { g_return_val_if_fail (E_IS_CONTACT_MAP (map), NULL); diff --git a/widgets/misc/e-contact-map.h b/widgets/misc/e-contact-map.h index f2f98f72b6..a5ff813ad8 100644 --- a/widgets/misc/e-contact-map.h +++ b/widgets/misc/e-contact-map.h @@ -97,7 +97,7 @@ void e_contact_map_remove_marker (EContactMap *map, void e_contact_map_zoom_on_marker (EContactMap *map, ClutterActor *marker); -ChamplainView* e_contact_map_get_view (EContactMap *map); +ChamplainView * e_contact_map_get_view (EContactMap *map); G_END_DECLS diff --git a/widgets/misc/e-contact-marker.c b/widgets/misc/e-contact-marker.c index b5781c8c3b..7d7f57db25 100644 --- a/widgets/misc/e-contact-marker.c +++ b/widgets/misc/e-contact-marker.c @@ -74,8 +74,8 @@ static ClutterColor DEFAULT_COLOR = { 0x33, 0x33, 0x33, 0xff }; static gboolean contact_marker_clicked_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer user_data) + ClutterEvent *event, + gpointer user_data) { gint click_count = clutter_event_get_click_count (event); @@ -87,7 +87,7 @@ contact_marker_clicked_cb (ClutterActor *actor, static ClutterActor * texture_new_from_pixbuf (GdkPixbuf *pixbuf, - GError **error) + GError **error) { ClutterActor *texture = NULL; const guchar *data; @@ -114,7 +114,7 @@ texture_new_from_pixbuf (GdkPixbuf *pixbuf, return texture; } -static ClutterActor* +static ClutterActor * contact_photo_to_texture (EContactPhoto *photo) { GdkPixbuf *pixbuf; @@ -168,9 +168,9 @@ contact_photo_to_texture (EContactPhoto *photo) static void draw_box (cairo_t *cr, - gint width, - gint height, - gint point) + gint width, + gint height, + gint point) { cairo_move_to (cr, RADIUS, 0); cairo_line_to (cr, width - RADIUS, 0); @@ -185,9 +185,9 @@ draw_box (cairo_t *cr, static void draw_shadow (EContactMarker *marker, - gint width, - gint height, - gint point) + gint width, + gint height, + gint point) { EContactMarkerPrivate *priv = marker->priv; ClutterActor *shadow = NULL; @@ -232,9 +232,9 @@ draw_shadow (EContactMarker *marker, static void draw_background (EContactMarker *marker, - gint width, - gint height, - gint point) + gint width, + gint height, + gint point) { EContactMarkerPrivate *priv = marker->priv; ClutterActor *bg = NULL; @@ -295,7 +295,7 @@ draw_marker (EContactMarker *marker) ClutterText *text; if (priv->image) { - clutter_actor_set_position (priv->image, 2*PADDING, 2*PADDING); + clutter_actor_set_position (priv->image, 2 *PADDING, 2 *PADDING); if (clutter_actor_get_parent (priv->image) == NULL) clutter_container_add_actor ( CLUTTER_CONTAINER (priv->content_group), @@ -326,14 +326,14 @@ draw_marker (EContactMarker *marker) if (priv->image) { clutter_actor_set_width (priv->text_actor, clutter_actor_get_width (priv->image)); - total_height = clutter_actor_get_height (priv->image) + 2*PADDING + - clutter_actor_get_height (priv->text_actor) + 2*PADDING; - total_width = clutter_actor_get_width (priv->image) + 4*PADDING; + total_height = clutter_actor_get_height (priv->image) + 2 *PADDING + + clutter_actor_get_height (priv->text_actor) + 2 *PADDING; + total_width = clutter_actor_get_width (priv->image) + 4 *PADDING; clutter_actor_set_position (priv->text_actor, PADDING, - clutter_actor_get_height (priv->image)+2*PADDING+3); + clutter_actor_get_height (priv->image) + 2 *PADDING + 3); } else { - total_height = clutter_actor_get_height (priv->text_actor) + 2*PADDING; - total_width = clutter_actor_get_width (priv->text_actor) + 4*PADDING; + total_height = clutter_actor_get_height (priv->text_actor) + 2 *PADDING; + total_width = clutter_actor_get_width (priv->text_actor) + 4 *PADDING; clutter_actor_set_position (priv->text_actor, 2 * PADDING, PADDING); } @@ -395,8 +395,8 @@ queue_redraw (EContactMarker *marker) static void allocate (ClutterActor *self, - const ClutterActorBox *box, - ClutterAllocationFlags flags) + const ClutterActorBox *box, + ClutterAllocationFlags flags) { ClutterActorBox child_box; EContactMarkerPrivate *priv = E_CONTACT_MARKER (self)->priv; @@ -473,8 +473,8 @@ pick (ClutterActor *self, static void notify_selected (GObject *gobject, - G_GNUC_UNUSED GParamSpec *pspec, - G_GNUC_UNUSED gpointer user_data) + G_GNUC_UNUSED GParamSpec *pspec, + G_GNUC_UNUSED gpointer user_data) { queue_redraw (E_CONTACT_MARKER (gobject)); } @@ -573,8 +573,8 @@ e_contact_marker_init (EContactMarker *marker) ClutterActor * e_contact_marker_new (const gchar *name, - const gchar *contact_uid, - EContactPhoto *photo) + const gchar *contact_uid, + EContactPhoto *photo) { ClutterActor *marker = CLUTTER_ACTOR (g_object_new (E_TYPE_CONTACT_MARKER, NULL)); EContactMarkerPrivate *priv = E_CONTACT_MARKER (marker)->priv; diff --git a/widgets/misc/e-contact-marker.h b/widgets/misc/e-contact-marker.h index 7b332b15e7..996e922e1c 100644 --- a/widgets/misc/e-contact-marker.h +++ b/widgets/misc/e-contact-marker.h @@ -71,7 +71,7 @@ struct _EContactMarkerClass GType e_contact_marker_get_type (void); -ClutterActor* e_contact_marker_new (const gchar *name, +ClutterActor * e_contact_marker_new (const gchar *name, const gchar *contact_uid, EContactPhoto *photo); diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index acc3c08fe5..2a9eb7f457 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -56,7 +56,7 @@ struct _EDateEditPrivate { GtkWidget *now_button; GtkWidget *today_button; GtkWidget *none_button; /* This will only be visible if a - 'None' date/time is permitted. */ + * 'None' date/time is permitted. */ gboolean show_date; gboolean show_time; @@ -79,8 +79,8 @@ struct _EDateEditPrivate { gboolean date_is_valid; /* This is the last valid date which was set. If the date was set to - 'None' or empty, date_set_to_none will be TRUE and the other fields - are undefined, so don't use them. */ + * 'None' or empty, date_set_to_none will be TRUE and the other fields + * are undefined, so don't use them. */ gboolean date_set_to_none; gint year; gint month; @@ -95,8 +95,8 @@ struct _EDateEditPrivate { gboolean time_is_valid; /* This is the last valid time which was set. If the time was set to - 'None' or empty, time_set_to_none will be TRUE and the other fields - are undefined, so don't use them. */ + * 'None' or empty, time_set_to_none will be TRUE and the other fields + * are undefined, so don't use them. */ gboolean time_set_to_none; gint hour; gint minute; @@ -491,7 +491,7 @@ e_date_edit_init (EDateEdit *dedit) * Returns: a new #EDateEdit widget. */ GtkWidget * -e_date_edit_new (void) +e_date_edit_new (void) { EDateEdit *dedit; AtkObject *a11y; @@ -504,7 +504,7 @@ e_date_edit_new (void) } static void -create_children (EDateEdit *dedit) +create_children (EDateEdit *dedit) { EDateEditPrivate *priv; ECalendar *calendar; @@ -673,7 +673,7 @@ create_children (EDateEdit *dedit) G_CALLBACK (on_date_popup_today_button_clicked), dedit); /* Note that we don't show this here, since by default a 'None' date - is not permitted. */ + * is not permitted. */ priv->none_button = gtk_button_new_with_mnemonic (_("_None")); gtk_container_add (GTK_CONTAINER (bbox), priv->none_button); g_signal_connect (priv->none_button, "clicked", @@ -686,16 +686,17 @@ create_children (EDateEdit *dedit) /* GtkWidget::mnemonic_activate() handler for the EDateEdit */ static gboolean -e_date_edit_mnemonic_activate (GtkWidget *widget, gboolean group_cycling) +e_date_edit_mnemonic_activate (GtkWidget *widget, + gboolean group_cycling) { e_date_edit_grab_focus (widget); return TRUE; } /* Grab_focus handler for the EDateEdit. If the date field is being shown, we - grab the focus to that, otherwise we grab it to the time field. */ + * grab the focus to that, otherwise we grab it to the time field. */ static void -e_date_edit_grab_focus (GtkWidget *widget) +e_date_edit_grab_focus (GtkWidget *widget) { EDateEdit *dedit; GtkWidget *child; @@ -721,7 +722,8 @@ e_date_edit_grab_focus (GtkWidget *widget) * date from the GtkEntry. */ void -e_date_edit_set_editable (EDateEdit *dedit, gboolean editable) +e_date_edit_set_editable (EDateEdit *dedit, + gboolean editable) { EDateEditPrivate *priv; @@ -746,7 +748,7 @@ e_date_edit_set_editable (EDateEdit *dedit, gboolean editable) * check this with e_date_edit_time_is_valid(). */ time_t -e_date_edit_get_time (EDateEdit *dedit) +e_date_edit_get_time (EDateEdit *dedit) { EDateEditPrivate *priv; struct tm tmp_tm = { 0 }; @@ -793,8 +795,8 @@ e_date_edit_get_time (EDateEdit *dedit) * e_date_edit_set_date() and e_date_edit_set_time_of_day() instead. */ void -e_date_edit_set_time (EDateEdit *dedit, - time_t the_time) +e_date_edit_set_time (EDateEdit *dedit, + time_t the_time) { EDateEditPrivate *priv; struct tm tmp_tm; @@ -852,10 +854,10 @@ e_date_edit_set_time (EDateEdit *dedit, * Returns the last valid date entered into the date field. */ gboolean -e_date_edit_get_date (EDateEdit *dedit, - gint *year, - gint *month, - gint *day) +e_date_edit_get_date (EDateEdit *dedit, + gint *year, + gint *month, + gint *day) { EDateEditPrivate *priv; @@ -887,10 +889,10 @@ e_date_edit_get_date (EDateEdit *dedit, * Sets the date in the date field. */ void -e_date_edit_set_date (EDateEdit *dedit, - gint year, - gint month, - gint day) +e_date_edit_set_date (EDateEdit *dedit, + gint year, + gint month, + gint day) { gboolean date_changed = FALSE; @@ -918,9 +920,9 @@ e_date_edit_set_date (EDateEdit *dedit, * Returns the last valid time entered into the time field. */ gboolean -e_date_edit_get_time_of_day (EDateEdit *dedit, - gint *hour, - gint *minute) +e_date_edit_get_time_of_day (EDateEdit *dedit, + gint *hour, + gint *minute) { EDateEditPrivate *priv; @@ -951,9 +953,9 @@ e_date_edit_get_time_of_day (EDateEdit *dedit, * Description: Sets the time in the time field. */ void -e_date_edit_set_time_of_day (EDateEdit *dedit, - gint hour, - gint minute) +e_date_edit_set_time_of_day (EDateEdit *dedit, + gint hour, + gint minute) { EDateEditPrivate *priv; gboolean time_changed = FALSE; @@ -985,12 +987,12 @@ e_date_edit_set_time_of_day (EDateEdit *dedit, } void -e_date_edit_set_date_and_time_of_day (EDateEdit *dedit, - gint year, - gint month, - gint day, - gint hour, - gint minute) +e_date_edit_set_date_and_time_of_day (EDateEdit *dedit, + gint year, + gint month, + gint day, + gint hour, + gint minute) { gboolean date_changed, time_changed; @@ -1017,7 +1019,7 @@ e_date_edit_set_date_and_time_of_day (EDateEdit *dedit, * Description: Returns TRUE if the date field is currently shown. */ gboolean -e_date_edit_get_show_date (EDateEdit *dedit) +e_date_edit_get_show_date (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), TRUE); @@ -1033,8 +1035,8 @@ e_date_edit_get_show_date (EDateEdit *dedit) * field would be hidden if only a time needed to be entered. */ void -e_date_edit_set_show_date (EDateEdit *dedit, - gboolean show_date) +e_date_edit_set_show_date (EDateEdit *dedit, + gboolean show_date) { EDateEditPrivate *priv; @@ -1074,7 +1076,7 @@ e_date_edit_set_show_date (EDateEdit *dedit, * Description: Returns TRUE if the time field is currently shown. */ gboolean -e_date_edit_get_show_time (EDateEdit *dedit) +e_date_edit_get_show_time (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), TRUE); @@ -1090,8 +1092,8 @@ e_date_edit_get_show_time (EDateEdit *dedit) * field would be hidden if only a date needed to be entered. */ void -e_date_edit_set_show_time (EDateEdit *dedit, - gboolean show_time) +e_date_edit_set_show_time (EDateEdit *dedit, + gboolean show_time) { EDateEditPrivate *priv; @@ -1119,7 +1121,7 @@ e_date_edit_set_show_time (EDateEdit *dedit, * hiding it. */ gboolean -e_date_edit_get_make_time_insensitive (EDateEdit *dedit) +e_date_edit_get_make_time_insensitive (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), TRUE); @@ -1140,8 +1142,8 @@ e_date_edit_get_make_time_insensitive (EDateEdit *dedit) * disappear as that may affect the layout of the widgets. */ void -e_date_edit_set_make_time_insensitive (EDateEdit *dedit, - gboolean make_insensitive) +e_date_edit_set_make_time_insensitive (EDateEdit *dedit, + gboolean make_insensitive) { EDateEditPrivate *priv; @@ -1255,7 +1257,7 @@ e_date_edit_set_use_24_hour_format (EDateEdit *dedit, } /* Whether we allow the date to be set to 'None'. e_date_edit_get_time() will - return (time_t) -1 in this case. */ + * return (time_t) -1 in this case. */ gboolean e_date_edit_get_allow_no_date_set (EDateEdit *dedit) { @@ -1274,8 +1276,8 @@ e_date_edit_set_allow_no_date_set (EDateEdit *dedit, if (!allow_no_date_set) { /* If the date is showing, we make sure it isn't 'None' (we - don't really mind if the time is empty), else if just the - time is showing we make sure it isn't 'None'. */ + * don't really mind if the time is empty), else if just the + * time is showing we make sure it isn't 'None'. */ if (dedit->priv->show_date) { if (dedit->priv->date_set_to_none) e_date_edit_set_time (dedit, 0); @@ -1290,9 +1292,9 @@ e_date_edit_set_allow_no_date_set (EDateEdit *dedit, /* The range of time to show in the time combo popup. */ void -e_date_edit_get_time_popup_range (EDateEdit *dedit, - gint *lower_hour, - gint *upper_hour) +e_date_edit_get_time_popup_range (EDateEdit *dedit, + gint *lower_hour, + gint *upper_hour) { g_return_if_fail (E_IS_DATE_EDIT (dedit)); @@ -1301,9 +1303,9 @@ e_date_edit_get_time_popup_range (EDateEdit *dedit, } void -e_date_edit_set_time_popup_range (EDateEdit *dedit, - gint lower_hour, - gint upper_hour) +e_date_edit_set_time_popup_range (EDateEdit *dedit, + gint lower_hour, + gint upper_hour) { EDateEditPrivate *priv; @@ -1321,22 +1323,22 @@ e_date_edit_set_time_popup_range (EDateEdit *dedit, rebuild_time_popup (dedit); /* Setting the combo list items seems to mess up the time entry, so - we set it again. We have to reset it to its last valid time. */ + * we set it again. We have to reset it to its last valid time. */ priv->time_is_valid = TRUE; e_date_edit_update_time_entry (dedit); } /* The arrow button beside the date field has been clicked, so we show the - popup with the ECalendar in. */ + * popup with the ECalendar in. */ static void -on_date_button_clicked (GtkWidget *widget, - EDateEdit *dedit) +on_date_button_clicked (GtkWidget *widget, + EDateEdit *dedit) { e_date_edit_show_date_popup (dedit); } static void -e_date_edit_show_date_popup (EDateEdit *dedit) +e_date_edit_show_date_popup (EDateEdit *dedit) { EDateEditPrivate *priv; ECalendar *calendar; @@ -1365,7 +1367,7 @@ e_date_edit_show_date_popup (EDateEdit *dedit) } /* FIXME: Hack. Change ECalendarItem so it doesn't queue signal - emissions. */ + * emissions. */ calendar->calitem->selection_changed = FALSE; position_date_popup (dedit); @@ -1385,9 +1387,9 @@ e_date_edit_show_date_popup (EDateEdit *dedit) } /* This positions the date popup below and to the left of the arrow button, - just before it is shown. */ + * just before it is shown. */ static void -position_date_popup (EDateEdit *dedit) +position_date_popup (EDateEdit *dedit) { gint x, y; gint win_x, win_y; @@ -1427,10 +1429,10 @@ position_date_popup (EDateEdit *dedit) } /* A date has been selected in the date popup, so we set the date field - and hide the popup. */ + * and hide the popup. */ static void -on_date_popup_date_selected (ECalendarItem *calitem, - EDateEdit *dedit) +on_date_popup_date_selected (ECalendarItem *calitem, + EDateEdit *dedit) { GDate start_date, end_date; @@ -1445,16 +1447,16 @@ on_date_popup_date_selected (ECalendarItem *calitem, } static void -on_date_popup_now_button_clicked (GtkWidget *button, - EDateEdit *dedit) +on_date_popup_now_button_clicked (GtkWidget *button, + EDateEdit *dedit) { hide_date_popup (dedit); e_date_edit_set_time (dedit, 0); } static void -on_date_popup_today_button_clicked (GtkWidget *button, - EDateEdit *dedit) +on_date_popup_today_button_clicked (GtkWidget *button, + EDateEdit *dedit) { EDateEditPrivate *priv; struct tm tmp_tm; @@ -1476,19 +1478,19 @@ on_date_popup_today_button_clicked (GtkWidget *button, } static void -on_date_popup_none_button_clicked (GtkWidget *button, - EDateEdit *dedit) +on_date_popup_none_button_clicked (GtkWidget *button, + EDateEdit *dedit) { hide_date_popup (dedit); e_date_edit_set_time (dedit, -1); } /* A key has been pressed while the date popup is showing. If it is the Escape - key we hide the popup. */ + * key we hide the popup. */ static gint -on_date_popup_key_press (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_date_popup_key_press (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { GdkWindow *window; @@ -1506,13 +1508,13 @@ on_date_popup_key_press (GtkWidget *widget, } /* A mouse button has been pressed while the date popup is showing. - Any button press events used to select days etc. in the popup will have - have been handled elsewhere, so here we just hide the popup. - (This function is yanked from gtkcombo.c) */ + * Any button press events used to select days etc. in the popup will have + * have been handled elsewhere, so here we just hide the popup. + * (This function is yanked from gtkcombo.c) */ static gint -on_date_popup_button_press (GtkWidget *widget, - GdkEventButton *event, - gpointer data) +on_date_popup_button_press (GtkWidget *widget, + GdkEventButton *event, + gpointer data) { EDateEdit *dedit; GtkWidget *child; @@ -1542,10 +1544,10 @@ on_date_popup_button_press (GtkWidget *widget, } /* A delete event has been received for the date popup, so we hide it and - return TRUE so it doesn't get destroyed. */ + * return TRUE so it doesn't get destroyed. */ static gint -on_date_popup_delete_event (GtkWidget *widget, - EDateEdit *dedit) +on_date_popup_delete_event (GtkWidget *widget, + EDateEdit *dedit) { hide_date_popup (dedit); return TRUE; @@ -1553,7 +1555,7 @@ on_date_popup_delete_event (GtkWidget *widget, /* Hides the date popup, removing any grabs. */ static void -hide_date_popup (EDateEdit *dedit) +hide_date_popup (EDateEdit *dedit) { gtk_widget_hide (dedit->priv->cal_popup); gtk_grab_remove (dedit->priv->cal_popup); @@ -1562,9 +1564,9 @@ hide_date_popup (EDateEdit *dedit) } /* Clears the time popup and rebuilds it using the lower_hour, upper_hour - and use_24_hour_format settings. */ + * and use_24_hour_format settings. */ static void -rebuild_time_popup (EDateEdit *dedit) +rebuild_time_popup (EDateEdit *dedit) { EDateEditPrivate *priv; GtkTreeModel *model; @@ -1629,8 +1631,8 @@ rebuild_time_popup (EDateEdit *dedit) static gboolean e_date_edit_parse_date (EDateEdit *dedit, - const gchar *date_text, - struct tm *date_tm) + const gchar *date_text, + struct tm *date_tm) { gboolean twodigit_year = FALSE; @@ -1652,9 +1654,9 @@ e_date_edit_parse_date (EDateEdit *dedit, } static gboolean -e_date_edit_parse_time (EDateEdit *dedit, - const gchar *time_text, - struct tm *time_tm) +e_date_edit_parse_time (EDateEdit *dedit, + const gchar *time_text, + struct tm *time_tm) { if (field_set_to_none (time_text)) { time_tm->tm_hour = 0; @@ -1669,7 +1671,7 @@ e_date_edit_parse_time (EDateEdit *dedit, } /* Returns TRUE if the string is empty or is "None" in the current locale. - It ignores whitespace. */ + * It ignores whitespace. */ static gboolean field_set_to_none (const gchar *text) { @@ -1678,7 +1680,7 @@ field_set_to_none (const gchar *text) gint n; pos = text; - while (n = (gint)((guchar)*pos), isspace (n)) + while (n = (gint)((guchar) * pos), isspace (n)) pos++; /* Translators: "None" for date field of a date edit, shown when @@ -1691,15 +1693,15 @@ field_set_to_none (const gchar *text) } static void -on_date_edit_time_selected (GtkComboBox *combo, - EDateEdit *dedit) +on_date_edit_time_selected (GtkComboBox *combo, + EDateEdit *dedit) { GtkWidget *child; child = gtk_bin_get_child (GTK_BIN (combo)); /* We only want to emit signals when an item is selected explicitly, - not when it is selected by the silly combo update thing. */ + * not when it is selected by the silly combo update thing. */ if (gtk_combo_box_get_active (combo) == -1) return; @@ -1710,9 +1712,9 @@ on_date_edit_time_selected (GtkComboBox *combo, } static gint -on_date_entry_key_press (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_date_entry_key_press (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { if (event->state & GDK_MOD1_MASK && (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down @@ -1724,7 +1726,7 @@ on_date_entry_key_press (GtkWidget *widget, } /* If the user hits the return key emit a "date_changed" signal if - needed. But let the signal carry on. */ + * needed. But let the signal carry on. */ if (event->keyval == GDK_KEY_Return) { e_date_edit_check_date_changed (dedit); return FALSE; @@ -1734,16 +1736,16 @@ on_date_entry_key_press (GtkWidget *widget, } static gint -on_time_entry_key_press (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_time_entry_key_press (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { GtkWidget *child; child = gtk_bin_get_child (GTK_BIN (dedit->priv->time_combo)); /* I'd like to use Alt+Up/Down for popping up the list, like Win32, - but the combo steals any Up/Down keys, so we use Alt+Return. */ + * but the combo steals any Up/Down keys, so we use Alt + Return. */ #if 0 if (event->state & GDK_MOD1_MASK && (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down)) { @@ -1756,7 +1758,7 @@ on_time_entry_key_press (GtkWidget *widget, } /* Stop the return key from emitting the activate signal, and check - if we need to emit a "time_changed" signal. */ + * if we need to emit a "time_changed" signal. */ if (event->keyval == GDK_KEY_Return) { g_signal_stop_emission_by_name (widget, "key_press_event"); @@ -1768,18 +1770,18 @@ on_time_entry_key_press (GtkWidget *widget, } static gint -on_date_entry_key_release (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_date_entry_key_release (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { e_date_edit_check_date_changed (dedit); return TRUE; } static gint -on_time_entry_key_release (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_time_entry_key_release (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down) { g_signal_stop_emission_by_name (widget, @@ -1792,9 +1794,9 @@ on_time_entry_key_release (GtkWidget *widget, } static gint -on_date_entry_focus_out (GtkEntry *entry, - GdkEventFocus *event, - EDateEdit *dedit) +on_date_entry_focus_out (GtkEntry *entry, + GdkEventFocus *event, + EDateEdit *dedit) { struct tm tmp_tm; GtkWidget *msg_dialog; @@ -1841,16 +1843,16 @@ on_date_entry_focus_out (GtkEntry *entry, } static gint -on_time_entry_focus_out (GtkEntry *entry, - GdkEventFocus *event, - EDateEdit *dedit) +on_time_entry_focus_out (GtkEntry *entry, + GdkEventFocus *event, + EDateEdit *dedit) { GtkWidget *msg_dialog; e_date_edit_check_time_changed (dedit); if (!e_date_edit_time_is_valid (dedit)) { - msg_dialog=gtk_message_dialog_new (NULL, + msg_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, @@ -1865,7 +1867,8 @@ on_time_entry_focus_out (GtkEntry *entry, } static void -add_relation (EDateEdit *dedit, GtkWidget *widget) +add_relation (EDateEdit *dedit, + GtkWidget *widget) { AtkObject *a11yEdit, *a11yWidget; AtkRelationSet *set; @@ -1906,7 +1909,7 @@ add_relation (EDateEdit *dedit, GtkWidget *widget) /* This sets the text in the date entry according to the current settings. */ static void -e_date_edit_update_date_entry (EDateEdit *dedit) +e_date_edit_update_date_entry (EDateEdit *dedit) { EDateEditPrivate *priv; gchar buffer[100]; @@ -2033,7 +2036,7 @@ e_date_edit_update_time_entry (EDateEdit *dedit) } static void -e_date_edit_update_time_combo_state (EDateEdit *dedit) +e_date_edit_update_time_combo_state (EDateEdit *dedit) { EDateEditPrivate *priv; gboolean show = TRUE, show_now_button = TRUE; @@ -2043,7 +2046,7 @@ e_date_edit_update_time_combo_state (EDateEdit *dedit) priv = dedit->priv; /* If the date entry is currently shown, and it is set to None, - clear the time entry and disable the time combo. */ + * clear the time entry and disable the time combo. */ if (priv->show_date && priv->date_set_to_none) { clear_entry = TRUE; sensitive = FALSE; @@ -2090,9 +2093,9 @@ e_date_edit_update_time_combo_state (EDateEdit *dedit) } /* Parses the date, and if it is different from the current settings it - updates the settings and emits a "date_changed" signal. */ + * updates the settings and emits a "date_changed" signal. */ static void -e_date_edit_check_date_changed (EDateEdit *dedit) +e_date_edit_check_date_changed (EDateEdit *dedit) { EDateEditPrivate *priv; const gchar *date_text; @@ -2127,9 +2130,9 @@ e_date_edit_check_date_changed (EDateEdit *dedit) } /* Parses the time, and if it is different from the current settings it - updates the settings and emits a "time_changed" signal. */ + * updates the settings and emits a "time_changed" signal. */ static void -e_date_edit_check_time_changed (EDateEdit *dedit) +e_date_edit_check_time_changed (EDateEdit *dedit) { EDateEditPrivate *priv; GtkWidget *child; @@ -2171,7 +2174,7 @@ e_date_edit_check_time_changed (EDateEdit *dedit) * valid. */ gboolean -e_date_edit_date_is_valid (EDateEdit *dedit) +e_date_edit_date_is_valid (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), FALSE); @@ -2198,7 +2201,7 @@ e_date_edit_date_is_valid (EDateEdit *dedit) * entered which was valid. */ gboolean -e_date_edit_time_is_valid (EDateEdit *dedit) +e_date_edit_time_is_valid (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), FALSE); @@ -2206,8 +2209,8 @@ e_date_edit_time_is_valid (EDateEdit *dedit) return FALSE; /* If the time is empty and that isn't permitted, return FALSE. - Note that we don't mind an empty time if the date field is shown - - in that case we just assume 0:00. */ + * Note that we don't mind an empty time if the date field is shown + * - in that case we just assume 0:00. */ if (dedit->priv->time_set_to_none && !dedit->priv->show_date && !e_date_edit_get_allow_no_date_set (dedit)) return FALSE; @@ -2233,12 +2236,12 @@ e_date_edit_have_time (EDateEdit *dedit) } static gboolean -e_date_edit_set_date_internal (EDateEdit *dedit, - gboolean valid, - gboolean none, - gint year, - gint month, - gint day) +e_date_edit_set_date_internal (EDateEdit *dedit, + gboolean valid, + gboolean none, + gint year, + gint month, + gint day) { EDateEditPrivate *priv; gboolean date_changed = FALSE; @@ -2279,11 +2282,11 @@ e_date_edit_set_date_internal (EDateEdit *dedit, } static gboolean -e_date_edit_set_time_internal (EDateEdit *dedit, - gboolean valid, - gboolean none, - gint hour, - gint minute) +e_date_edit_set_time_internal (EDateEdit *dedit, + gboolean valid, + gboolean none, + gint hour, + gint minute) { EDateEditPrivate *priv; gboolean time_changed = FALSE; @@ -2337,13 +2340,13 @@ void e_date_edit_set_twodigit_year_can_future (EDateEdit *dedit, } /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void -e_date_edit_set_get_time_callback (EDateEdit *dedit, - EDateEditGetTimeCallback cb, - gpointer data, - GDestroyNotify destroy) +e_date_edit_set_get_time_callback (EDateEdit *dedit, + EDateEditGetTimeCallback cb, + gpointer data, + GDestroyNotify destroy) { EDateEditPrivate *priv; @@ -2361,7 +2364,7 @@ e_date_edit_set_get_time_callback (EDateEdit *dedit, } GtkWidget * -e_date_edit_get_entry (EDateEdit *dedit) +e_date_edit_get_entry (EDateEdit *dedit) { EDateEditPrivate *priv; priv = dedit->priv; diff --git a/widgets/misc/e-dateedit.h b/widgets/misc/e-dateedit.h index 28032dd8c9..f490a5f359 100644 --- a/widgets/misc/e-dateedit.h +++ b/widgets/misc/e-dateedit.h @@ -73,15 +73,15 @@ struct _EDateEditClass { }; GType e_date_edit_get_type (void); -GtkWidget* e_date_edit_new (void); +GtkWidget * e_date_edit_new (void); /* Analogous to gtk_editable_set_editable. disable editing, while still - allowing selection. */ + * allowing selection. */ void e_date_edit_set_editable (EDateEdit *dedit, gboolean editable); /* Returns TRUE if the last date and time set were valid. The date and time - are only set when the user hits Return or switches keyboard focus, or - selects a date or time from the popup. */ + * are only set when the user hits Return or switches keyboard focus, or + * selects a date or time from the popup. */ gboolean e_date_edit_date_is_valid (EDateEdit *dedit); gboolean e_date_edit_time_is_valid (EDateEdit *dedit); @@ -89,14 +89,14 @@ gboolean e_date_edit_time_is_valid (EDateEdit *dedit); gboolean e_date_edit_have_time (EDateEdit *dedit); /* Returns the last valid date & time set, or -1 if the date & time was set to - 'None' and this is permitted via e_date_edit_set_allow_no_date_set. */ + * 'None' and this is permitted via e_date_edit_set_allow_no_date_set. */ time_t e_date_edit_get_time (EDateEdit *dedit); void e_date_edit_set_time (EDateEdit *dedit, time_t the_time); /* This returns the last valid date set, without the time. It returns TRUE - if a date is set, or FALSE if the date is set to 'None' and this is - permitted via e_date_edit_set_allow_no_date_set. (Month is 1 - 12). */ + * if a date is set, or FALSE if the date is set to 'None' and this is + * permitted via e_date_edit_set_allow_no_date_set. (Month is 1 - 12). */ gboolean e_date_edit_get_date (EDateEdit *dedit, gint *year, gint *month, @@ -107,8 +107,8 @@ void e_date_edit_set_date (EDateEdit *dedit, gint day); /* This returns the last valid time set, without the date. It returns TRUE - if a time is set, or FALSE if the time is set to 'None' and this is - permitted via e_date_edit_set_allow_no_date_set. */ + * if a time is set, or FALSE if the time is set to 'None' and this is + * permitted via e_date_edit_set_allow_no_date_set. */ gboolean e_date_edit_get_time_of_day (EDateEdit *dedit, gint *hour, gint *minute); @@ -150,7 +150,7 @@ void e_date_edit_set_use_24_hour_format (EDateEdit *dedit, gboolean use_24_hour_format); /* Whether we allow the date to be set to 'None'. e_date_edit_get_time() will - return (time_t) -1 in this case. */ + * return (time_t) -1 in this case. */ gboolean e_date_edit_get_allow_no_date_set (EDateEdit *dedit); void e_date_edit_set_allow_no_date_set (EDateEdit *dedit, gboolean allow_no_date_set); @@ -174,13 +174,13 @@ void e_date_edit_set_twodigit_year_can_future (EDateEdit *dedit, gboolean value); /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void e_date_edit_set_get_time_callback (EDateEdit *dedit, EDateEditGetTimeCallback cb, gpointer data, GDestroyNotify destroy); -GtkWidget* e_date_edit_get_entry (EDateEdit *dedit); +GtkWidget * e_date_edit_get_entry (EDateEdit *dedit); #endif diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index 69cf847ae5..06dff88e29 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -159,7 +159,7 @@ filename_changed (GtkWidget *widget, gboolean valid; GSList *l; EImportImporter *first = NULL; - gint i=0, firstitem=0; + gint i = 0, firstitem = 0; g_free (page->target->uri_src); page->target->uri_src = g_filename_to_uri (filename, NULL, NULL); @@ -541,7 +541,7 @@ prepare_intelligent_page (GtkAssistant *assistant, table = gtk_table_new (g_slist_length (l), 2, FALSE); row = 0; - for (;l;l=l->next) { + for (; l; l = l->next) { EImportImporter *eii = l->data; gchar *str; GtkWidget *w, *label; @@ -558,11 +558,11 @@ prepare_intelligent_page (GtkAssistant *assistant, gtk_table_attach ( GTK_TABLE (table), label, - 0, 1, row, row+1, GTK_FILL, 0, 0, 0); + 0, 1, row, row + 1, GTK_FILL, 0, 0, 0); if (w) gtk_table_attach ( GTK_TABLE (table), w, - 1, 2, row, row+1, GTK_FILL, 0, 3, 0); + 1, 2, row, row + 1, GTK_FILL, 0, 3, 0); row++; } @@ -597,7 +597,8 @@ import_done (EImport *ei, } static void -import_simple_done (EImport *ei, gpointer user_data) +import_simple_done (EImport *ei, + gpointer user_data) { EImportAssistant *import_assistant = user_data; EImportAssistantPrivate *priv; @@ -775,7 +776,7 @@ prepare_progress_page (GtkAssistant *assistant, gtk_assistant_add_action_widget (assistant, cancel_button); gtk_widget_show (cancel_button); - g_object_get (G_OBJECT (assistant), "is-simple", &is_simple, NULL); + g_object_get (assistant, "is-simple", &is_simple, NULL); intelligent_import = is_simple ? FALSE : gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (priv->type_page.intelligent)); @@ -809,7 +810,8 @@ prepare_progress_page (GtkAssistant *assistant, } static void -simple_filetype_changed_cb (GtkComboBox *combo_box, GtkAssistant *assistant) +simple_filetype_changed_cb (GtkComboBox *combo_box, + GtkAssistant *assistant) { EImportAssistantPrivate *priv; ImportSimplePage *page; @@ -853,7 +855,8 @@ simple_filetype_changed_cb (GtkComboBox *combo_box, GtkAssistant *assistant) } static void -prepare_simple_page (GtkAssistant *assistant, GtkWidget *vbox) +prepare_simple_page (GtkAssistant *assistant, + GtkWidget *vbox) { EImportAssistantPrivate *priv; GSList *importers, *imp; @@ -963,7 +966,7 @@ forward_cb (gint current_page, GtkToggleButton *toggle_button; gboolean is_simple = FALSE; - g_object_get (G_OBJECT (import_assistant), "is-simple", &is_simple, NULL); + g_object_get (import_assistant, "is-simple", &is_simple, NULL); if (is_simple) { if (!import_assistant->priv->simple_page.has_preview) @@ -1036,7 +1039,7 @@ set_import_uris (EImportAssistant *assistant, if (importers != NULL) { /* there is at least one importer which can be used, - thus there can be done an import */ + * thus there can be done an import */ fileuris = g_ptr_array_new (); } @@ -1175,7 +1178,7 @@ import_assistant_prepare (GtkAssistant *assistant, gint page_no = gtk_assistant_get_current_page (assistant); gboolean is_simple = FALSE; - g_object_get (G_OBJECT (assistant), "is-simple", &is_simple, NULL); + g_object_get (assistant, "is-simple", &is_simple, NULL); if (is_simple) { if (page_no == 0) { diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index dd02486a43..a239709415 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -155,7 +155,8 @@ e_map_stop_tweening (EMap *map) } static void -e_map_tween_destroy (EMap *map, EMapTween *tween) +e_map_tween_destroy (EMap *map, + EMapTween *tween) { map->priv->tweens = g_slist_remove (map->priv->tweens, tween); g_slice_free (EMapTween, tween); @@ -313,7 +314,8 @@ e_map_apply_tween (EMapTween *tween, } static void -e_map_tweens_compute_matrix (EMap *map, cairo_matrix_t *matrix) +e_map_tweens_compute_matrix (EMap *map, + cairo_matrix_t *matrix) { GSList *walk; gdouble zoom, x, y, latitude, longitude, effect; @@ -348,7 +350,8 @@ e_map_tweens_compute_matrix (EMap *map, cairo_matrix_t *matrix) /* GtkScrollable implementation */ static void -e_map_adjustment_changed (GtkAdjustment *adjustment, EMap *map) +e_map_adjustment_changed (GtkAdjustment *adjustment, + EMap *map) { EMapPrivate *priv = map->priv; @@ -420,7 +423,8 @@ e_map_set_vadjustment_values (EMap *map) } static void -e_map_set_hadjustment (EMap *map, GtkAdjustment *adjustment) +e_map_set_hadjustment (EMap *map, + GtkAdjustment *adjustment) { EMapPrivate *priv = map->priv; @@ -447,7 +451,8 @@ e_map_set_hadjustment (EMap *map, GtkAdjustment *adjustment) } static void -e_map_set_vadjustment (EMap *map, GtkAdjustment *adjustment) +e_map_set_vadjustment (EMap *map, + GtkAdjustment *adjustment) { EMapPrivate *priv = map->priv; @@ -479,7 +484,7 @@ e_map_set_vadjustment (EMap *map, GtkAdjustment *adjustment) static void e_map_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -487,7 +492,7 @@ e_map_set_property (GObject *object, map = E_MAP (object); - switch (prop_id) { + switch (property_id) { case PROP_HADJUSTMENT: e_map_set_hadjustment (map, g_value_get_object (value)); break; @@ -504,14 +509,14 @@ e_map_set_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_map_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { @@ -519,7 +524,7 @@ e_map_get_property (GObject *object, map = E_MAP (object); - switch (prop_id) { + switch (property_id) { case PROP_HADJUSTMENT: g_value_set_object (value, map->priv->hadjustment); break; @@ -534,7 +539,7 @@ e_map_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -618,7 +623,9 @@ e_map_unrealize (GtkWidget *widget) } static void -e_map_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) +e_map_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural) { EMap *map; @@ -633,7 +640,9 @@ e_map_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) } static void -e_map_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) +e_map_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural) { EMap *view; EMapPrivate *priv; @@ -650,7 +659,8 @@ e_map_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) } static void -e_map_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +e_map_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { EMap *map; @@ -680,7 +690,8 @@ e_map_size_allocate (GtkWidget *widget, GtkAllocation *allocation) } static gboolean -e_map_draw (GtkWidget *widget, cairo_t *cr) +e_map_draw (GtkWidget *widget, + cairo_t *cr) { EMap *map; cairo_matrix_t matrix; @@ -704,14 +715,16 @@ e_map_draw (GtkWidget *widget, cairo_t *cr) } static gint -e_map_button_press (GtkWidget *widget, GdkEventButton *event) +e_map_button_press (GtkWidget *widget, + GdkEventButton *event) { if (!gtk_widget_has_focus (widget)) gtk_widget_grab_focus (widget); return TRUE; } static gint -e_map_button_release (GtkWidget *widget, GdkEventButton *event) +e_map_button_release (GtkWidget *widget, + GdkEventButton *event) { if (event->button != 1) return FALSE; @@ -720,7 +733,8 @@ e_map_button_release (GtkWidget *widget, GdkEventButton *event) } static gint -e_map_motion (GtkWidget *widget, GdkEventMotion *event) +e_map_motion (GtkWidget *widget, + GdkEventMotion *event) { return FALSE; } @@ -934,7 +948,8 @@ e_map_get_magnification (EMap *map) } static void -e_map_set_zoom (EMap *map, EMapZoomState zoom) +e_map_set_zoom (EMap *map, + EMapZoomState zoom) { if (map->priv->zoom_state == zoom) return; @@ -986,7 +1001,8 @@ e_map_zoom_out (EMap *map) } void -e_map_set_smooth_zoom (EMap *map, gboolean state) +e_map_set_smooth_zoom (EMap *map, + gboolean state) { ((EMapPrivate *) map->priv)->smooth_zoom = state; } @@ -1040,7 +1056,8 @@ e_map_add_point (EMap *map, } void -e_map_remove_point (EMap *map, EMapPoint *point) +e_map_remove_point (EMap *map, + EMapPoint *point) { g_ptr_array_remove (map->priv->points, point); @@ -1094,7 +1111,8 @@ e_map_point_set_color_rgba (EMap *map, } void -e_map_point_set_data (EMapPoint *point, gpointer data) +e_map_point_set_data (EMapPoint *point, + gpointer data) { point->user_data = data; } @@ -1106,7 +1124,8 @@ e_map_point_get_data (EMapPoint *point) } gboolean -e_map_point_is_in_view (EMap *map, EMapPoint *point) +e_map_point_is_in_view (EMap *map, + EMapPoint *point) { GtkAllocation allocation; gdouble x, y; @@ -1165,7 +1184,8 @@ update_and_paint (EMap *map) } static gint -load_map_background (EMap *map, gchar *name) +load_map_background (EMap *map, + gchar *name) { GdkPixbuf *pb0; @@ -1251,7 +1271,8 @@ update_render_surface (EMap *map, /* Redraw point in client surface */ static void -update_render_point (EMap *map, EMapPoint *point) +update_render_point (EMap *map, + EMapPoint *point) { cairo_t *cr; gdouble px, py; @@ -1295,7 +1316,8 @@ update_render_point (EMap *map, EMapPoint *point) /* Repaint point on X server */ static void -repaint_point (EMap *map, EMapPoint *point) +repaint_point (EMap *map, + EMapPoint *point) { gdouble px, py; @@ -1310,7 +1332,9 @@ repaint_point (EMap *map, EMapPoint *point) } static void -center_at (EMap *map, gdouble longitude, gdouble latitude) +center_at (EMap *map, + gdouble longitude, + gdouble latitude) { GtkAllocation allocation; gint pb_width, pb_height; @@ -1335,7 +1359,9 @@ center_at (EMap *map, gdouble longitude, gdouble latitude) /* Scrolls the view to the specified offsets. Does not perform range checking! */ static void -scroll_to (EMap *map, gint x, gint y) +scroll_to (EMap *map, + gint x, + gint y) { gint xofs, yofs; @@ -1354,7 +1380,9 @@ scroll_to (EMap *map, gint x, gint y) } static void -set_scroll_area (EMap *view, gint width, gint height) +set_scroll_area (EMap *view, + gint width, + gint height) { EMapPrivate *priv; GtkAllocation allocation; diff --git a/widgets/misc/e-paned.c b/widgets/misc/e-paned.c index b98dc1928d..c90d40c140 100644 --- a/widgets/misc/e-paned.c +++ b/widgets/misc/e-paned.c @@ -57,6 +57,14 @@ G_DEFINE_TYPE ( GTK_TYPE_PANED) static gboolean +paned_queue_resize_on_idle (GtkWidget *paned) +{ + gtk_widget_queue_resize_no_redraw (paned); + + return FALSE; +} + +static gboolean paned_window_state_event_cb (EPaned *paned, GdkEventWindowState *event, GtkWidget *toplevel) @@ -240,19 +248,6 @@ paned_realize (GtkWidget *widget) priv->toplevel_ready = TRUE; } -static gboolean -paned_queue_resize_on_idle (gpointer user_data) -{ - GtkWidget *paned = user_data; - - g_return_val_if_fail (paned != NULL, FALSE); - - gtk_widget_queue_resize_no_redraw (paned); - g_object_unref (paned); - - return FALSE; -} - static void paned_size_allocate (GtkWidget *widget, GtkAllocation *allocation) @@ -297,10 +292,13 @@ paned_size_allocate (GtkWidget *widget, paned->priv->sync_request = SYNC_REQUEST_NONE; /* gtk_paned_set_position() calls queue_resize, which cannot - be called from size_allocate, thus call it on idle to take - the change in the effect. - */ - g_idle_add (paned_queue_resize_on_idle, g_object_ref (paned)); + * be called from size_allocate, so schedule it from an idle + * callback so the change takes effect. */ + g_idle_add_full ( + G_PRIORITY_DEFAULT_IDLE, + (GSourceFunc) paned_queue_resize_on_idle, + g_object_ref (paned), + (GDestroyNotify) g_object_unref); } static void diff --git a/widgets/misc/e-picture-gallery.c b/widgets/misc/e-picture-gallery.c index a657dbf373..a742a5e37c 100644 --- a/widgets/misc/e-picture-gallery.c +++ b/widgets/misc/e-picture-gallery.c @@ -47,7 +47,10 @@ enum { G_DEFINE_TYPE (EPictureGallery, e_picture_gallery, GTK_TYPE_ICON_VIEW) static gboolean -update_file_iter (GtkListStore *list_store, GtkTreeIter *iter, GFile *file, gboolean force_thumbnail_update) +update_file_iter (GtkListStore *list_store, + GtkTreeIter *iter, + GFile *file, + gboolean force_thumbnail_update) { GFileInfo *file_info; gchar *uri; @@ -85,7 +88,7 @@ update_file_iter (GtkListStore *list_store, GtkTreeIter *iter, GFile *file, gboo } if (existing_thumb && !g_file_info_get_attribute_boolean (file_info, G_FILE_ATTRIBUTE_THUMBNAILING_FAILED)) { - GdkPixbuf* pixbuf; + GdkPixbuf * pixbuf; pixbuf = gdk_pixbuf_new_from_file (existing_thumb, NULL); @@ -125,7 +128,8 @@ update_file_iter (GtkListStore *list_store, GtkTreeIter *iter, GFile *file, gboo } static void -add_file (GtkListStore *list_store, GFile *file) +add_file (GtkListStore *list_store, + GFile *file) { GtkTreeIter iter; @@ -138,7 +142,9 @@ add_file (GtkListStore *list_store, GFile *file) } static gboolean -find_file_uri (GtkListStore *list_store, const gchar *uri, GtkTreeIter *iter) +find_file_uri (GtkListStore *list_store, + const gchar *uri, + GtkTreeIter *iter) { GtkTreeModel *model; @@ -171,14 +177,16 @@ find_file_uri (GtkListStore *list_store, const gchar *uri, GtkTreeIter *iter) } static void -picture_gallery_dir_changed_cb (GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, EPictureGallery *gallery) +picture_gallery_dir_changed_cb (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + EPictureGallery *gallery) { gchar *uri; GtkListStore *list_store; GtkTreeIter iter; - g_return_if_fail (gallery != NULL); - g_return_if_fail (gallery->priv != NULL); g_return_if_fail (file != NULL); list_store = GTK_LIST_STORE (gtk_icon_view_get_model (GTK_ICON_VIEW (gallery))); @@ -273,9 +281,9 @@ e_picture_gallery_get_path (EPictureGallery *gallery) } static void -picture_gallery_set_path (EPictureGallery *gallery, const gchar *path) +picture_gallery_set_path (EPictureGallery *gallery, + const gchar *path) { - g_return_if_fail (gallery != NULL); g_return_if_fail (E_IS_PICTURE_GALLERY (gallery)); g_return_if_fail (gallery->priv != NULL); @@ -288,7 +296,10 @@ picture_gallery_set_path (EPictureGallery *gallery, const gchar *path) } static void -picture_gallery_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +picture_gallery_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_PATH: @@ -300,7 +311,10 @@ picture_gallery_get_property (GObject *object, guint property_id, GValue *value, } static void -picture_gallery_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +picture_gallery_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_PATH: @@ -314,9 +328,6 @@ picture_gallery_set_property (GObject *object, guint property_id, const GValue * static void visible_cb (EPictureGallery *gallery) { - g_return_if_fail (gallery != NULL); - g_return_if_fail (gallery->priv != NULL); - if (!gallery->priv->initialized && gtk_widget_get_visible (GTK_WIDGET (gallery))) { gallery->priv->initialized = TRUE; @@ -367,9 +378,6 @@ picture_gallery_dispose (GObject *object) gallery = E_PICTURE_GALLERY (object); - g_return_if_fail (gallery != NULL); - g_return_if_fail (gallery->priv != NULL); - if (gallery->priv->monitor) { g_object_unref (gallery->priv->monitor); gallery->priv->monitor = NULL; diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c index a918081480..ada5398523 100644 --- a/widgets/misc/e-printable.c +++ b/widgets/misc/e-printable.c @@ -121,11 +121,11 @@ e_printable_new (void) } void -e_printable_print_page (EPrintable *e_printable, - GtkPrintContext *context, - gdouble width, - gdouble height, - gboolean quantized) +e_printable_print_page (EPrintable *e_printable, + GtkPrintContext *context, + gdouble width, + gdouble height, + gboolean quantized) { g_return_if_fail (e_printable != NULL); g_return_if_fail (E_IS_PRINTABLE (e_printable)); @@ -139,7 +139,7 @@ e_printable_print_page (EPrintable *e_printable, } gboolean -e_printable_data_left (EPrintable *e_printable) +e_printable_data_left (EPrintable *e_printable) { gboolean ret_val; @@ -154,7 +154,7 @@ e_printable_data_left (EPrintable *e_printable) } void -e_printable_reset (EPrintable *e_printable) +e_printable_reset (EPrintable *e_printable) { g_return_if_fail (e_printable != NULL); g_return_if_fail (E_IS_PRINTABLE (e_printable)); @@ -164,11 +164,11 @@ e_printable_reset (EPrintable *e_printable) } gdouble -e_printable_height (EPrintable *e_printable, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantized) +e_printable_height (EPrintable *e_printable, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantized) { gdouble ret_val; @@ -187,11 +187,11 @@ e_printable_height (EPrintable *e_printable, } gboolean -e_printable_will_fit (EPrintable *e_printable, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantized) +e_printable_will_fit (EPrintable *e_printable, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantized) { gboolean ret_val; diff --git a/widgets/misc/e-searching-tokenizer.c b/widgets/misc/e-searching-tokenizer.c index 3720030815..c3a7dfff2e 100644 --- a/widgets/misc/e-searching-tokenizer.c +++ b/widgets/misc/e-searching-tokenizer.c @@ -56,7 +56,7 @@ G_DEFINE_TYPE ( static inline guint32 camel_utf8_getc (const guchar **ptr) { - register guchar *p = (guchar *)*ptr; + register guchar *p = (guchar *) * ptr; register guchar c, r; register guint32 v, m; @@ -75,7 +75,7 @@ loop: r = c; goto loop; } - v = (v<<6) | (c & 0x3f); + v = (v << 6) | (c & 0x3f); r<<=1; m<<=5; } while (r & 0x40); @@ -93,22 +93,22 @@ loop: /* 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 */ + * if this list gets longer than 10 entries, consider binary search */ static const gchar *ignored_tags[] = { "B", "I", "FONT", "TT", "EM", /* and more? */}; static gint ignore_tag (const gchar *tag) { - gchar *t = g_alloca (strlen (tag)+1), c, *out; + gchar *t = g_alloca (strlen (tag) + 1), c, *out; const gchar *in; gint i; /* we could use a aho-corasick matcher here too ... but we wont */ /* normalise tag into 't'. - Note we use the property that the only tags we're interested in - are 7 bit ascii to shortcut and simplify case insensitivity */ + * Note we use the property that the only tags we're interested in + * are 7 bit ascii to shortcut and simplify case insensitivity */ in = tag+2; /* skip: TAG_ESCAPE '<' */ if (*in == '/') in++; @@ -163,20 +163,21 @@ struct _trie { /* will be enabled only if debug is enabled */ #if d(1) -1 != -1 static void -dump_trie (struct _state *s, gint d) +dump_trie (struct _state *s, + gint d) { - gchar *p = g_alloca (d*2+1); + gchar *p = g_alloca (d *2 + 1); struct _match *m; - memset (p, ' ', d*2); - p[d*2]=0; + memset (p, ' ', d *2); + p[d *2]=0; printf("%s[state] %p: %d fail->%p\n", p, s, s->final, s->fail); m = s->matches; while (m) { printf(" %s'%c' -> %p\n", p, m->ch, m->match); if (m->match) - dump_trie (m->match, d+1); + dump_trie (m->match, d + 1); m = m->next; } } @@ -184,11 +185,12 @@ dump_trie (struct _state *s, gint d) /* This builds an Aho-Corasick search trie for a set of utf8 words */ /* See - http://www-sr.informatik.uni-tuebingen.de/~buehler/AC/AC.html - for a neat demo */ + * http://www-sr.informatik.uni-tuebingen.de/~buehler/AC/AC.html + * for a neat demo */ static inline struct _match * -g (struct _state *q, guint32 c) +g (struct _state *q, + guint32 c) { struct _match *m = q->matches; @@ -199,7 +201,9 @@ g (struct _state *q, guint32 c) } static struct _trie * -build_trie (gint nocase, gint len, guchar **words) +build_trie (gint nocase, + gint len, + guchar **words) { struct _state *q, *qt, *r; const guchar *word; @@ -222,14 +226,14 @@ build_trie (gint nocase, gint len, guchar **words) /* This will correspond to the length of the longest pattern */ state_depth_size = 0; state_depth_max = 64; - state_depth = g_malloc (sizeof (*state_depth[0])*64); + state_depth = g_malloc (sizeof (*state_depth[0]) * 64); state_depth[0] = NULL; /* Step 1: Build trie */ /* This just builds a tree that merges all common prefixes into the same branch */ - for (i=0;i<len;i++) { + for (i = 0; i < len; i++) { word = words[i]; q = &trie->root; depth = 0; @@ -277,7 +281,7 @@ build_trie (gint nocase, gint len, guchar **words) * find multiple substrings concurrently, using aho-corasick's * algorithm. */ - for (i=0;i<state_depth_size;i++) { + for (i = 0; i < state_depth_size; i++) { q = state_depth[i]; while (q) { m = q->matches; @@ -411,17 +415,17 @@ searcher_new (gint flags, s->offout = 0; /* rotating queue of previous character positions */ - m = s->t->max_depth+1; + m = s->t->max_depth + 1; i = 2; - while (i<m) + while (i < m) i<<=2; - s->last = g_malloc (sizeof (s->last[0])*i); - s->last_mask = i-1; + s->last = g_malloc (sizeof (s->last[0]) * i); + s->last_mask = i - 1; s->lastp = 0; /* a stack of possible submatches */ s->submatchp = 0; - s->submatches = g_malloc (sizeof (s->submatches[0])*argc+1); + s->submatches = g_malloc (sizeof (s->submatches[0]) * argc + 1); return s; } @@ -444,13 +448,15 @@ searcher_free (struct _searcher *s) } static struct _token * -append_token (GQueue *queue, const gchar *tok, gint len) +append_token (GQueue *queue, + const gchar *tok, + gint len) { struct _token *token; if (len == -1) len = strlen (tok); - token = g_malloc (sizeof (*token) + len+1); + token = g_malloc (sizeof (*token) + len + 1); token->offset = 0; /* set by caller when required */ memcpy (token->tok, tok, len); token->tok[len] = 0; @@ -462,7 +468,8 @@ append_token (GQueue *queue, const gchar *tok, gint len) #define free_token(x) (g_free (x)) static void -output_token (struct _searcher *s, struct _token *token) +output_token (struct _searcher *s, + struct _token *token) { gint offend; gint left, pre; @@ -475,11 +482,11 @@ output_token (struct _searcher *s, struct _token *token) } } else { offend = token->offset + strlen (token->tok); - left = offend-s->offout; + left = offend - s->offout; if (left > 0) { pre = s->offout - token->offset; - if (pre>0) - memmove (token->tok, token->tok+pre, left+1); + if (pre > 0) + memmove (token->tok, token->tok + pre, left + 1); s->offout = offend; g_queue_push_tail (&s->output, token); } else { @@ -489,7 +496,8 @@ output_token (struct _searcher *s, struct _token *token) } static struct _token * -find_token (struct _searcher *s, gint start) +find_token (struct _searcher *s, + gint start) { GList *link; @@ -508,7 +516,9 @@ find_token (struct _searcher *s, gint start) } static void -output_match (struct _searcher *s, guint start, guint end) +output_match (struct _searcher *s, + guint start, + guint end) { register struct _token *token; struct _token *starttoken, *endtoken; @@ -534,8 +544,8 @@ output_match (struct _searcher *s, guint start, guint end) if (s->offout < start) { token = append_token ( &s->output, starttoken->tok + - (s->offout-starttoken->offset), - start-s->offout); + (s->offout - starttoken->offset), + start - s->offout); s->offout = start; } @@ -559,8 +569,8 @@ output_match (struct _searcher *s, guint start, guint end) if (s->offout < end) { token = append_token ( &s->output, endtoken->tok + - (s->offout-endtoken->offset), - end-s->offout); + (s->offout - endtoken->offset), + end - s->offout); s->offout = end; } @@ -581,29 +591,31 @@ output_subpending (struct _searcher *s) { gint i; - for (i=s->submatchp-1;i>=0;i--) + for (i = s->submatchp - 1; i >= 0; i--) output_match (s, s->submatches[i].offstart, s->submatches[i].offend); s->submatchp = 0; } /* returns true if a merge took place */ static gint -merge_subpending (struct _searcher *s, gint offstart, gint offend) +merge_subpending (struct _searcher *s, + gint offstart, + gint offend) { gint i; /* merges overlapping or abutting match strings */ if (s->submatchp && - s->submatches[s->submatchp-1].offend >= offstart) { + s->submatches[s->submatchp - 1].offend >= offstart) { /* go from end, any that match 'invalidate' follow-on ones too */ - for (i=s->submatchp-1;i>=0;i--) { + for (i = s->submatchp - 1; i >= 0; i--) { if (s->submatches[i].offend >= offstart) { if (offstart < s->submatches[i].offstart) s->submatches[i].offstart = offstart; s->submatches[i].offend = offend; if (s->submatchp > i) - s->submatchp = i+1; + s->submatchp = i + 1; } } return 1; @@ -613,13 +625,15 @@ merge_subpending (struct _searcher *s, gint offstart, gint offend) } static void -push_subpending (struct _searcher *s, gint offstart, gint offend) +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. */ if (s->submatchp >= s->words) { d (printf("ERROR: submatch pending stack overflow\n")); - s->submatchp = s->words-1; + s->submatchp = s->words - 1; } s->submatches[s->submatchp].offstart = offstart; @@ -648,7 +662,7 @@ flush_extra (struct _searcher *s) /* find earliest gchar that can be in contention */ start = s->offset - s->t->max_depth; - for (i=0;i<s->submatchp;i++) + for (i = 0; i < s->submatchp; i++) if (s->submatches[i].offstart < start) start = s->submatches[i].offstart; @@ -713,8 +727,8 @@ searcher_next_token (struct _searcher *s) q = &t->root; } else if (m != NULL) { /* keep track of previous offsets of utf8 chars, rotating buffer */ - s->last[s->lastp] = s->offset + (pre_tok-stok); - s->lastp = (s->lastp+1)&s->last_mask; + s->last[s->lastp] = s->offset + (pre_tok - stok); + s->lastp = (s->lastp + 1) &s->last_mask; q = m->match; /* we have a match of q->final characters for a matching word */ @@ -722,7 +736,7 @@ searcher_next_token (struct _searcher *s) s->matchcount++; /* use the last buffer to find the real offset of this gchar */ - offstart = s->last[(s->lastp - q->final)&s->last_mask]; + offstart = s->last[(s->lastp - q->final) &s->last_mask]; offend = s->offset + (tok - stok); if (q->matches == NULL) { @@ -752,7 +766,7 @@ searcher_next_token (struct _searcher *s) pre_tok = tok; } - s->offset += (pre_tok-stok); + s->offset += (pre_tok - stok); flush_extra (s); } @@ -794,8 +808,8 @@ searcher_pending (struct _searcher *s) struct _search_info { GPtrArray *strv; gchar *color; - guint size:8; - guint flags:8; + guint size : 8; + guint flags : 8; }; /** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ @@ -812,20 +826,24 @@ search_info_new (void) } static void -search_info_set_flags (struct _search_info *si, guint flags, guint mask) +search_info_set_flags (struct _search_info *si, + guint flags, + guint mask) { si->flags = (si->flags & ~mask) | (flags & mask); } static void -search_info_set_color (struct _search_info *si, const gchar *color) +search_info_set_color (struct _search_info *si, + const gchar *color) { g_free (si->color); si->color = g_strdup (color); } static void -search_info_add_string (struct _search_info *si, const gchar *s) +search_info_add_string (struct _search_info *si, + const gchar *s) { const guchar *start; guint32 c; @@ -851,7 +869,7 @@ search_info_clear (struct _search_info *si) { gint i; - for (i=0;i<si->strv->len;i++) + for (i = 0; i < si->strv->len; i++) g_free (si->strv->pdata[i]); g_ptr_array_set_size (si->strv, 0); @@ -862,7 +880,7 @@ search_info_free (struct _search_info *si) { gint i; - for (i=0;i<si->strv->len;i++) + for (i = 0; i < si->strv->len; i++) g_free (si->strv->pdata[i]); g_ptr_array_free (si->strv, TRUE); @@ -877,7 +895,7 @@ search_info_clone (struct _search_info *si) gint i; out = search_info_new (); - for (i=0;i<si->strv->len;i++) + for (i = 0; i < si->strv->len; i++) g_ptr_array_add (out->strv, g_strdup (si->strv->pdata[i])); out->color = g_strdup (si->color); out->flags = si->flags; @@ -900,7 +918,7 @@ search_info_to_searcher (struct _search_info *si) else col = si->color; - tags = g_alloca (20+strlen (col)); + tags = g_alloca (20 + strlen (col)); sprintf(tags, "%c<font color=\"%s\">", TAG_ESCAPE, col); tage = g_alloca (20); sprintf(tage, "%c</font>", TAG_ESCAPE); @@ -922,7 +940,7 @@ struct _ESearchingTokenizerPrivate { /** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ /* blah blah the htmltokeniser doesn't like being asked - for a token if it doens't hvae any! */ + * for a token if it doens't hvae any! */ static gchar * get_token (HTMLTokenizer *tokenizer) { diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c index a023ea5916..d744111bb4 100644 --- a/widgets/misc/e-selection-model-array.c +++ b/widgets/misc/e-selection-model-array.c @@ -55,7 +55,8 @@ e_selection_model_array_confirm_row_count (ESelectionModelArray *esma) } static gint -es_row_model_to_sorted (ESelectionModelArray *esma, gint model_row) +es_row_model_to_sorted (ESelectionModelArray *esma, + gint model_row) { if (model_row >= 0 && esma && esma->base.sorter && e_sorter_needs_sorting (esma->base.sorter)) return e_sorter_model_to_sorted (esma->base.sorter, model_row); @@ -64,7 +65,8 @@ es_row_model_to_sorted (ESelectionModelArray *esma, gint model_row) } static gint -es_row_sorted_to_model (ESelectionModelArray *esma, gint sorted_row) +es_row_sorted_to_model (ESelectionModelArray *esma, + gint sorted_row) { if (sorted_row >= 0 && esma && esma->base.sorter && e_sorter_needs_sorting (esma->base.sorter)) return e_sorter_sorted_to_model (esma->base.sorter, sorted_row); @@ -74,7 +76,9 @@ es_row_sorted_to_model (ESelectionModelArray *esma, gint sorted_row) /* FIXME: Should this deal with moving the selection if it's in single mode? */ void -e_selection_model_array_delete_rows (ESelectionModelArray *esma, gint row, gint count) +e_selection_model_array_delete_rows (ESelectionModelArray *esma, + gint row, + gint count) { if (esma->eba) { if (E_SELECTION_MODEL (esma)->mode == GTK_SELECTION_SINGLE) @@ -124,7 +128,9 @@ e_selection_model_array_delete_rows (ESelectionModelArray *esma, gint row, gint } void -e_selection_model_array_insert_rows (ESelectionModelArray *esma, gint row, gint count) +e_selection_model_array_insert_rows (ESelectionModelArray *esma, + gint row, + gint count) { if (esma->eba) { e_bit_array_insert (esma->eba, row, count); @@ -140,7 +146,9 @@ e_selection_model_array_insert_rows (ESelectionModelArray *esma, gint row, gint } void -e_selection_model_array_move_row (ESelectionModelArray *esma, gint old_row, gint new_row) +e_selection_model_array_move_row (ESelectionModelArray *esma, + gint old_row, + gint new_row) { ESelectionModel *esm = E_SELECTION_MODEL (esma); @@ -195,11 +203,14 @@ esma_dispose (GObject *object) } static void -esma_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +esma_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: g_value_set_int (value, esma->cursor_row); break; @@ -211,12 +222,15 @@ esma_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps } static void -esma_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +esma_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ESelectionModel *esm = E_SELECTION_MODEL (object); ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: e_selection_model_do_something (esm, g_value_get_int (value), esma->cursor_col, 0); break; @@ -238,7 +252,7 @@ esma_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp */ static gboolean esma_is_row_selected (ESelectionModel *selection, - gint n) + gint n) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); if (esma->eba) @@ -258,8 +272,8 @@ esma_is_row_selected (ESelectionModel *selection, */ static void esma_foreach (ESelectionModel *selection, - EForeachFunc callback, - gpointer closure) + EForeachFunc callback, + gpointer closure) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); if (esma->eba) @@ -371,7 +385,9 @@ esma_row_count (ESelectionModel *selection) } static void -esma_change_one_row (ESelectionModel *selection, gint row, gboolean grow) +esma_change_one_row (ESelectionModel *selection, + gint row, + gboolean grow) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); e_selection_model_array_confirm_row_count (esma); @@ -379,7 +395,9 @@ esma_change_one_row (ESelectionModel *selection, gint row, gboolean grow) } static void -esma_change_cursor (ESelectionModel *selection, gint row, gint col) +esma_change_cursor (ESelectionModel *selection, + gint row, + gint col) { ESelectionModelArray *esma; @@ -394,7 +412,10 @@ esma_change_cursor (ESelectionModel *selection, gint row, gint col) } static void -esma_change_range (ESelectionModel *selection, gint start, gint end, gboolean grow) +esma_change_range (ESelectionModel *selection, + gint start, + gint end, + gboolean grow) { gint i; ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); @@ -425,7 +446,8 @@ esma_cursor_col (ESelectionModel *selection) } static void -esma_real_select_single_row (ESelectionModel *selection, gint row) +esma_real_select_single_row (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); @@ -439,7 +461,8 @@ esma_real_select_single_row (ESelectionModel *selection, gint row) } static void -esma_select_single_row (ESelectionModel *selection, gint row) +esma_select_single_row (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); gint selected_row = esma->selected_row; @@ -456,7 +479,8 @@ esma_select_single_row (ESelectionModel *selection, gint row) } static void -esma_toggle_single_row (ESelectionModel *selection, gint row) +esma_toggle_single_row (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); @@ -470,7 +494,8 @@ esma_toggle_single_row (ESelectionModel *selection, gint row) } static void -esma_real_move_selection_end (ESelectionModel *selection, gint row) +esma_real_move_selection_end (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); gint old_start; @@ -506,14 +531,16 @@ esma_real_move_selection_end (ESelectionModel *selection, gint row) } static void -esma_move_selection_end (ESelectionModel *selection, gint row) +esma_move_selection_end (ESelectionModel *selection, + gint row) { esma_real_move_selection_end (selection, row); e_selection_model_selection_changed (selection); } static void -esma_set_selection_end (ESelectionModel *selection, gint row) +esma_set_selection_end (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); gint selected_range_end = esma->selected_range_end; diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index 4f00369b16..fc73df6b5e 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -54,7 +54,8 @@ enum { }; inline static void -add_sorter (ESelectionModel *esm, ESorter *sorter) +add_sorter (ESelectionModel *esm, + ESorter *sorter) { esm->sorter = sorter; if (sorter) { diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c index 9a916fbf0b..103697fd0b 100644 --- a/widgets/misc/e-send-options.c +++ b/widgets/misc/e-send-options.c @@ -259,7 +259,8 @@ sensitize_widgets (ESendOptionsDialog *sod) } static void -expiration_toggled_cb (GtkToggleButton *toggle, gpointer data) +expiration_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active; ESendOptionsDialog *sod; @@ -274,7 +275,8 @@ expiration_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -reply_request_toggled_cb (GtkToggleButton *toggle, gpointer data) +reply_request_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active; ESendOptionsDialog *sod; @@ -291,7 +293,8 @@ reply_request_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -delay_delivery_toggled_cb (GtkToggleButton *toggle, gpointer data) +delay_delivery_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active; ESendOptionsDialog *sod; @@ -305,7 +308,8 @@ delay_delivery_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -sent_item_toggled_cb (GtkToggleButton *toggle, gpointer data) +sent_item_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active; ESendOptionsDialog *sod; @@ -322,7 +326,8 @@ sent_item_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -delay_until_date_changed_cb (GtkWidget *dedit, gpointer data) +delay_until_date_changed_cb (GtkWidget *dedit, + gpointer data) { ESendOptionsDialog *sod; ESendOptionsDialogPrivate *priv; @@ -340,7 +345,10 @@ delay_until_date_changed_cb (GtkWidget *dedit, gpointer data) } static void -page_changed_cb (GtkNotebook *notebook, GtkWidget *page, gint num, gpointer data) +page_changed_cb (GtkNotebook *notebook, + GtkWidget *page, + gint num, + gpointer data) { ESendOptionsDialog *sod = data; ESendOptionsDialogPrivate *priv = sod->priv; @@ -484,7 +492,8 @@ get_widgets (ESendOptionsDialog *sod) } static void -setup_widgets (ESendOptionsDialog *sod, Item_type type) +setup_widgets (ESendOptionsDialog *sod, + Item_type type) { ESendOptionsDialogPrivate *priv; @@ -558,7 +567,8 @@ setup_widgets (ESendOptionsDialog *sod, Item_type type) } ESendOptionsDialog * -e_send_options_dialog_new (void) { +e_send_options_dialog_new (void) +{ ESendOptionsDialog *sod; sod = g_object_new (E_TYPE_SENDOPTIONS_DIALOG, NULL); @@ -567,7 +577,8 @@ e_send_options_dialog_new (void) { } void -e_send_options_set_need_general_options (ESendOptionsDialog *sod, gboolean needed) +e_send_options_set_need_general_options (ESendOptionsDialog *sod, + gboolean needed) { g_return_if_fail (E_IS_SENDOPTIONS_DIALOG (sod)); @@ -583,7 +594,8 @@ e_send_options_get_need_general_options (ESendOptionsDialog *sod) } gboolean -e_send_options_set_global (ESendOptionsDialog *sod, gboolean set) +e_send_options_set_global (ESendOptionsDialog *sod, + gboolean set) { g_return_val_if_fail (E_IS_SENDOPTIONS_DIALOG (sod), FALSE); @@ -592,7 +604,10 @@ e_send_options_set_global (ESendOptionsDialog *sod, gboolean set) return TRUE; } -static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data) +static void +e_send_options_cb (GtkDialog *dialog, + gint state, + gpointer func_data) { ESendOptionsDialogPrivate *priv; ESendOptionsDialog *sod; @@ -619,7 +634,9 @@ static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data } gboolean -e_send_options_dialog_run (ESendOptionsDialog *sod, GtkWidget *parent, Item_type type) +e_send_options_dialog_run (ESendOptionsDialog *sod, + GtkWidget *parent, + Item_type type) { ESendOptionsDialogPrivate *priv; GtkWidget *toplevel; diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c index eaefdccddd..c4a174c0a6 100644 --- a/widgets/misc/e-url-entry.c +++ b/widgets/misc/e-url-entry.c @@ -106,7 +106,8 @@ finalize (GObject *object) /* GtkWidget::mnemonic_activate() handler for the EUrlEntry */ static gboolean -mnemonic_activate (GtkWidget *widget, gboolean group_cycling) +mnemonic_activate (GtkWidget *widget, + gboolean group_cycling) { EUrlEntry *url_entry; EUrlEntryPrivate *priv; @@ -139,7 +140,8 @@ e_url_entry_get_entry (EUrlEntry *url_entry) } static void -button_clicked_cb (GtkWidget *widget, gpointer data) +button_clicked_cb (GtkWidget *widget, + gpointer data) { EUrlEntry *url_entry; EUrlEntryPrivate *priv; @@ -155,7 +157,8 @@ button_clicked_cb (GtkWidget *widget, gpointer data) } static void -entry_changed_cb (GtkEditable *editable, gpointer data) +entry_changed_cb (GtkEditable *editable, + gpointer data) { EUrlEntry *url_entry; EUrlEntryPrivate *priv; diff --git a/widgets/misc/e-web-view-preview.c b/widgets/misc/e-web-view-preview.c index 763d31329e..12270da0b7 100644 --- a/widgets/misc/e-web-view-preview.c +++ b/widgets/misc/e-web-view-preview.c @@ -47,9 +47,9 @@ G_DEFINE_TYPE ( static void web_view_preview_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_ESCAPE_VALUES: @@ -64,9 +64,9 @@ web_view_preview_set_property (GObject *object, static void web_view_preview_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_TREE_VIEW: @@ -108,13 +108,13 @@ web_view_preview_dispose (GObject *object) } static void -e_web_view_preview_class_init (EWebViewPreviewClass *klass) +e_web_view_preview_class_init (EWebViewPreviewClass *class) { GObjectClass *object_class; - g_type_class_add_private (klass, sizeof (EWebViewPreviewPrivate)); + g_type_class_add_private (class, sizeof (EWebViewPreviewPrivate)); - object_class = G_OBJECT_CLASS (klass); + object_class = G_OBJECT_CLASS (class); object_class->set_property = web_view_preview_set_property; object_class->get_property = web_view_preview_get_property; object_class->dispose = web_view_preview_dispose; @@ -206,7 +206,7 @@ e_web_view_preview_get_tree_view (EWebViewPreview *preview) } GtkWidget * -e_web_view_preview_get_preview (EWebViewPreview *preview) +e_web_view_preview_get_preview (EWebViewPreview *preview) { g_return_val_if_fail (preview != NULL, NULL); g_return_val_if_fail (E_IS_WEB_VIEW_PREVIEW (preview), NULL); @@ -215,13 +215,12 @@ e_web_view_preview_get_preview (EWebViewPreview *preview) } void -e_web_view_preview_set_preview (EWebViewPreview *preview, GtkWidget *preview_widget) +e_web_view_preview_set_preview (EWebViewPreview *preview, + GtkWidget *preview_widget) { GtkWidget *old_child; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview_widget != NULL); g_return_if_fail (GTK_IS_WIDGET (preview_widget)); old_child = gtk_bin_get_child (GTK_BIN (gtk_paned_get_child2 (GTK_PANED (preview)))); @@ -236,7 +235,6 @@ e_web_view_preview_set_preview (EWebViewPreview *preview, GtkWidget *preview_wid void e_web_view_preview_show_tree_view (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); gtk_widget_show (gtk_paned_get_child1 (GTK_PANED (preview))); @@ -245,18 +243,16 @@ e_web_view_preview_show_tree_view (EWebViewPreview *preview) void e_web_view_preview_hide_tree_view (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); gtk_widget_hide (gtk_paned_get_child1 (GTK_PANED (preview))); } void -e_web_view_preview_set_escape_values (EWebViewPreview *preview, gboolean escape) +e_web_view_preview_set_escape_values (EWebViewPreview *preview, + gboolean escape) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); preview->priv->escape_values = escape; } @@ -274,9 +270,7 @@ e_web_view_preview_get_escape_values (EWebViewPreview *preview) void e_web_view_preview_begin_update (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); if (preview->priv->updating_content) { g_warning ("%s: Previous content update isn't finished with e_web_view_preview_end_update()", G_STRFUNC); @@ -291,9 +285,7 @@ e_web_view_preview_end_update (EWebViewPreview *preview) { GtkWidget *web_view; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_string_append (preview->priv->updating_content, "</TABLE>"); @@ -307,7 +299,9 @@ e_web_view_preview_end_update (EWebViewPreview *preview) } static gchar * -replace_string (const gchar *text, const gchar *find, const gchar *replace) +replace_string (const gchar *text, + const gchar *find, + const gchar *replace) { const gchar *p, *next; GString *str; @@ -337,7 +331,8 @@ replace_string (const gchar *text, const gchar *find, const gchar *replace) } static gchar * -web_view_preview_escape_text (EWebViewPreview *preview, const gchar *text) +web_view_preview_escape_text (EWebViewPreview *preview, + const gchar *text) { gchar *utf8_valid, *res, *end; @@ -375,13 +370,13 @@ web_view_preview_escape_text (EWebViewPreview *preview, const gchar *text) } void -e_web_view_preview_add_header (EWebViewPreview *preview, gint index, const gchar *header) +e_web_view_preview_add_header (EWebViewPreview *preview, + gint index, + const gchar *header) { gchar *escaped; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (header != NULL); @@ -400,13 +395,12 @@ e_web_view_preview_add_header (EWebViewPreview *preview, gint index, const gchar } void -e_web_view_preview_add_text (EWebViewPreview *preview, const gchar *text) +e_web_view_preview_add_text (EWebViewPreview *preview, + const gchar *text) { gchar *escaped; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (text != NULL); @@ -420,11 +414,10 @@ e_web_view_preview_add_text (EWebViewPreview *preview, const gchar *text) } void -e_web_view_preview_add_raw_html (EWebViewPreview *preview, const gchar *raw_html) +e_web_view_preview_add_raw_html (EWebViewPreview *preview, + const gchar *raw_html) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (raw_html != NULL); @@ -434,9 +427,7 @@ e_web_view_preview_add_raw_html (EWebViewPreview *preview, const gchar *raw_html void e_web_view_preview_add_separator (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_string_append (preview->priv->updating_content, "<TR><TD colspan=2><HR></TD></TR>"); @@ -445,9 +436,7 @@ e_web_view_preview_add_separator (EWebViewPreview *preview) void e_web_view_preview_add_empty_line (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_string_append (preview->priv->updating_content, "<TR><TD colspan=2> </TD></TR>"); @@ -455,13 +444,13 @@ e_web_view_preview_add_empty_line (EWebViewPreview *preview) /* section can be NULL, but value cannot */ void -e_web_view_preview_add_section (EWebViewPreview *preview, const gchar *section, const gchar *value) +e_web_view_preview_add_section (EWebViewPreview *preview, + const gchar *section, + const gchar *value) { gchar *escaped_section = NULL, *escaped_value; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (value != NULL); diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index 18529b603e..8e037ac66c 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -2049,7 +2049,8 @@ e_web_view_get_cursor_image_src (EWebView *web_view) } void -e_web_view_set_cursor_image_src (EWebView *web_view, const gchar *src_uri) +e_web_view_set_cursor_image_src (EWebView *web_view, + const gchar *src_uri) { g_return_if_fail (E_IS_WEB_VIEW (web_view)); diff --git a/widgets/misc/ea-calendar-cell.c b/widgets/misc/ea-calendar-cell.c index b8e53fd359..c71f4f4d47 100644 --- a/widgets/misc/ea-calendar-cell.c +++ b/widgets/misc/ea-calendar-cell.c @@ -70,7 +70,9 @@ e_calendar_cell_class_init (ECalendarCellClass *class) } ECalendarCell * -e_calendar_cell_new (ECalendarItem *calitem, gint row, gint column) +e_calendar_cell_new (ECalendarItem *calitem, + gint row, + gint column) { GObject *object; ECalendarCell *cell; @@ -182,7 +184,7 @@ ea_calendar_cell_init (EaCalendarCell *a11y) atk_state_set_add_state (a11y->state_set, ATK_STATE_FOCUSABLE); } -AtkObject* +AtkObject * ea_calendar_cell_new (GObject *obj) { gpointer object; @@ -316,8 +318,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *atk_obj, *atk_canvas; diff --git a/widgets/misc/ea-calendar-cell.h b/widgets/misc/ea-calendar-cell.h index fa68fdca55..2fd2051538 100644 --- a/widgets/misc/ea-calendar-cell.h +++ b/widgets/misc/ea-calendar-cell.h @@ -79,7 +79,7 @@ struct _EaCalendarCellClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_calendar_cell_new (GObject *gobj); +AtkObject * ea_calendar_cell_new (GObject *gobj); G_END_DECLS diff --git a/widgets/misc/ea-calendar-item.c b/widgets/misc/ea-calendar-item.c index 5d482feb40..98a715eacf 100644 --- a/widgets/misc/ea-calendar-item.c +++ b/widgets/misc/ea-calendar-item.c @@ -45,7 +45,7 @@ static const gchar * ea_calendar_item_get_name (AtkObject *accessible); static const gchar * ea_calendar_item_get_description (AtkObject *accessible); static gint ea_calendar_item_get_n_children (AtkObject *accessible); static AtkObject *ea_calendar_item_ref_child (AtkObject *accessible, gint index); -static AtkStateSet* ea_calendar_item_ref_state_set (AtkObject *accessible); +static AtkStateSet * ea_calendar_item_ref_state_set (AtkObject *accessible); /* atk table interface */ static void atk_table_interface_init (AtkTableIface *iface); @@ -56,7 +56,7 @@ static gint table_interface_get_column_at_index (AtkTable *table, gint index); static gint table_interface_get_row_at_index (AtkTable *table, gint index); -static AtkObject* table_interface_ref_at (AtkTable *table, +static AtkObject * table_interface_ref_at (AtkTable *table, gint row, gint column); static gint table_interface_get_n_rows (AtkTable *table); @@ -86,29 +86,31 @@ static gboolean table_interface_add_column_selection (AtkTable *table, gint column); static gboolean table_interface_remove_column_selection (AtkTable *table, gint column); -static AtkObject* table_interface_get_row_header (AtkTable *table, gint row); -static AtkObject* table_interface_get_column_header (AtkTable *table, +static AtkObject * table_interface_get_row_header (AtkTable *table, gint row); +static AtkObject * table_interface_get_column_header (AtkTable *table, gint in_col); -static AtkObject* table_interface_get_caption (AtkTable *table); +static AtkObject * table_interface_get_caption (AtkTable *table); static const gchar * -table_interface_get_column_description (AtkTable *table, gint in_col); +table_interface_get_column_description (AtkTable *table, + gint in_col); static const gchar * -table_interface_get_row_description (AtkTable *table, gint row); +table_interface_get_row_description (AtkTable *table, + gint row); -static AtkObject* table_interface_get_summary (AtkTable *table); +static AtkObject *table_interface_get_summary (AtkTable *table); /* atk selection interface */ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, - gint i); + gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, - gint i); +static AtkObject *selection_interface_ref_selection (AtkSelection *selection, + gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, - gint i); + gint i); /* callbacks */ static void selection_preview_change_cb (ECalendarItem *calitem); @@ -118,18 +120,20 @@ static void date_range_changed_cb (ECalendarItem *calitem); static EaCellTable *ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem); static void ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem); static gboolean ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, - gint column, - gchar *buffer, - gint buffer_size); + gint column, + gchar *buffer, + gint buffer_size); static gboolean ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, - gint row, - gchar *buffer, - gint buffer_size); + gint row, + gchar *buffer, + gint buffer_size); static gboolean e_calendar_item_get_offset_for_date (ECalendarItem *calitem, - gint year, gint month, gint day, - gint *offset); + gint year, + gint month, + gint day, + gint *offset); static void ea_calendar_set_focus_object (EaCalendarItem *ea_calitem, - AtkObject *item_cell); + AtkObject *item_cell); #ifdef ACC_DEBUG static gint n_ea_calendar_item_created = 0; @@ -212,7 +216,7 @@ ea_calendar_item_class_init (EaCalendarItemClass *klass) class->ref_child = ea_calendar_item_ref_child; } -AtkObject* +AtkObject * ea_calendar_item_new (GObject *obj) { gpointer object; @@ -350,7 +354,7 @@ ea_calendar_item_get_description (AtkObject *accessible) return _("evolution calendar item"); } -static AtkStateSet* +static AtkStateSet * ea_calendar_item_ref_state_set (AtkObject *accessible) { AtkStateSet *state_set; @@ -403,7 +407,8 @@ ea_calendar_item_get_n_children (AtkObject *accessible) } static AtkObject * -ea_calendar_item_ref_child (AtkObject *accessible, gint index) +ea_calendar_item_ref_child (AtkObject *accessible, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -482,14 +487,14 @@ atk_table_interface_init (AtkTableIface *iface) iface->get_column_description = table_interface_get_column_description; } -static AtkObject* +static AtkObject * table_interface_ref_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { gint index; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); index = EA_CALENDAR_COLUMN_NUM * row + column; return ea_calendar_item_ref_child (ATK_OBJECT (ea_calitem), index); } @@ -499,7 +504,7 @@ table_interface_get_n_rows (AtkTable *table) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); gint n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -516,7 +521,7 @@ table_interface_get_n_columns (AtkTable *table) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -528,12 +533,12 @@ table_interface_get_n_columns (AtkTable *table) static gint table_interface_get_index_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -545,11 +550,11 @@ table_interface_get_index_at (AtkTable *table, static gint table_interface_get_column_at_index (AtkTable *table, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); gint n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -565,11 +570,11 @@ table_interface_get_column_at_index (AtkTable *table, static gint table_interface_get_row_at_index (AtkTable *table, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); gint n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -584,14 +589,14 @@ table_interface_get_row_at_index (AtkTable *table, } static gint -table_interface_get_column_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_column_extent_at (AtkTable *table, + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -604,12 +609,13 @@ table_interface_get_column_extent_at (AtkTable *table, static gint table_interface_get_row_extent_at (AtkTable *table, - gint row, gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -623,7 +629,7 @@ table_interface_get_row_extent_at (AtkTable *table, /* any day in the row is selected, the row is selected */ static gboolean table_interface_is_row_selected (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -673,8 +679,8 @@ table_interface_is_row_selected (AtkTable *table, static gboolean table_interface_is_selected (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -722,14 +728,14 @@ table_interface_is_selected (AtkTable *table, static gboolean table_interface_is_column_selected (AtkTable *table, - gint column) + gint column) { return FALSE; } static gint table_interface_get_selected_rows (AtkTable *table, - gint **rows_selected) + gint **rows_selected) { *rows_selected = NULL; return -1; @@ -737,7 +743,7 @@ table_interface_get_selected_rows (AtkTable *table, static gint table_interface_get_selected_columns (AtkTable *table, - gint **columns_selected) + gint **columns_selected) { *columns_selected = NULL; return -1; @@ -745,62 +751,63 @@ table_interface_get_selected_columns (AtkTable *table, static gboolean table_interface_add_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_remove_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_add_column_selection (AtkTable *table, - gint column) + gint column) { return FALSE; } static gboolean table_interface_remove_column_selection (AtkTable *table, - gint column) + gint column) { /* FIXME: NOT IMPLEMENTED */ return FALSE; } -static AtkObject* +static AtkObject * table_interface_get_row_header (AtkTable *table, - gint row) + gint row) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* +static AtkObject * table_interface_get_column_header (AtkTable *table, - gint in_col) + gint in_col) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* -table_interface_get_caption (AtkTable *table) +static AtkObject * +table_interface_get_caption (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; } static const gchar * -table_interface_get_column_description (AtkTable *table, gint in_col) +table_interface_get_column_description (AtkTable *table, + gint in_col) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); const gchar *description = NULL; EaCellTable *cell_data; gint n_columns; @@ -830,11 +837,12 @@ table_interface_get_column_description (AtkTable *table, gint in_col) } static const gchar * -table_interface_get_row_description (AtkTable *table, gint row) +table_interface_get_row_description (AtkTable *table, + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); const gchar *description = NULL; EaCellTable *cell_data; gint n_rows; @@ -863,8 +871,8 @@ table_interface_get_row_description (AtkTable *table, gint row) return description; } -static AtkObject* -table_interface_get_summary (AtkTable *table) +static AtkObject * +table_interface_get_summary (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; @@ -885,12 +893,13 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint index) +selection_interface_add_selection (AtkSelection *selection, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); gint year, month, day; GDate start_date, end_date; @@ -917,7 +926,7 @@ selection_interface_clear_selection (AtkSelection *selection) AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -930,12 +939,13 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); gint count, sel_offset; GDate start_date, end_date; @@ -964,7 +974,7 @@ selection_interface_get_selection_count (AtkSelection *selection) AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); GDate start_date, end_date; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -980,11 +990,12 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint index) +selection_interface_is_child_selected (AtkSelection *selection, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); gint row, column, n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -1066,7 +1077,7 @@ ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem) if (!cell_data) { gint n_cells = ea_calendar_item_get_n_children (ATK_OBJECT (ea_calitem)); - cell_data = ea_cell_table_create (n_cells/EA_CALENDAR_COLUMN_NUM, + cell_data = ea_cell_table_create (n_cells / EA_CALENDAR_COLUMN_NUM, EA_CALENDAR_COLUMN_NUM, FALSE); g_object_set_data (G_OBJECT (ea_calitem), @@ -1092,8 +1103,10 @@ ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem) } static gboolean -ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, gint row, - gchar *buffer, gint buffer_size) +ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, + gint row, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -1123,8 +1136,10 @@ ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, gint row, } static gboolean -ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, gint column, - gchar *buffer, gint buffer_size) +ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, + gint column, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -1147,9 +1162,13 @@ ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, gint column, /* the coordinate the e-calendar canvas coord */ gboolean e_calendar_item_get_day_extents (ECalendarItem *calitem, - gint year, gint month, gint date, - gint *x, gint *y, - gint *width, gint *height) + gint year, + gint month, + gint date, + gint *x, + gint *y, + gint *width, + gint *height) { GnomeCanvasItem *item; GtkWidget *widget; @@ -1229,8 +1248,11 @@ e_calendar_item_get_day_extents (ECalendarItem *calitem, /* month is from 0 to 11 */ gboolean -e_calendar_item_get_date_for_offset (ECalendarItem *calitem, gint day_offset, - gint *year, gint *month, gint *day) +e_calendar_item_get_date_for_offset (ECalendarItem *calitem, + gint day_offset, + gint *year, + gint *month, + gint *day) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -1258,8 +1280,10 @@ e_calendar_item_get_date_for_offset (ECalendarItem *calitem, gint day_offset, /* the arg month is from 0 to 11 */ static gboolean e_calendar_item_get_offset_for_date (ECalendarItem *calitem, - gint year, gint month, gint day, - gint *offset) + gint year, + gint month, + gint day, + gint *offset) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -1286,7 +1310,8 @@ e_calendar_item_get_offset_for_date (ECalendarItem *calitem, gint e_calendar_item_get_n_days_from_week_start (ECalendarItem *calitem, - gint year, gint month) + gint year, + gint month) { struct tm tmp_tm; gint start_weekday, days_from_week_start; @@ -1304,7 +1329,8 @@ e_calendar_item_get_n_days_from_week_start (ECalendarItem *calitem, } static void -ea_calendar_set_focus_object (EaCalendarItem *ea_calitem, AtkObject *item_cell) +ea_calendar_set_focus_object (EaCalendarItem *ea_calitem, + AtkObject *item_cell) { AtkStateSet *state_set, *old_state_set; AtkObject *old_cell; diff --git a/widgets/misc/ea-cell-table.c b/widgets/misc/ea-cell-table.c index c0c2bc0cde..bbdef0aea1 100644 --- a/widgets/misc/ea-cell-table.c +++ b/widgets/misc/ea-cell-table.c @@ -27,9 +27,11 @@ #include "ea-cell-table.h" EaCellTable * -ea_cell_table_create (gint rows, gint columns, gboolean column_first) +ea_cell_table_create (gint rows, + gint columns, + gboolean column_first) { - EaCellTable * cell_data; + EaCellTable *cell_data; gint index; g_return_val_if_fail (((columns > 0) && (rows > 0)), NULL); @@ -55,7 +57,7 @@ ea_cell_table_create (gint rows, gint columns, gboolean column_first) } void -ea_cell_table_destroy (EaCellTable * cell_data) +ea_cell_table_destroy (EaCellTable *cell_data) { gint index; g_return_if_fail (cell_data); @@ -80,8 +82,9 @@ ea_cell_table_destroy (EaCellTable * cell_data) } gpointer -ea_cell_table_get_cell (EaCellTable * cell_data, - gint row, gint column) +ea_cell_table_get_cell (EaCellTable *cell_data, + gint row, + gint column) { gint index; @@ -95,8 +98,10 @@ ea_cell_table_get_cell (EaCellTable * cell_data, } gboolean -ea_cell_table_set_cell (EaCellTable * cell_data, - gint row, gint column, gpointer cell) +ea_cell_table_set_cell (EaCellTable *cell_data, + gint row, + gint column, + gpointer cell) { gint index; @@ -117,8 +122,8 @@ ea_cell_table_set_cell (EaCellTable * cell_data, } gpointer -ea_cell_table_get_cell_at_index (EaCellTable * cell_data, - gint index) +ea_cell_table_get_cell_at_index (EaCellTable *cell_data, + gint index) { g_return_val_if_fail (cell_data, NULL); @@ -128,8 +133,9 @@ ea_cell_table_get_cell_at_index (EaCellTable * cell_data, } gboolean -ea_cell_table_set_cell_at_index (EaCellTable * cell_data, - gint index, gpointer cell) +ea_cell_table_set_cell_at_index (EaCellTable *cell_data, + gint index, + gpointer cell) { g_return_val_if_fail (cell_data, FALSE); @@ -147,8 +153,8 @@ ea_cell_table_set_cell_at_index (EaCellTable * cell_data, } const gchar * -ea_cell_table_get_column_label (EaCellTable * cell_data, - gint column) +ea_cell_table_get_column_label (EaCellTable *cell_data, + gint column) { g_return_val_if_fail (cell_data, NULL); g_return_val_if_fail ((column >= 0 && column < cell_data->columns), NULL); @@ -157,8 +163,9 @@ ea_cell_table_get_column_label (EaCellTable * cell_data, } void -ea_cell_table_set_column_label (EaCellTable * cell_data, - gint column, const gchar *label) +ea_cell_table_set_column_label (EaCellTable *cell_data, + gint column, + const gchar *label) { g_return_if_fail (cell_data); g_return_if_fail ((column >= 0 && column < cell_data->columns)); @@ -169,8 +176,8 @@ ea_cell_table_set_column_label (EaCellTable * cell_data, } const gchar * -ea_cell_table_get_row_label (EaCellTable * cell_data, - gint row) +ea_cell_table_get_row_label (EaCellTable *cell_data, + gint row) { g_return_val_if_fail (cell_data, NULL); g_return_val_if_fail ((row >= 0 && row < cell_data->rows), NULL); @@ -179,8 +186,9 @@ ea_cell_table_get_row_label (EaCellTable * cell_data, } void -ea_cell_table_set_row_label (EaCellTable * cell_data, - gint row, const gchar *label) +ea_cell_table_set_row_label (EaCellTable *cell_data, + gint row, + const gchar *label) { g_return_if_fail (cell_data); g_return_if_fail ((row >= 0 && row < cell_data->rows)); @@ -192,7 +200,8 @@ ea_cell_table_set_row_label (EaCellTable * cell_data, gint ea_cell_table_get_index (EaCellTable *cell_data, - gint row, gint column) + gint row, + gint column) { g_return_val_if_fail (cell_data, -1); if (row < 0 || row >= cell_data->rows || diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 83b8f11cd7..7a4d2f8954 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -46,14 +46,15 @@ static void on_selection_changed (ECalendarItem *calitem); static void delete_event_cb (GtkWidget *widget, - GdkEventAny *event, - gpointer data) + GdkEventAny *event, + gpointer data) { gtk_main_quit (); } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GtkWidget *window; GtkWidget *cal; diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c index 79ca726c3e..2629fad4e0 100644 --- a/widgets/misc/test-dateedit.c +++ b/widgets/misc/test-dateedit.c @@ -48,7 +48,8 @@ static void on_time_changed (EDateEdit *dedit, #endif gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GtkWidget *window; EDateEdit *dedit; @@ -94,14 +95,14 @@ main (gint argc, gchar **argv) gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, 0, 0, 0, 0); gtk_widget_show (button); - g_signal_connect((button), "clicked", + g_signal_connect ((button), "clicked", G_CALLBACK (on_get_date_clicked), dedit); /* EDateEdit 2. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget*) dedit, + gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, 0, 1, 1, 2, GTK_FILL, GTK_EXPAND, 0, 0); - gtk_widget_show ((GtkWidget*) (dedit)); + gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); e_date_edit_set_use_24_hour_format (dedit, FALSE); @@ -127,9 +128,9 @@ main (gint argc, gchar **argv) /* EDateEdit 3. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget*) dedit, + gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, 0, 1, 2, 3, GTK_FILL, GTK_EXPAND, 0, 0); - gtk_widget_show ((GtkWidget*) (dedit)); + gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); e_date_edit_set_use_24_hour_format (dedit, FALSE); @@ -168,9 +169,9 @@ main (gint argc, gchar **argv) } static void -delete_event_cb (GtkWidget *widget, - GdkEventAny *event, - GtkWidget *window) +delete_event_cb (GtkWidget *widget, + GdkEventAny *event, + GtkWidget *window) { gtk_widget_destroy (window); @@ -178,8 +179,8 @@ delete_event_cb (GtkWidget *widget, } static void -on_get_date_clicked (GtkWidget *button, - EDateEdit *dedit) +on_get_date_clicked (GtkWidget *button, + EDateEdit *dedit) { time_t t; @@ -197,8 +198,8 @@ on_get_date_clicked (GtkWidget *button, } static void -on_toggle_24_hour_clicked (GtkWidget *button, - EDateEdit *dedit) +on_toggle_24_hour_clicked (GtkWidget *button, + EDateEdit *dedit) { gboolean use_24_hour_format; @@ -208,8 +209,8 @@ on_toggle_24_hour_clicked (GtkWidget *button, #if 0 static void -on_date_changed (EDateEdit *dedit, - gchar *name) +on_date_changed (EDateEdit *dedit, + gchar *name) { gint year, month, day; @@ -226,8 +227,8 @@ on_date_changed (EDateEdit *dedit, } static void -on_time_changed (EDateEdit *dedit, - gchar *name) +on_time_changed (EDateEdit *dedit, + gchar *name) { gint hour, minute; @@ -245,8 +246,8 @@ on_time_changed (EDateEdit *dedit, #endif static void -on_changed (EDateEdit *dedit, - gchar *name) +on_changed (EDateEdit *dedit, + gchar *name) { gint year, month, day, hour, minute; diff --git a/widgets/misc/test-preferences-window.c b/widgets/misc/test-preferences-window.c index e7c4499d6a..738d7ff403 100644 --- a/widgets/misc/test-preferences-window.c +++ b/widgets/misc/test-preferences-window.c @@ -71,8 +71,8 @@ add_pages (EPreferencesWindow *preferences_window) static gint delete_event_callback (GtkWidget *widget, - GdkEventAny *event, - gpointer data) + GdkEventAny *event, + gpointer data) { gtk_main_quit (); @@ -80,7 +80,8 @@ delete_event_callback (GtkWidget *widget, } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GtkWidget *window; diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c index 7969e2b4f0..9e775761c7 100644 --- a/widgets/table/e-cell-checkbox.c +++ b/widgets/table/e-cell-checkbox.c @@ -42,9 +42,13 @@ G_DEFINE_TYPE (ECellCheckbox, e_cell_checkbox, E_TYPE_CELL_TOGGLE) static GdkPixbuf *checks[2]; static void -ecc_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +ecc_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { cairo_t *cr = gtk_print_context_get_cairo_context (context); const gint value = GPOINTER_TO_INT ( diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index f759185a56..2617cfafdf 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -109,7 +109,7 @@ static void e_cell_combo_restart_edit (ECellCombo *ecc); G_DEFINE_TYPE (ECellCombo, e_cell_combo, E_TYPE_CELL_POPUP) static void -e_cell_combo_class_init (ECellComboClass *class) +e_cell_combo_class_init (ECellComboClass *class) { ECellPopupClass *ecpc = E_CELL_POPUP_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class); @@ -120,7 +120,7 @@ e_cell_combo_class_init (ECellComboClass *class) } static void -e_cell_combo_init (ECellCombo *ecc) +e_cell_combo_init (ECellCombo *ecc) { GtkWidget *frame; AtkObject *a11y; @@ -129,7 +129,7 @@ e_cell_combo_init (ECellCombo *ecc) GtkScrolledWindow *scrolled_window; /* We create one popup window for the ECell, since there will only - ever be one popup in use at a time. */ + * ever be one popup in use at a time. */ ecc->popup_window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_type_hint ( @@ -292,10 +292,10 @@ e_cell_combo_do_popup (ECellPopup *ecp, } static void -e_cell_combo_select_matching_item (ECellCombo *ecc) +e_cell_combo_select_matching_item (ECellCombo *ecc) { ECellPopup *ecp = E_CELL_POPUP (ecc); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ECellText *ecell_text = E_CELL_TEXT (ecp->child); ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); ETableCol *ecol; @@ -342,7 +342,9 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) } static void -e_cell_combo_show_popup (ECellCombo *ecc, gint row, gint view_col) +e_cell_combo_show_popup (ECellCombo *ecc, + gint row, + gint view_col) { GdkWindow *window; GtkAllocation allocation; @@ -379,13 +381,13 @@ e_cell_combo_show_popup (ECellCombo *ecc, gint row, gint view_col) /* Calculates the size and position of the popup window (like GtkCombo). */ static void -e_cell_combo_get_popup_pos (ECellCombo *ecc, - gint row, - gint view_col, - gint *x, - gint *y, - gint *height, - gint *width) +e_cell_combo_get_popup_pos (ECellCombo *ecc, + gint row, + gint view_col, + gint *x, + gint *y, + gint *height, + gint *width) { ECellPopup *ecp = E_CELL_POPUP (ecc); ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); @@ -448,7 +450,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, avail_height = gdk_screen_height () - *y; /* We'll use the entire screen width if needed, but we save space for - the vertical scrollbar in case we need to show that. */ + * the vertical scrollbar in case we need to show that. */ screen_width = gdk_screen_width (); avail_width = screen_width - scrollbar_width; @@ -481,7 +483,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, *width = column_width; /* If it is larger than the available width, use that instead and show - the horizontal scrollbar. */ + * the horizontal scrollbar. */ if (*width > avail_width) { *width = avail_width; show_hscroll = TRUE; @@ -506,11 +508,11 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, /* Check if it fits in the available height. */ if (work_height + list_requisition.height > avail_height) { /* It doesn't fit, so we see if we have the minimum space - needed. */ + * needed. */ if (work_height + min_height > avail_height && *y - row_height > avail_height) { /* We don't, so we show the popup above the cell - instead of below it. */ + * instead of below it. */ avail_height = *y - row_height; *y -= (work_height + list_requisition.height + row_height); @@ -526,7 +528,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, } /* We try to line it up with the right edge of the column, but we don't - want it to go off the edges of the screen. */ + * want it to go off the edges of the screen. */ if (*x > screen_width) *x = screen_width; *x -= *width; @@ -540,7 +542,8 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, } static void -e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc) +e_cell_combo_selection_changed (GtkTreeSelection *selection, + ECellCombo *ecc) { GtkTreeIter iter; GtkTreeModel *model; @@ -554,25 +557,25 @@ e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc) } /* This handles button press events in the popup window. - Note that since we have a pointer grab on this window, we also get button - press events for windows outside the application here, so we hide the popup - window if that happens. We also get propagated events from child widgets - which we ignore. */ + * Note that since we have a pointer grab on this window, we also get button + * press events for windows outside the application here, so we hide the popup + * window if that happens. We also get propagated events from child widgets + * which we ignore. */ static gint -e_cell_combo_button_press (GtkWidget *popup_window, - GdkEvent *event, - ECellCombo *ecc) +e_cell_combo_button_press (GtkWidget *popup_window, + GdkEvent *event, + ECellCombo *ecc) { GtkWidget *event_widget; event_widget = gtk_get_event_widget (event); /* If the button press was for a widget inside the popup list, but - not the popup window itself, then we ignore the event and return - FALSE. Otherwise we will hide the popup. - Note that since we have a pointer grab on the popup list, button - presses outside the application will be reported to this window, - which is why we hide the popup in this case. */ + * not the popup window itself, then we ignore the event and return + * FALSE. Otherwise we will hide the popup. + * Note that since we have a pointer grab on the popup list, button + * presses outside the application will be reported to this window, + * which is why we hide the popup in this case. */ while (event_widget) { event_widget = gtk_widget_get_parent (event_widget); if (event_widget == ecc->popup_tree_view) @@ -588,10 +591,10 @@ e_cell_combo_button_press (GtkWidget *popup_window, d(g_print("%s: popup_shown = FALSE\n", __FUNCTION__)); /* We don't want to update the cell here. Since the list is in browse - mode there will always be one item selected, so when we popup the - list one item is selected even if it doesn't match the current text - in the cell. So if you click outside the popup (which is what has - happened here) it is better to not update the cell. */ + * mode there will always be one item selected, so when we popup the + * list one item is selected even if it doesn't match the current text + * in the cell. So if you click outside the popup (which is what has + * happened here) it is better to not update the cell. */ /*e_cell_combo_update_cell (ecc);*/ e_cell_combo_restart_edit (ecc); @@ -599,16 +602,16 @@ e_cell_combo_button_press (GtkWidget *popup_window, } /* This handles button release events in the popup window. If the button is - released inside the list, we want to hide the popup window and update the - cell with the new selection. */ + * released inside the list, we want to hide the popup window and update the + * cell with the new selection. */ static gint -e_cell_combo_button_release (GtkWidget *popup_window, - GdkEventButton *event, - ECellCombo *ecc) +e_cell_combo_button_release (GtkWidget *popup_window, + GdkEventButton *event, + ECellCombo *ecc) { GtkWidget *event_widget; - event_widget = gtk_get_event_widget ((GdkEvent*) event); + event_widget = gtk_get_event_widget ((GdkEvent *) event); /* See if the button was released in the list (or its children). */ while (event_widget && event_widget != ecc->popup_tree_view) @@ -619,7 +622,7 @@ e_cell_combo_button_release (GtkWidget *popup_window, return FALSE; /* The button was released inside the list, so we hide the popup and - update the cell to reflect the new selection. */ + * update the cell to reflect the new selection. */ gtk_grab_remove (ecc->popup_window); gdk_pointer_ungrab (event->time); gdk_keyboard_ungrab (event->time); @@ -635,11 +638,11 @@ e_cell_combo_button_release (GtkWidget *popup_window, } /* This handles key press events in the popup window. If the Escape key is - pressed we hide the popup, and do not change the cell contents. */ + * pressed we hide the popup, and do not change the cell contents. */ static gint -e_cell_combo_key_press (GtkWidget *popup_window, - GdkEventKey *event, - ECellCombo *ecc) +e_cell_combo_key_press (GtkWidget *popup_window, + GdkEventKey *event, + ECellCombo *ecc) { /* If the Escape key is pressed we hide the popup. */ if (event->keyval != GDK_KEY_Escape @@ -670,10 +673,10 @@ e_cell_combo_key_press (GtkWidget *popup_window, } static void -e_cell_combo_update_cell (ECellCombo *ecc) +e_cell_combo_update_cell (ECellCombo *ecc) { ECellPopup *ecp = E_CELL_POPUP (ecc); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ECellText *ecell_text = E_CELL_TEXT (ecp->child); ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); ETableCol *ecol; @@ -708,11 +711,11 @@ e_cell_combo_update_cell (ECellCombo *ecc) } static void -e_cell_combo_restart_edit (ECellCombo *ecc) +e_cell_combo_restart_edit (ECellCombo *ecc) { /* This doesn't work. ETable stops the edit straight-away again. */ #if 0 - ECellView *ecv = (ECellView*) ecc->popup_cell_view; + ECellView *ecv = (ECellView *) ecc->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); e_table_item_enter_edit (eti, ecc->popup_view_col, ecc->popup_row); diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index 7517ad0e9c..3035652116 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -219,7 +219,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) ecde->time_callback_destroy = NULL; /* We create one popup window for the ECell, since there will only - ever be one popup in use at a time. */ + * ever be one popup in use at a time. */ ecde->popup_window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_type_hint (GTK_WINDOW (ecde->popup_window), @@ -299,7 +299,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) now_button = gtk_button_new_with_label (_("Now")); gtk_container_add (GTK_CONTAINER (bbox), now_button); gtk_widget_show (now_button); - g_signal_connect((now_button), "clicked", + g_signal_connect ((now_button), "clicked", G_CALLBACK (e_cell_date_edit_on_now_clicked), ecde); ecde->now_button = now_button; @@ -307,7 +307,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) today_button = gtk_button_new_with_label (_("Today")); gtk_container_add (GTK_CONTAINER (bbox), today_button); gtk_widget_show (today_button); - g_signal_connect((today_button), "clicked", + g_signal_connect ((today_button), "clicked", G_CALLBACK (e_cell_date_edit_on_today_clicked), ecde); ecde->today_button = today_button; @@ -316,7 +316,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) none_button = gtk_button_new_with_label (C_("table-date", "None")); gtk_container_add (GTK_CONTAINER (bbox), none_button); gtk_widget_show (none_button); - g_signal_connect((none_button), "clicked", + g_signal_connect ((none_button), "clicked", G_CALLBACK (e_cell_date_edit_on_none_clicked), ecde); ecde->none_button = none_button; @@ -324,7 +324,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) ok_button = gtk_button_new_with_label (_("OK")); gtk_container_add (GTK_CONTAINER (bbox), ok_button); gtk_widget_show (ok_button); - g_signal_connect((ok_button), "clicked", + g_signal_connect ((ok_button), "clicked", G_CALLBACK (e_cell_date_edit_on_ok_clicked), ecde); @@ -346,16 +346,16 @@ e_cell_date_edit_init (ECellDateEdit *ecde) * Returns: an ECellDateEdit object. */ ECell * -e_cell_date_edit_new (void) +e_cell_date_edit_new (void) { return g_object_new (e_cell_date_edit_get_type (), NULL); } static void -e_cell_date_edit_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) +e_cell_date_edit_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellDateEdit *ecde; @@ -389,10 +389,10 @@ e_cell_date_edit_get_property (GObject *object, } static void -e_cell_date_edit_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) +e_cell_date_edit_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellDateEdit *ecde; gint ivalue; @@ -477,10 +477,10 @@ e_cell_date_edit_dispose (GObject *object) } static gint -e_cell_date_edit_do_popup (ECellPopup *ecp, - GdkEvent *event, - gint row, - gint view_col) +e_cell_date_edit_do_popup (ECellPopup *ecp, + GdkEvent *event, + gint row, + gint view_col) { ECellDateEdit *ecde = E_CELL_DATE_EDIT (ecp); GdkWindow *window; @@ -499,11 +499,11 @@ e_cell_date_edit_do_popup (ECellPopup *ecp, } static void -e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) +e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) { ECellPopup *ecp = E_CELL_POPUP (ecde); ECellText *ecell_text = E_CELL_TEXT (ecp->child); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); ETableCol *ecol; gchar *cell_text; @@ -519,7 +519,7 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) ecol->col_idx, ecp->popup_row); /* Try to parse just a date first. If the value is only a date, we - use a DATE value. */ + * use a DATE value. */ status = e_time_parse_date (cell_text, &date_tm); if (status == E_TIME_PARSE_INVALID) { is_date = FALSE; @@ -527,7 +527,7 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) } /* If there is no date and time set, or the date is invalid, we clear - the selections, else we select the appropriate date & time. */ + * the selections, else we select the appropriate date & time. */ calitem = E_CALENDAR_ITEM (E_CALENDAR (ecde->calendar)->calitem); if (status == E_TIME_PARSE_NONE || status == E_TIME_PARSE_INVALID) { gtk_entry_set_text (GTK_ENTRY (ecde->time_entry), ""); @@ -562,8 +562,8 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) } static void -e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, - gchar *time) +e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, + gchar *time) { gboolean found = FALSE; gboolean valid; @@ -605,9 +605,9 @@ e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, } static void -e_cell_date_edit_show_popup (ECellDateEdit *ecde, - gint row, - gint view_col) +e_cell_date_edit_show_popup (ECellDateEdit *ecde, + gint row, + gint view_col) { GdkWindow *window; gint x, y, width, height; @@ -631,13 +631,13 @@ e_cell_date_edit_show_popup (ECellDateEdit *ecde, /* Calculates the size and position of the popup window (like GtkCombo). */ static void -e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, - gint row, - gint view_col, - gint *x, - gint *y, - gint *height, - gint *width) +e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, + gint row, + gint view_col, + gint *x, + gint *y, + gint *height, + gint *width) { ECellPopup *ecp = E_CELL_POPUP (ecde); ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); @@ -672,7 +672,7 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, *x += x1; /* The ETable positions don't include the grid lines, I think, so we - add 1. */ + * add 1. */ scrollable = GTK_SCROLLABLE (&GNOME_CANVAS (canvas)->layout); adjustment = gtk_scrollable_get_vadjustment (scrollable); value = (gint) gtk_adjustment_get_value (adjustment); @@ -681,7 +681,7 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, avail_height = gdk_screen_height () - *y; /* We'll use the entire screen width if needed, but we save space for - the vertical scrollbar in case we need to show that. */ + * the vertical scrollbar in case we need to show that. */ screen_width = gdk_screen_width (); gtk_widget_get_preferred_size (ecde->popup_window, &popup_requisition, NULL); @@ -696,10 +696,10 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, /* Check if it fits in the available height. */ if (popup_requisition.height > avail_height) { /* It doesn't fit, so we see if we have the minimum space - needed. */ + * needed. */ if (*y - row_height > avail_height) { /* We don't, so we show the popup above the cell - instead of below it. */ + * instead of below it. */ *y -= (popup_requisition.height + row_height); if (*y < 0) *y = 0; @@ -707,7 +707,7 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, } /* We try to line it up with the right edge of the column, but we don't - want it to go off the edges of the screen. */ + * want it to go off the edges of the screen. */ if (*x > screen_width) *x = screen_width; *x -= *width; @@ -718,11 +718,11 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, } /* This handles key press events in the popup window. If the Escape key is - pressed we hide the popup, and do not change the cell contents. */ + * pressed we hide the popup, and do not change the cell contents. */ static gint -e_cell_date_edit_key_press (GtkWidget *popup_window, - GdkEventKey *event, - ECellDateEdit *ecde) +e_cell_date_edit_key_press (GtkWidget *popup_window, + GdkEventKey *event, + ECellDateEdit *ecde) { /* If the Escape key is pressed we hide the popup. */ if (event->keyval != GDK_KEY_Escape) @@ -734,16 +734,16 @@ e_cell_date_edit_key_press (GtkWidget *popup_window, } /* This handles button press events in the popup window. If the button is - pressed outside the popup, we hide it and do not change the cell contents. + * pressed outside the popup, we hide it and do not change the cell contents. */ static gint -e_cell_date_edit_button_press (GtkWidget *popup_window, - GdkEventButton *event, - ECellDateEdit *ecde) +e_cell_date_edit_button_press (GtkWidget *popup_window, + GdkEventButton *event, + ECellDateEdit *ecde) { GtkWidget *event_widget; - event_widget = gtk_get_event_widget ((GdkEvent*) event); + event_widget = gtk_get_event_widget ((GdkEvent *) event); if (gtk_widget_get_toplevel (event_widget) != popup_window) { e_cell_date_edit_hide_popup (ecde); } @@ -752,9 +752,9 @@ e_cell_date_edit_button_press (GtkWidget *popup_window, } /* Clears the time list and rebuilds it using the lower_hour, upper_hour - and use_24_hour_format settings. */ + * and use_24_hour_format settings. */ static void -e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) +e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) { GtkListStore *store; gchar buffer[40]; @@ -774,7 +774,7 @@ e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) for (hour = ecde->lower_hour; hour <= ecde->upper_hour; hour++) { /* We don't want to display midnight at the end, since that is - really in the next day. */ + * really in the next day. */ if (hour == 24) break; @@ -798,8 +798,8 @@ e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) } static void -e_cell_date_edit_on_ok_clicked (GtkWidget *button, - ECellDateEdit *ecde) +e_cell_date_edit_on_ok_clicked (GtkWidget *button, + ECellDateEdit *ecde) { ECalendarItem *calitem; GDate start_date, end_date; @@ -860,7 +860,7 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) buffer, sizeof (buffer)); /* FIXME: Fix transient settings - I'm not sure it works with popup - windows. Maybe we need to use a normal window without decorations.*/ + * windows. Maybe we need to use a normal window without decorations.*/ dialog = gtk_message_dialog_new ( GTK_WINDOW (ecde->popup_window), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -937,7 +937,7 @@ e_cell_date_edit_update_cell (ECellDateEdit *ecde, { ECellPopup *ecp = E_CELL_POPUP (ecde); ECellText *ecell_text = E_CELL_TEXT (ecp->child); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); ETableCol *ecol; gchar *old_text; @@ -991,10 +991,10 @@ e_cell_date_edit_hide_popup (ECellDateEdit *ecde) } /* These freeze and thaw the rebuilding of the time list. They are useful when - setting several properties which result in rebuilds of the list, e.g. the - lower_hour, upper_hour and use_24_hour_format properties. */ + * setting several properties which result in rebuilds of the list, e.g. the + * lower_hour, upper_hour and use_24_hour_format properties. */ void -e_cell_date_edit_freeze (ECellDateEdit *ecde) +e_cell_date_edit_freeze (ECellDateEdit *ecde) { g_return_if_fail (E_IS_CELL_DATE_EDIT (ecde)); @@ -1002,7 +1002,7 @@ e_cell_date_edit_freeze (ECellDateEdit *ecde) } void -e_cell_date_edit_thaw (ECellDateEdit *ecde) +e_cell_date_edit_thaw (ECellDateEdit *ecde) { g_return_if_fail (E_IS_CELL_DATE_EDIT (ecde)); @@ -1015,13 +1015,13 @@ e_cell_date_edit_thaw (ECellDateEdit *ecde) } /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void -e_cell_date_edit_set_get_time_callback (ECellDateEdit *ecde, - ECellDateEditGetTimeCallback cb, - gpointer data, - GDestroyNotify destroy) +e_cell_date_edit_set_get_time_callback (ECellDateEdit *ecde, + ECellDateEditGetTimeCallback cb, + gpointer data, + GDestroyNotify destroy) { g_return_if_fail (E_IS_CELL_DATE_EDIT (ecde)); diff --git a/widgets/table/e-cell-date-edit.h b/widgets/table/e-cell-date-edit.h index 5224b0ddff..186302d79a 100644 --- a/widgets/table/e-cell-date-edit.h +++ b/widgets/table/e-cell-date-edit.h @@ -84,7 +84,7 @@ struct _ECellDateEdit { gboolean need_time_list_rebuild; /* The freeze count for rebuilding the time list. We only rebuild when - this is 0. */ + * this is 0. */ gint freeze_count; ECellDateEditGetTimeCallback time_callback; @@ -100,14 +100,14 @@ GType e_cell_date_edit_get_type (void) G_GNUC_CONST; ECell * e_cell_date_edit_new (void); /* These freeze and thaw the rebuilding of the time list. They are useful when - setting several properties which result in rebuilds of the list, e.g. the - lower_hour, upper_hour and use_24_hour_format properties. */ + * setting several properties which result in rebuilds of the list, e.g. the + * lower_hour, upper_hour and use_24_hour_format properties. */ void e_cell_date_edit_freeze (ECellDateEdit *ecde); void e_cell_date_edit_thaw (ECellDateEdit *ecde); /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void e_cell_date_edit_set_get_time_callback (ECellDateEdit *ecde, ECellDateEditGetTimeCallback cb, diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index fb3dd9fc71..79534aff45 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -39,7 +39,10 @@ G_DEFINE_TYPE (ECellDate, e_cell_date, E_TYPE_CELL_TEXT) static gchar * -ecd_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ecd_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { time_t date = GPOINTER_TO_INT (e_table_model_value_at (model, col, row)); const gchar *fmt_component, *fmt_part = NULL; @@ -59,7 +62,8 @@ ecd_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecd_free_text (ECellText *cell, gchar *text) +ecd_free_text (ECellText *cell, + gchar *text) { g_free (text); } @@ -104,7 +108,8 @@ e_cell_date_init (ECellDate *ecd) * Returns: an ECell object that can be used to render dates. */ ECell * -e_cell_date_new (const gchar *fontname, GtkJustification justify) +e_cell_date_new (const gchar *fontname, + GtkJustification justify) { ECellDate *ecd = g_object_new (E_TYPE_CELL_DATE, NULL); @@ -114,7 +119,8 @@ e_cell_date_new (const gchar *fontname, GtkJustification justify) } void -e_cell_date_set_format_component (ECellDate *ecd, const gchar *fmt_component) +e_cell_date_set_format_component (ECellDate *ecd, + const gchar *fmt_component) { g_return_if_fail (ecd != NULL); diff --git a/widgets/table/e-cell-hbox.c b/widgets/table/e-cell-hbox.c index c8485b983a..a8eb4ccb76 100644 --- a/widgets/table/e-cell-hbox.c +++ b/widgets/table/e-cell-hbox.c @@ -50,7 +50,9 @@ G_DEFINE_TYPE (ECellHbox, e_cell_hbox, E_TYPE_CELL) * ECell::new_view method */ static ECellView * -ecv_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ecv_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellHbox *ecv = E_CELL_HBOX (ecell); ECellHboxView *hbox_view = g_new0 (ECellHboxView, 1); @@ -155,11 +157,11 @@ ecv_draw (ECellView *ecell_view, gint subcell_offset = 0; gint i; - gint allotted_width = x2-x1; + gint allotted_width = x2 - x1; for (i = 0; i < hbox_view->subcell_view_count; i++) { /* Now cause our subcells to draw their contents, - shifted by subcell_offset pixels */ + * shifted by subcell_offset pixels */ gint width = allotted_width * hbox_view->def_size_cols[i] / 100; /* e_cell_max_width_by_row (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col, row); if (width < hbox_view->def_size_cols[i]) @@ -180,7 +182,13 @@ ecv_draw (ECellView *ecell_view, * ECell::event method */ static gint -ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ecv_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; gint y = 0; @@ -217,7 +225,10 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::height method */ static gint -ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ecv_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; gint height = 0, max_height = 0; @@ -234,7 +245,9 @@ ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECell::max_width method */ static gint -ecv_max_width (ECellView *ecell_view, gint model_col, gint view_col) +ecv_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; gint width = 0; @@ -321,7 +334,10 @@ e_cell_hbox_new (void) } void -e_cell_hbox_append (ECellHbox *hbox, ECell *subcell, gint model_col, gint size) +e_cell_hbox_append (ECellHbox *hbox, + ECell *subcell, + gint model_col, + gint size) { hbox->subcell_count++; diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c index 7944bbea51..6e2f685a86 100644 --- a/widgets/table/e-cell-number.c +++ b/widgets/table/e-cell-number.c @@ -35,7 +35,10 @@ G_DEFINE_TYPE (ECellNumber, e_cell_number, E_TYPE_CELL_TEXT) static gchar * -ecn_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ecn_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { gpointer value; @@ -45,7 +48,8 @@ ecn_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecn_free_text (ECellText *cell, gchar *text) +ecn_free_text (ECellText *cell, + gchar *text) { g_free (text); } @@ -78,7 +82,8 @@ e_cell_number_init (ECellNumber *cell_number) * Returns: an ECell object that can be used to render numbers. */ ECell * -e_cell_number_new (const gchar *fontname, GtkJustification justify) +e_cell_number_new (const gchar *fontname, + GtkJustification justify) { ECellNumber *ecn = g_object_new (E_TYPE_CELL_NUMBER, NULL); diff --git a/widgets/table/e-cell-percent.c b/widgets/table/e-cell-percent.c index 5b54527f67..61543b0e0c 100644 --- a/widgets/table/e-cell-percent.c +++ b/widgets/table/e-cell-percent.c @@ -41,7 +41,10 @@ G_DEFINE_TYPE (ECellPercent, e_cell_percent, E_TYPE_CELL_TEXT) static gchar * -ecp_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ecp_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { gint percent; static gchar buffer[8]; @@ -59,7 +62,8 @@ ecp_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecp_free_text (ECellText *cell, gchar *text) +ecp_free_text (ECellText *cell, + gchar *text) { /* Do Nothing. */ } @@ -79,8 +83,11 @@ show_percent_warning (void) } static void -ecp_set_value (ECellText *cell, ETableModel *model, gint col, gint row, - const gchar *text) +ecp_set_value (ECellText *cell, + ETableModel *model, + gint col, + gint row, + const gchar *text) { gint matched, percent; gboolean empty = TRUE; @@ -141,7 +148,8 @@ e_cell_percent_init (ECellPercent *ecp) * Returns: an ECell object that can be used to render numbers. */ ECell * -e_cell_percent_new (const gchar *fontname, GtkJustification justify) +e_cell_percent_new (const gchar *fontname, + GtkJustification justify) { ECellPercent *ecn = g_object_new (E_TYPE_CELL_PERCENT, NULL); diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index 9a9e31c7e4..b2cf3e2a2d 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -66,7 +66,9 @@ e_cell_pixbuf_new (void) */ static ECellView * -pixbuf_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +pixbuf_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellPixbufView *pixbuf_view = g_new0 (ECellPixbufView, 1); ETableItem *eti = E_TABLE_ITEM (e_table_item_view); @@ -99,9 +101,16 @@ pixbuf_kill_view (ECellView *ecell_view) } static void -pixbuf_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +pixbuf_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { GdkPixbuf *cell_pixbuf; gint real_x, real_y; @@ -124,14 +133,14 @@ pixbuf_draw (ECellView *ecell_view, cairo_t *cr, /* We center the pixbuf within our allocated space */ if (x2 - x1 > pix_w) { gint diff = (x2 - x1) - pix_w; - real_x = x1 + diff/2; + real_x = x1 + diff / 2; } else { real_x = x1; } if (y2 - y1 > pix_h) { gint diff = (y2 - y1) - pix_h; - real_y = y1 + diff/2; + real_y = y1 + diff / 2; } else { real_y = y1; } @@ -143,9 +152,13 @@ pixbuf_draw (ECellView *ecell_view, cairo_t *cr, } static gint -pixbuf_event (ECellView *ecell_view, GdkEvent *event, - gint model_col, gint view_col, gint row, - ECellFlags flags, ECellActions *actions) +pixbuf_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { /* noop */ @@ -153,7 +166,10 @@ pixbuf_event (ECellView *ecell_view, GdkEvent *event, } static gint -pixbuf_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +pixbuf_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { GdkPixbuf *pixbuf; if (row == -1) { @@ -176,9 +192,13 @@ pixbuf_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECell::print method */ static void -pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +pixbuf_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { GdkPixbuf *pixbuf; gint scale; @@ -197,9 +217,12 @@ pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +pixbuf_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { GdkPixbuf *pixbuf; @@ -220,7 +243,9 @@ pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, } static gint -pixbuf_max_width (ECellView *ecell_view, gint model_col, gint view_col) +pixbuf_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { gint pw; gint num_rows, i; @@ -249,15 +274,15 @@ pixbuf_max_width (ECellView *ecell_view, gint model_col, gint view_col) static void pixbuf_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (prop_id) { + switch (property_id) { case PROP_SELECTED_COLUMN: pixbuf->selected_column = g_value_get_int (value); break; @@ -278,15 +303,15 @@ pixbuf_set_property (GObject *object, /* Get_arg handler for the pixbuf item */ static void pixbuf_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (prop_id) { + switch (property_id) { case PROP_SELECTED_COLUMN: g_value_set_int (value, pixbuf->selected_column); break; @@ -300,7 +325,7 @@ pixbuf_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c index b3ba9bdfac..65440b2465 100644 --- a/widgets/table/e-cell-popup.c +++ b/widgets/table/e-cell-popup.c @@ -49,7 +49,7 @@ static void e_cell_popup_dispose (GObject *object); -static ECellView* ecp_new_view (ECell *ecell, +static ECellView * ecp_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view); static void ecp_kill_view (ECellView *ecv); @@ -111,7 +111,7 @@ static gint e_cell_popup_do_popup (ECellPopupView *ecp_view, G_DEFINE_TYPE (ECellPopup, e_cell_popup, E_TYPE_CELL) static void -e_cell_popup_class_init (ECellPopupClass *class) +e_cell_popup_class_init (ECellPopupClass *class) { ECellClass *ecc = E_CELL_CLASS (class); @@ -137,7 +137,7 @@ e_cell_popup_class_init (ECellPopupClass *class) } static void -e_cell_popup_init (ECellPopup *ecp) +e_cell_popup_init (ECellPopup *ecp) { ecp->popup_shown = FALSE; ecp->popup_model = NULL; @@ -172,7 +172,9 @@ e_cell_popup_dispose (GObject *object) * ECell::new_view method */ static ECellView * -ecp_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ecp_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellPopup *ecp = E_CELL_POPUP (ecell); ECellPopupView *ecp_view; @@ -191,7 +193,7 @@ ecp_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view ecp_view->child_view = e_cell_new_view (ecp->child, table_model, e_table_item_view); - return (ECellView*) ecp_view; + return (ECellView *) ecp_view; } /* @@ -247,9 +249,16 @@ ecp_unrealize (ECellView *ecv) * ECell::draw method */ static void -ecp_draw (ECellView *ecv, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +ecp_draw (ECellView *ecv, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { ECellPopup *ecp = E_CELL_POPUP (ecv->ecell); ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -263,7 +272,7 @@ ecp_draw (ECellView *ecv, cairo_t *cr, canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (ecv->e_table_item_view)->canvas); /* Display the popup arrow if we are the cursor cell, or the popup - is shown for this cell. */ + * is shown for this cell. */ show_popup_arrow = e_table_model_is_cell_editable ( ecv->e_table_model, model_col, row) && @@ -318,8 +327,13 @@ ecp_draw (ECellView *ecv, cairo_t *cr, * ECell::event method */ static gint -ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, - gint row, ECellFlags flags, ECellActions *actions) +ecp_event (ECellView *ecv, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); @@ -335,7 +349,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, view_col + 1); /* FIXME: The event coords seem to be relative to the - text within the cell, so we have to add 4. */ + * text within the cell, so we have to add 4. */ if (event->button.x + 4 >= width - E_CELL_POPUP_ARROW_WIDTH) { return e_cell_popup_do_popup (ecp_view, event, row, view_col); } @@ -360,7 +374,10 @@ ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, * ECell::height method */ static gint -ecp_height (ECellView *ecv, gint model_col, gint view_col, gint row) +ecp_height (ECellView *ecv, + gint model_col, + gint view_col, + gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -371,7 +388,10 @@ ecp_height (ECellView *ecv, gint model_col, gint view_col, gint row) * ECellView::enter_edit method */ static gpointer -ecp_enter_edit (ECellView *ecv, gint model_col, gint view_col, gint row) +ecp_enter_edit (ECellView *ecv, + gint model_col, + gint view_col, + gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -382,8 +402,11 @@ ecp_enter_edit (ECellView *ecv, gint model_col, gint view_col, gint row) * ECellView::leave_edit method */ static void -ecp_leave_edit (ECellView *ecv, gint model_col, gint view_col, gint row, - gpointer edit_context) +ecp_leave_edit (ECellView *ecv, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -392,8 +415,13 @@ ecp_leave_edit (ECellView *ecv, gint model_col, gint view_col, gint row, } static void -ecp_print (ECellView *ecv, GtkPrintContext *context, - gint model_col, gint view_col, gint row, gdouble width, gdouble height) +ecp_print (ECellView *ecv, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -402,9 +430,12 @@ ecp_print (ECellView *ecv, GtkPrintContext *context, } static gdouble -ecp_print_height (ECellView *ecv, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +ecp_print_height (ECellView *ecv, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -414,8 +445,8 @@ ecp_print_height (ECellView *ecv, GtkPrintContext *context, static gint ecp_max_width (ECellView *ecv, - gint model_col, - gint view_col) + gint model_col, + gint view_col) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -423,15 +454,16 @@ ecp_max_width (ECellView *ecv, } static gchar * -ecp_get_bg_color (ECellView *ecell_view, gint row) +ecp_get_bg_color (ECellView *ecell_view, + gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecell_view; return e_cell_get_bg_color (ecp_view->child_view, row); } -ECell* -e_cell_popup_get_child (ECellPopup *ecp) +ECell * +e_cell_popup_get_child (ECellPopup *ecp) { g_return_val_if_fail (E_IS_CELL_POPUP (ecp), NULL); @@ -439,8 +471,8 @@ e_cell_popup_get_child (ECellPopup *ecp) } void -e_cell_popup_set_child (ECellPopup *ecp, - ECell *child) +e_cell_popup_set_child (ECellPopup *ecp, + ECell *child) { g_return_if_fail (E_IS_CELL_POPUP (ecp)); @@ -452,10 +484,10 @@ e_cell_popup_set_child (ECellPopup *ecp, } static gint -e_cell_popup_do_popup (ECellPopupView *ecp_view, - GdkEvent *event, - gint row, - gint view_col) +e_cell_popup_do_popup (ECellPopupView *ecp_view, + GdkEvent *event, + gint row, + gint view_col) { ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); gint (*popup_func) (ECellPopup *ecp, GdkEvent *event, gint row, gint view_col); @@ -472,7 +504,7 @@ e_cell_popup_do_popup (ECellPopupView *ecp_view, } /* This redraws the popup cell. Only use this if you know popup_view_col and - popup_row are valid. */ + * popup_row are valid. */ void e_cell_popup_queue_cell_redraw (ECellPopup *ecp) { @@ -486,8 +518,8 @@ e_cell_popup_queue_cell_redraw (ECellPopup *ecp) } void -e_cell_popup_set_shown (ECellPopup *ecp, - gboolean shown) +e_cell_popup_set_shown (ECellPopup *ecp, + gboolean shown) { ecp->popup_shown = shown; e_cell_popup_queue_cell_redraw (ecp); diff --git a/widgets/table/e-cell-popup.h b/widgets/table/e-cell-popup.h index 6d04fb3c8d..bc99196eaf 100644 --- a/widgets/table/e-cell-popup.h +++ b/widgets/table/e-cell-popup.h @@ -66,13 +66,13 @@ struct _ECellPopup { ECell *child; /* This is TRUE if the popup window is shown for the cell being - edited. While shown we display the arrow indented. */ + * edited. While shown we display the arrow indented. */ gboolean popup_shown; /* This is TRUE if the popup arrow is shown for the cell being edited. - This is needed to stop the first click on the cell from popping up - the popup window. We only popup the window after we have drawn the - arrow. */ + * This is needed to stop the first click on the cell from popping up + * the popup window. We only popup the window after we have drawn the + * arrow. */ gboolean popup_arrow_shown; /* The view in which the popup is shown. */ diff --git a/widgets/table/e-cell-size.c b/widgets/table/e-cell-size.c index d596713977..b330a95a96 100644 --- a/widgets/table/e-cell-size.c +++ b/widgets/table/e-cell-size.c @@ -34,7 +34,10 @@ G_DEFINE_TYPE (ECellSize, e_cell_size, E_TYPE_CELL_TEXT) static gchar * -ecd_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ecd_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { gint size = GPOINTER_TO_INT (e_table_model_value_at (model, col, row)); gfloat fsize; @@ -53,7 +56,8 @@ ecd_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecd_free_text (ECellText *cell, gchar *text) +ecd_free_text (ECellText *cell, + gchar *text) { g_free (text); } @@ -98,7 +102,8 @@ e_cell_size_init (ECellSize *e_cell_size) * * Returns: an ECell object that can be used to render file sizes. */ ECell * -e_cell_size_new (const gchar *fontname, GtkJustification justify) +e_cell_size_new (const gchar *fontname, + GtkJustification justify) { ECellSize *ecd = g_object_new (E_TYPE_CELL_SIZE, NULL); diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 9d652372d0..7e391c3ba9 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -205,33 +205,42 @@ static gboolean e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, ECel static gboolean e_cell_text_delete_surrounding_cb (GtkIMContext *context, gint offset, gint n_chars, ECellTextView *text_view); static void _insert (ECellTextView *text_view, const gchar *string, gint value); static void _delete_selection (ECellTextView *text_view); -static PangoAttrList* build_attr_list (ECellTextView *text_view, gint row, gint text_length); +static PangoAttrList * build_attr_list (ECellTextView *text_view, gint row, gint text_length); static void update_im_cursor_location (ECellTextView *tv); static gchar * -ect_real_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ect_real_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { return e_table_model_value_at (model, col, row); } static void -ect_real_free_text (ECellText *cell, gchar *text) +ect_real_free_text (ECellText *cell, + gchar *text) { } /* This is the default method for setting the ETableModel value based on - the text in the ECellText. This simply uses the text as it is - it assumes - the value in the model is a gchar *. Subclasses may parse the text into - data structures to pass to the model. */ + * the text in the ECellText. This simply uses the text as it is - it assumes + * the value in the model is a gchar *. Subclasses may parse the text into + * data structures to pass to the model. */ static void -ect_real_set_value (ECellText *cell, ETableModel *model, gint col, gint row, - const gchar *text) +ect_real_set_value (ECellText *cell, + ETableModel *model, + gint col, + gint row, + const gchar *text) { e_table_model_set_value_at (model, col, row, text); } static void -ect_queue_redraw (ECellTextView *text_view, gint view_col, gint view_row) +ect_queue_redraw (ECellTextView *text_view, + gint view_col, + gint view_row) { e_table_item_redraw_range ( text_view->cell_view.e_table_item_view, @@ -242,7 +251,8 @@ ect_queue_redraw (ECellTextView *text_view, gint view_col, gint view_row) * Shuts down the editing process */ static void -ect_stop_editing (ECellTextView *text_view, gboolean commit) +ect_stop_editing (ECellTextView *text_view, + gboolean commit) { GdkWindow *window; CellEdit *edit = text_view->edit; @@ -319,7 +329,9 @@ ect_cancel_edit (ECellTextView *text_view) * ECell::new_view method */ static ECellView * -ect_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ect_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellTextView *text_view = g_new0 (ECellTextView, 1); GnomeCanvas *canvas = GNOME_CANVAS_ITEM (e_table_item_view)->canvas; @@ -388,8 +400,10 @@ ect_unrealize (ECellView *ecv) } -static PangoAttrList* -build_attr_list (ECellTextView *text_view, gint row, gint text_length) +static PangoAttrList * +build_attr_list (ECellTextView *text_view, + gint row, + gint text_length) { ECellView *ecell_view = (ECellView *) text_view; @@ -434,7 +448,10 @@ build_attr_list (ECellTextView *text_view, gint row, gint text_length) } static PangoLayout * -layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint width) +layout_with_preedit (ECellTextView *text_view, + gint row, + const gchar *text, + gint width) { CellEdit *edit = text_view->edit; PangoAttrList *attrs; @@ -463,9 +480,9 @@ layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint */ if (mlen < text_length) { - if (!g_utf8_validate (text+mlen, -1, NULL)) { + if (!g_utf8_validate (text + mlen, -1, NULL)) { gchar *tc; - tc = g_utf8_find_next_char (text+mlen,NULL); + tc = g_utf8_find_next_char (text + mlen,NULL); if (tc) { mlen = (gint) (tc - text); } @@ -495,7 +512,10 @@ layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint } static PangoLayout * -build_layout (ECellTextView *text_view, gint row, const gchar *text, gint width) +build_layout (ECellTextView *text_view, + gint row, + const gchar *text, + gint width) { ECellView *ecell_view = (ECellView *) text_view; ECellText *ect = E_CELL_TEXT (ecell_view->ecell); @@ -560,7 +580,11 @@ build_layout (ECellTextView *text_view, gint row, const gchar *text, gint width) } static PangoLayout * -generate_layout (ECellTextView *text_view, gint model_col, gint view_col, gint row, gint width) +generate_layout (ECellTextView *text_view, + gint model_col, + gint view_col, + gint row, + gint width) { ECellView *ecell_view = (ECellView *) text_view; ECellText *ect = E_CELL_TEXT (ecell_view->ecell); @@ -583,7 +607,10 @@ generate_layout (ECellTextView *text_view, gint model_col, gint view_col, gint r } static void -draw_cursor (cairo_t *cr, gint x1, gint y1, PangoRectangle rect) +draw_cursor (cairo_t *cr, + gint x1, + gint y1, + PangoRectangle rect) { gdouble scaled_x; gdouble scaled_y; @@ -602,7 +629,8 @@ draw_cursor (cairo_t *cr, gint x1, gint y1, PangoRectangle rect) } static gboolean -show_pango_rectangle (CellEdit *edit, PangoRectangle rect) +show_pango_rectangle (CellEdit *edit, + PangoRectangle rect) { gint x1 = rect.x / PANGO_SCALE; gint x2 = (rect.x + rect.width) / PANGO_SCALE; @@ -664,9 +692,16 @@ get_vertical_spacing (GtkWidget *canvas) * ECell::draw method */ static void -ect_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +ect_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { PangoLayout *layout; ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -771,7 +806,8 @@ ect_draw (ECellView *ecell_view, cairo_t *cr, * Get the background color */ static gchar * -ect_get_bg_color (ECellView *ecell_view, gint row) +ect_get_bg_color (ECellView *ecell_view, + gint row) { ECellText *ect = E_CELL_TEXT (ecell_view->ecell); gchar *color_spec; @@ -811,7 +847,13 @@ key_begins_editing (GdkEventKey *event) * ECell::event method */ static gint -ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ect_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellTextView *text_view = (ECellTextView *) ecell_view; ETextEventProcessorEvent e_tep_event; @@ -849,7 +891,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col if (edit_display && edit->im_context && gtk_im_context_filter_keypress (\ edit->im_context, - (GdkEventKey*) event)) { + (GdkEventKey *) event)) { edit->need_im_reset = TRUE; if (preedit_len && flags & E_CELL_PREEDIT) @@ -1022,7 +1064,10 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::height method */ static gint -ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellTextView *text_view = (ECellTextView *) ecell_view; gint height; @@ -1038,7 +1083,10 @@ ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECellView::enter_edit method */ static gpointer -ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit; @@ -1127,7 +1175,11 @@ ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECellView::leave_edit method */ static void -ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +ect_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1153,7 +1205,11 @@ ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, * ECellView::save_state method */ static gpointer -ect_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +ect_save_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1169,7 +1225,12 @@ ect_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, * ECellView::load_state method */ static void -ect_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context, gpointer save_state) +ect_load_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context, + gpointer save_state) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1188,14 +1249,21 @@ ect_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, * ECellView::free_state method */ static void -ect_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) +ect_free_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer save_state) { g_free (save_state); } static void -get_font_size (PangoLayout *layout, PangoFontDescription *font, const gchar *text, - gdouble *width, gdouble *height) +get_font_size (PangoLayout *layout, + PangoFontDescription *font, + const gchar *text, + gdouble *width, + gdouble *height) { gint w; gint h; @@ -1213,9 +1281,13 @@ get_font_size (PangoLayout *layout, PangoFontDescription *font, const gchar *tex } static void -ect_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +ect_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { PangoFontDescription *font_des; PangoLayout *layout; @@ -1263,7 +1335,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, dir = pango_find_base_dir (string, strlen (string)); if (underline) { - ly = ty + (gdouble) pango_font_metrics_get_underline_position (font_metrics)/(gdouble) PANGO_SCALE; + ly = ty + (gdouble) pango_font_metrics_get_underline_position (font_metrics) / (gdouble) PANGO_SCALE; cairo_new_path (cr); if (dir == PANGO_DIRECTION_RTL) { cairo_move_to (cr, width - 2, ly + text_height + 6); @@ -1273,12 +1345,12 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, cairo_move_to (cr, 2, ly + text_height + 6); cairo_line_to (cr, MIN (2 + text_width, width - 2), ly + text_height + 6); } - cairo_set_line_width (cr, (gdouble) pango_font_metrics_get_underline_thickness (font_metrics)/(gdouble) PANGO_SCALE); + cairo_set_line_width (cr, (gdouble) pango_font_metrics_get_underline_thickness (font_metrics) / (gdouble) PANGO_SCALE); cairo_stroke (cr); } if (strikeout) { - ly = ty + (gdouble) pango_font_metrics_get_strikethrough_position (font_metrics)/(gdouble) PANGO_SCALE; + ly = ty + (gdouble) pango_font_metrics_get_strikethrough_position (font_metrics) / (gdouble) PANGO_SCALE; cairo_new_path (cr); if (dir == PANGO_DIRECTION_RTL) { cairo_move_to (cr, width - 2, ly + text_height + 6); @@ -1288,13 +1360,13 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, cairo_move_to (cr, 2, ly + text_height + 6); cairo_line_to (cr, MIN (2 + text_width, width - 2), ly + text_height + 6); } - cairo_set_line_width (cr,(gdouble) pango_font_metrics_get_strikethrough_thickness (font_metrics)/(gdouble) PANGO_SCALE); + cairo_set_line_width (cr,(gdouble) pango_font_metrics_get_strikethrough_thickness (font_metrics) / (gdouble) PANGO_SCALE); cairo_stroke (cr); } cairo_move_to (cr, 2, text_height- 5); - pango_layout_set_width (layout, (width - 4)*PANGO_SCALE); + pango_layout_set_width (layout, (width - 4) * PANGO_SCALE); pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); pango_cairo_show_layout (cr, layout); cairo_restore (cr); @@ -1305,9 +1377,12 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -ect_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +ect_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { /* * Font size is 16 by default. To leave some margin for cell @@ -1321,7 +1396,7 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context, ECellText *ect = E_CELL_TEXT (ecell_view->ecell); gchar *string; gdouble text_width = 0.0, text_height = 0.0; - gint lines=1; + gint lines = 1; string = e_cell_text_get_text (ect, ecell_view->e_table_model, model_col, row); @@ -1334,15 +1409,15 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context, /* Checking if the text width goes beyond the column width to increase the * number of lines. */ - if ( text_width > width-4) - lines = (text_width / (width-4)) + 1; - return 16*lines + 8; + if ( text_width > width - 4) + lines = (text_width / (width - 4)) + 1; + return 16 *lines + 8; } static gint ect_max_width (ECellView *ecell_view, - gint model_col, - gint view_col) + gint model_col, + gint view_col) { /* New ECellText */ ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -1367,9 +1442,9 @@ ect_max_width (ECellView *ecell_view, static gint ect_max_width_by_row (ECellView *ecell_view, - gint model_col, - gint view_col, - gint row) + gint model_col, + gint view_col, + gint row) { /* New ECellText */ ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -1399,15 +1474,15 @@ ect_finalize (GObject *object) /* Set_arg handler for the text item */ static void ect_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellText *text; text = E_CELL_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_STRIKEOUT_COLUMN: text->strikeout_column = g_value_get_int (value); break; @@ -1440,15 +1515,15 @@ ect_set_property (GObject *object, /* Get_arg handler for the text item */ static void ect_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellText *text; text = E_CELL_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_STRIKEOUT_COLUMN: g_value_set_int (value, text->strikeout_column); break; @@ -1474,7 +1549,7 @@ ect_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1597,11 +1672,11 @@ e_cell_text_class_init (ECellTextClass *class) static void e_cell_text_get_cursor_locations (ECellTextView *tv, - GdkRectangle *strong_pos, - GdkRectangle *weak_pos) + GdkRectangle *strong_pos, + GdkRectangle *weak_pos) { GdkRectangle area; - CellEdit *edit=tv->edit; + CellEdit *edit = tv->edit; ECellView *cell_view = (ECellView *) tv; ETableItem *item = E_TABLE_ITEM ((cell_view)->e_table_item_view); GnomeCanvasItem *parent_item = GNOME_CANVAS_ITEM (item)->parent; @@ -1647,7 +1722,7 @@ e_cell_text_get_cursor_locations (ECellTextView *tv, static void update_im_cursor_location (ECellTextView *tv) { - CellEdit *edit=tv->edit; + CellEdit *edit = tv->edit; GdkRectangle area; e_cell_text_get_cursor_locations (tv, &area, NULL); @@ -1657,11 +1732,11 @@ update_im_cursor_location (ECellTextView *tv) static void e_cell_text_preedit_changed_cb (GtkIMContext *context, - ECellTextView *tv) + ECellTextView *tv) { gchar *preedit_string; gint cursor_pos; - CellEdit *edit=tv->edit; + CellEdit *edit = tv->edit; gtk_im_context_get_preedit_string (edit->im_context, &preedit_string, NULL, &cursor_pos); @@ -1675,8 +1750,8 @@ e_cell_text_preedit_changed_cb (GtkIMContext *context, static void e_cell_text_commit_cb (GtkIMContext *context, - const gchar *str, - ECellTextView *tv) + const gchar *str, + ECellTextView *tv) { CellEdit *edit = tv->edit; ETextEventProcessorCommand command; @@ -1693,7 +1768,7 @@ e_cell_text_commit_cb (GtkIMContext *context, static gboolean e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, - ECellTextView *tv) + ECellTextView *tv) { CellEdit *edit = tv->edit; @@ -1707,10 +1782,10 @@ e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, } static gboolean -e_cell_text_delete_surrounding_cb (GtkIMContext *context, - gint offset, - gint n_chars, - ECellTextView *tv) +e_cell_text_delete_surrounding_cb (GtkIMContext *context, + gint offset, + gint n_chars, + ECellTextView *tv) { gint begin_pos, end_pos; glong text_len; @@ -1774,7 +1849,8 @@ e_cell_text_init (ECellText *ect) * Returns: an ECell object that can be used to render strings. */ ECell * -e_cell_text_new (const gchar *fontname, GtkJustification justify) +e_cell_text_new (const gchar *fontname, + GtkJustification justify) { ECellText *ect = g_object_new (E_TYPE_CELL_TEXT, NULL); @@ -1861,7 +1937,9 @@ e_cell_text_set_value (ECellText *cell, /* position is in BYTES */ static gint -get_position_from_xy (CellEdit *edit, gint x, gint y) +get_position_from_xy (CellEdit *edit, + gint x, + gint y) { gint index; gint trailing; @@ -1955,7 +2033,8 @@ _blink_scroll_timeout (gpointer data) } static gint -next_word (CellEdit *edit, gint start) +next_word (CellEdit *edit, + gint start) { gchar *p; gint length; @@ -1977,7 +2056,8 @@ next_word (CellEdit *edit, gint start) } static gint -_get_position (ECellTextView *text_view, ETextEventProcessorCommand *command) +_get_position (ECellTextView *text_view, + ETextEventProcessorCommand *command) { gint length; CellEdit *edit = text_view->edit; @@ -2144,14 +2224,16 @@ _delete_selection (ECellTextView *text_view) edit->selection_end = edit->selection_start; - g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_DELETED], 0, text_view, edit->selection_start, ep-sp, edit->row, edit->model_col); + g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_DELETED], 0, text_view, edit->selection_start, ep - sp, edit->row, edit->model_col); } /* fixme: */ /* NB! We expect value to be length IN BYTES */ static void -_insert (ECellTextView *text_view, const gchar *string, gint value) +_insert (ECellTextView *text_view, + const gchar *string, + gint value) { CellEdit *edit = text_view->edit; gchar *temp; @@ -2173,11 +2255,14 @@ _insert (ECellTextView *text_view, const gchar *string, gint value) edit->selection_start += value; edit->selection_end = edit->selection_start; - g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_INSERTED], 0, text_view, edit->selection_end-value, value, edit->row, edit->model_col); + g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_INSERTED], 0, text_view, edit->selection_end - value, value, edit->row, edit->model_col); } static void -capitalize (CellEdit *edit, gint start, gint end, ETextEventProcessorCaps type) +capitalize (CellEdit *edit, + gint start, + gint end, + ETextEventProcessorCaps type) { ECellTextView *text_view = edit->text_view; @@ -2228,7 +2313,9 @@ capitalize (CellEdit *edit, gint start, gint end, ETextEventProcessorCaps type) } static void -e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data) +e_cell_text_view_command (ETextEventProcessor *tep, + ETextEventProcessorCommand *command, + gpointer data) { CellEdit *edit = (CellEdit *) data; ECellTextView *text_view = edit->text_view; @@ -2240,7 +2327,7 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * gint sel_start, sel_end; /* If the EText isn't editable, then ignore any commands that would - modify the text. */ + * modify the text. */ if (!ect->editable && (command->action == E_TEP_DELETE || command->action == E_TEP_INSERT || command->action == E_TEP_PASTE @@ -2372,7 +2459,11 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * } static void -e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, gchar *data, gint length) +e_cell_text_view_supply_selection (CellEdit *edit, + guint time, + GdkAtom selection, + gchar *data, + gint length) { #if DO_SELECTION GtkClipboard *clipboard; @@ -2390,8 +2481,8 @@ e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection #ifdef DO_SELECTION static void paste_received (GtkClipboard *clipboard, - const gchar *text, - gpointer data) + const gchar *text, + gpointer data) { CellEdit *edit; @@ -2412,7 +2503,9 @@ paste_received (GtkClipboard *clipboard, #endif static void -e_cell_text_view_get_selection (CellEdit *edit, GdkAtom selection, guint32 time) +e_cell_text_view_get_selection (CellEdit *edit, + GdkAtom selection, + guint32 time) { #if DO_SELECTION gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (edit->text_view->canvas), diff --git a/widgets/table/e-cell-text.h b/widgets/table/e-cell-text.h index 7645a0064b..850d0caf29 100644 --- a/widgets/table/e-cell-text.h +++ b/widgets/table/e-cell-text.h @@ -87,8 +87,8 @@ struct _ECellText { gint bold_column; /* This column in the ETable should return a string specifying a color, - either a color name like "red" or a color spec like "rgb:F/0/0". - See the XParseColor man page for the formats available. */ + * either a color name like "red" or a color spec like "rgb:F/0/0". + * See the XParseColor man page for the formats available. */ gint color_column; gint bg_color_column; }; @@ -132,8 +132,8 @@ ECell * e_cell_text_construct (ECellText *cell, GtkJustification justify); /* Gets the value from the model and converts it into a string. In ECellText - itself, the value is assumed to be a gchar * and so needs no conversion. - In subclasses the ETableModel value may be a more complicated datatype. */ + * itself, the value is assumed to be a gchar * and so needs no conversion. + * In subclasses the ETableModel value may be a more complicated datatype. */ gchar * e_cell_text_get_text (ECellText *cell, ETableModel *model, gint col, diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index 77f25ae387..e4bb093912 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -71,25 +71,29 @@ e_cell_tree_view_get_subcell_view (ECellView *ect) } static ETreePath -e_cell_tree_get_node (ETableModel *table_model, gint row) +e_cell_tree_get_node (ETableModel *table_model, + gint row) { return e_table_model_value_at (table_model, -1, row); } -static ETreeModel* -e_cell_tree_get_tree_model (ETableModel *table_model, gint row) +static ETreeModel * +e_cell_tree_get_tree_model (ETableModel *table_model, + gint row) { return e_table_model_value_at (table_model, -2, row); } static ETreeTableAdapter * -e_cell_tree_get_tree_table_adapter (ETableModel *table_model, gint row) +e_cell_tree_get_tree_table_adapter (ETableModel *table_model, + gint row) { return e_table_model_value_at (table_model, -3, row); } static gint -visible_depth_of_node (ETableModel *model, gint row) +visible_depth_of_node (ETableModel *model, + gint row) { ETreeModel *tree_model = e_cell_tree_get_tree_model (model, row); ETreeTableAdapter *adapter = e_cell_tree_get_tree_table_adapter (model, row); @@ -99,10 +103,11 @@ visible_depth_of_node (ETableModel *model, gint row) } /* If this is changed to not include the width of the expansion pixmap - if the path is not expandable, then max_width needs to change as - well. */ + * if the path is not expandable, then max_width needs to change as + * well. */ static gint -offset_of_node (ETableModel *table_model, gint row) +offset_of_node (ETableModel *table_model, + gint row) { ETreeModel *tree_model = e_cell_tree_get_tree_model (table_model, row); ETreePath path = e_cell_tree_get_node (table_model, row); @@ -119,7 +124,9 @@ offset_of_node (ETableModel *table_model, gint row) * ECell::new_view method */ static ECellView * -ect_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ect_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellTree *ect = E_CELL_TREE (ecell); ECellTreeView *tree_view = g_new0 (ECellTreeView, 1); @@ -283,7 +290,7 @@ ect_draw (ECellView *ecell_view, } /* Now cause our subcell to draw its contents, shifted by - subcell_offset pixels */ + * subcell_offset pixels */ e_cell_draw (tree_view->subcell_view, cr, model_col, view_col, row, flags, x1 + subcell_offset, y1, x2, y2); @@ -292,7 +299,8 @@ ect_draw (ECellView *ecell_view, } static void -adjust_event_position (GdkEvent *event, gint offset) +adjust_event_position (GdkEvent *event, + gint offset) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -310,7 +318,9 @@ adjust_event_position (GdkEvent *event, gint offset) } static gboolean -event_in_expander (GdkEvent *event, gint offset, gint height) +event_in_expander (GdkEvent *event, + gint offset, + gint height) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -329,7 +339,10 @@ event_in_expander (GdkEvent *event, gint offset, gint height) * ECell::height method */ static gint -ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -381,7 +394,13 @@ animate_expander (gpointer data) * ECell::event method */ static gint -ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ect_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { GtkLayout *layout; GdkWindow *window; @@ -504,7 +523,9 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::max_width method */ static gint -ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) +ect_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; gint row; @@ -578,7 +599,8 @@ ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) * ECellView::get_bg_color method */ static gchar * -ect_get_bg_color (ECellView *ecell_view, gint row) +ect_get_bg_color (ECellView *ecell_view, + gint row) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -589,7 +611,10 @@ ect_get_bg_color (ECellView *ecell_view, gint row) * ECellView::enter_edit method */ static gpointer -ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { /* just defer to our subcell's view */ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -601,7 +626,11 @@ ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECellView::leave_edit method */ static void -ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +ect_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { /* just defer to our subcell's view */ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -610,9 +639,13 @@ ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, } static void -ect_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +ect_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; cairo_t *cr = gtk_print_context_get_cairo_context (context); @@ -650,8 +683,8 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } /* now traverse back up to the root of the tree, checking at - each level if the node has siblings, and drawing the - correct vertical pipe for it's configuration. */ + * each level if the node has siblings, and drawing the + * correct vertical pipe for it's configuration. */ node = e_tree_model_node_get_parent (tree_model, node); depth = visible_depth_of_node (ecell_view->e_table_model, row) - 1; offset -= INDENT_AMOUNT; @@ -700,9 +733,12 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -ect_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +ect_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { return 12; /* XXX */ } @@ -766,8 +802,8 @@ e_cell_tree_init (ECellTree *ect) **/ void e_cell_tree_construct (ECellTree *ect, - gboolean draw_lines, - ECell *subcell) + gboolean draw_lines, + ECell *subcell) { ect->subcell = subcell; if (subcell) @@ -792,7 +828,7 @@ e_cell_tree_construct (ECellTree *ect, **/ ECell * e_cell_tree_new (gboolean draw_lines, - ECell *subcell) + ECell *subcell) { ECellTree *ect = g_object_new (E_TYPE_CELL_TREE, NULL); diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c index 1c0cbc62ca..9830a06aff 100644 --- a/widgets/table/e-cell-vbox.c +++ b/widgets/table/e-cell-vbox.c @@ -46,7 +46,9 @@ G_DEFINE_TYPE (ECellVbox, e_cell_vbox, E_TYPE_CELL) * ECell::new_view method */ static ECellView * -ecv_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ecv_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellVbox *ecv = E_CELL_VBOX (ecell); ECellVboxView *vbox_view = g_new0 (ECellVboxView, 1); @@ -151,7 +153,7 @@ ecv_draw (ECellView *ecell_view, for (i = 0; i < vbox_view->subcell_view_count; i++) { /* Now cause our subcells to draw their contents, - shifted by subcell_offset pixels */ + * shifted by subcell_offset pixels */ gint height; height = e_cell_height ( @@ -173,7 +175,13 @@ ecv_draw (ECellView *ecell_view, * ECell::event method */ static gint -ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ecv_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; gint y = 0; @@ -208,7 +216,10 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::height method */ static gint -ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ecv_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; gint height = 0; @@ -224,7 +235,9 @@ ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECell::max_width method */ static gint -ecv_max_width (ECellView *ecell_view, gint model_col, gint view_col) +ecv_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; gint max_width = 0; @@ -312,7 +325,9 @@ e_cell_vbox_new (void) } void -e_cell_vbox_append (ECellVbox *vbox, ECell *subcell, gint model_col) +e_cell_vbox_append (ECellVbox *vbox, + ECell *subcell, + gint model_col) { vbox->subcell_count++; diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c index cbc0bfc0ae..88762f6a7a 100644 --- a/widgets/table/e-cell.c +++ b/widgets/table/e-cell.c @@ -36,7 +36,9 @@ G_DEFINE_TYPE (ECell, e_cell, G_TYPE_OBJECT) #define ECVIEW_EC_CLASS(v) (E_CELL_GET_CLASS (v->ecell)) static ECellView * -ec_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ec_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { return NULL; } @@ -57,15 +59,28 @@ ec_unrealize (ECellView *e_cell) } static void -ec_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +ec_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { g_critical ("e-cell-draw invoked"); } static gint -ec_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ec_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { g_critical ("e-cell-event invoked"); @@ -73,7 +88,10 @@ ec_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, } static gint -ec_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ec_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { g_critical ("e-cell-height invoked"); @@ -81,7 +99,14 @@ ec_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) } static void -ec_focus (ECellView *ecell_view, gint model_col, gint view_col, gint row, gint x1, gint y1, gint x2, gint y2) +ec_focus (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gint x1, + gint y1, + gint x2, + gint y2) { ecell_view->focus_col = view_col; ecell_view->focus_row = row; @@ -103,29 +128,49 @@ ec_unfocus (ECellView *ecell_view) } static gpointer -ec_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ec_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { return NULL; } static void -ec_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context) +ec_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer context) { } static gpointer -ec_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context) +ec_save_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer context) { return NULL; } static void -ec_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context, gpointer save_state) +ec_load_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer context, + gpointer save_state) { } static void -ec_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) +ec_free_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer save_state) { } @@ -172,7 +217,13 @@ e_cell_init (ECell *cell) * Returns: processing state from the GdkEvent handling. */ gint -e_cell_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +e_cell_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { return ECVIEW_EC_CLASS (ecell_view)->event ( ecell_view, event, model_col, view_col, row, flags, actions); @@ -194,7 +245,9 @@ e_cell_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_ * Returns: a new ECellView for this @ecell on the @table_model displayed on the @e_table_item_view. */ ECellView * -e_cell_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +e_cell_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { return E_CELL_GET_CLASS (ecell)->new_view ( ecell, table_model, e_table_item_view); @@ -260,9 +313,16 @@ e_cell_unrealize (ECellView *ecell_view) * flags include alignments and justifications. */ void -e_cell_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +e_cell_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { g_return_if_fail (ecell_view != NULL); g_return_if_fail (row >= 0); @@ -288,9 +348,13 @@ e_cell_draw (ECellView *ecell_view, cairo_t *cr, * FIXME: */ void -e_cell_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +e_cell_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { if (ECVIEW_EC_CLASS (ecell_view)->print) ECVIEW_EC_CLASS (ecell_view)->print (ecell_view, context, model_col, view_col, row, width, height); @@ -302,9 +366,12 @@ e_cell_print (ECellView *ecell_view, GtkPrintContext *context, * FIXME: */ gdouble -e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +e_cell_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { if (ECVIEW_EC_CLASS (ecell_view)->print_height) return ECVIEW_EC_CLASS (ecell_view)->print_height @@ -324,7 +391,10 @@ e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, * @view_col, @row. */ gint -e_cell_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +e_cell_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { return ECVIEW_EC_CLASS (ecell_view)->height (ecell_view, model_col, view_col, row); } @@ -340,7 +410,10 @@ e_cell_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * @model_col, @row rendered at @view_col, @row. */ gpointer -e_cell_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +e_cell_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { return ECVIEW_EC_CLASS (ecell_view)->enter_edit (ecell_view, model_col, view_col, row); } @@ -357,7 +430,11 @@ e_cell_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint ro * rendered at @view_col, @row. */ void -e_cell_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +e_cell_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECVIEW_EC_CLASS (ecell_view)->leave_edit (ecell_view, model_col, view_col, row, edit_context); } @@ -377,7 +454,11 @@ e_cell_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint ro * or scrolling. */ gpointer -e_cell_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +e_cell_save_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { if (ECVIEW_EC_CLASS (ecell_view)->save_state) return ECVIEW_EC_CLASS (ecell_view)->save_state (ecell_view, model_col, view_col, row, edit_context); @@ -397,7 +478,12 @@ e_cell_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro * Requests that the ECellView load from the given save state. */ void -e_cell_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context, gpointer save_state) +e_cell_load_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context, + gpointer save_state) { if (ECVIEW_EC_CLASS (ecell_view)->load_state) ECVIEW_EC_CLASS (ecell_view)->load_state (ecell_view, model_col, view_col, row, edit_context, save_state); @@ -415,7 +501,11 @@ e_cell_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro * Requests that the ECellView free the given save state. */ void -e_cell_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) +e_cell_free_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer save_state) { if (ECVIEW_EC_CLASS (ecell_view)->free_state) ECVIEW_EC_CLASS (ecell_view)->free_state (ecell_view, model_col, view_col, row, save_state); @@ -431,7 +521,9 @@ e_cell_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro * is being rendered as @view_col */ gint -e_cell_max_width (ECellView *ecell_view, gint model_col, gint view_col) +e_cell_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { return ECVIEW_EC_CLASS (ecell_view)->max_width (ecell_view, model_col, view_col); @@ -448,7 +540,10 @@ e_cell_max_width (ECellView *ecell_view, gint model_col, gint view_col) * is being rendered as @view_col for the data in @row. */ gint -e_cell_max_width_by_row (ECellView *ecell_view, gint model_col, gint view_col, gint row) +e_cell_max_width_by_row (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { if (ECVIEW_EC_CLASS (ecell_view)->max_width_by_row) return ECVIEW_EC_CLASS (ecell_view)->max_width_by_row @@ -474,7 +569,8 @@ e_cell_max_width_by_row_implemented (ECellView *ecell_view) } gchar * -e_cell_get_bg_color (ECellView *ecell_view, gint row) +e_cell_get_bg_color (ECellView *ecell_view, + gint row) { if (ECVIEW_EC_CLASS (ecell_view)->get_bg_color) return ECVIEW_EC_CLASS (ecell_view)->get_bg_color (ecell_view, row); @@ -483,7 +579,8 @@ e_cell_get_bg_color (ECellView *ecell_view, gint row) } void -e_cell_style_set (ECellView *ecell_view, GtkStyle *previous_style) +e_cell_style_set (ECellView *ecell_view, + GtkStyle *previous_style) { if (ECVIEW_EC_CLASS (ecell_view)->style_set) ECVIEW_EC_CLASS (ecell_view)->style_set (ecell_view, previous_style); diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h index 3a41db0afe..830184c06d 100644 --- a/widgets/table/e-cell.h +++ b/widgets/table/e-cell.h @@ -92,7 +92,7 @@ struct _ECellView { gint focus_x1, focus_y1, focus_x2, focus_y2; gint focus_col, focus_row; - void (*kill_view_cb) (struct _ECellView*, gpointer ); + void (*kill_view_cb) (struct _ECellView *, gpointer ); GList *kill_view_cb_data; }; diff --git a/widgets/table/e-popup-menu.c b/widgets/table/e-popup-menu.c index 07589b1589..a4cfec07e9 100644 --- a/widgets/table/e-popup-menu.c +++ b/widgets/table/e-popup-menu.c @@ -38,7 +38,9 @@ * Creates an item with an optional icon */ static void -make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name) +make_item (GtkMenu *menu, + GtkMenuItem *item, + const gchar *name) { GtkWidget *label; @@ -57,10 +59,10 @@ make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name) GtkMenu * e_popup_menu_create_with_domain (EPopupMenu *menu_list, - guint32 disable_mask, - guint32 hide_mask, - gpointer default_closure, - const gchar *domain) + guint32 disable_mask, + guint32 hide_mask, + gpointer default_closure, + const gchar *domain) { GtkMenu *menu = GTK_MENU (gtk_menu_new ()); gboolean last_item_separator = TRUE; diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index 662a9c50a5..8defc2c479 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -63,7 +63,10 @@ enum { }; static void -etcta_cursor_change (GObject *object, gint row, gint col, ETableClickToAdd *etcta) +etcta_cursor_change (GObject *object, + gint row, + gint col, + ETableClickToAdd *etcta) { g_signal_emit (etcta, etcta_signals[CURSOR_CHANGE], 0, @@ -71,7 +74,8 @@ etcta_cursor_change (GObject *object, gint row, gint col, ETableClickToAdd *etct } static void -etcta_style_set (ETableClickToAdd *etcta, GtkStyle *previous_style) +etcta_style_set (ETableClickToAdd *etcta, + GtkStyle *previous_style) { GtkWidget *widget; GtkStyle *style; @@ -94,7 +98,8 @@ etcta_style_set (ETableClickToAdd *etcta, GtkStyle *previous_style) } static void -etcta_add_table_header (ETableClickToAdd *etcta, ETableHeader *header) +etcta_add_table_header (ETableClickToAdd *etcta, + ETableHeader *header) { etcta->eth = header; if (etcta->eth) @@ -116,7 +121,8 @@ etcta_drop_table_header (ETableClickToAdd *etcta) } static void -etcta_add_one (ETableClickToAdd *etcta, ETableModel *one) +etcta_add_one (ETableClickToAdd *etcta, + ETableModel *one) { etcta->one = one; if (etcta->one) @@ -143,7 +149,8 @@ etcta_drop_one (ETableClickToAdd *etcta) } static void -etcta_add_model (ETableClickToAdd *etcta, ETableModel *model) +etcta_add_model (ETableClickToAdd *etcta, + ETableModel *model) { etcta->model = model; if (etcta->model) @@ -161,7 +168,8 @@ etcta_drop_model (ETableClickToAdd *etcta) } static void -etcta_add_message (ETableClickToAdd *etcta, const gchar *message) +etcta_add_message (ETableClickToAdd *etcta, + const gchar *message) { etcta->message = g_strdup (message); } @@ -191,7 +199,7 @@ etcta_dispose (GObject *object) static void etcta_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -201,7 +209,7 @@ etcta_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); etcta = E_TABLE_CLICK_TO_ADD (object); - switch (prop_id) { + switch (property_id) { case PROP_HEADER: etcta_drop_table_header (etcta); etcta_add_table_header (etcta, E_TABLE_HEADER (g_value_get_object (value))); @@ -230,7 +238,7 @@ etcta_set_property (GObject *object, NULL); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); return; } @@ -270,13 +278,16 @@ create_rect_and_text (ETableClickToAdd *etcta) } static void -etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etcta_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableClickToAdd *etcta; etcta = E_TABLE_CLICK_TO_ADD (object); - switch (prop_id) { + switch (property_id) { case PROP_HEADER: g_value_set_object (value, etcta->eth); break; @@ -293,7 +304,7 @@ etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p g_value_set_double (value, etcta->height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -376,7 +387,7 @@ finish_editing (ETableClickToAdd *etcta) "cursor_mode", E_CURSOR_SPREADSHEET, NULL); - g_signal_connect(etcta->row, "key_press", + g_signal_connect (etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); set_initial_selection (etcta); @@ -386,7 +397,8 @@ finish_editing (ETableClickToAdd *etcta) /* Handles the events on the ETableClickToAdd, particularly * it creates the ETableItem and passes in some events. */ static gint -etcta_event (GnomeCanvasItem *item, GdkEvent *e) +etcta_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); @@ -424,7 +436,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) "cursor_mode", E_CURSOR_SPREADSHEET, NULL); - g_signal_connect(etcta->row, "key_press", + g_signal_connect (etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (etcta->row), TRUE); @@ -462,7 +474,8 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) } static void -etcta_reflow (GnomeCanvasItem *item, gint flags) +etcta_reflow (GnomeCanvasItem *item, + gint flags) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); @@ -583,7 +596,7 @@ etcta_init (ETableClickToAdd *etcta) etcta->height = 6; etcta->selection = e_table_selection_model_new (); - g_signal_connect(etcta->selection, "cursor_changed", + g_signal_connect (etcta->selection, "cursor_changed", G_CALLBACK (etcta_cursor_change), etcta); e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (etcta), etcta_reflow); diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c index 7296408594..fc7da9c9f5 100644 --- a/widgets/table/e-table-col.c +++ b/widgets/table/e-table-col.c @@ -82,13 +82,13 @@ etc_dispose (GObject *object) static void etc_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { ETableCol *etc = E_TABLE_COL (object); - switch (prop_id) { + switch (property_id) { case PROP_COMPARE_COL: etc->compare_col = g_value_get_int (value); break; @@ -99,18 +99,18 @@ etc_set_property (GObject *object, static void etc_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { ETableCol *etc = E_TABLE_COL (object); - switch (prop_id) { + switch (property_id) { case PROP_COMPARE_COL: g_value_set_int (value, etc->compare_col); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-table-col.h b/widgets/table/e-table-col.h index b82886a5ca..042137b40a 100644 --- a/widgets/table/e-table-col.h +++ b/widgets/table/e-table-col.h @@ -73,11 +73,11 @@ struct _ETableCol { GCompareDataFunc compare; ETableSearchFunc search; - guint selected:1; - guint resizable:1; - guint disabled:1; - guint sortable:1; - guint groupable:1; + guint selected : 1; + guint resizable : 1; + guint disabled : 1; + guint sortable : 1; + guint groupable : 1; gint col_idx; gint compare_col; diff --git a/widgets/table/e-table-column-specification.c b/widgets/table/e-table-column-specification.c index 7fb0756085..cd7e07acca 100644 --- a/widgets/table/e-table-column-specification.c +++ b/widgets/table/e-table-column-specification.c @@ -102,7 +102,7 @@ e_table_column_specification_new (void) void e_table_column_specification_load_from_node (ETableColumnSpecification *etcs, - const xmlNode *node) + const xmlNode *node) { free_strings (etcs); @@ -128,7 +128,7 @@ e_table_column_specification_load_from_node (ETableColumnSpecification *etcs, xmlNode * e_table_column_specification_save_to_node (ETableColumnSpecification *specification, - xmlNode *parent) + xmlNode *parent) { xmlNode *node; if (parent) diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 4bfb80d1e9..4e9fe81117 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -94,7 +94,8 @@ config_finalize (GObject *object) } static void -e_table_config_changed (ETableConfig *config, ETableState *state) +e_table_config_changed (ETableConfig *config, + ETableState *state) { g_return_if_fail (E_IS_TABLE_CONFIG (config)); @@ -113,13 +114,13 @@ config_dialog_changed (ETableConfig *config) static void config_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableConfig *config = E_TABLE_CONFIG (object); - switch (prop_id) { + switch (property_id) { case PROP_STATE: g_value_set_object (value, config->state); break; @@ -156,7 +157,8 @@ e_table_config_class_init (ETableConfigClass *class) } static void -configure_combo_box_add (GtkComboBox *combo_box, const gchar *item, +configure_combo_box_add (GtkComboBox *combo_box, + const gchar *item, const gchar *value) { GtkTreeRowReference *reference; @@ -203,7 +205,8 @@ configure_combo_box_get_active (GtkComboBox *combo_box) } static void -configure_combo_box_set_active (GtkComboBox *combo_box, const gchar *value) +configure_combo_box_set_active (GtkComboBox *combo_box, + const gchar *value) { GtkTreeRowReference *reference; GHashTable *index; @@ -231,7 +234,8 @@ configure_combo_box_set_active (GtkComboBox *combo_box, const gchar *value) } static ETableColumnSpecification * -find_column_in_spec (ETableSpecification *spec, gint model_col) +find_column_in_spec (ETableSpecification *spec, + gint model_col) { ETableColumnSpecification **column; @@ -248,7 +252,8 @@ find_column_in_spec (ETableSpecification *spec, gint model_col) } static gint -find_model_column_by_name (ETableSpecification *spec, const gchar *s) +find_model_column_by_name (ETableSpecification *spec, + const gchar *s) { ETableColumnSpecification **column; @@ -263,7 +268,8 @@ find_model_column_by_name (ETableSpecification *spec, const gchar *s) } static void -update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) +update_sort_and_group_config_dialog (ETableConfig *config, + gboolean is_sort) { ETableConfigSortWidgets *widgets; gint count, i; @@ -328,7 +334,7 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) d = GTK_TOGGLE_BUTTON ( widgets[i].radio_descending); - gtk_toggle_button_set_active (col.ascending ? a:d, 1); + gtk_toggle_button_set_active (col.ascending ? a : d, 1); } else { GtkToggleButton *t; @@ -428,7 +434,7 @@ config_group_info_update (ETableConfig *config) col.ascending ? _("(Ascending)") : _("(Descending)")); - if ((i+1) != count) + if ((i + 1) != count) g_string_append (res, ", "); } if (res->str[0] == 0) @@ -492,7 +498,8 @@ config_fields_info_update (ETableConfig *config) } static void -do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) +do_sort_and_group_config_dialog (ETableConfig *config, + gboolean is_sort) { GtkDialog *dialog; gint response, running = 1; @@ -682,32 +689,38 @@ e_table_proxy_etable_available_new (ETableModel *store) } static void -config_button_fields (GtkWidget *widget, ETableConfig *config) +config_button_fields (GtkWidget *widget, + ETableConfig *config) { do_fields_config_dialog (config); } static void -config_button_sort (GtkWidget *widget, ETableConfig *config) +config_button_sort (GtkWidget *widget, + ETableConfig *config) { do_sort_and_group_config_dialog (config, TRUE); } static void -config_button_group (GtkWidget *widget, ETableConfig *config) +config_button_group (GtkWidget *widget, + ETableConfig *config) { do_sort_and_group_config_dialog (config, FALSE); } static void -dialog_destroyed (gpointer data, GObject *where_object_was) +dialog_destroyed (gpointer data, + GObject *where_object_was) { ETableConfig *config = data; g_object_unref (config); } static void -dialog_response (GtkWidget *dialog, gint response_id, ETableConfig *config) +dialog_response (GtkWidget *dialog, + gint response_id, + ETableConfig *config) { if (response_id == GTK_RESPONSE_APPLY || response_id == GTK_RESPONSE_OK) { @@ -760,14 +773,13 @@ connect_button (ETableConfig *config, { GtkWidget *button = e_builder_get_widget (builder, widget_name); - if (button) { - g_signal_connect (G_OBJECT (button), "clicked", - cback, config); - } + if (button) + g_signal_connect (button, "clicked", cback, config); } static gint -get_source_model_col_index (ETableConfig *config, gint idx) +get_source_model_col_index (ETableConfig *config, + gint idx) { gint visible_index; ETableModel *src_model; @@ -781,7 +793,8 @@ get_source_model_col_index (ETableConfig *config, gint idx) } static void -sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) +sort_combo_changed (GtkComboBox *combo_box, + ETableConfigSortWidgets *sort) { ETableConfig *config = sort->e_table_config; ETableSortInfo *sort_info = config->temp_state->sort_info; @@ -819,7 +832,8 @@ sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) } static void -sort_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *sort) +sort_ascending_toggled (GtkToggleButton *t, + ETableConfigSortWidgets *sort) { ETableConfig *config = sort->e_table_config; ETableSortInfo *si = config->temp_state->sort_info; @@ -833,7 +847,8 @@ sort_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *sort) } static void -configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) +configure_sort_dialog (ETableConfig *config, + GtkBuilder *builder) { GSList *l; gint i; @@ -904,7 +919,8 @@ configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) } static void -group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) +group_combo_changed (GtkComboBox *combo_box, + ETableConfigSortWidgets *group) { ETableConfig *config = group->e_table_config; ETableSortInfo *sort_info = config->temp_state->sort_info; @@ -942,7 +958,8 @@ group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) } static void -group_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *group) +group_ascending_toggled (GtkToggleButton *t, + ETableConfigSortWidgets *group) { ETableConfig *config = group->e_table_config; ETableSortInfo *si = config->temp_state->sort_info; @@ -956,7 +973,8 @@ group_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *group) } static void -configure_group_dialog (ETableConfig *config, GtkBuilder *builder) +configure_group_dialog (ETableConfig *config, + GtkBuilder *builder) { GSList *l; gint i; @@ -1027,14 +1045,16 @@ configure_group_dialog (ETableConfig *config, GtkBuilder *builder) } static void -add_column (gint model_row, gpointer closure) +add_column (gint model_row, + gpointer closure) { GList **columns = closure; *columns = g_list_prepend (*columns, GINT_TO_POINTER (model_row)); } static void -config_button_add (GtkWidget *widget, ETableConfig *config) +config_button_add (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1070,7 +1090,8 @@ config_button_add (GtkWidget *widget, ETableConfig *config) } static void -config_button_remove (GtkWidget *widget, ETableConfig *config) +config_button_remove (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1103,7 +1124,8 @@ config_button_remove (GtkWidget *widget, ETableConfig *config) } static void -config_button_up (GtkWidget *widget, ETableConfig *config) +config_button_up (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1158,7 +1180,8 @@ config_button_up (GtkWidget *widget, ETableConfig *config) } static void -config_button_down (GtkWidget *widget, ETableConfig *config) +config_button_down (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1211,7 +1234,8 @@ config_button_down (GtkWidget *widget, ETableConfig *config) } static void -configure_fields_dialog (ETableConfig *config, GtkBuilder *builder) +configure_fields_dialog (ETableConfig *config, + GtkBuilder *builder) { GtkWidget *scrolled; GtkWidget *etable; @@ -1341,11 +1365,11 @@ e_table_config_init (ETableConfig *config) } ETableConfig * -e_table_config_construct (ETableConfig *config, - const gchar *header, - ETableSpecification *spec, - ETableState *state, - GtkWindow *parent_window) +e_table_config_construct (ETableConfig *config, + const gchar *header, + ETableSpecification *spec, + ETableState *state, + GtkWindow *parent_window) { ETableColumnSpecification **column; diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index b07651a22c..f3e55cf8cf 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -156,7 +156,9 @@ e_string_search (gconstpointer haystack, } static gint -e_table_str_case_compare (gconstpointer x, gconstpointer y, gpointer cmp_cache) +e_table_str_case_compare (gconstpointer x, + gconstpointer y, + gpointer cmp_cache) { const gchar *cx = NULL, *cy = NULL; @@ -190,7 +192,9 @@ e_table_str_case_compare (gconstpointer x, gconstpointer y, gpointer cmp_cache) } static gint -e_table_collate_compare (gconstpointer x, gconstpointer y, gpointer cmp_cache) +e_table_collate_compare (gconstpointer x, + gconstpointer y, + gpointer cmp_cache) { const gchar *cx = NULL, *cy = NULL; diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index b4ac8e53ef..354095b0c8 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -32,8 +32,8 @@ #include "e-table-field-chooser-dialog.h" -static void e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_table_field_chooser_dialog_dispose (GObject *object); static void e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id); @@ -53,7 +53,7 @@ e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *class) GObjectClass *object_class; GtkDialogClass *dialog_class; - object_class = (GObjectClass*) class; + object_class = (GObjectClass *) class; dialog_class = GTK_DIALOG_CLASS (class); object_class->dispose = e_table_field_chooser_dialog_dispose; @@ -119,7 +119,7 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos gtk_window_set_title (GTK_WINDOW (dialog), _("Add a Column")); } -GtkWidget* +GtkWidget * e_table_field_chooser_dialog_new (void) { return g_object_new (E_TYPE_TABLE_FIELD_CHOOSER_DIALOG, NULL); @@ -146,10 +146,13 @@ e_table_field_chooser_dialog_dispose (GObject *object) } static void -e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_table_field_chooser_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_free (etfcd->dnd_code); etfcd->dnd_code = g_strdup (g_value_get_string (value)); @@ -192,10 +195,13 @@ e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const } static void -e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_table_field_chooser_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_value_set_string (value, etfcd->dnd_code); break; @@ -206,13 +212,14 @@ e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValu g_value_set_object (value, etfcd->header); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id) +e_table_field_chooser_dialog_response (GtkDialog *dialog, + gint id) { if (id == GTK_RESPONSE_OK) gtk_widget_destroy (GTK_WIDGET (dialog)); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index e2dc6f1721..ecc414853c 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -89,7 +89,8 @@ etfci_dispose (GObject *object) } static gint -etfci_find_button (ETableFieldChooserItem *etfci, gdouble loc) +etfci_find_button (ETableFieldChooserItem *etfci, + gdouble loc) { gint i; gint count; @@ -148,7 +149,8 @@ etfci_rebuild_combined (ETableFieldChooserItem *etfci) } static void -etfci_reflow (GnomeCanvasItem *item, gint flags) +etfci_reflow (GnomeCanvasItem *item, + gint flags) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); gdouble old_height; @@ -345,7 +347,7 @@ etfci_add_table_header (ETableFieldChooserItem *etfci, static void etfci_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -355,7 +357,7 @@ etfci_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_FULL_HEADER: etfci_drop_full_header (etfci); if (g_value_get_object (value)) @@ -385,13 +387,16 @@ etfci_set_property (GObject *object, } static void -etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etfci_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableFieldChooserItem *etfci; etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_value_set_string (value, etfci->dnd_code); @@ -403,18 +408,18 @@ etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p g_value_set_double (value, etfci->height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -etfci_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETableFieldChooserItem *etfci) +etfci_drag_data_get (GtkWidget *widget, + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETableFieldChooserItem *etfci) { if (etfci->drag_col != -1) { gchar *string = g_strdup_printf("%d", etfci->drag_col); @@ -428,9 +433,9 @@ etfci_drag_data_get (GtkWidget *widget, } static void -etfci_drag_end (GtkWidget *canvas, - GdkDragContext *context, - ETableFieldChooserItem *etfci) +etfci_drag_end (GtkWidget *canvas, + GdkDragContext *context, + ETableFieldChooserItem *etfci) { etfci->drag_col = -1; } @@ -529,13 +534,19 @@ etfci_draw (GnomeCanvasItem *item, } static GnomeCanvasItem * -etfci_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +etfci_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gboolean -etfci_maybe_start_drag (ETableFieldChooserItem *etfci, gint x, gint y) +etfci_maybe_start_drag (ETableFieldChooserItem *etfci, + gint x, + gint y) { if (!etfci->maybe_drag) return FALSE; @@ -548,7 +559,10 @@ etfci_maybe_start_drag (ETableFieldChooserItem *etfci, gint x, gint y) } static void -etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdouble y) +etfci_start_drag (ETableFieldChooserItem *etfci, + GdkEvent *event, + gdouble x, + gdouble y) { GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas); GtkTargetList *list; @@ -622,7 +636,8 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo * Handles the events on the ETableFieldChooserItem */ static gint -etfci_event (GnomeCanvasItem *item, GdkEvent *e) +etfci_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); GnomeCanvas *canvas = item->canvas; diff --git a/widgets/table/e-table-field-chooser-item.h b/widgets/table/e-table-field-chooser-item.h index 066dd52ffb..f08b94ac6f 100644 --- a/widgets/table/e-table-field-chooser-item.h +++ b/widgets/table/e-table-field-chooser-item.h @@ -74,7 +74,7 @@ struct _ETableFieldChooserItem { /* * For dragging columns */ - guint maybe_drag:1; + guint maybe_drag : 1; gint click_x, click_y; gint drag_col; guint drag_data_get_id; diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index 2f945bb079..5e2cb13880 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -36,8 +36,8 @@ #include "e-table-field-chooser.h" #include "e-table-field-chooser-item.h" -static void e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_table_field_chooser_dispose (GObject *object); /* The arguments we take */ @@ -55,7 +55,7 @@ e_table_field_chooser_class_init (ETableFieldChooserClass *class) { GObjectClass *object_class; - object_class = (GObjectClass*) class; + object_class = (GObjectClass *) class; object_class->set_property = e_table_field_chooser_set_property; object_class->get_property = e_table_field_chooser_get_property; @@ -202,7 +202,7 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) "dnd_code", etfc->dnd_code, NULL ); - g_signal_connect( etfc->canvas, "reflow", + g_signal_connect ( etfc->canvas, "reflow", G_CALLBACK ( resize ), etfc); @@ -238,18 +238,21 @@ e_table_field_chooser_dispose (GObject *object) G_OBJECT_CLASS (e_table_field_chooser_parent_class)->dispose (object); } -GtkWidget* +GtkWidget * e_table_field_chooser_new (void) { return g_object_new (E_TYPE_TABLE_FIELD_CHOOSER, NULL); } static void -e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_table_field_chooser_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_free (etfc->dnd_code); etfc->dnd_code = g_strdup (g_value_get_string (value)); @@ -292,11 +295,14 @@ e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue } static void -e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_table_field_chooser_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_value_set_string (value, etfc->dnd_code); break; @@ -307,7 +313,7 @@ e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *valu g_value_set_object (value, etfc->header); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 0a933769f9..d874834db1 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -68,8 +68,8 @@ static EPrintable * etgc_get_printable (ETableGroup *etg); static void -e_table_group_container_child_node_free (ETableGroupContainer *etgc, - ETableGroupContainerChildNode *child_node) +e_table_group_container_child_node_free (ETableGroupContainer *etgc, + ETableGroupContainerChildNode *child_node) { ETableGroup *etg = E_TABLE_GROUP (etgc); ETableGroup *child = child_node->child; @@ -141,10 +141,13 @@ etgc_dispose (GObject *object) * This routine constructs the new %ETableGroupContainer. */ void -e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, gint n) +e_table_group_container_construct (GnomeCanvasGroup *parent, + ETableGroupContainer *etgc, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info, + gint n) { ETableCol *col; ETableSortColumn column = e_table_sort_info_grouping_get_nth (sort_info, n); @@ -186,9 +189,12 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine * Returns: The new %ETableGroupContainer. */ ETableGroup * -e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, gint n) +e_table_group_container_new (GnomeCanvasGroup *parent, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info, + gint n) { ETableGroupContainer *etgc; @@ -202,7 +208,8 @@ e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header } static gint -etgc_event (GnomeCanvasItem *item, GdkEvent *event) +etgc_event (GnomeCanvasItem *item, + GdkEvent *event) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item); gboolean return_val = TRUE; @@ -338,17 +345,18 @@ etgc_unrealize (GnomeCanvasItem *item) } static void -compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_node) +compute_text (ETableGroupContainer *etgc, + ETableGroupContainerChildNode *child_node) { gchar *text; if (etgc->ecol->text) { /* Translators: This text is used as a special row when an ETable - has turned on grouping on a column, which has set a title. - The first %s is replaced with a column title. - The second %s is replaced with an actual group value. - Finally the %d is replaced with count of items in this group. - Example: "Family name: Smith (13 items)" + * has turned on grouping on a column, which has set a title. + * The first %s is replaced with a column title. + * The second %s is replaced with an actual group value. + * Finally the %d is replaced with count of items in this group. + * Example: "Family name: Smith (13 items)" */ text = g_strdup_printf (ngettext("%s: %s (%d item)", "%s: %s (%d items)", @@ -357,10 +365,10 @@ compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_n (gint) child_node->count); } else { /* Translators: This text is used as a special row when an ETable - has turned on grouping on a column, which doesn't have set a title. - The %s is replaced with an actual group value. - The %d is replaced with count of items in this group. - Example: "Smith (13 items)" + * has turned on grouping on a column, which doesn't have set a title. + * The %s is replaced with an actual group value. + * The %d is replaced with count of items in this group. + * Example: "Smith (13 items)" */ text = g_strdup_printf (ngettext("%s (%d item)", "%s (%d items)", @@ -375,56 +383,74 @@ compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_n } static void -child_cursor_change (ETableGroup *etg, gint row, - ETableGroupContainer *etgc) +child_cursor_change (ETableGroup *etg, + gint row, + ETableGroupContainer *etgc) { e_table_group_cursor_change (E_TABLE_GROUP (etgc), row); } static void -child_cursor_activated (ETableGroup *etg, gint row, - ETableGroupContainer *etgc) +child_cursor_activated (ETableGroup *etg, + gint row, + ETableGroupContainer *etgc) { e_table_group_cursor_activated (E_TABLE_GROUP (etgc), row); } static void -child_double_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_double_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { e_table_group_double_click (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_right_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_right_click (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_click (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_key_press (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_key_press (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_start_drag (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_start_drag (E_TABLE_GROUP (etgc), row, col, event); } static ETableGroupContainerChildNode * -create_child_node (ETableGroupContainer *etgc, gpointer val) +create_child_node (ETableGroupContainer *etgc, + gpointer val) { ETableGroup *child; ETableGroupContainerChildNode *child_node; @@ -478,7 +504,8 @@ create_child_node (ETableGroupContainer *etgc, gpointer val) } static void -etgc_add (ETableGroup *etg, gint row) +etgc_add (ETableGroup *etg, + gint row) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); gpointer val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, row); @@ -522,7 +549,9 @@ etgc_add (ETableGroup *etg, gint row) } static void -etgc_add_array (ETableGroup *etg, const gint *array, gint count) +etgc_add_array (ETableGroup *etg, + const gint *array, + gint count) { gint i; ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -589,7 +618,8 @@ etgc_add_all (ETableGroup *etg) } static gboolean -etgc_remove (ETableGroup *etg, gint row) +etgc_remove (ETableGroup *etg, + gint row) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; @@ -630,7 +660,9 @@ etgc_row_count (ETableGroup *etg) } static void -etgc_increment (ETableGroup *etg, gint position, gint amount) +etgc_increment (ETableGroup *etg, + gint position, + gint amount) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; @@ -641,7 +673,9 @@ etgc_increment (ETableGroup *etg, gint position, gint amount) } static void -etgc_decrement (ETableGroup *etg, gint position, gint amount) +etgc_decrement (ETableGroup *etg, + gint position, + gint amount) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; @@ -652,7 +686,9 @@ etgc_decrement (ETableGroup *etg, gint position, gint amount) } static void -etgc_set_focus (ETableGroup *etg, EFocus direction, gint view_col) +etgc_set_focus (ETableGroup *etg, + EFocus direction, + gint view_col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); if (etgc->children) { @@ -683,7 +719,11 @@ etgc_get_focus_column (ETableGroup *etg) } static void -etgc_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) +etgc_compute_location (ETableGroup *etg, + gint *x, + gint *y, + gint *row, + gint *col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -709,7 +749,9 @@ etgc_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) } static void -etgc_get_mouse_over (ETableGroup *etg, gint *row, gint *col) +etgc_get_mouse_over (ETableGroup *etg, + gint *row, + gint *col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -740,7 +782,13 @@ etgc_get_mouse_over (ETableGroup *etg, gint *row, gint *col) } static void -etgc_get_cell_geometry (ETableGroup *etg, gint *row, gint *col, gint *x, gint *y, gint *width, gint *height) +etgc_get_cell_geometry (ETableGroup *etg, + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -773,13 +821,16 @@ static void etgc_thaw (ETableGroup *etg) } static void -etgc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +etgc_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); GList *list; - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: if (g_value_get_boolean (value)) etg->frozen = TRUE; @@ -887,12 +938,15 @@ etgc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp } static void -etgc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etgc_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: g_value_set_boolean (value, etg->frozen); break; @@ -909,7 +963,7 @@ etgc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps g_value_set_boolean (value, etgc->uniform_row_height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1029,7 +1083,8 @@ etgc_class_init (ETableGroupContainerClass *class) } static void -etgc_reflow (GnomeCanvasItem *item, gint flags) +etgc_reflow (GnomeCanvasItem *item, + gint flags) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item); gboolean frozen; @@ -1136,7 +1191,9 @@ etgc_init (ETableGroupContainer *container) } void -e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, gpointer closure) +e_table_group_apply_to_leafs (ETableGroup *etg, + ETableGroupLeafFn fn, + gpointer closure) { if (E_IS_TABLE_GROUP_CONTAINER (etg)) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -1170,7 +1227,11 @@ typedef struct { #if 0 static gint -gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdouble height) +gp_draw_rect (GtkPrintContext *context, + gdouble x, + gdouble y, + gdouble width, + gdouble height) { cairo_t *cr; cr = gtk_print_context_get_cairo_context (context); @@ -1184,12 +1245,12 @@ gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdo #define TEXT_AREA_HEIGHT (TEXT_HEIGHT + 4) static void -e_table_group_container_print_page (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble height, - gboolean quantize, - ETGCPrintContext *groupcontext) +e_table_group_container_print_page (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble height, + gboolean quantize, + ETGCPrintContext *groupcontext) { cairo_t *cr; GtkPageSetup *setup; @@ -1283,7 +1344,7 @@ e_table_group_container_print_page (EPrintable *ep, cairo_rectangle (cr, 0, child_margin, width - 2 * TEXT_AREA_HEIGHT, child_height + child_margin + 20); cairo_clip (cr); - e_printable_print_page (child_printable, context, width-2 * TEXT_AREA_HEIGHT, child_margin, quantize); + e_printable_print_page (child_printable, context, width - 2 * TEXT_AREA_HEIGHT, child_margin, quantize); yd -= child_height + TEXT_AREA_HEIGHT; if (e_printable_data_left (child_printable)) { @@ -1319,16 +1380,16 @@ e_table_group_container_print_page (EPrintable *ep, } static gboolean -e_table_group_container_data_left (EPrintable *ep, - ETGCPrintContext *groupcontext) +e_table_group_container_data_left (EPrintable *ep, + ETGCPrintContext *groupcontext) { g_signal_stop_emission_by_name(ep, "data_left"); return groupcontext->child != NULL; } static void -e_table_group_container_reset (EPrintable *ep, - ETGCPrintContext *groupcontext) +e_table_group_container_reset (EPrintable *ep, + ETGCPrintContext *groupcontext) { groupcontext->child = groupcontext->etgc->children; if (groupcontext->child_printable) @@ -1337,12 +1398,12 @@ e_table_group_container_reset (EPrintable *ep, } static gdouble -e_table_group_container_height (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETGCPrintContext *groupcontext) +e_table_group_container_height (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETGCPrintContext *groupcontext) { gdouble height = 0; gdouble child_height; @@ -1405,12 +1466,12 @@ e_table_group_container_height (EPrintable *ep, } static gboolean -e_table_group_container_will_fit (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETGCPrintContext *groupcontext) +e_table_group_container_will_fit (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETGCPrintContext *groupcontext) { gboolean will_fit = TRUE; gdouble child_height; @@ -1476,7 +1537,7 @@ e_table_group_container_will_fit (EPrintable *ep, static void e_table_group_container_printable_destroy (gpointer data, - GObject *where_object_was) + GObject *where_object_was) { ETGCPrintContext *groupcontext = data; diff --git a/widgets/table/e-table-group-container.h b/widgets/table/e-table-group-container.h index 5ea0910ef0..ac5f7c9033 100644 --- a/widgets/table/e-table-group-container.h +++ b/widgets/table/e-table-group-container.h @@ -95,7 +95,7 @@ struct _ETableGroupContainer { /* * State: the ETableGroup is open or closed */ - guint open:1; + guint open : 1; }; struct _ETableGroupContainerClass { diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index bf4f1553aa..27a62bbb16 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -114,11 +114,11 @@ etgl_dispose (GObject *object) static void e_table_group_leaf_construct (GnomeCanvasGroup *parent, - ETableGroupLeaf *etgl, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, - ETableSortInfo *sort_info) + ETableGroupLeaf *etgl, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info) { etgl->is_grouped = (e_table_sort_info_grouping_get_count (sort_info) > 0); @@ -262,7 +262,8 @@ etgl_click (GObject *object, } static void -etgl_reflow (GnomeCanvasItem *item, gint flags) +etgl_reflow (GnomeCanvasItem *item, + gint flags) { ETableGroupLeaf *leaf = E_TABLE_GROUP_LEAF (item); @@ -330,7 +331,8 @@ etgl_realize (GnomeCanvasItem *item) } static void -etgl_add (ETableGroup *etg, gint row) +etgl_add (ETableGroup *etg, + gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -341,7 +343,9 @@ etgl_add (ETableGroup *etg, gint row) } static void -etgl_add_array (ETableGroup *etg, const gint *array, gint count) +etgl_add_array (ETableGroup *etg, + const gint *array, + gint count) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -363,7 +367,8 @@ etgl_add_all (ETableGroup *etg) } static gboolean -etgl_remove (ETableGroup *etg, gint row) +etgl_remove (ETableGroup *etg, + gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -375,7 +380,9 @@ etgl_remove (ETableGroup *etg, gint row) } static void -etgl_increment (ETableGroup *etg, gint position, gint amount) +etgl_increment (ETableGroup *etg, + gint position, + gint amount) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -387,7 +394,9 @@ etgl_increment (ETableGroup *etg, gint position, gint amount) } static void -etgl_decrement (ETableGroup *etg, gint position, gint amount) +etgl_decrement (ETableGroup *etg, + gint position, + gint amount) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -407,7 +416,9 @@ etgl_row_count (ETableGroup *etg) } static void -etgl_set_focus (ETableGroup *etg, EFocus direction, gint view_col) +etgl_set_focus (ETableGroup *etg, + EFocus direction, + gint view_col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -437,7 +448,11 @@ etgl_get_printable (ETableGroup *etg) } static void -etgl_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) +etgl_compute_location (ETableGroup *etg, + gint *x, + gint *y, + gint *row, + gint *col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -445,7 +460,9 @@ etgl_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) } static void -etgl_get_mouse_over (ETableGroup *etg, gint *row, gint *col) +etgl_get_mouse_over (ETableGroup *etg, + gint *row, + gint *col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -473,14 +490,14 @@ etgl_get_cell_geometry (ETableGroup *etg, static void etgl_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object); - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: etg->frozen = g_value_get_boolean (value); break; @@ -574,12 +591,15 @@ etgl_set_property (GObject *object, } static void -etgl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etgl_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object); - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: g_value_set_boolean (value, etg->frozen); break; @@ -595,7 +615,7 @@ etgl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps case PROP_UNIFORM_ROW_HEIGHT: g_value_set_boolean (value, etgl->uniform_row_height); default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index 8fd56bc7b1..8d820f861a 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -99,11 +99,11 @@ etg_dispose (GObject *object) */ ETableGroup * e_table_group_new (GnomeCanvasGroup *parent, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, - ETableSortInfo *sort_info, - gint n) + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info, + gint n) { g_return_val_if_fail (model != NULL, NULL); @@ -128,10 +128,10 @@ e_table_group_new (GnomeCanvasGroup *parent, */ void e_table_group_construct (GnomeCanvasGroup *parent, - ETableGroup *etg, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model) + ETableGroup *etg, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model) { etg->full_header = full_header; g_object_ref (etg->full_header); @@ -139,9 +139,7 @@ e_table_group_construct (GnomeCanvasGroup *parent, g_object_ref (etg->header); etg->model = model; g_object_ref (etg->model); - g_object_set (G_OBJECT (etg), - "parent", parent, - NULL); + g_object_set (etg, "parent", parent, NULL); } /** @@ -154,7 +152,7 @@ e_table_group_construct (GnomeCanvasGroup *parent, */ void e_table_group_add (ETableGroup *etg, - gint row) + gint row) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -174,8 +172,8 @@ e_table_group_add (ETableGroup *etg, */ void e_table_group_add_array (ETableGroup *etg, - const gint *array, - gint count) + const gint *array, + gint count) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -214,7 +212,7 @@ e_table_group_add_all (ETableGroup *etg) */ gboolean e_table_group_remove (ETableGroup *etg, - gint row) + gint row) { g_return_val_if_fail (etg != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (etg), FALSE); @@ -235,8 +233,8 @@ e_table_group_remove (ETableGroup *etg, */ void e_table_group_increment (ETableGroup *etg, - gint position, - gint amount) + gint position, + gint amount) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -257,8 +255,8 @@ e_table_group_increment (ETableGroup *etg, */ void e_table_group_decrement (ETableGroup *etg, - gint position, - gint amount) + gint position, + gint amount) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -296,8 +294,8 @@ e_table_group_row_count (ETableGroup *etg) */ void e_table_group_set_focus (ETableGroup *etg, - EFocus direction, - gint view_col) + EFocus direction, + gint view_col) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -390,7 +388,9 @@ e_table_group_compute_location (ETableGroup *etg, } void -e_table_group_get_mouse_over (ETableGroup *etg, gint *row, gint *col) +e_table_group_get_mouse_over (ETableGroup *etg, + gint *row, + gint *col) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -414,13 +414,13 @@ e_table_group_get_mouse_over (ETableGroup *etg, gint *row, gint *col) * removed from the value row points to. */ void -e_table_group_get_cell_geometry (ETableGroup *etg, - gint *row, - gint *col, - gint *x, - gint *y, - gint *width, - gint *height) +e_table_group_get_cell_geometry (ETableGroup *etg, + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -437,7 +437,8 @@ e_table_group_get_cell_geometry (ETableGroup *etg, * This routine emits the "cursor_change" signal. */ void -e_table_group_cursor_change (ETableGroup *e_table_group, gint row) +e_table_group_cursor_change (ETableGroup *e_table_group, + gint row) { g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); @@ -455,7 +456,8 @@ e_table_group_cursor_change (ETableGroup *e_table_group, gint row) * This routine emits the "cursor_activated" signal. */ void -e_table_group_cursor_activated (ETableGroup *e_table_group, gint row) +e_table_group_cursor_activated (ETableGroup *e_table_group, + gint row) { g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); @@ -614,7 +616,8 @@ e_table_group_get_header (ETableGroup *etg) } static gint -etg_event (GnomeCanvasItem *item, GdkEvent *event) +etg_event (GnomeCanvasItem *item, + GdkEvent *event) { ETableGroup *etg = E_TABLE_GROUP (item); gboolean return_val = TRUE; @@ -638,7 +641,7 @@ etg_event (GnomeCanvasItem *item, GdkEvent *event) } static gboolean -etg_get_focus (ETableGroup *etg) +etg_get_focus (ETableGroup *etg) { return etg->has_focus; } diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 16633f967c..11d8f31f81 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -101,7 +101,8 @@ static void scroll_off (ETableHeaderItem *ethi); static void scroll_on (ETableHeaderItem *ethi, guint scroll_direction); static void -ethi_dispose (GObject *object) { +ethi_dispose (GObject *object) +{ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (object); ethi_drop_table_header (ethi); @@ -223,7 +224,8 @@ ethi_update (GnomeCanvasItem *item, } static void -ethi_font_set (ETableHeaderItem *ethi, PangoFontDescription *font_desc) +ethi_font_set (ETableHeaderItem *ethi, + PangoFontDescription *font_desc) { if (ethi->font_desc) pango_font_description_free (ethi->font_desc); @@ -252,19 +254,23 @@ ethi_drop_table_header (ETableHeaderItem *ethi) } static void -structure_changed (ETableHeader *header, ETableHeaderItem *ethi) +structure_changed (ETableHeader *header, + ETableHeaderItem *ethi) { gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void -dimension_changed (ETableHeader *header, gint col, ETableHeaderItem *ethi) +dimension_changed (ETableHeader *header, + gint col, + ETableHeaderItem *ethi) { gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void -ethi_add_table_header (ETableHeaderItem *ethi, ETableHeader *header) +ethi_add_table_header (ETableHeaderItem *ethi, + ETableHeader *header) { ethi->eth = header; g_object_ref (ethi->eth); @@ -282,16 +288,17 @@ ethi_add_table_header (ETableHeaderItem *ethi, ETableHeader *header) } static void -ethi_sort_info_changed (ETableSortInfo *sort_info, ETableHeaderItem *ethi) +ethi_sort_info_changed (ETableSortInfo *sort_info, + ETableHeaderItem *ethi) { gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void ethi_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; ETableHeaderItem *ethi; @@ -299,7 +306,7 @@ ethi_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); ethi = E_TABLE_HEADER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_TABLE_HEADER: ethi_drop_table_header (ethi); ethi_add_table_header (ethi, E_TABLE_HEADER (g_value_get_object (value))); @@ -364,15 +371,15 @@ ethi_set_property (GObject *object, static void ethi_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableHeaderItem *ethi; ethi = E_TABLE_HEADER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_FULL_HEADER: g_value_set_object (value, ethi->full_header); break; @@ -380,13 +387,14 @@ ethi_get_property (GObject *object, g_value_set_string (value, ethi->dnd_code); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static gint -ethi_find_col_by_x (ETableHeaderItem *ethi, gint x) +ethi_find_col_by_x (ETableHeaderItem *ethi, + gint x) { const gint cols = e_table_header_count (ethi->eth); gint x1 = 0; @@ -416,7 +424,8 @@ ethi_find_col_by_x (ETableHeaderItem *ethi, gint x) } static gint -ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, gint x) +ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, + gint x) { const gint cols = e_table_header_count (ethi->eth); gint x1 = 0; @@ -473,7 +482,9 @@ make_shaped_window_from_xpm (const gchar **xpm) } static void -ethi_add_drop_marker (ETableHeaderItem *ethi, gint col, gboolean recreate) +ethi_add_drop_marker (ETableHeaderItem *ethi, + gint col, + gboolean recreate) { GnomeCanvas *canvas; GtkAdjustment *adjustment; @@ -536,7 +547,7 @@ ethi_add_destroy_marker (ETableHeaderItem *ethi) "x1", x1 + 1, "y1", (gdouble) 1, "x2", (gdouble) x1 + e_table_header_col_diff ( - ethi->eth, ethi->drag_col, ethi->drag_col+1) - 2, + ethi->eth, ethi->drag_col, ethi->drag_col + 1) - 2, "y2", (gdouble) ethi->height - 2, "fill_color_rgba", 0xFF000080, @@ -555,7 +566,9 @@ ethi_remove_destroy_marker (ETableHeaderItem *ethi) #if 0 static gboolean -moved (ETableHeaderItem *ethi, guint col, guint model_col) +moved (ETableHeaderItem *ethi, + guint col, + guint model_col) { if (col == -1) return TRUE; @@ -667,7 +680,8 @@ scroll_timeout (gpointer data) } static void -scroll_on (ETableHeaderItem *ethi, guint scroll_direction) +scroll_on (ETableHeaderItem *ethi, + guint scroll_direction) { if (ethi->scroll_idle_id == 0 || scroll_direction != ethi->scroll_direction) { if (ethi->scroll_idle_id != 0) @@ -786,13 +800,13 @@ ethi_drag_end (GtkWidget *canvas, static void ethi_drag_data_received (GtkWidget *canvas, - GdkDragContext *drag_context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - ETableHeaderItem *ethi) + GdkDragContext *drag_context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + ETableHeaderItem *ethi) { const guchar *data; gint found = FALSE; @@ -836,11 +850,11 @@ ethi_drag_data_received (GtkWidget *canvas, static void ethi_drag_data_get (GtkWidget *canvas, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETableHeaderItem *ethi) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETableHeaderItem *ethi) { if (ethi->drag_col != -1) { ETableCol *ecol = e_table_header_get_column (ethi->eth, ethi->drag_col); @@ -857,11 +871,11 @@ ethi_drag_data_get (GtkWidget *canvas, static gboolean ethi_drag_drop (GtkWidget *canvas, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETableHeaderItem *ethi) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETableHeaderItem *ethi) { gboolean successful = FALSE; @@ -1059,7 +1073,11 @@ ethi_draw (GnomeCanvasItem *item, } static GnomeCanvasItem * -ethi_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +ethi_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } @@ -1089,7 +1107,7 @@ is_pointer_on_division (ETableHeaderItem *ethi, total += ecol->width; - if ((total - TOLERANCE < pos)&& (pos < total + TOLERANCE)) { + if ((total - TOLERANCE < pos) && (pos < total + TOLERANCE)) { if (return_col) *return_col = col; if (the_total) @@ -1110,7 +1128,8 @@ is_pointer_on_division (ETableHeaderItem *ethi, #define convert(c,sx,sy,x,y) gnome_canvas_w2c (c,sx,sy,x,y) static void -set_cursor (ETableHeaderItem *ethi, gint pos) +set_cursor (ETableHeaderItem *ethi, + gint pos) { GnomeCanvas *canvas; GdkWindow *window; @@ -1133,7 +1152,7 @@ set_cursor (ETableHeaderItem *ethi, gint pos) gint c = col + 1; /* Column is not resizable if all columns after it - are also not resizable */ + * are also not resizable */ for (; c <= last_col; c++) { ETableCol *ecol2; @@ -1162,7 +1181,8 @@ ethi_end_resize (ETableHeaderItem *ethi) } static gboolean -ethi_maybe_start_drag (ETableHeaderItem *ethi, GdkEventMotion *event) +ethi_maybe_start_drag (ETableHeaderItem *ethi, + GdkEventMotion *event) { if (!ethi->maybe_drag) return FALSE; @@ -1180,7 +1200,8 @@ ethi_maybe_start_drag (ETableHeaderItem *ethi, GdkEventMotion *event) } static void -ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) +ethi_start_drag (ETableHeaderItem *ethi, + GdkEvent *event) { GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas); GtkTargetList *list; @@ -1281,7 +1302,8 @@ typedef struct { } EthiHeaderInfo; static void -ethi_popup_sort_ascending (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_sort_ascending (GtkWidget *widget, + EthiHeaderInfo *info) { ETableCol *col; gint model_col = -1; @@ -1336,7 +1358,8 @@ ethi_popup_sort_ascending (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_sort_descending (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_sort_descending (GtkWidget *widget, + EthiHeaderInfo *info) { ETableCol *col; gint model_col=-1; @@ -1391,7 +1414,8 @@ ethi_popup_sort_descending (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_unsort (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_unsort (GtkWidget *widget, + EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; @@ -1400,7 +1424,8 @@ ethi_popup_unsort (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_group_field (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_group_field (GtkWidget *widget, + EthiHeaderInfo *info) { ETableCol *col; gint model_col; @@ -1417,18 +1442,21 @@ ethi_popup_group_field (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_group_box (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_group_box (GtkWidget *widget, + EthiHeaderInfo *info) { } static void -ethi_popup_remove_column (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_remove_column (GtkWidget *widget, + EthiHeaderInfo *info) { e_table_header_remove (info->ethi->eth, info->col); } static void -ethi_popup_field_chooser (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_field_chooser (GtkWidget *widget, + EthiHeaderInfo *info) { GtkWidget *etfcd = info->ethi->etfcd.widget; @@ -1453,12 +1481,14 @@ ethi_popup_field_chooser (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_alignment (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_alignment (GtkWidget *widget, + EthiHeaderInfo *info) { } static void -ethi_popup_best_fit (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_best_fit (GtkWidget *widget, + EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; gint width; @@ -1474,19 +1504,22 @@ ethi_popup_best_fit (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_format_columns (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_format_columns (GtkWidget *widget, + EthiHeaderInfo *info) { } static void -config_destroyed (gpointer data, GObject *where_object_was) +config_destroyed (gpointer data, + GObject *where_object_was) { ETableHeaderItem *ethi = data; ethi->config = NULL; } static void -apply_changes (ETableConfig *config, ETableHeaderItem *ethi) +apply_changes (ETableConfig *config, + ETableHeaderItem *ethi) { gchar *state = e_table_state_save_to_string (config->state); @@ -1501,7 +1534,8 @@ apply_changes (ETableConfig *config, ETableHeaderItem *ethi) } static void -ethi_popup_customize_view (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_customize_view (GtkWidget *widget, + EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; ETableState *state; @@ -1531,7 +1565,8 @@ ethi_popup_customize_view (GtkWidget *widget, EthiHeaderInfo *info) } static void -free_popup_info (GtkWidget *w, EthiHeaderInfo *info) +free_popup_info (GtkWidget *w, + EthiHeaderInfo *info) { g_free (info); } @@ -1580,7 +1615,8 @@ static EPopupMenu ethi_context_menu[] = { }; static void -sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi) +sort_by_id (GtkWidget *menu_item, + ETableHeaderItem *ethi) { ETableCol *ecol; gboolean clearfirst; @@ -1606,13 +1642,15 @@ sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi) } static void -popup_custom (GtkWidget *menu_item, EthiHeaderInfo *info) +popup_custom (GtkWidget *menu_item, + EthiHeaderInfo *info) { ethi_popup_customize_view (menu_item, info); } static void -ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) +ethi_header_context_menu (ETableHeaderItem *ethi, + GdkEventButton *event) { EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1); GtkMenu *popup; @@ -1664,9 +1702,9 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) gtk_widget_show (menu_item); gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item); /* Headers */ - for (ncol = 0; ncol<ethi->full_header->col_count; ncol++) + for (ncol = 0; ncol < ethi->full_header->col_count; ncol++) { - gchar *text=NULL; + gchar *text = NULL; if (!ethi->full_header->columns[ncol]->sortable || ethi->full_header->columns[ncol]->disabled) @@ -1704,14 +1742,15 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) } static void -ethi_button_pressed (ETableHeaderItem *ethi, GdkEventButton *event) +ethi_button_pressed (ETableHeaderItem *ethi, + GdkEventButton *event) { - g_signal_emit (ethi, - ethi_signals[BUTTON_PRESSED], 0, event); + g_signal_emit (ethi, ethi_signals[BUTTON_PRESSED], 0, event); } void -ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) +ethi_change_sort_state (ETableHeaderItem *ethi, + ETableCol *col) { gint model_col = -1; gint length; @@ -1793,7 +1832,8 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) * Handles the events on the ETableHeaderItem, particularly it handles resizing */ static gint -ethi_event (GnomeCanvasItem *item, GdkEvent *e) +ethi_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); GnomeCanvas *canvas = item->canvas; diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h index 96f167b4e8..be8e10820a 100644 --- a/widgets/table/e-table-header-item.h +++ b/widgets/table/e-table-header-item.h @@ -84,8 +84,8 @@ struct _ETableHeaderItem { /* * For dragging columns */ - guint maybe_drag:1; - guint dnd_ready:1; + guint maybe_drag : 1; + guint dnd_ready : 1; gint click_x, click_y; gint drag_col, drop_col, drag_mark; guint drag_motion_id; diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index 659677eceb..34f93a701b 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -35,8 +35,9 @@ #include "e-table-defines.h" #include "e-table-header-utils.h" -static PangoLayout* -build_header_layout (GtkWidget *widget, const gchar *str) +static PangoLayout * +build_header_layout (GtkWidget *widget, + const gchar *str) { PangoLayout *layout; @@ -69,7 +70,8 @@ build_header_layout (GtkWidget *widget, const gchar *str) * Return value: The height of the button, in pixels. **/ gdouble -e_table_header_compute_height (ETableCol *ecol, GtkWidget *widget) +e_table_header_compute_height (ETableCol *ecol, + GtkWidget *widget) { gint ythick; gint height; @@ -112,9 +114,14 @@ e_table_header_width_extras (GtkStyle *style) */ #if 0 static GdkPixmap * -make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, - GdkPixbuf *pixbuf, GdkColor *bg, gint width, gint height, - gint dither_xofs, gint dither_yofs) +make_composite_pixmap (GdkDrawable *drawable, + GdkGC *gc, + GdkPixbuf *pixbuf, + GdkColor *bg, + gint width, + gint height, + gint dither_xofs, + gint dither_yofs) { gint pwidth, pheight; GdkPixmap *pixmap; @@ -240,12 +247,18 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, * Draws a button suitable for a table header. **/ void -e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, - GtkStyle *style, GtkStateType state, - GtkWidget *widget, - gint x, gint y, gint width, gint height, - gint button_width, gint button_height, - ETableColArrow arrow) +e_table_header_draw_button (cairo_t *cr, + ETableCol *ecol, + GtkStyle *style, + GtkStateType state, + GtkWidget *widget, + gint x, + gint y, + gint width, + gint height, + gint button_width, + gint button_height, + ETableColArrow arrow) { gint xthick, ythick; gint inner_x, inner_y; diff --git a/widgets/table/e-table-header-utils.h b/widgets/table/e-table-header-utils.h index cfa568bcdd..c3b2de89c7 100644 --- a/widgets/table/e-table-header-utils.h +++ b/widgets/table/e-table-header-utils.h @@ -34,7 +34,7 @@ gdouble e_table_header_compute_height (ETableCol *ecol, GtkWidget *widget); gdouble e_table_header_width_extras (GtkStyle *style); void e_table_header_draw_button (cairo_t *cr, - ETableCol*ecol, + ETableCol *ecol, GtkStyle *style, GtkStateType state, GtkWidget *widget, diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 90dec061c1..aab0971518 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -63,13 +63,16 @@ struct two_ints { }; static void -eth_set_width (ETableHeader *eth, gint width) +eth_set_width (ETableHeader *eth, + gint width) { eth->width = width; } static void -dequeue (ETableHeader *eth, gint *column, gint *width) +dequeue (ETableHeader *eth, + gint *column, + gint *width) { GSList *head; struct two_ints *store; @@ -110,7 +113,9 @@ dequeue_idle (ETableHeader *eth) } static void -enqueue (ETableHeader *eth, gint column, gint width) +enqueue (ETableHeader *eth, + gint column, + gint width) { struct two_ints *store; store = g_new (struct two_ints, 1); @@ -129,7 +134,9 @@ enqueue (ETableHeader *eth, gint column, gint width) } void -e_table_header_set_size (ETableHeader *eth, gint idx, gint size) +e_table_header_set_size (ETableHeader *eth, + gint idx, + gint size) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -138,12 +145,14 @@ e_table_header_set_size (ETableHeader *eth, gint idx, gint size) } static void -eth_do_remove (ETableHeader *eth, gint idx, gboolean do_unref) +eth_do_remove (ETableHeader *eth, + gint idx, + gboolean do_unref) { if (do_unref) g_object_unref (eth->columns[idx]); - memmove (ð->columns[idx], ð->columns[idx+1], + memmove (ð->columns[idx], ð->columns[idx + 1], sizeof (ETableCol *) * (eth->col_count - idx - 1)); eth->col_count--; } @@ -189,17 +198,21 @@ eth_finalize (GObject *object) } static void -eth_group_info_changed (ETableSortInfo *info, ETableHeader *eth) +eth_group_info_changed (ETableSortInfo *info, + ETableHeader *eth) { enqueue (eth, -1, eth->nominal_width); } static void -eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec *pspec) +eth_set_property (GObject *object, + guint property_id, + const GValue *val, + GParamSpec *pspec) { ETableHeader *eth = E_TABLE_HEADER (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: eth->nominal_width = g_value_get_double (val); enqueue (eth, -1, eth->nominal_width); @@ -219,9 +232,9 @@ eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec eth->sort_info = E_TABLE_SORT_INFO (g_value_get_object (val)); if (eth->sort_info) { g_object_ref (eth->sort_info); - eth->sort_info_group_change_id - = g_signal_connect(G_OBJECT(eth->sort_info), "group_info_changed", - G_CALLBACK (eth_group_info_changed), eth); + eth->sort_info_group_change_id = g_signal_connect ( + eth->sort_info, "group_info_changed", + G_CALLBACK (eth_group_info_changed), eth); } enqueue (eth, -1, eth->nominal_width); break; @@ -231,11 +244,14 @@ eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec } static void -eth_get_property (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec) +eth_get_property (GObject *object, + guint property_id, + GValue *val, + GParamSpec *pspec) { ETableHeader *eth = E_TABLE_HEADER (object); - switch (prop_id) { + switch (property_id) { case PROP_SORT_INFO: g_value_set_object (val, G_OBJECT (eth->sort_info)); break; @@ -246,7 +262,7 @@ eth_get_property (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec g_value_set_double (val, eth->width_extras); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -363,9 +379,11 @@ eth_update_offsets (ETableHeader *eth) } static void -eth_do_insert (ETableHeader *eth, gint pos, ETableCol *val) +eth_do_insert (ETableHeader *eth, + gint pos, + ETableCol *val) { - memmove (ð->columns[pos+1], ð->columns[pos], + memmove (ð->columns[pos + 1], ð->columns[pos], sizeof (ETableCol *) * (eth->col_count - pos)); eth->columns[pos] = val; eth->col_count++; @@ -386,7 +404,9 @@ eth_do_insert (ETableHeader *eth, gint pos, ETableCol *val) * The ETableCol is assumed */ void -e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) +e_table_header_add_column (ETableHeader *eth, + ETableCol *tc, + gint pos) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -418,7 +438,8 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) * Returns: The ETableCol at @column in the @eth object */ ETableCol * -e_table_header_get_column (ETableHeader *eth, gint column) +e_table_header_get_column (ETableHeader *eth, + gint column) { g_return_val_if_fail (eth != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL); @@ -440,7 +461,8 @@ e_table_header_get_column (ETableHeader *eth, gint column) * Returns: The ETableCol with col_idx = @col_idx in the @eth object */ ETableCol * -e_table_header_get_column_by_col_idx (ETableHeader *eth, gint col_idx) +e_table_header_get_column_by_col_idx (ETableHeader *eth, + gint col_idx) { gint i; g_return_val_if_fail (eth != NULL, NULL); @@ -483,7 +505,8 @@ e_table_header_count (ETableHeader *eth) * Returns: the column in the model that the @col column * in the ETableHeader points to. */ gint -e_table_header_index (ETableHeader *eth, gint col) +e_table_header_index (ETableHeader *eth, + gint col) { g_return_val_if_fail (eth != NULL, -1); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), -1); @@ -504,7 +527,8 @@ e_table_header_index (ETableHeader *eth, gint col) * if no column inside this ETableHeader contains that pixel. */ gint -e_table_header_get_index_at (ETableHeader *eth, gint x_offset) +e_table_header_get_index_at (ETableHeader *eth, + gint x_offset) { gint i, total; @@ -629,7 +653,9 @@ e_table_header_min_width (ETableHeader *eth) * and "structure_change" will be emmited */ void -e_table_header_move (ETableHeader *eth, gint source_index, gint target_index) +e_table_header_move (ETableHeader *eth, + gint source_index, + gint target_index) { ETableCol *old; @@ -663,7 +689,8 @@ e_table_header_move (ETableHeader *eth, gint source_index, gint target_index) * This emmits the "structure_change" signal on the @eth object. */ void -e_table_header_remove (ETableHeader *eth, gint idx) +e_table_header_remove (ETableHeader *eth, + gint idx) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -679,14 +706,17 @@ e_table_header_remove (ETableHeader *eth, gint idx) * FIXME: deprecated? */ void -e_table_header_set_selection (ETableHeader *eth, gboolean allow_selection) +e_table_header_set_selection (ETableHeader *eth, + gboolean allow_selection) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); } static void -eth_set_size (ETableHeader *eth, gint idx, gint size) +eth_set_size (ETableHeader *eth, + gint idx, + gint size) { gdouble expansion; gdouble old_expansion; @@ -824,7 +854,9 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) * @eth ETableHeader object */ gint -e_table_header_col_diff (ETableHeader *eth, gint start_col, gint end_col) +e_table_header_col_diff (ETableHeader *eth, + gint start_col, + gint end_col) { gint total, col; diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index ac46df2cd3..25ea433a66 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -67,8 +67,8 @@ static void eti_check_cursor_bounds (ETableItem *eti); static void eti_cancel_drag_due_to_model_change (ETableItem *eti); /* FIXME: Do an analysis of which cell functions are needed before - realize and make sure that all of them are doable by all the cells - and that all of the others are only done after realization. */ + * realize and make sure that all of them are doable by all the cells + * and that all of the others are only done after realization. */ enum { CURSOR_CHANGE, @@ -122,9 +122,9 @@ static void e_table_item_redraw_row (ETableItem *eti, gint row); #define ETI_ROW_HEIGHT(eti,row) ((eti)->uniform_row_height ? ETI_SINGLE_ROW_HEIGHT ((eti)) : ETI_MULTIPLE_ROW_HEIGHT((eti),(row))) /* tweak_hsv is a really tweaky function. it modifies its first argument, which - should be the color you want tweaked. delta_h, delta_s and delta_v specify - how much you want their respective channels modified (and in what direction). - if it can't do the specified modification, it does it in the oppositon direction */ + * should be the color you want tweaked. delta_h, delta_s and delta_v specify + * how much you want their respective channels modified (and in what direction). + * if it can't do the specified modification, it does it in the oppositon direction */ static void e_hsv_tweak (GdkColor *color, gdouble delta_h, @@ -165,7 +165,8 @@ e_hsv_tweak (GdkColor *color, } inline static gint -model_to_view_row (ETableItem *eti, gint row) +model_to_view_row (ETableItem *eti, + gint row) { gint i; if (row == -1) @@ -187,7 +188,8 @@ model_to_view_row (ETableItem *eti, gint row) } inline static gint -view_to_model_row (ETableItem *eti, gint row) +view_to_model_row (ETableItem *eti, + gint row) { if (eti->uses_source_model) { ETableSubset *etss = E_TABLE_SUBSET (eti->table_model); @@ -201,7 +203,8 @@ view_to_model_row (ETableItem *eti, gint row) } inline static gint -model_to_view_col (ETableItem *eti, gint col) +model_to_view_col (ETableItem *eti, + gint col) { gint i; if (col == -1) @@ -215,14 +218,17 @@ model_to_view_col (ETableItem *eti, gint col) } inline static gint -view_to_model_col (ETableItem *eti, gint col) +view_to_model_col (ETableItem *eti, + gint col) { ETableCol *ecol = e_table_header_get_column (eti->header, col); return ecol ? ecol->col_idx : -1; } static void -grab_cancelled (ECanvas *canvas, GnomeCanvasItem *item, gpointer data) +grab_cancelled (ECanvas *canvas, + GnomeCanvasItem *item, + gpointer data) { ETableItem *eti = data; @@ -230,7 +236,8 @@ grab_cancelled (ECanvas *canvas, GnomeCanvasItem *item, gpointer data) } inline static void -eti_grab (ETableItem *eti, guint32 time) +eti_grab (ETableItem *eti, + guint32 time) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); d(g_print ("%s: time: %d\n", __FUNCTION__, time)); @@ -253,7 +260,8 @@ eti_grab (ETableItem *eti, guint32 time) } inline static void -eti_ungrab (ETableItem *eti, guint32 time) +eti_ungrab (ETableItem *eti, + guint32 time) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); d(g_print ("%s: time: %d\n", __FUNCTION__, time)); @@ -286,7 +294,11 @@ eti_editing (ETableItem *eti) } inline static GdkColor * -eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean selected, gboolean *allocatedp) +eti_get_cell_background_color (ETableItem *eti, + gint row, + gint col, + gboolean selected, + gboolean *allocatedp) { ECellView *ecell_view = eti->cell_views[col]; GtkWidget *canvas; @@ -334,7 +346,11 @@ eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean sel } inline static GdkColor * -eti_get_cell_foreground_color (ETableItem *eti, gint row, gint col, gboolean selected, gboolean *allocated) +eti_get_cell_foreground_color (ETableItem *eti, + gint row, + gint col, + gboolean selected, + gboolean *allocated) { GtkWidget *canvas; GdkColor *foreground; @@ -381,7 +397,7 @@ eti_free_save_state (ETableItem *eti) * we might want to avoid realizing each e-cell. */ static void -eti_realize_cell_views ( ETableItem *eti) +eti_realize_cell_views (ETableItem *eti) { GnomeCanvasItem *item; gint i; @@ -470,7 +486,11 @@ eti_detach_cell_views (ETableItem *eti) } static void -eti_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2) +eti_bounds (GnomeCanvasItem *item, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2) { cairo_matrix_t i2c; ETableItem *eti = E_TABLE_ITEM (item); @@ -487,7 +507,8 @@ eti_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdoubl } static void -eti_reflow (GnomeCanvasItem *item, gint flags) +eti_reflow (GnomeCanvasItem *item, + gint flags) { ETableItem *eti = E_TABLE_ITEM (item); @@ -518,7 +539,9 @@ eti_reflow (GnomeCanvasItem *item, gint flags) * GnomeCanvasItem::update method */ static void -eti_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +eti_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { ETableItem *eti = E_TABLE_ITEM (item); gdouble x1, x2, y1, y2; @@ -652,7 +675,8 @@ eti_remove_header_model (ETableItem *eti) * used as a separator between rows */ static gint -eti_row_height_real (ETableItem *eti, gint row) +eti_row_height_real (ETableItem *eti, + gint row) { const gint cols = e_table_header_count (eti->header); gint col; @@ -744,7 +768,8 @@ calculate_height_cache (ETableItem *eti) * used as a separator between rows */ static gint -eti_row_height (ETableItem *eti, gint row) +eti_row_height (ETableItem *eti, + gint row) { if (eti->uniform_row_height) { eti->uniform_row_height_cache = eti_row_height_real (eti, -1); @@ -826,7 +851,11 @@ eti_get_height (ETableItem *eti) } static void -eti_item_region_redraw (ETableItem *eti, gint x0, gint y0, gint x1, gint y1) +eti_item_region_redraw (ETableItem *eti, + gint x0, + gint y0, + gint x1, + gint y1) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); gdouble dx1, dy1, dx2, dy2; @@ -847,7 +876,9 @@ eti_item_region_redraw (ETableItem *eti, gint x0, gint y0, gint x1, gint y1) * Computes the distance between @start_row and @end_row in pixels */ gint -e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row) +e_table_item_row_diff (ETableItem *eti, + gint start_row, + gint end_row) { gint height_extra = eti->horizontal_draw_grid ? 1 : 0; @@ -870,10 +901,14 @@ e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row) static void eti_get_region (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row, - gint *x1p, gint *y1p, - gint *x2p, gint *y2p) + gint start_col, + gint start_row, + gint end_col, + gint end_row, + gint *x1p, + gint *y1p, + gint *x2p, + gint *y2p) { gint x1, y1, x2, y2; @@ -903,8 +938,11 @@ eti_get_region (ETableItem *eti, */ static void eti_request_region_redraw (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row, gint border) + gint start_col, + gint start_row, + gint end_col, + gint end_row, + gint border) { gint x1, y1, x2, y2; @@ -930,8 +968,11 @@ eti_request_region_redraw (ETableItem *eti, */ static void eti_request_region_show (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row, gint delay) + gint start_col, + gint start_row, + gint end_col, + gint end_row, + gint delay) { gint x1, y1, x2, y2; @@ -947,7 +988,8 @@ eti_request_region_show (ETableItem *eti, } static void -eti_show_cursor (ETableItem *eti, gint delay) +eti_show_cursor (ETableItem *eti, + gint delay) { GnomeCanvasItem *item; gint cursor_row; @@ -1028,7 +1070,8 @@ eti_check_cursor_bounds (ETableItem *eti) } static void -eti_maybe_show_cursor (ETableItem *eti, gint delay) +eti_maybe_show_cursor (ETableItem *eti, + gint delay) { d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE")); if (eti->cursor_on_screen) @@ -1101,7 +1144,8 @@ eti_unfreeze (ETableItem *eti) * Callback routine: invoked before the ETableModel suffers a change */ static void -eti_table_model_pre_change (ETableModel *table_model, ETableItem *eti) +eti_table_model_pre_change (ETableModel *table_model, + ETableItem *eti) { eti_cancel_drag_due_to_model_change (eti); eti_check_cursor_bounds (eti); @@ -1116,7 +1160,8 @@ eti_table_model_pre_change (ETableModel *table_model, ETableItem *eti) * Callback routine: invoked when the ETableModel has not suffered a change */ static void -eti_table_model_no_change (ETableModel *table_model, ETableItem *eti) +eti_table_model_no_change (ETableModel *table_model, + ETableItem *eti) { eti_unfreeze (eti); } @@ -1126,7 +1171,8 @@ eti_table_model_no_change (ETableModel *table_model, ETableItem *eti) */ static void -eti_table_model_changed (ETableModel *table_model, ETableItem *eti) +eti_table_model_changed (ETableModel *table_model, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1150,7 +1196,9 @@ eti_table_model_changed (ETableModel *table_model, ETableItem *eti) } static void -eti_table_model_row_changed (ETableModel *table_model, gint row, ETableItem *eti) +eti_table_model_row_changed (ETableModel *table_model, + gint row, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1170,7 +1218,10 @@ eti_table_model_row_changed (ETableModel *table_model, gint row, ETableItem *eti } static void -eti_table_model_cell_changed (ETableModel *table_model, gint col, gint row, ETableItem *eti) +eti_table_model_cell_changed (ETableModel *table_model, + gint col, + gint row, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1190,7 +1241,10 @@ eti_table_model_cell_changed (ETableModel *table_model, gint col, gint row, ETab } static void -eti_table_model_rows_inserted (ETableModel *table_model, gint row, gint count, ETableItem *eti) +eti_table_model_rows_inserted (ETableModel *table_model, + gint row, + gint count, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1219,7 +1273,10 @@ eti_table_model_rows_inserted (ETableModel *table_model, gint row, gint count, E } static void -eti_table_model_rows_deleted (ETableModel *table_model, gint row, gint count, ETableItem *eti) +eti_table_model_rows_deleted (ETableModel *table_model, + gint row, + gint count, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1257,8 +1314,10 @@ eti_table_model_rows_deleted (ETableModel *table_model, gint row, gint count, ET */ void e_table_item_redraw_range (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row) + gint start_col, + gint start_row, + gint end_col, + gint end_row) { gint border; gint cursor_col, cursor_row; @@ -1284,14 +1343,15 @@ e_table_item_redraw_range (ETableItem *eti, static void e_table_item_redraw_row (ETableItem *eti, - gint row) + gint row) { if (row != -1) e_table_item_redraw_range (eti, 0, row, eti->cols - 1, row); } static void -eti_add_table_model (ETableItem *eti, ETableModel *table_model) +eti_add_table_model (ETableItem *eti, + ETableModel *table_model) { g_return_if_fail (eti->table_model == NULL); @@ -1344,7 +1404,8 @@ eti_add_table_model (ETableItem *eti, ETableModel *table_model) } static void -eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) +eti_add_selection_model (ETableItem *eti, + ESelectionModel *selection) { g_return_if_fail (eti->selection == NULL); @@ -1373,7 +1434,9 @@ eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) } static void -eti_header_dim_changed (ETableHeader *eth, gint col, ETableItem *eti) +eti_header_dim_changed (ETableHeader *eth, + gint col, + ETableItem *eti) { eti->needs_compute_width = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti)); @@ -1382,7 +1445,8 @@ eti_header_dim_changed (ETableHeader *eth, gint col, ETableItem *eti) } static void -eti_header_structure_changed (ETableHeader *eth, ETableItem *eti) +eti_header_structure_changed (ETableHeader *eth, + ETableItem *eti) { eti->cols = e_table_header_count (eti->header); @@ -1409,7 +1473,9 @@ eti_header_structure_changed (ETableHeader *eth, ETableItem *eti) } static gint -eti_request_column_width (ETableHeader *eth, gint col, ETableItem *eti) +eti_request_column_width (ETableHeader *eth, + gint col, + ETableItem *eti) { gint width = 0; @@ -1421,7 +1487,8 @@ eti_request_column_width (ETableHeader *eth, gint col, ETableItem *eti) } static void -eti_add_header_model (ETableItem *eti, ETableHeader *header) +eti_add_header_model (ETableItem *eti, + ETableHeader *header) { g_return_if_fail (eti->header == NULL); @@ -1475,13 +1542,16 @@ eti_dispose (GObject *object) } static void -eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +eti_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (object); ETableItem *eti = E_TABLE_ITEM (object); gint cursor_col; - switch (prop_id) { + switch (property_id) { case PROP_TABLE_HEADER: eti_remove_header_model (eti); eti_add_header_model (eti, E_TABLE_HEADER (g_value_get_object (value))); @@ -1558,14 +1628,17 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe } static void -eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +eti_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableItem *eti; gint row; eti = E_TABLE_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, eti->width); break; @@ -1585,7 +1658,7 @@ eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp g_value_set_boolean (value, eti->uniform_row_height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1666,7 +1739,9 @@ static const gchar gray50_bits[] = { 0x02, 0x01, }; static gboolean -eti_tree_unfreeze (GtkWidget *widget, GdkEvent *event, ETableItem *eti) +eti_tree_unfreeze (GtkWidget *widget, + GdkEvent *event, + ETableItem *eti) { if (widget) @@ -1745,8 +1820,13 @@ eti_unrealize (GnomeCanvasItem *item) } static void -eti_draw_grid_line (ETableItem *eti, cairo_t *cr, GtkStyle *style, - gint x1, gint y1, gint x2, gint y2) +eti_draw_grid_line (ETableItem *eti, + cairo_t *cr, + GtkStyle *style, + gint x1, + gint y1, + gint x2, + gint y2) { cairo_save (cr); @@ -1761,7 +1841,12 @@ eti_draw_grid_line (ETableItem *eti, cairo_t *cr, GtkStyle *style, } static void -eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height) +eti_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { ETableItem *eti = E_TABLE_ITEM (item); const gint rows = eti->rows; @@ -1915,26 +2000,26 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h } x1 = xd; - y1 = yd+1; + y1 = yd + 1; x2 = x1 + ecol->width; - y2 = yd+height; + y2 = yd + height; background = eti_get_cell_background_color (eti, row, col, col_selected, &free_background); cairo_save (cr); pat = cairo_pattern_create_linear (0, y1, 0, y2); - cairo_pattern_add_color_stop_rgba (pat, 0.0, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, selected ? 0.8: 1.0); + cairo_pattern_add_color_stop_rgba (pat, 0.0, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, selected ? 0.8: 1.0); if (selected) - cairo_pattern_add_color_stop_rgba (pat, 0.5, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, 0.9); - - cairo_pattern_add_color_stop_rgba (pat, 1, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, selected ? 0.8 : 1.0); - cairo_rectangle (cr, x1, y1, ecol->width, height-1); + cairo_pattern_add_color_stop_rgba (pat, 0.5, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, 0.9); + + cairo_pattern_add_color_stop_rgba (pat, 1, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, selected ? 0.8 : 1.0); + cairo_rectangle (cr, x1, y1, ecol->width, height - 1); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); @@ -1944,17 +2029,17 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h cairo_save (cr); cairo_set_line_width (cr, 1.0); - cairo_set_source_rgba (cr, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, 1); + cairo_set_source_rgba (cr, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, 1); cairo_move_to (cr, x1, y1); cairo_line_to (cr, x2, y1); cairo_stroke (cr); cairo_set_line_width (cr, 1.0); - cairo_set_source_rgba (cr, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, 1); + cairo_set_source_rgba (cr, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, 1); cairo_move_to (cr, x1, y2); cairo_line_to (cr, x2, y2); cairo_stroke (cr); @@ -1991,7 +2076,7 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h if (view_to_model_row (eti, row) == cursor_row) { f_x1 = floor (eti_base_x) - x; f_x2 = floor (lower_right_x) - x; - f_y1 = yd+1; + f_y1 = yd + 1; f_y2 = yd + height; f_found = TRUE; } @@ -2055,13 +2140,23 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h } static GnomeCanvasItem * -eti_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +eti_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gboolean -find_cell (ETableItem *eti, gdouble x, gdouble y, gint *view_col_res, gint *view_row_res, gdouble *x1_res, gdouble *y1_res) +find_cell (ETableItem *eti, + gdouble x, + gdouble y, + gint *view_col_res, + gint *view_row_res, + gdouble *x1_res, + gdouble *y1_res) { const gint cols = eti->cols; const gint rows = eti->rows; @@ -2127,7 +2222,9 @@ find_cell (ETableItem *eti, gdouble x, gdouble y, gint *view_col_res, gint *view } static void -eti_cursor_move (ETableItem *eti, gint row, gint column) +eti_cursor_move (ETableItem *eti, + gint row, + gint column) { e_table_item_leave_edit_(eti); e_table_item_focus (eti, view_to_model_col (eti, column), view_to_model_row (eti, row), 0); @@ -2158,7 +2255,14 @@ eti_cursor_move_right (ETableItem *eti) } static gint -eti_e_cell_event (ETableItem *item, ECellView *ecell_view, GdkEvent *event, gint time, gint model_col, gint view_col, gint row, ECellFlags flags) +eti_e_cell_event (ETableItem *item, + ECellView *ecell_view, + GdkEvent *event, + gint time, + gint model_col, + gint view_col, + gint row, + ECellFlags flags) { ECellActions actions = 0; gint ret_val; @@ -2184,7 +2288,8 @@ eti_e_cell_event (ETableItem *item, ECellView *ecell_view, GdkEvent *event, /* FIXME: cursor */ static gint -eti_event (GnomeCanvasItem *item, GdkEvent *e) +eti_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableItem *eti = E_TABLE_ITEM (item); ECellView *ecell_view; @@ -2786,7 +2891,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } static void -eti_style_set (ETableItem *eti, GtkStyle *previous_style) +eti_style_set (ETableItem *eti, + GtkStyle *previous_style) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -3057,13 +3163,18 @@ eti_class_init (ETableItemClass *class) * This routine sets the cursor of the %ETableItem canvas item. */ void -e_table_item_set_cursor (ETableItem *eti, gint col, gint row) +e_table_item_set_cursor (ETableItem *eti, + gint col, + gint row) { e_table_item_focus (eti, col, view_to_model_row (eti, row), 0); } static void -e_table_item_focus (ETableItem *eti, gint col, gint row, GdkModifierType state) +e_table_item_focus (ETableItem *eti, + gint col, + gint row, + GdkModifierType state) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3107,7 +3218,10 @@ e_table_item_get_focused_column (ETableItem *eti) } static void -eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *eti) +eti_cursor_change (ESelectionModel *selection, + gint row, + gint col, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); gint view_row; @@ -3146,7 +3260,10 @@ eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *e } static void -eti_cursor_activated (ESelectionModel *selection, gint row, gint col, ETableItem *eti) +eti_cursor_activated (ESelectionModel *selection, + gint row, + gint col, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); gint view_row; @@ -3178,7 +3295,8 @@ eti_cursor_activated (ESelectionModel *selection, gint row, gint col, ETableItem } static void -eti_selection_change (ESelectionModel *selection, ETableItem *eti) +eti_selection_change (ESelectionModel *selection, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -3190,7 +3308,9 @@ eti_selection_change (ESelectionModel *selection, ETableItem *eti) } static void -eti_selection_row_change (ESelectionModel *selection, gint row, ETableItem *eti) +eti_selection_row_change (ESelectionModel *selection, + gint row, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -3212,7 +3332,9 @@ eti_selection_row_change (ESelectionModel *selection, gint row, ETableItem *eti) * column and row. */ void -e_table_item_enter_edit (ETableItem *eti, gint col, gint row) +e_table_item_enter_edit (ETableItem *eti, + gint col, + gint row) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3276,14 +3398,14 @@ e_table_item_leave_edit (ETableItem *eti) * is removed from the value y points to. */ void -e_table_item_compute_location (ETableItem *eti, - gint *x, - gint *y, - gint *row, - gint *col) +e_table_item_compute_location (ETableItem *eti, + gint *x, + gint *y, + gint *row, + gint *col) { /* Save the grabbed row but make sure that we don't get flawed - results because the cursor is grabbed. */ + * results because the cursor is grabbed. */ gint grabbed_row = eti->grabbed_row; eti->grabbed_row = -1; @@ -3300,15 +3422,15 @@ e_table_item_compute_location (ETableItem *eti, * the position inside the item too. **/ void -e_table_item_compute_mouse_over (ETableItem *eti, - gint x, - gint y, - gint *row, - gint *col) +e_table_item_compute_mouse_over (ETableItem *eti, + gint x, + gint y, + gint *row, + gint *col) { gdouble realx, realy; /* Save the grabbed row but make sure that we don't get flawed - results because the cursor is grabbed. */ + * results because the cursor is grabbed. */ gint grabbed_row = eti->grabbed_row; eti->grabbed_row = -1; @@ -3326,13 +3448,13 @@ e_table_item_compute_mouse_over (ETableItem *eti, } void -e_table_item_get_cell_geometry (ETableItem *eti, - gint *row, - gint *col, - gint *x, - gint *y, - gint *width, - gint *height) +e_table_item_get_cell_geometry (ETableItem *eti, + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { if (eti->rows > *row) { if (x) @@ -3356,7 +3478,8 @@ typedef struct { } ETableItemPrintContext; static gdouble * -e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width) +e_table_item_calculate_print_widths (ETableHeader *eth, + gdouble width) { gint i; gdouble extra; @@ -3375,14 +3498,17 @@ e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width) widths[i] = eth->columns[i]->min_width * scale; } for (i = 0; i <= last_resizable; i++) { - widths[i] += extra * (eth->columns[i]->resizable ? eth->columns[i]->expansion : 0)/expansion; + widths[i] += extra * (eth->columns[i]->resizable ? eth->columns[i]->expansion : 0) / expansion; } return widths; } static gdouble -eti_printed_row_height (ETableItem *eti, gdouble *widths, GtkPrintContext *context, gint row) +eti_printed_row_height (ETableItem *eti, + gdouble *widths, + GtkPrintContext *context, + gint row) { gint col; gint cols = eti->cols; @@ -3400,7 +3526,11 @@ eti_printed_row_height (ETableItem *eti, gdouble *widths, GtkPrintContext *conte #define CHECK(x) if((x) == -1) return -1; static gint -gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdouble height) +gp_draw_rect (GtkPrintContext *context, + gdouble x, + gdouble y, + gdouble width, + gdouble height) { cairo_t *cr; cr = gtk_print_context_get_cairo_context (context); @@ -3413,12 +3543,12 @@ gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdo } static void -e_table_item_print_page (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble height, - gboolean quantize, - ETableItemPrintContext *itemcontext) +e_table_item_print_page (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble height, + gboolean quantize, + ETableItemPrintContext *itemcontext) { ETableItem *eti = itemcontext->item; const gint rows = eti->rows; @@ -3503,8 +3633,8 @@ e_table_item_print_page (EPrintable *ep, } static gboolean -e_table_item_data_left (EPrintable *ep, - ETableItemPrintContext *itemcontext) +e_table_item_data_left (EPrintable *ep, + ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; gint rows_printed = itemcontext->rows_printed; @@ -3514,19 +3644,19 @@ e_table_item_data_left (EPrintable *ep, } static void -e_table_item_reset (EPrintable *ep, - ETableItemPrintContext *itemcontext) +e_table_item_reset (EPrintable *ep, + ETableItemPrintContext *itemcontext) { itemcontext->rows_printed = 0; } static gdouble -e_table_item_height (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETableItemPrintContext *itemcontext) +e_table_item_height (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; const gint rows = item->rows; @@ -3571,12 +3701,12 @@ e_table_item_height (EPrintable *ep, } static gboolean -e_table_item_will_fit (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETableItemPrintContext *itemcontext) +e_table_item_will_fit (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; const gint rows = item->rows; @@ -3622,7 +3752,7 @@ e_table_item_will_fit (EPrintable *ep, static void e_table_item_printable_destroy (gpointer data, - GObject *where_object_was) + GObject *where_object_was) { ETableItemPrintContext *itemcontext = data; diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h index d2fd2c56d6..26a181dd64 100644 --- a/widgets/table/e-table-item.h +++ b/widgets/table/e-table-item.h @@ -94,12 +94,12 @@ struct _ETableItem { /* View row, -1 means unknown */ gint old_cursor_row; - guint alternating_row_colors:1; - guint horizontal_draw_grid:1; - guint vertical_draw_grid:1; - guint draw_focus:1; - guint uniform_row_height:1; - guint cell_views_realized:1; + guint alternating_row_colors : 1; + guint horizontal_draw_grid : 1; + guint vertical_draw_grid : 1; + guint draw_focus : 1; + guint uniform_row_height : 1; + guint cell_views_realized : 1; guint needs_redraw : 1; guint needs_compute_height : 1; diff --git a/widgets/table/e-table-memory-callbacks.c b/widgets/table/e-table-memory-callbacks.c index bc85c7d39a..279d0a505e 100644 --- a/widgets/table/e-table-memory-callbacks.c +++ b/widgets/table/e-table-memory-callbacks.c @@ -43,7 +43,9 @@ etmc_column_count (ETableModel *etm) } static gpointer -etmc_value_at (ETableModel *etm, gint col, gint row) +etmc_value_at (ETableModel *etm, + gint col, + gint row) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -54,7 +56,10 @@ etmc_value_at (ETableModel *etm, gint col, gint row) } static void -etmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etmc_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -63,7 +68,9 @@ etmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etmc_is_cell_editable (ETableModel *etm, gint col, gint row) +etmc_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -75,7 +82,9 @@ etmc_is_cell_editable (ETableModel *etm, gint col, gint row) /* The default for etmc_duplicate_value is to return the raw value. */ static gpointer -etmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etmc_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -86,7 +95,9 @@ etmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etmc_free_value (ETableModel *etm, gint col, gpointer value) +etmc_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -95,7 +106,8 @@ etmc_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etmc_initialize_value (ETableModel *etm, gint col) +etmc_initialize_value (ETableModel *etm, + gint col) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -106,7 +118,9 @@ etmc_initialize_value (ETableModel *etm, gint col) } static gboolean -etmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etmc_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -117,7 +131,9 @@ etmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etmc_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -128,7 +144,9 @@ etmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) } static void -etmc_append_row (ETableModel *etm, ETableModel *source, gint row) +etmc_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -189,15 +207,15 @@ e_table_memory_callbacks_init (ETableMemoryCallbacks *etmc) */ ETableModel * e_table_memory_callbacks_new (ETableMemoryCallbacksColumnCountFn col_count, - ETableMemoryCallbacksValueAtFn value_at, - ETableMemoryCallbacksSetValueAtFn set_value_at, - ETableMemoryCallbacksIsCellEditableFn is_cell_editable, - ETableMemoryCallbacksDuplicateValueFn duplicate_value, - ETableMemoryCallbacksFreeValueFn free_value, - ETableMemoryCallbacksInitializeValueFn initialize_value, - ETableMemoryCallbacksValueIsEmptyFn value_is_empty, - ETableMemoryCallbacksValueToStringFn value_to_string, - gpointer data) + ETableMemoryCallbacksValueAtFn value_at, + ETableMemoryCallbacksSetValueAtFn set_value_at, + ETableMemoryCallbacksIsCellEditableFn is_cell_editable, + ETableMemoryCallbacksDuplicateValueFn duplicate_value, + ETableMemoryCallbacksFreeValueFn free_value, + ETableMemoryCallbacksInitializeValueFn initialize_value, + ETableMemoryCallbacksValueIsEmptyFn value_is_empty, + ETableMemoryCallbacksValueToStringFn value_to_string, + gpointer data) { ETableMemoryCallbacks *et; diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c index dc77e13410..55f96f5862 100644 --- a/widgets/table/e-table-memory-store.c +++ b/widgets/table/e-table-memory-store.c @@ -41,7 +41,9 @@ struct _ETableMemoryStorePrivate { G_DEFINE_TYPE (ETableMemoryStore, e_table_memory_store, E_TYPE_TABLE_MEMORY) static gpointer -duplicate_value (ETableMemoryStore *etms, gint col, gconstpointer val) +duplicate_value (ETableMemoryStore *etms, + gint col, + gconstpointer val) { switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -65,7 +67,9 @@ duplicate_value (ETableMemoryStore *etms, gint col, gconstpointer val) } static void -free_value (ETableMemoryStore *etms, gint col, gpointer value) +free_value (ETableMemoryStore *etms, + gint col, + gpointer value) { switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -97,7 +101,9 @@ etms_column_count (ETableModel *etm) } static gpointer -etms_value_at (ETableModel *etm, gint col, gint row) +etms_value_at (ETableModel *etm, + gint col, + gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -105,7 +111,10 @@ etms_value_at (ETableModel *etm, gint col, gint row) } static void -etms_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etms_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -117,7 +126,9 @@ etms_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etms_is_cell_editable (ETableModel *etm, gint col, gint row) +etms_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -126,7 +137,9 @@ etms_is_cell_editable (ETableModel *etm, gint col, gint row) /* The default for etms_duplicate_value is to return the raw value. */ static gpointer -etms_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etms_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -134,7 +147,9 @@ etms_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etms_free_value (ETableModel *etm, gint col, gpointer value) +etms_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -142,7 +157,8 @@ etms_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etms_initialize_value (ETableModel *etm, gint col) +etms_initialize_value (ETableModel *etm, + gint col) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -163,7 +179,9 @@ etms_initialize_value (ETableModel *etm, gint col) } static gboolean -etms_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etms_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -184,7 +202,9 @@ etms_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etms_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etms_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -205,7 +225,9 @@ etms_value_to_string (ETableModel *etm, gint col, gconstpointer value) } static void -etms_append_row (ETableModel *etm, ETableModel *source, gint row) +etms_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); gpointer *new_data; @@ -310,7 +332,8 @@ e_table_memory_store_new (ETableMemoryStoreColumnInfo *columns) } ETableModel * -e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumnInfo *columns) +e_table_memory_store_construct (ETableMemoryStore *etms, + ETableMemoryStoreColumnInfo *columns) { gint i; for (i = 0; columns[i].type != E_TABLE_MEMORY_STORE_COLUMN_TYPE_TERMINATOR; i++) @@ -325,7 +348,10 @@ e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumn } void -e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, gint col, gint row, gpointer value) +e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, + gint col, + gint row, + gpointer value) { e_table_model_pre_change (E_TABLE_MODEL (etms)); @@ -336,7 +362,10 @@ e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, gint col, gint row /* The size of these arrays is the number of columns. */ void -e_table_memory_store_insert_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_insert_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint row_count; gint i; @@ -357,7 +386,10 @@ e_table_memory_store_insert_array (ETableMemoryStore *etms, gint row, gpointer * } void -e_table_memory_store_insert (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_insert (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -377,7 +409,10 @@ e_table_memory_store_insert (ETableMemoryStore *etms, gint row, gpointer data, . } void -e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint row_count; gint i; @@ -398,7 +433,10 @@ e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, gint row, gpoi } void -e_table_memory_store_insert_adopt (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_insert_adopt (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -429,7 +467,10 @@ e_table_memory_store_insert_adopt (ETableMemoryStore *etms, gint row, gpointer d * */ void -e_table_memory_store_change_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_change_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint i; @@ -456,7 +497,10 @@ e_table_memory_store_change_array (ETableMemoryStore *etms, gint row, gpointer * * pass in etms->col_count args. */ void -e_table_memory_store_change (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_change (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -490,7 +534,10 @@ e_table_memory_store_change (ETableMemoryStore *etms, gint row, gpointer data, . * duplicate the data. */ void -e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint i; @@ -515,7 +562,10 @@ e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, gint row, gpoi * must pass in etms->col_count args. */ void -e_table_memory_store_change_adopt (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_change_adopt (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -537,7 +587,8 @@ e_table_memory_store_change_adopt (ETableMemoryStore *etms, gint row, gpointer d } void -e_table_memory_store_remove (ETableMemoryStore *etms, gint row) +e_table_memory_store_remove (ETableMemoryStore *etms, + gint row) { ETableModel *model; gint column_count, row_count; diff --git a/widgets/table/e-table-memory.c b/widgets/table/e-table-memory.c index cc62a6d0b5..28f10264f8 100644 --- a/widgets/table/e-table-memory.c +++ b/widgets/table/e-table-memory.c @@ -113,7 +113,8 @@ e_table_memory_new (void) * Return value: **/ gpointer -e_table_memory_get_data (ETableMemory *etmm, gint row) +e_table_memory_get_data (ETableMemory *etmm, + gint row) { g_return_val_if_fail (row >= 0, NULL); g_return_val_if_fail (row < etmm->priv->num_rows, NULL); @@ -130,7 +131,9 @@ e_table_memory_get_data (ETableMemory *etmm, gint row) * **/ void -e_table_memory_set_data (ETableMemory *etmm, gint row, gpointer data) +e_table_memory_set_data (ETableMemory *etmm, + gint row, + gpointer data) { g_return_if_fail (row >= 0); g_return_if_fail (row < etmm->priv->num_rows); @@ -151,8 +154,8 @@ e_table_memory_set_data (ETableMemory *etmm, gint row, gpointer data) **/ void e_table_memory_insert (ETableMemory *etmm, - gint row, - gpointer data) + gint row, + gpointer data) { g_return_if_fail (row >= -1); g_return_if_fail (row <= etmm->priv->num_rows); @@ -185,7 +188,8 @@ e_table_memory_insert (ETableMemory *etmm, * Return value: **/ gpointer -e_table_memory_remove (ETableMemory *etmm, gint row) +e_table_memory_remove (ETableMemory *etmm, + gint row) { gpointer ret; diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c index 77b462ec2a..6f44379858 100644 --- a/widgets/table/e-table-model.c +++ b/widgets/table/e-table-model.c @@ -90,7 +90,9 @@ e_table_model_row_count (ETableModel *e_table_model) * */ void -e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, gint row) +e_table_model_append_row (ETableModel *e_table_model, + ETableModel *source, + gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -119,7 +121,9 @@ e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, gint * rows_inserted and no_change don't affect any data in this way. **/ gpointer -e_table_model_value_at (ETableModel *e_table_model, gint col, gint row) +e_table_model_value_at (ETableModel *e_table_model, + gint col, + gint row) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -143,7 +147,10 @@ e_table_model_value_at (ETableModel *e_table_model, gint col, gint row) * be a pointer to a set of data, or a datum that fits inside a gpointer . */ void -e_table_model_set_value_at (ETableModel *e_table_model, gint col, gint row, gconstpointer value) +e_table_model_set_value_at (ETableModel *e_table_model, + gint col, + gint row, + gconstpointer value) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -161,7 +168,9 @@ e_table_model_set_value_at (ETableModel *e_table_model, gint col, gint row, gcon * edited, %FALSE otherwise */ gboolean -e_table_model_is_cell_editable (ETableModel *e_table_model, gint col, gint row) +e_table_model_is_cell_editable (ETableModel *e_table_model, + gint col, + gint row) { g_return_val_if_fail (e_table_model != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE); @@ -170,7 +179,9 @@ e_table_model_is_cell_editable (ETableModel *e_table_model, gint col, gint row) } gpointer -e_table_model_duplicate_value (ETableModel *e_table_model, gint col, gconstpointer value) +e_table_model_duplicate_value (ETableModel *e_table_model, + gint col, + gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -182,7 +193,9 @@ e_table_model_duplicate_value (ETableModel *e_table_model, gint col, gconstpoint } void -e_table_model_free_value (ETableModel *e_table_model, gint col, gpointer value) +e_table_model_free_value (ETableModel *e_table_model, + gint col, + gpointer value) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -204,7 +217,8 @@ e_table_model_has_save_id (ETableModel *e_table_model) } gchar * -e_table_model_get_save_id (ETableModel *e_table_model, gint row) +e_table_model_get_save_id (ETableModel *e_table_model, + gint row) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -228,7 +242,8 @@ e_table_model_has_change_pending (ETableModel *e_table_model) } gpointer -e_table_model_initialize_value (ETableModel *e_table_model, gint col) +e_table_model_initialize_value (ETableModel *e_table_model, + gint col) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -240,7 +255,9 @@ e_table_model_initialize_value (ETableModel *e_table_model, gint col) } gboolean -e_table_model_value_is_empty (ETableModel *e_table_model, gint col, gconstpointer value) +e_table_model_value_is_empty (ETableModel *e_table_model, + gint col, + gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE); @@ -252,7 +269,9 @@ e_table_model_value_is_empty (ETableModel *e_table_model, gint col, gconstpointe } gchar * -e_table_model_value_to_string (ETableModel *e_table_model, gint col, gconstpointer value) +e_table_model_value_to_string (ETableModel *e_table_model, + gint col, + gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -462,7 +481,8 @@ e_table_model_changed (ETableModel *e_table_model) * object */ void -e_table_model_row_changed (ETableModel *e_table_model, gint row) +e_table_model_row_changed (ETableModel *e_table_model, + gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -490,7 +510,9 @@ e_table_model_row_changed (ETableModel *e_table_model, gint row) * object */ void -e_table_model_cell_changed (ETableModel *e_table_model, gint col, gint row) +e_table_model_cell_changed (ETableModel *e_table_model, + gint col, + gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -518,7 +540,9 @@ e_table_model_cell_changed (ETableModel *e_table_model, gint col, gint row) * @e_table_model object */ void -e_table_model_rows_inserted (ETableModel *e_table_model, gint row, gint count) +e_table_model_rows_inserted (ETableModel *e_table_model, + gint row, + gint count) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -544,7 +568,8 @@ e_table_model_rows_inserted (ETableModel *e_table_model, gint row, gint count) * the "model_rows_inserted" signal on the @e_table_model object */ void -e_table_model_row_inserted (ETableModel *e_table_model, gint row) +e_table_model_row_inserted (ETableModel *e_table_model, + gint row) { e_table_model_rows_inserted (e_table_model, row, 1); } @@ -561,7 +586,9 @@ e_table_model_row_inserted (ETableModel *e_table_model, gint row) * @e_table_model object */ void -e_table_model_rows_deleted (ETableModel *e_table_model, gint row, gint count) +e_table_model_rows_deleted (ETableModel *e_table_model, + gint row, + gint count) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -587,7 +614,8 @@ e_table_model_rows_deleted (ETableModel *e_table_model, gint row, gint count) * the "model_rows_deleted" signal on the @e_table_model object */ void -e_table_model_row_deleted (ETableModel *e_table_model, gint row) +e_table_model_row_deleted (ETableModel *e_table_model, + gint row) { e_table_model_rows_deleted (e_table_model, row, 1); } diff --git a/widgets/table/e-table-one.c b/widgets/table/e-table-one.c index 7683b935a4..ff38d94131 100644 --- a/widgets/table/e-table-one.c +++ b/widgets/table/e-table-one.c @@ -49,7 +49,9 @@ one_row_count (ETableModel *etm) } static gpointer -one_value_at (ETableModel *etm, gint col, gint row) +one_value_at (ETableModel *etm, + gint col, + gint row) { ETableOne *one = E_TABLE_ONE (etm); @@ -60,7 +62,10 @@ one_value_at (ETableModel *etm, gint col, gint row) } static void -one_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +one_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableOne *one = E_TABLE_ONE (etm); @@ -71,7 +76,9 @@ one_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -one_is_cell_editable (ETableModel *etm, gint col, gint row) +one_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableOne *one = E_TABLE_ONE (etm); @@ -83,7 +90,9 @@ one_is_cell_editable (ETableModel *etm, gint col, gint row) /* The default for one_duplicate_value is to return the raw value. */ static gpointer -one_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +one_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableOne *one = E_TABLE_ONE (etm); @@ -94,7 +103,9 @@ one_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -one_free_value (ETableModel *etm, gint col, gpointer value) +one_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableOne *one = E_TABLE_ONE (etm); @@ -103,7 +114,8 @@ one_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -one_initialize_value (ETableModel *etm, gint col) +one_initialize_value (ETableModel *etm, + gint col) { ETableOne *one = E_TABLE_ONE (etm); @@ -114,7 +126,9 @@ one_initialize_value (ETableModel *etm, gint col) } static gboolean -one_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +one_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableOne *one = E_TABLE_ONE (etm); @@ -125,7 +139,9 @@ one_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -one_value_to_string (ETableModel *etm, gint col, gconstpointer value) +one_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableOne *one = E_TABLE_ONE (etm); diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 955547fd7f..99f282c76f 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -32,8 +32,6 @@ #define d(x) -d (static gint depth = 0) - struct _ETableSearchPrivate { guint timeout_id; @@ -49,6 +47,8 @@ enum { LAST_SIGNAL }; +d (static gint depth = 0) + static guint e_table_search_signals[LAST_SIGNAL] = { 0, }; static gboolean @@ -174,7 +174,8 @@ e_table_search_new (void) * Returns: the number of columns in the table search. */ void -e_table_search_input_character (ETableSearch *ets, gunichar character) +e_table_search_input_character (ETableSearch *ets, + gunichar character) { gchar character_utf8[7]; gchar *temp_string; diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index b8f33c639e..0320663e8e 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -44,7 +44,8 @@ enum { }; static void -save_to_hash (gint model_row, gpointer closure) +save_to_hash (gint model_row, + gpointer closure) { ETableSelectionModel *etsm = closure; const gchar *key = e_table_model_get_save_id (etsm->model, model_row); @@ -65,7 +66,8 @@ free_hash (ETableSelectionModel *etsm) } static void -model_pre_change (ETableModel *etm, ETableSelectionModel *etsm) +model_pre_change (ETableModel *etm, + ETableSelectionModel *etsm) { free_hash (etsm); @@ -131,7 +133,8 @@ model_changed_idle (ETableSelectionModel *etsm) } static void -model_changed (ETableModel *etm, ETableSelectionModel *etsm) +model_changed (ETableModel *etm, + ETableSelectionModel *etsm) { e_selection_model_clear (E_SELECTION_MODEL (etsm)); if (!etsm->model_changed_idle_id && etm && e_table_model_has_save_id (etm)) { @@ -140,27 +143,38 @@ model_changed (ETableModel *etm, ETableSelectionModel *etsm) } static void -model_row_changed (ETableModel *etm, gint row, ETableSelectionModel *etsm) +model_row_changed (ETableModel *etm, + gint row, + ETableSelectionModel *etsm) { free_hash (etsm); } static void -model_cell_changed (ETableModel *etm, gint col, gint row, ETableSelectionModel *etsm) +model_cell_changed (ETableModel *etm, + gint col, + gint row, + ETableSelectionModel *etsm) { free_hash (etsm); } #if 1 static void -model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_inserted (ETableModel *etm, + gint row, + gint count, + ETableSelectionModel *etsm) { e_selection_model_array_insert_rows (E_SELECTION_MODEL_ARRAY (etsm), row, count); free_hash (etsm); } static void -model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_deleted (ETableModel *etm, + gint row, + gint count, + ETableSelectionModel *etsm) { e_selection_model_array_delete_rows (E_SELECTION_MODEL_ARRAY (etsm), row, count); free_hash (etsm); @@ -169,36 +183,49 @@ model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSelectionModel #else static void -model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_inserted (ETableModel *etm, + gint row, + gint count, + ETableSelectionModel *etsm) { model_changed (etm, etsm); } static void -model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_deleted (ETableModel *etm, + gint row, + gint count, + ETableSelectionModel *etsm) { model_changed (etm, etsm); } #endif inline static void -add_model (ETableSelectionModel *etsm, ETableModel *model) +add_model (ETableSelectionModel *etsm, + ETableModel *model) { etsm->model = model; if (model) { g_object_ref (model); - etsm->model_pre_change_id = g_signal_connect(G_OBJECT(model), "model_pre_change", - G_CALLBACK (model_pre_change), etsm); - etsm->model_changed_id = g_signal_connect(G_OBJECT(model), "model_changed", - G_CALLBACK (model_changed), etsm); - etsm->model_row_changed_id = g_signal_connect(G_OBJECT(model), "model_row_changed", - G_CALLBACK (model_row_changed), etsm); - etsm->model_cell_changed_id = g_signal_connect(G_OBJECT(model), "model_cell_changed", - G_CALLBACK (model_cell_changed), etsm); - etsm->model_rows_inserted_id = g_signal_connect(G_OBJECT(model), "model_rows_inserted", - G_CALLBACK (model_rows_inserted), etsm); - etsm->model_rows_deleted_id = g_signal_connect(G_OBJECT(model), "model_rows_deleted", - G_CALLBACK (model_rows_deleted), etsm); + etsm->model_pre_change_id = g_signal_connect ( + model, "model_pre_change", + G_CALLBACK (model_pre_change), etsm); + etsm->model_changed_id = g_signal_connect ( + model, "model_changed", + G_CALLBACK (model_changed), etsm); + etsm->model_row_changed_id = g_signal_connect ( + model, "model_row_changed", + G_CALLBACK (model_row_changed), etsm); + etsm->model_cell_changed_id = g_signal_connect ( + model, "model_cell_changed", + G_CALLBACK (model_cell_changed), etsm); + etsm->model_rows_inserted_id = g_signal_connect ( + model, "model_rows_inserted", + G_CALLBACK (model_rows_inserted), etsm); + etsm->model_rows_deleted_id = g_signal_connect ( + model, "model_rows_deleted", + G_CALLBACK (model_rows_deleted), etsm); } e_selection_model_array_confirm_row_count (E_SELECTION_MODEL_ARRAY (etsm)); } @@ -244,11 +271,14 @@ etsm_dispose (GObject *object) } static void -etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etsm_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: g_value_set_object (value, etsm->model); break; @@ -259,11 +289,14 @@ etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps } static void -etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +etsm_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: drop_model (etsm); add_model (etsm, g_value_get_object (value) ? E_TABLE_MODEL (g_value_get_object (value)) : NULL); diff --git a/widgets/table/e-table-selection-model.h b/widgets/table/e-table-selection-model.h index f144980f03..02309c047a 100644 --- a/widgets/table/e-table-selection-model.h +++ b/widgets/table/e-table-selection-model.h @@ -35,7 +35,7 @@ (G_TYPE_CHECK_INSTANCE_CAST \ ((obj), E_TYPE_TABLE_SELECTION_MODEL, ETableSelectionModel)) #define E_TABLE_SELECTION_MODEL_CLASS(cls) \ - (G_TYPE-CHECK_CLASS_CAST \ + (G_TYPE - CHECK_CLASS_CAST \ ((cls), E_TYPE_TABLE_SELECTION_MODEL, ETableSelectionModelClass)) #define E_IS_TABLE_SELECTION_MODEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE \ diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index b488dbce06..cac2586b8a 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -141,7 +141,7 @@ e_table_sort_info_group_info_changed (ETableSortInfo *info) * trigger any signals that might have been queued. */ void -e_table_sort_info_freeze (ETableSortInfo *info) +e_table_sort_info_freeze (ETableSortInfo *info) { info->frozen++; } @@ -158,7 +158,7 @@ e_table_sort_info_freeze (ETableSortInfo *info) * this object. */ void -e_table_sort_info_thaw (ETableSortInfo *info) +e_table_sort_info_thaw (ETableSortInfo *info) { info->frozen--; if (info->frozen != 0) @@ -190,7 +190,8 @@ e_table_sort_info_grouping_get_count (ETableSortInfo *info) } static void -e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, + gint length) { if (length < info->group_count) { info->group_count = length; @@ -210,7 +211,8 @@ e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, gint length) * criteria in the object. */ void -e_table_sort_info_grouping_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_grouping_truncate (ETableSortInfo *info, + gint length) { e_table_sort_info_grouping_real_truncate (info, length); e_table_sort_info_group_info_changed (info); @@ -224,7 +226,8 @@ e_table_sort_info_grouping_truncate (ETableSortInfo *info, gint length) * Returns: the description of the @n-th grouping criteria in the @info object. */ ETableSortColumn -e_table_sort_info_grouping_get_nth (ETableSortInfo *info, gint n) +e_table_sort_info_grouping_get_nth (ETableSortInfo *info, + gint n) { if (info->can_group && n < info->group_count) { return info->groupings[n]; @@ -244,7 +247,9 @@ e_table_sort_info_grouping_get_nth (ETableSortInfo *info, gint n) * whether it is ascending or descending). */ void -e_table_sort_info_grouping_set_nth (ETableSortInfo *info, gint n, ETableSortColumn column) +e_table_sort_info_grouping_set_nth (ETableSortInfo *info, + gint n, + ETableSortColumn column) { if (n >= info->group_count) { e_table_sort_info_grouping_real_truncate (info, n + 1); @@ -266,7 +271,8 @@ e_table_sort_info_sorting_get_count (ETableSortInfo *info) } static void -e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, + gint length) { if (length < info->sort_count) { info->sort_count = length; @@ -286,7 +292,8 @@ e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, gint length) * criteria in the object. */ void -e_table_sort_info_sorting_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_sorting_truncate (ETableSortInfo *info, + gint length) { e_table_sort_info_sorting_real_truncate (info, length); e_table_sort_info_sort_info_changed (info); @@ -300,7 +307,8 @@ e_table_sort_info_sorting_truncate (ETableSortInfo *info, gint length) * Returns: the description of the @n-th grouping criteria in the @info object. */ ETableSortColumn -e_table_sort_info_sorting_get_nth (ETableSortInfo *info, gint n) +e_table_sort_info_sorting_get_nth (ETableSortInfo *info, + gint n) { if (n < info->sort_count) { return info->sortings[n]; @@ -320,7 +328,9 @@ e_table_sort_info_sorting_get_nth (ETableSortInfo *info, gint n) * column number and whether it is ascending or descending). */ void -e_table_sort_info_sorting_set_nth (ETableSortInfo *info, gint n, ETableSortColumn column) +e_table_sort_info_sorting_set_nth (ETableSortInfo *info, + gint n, + ETableSortColumn column) { if (n >= info->sort_count) { e_table_sort_info_sorting_real_truncate (info, n + 1); @@ -356,8 +366,8 @@ e_table_sort_info_new (void) */ void e_table_sort_info_load_from_node (ETableSortInfo *info, - xmlNode *node, - gdouble state_version) + xmlNode *node, + gdouble state_version) { gint i; xmlNode *grouping; @@ -412,7 +422,7 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, */ xmlNode * e_table_sort_info_save_to_node (ETableSortInfo *info, - xmlNode *parent) + xmlNode *parent) { xmlNode *grouping; gint i; @@ -461,14 +471,14 @@ e_table_sort_info_duplicate (ETableSortInfo *info) } void -e_table_sort_info_set_can_group (ETableSortInfo *info, - gboolean can_group) +e_table_sort_info_set_can_group (ETableSortInfo *info, + gboolean can_group) { info->can_group = can_group; } gboolean -e_table_sort_info_get_can_group (ETableSortInfo *info) +e_table_sort_info_get_can_group (ETableSortInfo *info) { return info->can_group; } diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c index 0ed35c95a6..7792795477 100644 --- a/widgets/table/e-table-sorted-variable.c +++ b/widgets/table/e-table-sorted-variable.c @@ -122,8 +122,8 @@ etsv_insert_idle (ETableSortedVariable *etsv) } static void -etsv_add (ETableSubsetVariable *etssv, - gint row) +etsv_add (ETableSubsetVariable *etssv, + gint row) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -139,7 +139,7 @@ etsv_add (ETableSubsetVariable *etssv, i = etss->n_map; if (etsv->sort_idle_id == 0) { /* this is to see if we're inserting a lot of things between idle loops. - If we are, we're busy, its faster to just append and perform a full sort later */ + * If we are, we're busy, its faster to just append and perform a full sort later */ etsv->insert_count++; if (etsv->insert_count > ETSV_INSERT_MAX) { /* schedule a sort, and append instead */ @@ -160,7 +160,7 @@ etsv_add (ETableSubsetVariable *etssv, } static void -etsv_add_all (ETableSubsetVariable *etssv) +etsv_add_all (ETableSubsetVariable *etssv) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -187,7 +187,9 @@ etsv_add_all (ETableSubsetVariable *etssv) } ETableModel * -e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_table_sorted_variable_new (ETableModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETableSortedVariable *etsv = g_object_new (E_TYPE_TABLE_SORTED_VARIABLE, NULL); ETableSubsetVariable *etssv = E_TABLE_SUBSET_VARIABLE (etsv); @@ -202,14 +204,16 @@ e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETa etsv->full_header = full_header; g_object_ref (etsv->full_header); - etsv->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", - G_CALLBACK (etsv_sort_info_changed), etsv); + etsv->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (etsv_sort_info_changed), etsv); return E_TABLE_MODEL (etsv); } static void -etsv_sort_info_changed (ETableSortInfo *info, ETableSortedVariable *etsv) +etsv_sort_info_changed (ETableSortInfo *info, + ETableSortedVariable *etsv) { etsv_sort (etsv); } diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c index 61ea10c082..fe5f644dbf 100644 --- a/widgets/table/e-table-sorted.c +++ b/widgets/table/e-table-sorted.c @@ -125,7 +125,9 @@ ets_insert_idle (ETableSorted *ets) } ETableModel * -e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_table_sorted_new (ETableModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETableSorted *ets = g_object_new (E_TYPE_TABLE_SORTED, NULL); ETableSubset *etss = E_TABLE_SUBSET (ets); @@ -145,20 +147,23 @@ e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortIn ets_proxy_model_changed (etss, source); - ets->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", - G_CALLBACK (ets_sort_info_changed), ets); + ets->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); return E_TABLE_MODEL (ets); } static void -ets_sort_info_changed (ETableSortInfo *info, ETableSorted *ets) +ets_sort_info_changed (ETableSortInfo *info, + ETableSorted *ets) { ets_sort (ets); } static void -ets_proxy_model_changed (ETableSubset *subset, ETableModel *source) +ets_proxy_model_changed (ETableSubset *subset, + ETableModel *source) { gint rows, i; @@ -179,7 +184,9 @@ ets_proxy_model_changed (ETableSubset *subset, ETableModel *source) } static void -ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, gint row) +ets_proxy_model_row_changed (ETableSubset *subset, + ETableModel *source, + gint row) { if (!E_TABLE_SORTED (subset)->sort_idle_id) E_TABLE_SORTED (subset)->sort_idle_id = g_idle_add_full (50, (GSourceFunc) ets_sort_idle, subset, NULL); @@ -189,7 +196,10 @@ ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, gint row } static void -ets_proxy_model_cell_changed (ETableSubset *subset, ETableModel *source, gint col, gint row) +ets_proxy_model_cell_changed (ETableSubset *subset, + ETableModel *source, + gint col, + gint row) { ETableSorted *ets = E_TABLE_SORTED (subset); if (e_table_sorting_utils_affects_sort (ets->sort_info, ets->full_header, col)) @@ -199,7 +209,10 @@ ets_proxy_model_cell_changed (ETableSubset *subset, ETableModel *source, gint co } static void -ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row, gint count) +ets_proxy_model_rows_inserted (ETableSubset *etss, + ETableModel *source, + gint row, + gint count) { ETableModel *etm = E_TABLE_MODEL (etss); ETableSorted *ets = E_TABLE_SORTED (etss); @@ -228,7 +241,7 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row i = etss->n_map; if (ets->sort_idle_id == 0) { /* this is to see if we're inserting a lot of things between idle loops. - If we are, we're busy, its faster to just append and perform a full sort later */ + * If we are, we're busy, its faster to just append and perform a full sort later */ ets->insert_count++; if (ets->insert_count > ETS_INSERT_MAX) { /* schedule a sort, and append instead */ @@ -259,7 +272,10 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row } static void -ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, gint row, gint count) +ets_proxy_model_rows_deleted (ETableSubset *etss, + ETableModel *source, + gint row, + gint count) { ETableModel *etm = E_TABLE_MODEL (etss); gint i; diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index d74dbd3d04..418ce3a5e8 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -115,11 +115,14 @@ ets_dispose (GObject *object) } static void -ets_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +ets_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableSorter *ets = E_TABLE_SORTER (object); - switch (prop_id) { + switch (property_id) { case PROP_SORT_INFO: if (ets->sort_info) { if (ets->sort_info_changed_id) @@ -144,10 +147,13 @@ ets_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe } static void -ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +ets_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableSorter *ets = E_TABLE_SORTER (object); - switch (prop_id) { + switch (property_id) { case PROP_SORT_INFO: g_value_set_object (value, ets->sort_info); break; @@ -197,7 +203,9 @@ ets_init (ETableSorter *ets) } ETableSorter * -e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_table_sorter_new (ETableModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETableSorter *ets = g_object_new (E_TYPE_TABLE_SORTER, NULL); @@ -227,37 +235,50 @@ e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortIn } static void -ets_model_changed (ETableModel *etm, ETableSorter *ets) +ets_model_changed (ETableModel *etm, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_row_changed (ETableModel *etm, gint row, ETableSorter *ets) +ets_model_row_changed (ETableModel *etm, + gint row, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_cell_changed (ETableModel *etm, gint col, gint row, ETableSorter *ets) +ets_model_cell_changed (ETableModel *etm, + gint col, + gint row, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSorter *ets) +ets_model_rows_inserted (ETableModel *etm, + gint row, + gint count, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSorter *ets) +ets_model_rows_deleted (ETableModel *etm, + gint row, + gint count, + ETableSorter *ets) { ets_clean (ets); } static void -ets_sort_info_changed (ETableSortInfo *info, ETableSorter *ets) +ets_sort_info_changed (ETableSortInfo *info, + ETableSorter *ets) { d(g_print ("sort info changed\n")); ets_clean (ets); @@ -275,7 +296,9 @@ struct qsort_data { /* FIXME: Make it not cache the second and later columns (as if anyone cares.) */ static gint -qsort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) +qsort_callback (gconstpointer data1, + gconstpointer data2, + gpointer user_data) { struct qsort_data *qd = (struct qsort_data *) user_data; gint row1 = *(gint *) data1; @@ -390,7 +413,8 @@ ets_backsort (ETableSorter *ets) } static gint -ets_model_to_sorted (ESorter *es, gint row) +ets_model_to_sorted (ESorter *es, + gint row) { ETableSorter *ets = E_TABLE_SORTER (es); gint rows = e_table_model_row_count (ets->source); @@ -408,7 +432,8 @@ ets_model_to_sorted (ESorter *es, gint row) } static gint -ets_sorted_to_model (ESorter *es, gint row) +ets_sorted_to_model (ESorter *es, + gint row) { ETableSorter *ets = E_TABLE_SORTER (es); gint rows = e_table_model_row_count (ets->source); @@ -426,7 +451,9 @@ ets_sorted_to_model (ESorter *es, gint row) } static void -ets_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) +ets_get_model_to_sorted_array (ESorter *es, + gint **array, + gint *count) { ETableSorter *ets = E_TABLE_SORTER (es); if (array || count) { @@ -440,7 +467,9 @@ ets_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) } static void -ets_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) +ets_get_sorted_to_model_array (ESorter *es, + gint **array, + gint *count) { ETableSorter *ets = E_TABLE_SORTER (es); if (array || count) { diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c index e654f94b9c..a94c45f7b0 100644 --- a/widgets/table/e-table-sorting-utils.c +++ b/widgets/table/e-table-sorting-utils.c @@ -35,7 +35,12 @@ /* This takes source rows. */ static gint -etsu_compare (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint row1, gint row2, gpointer cmp_cache) +etsu_compare (ETableModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + gint row1, + gint row2, + gpointer cmp_cache) { gint j; gint sort_count = e_table_sort_info_sorting_get_count (sort_info); @@ -84,7 +89,9 @@ typedef struct { /* FIXME: Make it not cache the second and later columns (as if anyone cares.) */ static gint -e_sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) +e_sort_callback (gconstpointer data1, + gconstpointer data2, + gpointer user_data) { gint row1 = *(gint *) data1; gint row2 = *(gint *) data2; @@ -111,7 +118,11 @@ e_sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) } void -e_table_sorting_utils_sort (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows) +e_table_sorting_utils_sort (ETableModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + gint *map_table, + gint rows) { gint total_rows; gint i; @@ -158,9 +169,9 @@ e_table_sorting_utils_sort (ETableModel *source, ETableSortInfo *sort_info, ETab } gboolean -e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, - ETableHeader *full_header, - gint col) +e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, + ETableHeader *full_header, + gint col) { gint j; gint cols; @@ -186,7 +197,12 @@ e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, /* FIXME: This could be done in time log n instead of time n with a binary search. */ gint -e_table_sorting_utils_insert (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows, gint row) +e_table_sorting_utils_insert (ETableModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + gint *map_table, + gint rows, + gint row) { gint i; gpointer cmp_cache = e_table_sorting_utils_create_cmp_cache (); @@ -203,7 +219,12 @@ e_table_sorting_utils_insert (ETableModel *source, ETableSortInfo *sort_info, ET /* FIXME: This could be done in time log n instead of time n with a binary search. */ gint -e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows, gint view_row) +e_table_sorting_utils_check_position (ETableModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + gint *map_table, + gint rows, + gint view_row) { gint i; gint row; @@ -231,7 +252,12 @@ e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_ /* This takes source rows. */ static gint -etsu_tree_compare (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath path1, ETreePath path2, gpointer cmp_cache) +etsu_tree_compare (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + ETreePath path1, + ETreePath path2, + gpointer cmp_cache) { gint j; gint sort_count = e_table_sort_info_sorting_get_count (sort_info); @@ -257,7 +283,9 @@ etsu_tree_compare (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader * } static gint -e_sort_tree_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) +e_sort_tree_callback (gconstpointer data1, + gconstpointer data2, + gpointer user_data) { ETreePath *path1 = *(ETreePath *) data1; ETreePath *path2 = *(ETreePath *) data2; @@ -267,7 +295,11 @@ e_sort_tree_callback (gconstpointer data1, gconstpointer data2, gpointer user_da } void -e_table_sorting_utils_tree_sort (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count) +e_table_sorting_utils_tree_sort (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + ETreePath *map_table, + gint count) { ETableSortClosure closure; gint cols; @@ -331,7 +363,12 @@ e_table_sorting_utils_tree_sort (ETreeModel *source, ETableSortInfo *sort_info, /* FIXME: This could be done in time log n instead of time n with a binary search. */ gint -e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count, gint old_index) +e_table_sorting_utils_tree_check_position (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + ETreePath *map_table, + gint count, + gint old_index) { gint i; ETreePath path; @@ -357,7 +394,12 @@ e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *s /* FIXME: This does not pay attention to making sure that it's a stable insert. This needs to be fixed. */ gint -e_table_sorting_utils_tree_insert (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count, ETreePath path) +e_table_sorting_utils_tree_insert (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + ETreePath *map_table, + gint count, + ETreePath path) { gsize start; gsize end; @@ -418,7 +460,9 @@ e_table_sorting_utils_free_cmp_cache (gpointer cmp_cache) * Note: Given @value will be stolen and later freed with g_free. **/ void -e_table_sorting_utils_add_to_cmp_cache (gpointer cmp_cache, const gchar *key, gchar *value) +e_table_sorting_utils_add_to_cmp_cache (gpointer cmp_cache, + const gchar *key, + gchar *value) { g_return_if_fail (cmp_cache != NULL); g_return_if_fail (key != NULL); @@ -436,7 +480,8 @@ e_table_sorting_utils_add_to_cmp_cache (gpointer cmp_cache, const gchar *key, gc * with a key. **/ const gchar * -e_table_sorting_utils_lookup_cmp_cache (gpointer cmp_cache, const gchar *key) +e_table_sorting_utils_lookup_cmp_cache (gpointer cmp_cache, + const gchar *key) { g_return_val_if_fail (key != NULL, NULL); diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index 76c268ad11..03f0e4503b 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -129,7 +129,7 @@ e_table_specification_new (void) */ gboolean e_table_specification_load_from_file (ETableSpecification *specification, - const gchar *filename) + const gchar *filename) { xmlDoc *doc; @@ -156,7 +156,7 @@ e_table_specification_load_from_file (ETableSpecification *specification, */ gboolean e_table_specification_load_from_string (ETableSpecification *specification, - const gchar *xml) + const gchar *xml) { xmlDoc *doc; doc = xmlParseMemory ( (gchar *) xml, strlen (xml)); @@ -180,7 +180,7 @@ e_table_specification_load_from_string (ETableSpecification *specification, */ void e_table_specification_load_from_node (ETableSpecification *specification, - const xmlNode *node) + const xmlNode *node) { gchar *temp; xmlNode *children; @@ -285,7 +285,7 @@ e_table_specification_load_from_node (ETableSpecification *specification, */ gint e_table_specification_save_to_file (ETableSpecification *specification, - const gchar *filename) + const gchar *filename) { xmlDoc *doc; gint ret; @@ -349,7 +349,7 @@ e_table_specification_save_to_string (ETableSpecification *specification) */ xmlNode * e_table_specification_save_to_node (ETableSpecification *specification, - xmlDoc *doc) + xmlDoc *doc) { xmlNode *node; const gchar *s; diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c index 0bb311b8c4..785c807442 100644 --- a/widgets/table/e-table-state.c +++ b/widgets/table/e-table-state.c @@ -116,8 +116,8 @@ e_table_state_vanilla (gint col_count) } gboolean -e_table_state_load_from_file (ETableState *state, - const gchar *filename) +e_table_state_load_from_file (ETableState *state, + const gchar *filename) { xmlDoc *doc; @@ -135,8 +135,8 @@ e_table_state_load_from_file (ETableState *state, } void -e_table_state_load_from_string (ETableState *state, - const gchar *xml) +e_table_state_load_from_string (ETableState *state, + const gchar *xml) { xmlDoc *doc; @@ -158,7 +158,7 @@ typedef struct { void e_table_state_load_from_node (ETableState *state, - const xmlNode *node) + const xmlNode *node) { xmlNode *children; GList *list = NULL, *iterator; @@ -215,8 +215,8 @@ e_table_state_load_from_node (ETableState *state, } void -e_table_state_save_to_file (ETableState *state, - const gchar *filename) +e_table_state_save_to_file (ETableState *state, + const gchar *filename) { xmlDoc *doc; @@ -231,7 +231,7 @@ e_table_state_save_to_file (ETableState *state, } gchar * -e_table_state_save_to_string (ETableState *state) +e_table_state_save_to_string (ETableState *state) { gchar *ret_val; xmlChar *string; @@ -251,8 +251,8 @@ e_table_state_save_to_string (ETableState *state) } xmlNode * -e_table_state_save_to_node (ETableState *state, - xmlNode *parent) +e_table_state_save_to_node (ETableState *state, + xmlNode *parent) { gint i; xmlNode *node; diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index 99fed4ba02..a40859b492 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -40,8 +40,8 @@ G_DEFINE_TYPE (ETableSubsetVariable, etssv, E_TYPE_TABLE_SUBSET) #define INCREMENT_AMOUNT 10 static void -etssv_add (ETableSubsetVariable *etssv, - gint row) +etssv_add (ETableSubsetVariable *etssv, + gint row) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -62,8 +62,8 @@ etssv_add (ETableSubsetVariable *etssv, static void etssv_add_array (ETableSubsetVariable *etssv, - const gint *array, - gint count) + const gint *array, + gint count) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -84,7 +84,7 @@ etssv_add_array (ETableSubsetVariable *etssv, } static void -etssv_add_all (ETableSubsetVariable *etssv) +etssv_add_all (ETableSubsetVariable *etssv) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -107,8 +107,8 @@ etssv_add_all (ETableSubsetVariable *etssv) } static gboolean -etssv_remove (ETableSubsetVariable *etssv, - gint row) +etssv_remove (ETableSubsetVariable *etssv, + gint row) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -147,7 +147,7 @@ etssv_init (ETableSubsetVariable *etssv) ETableModel * e_table_subset_variable_construct (ETableSubsetVariable *etssv, - ETableModel *source) + ETableModel *source) { if (e_table_subset_construct (E_TABLE_SUBSET (etssv), source, 1) == NULL) return NULL; @@ -170,8 +170,8 @@ e_table_subset_variable_new (ETableModel *source) } void -e_table_subset_variable_add (ETableSubsetVariable *etssv, - gint row) +e_table_subset_variable_add (ETableSubsetVariable *etssv, + gint row) { g_return_if_fail (etssv != NULL); g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); @@ -181,9 +181,9 @@ e_table_subset_variable_add (ETableSubsetVariable *etssv, } void -e_table_subset_variable_add_array (ETableSubsetVariable *etssv, - const gint *array, - gint count) +e_table_subset_variable_add_array (ETableSubsetVariable *etssv, + const gint *array, + gint count) { g_return_if_fail (etssv != NULL); g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); @@ -193,7 +193,7 @@ e_table_subset_variable_add_array (ETableSubsetVariable *etssv, } void -e_table_subset_variable_add_all (ETableSubsetVariable *etssv) +e_table_subset_variable_add_all (ETableSubsetVariable *etssv) { g_return_if_fail (etssv != NULL); g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); @@ -203,8 +203,8 @@ e_table_subset_variable_add_all (ETableSubsetVariable *etssv) } gboolean -e_table_subset_variable_remove (ETableSubsetVariable *etssv, - gint row) +e_table_subset_variable_remove (ETableSubsetVariable *etssv, + gint row) { g_return_val_if_fail (etssv != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv), FALSE); @@ -224,7 +224,7 @@ e_table_subset_variable_clear (ETableSubsetVariable *etssv) e_table_model_pre_change (etm); etss->n_map = 0; g_free (etss->map_table); - etss->map_table = (gint *) g_new (unsigned int, 1); + etss->map_table = (gint *) g_new (guint, 1); etssv->n_vals_allocated = 1; e_table_model_changed (etm); @@ -232,8 +232,8 @@ e_table_subset_variable_clear (ETableSubsetVariable *etssv) void e_table_subset_variable_increment (ETableSubsetVariable *etssv, - gint position, - gint amount) + gint position, + gint amount) { gint i; ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -245,8 +245,8 @@ e_table_subset_variable_increment (ETableSubsetVariable *etssv, void e_table_subset_variable_decrement (ETableSubsetVariable *etssv, - gint position, - gint amount) + gint position, + gint amount) { gint i; ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -258,7 +258,7 @@ e_table_subset_variable_decrement (ETableSubsetVariable *etssv, void e_table_subset_variable_set_allocation (ETableSubsetVariable *etssv, - gint total) + gint total) { ETableSubset *etss = E_TABLE_SUBSET (etssv); if (total <= 0) diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index 03871771f6..9a26020296 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -52,7 +52,8 @@ G_DEFINE_TYPE (ETableSubset, etss, E_TYPE_TABLE_MODEL) #define MAP_ROW(etss, row) (row == -1 ? -1 : etss->map_table[row]) static gint -etss_get_view_row (ETableSubset *etss, gint row) +etss_get_view_row (ETableSubset *etss, + gint row) { const gint n = etss->n_map; const gint * const map_table = etss->map_table; @@ -150,7 +151,9 @@ etss_row_count (ETableModel *etm) } static gpointer -etss_value_at (ETableModel *etm, gint col, gint row) +etss_value_at (ETableModel *etm, + gint col, + gint row) { ETableSubset *etss = (ETableSubset *) etm; @@ -162,7 +165,10 @@ etss_value_at (ETableModel *etm, gint col, gint row) } static void -etss_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etss_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableSubset *etss = (ETableSubset *) etm; @@ -174,7 +180,9 @@ etss_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etss_is_cell_editable (ETableModel *etm, gint col, gint row) +etss_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableSubset *etss = (ETableSubset *) etm; @@ -190,7 +198,8 @@ etss_has_save_id (ETableModel *etm) } static gchar * -etss_get_save_id (ETableModel *etm, gint row) +etss_get_save_id (ETableModel *etm, + gint row) { ETableSubset *etss = (ETableSubset *) etm; @@ -203,14 +212,18 @@ etss_get_save_id (ETableModel *etm, gint row) } static void -etss_append_row (ETableModel *etm, ETableModel *source, gint row) +etss_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ETableSubset *etss = (ETableSubset *) etm; e_table_model_append_row (etss->source, source, row); } static gpointer -etss_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etss_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -218,7 +231,9 @@ etss_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etss_free_value (ETableModel *etm, gint col, gpointer value) +etss_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -226,7 +241,8 @@ etss_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etss_initialize_value (ETableModel *etm, gint col) +etss_initialize_value (ETableModel *etm, + gint col) { ETableSubset *etss = (ETableSubset *) etm; @@ -234,7 +250,9 @@ etss_initialize_value (ETableModel *etm, gint col) } static gboolean -etss_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etss_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -242,7 +260,9 @@ etss_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etss_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etss_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -291,25 +311,30 @@ etss_init (ETableSubset *etss) } static void -etss_proxy_model_pre_change_real (ETableSubset *etss, ETableModel *etm) +etss_proxy_model_pre_change_real (ETableSubset *etss, + ETableModel *etm) { e_table_model_pre_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_no_change_real (ETableSubset *etss, ETableModel *etm) +etss_proxy_model_no_change_real (ETableSubset *etss, + ETableModel *etm) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_changed_real (ETableSubset *etss, ETableModel *etm) +etss_proxy_model_changed_real (ETableSubset *etss, + ETableModel *etm) { e_table_model_changed (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, gint row) +etss_proxy_model_row_changed_real (ETableSubset *etss, + ETableModel *etm, + gint row) { gint view_row = etss_get_view_row (etss, row); if (view_row != -1) @@ -319,7 +344,10 @@ etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, gint ro } static void -etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, gint col, gint row) +etss_proxy_model_cell_changed_real (ETableSubset *etss, + ETableModel *etm, + gint col, + gint row) { gint view_row = etss_get_view_row (etss, row); if (view_row != -1) @@ -329,68 +357,90 @@ etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, gint c } static void -etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count) +etss_proxy_model_rows_inserted_real (ETableSubset *etss, + ETableModel *etm, + gint row, + gint count) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count) +etss_proxy_model_rows_deleted_real (ETableSubset *etss, + ETableModel *etm, + gint row, + gint count) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_pre_change (ETableModel *etm, ETableSubset *etss) +etss_proxy_model_pre_change (ETableModel *etm, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_pre_change) (ETSS_CLASS (etss)->proxy_model_pre_change) (etss, etm); } static void -etss_proxy_model_no_change (ETableModel *etm, ETableSubset *etss) +etss_proxy_model_no_change (ETableModel *etm, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_no_change) (ETSS_CLASS (etss)->proxy_model_no_change) (etss, etm); } static void -etss_proxy_model_changed (ETableModel *etm, ETableSubset *etss) +etss_proxy_model_changed (ETableModel *etm, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_changed) (ETSS_CLASS (etss)->proxy_model_changed) (etss, etm); } static void -etss_proxy_model_row_changed (ETableModel *etm, gint row, ETableSubset *etss) +etss_proxy_model_row_changed (ETableModel *etm, + gint row, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_row_changed) (ETSS_CLASS (etss)->proxy_model_row_changed) (etss, etm, row); } static void -etss_proxy_model_cell_changed (ETableModel *etm, gint col, gint row, ETableSubset *etss) +etss_proxy_model_cell_changed (ETableModel *etm, + gint col, + gint row, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_cell_changed) (ETSS_CLASS (etss)->proxy_model_cell_changed) (etss, etm, col, row); } static void -etss_proxy_model_rows_inserted (ETableModel *etm, gint row, gint col, ETableSubset *etss) +etss_proxy_model_rows_inserted (ETableModel *etm, + gint row, + gint col, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_rows_inserted) (ETSS_CLASS (etss)->proxy_model_rows_inserted) (etss, etm, row, col); } static void -etss_proxy_model_rows_deleted (ETableModel *etm, gint row, gint col, ETableSubset *etss) +etss_proxy_model_rows_deleted (ETableModel *etm, + gint row, + gint col, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_rows_deleted) (ETSS_CLASS (etss)->proxy_model_rows_deleted) (etss, etm, row, col); } ETableModel * -e_table_subset_construct (ETableSubset *etss, ETableModel *source, gint nvals) +e_table_subset_construct (ETableSubset *etss, + ETableModel *source, + gint nvals) { guint *buffer; gint i; @@ -410,26 +460,34 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, gint nvals) for (i = 0; i < nvals; i++) etss->map_table[i] = i; - etss->table_model_pre_change_id = g_signal_connect (G_OBJECT (source), "model_pre_change", - G_CALLBACK (etss_proxy_model_pre_change), etss); - etss->table_model_no_change_id = g_signal_connect (G_OBJECT (source), "model_no_change", - G_CALLBACK (etss_proxy_model_no_change), etss); - etss->table_model_changed_id = g_signal_connect (G_OBJECT (source), "model_changed", - G_CALLBACK (etss_proxy_model_changed), etss); - etss->table_model_row_changed_id = g_signal_connect (G_OBJECT (source), "model_row_changed", - G_CALLBACK (etss_proxy_model_row_changed), etss); - etss->table_model_cell_changed_id = g_signal_connect (G_OBJECT (source), "model_cell_changed", - G_CALLBACK (etss_proxy_model_cell_changed), etss); - etss->table_model_rows_inserted_id = g_signal_connect (G_OBJECT (source), "model_rows_inserted", - G_CALLBACK (etss_proxy_model_rows_inserted), etss); - etss->table_model_rows_deleted_id = g_signal_connect (G_OBJECT (source), "model_rows_deleted", - G_CALLBACK (etss_proxy_model_rows_deleted), etss); + etss->table_model_pre_change_id = g_signal_connect ( + source, "model_pre_change", + G_CALLBACK (etss_proxy_model_pre_change), etss); + etss->table_model_no_change_id = g_signal_connect ( + source, "model_no_change", + G_CALLBACK (etss_proxy_model_no_change), etss); + etss->table_model_changed_id = g_signal_connect ( + source, "model_changed", + G_CALLBACK (etss_proxy_model_changed), etss); + etss->table_model_row_changed_id = g_signal_connect ( + source, "model_row_changed", + G_CALLBACK (etss_proxy_model_row_changed), etss); + etss->table_model_cell_changed_id = g_signal_connect ( + source, "model_cell_changed", + G_CALLBACK (etss_proxy_model_cell_changed), etss); + etss->table_model_rows_inserted_id = g_signal_connect ( + source, "model_rows_inserted", + G_CALLBACK (etss_proxy_model_rows_inserted), etss); + etss->table_model_rows_deleted_id = g_signal_connect ( + source, "model_rows_deleted", + G_CALLBACK (etss_proxy_model_rows_deleted), etss); return E_TABLE_MODEL (etss); } ETableModel * -e_table_subset_new (ETableModel *source, const gint nvals) +e_table_subset_new (ETableModel *source, + const gint nvals) { ETableSubset *etss = g_object_new (E_TYPE_TABLE_SUBSET, NULL); @@ -442,8 +500,8 @@ e_table_subset_new (ETableModel *source, const gint nvals) } gint -e_table_subset_model_to_view_row (ETableSubset *ets, - gint model_row) +e_table_subset_model_to_view_row (ETableSubset *ets, + gint model_row) { gint i; for (i = 0; i < ets->n_map; i++) { @@ -454,8 +512,8 @@ e_table_subset_model_to_view_row (ETableSubset *ets, } gint -e_table_subset_view_to_model_row (ETableSubset *ets, - gint view_row) +e_table_subset_view_to_model_row (ETableSubset *ets, + gint view_row) { if (view_row >= 0 && view_row < ets->n_map) return ets->map_table[view_row]; @@ -476,7 +534,7 @@ e_table_subset_get_toplevel (ETableSubset *table) } void -e_table_subset_print_debugging (ETableSubset *table_model) +e_table_subset_print_debugging (ETableSubset *table_model) { gint i; for (i = 0; i < table_model->n_map; i++) { diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c index d84b244fdf..007803585e 100644 --- a/widgets/table/e-table-utils.c +++ b/widgets/table/e-table-utils.c @@ -81,8 +81,8 @@ e_table_state_to_header (GtkWidget *widget, static ETableCol * et_col_spec_to_col (ETableColumnSpecification *col_spec, - ETableExtras *ete, - const gchar *domain) + ETableExtras *ete, + const gchar *domain) { ETableCol *col = NULL; ECell *cell = NULL; @@ -146,7 +146,7 @@ et_col_spec_to_col (ETableColumnSpecification *col_spec, ETableHeader * e_table_spec_to_full_header (ETableSpecification *spec, - ETableExtras *ete) + ETableExtras *ete) { ETableHeader *nh; gint column; @@ -170,7 +170,8 @@ e_table_spec_to_full_header (ETableSpecification *spec, } static gboolean -check_col (ETableCol *col, gpointer user_data) +check_col (ETableCol *col, + gpointer user_data) { return col->search ? TRUE : FALSE; } diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index 59d254c862..785feb456b 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -53,7 +53,8 @@ struct _ETableWithoutPrivate { }; static gboolean -check (ETableWithout *etw, gint model_row) +check (ETableWithout *etw, + gint model_row) { gboolean ret_val; gpointer key; @@ -70,7 +71,9 @@ check (ETableWithout *etw, gint model_row) } static gboolean -check_with_key (ETableWithout *etw, gpointer key, gint model_row) +check_with_key (ETableWithout *etw, + gpointer key, + gint model_row) { gboolean ret_val; gpointer key2; @@ -90,14 +93,16 @@ check_with_key (ETableWithout *etw, gpointer key, gint model_row) } static gint -etw_view_to_model_row (ETableWithout *etw, gint view_row) +etw_view_to_model_row (ETableWithout *etw, + gint view_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); return etss->map_table[view_row]; } static void -add_row (ETableWithout *etw, gint model_row) +add_row (ETableWithout *etw, + gint model_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -111,7 +116,8 @@ add_row (ETableWithout *etw, gint model_row) } static void -remove_row (ETableWithout *etw, gint view_row) +remove_row (ETableWithout *etw, + gint view_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -126,8 +132,8 @@ remove_row (ETableWithout *etw, gint view_row) static void delete_hash_element (gpointer key, - gpointer value, - gpointer closure) + gpointer value, + gpointer closure) { ETableWithout *etw = closure; if (etw->priv->free_duplicated_key_func) @@ -209,7 +215,8 @@ etw_proxy_model_rows_deleted (ETableSubset *etss, } static void -etw_proxy_model_changed (ETableSubset *etss, ETableModel *etm) +etw_proxy_model_changed (ETableSubset *etss, + ETableModel *etm) { gint i; /* Model row */ gint j; /* View row */ @@ -256,15 +263,15 @@ etw_init (ETableWithout *etw) } ETableModel * -e_table_without_construct (ETableWithout *etw, - ETableModel *source, - GHashFunc hash_func, - GCompareFunc compare_func, - ETableWithoutGetKeyFunc get_key_func, - ETableWithoutDuplicateKeyFunc duplicate_key_func, - ETableWithoutFreeKeyFunc free_gotten_key_func, - ETableWithoutFreeKeyFunc free_duplicated_key_func, - void *closure) +e_table_without_construct (ETableWithout *etw, + ETableModel *source, + GHashFunc hash_func, + GCompareFunc compare_func, + ETableWithoutGetKeyFunc get_key_func, + ETableWithoutDuplicateKeyFunc duplicate_key_func, + ETableWithoutFreeKeyFunc free_gotten_key_func, + ETableWithoutFreeKeyFunc free_duplicated_key_func, + gpointer closure) { if (e_table_subset_construct (E_TABLE_SUBSET (etw), source, 1) == NULL) return NULL; @@ -284,14 +291,14 @@ e_table_without_construct (ETableWithout *etw, } ETableModel * -e_table_without_new (ETableModel *source, - GHashFunc hash_func, - GCompareFunc compare_func, - ETableWithoutGetKeyFunc get_key_func, - ETableWithoutDuplicateKeyFunc duplicate_key_func, - ETableWithoutFreeKeyFunc free_gotten_key_func, - ETableWithoutFreeKeyFunc free_duplicated_key_func, - void *closure) +e_table_without_new (ETableModel *source, + GHashFunc hash_func, + GCompareFunc compare_func, + ETableWithoutGetKeyFunc get_key_func, + ETableWithoutDuplicateKeyFunc duplicate_key_func, + ETableWithoutFreeKeyFunc free_gotten_key_func, + ETableWithoutFreeKeyFunc free_duplicated_key_func, + gpointer closure) { ETableWithout *etw = g_object_new (E_TYPE_TABLE_WITHOUT, NULL); @@ -312,8 +319,9 @@ e_table_without_new (ETableModel *source, return (ETableModel *) etw; } -void e_table_without_hide (ETableWithout *etw, - void *key) +void +e_table_without_hide (ETableWithout *etw, + gpointer key) { gint i; /* View row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -331,8 +339,9 @@ void e_table_without_hide (ETableWithout *etw, } /* An adopted key will later be freed using the free_duplicated_key function. */ -void e_table_without_hide_adopt (ETableWithout *etw, - void *key) +void +e_table_without_hide_adopt (ETableWithout *etw, + gpointer key) { gint i; /* View row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -347,8 +356,8 @@ void e_table_without_hide_adopt (ETableWithout *etw, } void -e_table_without_show (ETableWithout *etw, - void *key) +e_table_without_show (ETableWithout *etw, + gpointer key) { gint i; /* Model row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -372,7 +381,7 @@ e_table_without_show (ETableWithout *etw, } void -e_table_without_show_all (ETableWithout *etw) +e_table_without_show_all (ETableWithout *etw) { gint i; /* Model row */ gint row_count; diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index f755cbc451..472681796f 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -232,7 +232,9 @@ current_search_col (ETable *et) } static void -et_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) +et_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural) { ETable *et = E_TABLE (widget); @@ -246,7 +248,9 @@ et_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) } static void -et_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) +et_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural) { GTK_WIDGET_CLASS (e_table_parent_class)-> get_preferred_height (widget, minimum, natural); @@ -262,7 +266,8 @@ set_header_width (ETable *et) } static void -structure_changed (ETableHeader *header, ETable *et) +structure_changed (ETableHeader *header, + ETable *et) { e_table_state_change (et); set_header_width (et); @@ -270,14 +275,17 @@ structure_changed (ETableHeader *header, ETable *et) } static void -expansion_changed (ETableHeader *header, ETable *et) +expansion_changed (ETableHeader *header, + ETable *et) { e_table_state_change (et); set_header_width (et); } static void -dimension_changed (ETableHeader *header, gint total_width, ETable *et) +dimension_changed (ETableHeader *header, + gint total_width, + ETable *et) { set_header_width (et); } @@ -303,7 +311,8 @@ disconnect_header (ETable *e_table) } static void -connect_header (ETable *e_table, ETableState *state) +connect_header (ETable *e_table, + ETableState *state) { if (e_table->header != NULL) disconnect_header (e_table); @@ -311,15 +320,15 @@ connect_header (ETable *e_table, ETableState *state) e_table->header = e_table_state_to_header ( GTK_WIDGET (e_table), e_table->full_header, state); - e_table->structure_change_id = - g_signal_connect (G_OBJECT (e_table->header), "structure_change", - G_CALLBACK (structure_changed), e_table); - e_table->expansion_change_id = - g_signal_connect (G_OBJECT (e_table->header), "expansion_change", - G_CALLBACK (expansion_changed), e_table); - e_table->dimension_change_id = - g_signal_connect (G_OBJECT (e_table->header), "dimension_change", - G_CALLBACK (dimension_changed), e_table); + e_table->structure_change_id = g_signal_connect ( + e_table->header, "structure_change", + G_CALLBACK (structure_changed), e_table); + e_table->expansion_change_id = g_signal_connect ( + e_table->header, "expansion_change", + G_CALLBACK (expansion_changed), e_table); + e_table->dimension_change_id = g_signal_connect ( + e_table->header, "dimension_change", + G_CALLBACK (dimension_changed), e_table); } static void @@ -499,7 +508,8 @@ et_search_search (ETableSearch *search, } static void -et_search_accept (ETableSearch *search, ETable *et) +et_search_accept (ETableSearch *search, + ETable *et) { gint cursor; ETableCol *col = current_search_col (et); @@ -521,12 +531,12 @@ init_search (ETable *e_table) e_table->search = e_table_search_new (); - e_table->search_search_id = - g_signal_connect (G_OBJECT (e_table->search), "search", - G_CALLBACK (et_search_search), e_table); - e_table->search_accept_id = - g_signal_connect (G_OBJECT (e_table->search), "accept", - G_CALLBACK (et_search_accept), e_table); + e_table->search_search_id = g_signal_connect ( + e_table->search, "search", + G_CALLBACK (et_search_search), e_table); + e_table->search_accept_id = g_signal_connect ( + e_table->search, "accept", + G_CALLBACK (et_search_accept), e_table); } static void @@ -610,7 +620,8 @@ et_grab_focus (GtkWidget *widget) /* Focus handler for the ETable */ static gint -et_focus (GtkWidget *container, GtkDirectionType direction) +et_focus (GtkWidget *container, + GtkDirectionType direction) { ETable *e_table; @@ -647,7 +658,9 @@ set_header_canvas_width (ETable *e_table) } static void -header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_table) +header_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETable *e_table) { GtkAllocation allocation; @@ -657,9 +670,9 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ GTK_WIDGET (e_table->header_canvas), &allocation); /* When the header item is created ->height == 0, - as the font is only created when everything is realized. - So we set the usize here as well, so that the size of the - header is correct */ + * as the font is only created when everything is realized. + * So we set the usize here as well, so that the size of the + * header is correct */ if (allocation.height != E_TABLE_HEADER_ITEM (e_table->header_item)->height) g_object_set ( e_table->header_canvas, "height-request", @@ -668,7 +681,8 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ } static void -group_info_changed (ETableSortInfo *info, ETable *et) +group_info_changed (ETableSortInfo *info, + ETable *et) { gboolean will_be_grouped = e_table_sort_info_grouping_get_count (info) > 0; clear_current_search_col (et); @@ -684,7 +698,8 @@ group_info_changed (ETableSortInfo *info, ETable *et) } static void -sort_info_changed (ETableSortInfo *info, ETable *et) +sort_info_changed (ETableSortInfo *info, + ETable *et) { clear_current_search_col (et); e_table_state_change (et); @@ -751,8 +766,9 @@ table_canvas_reflow_idle (ETable *e_table) } static void -table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, - ETable *e_table) +table_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETable *e_table) { gdouble width; gdouble height; @@ -782,7 +798,8 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, } static void -table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table) +table_canvas_reflow (GnomeCanvas *canvas, + ETable *e_table) { if (!e_table->reflow_idle_id) e_table->reflow_idle_id = g_idle_add_full ( @@ -791,7 +808,10 @@ table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table) } static void -click_to_add_cursor_change (ETableClickToAdd *etcta, gint row, gint col, ETable *et) +click_to_add_cursor_change (ETableClickToAdd *etcta, + gint row, + gint col, + ETable *et) { if (et->cursor_loc == E_TABLE_CURSOR_LOC_TABLE) { e_selection_model_clear (E_SELECTION_MODEL (et->selection)); @@ -800,7 +820,9 @@ click_to_add_cursor_change (ETableClickToAdd *etcta, gint row, gint col, ETable } static void -group_cursor_change (ETableGroup *etg, gint row, ETable *et) +group_cursor_change (ETableGroup *etg, + gint row, + ETable *et) { ETableCursorLoc old_cursor_loc; @@ -814,19 +836,29 @@ group_cursor_change (ETableGroup *etg, gint row, ETable *et) } static void -group_cursor_activated (ETableGroup *etg, gint row, ETable *et) +group_cursor_activated (ETableGroup *etg, + gint row, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[CURSOR_ACTIVATED], 0, row); } static void -group_double_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_double_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[DOUBLE_CLICK], 0, row, col, event); } static gboolean -group_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_right_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = FALSE; @@ -838,7 +870,11 @@ group_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable } static gboolean -group_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = 0; g_signal_emit (G_OBJECT (et), et_signals[CLICK], 0, row, col, event, &return_val); @@ -846,7 +882,11 @@ group_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) } static gboolean -group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_key_press (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = FALSE; GdkEventKey *key = (GdkEventKey *) event; @@ -923,7 +963,11 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable * } static gboolean -group_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_start_drag (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = TRUE; g_signal_emit (G_OBJECT (et), et_signals[START_DRAG], 0, @@ -932,7 +976,8 @@ group_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable } static void -et_table_model_changed (ETableModel *model, ETable *et) +et_table_model_changed (ETableModel *model, + ETable *et) { et->need_rebuild = TRUE; if (!et->rebuild_idle_id) { @@ -943,7 +988,9 @@ et_table_model_changed (ETableModel *model, ETable *et) } static void -et_table_row_changed (ETableModel *table_model, gint row, ETable *et) +et_table_row_changed (ETableModel *table_model, + gint row, + ETable *et) { if (!et->need_rebuild) { if (e_table_group_remove (et->group, row)) @@ -953,13 +1000,19 @@ et_table_row_changed (ETableModel *table_model, gint row, ETable *et) } static void -et_table_cell_changed (ETableModel *table_model, gint view_col, gint row, ETable *et) +et_table_cell_changed (ETableModel *table_model, + gint view_col, + gint row, + ETable *et) { et_table_row_changed (table_model, row, et); } static void -et_table_rows_inserted (ETableModel *table_model, gint row, gint count, ETable *et) +et_table_rows_inserted (ETableModel *table_model, + gint row, + gint count, + ETable *et) { /* This number has already been decremented. */ gint row_count = e_table_model_row_count (table_model); @@ -974,7 +1027,10 @@ et_table_rows_inserted (ETableModel *table_model, gint row, gint count, ETable * } static void -et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETable *et) +et_table_rows_deleted (ETableModel *table_model, + gint row, + gint count, + ETable *et) { gint row_count = e_table_model_row_count (table_model); if (!et->need_rebuild) { @@ -1022,20 +1078,27 @@ et_build_groups (ETable *et) "selection_model", et->selection, NULL); - g_signal_connect (G_OBJECT (et->group), "cursor_change", - G_CALLBACK (group_cursor_change), et); - g_signal_connect (G_OBJECT (et->group), "cursor_activated", - G_CALLBACK (group_cursor_activated), et); - g_signal_connect (G_OBJECT (et->group), "double_click", - G_CALLBACK (group_double_click), et); - g_signal_connect (G_OBJECT (et->group), "right_click", - G_CALLBACK (group_right_click), et); - g_signal_connect (G_OBJECT (et->group), "click", - G_CALLBACK (group_click), et); - g_signal_connect (G_OBJECT (et->group), "key_press", - G_CALLBACK (group_key_press), et); - g_signal_connect (G_OBJECT (et->group), "start_drag", - G_CALLBACK (group_start_drag), et); + g_signal_connect ( + et->group, "cursor_change", + G_CALLBACK (group_cursor_change), et); + g_signal_connect ( + et->group, "cursor_activated", + G_CALLBACK (group_cursor_activated), et); + g_signal_connect ( + et->group, "double_click", + G_CALLBACK (group_double_click), et); + g_signal_connect ( + et->group, "right_click", + G_CALLBACK (group_right_click), et); + g_signal_connect ( + et->group, "click", + G_CALLBACK (group_click), et); + g_signal_connect ( + et->group, "key_press", + G_CALLBACK (group_key_press), et); + g_signal_connect ( + et->group, "start_drag", + G_CALLBACK (group_start_drag), et); if (!(et->is_grouped) && was_grouped) et_disconnect_model (et); @@ -1102,7 +1165,8 @@ changed_idle (gpointer data) } static void -et_canvas_realize (GtkWidget *canvas, ETable *e_table) +et_canvas_realize (GtkWidget *canvas, + ETable *e_table) { GtkWidget *widget; GtkStyle *style; @@ -1120,7 +1184,9 @@ et_canvas_realize (GtkWidget *canvas, ETable *e_table) } static gboolean -white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETable *e_table) +white_item_event (GnomeCanvasItem *white_item, + GdkEvent *event, + ETable *e_table) { gboolean return_val = 0; g_signal_emit (G_OBJECT (e_table), et_signals[WHITE_SPACE_EVENT], 0, @@ -1143,7 +1209,9 @@ et_eti_leave_edit (ETable *et) } static gint -et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETable *e_table) +et_canvas_root_event (GnomeCanvasItem *root, + GdkEvent *event, + ETable *e_table) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -1188,7 +1256,9 @@ focus_first_etable_item (ETableGroup *group) * always, and also give the focus to some ETableItem if we get focused. */ static gint -table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data) +table_canvas_focus_event_cb (GtkWidget *widget, + GdkEventFocus *event, + gpointer data) { GnomeCanvas *canvas; ECanvas *ecanvas; @@ -1232,7 +1302,9 @@ table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer d } static gboolean -canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable) +canvas_vbox_event (ECanvasVbox *vbox, + GdkEventKey *key, + ETable *etable) { if (key->type != GDK_KEY_PRESS && key->type != GDK_KEY_RELEASE) { @@ -1254,7 +1326,9 @@ canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable) } static gboolean -click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) +click_to_add_event (ETableClickToAdd *etcta, + GdkEventKey *key, + ETable *etable) { if (key->type != GDK_KEY_PRESS && key->type != GDK_KEY_RELEASE) { @@ -1284,50 +1358,53 @@ click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) } static void -e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *header, - ETableModel *model) +e_table_setup_table (ETable *e_table, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model) { GtkWidget *widget; GtkStyle *style; e_table->table_canvas = GNOME_CANVAS (e_canvas_new ()); g_signal_connect ( - G_OBJECT (e_table->table_canvas), "size_allocate", + e_table->table_canvas, "size_allocate", G_CALLBACK (table_canvas_size_allocate), e_table); g_signal_connect ( - G_OBJECT (e_table->table_canvas), "focus_in_event", + e_table->table_canvas, "focus_in_event", G_CALLBACK (table_canvas_focus_event_cb), e_table); g_signal_connect ( - G_OBJECT (e_table->table_canvas), "focus_out_event", + e_table->table_canvas, "focus_out_event", G_CALLBACK (table_canvas_focus_event_cb), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_begin", + e_table, "drag_begin", G_CALLBACK (et_drag_begin), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_end", + e_table, "drag_end", G_CALLBACK (et_drag_end), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_data_get", + e_table, "drag_data_get", G_CALLBACK (et_drag_data_get), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_data_delete", + e_table, "drag_data_delete", G_CALLBACK (et_drag_data_delete), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_motion", + e_table, "drag_motion", G_CALLBACK (et_drag_motion), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_leave", + e_table, "drag_leave", G_CALLBACK (et_drag_leave), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_drop", + e_table, "drag_drop", G_CALLBACK (et_drag_drop), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_data_received", + e_table, "drag_data_received", G_CALLBACK (et_drag_data_received), e_table); - g_signal_connect (G_OBJECT(e_table->table_canvas), "reflow", - G_CALLBACK (table_canvas_reflow), e_table); + g_signal_connect ( + e_table->table_canvas, "reflow", + G_CALLBACK (table_canvas_reflow), e_table); widget = GTK_WIDGET (e_table->table_canvas); style = gtk_widget_get_style (widget); @@ -1340,14 +1417,17 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h "fill_color_gdk", &style->base[GTK_STATE_NORMAL], NULL); - g_signal_connect (G_OBJECT (e_table->white_item), "event", - G_CALLBACK (white_item_event), e_table); + g_signal_connect ( + e_table->white_item, "event", + G_CALLBACK (white_item_event), e_table); - g_signal_connect (G_OBJECT(e_table->table_canvas), "realize", - G_CALLBACK (et_canvas_realize), e_table); + g_signal_connect ( + e_table->table_canvas, "realize", + G_CALLBACK (et_canvas_realize), e_table); - g_signal_connect (G_OBJECT(gnome_canvas_root (e_table->table_canvas)), "event", - G_CALLBACK (et_canvas_root_event), e_table); + g_signal_connect ( + gnome_canvas_root (e_table->table_canvas), "event", + G_CALLBACK (et_canvas_root_event), e_table); e_table->canvas_vbox = gnome_canvas_item_new ( gnome_canvas_root (e_table->table_canvas), @@ -1389,7 +1469,8 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h } static void -e_table_fill_table (ETable *e_table, ETableModel *model) +e_table_fill_table (ETable *e_table, + ETableModel *model) { e_table_group_add_all (e_table->group); } @@ -1404,7 +1485,8 @@ e_table_fill_table (ETable *e_table, ETableModel *model) * **/ void -e_table_set_state_object (ETable *e_table, ETableState *state) +e_table_set_state_object (ETable *e_table, + ETableState *state) { GValue *val; GtkWidget *widget; @@ -1434,12 +1516,13 @@ e_table_set_state_object (ETable *e_table, ETableState *state) if (state->sort_info) { e_table->sort_info = e_table_sort_info_duplicate (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->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->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 ( + e_table->sort_info, "sort_info_changed", + G_CALLBACK (sort_info_changed), e_table); } else e_table->sort_info = NULL; @@ -1474,8 +1557,8 @@ e_table_set_state_object (ETable *e_table, ETableState *state) * **/ void -e_table_set_state (ETable *e_table, - const gchar *state_str) +e_table_set_state (ETable *e_table, + const gchar *state_str) { ETableState *state; @@ -1501,8 +1584,8 @@ e_table_set_state (ETable *e_table, * **/ void -e_table_load_state (ETable *e_table, - const gchar *filename) +e_table_load_state (ETable *e_table, + const gchar *filename) { ETableState *state; @@ -1592,8 +1675,8 @@ gchar *e_table_get_state (ETable *e_table * **/ void -e_table_save_state (ETable *e_table, - const gchar *filename) +e_table_save_state (ETable *e_table, + const gchar *filename) { ETableState *state; @@ -1603,20 +1686,26 @@ e_table_save_state (ETable *e_table, } static void -et_selection_model_selection_changed (ETableGroup *etg, ETable *et) +et_selection_model_selection_changed (ETableGroup *etg, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[SELECTION_CHANGE], 0); } static void -et_selection_model_selection_row_changed (ETableGroup *etg, gint row, ETable *et) +et_selection_model_selection_row_changed (ETableGroup *etg, + gint row, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[SELECTION_CHANGE], 0); } static ETable * -et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, - ETableSpecification *specification, ETableState *state) +et_real_construct (ETable *e_table, + ETableModel *etm, + ETableExtras *ete, + ETableSpecification *specification, + ETableState *state) { gint row = 0; gint col_count, i; @@ -1751,8 +1840,11 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, * The passed in value @e_table or %NULL if there's an error. **/ ETable * -e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const gchar *spec_str, const gchar *state_str) +e_table_construct (ETable *e_table, + ETableModel *etm, + ETableExtras *ete, + const gchar *spec_str, + const gchar *state_str) { ETableSpecification *specification; ETableState *state; @@ -1811,8 +1903,11 @@ e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, * The passed in value @e_table or %NULL if there's an error. **/ ETable * -e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const gchar *spec_fn, const gchar *state_fn) +e_table_construct_from_spec_file (ETable *e_table, + ETableModel *etm, + ETableExtras *ete, + const gchar *spec_fn, + const gchar *state_fn) { ETableSpecification *specification; ETableState *state; @@ -2027,7 +2122,8 @@ e_table_get_specification (ETable *e_table) } gint -e_table_set_specification (ETable *e_table, const gchar *spec) +e_table_set_specification (ETable *e_table, + const gchar *spec) { xmlDoc *xmlSpec; gint ret; @@ -2045,7 +2141,8 @@ e_table_set_specification (ETable *e_table, const gchar *spec) } void -e_table_save_specification (ETable *e_table, const gchar *filename) +e_table_save_specification (ETable *e_table, + const gchar *filename) { xmlDoc *doc = et_build_tree (e_table); @@ -2059,7 +2156,8 @@ e_table_save_specification (ETable *e_table, const gchar *filename) } gint -e_table_load_specification (ETable *e_table, gchar *filename) +e_table_load_specification (ETable *e_table, + gchar *filename) { xmlDoc *xmlSpec; gint ret; @@ -2093,7 +2191,8 @@ e_table_load_specification (ETable *e_table, gchar *filename) * Sets the cursor row and the selection to the given row number. **/ void -e_table_set_cursor_row (ETable *e_table, gint row) +e_table_set_cursor_row (ETable *e_table, + gint row) { g_return_if_fail (e_table != NULL); g_return_if_fail (E_IS_TABLE (e_table)); @@ -2140,9 +2239,9 @@ e_table_get_cursor_row (ETable *e_table) * and then act upon that list. (In inverse order if it's rows.) **/ void -e_table_selected_row_foreach (ETable *e_table, - EForeachFunc callback, - gpointer closure) +e_table_selected_row_foreach (ETable *e_table, + EForeachFunc callback, + gpointer closure) { g_return_if_fail (e_table != NULL); g_return_if_fail (E_IS_TABLE (e_table)); @@ -2162,7 +2261,7 @@ e_table_selected_row_foreach (ETable *e_table, * The number of rows selected. **/ gint -e_table_selected_count (ETable *e_table) +e_table_selected_count (ETable *e_table) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2248,13 +2347,13 @@ e_table_commit_click_to_add (ETable *table) static void et_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETable *etable = E_TABLE (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: g_value_set_object (value, etable->model); break; @@ -2311,13 +2410,13 @@ typedef struct { static void et_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { ETable *etable = E_TABLE (object); - switch (prop_id) { + switch (property_id) { case PROP_LENGTH_THRESHOLD: etable->length_threshold = g_value_get_int (value); if (etable->group) { @@ -2418,8 +2517,8 @@ et_set_property (GObject *object, * The model row number. **/ gint -e_table_get_next_row (ETable *e_table, - gint model_row) +e_table_get_next_row (ETable *e_table, + gint model_row) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2452,8 +2551,8 @@ e_table_get_next_row (ETable *e_table, * The model row number. **/ gint -e_table_get_prev_row (ETable *e_table, - gint model_row) +e_table_get_prev_row (ETable *e_table, + gint model_row) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2481,8 +2580,8 @@ e_table_get_prev_row (ETable *e_table, * The view row number. **/ gint -e_table_model_to_view_row (ETable *e_table, - gint model_row) +e_table_model_to_view_row (ETable *e_table, + gint model_row) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2504,8 +2603,8 @@ e_table_model_to_view_row (ETable *e_table, * The model row number. **/ gint -e_table_view_to_model_row (ETable *e_table, - gint view_row) +e_table_view_to_model_row (ETable *e_table, + gint view_row) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2529,8 +2628,10 @@ e_table_view_to_model_row (ETable *e_table, **/ void e_table_get_cell_at (ETable *table, - gint x, gint y, - gint *row_return, gint *col_return) + gint x, + gint y, + gint *row_return, + gint *col_return) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -2571,9 +2672,12 @@ e_table_get_cell_at (ETable *table, **/ void e_table_get_cell_geometry (ETable *table, - gint row, gint col, - gint *x_return, gint *y_return, - gint *width_return, gint *height_return) + gint row, + gint col, + gint *x_return, + gint *y_return, + gint *width_return, + gint *height_return) { GtkAllocation allocation; GtkAdjustment *adjustment; @@ -2614,7 +2718,9 @@ e_table_get_cell_geometry (ETable *table, * based on the mouse motion information in the group. **/ void -e_table_get_mouse_over_cell (ETable *table, gint *row, gint *col) +e_table_get_mouse_over_cell (ETable *table, + gint *row, + gint *col) { g_return_if_fail (table != NULL); g_return_if_fail (E_IS_TABLE (table)); @@ -2724,12 +2830,12 @@ struct _GtkDragSourceInfo * **/ void -e_table_drag_get_data (ETable *table, - gint row, - gint col, - GdkDragContext *context, - GdkAtom target, - guint32 time) +e_table_drag_get_data (ETable *table, + gint row, + gint col, + GdkDragContext *context, + GdkAtom target, + guint32 time) { g_return_if_fail (table != NULL); g_return_if_fail (E_IS_TABLE (table)); @@ -2751,8 +2857,8 @@ e_table_drag_get_data (ETable *table, **/ void e_table_drag_highlight (ETable *table, - gint row, - gint col) + gint row, + gint col) { GtkAllocation allocation; GtkAdjustment *adjustment; @@ -2867,7 +2973,10 @@ e_table_drag_dest_unset (GtkWidget *widget) /* Source side */ static gint -et_real_start_drag (ETable *table, gint row, gint col, GdkEvent *event) +et_real_start_drag (ETable *table, + gint row, + gint col, + GdkEvent *event) { GtkDragSourceInfo *info; GdkDragContext *context; @@ -2910,11 +3019,11 @@ et_real_start_drag (ETable *table, gint row, gint col, GdkEvent *event) * Registers this table as a drag site, and possibly adds default behaviors. **/ void -e_table_drag_source_set (ETable *table, - GdkModifierType start_button_mask, - const GtkTargetEntry *targets, - gint n_targets, - GdkDragAction actions) +e_table_drag_source_set (ETable *table, + GdkModifierType start_button_mask, + const GtkTargetEntry *targets, + gint n_targets, + GdkDragAction actions) { ETableDragSourceSite *site; GtkWidget *canvas; @@ -2995,13 +3104,13 @@ e_table_drag_source_unset (ETable *table) * The drag context. **/ GdkDragContext * -e_table_drag_begin (ETable *table, - gint row, - gint col, - GtkTargetList *targets, - GdkDragAction actions, - gint button, - GdkEvent *event) +e_table_drag_begin (ETable *table, + gint row, + gint col, + GtkTargetList *targets, + GdkDragAction actions, + gint button, + GdkEvent *event) { g_return_val_if_fail (table != NULL, NULL); g_return_val_if_fail (E_IS_TABLE (table), NULL); @@ -3018,8 +3127,8 @@ e_table_drag_begin (ETable *table, static void et_drag_begin (GtkWidget *widget, - GdkDragContext *context, - ETable *et) + GdkDragContext *context, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_BEGIN], 0, et->drag_row, et->drag_col, context); @@ -3027,8 +3136,8 @@ et_drag_begin (GtkWidget *widget, static void et_drag_end (GtkWidget *widget, - GdkDragContext *context, - ETable *et) + GdkDragContext *context, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_END], 0, et->drag_row, et->drag_col, context); @@ -3036,11 +3145,11 @@ et_drag_end (GtkWidget *widget, static void et_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETable *et) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_GET], 0, et->drag_row, et->drag_col, context, selection_data, @@ -3049,8 +3158,8 @@ et_drag_data_get (GtkWidget *widget, static void et_drag_data_delete (GtkWidget *widget, - GdkDragContext *context, - ETable *et) + GdkDragContext *context, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_DELETE], 0, et->drag_row, et->drag_col, context); @@ -3058,10 +3167,10 @@ et_drag_data_delete (GtkWidget *widget, static gboolean do_drag_motion (ETable *et, - GdkDragContext *context, - gint x, - gint y, - guint time) + GdkDragContext *context, + gint x, + gint y, + guint time) { gboolean ret_val; gint row = -1, col = -1; @@ -3141,7 +3250,8 @@ scroll_timeout (gpointer data) } static void -scroll_on (ETable *et, guint scroll_direction) +scroll_on (ETable *et, + guint scroll_direction) { if (et->scroll_idle_id == 0 || scroll_direction != et->scroll_direction) { if (et->scroll_idle_id != 0) @@ -3177,7 +3287,8 @@ context_destroyed (gpointer data) } static void -context_connect (ETable *et, GdkDragContext *context) +context_connect (ETable *et, + GdkDragContext *context) { if (g_dataset_get_data (context, "e-table") == NULL) { g_object_ref (et); @@ -3187,9 +3298,9 @@ context_connect (ETable *et, GdkDragContext *context) static void et_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - ETable *et) + GdkDragContext *context, + guint time, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_LEAVE], 0, et->drop_row, et->drop_col, context, time); @@ -3201,11 +3312,11 @@ et_drag_leave (GtkWidget *widget, static gboolean et_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETable *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETable *et) { GtkAllocation allocation; gboolean ret_val; @@ -3240,11 +3351,11 @@ et_drag_motion (GtkWidget *widget, static gboolean et_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETable *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETable *et) { gboolean ret_val; gint row, col; @@ -3271,13 +3382,13 @@ et_drag_drop (GtkWidget *widget, static void et_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - ETable *et) + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + ETable *et) { gint row, col; diff --git a/widgets/table/e-table.h b/widgets/table/e-table.h index 99daf6d1e5..e1e4e0eb8f 100644 --- a/widgets/table/e-table.h +++ b/widgets/table/e-table.h @@ -121,8 +121,8 @@ struct _ETable { gint length_threshold; gint rebuild_idle_id; - guint need_rebuild:1; - guint size_allocated:1; + guint need_rebuild : 1; + guint size_allocated : 1; /* * Configuration settings diff --git a/widgets/table/e-tree-memory-callbacks.c b/widgets/table/e-tree-memory-callbacks.c index 7281f3d327..9f8d7d468a 100644 --- a/widgets/table/e-tree-memory-callbacks.c +++ b/widgets/table/e-tree-memory-callbacks.c @@ -34,7 +34,8 @@ G_DEFINE_TYPE (ETreeMemoryCallbacks, e_tree_memory_callbacks, E_TYPE_TREE_MEMORY) static GdkPixbuf * -etmc_icon_at (ETreeModel *etm, ETreePath node) +etmc_icon_at (ETreeModel *etm, + ETreePath node) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -64,7 +65,8 @@ etmc_has_save_id (ETreeModel *etm) } static gchar * -etmc_get_save_id (ETreeModel *etm, ETreePath node) +etmc_get_save_id (ETreeModel *etm, + ETreePath node) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -86,7 +88,8 @@ etmc_has_get_node_by_id (ETreeModel *etm) } static ETreePath -etmc_get_node_by_id (ETreeModel *etm, const gchar *save_id) +etmc_get_node_by_id (ETreeModel *etm, + const gchar *save_id) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -97,7 +100,9 @@ etmc_get_node_by_id (ETreeModel *etm, const gchar *save_id) } static gpointer -etmc_sort_value_at (ETreeModel *etm, ETreePath node, gint col) +etmc_sort_value_at (ETreeModel *etm, + ETreePath node, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -108,7 +113,9 @@ etmc_sort_value_at (ETreeModel *etm, ETreePath node, gint col) } static gpointer -etmc_value_at (ETreeModel *etm, ETreePath node, gint col) +etmc_value_at (ETreeModel *etm, + ETreePath node, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -116,7 +123,10 @@ etmc_value_at (ETreeModel *etm, ETreePath node, gint col) } static void -etmc_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) +etmc_set_value_at (ETreeModel *etm, + ETreePath node, + gint col, + gconstpointer val) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -124,7 +134,9 @@ etmc_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) } static gboolean -etmc_is_editable (ETreeModel *etm, ETreePath node, gint col) +etmc_is_editable (ETreeModel *etm, + ETreePath node, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -133,7 +145,9 @@ etmc_is_editable (ETreeModel *etm, ETreePath node, gint col) /* The default for etmc_duplicate_value is to return the raw value. */ static gpointer -etmc_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) +etmc_duplicate_value (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -144,7 +158,9 @@ etmc_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) } static void -etmc_free_value (ETreeModel *etm, gint col, gpointer value) +etmc_free_value (ETreeModel *etm, + gint col, + gpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -153,7 +169,8 @@ etmc_free_value (ETreeModel *etm, gint col, gpointer value) } static gpointer -etmc_initialize_value (ETreeModel *etm, gint col) +etmc_initialize_value (ETreeModel *etm, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -164,7 +181,9 @@ etmc_initialize_value (ETreeModel *etm, gint col) } static gboolean -etmc_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) +etmc_value_is_empty (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -175,7 +194,9 @@ etmc_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) } static gchar * -etmc_value_to_string (ETreeModel *etm, gint col, gconstpointer value) +etmc_value_to_string (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -240,28 +261,28 @@ e_tree_memory_callbacks_init (ETreeMemoryCallbacks *etmc) * */ ETreeModel * -e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, +e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, - ETreeMemoryCallbacksColumnCountFn column_count, + ETreeMemoryCallbacksColumnCountFn column_count, - ETreeMemoryCallbacksHasSaveIdFn has_save_id, - ETreeMemoryCallbacksGetSaveIdFn get_save_id, + ETreeMemoryCallbacksHasSaveIdFn has_save_id, + ETreeMemoryCallbacksGetSaveIdFn get_save_id, - ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id, - ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id, + ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id, + ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id, - ETreeMemoryCallbacksValueAtFn sort_value_at, - ETreeMemoryCallbacksValueAtFn value_at, - ETreeMemoryCallbacksSetValueAtFn set_value_at, - ETreeMemoryCallbacksIsEditableFn is_editable, + ETreeMemoryCallbacksValueAtFn sort_value_at, + ETreeMemoryCallbacksValueAtFn value_at, + ETreeMemoryCallbacksSetValueAtFn set_value_at, + ETreeMemoryCallbacksIsEditableFn is_editable, - ETreeMemoryCallbacksDuplicateValueFn duplicate_value, - ETreeMemoryCallbacksFreeValueFn free_value, - ETreeMemoryCallbacksInitializeValueFn initialize_value, - ETreeMemoryCallbacksValueIsEmptyFn value_is_empty, - ETreeMemoryCallbacksValueToStringFn value_to_string, + ETreeMemoryCallbacksDuplicateValueFn duplicate_value, + ETreeMemoryCallbacksFreeValueFn free_value, + ETreeMemoryCallbacksInitializeValueFn initialize_value, + ETreeMemoryCallbacksValueIsEmptyFn value_is_empty, + ETreeMemoryCallbacksValueToStringFn value_to_string, - gpointer model_data) + gpointer model_data) { ETreeMemoryCallbacks *etmc; @@ -290,6 +311,6 @@ e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, etmc->model_data = model_data; - return (ETreeModel*) etmc; + return (ETreeModel *) etmc; } diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 4b9a977f05..43fb41b29c 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -81,7 +81,8 @@ struct _ETreeMemoryPrivate { /* ETreeMemoryPath functions */ static inline void -check_children (ETreeMemory *memory, ETreePath node) +check_children (ETreeMemory *memory, + ETreePath node) { ETreeMemoryPath *path = node; if (!path->children_computed) { @@ -236,14 +237,16 @@ etmm_get_root (ETreeModel *etm) } static ETreePath -etmm_get_parent (ETreeModel *etm, ETreePath node) +etmm_get_parent (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return path->parent; } static ETreePath -etmm_get_first_child (ETreeModel *etm, ETreePath node) +etmm_get_first_child (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -252,7 +255,8 @@ etmm_get_first_child (ETreeModel *etm, ETreePath node) } static ETreePath -etmm_get_last_child (ETreeModel *etm, ETreePath node) +etmm_get_last_child (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -261,28 +265,32 @@ etmm_get_last_child (ETreeModel *etm, ETreePath node) } static ETreePath -etmm_get_next (ETreeModel *etm, ETreePath node) +etmm_get_next (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return path->next_sibling; } static ETreePath -etmm_get_prev (ETreeModel *etm, ETreePath node) +etmm_get_prev (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return path->prev_sibling; } static gboolean -etmm_is_root (ETreeModel *etm, ETreePath node) +etmm_is_root (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return e_tree_memory_path_depth (path) == 0; } static gboolean -etmm_is_expandable (ETreeModel *etm, ETreePath node) +etmm_is_expandable (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -291,7 +299,9 @@ etmm_is_expandable (ETreeModel *etm, ETreePath node) } static guint -etmm_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) +etmm_get_children (ETreeModel *etm, + ETreePath node, + ETreePath **nodes) { ETreeMemoryPath *path = node; guint n_children; @@ -314,7 +324,8 @@ etmm_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) } static guint -etmm_depth (ETreeModel *etm, ETreePath path) +etmm_depth (ETreeModel *etm, + ETreePath path) { return e_tree_memory_path_depth (path); } @@ -338,7 +349,8 @@ etmm_clear_children_computed (ETreeMemoryPath *path) } static void -etmm_node_request_collapse (ETreeModel *etm, ETreePath node) +etmm_node_request_collapse (ETreeModel *etm, + ETreePath node) { ETreeModelClass *parent_class; @@ -430,7 +442,8 @@ e_tree_memory_new (void) * the value of @expanded. */ void -e_tree_memory_set_expanded_default (ETreeMemory *etree, gboolean expanded) +e_tree_memory_set_expanded_default (ETreeMemory *etree, + gboolean expanded) { g_return_if_fail (etree != NULL); @@ -447,7 +460,8 @@ e_tree_memory_set_expanded_default (ETreeMemory *etree, gboolean expande * Return value: **/ gpointer -e_tree_memory_node_get_data (ETreeMemory *etmm, ETreePath node) +e_tree_memory_node_get_data (ETreeMemory *etmm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -465,7 +479,9 @@ e_tree_memory_node_get_data (ETreeMemory *etmm, ETreePath node) * **/ void -e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_data) +e_tree_memory_node_set_data (ETreeMemory *etmm, + ETreePath node, + gpointer node_data) { ETreeMemoryPath *path = node; @@ -487,9 +503,9 @@ e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_da **/ ETreePath e_tree_memory_node_insert (ETreeMemory *tree_model, - ETreePath parent_node, - gint position, - gpointer node_data) + ETreePath parent_node, + gint position, + gpointer node_data) { ETreeMemoryPrivate *priv; ETreeMemoryPath *new_path; @@ -550,9 +566,9 @@ e_tree_memory_node_insert_id (ETreeMemory *etree, **/ ETreePath e_tree_memory_node_insert_before (ETreeMemory *etree, - ETreePath parent, - ETreePath sibling, - gpointer node_data) + ETreePath parent, + ETreePath sibling, + gpointer node_data) { ETreeMemoryPath *child; ETreeMemoryPath *parent_path = parent; @@ -574,7 +590,8 @@ e_tree_memory_node_insert_before (ETreeMemory *etree, /* just blows away child data, doesn't take into account unlinking/etc */ static void -child_free (ETreeMemory *etree, ETreeMemoryPath *node) +child_free (ETreeMemory *etree, + ETreeMemoryPath *node) { ETreeMemoryPath *child, *next; @@ -602,7 +619,8 @@ child_free (ETreeMemory *etree, ETreeMemoryPath *node) * Return value: **/ gpointer -e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) +e_tree_memory_node_remove (ETreeMemory *etree, + ETreePath node) { ETreeMemoryPath *path = node; ETreeMemoryPath *parent = path->parent; @@ -622,7 +640,7 @@ e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) } /* unlink this node - we only have to unlink the root node being removed, - since the others are only references from this node */ + * since the others are only references from this node */ e_tree_path_unlink (path); /*printf("removing %d nodes from position %d\n", visible, base);*/ @@ -647,7 +665,9 @@ typedef struct { } MemoryAndClosure; static gint -sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) +sort_callback (gconstpointer data1, + gconstpointer data2, + gpointer user_data) { ETreePath path1 = *(ETreePath *) data1; ETreePath path2 = *(ETreePath *) data2; @@ -656,10 +676,10 @@ sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) } void -e_tree_memory_sort_node (ETreeMemory *etmm, - ETreePath node, - ETreeMemorySortCallback callback, - gpointer user_data) +e_tree_memory_sort_node (ETreeMemory *etmm, + ETreePath node, + ETreeMemorySortCallback callback, + gpointer user_data) { ETreeMemoryPath **children; ETreeMemoryPath *child; @@ -716,9 +736,9 @@ e_tree_memory_sort_node (ETreeMemory *etmm, } void -e_tree_memory_set_node_destroy_func (ETreeMemory *etmm, - GFunc destroy_func, - gpointer user_data) +e_tree_memory_set_node_destroy_func (ETreeMemory *etmm, + GFunc destroy_func, + gpointer user_data) { etmm->priv->destroy_func = destroy_func; etmm->priv->destroy_user_data = user_data; diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index 8772e5309f..b37ce4bf17 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -223,7 +223,7 @@ e_tree_model_init (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_pre_change (ETreeModel *tree_model) +e_tree_model_pre_change (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -243,7 +243,7 @@ e_tree_model_pre_change (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_no_change (ETreeModel *tree_model) +e_tree_model_no_change (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -263,7 +263,7 @@ e_tree_model_no_change (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_rebuilt (ETreeModel *tree_model) +e_tree_model_rebuilt (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -282,7 +282,8 @@ e_tree_model_rebuilt (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) +e_tree_model_node_changed (ETreeModel *tree_model, + ETreePath node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -302,7 +303,8 @@ e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) * Return value: **/ void -e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) +e_tree_model_node_data_changed (ETreeModel *tree_model, + ETreePath node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -322,7 +324,9 @@ e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) * Return value: **/ void -e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, gint col) +e_tree_model_node_col_changed (ETreeModel *tree_model, + ETreePath node, + gint col) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -342,8 +346,8 @@ e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, gint col **/ void e_tree_model_node_inserted (ETreeModel *tree_model, - ETreePath parent_node, - ETreePath inserted_node) + ETreePath parent_node, + ETreePath inserted_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -363,7 +367,10 @@ e_tree_model_node_inserted (ETreeModel *tree_model, * **/ void -e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETreePath removed_node, gint old_position) +e_tree_model_node_removed (ETreeModel *tree_model, + ETreePath parent_node, + ETreePath removed_node, + gint old_position) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -382,7 +389,8 @@ e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETree * **/ void -e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) +e_tree_model_node_deleted (ETreeModel *tree_model, + ETreePath deleted_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -400,7 +408,8 @@ e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) * **/ void -e_tree_model_node_request_collapse (ETreeModel *tree_model, ETreePath collapsed_node) +e_tree_model_node_request_collapse (ETreeModel *tree_model, + ETreePath collapsed_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -455,7 +464,8 @@ e_tree_model_get_root (ETreeModel *etree) * Return value: **/ ETreePath -e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_parent (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); if (ETM_CLASS (etree)->get_parent) @@ -474,7 +484,8 @@ e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_first_child (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -495,7 +506,8 @@ e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_last_child (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -516,7 +528,8 @@ e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_next (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_next (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -537,7 +550,8 @@ e_tree_model_node_get_next (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_prev (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -558,7 +572,8 @@ e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) * Return value: **/ gboolean -e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) +e_tree_model_node_is_root (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, FALSE); @@ -578,7 +593,8 @@ e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) * Return value: **/ gboolean -e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node) +e_tree_model_node_is_expandable (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, FALSE); g_return_val_if_fail (node != NULL, FALSE); @@ -590,7 +606,9 @@ e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node) } guint -e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **nodes) +e_tree_model_node_get_children (ETreeModel *etree, + ETreePath node, + ETreePath **nodes) { g_return_val_if_fail (etree != NULL, 0); if (ETM_CLASS (etree)->get_children) @@ -609,7 +627,8 @@ e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **n * Return value: **/ guint -e_tree_model_node_depth (ETreeModel *etree, ETreePath node) +e_tree_model_node_depth (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, 0); g_return_val_if_fail (E_IS_TREE_MODEL (etree), 0); @@ -630,7 +649,8 @@ e_tree_model_node_depth (ETreeModel *etree, ETreePath node) * return values: the GdkPixbuf associated with this node. */ GdkPixbuf * -e_tree_model_icon_at (ETreeModel *etree, ETreePath node) +e_tree_model_icon_at (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -711,7 +731,8 @@ e_tree_model_has_save_id (ETreeModel *etree) * return values: The save id for this path. */ gchar * -e_tree_model_get_save_id (ETreeModel *etree, ETreePath node) +e_tree_model_get_save_id (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -755,7 +776,8 @@ e_tree_model_has_get_node_by_id (ETreeModel *etree) * return values: The path for this save id. */ ETreePath -e_tree_model_get_node_by_id (ETreeModel *etree, const gchar *save_id) +e_tree_model_get_node_by_id (ETreeModel *etree, + const gchar *save_id) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -807,7 +829,9 @@ e_tree_model_has_change_pending (ETreeModel *etree) * node_removed, and no_change don't affect any data in this way. **/ gpointer -e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, gint col) +e_tree_model_sort_value_at (ETreeModel *etree, + ETreePath node, + gint col) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -838,7 +862,9 @@ e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, gint col) * node_removed, and no_change don't affect any data in this way. **/ gpointer -e_tree_model_value_at (ETreeModel *etree, ETreePath node, gint col) +e_tree_model_value_at (ETreeModel *etree, + ETreePath node, + gint col) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -850,7 +876,10 @@ e_tree_model_value_at (ETreeModel *etree, ETreePath node, gint col) } void -e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, gconstpointer val) +e_tree_model_set_value_at (ETreeModel *etree, + ETreePath node, + gint col, + gconstpointer val) { g_return_if_fail (etree != NULL); g_return_if_fail (E_IS_TREE_MODEL (etree)); @@ -869,7 +898,9 @@ e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, gconstpo * Return value: **/ gboolean -e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col) +e_tree_model_node_is_editable (ETreeModel *etree, + ETreePath node, + gint col) { g_return_val_if_fail (etree != NULL, FALSE); @@ -889,7 +920,9 @@ e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col) * Return value: **/ gpointer -e_tree_model_duplicate_value (ETreeModel *etree, gint col, gconstpointer value) +e_tree_model_duplicate_value (ETreeModel *etree, + gint col, + gconstpointer value) { g_return_val_if_fail (etree != NULL, NULL); @@ -909,7 +942,9 @@ e_tree_model_duplicate_value (ETreeModel *etree, gint col, gconstpointer value) * Return value: **/ void -e_tree_model_free_value (ETreeModel *etree, gint col, gpointer value) +e_tree_model_free_value (ETreeModel *etree, + gint col, + gpointer value) { g_return_if_fail (etree != NULL); @@ -927,7 +962,8 @@ e_tree_model_free_value (ETreeModel *etree, gint col, gpointer value) * Return value: **/ gpointer -e_tree_model_initialize_value (ETreeModel *etree, gint col) +e_tree_model_initialize_value (ETreeModel *etree, + gint col) { g_return_val_if_fail (etree != NULL, NULL); @@ -947,7 +983,9 @@ e_tree_model_initialize_value (ETreeModel *etree, gint col) * Return value: **/ gboolean -e_tree_model_value_is_empty (ETreeModel *etree, gint col, gconstpointer value) +e_tree_model_value_is_empty (ETreeModel *etree, + gint col, + gconstpointer value) { g_return_val_if_fail (etree != NULL, TRUE); @@ -967,7 +1005,9 @@ e_tree_model_value_is_empty (ETreeModel *etree, gint col, gconstpointer value) * Return value: **/ gchar * -e_tree_model_value_to_string (ETreeModel *etree, gint col, gconstpointer value) +e_tree_model_value_to_string (ETreeModel *etree, + gint col, + gconstpointer value) { g_return_val_if_fail(etree != NULL, g_strdup("")); @@ -987,7 +1027,10 @@ e_tree_model_value_to_string (ETreeModel *etree, gint col, gconstpointer value) * **/ void -e_tree_model_node_traverse (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data) +e_tree_model_node_traverse (ETreeModel *model, + ETreePath path, + ETreePathFunc func, + gpointer data) { ETreePath child; @@ -1019,7 +1062,10 @@ e_tree_model_node_traverse (ETreeModel *model, ETreePath path, ETreePathFunc fun * **/ void -e_tree_model_node_traverse_preorder (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data) +e_tree_model_node_traverse_preorder (ETreeModel *model, + ETreePath path, + ETreePathFunc func, + gpointer data) { ETreePath child; @@ -1052,7 +1098,12 @@ e_tree_model_node_traverse_preorder (ETreeModel *model, ETreePath path, ETreePat * **/ static ETreePath -e_tree_model_node_real_traverse (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data) +e_tree_model_node_real_traverse (ETreeModel *model, + ETreePath path, + ETreePath end_path, + gboolean forward_direction, + ETreePathFunc func, + gpointer data) { ETreePath child; @@ -1095,7 +1146,12 @@ e_tree_model_node_real_traverse (ETreeModel *model, ETreePath path, ETreePath en * **/ ETreePath -e_tree_model_node_find (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data) +e_tree_model_node_find (ETreeModel *model, + ETreePath path, + ETreePath end_path, + gboolean forward_direction, + ETreePathFunc func, + gpointer data) { ETreePath result; ETreePath next; diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index dd00fca2e0..9d04086b2f 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -79,7 +79,9 @@ clear_selection (ETreeSelectionModel *etsm) } static void -change_one_path (ETreeSelectionModel *etsm, ETreePath path, gboolean grow) +change_one_path (ETreeSelectionModel *etsm, + ETreePath path, + gboolean grow) { if (!path) return; @@ -91,7 +93,8 @@ change_one_path (ETreeSelectionModel *etsm, ETreePath path, gboolean grow) } static void -select_single_path (ETreeSelectionModel *etsm, ETreePath path) +select_single_path (ETreeSelectionModel *etsm, + ETreePath path) { clear_selection (etsm); change_one_path (etsm, path, TRUE); @@ -100,7 +103,9 @@ select_single_path (ETreeSelectionModel *etsm, ETreePath path) } static void -select_range (ETreeSelectionModel *etsm, gint start, gint end) +select_range (ETreeSelectionModel *etsm, + gint start, + gint end) { gint i; @@ -125,7 +130,8 @@ free_id (ETreeSelectionModel *etsm) } static void -restore_cursor (ETreeSelectionModel *etsm, ETreeModel *etm) +restore_cursor (ETreeSelectionModel *etsm, + ETreeModel *etm) { clear_selection (etsm); etsm->priv->cursor_path = NULL; @@ -153,7 +159,8 @@ restore_cursor (ETreeSelectionModel *etsm, ETreeModel *etm) } static void -etsm_pre_change (ETreeModel *etm, ETreeSelectionModel *etsm) +etsm_pre_change (ETreeModel *etm, + ETreeSelectionModel *etsm) { g_free (etsm->priv->cursor_save_id); etsm->priv->cursor_save_id = NULL; @@ -164,49 +171,67 @@ etsm_pre_change (ETreeModel *etm, ETreeSelectionModel *etsm) } static void -etsm_no_change (ETreeModel *etm, ETreeSelectionModel *etsm) +etsm_no_change (ETreeModel *etm, + ETreeSelectionModel *etsm) { free_id (etsm); } static void -etsm_node_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *etsm) +etsm_node_changed (ETreeModel *etm, + ETreePath node, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -etsm_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *etsm) +etsm_node_data_changed (ETreeModel *etm, + ETreePath node, + ETreeSelectionModel *etsm) { free_id (etsm); } static void -etsm_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSelectionModel *etsm) +etsm_node_col_changed (ETreeModel *etm, + ETreePath node, + gint col, + ETreeSelectionModel *etsm) { free_id (etsm); } static void -etsm_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSelectionModel *etsm) +etsm_node_inserted (ETreeModel *etm, + ETreePath parent, + ETreePath child, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -etsm_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeSelectionModel *etsm) +etsm_node_removed (ETreeModel *etm, + ETreePath parent, + ETreePath child, + gint old_position, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -etsm_node_deleted (ETreeModel *etm, ETreePath child, ETreeSelectionModel *etsm) +etsm_node_deleted (ETreeModel *etm, + ETreePath child, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -add_model (ETreeSelectionModel *etsm, ETreeModel *model) +add_model (ETreeSelectionModel *etsm, + ETreeModel *model) { ETreeSelectionModelPrivate *priv = etsm->priv; @@ -298,11 +323,14 @@ etsm_finalize (GObject *object) } static void -etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etsm_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: g_value_set_int (value, get_cursor_row (etsm)); break; @@ -322,12 +350,15 @@ etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps } static void -etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +etsm_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ESelectionModel *esm = E_SELECTION_MODEL (object); ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: e_selection_model_do_something (esm, g_value_get_int (value), etsm->priv->cursor_col, 0); break; @@ -348,7 +379,8 @@ etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp } static gboolean -etsm_is_path_selected (ETreeSelectionModel *etsm, ETreePath path) +etsm_is_path_selected (ETreeSelectionModel *etsm, + ETreePath path) { if (path && g_hash_table_lookup (etsm->priv->paths, path)) return TRUE; @@ -367,7 +399,7 @@ etsm_is_path_selected (ETreeSelectionModel *etsm, ETreePath path) */ static gboolean etsm_is_row_selected (ESelectionModel *selection, - gint row) + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path; @@ -387,7 +419,9 @@ typedef struct { } ModelAndCallback; static void -etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) +etsm_row_foreach_cb (gpointer key, + gpointer value, + gpointer user_data) { ETreePath path = key; ModelAndCallback *mac = user_data; @@ -407,8 +441,8 @@ etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) */ static void etsm_foreach (ESelectionModel *selection, - EForeachFunc callback, - gpointer closure) + EForeachFunc callback, + gpointer closure) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ModelAndCallback mac; @@ -520,7 +554,9 @@ etsm_invert_selection (ESelectionModel *selection) } static void -etsm_change_one_row (ESelectionModel *selection, gint row, gboolean grow) +etsm_change_one_row (ESelectionModel *selection, + gint row, + gboolean grow) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path; @@ -538,7 +574,9 @@ etsm_change_one_row (ESelectionModel *selection, gint row, gboolean grow) } static void -etsm_change_cursor (ESelectionModel *selection, gint row, gint col) +etsm_change_cursor (ESelectionModel *selection, + gint row, + gint col) { ETreeSelectionModel *etsm; @@ -569,7 +607,8 @@ etsm_cursor_col (ESelectionModel *selection) } static void -etsm_get_rows (gint row, gpointer d) +etsm_get_rows (gint row, + gpointer d) { gint **rowp = d; @@ -578,7 +617,8 @@ etsm_get_rows (gint row, gpointer d) } static void -etsm_select_single_row (ESelectionModel *selection, gint row) +etsm_select_single_row (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); @@ -587,7 +627,7 @@ etsm_select_single_row (ESelectionModel *selection, gint row) g_return_if_fail (path != NULL); /* we really only care about the size=1 case (cursor changed), - but this doesn't cost much */ + * but this doesn't cost much */ size = g_hash_table_size (etsm->priv->paths); if (size > 0 && size <= 5) { rowp = rows; @@ -596,13 +636,13 @@ etsm_select_single_row (ESelectionModel *selection, gint row) select_single_path (etsm, path); - if (size>5) { + if (size > 5) { e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); } else { if (rowp) { gint *p = rows; - while (p<rowp) + while (p < rowp) e_selection_model_selection_row_changed ((ESelectionModel *) etsm, *p++); } e_selection_model_selection_row_changed ((ESelectionModel *) etsm, row); @@ -610,7 +650,8 @@ etsm_select_single_row (ESelectionModel *selection, gint row) } static void -etsm_toggle_single_row (ESelectionModel *selection, gint row) +etsm_toggle_single_row (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); @@ -628,7 +669,8 @@ etsm_toggle_single_row (ESelectionModel *selection, gint row) } static void -etsm_real_move_selection_end (ETreeSelectionModel *etsm, gint row) +etsm_real_move_selection_end (ETreeSelectionModel *etsm, + gint row) { ETreePath end_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); gint start; @@ -641,7 +683,8 @@ etsm_real_move_selection_end (ETreeSelectionModel *etsm, gint row) } static void -etsm_move_selection_end (ESelectionModel *selection, gint row) +etsm_move_selection_end (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); @@ -652,7 +695,8 @@ etsm_move_selection_end (ESelectionModel *selection, gint row) } static void -etsm_set_selection_end (ESelectionModel *selection, gint row) +etsm_set_selection_end (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); @@ -670,7 +714,9 @@ struct foreach_path_t { }; static void -foreach_path (gpointer key, gpointer value, gpointer data) +foreach_path (gpointer key, + gpointer value, + gpointer data) { ETreePath path = key; struct foreach_path_t *c = data; @@ -678,7 +724,9 @@ foreach_path (gpointer key, gpointer value, gpointer data) } void -e_tree_selection_model_foreach (ETreeSelectionModel *etsm, ETreeForeachFunc callback, gpointer closure) +e_tree_selection_model_foreach (ETreeSelectionModel *etsm, + ETreeForeachFunc callback, + gpointer closure) { if (etsm->priv->paths) { struct foreach_path_t c; @@ -690,7 +738,8 @@ e_tree_selection_model_foreach (ETreeSelectionModel *etsm, ETreeForeachFunc call } void -e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath path) +e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, + ETreePath path) { select_single_path (etsm, path); @@ -698,12 +747,13 @@ e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath } void -e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, GPtrArray *paths) +e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, + GPtrArray *paths) { ETreePath path; gint i; - for (i=0;i<paths->len;i++) { + for (i = 0; i < paths->len; i++) { path = paths->pdata[i]; change_one_path (etsm, path, TRUE); } @@ -712,7 +762,8 @@ e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, GPtrArray *paths } void -e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath path) +e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, + ETreePath path) { change_one_path (etsm, path, TRUE); @@ -720,7 +771,8 @@ e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath pa } void -e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, ETreePath path) +e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, + ETreePath path) { gint row; diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index c92bb45c65..72b4cba091 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -169,7 +169,8 @@ ets_insert_idle (ETreeSorted *ets) #define CHECK_AROUND_LAST_ACCESS static inline ETreeSortedPath * -check_last_access (ETreeSorted *ets, ETreePath corresponding) +check_last_access (ETreeSorted *ets, + ETreePath corresponding) { #ifdef CHECK_AROUND_LAST_ACCESS ETreeSortedPath *parent; @@ -211,7 +212,8 @@ check_last_access (ETreeSorted *ets, ETreePath corresponding) } static ETreeSortedPath * -find_path (ETreeSorted *ets, ETreePath corresponding) +find_path (ETreeSorted *ets, + ETreePath corresponding) { gint depth; ETreePath *sequence; @@ -268,7 +270,9 @@ find_path (ETreeSorted *ets, ETreePath corresponding) } static ETreeSortedPath * -find_child_path (ETreeSorted *ets, ETreeSortedPath *parent, ETreePath corresponding) +find_child_path (ETreeSorted *ets, + ETreeSortedPath *parent, + ETreePath corresponding) { gint i; @@ -287,7 +291,8 @@ find_child_path (ETreeSorted *ets, ETreeSortedPath *parent, ETreePath correspond } static ETreeSortedPath * -find_or_create_path (ETreeSorted *ets, ETreePath corresponding) +find_or_create_path (ETreeSorted *ets, + ETreePath corresponding) { gint depth; ETreePath *sequence; @@ -367,7 +372,8 @@ free_path (ETreeSortedPath *path) } static ETreeSortedPath * -new_path (ETreeSortedPath *parent, ETreePath corresponding) +new_path (ETreeSortedPath *parent, + ETreePath corresponding) { ETreeSortedPath *path; @@ -388,7 +394,8 @@ new_path (ETreeSortedPath *parent, ETreePath corresponding) } static gboolean -reposition_path (ETreeSorted *ets, ETreeSortedPath *path) +reposition_path (ETreeSorted *ets, + ETreeSortedPath *path) { gint new_index; gint old_index = path->position; @@ -442,7 +449,8 @@ reposition_path (ETreeSorted *ets, ETreeSortedPath *path) } static void -regenerate_children (ETreeSorted *ets, ETreeSortedPath *path) +regenerate_children (ETreeSorted *ets, + ETreeSortedPath *path) { ETreeSortedPath **children; gint i; @@ -455,7 +463,8 @@ regenerate_children (ETreeSorted *ets, ETreeSortedPath *path) } static void -generate_children (ETreeSorted *ets, ETreeSortedPath *path) +generate_children (ETreeSorted *ets, + ETreeSortedPath *path) { ETreePath child; gint i; @@ -484,7 +493,11 @@ generate_children (ETreeSorted *ets, ETreeSortedPath *path) } static void -resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_children, gboolean needs_regen, gboolean send_signals) +resort_node (ETreeSorted *ets, + ETreeSortedPath *path, + gboolean resort_all_children, + gboolean needs_regen, + gboolean send_signals) { gboolean needs_resort; if (path) { @@ -532,7 +545,8 @@ resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_childr } static void -mark_path_child_needs_resort (ETreeSorted *ets, ETreeSortedPath *path) +mark_path_child_needs_resort (ETreeSorted *ets, + ETreeSortedPath *path) { if (path == NULL) return; @@ -543,7 +557,10 @@ mark_path_child_needs_resort (ETreeSorted *ets, ETreeSortedPath *path) } static void -mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children) +mark_path_needs_resort (ETreeSorted *ets, + ETreeSortedPath *path, + gboolean needs_regen, + gboolean resort_all_children) { if (path == NULL) return; @@ -556,7 +573,10 @@ mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_ } static void -schedule_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children) +schedule_resort (ETreeSorted *ets, + ETreeSortedPath *path, + gboolean needs_regen, + gboolean resort_all_children) { ets->priv->insert_count = 0; if (ets->priv->insert_idle_id != 0) { @@ -681,14 +701,16 @@ ets_get_root (ETreeModel *etm) } static ETreePath -ets_get_parent (ETreeModel *etm, ETreePath node) +ets_get_parent (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; return path->parent; } static ETreePath -ets_get_first_child (ETreeModel *etm, ETreePath node) +ets_get_first_child (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -703,7 +725,8 @@ ets_get_first_child (ETreeModel *etm, ETreePath node) } static ETreePath -ets_get_last_child (ETreeModel *etm, ETreePath node) +ets_get_last_child (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -718,7 +741,8 @@ ets_get_last_child (ETreeModel *etm, ETreePath node) } static ETreePath -ets_get_next (ETreeModel *etm, ETreePath node) +ets_get_next (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSortedPath *parent = path->parent; @@ -732,7 +756,8 @@ ets_get_next (ETreeModel *etm, ETreePath node) } static ETreePath -ets_get_prev (ETreeModel *etm, ETreePath node) +ets_get_prev (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSortedPath *parent = path->parent; @@ -746,7 +771,8 @@ ets_get_prev (ETreeModel *etm, ETreePath node) } static gboolean -ets_is_root (ETreeModel *etm, ETreePath node) +ets_is_root (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -755,7 +781,8 @@ ets_is_root (ETreeModel *etm, ETreePath node) } static gboolean -ets_is_expandable (ETreeModel *etm, ETreePath node) +ets_is_expandable (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -769,7 +796,9 @@ ets_is_expandable (ETreeModel *etm, ETreePath node) } static guint -ets_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) +ets_get_children (ETreeModel *etm, + ETreePath node, + ETreePath **nodes) { ETreeSortedPath *path = node; guint n_children; @@ -793,7 +822,8 @@ ets_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) } static guint -ets_depth (ETreeModel *etm, ETreePath node) +ets_depth (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -802,7 +832,8 @@ ets_depth (ETreeModel *etm, ETreePath node) } static GdkPixbuf * -ets_icon_at (ETreeModel *etm, ETreePath node) +ets_icon_at (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -833,7 +864,8 @@ ets_has_save_id (ETreeModel *etm) } static gchar * -ets_get_save_id (ETreeModel *etm, ETreePath node) +ets_get_save_id (ETreeModel *etm, + ETreePath node) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -852,7 +884,8 @@ ets_has_get_node_by_id (ETreeModel *etm) } static ETreePath -ets_get_node_by_id (ETreeModel *etm, const gchar *save_id) +ets_get_node_by_id (ETreeModel *etm, + const gchar *save_id) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreePath node; @@ -871,7 +904,9 @@ ets_has_change_pending (ETreeModel *etm) } static gpointer -ets_value_at (ETreeModel *etm, ETreePath node, gint col) +ets_value_at (ETreeModel *etm, + ETreePath node, + gint col) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -880,7 +915,10 @@ ets_value_at (ETreeModel *etm, ETreePath node, gint col) } static void -ets_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) +ets_set_value_at (ETreeModel *etm, + ETreePath node, + gint col, + gconstpointer val) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -889,7 +927,9 @@ ets_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) } static gboolean -ets_is_editable (ETreeModel *etm, ETreePath node, gint col) +ets_is_editable (ETreeModel *etm, + ETreePath node, + gint col) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -899,7 +939,9 @@ ets_is_editable (ETreeModel *etm, ETreePath node, gint col) /* The default for ets_duplicate_value is to return the raw value. */ static gpointer -ets_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) +ets_duplicate_value (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -907,7 +949,9 @@ ets_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) } static void -ets_free_value (ETreeModel *etm, gint col, gpointer value) +ets_free_value (ETreeModel *etm, + gint col, + gpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -915,7 +959,8 @@ ets_free_value (ETreeModel *etm, gint col, gpointer value) } static gpointer -ets_initialize_value (ETreeModel *etm, gint col) +ets_initialize_value (ETreeModel *etm, + gint col) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -923,7 +968,9 @@ ets_initialize_value (ETreeModel *etm, gint col) } static gboolean -ets_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) +ets_value_is_empty (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -931,7 +978,9 @@ ets_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) } static gchar * -ets_value_to_string (ETreeModel *etm, gint col, gconstpointer value) +ets_value_to_string (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -941,19 +990,23 @@ ets_value_to_string (ETreeModel *etm, gint col, gconstpointer value) /* Proxy functions */ static void -ets_proxy_pre_change (ETreeModel *etm, ETreeSorted *ets) +ets_proxy_pre_change (ETreeModel *etm, + ETreeSorted *ets) { e_tree_model_pre_change (E_TREE_MODEL (ets)); } static void -ets_proxy_no_change (ETreeModel *etm, ETreeSorted *ets) +ets_proxy_no_change (ETreeModel *etm, + ETreeSorted *ets) { e_tree_model_no_change (E_TREE_MODEL (ets)); } static void -ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) +ets_proxy_node_changed (ETreeModel *etm, + ETreePath node, + ETreeSorted *ets) { ets->priv->last_access = NULL; d(g_print("Setting last access %p. (ets_proxy_node_changed)\n", ets->priv->last_access)); @@ -984,7 +1037,9 @@ ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) } static void -ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) +ets_proxy_node_data_changed (ETreeModel *etm, + ETreePath node, + ETreeSorted *ets) { ETreeSortedPath *path = find_path (ets, node); @@ -998,7 +1053,10 @@ ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) } static void -ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSorted *ets) +ets_proxy_node_col_changed (ETreeModel *etm, + ETreePath node, + gint col, + ETreeSorted *ets) { ETreeSortedPath *path = find_path (ets, node); @@ -1015,7 +1073,10 @@ ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSort } static void -ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSorted *ets) +ets_proxy_node_inserted (ETreeModel *etm, + ETreePath parent, + ETreePath child, + ETreeSorted *ets) { ETreeSortedPath *parent_path = find_path (ets, parent); @@ -1083,7 +1144,11 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr } static void -ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeSorted *ets) +ets_proxy_node_removed (ETreeModel *etm, + ETreePath parent, + ETreePath child, + gint old_position, + ETreeSorted *ets) { ETreeSortedPath *parent_path = find_path (ets, parent); ETreeSortedPath *path; @@ -1120,13 +1185,17 @@ ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint } static void -ets_proxy_node_deleted (ETreeModel *etm, ETreePath child, ETreeSorted *ets) +ets_proxy_node_deleted (ETreeModel *etm, + ETreePath child, + ETreeSorted *ets) { e_tree_model_node_deleted (E_TREE_MODEL (ets), NULL); } static void -ets_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeSorted *ets) +ets_proxy_node_request_collapse (ETreeModel *etm, + ETreePath node, + ETreeSorted *ets) { ETreeSortedPath *path = find_path (ets, node); if (path) { @@ -1135,7 +1204,8 @@ ets_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeSorted *e } static void -ets_sort_info_changed (ETableSortInfo *sort_info, ETreeSorted *ets) +ets_sort_info_changed (ETableSortInfo *sort_info, + ETreeSorted *ets) { schedule_resort (ets, ets->priv->root, TRUE, TRUE); } @@ -1216,7 +1286,10 @@ e_tree_sorted_init (ETreeSorted *ets) * **/ void -e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_tree_sorted_construct (ETreeSorted *ets, + ETreeModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ets->priv->source = source; if (source) @@ -1228,24 +1301,33 @@ e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *ful e_tree_sorted_set_sort_info (ets, sort_info); - ets->priv->tree_model_pre_change_id = g_signal_connect (G_OBJECT (source), "pre_change", - G_CALLBACK (ets_proxy_pre_change), ets); - ets->priv->tree_model_no_change_id = g_signal_connect (G_OBJECT (source), "no_change", - G_CALLBACK (ets_proxy_no_change), ets); - ets->priv->tree_model_node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed", - G_CALLBACK (ets_proxy_node_changed), ets); - ets->priv->tree_model_node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed", - G_CALLBACK (ets_proxy_node_data_changed), ets); - ets->priv->tree_model_node_col_changed_id = g_signal_connect (G_OBJECT (source), "node_col_changed", - G_CALLBACK (ets_proxy_node_col_changed), ets); - ets->priv->tree_model_node_inserted_id = g_signal_connect (G_OBJECT (source), "node_inserted", - G_CALLBACK (ets_proxy_node_inserted), ets); - ets->priv->tree_model_node_removed_id = g_signal_connect (G_OBJECT (source), "node_removed", - G_CALLBACK (ets_proxy_node_removed), ets); - ets->priv->tree_model_node_deleted_id = g_signal_connect (G_OBJECT (source), "node_deleted", - G_CALLBACK (ets_proxy_node_deleted), ets); - ets->priv->tree_model_node_request_collapse_id = g_signal_connect (G_OBJECT (source), "node_request_collapse", - G_CALLBACK (ets_proxy_node_request_collapse), ets); + ets->priv->tree_model_pre_change_id = g_signal_connect ( + source, "pre_change", + G_CALLBACK (ets_proxy_pre_change), ets); + ets->priv->tree_model_no_change_id = g_signal_connect ( + source, "no_change", + G_CALLBACK (ets_proxy_no_change), ets); + ets->priv->tree_model_node_changed_id = g_signal_connect ( + source, "node_changed", + G_CALLBACK (ets_proxy_node_changed), ets); + ets->priv->tree_model_node_data_changed_id = g_signal_connect ( + source, "node_data_changed", + G_CALLBACK (ets_proxy_node_data_changed), ets); + ets->priv->tree_model_node_col_changed_id = g_signal_connect ( + source, "node_col_changed", + G_CALLBACK (ets_proxy_node_col_changed), ets); + ets->priv->tree_model_node_inserted_id = g_signal_connect ( + source, "node_inserted", + G_CALLBACK (ets_proxy_node_inserted), ets); + ets->priv->tree_model_node_removed_id = g_signal_connect ( + source, "node_removed", + G_CALLBACK (ets_proxy_node_removed), ets); + ets->priv->tree_model_node_deleted_id = g_signal_connect ( + source, "node_deleted", + G_CALLBACK (ets_proxy_node_deleted), ets); + ets->priv->tree_model_node_request_collapse_id = g_signal_connect ( + source, "node_request_collapse", + G_CALLBACK (ets_proxy_node_request_collapse), ets); } @@ -1257,7 +1339,9 @@ e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *ful * return values: a newly constructed ETreeSorted. */ ETreeSorted * -e_tree_sorted_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_tree_sorted_new (ETreeModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETreeSorted *ets = g_object_new (E_TYPE_TREE_SORTED, NULL); @@ -1267,8 +1351,8 @@ e_tree_sorted_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo } ETreePath -e_tree_sorted_view_to_model_path (ETreeSorted *ets, - ETreePath view_path) +e_tree_sorted_view_to_model_path (ETreeSorted *ets, + ETreePath view_path) { ETreeSortedPath *path = view_path; if (path) { @@ -1280,23 +1364,23 @@ e_tree_sorted_view_to_model_path (ETreeSorted *ets, } ETreePath -e_tree_sorted_model_to_view_path (ETreeSorted *ets, - ETreePath model_path) +e_tree_sorted_model_to_view_path (ETreeSorted *ets, + ETreePath model_path) { return find_or_create_path (ets, model_path); } gint -e_tree_sorted_orig_position (ETreeSorted *ets, - ETreePath path) +e_tree_sorted_orig_position (ETreeSorted *ets, + ETreePath path) { ETreeSortedPath *sorted_path = path; return sorted_path->orig_position; } gint -e_tree_sorted_node_num_children (ETreeSorted *ets, - ETreePath path) +e_tree_sorted_node_num_children (ETreeSorted *ets, + ETreePath path) { ETreeSortedPath *sorted_path = path; @@ -1308,7 +1392,8 @@ e_tree_sorted_node_num_children (ETreeSorted *ets, } void -e_tree_sorted_node_resorted (ETreeSorted *sorted, ETreePath node) +e_tree_sorted_node_resorted (ETreeSorted *sorted, + ETreePath node) { g_return_if_fail (sorted != NULL); g_return_if_fail (E_IS_TREE_SORTED (sorted)); @@ -1317,7 +1402,8 @@ e_tree_sorted_node_resorted (ETreeSorted *sorted, ETreePath node) } void -e_tree_sorted_set_sort_info (ETreeSorted *ets, ETableSortInfo *sort_info) +e_tree_sorted_set_sort_info (ETreeSorted *ets, + ETableSortInfo *sort_info) { g_return_if_fail (ets != NULL); @@ -1333,15 +1419,16 @@ e_tree_sorted_set_sort_info (ETreeSorted *ets, ETableSortInfo *sort_info) ets->priv->sort_info = sort_info; if (sort_info) { g_object_ref (sort_info); - ets->priv->sort_info_changed_id = g_signal_connect (G_OBJECT (ets->priv->sort_info), "sort_info_changed", - G_CALLBACK (ets_sort_info_changed), ets); + ets->priv->sort_info_changed_id = g_signal_connect ( + ets->priv->sort_info, "sort_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); } if (ets->priv->root) schedule_resort (ets, ets->priv->root, TRUE, TRUE); } -ETableSortInfo* +ETableSortInfo * e_tree_sorted_get_sort_info (ETreeSorted *ets) { return ets->priv->sort_info; diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 4cfd74fe68..1b87211c7b 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -98,7 +98,8 @@ struct _ETreeTableAdapterPrivate { static void etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta); static GNode * -lookup_gnode (ETreeTableAdapter *etta, ETreePath path) +lookup_gnode (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode; @@ -111,7 +112,8 @@ lookup_gnode (ETreeTableAdapter *etta, ETreePath path) } static void -resize_map (ETreeTableAdapter *etta, gint size) +resize_map (ETreeTableAdapter *etta, + gint size) { if (size > etta->priv->n_vals_allocated) { etta->priv->n_vals_allocated = MAX (etta->priv->n_vals_allocated + INCREMENT_AMOUNT, size); @@ -122,7 +124,10 @@ resize_map (ETreeTableAdapter *etta, gint size) } static void -move_map_elements (ETreeTableAdapter *etta, gint to, gint from, gint count) +move_map_elements (ETreeTableAdapter *etta, + gint to, + gint from, + gint count) { if (count <= 0 || from >= etta->priv->n_map) return; @@ -131,7 +136,9 @@ move_map_elements (ETreeTableAdapter *etta, gint to, gint from, gint count) } static gint -fill_map (ETreeTableAdapter *etta, gint index, GNode *gnode) +fill_map (ETreeTableAdapter *etta, + gint index, + GNode *gnode) { GNode *p; @@ -155,7 +162,8 @@ remap_indices (ETreeTableAdapter *etta) } static node_t * -get_node (ETreeTableAdapter *etta, ETreePath path) +get_node (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode = lookup_gnode (etta, path); @@ -166,7 +174,9 @@ get_node (ETreeTableAdapter *etta, ETreePath path) } static void -resort_node (ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) +resort_node (ETreeTableAdapter *etta, + GNode *gnode, + gboolean recurse) { node_t *node = (node_t *) gnode->data; ETreePath *paths, path; @@ -217,7 +227,8 @@ resort_node (ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) } static gint -get_row (ETreeTableAdapter *etta, ETreePath path) +get_row (ETreeTableAdapter *etta, + ETreePath path) { node_t *node = get_node (etta, path); if (!node) @@ -230,7 +241,8 @@ get_row (ETreeTableAdapter *etta, ETreePath path) } static ETreePath -get_path (ETreeTableAdapter *etta, gint row) +get_path (ETreeTableAdapter *etta, + gint row) { if (row == -1 && etta->priv->n_map > 0) row = etta->priv->n_map - 1; @@ -241,7 +253,8 @@ get_path (ETreeTableAdapter *etta, gint row) } static void -kill_gnode (GNode *node, ETreeTableAdapter *etta) +kill_gnode (GNode *node, + ETreeTableAdapter *etta) { g_hash_table_remove (etta->priv->nodes, ((node_t *) node->data)->path); @@ -258,7 +271,8 @@ kill_gnode (GNode *node, ETreeTableAdapter *etta) } static void -update_child_counts (GNode *gnode, gint delta) +update_child_counts (GNode *gnode, + gint delta) { while (gnode) { node_t *node = (node_t *) gnode->data; @@ -268,7 +282,8 @@ update_child_counts (GNode *gnode, gint delta) } static gint -delete_children (ETreeTableAdapter *etta, GNode *gnode) +delete_children (ETreeTableAdapter *etta, + GNode *gnode) { node_t *node = (node_t *) gnode->data; gint to_remove = node ? node->num_visible_children : 0; @@ -286,7 +301,9 @@ delete_children (ETreeTableAdapter *etta, GNode *gnode) } static void -delete_node (ETreeTableAdapter *etta, ETreePath parent, ETreePath path) +delete_node (ETreeTableAdapter *etta, + ETreePath parent, + ETreePath path) { gint to_remove = 1; gint parent_row = get_row (etta, parent); @@ -325,7 +342,8 @@ delete_node (ETreeTableAdapter *etta, ETreePath parent, ETreePath path) } static GNode * -create_gnode (ETreeTableAdapter *etta, ETreePath path) +create_gnode (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode; node_t *node; @@ -343,7 +361,8 @@ create_gnode (ETreeTableAdapter *etta, ETreePath path) } static gint -insert_children (ETreeTableAdapter *etta, GNode *gnode) +insert_children (ETreeTableAdapter *etta, + GNode *gnode) { ETreePath path, tmp; gint count = 0; @@ -365,7 +384,8 @@ insert_children (ETreeTableAdapter *etta, GNode *gnode) } static void -generate_tree (ETreeTableAdapter *etta, ETreePath path) +generate_tree (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode; node_t *node; @@ -394,7 +414,9 @@ generate_tree (ETreeTableAdapter *etta, ETreePath path) } static void -insert_node (ETreeTableAdapter *etta, ETreePath parent, ETreePath path) +insert_node (ETreeTableAdapter *etta, + ETreePath parent, + ETreePath path) { GNode *gnode, *parent_gnode; node_t *node, *parent_node; @@ -467,7 +489,8 @@ typedef struct { } check_expanded_closure; static gboolean -check_expanded (GNode *gnode, gpointer data) +check_expanded (GNode *gnode, + gpointer data) { check_expanded_closure *closure = (check_expanded_closure *) data; node_t *node = (node_t *) gnode->data; @@ -479,7 +502,8 @@ check_expanded (GNode *gnode, gpointer data) } static void -update_node (ETreeTableAdapter *etta, ETreePath path) +update_node (ETreeTableAdapter *etta, + ETreePath path) { check_expanded_closure closure; ETreePath parent = e_tree_model_node_get_parent (etta->priv->source, path); @@ -595,7 +619,8 @@ etta_has_save_id (ETableModel *etm) } static gchar * -etta_get_save_id (ETableModel *etm, gint row) +etta_get_save_id (ETableModel *etm, + gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -619,7 +644,9 @@ etta_row_count (ETableModel *etm) } static gpointer -etta_value_at (ETableModel *etm, gint col, gint row) +etta_value_at (ETableModel *etm, + gint col, + gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -638,7 +665,10 @@ etta_value_at (ETableModel *etm, gint col, gint row) } static void -etta_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etta_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -646,7 +676,9 @@ etta_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etta_is_cell_editable (ETableModel *etm, gint col, gint row) +etta_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -654,12 +686,16 @@ etta_is_cell_editable (ETableModel *etm, gint col, gint row) } static void -etta_append_row (ETableModel *etm, ETableModel *source, gint row) +etta_append_row (ETableModel *etm, + ETableModel *source, + gint row) { } static gpointer -etta_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etta_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -667,7 +703,9 @@ etta_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etta_free_value (ETableModel *etm, gint col, gpointer value) +etta_free_value (ETableModel *etm, + gint col, + gpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -675,7 +713,8 @@ etta_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etta_initialize_value (ETableModel *etm, gint col) +etta_initialize_value (ETableModel *etm, + gint col) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -683,7 +722,9 @@ etta_initialize_value (ETableModel *etm, gint col) } static gboolean -etta_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etta_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -691,7 +732,9 @@ etta_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etta_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etta_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -752,19 +795,22 @@ etta_init (ETreeTableAdapter *etta) } static void -etta_proxy_pre_change (ETreeModel *etm, ETreeTableAdapter *etta) +etta_proxy_pre_change (ETreeModel *etm, + ETreeTableAdapter *etta) { e_table_model_pre_change (E_TABLE_MODEL (etta)); } static void -etta_proxy_no_change (ETreeModel *etm, ETreeTableAdapter *etta) +etta_proxy_no_change (ETreeModel *etm, + ETreeTableAdapter *etta) { e_table_model_no_change (E_TABLE_MODEL (etta)); } static void -etta_proxy_rebuilt (ETreeModel *etm, ETreeTableAdapter *etta) +etta_proxy_rebuilt (ETreeModel *etm, + ETreeTableAdapter *etta) { if (!etta->priv->root) return; @@ -783,7 +829,9 @@ resort_model (ETreeTableAdapter *etta) } static void -etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta) +etta_proxy_node_changed (ETreeModel *etm, + ETreePath path, + ETreeTableAdapter *etta) { update_node (etta, path); e_table_model_changed (E_TABLE_MODEL (etta)); @@ -796,7 +844,9 @@ etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *ett } static void -etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta) +etta_proxy_node_data_changed (ETreeModel *etm, + ETreePath path, + ETreeTableAdapter *etta) { gint row = get_row (etta, path); @@ -809,7 +859,10 @@ etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter } static void -etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, gint col, ETreeTableAdapter *etta) +etta_proxy_node_col_changed (ETreeModel *etm, + ETreePath path, + gint col, + ETreeTableAdapter *etta) { gint row = get_row (etta, path); @@ -822,7 +875,10 @@ etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, gint col, ETreeTab } static void -etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeTableAdapter *etta) +etta_proxy_node_inserted (ETreeModel *etm, + ETreePath parent, + ETreePath child, + ETreeTableAdapter *etta) { if (e_tree_model_node_is_root (etm, child)) generate_tree (etta, child); @@ -833,26 +889,33 @@ etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ET } static void -etta_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeTableAdapter *etta) +etta_proxy_node_removed (ETreeModel *etm, + ETreePath parent, + ETreePath child, + gint old_position, + ETreeTableAdapter *etta) { delete_node (etta, parent, child); e_table_model_changed (E_TABLE_MODEL (etta)); } static void -etta_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeTableAdapter *etta) +etta_proxy_node_request_collapse (ETreeModel *etm, + ETreePath node, + ETreeTableAdapter *etta) { e_tree_table_adapter_node_set_expanded (etta, node, FALSE); } static void -etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta) +etta_sort_info_changed (ETableSortInfo *sort_info, + ETreeTableAdapter *etta) { if (!etta->priv->root) return; /* the function is called also internally, with sort_info = NULL, - thus skip those in signal emit */ + * thus skip those in signal emit */ if (sort_info) { gboolean handled = FALSE; @@ -869,7 +932,10 @@ etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta) } ETableModel * -e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *header) +e_tree_table_adapter_construct (ETreeTableAdapter *etta, + ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *header) { ETreePath root; @@ -879,8 +945,9 @@ e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETa etta->priv->sort_info = sort_info; if (sort_info) { g_object_ref (sort_info); - etta->priv->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", - G_CALLBACK (etta_sort_info_changed), etta); + etta->priv->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (etta_sort_info_changed), etta); } etta->priv->header = header; @@ -894,30 +961,41 @@ e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETa if (root) generate_tree (etta, root); - etta->priv->pre_change_id = g_signal_connect(G_OBJECT(source), "pre_change", - G_CALLBACK (etta_proxy_pre_change), etta); - etta->priv->no_change_id = g_signal_connect (G_OBJECT (source), "no_change", - G_CALLBACK (etta_proxy_no_change), etta); - etta->priv->rebuilt_id = g_signal_connect (G_OBJECT (source), "rebuilt", - G_CALLBACK (etta_proxy_rebuilt), etta); - etta->priv->node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed", - G_CALLBACK (etta_proxy_node_changed), etta); - etta->priv->node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed", - G_CALLBACK (etta_proxy_node_data_changed), etta); - etta->priv->node_col_changed_id = g_signal_connect (G_OBJECT (source), "node_col_changed", - G_CALLBACK (etta_proxy_node_col_changed), etta); - etta->priv->node_inserted_id = g_signal_connect (G_OBJECT (source), "node_inserted", - G_CALLBACK (etta_proxy_node_inserted), etta); - etta->priv->node_removed_id = g_signal_connect (G_OBJECT (source), "node_removed", - G_CALLBACK (etta_proxy_node_removed), etta); - etta->priv->node_request_collapse_id = g_signal_connect (G_OBJECT (source), "node_request_collapse", - G_CALLBACK (etta_proxy_node_request_collapse), etta); + etta->priv->pre_change_id = g_signal_connect ( + source, "pre_change", + G_CALLBACK (etta_proxy_pre_change), etta); + etta->priv->no_change_id = g_signal_connect ( + source, "no_change", + G_CALLBACK (etta_proxy_no_change), etta); + etta->priv->rebuilt_id = g_signal_connect ( + source, "rebuilt", + G_CALLBACK (etta_proxy_rebuilt), etta); + etta->priv->node_changed_id = g_signal_connect ( + source, "node_changed", + G_CALLBACK (etta_proxy_node_changed), etta); + etta->priv->node_data_changed_id = g_signal_connect ( + source, "node_data_changed", + G_CALLBACK (etta_proxy_node_data_changed), etta); + etta->priv->node_col_changed_id = g_signal_connect ( + source, "node_col_changed", + G_CALLBACK (etta_proxy_node_col_changed), etta); + etta->priv->node_inserted_id = g_signal_connect ( + source, "node_inserted", + G_CALLBACK (etta_proxy_node_inserted), etta); + etta->priv->node_removed_id = g_signal_connect ( + source, "node_removed", + G_CALLBACK (etta_proxy_node_removed), etta); + etta->priv->node_request_collapse_id = g_signal_connect ( + source, "node_request_collapse", + G_CALLBACK (etta_proxy_node_request_collapse), etta); return E_TABLE_MODEL (etta); } ETableModel * -e_tree_table_adapter_new (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *header) +e_tree_table_adapter_new (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *header) { ETreeTableAdapter *etta = g_object_new (E_TYPE_TREE_TABLE_ADAPTER, NULL); @@ -933,7 +1011,9 @@ typedef struct { } TreeAndRoot; static void -save_expanded_state_func (gpointer keyp, gpointer value, gpointer data) +save_expanded_state_func (gpointer keyp, + gpointer value, + gpointer data) { ETreePath path = keyp; node_t *node = ((GNode *) value)->data; @@ -974,7 +1054,8 @@ e_tree_table_adapter_save_expanded_state_xml (ETreeTableAdapter *etta) } void -e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const gchar *filename) +e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, + const gchar *filename) { xmlDoc *doc; @@ -988,7 +1069,8 @@ e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const gchar * } static xmlDoc * -open_file (ETreeTableAdapter *etta, const gchar *filename) +open_file (ETreeTableAdapter *etta, + const gchar *filename) { xmlDoc *doc; xmlNode *root; @@ -1034,7 +1116,8 @@ open_file (ETreeTableAdapter *etta, const gchar *filename) /* state: <0 ... collapse; 0 ... use default; >0 ... expand */ void -e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, gint state) +e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, + gint state) { g_return_if_fail (etta != NULL); @@ -1042,7 +1125,8 @@ e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, gint state) } void -e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *doc) +e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, + xmlDoc *doc) { xmlNode *root, *child; gboolean model_default; @@ -1104,7 +1188,8 @@ e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *d } void -e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const gchar *filename) +e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, + const gchar *filename) { xmlDoc *doc; @@ -1120,7 +1205,8 @@ e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const gchar * } void -e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean visible) +e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, + gboolean visible) { gint size; @@ -1145,7 +1231,9 @@ e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean vi } void -e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, gboolean expanded) +e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, + ETreePath path, + gboolean expanded) { GNode *gnode = lookup_gnode (etta, path); node_t *node; @@ -1203,7 +1291,9 @@ e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, } void -e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePath path, gboolean expanded) +e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, + ETreePath path, + gboolean expanded) { ETreePath children; @@ -1217,13 +1307,15 @@ e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePa } ETreePath -e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, gint row) +e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, + gint row) { return get_path (etta, row); } gint -e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, + ETreePath path) { return get_row (etta, path); } @@ -1235,7 +1327,8 @@ e_tree_table_adapter_root_node_is_visible (ETreeTableAdapter *etta) } void -e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_show_node (ETreeTableAdapter *etta, + ETreePath path) { ETreePath parent; @@ -1248,7 +1341,8 @@ e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path) } gboolean -e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, + ETreePath path) { node_t *node = get_node (etta, path); if (!e_tree_model_node_is_expandable (etta->priv->source, path) || !node) @@ -1258,7 +1352,8 @@ e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path) } void -e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, ETableSortInfo *sort_info) +e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, + ETableSortInfo *sort_info) { if (etta->priv->sort_info) { g_signal_handler_disconnect (G_OBJECT (etta->priv->sort_info), @@ -1269,8 +1364,9 @@ e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, ETableSortInfo *sor etta->priv->sort_info = sort_info; if (sort_info) { g_object_ref (sort_info); - etta->priv->sort_info_changed_id = g_signal_connect(G_OBJECT(sort_info), "sort_info_changed", - G_CALLBACK (etta_sort_info_changed), etta); + etta->priv->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (etta_sort_info_changed), etta); } if (!etta->priv->root) @@ -1299,7 +1395,8 @@ e_tree_table_adapter_get_header (ETreeTableAdapter *etta) } ETreePath -e_tree_table_adapter_node_get_next (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_node_get_next (ETreeTableAdapter *etta, + ETreePath path) { GNode *node = lookup_gnode (etta, path); diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 996a6b1e51..770b2ad653 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -303,13 +303,15 @@ e_tree_state_change (ETree *et) } static void -change_trigger (GObject *object, ETree *et) +change_trigger (GObject *object, + ETree *et) { e_tree_state_change (et); } static void -search_col_change_trigger (GObject *object, ETree *et) +search_col_change_trigger (GObject *object, + ETree *et) { clear_current_search_col (et); e_tree_state_change (et); @@ -343,7 +345,8 @@ disconnect_header (ETree *e_tree) } static void -connect_header (ETree *e_tree, ETableState *state) +connect_header (ETree *e_tree, + ETableState *state) { GValue *val = g_new0 (GValue, 1); @@ -489,7 +492,9 @@ typedef struct { } SearchSearchStruct; static gboolean -search_search_callback (ETreeModel *model, ETreePath path, gpointer data) +search_search_callback (ETreeModel *model, + ETreePath path, + gpointer data) { SearchSearchStruct *cb_data = data; gconstpointer value; @@ -561,7 +566,8 @@ et_search_search (ETableSearch *search, } static void -et_search_accept (ETableSearch *search, ETree *et) +et_search_accept (ETableSearch *search, + ETree *et) { ETableCol *col = current_search_col (et); gint cursor; @@ -609,12 +615,13 @@ e_tree_init (ETree *e_tree) e_tree->priv->search = e_table_search_new (); - e_tree->priv->search_search_id = - g_signal_connect (G_OBJECT (e_tree->priv->search), "search", - G_CALLBACK (et_search_search), e_tree); - e_tree->priv->search_accept_id = - g_signal_connect (G_OBJECT (e_tree->priv->search), "accept", - G_CALLBACK (et_search_accept), e_tree); + e_tree->priv->search_search_id = g_signal_connect ( + e_tree->priv->search, "search", + G_CALLBACK (et_search_search), e_tree); + + e_tree->priv->search_accept_id = g_signal_connect ( + e_tree->priv->search, "accept", + G_CALLBACK (et_search_accept), e_tree); e_tree->priv->always_search = g_getenv ("GAL_ALWAYS_SEARCH") ? TRUE : FALSE; } @@ -632,7 +639,8 @@ et_grab_focus (GtkWidget *widget) /* Focus handler for the ETree */ static gint -et_focus (GtkWidget *container, GtkDirectionType direction) +et_focus (GtkWidget *container, + GtkDirectionType direction) { ETree *e_tree; @@ -670,7 +678,9 @@ set_header_canvas_width (ETree *e_tree) } static void -header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_tree) +header_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETree *e_tree) { GtkAllocation allocation; @@ -680,9 +690,9 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_t gtk_widget_get_allocation (widget, &allocation); /* When the header item is created ->height == 0, - as the font is only created when everything is realized. - So we set the usize here as well, so that the size of the - header is correct */ + * as the font is only created when everything is realized. + * So we set the usize here as well, so that the size of the + * header is correct */ if (allocation.height != E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height) gtk_widget_set_size_request ( widget, -1, @@ -804,8 +814,9 @@ tree_canvas_reflow_idle (ETree *e_tree) } static void -tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, - ETree *e_tree) +tree_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETree *e_tree) { gdouble width; gdouble height; @@ -831,7 +842,8 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, } static void -tree_canvas_reflow (GnomeCanvas *canvas, ETree *e_tree) +tree_canvas_reflow (GnomeCanvas *canvas, + ETree *e_tree) { if (!e_tree->priv->reflow_idle_id) e_tree->priv->reflow_idle_id = g_idle_add_full ( @@ -840,7 +852,9 @@ tree_canvas_reflow (GnomeCanvas *canvas, ETree *e_tree) } static void -item_cursor_change (ETableItem *eti, gint row, ETree *et) +item_cursor_change (ETableItem *eti, + gint row, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -848,7 +862,9 @@ item_cursor_change (ETableItem *eti, gint row, ETree *et) } static void -item_cursor_activated (ETableItem *eti, gint row, ETree *et) +item_cursor_activated (ETableItem *eti, + gint row, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -856,7 +872,11 @@ item_cursor_activated (ETableItem *eti, gint row, ETree *et) } static void -item_double_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_double_click (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -864,7 +884,11 @@ item_double_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree * } static gboolean -item_right_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_right_click (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); gboolean return_val = 0; @@ -877,7 +901,11 @@ item_right_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *e } static gboolean -item_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_click (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { gboolean return_val = 0; ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -889,7 +917,11 @@ item_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) } static gint -item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_key_press (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { gint return_val = 0; GdkEventKey *key = (GdkEventKey *) event; @@ -1000,7 +1032,11 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) } static gint -item_start_drag (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_start_drag (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { ETreePath path; gint return_val = 0; @@ -1015,7 +1051,8 @@ item_start_drag (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et } static void -et_selection_model_selection_changed (ETableSelectionModel *etsm, ETree *et) +et_selection_model_selection_changed (ETableSelectionModel *etsm, + ETree *et) { g_signal_emit (et, et_signals[SELECTION_CHANGE], 0); } @@ -1064,7 +1101,8 @@ et_build_item (ETree *et) } static void -et_canvas_style_set (GtkWidget *widget, GtkStyle *prev_style) +et_canvas_style_set (GtkWidget *widget, + GtkStyle *prev_style) { GtkStyle *style; @@ -1077,7 +1115,9 @@ et_canvas_style_set (GtkWidget *widget, GtkStyle *prev_style) } static gboolean -white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETree *e_tree) +white_item_event (GnomeCanvasItem *white_item, + GdkEvent *event, + ETree *e_tree) { gboolean return_val = 0; g_signal_emit (e_tree, @@ -1087,7 +1127,9 @@ white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETree *e_tree) } static gint -et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree) +et_canvas_root_event (GnomeCanvasItem *root, + GdkEvent *event, + ETree *e_tree) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -1115,7 +1157,9 @@ et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree) * and give the focus to some ETableItem. */ static gint -table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data) +table_canvas_focus_event_cb (GtkWidget *widget, + GdkEventFocus *event, + gpointer data) { GnomeCanvas *canvas; ETree *tree; @@ -1213,7 +1257,8 @@ e_tree_setup_table (ETree *e_tree) * search column is cleared. */ void -e_tree_set_search_column (ETree *e_tree, gint col) +e_tree_set_search_column (ETree *e_tree, + gint col) { if (col == -1) { clear_current_search_col (e_tree); @@ -1226,7 +1271,8 @@ e_tree_set_search_column (ETree *e_tree, gint col) } void -e_tree_set_state_object (ETree *e_tree, ETableState *state) +e_tree_set_state_object (ETree *e_tree, + ETableState *state) { GValue *val; GtkAllocation allocation; @@ -1271,8 +1317,8 @@ e_tree_set_state_object (ETree *e_tree, ETableState *state) * #ETree object. */ void -e_tree_set_state (ETree *e_tree, - const gchar *state_str) +e_tree_set_state (ETree *e_tree, + const gchar *state_str) { ETableState *state; @@ -1298,8 +1344,8 @@ e_tree_set_state (ETree *e_tree, * @e_tree object. */ void -e_tree_load_state (ETree *e_tree, - const gchar *filename) +e_tree_load_state (ETree *e_tree, + const gchar *filename) { ETableState *state; @@ -1388,8 +1434,8 @@ e_tree_get_state (ETree *e_tree) * @filename. **/ void -e_tree_save_state (ETree *e_tree, - const gchar *filename) +e_tree_save_state (ETree *e_tree, + const gchar *filename) { ETableState *state; @@ -1413,26 +1459,35 @@ e_tree_get_spec (ETree *e_tree) } static void -et_table_model_changed (ETableModel *model, ETree *et) +et_table_model_changed (ETableModel *model, + ETree *et) { if (et->priv->horizontal_scrolling) e_table_header_update_horizontal (et->priv->header); } static void -et_table_row_changed (ETableModel *table_model, gint row, ETree *et) +et_table_row_changed (ETableModel *table_model, + gint row, + ETree *et) { et_table_model_changed (table_model, et); } static void -et_table_cell_changed (ETableModel *table_model, gint view_col, gint row, ETree *et) +et_table_cell_changed (ETableModel *table_model, + gint view_col, + gint row, + ETree *et) { et_table_model_changed (table_model, et); } static void -et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETree *et) +et_table_rows_deleted (ETableModel *table_model, + gint row, + gint count, + ETree *et) { ETreePath * node, * prev_node; @@ -1441,7 +1496,7 @@ et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETree *et || row == 0) return; - prev_node = e_tree_node_at_row (et, row-1); + prev_node = e_tree_node_at_row (et, row - 1); node = e_tree_get_cursor (et); /* Check if the cursor is a child of the node directly before the @@ -1479,8 +1534,11 @@ et_connect_to_etta (ETree *et) } static gboolean -et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - ETableSpecification *specification, ETableState *state) +et_real_construct (ETree *e_tree, + ETreeModel *etm, + ETableExtras *ete, + ETableSpecification *specification, + ETableState *state) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -1525,9 +1583,9 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, "cursor_mode", specification->cursor_mode, NULL); - g_signal_connect(e_tree->priv->selection, "selection_changed", + g_signal_connect (e_tree->priv->selection, "selection_changed", G_CALLBACK (et_selection_model_selection_changed), e_tree); - g_signal_connect(e_tree->priv->selection, "selection_row_changed", + g_signal_connect (e_tree->priv->selection, "selection_row_changed", G_CALLBACK (et_selection_model_selection_row_changed), e_tree); if (!specification->no_headers) { @@ -1578,8 +1636,11 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, * Return value: %TRUE on success, %FALSE if an error occurred **/ gboolean -e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const gchar *spec_str, const gchar *state_str) +e_tree_construct (ETree *e_tree, + ETreeModel *etm, + ETableExtras *ete, + const gchar *spec_str, + const gchar *state_str) { ETableSpecification *specification; ETableState *state; @@ -1637,8 +1698,11 @@ e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, * Return value: %TRUE on success, %FALSE if an error occurred **/ gboolean -e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const gchar *spec_fn, const gchar *state_fn) +e_tree_construct_from_spec_file (ETree *e_tree, + ETreeModel *etm, + ETableExtras *ete, + const gchar *spec_fn, + const gchar *state_fn) { ETableSpecification *specification; ETableState *state; @@ -1707,7 +1771,10 @@ e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *e * The newly created #ETree or %NULL if there's an error. **/ GtkWidget * -e_tree_new (ETreeModel *etm, ETableExtras *ete, const gchar *spec, const gchar *state) +e_tree_new (ETreeModel *etm, + ETableExtras *ete, + const gchar *spec, + const gchar *state) { ETree *e_tree; @@ -1779,7 +1846,8 @@ e_tree_show_cursor_after_reflow (ETree *e_tree) } void -e_tree_set_cursor (ETree *e_tree, ETreePath path) +e_tree_set_cursor (ETree *e_tree, + ETreePath path) { #ifndef E_TREE_USE_TREE_SELECTION gint row; @@ -1829,9 +1897,9 @@ e_tree_get_cursor (ETree *e_tree) } void -e_tree_selected_row_foreach (ETree *e_tree, - EForeachFunc callback, - gpointer closure) +e_tree_selected_row_foreach (ETree *e_tree, + EForeachFunc callback, + gpointer closure) { g_return_if_fail (e_tree != NULL); g_return_if_fail (E_IS_TREE (e_tree)); @@ -1843,9 +1911,9 @@ e_tree_selected_row_foreach (ETree *e_tree, #ifdef E_TREE_USE_TREE_SELECTION void -e_tree_selected_path_foreach (ETree *e_tree, - ETreeForeachFunc callback, - gpointer closure) +e_tree_selected_path_foreach (ETree *e_tree, + ETreeForeachFunc callback, + gpointer closure) { g_return_if_fail (e_tree != NULL); g_return_if_fail (E_IS_TREE (e_tree)); @@ -1858,9 +1926,9 @@ e_tree_selected_path_foreach (ETree *e_tree, /* Standard functions */ static void et_foreach_recurse (ETreeModel *model, - ETreePath path, - ETreeForeachFunc callback, - gpointer closure) + ETreePath path, + ETreeForeachFunc callback, + gpointer closure) { ETreePath child; @@ -1874,8 +1942,8 @@ et_foreach_recurse (ETreeModel *model, void e_tree_path_foreach (ETree *e_tree, - ETreeForeachFunc callback, - gpointer closure) + ETreeForeachFunc callback, + gpointer closure) { ETreePath root; @@ -1903,13 +1971,13 @@ e_tree_get_printable (ETree *e_tree) static void et_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETree *etree = E_TREE (object); - switch (prop_id) { + switch (property_id) { case PROP_ETTA: g_value_set_object (value, etree->priv->etta); break; @@ -1952,7 +2020,7 @@ et_get_property (GObject *object, g_value_set_enum (value, 0); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1964,13 +2032,13 @@ typedef struct { static void et_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETree *etree = E_TREE (object); - switch (prop_id) { + switch (property_id) { case PROP_LENGTH_THRESHOLD: etree->priv->length_threshold = g_value_get_int (value); if (etree->priv->item) { @@ -2051,8 +2119,8 @@ et_set_property (GObject *object, } gint -e_tree_get_next_row (ETree *e_tree, - gint model_row) +e_tree_get_next_row (ETree *e_tree, + gint model_row) { g_return_val_if_fail (e_tree != NULL, -1); g_return_val_if_fail (E_IS_TREE (e_tree), -1); @@ -2079,8 +2147,8 @@ e_tree_get_next_row (ETree *e_tree, } gint -e_tree_get_prev_row (ETree *e_tree, - gint model_row) +e_tree_get_prev_row (ETree *e_tree, + gint model_row) { g_return_val_if_fail (e_tree != NULL, -1); g_return_val_if_fail (E_IS_TREE (e_tree), -1); @@ -2098,8 +2166,8 @@ e_tree_get_prev_row (ETree *e_tree, } gint -e_tree_model_to_view_row (ETree *e_tree, - gint model_row) +e_tree_model_to_view_row (ETree *e_tree, + gint model_row) { g_return_val_if_fail (e_tree != NULL, -1); g_return_val_if_fail (E_IS_TREE (e_tree), -1); @@ -2111,8 +2179,8 @@ e_tree_model_to_view_row (ETree *e_tree, } gint -e_tree_view_to_model_row (ETree *e_tree, - gint view_row) +e_tree_view_to_model_row (ETree *e_tree, + gint view_row) { g_return_val_if_fail (e_tree != NULL, -1); g_return_val_if_fail (E_IS_TREE (e_tree), -1); @@ -2124,7 +2192,8 @@ e_tree_view_to_model_row (ETree *e_tree, } gboolean -e_tree_node_is_expanded (ETree *et, ETreePath path) +e_tree_node_is_expanded (ETree *et, + ETreePath path) { g_return_val_if_fail (path, FALSE); @@ -2132,7 +2201,9 @@ e_tree_node_is_expanded (ETree *et, ETreePath path) } void -e_tree_node_set_expanded (ETree *et, ETreePath path, gboolean expanded) +e_tree_node_set_expanded (ETree *et, + ETreePath path, + gboolean expanded) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2141,7 +2212,9 @@ e_tree_node_set_expanded (ETree *et, ETreePath path, gboolean expanded) } void -e_tree_node_set_expanded_recurse (ETree *et, ETreePath path, gboolean expanded) +e_tree_node_set_expanded_recurse (ETree *et, + ETreePath path, + gboolean expanded) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2150,7 +2223,8 @@ e_tree_node_set_expanded_recurse (ETree *et, ETreePath path, gboolean expanded) } void -e_tree_root_node_set_visible (ETree *et, gboolean visible) +e_tree_root_node_set_visible (ETree *et, + gboolean visible) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2159,7 +2233,8 @@ e_tree_root_node_set_visible (ETree *et, gboolean visible) } ETreePath -e_tree_node_at_row (ETree *et, gint row) +e_tree_node_at_row (ETree *et, + gint row) { ETreePath path; @@ -2169,7 +2244,8 @@ e_tree_node_at_row (ETree *et, gint row) } gint -e_tree_row_of_node (ETree *et, ETreePath path) +e_tree_row_of_node (ETree *et, + ETreePath path) { return e_tree_table_adapter_row_of_node (et->priv->etta, path); } @@ -2181,7 +2257,8 @@ e_tree_root_node_is_visible (ETree *et) } void -e_tree_show_node (ETree *et, ETreePath path) +e_tree_show_node (ETree *et, + ETreePath path) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2190,7 +2267,8 @@ e_tree_show_node (ETree *et, ETreePath path) } void -e_tree_save_expanded_state (ETree *et, gchar *filename) +e_tree_save_expanded_state (ETree *et, + gchar *filename) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2199,7 +2277,8 @@ e_tree_save_expanded_state (ETree *et, gchar *filename) } void -e_tree_load_expanded_state (ETree *et, gchar *filename) +e_tree_load_expanded_state (ETree *et, + gchar *filename) { e_tree_table_adapter_load_expanded_state (et->priv->etta, filename); } @@ -2214,7 +2293,8 @@ e_tree_save_expanded_state_xml (ETree *et) } void -e_tree_load_expanded_state_xml (ETree *et, xmlDoc *doc) +e_tree_load_expanded_state_xml (ETree *et, + xmlDoc *doc) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2224,10 +2304,11 @@ e_tree_load_expanded_state_xml (ETree *et, xmlDoc *doc) } /* state: <0 ... collapse; 0 ... no force - use default; >0 ... expand; - when using this, be sure to reset to 0 once no forcing is required - anymore, aka the build of the tree is done */ + * when using this, be sure to reset to 0 once no forcing is required + * anymore, aka the build of the tree is done */ void -e_tree_force_expanded_state (ETree *et, gint state) +e_tree_force_expanded_state (ETree *et, + gint state) { e_tree_table_adapter_force_expanded_state (et->priv->etta, state); } @@ -2245,7 +2326,11 @@ e_tree_get_tooltip (ETree *et) } static ETreePath -find_next_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointer data) +find_next_in_range (ETree *et, + gint start, + gint end, + ETreePathFunc func, + gpointer data) { ETreePath path; gint row; @@ -2260,7 +2345,11 @@ find_next_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointe } static ETreePath -find_prev_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointer data) +find_prev_in_range (ETree *et, + gint start, + gint end, + ETreePathFunc func, + gpointer data) { ETreePath path; gint row; @@ -2372,7 +2461,7 @@ e_tree_get_table_adapter (ETree *et) } ETableItem * -e_tree_get_item (ETree * et) +e_tree_get_item (ETree *et) { g_return_val_if_fail (et != NULL, NULL); g_return_val_if_fail (E_IS_TREE (et), NULL); @@ -2381,7 +2470,7 @@ e_tree_get_item (ETree * et) } GnomeCanvasItem * -e_tree_get_header_item (ETree * et) +e_tree_get_header_item (ETree *et) { g_return_val_if_fail (et != NULL, NULL); g_return_val_if_fail (E_IS_TREE (et), NULL); @@ -2458,12 +2547,12 @@ struct _GtkDragSourceInfo /* Target */ void -e_tree_drag_get_data (ETree *tree, - gint row, - gint col, - GdkDragContext *context, - GdkAtom target, - guint32 time) +e_tree_drag_get_data (ETree *tree, + gint row, + gint col, + GdkDragContext *context, + GdkAtom target, + guint32 time) { g_return_if_fail (tree != NULL); g_return_if_fail (E_IS_TREE (tree)); @@ -2486,8 +2575,8 @@ e_tree_drag_get_data (ETree *tree, */ void e_tree_drag_highlight (ETree *tree, - gint row, - gint col) + gint row, + gint col) { GtkAllocation allocation; GtkAdjustment *adjustment; @@ -2596,7 +2685,11 @@ e_tree_drag_dest_unset (GtkWidget *widget) /* Source side */ static gint -et_real_start_drag (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event) +et_real_start_drag (ETree *tree, + gint row, + ETreePath path, + gint col, + GdkEvent *event) { GtkDragSourceInfo *info; GdkDragContext *context; @@ -2629,11 +2722,11 @@ et_real_start_drag (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *e } void -e_tree_drag_source_set (ETree *tree, - GdkModifierType start_button_mask, - const GtkTargetEntry *targets, - gint n_targets, - GdkDragAction actions) +e_tree_drag_source_set (ETree *tree, + GdkModifierType start_button_mask, + const GtkTargetEntry *targets, + gint n_targets, + GdkDragAction actions) { ETreeDragSourceSite *site; GtkWidget *canvas; @@ -2692,13 +2785,13 @@ e_tree_drag_source_unset (ETree *tree) */ GdkDragContext * -e_tree_drag_begin (ETree *tree, - gint row, - gint col, - GtkTargetList *targets, - GdkDragAction actions, - gint button, - GdkEvent *event) +e_tree_drag_begin (ETree *tree, + gint row, + gint col, + GtkTargetList *targets, + GdkDragAction actions, + gint button, + GdkEvent *event) { ETreePath path; g_return_val_if_fail (tree != NULL, NULL); @@ -2730,8 +2823,10 @@ e_tree_drag_begin (ETree *tree, **/ void e_tree_get_cell_at (ETree *tree, - gint x, gint y, - gint *row_return, gint *col_return) + gint x, + gint y, + gint *row_return, + gint *col_return) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -2777,9 +2872,12 @@ e_tree_get_cell_at (ETree *tree, **/ void e_tree_get_cell_geometry (ETree *tree, - gint row, gint col, - gint *x_return, gint *y_return, - gint *width_return, gint *height_return) + gint row, + gint col, + gint *x_return, + gint *y_return, + gint *width_return, + gint *height_return) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -2811,8 +2909,8 @@ e_tree_get_cell_geometry (ETree *tree, static void et_drag_begin (GtkWidget *widget, - GdkDragContext *context, - ETree *et) + GdkDragContext *context, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_BEGIN], 0, @@ -2824,8 +2922,8 @@ et_drag_begin (GtkWidget *widget, static void et_drag_end (GtkWidget *widget, - GdkDragContext *context, - ETree *et) + GdkDragContext *context, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_END], 0, @@ -2837,11 +2935,11 @@ et_drag_end (GtkWidget *widget, static void et_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETree *et) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_DATA_GET], 0, @@ -2856,8 +2954,8 @@ et_drag_data_get (GtkWidget *widget, static void et_drag_data_delete (GtkWidget *widget, - GdkDragContext *context, - ETree *et) + GdkDragContext *context, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_DATA_DELETE], 0, @@ -2869,10 +2967,10 @@ et_drag_data_delete (GtkWidget *widget, static gboolean do_drag_motion (ETree *et, - GdkDragContext *context, - gint x, - gint y, - guint time) + GdkDragContext *context, + gint x, + gint y, + guint time) { gboolean ret_val = FALSE; gint row, col; @@ -2973,7 +3071,8 @@ scroll_timeout (gpointer data) } static void -scroll_on (ETree *et, guint scroll_direction) +scroll_on (ETree *et, + guint scroll_direction) { if (et->priv->scroll_idle_id == 0 || scroll_direction != et->priv->scroll_direction) { @@ -3027,7 +3126,9 @@ hover_timeout (gpointer data) } static void -hover_on (ETree *et, gint x, gint y) +hover_on (ETree *et, + gint x, + gint y) { et->priv->hover_x = x; et->priv->hover_y = y; @@ -3046,7 +3147,8 @@ hover_off (ETree *et) } static void -collapse_drag (ETree *et, ETreePath drop) +collapse_drag (ETree *et, + ETreePath drop) { GList *list; @@ -3085,7 +3187,8 @@ collapse_drag (ETree *et, ETreePath drop) } static void -context_destroyed (gpointer data, GObject *ctx) +context_destroyed (gpointer data, + GObject *ctx) { ETree *et = data; if (et->priv) { @@ -3101,7 +3204,8 @@ context_destroyed (gpointer data, GObject *ctx) } static void -context_connect (ETree *et, GdkDragContext *context) +context_connect (ETree *et, + GdkDragContext *context) { if (context == et->priv->last_drop_context) return; @@ -3118,9 +3222,9 @@ context_connect (ETree *et, GdkDragContext *context) static void et_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - ETree *et) + GdkDragContext *context, + guint time, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_LEAVE], 0, @@ -3138,11 +3242,11 @@ et_drag_leave (GtkWidget *widget, static gboolean et_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETree *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETree *et) { GtkAllocation allocation; gint ret_val; @@ -3186,11 +3290,11 @@ et_drag_motion (GtkWidget *widget, static gboolean et_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETree *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETree *et) { gboolean ret_val = FALSE; gint row, col; @@ -3248,13 +3352,13 @@ et_drag_drop (GtkWidget *widget, static void et_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - ETree *et) + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + ETree *et) { gint row, col; ETreePath path; @@ -3602,7 +3706,9 @@ e_tree_class_init (ETreeClass *class) } static void -tree_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *tree) +tree_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETree *tree) { gdouble width; @@ -3629,7 +3735,8 @@ tree_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *tree) * Creates an info message in table area, or removes old. **/ void -e_tree_set_info_message (ETree *tree, const gchar *info_message) +e_tree_set_info_message (ETree *tree, + const gchar *info_message) { GtkAllocation allocation; GtkWidget *widget; diff --git a/widgets/table/gal-a11y-e-cell-popup.c b/widgets/table/gal-a11y-e-cell-popup.c index f1c2540820..b1232a6b84 100644 --- a/widgets/table/gal-a11y-e-cell-popup.c +++ b/widgets/table/gal-a11y-e-cell-popup.c @@ -83,16 +83,16 @@ gal_a11y_e_cell_popup_class_init (GalA11yECellPopupClass *class) AtkObject * gal_a11y_e_cell_popup_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *cell; ECellPopup *popupcell; - ECellView* child_view = NULL; + ECellView * child_view = NULL; popupcell= E_CELL_POPUP (cell_view->ecell); diff --git a/widgets/table/gal-a11y-e-cell-registry.c b/widgets/table/gal-a11y-e-cell-registry.c index 79ad4cacb2..ce533882ab 100644 --- a/widgets/table/gal-a11y-e-cell-registry.c +++ b/widgets/table/gal-a11y-e-cell-registry.c @@ -108,13 +108,13 @@ init_default_registry (void) } AtkObject * -gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, - ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) +gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, + ETableItem *item, + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { GalA11yECellRegistryFunc func = NULL; GType type; @@ -137,9 +137,9 @@ gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, } void -gal_a11y_e_cell_registry_add_cell_type (GalA11yECellRegistry *registry, - GType type, - GalA11yECellRegistryFunc func) +gal_a11y_e_cell_registry_add_cell_type (GalA11yECellRegistry *registry, + GType type, + GalA11yECellRegistryFunc func) { if (registry == NULL) { init_default_registry (); diff --git a/widgets/table/gal-a11y-e-cell-toggle.c b/widgets/table/gal-a11y-e-cell-toggle.c index 98fcdcd92f..991d3c0721 100644 --- a/widgets/table/gal-a11y-e-cell-toggle.c +++ b/widgets/table/gal-a11y-e-cell-toggle.c @@ -122,9 +122,9 @@ toggle_cell_action (GalA11yECell *cell) static void model_change_cb (ETableModel *etm, - gint col, - gint row, - GalA11yECell *cell) + gint col, + gint row, + GalA11yECell *cell) { gint value; @@ -143,13 +143,13 @@ model_change_cb (ETableModel *etm, } } -AtkObject* +AtkObject * gal_a11y_e_cell_toggle_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *cell; diff --git a/widgets/table/gal-a11y-e-cell-tree.c b/widgets/table/gal-a11y-e-cell-tree.c index 70880fc0cc..148731d4b8 100644 --- a/widgets/table/gal-a11y-e-cell-tree.c +++ b/widgets/table/gal-a11y-e-cell-tree.c @@ -43,8 +43,8 @@ static AtkObjectClass *a11y_parent_class; static void ectr_model_row_changed_cb (ETableModel *etm, - gint row, - GalA11yECell *a11y) + gint row, + GalA11yECell *a11y) { ETreePath node; ETreeModel *tree_model; @@ -88,7 +88,7 @@ kill_view_cb (ECellView *subcell_view, static void ectr_subcell_weak_ref (GalA11yECellTree *a11y, - GalA11yECell *subcell_a11y) + GalA11yECell *subcell_a11y) { ECellView *subcell_view = subcell_a11y ? subcell_a11y->cell_view : NULL; if (subcell_a11y && subcell_view && subcell_view->kill_view_cb_data) @@ -184,11 +184,11 @@ gal_a11y_e_cell_tree_get_type (void) AtkObject * gal_a11y_e_cell_tree_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *subcell_a11y; GalA11yECellTree *a11y; @@ -236,8 +236,8 @@ gal_a11y_e_cell_tree_new (ETableItem *item, subcell_a11y = NULL; /* create a companion a11y object, this object has type GalA11yECellTree - and it connects to some signals to determine whether a tree cell is - expanded or collapsed */ + * and it connects to some signals to determine whether a tree cell is + * expanded or collapsed */ a11y = g_object_new (gal_a11y_e_cell_tree_get_type (), NULL); gal_a11y_e_cell_construct (ATK_OBJECT (a11y), item, diff --git a/widgets/table/gal-a11y-e-cell-vbox.c b/widgets/table/gal-a11y-e-cell-vbox.c index e663bb1f1f..d0b9d26036 100644 --- a/widgets/table/gal-a11y-e-cell-vbox.c +++ b/widgets/table/gal-a11y-e-cell-vbox.c @@ -63,8 +63,9 @@ subcell_destroyed (gpointer data) gaev->a11y_subcells[cell->view_col] = NULL; } -static AtkObject* -ecv_ref_child (AtkObject *a11y, gint i) +static AtkObject * +ecv_ref_child (AtkObject *a11y, + gint i) { GalA11yECellVbox *gaev = GAL_A11Y_E_CELL_VBOX (a11y); GalA11yECell *gaec = GAL_A11Y_E_CELL (a11y); @@ -117,11 +118,11 @@ ecv_dispose (GObject *object) } /* AtkComponet interface */ -static AtkObject* +static AtkObject * ecv_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) + gint x, + gint y, + AtkCoordType coord_type) { gint x0, y0, width, height; gint subcell_height, i; @@ -227,6 +228,6 @@ AtkObject *gal_a11y_e_cell_vbox_new (ETableItem *item, gaev = GAL_A11Y_E_CELL_VBOX (a11y); ecvv = (ECellVboxView *) (gaec->cell_view); gaev->a11y_subcell_count = ecvv->subcell_view_count; - gaev->a11y_subcells = g_malloc0 (sizeof (AtkObject *)*gaev->a11y_subcell_count); + gaev->a11y_subcells = g_malloc0 (sizeof (AtkObject *) * gaev->a11y_subcell_count); return a11y; } diff --git a/widgets/table/gal-a11y-e-cell.c b/widgets/table/gal-a11y-e-cell.c index e48977f026..4a75c97ce4 100644 --- a/widgets/table/gal-a11y-e-cell.c +++ b/widgets/table/gal-a11y-e-cell.c @@ -42,7 +42,8 @@ static GObjectClass *parent_class; #if 0 static void -unref_item (gpointer user_data, GObject *obj_loc) +unref_item (gpointer user_data, + GObject *obj_loc) { GalA11yECell *a11y = GAL_A11Y_E_CELL (user_data); a11y->item = NULL; @@ -50,7 +51,8 @@ unref_item (gpointer user_data, GObject *obj_loc) } static void -unref_cell (gpointer user_data, GObject *obj_loc) +unref_cell (gpointer user_data, + GObject *obj_loc) { GalA11yECell *a11y = GAL_A11Y_E_CELL (user_data); a11y->cell_view = NULL; @@ -104,7 +106,7 @@ gal_a11y_e_cell_dispose (GObject *object) /* Static functions */ static const gchar * -gal_a11y_e_cell_get_name (AtkObject * a11y) +gal_a11y_e_cell_get_name (AtkObject *a11y) { GalA11yECell *cell = GAL_A11Y_E_CELL (a11y); ETableCol *ecol; @@ -133,7 +135,7 @@ gal_a11y_e_cell_ref_state_set (AtkObject *accessible) return cell->state_set; } -static AtkObject* +static AtkObject * gal_a11y_e_cell_get_parent (AtkObject *accessible) { GalA11yECell *a11y = GAL_A11Y_E_CELL (accessible); @@ -154,11 +156,11 @@ gal_a11y_e_cell_get_index_in_parent (AtkObject *accessible) /* Component IFace */ static void gal_a11y_e_cell_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GalA11yECell *a11y = GAL_A11Y_E_CELL (component); GtkWidget *tableOrTree; @@ -267,7 +269,7 @@ gal_a11y_e_cell_init (GalA11yECell *a11y) static ActionInfo * _gal_a11y_e_cell_get_action_info (GalA11yECell *cell, - gint index) + gint index) { GList *list_node; @@ -282,7 +284,7 @@ _gal_a11y_e_cell_get_action_info (GalA11yECell *cell, static void _gal_a11y_e_cell_destroy_action_info (gpointer action_info, - gpointer user_data) + gpointer user_data) { ActionInfo *info = (ActionInfo *) action_info; @@ -294,11 +296,11 @@ _gal_a11y_e_cell_destroy_action_info (gpointer action_info, } gboolean -gal_a11y_e_cell_add_action ( GalA11yECell * cell, - const gchar *action_name, - const gchar *action_description, - const gchar *action_keybinding, - ACTION_FUNC action_func) +gal_a11y_e_cell_add_action (GalA11yECell *cell, + const gchar *action_name, + const gchar *action_description, + const gchar *action_keybinding, + ACTION_FUNC action_func) { ActionInfo *info; g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE); @@ -325,7 +327,7 @@ gal_a11y_e_cell_add_action ( GalA11yECell * cell, gboolean gal_a11y_e_cell_remove_action (GalA11yECell *cell, - gint action_index) + gint action_index) { GList *list_node; @@ -342,7 +344,7 @@ gal_a11y_e_cell_remove_action (GalA11yECell *cell, gboolean gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell, - const gchar *action_name) + const gchar *action_name) { GList *list_node; gboolean action_found= FALSE; @@ -377,7 +379,7 @@ gal_a11y_e_cell_action_get_n_actions (AtkAction *action) static const gchar * gal_a11y_e_cell_action_get_name (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -389,7 +391,7 @@ gal_a11y_e_cell_action_get_name (AtkAction *action, static const gchar * gal_a11y_e_cell_action_get_description (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -400,9 +402,9 @@ gal_a11y_e_cell_action_get_description (AtkAction *action, } static gboolean -gal_a11y_e_cell_action_set_description (AtkAction *action, - gint index, - const gchar *desc) +gal_a11y_e_cell_action_set_description (AtkAction *action, + gint index, + const gchar *desc) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -416,7 +418,7 @@ gal_a11y_e_cell_action_set_description (AtkAction *action, static const gchar * gal_a11y_e_cell_action_get_keybinding (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -445,7 +447,7 @@ idle_do_action (gpointer data) static gboolean gal_a11y_e_cell_action_do_action (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -493,9 +495,9 @@ gal_a11y_e_cell_type_add_action_interface (GType type) } gboolean -gal_a11y_e_cell_add_state (GalA11yECell *cell, - AtkStateType state_type, - gboolean emit_signal) +gal_a11y_e_cell_add_state (GalA11yECell *cell, + AtkStateType state_type, + gboolean emit_signal) { if (!atk_state_set_contains_state (cell->state_set, state_type)) { gboolean rc; @@ -510,7 +512,7 @@ gal_a11y_e_cell_add_state (GalA11yECell *cell, if (emit_signal) { atk_object_notify_state_change (ATK_OBJECT (cell), state_type, TRUE); /* If state_type is ATK_STATE_VISIBLE, additional - notification */ + * notification */ if (state_type == ATK_STATE_VISIBLE) g_signal_emit_by_name (cell, "visible_data_changed"); } @@ -522,9 +524,9 @@ gal_a11y_e_cell_add_state (GalA11yECell *cell, } gboolean -gal_a11y_e_cell_remove_state (GalA11yECell *cell, - AtkStateType state_type, - gboolean emit_signal) +gal_a11y_e_cell_remove_state (GalA11yECell *cell, + AtkStateType state_type, + gboolean emit_signal) { if (atk_state_set_contains_state (cell->state_set, state_type)) { gboolean rc; @@ -592,11 +594,11 @@ gal_a11y_e_cell_get_type (void) AtkObject * gal_a11y_e_cell_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; @@ -613,13 +615,13 @@ gal_a11y_e_cell_new (ETableItem *item, } void -gal_a11y_e_cell_construct (AtkObject *object, - ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) +gal_a11y_e_cell_construct (AtkObject *object, + ETableItem *item, + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { GalA11yECell *a11y = GAL_A11Y_E_CELL (object); a11y->item = item; diff --git a/widgets/table/gal-a11y-e-table-click-to-add-factory.c b/widgets/table/gal-a11y-e-table-click-to-add-factory.c index c71199cebb..1a4b418adf 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add-factory.c +++ b/widgets/table/gal-a11y-e-table-click-to-add-factory.c @@ -45,7 +45,7 @@ gal_a11y_e_table_click_to_add_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD; } -static AtkObject* +static AtkObject * gal_a11y_e_table_click_to_add_factory_create_accessible (GObject *obj) { AtkObject * atk_object; 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 a947415c15..e4b5255e4c 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add.c +++ b/widgets/table/gal-a11y-e-table-click-to-add.c @@ -56,7 +56,7 @@ etcta_get_n_actions (AtkAction *action) static const gchar * etcta_get_description (AtkAction *action, - gint i) + gint i) { if (i == 0) return _("click to add"); @@ -65,7 +65,8 @@ etcta_get_description (AtkAction *action, } static const gchar * -etcta_action_get_name (AtkAction *action, gint i) +etcta_action_get_name (AtkAction *action, + gint i) { if (i == 0) return _("click"); @@ -105,7 +106,8 @@ idle_do_action (gpointer data) } static gboolean -etcta_do_action (AtkAction * action, gint i) +etcta_do_action (AtkAction *action, + gint i) { g_return_val_if_fail (i == 0, FALSE); @@ -252,7 +254,9 @@ gal_a11y_e_table_click_to_add_get_type (void) } static gboolean -etcta_event (GnomeCanvasItem *item, GdkEvent *e, gpointer data) +etcta_event (GnomeCanvasItem *item, + GdkEvent *e, + gpointer data) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); GalA11yETableClickToAdd *a11y; @@ -285,8 +289,10 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e, gpointer data) } static void -etcta_selection_cursor_changed (ESelectionModel *esm, gint row, gint col, - GalA11yETableClickToAdd *a11y) +etcta_selection_cursor_changed (ESelectionModel *esm, + gint row, + gint col, + GalA11yETableClickToAdd *a11y) { ETableClickToAdd *etcta; AtkObject *row_a11y; diff --git a/widgets/table/gal-a11y-e-table-column-header.c b/widgets/table/gal-a11y-e-table-column-header.c index ccbfffadc9..8e13fd6865 100644 --- a/widgets/table/gal-a11y-e-table-column-header.c +++ b/widgets/table/gal-a11y-e-table-column-header.c @@ -67,7 +67,8 @@ gal_a11y_e_table_column_header_ref_state_set (AtkObject *accessible) } static void -gal_a11y_e_table_column_header_real_initialize (AtkObject *obj, gpointer data) +gal_a11y_e_table_column_header_real_initialize (AtkObject *obj, + gpointer data) { ATK_OBJECT_CLASS (parent_class)->initialize (obj, data); } @@ -110,7 +111,7 @@ etch_a11y_get_gobject (AtkGObjectAccessible *accessible) static gboolean gal_a11y_e_table_column_header_do_action (AtkAction *action, - gint i) + gint i) { gboolean return_value = TRUE; GtkWidget *widget; @@ -148,7 +149,7 @@ gal_a11y_e_table_column_header_get_n_actions (AtkAction *action) static const gchar * gal_a11y_e_table_column_header_action_get_name (AtkAction *action, - gint i) + gint i) { const gchar *return_value; @@ -209,7 +210,8 @@ gal_a11y_e_table_column_header_get_type (void) } AtkObject * -gal_a11y_e_table_column_header_new (ETableCol *ecol, ETableItem *item) +gal_a11y_e_table_column_header_new (ETableCol *ecol, + ETableItem *item) { GalA11yETableColumnHeader *a11y; AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-table-factory.c b/widgets/table/gal-a11y-e-table-factory.c index e89bb799bb..2270cbaa5b 100644 --- a/widgets/table/gal-a11y-e-table-factory.c +++ b/widgets/table/gal-a11y-e-table-factory.c @@ -39,7 +39,7 @@ gal_a11y_e_table_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TABLE; } -static AtkObject* +static AtkObject * gal_a11y_e_table_factory_create_accessible (GObject *obj) { AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-table-item-factory.c b/widgets/table/gal-a11y-e-table-item-factory.c index 3aeab505f3..a38269bd81 100644 --- a/widgets/table/gal-a11y-e-table-item-factory.c +++ b/widgets/table/gal-a11y-e-table-item-factory.c @@ -45,7 +45,7 @@ gal_a11y_e_table_item_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TABLE_ITEM; } -static AtkObject* +static AtkObject * gal_a11y_e_table_item_factory_create_accessible (GObject *obj) { AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-table-item.c b/widgets/table/gal-a11y-e-table-item.c index e296882e65..5b0e565714 100644 --- a/widgets/table/gal-a11y-e-table-item.c +++ b/widgets/table/gal-a11y-e-table-item.c @@ -68,10 +68,11 @@ static gboolean gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y, ESelectionModel *selection); static gboolean gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y); -static AtkObject* eti_ref_at (AtkTable *table, gint row, gint column); +static AtkObject * eti_ref_at (AtkTable *table, gint row, gint column); static void -item_finalized (gpointer user_data, GObject *gone_item) +item_finalized (gpointer user_data, + GObject *gone_item) { GalA11yETableItem *a11y; GalA11yETableItemPrivate *priv; @@ -103,7 +104,8 @@ eti_ref_state_set (AtkObject *accessible) } inline static gint -view_to_model_row (ETableItem *eti, gint row) +view_to_model_row (ETableItem *eti, + gint row) { if (eti->uses_source_model) { ETableSubset *etss = E_TABLE_SUBSET (eti->table_model); @@ -117,14 +119,16 @@ view_to_model_row (ETableItem *eti, gint row) } inline static gint -view_to_model_col (ETableItem *eti, gint col) +view_to_model_col (ETableItem *eti, + gint col) { ETableCol *ecol = e_table_header_get_column (eti->header, col); return ecol ? ecol->col_idx : -1; } inline static gint -model_to_view_row (ETableItem *eti, gint row) +model_to_view_row (ETableItem *eti, + gint row) { gint i; if (row == -1) @@ -146,7 +150,8 @@ model_to_view_row (ETableItem *eti, gint row) } inline static gint -model_to_view_col (ETableItem *eti, gint col) +model_to_view_col (ETableItem *eti, + gint col) { gint i; if (col == -1) @@ -235,8 +240,9 @@ eti_get_n_children (AtkObject *accessible) (atk_table_get_n_rows (ATK_TABLE (accessible)) + 1); } -static AtkObject* -eti_ref_child (AtkObject *accessible, gint index) +static AtkObject * +eti_ref_child (AtkObject *accessible, + gint index) { ETableItem *item; gint col, row; @@ -264,11 +270,11 @@ eti_ref_child (AtkObject *accessible, gint index) static void eti_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { ETableItem *item; AtkObject *parent; @@ -294,11 +300,11 @@ eti_get_extents (AtkComponent *component, } } -static AtkObject* +static AtkObject * eti_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) + gint x, + gint y, + AtkCoordType coord_type) { gint row = -1; gint col = -1; @@ -349,11 +355,13 @@ cell_destroyed (gpointer data) } /* atk table */ -static AtkObject* -eti_ref_at (AtkTable *table, gint row, gint column) +static AtkObject * +eti_ref_at (AtkTable *table, + gint row, + gint column) { ETableItem *item; - AtkObject* ret; + AtkObject * ret; GalA11yETableItemPrivate *priv = GET_PRIVATE (table); if (atk_state_set_contains_state (priv->state_set, ATK_STATE_DEFUNCT)) @@ -399,7 +407,9 @@ eti_ref_at (AtkTable *table, gint row, gint column) } static gint -eti_get_index_at (AtkTable *table, gint row, gint column) +eti_get_index_at (AtkTable *table, + gint row, + gint column) { ETableItem *item; @@ -411,7 +421,8 @@ eti_get_index_at (AtkTable *table, gint row, gint column) } static gint -eti_get_column_at_index (AtkTable *table, gint index) +eti_get_column_at_index (AtkTable *table, + gint index) { ETableItem *item; @@ -423,7 +434,8 @@ eti_get_column_at_index (AtkTable *table, gint index) } static gint -eti_get_row_at_index (AtkTable *table, gint index) +eti_get_row_at_index (AtkTable *table, + gint index) { ETableItem *item; @@ -460,8 +472,8 @@ eti_get_n_rows (AtkTable *table) static gint eti_get_column_extent_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { ETableItem *item; gint width; @@ -483,8 +495,8 @@ eti_get_column_extent_at (AtkTable *table, static gint eti_get_row_extent_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { ETableItem *item; gint height; @@ -513,7 +525,7 @@ eti_get_caption (AtkTable *table) static const gchar * eti_get_column_description (AtkTable *table, - gint column) + gint column) { ETableItem *item; ETableCol *ecol; @@ -528,7 +540,8 @@ eti_get_column_description (AtkTable *table, } static AtkObject * -eti_get_column_header (AtkTable *table, gint column) +eti_get_column_header (AtkTable *table, + gint column) { ETableItem *item; ETableCol *ecol; @@ -548,7 +561,7 @@ eti_get_column_header (AtkTable *table, gint column) static const gchar * eti_get_row_description (AtkTable *table, - gint row) + gint row) { /* Unimplemented */ return NULL; @@ -556,7 +569,7 @@ eti_get_row_description (AtkTable *table, static AtkObject * eti_get_row_header (AtkTable *table, - gint row) + gint row) { /* Unimplemented */ return NULL; @@ -570,7 +583,8 @@ eti_get_summary (AtkTable *table) } static gboolean -table_is_row_selected (AtkTable *table, gint row) +table_is_row_selected (AtkTable *table, + gint row) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (table); @@ -590,13 +604,16 @@ table_is_row_selected (AtkTable *table, gint row) } static gboolean -table_is_selected (AtkTable *table, gint row, gint column) +table_is_selected (AtkTable *table, + gint row, + gint column) { return table_is_row_selected (table, row); } static gint -table_get_selected_rows (AtkTable *table, gint **rows_selected) +table_get_selected_rows (AtkTable *table, + gint **rows_selected) { ETableItem *item; gint n_selected, row, index_selected; @@ -625,7 +642,8 @@ table_get_selected_rows (AtkTable *table, gint **rows_selected) } static gboolean -table_add_row_selection (AtkTable *table, gint row) +table_add_row_selection (AtkTable *table, + gint row) { ETableItem *item; @@ -642,7 +660,8 @@ table_add_row_selection (AtkTable *table, gint row) } static gboolean -table_remove_row_selection (AtkTable *table, gint row) +table_remove_row_selection (AtkTable *table, + gint row) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (table); @@ -698,8 +717,10 @@ eti_atk_component_iface_init (AtkComponentIface *iface) } static void -eti_rows_inserted (ETableModel * model, gint row, gint count, - AtkObject * table_item) +eti_rows_inserted (ETableModel *model, + gint row, + gint count, + AtkObject *table_item) { gint n_cols,n_rows,i,j; GalA11yETableItem * item_a11y; @@ -725,7 +746,7 @@ eti_rows_inserted (ETableModel * model, gint row, gint count, for (j = 0; j < n_cols; j++) { g_signal_emit_by_name (table_item, "children_changed::add", - ( ((i + 1)*n_cols) + j), NULL, NULL); + ( ((i + 1) * n_cols) + j), NULL, NULL); } } @@ -733,8 +754,10 @@ eti_rows_inserted (ETableModel * model, gint row, gint count, } static void -eti_rows_deleted (ETableModel * model, gint row, gint count, - AtkObject * table_item) +eti_rows_deleted (ETableModel *model, + gint row, + gint count, + AtkObject *table_item) { gint i,j, n_rows, n_cols, old_nrows; ETableItem *item = E_TABLE_ITEM ( @@ -746,7 +769,7 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, old_nrows = GET_PRIVATE (table_item)->rows; - g_return_if_fail ( row+count <= old_nrows); + g_return_if_fail ( row + count <= old_nrows); g_return_if_fail (old_nrows == n_rows + count); GET_PRIVATE (table_item)->rows = n_rows; @@ -757,7 +780,7 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, for (j = 0; j < n_cols; j++) { g_signal_emit_by_name (table_item, "children_changed::remove", - ( ((i + 1)*n_cols) + j), NULL, NULL); + ( ((i + 1) * n_cols) + j), NULL, NULL); } } g_signal_emit_by_name (table_item, "visible-data-changed"); @@ -765,7 +788,9 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, } static void -eti_tree_model_node_changed_cb (ETreeModel *model, ETreePath node, ETableItem *eti) +eti_tree_model_node_changed_cb (ETreeModel *model, + ETreePath node, + ETableItem *eti) { AtkObject *atk_obj; GalA11yETableItem *a11y; @@ -793,10 +818,11 @@ enum { * 3. Emit signals */ static void -eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) +eti_header_structure_changed (ETableHeader *eth, + AtkObject *a11y) { - gboolean reorder_found=FALSE, added_found=FALSE, removed_found=FALSE; + gboolean reorder_found = FALSE, added_found = FALSE, removed_found = FALSE; GalA11yETableItem * a11y_item; ETableCol ** cols, **prev_cols; GalA11yETableItemPrivate *priv; @@ -876,7 +902,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) g_signal_emit_by_name ( G_OBJECT (a11y_item), "children_changed::remove", - ((j+1)*prev_n_cols+i), + ((j + 1) * prev_n_cols + i), NULL, NULL); } } @@ -892,7 +918,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) g_signal_emit_by_name ( G_OBJECT (a11y_item), "children_changed::add", - ((j+1)*n_cols+i), + ((j + 1) * n_cols + i), NULL, NULL); } } @@ -910,7 +936,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) static void eti_real_initialize (AtkObject *obj, - gpointer data) + gpointer data) { ETableItem * eti; ETableModel * model; @@ -920,14 +946,15 @@ eti_real_initialize (AtkObject *obj, model = eti->table_model; - g_signal_connect (model, "model-rows-inserted", - G_CALLBACK (eti_rows_inserted), - obj); - g_signal_connect (model, "model-rows-deleted", - G_CALLBACK (eti_rows_deleted), - obj); - g_signal_connect (G_OBJECT (eti->header), "structure_change", - G_CALLBACK (eti_header_structure_changed), obj); + g_signal_connect ( + model, "model-rows-inserted", + G_CALLBACK (eti_rows_inserted), obj); + g_signal_connect ( + model, "model-rows-deleted", + G_CALLBACK (eti_rows_deleted), obj); + g_signal_connect ( + eti->header, "structure_change", + G_CALLBACK (eti_header_structure_changed), obj); } @@ -1084,10 +1111,12 @@ gal_a11y_e_table_item_new (ETableItem *item) return NULL; if (item) { - g_signal_connect (G_OBJECT(item), "selection_model_removed", - G_CALLBACK (eti_a11y_selection_model_removed_cb), NULL); - g_signal_connect (G_OBJECT(item), "selection_model_added", - G_CALLBACK (eti_a11y_selection_model_added_cb), NULL); + g_signal_connect ( + item, "selection_model_removed", + G_CALLBACK (eti_a11y_selection_model_removed_cb), NULL); + g_signal_connect ( + item, "selection_model_added", + G_CALLBACK (eti_a11y_selection_model_added_cb), NULL); if (item->selection) gal_a11y_e_table_item_ref_selection (a11y, item->selection); @@ -1104,8 +1133,9 @@ gal_a11y_e_table_item_new (ETableItem *item) if (E_IS_TREE (GET_PRIVATE (a11y)->widget)) { ETreeModel *model; model = e_tree_get_model (E_TREE (GET_PRIVATE (a11y)->widget)); - g_signal_connect (G_OBJECT(model), "node_changed", - G_CALLBACK (eti_tree_model_node_changed_cb), item); + g_signal_connect ( + model, "node_changed", + G_CALLBACK (eti_tree_model_node_changed_cb), item); accessible->role = ATK_ROLE_TREE_TABLE; } else if (E_IS_TABLE (GET_PRIVATE (a11y)->widget)) { accessible->role = ATK_ROLE_TABLE; @@ -1126,7 +1156,7 @@ gal_a11y_e_table_item_new (ETableItem *item) static gboolean gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y, - ESelectionModel *selection) + ESelectionModel *selection) { GalA11yETableItemPrivate *priv; @@ -1174,8 +1204,9 @@ gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y) /* callbacks */ static void -eti_a11y_selection_model_removed_cb (ETableItem *eti, ESelectionModel *selection, - gpointer data) +eti_a11y_selection_model_removed_cb (ETableItem *eti, + ESelectionModel *selection, + gpointer data) { AtkObject *atk_obj; GalA11yETableItem *a11y; @@ -1191,8 +1222,9 @@ eti_a11y_selection_model_removed_cb (ETableItem *eti, ESelectionModel *selection } static void -eti_a11y_selection_model_added_cb (ETableItem *eti, ESelectionModel *selection, - gpointer data) +eti_a11y_selection_model_added_cb (ETableItem *eti, + ESelectionModel *selection, + gpointer data) { AtkObject *atk_obj; GalA11yETableItem *a11y; @@ -1209,7 +1241,8 @@ eti_a11y_selection_model_added_cb (ETableItem *eti, ESelectionModel *selection, } static void -eti_a11y_selection_changed_cb (ESelectionModel *selection, GalA11yETableItem *a11y) +eti_a11y_selection_changed_cb (ESelectionModel *selection, + GalA11yETableItem *a11y) { GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y); @@ -1223,7 +1256,9 @@ eti_a11y_selection_changed_cb (ESelectionModel *selection, GalA11yETableItem *a1 static void eti_a11y_cursor_changed_cb (ESelectionModel *selection, - gint row, gint col, GalA11yETableItem *a11y) + gint row, + gint col, + GalA11yETableItem *a11y) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y); @@ -1255,7 +1290,8 @@ static void atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_add_selection (AtkSelection *selection, gint index) +selection_add_selection (AtkSelection *selection, + gint index) { AtkTable *table; gint row, col, cursor_row, cursor_col, model_row, model_col; @@ -1315,7 +1351,8 @@ selection_clear_selection (AtkSelection *selection) } static AtkObject * -selection_ref_selection (AtkSelection *selection, gint index) +selection_ref_selection (AtkSelection *selection, + gint index) { AtkTable *table; gint row, col; @@ -1343,7 +1380,8 @@ selection_get_selection_count (AtkSelection *selection) } static gboolean -selection_is_child_selected (AtkSelection *selection, gint i) +selection_is_child_selected (AtkSelection *selection, + gint i) { gint row; diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c index 436de1ec0f..6ba51303ed 100644 --- a/widgets/table/gal-a11y-e-table.c +++ b/widgets/table/gal-a11y-e-table.c @@ -70,8 +70,9 @@ find_first_table_item (ETableGroup *group) return NULL; } -static AtkObject* -eti_get_accessible (ETableItem *eti, AtkObject *parent) +static AtkObject * +eti_get_accessible (ETableItem *eti, + AtkObject *parent) { AtkObject *a11y = NULL; @@ -110,11 +111,11 @@ init_child_item (GalA11yETable *a11y) return FALSE; } -static AtkObject* -et_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) +static AtkObject * +et_ref_accessible_at_point (AtkComponent *component, + gint x, + gint y, + AtkCoordType coord_type) { GalA11yETable *a11y = GAL_A11Y_E_TABLE (component); if (GET_PRIVATE (a11y)->child_item) @@ -146,9 +147,9 @@ et_get_n_children (AtkObject *accessible) return n; } -static AtkObject* +static AtkObject * et_ref_child (AtkObject *accessible, - gint i) + gint i) { GalA11yETable *a11y = GAL_A11Y_E_TABLE (accessible); ETable * et; diff --git a/widgets/table/gal-a11y-e-tree-factory.c b/widgets/table/gal-a11y-e-tree-factory.c index 4e22c1ca70..00ce55c8c0 100644 --- a/widgets/table/gal-a11y-e-tree-factory.c +++ b/widgets/table/gal-a11y-e-tree-factory.c @@ -38,7 +38,7 @@ gal_a11y_e_tree_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TREE; } -static AtkObject* +static AtkObject * gal_a11y_e_tree_factory_create_accessible (GObject *obj) { AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-tree.c b/widgets/table/gal-a11y-e-tree.c index f26c525550..12697f4535 100644 --- a/widgets/table/gal-a11y-e-tree.c +++ b/widgets/table/gal-a11y-e-tree.c @@ -61,11 +61,11 @@ init_child_item (GalA11yETree *a11y) } } -static AtkObject* -et_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) +static AtkObject * +et_ref_accessible_at_point (AtkComponent *component, + gint x, + gint y, + AtkCoordType coord_type) { GalA11yETree *a11y = GAL_A11Y_E_TREE (component); init_child_item (a11y); @@ -78,9 +78,9 @@ et_get_n_children (AtkObject *accessible) return 1; } -static AtkObject* +static AtkObject * et_ref_child (AtkObject *accessible, - gint i) + gint i) { GalA11yETree *a11y = GAL_A11Y_E_TREE (accessible); if (i != 0) diff --git a/widgets/text/e-reflow-model.c b/widgets/text/e-reflow-model.c index f96d512f1e..05457d0145 100644 --- a/widgets/text/e-reflow-model.c +++ b/widgets/text/e-reflow-model.c @@ -52,7 +52,8 @@ static guint e_reflow_model_signals[LAST_SIGNAL] = { 0, }; * @width: The new value for the width of each item. */ void -e_reflow_model_set_width (EReflowModel *e_reflow_model, gint width) +e_reflow_model_set_width (EReflowModel *e_reflow_model, + gint width) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -84,7 +85,9 @@ e_reflow_model_count (EReflowModel *e_reflow_model) * Returns: the height of the nth item. */ gint -e_reflow_model_height (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) +e_reflow_model_height (EReflowModel *e_reflow_model, + gint n, + GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, 0); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0); @@ -103,7 +106,9 @@ e_reflow_model_height (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *p * Returns: the new GnomeCanvasItem. */ GnomeCanvasItem * -e_reflow_model_incarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) +e_reflow_model_incarnate (EReflowModel *e_reflow_model, + gint n, + GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, NULL); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), NULL); @@ -148,7 +153,10 @@ e_reflow_model_create_cmp_cache (EReflowModel *e_reflow_model) * Returns: strcmp like semantics for the comparison value. */ gint -e_reflow_model_compare (EReflowModel *e_reflow_model, gint n1, gint n2, GHashTable *cmp_cache) +e_reflow_model_compare (EReflowModel *e_reflow_model, + gint n1, + gint n2, + GHashTable *cmp_cache) { #if 0 g_return_val_if_fail (e_reflow_model != NULL, 0); @@ -167,7 +175,9 @@ e_reflow_model_compare (EReflowModel *e_reflow_model, gint n1, gint n2, GHashTab * Update item to represent the nth piece of data. */ void -e_reflow_model_reincarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasItem *item) +e_reflow_model_reincarnate (EReflowModel *e_reflow_model, + gint n, + GnomeCanvasItem *item) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -312,7 +322,9 @@ e_reflow_model_comparison_changed (EReflowModel *e_reflow_model) * Use this function to notify any views of the reflow model that a number of items have been inserted. **/ void -e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint count) +e_reflow_model_items_inserted (EReflowModel *e_reflow_model, + gint position, + gint count) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -335,8 +347,8 @@ e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint * item has been removed. **/ void -e_reflow_model_item_removed (EReflowModel *e_reflow_model, - gint n) +e_reflow_model_item_removed (EReflowModel *e_reflow_model, + gint n) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -362,7 +374,8 @@ e_reflow_model_item_removed (EReflowModel *e_reflow_model, * object */ void -e_reflow_model_item_changed (EReflowModel *e_reflow_model, gint n) +e_reflow_model_item_changed (EReflowModel *e_reflow_model, + gint n) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index 1b99d6aec7..02535d7b34 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -85,14 +85,18 @@ er_create_cmp_cache (gpointer user_data) } static gint -er_compare (gint i1, gint i2, GHashTable *cmp_cache, gpointer user_data) +er_compare (gint i1, + gint i2, + GHashTable *cmp_cache, + gpointer user_data) { EReflow *reflow = user_data; return e_reflow_model_compare (reflow->model, i1, i2, cmp_cache); } static gint -e_reflow_pick_line (EReflow *reflow, gdouble x) +e_reflow_pick_line (EReflow *reflow, + gdouble x) { x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; x /= reflow->column_width + E_REFLOW_FULL_GUTTER; @@ -100,7 +104,8 @@ e_reflow_pick_line (EReflow *reflow, gdouble x) } static gint -er_find_item (EReflow *reflow, GnomeCanvasItem *item) +er_find_item (EReflow *reflow, + GnomeCanvasItem *item) { gint i; for (i = 0; i < reflow->count; i++) { @@ -129,7 +134,8 @@ e_reflow_resize_children (GnomeCanvasItem *item) } static inline void -e_reflow_update_selection_row (EReflow *reflow, gint row) +e_reflow_update_selection_row (EReflow *reflow, + gint row) { if (reflow->items[row]) { g_object_set (reflow->items[row], @@ -157,13 +163,16 @@ e_reflow_update_selection (EReflow *reflow) } static void -selection_changed (ESelectionModel *selection, EReflow *reflow) +selection_changed (ESelectionModel *selection, + EReflow *reflow) { e_reflow_update_selection (reflow); } static void -selection_row_changed (ESelectionModel *selection, gint row, EReflow *reflow) +selection_row_changed (ESelectionModel *selection, + gint row, + EReflow *reflow) { e_reflow_update_selection_row (reflow, row); } @@ -208,7 +217,10 @@ do_adjustment (gpointer user_data) } static void -cursor_changed (ESelectionModel *selection, gint row, gint col, EReflow *reflow) +cursor_changed (ESelectionModel *selection, + gint row, + gint col, + EReflow *reflow) { gint count = reflow->count; gint old_cursor = reflow->cursor_row; @@ -329,8 +341,8 @@ reflow_columns (EReflow *reflow) } else { /* we start one column before the earliest new entry, - so we can handle the case where the new entry is - inserted at the start of the column */ + * so we can handle the case where the new entry is + * inserted at the start of the column */ column_start = reflow->reflow_from_column - 1; start = reflow->columns[column_start]; column_count = column_start + 1; @@ -371,7 +383,9 @@ reflow_columns (EReflow *reflow) } static void -item_changed (EReflowModel *model, gint i, EReflow *reflow) +item_changed (EReflowModel *model, + gint i, + EReflow *reflow) { if (i < 0 || i >= reflow->count) return; @@ -386,7 +400,9 @@ item_changed (EReflowModel *model, gint i, EReflow *reflow) } static void -item_removed (EReflowModel *model, gint i, EReflow *reflow) +item_removed (EReflowModel *model, + gint i, + EReflow *reflow) { gint c; gint sorted; @@ -428,7 +444,10 @@ item_removed (EReflowModel *model, gint i, EReflow *reflow) } static void -items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) +items_inserted (EReflowModel *model, + gint position, + gint count, + EReflow *reflow) { gint i, oldcount; @@ -481,7 +500,8 @@ items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) } static void -model_changed (EReflowModel *model, EReflow *reflow) +model_changed (EReflowModel *model, + EReflow *reflow) { gint i; gint count; @@ -518,7 +538,8 @@ model_changed (EReflowModel *model, EReflow *reflow) } static void -comparison_changed (EReflowModel *model, EReflow *reflow) +comparison_changed (EReflowModel *model, + EReflow *reflow) { e_sorter_array_clean (reflow->sorter); reflow->reflow_from_column = -1; @@ -615,7 +636,8 @@ disconnect_selection (EReflow *reflow) } static void -connect_model (EReflow *reflow, EReflowModel *model) +connect_model (EReflow *reflow, + EReflowModel *model) { if (reflow->model != NULL) disconnect_model (reflow); @@ -644,7 +666,8 @@ connect_model (EReflow *reflow, EReflowModel *model) } static void -adjustment_changed (GtkAdjustment *adjustment, EReflow *reflow) +adjustment_changed (GtkAdjustment *adjustment, + EReflow *reflow) { queue_incarnate (reflow); } @@ -668,7 +691,8 @@ disconnect_adjustment (EReflow *reflow) } static void -connect_adjustment (EReflow *reflow, GtkAdjustment *adjustment) +connect_adjustment (EReflow *reflow, + GtkAdjustment *adjustment) { if (reflow->adjustment != NULL) disconnect_adjustment (reflow); @@ -688,7 +712,10 @@ connect_adjustment (EReflow *reflow, GtkAdjustment *adjustment) #if 0 static void -set_scroll_adjustments (GtkLayout *layout, GtkAdjustment *hadj, GtkAdjustment *vadj, EReflow *reflow) +set_scroll_adjustments (GtkLayout *layout, + GtkAdjustment *hadj, + GtkAdjustment *vadj, + EReflow *reflow) { connect_adjustment (reflow, hadj); } @@ -723,7 +750,10 @@ column_width_changed (EReflow *reflow) /* Virtual functions */ static void -e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_reflow_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; EReflow *reflow; @@ -731,7 +761,7 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar item = GNOME_CANVAS_ITEM (object); reflow = E_REFLOW (object); - switch (prop_id) { + switch (property_id) { case PROP_HEIGHT: reflow->height = g_value_get_double (value); reflow->need_reflow_columns = TRUE; @@ -785,13 +815,16 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar } static void -e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_reflow_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { EReflow *reflow; reflow = E_REFLOW (object); - switch (prop_id) { + switch (property_id) { case PROP_MINIMUM_WIDTH: g_value_set_double (value, reflow->minimum_width); break; @@ -811,7 +844,7 @@ e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec g_value_set_double (value, reflow->column_width); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -922,7 +955,8 @@ e_reflow_unrealize (GnomeCanvasItem *item) } static gboolean -e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) +e_reflow_event (GnomeCanvasItem *item, + GdkEvent *event) { EReflow *reflow; gint return_val = FALSE; @@ -1054,7 +1088,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) value = gtk_adjustment_get_value (adjustment); reflow->temp_column_width = reflow->column_width + - (button->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); + (button->x - reflow->start_x) / (reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); if (reflow->temp_column_width < 50) reflow->temp_column_width = 50; reflow->column_drag = FALSE; @@ -1094,7 +1128,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) value = gtk_adjustment_get_value (adjustment); reflow->temp_column_width = reflow->column_width + - (motion->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); + (motion->x - reflow->start_x) / (reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); if (reflow->temp_column_width < 50) reflow->temp_column_width = 50; if (old_width != reflow->temp_column_width) { @@ -1268,7 +1302,9 @@ e_reflow_draw (GnomeCanvasItem *item, } static void -e_reflow_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +e_reflow_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { EReflow *reflow; gdouble x0, x1, y0, y1; @@ -1359,7 +1395,10 @@ e_reflow_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) static GnomeCanvasItem * e_reflow_point (GnomeCanvasItem *item, - gdouble x, gdouble y, gint cx, gint cy) + gdouble x, + gdouble y, + gint cx, + gint cy) { GnomeCanvasItem *child; @@ -1383,7 +1422,8 @@ e_reflow_point (GnomeCanvasItem *item, } static void -e_reflow_reflow ( GnomeCanvasItem *item, gint flags ) +e_reflow_reflow (GnomeCanvasItem *item, + gint flags) { EReflow *reflow = E_REFLOW (item); gdouble old_width; @@ -1429,7 +1469,9 @@ e_reflow_reflow ( GnomeCanvasItem *item, gint flags ) } static gint -e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event) +e_reflow_selection_event_real (EReflow *reflow, + GnomeCanvasItem *item, + GdkEvent *event) { gint row; gint return_val = TRUE; @@ -1484,7 +1526,7 @@ e_reflow_class_init (EReflowClass *klass) GObjectClass *object_class; GnomeCanvasItemClass *item_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; item_class = (GnomeCanvasItemClass *) klass; object_class->set_property = e_reflow_set_property; @@ -1612,13 +1654,13 @@ e_reflow_init (EReflow *reflow) NULL); reflow->selection_changed_id = - g_signal_connect(reflow->selection, "selection_changed", + g_signal_connect (reflow->selection, "selection_changed", G_CALLBACK (selection_changed), reflow); reflow->selection_row_changed_id = - g_signal_connect(reflow->selection, "selection_row_changed", + g_signal_connect (reflow->selection, "selection_row_changed", G_CALLBACK (selection_row_changed), reflow); reflow->cursor_changed_id = - g_signal_connect(reflow->selection, "cursor_changed", + g_signal_connect (reflow->selection, "cursor_changed", G_CALLBACK (cursor_changed), reflow); e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (reflow), e_reflow_reflow); diff --git a/widgets/text/e-text-model-repos.c b/widgets/text/e-text-model-repos.c index 0b7a3433fd..b56a213215 100644 --- a/widgets/text/e-text-model-repos.c +++ b/widgets/text/e-text-model-repos.c @@ -30,7 +30,8 @@ #define MODEL_CLAMP(model, pos) (CLAMP((pos), 0, strlen((model)->text))) gint -e_repos_absolute (gint pos, gpointer data) +e_repos_absolute (gint pos, + gpointer data) { EReposAbsolute *info = (EReposAbsolute *) data; g_return_val_if_fail (data, -1); @@ -45,7 +46,8 @@ e_repos_absolute (gint pos, gpointer data) } gint -e_repos_insert_shift (gint pos, gpointer data) +e_repos_insert_shift (gint pos, + gpointer data) { EReposInsertShift *info = (EReposInsertShift *) data; g_return_val_if_fail (data, -1); @@ -57,7 +59,8 @@ e_repos_insert_shift (gint pos, gpointer data) } gint -e_repos_delete_shift (gint pos, gpointer data) +e_repos_delete_shift (gint pos, + gpointer data) { EReposDeleteShift *info = (EReposDeleteShift *) data; g_return_val_if_fail (data, -1); diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c index f079346b72..a2c34a7a84 100644 --- a/widgets/text/e-text-model.c +++ b/widgets/text/e-text-model.c @@ -171,7 +171,8 @@ e_text_model_dispose (GObject *object) } static gint -e_text_model_real_validate_position (ETextModel *model, gint pos) +e_text_model_real_validate_position (ETextModel *model, + gint pos) { gint len = e_text_model_get_text_length (model); @@ -199,7 +200,8 @@ e_text_model_real_get_text_length (ETextModel *model) } static void -e_text_model_real_set_text (ETextModel *model, const gchar *text) +e_text_model_real_set_text (ETextModel *model, + const gchar *text) { EReposAbsolute repos; gboolean changed = FALSE; @@ -226,7 +228,9 @@ e_text_model_real_set_text (ETextModel *model, const gchar *text) } static void -e_text_model_real_insert (ETextModel *model, gint position, const gchar *text) +e_text_model_real_insert (ETextModel *model, + gint position, + const gchar *text) { e_text_model_insert_length (model, position, text, strlen (text)); } @@ -268,7 +272,9 @@ e_text_model_real_insert_length (ETextModel *model, } static void -e_text_model_real_delete (ETextModel *model, gint position, gint length) +e_text_model_real_delete (ETextModel *model, + gint position, + gint length) { EReposDeleteShift repos; gint byte_position, byte_length; @@ -322,7 +328,9 @@ e_text_model_cancel_completion (ETextModel *model) } void -e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data) +e_text_model_reposition (ETextModel *model, + ETextModelReposFn fn, + gpointer repos_data) { g_return_if_fail (E_IS_TEXT_MODEL (model)); g_return_if_fail (fn != NULL); @@ -333,7 +341,8 @@ e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos } gint -e_text_model_validate_position (ETextModel *model, gint pos) +e_text_model_validate_position (ETextModel *model, + gint pos) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); @@ -380,7 +389,8 @@ e_text_model_get_text_length (ETextModel *model) } void -e_text_model_set_text (ETextModel *model, const gchar *text) +e_text_model_set_text (ETextModel *model, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -389,7 +399,9 @@ e_text_model_set_text (ETextModel *model, const gchar *text) } void -e_text_model_insert (ETextModel *model, gint position, const gchar *text) +e_text_model_insert (ETextModel *model, + gint position, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -417,7 +429,8 @@ e_text_model_insert_length (ETextModel *model, } void -e_text_model_prepend (ETextModel *model, const gchar *text) +e_text_model_prepend (ETextModel *model, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -428,7 +441,8 @@ e_text_model_prepend (ETextModel *model, const gchar *text) } void -e_text_model_append (ETextModel *model, const gchar *text) +e_text_model_append (ETextModel *model, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -439,7 +453,9 @@ e_text_model_append (ETextModel *model, const gchar *text) } void -e_text_model_delete (ETextModel *model, gint position, gint length) +e_text_model_delete (ETextModel *model, + gint position, + gint length) { gint txt_len; @@ -469,7 +485,9 @@ e_text_model_object_count (ETextModel *model) } const gchar * -e_text_model_get_nth_object (ETextModel *model, gint n, gint *len) +e_text_model_get_nth_object (ETextModel *model, + gint n, + gint *len) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); @@ -483,7 +501,8 @@ e_text_model_get_nth_object (ETextModel *model, gint n, gint *len) } gchar * -e_text_model_strdup_nth_object (ETextModel *model, gint n) +e_text_model_strdup_nth_object (ETextModel *model, + gint n) { const gchar *obj; gint len = 0; @@ -503,7 +522,10 @@ e_text_model_strdup_nth_object (ETextModel *model, gint n) } void -e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint *end) +e_text_model_get_nth_object_bounds (ETextModel *model, + gint n, + gint *start, + gint *end) { const gchar *txt = NULL, *obj = NULL; gint len = 0; @@ -522,7 +544,8 @@ e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint } gint -e_text_model_get_object_at_offset (ETextModel *model, gint offset) +e_text_model_get_object_at_offset (ETextModel *model, + gint offset) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); @@ -553,7 +576,8 @@ e_text_model_get_object_at_offset (ETextModel *model, gint offset) } gint -e_text_model_get_object_at_pointer (ETextModel *model, const gchar *s) +e_text_model_get_object_at_pointer (ETextModel *model, + const gchar *s) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); g_return_val_if_fail (s != NULL, -1); @@ -563,7 +587,8 @@ e_text_model_get_object_at_pointer (ETextModel *model, const gchar *s) } void -e_text_model_activate_nth_object (ETextModel *model, gint n) +e_text_model_activate_nth_object (ETextModel *model, + gint n) { g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index fefc0a3317..b57cec835d 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -191,7 +191,8 @@ disconnect_im_context (EText *text) #if 0 static void -e_text_style_set (EText *text, GtkStyle *previous_style) +e_text_style_set (EText *text, + GtkStyle *previous_style) { if (text->line_wrap) { text->needs_split_into_lines = 1; @@ -463,7 +464,8 @@ reset_layout (EText *text) } static void -e_text_text_model_changed (ETextModel *model, EText *text) +e_text_text_model_changed (ETextModel *model, + EText *text) { gint model_len = e_text_model_get_text_length (model); text->text = e_text_model_get_text (model); @@ -494,7 +496,7 @@ e_text_text_model_reposition (ETextModel *model, text->selection_end = fn (text->selection_end, repos_data); /* Our repos function should make sure we don't overrun the buffer, but it never - hurts to be paranoid. */ + * hurts to be paranoid. */ text->selection_start = CLAMP (text->selection_start, 0, model_len); text->selection_end = CLAMP (text->selection_end, 0, model_len); @@ -506,7 +508,11 @@ e_text_text_model_reposition (ETextModel *model, } static void -get_bounds (EText *text, gdouble *px1, gdouble *py1, gdouble *px2, gdouble *py2) +get_bounds (EText *text, + gdouble *px1, + gdouble *py1, + gdouble *px2, + gdouble *py2) { GnomeCanvasItem *item; gdouble wx, wy, clip_width, clip_height; @@ -608,7 +614,7 @@ split_into_lines (EText *text) /* Set_arg handler for the text item */ static void e_text_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -623,7 +629,7 @@ e_text_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); text = E_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: if (text->model_changed_signal_id) @@ -726,9 +732,9 @@ e_text_set_property (GObject *object, text->clip_height = fabs (g_value_get_double (value)); text->needs_recalc_bounds = 1; /* toshok: kind of a hack - set needs_reset_layout - here so when something about the style/them - changes, we redraw the text at the proper size/with - the proper font. */ + * here so when something about the style/them + * changes, we redraw the text at the proper size/with + * the proper font. */ text->needs_reset_layout = 1; needs_reflow = 1; break; @@ -936,7 +942,7 @@ e_text_set_property (GObject *object, /* Get_arg handler for the text item */ static void e_text_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { @@ -944,7 +950,7 @@ e_text_get_property (GObject *object, text = E_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: g_value_set_object (value, text->model); break; @@ -1070,14 +1076,15 @@ e_text_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } /* Update handler for the text item */ static void -e_text_reflow (GnomeCanvasItem *item, gint flags) +e_text_reflow (GnomeCanvasItem *item, + gint flags) { EText *text; @@ -1106,7 +1113,9 @@ e_text_reflow (GnomeCanvasItem *item, gint flags) /* Update handler for the text item */ static void -e_text_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +e_text_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { EText *text; gdouble x1, y1, x2, y2; @@ -1213,7 +1222,8 @@ draw_pango_rectangle (cairo_t *cr, } static gboolean -show_pango_rectangle (EText *text, PangoRectangle rect) +show_pango_rectangle (EText *text, + PangoRectangle rect) { gint x1 = rect.x / PANGO_SCALE; gint x2 = (rect.x + rect.width) / PANGO_SCALE; @@ -1278,8 +1288,12 @@ show_pango_rectangle (EText *text, PangoRectangle rect) /* Draw handler for the text item */ static void -e_text_draw (GnomeCanvasItem *item, cairo_t *cr, - gint x, gint y, gint width, gint height) +e_text_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { EText *text; gint xpos, ypos; @@ -1536,8 +1550,11 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, /* Point handler for the text item */ static GnomeCanvasItem * -e_text_point (GnomeCanvasItem *item, gdouble x, gdouble y, - gint cx, gint cy) +e_text_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { EText *text; gdouble clip_width; @@ -1609,7 +1626,9 @@ e_text_bounds (GnomeCanvasItem *item, } static gint -get_position_from_xy (EText *text, gint x, gint y) +get_position_from_xy (EText *text, + gint x, + gint y) { gint index; gint trailing; @@ -1801,7 +1820,8 @@ _click (gpointer data) } static gint -e_text_event (GnomeCanvasItem *item, GdkEvent *event) +e_text_event (GnomeCanvasItem *item, + GdkEvent *event) { EText *text = E_TEXT (item); ETextEventProcessorEvent e_tep_event; @@ -1896,7 +1916,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) if (text->im_context && gtk_im_context_filter_keypress ( text->im_context, - (GdkEventKey*) event)) { + (GdkEventKey *) event)) { text->need_im_reset = TRUE; return 1; } @@ -1982,7 +2002,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) } /* Create our own double and triple click events, - as gnome-canvas doesn't forward them to us */ + * as gnome-canvas doesn't forward them to us */ if (event->type == GDK_BUTTON_PRESS) { if (text->dbl_timeout == 0 && text->tpl_timeout == 0) { @@ -2135,10 +2155,10 @@ e_text_select_all (EText *text) } static void -primary_get_cb (GtkClipboard *clipboard, - GtkSelectionData *selection_data, - guint info, - gpointer data) +primary_get_cb (GtkClipboard *clipboard, + GtkSelectionData *selection_data, + guint info, + gpointer data) { EText *text = E_TEXT (data); gint sel_start, sel_end; @@ -2159,7 +2179,7 @@ primary_get_cb (GtkClipboard *clipboard, static void primary_clear_cb (GtkClipboard *clipboard, - gpointer data) + gpointer data) { #ifdef notyet /* XXX */ @@ -2197,8 +2217,8 @@ e_text_update_primary_selection (EText *text) static void paste_received (GtkClipboard *clipboard, - const gchar *text, - gpointer data) + const gchar *text, + gpointer data) { EText *etext = E_TEXT (data); @@ -2213,7 +2233,8 @@ paste_received (GtkClipboard *clipboard, } static void -e_text_paste (EText *text, GdkAtom selection) +e_text_paste (EText *text, + GdkAtom selection) { g_object_ref (text); gtk_clipboard_request_text ( @@ -2230,7 +2251,7 @@ typedef struct { static void popup_menu_detach (GtkWidget *attach_widget, - GtkMenu *menu) + GtkMenu *menu) { } @@ -2258,9 +2279,9 @@ popup_menu_placement_cb (GtkMenu *menu, } static void -popup_targets_received (GtkClipboard *clipboard, - GtkSelectionData *data, - gpointer user_data) +popup_targets_received (GtkClipboard *clipboard, + GtkSelectionData *data, + gpointer user_data) { PopupClosure *closure = user_data; EText *text = closure->text; @@ -2348,7 +2369,9 @@ popup_targets_received (GtkClipboard *clipboard, } static void -e_text_do_popup (EText *text, GdkEventButton *button, gint position) +e_text_do_popup (EText *text, + GdkEventButton *button, + gint position) { PopupClosure *closure = g_new (PopupClosure, 1); @@ -2377,7 +2400,8 @@ e_text_reset_im_context (EText *text) /* fixme: */ static gint -next_word (EText *text, gint start) +next_word (EText *text, + gint start) { gchar *p = g_utf8_offset_to_pointer (text->text, start); gint length; @@ -2406,7 +2430,9 @@ next_word (EText *text, gint start) } static gint -find_offset_into_line (EText *text, gint offset_into_text, gchar **start_of_line) +find_offset_into_line (EText *text, + gint offset_into_text, + gchar **start_of_line) { gchar *p; @@ -2436,10 +2462,11 @@ find_offset_into_line (EText *text, gint offset_into_text, gchar **start_of_line } /* direction = TRUE (move forward), FALSE (move backward) - Any error shall return length (text->text) or 0 or - text->selection_end (as deemed fit) */ + * Any error shall return length (text->text) or 0 or + * text->selection_end (as deemed fit) */ static gint -_get_updated_position (EText *text, gboolean direction) +_get_updated_position (EText *text, + gboolean direction) { PangoLogAttr *log_attrs = NULL; gint n_attrs; @@ -2469,7 +2496,7 @@ _get_updated_position (EText *text, gboolean direction) pango_layout_get_log_attrs (text->layout, &log_attrs, &n_attrs); /* Fetch the current gchar index in the line & keep moving - forward until we can display cursor */ + * forward until we can display cursor */ p = g_utf8_offset_to_pointer (text->text, text->selection_end); new_pos = text->selection_end; @@ -2489,7 +2516,7 @@ _get_updated_position (EText *text, gboolean direction) new_pos = g_utf8_pointer_to_offset (text->text, p); /* if is_cursor_position is set, cursor can appear in front of character. - i.e. this is a grapheme boundary AND make some sanity checks */ + * i.e. this is a grapheme boundary AND make some sanity checks */ if ((new_pos >=0) && (new_pos < n_attrs) && (log_attrs[new_pos].is_cursor_position)) break; @@ -2507,7 +2534,8 @@ _get_updated_position (EText *text, gboolean direction) } static gint -_get_position (EText *text, ETextEventProcessorCommand *command) +_get_position (EText *text, + ETextEventProcessorCommand *command) { gint length, obj_num; gunichar unival; @@ -2636,7 +2664,7 @@ _get_position (EText *text, ETextEventProcessorCommand *command) return text->selection_end; /* now we search forward til we hit a \n, and then - offset_into_line more characters */ + * offset_into_line more characters */ p = g_utf8_offset_to_pointer (text->text, text->selection_end); while (p && *p) { if (*p == '\n') @@ -2645,7 +2673,7 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } if (p && *p == '\n') { /* now we loop forward offset_into_line - characters, or until we hit \n or \0 */ + * characters, or until we hit \n or \0 */ p = g_utf8_next_char (p); while (offset_into_line > 0 && p && *p != '\n' && *p != '\0') { @@ -2655,7 +2683,7 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } /* at this point, p points to the new location, - convert it to an offset and we're done */ + * convert it to an offset and we're done */ new_pos = g_utf8_pointer_to_offset (text->text, p); break; } @@ -2666,8 +2694,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) return text->selection_end; /* p points to the first character on our line. if we - have a \n before it, skip it and scan til we hit - the next one */ + * have a \n before it, skip it and scan til we hit + * the next one */ if (p != text->text) { p = g_utf8_find_prev_char (text->text, p); if (*p == '\n') { @@ -2683,8 +2711,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } /* at this point 'p' points to the start of the - previous line, move forward 'offset_into_line' - times. */ + * previous line, move forward 'offset_into_line' + * times. */ while (offset_into_line > 0 && p && *p != '\n' && *p != '\0') { p = g_utf8_next_char (p); @@ -2692,14 +2720,14 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } /* at this point, p points to the new location, - convert it to an offset and we're done */ + * convert it to an offset and we're done */ new_pos = g_utf8_pointer_to_offset (text->text, p); break; } case E_TEP_SELECT_WORD: /* This is a silly hack to cause double-clicking on an object - to activate that object. - (Normally, double click == select word, which is why this is here.) */ + * to activate that object. + * (Normally, double click == select word, which is why this is here.) */ obj_num = e_text_model_get_object_at_offset ( text->model, text->selection_start); @@ -2781,7 +2809,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } static void -e_text_insert (EText *text, const gchar *string) +e_text_insert (EText *text, + const gchar *string) { gint len = strlen (string); @@ -2820,7 +2849,10 @@ e_text_insert (EText *text, const gchar *string) } static void -capitalize (EText *text, gint start, gint end, ETextEventProcessorCaps type) +capitalize (EText *text, + gint start, + gint end, + ETextEventProcessorCaps type) { gboolean first = TRUE; const gchar *p = g_utf8_offset_to_pointer (text->text, start); @@ -2992,17 +3024,17 @@ e_text_command (ETextEventProcessor *tep, e_text_reset_im_context (text); /* it's possible to get here without ever having been realized - by our canvas (if the e-text started completely obscured.) - so let's create our layout object if we don't already have - one. */ + * by our canvas (if the e-text started completely obscured.) + * so let's create our layout object if we don't already have + * one. */ if (!text->layout) create_layout (text); /* We move cursor only if scroll is TRUE */ if (scroll && !text->button_down) { /* XXX do we really need the @trailing logic here? if - we don't we can scrap the loop and just use - pango_layout_index_to_pos */ + * we don't we can scrap the loop and just use + * pango_layout_index_to_pos */ PangoLayoutLine *cur_line = NULL; gint selection_index; PangoLayoutIter *iter = pango_layout_get_iter (text->layout); @@ -3477,8 +3509,8 @@ e_text_init (EText *text) /* IM Context Callbacks */ static void e_text_commit_cb (GtkIMContext *context, - const gchar *str, - EText *text) + const gchar *str, + EText *text) { if (g_utf8_validate (str, strlen (str), NULL)) { if (text->selection_end != text->selection_start) @@ -3490,7 +3522,7 @@ e_text_commit_cb (GtkIMContext *context, static void e_text_preedit_changed_cb (GtkIMContext *context, - EText *etext) + EText *etext) { gchar *preedit_string = NULL; gint cursor_pos; @@ -3509,7 +3541,7 @@ e_text_preedit_changed_cb (GtkIMContext *context, static gboolean e_text_retrieve_surrounding_cb (GtkIMContext *context, - EText *text) + EText *text) { gtk_im_context_set_surrounding ( context, text->text, strlen (text->text), @@ -3520,10 +3552,10 @@ e_text_retrieve_surrounding_cb (GtkIMContext *context, } static gboolean -e_text_delete_surrounding_cb (GtkIMContext *context, - gint offset, - gint n_chars, - EText *text) +e_text_delete_surrounding_cb (GtkIMContext *context, + gint offset, + gint n_chars, + EText *text) { e_text_model_delete (text->model, MIN (text->selection_start, text->selection_end) + offset, diff --git a/widgets/text/gal-a11y-e-text-factory.c b/widgets/text/gal-a11y-e-text-factory.c index a1ffaa0d90..8da12ee294 100644 --- a/widgets/text/gal-a11y-e-text-factory.c +++ b/widgets/text/gal-a11y-e-text-factory.c @@ -39,7 +39,7 @@ gal_a11y_e_text_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TEXT; } -static AtkObject* +static AtkObject * gal_a11y_e_text_factory_create_accessible (GObject *obj) { AtkObject *atk_object; diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c index a657543305..609b23a900 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/widgets/text/gal-a11y-e-text.c @@ -57,11 +57,11 @@ et_dispose (GObject *object) static void et_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { EText *item = E_TEXT (atk_gobject_accessible_get_object ( ATK_GOBJECT_ACCESSIBLE (component))); @@ -107,7 +107,7 @@ et_get_full_text (AtkText *text) static void et_set_full_text (AtkEditableText *text, - const gchar *full_text) + const gchar *full_text) { EText *etext = E_TEXT (atk_gobject_accessible_get_object ( ATK_GOBJECT_ACCESSIBLE (text))); @@ -120,8 +120,8 @@ et_set_full_text (AtkEditableText *text, static gchar * et_get_text (AtkText *text, - gint start_offset, - gint end_offset) + gint start_offset, + gint end_offset) { gint start, end, real_start, real_end, len; const gchar *full_text = et_get_full_text (text); @@ -153,8 +153,8 @@ is_a_seperator (gunichar c) static gint find_word_start (const gchar *text, - gint begin_offset, - gint step) + gint begin_offset, + gint step) { gint offset; gchar *at_offset; @@ -167,7 +167,7 @@ find_word_start (const gchar *text, while (offset > 0 && offset < len) { at_offset = g_utf8_offset_to_pointer (text, offset); current = g_utf8_get_char_validated (at_offset, -1); - at_offset = g_utf8_offset_to_pointer (text, offset-1); + at_offset = g_utf8_offset_to_pointer (text, offset - 1); previous = g_utf8_get_char_validated (at_offset, -1); if ((!is_a_seperator (current)) && is_a_seperator (previous)) break; @@ -179,8 +179,8 @@ find_word_start (const gchar *text, static gint find_word_end (const gchar *text, - gint begin_offset, - gint step) + gint begin_offset, + gint step) { gint offset; gchar *at_offset; @@ -193,7 +193,7 @@ find_word_end (const gchar *text, while (offset > 0 && offset < len) { at_offset = g_utf8_offset_to_pointer (text, offset); current = g_utf8_get_char_validated (at_offset, -1); - at_offset = g_utf8_offset_to_pointer (text, offset-1); + at_offset = g_utf8_offset_to_pointer (text, offset - 1); previous = g_utf8_get_char_validated (at_offset, -1); if (is_a_seperator (current) && (!is_a_seperator (previous))) break; @@ -205,8 +205,8 @@ find_word_end (const gchar *text, static gint find_sentence_start (const gchar *text, - gint begin_offset, - gint step) + gint begin_offset, + gint step) { gint offset, last_word_end, len; gchar *at_offset; @@ -216,7 +216,7 @@ find_sentence_start (const gchar *text, offset = find_word_start (text, begin_offset, step); len = g_utf8_strlen (text, -1); - while (offset>0 && offset <len) { + while (offset > 0 && offset <len) { last_word_end = find_word_end (text, offset - 1, -1); if (last_word_end == 0) break; @@ -307,10 +307,10 @@ find_line_end (const gchar *text, static gchar * et_get_text_after_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) + gint offset, + AtkTextBoundary boundary_type, + gint *start_offset, + gint *end_offset) { gint start, end, len; const gchar *full_text = et_get_full_text (text); @@ -360,10 +360,10 @@ et_get_text_after_offset (AtkText *text, static gchar * et_get_text_at_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) + gint offset, + AtkTextBoundary boundary_type, + gint *start_offset, + gint *end_offset) { gint start, end, len; const gchar *full_text = et_get_full_text (text); @@ -413,7 +413,7 @@ et_get_text_at_offset (AtkText *text, static gunichar et_get_character_at_offset (AtkText *text, - gint offset) + gint offset) { const gchar *full_text = et_get_full_text (text); gchar *at_offset; @@ -424,10 +424,10 @@ et_get_character_at_offset (AtkText *text, static gchar * et_get_text_before_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) + gint offset, + AtkTextBoundary boundary_type, + gint *start_offset, + gint *end_offset) { gint start, end, len; const gchar *full_text = et_get_full_text (text); @@ -494,17 +494,17 @@ et_get_caret_offset (AtkText *text) return offset; } -static AtkAttributeSet* +static AtkAttributeSet * et_get_run_attributes (AtkText *text, - gint offset, - gint *start_offset, - gint *end_offset) + gint offset, + gint *start_offset, + gint *end_offset) { /* Unimplemented */ return NULL; } -static AtkAttributeSet* +static AtkAttributeSet * et_get_default_attributes (AtkText *text) { /* Unimplemented */ @@ -513,12 +513,12 @@ et_get_default_attributes (AtkText *text) static void et_get_character_extents (AtkText *text, - gint offset, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coords) + gint offset, + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coords) { GObject *obj; EText *etext; @@ -593,9 +593,9 @@ et_get_character_count (AtkText *text) static gint et_get_offset_at_point (AtkText *text, - gint x, - gint y, - AtkCoordType coords) + gint x, + gint y, + AtkCoordType coords) { GObject *obj; EText *etext; @@ -668,9 +668,9 @@ et_get_n_selections (AtkText *text) static gchar * et_get_selection (AtkText *text, - gint selection_num, - gint *start_offset, - gint *end_offset) + gint selection_num, + gint *start_offset, + gint *end_offset) { gint start, end, real_start, real_end, len; EText *etext; @@ -701,8 +701,8 @@ et_get_selection (AtkText *text, static gboolean et_add_selection (AtkText *text, - gint start_offset, - gint end_offset) + gint start_offset, + gint end_offset) { GObject *obj; EText *etext; @@ -739,7 +739,7 @@ et_add_selection (AtkText *text, static gboolean et_remove_selection (AtkText *text, - gint selection_num) + gint selection_num) { GObject *obj; EText *etext; @@ -763,9 +763,9 @@ et_remove_selection (AtkText *text, static gboolean et_set_selection (AtkText *text, - gint selection_num, - gint start_offset, - gint end_offset) + gint selection_num, + gint start_offset, + gint end_offset) { GObject *obj; @@ -781,7 +781,7 @@ et_set_selection (AtkText *text, static gboolean et_set_caret_offset (AtkText *text, - gint offset) + gint offset) { GObject *obj; EText *etext; @@ -813,9 +813,9 @@ et_set_caret_offset (AtkText *text, static gboolean et_set_run_attributes (AtkEditableText *text, - AtkAttributeSet *attrib_set, - gint start_offset, - gint end_offset) + AtkAttributeSet *attrib_set, + gint start_offset, + gint end_offset) { /* Unimplemented */ return FALSE; @@ -823,16 +823,16 @@ et_set_run_attributes (AtkEditableText *text, static void et_set_text_contents (AtkEditableText *text, - const gchar *string) + const gchar *string) { et_set_full_text (text, string); } static void et_insert_text (AtkEditableText *text, - const gchar *string, - gint length, - gint *position) + const gchar *string, + gint length, + gint *position) { /* Utf8 unimplemented */ gchar *result; @@ -854,8 +854,8 @@ et_insert_text (AtkEditableText *text, static void et_copy_text (AtkEditableText *text, - gint start_pos, - gint end_pos) + gint start_pos, + gint end_pos) { GObject *obj; EText *etext; @@ -877,8 +877,8 @@ et_copy_text (AtkEditableText *text, static void et_delete_text (AtkEditableText *text, - gint start_pos, - gint end_pos) + gint start_pos, + gint end_pos) { GObject *obj; EText *etext; @@ -899,8 +899,8 @@ et_delete_text (AtkEditableText *text, static void et_cut_text (AtkEditableText *text, - gint start_pos, - gint end_pos) + gint start_pos, + gint end_pos) { et_copy_text (text, start_pos, end_pos); et_delete_text (text, start_pos, end_pos); @@ -908,7 +908,7 @@ et_cut_text (AtkEditableText *text, static void et_paste_text (AtkEditableText *text, - gint position) + gint position) { GObject *obj; EText *etext; @@ -967,9 +967,9 @@ et_atk_editable_text_iface_init (AtkEditableTextIface *iface) static void _et_reposition_cb (ETextModel *model, - ETextModelReposFn fn, - gpointer repos_data, - gpointer user_data) + ETextModelReposFn fn, + gpointer repos_data, + gpointer user_data) { AtkObject *accessible; AtkText *text; @@ -989,8 +989,8 @@ _et_reposition_cb (ETextModel *model, static void _et_command_cb (ETextEventProcessor *tep, - ETextEventProcessorCommand *command, - gpointer user_data) + ETextEventProcessorCommand *command, + gpointer user_data) { AtkObject *accessible; AtkText *text; @@ -1012,7 +1012,7 @@ _et_command_cb (ETextEventProcessor *tep, static void et_real_initialize (AtkObject *obj, - gpointer data) + gpointer data) { EText *etext; |