diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-11-10 11:40:00 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-11-11 04:54:43 +0800 |
commit | 2c4ae5e7685c462f8d464448e4617b8dea029e72 (patch) | |
tree | c34f0cbb7c500ff70f10fce846631b0a948b341c | |
parent | 583da46b8caf4b2a8b548b03c38fe0e84164abfb (diff) | |
download | gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.gz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.bz2 gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.lz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.xz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.zst gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.zip |
Coding style and whitespace cleanup.
293 files changed, 10886 insertions, 8365 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 8dc2621787..4777091128 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -253,9 +253,10 @@ e_contact_editor_fullname_new (const EContactName *name) { GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, NULL); - g_object_set (widget, - "name", name, - NULL); + g_object_set ( + widget, + "name", name, + NULL); return widget; } @@ -320,9 +321,9 @@ extract_info (EContactEditorFullname *editor) editor->name = name; } - name->prefixes = extract_field (editor, "comboentry-title" ); - name->given = extract_field (editor, "entry-first" ); + name->prefixes = extract_field (editor, "comboentry-title"); + name->given = extract_field (editor, "entry-first"); name->additional = extract_field (editor, "entry-middle"); - name->family = extract_field (editor, "entry-last" ); + name->family = extract_field (editor, "entry-last"); name->suffixes = extract_field (editor, "comboentry-suffix"); } diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index d2111f0def..8e2e455dc1 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -689,7 +689,7 @@ sensitize_ok (EContactEditor *ce) GtkWidget *widget; gboolean allow_save; GtkWidget *entry_fullname = - e_builder_get_widget (ce->builder, "entry-fullname" ); + e_builder_get_widget (ce->builder, "entry-fullname"); GtkWidget *entry_file_as = gtk_bin_get_child (GTK_BIN ( e_builder_get_widget (ce->builder, "combo-file-as"))); @@ -808,7 +808,8 @@ init_email_record_location (EContactEditor *editor, for (i = 0; i < G_N_ELEMENTS (common_location); i++) { gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, _(common_location[i].pretty_name), -1); } @@ -1894,8 +1895,8 @@ extract_im (EContactEditor *editor) old_service_attr_list = e_contact_get_attributes ( editor->contact, im_service[i].field); - filled_in_slots = - MIN (remaining_slots, + filled_in_slots = MIN ( + remaining_slots, g_list_length (old_service_attr_list)); remaining_slots -= filled_in_slots; @@ -2289,9 +2290,11 @@ set_address_label (EContact *contact, g_object_unref (settings); if (format_address) { - address_label = eab_format_address (contact, - (field == E_CONTACT_ADDRESS_LABEL_WORK) ? E_CONTACT_ADDRESS_WORK : - E_CONTACT_ADDRESS_HOME); + address_label = eab_format_address ( + contact, + (field == E_CONTACT_ADDRESS_LABEL_WORK) ? + E_CONTACT_ADDRESS_WORK : + E_CONTACT_ADDRESS_HOME); } if (!format_address || !address_label) { @@ -2702,7 +2705,8 @@ extract_simple_field (EContactEditor *editor, gtk_combo_box_get_model ( GTK_COMBO_BOX (widget))); - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, + gtk_tree_model_get ( + GTK_TREE_MODEL (store), &iter, 0, &text, -1); } @@ -2776,7 +2780,7 @@ extract_simple_field (EContactEditor *editor, NULL); if (prompt_response == GTK_RESPONSE_YES) { - if ( width > height) { + if (width > height) { height = height * 96 / width; width = 96; } else { @@ -3681,7 +3685,7 @@ save_contact (EContactEditor *ce, return; } - entry_fullname = e_builder_get_widget (ce->builder, "entry-fullname" ); + entry_fullname = e_builder_get_widget (ce->builder, "entry-fullname"); entry_file_as = gtk_bin_get_child ( GTK_BIN (e_builder_get_widget (ce->builder, "combo-file-as"))); company_name = e_builder_get_widget (ce->builder, "entry-company"); @@ -3794,8 +3798,9 @@ e_contact_editor_is_valid (EABEditor *editor) /* If valid, see if the birthday is a future date */ bday = e_date_edit_get_time (E_DATE_EDIT (widget)); if (bday > now) { - g_string_append_printf (errmsg, _("'%s' cannot be a future date"), - e_contact_pretty_name (E_CONTACT_BIRTH_DATE)); + g_string_append_printf ( + errmsg, _("'%s' cannot be a future date"), + e_contact_pretty_name (E_CONTACT_BIRTH_DATE)); validation_error = TRUE; } diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index fd4c8edb82..e9076a9df8 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -492,34 +492,40 @@ build_quick_add_dialog (QuickAdd *qa) 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, - 0, 1, 0, 1, - GTK_FILL, 0, xpad, ypad); - gtk_table_attach (table, qa->name_entry, - 1, 2, 0, 1, - GTK_EXPAND | GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, label, + 0, 1, 0, 1, + GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, qa->name_entry, + 1, 2, 0, 1, + GTK_EXPAND | GTK_FILL, 0, xpad, ypad); label = gtk_label_new_with_mnemonic (_("E_mail")); gtk_label_set_mnemonic_widget ((GtkLabel *) label, qa->email_entry); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (table, label, - 0, 1, 1, 2, - GTK_FILL, 0, xpad, ypad); - gtk_table_attach (table, qa->email_entry, - 1, 2, 1, 2, - GTK_EXPAND | GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, label, + 0, 1, 1, 2, + GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, qa->email_entry, + 1, 2, 1, 2, + GTK_EXPAND | GTK_FILL, 0, xpad, ypad); label = gtk_label_new_with_mnemonic (_("_Select Address Book")); gtk_label_set_mnemonic_widget ((GtkLabel *) label, qa->combo_box); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (table, label, - 0, 1, 2, 3, - GTK_FILL, 0, xpad, ypad); - gtk_table_attach (table, qa->combo_box, - 1, 2, 2, 3, - GTK_EXPAND | GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, label, + 0, 1, 2, 3, + GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, qa->combo_box, + 1, 2, 2, 3, + GTK_EXPAND | GTK_FILL, 0, xpad, ypad); gtk_container_set_border_width (GTK_CONTAINER (table), 12); container = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c index a7165e70d8..fcbdfb1049 100644 --- a/addressbook/gui/contact-editor/eab-editor.c +++ b/addressbook/gui/contact-editor/eab-editor.c @@ -175,44 +175,47 @@ eab_editor_class_init (EABEditorClass *class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - signals[CONTACT_ADDED] = - g_signal_new ("contact_added", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EABEditorClass, contact_added), - NULL, NULL, - e_marshal_NONE__POINTER_OBJECT, - G_TYPE_NONE, 2, - G_TYPE_POINTER, G_TYPE_OBJECT); - - signals[CONTACT_MODIFIED] = - g_signal_new ("contact_modified", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EABEditorClass, contact_modified), - NULL, NULL, - e_marshal_NONE__POINTER_OBJECT, - G_TYPE_NONE, 2, - G_TYPE_POINTER, G_TYPE_OBJECT); - - signals[CONTACT_DELETED] = - g_signal_new ("contact_deleted", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EABEditorClass, contact_deleted), - NULL, NULL, - e_marshal_NONE__POINTER_OBJECT, - G_TYPE_NONE, 2, - G_TYPE_POINTER, G_TYPE_OBJECT); - - signals[EDITOR_CLOSED] = - g_signal_new ("editor_closed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EABEditorClass, editor_closed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + signals[CONTACT_ADDED] = g_signal_new ( + "contact_added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EABEditorClass, contact_added), + NULL, NULL, + e_marshal_NONE__POINTER_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_POINTER, + G_TYPE_OBJECT); + + signals[CONTACT_MODIFIED] = g_signal_new ( + "contact_modified", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EABEditorClass, contact_modified), + NULL, NULL, + e_marshal_NONE__POINTER_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_POINTER, + G_TYPE_OBJECT); + + signals[CONTACT_DELETED] = g_signal_new ( + "contact_deleted", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EABEditorClass, contact_deleted), + NULL, NULL, + e_marshal_NONE__POINTER_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_POINTER, + G_TYPE_OBJECT); + + signals[EDITOR_CLOSED] = g_signal_new ( + "editor_closed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EABEditorClass, editor_closed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static void 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 e3cb38ec96..a6205757d8 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -508,7 +508,8 @@ contact_list_editor_add_button_clicked_cb (GtkWidget *widget) editor = contact_list_editor_extract (widget); - contact_list_editor_add_email (editor, + contact_list_editor_add_email ( + editor, gtk_entry_get_text (GTK_ENTRY (WIDGET (EMAIL_ENTRY)))); gtk_entry_set_text (GTK_ENTRY (WIDGET (EMAIL_ENTRY)), ""); } @@ -1208,7 +1209,8 @@ setup_custom_widgets (EContactListEditor *editor) gtk_widget_get_name (old)); parent = gtk_widget_get_parent (old); - gtk_container_child_get (GTK_CONTAINER (parent), old, + gtk_container_child_get ( + GTK_CONTAINER (parent), old, "bottom-attach", &ba, "left-attach", &la, "right-attach", &ra, @@ -1660,12 +1662,13 @@ e_contact_list_editor_new (EShell *shell, E_TYPE_CONTACT_LIST_EDITOR, "shell", shell, NULL); - g_object_set (editor, - "client", book_client, - "contact", list_contact, - "is_new_list", is_new_list, - "editable", editable, - NULL); + g_object_set ( + editor, + "client", book_client, + "contact", list_contact, + "is_new_list", is_new_list, + "editable", editable, + NULL); return editor; } @@ -1721,9 +1724,11 @@ save_contact_list (GtkTreeModel *model, uid = g_strdup_printf ("%d", *parent_id); attr = e_vcard_attribute_new (NULL, EVC_CONTACT_LIST); - e_vcard_attribute_add_param_with_value (attr, + e_vcard_attribute_add_param_with_value ( + attr, e_vcard_attribute_param_new (EVC_CL_UID), uid); - e_vcard_attribute_add_value (attr, + e_vcard_attribute_add_value ( + attr, e_destination_get_name (dest)); g_free (uid); @@ -1738,7 +1743,8 @@ save_contact_list (GtkTreeModel *model, e_destination_export_to_vcard_attribute (dest, attr); } - e_vcard_attribute_add_param_with_value (attr, + e_vcard_attribute_add_param_with_value ( + attr, e_vcard_attribute_param_new (EVC_PARENT_CL), pid_str); *attrs = g_slist_prepend (*attrs, attr); @@ -1889,7 +1895,7 @@ e_contact_list_editor_set_is_new_list (EContactListEditor *editor, g_return_if_fail (E_IS_CONTACT_LIST_EDITOR (editor)); - if ((editor->priv->is_new_list ? 1 : 0) == (is_new_list ? 1 : 0)) + if (editor->priv->is_new_list == is_new_list) return; editor->priv->is_new_list = is_new_list; @@ -1912,7 +1918,7 @@ e_contact_list_editor_set_editable (EContactListEditor *editor, { g_return_if_fail (E_IS_CONTACT_LIST_EDITOR (editor)); - if ((editor->priv->editable ? 1 : 0) == (editable ? 1 : 0)) + if (editor->priv->editable == editable) return; editor->priv->editable = editable; 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 55cc70bec7..337fd351e4 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -152,8 +152,9 @@ e_contact_list_model_add_destination (EContactListModel *model, if (e_destination_is_evolution_list (destination)) { const GList *dest, *dests = e_destination_list_get_root_dests (destination); /* Get number of instances of this list in the model */ - gint list_refs = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->uids_table, - e_destination_get_contact_uid (destination))); + gint list_refs = GPOINTER_TO_INT ( + g_hash_table_lookup (model->priv->uids_table, + e_destination_get_contact_uid (destination))); gtk_tree_store_append (GTK_TREE_STORE (model), &iter, parent); gtk_tree_store_set (GTK_TREE_STORE (model), &iter, 0, destination, -1); @@ -170,7 +171,8 @@ e_contact_list_model_add_destination (EContactListModel *model, if (!gtk_tree_model_iter_has_child (GTK_TREE_MODEL (model), &iter)) { gtk_tree_store_remove (GTK_TREE_STORE (model), &iter); } else { - g_hash_table_insert (model->priv->uids_table, + g_hash_table_insert ( + model->priv->uids_table, g_strdup (e_destination_get_contact_uid (destination)), GINT_TO_POINTER (list_refs + 1)); } @@ -182,10 +184,12 @@ e_contact_list_model_add_destination (EContactListModel *model, return NULL; } - dest_refs = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->emails_table, - e_destination_get_email (destination))); + dest_refs = GPOINTER_TO_INT ( + g_hash_table_lookup (model->priv->emails_table, + e_destination_get_email (destination))); - g_hash_table_insert (model->priv->emails_table, + g_hash_table_insert ( + model->priv->emails_table, g_strdup (e_destination_get_email (destination)), GINT_TO_POINTER (dest_refs + 1)); @@ -225,16 +229,19 @@ contact_list_model_unref_row_dest (EContactListModel *model, if (gtk_tree_model_iter_has_child (tree_model, iter)) { GtkTreeIter child_iter; - gint list_refs = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->uids_table, + gint list_refs = GPOINTER_TO_INT ( + g_hash_table_lookup (model->priv->uids_table, 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 */ if (list_refs <= 1) { - g_hash_table_remove (model->priv->uids_table, + g_hash_table_remove ( + model->priv->uids_table, e_destination_get_contact_uid (dest)); } else { - g_hash_table_insert (model->priv->uids_table, + g_hash_table_insert ( + model->priv->uids_table, g_strdup (e_destination_get_contact_uid (dest)), GINT_TO_POINTER (list_refs - 1)); } @@ -246,14 +253,18 @@ contact_list_model_unref_row_dest (EContactListModel *model, } } else { - gint dest_refs = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->emails_table, - e_destination_get_email (dest))); + gint dest_refs = GPOINTER_TO_INT ( + g_hash_table_lookup ( + model->priv->emails_table, + e_destination_get_email (dest))); if (dest_refs <= 1) { - g_hash_table_remove (model->priv->emails_table, + g_hash_table_remove ( + model->priv->emails_table, e_destination_get_email (dest)); } else { - g_hash_table_insert (model->priv->emails_table, + g_hash_table_insert ( + model->priv->emails_table, g_strdup (e_destination_get_email (dest)), GINT_TO_POINTER (dest_refs - 1)); } diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index 7c7f096e90..7f5dfe1564 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -442,7 +442,7 @@ match_email_hostname (const gchar *addr1, --addr1; --addr2; } - if ((*addr1 == '@' && *addr2 != '@' ) || (*addr2 == '@' && *addr1 != '@')) + if ((*addr1 == '@' && *addr2 != '@') || (*addr2 == '@' && *addr1 != '@')) return FALSE; return TRUE; diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index 9eea4c7f89..1720b19a09 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -649,106 +649,113 @@ e_addressbook_model_class_init (EAddressbookModelClass *class) G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); - signals[WRITABLE_STATUS] = - g_signal_new ("writable_status", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, writable_status), - NULL, NULL, - g_cclosure_marshal_VOID__BOOLEAN, - G_TYPE_NONE, - 1, G_TYPE_BOOLEAN); - - signals[STATUS_MESSAGE] = - g_signal_new ("status_message", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, status_message), - NULL, NULL, - e_marshal_VOID__STRING_INT, - G_TYPE_NONE, - 2, G_TYPE_STRING, G_TYPE_INT); - - signals[SEARCH_STARTED] = - g_signal_new ("search_started", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, search_started), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[SEARCH_RESULT] = - g_signal_new ("search_result", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, search_result), - NULL, NULL, - g_cclosure_marshal_VOID__BOXED, - G_TYPE_NONE, 1, G_TYPE_ERROR); - - signals[FOLDER_BAR_MESSAGE] = - g_signal_new ("folder_bar_message", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, folder_bar_message), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - signals[CONTACT_ADDED] = - g_signal_new ("contact_added", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, contact_added), - NULL, NULL, - e_marshal_NONE__INT_INT, - G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - - signals[CONTACTS_REMOVED] = - g_signal_new ("contacts_removed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, contacts_removed), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - signals[CONTACT_CHANGED] = - g_signal_new ("contact_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, contact_changed), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - - signals[MODEL_CHANGED] = - g_signal_new ("model_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, model_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[STOP_STATE_CHANGED] = - g_signal_new ("stop_state_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, stop_state_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[BACKEND_DIED] = - g_signal_new ("backend_died", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookModelClass, backend_died), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + signals[WRITABLE_STATUS] = g_signal_new ( + "writable_status", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, writable_status), + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, + G_TYPE_BOOLEAN); + + signals[STATUS_MESSAGE] = g_signal_new ( + "status_message", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, status_message), + NULL, NULL, + e_marshal_VOID__STRING_INT, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_INT); + + signals[SEARCH_STARTED] = g_signal_new ( + "search_started", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, search_started), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[SEARCH_RESULT] = g_signal_new ( + "search_result", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, search_result), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + G_TYPE_ERROR); + + signals[FOLDER_BAR_MESSAGE] = g_signal_new ( + "folder_bar_message", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, folder_bar_message), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + + signals[CONTACT_ADDED] = g_signal_new ( + "contact_added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, contact_added), + NULL, NULL, + e_marshal_NONE__INT_INT, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_INT); + + signals[CONTACTS_REMOVED] = g_signal_new ( + "contacts_removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, contacts_removed), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + + signals[CONTACT_CHANGED] = g_signal_new ( + "contact_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, contact_changed), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + signals[MODEL_CHANGED] = g_signal_new ( + "model_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, model_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[STOP_STATE_CHANGED] = g_signal_new ( + "stop_state_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, stop_state_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[BACKEND_DIED] = g_signal_new ( + "backend_died", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, backend_died), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static void @@ -945,7 +952,7 @@ e_addressbook_model_set_editable (EAddressbookModel *model, { g_return_if_fail (E_IS_ADDRESSBOOK_MODEL (model)); - if ((model->priv->editable ? 1 : 0) != (editable ? 1 : 0)) { + if (model->priv->editable != editable) { model->priv->editable = editable; g_signal_emit ( diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 00a86ce73f..48ed73bb25 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -73,23 +73,29 @@ unlink_model (EAddressbookReflowAdapter *adapter) EAddressbookReflowAdapterPrivate *priv = adapter->priv; if (priv->model && priv->create_contact_id) - g_signal_handler_disconnect (priv->model, - priv->create_contact_id); + g_signal_handler_disconnect ( + priv->model, + priv->create_contact_id); if (priv->model && priv->remove_contact_id) - g_signal_handler_disconnect (priv->model, - priv->remove_contact_id); + g_signal_handler_disconnect ( + priv->model, + priv->remove_contact_id); if (priv->model && priv->modify_contact_id) - g_signal_handler_disconnect (priv->model, - priv->modify_contact_id); + g_signal_handler_disconnect ( + priv->model, + priv->modify_contact_id); if (priv->model && priv->model_changed_id) - g_signal_handler_disconnect (priv->model, - priv->model_changed_id); + g_signal_handler_disconnect ( + priv->model, + priv->model_changed_id); if (priv->model && priv->search_started_id) - g_signal_handler_disconnect (priv->model, - priv->search_started_id); + g_signal_handler_disconnect ( + priv->model, + priv->search_started_id); if (priv->model && priv->search_result_id) - g_signal_handler_disconnect (priv->model, - priv->search_result_id); + g_signal_handler_disconnect ( + priv->model, + priv->search_result_id); priv->create_contact_id = 0; priv->remove_contact_id = 0; @@ -289,9 +295,10 @@ adapter_drag_begin (EMinicard *card, { gint ret_val = 0; - g_signal_emit (adapter, - signals[DRAG_BEGIN], 0, - event, &ret_val); + g_signal_emit ( + adapter, + signals[DRAG_BEGIN], 0, + event, &ret_val); return ret_val; } @@ -338,9 +345,10 @@ addressbook_reincarnate (EReflowModel *erm, EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; - gnome_canvas_item_set (item, - "contact", e_addressbook_model_contact_at (priv->model, i), - NULL); + gnome_canvas_item_set ( + item, + "contact", e_addressbook_model_contact_at (priv->model, i), + NULL); } static void @@ -349,9 +357,10 @@ create_contact (EAddressbookModel *model, gint count, EAddressbookReflowAdapter *adapter) { - e_reflow_model_items_inserted (E_REFLOW_MODEL (adapter), - index, - count); + e_reflow_model_items_inserted ( + E_REFLOW_MODEL (adapter), + index, + count); } static void @@ -418,19 +427,22 @@ addressbook_set_property (GObject *object, switch (property_id) { case PROP_CLIENT: - g_object_set (priv->model, - "client", g_value_get_object (value), - NULL); + g_object_set ( + priv->model, + "client", g_value_get_object (value), + NULL); break; case PROP_QUERY: - g_object_set (priv->model, - "query", g_value_get_string (value), - NULL); + g_object_set ( + priv->model, + "query", g_value_get_string (value), + NULL); break; case PROP_EDITABLE: - g_object_set (priv->model, - "editable", g_value_get_boolean (value), - NULL); + g_object_set ( + priv->model, + "editable", g_value_get_boolean (value), + NULL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -449,18 +461,21 @@ addressbook_get_property (GObject *object, switch (property_id) { case PROP_CLIENT: { - g_object_get_property (G_OBJECT (priv->model), - "client", value); + g_object_get_property ( + G_OBJECT (priv->model), + "client", value); break; } case PROP_QUERY: { - g_object_get_property (G_OBJECT (priv->model), - "query", value); + g_object_get_property ( + G_OBJECT (priv->model), + "query", value); break; } case PROP_EDITABLE: { - g_object_get_property (G_OBJECT (priv->model), - "editable", value); + g_object_get_property ( + G_OBJECT (priv->model), + "editable", value); break; } case PROP_MODEL: @@ -495,52 +510,65 @@ e_addressbook_reflow_adapter_class_init (EAddressbookReflowAdapterClass *class) reflow_model_class->incarnate = addressbook_incarnate; reflow_model_class->reincarnate = addressbook_reincarnate; - g_object_class_install_property (object_class, PROP_CLIENT, - g_param_spec_object ("client", - "EBookClient", - NULL, - E_TYPE_BOOK_CLIENT, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_QUERY, - g_param_spec_string ("query", - "Query", - NULL, - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_EDITABLE, - g_param_spec_boolean ("editable", - "Editable", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_MODEL, - g_param_spec_object ("model", - "Model", - NULL, - E_TYPE_ADDRESSBOOK_MODEL, - G_PARAM_READABLE)); - - signals[DRAG_BEGIN] = - g_signal_new ("drag_begin", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookReflowAdapterClass, drag_begin), - NULL, NULL, - e_marshal_INT__POINTER, - G_TYPE_INT, 1, G_TYPE_POINTER); - - signals[OPEN_CONTACT] = - g_signal_new ("open-contact", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EAddressbookReflowAdapterClass, open_contact), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - E_TYPE_CONTACT); + g_object_class_install_property ( + object_class, + PROP_CLIENT, + g_param_spec_object ( + "client", + "EBookClient", + NULL, + E_TYPE_BOOK_CLIENT, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_QUERY, + g_param_spec_string ( + "query", + "Query", + NULL, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_EDITABLE, + g_param_spec_boolean ( + "editable", + "Editable", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_MODEL, + g_param_spec_object ( + "model", + "Model", + NULL, + E_TYPE_ADDRESSBOOK_MODEL, + G_PARAM_READABLE)); + + signals[DRAG_BEGIN] = g_signal_new ( + "drag_begin", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookReflowAdapterClass, drag_begin), + NULL, NULL, + e_marshal_INT__POINTER, + G_TYPE_INT, 1, + G_TYPE_POINTER); + + signals[OPEN_CONTACT] = g_signal_new ( + "open-contact", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookReflowAdapterClass, open_contact), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + E_TYPE_CONTACT); } static void diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 035a194cca..4d6aea77ae 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1137,7 +1137,8 @@ backend_died (EAddressbookView *view) book_client = e_addressbook_model_get_client (model); source = e_client_get_source (E_CLIENT (book_client)); - e_alert_submit (alert_sink, + e_alert_submit ( + alert_sink, "addressbook:backend-died", e_source_get_display_name (source), NULL); } @@ -1310,29 +1311,29 @@ addressbook_view_confirm_delete (GtkWindow *parent, if (plural) { message = g_strdup ( _("Are you sure you want to " - "delete these contact lists?")); + "delete these contact lists?")); } else if (name == NULL) { message = g_strdup ( _("Are you sure you want to " - "delete this contact list?")); + "delete this contact list?")); } else { message = g_strdup_printf ( _("Are you sure you want to delete " - "this contact list (%s)?"), name); + "this contact list (%s)?"), name); } } else { if (plural) { message = g_strdup ( _("Are you sure you want to " - "delete these contacts?")); + "delete these contacts?")); } else if (name == NULL) { message = g_strdup ( _("Are you sure you want to " - "delete this contact?")); + "delete this contact?")); } else { message = g_strdup_printf ( _("Are you sure you want to delete " - "this contact (%s)?"), name); + "this contact (%s)?"), name); } } diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index 584ed9fe98..618e4ea160 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -42,7 +42,7 @@ static void e_minicard_label_realize (GnomeCanvasItem *item); static void e_minicard_label_reflow (GnomeCanvasItem *item, gint flags); static void e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style); -static void e_minicard_label_resize_children ( EMinicardLabel *e_minicard_label ); +static void e_minicard_label_resize_children (EMinicardLabel *e_minicard_label); static void set_colors (EMinicardLabel *label); @@ -83,73 +83,96 @@ e_minicard_label_class_init (EMinicardLabelClass *class) object_class->set_property = e_minicard_label_set_property; object_class->get_property = e_minicard_label_get_property; - /* object_class->destroy = e_minicard_label_destroy; */ - - g_object_class_install_property (object_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - NULL, - 0.0, G_MAXDOUBLE, 10.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - NULL, - 0.0, G_MAXDOUBLE, 10.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_HAS_FOCUS, - g_param_spec_boolean ("has_focus", - "Has Focus", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_FIELD, - g_param_spec_string ("field", - "Field", - NULL, - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_FIELDNAME, - g_param_spec_string ("fieldname", - "Field Name", - NULL, - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_TEXT_MODEL, - g_param_spec_object ("text_model", - "Text Model", - NULL, - E_TYPE_TEXT_MODEL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_MAX_FIELD_NAME_WIDTH, - g_param_spec_double ("max_field_name_length", - "Max field name length", - NULL, - -1.0, G_MAXDOUBLE, -1.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_EDITABLE, - g_param_spec_boolean ("editable", - "Editable", - NULL, - FALSE, - G_PARAM_READWRITE)); - - e_minicard_label_signals[STYLE_SET] = - g_signal_new ("style_set", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EMinicardLabelClass, style_set), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GTK_TYPE_STYLE); + + g_object_class_install_property ( + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + NULL, + 0.0, G_MAXDOUBLE, 10.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + NULL, + 0.0, G_MAXDOUBLE, 10.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HAS_FOCUS, + g_param_spec_boolean ( + "has_focus", + "Has Focus", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_FIELD, + g_param_spec_string ( + "field", + "Field", + NULL, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_FIELDNAME, + g_param_spec_string ( + "fieldname", + "Field Name", + NULL, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_TEXT_MODEL, + g_param_spec_object ( + "text_model", + "Text Model", + NULL, + E_TYPE_TEXT_MODEL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_MAX_FIELD_NAME_WIDTH, + g_param_spec_double ( + "max_field_name_length", + "Max field name length", + NULL, + -1.0, G_MAXDOUBLE, -1.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_EDITABLE, + g_param_spec_boolean ( + "editable", + "Editable", + NULL, + FALSE, + G_PARAM_READWRITE)); + + e_minicard_label_signals[STYLE_SET] = g_signal_new ( + "style_set", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EMinicardLabelClass, style_set), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_STYLE); /* GnomeCanvasItem method overrides */ item_class->realize = e_minicard_label_realize; @@ -159,15 +182,17 @@ e_minicard_label_class_init (EMinicardLabelClass *class) static void e_minicard_label_init (EMinicardLabel *minicard_label) { - minicard_label->width = 10; - minicard_label->height = 10; - minicard_label->rect = NULL; - minicard_label->fieldname = NULL; - minicard_label->field = NULL; + minicard_label->width = 10; + minicard_label->height = 10; + minicard_label->rect = NULL; + minicard_label->fieldname = NULL; + minicard_label->field = NULL; - minicard_label->max_field_name_length = -1; + minicard_label->max_field_name_length = -1; - e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (minicard_label), e_minicard_label_reflow); + e_canvas_item_set_reflow_callback ( + GNOME_CANVAS_ITEM (minicard_label), + e_minicard_label_reflow); } static void @@ -193,13 +218,13 @@ e_minicard_label_set_property (GObject *object, e_canvas_item_grab_focus (e_minicard_label->field, FALSE); break; case PROP_FIELD: - gnome_canvas_item_set ( e_minicard_label->field, "text", g_value_get_string (value), NULL ); + gnome_canvas_item_set (e_minicard_label->field, "text", g_value_get_string (value), NULL); break; case PROP_FIELDNAME: - gnome_canvas_item_set ( e_minicard_label->fieldname, "text", g_value_get_string (value), NULL ); + gnome_canvas_item_set (e_minicard_label->fieldname, "text", g_value_get_string (value), NULL); break; case PROP_TEXT_MODEL: - gnome_canvas_item_set ( e_minicard_label->field, "model", g_value_get_object (value), NULL); + gnome_canvas_item_set (e_minicard_label->field, "model", g_value_get_object (value), NULL); break; case PROP_MAX_FIELD_NAME_WIDTH: e_minicard_label->max_field_name_length = g_value_get_double (value); @@ -235,16 +260,19 @@ e_minicard_label_get_property (GObject *object, g_value_set_boolean (value, e_minicard_label->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE); break; case PROP_FIELD: - g_object_get_property (G_OBJECT (e_minicard_label->field), - "text", value); + g_object_get_property ( + G_OBJECT (e_minicard_label->field), + "text", value); break; case PROP_FIELDNAME: - g_object_get_property (G_OBJECT (e_minicard_label->fieldname), - "text", value); + g_object_get_property ( + G_OBJECT (e_minicard_label->fieldname), + "text", value); break; case PROP_TEXT_MODEL: - g_object_get_property (G_OBJECT (e_minicard_label->field), - "model", value); + g_object_get_property ( + G_OBJECT (e_minicard_label->field), + "model", value); break; case PROP_MAX_FIELD_NAME_WIDTH: g_value_set_double (value, e_minicard_label->max_field_name_length); @@ -265,43 +293,48 @@ e_minicard_label_realize (GnomeCanvasItem *item) GnomeCanvasGroup *group; e_minicard_label = E_MINICARD_LABEL (item); - group = GNOME_CANVAS_GROUP ( item ); + group = GNOME_CANVAS_GROUP (item); GNOME_CANVAS_ITEM_CLASS (e_minicard_label_parent_class)->realize (item); e_canvas_item_request_reflow (item); - e_minicard_label->rect = - gnome_canvas_item_new ( group, - gnome_canvas_rect_get_type (), - "x1", (double) 0, - "y1", (double) 0, - "x2", (double) e_minicard_label->width - 1, - "y2", (double) e_minicard_label->height - 1, - "outline_color", NULL, - NULL ); - e_minicard_label->fieldname = - gnome_canvas_item_new ( group, - e_text_get_type (), - "clip_width", (double) ( e_minicard_label->width / 2 - 4 ), - "clip", TRUE, - "use_ellipsis", TRUE, - "fill_color", "black", - "im_context", E_CANVAS (item->canvas)->im_context, - NULL ); + e_minicard_label->rect = gnome_canvas_item_new ( + group, + gnome_canvas_rect_get_type (), + "x1", (gdouble) 0, + "y1", (gdouble) 0, + "x2", (gdouble) e_minicard_label->width - 1, + "y2", (gdouble) e_minicard_label->height - 1, + "outline_color", NULL, + NULL); + + e_minicard_label->fieldname = gnome_canvas_item_new ( + group, + e_text_get_type (), + "clip_width", (gdouble) (e_minicard_label->width / 2 - 4), + "clip", TRUE, + "use_ellipsis", TRUE, + "fill_color", "black", + "im_context", E_CANVAS (item->canvas)->im_context, + NULL); + e_canvas_item_move_absolute (e_minicard_label->fieldname, 2, 1); - e_minicard_label->field = - gnome_canvas_item_new ( group, - e_text_get_type (), - "clip_width", (double) ( ( e_minicard_label->width + 1 ) / 2 - 4 ), - "clip", TRUE, - "use_ellipsis", TRUE, - "fill_color", "black", - "editable", FALSE, /* e_minicard_label->editable, */ - "im_context", E_CANVAS (item->canvas)->im_context, - NULL ); - e_canvas_item_move_absolute (e_minicard_label->field, ( e_minicard_label->width / 2 + 2), 1); + e_minicard_label->field = gnome_canvas_item_new ( + group, + e_text_get_type (), + "clip_width", (gdouble) ((e_minicard_label->width + 1) / 2 - 4), + "clip", TRUE, + "use_ellipsis", TRUE, + "fill_color", "black", + "editable", FALSE, /* e_minicard_label->editable, */ + "im_context", E_CANVAS (item->canvas)->im_context, + NULL); + + e_canvas_item_move_absolute ( + e_minicard_label->field, + (e_minicard_label->width / 2 + 2), 1); set_colors (e_minicard_label); @@ -334,9 +367,10 @@ e_minicard_label_event (GnomeCanvasItem *item, e_minicard_label->has_focus = focus_event->in; set_colors (e_minicard_label); - g_object_set (e_minicard_label->field, - "handle_popup", e_minicard_label->has_focus, - NULL); + g_object_set ( + e_minicard_label->field, + "handle_popup", e_minicard_label->has_focus, + NULL); break; } case GDK_BUTTON_PRESS: @@ -368,14 +402,16 @@ e_minicard_label_resize_children (EMinicardLabel *e_minicard_label) else left_width = e_minicard_label->width / 2 - 4; - fieldnamewidth = (double) MAX ( left_width, 0 ); - fieldwidth = (double) MAX ( e_minicard_label->width - 8 - left_width, 0 ); - gnome_canvas_item_set ( e_minicard_label->fieldname, - "clip_width", is_rtl ? fieldwidth : fieldnamewidth, - NULL ); - gnome_canvas_item_set ( e_minicard_label->field, - "clip_width", is_rtl ? fieldnamewidth : fieldwidth, - NULL ); + fieldnamewidth = (gdouble) MAX (left_width, 0); + fieldwidth = (gdouble) MAX (e_minicard_label->width - 8 - left_width, 0); + gnome_canvas_item_set ( + e_minicard_label->fieldname, + "clip_width", is_rtl ? fieldwidth : fieldnamewidth, + NULL); + gnome_canvas_item_set ( + e_minicard_label->field, + "clip_width", is_rtl ? fieldnamewidth : fieldwidth, + NULL); } static void @@ -391,32 +427,38 @@ set_colors (EMinicardLabel *label) style = gtk_widget_get_style (GTK_WIDGET (canvas)); if (label->has_focus) { - gnome_canvas_item_set (label->rect, - "outline_color_gdk", &style->mid[GTK_STATE_SELECTED], - "fill_color_gdk", &style->bg[GTK_STATE_NORMAL], - NULL); - - gnome_canvas_item_set (label->field, - "fill_color_gdk", &style->text[GTK_STATE_NORMAL], - NULL); - - gnome_canvas_item_set (label->fieldname, - "fill_color_gdk", &style->text[GTK_STATE_NORMAL], - NULL); + gnome_canvas_item_set ( + label->rect, + "outline_color_gdk", &style->mid[GTK_STATE_SELECTED], + "fill_color_gdk", &style->bg[GTK_STATE_NORMAL], + NULL); + + gnome_canvas_item_set ( + label->field, + "fill_color_gdk", &style->text[GTK_STATE_NORMAL], + NULL); + + gnome_canvas_item_set ( + label->fieldname, + "fill_color_gdk", &style->text[GTK_STATE_NORMAL], + NULL); } else { - gnome_canvas_item_set (label->rect, - "outline_color_gdk", NULL, - "fill_color_gdk", NULL, - NULL); - - gnome_canvas_item_set (label->field, - "fill_color_gdk", &style->text[GTK_STATE_NORMAL], - NULL); - - gnome_canvas_item_set (label->fieldname, - "fill_color_gdk", &style->text[GTK_STATE_NORMAL], - NULL); + gnome_canvas_item_set ( + label->rect, + "outline_color_gdk", NULL, + "fill_color_gdk", NULL, + NULL); + + gnome_canvas_item_set ( + label->field, + "fill_color_gdk", &style->text[GTK_STATE_NORMAL], + NULL); + + gnome_canvas_item_set ( + label->fieldname, + "fill_color_gdk", &style->text[GTK_STATE_NORMAL], + NULL); } } } @@ -440,28 +482,32 @@ e_minicard_label_reflow (GnomeCanvasItem *item, old_height = e_minicard_label->height; - g_object_get (e_minicard_label->fieldname, - "text_height", &text_height, - NULL); + g_object_get ( + e_minicard_label->fieldname, + "text_height", &text_height, + NULL); e_minicard_label->height = text_height; - g_object_get (e_minicard_label->field, - "text_height", &text_height, - NULL); + g_object_get ( + e_minicard_label->field, + "text_height", &text_height, + NULL); if (e_minicard_label->height < text_height) e_minicard_label->height = text_height; e_minicard_label->height += 3; - gnome_canvas_item_set ( e_minicard_label->rect, - "x2", (double) e_minicard_label->width - 1, - "y2", (double) e_minicard_label->height - 1, - NULL ); + gnome_canvas_item_set ( + e_minicard_label->rect, + "x2", (gdouble) e_minicard_label->width - 1, + "y2", (gdouble) e_minicard_label->height - 1, + NULL); - gnome_canvas_item_set ( e_minicard_label->fieldname, - "clip_height", (double) e_minicard_label->height - 3, - NULL ); + gnome_canvas_item_set ( + e_minicard_label->fieldname, + "clip_height", (gdouble) e_minicard_label->height - 3, + NULL); if (e_minicard_label->max_field_name_length != -1 && ((e_minicard_label->width / 2) - 4 > e_minicard_label->max_field_name_length)) left_width = e_minicard_label->max_field_name_length; @@ -477,7 +523,7 @@ e_minicard_label_reflow (GnomeCanvasItem *item, GnomeCanvasItem * e_minicard_label_new (GnomeCanvasGroup *parent) { - GnomeCanvasItem *item = gnome_canvas_item_new (parent, e_minicard_label_get_type (), NULL); - return item; + return gnome_canvas_item_new ( + parent, e_minicard_label_get_type (), NULL); } diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index f7ebabf246..ecb2483652 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -104,78 +104,92 @@ e_minicard_view_widget_class_init (EMinicardViewWidgetClass *class) class->column_width_changed = NULL; class->right_click = NULL; - g_object_class_install_property (object_class, PROP_CLIENT, - g_param_spec_object ("client", - "EBookClient", - NULL, - E_TYPE_BOOK_CLIENT, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_QUERY, - g_param_spec_string ("query", - "Query", - NULL, - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_EDITABLE, - g_param_spec_boolean ("editable", - "Editable", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_COLUMN_WIDTH, - g_param_spec_double ("column_width", - "Column Width", - NULL, - 0.0, G_MAXDOUBLE, 225.0, - G_PARAM_READWRITE)); - - signals[CREATE_CONTACT] = - g_signal_new ("create-contact", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMinicardViewWidgetClass, create_contact), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[CREATE_CONTACT_LIST] = - g_signal_new ("create-contact-list", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMinicardViewWidgetClass, create_contact_list), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[SELECTION_CHANGE] = - g_signal_new ("selection_change", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMinicardViewWidgetClass, selection_change), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[COLUMN_WIDTH_CHANGED] = - g_signal_new ("column_width_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMinicardViewWidgetClass, column_width_changed), - NULL, NULL, - g_cclosure_marshal_VOID__DOUBLE, - G_TYPE_NONE, 1, G_TYPE_DOUBLE); - - signals[RIGHT_CLICK] = - g_signal_new ("right_click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMinicardViewWidgetClass, right_click), - NULL, NULL, - e_marshal_INT__POINTER, - G_TYPE_INT, 1, G_TYPE_POINTER); + g_object_class_install_property ( + object_class, + PROP_CLIENT, + g_param_spec_object ( + "client", + "EBookClient", + NULL, + E_TYPE_BOOK_CLIENT, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_QUERY, + g_param_spec_string ( + "query", + "Query", + NULL, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_EDITABLE, + g_param_spec_boolean ( + "editable", + "Editable", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_COLUMN_WIDTH, + g_param_spec_double ( + "column_width", + "Column Width", + NULL, + 0.0, G_MAXDOUBLE, 225.0, + G_PARAM_READWRITE)); + + signals[CREATE_CONTACT] = g_signal_new ( + "create-contact", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewWidgetClass, create_contact), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[CREATE_CONTACT_LIST] = g_signal_new ( + "create-contact-list", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewWidgetClass, create_contact_list), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[SELECTION_CHANGE] = g_signal_new ( + "selection_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewWidgetClass, selection_change), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[COLUMN_WIDTH_CHANGED] = g_signal_new ( + "column_width_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewWidgetClass, column_width_changed), + NULL, NULL, + g_cclosure_marshal_VOID__DOUBLE, + G_TYPE_NONE, 1, + G_TYPE_DOUBLE); + + signals[RIGHT_CLICK] = g_signal_new ( + "right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewWidgetClass, right_click), + NULL, NULL, + e_marshal_INT__POINTER, + G_TYPE_INT, 1, + G_TYPE_POINTER); } static void @@ -222,30 +236,34 @@ e_minicard_view_widget_set_property (GObject *object, } else emvw->book_client = NULL; if (emvw->emv) - g_object_set (emvw->emv, - "client", emvw->book_client, - NULL); + g_object_set ( + emvw->emv, + "client", emvw->book_client, + NULL); break; case PROP_QUERY: emvw->query = g_strdup (g_value_get_string (value)); if (emvw->emv) - g_object_set (emvw->emv, - "query", emvw->query, - NULL); + g_object_set ( + emvw->emv, + "query", emvw->query, + NULL); break; case PROP_EDITABLE: emvw->editable = g_value_get_boolean (value); if (emvw->emv) - g_object_set (emvw->emv, - "editable", emvw->editable, - NULL); + g_object_set ( + emvw->emv, + "editable", emvw->editable, + NULL); break; case PROP_COLUMN_WIDTH: emvw->column_width = g_value_get_double (value); if (emvw->emv) { - g_object_set (emvw->emv, - "column_width", emvw->column_width, - NULL); + g_object_set ( + emvw->emv, + "column_width", emvw->column_width, + NULL); } break; default: @@ -383,16 +401,16 @@ e_minicard_view_widget_realize (GtkWidget *widget) gnome_canvas_root (GNOME_CANVAS (view)), e_canvas_background_get_type (), "fill_color_gdk", &style->base[GTK_STATE_NORMAL], - NULL ); + NULL); view->emv = gnome_canvas_item_new ( gnome_canvas_root (GNOME_CANVAS (view)), e_minicard_view_get_type (), - "height", (double) 100, - "minimum_width", (double) 100, + "height", (gdouble) 100, + "minimum_width", (gdouble) 100, "adapter", view->adapter, "column_width", view->column_width, - NULL ); + NULL); g_signal_connect ( E_REFLOW (view->emv)->selection, diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 01899e8a57..88633d4492 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -144,8 +144,9 @@ 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); + context = gtk_drag_begin ( + GTK_WIDGET (GNOME_CANVAS_ITEM (view)->canvas), + target_list, actions, 1/*XXX */, event); if (!view->canvas_drag_data_get_id) view->canvas_drag_data_get_id = g_signal_connect ( @@ -167,11 +168,12 @@ set_empty_message (EMinicardView *view) EAddressbookModel *model = NULL; EBookClient *book_client = NULL; - g_object_get (view->adapter, - "editable", &editable, - "model", &model, - "client", &book_client, - NULL); + g_object_get ( + view->adapter, + "editable", &editable, + "model", &model, + "client", &book_client, + NULL); if (book_client && !e_client_check_capability (E_CLIENT (book_client), "do-initial-query")) perform_initial_query = TRUE; @@ -200,9 +202,10 @@ set_empty_message (EMinicardView *view) empty_message = _("\n\nThere are no items to show in this view."); } - g_object_set (view, - "empty_message", empty_message, - NULL); + g_object_set ( + view, + "empty_message", empty_message, + NULL); } static void @@ -245,9 +248,10 @@ e_minicard_view_set_property (GObject *object, if (view->adapter) { if (view->writable_status_id || view->stop_state_id) { EAddressbookModel *model; - g_object_get (view->adapter, - "model", &model, - NULL); + g_object_get ( + view->adapter, + "model", &model, + NULL); if (model) { if (view->writable_status_id) g_signal_handler_disconnect (model, view->writable_status_id); @@ -263,14 +267,16 @@ e_minicard_view_set_property (GObject *object, view->adapter = g_value_get_object (value); g_object_ref (view->adapter); adapter_changed (view); - g_object_set (view, - "model", view->adapter, - NULL); + g_object_set ( + view, + "model", view->adapter, + NULL); if (view->adapter) { EAddressbookModel *model; - g_object_get (view->adapter, - "model", &model, - NULL); + g_object_get ( + view->adapter, + "model", &model, + NULL); if (model) { view->writable_status_id = g_signal_connect ( model, "writable_status", @@ -283,20 +289,23 @@ e_minicard_view_set_property (GObject *object, } break; case PROP_CLIENT: - g_object_set (view->adapter, - "client", g_value_get_object (value), - NULL); + g_object_set ( + view->adapter, + "client", g_value_get_object (value), + NULL); set_empty_message (view); break; case PROP_QUERY: - g_object_set (view->adapter, - "query", g_value_get_string (value), - NULL); + g_object_set ( + view->adapter, + "query", g_value_get_string (value), + NULL); break; case PROP_EDITABLE: - g_object_set (view->adapter, - "editable", g_value_get_boolean (value), - NULL); + g_object_set ( + view->adapter, + "editable", g_value_get_boolean (value), + NULL); set_empty_message (view); break; default: @@ -320,16 +329,19 @@ e_minicard_view_get_property (GObject *object, g_value_set_object (value, view->adapter); break; case PROP_CLIENT: - g_object_get_property (G_OBJECT (view->adapter), - "client", value); + g_object_get_property ( + G_OBJECT (view->adapter), + "client", value); break; case PROP_QUERY: - g_object_get_property (G_OBJECT (view->adapter), - "query", value); + g_object_get_property ( + G_OBJECT (view->adapter), + "query", value); break; case PROP_EDITABLE: - g_object_get_property (G_OBJECT (view->adapter), - "editable", value); + g_object_get_property ( + G_OBJECT (view->adapter), + "editable", value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -345,17 +357,19 @@ e_minicard_view_dispose (GObject *object) clear_drag_data (view); if (view->canvas_drag_data_get_id) { - g_signal_handler_disconnect (GNOME_CANVAS_ITEM (view)->canvas, - view->canvas_drag_data_get_id); + g_signal_handler_disconnect ( + GNOME_CANVAS_ITEM (view)->canvas, + view->canvas_drag_data_get_id); view->canvas_drag_data_get_id = 0; } if (view->adapter) { if (view->writable_status_id || view->stop_state_id) { EAddressbookModel *model; - g_object_get (view->adapter, - "model", &model, - NULL); + g_object_get ( + view->adapter, + "model", &model, + NULL); if (model) { if (view->writable_status_id) g_signal_handler_disconnect (model, view->writable_status_id); @@ -379,8 +393,9 @@ e_minicard_view_right_click (EMinicardView *view, GdkEvent *event) { guint ret_val = 0; - g_signal_emit (view, signals[RIGHT_CLICK], 0, - event, &ret_val); + g_signal_emit ( + view, signals[RIGHT_CLICK], 0, + event, &ret_val); return ret_val; } @@ -474,58 +489,71 @@ e_minicard_view_class_init (EMinicardViewClass *class) object_class->get_property = e_minicard_view_get_property; object_class->dispose = e_minicard_view_dispose; - g_object_class_install_property (object_class, PROP_ADAPTER, - g_param_spec_object ("adapter", - "Adapter", - NULL, - E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_CLIENT, - g_param_spec_object ("client", - "EBookClient", - NULL, - E_TYPE_BOOK_CLIENT, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_QUERY, - g_param_spec_string ("query", - "Query", - NULL, - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_EDITABLE, - g_param_spec_boolean ("editable", - "Editable", - NULL, - FALSE, - G_PARAM_READWRITE)); - - signals[CREATE_CONTACT] = - g_signal_new ("create-contact", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - 0, NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[CREATE_CONTACT_LIST] = - g_signal_new ("create-contact-list", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - 0, NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[RIGHT_CLICK] = - g_signal_new ("right_click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMinicardViewClass, right_click), - NULL, NULL, - e_marshal_INT__POINTER, - G_TYPE_INT, 1, G_TYPE_POINTER); + g_object_class_install_property ( + object_class, + PROP_ADAPTER, + g_param_spec_object ( + "adapter", + "Adapter", + NULL, + E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_CLIENT, + g_param_spec_object ( + "client", + "EBookClient", + NULL, + E_TYPE_BOOK_CLIENT, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_QUERY, + g_param_spec_string ( + "query", + "Query", + NULL, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_EDITABLE, + g_param_spec_boolean ( + "editable", + "Editable", + NULL, + FALSE, + G_PARAM_READWRITE)); + + signals[CREATE_CONTACT] = g_signal_new ( + "create-contact", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + 0, NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[CREATE_CONTACT_LIST] = g_signal_new ( + "create-contact-list", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + 0, NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[RIGHT_CLICK] = g_signal_new ( + "right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewClass, right_click), + NULL, NULL, + e_marshal_INT__POINTER, + G_TYPE_INT, 1, + G_TYPE_POINTER); item_class->event = e_minicard_view_event; @@ -556,9 +584,10 @@ e_minicard_view_jump_to_letter (EMinicardView *view, gchar uft_str[6 + 1]; utf_str[g_unichar_to_utf8 (letter, utf_str)] = '\0'; - e_reflow_sorted_jump (E_REFLOW_SORTED (view), - (GCompareFunc) compare_to_utf_str, - utf_str); + e_reflow_sorted_jump ( + E_REFLOW_SORTED (view), + (GCompareFunc) compare_to_utf_str, + utf_str); #endif } diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index d0af5117b0..4e0df4c42f 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -46,11 +46,11 @@ static void e_minicard_dispose (GObject *object); static void e_minicard_finalize (GObject *object); static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_realize (GnomeCanvasItem *item); -static void e_minicard_reflow ( GnomeCanvasItem *item, gint flags ); +static void e_minicard_reflow (GnomeCanvasItem *item, gint flags); static void e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style); -static void e_minicard_resize_children ( EMinicard *e_minicard ); -static void remodel ( EMinicard *e_minicard ); +static void e_minicard_resize_children (EMinicard *e_minicard); +static void remodel (EMinicard *e_minicard); static gint e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event); @@ -118,94 +118,118 @@ e_minicard_class_init (EMinicardClass *class) class->style_set = e_minicard_style_set; class->selected = NULL; - g_object_class_install_property (object_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - NULL, - 0.0, G_MAXDOUBLE, 10.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - NULL, - 0.0, G_MAXDOUBLE, 10.0, - G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_HAS_FOCUS, - /* XXX should be _enum */ - g_param_spec_int ("has_focus", - "Has Focus", - NULL, - E_MINICARD_FOCUS_TYPE_START, E_MINICARD_FOCUS_TYPE_END, - E_MINICARD_FOCUS_TYPE_START, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_SELECTED, - g_param_spec_boolean ("selected", - "Selected", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_HAS_CURSOR, - g_param_spec_boolean ("has_cursor", - "Has Cursor", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_EDITABLE, - g_param_spec_boolean ("editable", - "Editable", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_CONTACT, - g_param_spec_object ("contact", - "Contact", - NULL, - E_TYPE_CONTACT, - G_PARAM_READWRITE)); - - signals[SELECTED] = - g_signal_new ("selected", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMinicardClass, selected), - NULL, NULL, - e_marshal_INT__POINTER, - G_TYPE_INT, 1, G_TYPE_POINTER); - - signals[DRAG_BEGIN] = - g_signal_new ("drag_begin", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMinicardClass, drag_begin), - NULL, NULL, - e_marshal_INT__POINTER, - G_TYPE_INT, 1, G_TYPE_POINTER); - - signals[OPEN_CONTACT] = - g_signal_new ("open-contact", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMinicardClass, open_contact), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - E_TYPE_CONTACT); - - signals[STYLE_SET] = - g_signal_new ("style_set", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EMinicardClass, style_set), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GTK_TYPE_STYLE); + g_object_class_install_property ( + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + NULL, + 0.0, G_MAXDOUBLE, 10.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + NULL, + 0.0, G_MAXDOUBLE, 10.0, + G_PARAM_READABLE)); + + g_object_class_install_property ( + object_class, + PROP_HAS_FOCUS, + /* XXX should be _enum */ + g_param_spec_int ( + "has_focus", + "Has Focus", + NULL, + E_MINICARD_FOCUS_TYPE_START, + E_MINICARD_FOCUS_TYPE_END, + E_MINICARD_FOCUS_TYPE_START, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_SELECTED, + g_param_spec_boolean ( + "selected", + "Selected", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HAS_CURSOR, + g_param_spec_boolean ( + "has_cursor", + "Has Cursor", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_EDITABLE, + g_param_spec_boolean ( + "editable", + "Editable", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_CONTACT, + g_param_spec_object ( + "contact", + "Contact", + NULL, + E_TYPE_CONTACT, + G_PARAM_READWRITE)); + + signals[SELECTED] = g_signal_new ( + "selected", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardClass, selected), + NULL, NULL, + e_marshal_INT__POINTER, + G_TYPE_INT, 1, + G_TYPE_POINTER); + + signals[DRAG_BEGIN] = g_signal_new ( + "drag_begin", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardClass, drag_begin), + NULL, NULL, + e_marshal_INT__POINTER, + G_TYPE_INT, 1, + G_TYPE_POINTER); + + signals[OPEN_CONTACT] = g_signal_new ( + "open-contact", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardClass, open_contact), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + E_TYPE_CONTACT); + + signals[STYLE_SET] = g_signal_new ( + "style_set", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EMinicardClass, style_set), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_STYLE); /* init the accessibility support for e_minicard */ e_minicard_a11y_init (); @@ -244,25 +268,31 @@ set_selected (EMinicard *minicard, style = gtk_widget_get_style (GTK_WIDGET (canvas)); if (selected) { - gnome_canvas_item_set (minicard->rect, - "outline_color_gdk", &style->bg[GTK_STATE_ACTIVE], - NULL); - gnome_canvas_item_set (minicard->header_rect, - "fill_color_gdk", &style->bg[GTK_STATE_SELECTED], - NULL); - gnome_canvas_item_set (minicard->header_text, - "fill_color_gdk", &style->text[GTK_STATE_SELECTED], - NULL); + gnome_canvas_item_set ( + minicard->rect, + "outline_color_gdk", &style->bg[GTK_STATE_ACTIVE], + NULL); + gnome_canvas_item_set ( + minicard->header_rect, + "fill_color_gdk", &style->bg[GTK_STATE_SELECTED], + NULL); + gnome_canvas_item_set ( + minicard->header_text, + "fill_color_gdk", &style->text[GTK_STATE_SELECTED], + NULL); } else { - gnome_canvas_item_set (minicard->rect, - "outline_color", NULL, - NULL); - gnome_canvas_item_set (minicard->header_rect, - "fill_color_gdk", &style->bg[GTK_STATE_NORMAL], - NULL); - gnome_canvas_item_set (minicard->header_text, - "fill_color_gdk", &style->text[GTK_STATE_NORMAL], - NULL); + gnome_canvas_item_set ( + minicard->rect, + "outline_color", NULL, + NULL); + gnome_canvas_item_set ( + minicard->header_rect, + "fill_color_gdk", &style->bg[GTK_STATE_NORMAL], + NULL); + gnome_canvas_item_set ( + minicard->header_text, + "fill_color_gdk", &style->text[GTK_STATE_NORMAL], + NULL); } minicard->selected = selected; } @@ -301,15 +331,17 @@ e_minicard_set_property (GObject *object, break; case PROP_HAS_FOCUS: if (e_minicard->fields) { - if ( g_value_get_int (value) == E_FOCUS_START || + if (g_value_get_int (value) == E_FOCUS_START || g_value_get_int (value) == E_FOCUS_CURRENT) { - gnome_canvas_item_set (E_MINICARD_FIELD (e_minicard->fields->data)->label, - "has_focus", g_value_get_int (value), - NULL); + gnome_canvas_item_set ( + E_MINICARD_FIELD (e_minicard->fields->data)->label, + "has_focus", g_value_get_int (value), + NULL); } else if (g_value_get_int (value) == E_FOCUS_END) { - gnome_canvas_item_set (E_MINICARD_FIELD (g_list_last (e_minicard->fields)->data)->label, - "has_focus", g_value_get_int (value), - NULL); + gnome_canvas_item_set ( + E_MINICARD_FIELD (g_list_last (e_minicard->fields)->data)->label, + "has_focus", g_value_get_int (value), + NULL); } } else { @@ -324,9 +356,10 @@ e_minicard_set_property (GObject *object, case PROP_EDITABLE: e_minicard->editable = g_value_get_boolean (value); for (l = e_minicard->fields; l; l = l->next) { - g_object_set (E_MINICARD_FIELD (l->data)->label, - "editable", FALSE /* e_minicard->editable */, - NULL); + g_object_set ( + E_MINICARD_FIELD (l->data)->label, + "editable", FALSE /* e_minicard->editable */, + NULL); } break; case PROP_HAS_CURSOR: @@ -467,43 +500,43 @@ e_minicard_realize (GnomeCanvasItem *item) GNOME_CANVAS_ITEM_CLASS (e_minicard_parent_class)->realize (item); - e_minicard->rect = - gnome_canvas_item_new ( group, - gnome_canvas_rect_get_type (), - "x1", (double) 0, - "y1", (double) 0, - "x2", (double) MAX (e_minicard->width - 1, 0), - "y2", (double) MAX (e_minicard->height - 1, 0), - "outline_color", NULL, - NULL ); - - e_minicard->header_rect = - gnome_canvas_item_new ( group, - gnome_canvas_rect_get_type (), - "x1", (double) 2, - "y1", (double) 2, - "x2", (double) MAX (e_minicard->width - 3, 0), - "y2", (double) MAX (e_minicard->height - 3, 0), - "fill_color_gdk", &style->bg[GTK_STATE_NORMAL], - NULL ); - - e_minicard->header_text = - gnome_canvas_item_new ( group, - e_text_get_type (), - "width", (double) MAX ( e_minicard->width - 12, 0 ), - "clip", TRUE, - "use_ellipsis", TRUE, - "fill_color_gdk", &style->fg[GTK_STATE_NORMAL], - "text", "", - NULL ); + e_minicard->rect = gnome_canvas_item_new ( + group, + gnome_canvas_rect_get_type (), + "x1", (gdouble) 0, + "y1", (gdouble) 0, + "x2", (gdouble) MAX (e_minicard->width - 1, 0), + "y2", (gdouble) MAX (e_minicard->height - 1, 0), + "outline_color", NULL, + NULL); + + e_minicard->header_rect = gnome_canvas_item_new ( + group, + gnome_canvas_rect_get_type (), + "x1", (gdouble) 2, + "y1", (gdouble) 2, + "x2", (gdouble) MAX (e_minicard->width - 3, 0), + "y2", (gdouble) MAX (e_minicard->height - 3, 0), + "fill_color_gdk", &style->bg[GTK_STATE_NORMAL], + NULL); + + e_minicard->header_text = gnome_canvas_item_new ( + group, + e_text_get_type (), + "width", (gdouble) MAX (e_minicard->width - 12, 0), + "clip", TRUE, + "use_ellipsis", TRUE, + "fill_color_gdk", &style->fg[GTK_STATE_NORMAL], + "text", "", + NULL); e_canvas_item_move_absolute (e_minicard->header_text, 6, 6); - e_minicard->list_icon = - gnome_canvas_item_new ( group, - gnome_canvas_pixbuf_get_type (), - "pixbuf", e_minicard->list_icon_pixbuf, - NULL); + e_minicard->list_icon = gnome_canvas_item_new ( + group, + gnome_canvas_pixbuf_get_type (), + "pixbuf", e_minicard->list_icon_pixbuf, + NULL); set_selected (e_minicard, e_minicard->selected); @@ -634,9 +667,10 @@ e_minicard_event (GnomeCanvasItem *item, model_index = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), view_index); if (reflow->items[model_index] == NULL) { reflow->items[model_index] = e_reflow_model_incarnate (reflow->model, model_index, GNOME_CANVAS_GROUP (reflow)); - g_object_set (reflow->items[model_index], - "width", (double) reflow->column_width, - NULL); + g_object_set ( + reflow->items[model_index], + "width", (gdouble) reflow->column_width, + NULL); } e_canvas_item_grab_focus (reflow->items[model_index], FALSE); @@ -660,9 +694,10 @@ e_minicard_event (GnomeCanvasItem *item, model_index = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), view_index); if (reflow->items[model_index] == NULL) { reflow->items[model_index] = e_reflow_model_incarnate (reflow->model, model_index, GNOME_CANVAS_GROUP (reflow)); - g_object_set (reflow->items[model_index], - "width", (double) reflow->column_width, - NULL); + g_object_set ( + reflow->items[model_index], + "width", (gdouble) reflow->column_width, + NULL); } e_canvas_item_grab_focus (reflow->items[model_index], FALSE); @@ -690,20 +725,23 @@ e_minicard_resize_children (EMinicard *e_minicard) gboolean is_list = GPOINTER_TO_INT (e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST)); if (e_minicard->header_text) { - gnome_canvas_item_set ( e_minicard->header_text, - "width", ((double) e_minicard->width - 12 - - (is_list ? e_minicard->list_icon_size : 0.0)), - NULL ); + gnome_canvas_item_set ( + e_minicard->header_text, + "width", ((gdouble) e_minicard->width - 12 + - (is_list ? e_minicard->list_icon_size : 0.0)), + NULL); } if (e_minicard->list_icon) { - e_canvas_item_move_absolute (e_minicard->list_icon, - e_minicard->width - e_minicard->list_icon_size - 3, - 3); + e_canvas_item_move_absolute ( + e_minicard->list_icon, + e_minicard->width - e_minicard->list_icon_size - 3, + 3); } - for (list = e_minicard->fields; list; list = g_list_next ( list )) { - gnome_canvas_item_set ( E_MINICARD_FIELD ( list->data )->label, - "width", (double) e_minicard->width - 4.0, - NULL ); + for (list = e_minicard->fields; list; list = g_list_next (list)) { + gnome_canvas_item_set ( + E_MINICARD_FIELD (list->data)->label, + "width", (gdouble) e_minicard->width - 4.0, + NULL); } } @@ -719,7 +757,7 @@ add_field (EMinicard *e_minicard, gchar *string; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); - group = GNOME_CANVAS_GROUP ( e_minicard ); + group = GNOME_CANVAS_GROUP (e_minicard); name = g_strdup_printf ("%s:", e_contact_pretty_name (field)); string = e_contact_get (e_minicard->contact, field); @@ -727,36 +765,40 @@ add_field (EMinicard *e_minicard, new_item = e_minicard_label_new (group); if (e_minicard->contact && e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST)) - gnome_canvas_item_set (new_item, - "fieldname", is_rtl ? "" : string, - "field", is_rtl ? string : "", - "max_field_name_length", left_width, - "editable", FALSE /* e_minicard->editable */, - "width", e_minicard->width - 4.0, - NULL ); + gnome_canvas_item_set ( + new_item, + "fieldname", is_rtl ? "" : string, + "field", is_rtl ? string : "", + "max_field_name_length", left_width, + "editable", FALSE /* e_minicard->editable */, + "width", e_minicard->width - 4.0, + NULL); else - gnome_canvas_item_set (new_item, - "fieldname", is_rtl ? string : name, - "field", is_rtl ? name : string, - "max_field_name_length", left_width, - "editable", FALSE /* e_minicard->editable */, - "width", e_minicard->width - 4.0, - NULL ); + gnome_canvas_item_set ( + new_item, + "fieldname", is_rtl ? string : name, + "field", is_rtl ? name : string, + "max_field_name_length", left_width, + "editable", FALSE /* e_minicard->editable */, + "width", e_minicard->width - 4.0, + NULL); #ifdef notyet - g_object_set (E_MINICARD_LABEL (new_item)->field, - "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->contact, field), - NULL); + g_object_set ( + E_MINICARD_LABEL (new_item)->field, + "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->contact, field), + NULL); #endif - g_object_set_data (G_OBJECT (E_MINICARD_LABEL (new_item)->field), - "EMinicard:field", - GINT_TO_POINTER (field)); + g_object_set_data ( + G_OBJECT (E_MINICARD_LABEL (new_item)->field), + "EMinicard:field", + GINT_TO_POINTER (field)); minicard_field = g_new (EMinicardField, 1); minicard_field->field = field; minicard_field->label = new_item; - e_minicard->fields = g_list_append ( e_minicard->fields, minicard_field); + e_minicard->fields = g_list_append (e_minicard->fields, minicard_field); e_canvas_item_move_absolute (new_item, 2, e_minicard->height); g_free (name); g_free (string); @@ -790,7 +832,7 @@ add_email_field (EMinicard *e_minicard, gint count =0; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); GList *emails = e_contact_get (e_minicard->contact, E_CONTACT_EMAIL); - group = GNOME_CANVAS_GROUP ( e_minicard ); + group = GNOME_CANVAS_GROUP (e_minicard); for (l = email_list, le = emails; l != NULL && count < limit && le != NULL; l = l->next, le = le->next) { const gchar *tmp; @@ -818,28 +860,31 @@ add_email_field (EMinicard *e_minicard, new_item = e_minicard_label_new (group); - gnome_canvas_item_set (new_item, - "fieldname", is_rtl ? string : name, - "field", is_rtl ? name : string, - "max_field_name_length", left_width, - "editable", FALSE /* e_minicard->editable */, - "width", e_minicard->width - 4.0, - NULL ); + gnome_canvas_item_set ( + new_item, + "fieldname", is_rtl ? string : name, + "field", is_rtl ? name : string, + "max_field_name_length", left_width, + "editable", FALSE /* e_minicard->editable */, + "width", e_minicard->width - 4.0, + NULL); #ifdef notyet - g_object_set (E_MINICARD_LABEL (new_item)->field, - "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->contact, field), - NULL); + g_object_set ( + E_MINICARD_LABEL (new_item)->field, + "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->contact, field), + NULL); #endif - g_object_set_data (G_OBJECT (E_MINICARD_LABEL (new_item)->field), - "EMinicard:field", - GINT_TO_POINTER (E_CONTACT_EMAIL)); + g_object_set_data ( + G_OBJECT (E_MINICARD_LABEL (new_item)->field), + "EMinicard:field", + GINT_TO_POINTER (E_CONTACT_EMAIL)); minicard_field = g_new (EMinicardField, 1); minicard_field->field = E_CONTACT_EMAIL; minicard_field->label = new_item; - e_minicard->fields = g_list_append ( e_minicard->fields, minicard_field); + e_minicard->fields = g_list_append (e_minicard->fields, minicard_field); e_canvas_item_move_absolute (new_item, 2, e_minicard->height); count++; if (!is_list) @@ -902,9 +947,10 @@ remodel (EMinicard *e_minicard) if (e_minicard->header_text) { file_as = e_contact_get (e_minicard->contact, E_CONTACT_FILE_AS); - gnome_canvas_item_set (e_minicard->header_text, - "text", file_as ? file_as : "", - NULL ); + gnome_canvas_item_set ( + e_minicard->header_text, + "text", file_as ? file_as : "", + NULL); g_free (file_as); } @@ -947,9 +993,10 @@ remodel (EMinicard *e_minicard) string = e_contact_get (e_minicard->contact, field); if (string && *string) { e_minicard->fields = g_list_append (e_minicard->fields, minicard_field); - g_object_set (minicard_field->label, - "field", string, - NULL); + g_object_set ( + minicard_field->label, + "field", string, + NULL); count++; } else { e_minicard_field_destroy (minicard_field); @@ -1012,35 +1059,40 @@ e_minicard_reflow (GnomeCanvasItem *item, old_height = e_minicard->height; - g_object_get (e_minicard->header_text, - "text_height", &text_height, - NULL); + g_object_get ( + e_minicard->header_text, + "text_height", &text_height, + NULL); e_minicard->height = text_height + 10.0; - gnome_canvas_item_set (e_minicard->header_rect, - "y2", text_height + 9.0, - NULL); + gnome_canvas_item_set ( + e_minicard->header_rect, + "y2", text_height + 9.0, + NULL); for (list = e_minicard->fields; list; list = g_list_next (list)) { EMinicardField *field = E_MINICARD_FIELD (list->data); /* Why not use the item that is passed in? */ GnomeCanvasItem *item = field->label; - g_object_get (item, - "height", &text_height, - NULL); + g_object_get ( + item, + "height", &text_height, + NULL); e_canvas_item_move_absolute (item, 2, e_minicard->height); e_minicard->height += text_height; } e_minicard->height += 2; - gnome_canvas_item_set (e_minicard->rect, - "x2", (double) e_minicard->width - 1.0, - "y2", (double) e_minicard->height - 1.0, - NULL); - gnome_canvas_item_set (e_minicard->header_rect, - "x2", (double) e_minicard->width - 3.0, - NULL); + gnome_canvas_item_set ( + e_minicard->rect, + "x2", (gdouble) e_minicard->width - 1.0, + "y2", (gdouble) e_minicard->height - 1.0, + NULL); + gnome_canvas_item_set ( + e_minicard->header_rect, + "x2", (gdouble) e_minicard->width - 3.0, + NULL); if (old_height != e_minicard->height) e_canvas_item_request_parent_reflow (item); @@ -1073,12 +1125,14 @@ e_minicard_compare (EMinicard *minicard1, if (minicard1->contact && minicard2->contact) { gchar *file_as1, *file_as2; - g_object_get (minicard1->contact, - "file_as", &file_as1, - NULL); - g_object_get (minicard2->contact, - "file_as", &file_as2, - NULL); + g_object_get ( + minicard1->contact, + "file_as", &file_as1, + NULL); + g_object_get ( + minicard2->contact, + "file_as", &file_as2, + NULL); if (file_as1 && file_as2) cmp = g_utf8_collate (file_as1, file_as2); @@ -1109,9 +1163,10 @@ e_minicard_selected (EMinicard *minicard, * it. */ if (signal_id != 0) { - g_signal_emit (item->parent, - signal_id, 0, - item, event, &ret_val); + g_signal_emit ( + item->parent, + signal_id, 0, + item, event, &ret_val); } } return ret_val; @@ -1123,9 +1178,10 @@ e_minicard_drag_begin (EMinicard *minicard, { gint ret_val = 0; GnomeCanvasItem *parent; - g_signal_emit (minicard, - signals[DRAG_BEGIN], 0, - event, &ret_val); + g_signal_emit ( + minicard, + signals[DRAG_BEGIN], 0, + event, &ret_val); parent = GNOME_CANVAS_ITEM (minicard)->parent; if (parent && E_IS_REFLOW (parent)) { diff --git a/addressbook/gui/widgets/ea-addressbook-view.c b/addressbook/gui/widgets/ea-addressbook-view.c index 5120f083b7..f1c21d1001 100644 --- a/addressbook/gui/widgets/ea-addressbook-view.c +++ b/addressbook/gui/widgets/ea-addressbook-view.c @@ -58,16 +58,18 @@ ea_ab_view_get_type (void) * Figure out the size of the class and instance * we are run-time deriving from (GailWidget, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - GTK_TYPE_EVENT_BOX); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GTK_TYPE_EVENT_BOX); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaABView", &tinfo, 0); + type = g_type_register_static ( + derived_atk_type, + "EaABView", &tinfo, 0); } return type; diff --git a/addressbook/gui/widgets/ea-addressbook.c b/addressbook/gui/widgets/ea-addressbook.c index b57720be39..ca218f4245 100644 --- a/addressbook/gui/widgets/ea-addressbook.c +++ b/addressbook/gui/widgets/ea-addressbook.c @@ -50,10 +50,11 @@ void e_minicard_view_a11y_init (void) EA_SET_FACTORY (e_minicard_view_get_type (), ea_minicard_view); if (atk_get_root ()) { - g_signal_add_emission_hook (g_signal_lookup ("event", - e_minicard_get_type ()), - 0, ea_addressbook_focus_watcher, - NULL, (GDestroyNotify) NULL); + g_signal_add_emission_hook ( + g_signal_lookup ("event", + e_minicard_get_type ()), + 0, ea_addressbook_focus_watcher, + NULL, (GDestroyNotify) NULL); } } diff --git a/addressbook/gui/widgets/ea-minicard-view.c b/addressbook/gui/widgets/ea-minicard-view.c index 65b20feb1a..67f112e66a 100644 --- a/addressbook/gui/widgets/ea-minicard-view.c +++ b/addressbook/gui/widgets/ea-minicard-view.c @@ -108,20 +108,24 @@ ea_minicard_view_get_type (void) * Figure out the size of the class and instance * we are run-time deriving from (GailWidget, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - GNOME_TYPE_CANVAS_GROUP); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GNOME_TYPE_CANVAS_GROUP); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaMinicardView", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_SELECTION, - &atk_selection_info); - g_type_add_interface_static (type, ATK_TYPE_ACTION, - &atk_action_info); + type = g_type_register_static ( + derived_atk_type, + "EaMinicardView", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_SELECTION, + &atk_selection_info); + g_type_add_interface_static ( + type, ATK_TYPE_ACTION, + &atk_action_info); } @@ -169,9 +173,10 @@ ea_minicard_view_get_name (AtkObject *accessible) if (display_name == NULL) display_name = ""; - string = g_strdup_printf (ngettext ("current address book folder %s has %d card", - "current address book folder %s has %d cards", - reflow->count), display_name, reflow->count); + string = g_strdup_printf ( + ngettext ("current address book folder %s has %d card", + "current address book folder %s has %d cards", + reflow->count), display_name, reflow->count); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, string); g_free (string); @@ -262,7 +267,7 @@ ea_minicard_view_ref_child (AtkObject *accessible, ATK_GOBJECT_ACCESSIBLE (accessible))); if (!reflow) return NULL; - if (!reflow->items ) + if (!reflow->items) return NULL; /* a minicard */ if (index < child_num) { @@ -342,7 +347,7 @@ selection_interface_get_selection_count (AtkSelection *selection) atk_gobj = ATK_GOBJECT_ACCESSIBLE (selection); reflow = E_REFLOW (atk_gobject_accessible_get_object (atk_gobj)); - if (!reflow ) + if (!reflow) return FALSE; return e_selection_model_selected_count (reflow->selection); @@ -426,7 +431,7 @@ static const gchar * atk_action_interface_get_name (AtkAction *iface, gint i) { - if ( i >= G_N_ELEMENTS (action_name) || i < 0) + if (i >= G_N_ELEMENTS (action_name) || i < 0) return NULL; return action_name[i]; diff --git a/addressbook/gui/widgets/ea-minicard.c b/addressbook/gui/widgets/ea-minicard.c index 45d496ffa0..8a93265d7f 100644 --- a/addressbook/gui/widgets/ea-minicard.c +++ b/addressbook/gui/widgets/ea-minicard.c @@ -97,18 +97,21 @@ ea_minicard_get_type (void) * we are run-time deriving from (GailWidget, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - GNOME_TYPE_CANVAS_GROUP); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GNOME_TYPE_CANVAS_GROUP); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static ( derived_atk_type, - "EaMinicard", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_ACTION, - &atk_action_info); + type = g_type_register_static ( + derived_atk_type, + "EaMinicard", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_ACTION, + &atk_action_info); } return type; @@ -145,8 +148,9 @@ ea_minicard_get_name (AtkObject *accessible) g_return_val_if_fail (EA_IS_MINICARD (accessible), NULL); memset (name, '\0', BUFFERSIZE); - card = E_MINICARD (atk_gobject_accessible_get_object - (ATK_GOBJECT_ACCESSIBLE (accessible))); + card = E_MINICARD ( + atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (accessible))); if (!card) return NULL; @@ -290,7 +294,7 @@ static const gchar * atk_action_interface_get_name (AtkAction *iface, gint i) { - if ( i >= G_N_ELEMENTS (action_name) || i < 0) + if (i >= G_N_ELEMENTS (action_name) || i < 0) return NULL; return action_name[i]; diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 66928b9f85..e00e089d38 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -552,12 +552,15 @@ eab_contact_display_init (EABContactDisplay *display) ui_manager = e_web_view_get_ui_manager (web_view); #ifdef WITH_CONTACT_MAPS - g_signal_connect (web_view, "create-plugin-widget", + g_signal_connect ( + web_view, "create-plugin-widget", G_CALLBACK (contact_display_object_requested), display); #endif - g_signal_connect (web_view, "notify::load-status", + g_signal_connect ( + web_view, "notify::load-status", G_CALLBACK (contact_display_load_status_changed), NULL); - g_signal_connect (web_view, "style-set", + g_signal_connect ( + web_view, "style-set", G_CALLBACK (load_contact), NULL); e_web_view_install_request_handler (E_WEB_VIEW (display), E_TYPE_FILE_REQUEST); @@ -654,7 +657,7 @@ eab_contact_display_set_show_maps (EABContactDisplay *display, { g_return_if_fail (EAB_IS_CONTACT_DISPLAY (display)); - if ((display->priv->show_maps ? 1 : 0) == (show_maps ? 1 : 0)) + if (display->priv->show_maps == show_maps) return; display->priv->show_maps = show_maps; diff --git a/addressbook/gui/widgets/eab-contact-formatter.c b/addressbook/gui/widgets/eab-contact-formatter.c index d04cc07f04..7a001cf44c 100644 --- a/addressbook/gui/widgets/eab-contact-formatter.c +++ b/addressbook/gui/widgets/eab-contact-formatter.c @@ -333,9 +333,10 @@ accum_time_attribute (GString *buffer, date = e_contact_get (contact, field); if (date) { - gdate = g_date_new_dmy ( date->day, - date->month, - date->year ); + gdate = g_date_new_dmy ( + date->day, + date->month, + date->year); g_date_strftime (sdate, 100, "%x", gdate); g_date_free (gdate); render_table_row (buffer, html_label, sdate, icon, html_flags); @@ -477,8 +478,8 @@ render_contact_list_row (EABContactFormatter *formatter, buffer, "<td width=" IMAGE_COL_WIDTH " valign=\"top\" align=\"left\">" "<img src=\"evo-file://%s/minus.png\" " - "id=\"%s\" " - "class=\"navigable _evo_collapse_button\">" + "id=\"%s\" " + "class=\"navigable _evo_collapse_button\">" "</td><td width=\"100%%\" align=\"left\">%s", evolution_imagesdir, e_destination_get_contact_uid (destination), @@ -642,13 +643,15 @@ accum_address_map (GString *buffer, g_string_append (buffer, "<tr><td colspan=\"3\">"); if (map_type == E_CONTACT_ADDRESS_WORK) { - g_string_append (buffer, - "<object type=\"application/x-work-map-widget\" " - "width=\"250\" height=\"250\"></object>"); + g_string_append ( + buffer, + "<object type=\"application/x-work-map-widget\" " + "width=\"250\" height=\"250\"></object>"); } else { - g_string_append (buffer, - "<object type=\"application/x-home-map-widget\" " - "width=\"250\" height=\"250\"></object>"); + g_string_append ( + buffer, + "<object type=\"application/x-home-map-widget\" " + "width=\"250\" height=\"250\"></object>"); } g_string_append (buffer, "</td></tr>"); @@ -869,8 +872,8 @@ render_compact (EABContactFormatter *formatter, max_dimension = calced_height; if (max_dimension > MAX_COMPACT_IMAGE_DIMENSION) { - calced_width *= ( (gfloat) MAX_COMPACT_IMAGE_DIMENSION / max_dimension); - calced_height *= ( (gfloat) MAX_COMPACT_IMAGE_DIMENSION / max_dimension); + calced_width *= ((gfloat) MAX_COMPACT_IMAGE_DIMENSION / max_dimension); + calced_height *= ((gfloat) MAX_COMPACT_IMAGE_DIMENSION / max_dimension); } g_object_unref (pixbuf); @@ -892,7 +895,8 @@ render_compact (EABContactFormatter *formatter, photo_data = g_base64_encode ( photo->data.inlined.data, photo->data.inlined.length); - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<img border=\"1\" src=\"data:%s;base64,%s\" " "width=\"%d\" height=\"%d\">", photo->data.inlined.mime_type, @@ -1093,22 +1097,26 @@ eab_contact_formatter_get_property (GObject *object, switch (property_id) { case PROP_DISPLAY_MODE: - g_value_set_int (value, + g_value_set_int ( + value, eab_contact_formatter_get_display_mode ( formatter)); return; case PROP_RENDER_MAPS: - g_value_set_boolean (value, + g_value_set_boolean ( + value, eab_contact_formatter_get_render_maps ( formatter)); return; case PROP_STYLE: - g_value_set_object (value, + g_value_set_object ( + value, eab_contact_formatter_get_style ( formatter)); return; case PROP_STATE: - g_value_set_uint (value, + g_value_set_uint ( + value, eab_contact_formatter_get_state ( formatter)); return; @@ -1203,10 +1211,11 @@ EABContactFormatter * eab_contact_formatter_new (EABContactDisplayMode mode, gboolean render_maps) { - return g_object_new (EAB_TYPE_CONTACT_FORMATTER, - "display-mode", mode, - "render-maps", render_maps, - NULL); + return g_object_new ( + EAB_TYPE_CONTACT_FORMATTER, + "display-mode", mode, + "render-maps", render_maps, + NULL); } void diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index e0eed37cc3..736f64d422 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -141,7 +141,7 @@ eab_load_error_dialog (GtkWidget *parent, label = g_strdup_printf ( _("This address book cannot be opened. Please check that the " - "path %s exists and that permissions are set to access it."), path); + "path %s exists and that permissions are set to access it."), path); g_free (path); label_string = label; @@ -994,7 +994,8 @@ parse_address_template_section (const gchar *format, if (address->street && *(address->street)) { g_string_append (res, address->street); if (address->ext && *(address->ext)) - g_string_append_printf (res, "\n%s", + g_string_append_printf ( + res, "\n%s", address->ext); ret = TRUE; } @@ -1136,11 +1137,13 @@ eab_format_address (EContact *contact, * and skip full names, as it's part of the EContact itself, * check this bug for reason: https://bugzilla.gnome.org/show_bug.cgi?id=667912 */ - parse_address_template_section (format, - NULL, - (address_type == E_CONTACT_ADDRESS_WORK) ? e_contact_get_const (contact, E_CONTACT_ORG): NULL, - addr, - &result); + parse_address_template_section ( + format, + NULL, + (address_type == E_CONTACT_ADDRESS_WORK) ? + e_contact_get_const (contact, E_CONTACT_ORG) : NULL, + addr, + &result); /* Add the country line. In some countries, the address can be located above the * rest of the address */ diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index 3adf2afe4f..c95b2f4357 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -257,7 +257,7 @@ parseLine (GHashTable *dn_contact_hash, return FALSE; } - colon = (gchar *) strchr ( ptr, ':' ); + colon = (gchar *) strchr (ptr, ':'); if (colon) { gint i; @@ -266,7 +266,7 @@ parseLine (GHashTable *dn_contact_hash, while (isspace (*value)) value++; - ldif_value = getValue (&value ); + ldif_value = getValue (&value); field_handled = FALSE; for (i = 0; i < G_N_ELEMENTS (ldif_fields); i++) { @@ -475,11 +475,12 @@ add_to_notes (EContact *contact, if (!field_text || !*field_text) return; - new_text = g_strdup_printf ("%s%s%s: %s", - old_text ? old_text : "", - old_text && *old_text && - *(old_text + strlen (old_text) - 1) != '\n' ? "\n" : "", - e_contact_pretty_name (field), field_text); + new_text = g_strdup_printf ( + "%s%s%s: %s", + old_text ? old_text : "", + old_text && *old_text && + *(old_text + strlen (old_text) - 1) != '\n' ? "\n" : "", + e_contact_pretty_name (field), field_text); e_contact_set (contact, E_CONTACT_NOTE, new_text); g_free (new_text); } diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index 2e452c24ad..d430bd24eb 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -95,11 +95,12 @@ add_to_notes (EContact *contact, if (!field_text || !*field_text) return; - new_text = g_strdup_printf ("%s%s%s: %s", - old_text ? old_text : "", - old_text && *old_text && - *(old_text + strlen (old_text) - 1) != '\n' ? "\n" : "", - e_contact_pretty_name (field), field_text); + new_text = g_strdup_printf ( + "%s%s%s: %s", + old_text ? old_text : "", + old_text && *old_text && + *(old_text + strlen (old_text) - 1) != '\n' ? "\n" : "", + e_contact_pretty_name (field), field_text); e_contact_set (contact, E_CONTACT_NOTE, new_text); g_free (new_text); } @@ -191,15 +192,17 @@ vcard_import_contact (VCardImporter *gci, * the rest should be kept as is */ if (location_only) { /* add VOICE */ - e_vcard_attribute_add_param_with_value (a, - e_vcard_attribute_param_new (EVC_TYPE), - "VOICE"); + e_vcard_attribute_add_param_with_value ( + a, + e_vcard_attribute_param_new (EVC_TYPE), + "VOICE"); } if (no_location) { /* add OTHER */ - e_vcard_attribute_add_param_with_value (a, - e_vcard_attribute_param_new (EVC_TYPE), - "OTHER"); + e_vcard_attribute_add_param_with_value ( + a, + e_vcard_attribute_param_new (EVC_TYPE), + "OTHER"); } } } @@ -235,7 +238,8 @@ vcard_import_contact (VCardImporter *gci, if (no_location) { /* add OTHER */ - e_vcard_attribute_add_param_with_value (a, + e_vcard_attribute_add_param_with_value ( + a, e_vcard_attribute_param_new (EVC_TYPE), "OTHER"); } @@ -977,10 +981,11 @@ evolution_contact_importer_get_preview_widget (const GSList *contacts) } gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, description ? description : "", 1, contact, - -1 ); + -1); g_free (free_description); } @@ -999,7 +1004,8 @@ evolution_contact_importer_get_preview_widget (const GSList *contacts) gtk_tree_view_set_model (tree_view, GTK_TREE_MODEL (store)); g_object_unref (store); - gtk_tree_view_insert_column_with_attributes (tree_view, -1, _("Contact"), + gtk_tree_view_insert_column_with_attributes ( + tree_view, -1, _("Contact"), gtk_cell_renderer_text_new (), "text", 0, NULL); if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL) > 1) diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index c535be4914..290863c817 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -255,7 +255,8 @@ e_contact_get_contact_height (EContact *contact, if (value == NULL || *value == '\0') continue; - text = g_strdup_printf ("%s: %s", + text = g_strdup_printf ( + "%s: %s", e_contact_pretty_name (field), value); cntct_height += e_contact_text_height ( @@ -293,7 +294,8 @@ e_contact_print_contact (EContact *contact, if (ctxt->style->print_using_grey && ctxt->pages == ctxt->page_nr) { cairo_save (cr); cairo_set_source_rgb (cr, .85, .85, .85); - cairo_rectangle (cr, ctxt->x, ctxt->y, ctxt->column_width, + cairo_rectangle ( + cr, ctxt->x, ctxt->y, ctxt->column_width, e_contact_text_height (ctxt->context, ctxt->style->headings_font, file_as)); cairo_fill (cr); @@ -324,7 +326,8 @@ e_contact_print_contact (EContact *contact, if (value == NULL || *value == '\0') continue; - text = g_strdup_printf ("%s: %s", + text = g_strdup_printf ( + "%s: %s", e_contact_pretty_name (field), value); if (ctxt->pages == ctxt->page_nr) @@ -340,8 +343,10 @@ e_contact_print_contact (EContact *contact, (ctxt->column_width + 4)) + 1; ctxt->y = ctxt->y + ((wrapped_lines + 1) * - e_contact_text_height (ctxt->context, - ctxt->style->body_font, text)); + e_contact_text_height ( + ctxt->context, + ctxt->style->body_font, + text)); ctxt->y += .2 * get_font_height (ctxt->style->body_font); @@ -521,70 +526,70 @@ e_contact_build_style (EContactPrintStyle *style) xmlNodePtr stylenode = xmlDocGetRootElement (styledoc); xmlNodePtr node; for (node = stylenode->children; node; node = node->next) { - gchar *data = (gchar *) xmlNodeGetContent ( node ); - if (!strcmp ( (gchar *) node->name, "title" )) { + gchar *data = (gchar *) xmlNodeGetContent (node); + if (!strcmp ((gchar *) node->name, "title")) { get_string (data, &(style->title)); - } else if (!strcmp ( (gchar *) node->name, "type" )) { + } else if (!strcmp ((gchar *) node->name, "type")) { if (g_ascii_strcasecmp (data, "cards") == 0) style->type = E_CONTACT_PRINT_TYPE_CARDS; else if (g_ascii_strcasecmp (data, "memo_style") == 0) style->type = E_CONTACT_PRINT_TYPE_MEMO_STYLE; else if (g_ascii_strcasecmp (data, "phone_list") == 0) style->type = E_CONTACT_PRINT_TYPE_PHONE_LIST; - } else if (!strcmp ( (gchar *) node->name, "sections_start_new_page" )) { + } else if (!strcmp ((gchar *) node->name, "sections_start_new_page")) { style->sections_start_new_page = get_bool (data); - } else if (!strcmp ( (gchar *) node->name, "num_columns" )) { + } else if (!strcmp ((gchar *) node->name, "num_columns")) { style->num_columns = get_integer (data); - } else if (!strcmp ( (gchar *) node->name, "blank_forms" )) { + } else if (!strcmp ((gchar *) node->name, "blank_forms")) { style->blank_forms = get_integer (data); - } else if (!strcmp ( (gchar *) node->name, "letter_headings" )) { + } else if (!strcmp ((gchar *) node->name, "letter_headings")) { style->letter_headings = get_bool (data); - } else if (!strcmp ( (gchar *) node->name, "headings_font" )) { - get_font ( data, &(style->headings_font) ); - } else if (!strcmp ( (gchar *) node->name, "body_font" )) { - get_font ( data, &(style->body_font) ); - } else if (!strcmp ( (gchar *) node->name, "print_using_grey" )) { + } else if (!strcmp ((gchar *) node->name, "headings_font")) { + get_font (data, &(style->headings_font)); + } else if (!strcmp ((gchar *) node->name, "body_font")) { + get_font (data, &(style->body_font)); + } else if (!strcmp ((gchar *) node->name, "print_using_grey")) { style->print_using_grey = get_bool (data); - } else if (!strcmp ( (gchar *) node->name, "paper_width" )) { + } else if (!strcmp ((gchar *) node->name, "paper_width")) { style->paper_width = get_float (data); - } else if (!strcmp ( (gchar *) node->name, "paper_height" )) { + } else if (!strcmp ((gchar *) node->name, "paper_height")) { style->paper_height = get_float (data); - } else if (!strcmp ( (gchar *) node->name, "top_margin" )) { + } else if (!strcmp ((gchar *) node->name, "top_margin")) { style->top_margin = get_float (data); - } else if (!strcmp ( (gchar *) node->name, "left_margin" )) { + } else if (!strcmp ((gchar *) node->name, "left_margin")) { style->left_margin = get_float (data); - } else if (!strcmp ( (gchar *) node->name, "bottom_margin" )) { + } else if (!strcmp ((gchar *) node->name, "bottom_margin")) { style->bottom_margin = get_float (data); - } else if (!strcmp ( (gchar *) node->name, "right_margin" )) { + } else if (!strcmp ((gchar *) node->name, "right_margin")) { style->right_margin = get_float (data); - } else if (!strcmp ( (gchar *) node->name, "page_width" )) { + } else if (!strcmp ((gchar *) node->name, "page_width")) { style->page_width = get_float (data); - } else if (!strcmp ( (gchar *) node->name, "page_height" )) { + } else if (!strcmp ((gchar *) node->name, "page_height")) { style->page_height = get_float (data); - } else if (!strcmp ( (gchar *) node->name, "orientation" )) { + } else if (!strcmp ((gchar *) node->name, "orientation")) { if (data) { style->orientation_portrait = (g_ascii_strcasecmp (data, "landscape") != 0); } else { style->orientation_portrait = TRUE; } - } else if (!strcmp ( (gchar *) node->name, "header_font" )) { - get_font ( data, &(style->header_font) ); - } else if (!strcmp ( (gchar *) node->name, "left_header" )) { + } else if (!strcmp ((gchar *) node->name, "header_font")) { + get_font (data, &(style->header_font)); + } else if (!strcmp ((gchar *) node->name, "left_header")) { get_string (data, &(style->left_header)); - } else if (!strcmp ( (gchar *) node->name, "center_header" )) { + } else if (!strcmp ((gchar *) node->name, "center_header")) { get_string (data, &(style->center_header)); - } else if (!strcmp ( (gchar *) node->name, "right_header" )) { + } else if (!strcmp ((gchar *) node->name, "right_header")) { get_string (data, &(style->right_header)); - } else if (!strcmp ( (gchar *) node->name, "footer_font" )) { - get_font ( data, &(style->footer_font) ); - } else if (!strcmp ( (gchar *) node->name, "left_footer" )) { + } else if (!strcmp ((gchar *) node->name, "footer_font")) { + get_font (data, &(style->footer_font)); + } else if (!strcmp ((gchar *) node->name, "left_footer")) { get_string (data, &(style->left_footer)); - } else if (!strcmp ( (gchar *) node->name, "center_footer" )) { + } else if (!strcmp ((gchar *) node->name, "center_footer")) { get_string (data, &(style->center_footer)); - } else if (!strcmp ( (gchar *) node->name, "right_footer" )) { + } else if (!strcmp ((gchar *) node->name, "right_footer")) { get_string (data, &(style->right_footer)); - } else if (!strcmp ( (gchar *) node->name, "reverse_on_even_pages" )) { + } else if (!strcmp ((gchar *) node->name, "reverse_on_even_pages")) { style->reverse_on_even_pages = get_bool (data); } if (data) @@ -716,7 +721,7 @@ contact_page_draw_footer (GtkPrintOperation *operation, * g_object_get (operation, "n-pages", &n_pages, NULL)*/ text = g_strdup_printf (_("Page %d"), page_nr + 1); - setup = gtk_print_context_get_page_setup ( context); + setup = gtk_print_context_get_page_setup (context); page_height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS); page_width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS); page_margin = gtk_page_setup_get_bottom_margin (setup, GTK_UNIT_POINTS); diff --git a/calendar/alarm-notify/alarm-notify-dialog.c b/calendar/alarm-notify/alarm-notify-dialog.c index cf94366ae9..e59080d14e 100644 --- a/calendar/alarm-notify/alarm-notify-dialog.c +++ b/calendar/alarm-notify/alarm-notify-dialog.c @@ -327,11 +327,13 @@ notified_alarms_dialog_new (void) gtk_window_set_keep_above (GTK_WINDOW (an->dialog), TRUE); - column = gtk_tree_view_column_new_with_attributes (_("Start time"), - renderer, "text", ALARM_DISPLAY_COLUMN, NULL); + column = gtk_tree_view_column_new_with_attributes ( + _("Start time"), + renderer, "text", ALARM_DISPLAY_COLUMN, NULL); - gtk_tree_view_column_set_attributes (column, renderer, - "markup", ALARM_DISPLAY_COLUMN, NULL); + gtk_tree_view_column_set_attributes ( + column, renderer, + "markup", ALARM_DISPLAY_COLUMN, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (an->treeview), column); @@ -458,11 +460,13 @@ add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, start = timet_to_str_with_zone (occur_start, current_zone); end = timet_to_str_with_zone (occur_end, current_zone); str_time = calculate_time (occur_start, occur_end); - to_display = g_markup_printf_escaped ("<big><b>%s</b></big>\n%s %s", + to_display = g_markup_printf_escaped ( + "<big><b>%s</b></big>\n%s %s", summary, start, str_time); g_free (start); g_free (end); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, ALARM_DISPLAY_COLUMN, to_display, -1); g_free (to_display); g_free (str_time); diff --git a/calendar/alarm-notify/alarm-notify.c b/calendar/alarm-notify/alarm-notify.c index dc588b726c..54242f2049 100644 --- a/calendar/alarm-notify/alarm-notify.c +++ b/calendar/alarm-notify/alarm-notify.c @@ -235,10 +235,17 @@ client_opened_cb (GObject *source_object, e_client_utils_open_new_finish (source, result, &client, &error); - if (client == NULL) { - debug (("Failed to open '%s' (%s): %s", e_source_get_display_name (source), - e_source_get_uid (source), error ? error->message : "Unknown error")); - g_clear_error (&error); + /* Sanity check. */ + g_return_if_fail ( + ((client != NULL) && (error == NULL)) || + ((client == NULL) && (error != NULL))); + + if (error != NULL) { + debug ( + ("Failed to open '%s' (%s): %s", + e_source_get_display_name (source), + e_source_get_uid (source), error->message)); + g_error_free (error); return; } diff --git a/calendar/alarm-notify/alarm-queue.c b/calendar/alarm-notify/alarm-queue.c index 788988be72..7fc308f482 100644 --- a/calendar/alarm-notify/alarm-queue.c +++ b/calendar/alarm-notify/alarm-queue.c @@ -663,7 +663,7 @@ load_alarms_for_today (ClientAlarms *ca) from = MAX (from, day_start); /* Add one hour after midnight, just to cover the delay in 30 minutes - midnight checking. */ + * midnight checking. */ day_end = time_day_end_with_zone (now, zone) + (60 * 60); debug (("From %s to %s", e_ctime (&from), e_ctime (&day_end))); load_alarms (ca, from, day_end); @@ -1054,11 +1054,12 @@ static void print_component (ECalClient *cal_client, ECalComponent *comp) { - print_comp (comp, - cal_client, - config_data_get_timezone (), - config_data_get_24_hour_format (), - GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); + print_comp ( + comp, + cal_client, + config_data_get_timezone (), + config_data_get_24_hour_format (), + GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); } typedef struct { @@ -1643,8 +1644,9 @@ display_notification (time_t trigger, end_str = timet_to_str_with_zone (qa->instance->occur_end, current_zone); time_str = calculate_time (qa->instance->occur_start, qa->instance->occur_end); - str = g_strdup_printf ("%s\n%s %s", - summary, start_str, time_str); + str = g_strdup_printf ( + "%s\n%s %s", + summary, start_str, time_str); /* create the private structure */ tray_data = g_new0 (TrayIconData, 1); @@ -1747,8 +1749,9 @@ popup_notification (time_t trigger, end_str = timet_to_str_with_zone (qa->instance->occur_end, current_zone); time_str = calculate_time (qa->instance->occur_start, qa->instance->occur_end); - str = g_strdup_printf ("%s %s", - start_str, time_str); + str = g_strdup_printf ( + "%s %s", + start_str, time_str); if (organiser.cn) { if (location) @@ -2075,7 +2078,7 @@ alarm_queue_init (gpointer data) g_timeout_add_seconds (1800, check_midnight_refresh, NULL); /* monotonic time doesn't change during hibernation, while the wall clock time does, - thus check for wall clock time changes and reschedule alarms when it changes */ + * thus check for wall clock time changes and reschedule alarms when it changes */ g_timeout_add_seconds (60, check_wall_clock_time_changed, NULL); #ifdef HAVE_LIBNOTIFY @@ -2319,8 +2322,9 @@ alarm_queue_remove_async (struct _alarm_client_msg *msg) if (ca->cal_client) { debug (("Disconnecting Client")); - g_signal_handlers_disconnect_matched (ca->cal_client, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, ca); + g_signal_handlers_disconnect_matched ( + ca->cal_client, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, ca); g_object_unref (ca->cal_client); ca->cal_client = NULL; } @@ -2328,8 +2332,9 @@ alarm_queue_remove_async (struct _alarm_client_msg *msg) if (ca->view) { debug (("Disconnecting Query")); - g_signal_handlers_disconnect_matched (ca->view, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, ca); + g_signal_handlers_disconnect_matched ( + ca->view, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, ca); g_object_unref (ca->view); ca->view = NULL; } @@ -2419,7 +2424,7 @@ update_cqa (CompQueuedAlarms *cqa, /* Update the actual component stored in CompQueuedAlarms structure */ g_object_unref (cqa->alarms->comp); cqa->alarms->comp = newcomp; - if (alarms != NULL ) + if (alarms != NULL) e_cal_component_alarms_free (alarms); } diff --git a/calendar/alarm-notify/alarm.c b/calendar/alarm-notify/alarm.c index cf586dfea2..99d3dd669b 100644 --- a/calendar/alarm-notify/alarm.c +++ b/calendar/alarm-notify/alarm.c @@ -152,8 +152,9 @@ setup_timeout (void) now = time (NULL); /* Add the time out */ - debug (("Setting timeout for %d.%2d (from now) %lu %lu", - diff / 60, diff % 60, ar->trigger, now)); + debug ( + ("Setting timeout for %d.%2d (from now) %lu %lu", + diff / 60, diff % 60, ar->trigger, now)); debug ((" %s", ctime (&ar->trigger))); debug ((" %s", ctime (&now))); timeout_id = g_timeout_add_seconds (diff, alarm_ready_cb, NULL); diff --git a/calendar/alarm-notify/config-data.c b/calendar/alarm-notify/config-data.c index b9f9b7a07d..84a2e38265 100644 --- a/calendar/alarm-notify/config-data.c +++ b/calendar/alarm-notify/config-data.c @@ -110,14 +110,18 @@ config_data_get_notify_with_tray (void) static void source_written_cb (GObject *source_object, - GAsyncResult *result, - gpointer user_data) + GAsyncResult *result, + gpointer user_data) { GError *error = NULL; - if (!e_source_write_finish (E_SOURCE (source_object), result, &error)) { - g_warning ("Failed to write source changes: %s", error ? error->message : "Unknown error"); - g_clear_error (&error); + e_source_write_finish (E_SOURCE (source_object), result, &error); + + if (error != NULL) { + g_warning ( + "Failed to write source changes: %s", + error->message); + g_error_free (error); } } diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index b7822da165..1bc62730ab 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -57,7 +57,8 @@ calendar_config_init (void) config = g_settings_new ("org.gnome.evolution.calendar"); /* will be freed together with EShell */ - g_object_set_data_full (G_OBJECT (e_shell_get_default ()), + g_object_set_data_full ( + G_OBJECT (e_shell_get_default ()), "calendar-config-config-cleanup", (gpointer) "1", (GDestroyNotify) do_cleanup); } @@ -68,7 +69,7 @@ calendar_config_remove_notification (CalendarConfigChangedFunc func, { calendar_config_init (); - g_signal_handlers_disconnect_by_func (G_OBJECT (config), G_CALLBACK (func), data); + g_signal_handlers_disconnect_by_func (config, G_CALLBACK (func), data); } /* Returns TRUE if the locale has 'am' and 'pm' strings defined, in which diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index 82f92e055a..c0935ca4e5 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -157,12 +157,14 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, goto out; if (start_datetime.value) { - offset1 = icaltimezone_get_utc_offset (start_zone, - start_datetime.value, - NULL); - offset2 = icaltimezone_get_utc_offset (zone, - start_datetime.value, - NULL); + offset1 = icaltimezone_get_utc_offset ( + start_zone, + start_datetime.value, + NULL); + offset2 = icaltimezone_get_utc_offset ( + zone, + start_datetime.value, + NULL); if (offset1 != offset2) goto out; } @@ -172,12 +174,14 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, goto out; if (end_datetime.value) { - offset1 = icaltimezone_get_utc_offset (end_zone, - end_datetime.value, - NULL); - offset2 = icaltimezone_get_utc_offset (zone, - end_datetime.value, - NULL); + offset1 = icaltimezone_get_utc_offset ( + end_zone, + end_datetime.value, + NULL); + offset2 = icaltimezone_get_utc_offset ( + zone, + end_datetime.value, + NULL); if (offset1 != offset2) goto out; } diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index d6fb07e91a..dda1d8548b 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -532,7 +532,7 @@ alarm_to_malarm_widgets (Dialog *dialog, e_destination_set_email (dest, a->value); } e_destination_store_append_destination (destination_store, dest); - g_object_unref (G_OBJECT (dest)); + g_object_unref (dest); } e_cal_component_free_attendee_list (attendee_list); } @@ -620,11 +620,11 @@ populate_widgets_from_alarm (Dialog *dialog) action = g_new0 (ECalComponentAlarmAction, 1); e_cal_component_alarm_get_action (dialog->alarm, action); - g_return_if_fail ( action != NULL ); + g_return_if_fail (action != NULL); trigger = g_new0 (ECalComponentAlarmTrigger, 1); e_cal_component_alarm_get_trigger (dialog->alarm, trigger); - g_return_if_fail ( trigger != NULL ); + g_return_if_fail (trigger != NULL); if (*action == E_CAL_COMPONENT_ALARM_NONE) return; @@ -842,10 +842,11 @@ get_widgets (Dialog *dialog) cell = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, - "text", 0, - "sensitive", 1, - NULL); + gtk_cell_layout_set_attributes ( + GTK_CELL_LAYOUT (combo), cell, + "text", 0, + "sensitive", 1, + NULL); for (i = 0; i < G_N_ELEMENTS (actions); i++) { GtkTreeIter iter; diff --git a/calendar/gui/dialogs/changed-comp.c b/calendar/gui/dialogs/changed-comp.c index f8a98c9908..fdbc228ae2 100644 --- a/calendar/gui/dialogs/changed-comp.c +++ b/calendar/gui/dialogs/changed-comp.c @@ -69,8 +69,9 @@ changed_component_dialog (GtkWindow *parent, break; default: - g_message ("changed_component_dialog(): " - "Cannot handle object of type %d", vtype); + g_message ( + "changed_component_dialog(): " + "Cannot handle object of type %d", vtype); return FALSE; } if (changed) @@ -93,8 +94,9 @@ changed_component_dialog (GtkWindow *parent, break; default: - g_message ("changed_component_dialog(): " - "Cannot handle object of type %d", vtype); + g_message ( + "changed_component_dialog(): " + "Cannot handle object of type %d", vtype); return FALSE; } if (changed) @@ -103,9 +105,10 @@ changed_component_dialog (GtkWindow *parent, str = g_strdup_printf (_("%s You have made no changes, update the editor?"), str); } - dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_YES_NO, "%s", str); + dialog = gtk_message_dialog_new ( + parent, GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_YES_NO, "%s", str); gtk_window_set_icon_name (GTK_WINDOW (dialog), "x-office-calendar"); diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index 356d4d78b2..3a6d67107b 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -154,14 +154,15 @@ comp_editor_page_class_init (CompEditorPageClass *class) FALSE, G_PARAM_READWRITE)); - comp_editor_page_signals[DATES_CHANGED] = - g_signal_new ("dates_changed", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (CompEditorPageClass, dates_changed), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); + comp_editor_page_signals[DATES_CHANGED] = g_signal_new ( + "dates_changed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (CompEditorPageClass, dates_changed), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); } static void @@ -222,7 +223,7 @@ comp_editor_page_set_updating (CompEditorPage *page, { g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); - if ((page->priv->updating ? 1 : 0) == (updating ? 1 : 0)) + if (page->priv->updating == updating) return; page->priv->updating = updating; @@ -406,9 +407,10 @@ comp_editor_page_notify_dates_changed (CompEditorPage *page, { g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); - g_signal_emit (page, - comp_editor_page_signals[DATES_CHANGED], 0, - dates); + g_signal_emit ( + page, + comp_editor_page_signals[DATES_CHANGED], 0, + dates); } /** diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 78505c2428..4eaf1bce75 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -500,10 +500,11 @@ save_comp (CompEditor *editor) /* Stop listening because we are about to change things */ if (priv->view) { - g_signal_handlers_disconnect_matched (G_OBJECT (priv->view), - G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, - editor); + g_signal_handlers_disconnect_matched ( + priv->view, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, + editor); g_object_unref (priv->view); priv->view = NULL; @@ -949,15 +950,17 @@ save_and_close_editor (CompEditor *editor, ECalComponentVType vtype = e_cal_component_get_vtype (editor->priv->comp); if (vtype == E_CAL_COMPONENT_EVENT) - response = em_utils_prompt_user ((GtkWindow *) widget, - NULL, - "calendar:ask-send-event-pending-download", - NULL); + response = em_utils_prompt_user ( + (GtkWindow *) widget, + NULL, + "calendar:ask-send-event-pending-download", + NULL); else - response = em_utils_prompt_user ((GtkWindow *) widget, - NULL, - "calendar:ask-send-task-pending-download", - NULL); + response = em_utils_prompt_user ( + (GtkWindow *) widget, + NULL, + "calendar:ask-send-task-pending-download", + NULL); #endif if (!response) return; @@ -1602,7 +1605,7 @@ comp_editor_dispose (GObject *object) if (priv->view) { g_signal_handlers_disconnect_matched ( - G_OBJECT (priv->view), G_SIGNAL_MATCH_DATA, + priv->view, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, object); g_object_unref (priv->view); priv->view = NULL; @@ -1614,7 +1617,7 @@ comp_editor_dispose (GObject *object) store = e_attachment_view_get_store ( E_ATTACHMENT_VIEW (priv->attachment_view)); g_signal_handlers_disconnect_matched ( - G_OBJECT (store), G_SIGNAL_MATCH_DATA, + store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, object); g_object_unref (priv->attachment_view); priv->attachment_view = NULL; @@ -1672,28 +1675,40 @@ comp_editor_bind_settings (CompEditor *editor) g_return_if_fail (editor != NULL); action = comp_editor_get_action (editor, "view-categories"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-categories", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-categories", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-role"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-role", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-role", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-rsvp"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-rsvp", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-rsvp", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-status"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-status", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-status", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-time-zone"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-timezone", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-timezone", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-type"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-type", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-type", + action, "active", + G_SETTINGS_BIND_DEFAULT); } static gboolean @@ -2327,8 +2342,9 @@ close_dialog (CompEditor *editor) * 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); + g_signal_handlers_disconnect_matched ( + priv->view, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, editor); gtk_widget_destroy (GTK_WIDGET (editor)); } @@ -2461,7 +2477,7 @@ comp_editor_set_summary (CompEditor *editor, e_notice ( editor->priv->notebook, GTK_MESSAGE_INFO, _("Changes made to this item may be " - "discarded if an update arrives")); + "discarded if an update arrives")); editor->priv->warned = TRUE; } @@ -2514,7 +2530,7 @@ comp_editor_set_use_24_hour_format (CompEditor *editor, { g_return_if_fail (IS_COMP_EDITOR (editor)); - if ((editor->priv->use_24_hour_format ? 1 : 0) == (use_24_hour_format ? 1 : 0)) + if (editor->priv->use_24_hour_format == use_24_hour_format) return; editor->priv->use_24_hour_format = use_24_hour_format; @@ -2627,10 +2643,10 @@ comp_editor_set_changed (CompEditor *editor, g_return_if_fail (IS_COMP_EDITOR (editor)); /* always process below changes, because other parts of - the editor listen for 'changed' notifications to update - its widgets, thus do it even the value actually didn't change + * the editor listen for 'changed' notifications to update + * its widgets, thus do it even the value actually didn't change */ - if ((editor->priv->changed ? 1 : 0) != (changed ? 1 : 0)) { + if (editor->priv->changed != changed) { editor->priv->changed = changed; action = comp_editor_get_action (editor, "save"); @@ -2648,7 +2664,7 @@ comp_editor_set_changed (CompEditor *editor, e_notice ( editor->priv->notebook, GTK_MESSAGE_INFO, _("Changes made to this item may be " - "discarded if an update arrives")); + "discarded if an update arrives")); editor->priv->warned = TRUE; } @@ -2814,8 +2830,9 @@ page_mapped_cb (GtkWidget *page_widget, return; if (page->accel_group) { - gtk_window_add_accel_group (GTK_WINDOW (toplevel), - page->accel_group); + gtk_window_add_accel_group ( + GTK_WINDOW (toplevel), + page->accel_group); } } @@ -3353,8 +3370,9 @@ real_send_comp (CompEditor *editor, } if (!e_cal_component_has_attachments (priv->comp) || - e_client_check_capability (E_CLIENT (priv->cal_client), - CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) { + e_client_check_capability ( + E_CLIENT (priv->cal_client), + CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) { if (itip_send_comp ( registry, method, send_comp, priv->cal_client, NULL, NULL, users, strip_alarms, @@ -3652,7 +3670,7 @@ page_dates_changed_cb (CompEditor *editor, e_notice ( priv->notebook, GTK_MESSAGE_INFO, _("Changes made to this item may be discarded " - "if an update arrives")); + "if an update arrives")); priv->warned = TRUE; } } diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c index d082551344..93e2df0d91 100644 --- a/calendar/gui/dialogs/delete-comp.c +++ b/calendar/gui/dialogs/delete-comp.c @@ -115,8 +115,9 @@ delete_component_dialog (ECalComponent *comp, break; default: - g_message ("delete_component_dialog(): Cannot handle object of type %d", - vtype); + g_message ( + "delete_component_dialog(): Cannot handle object of type %d", + vtype); g_free (arg0); return FALSE; } @@ -144,8 +145,9 @@ delete_component_dialog (ECalComponent *comp, break; default: - g_message ("delete_component_dialog(): Cannot handle objects of type %d", - vtype); + g_message ( + "delete_component_dialog(): Cannot handle objects of type %d", + vtype); return FALSE; } diff --git a/calendar/gui/dialogs/delete-error.c b/calendar/gui/dialogs/delete-error.c index 7dc53253fa..313bcea82f 100644 --- a/calendar/gui/dialogs/delete-error.c +++ b/calendar/gui/dialogs/delete-error.c @@ -109,9 +109,10 @@ delete_error_dialog (const GError *error, return; } - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, str, error->message); + dialog = gtk_message_dialog_new ( + NULL, GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, str, error->message); if (vtype == E_CAL_COMPONENT_EVENT) icon_name = "x-office-calendar"; else if (vtype == E_CAL_COMPONENT_TODO) diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c index a7016a4cdd..9ae253dc00 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.c +++ b/calendar/gui/dialogs/e-delegate-dialog.c @@ -186,8 +186,9 @@ addressbook_clicked_cb (GtkWidget *widget, { EDelegateDialog *edd = data; - e_name_selector_show_dialog (edd->priv->name_selector, - e_delegate_dialog_get_toplevel (edd)); + e_name_selector_show_dialog ( + edd->priv->name_selector, + e_delegate_dialog_get_toplevel (edd)); } static void diff --git a/calendar/gui/dialogs/e-send-options-utils.c b/calendar/gui/dialogs/e-send-options-utils.c index 6f3d4034ab..8157e10fab 100644 --- a/calendar/gui/dialogs/e-send-options-utils.c +++ b/calendar/gui/dialogs/e-send-options-utils.c @@ -194,13 +194,13 @@ e_send_options_utils_fill_component (ESendOptionsDialog *sod, if (gopts->reply_convenient) prop = icalproperty_new_x ("convenient"); else - prop = icalproperty_new_x ((const gchar *) g_strdup_printf ( "%d", gopts->reply_within)); + prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", gopts->reply_within)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-REPLY"); icalcomponent_add_property (icalcomp, prop); } if (gopts->expiration_enabled && gopts->expire_after) { - prop = icalproperty_new_x ((const gchar *) g_strdup_printf ( "%d", gopts->expire_after)); + prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", gopts->expire_after)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-EXPIRE"); icalcomponent_add_property (icalcomp, prop); } @@ -220,7 +220,7 @@ e_send_options_utils_fill_component (ESendOptionsDialog *sod, } if (sopts->tracking_enabled) - prop = icalproperty_new_x ((const gchar *) g_strdup_printf ( "%d", sopts->track_when)); + prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", sopts->track_when)); else prop = icalproperty_new_x ("0"); diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 1460ff47db..0681aa4ed7 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -664,8 +664,8 @@ event_editor_edit_comp (CompEditor *editor, EMeetingAttendee *ia; gboolean addresses_match; - addresses_match = - g_str_equal (user_email, + addresses_match = g_str_equal ( + user_email, itip_strip_mailto (ca->value)); if (delegate && !addresses_match) diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index f590b9f37f..cb4698fcf3 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -204,10 +204,10 @@ static void notify_dates_changed (EventPage *epage, struct icaltimetype *start_t static gboolean check_start_before_end (struct icaltimetype *start_tt, icaltimezone *start_zone, struct icaltimetype *end_tt, icaltimezone *end_zone, gboolean adjust_end_time); static void set_attendees (ECalComponent *comp, const GPtrArray *attendees); -static void hour_sel_changed ( GtkSpinButton *widget, EventPage *epage); -static void minute_sel_changed ( GtkSpinButton *widget, EventPage *epage); -static void hour_minute_changed ( EventPage *epage); -static void update_end_time_combo ( EventPage *epage); +static void hour_sel_changed (GtkSpinButton *widget, EventPage *epage); +static void minute_sel_changed (GtkSpinButton *widget, EventPage *epage); +static void hour_minute_changed (EventPage *epage); +static void update_end_time_combo (EventPage *epage); static void event_page_select_organizer (EventPage *epage, const gchar *backend_address); static void set_subscriber_info_string (EventPage *epage, const gchar *backend_address); @@ -755,11 +755,17 @@ update_time (EventPage *epage, if (!start_zone) { /* FIXME: Handle error better. */ GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, start_date->tzid, &start_zone, NULL, &error)) { - g_warning ("Couldn't get timezone '%s' from server: %s", - start_date->tzid ? start_date->tzid : "", error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + + e_cal_client_get_timezone_sync ( + client, start_date->tzid, + &start_zone, NULL, &error); + + if (error != NULL) { + g_warning ( + "Couldn't get timezone '%s' from server: %s", + start_date->tzid ? start_date->tzid : "", + error->message); + g_error_free (error); } } } @@ -1167,11 +1173,13 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponentText *dtext; dtext = l->data; - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), - dtext->value ? dtext->value : "", -1); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), + dtext->value ? dtext->value : "", -1); } else { - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), - "", 0); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), + "", 0); } e_cal_component_free_text_list (l); e_buffer_tagger_update_tags (GTK_TEXT_VIEW (priv->description)); @@ -1216,7 +1224,7 @@ event_page_fill_widgets (CompEditorPage *page, if (e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_NO_ORGANIZER) && (flags & COMP_EDITOR_DELEGATE)) string = g_strdup (backend_addr); - else if ( organizer.cn != NULL) + else if (organizer.cn != NULL) string = g_strdup_printf ("%s <%s>", organizer.cn, strip); else string = g_strdup (strip); @@ -1477,20 +1485,22 @@ event_page_fill_component (CompEditorPage *page, comp_editor_page_display_validation_error (page, _("Start date is wrong"), priv->start_time); return FALSE; } - start_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &start_tt.year, - &start_tt.month, - &start_tt.day); + start_date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &start_tt.year, + &start_tt.month, + &start_tt.day); g_return_val_if_fail (start_date_set, FALSE); if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->end_time))) { comp_editor_page_display_validation_error (page, _("End date is wrong"), priv->end_time); return FALSE; } - end_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->end_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); + end_date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->end_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); g_return_val_if_fail (end_date_set, FALSE); /* If the all_day toggle is set, we use DATE values for DTSTART and @@ -1510,16 +1520,18 @@ event_page_fill_component (CompEditorPage *page, comp_editor_page_display_validation_error (page, _("Start time is wrong"), priv->start_time); return FALSE; } - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &start_tt.hour, - &start_tt.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &start_tt.hour, + &start_tt.minute); if (!e_date_edit_time_is_valid (E_DATE_EDIT (priv->end_time))) { comp_editor_page_display_validation_error (page, _("End time is wrong"), priv->end_time); return FALSE; } - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->end_time), + &end_tt.hour, + &end_tt.minute); start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone)); start_date.tzid = icaltimezone_get_tzid (start_zone); end_date.tzid = icaltimezone_get_tzid (start_zone); @@ -1710,8 +1722,9 @@ event_page_fill_component (CompEditorPage *page, } if (e_meeting_store_count_actual_attendees (priv->meeting_store) < 1) { - e_notice (priv->main, GTK_MESSAGE_ERROR, - _("At least one attendee is required.")); + e_notice ( + priv->main, GTK_MESSAGE_ERROR, + _("At least one attendee is required.")); return FALSE; } @@ -1941,7 +1954,7 @@ time_sel_changed (GtkComboBox *combo, gtk_widget_show (priv->time_hour); gtk_widget_hide (priv->end_time); - update_end_time_combo ( epage); + update_end_time_combo (epage); } } @@ -1956,27 +1969,31 @@ void update_end_time_combo (EventPage *epage) priv = epage->priv; - e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &start_tt.year, - &start_tt.month, - &start_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &start_tt.hour, - &start_tt.minute); - e_date_edit_get_date (E_DATE_EDIT (priv->end_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &start_tt.year, + &start_tt.month, + &start_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &start_tt.hour, + &start_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->end_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->end_time), + &end_tt.hour, + &end_tt.minute); end_timet = icaltime_as_timet (end_tt); start_timet = icaltime_as_timet (start_tt); end_timet -= start_timet; - hours = end_timet / ( 60 * 60 ); - minutes = (end_timet / 60) - ( hours * 60 ); + hours = end_timet / (60 * 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); @@ -2030,25 +2047,28 @@ hour_minute_changed (EventPage *epage) priv = epage->priv; - e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &end_tt.hour, + &end_tt.minute); for_hours = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->hour_selector)); for_minutes = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->minute_selector)); icaltime_adjust (&end_tt, 0, for_hours, for_minutes, 0); - e_date_edit_set_date_and_time_of_day (E_DATE_EDIT (priv->end_time), - end_tt.year, - end_tt.month, - end_tt.day, - end_tt.hour, - end_tt.minute); + e_date_edit_set_date_and_time_of_day ( + E_DATE_EDIT (priv->end_time), + end_tt.year, + end_tt.month, + end_tt.day, + end_tt.hour, + end_tt.minute); } static void @@ -2205,7 +2225,7 @@ remove_clicked_cb (GtkButton *btn, selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view)); model = GTK_TREE_MODEL (priv->meeting_store); - if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model ))) { + if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model))) { g_warning ("Could not get a selection to delete."); return; } @@ -2354,22 +2374,26 @@ event_page_set_all_day_event (EventPage *epage, e_date_edit_set_show_time (E_DATE_EDIT (priv->start_time), !all_day); e_date_edit_set_show_time (E_DATE_EDIT (priv->end_time), !all_day); - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &start_tt.year, - &start_tt.month, - &start_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &start_tt.hour, - &start_tt.minute); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &start_tt.year, + &start_tt.month, + &start_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &start_tt.hour, + &start_tt.minute); g_return_if_fail (date_set); - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->end_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time), - &end_tt.hour, - &end_tt.minute); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->end_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->end_time), + &end_tt.hour, + &end_tt.minute); g_return_if_fail (date_set); /* TODO implement the for portion in end time selector */ @@ -2434,15 +2458,19 @@ event_page_set_all_day_event (EventPage *epage, g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); - e_date_edit_set_date (E_DATE_EDIT (priv->start_time), start_tt.year, - start_tt.month, start_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time), - start_tt.hour, start_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->start_time), start_tt.year, + start_tt.month, start_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->start_time), + start_tt.hour, start_tt.minute); - e_date_edit_set_date (E_DATE_EDIT (priv->end_time), end_tt.year, - end_tt.month, end_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time), - end_tt.hour, end_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->end_time), end_tt.year, + end_tt.month, end_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->end_time), + end_tt.hour, end_tt.minute); g_signal_handlers_unblock_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); g_signal_handlers_unblock_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); @@ -2651,7 +2679,7 @@ get_widgets (EventPage *epage) && priv->location && priv->start_time && priv->end_time - && priv->description ); + && priv->description); } static void @@ -2734,14 +2762,16 @@ check_start_before_end (struct icaltimetype *start_tt, /* Modify the end time, to be the start + 1 hour. */ *end_tt = *start_tt; icaltime_adjust (end_tt, 0, 1, 0, 0); - icaltimezone_convert_time (end_tt, start_zone, - end_zone); + icaltimezone_convert_time ( + end_tt, start_zone, + end_zone); } else { /* Modify the start time, to be the end - 1 hour. */ *start_tt = *end_tt; icaltime_adjust (start_tt, 0, -1, 0, 0); - icaltimezone_convert_time (start_tt, end_zone, - start_zone); + icaltimezone_convert_time ( + start_tt, end_zone, + start_zone); } return TRUE; } @@ -2777,16 +2807,18 @@ times_updated (EventPage *epage, /* Fetch the start and end times and timezones from the widgets. */ all_day_event = priv->all_day_event; - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &start_tt.year, - &start_tt.month, - &start_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &start_tt.year, + &start_tt.month, + &start_tt.day); g_return_if_fail (date_set); - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->end_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->end_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); g_return_if_fail (date_set); if (all_day_event) { @@ -2808,12 +2840,14 @@ times_updated (EventPage *epage, } else { /* For DATE-TIME events, we have to convert to the same * timezone before comparing. */ - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &start_tt.hour, - &start_tt.minute); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &start_tt.hour, + &start_tt.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->end_time), + &end_tt.hour, + &end_tt.minute); start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone)); @@ -2829,20 +2863,24 @@ times_updated (EventPage *epage, if (set_start_date) { g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); - e_date_edit_set_date (E_DATE_EDIT (priv->start_time), - start_tt.year, start_tt.month, - start_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time), - start_tt.hour, start_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->start_time), + start_tt.year, start_tt.month, + start_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->start_time), + start_tt.hour, start_tt.minute); g_signal_handlers_unblock_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); } if (set_end_date) { g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); - e_date_edit_set_date (E_DATE_EDIT (priv->end_time), - end_tt.year, end_tt.month, end_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time), - end_tt.hour, end_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->end_time), + end_tt.year, end_tt.month, end_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->end_time), + end_tt.hour, end_tt.minute); g_signal_handlers_unblock_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); } @@ -3393,10 +3431,10 @@ init_widgets (EventPage *epage) g_signal_connect ( priv->end_time_combo, "changed", G_CALLBACK (time_sel_changed), epage); - update_end_time_combo ( 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); @@ -3440,7 +3478,8 @@ init_widgets (EventPage *epage) store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->alarm_time_combo))); if (combo_label) { gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, combo_label, -1); g_free (combo_label); @@ -3450,12 +3489,14 @@ init_widgets (EventPage *epage) } gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, _("Customize"), -1); gtk_list_store_insert (store, &iter, 0); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, /* Translators: "None" for "No reminder set" */ 0, C_("cal-reminders", "None"), -1); @@ -3579,19 +3620,22 @@ event_page_construct (EventPage *epage, e_load_ui_builder_definition (priv->builder, "event-page.ui"); if (!get_widgets (epage)) { - g_message ("event_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "event_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } /* Create entry completion and attach it to the entry */ priv->location_completion = gtk_entry_completion_new (); - gtk_entry_set_completion (GTK_ENTRY (priv->location), + gtk_entry_set_completion ( + GTK_ENTRY (priv->location), priv->location_completion); /* Initialize completino model */ list_store = gtk_list_store_new (1, G_TYPE_STRING); - gtk_entry_completion_set_model (priv->location_completion, + gtk_entry_completion_set_model ( + priv->location_completion, GTK_TREE_MODEL (list_store)); gtk_entry_completion_set_text_column (priv->location_completion, 0); @@ -3618,8 +3662,9 @@ event_page_construct (EventPage *epage, G_CALLBACK (organizer_changed_cb), epage); if (!init_widgets (epage)) { - g_message ("event_page_construct(): " - "Could not initialize the widgets!"); + g_message ( + "event_page_construct(): " + "Could not initialize the widgets!"); return NULL; } diff --git a/calendar/gui/dialogs/goto-dialog.c b/calendar/gui/dialogs/goto-dialog.c index 4a77c87554..132438865c 100644 --- a/calendar/gui/dialogs/goto-dialog.c +++ b/calendar/gui/dialogs/goto-dialog.c @@ -164,17 +164,19 @@ create_ecal (GoToDialog *dlg) dlg->ecal = E_CALENDAR (e_calendar_new ()); calitem = dlg->ecal->calitem; - gnome_canvas_item_set (GNOME_CANVAS_ITEM (calitem), - "move_selection_when_moving", FALSE, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (calitem), + "move_selection_when_moving", FALSE, + NULL); e_calendar_item_set_display_popup (calitem, FALSE); gtk_widget_show (GTK_WIDGET (dlg->ecal)); gtk_box_pack_start (GTK_BOX (dlg->vbox), GTK_WIDGET (dlg->ecal), TRUE, TRUE, 0); e_calendar_item_set_first_month (calitem, dlg->year_val, dlg->month_val); - e_calendar_item_set_get_time_callback (calitem, - get_current_time, - dlg, NULL); + e_calendar_item_set_get_time_callback ( + calitem, + get_current_time, + dlg, NULL); ecal_date_range_changed (calitem, dlg); } diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 57332a1e0c..01d3c9143c 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -300,11 +300,13 @@ memo_page_fill_widgets (CompEditorPage *page, ECalComponentText *dtext; dtext = l->data; - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content)), - dtext->value ? dtext->value : "", -1); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content)), + dtext->value ? dtext->value : "", -1); } else { - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content)), - "", 0); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content)), + "", 0); } e_cal_component_free_text_list (l); e_buffer_tagger_update_tags (GTK_TEXT_VIEW (priv->memo_content)); @@ -313,9 +315,10 @@ memo_page_fill_widgets (CompEditorPage *page, e_cal_component_get_dtstart (comp, &d); if (d.value) { struct icaltimetype *start_tt = d.value; - e_date_edit_set_date (E_DATE_EDIT (priv->start_date), - start_tt->year, start_tt->month, - start_tt->day); + e_date_edit_set_date ( + E_DATE_EDIT (priv->start_date), + start_tt->year, start_tt->month, + start_tt->day); } else if (!(flags & COMP_EDITOR_NEW_ITEM)) e_date_edit_set_time (E_DATE_EDIT (priv->start_date), -1); e_cal_component_free_datetime (&d); @@ -342,7 +345,7 @@ memo_page_fill_widgets (CompEditorPage *page, const gchar *strip = itip_strip_mailto (organizer.value); gchar *string; - if ( organizer.cn != NULL) + if (organizer.cn != NULL) string = g_strdup_printf ("%s <%s>", organizer.cn, strip); else string = g_strdup (strip); @@ -536,8 +539,9 @@ fill_comp_with_recipients (ENameSelector *name_selector, icalcomponent *icalcomp; icalproperty *icalprop; - e_name_selector_model_peek_section (name_selector_model, "To", - NULL, &destination_store); + e_name_selector_model_peek_section ( + name_selector_model, "To", + NULL, &destination_store); destinations = e_destination_store_list_destinations (destination_store); for (l = destinations; l; l = g_list_next (l)) { @@ -581,8 +585,9 @@ fill_comp_with_recipients (ENameSelector *name_selector, EContact *n_con = NULL; gchar *query; - query = g_strdup_printf ("(is \"full_name\" \"%s\")", - (gchar *) e_contact_get (contact, E_CONTACT_FULL_NAME)); + query = g_strdup_printf ( + "(is \"full_name\" \"%s\")", + (gchar *) e_contact_get (contact, E_CONTACT_FULL_NAME)); if (!e_book_client_get_contacts_sync (book_client, query, &contacts, NULL, NULL)) { g_warning ("Could not get contact from the book \n"); @@ -966,7 +971,7 @@ mpage_client_opened_cb (GObject *source_object, editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (mpage)); priv = mpage->priv; - if (error) { + if (error != NULL) { GtkWidget *dialog; ECalClient *old_client; @@ -976,11 +981,12 @@ mpage_client_opened_cb (GObject *source_object, E_SOURCE_COMBO_BOX (priv->source_combo_box), e_client_get_source (E_CLIENT (old_client))); - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, - _("Unable to open memos in '%s': %s"), - e_source_get_display_name (source), - error ? error->message : _("Unknown error")); + dialog = gtk_message_dialog_new ( + NULL, GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, + _("Unable to open memos in '%s': %s"), + e_source_get_display_name (source), + error->message); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -1068,8 +1074,9 @@ static void to_button_clicked_cb (GtkButton *button, MemoPage *mpage) { - e_name_selector_show_dialog (mpage->priv->name_selector, - mpage->priv->main); + e_name_selector_show_dialog ( + mpage->priv->name_selector, + mpage->priv->main); } static void @@ -1248,8 +1255,9 @@ memo_page_construct (MemoPage *mpage) e_load_ui_builder_definition (priv->builder, "memo-page.ui"); if (!get_widgets (mpage)) { - g_message ("memo_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "memo_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } @@ -1295,7 +1303,7 @@ memo_page_construct (MemoPage *mpage) if (!init_widgets (mpage)) { g_message ("memo_page_construct(): " - "Could not initialize the widgets!"); + "Could not initialize the widgets!"); return NULL; } diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 64bbb946c5..d04d490b3d 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -267,8 +267,9 @@ preview_recur (RecurrencePage *rpage) fill_component (rpage, comp); - tag_calendar_by_comp (E_CALENDAR (priv->preview_calendar), comp, - client, zone, TRUE, FALSE, FALSE, priv->cancellable); + tag_calendar_by_comp ( + E_CALENDAR (priv->preview_calendar), comp, + client, zone, TRUE, FALSE, FALSE, priv->cancellable); g_object_unref (comp); } @@ -440,18 +441,20 @@ clear_widgets (RecurrencePage *rpage) g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_DAILY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_DAILY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); priv->ending_date_tt = icaltime_today (); priv->ending_count = 2; g_signal_handlers_block_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->ending_combo, - priv->ending_count == -1 ? ENDING_FOREVER : ENDING_FOR, - ending_types_map); + e_dialog_combo_box_set ( + priv->ending_combo, + priv->ending_count == -1 ? ENDING_FOREVER : ENDING_FOR, + ending_types_map); g_signal_handlers_unblock_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); if (priv->ending_count == -1) priv->ending_count = 2; @@ -571,11 +574,13 @@ sensitize_recur_widgets (RecurrencePage *rpage) gtk_widget_set_sensitive (priv->params, FALSE); gtk_widget_hide (priv->params); - label = gtk_label_new (_("This appointment contains " - "recurrences that Evolution " - "cannot edit.")); - gtk_container_add (GTK_CONTAINER (priv->custom_warning_bin), - label); + label = gtk_label_new ( + _("This appointment contains " + "recurrences that Evolution " + "cannot edit.")); + gtk_container_add ( + GTK_CONTAINER (priv->custom_warning_bin), + label); gtk_widget_show_all (priv->custom_warning_bin); } else if (recurs) { gtk_widget_set_sensitive (priv->params, sens); @@ -801,10 +806,12 @@ simple_recur_to_comp (RecurrencePage *rpage, g_return_if_fail (priv->month_num_combo != NULL); g_return_if_fail (GTK_IS_COMBO_BOX (priv->month_num_combo)); - month_num = e_dialog_combo_box_get (priv->month_num_combo, - month_num_options_map ); - month_day = e_dialog_combo_box_get (priv->month_day_combo, - month_day_options_map); + month_num = e_dialog_combo_box_get ( + priv->month_num_combo, + month_num_options_map); + month_day = e_dialog_combo_box_get ( + priv->month_day_combo, + month_day_options_map); if (month_num == MONTH_NUM_LAST) month_num = -1; @@ -891,10 +898,11 @@ simple_recur_to_comp (RecurrencePage *rpage, /* We only allow a DATE value to be set for the UNTIL property, * 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, - &r.until.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->ending_date_edit), + &r.until.year, + &r.until.month, + &r.until.day); g_return_if_fail (date_set); r.until.is_date = 1; @@ -965,9 +973,10 @@ fill_component (RecurrencePage *rpage, g_return_val_if_fail (dt != NULL, FALSE); if (!icaltime_is_valid_time (*dt->value)) { - comp_editor_page_display_validation_error (COMP_EDITOR_PAGE (rpage), - _("Recurrence date is invalid"), - priv->exception_list); + comp_editor_page_display_validation_error ( + COMP_EDITOR_PAGE (rpage), + _("Recurrence date is invalid"), + priv->exception_list); return FALSE; } @@ -1180,10 +1189,11 @@ make_recur_month_num_combo (gint month_index) gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, "text", 0, NULL); - gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo), - cell, - only_leaf_sensitive, - NULL, NULL); + gtk_cell_layout_set_cell_data_func ( + GTK_CELL_LAYOUT (combo), + cell, + only_leaf_sensitive, + NULL, NULL); return combo; } @@ -1229,8 +1239,9 @@ month_num_combo_changed_cb (GtkComboBox *combo, priv = rpage->priv; - month_day = e_dialog_combo_box_get (priv->month_day_combo, - month_day_options_map); + month_day = e_dialog_combo_box_get ( + priv->month_day_combo, + month_day_options_map); if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->month_num_combo), &iter)) { gint value; @@ -1264,13 +1275,15 @@ month_num_combo_changed_cb (GtkComboBox *combo, } if (month_num == MONTH_NUM_DAY && month_day != MONTH_DAY_NTH) - e_dialog_combo_box_set (priv->month_day_combo, - MONTH_DAY_NTH, - month_day_options_map); + e_dialog_combo_box_set ( + priv->month_day_combo, + MONTH_DAY_NTH, + month_day_options_map); else if (month_num != MONTH_NUM_DAY && month_num != MONTH_NUM_LAST && month_day == MONTH_DAY_NTH) - e_dialog_combo_box_set (priv->month_day_combo, - MONTH_DAY_MON, - month_num_options_map); + e_dialog_combo_box_set ( + priv->month_day_combo, + MONTH_DAY_MON, + month_num_options_map); comp_editor_page_changed (COMP_EDITOR_PAGE (rpage)); } @@ -1289,18 +1302,22 @@ month_day_combo_changed_cb (GtkComboBox *combo, priv = rpage->priv; - month_num = e_dialog_combo_box_get (priv->month_num_combo, - month_num_options_map); - month_day = e_dialog_combo_box_get (priv->month_day_combo, - month_day_options_map); + month_num = e_dialog_combo_box_get ( + priv->month_num_combo, + month_num_options_map); + month_day = e_dialog_combo_box_get ( + priv->month_day_combo, + month_day_options_map); if (month_day == MONTH_DAY_NTH && month_num != MONTH_NUM_LAST && month_num != MONTH_NUM_DAY) - e_dialog_combo_box_set (priv->month_num_combo, - MONTH_NUM_DAY, - month_num_options_map); + e_dialog_combo_box_set ( + priv->month_num_combo, + MONTH_NUM_DAY, + month_num_options_map); else if (month_day != MONTH_DAY_NTH && month_num == MONTH_NUM_DAY) - e_dialog_combo_box_set (priv->month_num_combo, - MONTH_NUM_FIRST, - month_num_options_map); + e_dialog_combo_box_set ( + priv->month_num_combo, + MONTH_NUM_FIRST, + month_num_options_map); comp_editor_page_changed (COMP_EDITOR_PAGE (rpage)); } @@ -1333,22 +1350,26 @@ make_monthly_special (RecurrencePage *rpage) adj = GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 31, 1, 10, 10)); priv->month_num_combo = make_recur_month_num_combo (priv->month_index); - gtk_box_pack_start (GTK_BOX (hbox), priv->month_num_combo, - FALSE, FALSE, 6); + gtk_box_pack_start ( + GTK_BOX (hbox), priv->month_num_combo, + FALSE, FALSE, 6); priv->month_day_combo = make_recur_month_combobox (); - gtk_box_pack_start (GTK_BOX (hbox), priv->month_day_combo, - FALSE, FALSE, 6); + gtk_box_pack_start ( + GTK_BOX (hbox), priv->month_day_combo, + FALSE, FALSE, 6); gtk_widget_show_all (hbox); /* Set the options */ - e_dialog_combo_box_set (priv->month_num_combo, - priv->month_num, - month_num_options_map); - e_dialog_combo_box_set (priv->month_day_combo, - priv->month_day, - month_day_options_map); + e_dialog_combo_box_set ( + priv->month_num_combo, + priv->month_num, + month_num_options_map); + e_dialog_combo_box_set ( + priv->month_day_combo, + priv->month_day, + month_day_options_map); g_signal_connect_swapped ( adj, "value-changed", @@ -1452,8 +1473,9 @@ make_ending_until_special (RecurrencePage *rpage) priv->ending_date_edit = comp_editor_new_date_edit (TRUE, FALSE, FALSE); de = E_DATE_EDIT (priv->ending_date_edit); - gtk_container_add (GTK_CONTAINER (priv->ending_special), - GTK_WIDGET (de)); + gtk_container_add ( + GTK_CONTAINER (priv->ending_special), + GTK_WIDGET (de)); gtk_widget_show_all (GTK_WIDGET (de)); /* Set the value */ @@ -1503,8 +1525,9 @@ make_ending_count_special (RecurrencePage *rpage) adj = GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 10000, 1, 10, 0)); priv->ending_count_spin = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric ((GtkSpinButton *) priv->ending_count_spin, TRUE); - gtk_box_pack_start (GTK_BOX (hbox), priv->ending_count_spin, - FALSE, FALSE, 6); + gtk_box_pack_start ( + GTK_BOX (hbox), priv->ending_count_spin, + FALSE, FALSE, 6); label = gtk_label_new (_("occurrences")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6); @@ -1587,9 +1610,10 @@ fill_ending_date (RecurrencePage *rpage, if (r->until.year == 0) { /* Forever */ - e_dialog_combo_box_set (priv->ending_combo, - ENDING_FOREVER, - ending_types_map); + e_dialog_combo_box_set ( + priv->ending_combo, + ENDING_FOREVER, + ending_types_map); } else { /* Ending date */ @@ -1629,17 +1653,19 @@ fill_ending_date (RecurrencePage *rpage, } priv->ending_date_tt = r->until; - e_dialog_combo_box_set (priv->ending_combo, - ENDING_UNTIL, - ending_types_map); + e_dialog_combo_box_set ( + priv->ending_combo, + ENDING_UNTIL, + ending_types_map); } } else { /* Count of occurrences */ priv->ending_count = r->count; - e_dialog_combo_box_set (priv->ending_combo, - ENDING_FOR, - ending_types_map); + e_dialog_combo_box_set ( + priv->ending_combo, + ENDING_FOR, + ending_types_map); } g_signal_handlers_unblock_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); @@ -1777,9 +1803,10 @@ recurrence_page_fill_widgets (CompEditorPage *page, goto custom; g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_DAILY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_DAILY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; @@ -1843,9 +1870,10 @@ recurrence_page_fill_widgets (CompEditorPage *page, priv->weekday_day_mask = day_mask; g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_WEEKLY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_WEEKLY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; } @@ -1942,9 +1970,10 @@ recurrence_page_fill_widgets (CompEditorPage *page, goto custom; g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_MONTHLY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_MONTHLY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; @@ -1958,9 +1987,10 @@ recurrence_page_fill_widgets (CompEditorPage *page, goto custom; g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_YEARLY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_YEARLY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; @@ -2061,10 +2091,12 @@ recurrence_page_set_dates (CompEditorPage *page, priv->weekday_blocked_day_mask = mask; if (priv->weekday_picker != NULL) { - weekday_picker_set_days (WEEKDAY_PICKER (priv->weekday_picker), - priv->weekday_day_mask); - weekday_picker_set_blocked_days (WEEKDAY_PICKER (priv->weekday_picker), - priv->weekday_blocked_day_mask); + weekday_picker_set_days ( + WEEKDAY_PICKER (priv->weekday_picker), + priv->weekday_day_mask); + weekday_picker_set_blocked_days ( + WEEKDAY_PICKER (priv->weekday_picker), + priv->weekday_blocked_day_mask); } } @@ -2200,11 +2232,12 @@ create_exception_dialog (RecurrencePage *rpage, priv = rpage->priv; toplevel = gtk_widget_get_toplevel (priv->main); - dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (toplevel), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, - GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, - NULL); + dialog = gtk_dialog_new_with_buttons ( + title, GTK_WINDOW (toplevel), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, + GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + NULL); *date_edit = comp_editor_new_date_edit (TRUE, FALSE, TRUE); gtk_widget_show (*date_edit); @@ -2234,10 +2267,11 @@ exception_add_cb (GtkWidget *widget, dt.tzid = NULL; icaltime.is_date = 1; - date_set = e_date_edit_get_date (E_DATE_EDIT (date_edit), - &icaltime.year, - &icaltime.month, - &icaltime.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (date_edit), + &icaltime.year, + &icaltime.month, + &icaltime.day); g_return_if_fail (date_set); append_exception (rpage, &dt); @@ -2270,8 +2304,9 @@ exception_modify_cb (GtkWidget *widget, current_dt = e_date_time_list_get_date_time (priv->exception_list_store, &iter); dialog = create_exception_dialog (rpage, _("Modify exception"), &date_edit); - e_date_edit_set_date (E_DATE_EDIT (date_edit), - current_dt->value->year, current_dt->value->month, current_dt->value->day); + e_date_edit_set_date ( + E_DATE_EDIT (date_edit), + current_dt->value->year, current_dt->value->month, current_dt->value->day); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { ECalComponentDateTime dt; @@ -2280,8 +2315,9 @@ exception_modify_cb (GtkWidget *widget, dt.value = &icaltime; tt = dt.value; - e_date_edit_get_date (E_DATE_EDIT (date_edit), - &tt->year, &tt->month, &tt->day); + e_date_edit_get_date ( + E_DATE_EDIT (date_edit), + &tt->year, &tt->month, &tt->day); tt->hour = 0; tt->minute = 0; tt->second = 0; @@ -2382,8 +2418,9 @@ init_widgets (RecurrencePage *rpage) ecal->calitem, "date_range_changed", G_CALLBACK (preview_date_range_changed_cb), rpage); e_calendar_item_set_max_days_sel (ecal->calitem, 0); - gtk_container_add (GTK_CONTAINER (priv->preview_bin), - priv->preview_calendar); + gtk_container_add ( + GTK_CONTAINER (priv->preview_bin), + priv->preview_calendar); gtk_widget_show (priv->preview_calendar); e_calendar_item_set_get_time_callback ( @@ -2442,8 +2479,9 @@ init_widgets (RecurrencePage *rpage) /* Model */ priv->exception_list_store = e_date_time_list_new (); - gtk_tree_view_set_model (GTK_TREE_VIEW (priv->exception_list), - GTK_TREE_MODEL (priv->exception_list_store)); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (priv->exception_list), + GTK_TREE_MODEL (priv->exception_list_store)); g_object_bind_property ( editor, "use-24-hour-format", @@ -2489,8 +2527,9 @@ recurrence_page_construct (RecurrencePage *rpage, e_load_ui_builder_definition (priv->builder, "recurrence-page.ui"); if (!get_widgets (rpage)) { - g_message ("recurrence_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "recurrence_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 3fcf1749cc..eafdb91744 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -104,13 +104,17 @@ update_time (SchedulePage *spage, if (!start_zone) { GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, start_date->tzid, &start_zone, NULL, &error)) { + e_cal_client_get_timezone_sync ( + client, start_date->tzid, + &start_zone, NULL, &error); + + if (error != NULL) { /* FIXME: Handle error better. */ - g_warning ("Couldn't get timezone '%s' from server: %s", - start_date->tzid ? start_date->tzid : "", - error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + g_warning ( + "Couldn't get timezone '%s' from server: %s", + start_date->tzid ? start_date->tzid : "", + error->message); + g_error_free (error); } } } @@ -119,13 +123,18 @@ update_time (SchedulePage *spage, end_zone = icaltimezone_get_builtin_timezone_from_tzid (end_date->tzid); if (!end_zone) { GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, end_date->tzid, &end_zone, NULL, &error)) { + + e_cal_client_get_timezone_sync ( + client, end_date->tzid, + &end_zone, NULL, &error); + + if (error != NULL) { /* FIXME: Handle error better. */ - g_warning ("Couldn't get timezone '%s' from server: %s", - end_date->tzid ? end_date->tzid : "", - error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + g_warning ( + "Couldn't get timezone '%s' from server: %s", + end_date->tzid ? end_date->tzid : "", + error->message); + g_error_free (error); } } } @@ -155,15 +164,19 @@ update_time (SchedulePage *spage, } } - e_date_edit_set_date (E_DATE_EDIT (priv->sel->start_date_edit), start_tt.year, - start_tt.month, start_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->sel->start_date_edit), - start_tt.hour, start_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->sel->start_date_edit), start_tt.year, + start_tt.month, start_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->sel->start_date_edit), + start_tt.hour, start_tt.minute); - e_date_edit_set_date (E_DATE_EDIT (priv->sel->end_date_edit), end_tt.year, - end_tt.month, end_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->sel->end_date_edit), - end_tt.hour, end_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->sel->end_date_edit), end_tt.year, + end_tt.month, end_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->sel->end_date_edit), + end_tt.hour, end_tt.minute); } @@ -387,8 +400,9 @@ schedule_page_construct (SchedulePage *spage, e_load_ui_builder_definition (priv->builder, "schedule-page.ui"); if (!get_widgets (spage)) { - g_message ("schedule_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "schedule_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } @@ -409,8 +423,9 @@ schedule_page_construct (SchedulePage *spage, gtk_box_pack_start (GTK_BOX (priv->main), GTK_WIDGET (priv->sel), TRUE, TRUE, 6); if (!init_widgets (spage)) { - g_message ("schedule_page_construct(): " - "Could not initialize the widgets!"); + g_message ( + "schedule_page_construct(): " + "Could not initialize the widgets!"); return NULL; } @@ -489,20 +504,24 @@ times_changed_cb (GtkWidget *widget, editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (spage)); - e_date_edit_get_date (E_DATE_EDIT (priv->sel->start_date_edit), - &start_tt.year, - &start_tt.month, - &start_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->sel->start_date_edit), - &start_tt.hour, - &start_tt.minute); - e_date_edit_get_date (E_DATE_EDIT (priv->sel->end_date_edit), - &end_tt.year, - &end_tt.month, - &end_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->sel->end_date_edit), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->sel->start_date_edit), + &start_tt.year, + &start_tt.month, + &start_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->sel->start_date_edit), + &start_tt.hour, + &start_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->sel->end_date_edit), + &end_tt.year, + &end_tt.month, + &end_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->sel->end_date_edit), + &end_tt.hour, + &end_tt.minute); start_dt.value = &start_tt; end_dt.value = &end_tt; diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c index 5f11665bea..fa7640eae7 100644 --- a/calendar/gui/dialogs/send-comp.c +++ b/calendar/gui/dialogs/send-comp.c @@ -170,8 +170,9 @@ send_component_dialog (GtkWindow *parent, case E_CAL_COMPONENT_JOURNAL: return TRUE; default: - g_message ("send_component_dialog(): " - "Cannot handle object of type %d", vtype); + g_message ( + "send_component_dialog(): " + "Cannot handle object of type %d", vtype); return FALSE; } @@ -232,8 +233,9 @@ send_component_prompt_subject (GtkWindow *parent, break; default: - g_message ("send_component_prompt_subject(): " - "Cannot handle object of type %d", vtype); + g_message ( + "send_component_prompt_subject(): " + "Cannot handle object of type %d", vtype); return FALSE; } diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index c31fef6e23..2ada645842 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -279,12 +279,14 @@ task_details_page_fill_widgets (CompEditorPage *page, icaltimezone_convert_time (completed, utc_zone, zone); - e_date_edit_set_date (E_DATE_EDIT (priv->completed_date), - completed->year, completed->month, - completed->day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->completed_date), - completed->hour, - completed->minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->completed_date), + completed->year, completed->month, + completed->day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->completed_date), + completed->hour, + completed->minute); e_cal_component_free_icaltimetype (completed); } @@ -357,20 +359,23 @@ task_details_page_fill_component (CompEditorPage *page, return FALSE; } - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->completed_date), - &icalcomplete.year, - &icalcomplete.month, - &icalcomplete.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->completed_date), + &icalcomplete.year, + &icalcomplete.month, + &icalcomplete.day); if (date_set) { - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->completed_date), - &icalcomplete.hour, - &icalcomplete.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->completed_date), + &icalcomplete.hour, + &icalcomplete.minute); /* COMPLETED today or before */ icaltoday = icaltime_current_time_with_zone (zone); - icaltimezone_convert_time (&icaltoday, zone, - icaltimezone_get_utc_timezone ()); + icaltimezone_convert_time ( + &icaltoday, zone, + icaltimezone_get_utc_timezone ()); if (icaltime_compare_date_only (icalcomplete, icaltoday) > 0) { comp_editor_page_display_validation_error ( @@ -385,7 +390,8 @@ task_details_page_fill_component (CompEditorPage *page, * 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_convert_time ( + &icalcomplete, zone, icaltimezone_get_utc_timezone ()); e_cal_component_set_completed (comp, &icalcomplete); } else { @@ -539,30 +545,34 @@ date_changed_cb (EDateEdit *dedit, comp_editor_page_set_updating (COMP_EDITOR_PAGE (tdpage), TRUE); - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->completed_date), - &completed_tt.year, - &completed_tt.month, - &completed_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->completed_date), - &completed_tt.hour, - &completed_tt.minute); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->completed_date), + &completed_tt.year, + &completed_tt.month, + &completed_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->completed_date), + &completed_tt.hour, + &completed_tt.minute); status = e_dialog_combo_box_get (priv->status_combo, status_map); if (!date_set) { completed_tt = icaltime_null_time (); if (status == ICAL_STATUS_COMPLETED) { - e_dialog_combo_box_set (priv->status_combo, - ICAL_STATUS_NONE, - status_map); + e_dialog_combo_box_set ( + priv->status_combo, + ICAL_STATUS_NONE, + status_map); gtk_spin_button_set_value ( GTK_SPIN_BUTTON (priv->percent_complete), 0); } } else { if (status != ICAL_STATUS_COMPLETED) { - e_dialog_combo_box_set (priv->status_combo, - ICAL_STATUS_COMPLETED, - status_map); + e_dialog_combo_box_set ( + priv->status_combo, + ICAL_STATUS_COMPLETED, + status_map); } gtk_spin_button_set_value ( GTK_SPIN_BUTTON (priv->percent_complete), 100); @@ -746,8 +756,9 @@ task_details_page_construct (TaskDetailsPage *tdpage) e_load_ui_builder_definition (priv->builder, "task-details-page.ui"); if (!get_widgets (tdpage)) { - g_message ("task_details_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "task_details_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 9f1542ced3..49f86212c0 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -256,7 +256,8 @@ check_starts_in_the_past (TaskPage *tpage) due_in_past = date_in_past (tpage, E_DATE_EDIT (priv->due_date)); if (start_in_past || due_in_past) { - gchar *tmp = g_strconcat ("<b>", start_in_past ? _("Task's start date is in the past") : "", + gchar *tmp = g_strconcat ( + "<b>", start_in_past ? _("Task's start date is in the past") : "", start_in_past && due_in_past ? "\n" : "", due_in_past ? _("Task's due date is in the past") : "", "</b>", NULL); task_page_set_info_string (tpage, GTK_STOCK_DIALOG_WARNING, tmp); g_free (tmp); @@ -544,11 +545,13 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponentText *dtext; dtext = l->data; - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), - dtext->value ? dtext->value : "", -1); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), + dtext->value ? dtext->value : "", -1); } else { - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), - "", 0); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), + "", 0); } e_cal_component_free_text_list (l); e_buffer_tagger_update_tags (GTK_TEXT_VIEW (priv->description)); @@ -560,9 +563,10 @@ task_page_fill_widgets (CompEditorPage *page, zone = NULL; if (d.value) { struct icaltimetype *due_tt = d.value; - e_date_edit_set_date (E_DATE_EDIT (priv->due_date), - due_tt->year, due_tt->month, - due_tt->day); + e_date_edit_set_date ( + E_DATE_EDIT (priv->due_date), + due_tt->year, due_tt->month, + due_tt->day); e_date_edit_set_time_of_day (E_DATE_EDIT (priv->due_date), -1, -1); } else { e_date_edit_set_time (E_DATE_EDIT (priv->due_date), -1); @@ -578,16 +582,22 @@ task_page_fill_widgets (CompEditorPage *page, * first. */ if (!zone && d.tzid) { GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, d.tzid, &zone, NULL, &error)) + + e_cal_client_get_timezone_sync ( + client, d.tzid, &zone, NULL, &error); + + if (error != NULL) { /* FIXME: Handle error better. */ - g_warning ("Couldn't get timezone '%s' from server: %s", - d.tzid ? d.tzid : "", error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + g_warning ( + "Couldn't get timezone '%s' from server: %s", + d.tzid ? d.tzid : "", error->message); + g_error_free (error); + } } - e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->timezone), - zone ? zone : default_zone); + e_timezone_entry_set_timezone ( + E_TIMEZONE_ENTRY (priv->timezone), + zone ? zone : default_zone); action = comp_editor_get_action (editor, "view-time-zone"); active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); @@ -608,9 +618,10 @@ task_page_fill_widgets (CompEditorPage *page, zone = NULL; if (d.value) { struct icaltimetype *start_tt = d.value; - e_date_edit_set_date (E_DATE_EDIT (priv->start_date), - start_tt->year, start_tt->month, - start_tt->day); + e_date_edit_set_date ( + E_DATE_EDIT (priv->start_date), + start_tt->year, start_tt->month, + start_tt->day); e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_date), -1, -1); } else { e_date_edit_set_time (E_DATE_EDIT (priv->start_date), -1); @@ -676,7 +687,7 @@ task_page_fill_widgets (CompEditorPage *page, if (e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_NO_ORGANIZER) && (flags & COMP_EDITOR_DELEGATE)) string = g_strdup (priv->user_add); - else if ( organizer.cn != NULL) + else if (organizer.cn != NULL) string = g_strdup_printf ("%s <%s>", organizer.cn, strip); else string = g_strdup (strip); @@ -835,10 +846,11 @@ task_page_fill_component (CompEditorPage *page, return FALSE; } - due_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->due_date), - &due_tt.year, - &due_tt.month, - &due_tt.day); + due_date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->due_date), + &due_tt.year, + &due_tt.month, + &due_tt.day); if (due_date_set) { due_tt.is_date = TRUE; date.tzid = NULL; @@ -855,10 +867,11 @@ task_page_fill_component (CompEditorPage *page, start_tt = icaltime_null_time (); date.value = &start_tt; - start_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_date), - &start_tt.year, - &start_tt.month, - &start_tt.day); + start_date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_date), + &start_tt.year, + &start_tt.month, + &start_tt.day); if (start_date_set) { start_tt.is_date = TRUE; date.tzid = NULL; @@ -935,12 +948,13 @@ task_page_fill_component (CompEditorPage *page, } if (e_meeting_store_count_actual_attendees (priv->meeting_store) < 1) { - e_notice (priv->main, GTK_MESSAGE_ERROR, - _("At least one attendee is required.")); + e_notice ( + priv->main, GTK_MESSAGE_ERROR, + _("At least one attendee is required.")); return FALSE; } - if (flags & COMP_EDITOR_DELEGATE ) { + if (flags & COMP_EDITOR_DELEGATE) { GSList *attendee_list, *l; gint i; const GPtrArray *attendees = e_meeting_store_get_attendees (priv->meeting_store); @@ -1595,10 +1609,11 @@ date_changed_cb (EDateEdit *dedit, if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage))) return; - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_date), - &start_tt.year, - &start_tt.month, - &start_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_date), + &start_tt.year, + &start_tt.month, + &start_tt.day); if (date_set) { start_tt.is_date = TRUE; start_dt.tzid = NULL; @@ -1607,10 +1622,11 @@ date_changed_cb (EDateEdit *dedit, start_dt.tzid = NULL; } - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->due_date), - &due_tt.year, - &due_tt.month, - &due_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->due_date), + &due_tt.year, + &due_tt.month, + &due_tt.day); if (date_set) { due_tt.is_date = TRUE; due_dt.tzid = NULL; @@ -1677,14 +1693,16 @@ check_start_before_end (struct icaltimetype *start_tt, /* Modify the end time, to be the start + 1 hour/day. */ *end_tt = *start_tt; icaltime_adjust (end_tt, 0, adjust_by_hour ? 1 : 24, 0, 0); - icaltimezone_convert_time (end_tt, start_zone, - end_zone); + icaltimezone_convert_time ( + end_tt, start_zone, + end_zone); } else { /* Modify the start time, to be the end - 1 hour/day. */ *start_tt = *end_tt; icaltime_adjust (start_tt, 0, adjust_by_hour ? -1 : -24, 0, 0); - icaltimezone_convert_time (start_tt, end_zone, - start_zone); + icaltimezone_convert_time ( + start_tt, end_zone, + start_zone); } return TRUE; } @@ -1720,17 +1738,19 @@ times_updated (TaskPage *tpage, if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage))) return; - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_date), - &start_tt.year, - &start_tt.month, - &start_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_date), + &start_tt.year, + &start_tt.month, + &start_tt.day); if (!date_set) return; - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->due_date), - &end_tt.year, - &end_tt.month, - &end_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->due_date), + &end_tt.year, + &end_tt.month, + &end_tt.day); if (!date_set) return; @@ -2156,8 +2176,9 @@ task_page_construct (TaskPage *tpage, e_load_ui_builder_definition (priv->builder, "task-page.ui"); if (!get_widgets (tpage)) { - g_message ("task_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "task_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } @@ -2184,8 +2205,9 @@ task_page_construct (TaskPage *tpage, G_CALLBACK (organizer_changed_cb), tpage); if (!init_widgets (tpage)) { - g_message ("task_page_construct(): " - "Could not initialize the widgets!"); + g_message ( + "task_page_construct(): " + "Could not initialize the widgets!"); return NULL; } diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c index bbfb66326d..95d2329ad4 100644 --- a/calendar/gui/e-alarm-list.c +++ b/calendar/gui/e-alarm-list.c @@ -437,13 +437,15 @@ get_alarm_string (ECalComponentAlarm *alarm) if (trigger.u.rel_duration.is_neg) /*Translator: The first %s refers to the base, which would be actions like * "Play a Sound". Second %s refers to the duration string e.g:"15 minutes"*/ - str = g_strdup_printf (_("%s %s before the start of the appointment"), - base, dur); + str = g_strdup_printf ( + _("%s %s before the start of the appointment"), + base, dur); else /*Translator: The first %s refers to the base, which would be actions like * "Play a Sound". Second %s refers to the duration string e.g:"15 minutes"*/ - str = g_strdup_printf (_("%s %s after the start of the appointment"), - base, dur); + str = g_strdup_printf ( + _("%s %s after the start of the appointment"), + base, dur); g_free (dur); } else @@ -460,13 +462,15 @@ get_alarm_string (ECalComponentAlarm *alarm) if (trigger.u.rel_duration.is_neg) /* Translator: The first %s refers to the base, which would be actions like * "Play a Sound". Second %s refers to the duration string e.g:"15 minutes" */ - str = g_strdup_printf (_("%s %s before the end of the appointment"), - base, dur); + str = g_strdup_printf ( + _("%s %s before the end of the appointment"), + base, dur); else /* Translator: The first %s refers to the base, which would be actions like * "Play a Sound". Second %s refers to the duration string e.g:"15 minutes" */ - str = g_strdup_printf (_("%s %s after the end of the appointment"), - base, dur); + str = g_strdup_printf ( + _("%s %s after the end of the appointment"), + base, dur); g_free (dur); } else diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index 99263ff158..fe9870e1d8 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -272,7 +272,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, /* write location */ e_cal_component_get_location (comp, &location); if (location) - g_string_append_printf (buffer, "<tr><th>%s</th><td>%s</td></tr>", + g_string_append_printf ( + buffer, "<tr><th>%s</th><td>%s</td></tr>", _("Summary:"), text.value); /* write start date */ @@ -280,7 +281,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, if (dt.value != NULL) { str = timet_to_str_with_zone ( &dt, client, default_zone, use_24_hour_format); - g_string_append_printf (buffer, "<tr><th>%s</th><td>%s</td></tr>", + g_string_append_printf ( + buffer, "<tr><th>%s</th><td>%s</td></tr>", _("Start Date:"), str); g_free (str); } @@ -291,7 +293,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, if (dt.value != NULL) { str = timet_to_str_with_zone ( &dt, client, default_zone, use_24_hour_format); - g_string_append_printf (buffer,"<tr><th>%s</th><td>%s</td></tr>", + g_string_append_printf ( + buffer,"<tr><th>%s</th><td>%s</td></tr>", _("End Date:"), str); g_free (str); } @@ -302,7 +305,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, if (dt.value != NULL) { str = timet_to_str_with_zone ( &dt, client, default_zone, use_24_hour_format); - g_string_append_printf (buffer, "<tr><th>%s</th><td>%s</td></tr>", + g_string_append_printf ( + buffer, "<tr><th>%s</th><td>%s</td></tr>", _("Due Date:"), str); g_free (str); } @@ -313,7 +317,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, icalprop = icalcomponent_get_first_property ( icalcomp, ICAL_STATUS_PROPERTY); if (icalprop != NULL) { - g_string_append_printf (buffer, "<tr><th>%s</th>", + g_string_append_printf ( + buffer, "<tr><th>%s</th>", _("Status:")); e_cal_component_get_status (comp, &status); switch (status) { @@ -339,7 +344,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, /* write priority */ e_cal_component_get_priority (comp, &priority_value); if (priority_value && *priority_value != 0) { - g_string_append_printf (buffer, "<tr><th>%s</th>", + g_string_append_printf ( + buffer, "<tr><th>%s</th>", _("Priority:")); if (*priority_value <= 4) str = g_strdup (_("High")); @@ -363,7 +369,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, if (list) { GSList *node; - g_string_append_printf (buffer, "<tr><th>%s</th>", + g_string_append_printf ( + buffer, "<tr><th>%s</th>", _("Description:")); g_string_append (buffer, "<td class=\"description\">"); @@ -393,7 +400,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, /* URL */ e_cal_component_get_url (comp, (const gchar **) &str); if (str) { - g_string_append_printf (buffer, "<tr><th>%s</th><td><a href=\"%s\">%s</a></td></tr>", + g_string_append_printf ( + buffer, "<tr><th>%s</th><td><a href=\"%s\">%s</a></td></tr>", _("Web Page:"), str, str); } @@ -444,7 +452,8 @@ e_cal_component_preview_init (ECalComponentPreview *preview) { preview->priv = E_CAL_COMPONENT_PREVIEW_GET_PRIVATE (preview); - g_signal_connect (preview, "style-set", + g_signal_connect ( + preview, "style-set", G_CALLBACK (load_comp), NULL); } diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c index 62e02b96ae..6427002904 100644 --- a/calendar/gui/e-cal-list-view.c +++ b/calendar/gui/e-cal-list-view.c @@ -178,9 +178,10 @@ setup_e_table (ECalListView *cal_list_view) /* Normal string fields */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - NULL); + g_object_set ( + cell, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + NULL); e_table_extras_add_cell (extras, "calstring", cell); g_object_unref (cell); @@ -188,9 +189,10 @@ setup_e_table (ECalListView *cal_list_view) /* Date fields */ cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - NULL); + g_object_set ( + cell, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + NULL); g_object_bind_property ( model, "timezone", @@ -220,17 +222,19 @@ setup_e_table (ECalListView *cal_list_view) gtk_widget_hide (E_CELL_DATE_EDIT (popup_cell)->none_button); - e_cell_date_edit_set_get_time_callback (E_CELL_DATE_EDIT (popup_cell), - get_current_time_cb, - cal_list_view, NULL); + e_cell_date_edit_set_get_time_callback ( + E_CELL_DATE_EDIT (popup_cell), + get_current_time_cb, + cal_list_view, NULL); /* Combo fields */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - "editable", FALSE, - NULL); + g_object_set ( + cell, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -240,8 +244,9 @@ setup_e_table (ECalListView *cal_list_view) strings = g_list_append (strings, (gchar *) _("Public")); strings = g_list_append (strings, (gchar *) _("Private")); strings = g_list_append (strings, (gchar *) _("Confidential")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "classification", popup_cell); @@ -249,8 +254,9 @@ setup_e_table (ECalListView *cal_list_view) /* Sorting */ - e_table_extras_add_compare (extras, "date-compare", - e_cell_date_edit_compare_cb); + e_table_extras_add_compare ( + extras, "date-compare", + e_cell_date_edit_compare_cb); /* set proper format component for a default 'date' cell renderer */ cell = e_table_extras_get_cell (extras, "date"); @@ -474,8 +480,9 @@ e_cal_list_view_get_selected_events (ECalendarView *cal_view) event = E_CAL_LIST_VIEW (cal_view)->cursor_event = g_new0 (ECalendarViewEvent, 1); event->comp_data = - e_cal_model_get_component_at (e_calendar_view_get_model (cal_view), - cursor_row); + e_cal_model_get_component_at ( + e_calendar_view_get_model (cal_view), + cursor_row); event_list = g_list_prepend (event_list, event); } diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index dc72e1c67b..5759d3acb1 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -111,8 +111,9 @@ get_dtend (ECalModelCalendar *model, if (model_zone) icaltimezone_convert_time (&tt_end, zone, model_zone); } else - tt_end = icaltime_from_timet_with_zone (comp_data->instance_end, tt_end.is_date, - model_zone); + tt_end = icaltime_from_timet_with_zone ( + comp_data->instance_end, + tt_end.is_date, model_zone); } if (!icaltime_is_valid_time (tt_end) || icaltime_is_null_time (tt_end)) @@ -318,7 +319,10 @@ ecmc_set_value_at (ETableModel *etm, break; } - if (e_cal_client_modify_object_sync (comp_data->client, comp_data->icalcomp, mod, NULL, &error)) { + e_cal_client_modify_object_sync ( + comp_data->client, comp_data->icalcomp, mod, NULL, &error); + + if (error == NULL) { gboolean strip_alarms = TRUE; if (itip_organizer_is_user (registry, comp, comp_data->client) && @@ -350,11 +354,12 @@ ecmc_set_value_at (ETableModel *etm, g_object_unref (send_comp); } } else { - g_warning (G_STRLOC ": Could not modify the object! %s", error ? error->message : "Unknown error"); + g_warning ( + G_STRLOC ": Could not modify the object! %s", + error->message); /* FIXME Show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } g_object_unref (comp); @@ -513,12 +518,15 @@ ecmc_fill_component_from_model (ECalModel *model, g_return_if_fail (comp_data != NULL); g_return_if_fail (E_IS_TABLE_MODEL (source_model)); - set_dtend (model, comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_DTEND, row)); - set_location (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_LOCATION, row)); - set_transparency (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, row)); + set_dtend ( + model, comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_DTEND, row)); + set_location ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_LOCATION, row)); + set_transparency ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, row)); } /** diff --git a/calendar/gui/e-cal-model-memos.c b/calendar/gui/e-cal-model-memos.c index 09a58941e7..a6d3f1d612 100644 --- a/calendar/gui/e-cal-model-memos.c +++ b/calendar/gui/e-cal-model-memos.c @@ -131,12 +131,17 @@ ecmm_set_value_at (ETableModel *etm, } /* TODO ask about mod type */ - if (!e_cal_client_modify_object_sync (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL, &error)) { - g_warning (G_STRLOC ": Could not modify the object! %s", error ? error->message : "Unknown error"); + e_cal_client_modify_object_sync ( + comp_data->client, comp_data->icalcomp, + CALOBJ_MOD_ALL, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not modify the object! %s", + error->message); /* TODO Show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } } diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index 54f95004cc..81c3cb3a45 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -278,9 +278,10 @@ ensure_task_complete (ECalModelComponent *comp_data, /* COMPLETED is stored in UTC. */ utc_zone = icaltimezone_get_utc_timezone (); - new_completed = icaltime_from_timet_with_zone (completed_date, - FALSE, - utc_zone); + new_completed = icaltime_from_timet_with_zone ( + completed_date, + FALSE, + utc_zone); if (prop) icalproperty_set_completed (prop, new_completed); else { @@ -430,11 +431,12 @@ get_geo (ECalModelComponent *comp_data) prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_GEO_PROPERTY); if (prop) { geo = icalproperty_get_geo (prop); - g_snprintf (buf, sizeof (buf), "%g %s, %g %s", - fabs (geo.lat), - geo.lat >= 0.0 ? "N" : "S", - fabs (geo.lon), - geo.lon >= 0.0 ? "E" : "W"); + g_snprintf ( + buf, sizeof (buf), "%g %s, %g %s", + fabs (geo.lat), + geo.lat >= 0.0 ? "N" : "S", + fabs (geo.lon), + geo.lon >= 0.0 ? "E" : "W"); return buf; } @@ -716,9 +718,10 @@ show_geo_warning (void) { GtkWidget *dialog; - dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - "%s", _("The geographical position must be entered " - "in the format: \n\n45.436845,125.862501")); + dialog = gtk_message_dialog_new ( + NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "%s", _("The geographical position must be entered " + "in the format: \n\n45.436845,125.862501")); gtk_widget_show (dialog); } @@ -1212,14 +1215,18 @@ ecmt_fill_component_from_model (ECalModel *model, set_status (comp_data, e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_STATUS, row)); } - set_due (model, comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_DUE, row)); - set_geo (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_GEO, row)); - set_priority (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_PRIORITY, row)); - set_url (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_URL, row)); + set_due ( + model, comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_DUE, row)); + set_geo ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_GEO, row)); + set_priority ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_PRIORITY, row)); + set_url ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_URL, row)); } ECalModel * @@ -1246,7 +1253,7 @@ e_cal_model_tasks_set_highlight_due_today (ECalModelTasks *model, { g_return_if_fail (E_IS_CAL_MODEL_TASKS (model)); - if ((highlight ? 1 : 0) == (model->priv->highlight_due_today ? 1 : 0)) + if (model->priv->highlight_due_today == highlight) return; model->priv->highlight_due_today = highlight; @@ -1292,7 +1299,7 @@ e_cal_model_tasks_set_highlight_overdue (ECalModelTasks *model, { g_return_if_fail (E_IS_CAL_MODEL_TASKS (model)); - if ((highlight ? 1 : 0) == (model->priv->highlight_overdue ? 1 : 0)) + if (model->priv->highlight_overdue == highlight) return; model->priv->highlight_overdue = highlight; @@ -1403,12 +1410,17 @@ commit_component_changes (ECalModelComponent *comp_data) g_return_if_fail (comp_data != NULL); /* FIXME ask about mod type */ - if (!e_cal_client_modify_object_sync (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL, &error)) { - g_warning (G_STRLOC ": Could not modify the object! %s", error ? error->message : "Unknown error"); + e_cal_client_modify_object_sync ( + comp_data->client, comp_data->icalcomp, + CALOBJ_MOD_ALL, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not modify the object! %s", + error->message); /* FIXME Show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } } diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 3020a70300..b7c7145c05 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -433,11 +433,13 @@ cal_model_dispose (GObject *object) while (priv->clients != NULL) { ECalModelClient *client_data = (ECalModelClient *) priv->clients->data; - g_signal_handlers_disconnect_matched (client_data->client, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, object); + g_signal_handlers_disconnect_matched ( + client_data->client, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); if (client_data->view) - g_signal_handlers_disconnect_matched (client_data->view, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, object); + g_signal_handlers_disconnect_matched ( + client_data->view, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); priv->clients = g_list_remove (priv->clients, client_data); @@ -678,50 +680,58 @@ e_cal_model_class_init (ECalModelClass *class) 0, G_PARAM_READWRITE)); - signals[TIME_RANGE_CHANGED] = - g_signal_new ("time_range_changed", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, time_range_changed), - NULL, NULL, - e_marshal_VOID__LONG_LONG, - G_TYPE_NONE, 2, G_TYPE_LONG, G_TYPE_LONG); - - signals[ROW_APPENDED] = - g_signal_new ("row_appended", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, row_appended), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[COMPS_DELETED] = - g_signal_new ("comps_deleted", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, comps_deleted), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - signals[CAL_VIEW_PROGRESS] = - g_signal_new ("cal_view_progress", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, cal_view_progress), - NULL, NULL, - e_marshal_VOID__STRING_INT_INT, - G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT); - - signals[CAL_VIEW_COMPLETE] = - g_signal_new ("cal_view_complete", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, cal_view_complete), - NULL, NULL, - e_marshal_VOID__BOXED_INT, - G_TYPE_NONE, 2, G_TYPE_ERROR, G_TYPE_INT); + signals[TIME_RANGE_CHANGED] = g_signal_new ( + "time_range_changed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, time_range_changed), + NULL, NULL, + e_marshal_VOID__LONG_LONG, + G_TYPE_NONE, 2, + G_TYPE_LONG, + G_TYPE_LONG); + + signals[ROW_APPENDED] = g_signal_new ( + "row_appended", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, row_appended), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[COMPS_DELETED] = g_signal_new ( + "comps_deleted", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, comps_deleted), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + + signals[CAL_VIEW_PROGRESS] = g_signal_new ( + "cal_view_progress", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, cal_view_progress), + NULL, NULL, + e_marshal_VOID__STRING_INT_INT, + G_TYPE_NONE, 3, + G_TYPE_STRING, + G_TYPE_INT, + G_TYPE_INT); + + signals[CAL_VIEW_COMPLETE] = g_signal_new ( + "cal_view_complete", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, cal_view_complete), + NULL, NULL, + e_marshal_VOID__BOXED_INT, + G_TYPE_NONE, 2, + G_TYPE_ERROR, + G_TYPE_INT); signals[STATUS_MESSAGE] = g_signal_new ( "status-message", @@ -731,7 +741,9 @@ e_cal_model_class_init (ECalModelClass *class) NULL, NULL, e_marshal_VOID__STRING_DOUBLE, G_TYPE_NONE, 2, - G_TYPE_STRING, G_TYPE_DOUBLE); + G_TYPE_STRING, + G_TYPE_DOUBLE); + signals[TIMEZONE_CHANGED] = g_signal_new ( "timezone-changed", G_TYPE_FROM_CLASS (class), @@ -1021,12 +1033,18 @@ ecm_value_at (ETableModel *etm, case E_CAL_MODEL_FIELD_DTSTART : return (gpointer) get_dtstart (model, comp_data); case E_CAL_MODEL_FIELD_CREATED : - return (gpointer) get_datetime_from_utc (model, comp_data, ICAL_CREATED_PROPERTY, icalproperty_get_created, &comp_data->created); + return (gpointer) get_datetime_from_utc ( + model, comp_data, ICAL_CREATED_PROPERTY, + icalproperty_get_created, &comp_data->created); case E_CAL_MODEL_FIELD_LASTMODIFIED : - return (gpointer) get_datetime_from_utc (model, comp_data, ICAL_LASTMODIFIED_PROPERTY, icalproperty_get_lastmodified, &comp_data->lastmodified); + return (gpointer) get_datetime_from_utc ( + model, comp_data, ICAL_LASTMODIFIED_PROPERTY, + icalproperty_get_lastmodified, &comp_data->lastmodified); case E_CAL_MODEL_FIELD_HAS_ALARMS : - return GINT_TO_POINTER ((icalcomponent_get_first_component (comp_data->icalcomp, - ICAL_VALARM_COMPONENT) != NULL)); + return GINT_TO_POINTER ( + icalcomponent_get_first_component ( + comp_data->icalcomp, + ICAL_VALARM_COMPONENT) != NULL); case E_CAL_MODEL_FIELD_ICON : { ECalComponent *comp; @@ -1337,12 +1355,17 @@ ecm_set_value_at (ETableModel *etm, } /* FIXME ask about mod type */ - if (!e_cal_client_modify_object_sync (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL, &error)) { - g_warning (G_STRLOC ": Could not modify the object! %s", error ? error->message : "Unknown error"); + e_cal_client_modify_object_sync ( + comp_data->client, comp_data->icalcomp, + CALOBJ_MOD_ALL, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not modify the object! %s", + error->message); /* FIXME Show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } } @@ -1472,17 +1495,21 @@ ecm_append_row (ETableModel *etm, model_class->fill_component_from_model (model, comp_data, source, row); } - if (!e_cal_client_create_object_sync (comp_data->client, comp_data->icalcomp, &uid, NULL, &error)) { - g_warning (G_STRLOC ": Could not create the object! %s", error ? error->message : "Unknown error"); + e_cal_client_create_object_sync ( + comp_data->client, comp_data->icalcomp, &uid, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not create the object! %s", + error->message); /* FIXME: show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } else { if (uid) icalcomponent_set_uid (comp_data->icalcomp, uid); - g_signal_emit (G_OBJECT (model), signals[ROW_APPENDED], 0); + g_signal_emit (model, signals[ROW_APPENDED], 0); } g_free (uid); @@ -1760,7 +1787,7 @@ e_cal_model_set_confirm_delete (ECalModel *model, { g_return_if_fail (E_IS_CAL_MODEL (model)); - if ((model->priv->confirm_delete ? 1 : 0) == (confirm_delete ? 1 : 0)) + if (model->priv->confirm_delete == confirm_delete) return; model->priv->confirm_delete = confirm_delete; @@ -1838,8 +1865,9 @@ e_cal_model_set_timezone (ECalModel *model, redo_queries (model); g_object_notify (G_OBJECT (model), "timezone"); - g_signal_emit (G_OBJECT (model), signals[TIMEZONE_CHANGED], 0, - old_zone, zone); + g_signal_emit ( + model, signals[TIMEZONE_CHANGED], 0, + old_zone, zone); } gboolean @@ -1856,7 +1884,7 @@ e_cal_model_set_compress_weekend (ECalModel *model, { g_return_if_fail (E_IS_CAL_MODEL (model)); - if ((model->priv->compress_weekend ? 1 : 0) == (compress_weekend ? 1 : 0)) + if (model->priv->compress_weekend == compress_weekend) return; model->priv->compress_weekend = compress_weekend; @@ -1958,7 +1986,7 @@ e_cal_model_set_use_default_reminder (ECalModel *model, { g_return_if_fail (E_IS_CAL_MODEL (model)); - if ((model->priv->use_default_reminder ? 1 : 0) == (use_default_reminder ? 1 : 0)) + if (model->priv->use_default_reminder == use_default_reminder) return; model->priv->use_default_reminder = use_default_reminder; @@ -2272,7 +2300,7 @@ remove_all_for_id_and_client (ECalModel *model, continue; list = g_slist_append (list, comp_data); - g_signal_emit (G_OBJECT (model), signals[COMPS_DELETED], 0, list); + g_signal_emit (model, signals[COMPS_DELETED], 0, list); g_slist_free (list); g_object_unref (comp_data); @@ -2595,7 +2623,7 @@ process_removed (ECalClientView *view, continue; l = g_slist_append (l, comp_data); - g_signal_emit (G_OBJECT (model), signals[COMPS_DELETED], 0, l); + g_signal_emit (model, signals[COMPS_DELETED], 0, l); g_slist_free (l); g_object_unref (comp_data); @@ -2776,8 +2804,9 @@ client_view_complete_cb (ECalClientView *view, g_return_if_fail (E_IS_CAL_MODEL (model)); - g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_COMPLETE], 0, error, - e_cal_client_get_source_type (client)); + g_signal_emit ( + model, signals[CAL_VIEW_COMPLETE], 0, error, + e_cal_client_get_source_type (client)); } struct get_view_data @@ -2815,25 +2844,29 @@ get_view_cb (GObject *source_object, g_return_if_fail (gvd->model != NULL); g_return_if_fail (gvd->client_data != NULL); - if (!e_cal_client_get_view_finish (E_CAL_CLIENT (source_object), result, &view, &error)) { - if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || - g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_clear_error (&error); + e_cal_client_get_view_finish ( + E_CAL_CLIENT (source_object), result, &view, &error); - free_get_view_data (gvd); - return; - } + if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + free_get_view_data (gvd); + g_error_free (error); + return; + } + if (error != NULL) { if (gvd->tries < 10) { - g_clear_error (&error); gvd->tries++; g_timeout_add (500, retry_get_view_timeout_cb, gvd); + g_error_free (error); return; } - g_debug ("%s: Failed to get view: %s", G_STRFUNC, error ? error->message : "Unknown error"); + g_warning ( + "%s: Failed to get view: %s", + G_STRFUNC, error->message); + g_error_free (error); - g_clear_error (&error); } else { gvd->client_data->view = view; @@ -2855,8 +2888,10 @@ get_view_cb (GObject *source_object, e_cal_client_view_start (gvd->client_data->view, &error); - if (error) { - g_debug ("%s: Failed to start view: %s", G_STRFUNC, error->message); + if (error != NULL) { + g_warning ( + "%s: Failed to start view: %s", + G_STRFUNC, error->message); g_error_free (error); } } @@ -2894,8 +2929,9 @@ update_e_cal_view_for_client (ECalModel *model, /* free the previous view, if any */ if (client_data->view) { - g_signal_handlers_disconnect_matched (client_data->view, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, model); + g_signal_handlers_disconnect_matched ( + client_data->view, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, model); g_object_unref (client_data->view); client_data->view = NULL; } @@ -3154,7 +3190,7 @@ remove_client_objects (ECalModel *model, g_ptr_array_remove (model->priv->objects, comp_data); l = g_slist_append (l, comp_data); - g_signal_emit (G_OBJECT (model), signals[COMPS_DELETED], 0, l); + g_signal_emit (model, signals[COMPS_DELETED], 0, l); g_slist_free (l); g_object_unref (comp_data); @@ -3285,7 +3321,7 @@ cleanup_content_cb (gpointer user_data) slist = get_objects_as_list (model); g_ptr_array_set_size (priv->objects, 0); - g_signal_emit (G_OBJECT (model), signals[COMPS_DELETED], 0, slist); + g_signal_emit (model, signals[COMPS_DELETED], 0, slist); e_table_model_rows_deleted (E_TABLE_MODEL (model), 0, len); @@ -3323,12 +3359,13 @@ redo_queries (ECalModel *model) if (priv->search_sexp) { priv->full_sexp = g_strdup_printf ( - "(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\") %s)", - iso_start, iso_end, default_tzloc, - priv->search_sexp ? priv->search_sexp : ""); + "(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\") %s)", + iso_start, iso_end, default_tzloc, + priv->search_sexp ? priv->search_sexp : ""); } else { - priv->full_sexp = g_strdup_printf ("(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", - iso_start, iso_end, default_tzloc); + priv->full_sexp = g_strdup_printf ( + "(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", + iso_start, iso_end, default_tzloc); } g_free (iso_start); @@ -3402,7 +3439,7 @@ e_cal_model_set_time_range (ECalModel *model, priv->start = start; priv->end = end; - g_signal_emit (G_OBJECT (model), signals[TIME_RANGE_CHANGED], 0, start, end); + g_signal_emit (model, signals[TIME_RANGE_CHANGED], 0, start, end); redo_queries (model); } @@ -3478,7 +3515,7 @@ e_cal_model_set_search_query_with_time_range (ECalModel *model, priv->end = end; do_query = TRUE; - g_signal_emit (G_OBJECT (model), signals[TIME_RANGE_CHANGED], 0, start, end); + g_signal_emit (model, signals[TIME_RANGE_CHANGED], 0, start, end); } if (do_query) @@ -3672,11 +3709,11 @@ e_cal_model_get_rgb_color_for_component (ECalModel *model, if (color && gdk_color_parse (color, &gdk_color)) { if (red) - *red = ((double) gdk_color.red)/0xffff; + *red = ((gdouble) gdk_color.red)/0xffff; if (green) - *green = ((double) gdk_color.green)/0xffff; + *green = ((gdouble) gdk_color.green)/0xffff; if (blue) - *blue = ((double) gdk_color.blue)/0xffff; + *blue = ((gdouble) gdk_color.blue)/0xffff; return TRUE; } diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index a2eb33cacd..88f8abc86c 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -240,7 +240,8 @@ calendar_view_delete_event (ECalendarView *cal_view, } rid = e_cal_component_get_recurid_as_string (comp); if (e_cal_util_component_is_instance (event->comp_data->icalcomp) || e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) - e_cal_client_remove_object_sync (event->comp_data->client, uid, + e_cal_client_remove_object_sync ( + event->comp_data->client, uid, rid, CALOBJ_MOD_ALL, NULL, &error); else e_cal_client_remove_object_sync (event->comp_data->client, uid, NULL, CALOBJ_MOD_THIS, NULL, &error); @@ -1191,8 +1192,9 @@ e_calendar_view_set_timezone (ECalendarView *cal_view, return; e_cal_model_set_timezone (cal_view->priv->model, zone); - g_signal_emit (G_OBJECT (cal_view), signals[TIMEZONE_CHANGED], 0, - old_zone, zone); + g_signal_emit ( + cal_view, signals[TIMEZONE_CHANGED], 0, + old_zone, zone); } const gchar * @@ -1445,8 +1447,9 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view) else { struct icaltimetype instance_rid; - instance_rid = icaltime_from_timet_with_zone (event->comp_data->instance_start, - TRUE, zone ? zone : icaltimezone_get_utc_timezone ()); + instance_rid = icaltime_from_timet_with_zone ( + event->comp_data->instance_start, + TRUE, zone ? zone : icaltimezone_get_utc_timezone ()); e_cal_util_remove_instances (event->comp_data->icalcomp, instance_rid, CALOBJ_MOD_THIS); e_cal_client_modify_object_sync (event->comp_data->client, event->comp_data->icalcomp, CALOBJ_MOD_THIS, NULL, &error); } @@ -1583,8 +1586,8 @@ e_calendar_view_new_appointment_for (ECalendarView *cal_view, flags |= COMP_EDITOR_USER_ORG; } - e_calendar_view_open_event_with_flags (cal_view, default_client, - icalcomp, flags); + e_calendar_view_open_event_with_flags ( + cal_view, default_client, icalcomp, flags); g_object_unref (comp); } @@ -1780,7 +1783,11 @@ e_calendar_view_modify_and_send (ECalendarView *cal_view, e_cal_component_commit_sequence (comp); - if (e_cal_client_modify_object_sync (client, e_cal_component_get_icalcomponent (comp), mod, NULL, &error)) { + e_cal_client_modify_object_sync ( + client, e_cal_component_get_icalcomponent (comp), + mod, NULL, &error); + + if (error == NULL) { gboolean strip_alarms = TRUE; if ((itip_organizer_is_user (registry, comp, client) || @@ -1816,10 +1823,11 @@ e_calendar_view_modify_and_send (ECalendarView *cal_view, g_object_unref (send_comp); } } else { - g_message (G_STRLOC ": Could not update the object! %s", error ? error->message : "Unknown error"); + g_message ( + G_STRLOC ": Could not update the object! %s", + error->message); - if (error) - g_error_free (error); + g_error_free (error); } } diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c index d6c2a32ca2..3076c537a0 100644 --- a/calendar/gui/e-cell-date-edit-text.c +++ b/calendar/gui/e-cell-date-edit-text.c @@ -334,7 +334,7 @@ e_cell_date_edit_text_set_use_24_hour_format (ECellDateEditText *ecd, { g_return_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd)); - if ((ecd->priv->use_24_hour_format ? 1 : 0) == (use_24_hour ? 1 : 0)) + if (ecd->priv->use_24_hour_format == use_24_hour) return; ecd->priv->use_24_hour_format = use_24_hour; diff --git a/calendar/gui/e-date-time-list.c b/calendar/gui/e-date-time-list.c index 4ca04a3f16..22e42fd964 100644 --- a/calendar/gui/e-date-time-list.c +++ b/calendar/gui/e-date-time-list.c @@ -171,9 +171,10 @@ get_exception_string (EDateTimeList *date_time_list, tmp_tm.tm_sec = dt->value->second; tmp_tm.tm_isdst = -1; - tmp_tm.tm_wday = time_day_of_week (dt->value->day, - dt->value->month - 1, - dt->value->year); + tmp_tm.tm_wday = time_day_of_week ( + dt->value->day, + dt->value->month - 1, + dt->value->year); e_time_format_date_and_time ( &tmp_tm, use_24_hour_format, @@ -525,7 +526,7 @@ e_date_time_list_set_use_24_hour_format (EDateTimeList *date_time_list, { g_return_if_fail (E_IS_DATE_TIME_LIST (date_time_list)); - if ((date_time_list->use_24_hour_format ? 1 : 0) == (use_24_hour_format ? 1 : 0)) + if (date_time_list->use_24_hour_format == use_24_hour_format) return; date_time_list->use_24_hour_format = use_24_hour_format; diff --git a/calendar/gui/e-day-view-layout.c b/calendar/gui/e-day-view-layout.c index d1957b95e7..573a3b3ccd 100644 --- a/calendar/gui/e-day-view-layout.c +++ b/calendar/gui/e-day-view-layout.c @@ -78,9 +78,10 @@ e_day_view_layout_long_events (GArray *events, * 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, - days_shown, day_starts, - rows_in_top_display); + e_day_view_layout_long_event ( + event, grid, + days_shown, day_starts, + rows_in_top_display); } /* Free the grid. */ @@ -170,8 +171,9 @@ e_day_view_layout_day_events (GArray *events, for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); - e_day_view_layout_day_event (event, grid, group_starts, - cols_per_row, rows, mins_per_row, max_cols); + e_day_view_layout_day_event ( + event, grid, group_starts, + cols_per_row, rows, mins_per_row, max_cols); } /* Recalculate the number of columns needed in each row. */ @@ -181,8 +183,9 @@ e_day_view_layout_day_events (GArray *events, * 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, - mins_per_row); + e_day_view_expand_day_event ( + event, grid, cols_per_row, + mins_per_row); } /* Free the grid and compute maximum number of columns used. */ diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 32021b670a..61e238eaa4 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -238,14 +238,15 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, if (!can_draw_in_region (draw_region, item_x, item_y, item_w, item_h)) return; - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); + gdk_cairo_set_source_color ( + cr, + &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); if (!is_array_index_in_bounds (day_view->events[day], event_num)) return; - event = &g_array_index (day_view->events[day], EDayViewEvent, - event_num); + event = &g_array_index ( + day_view->events[day], EDayViewEvent, event_num); if (!is_comp_data_valid (event)) return; @@ -281,8 +282,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, if (MAX (0, item_w - 31.5) != 0) { /* Vertical Line */ cairo_save (cr); - pat = cairo_pattern_create_linear (item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 6.5, item_y + 13.75, - item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 13.75, item_y + 13.75); + pat = cairo_pattern_create_linear ( + item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 6.5, item_y + 13.75, + item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 13.75, item_y + 13.75); cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1); cairo_pattern_add_color_stop_rgba (pat, 0.7, 0, 0, 0, 0.2); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); @@ -292,8 +294,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_pattern_destroy (pat); /* Arc at the right */ - pat = cairo_pattern_create_radial (item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 3, item_y + 13.5, 5.0, - item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 5, item_y + 13.5, 12.0); + pat = cairo_pattern_create_radial ( + item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 3, item_y + 13.5, 5.0, + item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 5, item_y + 13.5, 12.0); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); cairo_pattern_add_color_stop_rgba (pat, 0.25, 0, 0, 0, 0.2); cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1); @@ -309,8 +312,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_stroke (cr); /* Horizontal line */ - pat = cairo_pattern_create_linear (item_x + E_DAY_VIEW_BAR_WIDTH + 15, item_y + item_h, - item_x + E_DAY_VIEW_BAR_WIDTH + 15, item_y + item_h + 7); + pat = cairo_pattern_create_linear ( + item_x + E_DAY_VIEW_BAR_WIDTH + 15, item_y + item_h, + item_x + E_DAY_VIEW_BAR_WIDTH + 15, item_y + item_h + 7); cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1); cairo_pattern_add_color_stop_rgba (pat, 0.7, 0, 0, 0, 0.2); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); @@ -320,8 +324,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_pattern_destroy (pat); /* Bottom arc */ - pat = cairo_pattern_create_radial (item_x + E_DAY_VIEW_BAR_WIDTH + 12.5, item_y + item_h - 5, 5.0, - item_x + E_DAY_VIEW_BAR_WIDTH + 12.5, item_y + item_h - 5, 12.0); + pat = cairo_pattern_create_radial ( + item_x + E_DAY_VIEW_BAR_WIDTH + 12.5, item_y + item_h - 5, 5.0, + item_x + E_DAY_VIEW_BAR_WIDTH + 12.5, item_y + item_h - 5, 12.0); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); cairo_pattern_add_color_stop_rgba (pat, 0.7, 0, 0, 0, 0.2); cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1); @@ -341,7 +346,8 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_stroke (cr); /* Arc in middle */ - pat = cairo_pattern_create_radial (item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 1, item_y + item_h - 4.5, 1.0, + pat = cairo_pattern_create_radial ( + item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 1, item_y + item_h - 4.5, 1.0, item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 1, item_y + item_h - 4.5, 12.0); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); cairo_pattern_add_color_stop_rgba (pat, 0.8, 0, 0, 0, 0.2); @@ -393,7 +399,8 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_set_source_rgb (cr, 1, 1, 1); cairo_fill (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color ( + cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); for (row_y = y0; @@ -475,8 +482,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, if (is_editing) short_event = TRUE; - 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); + 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); @@ -497,16 +505,18 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, /* Draw the right edge of the vertical bar. */ cairo_save (cr); - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); + gdk_cairo_set_source_color ( + cr, + &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); cairo_set_line_width (cr, 0.7); cairo_move_to (cr, item_x + E_DAY_VIEW_BAR_WIDTH - 1, item_y + 1); cairo_line_to (cr, item_x + E_DAY_VIEW_BAR_WIDTH - 1, item_y + item_h - 2); cairo_stroke (cr); cairo_restore (cr); - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); + gdk_cairo_set_source_color ( + cr, + &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); /* Draw the vertical colored bar showing when the appointment * begins & ends. */ @@ -532,13 +542,15 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, end_hour = end_minute / 60; end_minute = end_minute % 60; - e_day_view_convert_time_to_display (day_view, end_hour, - &end_display_hour, - &end_resize_suffix, - &end_suffix_width); + e_day_view_convert_time_to_display ( + day_view, end_hour, + &end_display_hour, + &end_resize_suffix, + &end_suffix_width); cairo_save (cr); - cairo_rectangle (cr, item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 2.75, + cairo_rectangle ( + cr, item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 2.75, item_w - E_DAY_VIEW_BAR_WIDTH - 4.5, item_h - 5.5); cairo_clip (cr); @@ -546,17 +558,19 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, if (e_cal_model_get_use_24_hour_format (model)) { cairo_translate (cr, item_x + item_w - E_DAY_VIEW_BAR_WIDTH - 32, item_y + item_h - 8); - end_regsizeime = g_strdup_printf ("%2i:%02i", - end_display_hour, end_minute); + end_regsizeime = g_strdup_printf ( + "%2i:%02i", + end_display_hour, end_minute); } else { cairo_translate (cr, item_x + item_w - E_DAY_VIEW_BAR_WIDTH - 48, item_y + item_h - 8); - end_regsizeime = g_strdup_printf ("%2i:%02i%s", - end_display_hour, end_minute, - end_resize_suffix); + end_regsizeime = g_strdup_printf ( + "%2i:%02i%s", + end_display_hour, end_minute, + 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); @@ -578,14 +592,16 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, e_cal_component_get_transparency (comp, &transparency); if (transparency != E_CAL_COMPONENT_TRANSP_TRANSPARENT) { 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); + 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_rectangle (cr, item_x + 1, bar_y1, - E_DAY_VIEW_BAR_WIDTH - 2, bar_y2 - bar_y1); + cairo_rectangle ( + cr, item_x + 1, bar_y1, + E_DAY_VIEW_BAR_WIDTH - 2, bar_y2 - bar_y1); cairo_set_source (cr, pat); cairo_fill (cr); @@ -602,8 +618,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, } } - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); + gdk_cairo_set_source_color ( + cr, + &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); /* Draw the reminder & recurrence icons, if needed. */ if (!resize_flag && (!is_editing || text_x_offset > E_DAY_VIEW_ICON_X_PAD)) { @@ -734,14 +751,16 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, end_hour = end_minute / 60; end_minute = end_minute % 60; - e_day_view_convert_time_to_display (day_view, start_hour, - &start_display_hour, - &start_suffix, - &start_suffix_width); - e_day_view_convert_time_to_display (day_view, end_hour, - &end_display_hour, - &end_suffix, - &end_suffix_width); + e_day_view_convert_time_to_display ( + day_view, start_hour, + &start_display_hour, + &start_suffix, + &start_suffix_width); + e_day_view_convert_time_to_display ( + day_view, end_hour, + &end_display_hour, + &end_suffix, + &end_suffix_width); if (e_cal_model_get_use_24_hour_format (model)) { if (day_view->show_event_end_times && show_span) { @@ -776,7 +795,8 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, } cairo_save (cr); - cairo_rectangle (cr, item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 2.75, + cairo_rectangle ( + cr, item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 2.75, item_w - E_DAY_VIEW_BAR_WIDTH - 4.5, 14); @@ -790,7 +810,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); @@ -1019,12 +1039,14 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, work_day_end_y = e_day_view_convert_time_to_position ( day_view, work_day_end_hour, work_day_end_minute) - y; - today_tt = icaltime_from_timet_with_zone (time (NULL), FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + today_tt = icaltime_from_timet_with_zone ( + time (NULL), FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); for (day = 0; day < day_view->days_shown; day++) { - day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + day_start_tt = icaltime_from_timet_with_zone ( + day_view->day_starts[day], FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); weekday = icaltime_day_of_week (day_start_tt) - 1; work_day = day_view->working_days & (1 << weekday); @@ -1111,7 +1133,8 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, grid_x2 = day_view->day_offsets[day_view->days_shown] - x; cairo_save (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color ( + cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); for (row = 0, row_y = 0 - y; @@ -1137,13 +1160,15 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, continue; cairo_save (cr); - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); + gdk_cairo_set_source_color ( + cr, + &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); cairo_move_to (cr, grid_x1, grid_y1); cairo_line_to (cr, grid_x1, grid_y2); cairo_stroke (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color ( + cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); cairo_move_to (cr, grid_x1 + E_DAY_VIEW_BAR_WIDTH - 1, grid_y1); @@ -1152,8 +1177,9 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, cairo_set_source_rgb (cr, 1, 1, 1); - cairo_rectangle (cr, grid_x1 + 1, grid_y1, - E_DAY_VIEW_BAR_WIDTH - 2, grid_y2 - grid_y1); + cairo_rectangle ( + cr, grid_x1 + 1, grid_y1, + E_DAY_VIEW_BAR_WIDTH - 2, grid_y2 - grid_y1); cairo_fill (cr); @@ -1184,8 +1210,9 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkColor mb_color; cairo_save (cr); - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); + gdk_cairo_set_source_color ( + cr, + &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); if (day_view->marcus_bains_day_view_color && gdk_color_parse (day_view->marcus_bains_day_view_color, &mb_color)) { gdk_cairo_set_source_color (cr, &mb_color); diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index 02600d0225..506292d80f 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -331,11 +331,13 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, short_line_x1 = 0; large_hour_x2 = 0; } else { - max_suffix_width = MAX (day_view->am_string_width, - day_view->pm_string_width); + max_suffix_width = MAX ( + day_view->am_string_width, + day_view->pm_string_width); - max_minute_or_suffix_width = MAX (max_suffix_width, - day_view->max_minute_width); + max_minute_or_suffix_width = MAX ( + max_suffix_width, + day_view->max_minute_width); /* The start of the short horizontal line between the periods * within each hour. */ @@ -367,9 +369,8 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, day_view->day_starts[0], 0, cal_zone); /* diff is number of minutes */ - diff = (icaltimezone_get_utc_offset (use_zone, &tt, NULL) - - icaltimezone_get_utc_offset (cal_zone, &tt, NULL) - ) / 60; + diff =(icaltimezone_get_utc_offset (use_zone, &tt, NULL) - + icaltimezone_get_utc_offset (cal_zone, &tt, NULL)) / 60; tt = icaltime_from_timet_with_zone (day_view->day_starts[0], 0, cal_zone); tt.is_date = FALSE; @@ -480,9 +481,10 @@ 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. */ - e_day_view_convert_time_to_display (day_view, hour, - &display_hour, - &suffix, &suffix_width); + 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 @@ -502,11 +504,13 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, strcat (buffer, " "); strcat (buffer, midnight_month); } else if (e_cal_model_get_use_24_hour_format (model)) { - g_snprintf (buffer, sizeof (buffer), "%i:%02i", - display_hour, minute); + g_snprintf ( + buffer, sizeof (buffer), "%i:%02i", + display_hour, minute); } else { - g_snprintf (buffer, sizeof (buffer), "%i %s", - display_hour, suffix); + g_snprintf ( + buffer, sizeof (buffer), "%i %s", + display_hour, suffix); } cairo_save (cr); @@ -538,8 +542,9 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, if (show_midnight_date) strcpy (buffer, midnight_day); else - g_snprintf (buffer, sizeof (buffer), "%i", - display_hour); + g_snprintf ( + buffer, sizeof (buffer), "%i", + display_hour); cairo_set_line_width (cr, 0.7); cairo_move_to (cr, long_line_x1, row_y); @@ -590,8 +595,9 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, && !e_cal_model_get_use_24_hour_format (model)) { strcpy (buffer, suffix); } else { - g_snprintf (buffer, sizeof (buffer), - "%02i", minute); + g_snprintf ( + buffer, sizeof (buffer), + "%02i", minute); } cairo_save (cr); @@ -616,8 +622,9 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, } } - e_day_view_time_item_increment_time (&hour, &minute, - time_divisions); + e_day_view_time_item_increment_time ( + &hour, &minute, + time_divisions); } pango_font_metrics_unref (large_font_metrics); @@ -695,8 +702,8 @@ e_day_view_time_item_event (GnomeCanvasItem *item, break; case GDK_BUTTON_RELEASE: if (event->button.button == 1) - e_day_view_time_item_on_button_release (time_item, - event); + e_day_view_time_item_on_button_release ( + time_item, event); break; case GDK_MOTION_NOTIFY: @@ -787,7 +794,7 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, * day view, e.g. a day is displayed in * 24 "60 minute divisions" or * 48 "30 minute divisions". */ - _("%02i minute divisions"), divisions[i]); + _("%02i minute divisions"), divisions[i]); item = gtk_radio_menu_item_new_with_label (group, buffer); group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item)); gtk_widget_show (item); @@ -871,8 +878,9 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, gtk_widget_show_all (submenu); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - event->button.button, event->button.time); + gtk_menu_popup ( + GTK_MENU (menu), NULL, NULL, NULL, NULL, + event->button.button, event->button.time); } static void @@ -909,8 +917,9 @@ e_day_view_time_item_on_button_press (EDayViewTimeItem *time_item, canvas = GNOME_CANVAS_ITEM (time_item)->canvas; - row = e_day_view_time_item_convert_position_to_row (time_item, - event->button.y); + row = e_day_view_time_item_convert_position_to_row ( + time_item, + event->button.y); if (row == -1) return; @@ -968,8 +977,9 @@ e_day_view_time_item_on_motion_notify (EDayViewTimeItem *time_item, row = e_day_view_time_item_convert_position_to_row (time_item, y); if (row != -1) { - gnome_canvas_world_to_window (canvas, 0, event->motion.y, - NULL, &window_y); + gnome_canvas_world_to_window ( + canvas, 0, event->motion.y, + NULL, &window_y); e_day_view_update_selection (day_view, -1, row); e_day_view_check_auto_scroll (day_view, -1, (gint) window_y); } @@ -1056,18 +1066,21 @@ e_day_view_time_item_get_column_width (EDayViewTimeItem *time_item) g_object_unref (layout); - max_large_digit_width = MAX (max_large_digit_width, - large_digit_width); + max_large_digit_width = MAX ( + max_large_digit_width, + large_digit_width); } /* 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. */ - max_suffix_width = MAX (day_view->am_string_width, - day_view->pm_string_width); + max_suffix_width = MAX ( + day_view->am_string_width, + day_view->pm_string_width); - max_minute_or_suffix_width = MAX (max_suffix_width, - day_view->max_minute_width); + max_minute_or_suffix_width = MAX ( + max_suffix_width, + day_view->max_minute_width); column_width_default = max_large_digit_width * 2 + max_minute_or_suffix_width diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index 15cfc8079d..8d961ea6a5 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -248,8 +248,9 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, draw_curved_rectangle (cr, x0, y0, rect_width, rect_height, radius); - 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); + 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_set_source (cr, pat); @@ -318,22 +319,26 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, minute = offset % 60; /* Calculate the actual hour number to display. For 12-hour * 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); + e_day_view_convert_time_to_display ( + day_view, hour, + &display_hour, + &suffix, &suffix_width); if (e_cal_model_get_use_24_hour_format (model)) { - g_snprintf (buffer, sizeof (buffer), "%i:%02i", - display_hour, minute); + g_snprintf ( + buffer, sizeof (buffer), "%i:%02i", + display_hour, minute); } else { - g_snprintf (buffer, sizeof (buffer), "%i:%02i%s", - display_hour, minute, suffix); + g_snprintf ( + buffer, sizeof (buffer), "%i:%02i%s", + display_hour, minute, suffix); } cairo_save (cr); - cairo_rectangle (cr, - item_x - x, item_y - y, - item_w - E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH, item_h); + cairo_rectangle ( + cr, + item_x - x, item_y - y, + item_w - E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH, item_h); cairo_clip (cr); time_x = item_x + E_DAY_VIEW_LONG_EVENT_X_PAD - x; @@ -341,10 +346,11 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, time_x += day_view->digit_width; layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer); - cairo_move_to (cr, - time_x, - item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + - E_DAY_VIEW_LONG_EVENT_Y_PAD - y); + cairo_move_to ( + cr, + time_x, + item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + + E_DAY_VIEW_LONG_EVENT_Y_PAD - y); pango_cairo_show_layout (cr, layout); g_object_unref (layout); @@ -369,26 +375,30 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, if (time_x >= min_end_time_x) { /* Calculate the actual hour number to display. */ - e_day_view_convert_time_to_display (day_view, hour, - &display_hour, - &suffix, - &suffix_width); + e_day_view_convert_time_to_display ( + day_view, hour, + &display_hour, + &suffix, + &suffix_width); if (e_cal_model_get_use_24_hour_format (model)) { - g_snprintf (buffer, sizeof (buffer), - "%i:%02i", display_hour, minute); + g_snprintf ( + buffer, sizeof (buffer), + "%i:%02i", display_hour, minute); } else { - g_snprintf (buffer, sizeof (buffer), - "%i:%02i%s", display_hour, minute, - suffix); + g_snprintf ( + buffer, sizeof (buffer), + "%i:%02i%s", display_hour, minute, + suffix); } if (display_hour < 10) time_x += day_view->digit_width; layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer); - cairo_move_to (cr, - time_x, - item_y + E_DAY_VIEW_LONG_EVENT_Y_PAD + 1 - y); + cairo_move_to ( + cr, + time_x, + item_y + E_DAY_VIEW_LONG_EVENT_Y_PAD + 1 - y); pango_cairo_show_layout (cr, layout); g_object_unref (layout); @@ -457,12 +467,14 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, continue; if (icon_x <= max_icon_x) { - gdk_cairo_set_source_pixbuf (cr, pixbuf, - icon_x, icon_y); - cairo_rectangle (cr, - icon_x, icon_y, - E_DAY_VIEW_ICON_WIDTH, - E_DAY_VIEW_ICON_HEIGHT); + gdk_cairo_set_source_pixbuf ( + cr, pixbuf, + icon_x, icon_y); + cairo_rectangle ( + cr, + icon_x, icon_y, + E_DAY_VIEW_ICON_WIDTH, + E_DAY_VIEW_ICON_HEIGHT); cairo_fill (cr); icon_x -= icon_x_inc; } @@ -616,9 +628,10 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, /* Draw the background for the dates. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &bg); - cairo_rectangle (cr, left_edge + 2 - x, 2 - y, - canvas_width - left_edge - 3, - item_height - 3); + cairo_rectangle ( + cr, left_edge + 2 - x, 2 - y, + canvas_width - left_edge - 3, + item_height - 3); cairo_fill (cr); cairo_restore (cr); } @@ -628,9 +641,10 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); gdk_cairo_set_source_color ( cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS]); - cairo_rectangle (cr, left_edge - x, - y, - canvas_width - left_edge, - canvas_height); + cairo_rectangle ( + cr, left_edge - x, - y, + canvas_width - left_edge, + canvas_height); cairo_fill (cr); cairo_restore (cr); @@ -654,8 +668,9 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, gdk_cairo_set_source_color ( cr, &day_view->colors [E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED]); - cairo_rectangle (cr, rect_x - x, rect_y - y, - rect_w, rect_h); + cairo_rectangle ( + cr, rect_x - x, rect_y - y, + rect_w, rect_h); cairo_fill (cr); cairo_restore (cr); } @@ -703,16 +718,20 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, if (day != 0) { cairo_save (cr); gdk_cairo_set_source_color (cr, &light); - cairo_move_to (cr, day_view->day_offsets[day] - x, - 4 - y); - cairo_line_to (cr, day_view->day_offsets[day] - x, - item_height - 4 - y); + cairo_move_to ( + cr, day_view->day_offsets[day] - x, + 4 - y); + cairo_line_to ( + cr, day_view->day_offsets[day] - x, + item_height - 4 - y); cairo_stroke (cr); gdk_cairo_set_source_color (cr, &dark); - cairo_move_to (cr, day_view->day_offsets[day] - 1 - x, - 4 - y); - cairo_line_to (cr, day_view->day_offsets[day] - 1 - x, - item_height - 4 - y); + cairo_move_to ( + cr, day_view->day_offsets[day] - 1 - x, + 4 - y); + cairo_line_to ( + cr, day_view->day_offsets[day] - 1 - x, + item_height - 4 - y); cairo_stroke (cr); cairo_restore (cr); } @@ -723,10 +742,12 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, gdk_cairo_set_source_color ( cr, &day_view->colors [E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID]); - cairo_move_to (cr, day_view->day_offsets[day] - x, - item_height - y); - cairo_line_to (cr, day_view->day_offsets[day] - x, - canvas_height - y); + cairo_move_to ( + cr, day_view->day_offsets[day] - x, + item_height - y); + cairo_line_to ( + cr, day_view->day_offsets[day] - x, + canvas_height - y); cairo_stroke (cr); cairo_restore (cr); } @@ -883,7 +904,7 @@ e_day_view_top_item_set_show_dates (EDayViewTopItem *top_item, { g_return_if_fail (E_IS_DAY_VIEW_TOP_ITEM (top_item)); - if ((top_item->priv->show_dates ? 1 : 0) == (show_dates ? 1 : 0)) + if (top_item->priv->show_dates == show_dates) return; top_item->priv->show_dates = show_dates; diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index d6b3fbb05c..d029819d8a 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -926,8 +926,9 @@ timezone_changed_cb (ECalModel *cal_model, /* Recalculate the new start of the first day. We just use exactly * the same time, but with the new timezone. */ - tt = icaltime_from_timet_with_zone (day_view->lower, FALSE, - old_zone); + tt = icaltime_from_timet_with_zone ( + day_view->lower, FALSE, + old_zone); lower = icaltime_as_timet_with_zone (tt, new_zone); @@ -946,8 +947,9 @@ e_day_view_init (EDayView *day_view) gtk_widget_set_can_focus (GTK_WIDGET (day_view), TRUE); - day_view->long_events = g_array_new (FALSE, FALSE, - sizeof (EDayViewEvent)); + day_view->long_events = g_array_new ( + FALSE, FALSE, + sizeof (EDayViewEvent)); day_view->long_events_sorted = TRUE; day_view->long_events_need_layout = FALSE; day_view->long_events_need_reshape = FALSE; @@ -955,8 +957,9 @@ e_day_view_init (EDayView *day_view) day_view->layout_timeout_id = 0; for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++) { - day_view->events[day] = g_array_new (FALSE, FALSE, - sizeof (EDayViewEvent)); + day_view->events[day] = g_array_new ( + FALSE, FALSE, + sizeof (EDayViewEvent)); day_view->events_sorted[day] = TRUE; day_view->need_layout[day] = FALSE; day_view->need_reshape[day] = FALSE; @@ -1046,8 +1049,9 @@ e_day_view_init (EDayView *day_view) day_view->top_canvas = e_canvas_new (); gtk_box_pack_end (GTK_BOX (w), day_view->top_canvas, TRUE, TRUE, 0); - gtk_table_attach (GTK_TABLE (day_view), w, - 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), w, + 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show_all (w); g_signal_connect_after ( @@ -1085,47 +1089,52 @@ e_day_view_init (EDayView *day_view) canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_dates_canvas)->root); day_view->top_dates_canvas_item = - gnome_canvas_item_new (canvas_group, - e_day_view_top_item_get_type (), - "EDayViewTopItem::day_view", day_view, - "EDayViewTopItem::show_dates", TRUE, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_day_view_top_item_get_type (), + "EDayViewTopItem::day_view", day_view, + "EDayViewTopItem::show_dates", TRUE, + NULL); gtk_widget_set_size_request (day_view->top_dates_canvas, -1, day_view->top_row_height); canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root); day_view->top_canvas_item = - gnome_canvas_item_new (canvas_group, - e_day_view_top_item_get_type (), - "EDayViewTopItem::day_view", day_view, - "EDayViewTopItem::show_dates", FALSE, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_day_view_top_item_get_type (), + "EDayViewTopItem::day_view", day_view, + "EDayViewTopItem::show_dates", FALSE, + NULL); day_view->drag_long_event_rect_item = - gnome_canvas_item_new (canvas_group, - gnome_canvas_rect_get_type (), - "line_width", 1.0, - NULL); + gnome_canvas_item_new ( + canvas_group, + gnome_canvas_rect_get_type (), + "line_width", 1.0, + NULL); gnome_canvas_item_hide (day_view->drag_long_event_rect_item); day_view->drag_long_event_item = - gnome_canvas_item_new (canvas_group, - e_text_get_type (), - "line_wrap", TRUE, - "clip", TRUE, - "max_lines", 1, - "editable", TRUE, - "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0), - NULL); + gnome_canvas_item_new ( + canvas_group, + e_text_get_type (), + "line_wrap", TRUE, + "clip", TRUE, + "max_lines", 1, + "editable", TRUE, + "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0), + NULL); gnome_canvas_item_hide (day_view->drag_long_event_item); /* * Main Canvas */ day_view->main_canvas = e_canvas_new (); - gtk_table_attach (GTK_TABLE (day_view), day_view->main_canvas, - 1, 2, 1, 2, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), day_view->main_canvas, + 1, 2, 1, 2, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (day_view->main_canvas); g_signal_connect ( day_view->main_canvas, "realize", @@ -1167,33 +1176,37 @@ e_day_view_init (EDayView *day_view) canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root); day_view->main_canvas_item = - gnome_canvas_item_new (canvas_group, - e_day_view_main_item_get_type (), - "EDayViewMainItem::day_view", day_view, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_day_view_main_item_get_type (), + "EDayViewMainItem::day_view", day_view, + NULL); day_view->drag_rect_item = - gnome_canvas_item_new (canvas_group, - gnome_canvas_rect_get_type (), - "line_width", 1.0, - NULL); + gnome_canvas_item_new ( + canvas_group, + gnome_canvas_rect_get_type (), + "line_width", 1.0, + NULL); gnome_canvas_item_hide (day_view->drag_rect_item); day_view->drag_bar_item = - gnome_canvas_item_new (canvas_group, - gnome_canvas_rect_get_type (), - "line_width", 1.0, - NULL); + gnome_canvas_item_new ( + canvas_group, + gnome_canvas_rect_get_type (), + "line_width", 1.0, + NULL); gnome_canvas_item_hide (day_view->drag_bar_item); day_view->drag_item = - gnome_canvas_item_new (canvas_group, - e_text_get_type (), - "line_wrap", TRUE, - "clip", TRUE, - "editable", TRUE, - "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0), - NULL); + gnome_canvas_item_new ( + canvas_group, + e_text_get_type (), + "line_wrap", TRUE, + "clip", TRUE, + "editable", TRUE, + "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0), + NULL); gnome_canvas_item_hide (day_view->drag_item); /* @@ -1204,9 +1217,10 @@ e_day_view_init (EDayView *day_view) adjustment = gtk_scrollable_get_vadjustment (scrollable); scrollable = GTK_SCROLLABLE (day_view->time_canvas); gtk_scrollable_set_vadjustment (scrollable, adjustment); - gtk_table_attach (GTK_TABLE (day_view), day_view->time_canvas, - 0, 1, 1, 2, - GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), day_view->time_canvas, + 0, 1, 1, 2, + GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (day_view->time_canvas); g_signal_connect_after ( day_view->time_canvas, "scroll_event", @@ -1215,10 +1229,11 @@ e_day_view_init (EDayView *day_view) canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->time_canvas)->root); day_view->time_canvas_item = - gnome_canvas_item_new (canvas_group, - e_day_view_time_item_get_type (), - "EDayViewTimeItem::day_view", day_view, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_day_view_time_item_get_type (), + "EDayViewTimeItem::day_view", day_view, + NULL); /* * Scrollbar. @@ -1232,15 +1247,17 @@ e_day_view_init (EDayView *day_view) scrollable = GTK_SCROLLABLE (day_view->top_canvas); adjustment = gtk_scrollable_get_vadjustment (scrollable); day_view->tc_vscrollbar = gtk_vscrollbar_new (adjustment); - gtk_table_attach (GTK_TABLE (day_view), day_view->tc_vscrollbar, - 2, 3, 0, 1, 0, GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), day_view->tc_vscrollbar, + 2, 3, 0, 1, 0, GTK_FILL, 0, 0); /* gtk_widget_show (day_view->tc_vscrollbar); */ scrollable = GTK_SCROLLABLE (day_view->main_canvas); adjustment = gtk_scrollable_get_vadjustment (scrollable); day_view->vscrollbar = gtk_vscrollbar_new (adjustment); - gtk_table_attach (GTK_TABLE (day_view), day_view->vscrollbar, - 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), day_view->vscrollbar, + 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (day_view->vscrollbar); /* Create the cursors. */ @@ -1403,20 +1420,23 @@ e_day_view_realize (GtkWidget *widget) day_view->attach_icon = e_icon_factory_get_icon ("mail-attachment", GTK_ICON_SIZE_MENU); /* Set the canvas item colors. */ - gnome_canvas_item_set (day_view->drag_long_event_rect_item, - "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND], - "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], - NULL); + gnome_canvas_item_set ( + day_view->drag_long_event_rect_item, + "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND], + "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], + NULL); - gnome_canvas_item_set (day_view->drag_rect_item, - "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND], - "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], - NULL); + gnome_canvas_item_set ( + day_view->drag_rect_item, + "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND], + "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], + NULL); - gnome_canvas_item_set (day_view->drag_bar_item, - "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR], - "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], - NULL); + gnome_canvas_item_set ( + day_view->drag_bar_item, + "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR], + "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], + NULL); } static void @@ -1489,7 +1509,7 @@ e_day_view_get_text_color (EDayView *day_view, 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; @@ -1516,14 +1536,16 @@ e_day_view_update_top_scroll (EDayView *day_view, } /* Set the scroll region of the top canvas */ - gnome_canvas_get_scroll_region (GNOME_CANVAS (day_view->top_canvas), - NULL, NULL, &old_x2, &old_y2); + gnome_canvas_get_scroll_region ( + GNOME_CANVAS (day_view->top_canvas), + NULL, NULL, &old_x2, &old_y2); gtk_widget_get_allocation (day_view->top_canvas, &allocation); new_x2 = allocation.width - 1; new_y2 = (MAX (1, day_view->rows_in_top_display) + 1) * day_view->top_row_height - 1; if (old_x2 != new_x2 || old_y2 != new_y2) { - gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->top_canvas), - 0, 0, new_x2, new_y2); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (day_view->top_canvas), + 0, 0, new_x2, new_y2); if (scroll_to_top) gnome_canvas_scroll_to (GNOME_CANVAS (day_view->top_canvas), 0, 0); @@ -1570,9 +1592,10 @@ e_day_view_style_set (GtkWidget *widget, event = &g_array_index (day_view->events[week_day], EDayViewEvent, event_num); if (event->canvas_item) { color = e_day_view_get_text_color (day_view, event, widget); - gnome_canvas_item_set (event->canvas_item, - "fill_color_gdk", &color, - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "fill_color_gdk", &color, + NULL); } } } @@ -1580,17 +1603,19 @@ e_day_view_style_set (GtkWidget *widget, event = &g_array_index (day_view->long_events, EDayViewEvent, event_num); if (event->canvas_item) { color = e_day_view_get_text_color (day_view, event, widget); - gnome_canvas_item_set (event->canvas_item, - "fill_color_gdk", &color, - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "fill_color_gdk", &color, + NULL); } } /* Set up Pango prerequisites */ font_desc = gtk_widget_get_style (widget)->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); layout = pango_layout_new (pango_context); /* Create the large font. */ @@ -1598,24 +1623,26 @@ e_day_view_style_set (GtkWidget *widget, pango_font_description_free (day_view->large_font_desc); day_view->large_font_desc = pango_font_description_copy (font_desc); - pango_font_description_set_size (day_view->large_font_desc, - E_DAY_VIEW_LARGE_FONT_PTSIZE * PANGO_SCALE); + pango_font_description_set_size ( + day_view->large_font_desc, + E_DAY_VIEW_LARGE_FONT_PTSIZE * PANGO_SCALE); /* Create the small fonts. */ if (day_view->small_font_desc != NULL) pango_font_description_free (day_view->small_font_desc); day_view->small_font_desc = pango_font_description_copy (font_desc); - pango_font_description_set_size (day_view->small_font_desc, - E_DAY_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE); + pango_font_description_set_size ( + day_view->small_font_desc, + E_DAY_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE); /* Recalculate the height of each row based on the font size. */ day_view->row_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD * 2 + 2 /* FIXME */; - day_view->row_height = - MAX (day_view->row_height, + day_view->row_height = MAX ( + day_view->row_height, E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2); adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (day_view->main_canvas)); @@ -1627,7 +1654,8 @@ e_day_view_style_set (GtkWidget *widget, E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT * 2 + E_DAY_VIEW_LONG_EVENT_Y_PAD * 2 + E_DAY_VIEW_TOP_CANVAS_Y_GAP; day_view->top_row_height = - MAX (day_view->top_row_height, + MAX ( + day_view->top_row_height, E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2 + E_DAY_VIEW_TOP_CANVAS_Y_GAP); @@ -1748,8 +1776,8 @@ e_day_view_recalc_main_canvas_size (EDayView *day_view) 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); - gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas), - 0, scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (day_view->main_canvas), 0, scroll_y); day_view->scroll_to_work_day = FALSE; } @@ -2030,8 +2058,9 @@ e_day_view_remove_event_cb (EDayView *day_view, EDayViewEvent *event; #if 0 - g_print ("In e_day_view_remove_event_cb day:%i event_num:%i\n", - day, event_num); + g_print ( + "In e_day_view_remove_event_cb day:%i event_num:%i\n", + day, event_num); #endif if (day == E_DAY_VIEW_LONG_EVENT) { @@ -2185,9 +2214,10 @@ e_day_view_update_event_label (EDayView *day_view, } } - gnome_canvas_item_set (event->canvas_item, - "text", text, - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "text", text, + NULL); if (e_client_check_capability (E_CLIENT (event->comp_data->client), CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) @@ -2225,9 +2255,10 @@ e_day_view_update_long_event_label (EDayView *day_view, summary = e_calendar_view_get_icalcomponent_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text); - gnome_canvas_item_set (event->canvas_item, - "text", summary ? summary : "", - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "text", summary ? summary : "", + NULL); if (free_text) g_free ((gchar *) summary); @@ -2364,14 +2395,16 @@ e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view, g_return_if_fail (E_IS_DAY_VIEW (day_view)); /* Set the selection. */ - start_in_grid = e_day_view_convert_time_to_grid_position (day_view, - start_time, - &start_col, - &start_row); - end_in_grid = e_day_view_convert_time_to_grid_position (day_view, - end_time - 60, - &end_col, - &end_row); + start_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + start_time, + &start_col, + &start_row); + end_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + end_time - 60, + &end_col, + &end_row); if (!start_in_grid) start_col = 0; @@ -2419,11 +2452,13 @@ e_day_view_set_selected_time_range_visible (EDayView *day_view, work_day_start_minute = e_cal_model_get_work_day_start_minute (model); /* Set the selection. */ - start_in_grid = e_day_view_convert_time_to_grid_position (day_view, - start_time, - &start_col, - &start_row); - end_in_grid = e_day_view_convert_time_to_grid_position (day_view, + start_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + start_time, + &start_col, + &start_row); + end_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, end_time - 60, &end_col, &end_row); @@ -2539,14 +2574,16 @@ e_day_view_set_selected_time_range (ECalendarView *cal_view, end_time += e_calendar_view_get_time_divisions (cal_view) * 60; /* Set the selection. */ - start_in_grid = e_day_view_convert_time_to_grid_position (day_view, - start_time, - &start_col, - &start_row); - end_in_grid = e_day_view_convert_time_to_grid_position (day_view, - end_time - 60, - &end_col, - &end_row); + start_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + start_time, + &start_col, + &start_row); + end_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + end_time - 60, + &end_col, + &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 @@ -2830,7 +2867,7 @@ e_day_view_marcus_bains_set_show_line (EDayView *day_view, { g_return_if_fail (E_IS_DAY_VIEW (day_view)); - if ((day_view->marcus_bains_show_line ? 1 : 0) == (show_line ? 1 : 0)) + if (day_view->marcus_bains_show_line == show_line) return; day_view->marcus_bains_show_line = show_line; @@ -2973,8 +3010,9 @@ e_day_view_update_scroll_regions (EDayView *day_view) GNOME_CANVAS (day_view->time_canvas), NULL, NULL, &old_x2, &old_y2); new_x2 = time_canvas_allocation.width - 1; - new_y2 = MAX (day_view->rows * day_view->row_height, - main_canvas_allocation.height) - 1; + new_y2 = MAX ( + day_view->rows * day_view->row_height, + main_canvas_allocation.height) - 1; if (old_x2 != new_x2 || old_y2 != new_y2) gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->time_canvas), 0, 0, new_x2, new_y2); @@ -2991,8 +3029,9 @@ e_day_view_update_scroll_regions (EDayView *day_view) if (old_x2 != new_x2 || old_y2 != new_y2) { need_reshape = TRUE; - gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->main_canvas), - 0, 0, new_x2, new_y2); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (day_view->main_canvas), + 0, 0, new_x2, new_y2); } if (new_x2 <= main_canvas_allocation.width - 1) @@ -3093,19 +3132,21 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, day_view, (GdkEvent *) event, window, &event_x, &event_y)) return FALSE; - pos = e_day_view_convert_position_in_top_canvas (day_view, - event_x, event_y, - &day, &event_num); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + event_x, event_y, + &day, &event_num); if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) return FALSE; if (pos != E_CALENDAR_VIEW_POS_NONE) - return e_day_view_on_long_event_button_press (day_view, - event_num, - event, pos, - event_x, - event_y); + return e_day_view_on_long_event_button_press ( + day_view, + event_num, + event, pos, + event_x, + event_y); e_day_view_stop_editing_event (day_view); @@ -3233,18 +3274,20 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, return FALSE; /* Find out where the mouse is. */ - pos = e_day_view_convert_position_in_main_canvas (day_view, - event_x, event_y, - &day, &row, - &event_num); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + event_x, event_y, + &day, &row, + &event_num); if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) return FALSE; if (pos != E_CALENDAR_VIEW_POS_NONE) - return e_day_view_on_event_button_press (day_view, day, - event_num, event, pos, - event_x, event_y); + return e_day_view_on_event_button_press ( + day_view, day, + event_num, event, pos, + event_x, event_y); e_day_view_stop_editing_event (day_view); @@ -3393,13 +3436,15 @@ e_day_view_on_long_event_button_press (EDayView *day_view, { if (event->button == 1) { if (event->type == GDK_BUTTON_PRESS) { - e_day_view_on_long_event_click (day_view, event_num, - event, pos, - event_x, event_y); + e_day_view_on_long_event_click ( + day_view, event_num, + event, pos, + event_x, event_y); return TRUE; } else if (event->type == GDK_2BUTTON_PRESS) { - e_day_view_on_event_double_click (day_view, -1, - event_num); + e_day_view_on_event_double_click ( + day_view, -1, + event_num); g_signal_stop_emission_by_name (day_view->top_canvas, "button_press_event"); return TRUE; } @@ -3413,9 +3458,10 @@ e_day_view_on_long_event_button_press (EDayView *day_view, e_day_view_set_selected_time_range_in_top_visible (day_view, e->start, e->end); - e_day_view_on_event_right_click (day_view, event, - E_DAY_VIEW_LONG_EVENT, - event_num); + e_day_view_on_event_right_click ( + day_view, event, + E_DAY_VIEW_LONG_EVENT, + event_num); return TRUE; } @@ -3433,13 +3479,15 @@ e_day_view_on_event_button_press (EDayView *day_view, { if (event->button == 1) { if (event->type == GDK_BUTTON_PRESS) { - e_day_view_on_event_click (day_view, day, event_num, - event, pos, - event_x, event_y); + e_day_view_on_event_click ( + day_view, day, event_num, + event, pos, + event_x, event_y); return TRUE; } else if (event->type == GDK_2BUTTON_PRESS) { - e_day_view_on_event_double_click (day_view, day, - event_num); + e_day_view_on_event_double_click ( + day_view, day, + event_num); g_signal_stop_emission_by_name (day_view->main_canvas, "button_press_event"); return TRUE; @@ -3454,8 +3502,9 @@ e_day_view_on_event_button_press (EDayView *day_view, e_day_view_set_selected_time_range_visible (day_view, e->start, e->end); - e_day_view_on_event_right_click (day_view, event, - day, event_num); + e_day_view_on_event_right_click ( + day_view, event, + day, event_num); return TRUE; } @@ -3536,9 +3585,10 @@ e_day_view_on_long_event_click (EDayView *day_view, day_view->drag_event_x = event_x; day_view->drag_event_y = event_y; - e_day_view_convert_position_in_top_canvas (day_view, - event_x, event_y, - &day, NULL); + e_day_view_convert_position_in_top_canvas ( + day_view, + event_x, event_y, + &day, NULL); day_view->drag_event_offset = day - start_day; } } @@ -3625,10 +3675,11 @@ e_day_view_on_event_click (EDayView *day_view, day_view->drag_event_x = event_x; day_view->drag_event_y = event_y; - e_day_view_convert_position_in_main_canvas (day_view, - event_x, event_y, - &tmp_day, &row, - NULL); + e_day_view_convert_position_in_main_canvas ( + day_view, + event_x, event_y, + &tmp_day, &row, + NULL); start_row = event->start_minute / time_divisions; day_view->drag_event_offset = row - start_row; } @@ -3679,9 +3730,10 @@ static gboolean e_day_view_popup_menu (GtkWidget *widget) { EDayView *day_view = E_DAY_VIEW (widget); - e_day_view_show_popup_menu (day_view, NULL, - day_view->editing_event_day, - day_view->editing_event_num); + e_day_view_show_popup_menu ( + day_view, NULL, + day_view->editing_event_day, + day_view->editing_event_num); return TRUE; } @@ -3788,10 +3840,11 @@ e_day_view_on_top_canvas_button_release (GtkWidget *widget, gdk_pointer_ungrab (event->time); e_day_view_finish_long_event_resize (day_view); } else if (day_view->pressed_event_day != -1) { - e_day_view_start_editing_event (day_view, - day_view->pressed_event_day, - day_view->pressed_event_num, - NULL); + e_day_view_start_editing_event ( + day_view, + day_view->pressed_event_day, + day_view->pressed_event_num, + NULL); } day_view->pressed_event_day = -1; @@ -3817,7 +3870,8 @@ e_day_view_on_main_canvas_button_release (GtkWidget *widget, e_day_view_finish_resize (day_view); e_day_view_stop_auto_scroll (day_view); } else if (day_view->pressed_event_day != -1) { - e_day_view_start_editing_event (day_view, + e_day_view_start_editing_event ( + day_view, day_view->pressed_event_day, day_view->pressed_event_num, NULL); @@ -3876,9 +3930,10 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, canvas_x = event_x; canvas_y = event_y; - pos = e_day_view_convert_position_in_top_canvas (day_view, - canvas_x, canvas_y, - &day, &event_num); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + canvas_x, canvas_y, + &day, &event_num); if (event_num != -1) { if (!is_array_index_in_bounds (day_view->long_events, event_num)) return FALSE; @@ -3925,9 +3980,10 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, target_list = gtk_target_list_new ( target_table, G_N_ELEMENTS (target_table)); e_target_list_add_calendar_targets (target_list, 0); - gtk_drag_begin (widget, target_list, - GDK_ACTION_COPY | GDK_ACTION_MOVE, - 1, (GdkEvent *) mevent); + gtk_drag_begin ( + widget, target_list, + GDK_ACTION_COPY | GDK_ACTION_MOVE, + 1, (GdkEvent *) mevent); gtk_target_list_unref (target_list); } } else { @@ -3990,10 +4046,11 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, canvas_x = event_x; canvas_y = event_y; - pos = e_day_view_convert_position_in_main_canvas (day_view, - canvas_x, canvas_y, - &day, &row, - &event_num); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + canvas_x, canvas_y, + &day, &row, + &event_num); if (event_num != -1) { if (!is_array_index_in_bounds (day_view->events[day], event_num)) return FALSE; @@ -4005,15 +4062,17 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, if (day_view->selection_is_being_dragged) { if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) { e_day_view_update_selection (day_view, day, row); - e_day_view_check_auto_scroll (day_view, - event_x, event_y); + e_day_view_check_auto_scroll ( + day_view, + event_x, event_y); return TRUE; } } else if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) { if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) { e_day_view_update_resize (day_view, row); - e_day_view_check_auto_scroll (day_view, - event_x, event_y); + e_day_view_check_auto_scroll ( + day_view, + event_x, event_y); return TRUE; } } else if (day_view->pressed_event_day != -1 @@ -4037,9 +4096,10 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, target_list = gtk_target_list_new ( target_table, G_N_ELEMENTS (target_table)); e_target_list_add_calendar_targets (target_list, 0); - gtk_drag_begin (widget, target_list, - GDK_ACTION_COPY | GDK_ACTION_MOVE, - 1, (GdkEvent *) mevent); + gtk_drag_begin ( + widget, target_list, + GDK_ACTION_COPY | GDK_ACTION_MOVE, + 1, (GdkEvent *) mevent); gtk_target_list_unref (target_list); } } else { @@ -4617,10 +4677,12 @@ e_day_view_add_event (ESourceRegistry *registry, g_return_val_if_fail (start < add_event_data->day_view->upper, TRUE); g_return_val_if_fail (end > add_event_data->day_view->lower, TRUE); - start_tt = icaltime_from_timet_with_zone (start, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view))); - end_tt = icaltime_from_timet_with_zone (end, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view))); + start_tt = icaltime_from_timet_with_zone ( + start, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view))); + end_tt = icaltime_from_timet_with_zone ( + end, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view))); if (add_event_data->comp_data) { event.comp_data = g_object_ref (add_event_data->comp_data); @@ -4748,10 +4810,11 @@ e_day_view_check_layout (EDayView *day_view) } if (day_view->long_events_need_layout) { - e_day_view_layout_long_events (day_view->long_events, - day_view->days_shown, - day_view->day_starts, - &rows_in_top_display); + e_day_view_layout_long_events ( + day_view->long_events, + day_view->days_shown, + day_view->day_starts, + &rows_in_top_display); } if (day_view->long_events_need_layout @@ -4880,22 +4943,22 @@ e_day_view_reshape_long_event (EDayView *day_view, color = e_day_view_get_text_color (day_view, event, widget); event->canvas_item = - gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root), - e_text_get_type (), - "clip", TRUE, - "max_lines", 1, - "editable", TRUE, - "use_ellipsis", TRUE, - "fill_color_gdk", &color, - "im_context", E_CANVAS (day_view->top_canvas)->im_context, - NULL); + gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root), + e_text_get_type (), + "clip", TRUE, + "max_lines", 1, + "editable", TRUE, + "use_ellipsis", TRUE, + "fill_color_gdk", &color, + "im_context", E_CANVAS (day_view->top_canvas)->im_context, + NULL); g_object_set_data (G_OBJECT (event->canvas_item), "event-num", GINT_TO_POINTER (event_num)); g_object_set_data (G_OBJECT (event->canvas_item), "event-day", GINT_TO_POINTER (E_DAY_VIEW_LONG_EVENT)); g_signal_connect ( event->canvas_item, "event", G_CALLBACK (e_day_view_on_text_item_event), day_view); - g_signal_emit_by_name (G_OBJECT (day_view), - "event_added", event); + g_signal_emit_by_name (day_view, "event_added", event); e_day_view_update_long_event_label (day_view, event_num); } @@ -4947,12 +5010,14 @@ e_day_view_reshape_long_event (EDayView *day_view, } text_w = MAX (text_w, 0); - gnome_canvas_item_set (event->canvas_item, - "clip_width", (gdouble) text_w, - "clip_height", (gdouble) item_h, - NULL); - e_canvas_item_move_absolute (event->canvas_item, - text_x, item_y); + gnome_canvas_item_set ( + event->canvas_item, + "clip_width", (gdouble) text_w, + "clip_height", (gdouble) item_h, + NULL); + e_canvas_item_move_absolute ( + event->canvas_item, + text_x, item_y); g_object_unref (layout); g_object_unref (comp); @@ -5065,35 +5130,36 @@ e_day_view_reshape_day_event (EDayView *day_view, color = e_day_view_get_text_color (day_view, event, widget); - event->canvas_item = - gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root), - e_text_get_type (), - "line_wrap", TRUE, - "editable", TRUE, - "clip", TRUE, - "use_ellipsis", TRUE, - "fill_color_gdk", &color, - "im_context", E_CANVAS (day_view->main_canvas)->im_context, - NULL); + event->canvas_item = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root), + e_text_get_type (), + "line_wrap", TRUE, + "editable", TRUE, + "clip", TRUE, + "use_ellipsis", TRUE, + "fill_color_gdk", &color, + "im_context", E_CANVAS (day_view->main_canvas)->im_context, + NULL); g_object_set_data (G_OBJECT (event->canvas_item), "event-num", GINT_TO_POINTER (event_num)); g_object_set_data (G_OBJECT (event->canvas_item), "event-day", GINT_TO_POINTER (day)); g_signal_connect ( event->canvas_item, "event", G_CALLBACK (e_day_view_on_text_item_event), day_view); - g_signal_emit_by_name (G_OBJECT (day_view), - "event_added", event); + g_signal_emit_by_name (day_view, "event_added", event); e_day_view_update_event_label (day_view, day, event_num); } item_w = MAX (item_w, 0); - gnome_canvas_item_set (event->canvas_item, - "clip_width", (gdouble) item_w, - "clip_height", (gdouble) item_h, - "x_offset", (gdouble) icons_offset, - NULL); - e_canvas_item_move_absolute (event->canvas_item, - item_x, item_y); + gnome_canvas_item_set ( + event->canvas_item, + "clip_width", (gdouble) item_w, + "clip_height", (gdouble) item_h, + "x_offset", (gdouble) icons_offset, + NULL); + e_canvas_item_move_absolute ( + event->canvas_item, + item_x, item_y); } } @@ -5113,12 +5179,13 @@ e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view) * hide the resize bars. */ if (day != -1 && day == day_view->drag_event_day && event_num == day_view->drag_event_num) { - g_object_get (day_view->drag_rect_item, - "x1", &x, - "y1", &y, - "x2", &w, - "y2", &h, - NULL); + g_object_get ( + day_view->drag_rect_item, + "x1", &x, + "y1", &y, + "x2", &w, + "y2", &h, + NULL); w -= x; x++; h -= y; @@ -5144,20 +5211,22 @@ e_day_view_ensure_events_sorted (EDayView *day_view) /* Sort the long events. */ if (!day_view->long_events_sorted) { - qsort (day_view->long_events->data, - day_view->long_events->len, - sizeof (EDayViewEvent), - e_day_view_event_sort_func); + qsort ( + day_view->long_events->data, + day_view->long_events->len, + sizeof (EDayViewEvent), + e_day_view_event_sort_func); day_view->long_events_sorted = TRUE; } /* Sort the events for each day. */ for (day = 0; day < day_view->days_shown; day++) { if (!day_view->events_sorted[day]) { - qsort (day_view->events[day]->data, - day_view->events[day]->len, - sizeof (EDayViewEvent), - e_day_view_event_sort_func); + qsort ( + day_view->events[day]->data, + day_view->events[day]->len, + sizeof (EDayViewEvent), + e_day_view_event_sort_func); day_view->events_sorted[day] = TRUE; } } @@ -5221,11 +5290,13 @@ e_day_view_add_new_event_in_selected_range (EDayView *day_view, e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend); - start_tt = icaltime_from_timet_with_zone (dtstart, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + start_tt = icaltime_from_timet_with_zone ( + dtstart, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - end_tt = icaltime_from_timet_with_zone (dtend, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + end_tt = icaltime_from_timet_with_zone ( + dtend, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); if (day_view->selection_in_top_canvas) { start_dt.tzid = NULL; @@ -5440,9 +5511,10 @@ e_day_view_goto_start_of_work_day (EDayView *day_view) day_view, work_day_start_hour, work_day_start_minute); day_view->selection_end_row = day_view->selection_start_row; - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_row); + e_day_view_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); e_day_view_update_calendar_selection_time (day_view); @@ -5471,9 +5543,10 @@ e_day_view_goto_end_of_work_day (EDayView *day_view) 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, - day_view->selection_start_row, - day_view->selection_end_row); + e_day_view_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); e_day_view_update_calendar_selection_time (day_view); @@ -5510,9 +5583,10 @@ e_day_view_change_duration_to_start_of_work_day (EDayView *day_view) else day_view->selection_start_row = work_start_row; } - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_row); + e_day_view_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); e_day_view_update_calendar_selection_time (day_view); @@ -5551,9 +5625,10 @@ e_day_view_change_duration_to_end_of_work_day (EDayView *day_view) } } - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_row); + e_day_view_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); e_day_view_update_calendar_selection_time (day_view); @@ -5621,11 +5696,13 @@ e_day_view_focus (GtkWidget *widget, new_event_num, &start_row, &end_row)) /* ensure the event to be seen */ - e_day_view_ensure_rows_visible (day_view, - start_row, end_row); + e_day_view_ensure_rows_visible ( + day_view, + start_row, end_row); } - e_day_view_start_editing_event (day_view, new_day, - new_event_num, NULL); + e_day_view_start_editing_event ( + day_view, new_day, + new_event_num, NULL); return TRUE; } @@ -5777,9 +5854,10 @@ e_day_view_get_next_tab_event (EDayView *day_view, /* no long event, set to first event if there is */ - e_day_view_get_extreme_event (day_view, 0, - days_shown - 1, TRUE, - day_out, event_num_out); + e_day_view_get_extreme_event ( + day_view, 0, + days_shown - 1, TRUE, + day_out, event_num_out); /* go to event if found, or day view widget */ return TRUE; @@ -5792,9 +5870,10 @@ e_day_view_get_next_tab_event (EDayView *day_view, /* no event, set to last long event if there is */ - e_day_view_get_extreme_long_event (day_view, FALSE, - day_out, - event_num_out); + e_day_view_get_extreme_long_event ( + day_view, FALSE, + day_out, + event_num_out); /* go to long event if found, or day view widget */ @@ -5810,9 +5889,10 @@ e_day_view_get_next_tab_event (EDayView *day_view, /* go forward from the last long event */ else if ((new_day == E_DAY_VIEW_LONG_EVENT) && (new_event_num >= day_view->long_events->len)) { - e_day_view_get_extreme_event (day_view, 0, - days_shown - 1, TRUE, - day_out, event_num_out); + e_day_view_get_extreme_event ( + day_view, 0, + days_shown - 1, TRUE, + day_out, event_num_out); /* go to the next main item event if found or day view widget */ return TRUE; @@ -5828,8 +5908,9 @@ e_day_view_get_next_tab_event (EDayView *day_view, return TRUE; /* try to find a long event */ - e_day_view_get_extreme_long_event (day_view, FALSE, - day_out, event_num_out); + e_day_view_get_extreme_long_event ( + day_view, FALSE, + day_out, event_num_out); /* go to a long event if found, or day view widget */ return TRUE; @@ -5839,9 +5920,10 @@ e_day_view_get_next_tab_event (EDayView *day_view, (new_event_num >= day_view->events[new_day]->len)) { /* try to find a event from the next day in days shown */ - e_day_view_get_extreme_event (day_view, (new_day + 1), - days_shown - 1, TRUE, - day_out, event_num_out); + e_day_view_get_extreme_event ( + day_view, (new_day + 1), + days_shown - 1, TRUE, + day_out, event_num_out); /* go to a event found, or day view widget */ return TRUE; @@ -5954,9 +6036,10 @@ e_day_view_cursor_key_up (EDayView *day_view, day_view->selection_end_row = day_view->selection_start_row; if (!day_view->selection_in_top_canvas) - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_row); + e_day_view_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); g_signal_emit_by_name (day_view, "selected_time_changed"); e_day_view_update_calendar_selection_time (day_view); @@ -5987,7 +6070,8 @@ e_day_view_cursor_key_down (EDayView *day_view, day_view->selection_end_row = day_view->selection_start_row; if (!day_view->selection_in_top_canvas) - e_day_view_ensure_rows_visible (day_view, + e_day_view_ensure_rows_visible ( + day_view, day_view->selection_start_row, day_view->selection_end_row); @@ -6177,23 +6261,26 @@ e_day_view_start_editing_event (EDayView *day_view, gchar *initial_text; initial_text = e_utf8_from_gtk_event_key (GTK_WIDGET (day_view), key_event->keyval, key_event->string); - gnome_canvas_item_set (event->canvas_item, - "text", initial_text, - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "text", initial_text, + NULL); if (initial_text) g_free (initial_text); } } /* Try to move the cursor to the end of the text. */ - g_object_get (event->canvas_item, - "event_processor", &event_processor, - NULL); + g_object_get ( + event->canvas_item, + "event_processor", &event_processor, + NULL); if (event_processor) { command.action = E_TEP_MOVE; command.position = E_TEP_END_OF_BUFFER; - g_signal_emit_by_name (event_processor, - "command", &command); + g_signal_emit_by_name ( + event_processor, + "command", &command); } } @@ -6245,9 +6332,10 @@ 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 (event->canvas_item, - "text", summary ? summary : "", - NULL); + g_object_set ( + event->canvas_item, + "text", summary ? summary : "", + NULL); /* Stop editing */ e_day_view_stop_editing_event (day_view); @@ -6408,16 +6496,18 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, } /* Find out where the mouse is. */ if (main_canvas) { - pos = e_day_view_convert_position_in_main_canvas (day_view, - event_x, event_y, - &day, &row, - &event_num); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + event_x, event_y, + &day, &row, + &event_num); } else { gint tmp; - pos = e_day_view_convert_position_in_top_canvas (day_view, - event_x, event_y, - &tmp, &event_num); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + event_x, event_y, + &tmp, &event_num); day = E_DAY_VIEW_LONG_EVENT; } @@ -6755,8 +6845,9 @@ e_day_view_on_editing_started (EDayView *day_view, return; #if 0 - g_print ("In e_day_view_on_editing_started Day:%i Event:%i\n", - day, event_num); + g_print ( + "In e_day_view_on_editing_started Day:%i Event:%i\n", + day, event_num); #endif /* FIXME: This is a temporary workaround for a bug which seems to stop @@ -6823,8 +6914,9 @@ e_day_view_on_editing_stopped (EDayView *day_view, event_num = day_view->editing_event_num; #if 0 - g_print ("In e_day_view_on_editing_stopped Day:%i Event:%i\n", - day, event_num); + g_print ( + "In e_day_view_on_editing_stopped Day:%i Event:%i\n", + day, event_num); #endif /* If no item is being edited, just return. */ @@ -6857,9 +6949,10 @@ 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 (event->canvas_item, - "text", &text, - NULL); + g_object_get ( + event->canvas_item, + "text", &text, + NULL); g_return_if_fail (text != NULL); comp = e_cal_component_new (); @@ -6887,8 +6980,9 @@ e_day_view_on_editing_stopped (EDayView *day_view, if (day == E_DAY_VIEW_LONG_EVENT) e_day_view_reshape_long_event (day_view, event_num); else - e_day_view_update_event_label (day_view, day, - event_num); + e_day_view_update_event_label ( + day_view, day, + event_num); } else if (summary.value || !string_is_empty (text)) { icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp); @@ -7028,8 +7122,9 @@ e_day_view_convert_grid_position_to_time (EDayView *day_view, return day_view->day_starts[col + 1]; /* Create an icaltimetype and convert to a time_t. */ - tt = icaltime_from_timet_with_zone (day_view->day_starts[col], - FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + tt = icaltime_from_timet_with_zone ( + day_view->day_starts[col], + FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); tt.hour = minutes / 60; tt.minute = minutes % 60; tt.second = 0; @@ -7091,8 +7186,9 @@ e_day_view_check_auto_scroll (EDayView *day_view, GtkAllocation allocation; gint scroll_x, scroll_y; - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (day_view->main_canvas), + &scroll_x, &scroll_y); event_x -= scroll_x; event_y -= scroll_y; @@ -7151,8 +7247,9 @@ e_day_view_auto_scroll_handler (gpointer data) return TRUE; } - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (day_view->main_canvas), + &scroll_x, &scroll_y); scrollable = GTK_SCROLLABLE (day_view->main_canvas); adjustment = gtk_scrollable_get_vadjustment (scrollable); @@ -7164,14 +7261,16 @@ e_day_view_auto_scroll_handler (gpointer data) if (day_view->auto_scroll_up) new_scroll_y = MAX (scroll_y - step_increment, 0); else - new_scroll_y = MIN (scroll_y + step_increment, - upper - page_size); + new_scroll_y = MIN ( + scroll_y + step_increment, + upper - page_size); if (new_scroll_y != scroll_y) { /* NOTE: This reduces flicker, but only works if we don't use * canvas items which have X windows. */ - gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas), - scroll_x, new_scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (day_view->main_canvas), + scroll_x, new_scroll_y); } canvas_x = day_view->last_mouse_x + scroll_x; @@ -7184,9 +7283,10 @@ e_day_view_auto_scroll_handler (gpointer data) canvas_x = 0; /* Update the selection/resize/drag if necessary. */ - pos = e_day_view_convert_position_in_main_canvas (day_view, - canvas_x, canvas_y, - &day, &row, NULL); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + canvas_x, canvas_y, + &day, &row, NULL); if (day_view->last_mouse_x == -1) day = -1; @@ -7532,8 +7632,9 @@ e_day_view_on_top_canvas_drag_motion (GtkWidget *widget, { gint scroll_x, scroll_y; - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (widget), + &scroll_x, &scroll_y); day_view->drag_event_x = x + scroll_x; day_view->drag_event_y = y + scroll_y; @@ -7552,8 +7653,9 @@ e_day_view_reshape_top_canvas_drag_item (EDayView *day_view) * 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, - &day, NULL); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, x, y, + &day, NULL); /* This shouldn't really happen in a drag. */ if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) return; @@ -7621,20 +7723,23 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, item_h = day_view->top_row_height - E_DAY_VIEW_TOP_CANVAS_Y_GAP; /* Set the positions of the event & associated items. */ - gnome_canvas_item_set (day_view->drag_long_event_rect_item, - "x1", item_x, - "y1", item_y, - "x2", item_x + item_w - 1, - "y2", item_y + item_h - 1, - NULL); - - gnome_canvas_item_set (day_view->drag_long_event_item, - "clip_width", item_w - (E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD) * 2, - "clip_height", item_h - (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2, - NULL); - e_canvas_item_move_absolute (day_view->drag_long_event_item, - item_x + E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD, - item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD); + gnome_canvas_item_set ( + day_view->drag_long_event_rect_item, + "x1", item_x, + "y1", item_y, + "x2", item_x + item_w - 1, + "y2", item_y + item_h - 1, + NULL); + + gnome_canvas_item_set ( + day_view->drag_long_event_item, + "clip_width", item_w - (E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD) * 2, + "clip_height", item_h - (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2, + NULL); + e_canvas_item_move_absolute ( + day_view->drag_long_event_item, + item_x + E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD, + item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD); if (!(day_view->drag_long_event_rect_item->flags & GNOME_CANVAS_ITEM_VISIBLE)) { gnome_canvas_item_raise_to_top (day_view->drag_long_event_rect_item); @@ -7654,9 +7759,10 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, text = NULL; } - gnome_canvas_item_set (day_view->drag_long_event_item, - "text", text ? text : "", - NULL); + gnome_canvas_item_set ( + day_view->drag_long_event_item, + "text", text ? text : "", + NULL); gnome_canvas_item_raise_to_top (day_view->drag_long_event_item); gnome_canvas_item_show (day_view->drag_long_event_item); @@ -7674,8 +7780,9 @@ e_day_view_on_main_canvas_drag_motion (GtkWidget *widget, { gint scroll_x, scroll_y; - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (widget), + &scroll_x, &scroll_y); day_view->drag_event_x = x + scroll_x; day_view->drag_event_y = y + scroll_y; @@ -7698,8 +7805,9 @@ e_day_view_reshape_main_canvas_drag_item (EDayView *day_view) * 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, - &day, &row, NULL); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, x, y, + &day, &row, NULL); /* This shouldn't really happen in a drag. */ if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) return; @@ -7779,27 +7887,31 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, item_h = num_rows * day_view->row_height; /* Set the positions of the event & associated items. */ - gnome_canvas_item_set (day_view->drag_rect_item, - "x1", item_x + E_DAY_VIEW_BAR_WIDTH - 1, - "y1", item_y, - "x2", item_x + item_w - 1, - "y2", item_y + item_h - 1, - NULL); - - gnome_canvas_item_set (day_view->drag_bar_item, - "x1", item_x, - "y1", item_y, - "x2", item_x + E_DAY_VIEW_BAR_WIDTH - 1, - "y2", item_y + item_h - 1, - NULL); - - gnome_canvas_item_set (day_view->drag_item, - "clip_width", item_w - E_DAY_VIEW_BAR_WIDTH - E_DAY_VIEW_EVENT_X_PAD * 2, - "clip_height", item_h - (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2, - NULL); - e_canvas_item_move_absolute (day_view->drag_item, - item_x + E_DAY_VIEW_BAR_WIDTH + E_DAY_VIEW_EVENT_X_PAD, - item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD); + gnome_canvas_item_set ( + day_view->drag_rect_item, + "x1", item_x + E_DAY_VIEW_BAR_WIDTH - 1, + "y1", item_y, + "x2", item_x + item_w - 1, + "y2", item_y + item_h - 1, + NULL); + + gnome_canvas_item_set ( + day_view->drag_bar_item, + "x1", item_x, + "y1", item_y, + "x2", item_x + E_DAY_VIEW_BAR_WIDTH - 1, + "y2", item_y + item_h - 1, + NULL); + + gnome_canvas_item_set ( + day_view->drag_item, + "clip_width", item_w - E_DAY_VIEW_BAR_WIDTH - E_DAY_VIEW_EVENT_X_PAD * 2, + "clip_height", item_h - (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2, + NULL); + e_canvas_item_move_absolute ( + day_view->drag_item, + item_x + E_DAY_VIEW_BAR_WIDTH + E_DAY_VIEW_EVENT_X_PAD, + item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD); if (!(day_view->drag_bar_item->flags & GNOME_CANVAS_ITEM_VISIBLE)) { gnome_canvas_item_raise_to_top (day_view->drag_bar_item); @@ -7824,9 +7936,10 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, text = NULL; } - gnome_canvas_item_set (day_view->drag_item, - "text", text ? text : "", - NULL); + gnome_canvas_item_set ( + day_view->drag_item, + "text", text ? text : "", + NULL); gnome_canvas_item_raise_to_top (day_view->drag_item); gnome_canvas_item_show (day_view->drag_item); @@ -8051,9 +8164,10 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, if (length >= 0 && format == 8 && day_view->drag_event_day != -1) { /* We are dragging in the same window */ - pos = e_day_view_convert_position_in_top_canvas (day_view, - x, y, &day, - NULL); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + x, y, &day, + NULL); if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) { CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; @@ -8075,11 +8189,12 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, day -= day_view->drag_event_offset; day = MAX (day, 0); - e_day_view_find_long_event_days (event, - day_view->days_shown, - day_view->day_starts, - &start_day, - &end_day); + e_day_view_find_long_event_days ( + event, + day_view->days_shown, + day_view->day_starts, + &start_day, + &end_day); num_days = end_day - start_day + 1; /* Make sure we don't go off the screen. */ day = MIN (day, day_view->days_shown - num_days); @@ -8122,8 +8237,9 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, date.value = &itt; dt = day_view->day_starts[day] + start_offset * 60; - itt = icaltime_from_timet_with_zone (dt, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + itt = icaltime_from_timet_with_zone ( + dt, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); if (all_day_event) { itt.is_date = TRUE; date.tzid = NULL; @@ -8138,8 +8254,9 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, dt = day_view->day_starts[day + num_days]; else dt = day_view->day_starts[day + num_days - 1] + end_offset * 60; - itt = icaltime_from_timet_with_zone (dt, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + itt = icaltime_from_timet_with_zone ( + dt, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); if (all_day_event) { itt.is_date = TRUE; date.tzid = NULL; @@ -8199,9 +8316,10 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, time_t dtstart; icaltimezone *default_zone; - pos = e_day_view_convert_position_in_top_canvas (day_view, - x, y, &day, - NULL); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + x, y, &day, + NULL); if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) goto error; @@ -8226,8 +8344,9 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, while (subcomp) { child_kind = icalcomponent_isa (subcomp); if (child_kind == ICAL_VEVENT_COMPONENT) - e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart, - default_zone, subcomp, TRUE); + e_calendar_view_add_event ( + E_CALENDAR_VIEW (day_view), client, dtstart, + default_zone, subcomp, TRUE); else if (child_kind == ICAL_VTIMEZONE_COMPONENT) { icaltimezone *zone; @@ -8300,8 +8419,9 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, client = e_cal_model_get_default_client (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view))); - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (widget), + &scroll_x, &scroll_y); x += scroll_x; y += scroll_y; @@ -8309,9 +8429,10 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, if (length >= 0 && format == 8 && (day_view->drag_event_day != -1)) { /* We are dragging in the same window */ - pos = e_day_view_convert_position_in_main_canvas (day_view, - x, y, &day, - &row, NULL); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + x, y, &day, + &row, NULL); if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) { CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; @@ -8433,9 +8554,10 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, time_t dtstart; icaltimezone *default_zone; - pos = e_day_view_convert_position_in_main_canvas (day_view, - x, y, &day, - &row, NULL); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + x, y, &day, + &row, NULL); if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) goto error; @@ -8460,8 +8582,9 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, while (subcomp) { child_kind = icalcomponent_isa (subcomp); if (child_kind == ICAL_VEVENT_COMPONENT) - e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart, - default_zone, subcomp, FALSE); + e_calendar_view_add_event ( + E_CALENDAR_VIEW (day_view), client, dtstart, + default_zone, subcomp, FALSE); else if (child_kind == ICAL_VTIMEZONE_COMPONENT) { icaltimezone *zone; diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c index a7c4fff5d7..1059537b84 100644 --- a/calendar/gui/e-meeting-attendee.c +++ b/calendar/gui/e-meeting-attendee.c @@ -94,7 +94,7 @@ string_is_set (gchar *string) static void notify_changed (EMeetingAttendee *ia) { - g_signal_emit_by_name (G_OBJECT (ia), "changed"); + g_signal_emit_by_name (ia, "changed"); } static void @@ -657,8 +657,9 @@ compare_times (EMeetingTime *time1, { gint day_comparison; - day_comparison = g_date_compare (&time1->date, - &time2->date); + day_comparison = g_date_compare ( + &time1->date, + &time2->date); if (day_comparison != 0) return day_comparison; @@ -698,9 +699,10 @@ ensure_periods_sorted (EMeetingAttendee *ia) if (priv->busy_periods_sorted) return; - qsort (priv->busy_periods->data, priv->busy_periods->len, - sizeof (EMeetingFreeBusyPeriod), - compare_period_starts); + qsort ( + priv->busy_periods->data, priv->busy_periods->len, + sizeof (EMeetingFreeBusyPeriod), + compare_period_starts); priv->busy_periods_sorted = TRUE; } @@ -981,8 +983,9 @@ e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia, return FALSE; g_date_clear (&priv->busy_periods_start.date, 1); - g_date_set_dmy (&priv->busy_periods_start.date, - start_day, start_month, start_year); + g_date_set_dmy ( + &priv->busy_periods_start.date, + start_day, start_month, start_year); priv->busy_periods_start.hour = start_hour; priv->busy_periods_start.minute = start_minute; @@ -1014,8 +1017,9 @@ e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia, return FALSE; g_date_clear (&priv->busy_periods_end.date, 1); - g_date_set_dmy (&priv->busy_periods_end.date, - end_day, end_month, end_year); + g_date_set_dmy ( + &priv->busy_periods_end.date, + end_day, end_month, end_year); priv->busy_periods_end.hour = end_hour; priv->busy_periods_end.minute = end_minute; diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 19358ef02a..59ffa099e0 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -272,8 +272,9 @@ e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, name_selector_model = e_name_selector_peek_model (priv->name_selector); i = get_index_from_role (e_meeting_attendee_get_role (ma)); - e_name_selector_model_peek_section (name_selector_model, sections[i], - NULL, &destination_store); + e_name_selector_model_peek_section ( + name_selector_model, sections[i], + NULL, &destination_store); des = e_destination_new (); e_destination_set_email (des, itip_strip_mailto (e_meeting_attendee_get_address (ma))); e_destination_set_name (des, e_meeting_attendee_get_cn (ma)); @@ -296,8 +297,9 @@ e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, name_selector_model = e_name_selector_peek_model (priv->name_selector); i = get_index_from_role (e_meeting_attendee_get_role (ma)); - e_name_selector_model_peek_section (name_selector_model, sections[i], - NULL, &destination_store); + e_name_selector_model_peek_section ( + name_selector_model, sections[i], + NULL, &destination_store); destinations = e_destination_store_list_destinations (destination_store); madd = itip_strip_mailto (e_meeting_attendee_get_address (ma)); @@ -344,8 +346,9 @@ e_meeting_list_view_remove_all_attendees_from_name_selector (EMeetingListView *v EDestinationStore *destination_store = NULL; GList *destinations = NULL, *l = NULL; - e_name_selector_model_peek_section (name_selector_model, sections[i], - NULL, &destination_store); + e_name_selector_model_peek_section ( + name_selector_model, sections[i], + NULL, &destination_store); if (!destination_store) { g_warning ("destination store is NULL\n"); continue; @@ -416,7 +419,7 @@ attendee_edited_cb (GtkCellRenderer *renderer, e_meeting_attendee_set_delfrom (attendee, (gchar *) e_meeting_attendee_get_delfrom (existing_attendee)); } e_meeting_list_view_add_attendee_to_name_selector (E_MEETING_LIST_VIEW (view), attendee); - g_signal_emit_by_name (G_OBJECT (view), "attendee_added", (gpointer) attendee); + g_signal_emit_by_name (view, "attendee_added", (gpointer) attendee); } if (existing_attendee && can_remove) { @@ -461,7 +464,7 @@ attendee_edited_cb (GtkCellRenderer *renderer, if (address_changed) e_meeting_attendee_set_status (attendee, ICAL_PARTSTAT_NEEDSACTION); - g_signal_emit_by_name (G_OBJECT (view), "attendee_added", (gpointer) attendee); + g_signal_emit_by_name (view, "attendee_added", (gpointer) attendee); } } else if (existing_attendee) { const gchar *address = e_meeting_attendee_get_address (existing_attendee); @@ -585,7 +588,8 @@ create_combo_cell_renderer (GList *strings) renderer = gtk_cell_renderer_combo_new (); - g_object_set (G_OBJECT (renderer), + g_object_set ( + G_OBJECT (renderer), "has-entry", FALSE, "editable", TRUE, "model", GTK_TREE_MODEL (store), @@ -616,12 +620,13 @@ build_table (EMeetingListView *lview) renderer = e_select_names_renderer_new (); 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, - "name", E_MEETING_STORE_CN_COL, - "email", E_MEETING_STORE_ADDRESS_COL, - "underline", E_MEETING_STORE_ATTENDEE_UNDERLINE_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("Attendee "), renderer, + "text", E_MEETING_STORE_ATTENDEE_COL, + "name", E_MEETING_STORE_CN_COL, + "email", E_MEETING_STORE_ADDRESS_COL, + "underline", E_MEETING_STORE_ATTENDEE_UNDERLINE_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -641,9 +646,10 @@ build_table (EMeetingListView *lview) g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_ATTENDEE_COL), renderer); renderer = create_combo_cell_renderer (get_type_strings ()); - pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Type"), renderer, - "text", E_MEETING_STORE_TYPE_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("Type"), renderer, + "text", E_MEETING_STORE_TYPE_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -654,9 +660,10 @@ build_table (EMeetingListView *lview) g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_TYPE_COL), renderer); renderer = create_combo_cell_renderer (get_role_strings ()); - pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Role"), renderer, - "text", E_MEETING_STORE_ROLE_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("Role"), renderer, + "text", E_MEETING_STORE_ROLE_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -668,9 +675,10 @@ build_table (EMeetingListView *lview) renderer = create_combo_cell_renderer (get_rsvp_strings ()); /* To translators: RSVP means "please reply" */ - pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("RSVP"), renderer, - "text", E_MEETING_STORE_RSVP_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("RSVP"), renderer, + "text", E_MEETING_STORE_RSVP_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -681,9 +689,10 @@ build_table (EMeetingListView *lview) g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_RSVP_COL), renderer); renderer = create_combo_cell_renderer (get_status_strings ()); - pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Status"), renderer, - "text", E_MEETING_STORE_STATUS_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("Status"), renderer, + "text", E_MEETING_STORE_STATUS_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -903,8 +912,9 @@ process_section (EMeetingListView *view, EContact *n_con = NULL; gchar *query; - query = g_strdup_printf ("(is \"full_name\" \"%s\")", - (gchar *) e_contact_get (contact, E_CONTACT_FULL_NAME)); + query = g_strdup_printf ( + "(is \"full_name\" \"%s\")", + (gchar *) e_contact_get (contact, E_CONTACT_FULL_NAME)); if (!e_book_client_get_contacts_sync (book_client, query, &contacts, NULL, NULL)) { g_warning ("Could not get contact from the book \n"); @@ -1010,8 +1020,9 @@ name_selector_dialog_close_cb (ENameSelectorDialog *dialog, EDestinationStore *destination_store; GList *destinations; - e_name_selector_model_peek_section (name_selector_model, sections[i], - NULL, &destination_store); + e_name_selector_model_peek_section ( + name_selector_model, sections[i], + NULL, &destination_store); if (!destination_store) { g_warning ("destination store is NULL\n"); continue; @@ -1045,8 +1056,9 @@ name_selector_dialog_close_cb (ENameSelectorDialog *dialog, void e_meeting_list_view_invite_others_dialog (EMeetingListView *view) { - e_name_selector_show_dialog (view->priv->name_selector, - GTK_WIDGET (view)); + e_name_selector_show_dialog ( + view->priv->name_selector, + GTK_WIDGET (view)); } void diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index c7f5fde71a..d215b2decc 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -1358,12 +1358,13 @@ process_free_busy_comp (EMeetingAttendee *attendee, else ds_zone = icaltimezone_get_utc_timezone (); icaltimezone_convert_time (&dtstart, ds_zone, zone); - e_meeting_attendee_set_start_busy_range (attendee, - dtstart.year, - dtstart.month, - dtstart.day, - dtstart.hour, - dtstart.minute); + e_meeting_attendee_set_start_busy_range ( + attendee, + dtstart.year, + dtstart.month, + dtstart.day, + dtstart.hour, + dtstart.minute); } ip = icalcomponent_get_first_property (fb_comp, ICAL_DTEND_PROPERTY); @@ -1377,12 +1378,13 @@ process_free_busy_comp (EMeetingAttendee *attendee, else de_zone = icaltimezone_get_utc_timezone (); icaltimezone_convert_time (&dtend, de_zone, zone); - e_meeting_attendee_set_end_busy_range (attendee, - dtend.year, - dtend.month, - dtend.day, - dtend.hour, - dtend.minute); + e_meeting_attendee_set_end_busy_range ( + attendee, + dtend.year, + dtend.month, + dtend.day, + dtend.hour, + dtend.minute); } ip = icalcomponent_get_first_property (fb_comp, ICAL_FREEBUSY_PROPERTY); @@ -1423,18 +1425,19 @@ process_free_busy_comp (EMeetingAttendee *attendee, icaltimezone_convert_time (&fb.start, utc_zone, zone); icaltimezone_convert_time (&fb.end, utc_zone, zone); - e_meeting_attendee_add_busy_period (attendee, - fb.start.year, - fb.start.month, - fb.start.day, - fb.start.hour, - fb.start.minute, - fb.end.year, - fb.end.month, - fb.end.day, - fb.end.hour, - fb.end.minute, - busy_type); + e_meeting_attendee_add_busy_period ( + attendee, + fb.start.year, + fb.start.month, + fb.start.day, + fb.start.hour, + fb.start.minute, + fb.end.year, + fb.end.month, + fb.end.day, + fb.end.hour, + fb.end.minute, + busy_type); } ip = icalcomponent_get_next_property (fb_comp, ICAL_FREEBUSY_PROPERTY); @@ -1955,9 +1958,10 @@ redirect_handler (SoupMessage *msg, new_uri = soup_uri_new_with_base (soup_message_get_uri (msg), new_loc); if (!new_uri) { - soup_message_set_status_full (msg, - SOUP_STATUS_MALFORMED, - "Invalid Redirect URL"); + soup_message_set_status_full ( + msg, + SOUP_STATUS_MALFORMED, + "Invalid Redirect URL"); return; } diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c index 24a64f5799..52558e4f31 100644 --- a/calendar/gui/e-meeting-time-sel-item.c +++ b/calendar/gui/e-meeting-time-sel-item.c @@ -250,17 +250,20 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, ? TRUE : FALSE; /* Calculate the first and last visible days and positions. */ - e_meeting_time_selector_calculate_day_and_position (mts, x, - &date, &day_x); - e_meeting_time_selector_calculate_day_and_position (mts, x + width, - &last_date, NULL); + e_meeting_time_selector_calculate_day_and_position ( + mts, x, + &date, &day_x); + e_meeting_time_selector_calculate_day_and_position ( + mts, x + width, + &last_date, NULL); /* For the top display draw the 'All Attendees' row background. */ cairo_save (cr); if (is_display_top) { gdk_cairo_set_source_color (cr, &mts->all_attendees_bg_color); - cairo_rectangle (cr, 0, mts->row_height * 2 - y, - width, mts->row_height); + cairo_rectangle ( + cr, 0, mts->row_height * 2 - y, + width, mts->row_height); cairo_fill (cr); } else { gdk_cairo_set_source_color (cr, &mts->bg_color); @@ -279,12 +282,14 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_save (cr); gdk_cairo_set_source_color (cr, &mts->meeting_time_bg_color); if (is_display_top) { - cairo_rectangle (cr, meeting_start_x + 1 - x, mts->row_height * 2 - y, - meeting_end_x - meeting_start_x - 2, mts->row_height); + cairo_rectangle ( + cr, meeting_start_x + 1 - x, mts->row_height * 2 - y, + meeting_end_x - meeting_start_x - 2, mts->row_height); cairo_fill (cr); } else { - cairo_rectangle (cr, meeting_start_x + 1 - x, 0, - meeting_end_x - meeting_start_x - 2, height); + cairo_rectangle ( + cr, meeting_start_x + 1 - x, 0, + meeting_end_x - meeting_start_x - 2, height); cairo_fill (cr); } cairo_restore (cr); @@ -364,15 +369,17 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, if ((meeting_start_x + 2 >= x) && (meeting_start_x - 2 < x + width)) { - cairo_rectangle (cr, meeting_start_x - 2 - x, bar_y, - 5, bar_height); + cairo_rectangle ( + cr, meeting_start_x - 2 - x, bar_y, + 5, bar_height); cairo_fill (cr); } if ((meeting_end_x + 2 >= x) && (meeting_end_x - 2 < x + width)) { - cairo_rectangle (cr, meeting_end_x - 2 - x, bar_y, - 5, bar_height); + cairo_rectangle ( + cr, meeting_end_x - 2 - x, bar_y, + 5, bar_height); cairo_fill (cr); } @@ -587,9 +594,10 @@ e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, } cairo_stroke (cr); - cairo_rectangle (cr, - x + mts->day_width - 2, 0, - 2, unused_y); + cairo_rectangle ( + cr, + x + mts->day_width - 2, 0, + 2, unused_y); cairo_fill (cr); } @@ -604,9 +612,10 @@ e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, } cairo_stroke (cr); - cairo_rectangle (cr, - x + mts->day_width - 2, unused_y, - 2, height - unused_y); + cairo_rectangle ( + cr, + x + mts->day_width - 2, unused_y, + 2, height - unused_y); cairo_fill (cr); } @@ -755,11 +764,13 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt * 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, - x2 - x1, mts->row_height - 5); + cairo_rectangle ( + cr, x1 - x, y + 2, + x2 - x1, mts->row_height - 5); #else - cairo_rectangle (cr, x1 - x, y + 3, - x2 - x1, mts->row_height - 5); + cairo_rectangle ( + cr, x1 - x, y + 3, + x2 - x1, mts->row_height - 5); #endif cairo_fill (cr); } @@ -790,14 +801,17 @@ e_meeting_time_selector_item_event (GnomeCanvasItem *item, switch (event->type) { case GDK_BUTTON_PRESS: - return e_meeting_time_selector_item_button_press (mts_item, - event); + return e_meeting_time_selector_item_button_press ( + mts_item, + event); case GDK_BUTTON_RELEASE: - return e_meeting_time_selector_item_button_release (mts_item, - event); + return e_meeting_time_selector_item_button_release ( + mts_item, + event); case GDK_MOTION_NOTIFY: - return e_meeting_time_selector_item_motion_notify (mts_item, - event); + return e_meeting_time_selector_item_motion_notify ( + mts_item, + event); default: break; } @@ -825,8 +839,9 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, y = (gint) event->button.y; /* Check if we are starting a drag of the vertical meeting time bars.*/ - position = e_meeting_time_selector_item_get_drag_position (mts_item, - x, y); + position = e_meeting_time_selector_item_get_drag_position ( + mts_item, + x, y); if (position != E_MEETING_TIME_SELECTOR_POS_NONE) { if (gnome_canvas_item_grab (GNOME_CANVAS_ITEM (mts_item), GDK_POINTER_MOTION_MASK @@ -851,17 +866,18 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, gint hdiff, mdiff; GDate asdate, aedate; - e_meeting_time_selector_get_meeting_time (mts_item->mts, - &astart_year, - &astart_month, - &astart_day, - &astart_hour, - &astart_minute, - &aend_year, - &aend_month, - &aend_day, - &aend_hour, - &aend_minute); + e_meeting_time_selector_get_meeting_time ( + mts_item->mts, + &astart_year, + &astart_month, + &astart_day, + &astart_hour, + &astart_minute, + &aend_year, + &aend_month, + &aend_day, + &aend_hour, + &aend_minute); if (mts->zoomed_out) start_time.minute = 0; else @@ -901,17 +917,18 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, e_meeting_time_selector_fix_time_overflows (&end_time); /* Set the new meeting time. */ - e_meeting_time_selector_set_meeting_time (mts_item->mts, - g_date_get_year (start_date), - g_date_get_month (start_date), - g_date_get_day (start_date), - start_time.hour, - start_time.minute, - g_date_get_year (end_date), - g_date_get_month (end_date), - g_date_get_day (end_date), - end_time.hour, - end_time.minute); + e_meeting_time_selector_set_meeting_time ( + mts_item->mts, + g_date_get_year (start_date), + g_date_get_month (start_date), + g_date_get_day (start_date), + start_time.hour, + start_time.minute, + g_date_get_year (end_date), + g_date_get_month (end_date), + g_date_get_day (end_date), + end_time.hour, + end_time.minute); return FALSE; } @@ -930,8 +947,9 @@ e_meeting_time_selector_item_button_release (EMeetingTimeSelectorItem *mts_item, if (mts->dragging_position != E_MEETING_TIME_SELECTOR_POS_NONE) { mts->dragging_position = E_MEETING_TIME_SELECTOR_POS_NONE; e_meeting_time_selector_remove_timeout (mts); - gnome_canvas_item_ungrab (GNOME_CANVAS_ITEM (mts_item), - event->button.time); + gnome_canvas_item_ungrab ( + GNOME_CANVAS_ITEM (mts_item), + event->button.time); } return FALSE; @@ -959,8 +977,9 @@ e_meeting_time_selector_item_motion_notify (EMeetingTimeSelectorItem *mts_item, return TRUE; } - position = e_meeting_time_selector_item_get_drag_position (mts_item, - x, y); + position = e_meeting_time_selector_item_get_drag_position ( + mts_item, + x, y); /* Determine which cursor should be used. */ if (position != E_MEETING_TIME_SELECTOR_POS_NONE) diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index eb7a1fc67e..69d9e27ffb 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -413,9 +413,10 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->meeting_start_time.hour = meeting_start_tm->tm_hour; mts->meeting_start_time.minute = meeting_start_tm->tm_min; - e_meeting_time_selector_find_nearest_interval (mts, &mts->meeting_start_time, - &mts->meeting_end_time, - 0, 0, 30); + e_meeting_time_selector_find_nearest_interval ( + mts, &mts->meeting_start_time, + &mts->meeting_end_time, + 0, 0, 30); e_meeting_time_selector_update_dates_shown (mts); @@ -428,8 +429,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->auto_scroll_timeout_id = 0; vbox = gtk_vbox_new (FALSE, 0); - gtk_table_attach (GTK_TABLE (mts), - vbox, 0, 1, 0, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), + vbox, 0, 1, 0, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (vbox); mts->attendees_vbox_spacer = gtk_vbox_new (FALSE, 0); @@ -489,13 +491,15 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* The free/busy information */ mts->display_top = gnome_canvas_new (); gtk_widget_set_size_request (mts->display_top, -1, mts->row_height * 3); - gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_top), - 0, 0, - mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, - mts->row_height * 3); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (mts->display_top), + 0, 0, + mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, + mts->row_height * 3); /* Add some horizontal padding for the shadow around the display. */ - gtk_table_attach (GTK_TABLE (mts), mts->display_top, - 1, 4, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), mts->display_top, + 1, 4, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_widget_show (mts->display_top); g_signal_connect ( mts->display_top, "realize", @@ -504,9 +508,10 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->display_main = gnome_canvas_new (); e_meeting_time_selector_update_main_canvas_scroll_region (mts); /* Add some horizontal padding for the shadow around the display. */ - gtk_table_attach (GTK_TABLE (mts), mts->display_main, - 1, 4, 1, 2, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), mts->display_main, + 1, 4, 1, 2, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (mts->display_main); g_signal_connect ( mts->display_main, "realize", @@ -541,38 +546,44 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, gtk_widget_show (mts->vscrollbar); /* Create the item in the top canvas. */ - mts->item_top = gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_top)->root), - e_meeting_time_selector_item_get_type (), - "EMeetingTimeSelectorItem::meeting_time_selector", mts, - NULL); + mts->item_top = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_top)->root), + e_meeting_time_selector_item_get_type (), + "EMeetingTimeSelectorItem::meeting_time_selector", mts, + NULL); /* Create the item in the main canvas. */ - mts->item_main = gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_main)->root), - e_meeting_time_selector_item_get_type (), - "EMeetingTimeSelectorItem::meeting_time_selector", mts, - NULL); + mts->item_main = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_main)->root), + e_meeting_time_selector_item_get_type (), + "EMeetingTimeSelectorItem::meeting_time_selector", mts, + NULL); /* Create the hbox containing the color key. */ hbox = gtk_hbox_new (FALSE, 2); - gtk_table_attach (GTK_TABLE (mts), hbox, - 1, 4, 3, 4, GTK_FILL, 0, 0, 8); + gtk_table_attach ( + GTK_TABLE (mts), hbox, + 1, 4, 3, 4, GTK_FILL, 0, 0, 8); gtk_widget_show (hbox); e_meeting_time_selector_add_key_color (mts, hbox, _("Tentative"), &mts->busy_colors[E_MEETING_FREE_BUSY_TENTATIVE]); e_meeting_time_selector_add_key_color (mts, hbox, _("Busy"), &mts->busy_colors[E_MEETING_FREE_BUSY_BUSY]); e_meeting_time_selector_add_key_color (mts, hbox, _("Out of Office"), &mts->busy_colors[E_MEETING_FREE_BUSY_OUT_OF_OFFICE]); - e_meeting_time_selector_add_key_color (mts, hbox, _("No Information"), - NULL); + e_meeting_time_selector_add_key_color ( + mts, hbox, _("No Information"), + NULL); separator = gtk_hseparator_new (); - gtk_table_attach (GTK_TABLE (mts), separator, - 0, 5, 4, 5, GTK_FILL, 0, 6, 6); + gtk_table_attach ( + GTK_TABLE (mts), separator, + 0, 5, 4, 5, GTK_FILL, 0, 6, 6); gtk_widget_show (separator); /* Create the Invite Others & Options buttons on the left. */ hbox = gtk_hbox_new (FALSE, 4); - gtk_table_attach (GTK_TABLE (mts), hbox, - 0, 1, 3, 4, GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), hbox, + 0, 1, 3, 4, GTK_FILL, 0, 0, 0); gtk_widget_show (hbox); mts->add_attendees_button = @@ -603,8 +614,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6); gtk_widget_show (label); - gtk_widget_add_accelerator (mts->options_button, "clicked", mts->accel_group, - accel_key, GDK_MOD1_MASK, 0); + gtk_widget_add_accelerator ( + mts->options_button, "clicked", mts->accel_group, + accel_key, GDK_MOD1_MASK, 0); arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); gtk_box_pack_start (GTK_BOX (child_hbox), arrow, FALSE, FALSE, 6); @@ -612,15 +624,17 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* Create the Options menu. */ mts->options_menu = gtk_menu_new (); - gtk_menu_attach_to_widget (GTK_MENU (mts->options_menu), mts->options_button, - e_meeting_time_selector_options_menu_detacher); + gtk_menu_attach_to_widget ( + GTK_MENU (mts->options_menu), mts->options_button, + e_meeting_time_selector_options_menu_detacher); menuitem = gtk_check_menu_item_new_with_label (""); child = gtk_bin_get_child (GTK_BIN (menuitem)); gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("Show _only working hours")); gtk_menu_shell_append (GTK_MENU_SHELL (mts->options_menu), menuitem); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), - mts->working_hours_only); + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (menuitem), + mts->working_hours_only); g_signal_connect ( menuitem, "toggled", @@ -631,8 +645,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, child = gtk_bin_get_child (GTK_BIN (menuitem)); gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("Show _zoomed out")); gtk_menu_shell_append (GTK_MENU_SHELL (mts->options_menu), menuitem); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), - mts->zoomed_out); + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (menuitem), + mts->zoomed_out); g_signal_connect ( menuitem, "toggled", @@ -656,16 +671,18 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* Create the 3 AutoPick buttons on the left. */ hbox = gtk_hbox_new (FALSE, 0); - gtk_table_attach (GTK_TABLE (mts), hbox, - 0, 1, 5, 6, GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), hbox, + 0, 1, 5, 6, GTK_FILL, 0, 0, 0); gtk_widget_show (hbox); mts->autopick_down_button = gtk_button_new_with_label (""); child = gtk_bin_get_child (GTK_BIN (mts->autopick_down_button)); gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("_<<")); accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (child)); - gtk_widget_add_accelerator (mts->autopick_down_button, "clicked", mts->accel_group, - accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0); + gtk_widget_add_accelerator ( + mts->autopick_down_button, "clicked", mts->accel_group, + accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0); gtk_box_pack_start (GTK_BOX (hbox), mts->autopick_down_button, TRUE, TRUE, 6); gtk_widget_show (mts->autopick_down_button); g_signal_connect ( @@ -685,8 +702,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6); gtk_widget_show (label); - gtk_widget_add_accelerator (mts->autopick_button, "clicked", mts->accel_group, - accel_key, GDK_MOD1_MASK, 0); + gtk_widget_add_accelerator ( + mts->autopick_button, "clicked", mts->accel_group, + accel_key, GDK_MOD1_MASK, 0); g_signal_connect ( mts->autopick_button, "clicked", G_CALLBACK (e_meeting_time_selector_on_autopick_button_clicked), mts); @@ -699,8 +717,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, child = gtk_bin_get_child (GTK_BIN (mts->autopick_up_button)); gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _(">_>")); accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (child)); - gtk_widget_add_accelerator (mts->autopick_up_button, "clicked", mts->accel_group, - accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0); + gtk_widget_add_accelerator ( + mts->autopick_up_button, "clicked", mts->accel_group, + accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0); gtk_box_pack_start (GTK_BOX (hbox), mts->autopick_up_button, TRUE, TRUE, 6); gtk_widget_show (mts->autopick_up_button); g_signal_connect ( @@ -709,8 +728,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* Create the Autopick menu. */ mts->autopick_menu = gtk_menu_new (); - gtk_menu_attach_to_widget (GTK_MENU (mts->autopick_menu), mts->autopick_button, - e_meeting_time_selector_autopick_menu_detacher); + gtk_menu_attach_to_widget ( + GTK_MENU (mts->autopick_menu), mts->autopick_button, + e_meeting_time_selector_autopick_menu_detacher); menuitem = gtk_radio_menu_item_new_with_label (NULL, ""); mts->autopick_all_item = menuitem; @@ -757,8 +777,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* Create the date entry fields on the right. */ alignment = gtk_alignment_new (0.0, 0.5, 0, 0); - gtk_table_attach (GTK_TABLE (mts), alignment, - 1, 4, 5, 6, GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), alignment, + 1, 4, 5, 6, GTK_FILL, 0, 0, 0); gtk_widget_show (alignment); table = gtk_table_new (2, 2, FALSE); @@ -771,9 +792,10 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, a11y_label = gtk_widget_get_accessible (label); a11y_date_edit = gtk_widget_get_accessible (mts->start_date_edit); if (a11y_label != NULL && a11y_date_edit != NULL) { - atk_object_add_relationship (a11y_date_edit, - ATK_RELATION_LABELLED_BY, - a11y_label); + atk_object_add_relationship ( + a11y_date_edit, + ATK_RELATION_LABELLED_BY, + a11y_label); } e_date_edit_set_show_time (E_DATE_EDIT (mts->start_date_edit), TRUE); @@ -792,8 +814,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->start_date_edit, "week-start-day", G_BINDING_SYNC_CREATE); - gtk_table_attach (GTK_TABLE (table), mts->start_date_edit, - 1, 2, 0, 1, GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), mts->start_date_edit, + 1, 2, 0, 1, GTK_FILL, 0, 0, 0); gtk_widget_show (mts->start_date_edit); g_signal_connect ( mts->start_date_edit, "changed", @@ -803,8 +826,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, gtk_label_set_mnemonic_widget (GTK_LABEL (label), (mts->start_date_edit)); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, - 0, 1, 0, 1, GTK_FILL, 0, 4, 0); + gtk_table_attach ( + GTK_TABLE (table), label, + 0, 1, 0, 1, GTK_FILL, 0, 4, 0); gtk_widget_show (label); mts->end_date_edit = e_date_edit_new (); @@ -812,7 +836,8 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, a11y_label = gtk_widget_get_accessible (label); a11y_date_edit = gtk_widget_get_accessible (mts->end_date_edit); if (a11y_label != NULL && a11y_date_edit != NULL) { - atk_object_add_relationship (a11y_date_edit, + atk_object_add_relationship ( + a11y_date_edit, ATK_RELATION_LABELLED_BY, a11y_label); } @@ -833,8 +858,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->end_date_edit, "week-start-day", G_BINDING_SYNC_CREATE); - gtk_table_attach (GTK_TABLE (table), mts->end_date_edit, - 1, 2, 1, 2, GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), mts->end_date_edit, + 1, 2, 1, 2, GTK_FILL, 0, 0, 0); gtk_widget_show (mts->end_date_edit); g_signal_connect ( mts->end_date_edit, "changed", @@ -844,8 +870,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, gtk_label_set_mnemonic_widget (GTK_LABEL (label), (mts->end_date_edit)); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, - 0, 1, 1, 2, GTK_FILL, 0, 4, 0); + gtk_table_attach ( + GTK_TABLE (table), label, + 0, 1, 1, 2, GTK_FILL, 0, 4, 0); gtk_widget_show (label); gtk_table_set_col_spacing (GTK_TABLE (mts), 0, 4); @@ -942,9 +969,10 @@ e_meeting_time_selector_draw_key_color (GtkWidget *darea, } else { cairo_set_source (cr, mts->no_info_pattern); } - cairo_rectangle (cr, - 1, 1, - allocation.width - 2, allocation.height - 2); + cairo_rectangle ( + cr, + 1, 1, + allocation.width - 2, allocation.height - 2); cairo_fill (cr); return TRUE; @@ -958,7 +986,7 @@ e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector *mts, g_return_if_fail (name != NULL); g_return_if_fail (c != NULL); - if ( !gdk_color_parse (name, c)) + if (!gdk_color_parse (name, c)) g_warning ("Failed to parse color: %s\n", name); } @@ -1018,7 +1046,7 @@ e_meeting_time_selector_set_show_week_numbers (EMeetingTimeSelector *mts, { g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); - if ((mts->priv->show_week_numbers ? 1 : 0) == (show_week_numbers ? 1 : 0)) + if (mts->priv->show_week_numbers == show_week_numbers) return; mts->priv->show_week_numbers = show_week_numbers; @@ -1040,7 +1068,7 @@ e_meeting_time_selector_set_use_24_hour_format (EMeetingTimeSelector *mts, { g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); - if ((mts->priv->use_24_hour_format ? 1 : 0) == (use_24_hour_format ? 1 : 0)) + if (mts->priv->use_24_hour_format == use_24_hour_format) return; mts->priv->use_24_hour_format = use_24_hour_format; @@ -1078,8 +1106,9 @@ e_meeting_time_selector_create_no_info_pattern (EMeetingTimeSelector *mts) GdkColor color; cairo_t *cr; - surface = gdk_window_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (mts)), - CAIRO_CONTENT_COLOR, 8, 8); + surface = gdk_window_create_similar_surface ( + gtk_widget_get_window (GTK_WIDGET (mts)), + CAIRO_CONTENT_COLOR, 8, 8); cr = cairo_create (surface); gdk_color_parse ("white", &color); @@ -1138,9 +1167,10 @@ get_cell_height (GtkTreeView *tree) gint height = -1; column = gtk_tree_view_get_column (tree, 0); - gtk_tree_view_column_cell_get_size (column, NULL, - NULL, NULL, - NULL, &height); + gtk_tree_view_column_cell_get_size ( + column, NULL, + NULL, NULL, + NULL, &height); return height; } @@ -1162,8 +1192,9 @@ style_change_idle_func (EMeetingTimeSelector *mts) widget = GTK_WIDGET (mts); font_desc = gtk_widget_get_style (widget)->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); layout = pango_layout_new (pango_context); /* Calculate the widths of the hour strings in the style's font. */ @@ -1194,8 +1225,9 @@ style_change_idle_func (EMeetingTimeSelector *mts) * * gtk_widget_realize (mts->list_view); - gdk_window_get_position (gtk_tree_view_get_bin_window (GTK_TREE_VIEW (mts->list_view)), - NULL, &maxheight); + 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); * */ @@ -1356,12 +1388,14 @@ e_meeting_time_selector_set_meeting_time (EMeetingTimeSelector *mts, || end_minute < 0 || end_minute > 59) return FALSE; - g_date_set_dmy (&mts->meeting_start_time.date, start_day, start_month, + g_date_set_dmy ( + &mts->meeting_start_time.date, start_day, start_month, start_year); mts->meeting_start_time.hour = start_hour; mts->meeting_start_time.minute = start_minute; - g_date_set_dmy (&mts->meeting_end_time.date, end_day, end_month, - end_year); + g_date_set_dmy ( + &mts->meeting_end_time.date, + end_day, end_month, end_year); mts->meeting_end_time.hour = end_hour; mts->meeting_end_time.minute = end_minute; @@ -1387,10 +1421,12 @@ e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts, mts->all_day = all_day; - e_date_edit_set_show_time (E_DATE_EDIT (mts->start_date_edit), - !all_day); - e_date_edit_set_show_time (E_DATE_EDIT (mts->end_date_edit), - !all_day); + e_date_edit_set_show_time ( + E_DATE_EDIT (mts->start_date_edit), + !all_day); + e_date_edit_set_show_time ( + E_DATE_EDIT (mts->end_date_edit), + !all_day); e_meeting_time_selector_save_position (mts, &saved_time); e_meeting_time_selector_recalc_grid (mts); @@ -1508,7 +1544,7 @@ e_meeting_time_selector_refresh_cb (gpointer data) if (mts->display_main != NULL) gtk_widget_queue_draw (mts->display_main); - g_object_unref (G_OBJECT (mts)); + g_object_unref (mts); return FALSE; } @@ -1559,17 +1595,19 @@ e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, gint i; for (i = 0; i < e_meeting_store_count_actual_attendees (mts->model); i++) - g_object_ref (G_OBJECT (mts)); + g_object_ref (mts); } else { - g_object_ref (G_OBJECT (mts)); + g_object_ref (mts); } if (all) - e_meeting_store_refresh_all_busy_periods (mts->model, &start, &end, - e_meeting_time_selector_refresh_cb, mts); + e_meeting_store_refresh_all_busy_periods ( + mts->model, &start, &end, + e_meeting_time_selector_refresh_cb, mts); else - e_meeting_store_refresh_busy_periods (mts->model, row, &start, &end, - e_meeting_time_selector_refresh_cb, mts); + e_meeting_store_refresh_busy_periods ( + mts->model, row, &start, &end, + e_meeting_time_selector_refresh_cb, mts); } EMeetingTimeSelectorAutopickOption @@ -1653,8 +1691,9 @@ e_meeting_time_selector_dump (EMeetingTimeSelector *mts) attendee = &g_array_index (mts->attendees, EMeetingTimeSelectorAttendee, row); g_print ("Attendee: %s\n", attendee->name); - g_print (" Longest Busy Period: %i days\n", - attendee->longest_period_in_days); + g_print ( + " Longest Busy Period: %i days\n", + attendee->longest_period_in_days); e_meeting_time_selector_attendee_ensure_periods_sorted (mts, attendee); #if 1 @@ -1666,15 +1705,19 @@ e_meeting_time_selector_dump (EMeetingTimeSelector *mts) period_num); /* These are just for debugging so don't need i18n. */ - g_date_strftime (buffer, sizeof (buffer), - "%A, %B %d, %Y", &period->start.date); - g_print (" Start: %s %i:%02i\n", buffer, - period->start.hour, period->start.minute); - - g_date_strftime (buffer, sizeof (buffer), - "%A, %B %d, %Y", &period->end.date); - g_print (" End : %s %i:%02i\n", buffer, - period->end.hour, period->end.minute); + g_date_strftime ( + buffer, sizeof (buffer), + "%A, %B %d, %Y", &period->start.date); + g_print ( + " Start: %s %i:%02i\n", buffer, + period->start.hour, period->start.minute); + + g_date_strftime ( + buffer, sizeof (buffer), + "%A, %B %d, %Y", &period->end.date); + g_print ( + " End : %s %i:%02i\n", buffer, + period->end.hour, period->end.minute); } #endif } @@ -1691,10 +1734,12 @@ e_meeting_time_selector_dump_time (EMeetingTime *mtstime) gchar buffer2[128]; /* This is just for debugging so doesn't need i18n. */ - g_date_strftime (buffer, sizeof (buffer), "%A, %B %d, %Y", - &mtstime->date); - sprintf (buffer2, " at %i:%02i", (gint) mtstime->hour, - (gint) mtstime->minute); + g_date_strftime ( + buffer, sizeof (buffer), "%A, %B %d, %Y", + &mtstime->date); + sprintf ( + buffer2, " at %i:%02i", (gint) mtstime->hour, + (gint) mtstime->minute); strcat (buffer, buffer2); return buffer; @@ -1725,9 +1770,10 @@ static void e_meeting_time_selector_on_options_button_clicked (GtkWidget *button, EMeetingTimeSelector *mts) { - gtk_menu_popup (GTK_MENU (mts->options_menu), NULL, NULL, - e_meeting_time_selector_options_menu_position_callback, - mts, 1, GDK_CURRENT_TIME); + gtk_menu_popup ( + GTK_MENU (mts->options_menu), NULL, NULL, + e_meeting_time_selector_options_menu_position_callback, + mts, 1, GDK_CURRENT_TIME); } static void @@ -1778,9 +1824,10 @@ static void e_meeting_time_selector_on_autopick_button_clicked (GtkWidget *button, EMeetingTimeSelector *mts) { - gtk_menu_popup (GTK_MENU (mts->autopick_menu), NULL, NULL, - e_meeting_time_selector_autopick_menu_position_callback, - mts, 1, GDK_CURRENT_TIME); + gtk_menu_popup ( + GTK_MENU (mts->autopick_menu), NULL, NULL, + e_meeting_time_selector_autopick_menu_position_callback, + mts, 1, GDK_CURRENT_TIME); } static void @@ -2281,10 +2328,11 @@ e_meeting_time_selector_recalc_grid (EMeetingTimeSelector *mts) /* Add one pixel for the extra vertical grid line. */ mts->day_width++; - gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_top), - 0, 0, - mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, - mts->row_height * 3); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (mts->display_top), + 0, 0, + mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, + mts->row_height * 3); e_meeting_time_selector_update_main_canvas_scroll_region (mts); e_meeting_time_selector_recalc_date_format (mts); @@ -2298,8 +2346,9 @@ e_meeting_time_selector_save_position (EMeetingTimeSelector *mts, { gint scroll_x, scroll_y; - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); e_meeting_time_selector_calculate_time (mts, scroll_x, mtstime); } @@ -2310,12 +2359,14 @@ e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts, { gint scroll_x, scroll_y, new_scroll_x; - new_scroll_x = e_meeting_time_selector_calculate_time_position (mts, - mtstime); - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), - &scroll_x, &scroll_y); - gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main), - new_scroll_x, scroll_y); + new_scroll_x = e_meeting_time_selector_calculate_time_position ( + mts, mtstime); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (mts->display_main), + new_scroll_x, scroll_y); } /* This returns the x pixel coords of the meeting time in the entire scroll @@ -2420,8 +2471,9 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) } } - g_date_set_dmy (&date, days[longest_month - 1] + longest_weekday, - longest_month, 2000); + g_date_set_dmy ( + &date, days[longest_month - 1] + longest_weekday, + longest_month, 2000); g_date_to_struct_tm (&date, &tm_time); str = e_datetime_format_format_tm ("calendar", "table", DTFormatKindDate, &tm_time); @@ -2439,8 +2491,9 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) } #if 0 - g_print ("longest_month: %i longest_weekday: %i date: %s\n", - longest_month, longest_weekday, str); + g_print ( + "longest_month: %i longest_weekday: %i date: %s\n", + longest_month, longest_weekday, str); #endif pango_layout_set_text (layout, str, -1); @@ -2620,10 +2673,11 @@ e_meeting_time_selector_update_main_canvas_scroll_region (EMeetingTimeSelector * height = mts->row_height * (e_meeting_store_count_actual_attendees (mts->model) + 2); height = MAX (height, allocation.height); - gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_main), - 0, 0, - mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, - height); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (mts->display_main), + 0, 0, + mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, + height); } /* This changes the meeting time based on the given x coordinate and whether @@ -2641,8 +2695,9 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, GtkAllocation allocation; /* Get the x coords of visible part of the canvas. */ - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); gtk_widget_get_allocation (mts->display_main, &allocation); canvas_width = allocation.width; @@ -2668,8 +2723,8 @@ 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. */ 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); + e_meeting_time_selector_calculate_time ( + mts, scroll_x + canvas_width - 1, &last_time); if (!mts->all_day) { if (mts->zoomed_out) { if (first_time.minute > 30) @@ -2799,15 +2854,17 @@ e_meeting_time_selector_timeout_handler (gpointer data) return TRUE; /* Get the x coords of visible part of the canvas. */ - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); gtk_widget_get_allocation (mts->display_main, &allocation); canvas_width = allocation.width; /* Calculate the scroll delay, between 0 and MAX_SCROLL_SPEED. */ scroll_speed = abs (mts->last_drag_x / E_MEETING_TIME_SELECTOR_SCROLL_INCREMENT_WIDTH); - scroll_speed = MIN (scroll_speed, - E_MEETING_TIME_SELECTOR_MAX_SCROLL_SPEED); + scroll_speed = MIN ( + scroll_speed, + E_MEETING_TIME_SELECTOR_MAX_SCROLL_SPEED); /* Reset the scroll count. */ mts->scroll_count = E_MEETING_TIME_SELECTOR_MAX_SCROLL_SPEED - scroll_speed; @@ -2826,9 +2883,8 @@ e_meeting_time_selector_timeout_handler (gpointer data) /* Calculate the minimum or maximum visible time in the canvas, which * we will now set the dragged time to. */ if (scroll_offset > 0) { - e_meeting_time_selector_calculate_time (mts, - scroll_x + canvas_width - 1, - &drag_time); + e_meeting_time_selector_calculate_time ( + mts, scroll_x + canvas_width - 1, &drag_time); if (!mts->all_day) { if (mts->zoomed_out) { drag_time.minute = 0; @@ -2840,8 +2896,8 @@ e_meeting_time_selector_timeout_handler (gpointer data) drag_time.minute = 0; } } else { - e_meeting_time_selector_calculate_time (mts, scroll_x, - &drag_time); + e_meeting_time_selector_calculate_time ( + mts, scroll_x, &drag_time); if (!mts->all_day) { if (mts->zoomed_out) { if (drag_time.minute > 30) @@ -2918,10 +2974,12 @@ e_meeting_time_selector_timeout_handler (gpointer data) * 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), - scroll_x, scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (mts->display_main), + scroll_x, scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (mts->display_top), + scroll_x, scroll_y); return TRUE; } @@ -2940,12 +2998,13 @@ e_meeting_time_selector_remove_timeout (EMeetingTimeSelector *mts) static void e_meeting_time_selector_update_start_date_edit (EMeetingTimeSelector *mts) { - e_date_edit_set_date_and_time_of_day (E_DATE_EDIT (mts->start_date_edit), - g_date_get_year (&mts->meeting_start_time.date), - g_date_get_month (&mts->meeting_start_time.date), - g_date_get_day (&mts->meeting_start_time.date), - mts->meeting_start_time.hour, - mts->meeting_start_time.minute); + e_date_edit_set_date_and_time_of_day ( + E_DATE_EDIT (mts->start_date_edit), + g_date_get_year (&mts->meeting_start_time.date), + g_date_get_month (&mts->meeting_start_time.date), + g_date_get_day (&mts->meeting_start_time.date), + mts->meeting_start_time.hour, + mts->meeting_start_time.minute); } /* This updates the GnomeDateEdit widget displaying the meeting end time. */ @@ -2958,12 +3017,13 @@ e_meeting_time_selector_update_end_date_edit (EMeetingTimeSelector *mts) if (mts->all_day) g_date_subtract_days (&date, 1); - e_date_edit_set_date_and_time_of_day (E_DATE_EDIT (mts->end_date_edit), - g_date_get_year (&date), - g_date_get_month (&date), - g_date_get_day (&date), - mts->meeting_end_time.hour, - mts->meeting_end_time.minute); + e_date_edit_set_date_and_time_of_day ( + E_DATE_EDIT (mts->end_date_edit), + g_date_get_year (&date), + g_date_get_month (&date), + g_date_get_day (&date), + mts->meeting_end_time.hour, + mts->meeting_end_time.minute); } /* This ensures that the meeting time is shown on screen, by scrolling the @@ -2995,15 +3055,17 @@ e_meeting_time_selector_ensure_meeting_time_shown (EMeetingTimeSelector *mts) start_x = e_meeting_time_selector_calculate_time_position (mts, &time); } - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); gtk_widget_get_allocation (mts->display_main, &allocation); if (start_x > scroll_x && end_x <= scroll_x + allocation.width) return; new_scroll_x = start_x; - gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main), - new_scroll_x, scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (mts->display_main), + new_scroll_x, scroll_y); } /* This updates the range of dates shown in the canvas, to make sure that the @@ -3012,12 +3074,14 @@ static void e_meeting_time_selector_update_dates_shown (EMeetingTimeSelector *mts) { mts->first_date_shown = mts->meeting_start_time.date; - g_date_subtract_days (&mts->first_date_shown, - E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE); + g_date_subtract_days ( + &mts->first_date_shown, + E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE); mts->last_date_shown = mts->first_date_shown; - g_date_add_days (&mts->last_date_shown, - E_MEETING_TIME_SELECTOR_DAYS_SHOWN - 1); + g_date_add_days ( + &mts->last_date_shown, + E_MEETING_TIME_SELECTOR_DAYS_SHOWN - 1); } /* This checks if the time's hour is over 24 or its minute is over 60 and if @@ -3107,8 +3171,8 @@ e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, gint day_position; /* First get the day and the x position within the day. */ - e_meeting_time_selector_calculate_day_and_position (mts, x, &time->date, - NULL); + e_meeting_time_selector_calculate_day_and_position ( + mts, x, &time->date, NULL); /* Now convert the day_position into an hour and minute. */ if (x >= 0) @@ -3116,7 +3180,8 @@ e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, else day_position = mts->day_width + x % mts->day_width; - e_meeting_time_selector_convert_day_position_to_hours_and_mins (mts, day_position, &time->hour, &time->minute); + e_meeting_time_selector_convert_day_position_to_hours_and_mins ( + mts, day_position, &time->hour, &time->minute); } /* This takes a EMeetingTime and calculates the x pixel coordinate @@ -3130,7 +3195,9 @@ e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts, /* Calculate the number of days since the first date shown in the * entire canvas scroll region. */ - date_offset = g_date_get_julian (&mtstime->date) - g_date_get_julian (&mts->first_date_shown); + 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; diff --git a/calendar/gui/e-meeting-utils.c b/calendar/gui/e-meeting-utils.c index 369e819fc3..89149e77e9 100644 --- a/calendar/gui/e-meeting-utils.c +++ b/calendar/gui/e-meeting-utils.c @@ -33,8 +33,8 @@ e_meeting_time_compare_times (EMeetingTime *time1, { gint day_comparison; - day_comparison = g_date_compare (&time1->date, - &time2->date); + day_comparison = g_date_compare (&time1->date, &time2->date); + if (day_comparison != 0) return day_comparison; diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index ab86209dd5..45d51b9060 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -542,7 +542,7 @@ memo_table_query_tooltip (GtkWidget *widget, e_cal_component_get_organizer (new_comp, &organizer); if (organizer.cn) { gchar *ptr; - ptr = strchr ( organizer.value, ':'); + ptr = strchr (organizer.value, ':'); if (ptr) { ptr++; diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c index 9e18175b15..b45f7eb820 100644 --- a/calendar/gui/e-select-names-editable.c +++ b/calendar/gui/e-select-names-editable.c @@ -54,11 +54,12 @@ e_select_names_editable_new (void) EShell *shell; /* Might be cleaner to have 'registry' passed in, but the call chain - of this widget doesn't have access that low in the functions, thus - making the change without (private) API break. */ + * of this widget doesn't have access that low in the functions, thus + * making the change without (private) API break. */ shell = e_shell_get_default (); - return g_object_new (E_TYPE_SELECT_NAMES_EDITABLE, + return g_object_new ( + E_TYPE_SELECT_NAMES_EDITABLE, "registry", e_shell_get_registry (shell), NULL); } diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c index b3a00d5d7e..311616dd80 100644 --- a/calendar/gui/e-select-names-renderer.c +++ b/calendar/gui/e-select-names-renderer.c @@ -79,7 +79,7 @@ e_select_names_renderer_editing_done (GtkCellEditable *editable, names = e_select_names_editable_get_names (E_SELECT_NAMES_EDITABLE (editable)); /* remove empty addresses */ - for (a = addresses, n = names; a && n; ) { + for (a = addresses, n = names; a && n;) { gchar *addr = a->data, *nm = n->data; if ((!addr || !*addr) && (!nm || !*nm)) { diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index 56c4304ee2..ed73cbe6ef 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -484,11 +484,12 @@ task_table_constructed (GObject *object) * Normal string fields. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - 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, - NULL); + 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, + NULL); e_table_extras_add_cell (extras, "calstring", cell); g_object_unref (cell); @@ -497,11 +498,12 @@ task_table_constructed (GObject *object) * Date fields. */ cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT); - 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, - NULL); + 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, + NULL); g_object_bind_property ( model, "timezone", @@ -540,12 +542,13 @@ task_table_constructed (GObject *object) /* Classification field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - 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, - "editable", FALSE, - NULL); + 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, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -555,8 +558,9 @@ task_table_constructed (GObject *object) strings = g_list_append (strings, (gchar *) _("Public")); strings = g_list_append (strings, (gchar *) _("Private")); strings = g_list_append (strings, (gchar *) _("Confidential")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "classification", popup_cell); @@ -564,12 +568,13 @@ task_table_constructed (GObject *object) /* Priority field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - 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, - "editable", FALSE, - NULL); + 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, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -580,8 +585,9 @@ task_table_constructed (GObject *object) strings = g_list_append (strings, (gchar *) _("Normal")); strings = g_list_append (strings, (gchar *) _("Low")); strings = g_list_append (strings, (gchar *) _("Undefined")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "priority", popup_cell); @@ -589,11 +595,12 @@ task_table_constructed (GObject *object) /* Percent field. */ cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT); - 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, - NULL); + 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, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -607,8 +614,9 @@ task_table_constructed (GObject *object) */ strings = g_list_append (strings, g_strdup_printf (_("%d%%"), percent)); } - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_foreach (strings, (GFunc) g_free, NULL); g_list_free (strings); @@ -618,12 +626,13 @@ task_table_constructed (GObject *object) /* Transparency field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - 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, - "editable", FALSE, - NULL); + 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, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -632,8 +641,9 @@ task_table_constructed (GObject *object) strings = NULL; strings = g_list_append (strings, (gchar *) _("Free")); strings = g_list_append (strings, (gchar *) _("Busy")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "transparency", popup_cell); @@ -641,12 +651,13 @@ task_table_constructed (GObject *object) /* Status field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - 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, - "editable", FALSE, - NULL); + 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, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -657,21 +668,26 @@ task_table_constructed (GObject *object) strings = g_list_append (strings, (gchar *) _("In Progress")); strings = g_list_append (strings, (gchar *) _("Completed")); strings = g_list_append (strings, (gchar *) _("Canceled")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "calstatus", popup_cell); g_object_unref (popup_cell); - e_table_extras_add_compare (extras, "date-compare", - e_cell_date_edit_compare_cb); - e_table_extras_add_compare (extras, "percent-compare", - task_table_percent_compare_cb); - e_table_extras_add_compare (extras, "priority-compare", - task_table_priority_compare_cb); - e_table_extras_add_compare (extras, "status-compare", - task_table_status_compare_cb); + e_table_extras_add_compare ( + extras, "date-compare", + e_cell_date_edit_compare_cb); + e_table_extras_add_compare ( + extras, "percent-compare", + task_table_percent_compare_cb); + e_table_extras_add_compare ( + extras, "priority-compare", + task_table_priority_compare_cb); + e_table_extras_add_compare ( + extras, "status-compare", + task_table_status_compare_cb); /* Create pixmaps */ @@ -815,7 +831,7 @@ task_table_query_tooltip (GtkWidget *widget, e_cal_component_get_organizer (new_comp, &organizer); if (organizer.cn) { gchar *ptr; - ptr = strchr ( organizer.value, ':'); + ptr = strchr (organizer.value, ':'); if (ptr) { ptr++; @@ -1681,17 +1697,21 @@ hide_completed_rows_ready (GObject *source_object, GPtrArray *comp_objects; GError *error = NULL; - if (!e_cal_client_get_object_list_finish (E_CAL_CLIENT (source_object), result, &objects, &error)) { + e_cal_client_get_object_list_finish ( + E_CAL_CLIENT (source_object), result, &objects, &error); + + if (error != NULL) { if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { ESource *source = e_client_get_source (E_CLIENT (source_object)); - g_debug ("%s: Could not get the objects from '%s': %s", + g_debug ( + "%s: Could not get the objects from '%s': %s", G_STRFUNC, e_source_get_display_name (source), - error ? error->message : "Unknown error"); + error->message); } - g_clear_error (&error); + g_error_free (error); return; } @@ -1743,17 +1763,21 @@ show_completed_rows_ready (GObject *source_object, GPtrArray *comp_objects; GError *error = NULL; - if (!e_cal_client_get_object_list_finish (E_CAL_CLIENT (source_object), result, &objects, &error)) { + e_cal_client_get_object_list_finish ( + E_CAL_CLIENT (source_object), result, &objects, &error); + + if (error != NULL) { if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { ESource *source = e_client_get_source (E_CLIENT (source_object)); - g_debug ("%s: Could not get the objects from '%s': %s", + g_debug ( + "%s: Could not get the objects from '%s': %s", G_STRFUNC, e_source_get_display_name (source), - error ? error->message : "Unknown error"); + error->message); } - g_clear_error (&error); + g_error_free (error); return; } @@ -1865,13 +1889,15 @@ e_task_table_process_completed_tasks (ETaskTable *task_table, /* Delete rows from model*/ if (hide_sexp) { - task_table_get_object_list_async (clients_list, hide_sexp, cancellable, + task_table_get_object_list_async ( + clients_list, hide_sexp, cancellable, hide_completed_rows_ready, model); } /* Insert rows into model */ if (config_changed) { - task_table_get_object_list_async (clients_list, show_sexp, cancellable, + task_table_get_object_list_async ( + clients_list, show_sexp, cancellable, show_completed_rows_ready, model); } diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 13de066ce5..6cd4a9048a 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -210,8 +210,9 @@ week_view_event_item_button_press (EWeekViewEventItem *event_item, span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + event_item->priv->span_num); - pos = week_view_event_item_get_position (event_item, bevent->button.x, - bevent->button.y); + pos = week_view_event_item_get_position ( + event_item, bevent->button.x, + bevent->button.y); if (pos == E_CALENDAR_VIEW_POS_NONE) return FALSE; @@ -275,10 +276,11 @@ week_view_event_item_button_release (EWeekViewEventItem *event_item, if (week_view->pressed_event_num != -1 && week_view->pressed_event_num == event_item->priv->event_num && week_view->pressed_span_num == event_item->priv->span_num) { - e_week_view_start_editing_event (week_view, - event_item->priv->event_num, - event_item->priv->span_num, - NULL); + e_week_view_start_editing_event ( + week_view, + event_item->priv->event_num, + event_item->priv->span_num, + NULL); week_view->pressed_event_num = -1; return TRUE; } @@ -320,25 +322,29 @@ week_view_draw_time (EWeekView *week_view, if (small_font_desc) time_y_small_font = time_y; - e_week_view_convert_time_to_display (week_view, hour, &hour_to_display, - &suffix, &suffix_width); + e_week_view_convert_time_to_display ( + week_view, hour, &hour_to_display, + &suffix, &suffix_width); if (week_view->use_small_font && week_view->small_font_desc) { - g_snprintf (buffer, sizeof (buffer), "%2i:%02i", - hour_to_display, minute); + g_snprintf ( + buffer, sizeof (buffer), "%2i:%02i", + hour_to_display, minute); /* Draw the hour. */ if (hour_to_display < 10) { pango_layout_set_text (layout, buffer + 1, 1); - cairo_move_to (cr, - time_x + week_view->digit_width, - time_y_normal_font); + cairo_move_to ( + cr, + time_x + week_view->digit_width, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } else { pango_layout_set_text (layout, buffer, 2); - cairo_move_to (cr, - time_x, - time_y_normal_font); + cairo_move_to ( + cr, + time_x, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } @@ -347,9 +353,10 @@ week_view_draw_time (EWeekView *week_view, /* Draw the start minute, in the small font. */ pango_layout_set_font_description (layout, week_view->small_font_desc); pango_layout_set_text (layout, buffer + 3, 2); - cairo_move_to (cr, - time_x, - time_y_small_font); + cairo_move_to ( + cr, + time_x, + time_y_small_font); pango_cairo_show_layout (cr, layout); pango_layout_set_font_description (layout, style->font_desc); @@ -360,26 +367,30 @@ week_view_draw_time (EWeekView *week_view, if (!e_cal_model_get_use_24_hour_format (model)) { pango_layout_set_text (layout, suffix, -1); - cairo_move_to (cr, - time_x, - time_y_normal_font); + cairo_move_to ( + cr, + time_x, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } } else { /* Draw the start time in one go. */ - g_snprintf (buffer, sizeof (buffer), "%2i:%02i%s", - hour_to_display, minute, suffix); + g_snprintf ( + buffer, sizeof (buffer), "%2i:%02i%s", + hour_to_display, minute, suffix); if (hour_to_display < 10) { pango_layout_set_text (layout, buffer + 1, -1); - cairo_move_to (cr, - time_x + week_view->digit_width, - time_y_normal_font); + cairo_move_to ( + cr, + time_x + week_view->digit_width, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } else { pango_layout_set_text (layout, buffer, -1); - cairo_move_to (cr, - time_x, - time_y_normal_font); + cairo_move_to ( + cr, + time_x, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } @@ -1035,11 +1046,12 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); - cairo_rectangle (cr, - x1, y1, - x2 - x1 - E_WEEK_VIEW_EVENT_R_PAD - - E_WEEK_VIEW_EVENT_BORDER_WIDTH + 1, - y2 - y1 + 1); + cairo_rectangle ( + cr, + x1, y1, + x2 - x1 - E_WEEK_VIEW_EVENT_R_PAD + - E_WEEK_VIEW_EVENT_BORDER_WIDTH + 1, + y2 - y1 + 1); cairo_clip (cr); week_view_draw_time ( diff --git a/calendar/gui/e-week-view-layout.c b/calendar/gui/e-week-view-layout.c index 1e7f6366b1..67f3943aeb 100644 --- a/calendar/gui/e-week-view-layout.c +++ b/calendar/gui/e-week-view-layout.c @@ -83,11 +83,12 @@ e_week_view_layout_events (GArray *events, * 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, - multi_week_view, - weeks_shown, compress_weekend, - start_weekday, day_starts, - rows_per_day); + e_week_view_layout_event ( + event, grid, spans, old_spans, + multi_week_view, + weeks_shown, compress_weekend, + start_weekday, day_starts, + rows_per_day); } /* Free the grid. */ @@ -126,16 +127,19 @@ e_week_view_layout_event (EWeekViewEvent *event, EWeekViewEventSpan span, *old_span; days_shown = multi_week_view ? weeks_shown * 7 : 7; - start_day = e_week_view_find_day (event->start, FALSE, days_shown, - day_starts); - end_day = e_week_view_find_day (event->end, TRUE, days_shown, + start_day = e_week_view_find_day ( + event->start, FALSE, days_shown, + day_starts); + end_day = e_week_view_find_day ( + event->end, TRUE, days_shown, day_starts); start_day = CLAMP (start_day, 0, days_shown - 1); end_day = CLAMP (end_day, 0, days_shown - 1); #if 0 - g_print ("In e_week_view_layout_event Start:%i End: %i\n", - start_day, end_day); + g_print ( + "In e_week_view_layout_event Start:%i End: %i\n", + start_day, end_day); #endif /* Iterate through each of the spans of the event, where each span @@ -146,14 +150,16 @@ e_week_view_layout_event (EWeekViewEvent *event, spans_index = spans->len; num_spans = 0; while (span_start_day <= end_day) { - span_end_day = e_week_view_find_span_end (multi_week_view, - compress_weekend, - start_weekday, - span_start_day); + span_end_day = e_week_view_find_span_end ( + multi_week_view, + compress_weekend, + start_weekday, + span_start_day); span_end_day = MIN (span_end_day, end_day); #if 0 - g_print (" Span start:%i end:%i\n", span_start_day, - span_end_day); + g_print ( + " Span start:%i end:%i\n", span_start_day, + span_end_day); #endif /* Try each row until we find a free one or we fall off the * bottom of the available rows. */ @@ -176,12 +182,14 @@ e_week_view_layout_event (EWeekViewEvent *event, for (day = span_start_day; day <= span_end_day; day++) { grid[day * rows_per_cell + free_row] = 1; - rows_per_day[day] = MAX (rows_per_day[day], - free_row + 1); + rows_per_day[day] = MAX ( + rows_per_day[day], + free_row + 1); } #if 0 - g_print (" Span start:%i end:%i row:%i\n", - span_start_day, span_end_day, free_row); + g_print ( + " Span start:%i end:%i row:%i\n", + 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. */ diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index edf21ccaf6..7bbdbe1982 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -180,15 +180,17 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, } if (week_view->multi_week_view) { - cairo_rectangle (cr, x + 2, y + 1, - width - 5, - E_WEEK_VIEW_DATE_T_PAD - 1 + + cairo_rectangle ( + cr, x + 2, y + 1, + width - 5, + E_WEEK_VIEW_DATE_T_PAD - 1 + PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics))); cairo_fill (cr); } else { - cairo_rectangle (cr, x + 2, y + 1, - width - 5, line_y - y); + cairo_rectangle ( + cr, x + 2, y + 1, + width - 5, line_y - y); cairo_fill (cr); } } @@ -265,15 +267,16 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, if (today) { g_date_strftime ( buffer, sizeof (buffer), - format_string ? format_string : "<b>%d</b>", date); + format_string ? format_string : "<b>%d</b>", date); pango_cairo_update_context (cr, pango_context); layout = pango_cairo_create_layout (cr); pango_layout_set_font_description (layout, font_desc); pango_layout_set_text (layout, buffer, -1); pango_layout_set_markup (layout, buffer, strlen (buffer)); } else { - g_date_strftime (buffer, sizeof (buffer), - format_string ? format_string : "%d", date); + g_date_strftime ( + buffer, sizeof (buffer), + format_string ? format_string : "%d", date); pango_cairo_update_context (cr, pango_context); layout = pango_cairo_create_layout (cr); pango_layout_set_font_description (layout, font_desc); @@ -400,9 +403,10 @@ week_view_main_item_draw (GnomeCanvasItem *canvas_item, num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7; for (day = 0; day < num_days; day++) { - e_week_view_get_day_position (week_view, day, - &day_x, &day_y, - &day_w, &day_h); + e_week_view_get_day_position ( + week_view, day, + &day_x, &day_y, + &day_w, &day_h); /* Skip any days which are outside the area. */ if (day_x < x + width && day_x + day_w >= x && day_y < y + height && day_y + day_h >= y) { diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c index 0ad78e9cf7..1a1dc30d0f 100644 --- a/calendar/gui/e-week-view-titles-item.c +++ b/calendar/gui/e-week-view-titles-item.c @@ -184,9 +184,10 @@ week_view_titles_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); - cairo_rectangle (cr, - week_view->col_offsets[col] - x, 2 - y, - week_view->col_widths[col], allocation.height - 2); + cairo_rectangle ( + cr, + week_view->col_offsets[col] - x, 2 - y, + week_view->col_widths[col], allocation.height - 2); cairo_clip (cr); if (weekday == 5 && week_view->compress_weekend) diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 711c4b13c4..1b11a92c43 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -404,10 +404,12 @@ week_view_time_range_changed_cb (EWeekView *week_view, if (!g_date_valid (&week_view->first_day_shown) || g_date_compare (&week_view->first_day_shown, &base_date)) { week_view->first_day_shown = base_date; - start_time = time_add_day_with_zone (start_time, -day_offset, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); - start_time = time_day_begin_with_zone (start_time, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); + start_time = time_add_day_with_zone ( + start_time, -day_offset, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); + start_time = time_day_begin_with_zone ( + start_time, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); e_week_view_recalc_day_starts (week_view, start_time); } @@ -726,8 +728,9 @@ e_week_view_init (EWeekView *week_view) gtk_widget_set_can_focus (GTK_WIDGET (week_view), TRUE); week_view->event_destroyed = FALSE; - week_view->events = g_array_new (FALSE, FALSE, - sizeof (EWeekViewEvent)); + week_view->events = g_array_new ( + FALSE, FALSE, + sizeof (EWeekViewEvent)); week_view->events_sorted = TRUE; week_view->events_need_layout = FALSE; week_view->events_need_reshape = FALSE; @@ -766,8 +769,9 @@ e_week_view_init (EWeekView *week_view) week_view->small_font_desc = pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc); - pango_font_description_set_size (week_view->small_font_desc, - E_WEEK_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE); + pango_font_description_set_size ( + week_view->small_font_desc, + E_WEEK_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE); /* String to use in 12-hour time format for times in the morning. */ week_view->am_string = _("am"); @@ -784,33 +788,37 @@ e_week_view_init (EWeekView *week_view) * Month view. */ week_view->titles_canvas = e_canvas_new (); - gtk_table_attach (GTK_TABLE (week_view), week_view->titles_canvas, - 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (week_view), week_view->titles_canvas, + 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->titles_canvas)->root); week_view->titles_canvas_item = - gnome_canvas_item_new (canvas_group, - e_week_view_titles_item_get_type (), - "EWeekViewTitlesItem::week_view", week_view, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_week_view_titles_item_get_type (), + "EWeekViewTitlesItem::week_view", week_view, + NULL); /* * Main Canvas */ week_view->main_canvas = e_canvas_new (); - gtk_table_attach (GTK_TABLE (week_view), week_view->main_canvas, - 1, 2, 1, 2, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 1, 1); + gtk_table_attach ( + GTK_TABLE (week_view), week_view->main_canvas, + 1, 2, 1, 2, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 1, 1); gtk_widget_show (week_view->main_canvas); canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root); week_view->main_canvas_item = - gnome_canvas_item_new (canvas_group, - e_week_view_main_item_get_type (), - "EWeekViewMainItem::week_view", week_view, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_week_view_main_item_get_type (), + "EWeekViewMainItem::week_view", week_view, + NULL); g_signal_connect_after ( week_view->main_canvas, "button_press_event", @@ -849,8 +857,9 @@ e_week_view_init (EWeekView *week_view) adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, -52, 52, 1, 1, 1)); week_view->vscrollbar = gtk_vscrollbar_new (adjustment); - gtk_table_attach (GTK_TABLE (week_view), week_view->vscrollbar, - 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (week_view), week_view->vscrollbar, + 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (week_view->vscrollbar); /* Create the cursors. */ @@ -1068,7 +1077,7 @@ e_week_view_get_text_color (EWeekView *week_view, 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; @@ -1114,8 +1123,9 @@ e_week_view_style_set (GtkWidget *widget, /* Set up Pango prerequisites */ font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); layout = pango_layout_new (pango_context); /* Recalculate the height of each row based on the font size. */ @@ -1184,10 +1194,12 @@ e_week_view_style_set (GtkWidget *widget, week_view->max_month_width = max_month_width; week_view->max_abbr_month_width = max_abbr_month_width; - week_view->am_string_width = get_string_width (layout, - week_view->am_string); - week_view->pm_string_width = get_string_width (layout, - week_view->pm_string); + week_view->am_string_width = get_string_width ( + layout, + week_view->am_string); + week_view->pm_string_width = get_string_width ( + layout, + week_view->pm_string); g_object_unref (layout); pango_font_metrics_unref (font_metrics); @@ -1309,8 +1321,9 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) return; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + 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. */ @@ -1328,16 +1341,19 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) } height = week_view->row_heights[0]; - week_view->rows_per_cell = (height * 2 - week_view->events_y_offset) - / (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); - week_view->rows_per_cell = MIN (week_view->rows_per_cell, - E_WEEK_VIEW_MAX_ROWS_PER_CELL); + week_view->rows_per_cell = + (height * 2 - week_view->events_y_offset) / + (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); + week_view->rows_per_cell = MIN ( + week_view->rows_per_cell, + E_WEEK_VIEW_MAX_ROWS_PER_CELL); week_view->rows_per_compressed_cell = - (height - week_view->events_y_offset) - / (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); - week_view->rows_per_compressed_cell = MIN (week_view->rows_per_compressed_cell, - E_WEEK_VIEW_MAX_ROWS_PER_CELL); + (height - week_view->events_y_offset) / + (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); + week_view->rows_per_compressed_cell = MIN ( + week_view->rows_per_compressed_cell, + 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. */ @@ -1526,10 +1542,11 @@ e_week_view_focus (GtkWidget *widget, return TRUE; } - editable = e_week_view_start_editing_event (week_view, - new_event_num, - new_span_num, - NULL); + editable = e_week_view_start_editing_event ( + week_view, + new_event_num, + new_span_num, + NULL); last_focus_event_num = new_event_num; last_focus_span_num = new_span_num; @@ -1667,11 +1684,12 @@ e_week_view_set_selected_time_range (ECalendarView *cal_view, /* Make sure the selection is valid. */ num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7; num_days--; - week_view->selection_start_day = CLAMP (week_view->selection_start_day, - 0, num_days); - week_view->selection_end_day = CLAMP (week_view->selection_end_day, - week_view->selection_start_day, - num_days); + week_view->selection_start_day = CLAMP ( + week_view->selection_start_day, 0, num_days); + week_view->selection_end_day = CLAMP ( + week_view->selection_end_day, + week_view->selection_start_day, + 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 @@ -1716,11 +1734,13 @@ e_week_view_set_selected_time_range_visible (EWeekView *week_view, /* Make sure the selection is valid. */ num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7; num_days--; - week_view->selection_start_day = CLAMP (week_view->selection_start_day, + week_view->selection_start_day = CLAMP ( + week_view->selection_start_day, 0, num_days); - week_view->selection_end_day = CLAMP (week_view->selection_end_day, - week_view->selection_start_day, - num_days); + week_view->selection_end_day = CLAMP ( + week_view->selection_end_day, + week_view->selection_start_day, + num_days); gtk_widget_queue_draw (week_view->main_canvas); } @@ -1831,8 +1851,9 @@ e_week_view_set_first_day_shown (EWeekView *week_view, start_tt.month = g_date_get_month (&base_date); start_tt.day = g_date_get_day (&base_date); - start_time = icaltime_as_timet_with_zone (start_tt, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); + start_time = icaltime_as_timet_with_zone ( + start_tt, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); e_week_view_recalc_day_starts (week_view, start_time); e_week_view_update_query (week_view); @@ -1850,12 +1871,12 @@ e_week_view_set_first_day_shown (EWeekView *week_view, num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7; num_days--; - week_view->selection_start_day = - CLAMP (week_view->selection_start_day, 0, num_days); - week_view->selection_end_day = - CLAMP (week_view->selection_end_day, - week_view->selection_start_day, - num_days); + week_view->selection_start_day = CLAMP ( + week_view->selection_start_day, 0, num_days); + week_view->selection_end_day = CLAMP ( + week_view->selection_end_day, + week_view->selection_start_day, + num_days); } /* Reset the adjustment value to 0 if the base address has changed. @@ -1887,8 +1908,9 @@ e_week_view_recalc_day_starts (EWeekView *week_view, tmp_time = lower; week_view->day_starts[0] = tmp_time; for (day = 1; day <= num_days; day++) { - tmp_time = time_add_day_with_zone (tmp_time, 1, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); + tmp_time = time_add_day_with_zone ( + tmp_time, 1, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); week_view->day_starts[day] = tmp_time; } } @@ -1948,8 +1970,9 @@ e_week_view_set_multi_week_view (EWeekView *week_view, e_week_view_recalc_cell_sizes (week_view); if (g_date_valid (&week_view->first_day_shown)) - e_week_view_set_first_day_shown (week_view, - &week_view->first_day_shown); + e_week_view_set_first_day_shown ( + week_view, + &week_view->first_day_shown); } gboolean @@ -2033,7 +2056,7 @@ e_week_view_set_compress_weekend (EWeekView *week_view, g_return_if_fail (E_IS_WEEK_VIEW (week_view)); - if ((week_view->compress_weekend ? 1 : 0) == (compress_weekend ? 1 : 0)) + if (week_view->compress_weekend == compress_weekend) return; week_view->compress_weekend = compress_weekend; @@ -2079,7 +2102,7 @@ e_week_view_set_show_event_end_times (EWeekView *week_view, { g_return_if_fail (E_IS_WEEK_VIEW (week_view)); - if ((week_view->show_event_end_times ? 1 : 0) == (show_event_end_times ? 1 : 0)) + if (week_view->show_event_end_times == show_event_end_times) return; week_view->show_event_end_times = show_event_end_times; @@ -2274,12 +2297,13 @@ e_week_view_get_day_position (EWeekView *week_view, { gint cell_x, cell_y, cell_h; - e_week_view_layout_get_day_position (day, - week_view->multi_week_view, - week_view->weeks_shown, - week_view->display_start_day, - week_view->compress_weekend, - &cell_x, &cell_y, &cell_h); + e_week_view_layout_get_day_position ( + day, + week_view->multi_week_view, + week_view->weeks_shown, + week_view->display_start_day, + week_view->compress_weekend, + &cell_x, &cell_y, &cell_h); *day_x = week_view->col_offsets[cell_x]; *day_y = week_view->row_offsets[cell_y]; @@ -2339,8 +2363,9 @@ e_week_view_get_span_position (EWeekView *week_view, return FALSE; } - e_week_view_get_day_position (week_view, span->start_day, - &start_x, &start_y, &start_w, &start_h); + e_week_view_get_day_position ( + week_view, span->start_day, + &start_x, &start_y, &start_w, &start_h); *span_y = start_y + week_view->events_y_offset + span->row * (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); @@ -2348,9 +2373,10 @@ e_week_view_get_span_position (EWeekView *week_view, *span_x = start_x; *span_w = start_w - 1; } else { - e_week_view_get_day_position (week_view, - span->start_day + num_days - 1, - &end_x, &end_y, &end_w, &end_h); + e_week_view_get_day_position ( + week_view, + span->start_day + num_days - 1, + &end_x, &end_y, &end_w, &end_h); *span_x = start_x; *span_w = end_x + end_w - start_x - 1; } @@ -2624,8 +2650,11 @@ e_week_view_convert_position_to_day (EWeekView *week_view, for (day = 0; day < 7; day++) { gint day_x = 0, day_y = 0, rows = 0; - e_week_view_layout_get_day_position (day, FALSE, 1, week_view->display_start_day, week_view->compress_weekend, - &day_x, &day_y, &rows); + e_week_view_layout_get_day_position ( + day, FALSE, 1, + week_view->display_start_day, + week_view->compress_weekend, + &day_x, &day_y, &rows); if (grid_x == day_x && grid_y >= day_y && grid_y < day_y + rows) break; @@ -2760,9 +2789,11 @@ e_week_view_add_event (ECalComponent *comp, g_return_val_if_fail (start < add_event_data->week_view->day_starts[num_days], TRUE); g_return_val_if_fail (end > add_event_data->week_view->day_starts[0], TRUE); - start_tt = icaltime_from_timet_with_zone (start, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->week_view))); - end_tt = icaltime_from_timet_with_zone (end, FALSE, + start_tt = icaltime_from_timet_with_zone ( + start, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->week_view))); + end_tt = icaltime_from_timet_with_zone ( + end, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->week_view))); if (add_event_data->comp_data) { @@ -2841,10 +2872,11 @@ static void e_week_view_ensure_events_sorted (EWeekView *week_view) { if (!week_view->events_sorted) { - qsort (week_view->events->data, - week_view->events->len, - sizeof (EWeekViewEvent), - e_week_view_event_sort_func); + qsort ( + week_view->events->data, + week_view->events->len, + sizeof (EWeekViewEvent), + e_week_view_event_sort_func); week_view->events_sorted = TRUE; } } @@ -2888,8 +2920,8 @@ e_week_view_reshape_events (EWeekView *week_view) for (span_num = 0; span_num < event->num_spans; span_num++) { gchar *current_comp_string; - e_week_view_reshape_event_span (week_view, event_num, - span_num); + e_week_view_reshape_event_span ( + week_view, event_num, span_num); if (week_view->last_edited_comp_string == NULL) continue; current_comp_string = icalcomponent_as_ical_string_r (event->comp_data->icalcomp); @@ -2927,13 +2959,15 @@ e_week_view_reshape_events (EWeekView *week_view) } else { cairo_matrix_t matrix; - e_week_view_get_day_position (week_view, day, - &day_x, &day_y, - &day_w, &day_h); + e_week_view_get_day_position ( + week_view, day, + &day_x, &day_y, + &day_w, &day_h); - cairo_matrix_init_translate (&matrix, - day_x + day_w - E_WEEK_VIEW_JUMP_BUTTON_X_PAD - E_WEEK_VIEW_JUMP_BUTTON_WIDTH, - day_y + day_h - E_WEEK_VIEW_JUMP_BUTTON_Y_PAD - E_WEEK_VIEW_JUMP_BUTTON_HEIGHT); + cairo_matrix_init_translate ( + &matrix, + day_x + day_w - E_WEEK_VIEW_JUMP_BUTTON_X_PAD - E_WEEK_VIEW_JUMP_BUTTON_WIDTH, + day_y + day_h - E_WEEK_VIEW_JUMP_BUTTON_Y_PAD - E_WEEK_VIEW_JUMP_BUTTON_HEIGHT); gnome_canvas_item_set_matrix (week_view->jump_buttons[day], &matrix); gnome_canvas_item_show (week_view->jump_buttons[day]); @@ -3132,8 +3166,9 @@ e_week_view_reshape_event_span (EWeekView *week_view, /* Set up Pango prerequisites */ font_desc = gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc; pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view)); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); layout = pango_layout_new (pango_context); /* If we are editing a long event we don't show the icons and the EText @@ -3163,9 +3198,10 @@ e_week_view_reshape_event_span (EWeekView *week_view, /* Create the background canvas item if necessary. */ if (!span->background_item) { span->background_item = - gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), - e_week_view_event_item_get_type (), - NULL); + gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), + e_week_view_event_item_get_type (), + NULL); } g_object_set_data ((GObject *) span->background_item, "event-num", GINT_TO_POINTER (event_num)); @@ -3173,10 +3209,11 @@ e_week_view_reshape_event_span (EWeekView *week_view, span->background_item, "event", G_CALLBACK (tooltip_event_cb), week_view); - gnome_canvas_item_set (span->background_item, - "event_num", event_num, - "span_num", span_num, - NULL); + gnome_canvas_item_set ( + span->background_item, + "event_num", event_num, + "span_num", span_num, + NULL); /* Create the text item if necessary. */ if (!span->text_item) { @@ -3191,16 +3228,17 @@ e_week_view_reshape_event_span (EWeekView *week_view, summary = get_comp_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text); span->text_item = - gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), - e_text_get_type (), - "clip", TRUE, - "max_lines", 1, - "editable", TRUE, - "text", summary ? summary : "", - "use_ellipsis", TRUE, - "fill_color_gdk", &color, - "im_context", E_CANVAS (week_view->main_canvas)->im_context, - NULL); + gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), + e_text_get_type (), + "clip", TRUE, + "max_lines", 1, + "editable", TRUE, + "text", summary ? summary : "", + "use_ellipsis", TRUE, + "fill_color_gdk", &color, + "im_context", E_CANVAS (week_view->main_canvas)->im_context, + NULL); if (free_text) g_free ((gchar *) summary); @@ -3213,8 +3251,9 @@ e_week_view_reshape_event_span (EWeekView *week_view, g_signal_connect ( span->text_item, "event", G_CALLBACK (e_week_view_on_text_item_event), week_view); - g_signal_emit_by_name (G_OBJECT (week_view), - "event_added", event); + g_signal_emit_by_name ( + G_OBJECT (week_view), + "event_added", event); } @@ -3347,10 +3386,11 @@ e_week_view_reshape_event_span (EWeekView *week_view, /* Make sure we don't try to use a negative width. */ text_w = MAX (text_w, 0); - gnome_canvas_item_set (span->text_item, - "clip_width", (gdouble) text_w, - "clip_height", (gdouble) text_h, - NULL); + gnome_canvas_item_set ( + span->text_item, + "clip_width", (gdouble) text_w, + "clip_height", (gdouble) text_h, + NULL); e_canvas_item_move_absolute (span->text_item, text_x, text_y); g_object_unref (comp); @@ -3409,9 +3449,10 @@ e_week_view_start_editing_event (EWeekView *week_view, return FALSE; } - gnome_canvas_item_set (span->text_item, - "text", initial_text ? initial_text : icalcomponent_get_summary (event->comp_data->icalcomp), - NULL); + gnome_canvas_item_set ( + span->text_item, + "text", initial_text ? initial_text : icalcomponent_get_summary (event->comp_data->icalcomp), + NULL); /* Save the comp_data value because we use that as our invariant */ comp_data = event->comp_data; @@ -3448,8 +3489,9 @@ e_week_view_start_editing_event (EWeekView *week_view, if (event_processor) { command.action = E_TEP_MOVE; command.position = E_TEP_END_OF_BUFFER; - g_signal_emit_by_name (event_processor, - "command", &command); + g_signal_emit_by_name ( + event_processor, + "command", &command); } return TRUE; } @@ -3532,11 +3574,11 @@ 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. */ - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); return TRUE; } else if (gdkevent->key.keyval == GDK_KEY_Escape) { cancel_editing (week_view); - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); /* focus should go to week view when stop editing */ gtk_widget_grab_focus (GTK_WIDGET (week_view)); return TRUE; @@ -3561,11 +3603,12 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, if (!is_icalcomp_on_the_server (event->comp_data->icalcomp, event->comp_data->client)) return TRUE; - e_calendar_view_edit_appointment (E_CALENDAR_VIEW (week_view), - event->comp_data->client, - event->comp_data->icalcomp, EDIT_EVENT_AUTODETECT); + e_calendar_view_edit_appointment ( + E_CALENDAR_VIEW (week_view), + event->comp_data->client, + event->comp_data->icalcomp, EDIT_EVENT_AUTODETECT); - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); return TRUE; case GDK_BUTTON_PRESS: tooltip_destroy (week_view, item); @@ -3592,12 +3635,13 @@ 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, - event_num); + e_week_view_show_popup_menu ( + week_view, + (GdkEventButton *) gdkevent, + event_num); - g_signal_stop_emission_by_name (G_OBJECT (item->canvas), - "button_press_event"); + g_signal_stop_emission_by_name ( + item->canvas, "button_press_event"); return TRUE; } @@ -3608,7 +3652,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, /* Only let the EText handle the event while editing. */ if (!E_TEXT (item)->editing) { - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); if (gdkevent) { week_view->drag_event_x = gdkevent->button.x; @@ -3634,16 +3678,17 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, if (week_view->pressed_event_num != -1 && week_view->pressed_event_num == event_num && week_view->pressed_span_num == span_num) { - e_week_view_start_editing_event (week_view, - event_num, - span_num, - NULL); + e_week_view_start_editing_event ( + week_view, + event_num, + span_num, + NULL); week_view->pressed_event_num = -1; } /* Stop the signal last or we will also stop any * other events getting to the EText item. */ - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); return TRUE; } week_view->pressed_event_num = -1; @@ -3759,9 +3804,11 @@ static gboolean e_week_view_event_move (ECalendarView *cal_view, ECalViewMoveDir icaltime_adjust (&start_time ,adjust_days,0,0,0); icaltime_adjust (&end_time ,adjust_days,0,0,0); - start_dt = icaltime_as_timet_with_zone (start_time, + start_dt = icaltime_as_timet_with_zone ( + start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); - end_dt = icaltime_as_timet_with_zone (end_time, + end_dt = icaltime_as_timet_with_zone ( + end_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); current_start_day = e_week_view_get_day_offset_of_event (week_view,start_dt); @@ -3948,8 +3995,8 @@ e_week_view_on_editing_started (EWeekView *week_view, /* We need to reshape long events so the whole width is used while * 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); + e_week_view_reshape_event_span ( + week_view, event_num, span_num); } g_signal_emit_by_name (week_view, "selection_changed"); @@ -4048,8 +4095,13 @@ e_week_view_on_editing_stopped (EWeekView *week_view, gchar *uid = NULL; GError *error = NULL; - if (!e_cal_client_create_object_sync (client, icalcomp, &uid, NULL, &error)) { - g_message (G_STRLOC ": Could not create the object! %s", error ? error->message : "Unknown error"); + e_cal_client_create_object_sync ( + client, icalcomp, &uid, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not create the object! %s", + error->message); uid = NULL; } else { if (uid) @@ -4399,8 +4451,9 @@ e_week_view_add_new_event_in_selected_range (EWeekView *week_view, g_object_unref (comp); return FALSE; } else { - e_week_view_start_editing_event (week_view, event_num, 0, - (gchar *) initial_text); + e_week_view_start_editing_event ( + week_view, event_num, 0, + (gchar *) initial_text); } g_object_unref (comp); @@ -4571,8 +4624,9 @@ static gboolean e_week_view_popup_menu (GtkWidget *widget) { EWeekView *week_view = E_WEEK_VIEW (widget); - e_week_view_show_popup_menu (week_view, NULL, - week_view->editing_event_num); + e_week_view_show_popup_menu ( + week_view, NULL, + week_view->editing_event_num); return TRUE; } @@ -4635,16 +4689,18 @@ e_week_view_on_jump_button_event (GnomeCanvasItem *item, if (focus_event->in) { week_view->focused_jump_button = day; pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **) jump_xpm_focused); - gnome_canvas_item_set (week_view->jump_buttons[day], - "GnomeCanvasPixbuf::pixbuf", - pixbuf, NULL); + gnome_canvas_item_set ( + week_view->jump_buttons[day], + "GnomeCanvasPixbuf::pixbuf", + pixbuf, NULL); } else { week_view->focused_jump_button = E_WEEK_VIEW_JUMP_BUTTON_NO_FOCUS; pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **) jump_xpm); - gnome_canvas_item_set (week_view->jump_buttons[day], - "GnomeCanvasPixbuf::pixbuf", - pixbuf, NULL); + gnome_canvas_item_set ( + week_view->jump_buttons[day], + "GnomeCanvasPixbuf::pixbuf", + pixbuf, NULL); } if (pixbuf) g_object_unref (pixbuf); diff --git a/calendar/gui/ea-cal-view-event.c b/calendar/gui/ea-cal-view-event.c index 220e4415eb..35c3819062 100644 --- a/calendar/gui/ea-cal-view-event.c +++ b/calendar/gui/ea-cal-view-event.c @@ -111,8 +111,9 @@ ea_cal_view_event_get_type (void) * we are run-time deriving from (atk object for E_TEXT, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - E_TYPE_TEXT); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + E_TYPE_TEXT); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); @@ -120,12 +121,15 @@ ea_cal_view_event_get_type (void) tinfo.instance_size = query.instance_size; /* we inherit the component, text and other interfaces from E_TEXT */ - type = g_type_register_static (derived_atk_type, - "EaCalViewEvent", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); - g_type_add_interface_static (type, ATK_TYPE_ACTION, - &atk_action_info); + type = g_type_register_static ( + derived_atk_type, + "EaCalViewEvent", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); + g_type_add_interface_static ( + type, ATK_TYPE_ACTION, + &atk_action_info); } @@ -171,7 +175,8 @@ static void ea_cal_view_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); ++n_ea_cal_view_event_destroyed; - printf ("ACC_DEBUG: n_ea_cal_view_event_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_cal_view_event_destroyed = %d\n", n_ea_cal_view_event_destroyed); } #endif @@ -227,15 +232,17 @@ ea_cal_view_event_new (GObject *obj) if (!atk_obj) { static AtkRole event_role = ATK_ROLE_INVALID; - atk_obj = ATK_OBJECT (g_object_new (EA_TYPE_CAL_VIEW_EVENT, - NULL)); + atk_obj = ATK_OBJECT ( + g_object_new (EA_TYPE_CAL_VIEW_EVENT, + NULL)); atk_object_initialize (atk_obj, target_obj); if (event_role == ATK_ROLE_INVALID) event_role = atk_role_register ("Calendar Event"); atk_obj->role = event_role; #ifdef ACC_DEBUG ++n_ea_cal_view_event_created; - printf ("ACC_DEBUG: n_ea_cal_view_event_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_cal_view_event_created = %d\n", n_ea_cal_view_event_created); #endif } @@ -313,8 +320,9 @@ ea_cal_view_event_get_name (AtkObject *accessible) ATK_OBJECT_CLASS (parent_class)->set_name (accessible, name_string); #ifdef ACC_DEBUG - printf ("EvoAcc: name for event accobj=%p, is %s\n", - (gpointer) accessible, new_name); + printf ( + "EvoAcc: name for event accobj=%p, is %s\n", + (gpointer) accessible, new_name); #endif g_free (name_string); return accessible->name; diff --git a/calendar/gui/ea-cal-view.c b/calendar/gui/ea-cal-view.c index d7c700893e..1777a45790 100644 --- a/calendar/gui/ea-cal-view.c +++ b/calendar/gui/ea-cal-view.c @@ -97,18 +97,21 @@ ea_cal_view_get_type (void) * we are run-time deriving from (GailWidget, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - GTK_TYPE_WIDGET); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GTK_TYPE_WIDGET); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaCalView", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_ACTION, - &atk_action_info); + type = g_type_register_static ( + derived_atk_type, + "EaCalView", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_ACTION, + &atk_action_info); } return type; @@ -276,8 +279,9 @@ ea_cal_view_event_added_cb (ECalendarView *cal_view, #ifdef ACC_DEBUG printf ("AccDebug: event=%p added\n", (gpointer) event); #endif - g_signal_emit_by_name (atk_obj, "children_changed::add", - index, event_atk_obj, NULL); + g_signal_emit_by_name ( + atk_obj, "children_changed::add", + index, event_atk_obj, NULL); } } diff --git a/calendar/gui/ea-calendar-helpers.c b/calendar/gui/ea-calendar-helpers.c index 2ec6d93656..e0234d0a08 100644 --- a/calendar/gui/ea-calendar-helpers.c +++ b/calendar/gui/ea-calendar-helpers.c @@ -123,8 +123,9 @@ ea_calendar_helpers_get_cal_view_event_from (GnomeCanvasItem *canvas_item) gint event_day, event_num; EDayViewEvent *day_view_event; EDayView *day_view = E_DAY_VIEW (cal_view); - event_found = e_day_view_find_event_from_item (day_view, canvas_item, - &event_day, &event_num); + event_found = e_day_view_find_event_from_item ( + day_view, canvas_item, + &event_day, &event_num); if (!event_found) return NULL; if (event_day == E_DAY_VIEW_LONG_EVENT) { @@ -143,15 +144,16 @@ ea_calendar_helpers_get_cal_view_event_from (GnomeCanvasItem *canvas_item) gint event_num, span_num; EWeekViewEvent *week_view_event; EWeekView *week_view = E_WEEK_VIEW (cal_view); - event_found = e_week_view_find_event_from_item (week_view, - canvas_item, - &event_num, - &span_num); + event_found = e_week_view_find_event_from_item ( + week_view, + canvas_item, + &event_num, + &span_num); if (!event_found) return NULL; - week_view_event = &g_array_index (week_view->events, EWeekViewEvent, - event_num); + week_view_event = &g_array_index ( + week_view->events, EWeekViewEvent, event_num); cal_view_event = (ECalendarViewEvent *) week_view_event; } diff --git a/calendar/gui/ea-day-view-cell.c b/calendar/gui/ea-day-view-cell.c index 8410e00a92..5e25a2aae1 100644 --- a/calendar/gui/ea-day-view-cell.c +++ b/calendar/gui/ea-day-view-cell.c @@ -55,8 +55,9 @@ e_day_view_cell_get_type (void) NULL /* value table */ }; - type = g_type_register_static (G_TYPE_OBJECT, - "EDayViewCell", &tinfo, 0); + type = g_type_register_static ( + G_TYPE_OBJECT, + "EDayViewCell", &tinfo, 0); } return type; @@ -141,10 +142,12 @@ ea_day_view_cell_get_type (void) NULL }; - type = g_type_register_static (ATK_TYPE_GOBJECT_ACCESSIBLE, - "EaDayViewCell", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); + type = g_type_register_static ( + ATK_TYPE_GOBJECT_ACCESSIBLE, + "EaDayViewCell", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); } return type; @@ -185,7 +188,8 @@ ea_day_view_cell_new (GObject *obj) #ifdef ACC_DEBUG ++n_ea_day_view_cell_created; - printf ("ACC_DEBUG: n_ea_day_view_cell_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_day_view_cell_created = %d\n", n_ea_day_view_cell_created); #endif return atk_object; @@ -197,7 +201,8 @@ static void ea_day_view_cell_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); ++n_ea_day_view_cell_destroyed; - printf ("ACC_DEBUG: n_ea_day_view_cell_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_day_view_cell_destroyed = %d\n", n_ea_day_view_cell_destroyed); } #endif @@ -225,10 +230,12 @@ ea_day_view_cell_get_name (AtkObject *accessible) cell = E_DAY_VIEW_CELL (g_obj); main_item = cell->day_view->main_canvas_item; ea_main_item = atk_gobject_accessible_for_object (G_OBJECT (main_item)); - column_label = atk_table_get_column_description (ATK_TABLE (ea_main_item), - cell->column); - row_label = atk_table_get_row_description (ATK_TABLE (ea_main_item), - cell->row); + column_label = atk_table_get_column_description ( + ATK_TABLE (ea_main_item), + cell->column); + row_label = atk_table_get_row_description ( + ATK_TABLE (ea_main_item), + cell->row); new_name = g_strconcat (column_label, " ", row_label, NULL); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, new_name); g_free (new_name); @@ -311,8 +318,9 @@ ea_day_view_cell_get_index_in_parent (AtkObject *accessible) cell = E_DAY_VIEW_CELL (g_obj); parent = atk_object_get_parent (accessible); - return atk_table_get_index_at (ATK_TABLE (parent), - cell->row, cell->column); + return atk_table_get_index_at ( + ATK_TABLE (parent), + cell->row, cell->column); } /* Atk Component Interface */ @@ -356,12 +364,14 @@ component_interface_get_extents (AtkComponent *component, main_canvas = cell->day_view->main_canvas; atk_obj = atk_gobject_accessible_for_object (G_OBJECT (main_canvas)); - atk_component_get_extents (ATK_COMPONENT (atk_obj), - x, y, - &day_view_width, &day_view_height, - coord_type); - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas), - &scroll_x, &scroll_y); + atk_component_get_extents ( + ATK_COMPONENT (atk_obj), + x, y, + &day_view_width, &day_view_height, + coord_type); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (day_view->main_canvas), + &scroll_x, &scroll_y); *x += day_view->day_offsets[cell->column] - scroll_x; *y += day_view->row_height * cell->row - scroll_y; @@ -391,9 +401,10 @@ component_interface_grab_focus (AtkComponent *comp) day_view->selection_start_row = cell->row; day_view->selection_end_row = cell->row; - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_row); + e_day_view_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); e_day_view_update_calendar_selection_time (day_view); gtk_widget_queue_draw (day_view->main_canvas); diff --git a/calendar/gui/ea-day-view-main-item.c b/calendar/gui/ea-day-view-main-item.c index 19c91384da..3367833a4f 100644 --- a/calendar/gui/ea-day-view-main-item.c +++ b/calendar/gui/ea-day-view-main-item.c @@ -200,22 +200,27 @@ ea_day_view_main_item_get_type (void) * */ - factory = atk_registry_get_factory (atk_get_default_registry (), - e_day_view_main_item_get_type ()); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + e_day_view_main_item_get_type ()); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaDayViewMainItem", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); - g_type_add_interface_static (type, ATK_TYPE_TABLE, - &atk_table_info); - g_type_add_interface_static (type, ATK_TYPE_SELECTION, - &atk_selection_info); + type = g_type_register_static ( + derived_atk_type, + "EaDayViewMainItem", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); + g_type_add_interface_static ( + type, ATK_TYPE_TABLE, + &atk_table_info); + g_type_add_interface_static ( + type, ATK_TYPE_SELECTION, + &atk_selection_info); } return type; @@ -249,15 +254,17 @@ ea_day_view_main_item_new (GObject *obj) g_return_val_if_fail (E_IS_DAY_VIEW_MAIN_ITEM (obj), NULL); - accessible = ATK_OBJECT (g_object_new (EA_TYPE_DAY_VIEW_MAIN_ITEM, - NULL)); + accessible = ATK_OBJECT ( + g_object_new (EA_TYPE_DAY_VIEW_MAIN_ITEM, + NULL)); atk_object_initialize (accessible, obj); accessible->role = ATK_ROLE_TABLE; #ifdef ACC_DEBUG ++n_ea_day_view_main_item_created; - printf ("ACC_DEBUG: n_ea_day_view_main_item_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_day_view_main_item_created = %d\n", n_ea_day_view_main_item_created); #endif @@ -295,7 +302,8 @@ ea_day_view_main_item_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); #ifdef ACC_DEBUG ++n_ea_day_view_main_item_destroyed; - printf ("ACC_DEBUG: n_ea_day_view_main_item_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_day_view_main_item_destroyed = %d\n", n_ea_day_view_main_item_destroyed); #endif } @@ -461,17 +469,18 @@ ea_day_view_main_item_time_change_cb (EDayView *day_view, printf ("EvoAcc: ea_day_view_main_item time changed cb\n"); #endif /* only deal with the first selected child, for now */ - item_cell = atk_selection_ref_selection (ATK_SELECTION (ea_main_item), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (ea_main_item), 0); if (item_cell) { AtkStateSet *state_set; state_set = atk_object_ref_state_set (item_cell); atk_state_set_add_state (state_set, ATK_STATE_FOCUSED); g_object_unref (state_set); - g_signal_emit_by_name (ea_main_item, - "active-descendant-changed", - item_cell); + g_signal_emit_by_name ( + ea_main_item, + "active-descendant-changed", + item_cell); g_signal_emit_by_name (data, "selection_changed"); atk_focus_tracker_notify (item_cell); @@ -594,10 +603,12 @@ ea_day_view_main_item_get_row_label (EaDayViewMainItem *ea_main_item, hour = (hour + minute / 60) % 24; minute %= 60; - e_day_view_convert_time_to_display (day_view, hour, &hour, - &suffix, &suffix_width); - return g_snprintf (buffer, buffer_size, "%i:%02i %s", - hour, minute, suffix); + e_day_view_convert_time_to_display ( + day_view, hour, &hour, + &suffix, &suffix_width); + return g_snprintf ( + buffer, buffer_size, "%i:%02i %s", + hour, minute, suffix); } static EaCellTable * @@ -619,13 +630,16 @@ ea_day_view_main_item_get_cell_data (EaDayViewMainItem *ea_main_item) main_item = E_DAY_VIEW_MAIN_ITEM (g_obj); day_view = e_day_view_main_item_get_day_view (main_item); - cell_data = g_object_get_data (G_OBJECT (ea_main_item), - "ea-day-view-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_main_item), + "ea-day-view-cell-table"); if (!cell_data) { - cell_data = ea_cell_table_create (day_view->rows, - day_view->days_shown, TRUE); - g_object_set_data (G_OBJECT (ea_main_item), - "ea-day-view-cell-table", cell_data); + cell_data = ea_cell_table_create ( + day_view->rows, + day_view->days_shown, TRUE); + g_object_set_data ( + G_OBJECT (ea_main_item), + "ea-day-view-cell-table", cell_data); } return cell_data; } @@ -637,11 +651,13 @@ ea_day_view_main_item_destory_cell_data (EaDayViewMainItem *ea_main_item) g_return_if_fail (ea_main_item); - cell_data = g_object_get_data (G_OBJECT (ea_main_item), - "ea-day-view-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_main_item), + "ea-day-view-cell-table"); if (cell_data) { - g_object_set_data (G_OBJECT (ea_main_item), - "ea-day-view-cell-table", NULL); + g_object_set_data ( + G_OBJECT (ea_main_item), + "ea-day-view-cell-table", NULL); ea_cell_table_destroy (cell_data); } } @@ -681,8 +697,9 @@ component_interface_get_extents (AtkComponent *component, day_view = e_day_view_main_item_get_day_view (main_item); ea_canvas = gtk_widget_get_accessible (day_view->main_canvas); - atk_component_get_extents (ATK_COMPONENT (ea_canvas), x, y, - width, height, coord_type); + atk_component_get_extents ( + ATK_COMPONENT (ea_canvas), x, y, + width, height, coord_type); } /* atk table interface */ @@ -728,8 +745,9 @@ table_interface_ref_at (AtkTable *table, gint index; 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); + 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); } @@ -779,8 +797,9 @@ table_interface_get_index_at (AtkTable *table, gint column) { 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); + return ea_day_view_main_item_get_child_index_at ( + ea_main_item, + row, column); } static gint @@ -809,13 +828,15 @@ table_interface_get_column_extent_at (AtkTable *table, AtkObject *child; 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); - child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item), - index); + index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + row, column); + child = atk_object_ref_accessible_child ( + ATK_OBJECT (ea_main_item), + index); if (child) - atk_component_get_size (ATK_COMPONENT (child), - &width, &height); + atk_component_get_size ( + ATK_COMPONENT (child), &width, &height); return width; } @@ -830,13 +851,15 @@ table_interface_get_row_extent_at (AtkTable *table, AtkObject *child; 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); - child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item), - index); + index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + row, column); + child = atk_object_ref_accessible_child ( + ATK_OBJECT (ea_main_item), + index); if (child) - atk_component_get_size (ATK_COMPONENT (child), - &width, &height); + atk_component_get_size ( + ATK_COMPONENT (child), &width, &height); return height; } @@ -1004,9 +1027,10 @@ table_interface_add_row_selection (AtkTable *table, day_view->selection_start_row = row; day_view->selection_end_row = row; - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_row); + e_day_view_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); e_day_view_update_calendar_selection_time (day_view); gtk_widget_queue_draw (day_view->main_canvas); return TRUE; @@ -1143,8 +1167,7 @@ table_interface_get_row_description (AtkTable *table, ea_day_view_main_item_get_row_label ( ea_main_item, row, buffer, sizeof (buffer)); ea_cell_table_set_row_label (cell_data, row, buffer); - description = ea_cell_table_get_row_label (cell_data, - row); + description = ea_cell_table_get_row_label (cell_data, row); } return description; } @@ -1201,9 +1224,10 @@ selection_interface_add_selection (AtkSelection *selection, day_view->selection_start_row = row; day_view->selection_end_row = row; - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_row); + e_day_view_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); e_day_view_update_calendar_selection_time (day_view); gtk_widget_queue_draw (day_view->main_canvas); return TRUE; @@ -1257,9 +1281,10 @@ selection_interface_ref_selection (AtkSelection *selection, main_item = E_DAY_VIEW_MAIN_ITEM (g_obj); day_view = e_day_view_main_item_get_day_view (main_item); - start_index = ea_day_view_main_item_get_child_index_at (ea_main_item, - day_view->selection_start_row, - day_view->selection_start_day); + start_index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + day_view->selection_start_row, + day_view->selection_start_day); return ea_day_view_main_item_ref_child (ATK_OBJECT (selection), start_index + i); } @@ -1285,12 +1310,14 @@ selection_interface_get_selection_count (AtkSelection *selection) if (day_view->selection_start_day == -1 || day_view->selection_start_row == -1) return 0; - start_index = ea_day_view_main_item_get_child_index_at (ea_main_item, - day_view->selection_start_row, - day_view->selection_start_day); - end_index = ea_day_view_main_item_get_child_index_at (ea_main_item, - day_view->selection_end_row, - day_view->selection_end_day); + start_index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + day_view->selection_start_row, + day_view->selection_start_day); + end_index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + day_view->selection_end_row, + day_view->selection_end_day); return end_index - start_index + 1; } diff --git a/calendar/gui/ea-day-view.c b/calendar/gui/ea-day-view.c index c053258531..66f5cb3942 100644 --- a/calendar/gui/ea-day-view.c +++ b/calendar/gui/ea-day-view.c @@ -70,16 +70,18 @@ ea_day_view_get_type (void) * our parent class EaCalView is run-time deriving. */ - factory = atk_registry_get_factory (atk_get_default_registry (), - e_calendar_view_get_type ()); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + e_calendar_view_get_type ()); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaDayView", &tinfo, 0); + type = g_type_register_static ( + derived_atk_type, + "EaDayView", &tinfo, 0); } return type; @@ -148,8 +150,11 @@ ea_day_view_get_name (AtkObject *accessible) /* To translators: Here, "It" is either like "Work Week View: July 10th - July 14th, 2006." or "Day View: Thursday July 13th, 2006." */ event_str = g_strdup_printf ( - ngettext ("It has %d event.", - "It has %d events.", n_events), n_events); + ngettext ( + "It has %d event.", + "It has %d events.", + n_events), + n_events); else /* To translators: Here, "It" is either like "Work Week View: July 10th - July 14th, 2006." or "Day View: Thursday July 13th, 2006." */ @@ -160,14 +165,16 @@ ea_day_view_get_name (AtkObject *accessible) /* To translators: First %s is the week, for example "July 10th - July 14th, 2006". Second %s is the number of events in this work week, for example "It has %d event/events." or "It has no events." */ - name_str = g_strdup_printf (_("Work Week View: %s. %s"), - label_text, event_str); + name_str = g_strdup_printf ( + _("Work Week View: %s. %s"), + label_text, event_str); else /* To translators: First %s is the day, for example "Thursday July 13th, 2006". Second %s is the number of events on this day, for example "It has %d event/events." or "It has no events." */ - name_str = g_strdup_printf (_("Day View: %s. %s"), - label_text, event_str); + name_str = g_strdup_printf ( + _("Day View: %s. %s"), + label_text, event_str); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, name_str); g_free (name_str); diff --git a/calendar/gui/ea-gnome-calendar.c b/calendar/gui/ea-gnome-calendar.c index b7ffb20597..7edf52de7d 100644 --- a/calendar/gui/ea-gnome-calendar.c +++ b/calendar/gui/ea-gnome-calendar.c @@ -83,15 +83,17 @@ ea_gnome_calendar_get_type (void) * we are run-time deriving from (GailWidget, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - GTK_TYPE_WIDGET); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GTK_TYPE_WIDGET); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaGnomeCalendar", &tinfo, 0); + type = g_type_register_static ( + derived_atk_type, + "EaGnomeCalendar", &tinfo, 0); } @@ -171,8 +173,9 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) start_tm.tm_min = start_tt.minute; start_tm.tm_sec = start_tt.second; start_tm.tm_isdst = -1; - start_tm.tm_wday = time_day_of_week (start_tt.day, start_tt.month - 1, - start_tt.year); + start_tm.tm_wday = time_day_of_week ( + start_tt.day, start_tt.month - 1, + start_tt.year); /* Take one off end_time so we don't get an extra day. */ end_tt = icaltime_from_timet_with_zone (end_time - 1, FALSE, zone); @@ -183,8 +186,9 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) end_tm.tm_min = end_tt.minute; end_tm.tm_sec = end_tt.second; end_tm.tm_isdst = -1; - end_tm.tm_wday = time_day_of_week (end_tt.day, end_tt.month - 1, - end_tt.year); + end_tm.tm_wday = time_day_of_week ( + end_tt.day, end_tt.month - 1, + end_tt.year); view = gnome_calendar_get_view (gcal); @@ -195,20 +199,25 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) if (start_tm.tm_year == end_tm.tm_year && start_tm.tm_mon == end_tm.tm_mon && start_tm.tm_mday == end_tm.tm_mday) { - e_utf8_strftime (buffer, sizeof (buffer), - _("%A %d %b %Y"), &start_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%A %d %b %Y"), &start_tm); } else if (start_tm.tm_year == end_tm.tm_year) { - e_utf8_strftime (buffer, sizeof (buffer), - _("%a %d %b"), &start_tm); - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%a %d %b %Y"), &end_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%a %d %b"), &start_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%a %d %b %Y"), &end_tm); strcat (buffer, " - "); strcat (buffer, end_buffer); } else { - e_utf8_strftime (buffer, sizeof (buffer), - _("%a %d %b %Y"), &start_tm); - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%a %d %b %Y"), &end_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%a %d %b %Y"), &start_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%a %d %b %Y"), &end_tm); strcat (buffer, " - "); strcat (buffer, end_buffer); } @@ -220,26 +229,32 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) if (start_tm.tm_mday == end_tm.tm_mday) { buffer[0] = '\0'; } else { - e_utf8_strftime (buffer, sizeof (buffer), - "%d", &start_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + "%d", &start_tm); strcat (buffer, " - "); } - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%d %b %Y"), &end_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%d %b %Y"), &end_tm); strcat (buffer, end_buffer); } else { - e_utf8_strftime (buffer, sizeof (buffer), - _("%d %b"), &start_tm); - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%d %b %Y"), &end_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%d %b"), &start_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%d %b %Y"), &end_tm); strcat (buffer, " - "); strcat (buffer, end_buffer); } } else { - e_utf8_strftime (buffer, sizeof (buffer), - _("%d %b %Y"), &start_tm); - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%d %b %Y"), &end_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%d %b %Y"), &start_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%d %b %Y"), &end_tm); strcat (buffer, " - "); strcat (buffer, end_buffer); } @@ -275,7 +290,7 @@ ea_gnome_calendar_ref_child (AtkObject *obj, g_return_val_if_fail (EA_IS_GNOME_CALENDAR (obj), NULL); /* valid child index range is [0-3] */ - if (i < 0 || i >3 ) + if (i < 0 || i >3) return NULL; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); diff --git a/calendar/gui/ea-jump-button.c b/calendar/gui/ea-jump-button.c index 11a36df54a..4b201d57a9 100644 --- a/calendar/gui/ea-jump-button.c +++ b/calendar/gui/ea-jump-button.c @@ -126,8 +126,8 @@ ea_jump_button_new (GObject *obj) if (!atk_obj) { static AtkRole event_role = ATK_ROLE_INVALID; - atk_obj = ATK_OBJECT (g_object_new (EA_TYPE_JUMP_BUTTON, - NULL)); + atk_obj = ATK_OBJECT ( + g_object_new (EA_TYPE_JUMP_BUTTON, NULL)); atk_object_initialize (atk_obj, target_obj); if (event_role == ATK_ROLE_INVALID) event_role = atk_role_register ("Jump Button"); diff --git a/calendar/gui/ea-week-view-cell.c b/calendar/gui/ea-week-view-cell.c index e8fffd8500..2ceb8e17bc 100644 --- a/calendar/gui/ea-week-view-cell.c +++ b/calendar/gui/ea-week-view-cell.c @@ -55,8 +55,9 @@ e_week_view_cell_get_type (void) NULL /* value table */ }; - type = g_type_register_static (G_TYPE_OBJECT, - "EWeekViewCell", &tinfo, 0); + type = g_type_register_static ( + G_TYPE_OBJECT, + "EWeekViewCell", &tinfo, 0); } return type; @@ -140,10 +141,12 @@ ea_week_view_cell_get_type (void) (GInterfaceFinalizeFunc) NULL, NULL }; - type = g_type_register_static (ATK_TYPE_GOBJECT_ACCESSIBLE, - "EaWeekViewCell", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); + type = g_type_register_static ( + ATK_TYPE_GOBJECT_ACCESSIBLE, + "EaWeekViewCell", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); } @@ -185,7 +188,8 @@ ea_week_view_cell_new (GObject *obj) #ifdef ACC_DEBUG ++n_ea_week_view_cell_created; - printf ("ACC_DEBUG: n_ea_week_view_cell_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_week_view_cell_created = %d\n", n_ea_week_view_cell_created); #endif return atk_object; @@ -197,7 +201,8 @@ static void ea_week_view_cell_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); ++n_ea_week_view_cell_destroyed; - printf ("ACC_DEBUG: n_ea_week_view_cell_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_week_view_cell_destroyed = %d\n", n_ea_week_view_cell_destroyed); } #endif @@ -237,10 +242,12 @@ ea_week_view_cell_get_name (AtkObject *accessible) new_row = cell->row; } - column_label = atk_table_get_column_description (ATK_TABLE (ea_main_item), - new_column); - row_label = atk_table_get_row_description (ATK_TABLE (ea_main_item), - new_row); + column_label = atk_table_get_column_description ( + ATK_TABLE (ea_main_item), + new_column); + row_label = atk_table_get_row_description ( + ATK_TABLE (ea_main_item), + new_row); new_name = g_strconcat (column_label, " ", row_label, NULL); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, new_name); g_free (new_name); @@ -321,8 +328,9 @@ ea_week_view_cell_get_index_in_parent (AtkObject *accessible) cell = E_WEEK_VIEW_CELL (g_obj); parent = atk_object_get_parent (accessible); - return atk_table_get_index_at (ATK_TABLE (parent), - cell->row, cell->column); + return atk_table_get_index_at ( + ATK_TABLE (parent), + cell->row, cell->column); } /* Atk Component Interface */ @@ -367,12 +375,14 @@ component_interface_get_extents (AtkComponent *component, main_canvas = cell->week_view->main_canvas; atk_obj = atk_gobject_accessible_for_object (G_OBJECT (main_canvas)); - atk_component_get_extents (ATK_COMPONENT (atk_obj), - x, y, - &week_view_width, &week_view_height, - coord_type); - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (week_view->main_canvas), - &scroll_x, &scroll_y); + atk_component_get_extents ( + ATK_COMPONENT (atk_obj), + x, y, + &week_view_width, &week_view_height, + coord_type); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (week_view->main_canvas), + &scroll_x, &scroll_y); start_day = week_view->display_start_day; if (week_view->multi_week_view) { if (week_view->compress_weekend && (cell->column == (5 - start_day))) { diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c index 2fe8b239c4..d4597d8fdd 100644 --- a/calendar/gui/ea-week-view-main-item.c +++ b/calendar/gui/ea-week-view-main-item.c @@ -229,22 +229,27 @@ ea_week_view_main_item_get_type (void) * */ - factory = atk_registry_get_factory (atk_get_default_registry (), - e_week_view_main_item_get_type ()); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + e_week_view_main_item_get_type ()); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaWeekViewMainItem", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); - g_type_add_interface_static (type, ATK_TYPE_TABLE, - &atk_table_info); - g_type_add_interface_static (type, ATK_TYPE_SELECTION, - &atk_selection_info); + type = g_type_register_static ( + derived_atk_type, + "EaWeekViewMainItem", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); + g_type_add_interface_static ( + type, ATK_TYPE_TABLE, + &atk_table_info); + g_type_add_interface_static ( + type, ATK_TYPE_SELECTION, + &atk_selection_info); } return type; @@ -278,15 +283,17 @@ ea_week_view_main_item_new (GObject *obj) g_return_val_if_fail (E_IS_WEEK_VIEW_MAIN_ITEM (obj), NULL); - accessible = ATK_OBJECT (g_object_new (EA_TYPE_WEEK_VIEW_MAIN_ITEM, - NULL)); + accessible = ATK_OBJECT ( + g_object_new (EA_TYPE_WEEK_VIEW_MAIN_ITEM, + NULL)); atk_object_initialize (accessible, obj); accessible->role = ATK_ROLE_TABLE; #ifdef ACC_DEBUG ++n_ea_week_view_main_item_created; - printf ("ACC_DEBUG: n_ea_week_view_main_item_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_week_view_main_item_created = %d\n", n_ea_week_view_main_item_created); #endif @@ -324,7 +331,8 @@ ea_week_view_main_item_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); #ifdef ACC_DEBUG ++n_ea_week_view_main_item_destroyed; - printf ("ACC_DEBUG: n_ea_week_view_main_item_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_week_view_main_item_destroyed = %d\n", n_ea_week_view_main_item_destroyed); #endif } @@ -490,17 +498,19 @@ ea_week_view_main_item_time_change_cb (EWeekView *week_view, printf ("EvoAcc: ea_week_view_main_item time changed cb\n"); #endif /* only deal with the first selected child, for now */ - item_cell = atk_selection_ref_selection (ATK_SELECTION (ea_main_item), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (ea_main_item), + 0); if (item_cell) { AtkStateSet *state_set; state_set = atk_object_ref_state_set (item_cell); atk_state_set_add_state (state_set, ATK_STATE_FOCUSED); g_object_unref (state_set); - g_signal_emit_by_name (ea_main_item, - "active-descendant-changed", - item_cell); + g_signal_emit_by_name ( + ea_main_item, + "active-descendant-changed", + item_cell); g_signal_emit_by_name (data, "selection_changed"); atk_focus_tracker_notify (item_cell); g_object_unref (item_cell); @@ -594,8 +604,9 @@ ea_week_view_main_item_get_row_label (EaWeekViewMainItem *ea_main_item, if (!g_obj) return 0; - return g_snprintf (buffer, buffer_size, "the %i week", - row + 1); + return g_snprintf ( + buffer, buffer_size, "the %i week", + row + 1); } @@ -618,12 +629,14 @@ ea_week_view_main_item_get_cell_data (EaWeekViewMainItem *ea_main_item) main_item = E_WEEK_VIEW_MAIN_ITEM (g_obj); week_view = e_week_view_main_item_get_week_view (main_item); - cell_data = g_object_get_data (G_OBJECT (ea_main_item), - "ea-week-view-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_main_item), + "ea-week-view-cell-table"); if (!cell_data) { cell_data = ea_cell_table_create (week_view->weeks_shown, 7, TRUE); - g_object_set_data (G_OBJECT (ea_main_item), - "ea-week-view-cell-table", cell_data); + g_object_set_data ( + G_OBJECT (ea_main_item), + "ea-week-view-cell-table", cell_data); } return cell_data; } @@ -635,11 +648,13 @@ ea_week_view_main_item_destory_cell_data (EaWeekViewMainItem *ea_main_item) g_return_if_fail (ea_main_item); - cell_data = g_object_get_data (G_OBJECT (ea_main_item), - "ea-week-view-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_main_item), + "ea-week-view-cell-table"); if (cell_data) { - g_object_set_data (G_OBJECT (ea_main_item), - "ea-week-view-cell-table", NULL); + g_object_set_data ( + G_OBJECT (ea_main_item), + "ea-week-view-cell-table", NULL); ea_cell_table_destroy (cell_data); } } @@ -679,8 +694,9 @@ component_interface_get_extents (AtkComponent *component, week_view = e_week_view_main_item_get_week_view (main_item); ea_canvas = gtk_widget_get_accessible (week_view->main_canvas); - atk_component_get_extents (ATK_COMPONENT (ea_canvas), x, y, - width, height, coord_type); + atk_component_get_extents ( + ATK_COMPONENT (ea_canvas), x, y, + width, height, coord_type); } /* atk table interface */ @@ -726,8 +742,9 @@ table_interface_ref_at (AtkTable *table, gint index; 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); + 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); } @@ -772,8 +789,9 @@ table_interface_get_index_at (AtkTable *table, gint column) { 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); + return ea_week_view_main_item_get_child_index_at ( + ea_main_item, + row, column); } static gint @@ -802,13 +820,13 @@ table_interface_get_column_extent_at (AtkTable *table, AtkObject *child; 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); - child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item), - index); + index = ea_week_view_main_item_get_child_index_at ( + ea_main_item, row, column); + child = atk_object_ref_accessible_child ( + ATK_OBJECT (ea_main_item), index); if (child) - atk_component_get_size (ATK_COMPONENT (child), - &width, &height); + atk_component_get_size ( + ATK_COMPONENT (child), &width, &height); return width; } @@ -823,13 +841,13 @@ table_interface_get_row_extent_at (AtkTable *table, AtkObject *child; 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); - child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item), - index); + index = ea_week_view_main_item_get_child_index_at ( + ea_main_item, row, column); + child = atk_object_ref_accessible_child ( + ATK_OBJECT (ea_main_item), index); if (child) - atk_component_get_size (ATK_COMPONENT (child), - &width, &height); + atk_component_get_size ( + ATK_COMPONENT (child), &width, &height); return height; } @@ -855,7 +873,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)) || @@ -898,7 +916,7 @@ table_interface_is_column_selected (AtkTable *table, else { gint i; for (i = 0; i < week_view->weeks_shown; i++) - if ((column + i *7>= week_view->selection_start_day ) && + if ((column + i *7>= week_view->selection_start_day) && (column + i *7<= week_view->selection_end_day)) return TRUE; return FALSE; @@ -961,7 +979,7 @@ table_interface_get_selected_columns (AtkTable *table, if (week_view->selection_start_day == -1) return 0; - if (week_view->selection_end_day - week_view->selection_start_day >= 6 ) { + if (week_view->selection_end_day - week_view->selection_start_day >= 6) { start_column = 0; n_columns =7; } else { @@ -1159,8 +1177,7 @@ table_interface_get_row_description (AtkTable *table, ea_week_view_main_item_get_row_label ( ea_main_item, row, buffer, sizeof (buffer)); ea_cell_table_set_row_label (cell_data, row, buffer); - description = ea_cell_table_get_row_label (cell_data, - row); + description = ea_cell_table_get_row_label (cell_data, row); } return description; } @@ -1260,9 +1277,10 @@ selection_interface_ref_selection (AtkSelection *selection, main_item = E_WEEK_VIEW_MAIN_ITEM (g_obj); week_view = e_week_view_main_item_get_week_view (main_item); - start_index = ea_week_view_main_item_get_child_index_at (ea_main_item, - week_view->selection_start_day / 7, - week_view->selection_start_day % 7); + start_index = ea_week_view_main_item_get_child_index_at ( + ea_main_item, + week_view->selection_start_day / 7, + week_view->selection_start_day % 7); return ea_week_view_main_item_ref_child (ATK_OBJECT (selection), start_index + i); } diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c index fad264888d..26cdcf2eed 100644 --- a/calendar/gui/ea-week-view.c +++ b/calendar/gui/ea-week-view.c @@ -71,16 +71,18 @@ ea_week_view_get_type (void) * our parent class EaCalView is run-time deriving. */ - factory = atk_registry_get_factory (atk_get_default_registry (), - e_calendar_view_get_type ()); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + e_calendar_view_get_type ()); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaWeekView", &tinfo, 0); + type = g_type_register_static ( + derived_atk_type, + "EaWeekView", &tinfo, 0); } @@ -156,12 +158,14 @@ ea_week_view_get_name (AtkObject *accessible) view_type = gnome_calendar_get_view (gcal); if (view_type == GNOME_CAL_MONTH_VIEW) - name_str = g_strdup_printf (_("Month View: %s. %s"), - label_text, event_str); + name_str = g_strdup_printf ( + _("Month View: %s. %s"), + label_text, event_str); else - name_str = g_strdup_printf (_("Week View: %s. %s"), - label_text, event_str); + name_str = g_strdup_printf ( + _("Week View: %s. %s"), + label_text, event_str); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, name_str); g_free (name_str); @@ -337,7 +341,8 @@ ea_week_view_ref_child (AtkObject *accessible, } #ifdef ACC_DEBUG - printf ("EvoAcc: ea_week_view_ref_child [%d]=%p\n", + printf ( + "EvoAcc: ea_week_view_ref_child [%d]=%p\n", index, (gpointer) atk_object); #endif return atk_object; diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index b98857e717..0ea1008701 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -596,67 +596,65 @@ gnome_calendar_class_init (GnomeCalendarClass *class) GNOME_CAL_DAY_VIEW, G_PARAM_READWRITE)); - signals[DATES_SHOWN_CHANGED] = - g_signal_new ("dates_shown_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GnomeCalendarClass, dates_shown_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[CALENDAR_SELECTION_CHANGED] = - g_signal_new ("calendar_selection_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GnomeCalendarClass, calendar_selection_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[SOURCE_ADDED] = - g_signal_new ("source_added", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GnomeCalendarClass, source_added), - NULL, NULL, - e_marshal_VOID__INT_OBJECT, - G_TYPE_NONE, - 2, - G_TYPE_INT, G_TYPE_OBJECT); - - signals[SOURCE_REMOVED] = - g_signal_new ("source_removed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GnomeCalendarClass, source_removed), - NULL, NULL, - e_marshal_VOID__INT_OBJECT, - G_TYPE_NONE, - 2, - G_TYPE_INT, G_TYPE_OBJECT); - - signals[GOTO_DATE] = - g_signal_new ("goto_date", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (GnomeCalendarClass, goto_date), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, - 1, - G_TYPE_INT); - - signals[CHANGE_VIEW] = - g_signal_new ("change_view", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (GnomeCalendarClass, change_view), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, - 1, - G_TYPE_INT); + signals[DATES_SHOWN_CHANGED] = g_signal_new ( + "dates_shown_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GnomeCalendarClass, dates_shown_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[CALENDAR_SELECTION_CHANGED] = g_signal_new ( + "calendar_selection_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GnomeCalendarClass, calendar_selection_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[SOURCE_ADDED] = g_signal_new ( + "source_added", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GnomeCalendarClass, source_added), + NULL, NULL, + e_marshal_VOID__INT_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_OBJECT); + + signals[SOURCE_REMOVED] = g_signal_new ( + "source_removed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GnomeCalendarClass, source_removed), + NULL, NULL, + e_marshal_VOID__INT_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_OBJECT); + + signals[GOTO_DATE] = g_signal_new ( + "goto_date", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GnomeCalendarClass, goto_date), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + signals[CHANGE_VIEW] = g_signal_new ( + "change_view", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GnomeCalendarClass, change_view), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); /* * Key bindings @@ -665,98 +663,115 @@ gnome_calendar_class_init (GnomeCalendarClass *class) binding_set = gtk_binding_set_new (G_OBJECT_CLASS_NAME (class)); /* Alt+PageUp/PageDown, go to the first/last day of the month */ - gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Up, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Up, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Down, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Down, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_Page_Up, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_KP_Page_Up, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_Page_Down, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_KP_Page_Down, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); /* Alt+Home/End, go to the first/last day of the week */ - gtk_binding_entry_add_signal (binding_set, GDK_KEY_Home, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_End, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Home, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_End, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_Home, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_End, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_KP_Home, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_KP_End, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); /*Alt+Left/Right, go to the same day of the previous/next week*/ - gtk_binding_entry_add_signal (binding_set,GDK_KEY_Left, - GDK_MOD1_MASK, - "goto_date",1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); - gtk_binding_entry_add_signal (binding_set,GDK_KEY_KP_Left, - GDK_MOD1_MASK, - "goto_date",1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); - gtk_binding_entry_add_signal (binding_set,GDK_KEY_Right, - GDK_MOD1_MASK, - "goto_date",1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); - gtk_binding_entry_add_signal (binding_set,GDK_KEY_KP_Right, - GDK_MOD1_MASK, - "goto_date",1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); + gtk_binding_entry_add_signal ( + binding_set,GDK_KEY_Left, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); + gtk_binding_entry_add_signal ( + binding_set,GDK_KEY_KP_Left, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); + gtk_binding_entry_add_signal ( + binding_set,GDK_KEY_Right, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); + gtk_binding_entry_add_signal ( + binding_set,GDK_KEY_KP_Right, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); /* Ctrl+Y/J/K/M/L to switch between * DayView/WorkWeekView/WeekView/MonthView/ListView */ - gtk_binding_entry_add_signal (binding_set, GDK_KEY_y, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_DAY_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_j, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_WORK_WEEK_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_k, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_WEEK_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_m, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_MONTH_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_l, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_LIST_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_y, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_DAY_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_j, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_WORK_WEEK_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_k, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_WEEK_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_m, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_MONTH_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_l, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_LIST_VIEW); /* init the accessibility support for gnome_calendar */ gnome_calendar_a11y_init (); @@ -1091,12 +1106,13 @@ adjust_client_view_sexp (GnomeCalendar *gcal, end = isodate_from_time_t (end_time); if (sexp) { - new_sexp = g_strdup_printf ("(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\") %s)", - start, end, gcal_get_default_tzloc (gcal), - sexp); + new_sexp = g_strdup_printf ( + "(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\") %s)", + start, end, gcal_get_default_tzloc (gcal), sexp); } else { - new_sexp = g_strdup_printf ("(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", - start, end, gcal_get_default_tzloc (gcal)); + new_sexp = g_strdup_printf ( + "(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", + start, end, gcal_get_default_tzloc (gcal)); } g_free (start); @@ -1326,8 +1342,9 @@ update_todo_view_async (struct _mupdate_todo_msg *msg) model = e_task_table_get_model (E_TASK_TABLE (priv->task_table)); if ((sexp = calendar_config_get_hide_completed_tasks_sexp (FALSE)) != NULL) { - priv->todo_sexp = g_strdup_printf ("(and %s %s)", sexp, - priv->sexp ? priv->sexp : ""); + priv->todo_sexp = g_strdup_printf ( + "(and %s %s)", sexp, + priv->sexp ? priv->sexp : ""); e_cal_model_set_search_query (model, priv->todo_sexp); g_free (sexp); } else { @@ -2221,8 +2238,9 @@ gnome_calendar_update_date_navigator (GnomeCalendar *gcal) time_to_gdate_with_zone (&end_date, end, timezone); g_date_subtract_days (&end_date, 1); - e_calendar_item_set_selection (priv->date_navigator->calitem, - &start_date, &end_date); + e_calendar_item_set_selection ( + priv->date_navigator->calitem, + &start_date, &end_date); } void @@ -2312,8 +2330,9 @@ gnome_calendar_purge (GnomeCalendar *gcal, start = isodate_from_time_t (0); end = isodate_from_time_t (older_than); - sexp = g_strdup_printf ("(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", - start, end, gcal_get_default_tzloc (gcal)); + sexp = g_strdup_printf ( + "(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", + start, end, gcal_get_default_tzloc (gcal)); gcal_update_status_message (gcal, _("Purging"), -1); @@ -2370,7 +2389,7 @@ gnome_calendar_purge (GnomeCalendar *gcal, recur_id = icalcomponent_get_recurrenceid (m->data); - if (!icaltime_is_null_time (recur_id) ) + if (!icaltime_is_null_time (recur_id)) rid = icaltime_as_ical_string_r (recur_id); e_cal_client_remove_object_sync ( diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 738baa3654..e77f88aa24 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -646,8 +646,9 @@ comp_from (ECalComponentItipMethod method, e_cal_component_get_organizer (comp, &organizer); if (organizer.value == NULL) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("An organizer must be set.")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("An organizer must be set.")); return NULL; } return g_strdup (itip_strip_mailto (organizer.value)); @@ -694,16 +695,18 @@ comp_to_list (ESourceRegistry *registry, e_cal_component_get_attendee_list (comp, &attendees); len = g_slist_length (attendees); if (len <= 0) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("At least one attendee is necessary")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("At least one attendee is necessary")); e_cal_component_free_attendee_list (attendees); return NULL; } e_cal_component_get_organizer (comp, &organizer); if (organizer.value == NULL) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("An organizer must be set.")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("An organizer must be set.")); return NULL; } @@ -753,9 +756,6 @@ comp_to_list (ESourceRegistry *registry, e_destination_set_email ( destination, itip_strip_mailto (att->value)); g_ptr_array_add (array, destination); - d (printf ("itip-utils.c: comp_to_list: name: %s, email: %s\n", - e_destination_get_name (destination), - e_destination_get_email (destination))); } g_free (sender); e_cal_component_free_attendee_list (attendees); @@ -815,8 +815,9 @@ comp_to_list (ESourceRegistry *registry, case E_CAL_COMPONENT_METHOD_DECLINECOUNTER: e_cal_component_get_organizer (comp, &organizer); if (organizer.value == NULL) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("An organizer must be set.")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("An organizer must be set.")); return NULL; } @@ -1121,9 +1122,10 @@ comp_server_send (ECalComponentItipMethod method, e_notice ( NULL, GTK_MESSAGE_ERROR, _("Unable to book a resource, the " - "new event collides with some other.")); + "new event collides with some other.")); } else { - e_notice (NULL, GTK_MESSAGE_ERROR, + e_notice ( + NULL, GTK_MESSAGE_ERROR, _("Unable to book a resource, error: %s"), error->message); } @@ -1299,14 +1301,16 @@ comp_minimal (ESourceRegistry *registry, e_cal_component_set_attendee_list (clone, attendees); if (!comp_limit_attendees (registry, clone)) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("You must be an attendee of the event.")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("You must be an attendee of the event.")); goto error; } } - itt = icaltime_from_timet_with_zone (time (NULL), FALSE, - icaltimezone_get_utc_timezone ()); + itt = icaltime_from_timet_with_zone ( + time (NULL), FALSE, + icaltimezone_get_utc_timezone ()); e_cal_component_set_dtstamp (clone, &itt); e_cal_component_get_organizer (comp, &organizer); @@ -1397,8 +1401,9 @@ comp_compliant (ESourceRegistry *registry, struct icaltimetype itt; clone = e_cal_component_clone (comp); - itt = icaltime_from_timet_with_zone (time (NULL), FALSE, - icaltimezone_get_utc_timezone ()); + itt = icaltime_from_timet_with_zone ( + time (NULL), FALSE, + icaltimezone_get_utc_timezone ()); e_cal_component_set_dtstamp (clone, &itt); /* Make UNTIL date a datetime in a simple recurrence */ @@ -1694,7 +1699,8 @@ itip_send_comp (ESourceRegistry *registry, /* check whether backend could handle sending requests/updates */ if (method != E_CAL_COMPONENT_METHOD_PUBLISH && - e_client_check_capability (E_CLIENT (cal_client), + e_client_check_capability ( + E_CLIENT (cal_client), CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) { if (users) { g_slist_foreach (users, (GFunc) g_free, NULL); @@ -1932,23 +1938,27 @@ reply_to_calendar_comp (ESourceRegistry *registry, "</b><br><br><table>"); if (orig_from && *orig_from) - g_string_append_printf (body, + g_string_append_printf ( + body, "<tr><td><b>From</b></td>" "<td>:</td><td>%s</td></tr>", orig_from); g_free (orig_from); if (subject) - g_string_append_printf (body, + g_string_append_printf ( + body, "<tr><td><b>Subject</b></td>" "<td>:</td><td>%s</td></tr>", subject); g_free (subject); - g_string_append_printf (body, + g_string_append_printf ( + body, "<tr><td><b>Location</b></td>" "<td>:</td><td>%s</td></tr>", location); if (time) - g_string_append_printf (body, + g_string_append_printf ( + body, "<tr><td><b>Time</b></td>" "<td>:</td><td>%s</td></tr>", time); g_free (time); @@ -2004,8 +2014,9 @@ itip_publish_begin (ECalComponent *pub_comp, for (prop = icalcomponent_get_first_property (icomp, ICAL_FREEBUSY_PROPERTY); prop != NULL; - prop = icalcomponent_get_next_property (icomp, - ICAL_FREEBUSY_PROPERTY)) + prop = icalcomponent_get_next_property ( + icomp, + ICAL_FREEBUSY_PROPERTY)) { icalproperty *p; @@ -2058,8 +2069,8 @@ comp_fb_normalize (icalcomponent *icomp) iclone = icalcomponent_new (ICAL_VFREEBUSY_COMPONENT); - prop = icalcomponent_get_first_property (icomp, - ICAL_ORGANIZER_PROPERTY); + prop = icalcomponent_get_first_property ( + icomp, ICAL_ORGANIZER_PROPERTY); if (prop) { p = icalproperty_new_clone (prop); icalcomponent_add_property (iclone, p); @@ -2071,15 +2082,13 @@ comp_fb_normalize (icalcomponent *icomp) itt = icalcomponent_get_dtend (icomp); icalcomponent_set_dtend (iclone, itt); - fb_count = icalcomponent_count_properties (icomp, - ICAL_FREEBUSY_PROPERTY); + fb_count = icalcomponent_count_properties ( + icomp, ICAL_FREEBUSY_PROPERTY); ipt = g_new0 (struct icalperiodtype, fb_count + 1); - for (prop = icalcomponent_get_first_property (icomp, - ICAL_FREEBUSY_PROPERTY); + for (prop = icalcomponent_get_first_property (icomp, ICAL_FREEBUSY_PROPERTY); prop != NULL; - prop = icalcomponent_get_next_property (icomp, - ICAL_FREEBUSY_PROPERTY)) + prop = icalcomponent_get_next_property (icomp, ICAL_FREEBUSY_PROPERTY)) { ipt[i] = icalproperty_get_freebusy (prop); i++; @@ -2103,8 +2112,9 @@ comp_fb_normalize (icalcomponent *icomp) if (uid) icalcomponent_set_uid (iclone, uid); - itt = icaltime_from_timet_with_zone (time (NULL), FALSE, - icaltimezone_get_utc_timezone ()); + itt = icaltime_from_timet_with_zone ( + time (NULL), FALSE, + icaltimezone_get_utc_timezone ()); icalcomponent_set_dtstamp (iclone, itt); prop = icalcomponent_get_first_property (icomp, ICAL_URL_PROPERTY); @@ -2178,15 +2188,17 @@ itip_publish_comp (ECalClient *cal_client, soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT); ical_string = icalcomponent_as_ical_string_r (toplevel); - soup_message_set_request (msg, "text/calendar", SOUP_MEMORY_TEMPORARY, - ical_string, strlen (ical_string)); + soup_message_set_request ( + msg, "text/calendar", SOUP_MEMORY_TEMPORARY, + ical_string, strlen (ical_string)); /* send message to server */ soup_session_send_message (session, msg); if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { - g_warning (G_STRLOC ": Could not publish Free/Busy: %d: %s", - msg->status_code, - msg->reason_phrase); + g_warning ( + G_STRLOC ": Could not publish Free/Busy: %d: %s", + msg->status_code, + msg->reason_phrase); g_object_unref (msg); g_object_unref (session); g_free (ical_string); diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 9f4bb7b9c9..85a293e6fa 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -355,8 +355,9 @@ print_border_with_triangles (GtkPrintContext *pc, cairo_move_to (cr, x1, y1); if (left_triangle_width > 0.0) - cairo_line_to (cr, x1 - left_triangle_width, - (y1 + y2) / 2); + cairo_line_to ( + cr, x1 - left_triangle_width, + (y1 + y2) / 2); cairo_line_to (cr, x1, y2); cairo_line_to (cr, x2, y2); @@ -379,15 +380,17 @@ print_border_with_triangles (GtkPrintContext *pc, cairo_move_to (cr, x1, y1); if (left_triangle_width > 0.0) - cairo_line_to (cr, x1 - left_triangle_width, - (y1 + y2) / 2); + cairo_line_to ( + cr, x1 - left_triangle_width, + (y1 + y2) / 2); cairo_line_to (cr, x1, y2); cairo_line_to (cr, x2, y2); if (right_triangle_width > 0.0) - cairo_line_to (cr, x2 + right_triangle_width, - (y1 + y2) / 2); + cairo_line_to ( + cr, x2 + right_triangle_width, + (y1 + y2) / 2); cairo_line_to (cr, x2, y1); cairo_close_path (cr); @@ -458,16 +461,16 @@ print_rectangle (GtkPrintContext *context, */ static PangoLayout * shrink_text_to_line (PangoLayout *layout, - gint layout_width, - gint layout_height, - GtkPrintContext *context, - PangoFontDescription *desc, - const gchar *text, - PangoAlignment alignment, - gdouble x1, - gdouble x2, - gdouble y1, - gdouble y2) + gint layout_width, + gint layout_height, + GtkPrintContext *context, + PangoFontDescription *desc, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { gint new_length; @@ -477,7 +480,7 @@ shrink_text_to_line (PangoLayout *layout, new_length = (gint) floor (pango_units_from_double (x2 - x1) / (gdouble) layout_width * (gdouble) strlen (text)); - if (new_length < strlen(text)) { + if (new_length < strlen (text)) { g_object_unref (layout); /* Destroy old layout */ layout = gtk_print_context_create_pango_layout (context); @@ -494,14 +497,14 @@ shrink_text_to_line (PangoLayout *layout, * or PANGO_ALIGN_CENTER. Text is truncated if too long for cell. */ static gdouble print_text_line (GtkPrintContext *context, - PangoFontDescription *desc, - const gchar *text, - PangoAlignment alignment, - gdouble x1, - gdouble x2, - gdouble y1, - gdouble y2, - gboolean shrink) + PangoFontDescription *desc, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2, + gboolean shrink) { PangoLayout *layout; gint layout_width, layout_height; @@ -518,7 +521,8 @@ print_text_line (GtkPrintContext *context, pango_layout_get_size (layout, &layout_width, &layout_height); if (shrink && layout_width > pango_units_from_double (x2 - x1)) /* Too wide */ - layout = shrink_text_to_line (layout, layout_width, layout_height, + layout = shrink_text_to_line ( + layout, layout_width, layout_height, context, desc, text, alignment, x1, x2, y1, y2); @@ -547,19 +551,20 @@ print_text_line (GtkPrintContext *context, } /* Prints 1 or more lines 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. */ + * the horizontal alignment can be either PANGO_ALIGN_LEFT, PANGO_ALIGN_RIGHT, + * or PANGO_ALIGN_CENTER. */ static double print_text (GtkPrintContext *context, - PangoFontDescription *desc, + PangoFontDescription *desc, const gchar *text, - PangoAlignment alignment, + PangoAlignment alignment, gdouble x1, - gdouble x2, - gdouble y1, - gdouble y2) + gdouble x2, + gdouble y1, + gdouble y2) { - return print_text_line (context, desc, + return print_text_line ( + context, desc, text, alignment, x1, x2, y1, y2, FALSE); } @@ -587,13 +592,13 @@ print_text_size_bold (GtkPrintContext *context, /* gets/frees the font for you, as a bold font - absolute size parameter */ static double print_text_abs_bold (GtkPrintContext *context, - const gchar *text, - gdouble font_size, - PangoAlignment alignment, - gdouble x1, - gdouble x2, - gdouble y1, - gdouble y2) + const gchar *text, + gdouble font_size, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { PangoFontDescription *font; gdouble w; @@ -789,8 +794,9 @@ print_month_small (GtkPrintContext *context, font = get_font_for_size (header_size, PANGO_WEIGHT_BOLD); if (bordertitle) print_border (context, x1, x2, y1, y1 + header_size, 1.0, 0.9); - print_text (context, font, buf, PANGO_ALIGN_CENTER, x1, x2, - y1, y1 + header_size); + print_text ( + context, font, buf, PANGO_ALIGN_CENTER, x1, x2, + y1, y1 + header_size); pango_font_description_free (font); y1 += header_size; @@ -898,23 +904,26 @@ print_month_small (GtkPrintContext *context, sprintf (buf, "%d", day); /* this is a slow messy way to do this ... but easy ... */ - e_cal_model_generate_instances_sync (gnome_calendar_get_model (gcal), now, - time_day_end_with_zone (now, zone), - instance_cb, &found); + e_cal_model_generate_instances_sync ( + gnome_calendar_get_model (gcal), now, + time_day_end_with_zone (now, zone), + instance_cb, &found); font = found ? font_bold : font_normal; next = time_add_day_with_zone (now, 1, zone); if ((now >= greystart && now < greyend) || (greystart >= now && greystart < next)) { - print_border (context, - cell_left, cell_right, - cell_top, cell_bottom, - -1.0, 0.75); + print_border ( + context, + cell_left, cell_right, + cell_top, cell_bottom, + -1.0, 0.75); } - print_text (context, font, buf, PANGO_ALIGN_RIGHT, - cell_left, text_right, - cell_top, cell_bottom); + print_text ( + context, font, buf, PANGO_ALIGN_RIGHT, + cell_left, text_right, + cell_top, cell_bottom); now = next; } @@ -1047,10 +1056,10 @@ print_day_background (GtkPrintContext *context, hour_minute_width = evo_calendar_print_renderer_get_width ( context, font_minute, use_24_hour ? "00" : _("am")); if (!use_24_hour) - hour_minute_width = - MAX (hour_minute_width, + hour_minute_width = MAX ( + hour_minute_width, evo_calendar_print_renderer_get_width ( - context, font_minute, _("pm"))); + context, font_minute, _("pm"))); row = 0; hour_minute_x = left + width - hour_minute_width - 3; @@ -1075,12 +1084,14 @@ print_day_background (GtkPrintContext *context, /* the hour label/minute */ sprintf (buf, "%d", hour); - print_text (context, font_hour, buf, PANGO_ALIGN_RIGHT, - left, hour_minute_x, - y - yinc, y - yinc + hour_font_size); - print_text (context, font_minute, minute, PANGO_ALIGN_LEFT, - hour_minute_x, left + width - 3, - y - yinc, y - yinc + minute_font_size); + print_text ( + context, font_hour, buf, PANGO_ALIGN_RIGHT, + left, hour_minute_x, + y - yinc, y - yinc + hour_font_size); + print_text ( + context, font_minute, minute, PANGO_ALIGN_LEFT, + hour_minute_x, left + width - 3, + y - yinc, y - yinc + minute_font_size); /* Draw the horizontal line between hours, across the entire width of the day view. */ @@ -1186,9 +1197,10 @@ print_day_details_cb (ECalComponent *comp, ECalModelGenerateInstancesData *mdata = (ECalModelGenerateInstancesData *) data; struct pdinfo *pdi = (struct pdinfo *) mdata->cb_data; - print_day_add_event (mdata->comp_data, istart, iend, - pdi->zone, pdi->days_shown, pdi->day_starts, - pdi->long_events, pdi->events); + print_day_add_event ( + mdata->comp_data, istart, iend, + pdi->zone, pdi->days_shown, pdi->day_starts, + pdi->long_events, pdi->events); return TRUE; } @@ -1370,9 +1382,10 @@ print_day_long_event (GtkPrintContext *context, red = green = blue = 0.95; e_cal_model_get_rgb_color_for_component ( model, event->comp_data, &red, &green, &blue); - print_border_with_triangles (context, x1, x2, y1, y2, 0.5, red, green, blue, - left_triangle_width, - right_triangle_width); + print_border_with_triangles ( + context, x1, x2, y1, y2, 0.5, red, green, blue, + left_triangle_width, + right_triangle_width); /* If the event starts after the first day being printed, we need to * print the start time. */ @@ -1466,8 +1479,9 @@ print_day_event (GtkPrintContext *context, y1 = top + start_row * row_height; y2 = top + (end_row + 1) * row_height; #if 0 - g_print ("Event: %g,%g %g,%g\n row_height: %g start_row: %i top: %g rows: %i\n", - x1, y1, x2, y2, row_height, start_row, top, pdi->rows); + g_print ( + "Event: %g,%g %g,%g\n row_height: %g start_row: %i top: %g rows: %i\n", + x1, y1, x2, y2, row_height, start_row, top, pdi->rows); #endif red = green = blue = 0.95; @@ -1498,8 +1512,9 @@ print_day_event (GtkPrintContext *context, end_buffer, sizeof (end_buffer)); t = text; - text = g_strdup_printf ("%s - %s %s ", start_buffer, - end_buffer, text); + text = g_strdup_printf ( + "%s - %s %s ", + start_buffer, end_buffer, text); g_free (t); } @@ -1555,10 +1570,12 @@ print_day_details (GtkPrintContext *context, /* Get the events from the server. */ e_cal_model_generate_instances_sync (model, start, end, print_day_details_cb, &pdi); - qsort (pdi.long_events->data, pdi.long_events->len, - sizeof (EDayViewEvent), e_day_view_event_sort_func); - qsort (pdi.events[0]->data, pdi.events[0]->len, - sizeof (EDayViewEvent), e_day_view_event_sort_func); + qsort ( + pdi.long_events->data, pdi.long_events->len, + sizeof (EDayViewEvent), e_day_view_event_sort_func); + qsort ( + pdi.events[0]->data, pdi.events[0]->len, + sizeof (EDayViewEvent), e_day_view_event_sort_func); /* Also print events outside of work hours */ if (pdi.events[0]->len > 0) { @@ -1583,8 +1600,9 @@ print_day_details (GtkPrintContext *context, } /* Lay them out the long events, across the top of the page. */ - e_day_view_layout_long_events (pdi.long_events, pdi.days_shown, - pdi.day_starts, &rows_in_top_display); + e_day_view_layout_long_events ( + pdi.long_events, pdi.days_shown, + pdi.day_starts, &rows_in_top_display); /*Print the long events. */ font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); @@ -1593,9 +1611,10 @@ print_day_details (GtkPrintContext *context, * 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); + 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); if (rows_in_top_display > pdi.long_events->len) rows_in_top_display = pdi.long_events->len; @@ -1658,30 +1677,33 @@ print_day_details (GtkPrintContext *context, + LONG_DAY_EVENTS_BOTTOM_SPACING; /* Draw the borders, lines, and times down the left. */ - print_day_background (context, gcal, whence, &pdi, - left, right, top, bottom); + print_day_background ( + context, gcal, whence, &pdi, + left, right, top, bottom); /* Now adjust to get rid of the time column. */ left += DAY_VIEW_TIME_COLUMN_WIDTH; /* lay out the short events, within the day. */ - e_day_view_layout_day_events (pdi.events[0], CALC_DAY_VIEW_ROWS (pdi.mins_per_row), - pdi.mins_per_row, pdi.cols_per_row, -1); + e_day_view_layout_day_events ( + pdi.events[0], CALC_DAY_VIEW_ROWS (pdi.mins_per_row), + pdi.mins_per_row, pdi.cols_per_row, -1); /* use font like with 30 minutes time division */ rows_with_30_mins = (pdi.end_hour - pdi.start_hour) * (60 / 30); /* print the short events. */ - if (top > bottom ) + if (top > bottom) max_font_size = ((top - bottom) / rows_with_30_mins) - 4; else - max_font_size = ((bottom - top ) / rows_with_30_mins) - 4; + max_font_size = ((bottom - top) / rows_with_30_mins) - 4; font_size = MIN (DAY_NORMAL_FONT_SIZE, max_font_size); font = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL); for (i = 0; i < pdi.events[0]->len; i++) { event = &g_array_index (pdi.events[0], EDayViewEvent, i); - print_day_event (context, font, left, right, top, bottom, - event, &pdi, model); + print_day_event ( + context, font, left, right, top, bottom, + event, &pdi, model); } /* Free everything. */ @@ -1916,13 +1938,15 @@ print_week_event (GtkPrintContext *context, model, event->comp_data, &red, &green, &blue); if (print_is_one_day_week_event (event, span, psi->day_starts)) { - print_week_day_event (context, font, psi, - x1, x2, y1, psi->row_height, - event, span, text, red, green, blue); + print_week_day_event ( + context, font, psi, + x1, x2, y1, psi->row_height, + event, span, text, red, green, blue); } else { - print_week_long_event (context, font, psi, - x1, x2, y1, psi->row_height, - event, span, text, red, green, blue); + print_week_long_event ( + context, font, psi, + x1, x2, y1, psi->row_height, + event, span, text, red, green, blue); } } else { cairo_t *cr = gtk_print_context_get_cairo_context (context); @@ -2028,10 +2052,12 @@ print_week_view_background (GtkPrintContext *context, } else { cr = gtk_print_context_get_cairo_context (context); - cairo_move_to (cr, x1 + 0.1 * cell_width, - y1 + psi->header_row_height - 4); - cairo_line_to (cr, x2, - y1 + psi->header_row_height - 4); + cairo_move_to ( + cr, x1 + 0.1 * cell_width, + y1 + psi->header_row_height - 4); + cairo_line_to ( + cr, x2, + y1 + psi->header_row_height - 4); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width (cr, 0.5); @@ -2047,8 +2073,9 @@ print_week_view_background (GtkPrintContext *context, e_utf8_strftime (buffer, sizeof (buffer), format_string, &tm); - print_text_line (context, font, buffer, PANGO_ALIGN_RIGHT, - x1, x2 - 4, y1 + 2, y1 + 2 + font_size, TRUE); + print_text_line ( + context, font, buffer, PANGO_ALIGN_RIGHT, + x1, x2 - 4, y1 + 2, y1 + 2 + font_size, TRUE); } } @@ -2068,9 +2095,10 @@ print_week_summary_cb (ECalComponent *comp, /* Check that the event times are valid. */ #if 0 - g_print ("View start:%li end:%li Event start:%li end:%li\n", - psi->day_starts[0], psi->day_starts[psi->days_shown], - start, end); + g_print ( + "View start:%li end:%li Event start:%li end:%li\n", + psi->day_starts[0], psi->day_starts[psi->days_shown], + start, end); #endif g_return_val_if_fail (start <= end, TRUE); @@ -2105,7 +2133,7 @@ print_week_summary (GtkPrintContext *context, gint weeks_shown, gint month, gdouble font_size, - gdouble font_size_background, + gdouble font_size_background, gdouble left, gdouble right, gdouble top, @@ -2153,19 +2181,22 @@ print_week_summary (GtkPrintContext *context, } /* Get the events from the server. */ - e_cal_model_generate_instances_sync (model, + e_cal_model_generate_instances_sync ( + model, psi.day_starts[0], psi.day_starts[psi.days_shown], print_week_summary_cb, &psi); - qsort (psi.events->data, psi.events->len, - sizeof (EWeekViewEvent), e_week_view_event_sort_func); + qsort ( + psi.events->data, psi.events->len, + sizeof (EWeekViewEvent), e_week_view_event_sort_func); /* Layout the events. */ - spans = e_week_view_layout_events (psi.events, NULL, - psi.multi_week_view, - psi.weeks_shown, - psi.compress_weekend, - psi.display_start_weekday, - psi.day_starts, rows_per_day); + spans = e_week_view_layout_events ( + psi.events, NULL, + psi.multi_week_view, + psi.weeks_shown, + psi.compress_weekend, + psi.display_start_weekday, + psi.day_starts, rows_per_day); /* Calculate the size of the cells. */ if (multi_week_view) { @@ -2189,16 +2220,18 @@ print_week_summary (GtkPrintContext *context, /* Draw the grid and the day names/numbers. */ font_background = get_font_for_size (font_size_background, PANGO_WEIGHT_NORMAL); - print_week_view_background (context, font_background, &psi, left, top, - cell_width, cell_height); + print_week_view_background ( + context, font_background, &psi, left, top, + cell_width, cell_height); pango_font_description_free (font_background); /* Print the events. */ font = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL); for (event_num = 0; event_num < psi.events->len; event_num++) { event = &g_array_index (psi.events, EWeekViewEvent, event_num); - print_week_event (context, font, &psi, left, top, - cell_width, cell_height, model, event, spans); + print_week_event ( + context, font, &psi, left, top, + cell_width, cell_height, model, event, spans); } pango_font_description_free (font); @@ -2311,9 +2344,10 @@ print_month_summary (GtkPrintContext *context, pango_font_description_free (font); top = y2; - print_week_summary (context, gcal, date, TRUE, weeks, month, - MONTH_NORMAL_FONT_SIZE, MONTH_NORMAL_FONT_SIZE, - left, right, top, bottom); + print_week_summary ( + context, gcal, date, TRUE, weeks, month, + MONTH_NORMAL_FONT_SIZE, MONTH_NORMAL_FONT_SIZE, + left, right, top, bottom); } static void @@ -2350,8 +2384,9 @@ print_todo_details (GtkPrintContext *context, cairo_set_line_width (cr, 0.0); top +=2; - titled_box (context, _("Tasks"), font_summary, PANGO_ALIGN_CENTER, - &left, &top, &right, &bottom, 1.0); + titled_box ( + context, _("Tasks"), font_summary, PANGO_ALIGN_CENTER, + &left, &top, &right, &bottom, 1.0); y = top; yend = bottom - 2; @@ -2402,8 +2437,9 @@ print_todo_details (GtkPrintContext *context, cairo_stroke (cr); } - y = bound_text (context, font_summary, summary.value, -1, - x + 14, y + 4, xend, yend, FALSE, NULL, NULL); + 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; cr = gtk_print_context_get_cairo_context (context); @@ -2446,50 +2482,57 @@ print_day_view (GtkPrintContext *context, todo = width * 0.75; /* Print the main view with all the events in. */ - print_day_details (context, gcal, date, - 0.0, todo - 2.0, HEADER_HEIGHT + 4, - height); + print_day_details ( + context, gcal, date, + 0.0, todo - 2.0, HEADER_HEIGHT + 4, + height); /* Print the TaskPad down the right. */ - print_todo_details (context, gcal, 0, INT_MAX, - todo, width, HEADER_HEIGHT + 4, - height); + print_todo_details ( + context, gcal, 0, INT_MAX, + todo, width, HEADER_HEIGHT + 4, + height); /* Print the filled border around the header. */ - print_border (context, 0.0, width, - 0.0, HEADER_HEIGHT + 4, 1.0, 0.9); + print_border ( + context, 0.0, width, + 0.0, HEADER_HEIGHT + 4, 1.0, 0.9); /* Print the 2 mini calendar-months. */ l = width - SMALL_MONTH_PAD - (small_month_width + week_numbers_inc) * 2 - SMALL_MONTH_SPACING; - print_month_small (context, gcal, date, - l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2, - DATE_MONTH | DATE_YEAR, date, date, FALSE); + print_month_small ( + context, gcal, date, + l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2, + DATE_MONTH | DATE_YEAR, date, date, FALSE); l += SMALL_MONTH_SPACING + small_month_width + week_numbers_inc; - print_month_small (context, gcal, - time_add_month_with_zone (date, 1, zone), - l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2, - DATE_MONTH | DATE_YEAR, 0, 0, FALSE); + print_month_small ( + context, gcal, + time_add_month_with_zone (date, 1, zone), + l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2, + DATE_MONTH | DATE_YEAR, 0, 0, FALSE); /* Print the date, e.g. '8th May, 2001'. */ convert_timet_to_struct_tm (date, zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - 4, todo, 4, - 4 + 24); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + 4, todo, 4, + 4 + 24); /* Print the day, e.g. 'Tuesday'. */ format_date (&tm, DATE_DAYNAME, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - 4, todo, - HEADER_HEIGHT + 9, - HEADER_HEIGHT + 9 + 18); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + 4, todo, + HEADER_HEIGHT + 9, + HEADER_HEIGHT + 9 + 18); date = time_add_day_with_zone (date, 1, zone); } @@ -2563,10 +2606,10 @@ print_work_week_background (GtkPrintContext *context, hour_minute_xr = evo_calendar_print_renderer_get_width ( context, font_minute, use_24_hour ? "00" : _("am")); if (!use_24_hour) - hour_minute_xr = - MAX (hour_minute_xr, + hour_minute_xr = MAX ( + hour_minute_xr, evo_calendar_print_renderer_get_width ( - context, font_minute, _("pm"))); + context, font_minute, _("pm"))); row = 0; hour_minute_xl = left + width - hour_minute_xr - 3; @@ -2592,20 +2635,24 @@ print_work_week_background (GtkPrintContext *context, /* the hour label/minute */ sprintf (buf, "%d", hour); - print_text (context, font_hour, buf, PANGO_ALIGN_RIGHT, - left, hour_minute_xl, - y - yinc, y - yinc + hour_font_size); - print_text (context, font_minute, minute, PANGO_ALIGN_LEFT, - hour_minute_xl, left + width - 3, - y - yinc, y - yinc + minute_font_size); + print_text ( + context, font_hour, buf, PANGO_ALIGN_RIGHT, + left, hour_minute_xl, + y - yinc, y - yinc + hour_font_size); + print_text ( + context, font_minute, minute, PANGO_ALIGN_LEFT, + hour_minute_xl, left + width - 3, + y - yinc, y - yinc + minute_font_size); /* To the right */ - print_text (context, font_hour, buf, PANGO_ALIGN_RIGHT, - right - width, hour_minute_xr, - y - yinc, y - yinc + hour_font_size); - print_text (context, font_minute, minute, PANGO_ALIGN_LEFT, - hour_minute_xr, right - 3, - y - yinc, y - yinc + minute_font_size); + print_text ( + context, font_hour, buf, PANGO_ALIGN_RIGHT, + right - width, hour_minute_xr, + y - yinc, y - yinc + hour_font_size); + print_text ( + context, font_minute, minute, PANGO_ALIGN_LEFT, + hour_minute_xr, right - 3, + y - yinc, y - yinc + minute_font_size); /* Draw the horizontal line between hours, across the entire width of the day view. */ @@ -2694,10 +2741,12 @@ print_work_week_day_details (GtkPrintContext *context, /* Get the events from the server. */ e_cal_model_generate_instances_sync (model, start, end, print_day_details_cb, &pdi); - qsort (pdi.long_events->data, pdi.long_events->len, - sizeof (EDayViewEvent), e_day_view_event_sort_func); - qsort (pdi.events[0]->data, pdi.events[0]->len, - sizeof (EDayViewEvent), e_day_view_event_sort_func); + qsort ( + pdi.long_events->data, pdi.long_events->len, + sizeof (EDayViewEvent), e_day_view_event_sort_func); + qsort ( + pdi.events[0]->data, pdi.events[0]->len, + sizeof (EDayViewEvent), e_day_view_event_sort_func); pdi.start_hour = MIN (pdi.start_hour, _pdi->start_hour); pdi.end_hour = MAX (pdi.end_hour, _pdi->end_hour); @@ -2726,8 +2775,9 @@ print_work_week_day_details (GtkPrintContext *context, } /* Lay them out the long events, across the top of the page. */ - e_day_view_layout_long_events (pdi.long_events, pdi.days_shown, - pdi.day_starts, &rows_in_top_display); + e_day_view_layout_long_events ( + pdi.long_events, pdi.days_shown, + pdi.day_starts, &rows_in_top_display); /*Print the long events. */ font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); @@ -2736,9 +2786,10 @@ print_work_week_day_details (GtkPrintContext *context, * 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); + 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); if (rows_in_top_display > pdi.long_events->len) rows_in_top_display = pdi.long_events->len; @@ -2801,24 +2852,26 @@ print_work_week_day_details (GtkPrintContext *context, + LONG_DAY_EVENTS_BOTTOM_SPACING; /* lay out the short events, within the day. */ - e_day_view_layout_day_events (pdi.events[0], CALC_DAY_VIEW_ROWS (pdi.mins_per_row), - pdi.mins_per_row, pdi.cols_per_row, -1); + e_day_view_layout_day_events ( + pdi.events[0], CALC_DAY_VIEW_ROWS (pdi.mins_per_row), + pdi.mins_per_row, pdi.cols_per_row, -1); /* use font like with 30 minutes time division */ rows_with_30_mins = (pdi.end_hour - pdi.start_hour) * (60 / 30); /* print the short events. */ - if (top > bottom ) + if (top > bottom) max_font_size = ((top - bottom) / rows_with_30_mins) - 4; else - max_font_size = ((bottom - top ) / rows_with_30_mins) - 4; + max_font_size = ((bottom - top) / rows_with_30_mins) - 4; font_size = MIN (DAY_NORMAL_FONT_SIZE, max_font_size); font = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL); for (i = 0; i < pdi.events[0]->len; i++) { event = &g_array_index (pdi.events[0], EDayViewEvent, i); - print_day_event (context, font, left, - right, top, bottom, event, &pdi, model); + print_day_event ( + context, font, left, + right, top, bottom, event, &pdi, model); } /* Free everything. */ @@ -2893,9 +2946,10 @@ print_work_week_view (GtkPrintContext *context, e_cal_model_generate_instances_sync (model, start, end, print_work_week_view_cb, &pdi); - print_work_week_background (context, gcal, date, &pdi, 0.0, width, - HEADER_HEIGHT + DAY_VIEW_ROW_HEIGHT + LONG_EVENT_OFFSET, - height); + print_work_week_background ( + context, gcal, date, &pdi, 0.0, width, + HEADER_HEIGHT + DAY_VIEW_ROW_HEIGHT + LONG_EVENT_OFFSET, + height); print_border (context, 0.0, width, 0.0, HEADER_HEIGHT, 1.0, 0.9); @@ -2903,31 +2957,35 @@ print_work_week_view (GtkPrintContext *context, l = width - SMALL_MONTH_PAD - (small_month_width + weeknum_inc) * 2 - SMALL_MONTH_SPACING; - print_month_small (context, gcal, start, - l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4, - DATE_MONTH | DATE_YEAR, start, end, FALSE); + print_month_small ( + context, gcal, start, + l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4, + DATE_MONTH | DATE_YEAR, start, end, FALSE); l += SMALL_MONTH_SPACING + small_month_width + weeknum_inc; - print_month_small (context, gcal, - time_add_month_with_zone (start, 1, zone), - l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4, - DATE_MONTH | DATE_YEAR, 0, 0, FALSE); + print_month_small ( + context, gcal, + time_add_month_with_zone (start, 1, zone), + l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4, + DATE_MONTH | DATE_YEAR, 0, 0, FALSE); /* Print the start day of the week, e.g. '7th May 2001'. */ convert_timet_to_struct_tm (start, zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - 3, width, - 4, 4 + 24); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + 3, width, + 4, 4 + 24); /* Print the end day of the week, e.g. '13th May 2001'. */ /* We need to substract one or the wrong day will be printed */ convert_timet_to_struct_tm ( time_add_day_with_zone (end, -1, zone), zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - 3, width, - 24 + 3, 24 + 3 + 24); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + 3, width, + 24 + 3, 24 + 3 + 24); /* Now print each days' events */ day_width = (width - 2 *DAY_VIEW_TIME_COLUMN_WIDTH) / days; @@ -2939,13 +2997,15 @@ print_work_week_view (GtkPrintContext *context, convert_timet_to_struct_tm (when, zone, &tm); format_date (&tm, DATE_DAYNAME, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - day_x + 4, day_x + day_width, - HEADER_HEIGHT + 4, HEADER_HEIGHT + 4 + 18); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + day_x + 4, day_x + day_width, + HEADER_HEIGHT + 4, HEADER_HEIGHT + 4 + 18); - print_work_week_day_details (context, gcal, when, - day_x, day_x + day_width, - HEADER_HEIGHT, height, &pdi); + print_work_week_day_details ( + context, gcal, when, + day_x, day_x + day_width, + HEADER_HEIGHT, height, &pdi); when = time_add_day_with_zone (when, 1, zone); } } @@ -2989,46 +3049,53 @@ print_week_view (GtkPrintContext *context, } /* Print the main week view. */ - print_week_summary (context, gcal, when, FALSE, 1, 0, - WEEK_EVENT_FONT_SIZE, WEEK_SMALL_FONT_SIZE, - 0.0, width, - HEADER_HEIGHT + 20, height); + print_week_summary ( + context, gcal, when, FALSE, 1, 0, + WEEK_EVENT_FONT_SIZE, WEEK_SMALL_FONT_SIZE, + 0.0, width, + HEADER_HEIGHT + 20, height); /* Print the border around the main view. */ - print_border (context, 0.0, width, HEADER_HEIGHT , - height, 1.0, -1.0); + print_border ( + context, 0.0, width, HEADER_HEIGHT , + height, 1.0, -1.0); /* Print the border around the header area. */ - print_border (context, 0.0, width, - 0.0, HEADER_HEIGHT + 2.0 + 20, 1.0, 0.9); + print_border ( + context, 0.0, width, + 0.0, HEADER_HEIGHT + 2.0 + 20, 1.0, 0.9); /* Print the 2 mini calendar-months. */ l = width - SMALL_MONTH_PAD - (small_month_width + week_numbers_inc) * 2 - SMALL_MONTH_SPACING; - print_month_small (context, gcal, when, - l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10, - DATE_MONTH | DATE_YEAR, when, - time_add_week_with_zone (when, 1, zone), FALSE); + print_month_small ( + context, gcal, when, + l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10, + DATE_MONTH | DATE_YEAR, when, + time_add_week_with_zone (when, 1, zone), FALSE); l += SMALL_MONTH_SPACING + small_month_width + week_numbers_inc; - print_month_small (context, gcal, - time_add_month_with_zone (when, 1, zone), - l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10, - DATE_MONTH | DATE_YEAR, when, - time_add_week_with_zone (when, 1, zone), FALSE); + print_month_small ( + context, gcal, + time_add_month_with_zone (when, 1, zone), + l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10, + DATE_MONTH | DATE_YEAR, when, + time_add_week_with_zone (when, 1, zone), FALSE); /* Print the start day of the week, e.g. '7th May 2001'. */ convert_timet_to_struct_tm (when, zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_abs_bold (context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT, - 3, width, 4, 4 + 24); + print_text_abs_bold ( + context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT, + 3, width, 4, 4 + 24); /* Print the end day of the week, e.g. '13th May 2001'. */ when = time_add_day_with_zone (when, 6, zone); convert_timet_to_struct_tm (when, zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_abs_bold (context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT, - 3, width, 24 + 3, 24 + 3 + 24); + print_text_abs_bold ( + context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT, + 3, width, 24 + 3, 24 + 3 + 24); } static void @@ -3063,22 +3130,25 @@ print_month_view (GtkPrintContext *context, l = width - SMALL_MONTH_PAD - small_month_width - week_numbers_inc; /* Print the 2 mini calendar-months. */ - print_month_small (context, gcal, - time_add_month_with_zone (date, 1, zone), - l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4, - DATE_MONTH | DATE_YEAR, 0, 0, FALSE); - - print_month_small (context, gcal, - time_add_month_with_zone (date, -1, zone), - SMALL_MONTH_PAD, 4, SMALL_MONTH_PAD + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4, - DATE_MONTH | DATE_YEAR, 0, 0, FALSE); + print_month_small ( + context, gcal, + time_add_month_with_zone (date, 1, zone), + l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4, + DATE_MONTH | DATE_YEAR, 0, 0, FALSE); + + print_month_small ( + context, gcal, + time_add_month_with_zone (date, -1, zone), + SMALL_MONTH_PAD, 4, SMALL_MONTH_PAD + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4, + DATE_MONTH | DATE_YEAR, 0, 0, FALSE); /* Print the month, e.g. 'May 2001'. */ convert_timet_to_struct_tm (date, zone, &tm); format_date (&tm, DATE_MONTH | DATE_YEAR, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_CENTER, - 3, width - 3, - 3, 3 + 24); + print_text_size_bold ( + context, buf, PANGO_ALIGN_CENTER, + 3, width - 3, + 3, 3 + 24); } @@ -3140,11 +3210,14 @@ get_zone_from_tzid (ECalClient *client, if (!zone && tzid) { GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, tzid, &zone, NULL, &error)) { - g_warning ("Couldn't get timezone '%s' from server: %s", - tzid ? tzid : "", error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + e_cal_client_get_timezone_sync ( + client, tzid, &zone, NULL, &error); + + if (error != NULL) { + g_warning ( + "Couldn't get timezone '%s' from server: %s", + tzid ? tzid : "", error->message); + g_error_free (error); } } @@ -3172,8 +3245,9 @@ print_date_label (GtkPrintContext *context, start_zone = get_zone_from_tzid (client, datetime.tzid); if (!start_zone || datetime.value->is_date) start_zone = zone; - start = icaltime_as_timet_with_zone (*datetime.value, - start_zone); + start = icaltime_as_timet_with_zone ( + *datetime.value, + start_zone); } e_cal_component_free_datetime (&datetime); @@ -3182,8 +3256,9 @@ print_date_label (GtkPrintContext *context, end_zone = get_zone_from_tzid (client, datetime.tzid); if (!end_zone || datetime.value->is_date) end_zone = zone; - end = icaltime_as_timet_with_zone (*datetime.value, - end_zone); + end = icaltime_as_timet_with_zone ( + *datetime.value, + end_zone); } e_cal_component_free_datetime (&datetime); @@ -3192,16 +3267,16 @@ print_date_label (GtkPrintContext *context, due_zone = get_zone_from_tzid (client, datetime.tzid); if (!due_zone || datetime.value->is_date) due_zone = zone; - due = icaltime_as_timet_with_zone (*datetime.value, - due_zone); + due = icaltime_as_timet_with_zone ( + *datetime.value, due_zone); } e_cal_component_free_datetime (&datetime); e_cal_component_get_completed (comp, &datetime.value); if (datetime.value) { completed_zone = icaltimezone_get_utc_timezone (); - complete = icaltime_as_timet_with_zone (*datetime.value, - completed_zone); + complete = icaltime_as_timet_with_zone ( + *datetime.value, completed_zone); e_cal_component_free_icaltimetype (datetime.value); } @@ -3254,8 +3329,9 @@ print_date_label (GtkPrintContext *context, } } - print_text_size_bold (context, buffer, PANGO_ALIGN_LEFT, - left, right, top, top + 24); + print_text_size_bold ( + context, buffer, PANGO_ALIGN_LEFT, + left, right, top, top + 24); } static void @@ -3403,9 +3479,11 @@ print_comp_draw_real (GtkPrintOperation *operation, header_size = 40; if (page_nr == 0) { - print_border (context, 0.0, width, 0.0, header_size, + print_border ( + context, 0.0, width, 0.0, header_size, 1.0, 0.9); - print_text (context, font, title, PANGO_ALIGN_CENTER, 0.0, width, + print_text ( + context, font, title, PANGO_ALIGN_CENTER, 0.0, width, 0.1, header_size - 0.1); pango_font_description_free (font); } @@ -3416,18 +3494,21 @@ print_comp_draw_real (GtkPrintOperation *operation, font = get_font_for_size (18, PANGO_WEIGHT_BOLD); e_cal_component_get_summary (comp, &text); summary_string = g_strdup_printf (_("Summary: %s"), text.value); - top = bound_text (context, font, summary_string, -1, 0.0, top, width, - height, FALSE, &page_start, &pages); + top = bound_text ( + context, font, summary_string, -1, 0.0, top, width, + height, FALSE, &page_start, &pages); g_free (summary_string); /* Location */ e_cal_component_get_location (comp, &location); if (location && location[0]) { - location_string = g_strdup_printf (_("Location: %s"), - location); - top = bound_text (context, font, location_string, -1, 0.0, - top + 3, width, height, FALSE, &page_start, &pages); + location_string = g_strdup_printf ( + _("Location: %s"), + location); + top = bound_text ( + context, font, location_string, -1, 0.0, + top + 3, width, height, FALSE, &page_start, &pages); g_free (location_string); } @@ -3485,10 +3566,12 @@ print_comp_draw_real (GtkPrintOperation *operation, } if (status_string) { - gchar *status_text = g_strdup_printf (_("Status: %s"), - status_string); - top = bound_text (context, font, status_text, -1, - 0.0, top, width, height, FALSE, &page_start, &pages); + gchar *status_text = g_strdup_printf ( + _("Status: %s"), + status_string); + top = bound_text ( + context, font, status_text, -1, + 0.0, top, width, height, FALSE, &page_start, &pages); top += get_font_size (font) - 6; g_free (status_text); } @@ -3521,19 +3604,22 @@ print_comp_draw_real (GtkPrintOperation *operation, percent_string = g_strdup_printf (_("Percent Complete: %i"), *percent); e_cal_component_free_percent (percent); - top = bound_text (context, font, percent_string, -1, - 0.0, top, width, height, FALSE, &page_start, &pages); + top = bound_text ( + context, font, percent_string, -1, + 0.0, top, width, height, FALSE, &page_start, &pages); top += get_font_size (font) - 6; } /* URL */ e_cal_component_get_url (comp, &url); if (url && url[0]) { - gchar *url_string = g_strdup_printf (_("URL: %s"), - url); + gchar *url_string; + + url_string = g_strdup_printf (_("URL: %s"), url); - top = bound_text (context, font, url_string, -1, - 0.0, top, width, height, TRUE, &page_start, &pages); + top = bound_text ( + context, font, url_string, -1, + 0.0, top, width, height, TRUE, &page_start, &pages); top += get_font_size (font) - 6; g_free (url_string); } @@ -3542,10 +3628,11 @@ print_comp_draw_real (GtkPrintOperation *operation, /* Categories */ e_cal_component_get_categories (comp, &categories); if (categories && categories[0]) { - categories_string = g_strdup_printf (_("Categories: %s"), - categories); - top = bound_text (context, font, categories_string, -1, - 0.0, top, width, height, TRUE, &page_start, &pages); + categories_string = g_strdup_printf ( + _("Categories: %s"), categories); + top = bound_text ( + context, font, categories_string, -1, + 0.0, top, width, height, TRUE, &page_start, &pages); top += get_font_size (font) - 6; g_free (categories_string); } @@ -3563,8 +3650,9 @@ print_comp_draw_real (GtkPrintOperation *operation, } e_cal_component_free_text_list (contact_list); - top = bound_text (context, font, contacts->str, -1, - 0.0, top, width, height, TRUE, &page_start, &pages); + top = bound_text ( + context, font, contacts->str, -1, + 0.0, top, width, height, TRUE, &page_start, &pages); top += get_font_size (font) - 6; g_string_free (contacts, TRUE); } diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index 7c5f49d472..a37b4b7320 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -130,14 +130,16 @@ colorize_items (WeekdayPicker *wp) else o = outline; - gnome_canvas_item_set (priv->boxes[i], - "fill_color_gdk", f, - "outline_color_gdk", o, - NULL); - - gnome_canvas_item_set (priv->labels[i], - "fill_color_gdk", t, - NULL); + gnome_canvas_item_set ( + priv->boxes[i], + "fill_color_gdk", f, + "outline_color_gdk", o, + NULL); + + gnome_canvas_item_set ( + priv->labels[i], + "fill_color_gdk", t, + NULL); } } @@ -167,20 +169,22 @@ configure_items (WeekdayPicker *wp) if (day >= 7) day -= 7; - gnome_canvas_item_set (priv->boxes[i], - "x1", (double) (i * box_width), - "y1", (double) 0, - "x2", (double) ((i + 1) * box_width), - "y2", (double) (height - 1), - "line_width", 0.0, - NULL); + gnome_canvas_item_set ( + priv->boxes[i], + "x1", (gdouble) (i * box_width), + "y1", (gdouble) 0, + "x2", (gdouble) ((i + 1) * box_width), + "y2", (gdouble) (height - 1), + "line_width", 0.0, + NULL); c = get_day_text (day); - gnome_canvas_item_set (priv->labels[i], - "text", c, - "x", (double) (i * box_width) + PADDING, - "y", (double) (1 + PADDING), - NULL); + gnome_canvas_item_set ( + priv->labels[i], + "text", c, + "x", (gdouble) (i * box_width) + PADDING, + "y", (gdouble) (1 + PADDING), + NULL); g_free (c); } @@ -467,16 +471,18 @@ create_items (WeekdayPicker *wp) parent = gnome_canvas_root (GNOME_CANVAS (wp)); for (i = 0; i < 7; i++) { - priv->boxes[i] = gnome_canvas_item_new (parent, - GNOME_TYPE_CANVAS_RECT, - NULL); + priv->boxes[i] = gnome_canvas_item_new ( + parent, + GNOME_TYPE_CANVAS_RECT, + NULL); g_signal_connect ( priv->boxes[i], "event", G_CALLBACK (day_event_cb), wp); - priv->labels[i] = gnome_canvas_item_new (parent, - GNOME_TYPE_CANVAS_TEXT, - NULL); + priv->labels[i] = gnome_canvas_item_new ( + parent, + GNOME_TYPE_CANVAS_TEXT, + NULL); g_signal_connect ( priv->labels[i], "event", G_CALLBACK (day_event_cb), wp); @@ -523,7 +529,7 @@ weekday_picker_set_days (WeekdayPicker *wp, wp->priv->day_mask = day_mask; colorize_items (wp); - g_signal_emit (G_OBJECT (wp), wp_signals[CHANGED], 0); + g_signal_emit (wp, wp_signals[CHANGED], 0); } /** diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index 4f2a345de2..89e5f0ccfc 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -697,11 +697,13 @@ load_vcalendar_file (const gchar *filename) gchar *contents; gchar *default_alarm_filename; - default_alarm_filename = g_build_filename (EVOLUTION_SOUNDDIR, - "default_alarm.wav", - NULL); - defaults.alarm_audio_url = g_filename_to_uri (default_alarm_filename, - NULL, NULL); + default_alarm_filename = g_build_filename ( + EVOLUTION_SOUNDDIR, + "default_alarm.wav", + NULL); + defaults.alarm_audio_url = g_filename_to_uri ( + default_alarm_filename, + NULL, NULL); g_free (default_alarm_filename); defaults.alarm_audio_fmttype = (gchar *) "audio/x-wav"; defaults.alarm_description = (gchar *) _("Reminder!"); @@ -714,8 +716,8 @@ load_vcalendar_file (const gchar *filename) g_free (contents); if (vcal) { - icalcomp = icalvcal_convert_with_defaults (vcal, - &defaults); + icalcomp = icalvcal_convert_with_defaults ( + vcal, &defaults); cleanVObject (vcal); } } @@ -1501,10 +1503,11 @@ ical_get_preview (icalcomponent *icalcomp) formatted_dt = format_dt (&dt, timezones, users_zone); gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, kind == ICAL_VEVENT_COMPONENT ? (e_cal_component_has_attendees (comp) ? C_("iCalImp", "Meeting") : C_("iCalImp", "Event")) : - kind == ICAL_VTODO_COMPONENT ? C_("iCalImp", "Task") : - kind == ICAL_VJOURNAL_COMPONENT ? C_("iCalImp", "Memo") : "??? Other ???", + kind == ICAL_VTODO_COMPONENT ? C_("iCalImp", "Task") : + kind == ICAL_VJOURNAL_COMPONENT ? C_("iCalImp", "Memo") : "??? Other ???", 1, formatted_dt ? formatted_dt : "", 2, summary.value && *summary.value ? summary.value : summary.altrep && *summary.altrep ? summary.altrep : "", 3, comp, @@ -1535,15 +1538,18 @@ ical_get_preview (icalcomponent *icalcomp) g_object_unref (store); /* Translators: Column header for a component type; it can be Event, Task or Memo */ - gtk_tree_view_insert_column_with_attributes (tree_view, -1, C_("iCalImp", "Type"), + gtk_tree_view_insert_column_with_attributes ( + tree_view, -1, C_("iCalImp", "Type"), gtk_cell_renderer_text_new (), "text", 0, NULL); /* Translators: Column header for a component start date/time */ - gtk_tree_view_insert_column_with_attributes (tree_view, -1, C_("iCalImp", "Start"), + gtk_tree_view_insert_column_with_attributes ( + tree_view, -1, C_("iCalImp", "Start"), gtk_cell_renderer_text_new (), "text", 1, NULL); /* Translators: Column header for a component summary */ - gtk_tree_view_insert_column_with_attributes (tree_view, -1, C_("iCalImp", "Summary"), + gtk_tree_view_insert_column_with_attributes ( + tree_view, -1, C_("iCalImp", "Summary"), gtk_cell_renderer_text_new (), "text", 2, NULL); if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL) > 1) diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c index 83c4afd49e..b509b53d0d 100644 --- a/composer/e-composer-header.c +++ b/composer/e-composer-header.c @@ -379,7 +379,7 @@ e_composer_header_set_sensitive (EComposerHeader *header, { g_return_if_fail (E_IS_COMPOSER_HEADER (header)); - if ((header->priv->sensitive ? 1 : 0) == (sensitive ? 1 : 0)) + if (header->priv->sensitive == sensitive) return; header->priv->sensitive = sensitive; @@ -401,7 +401,7 @@ e_composer_header_set_visible (EComposerHeader *header, { g_return_if_fail (E_IS_COMPOSER_HEADER (header)); - if ((header->priv->visible ? 1 : 0) == (visible ? 1 : 0)) + if (header->priv->visible == visible) return; header->priv->visible = visible; diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c index 7f080c9071..86216d279f 100644 --- a/composer/e-composer-name-header.c +++ b/composer/e-composer-name-header.c @@ -121,7 +121,8 @@ composer_name_header_visible_changed_cb (EComposerNameHeader *header) label = e_composer_header_get_label (E_COMPOSER_HEADER (header)); dialog = e_name_selector_peek_dialog (priv->name_selector); - e_name_selector_dialog_set_section_visible (dialog, label, + e_name_selector_dialog_set_section_visible ( + dialog, label, e_composer_header_get_visible (E_COMPOSER_HEADER (header))); } @@ -221,7 +222,8 @@ composer_name_header_constructed (GObject *object) NULL); E_COMPOSER_HEADER (object)->input_widget = g_object_ref_sink (entry); - g_signal_connect_swapped (object, "notify::visible", + g_signal_connect_swapped ( + object, "notify::visible", G_CALLBACK (composer_name_header_visible_changed_cb), object); /* Chain up to parent's constructed() method. */ diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 777b7e7423..8354afad85 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -3612,7 +3612,9 @@ msg_composer_save_to_drafts_cb (EMsgComposer *composer, g_object_unref (message); if (e_msg_composer_is_exiting (composer)) - g_object_weak_ref (G_OBJECT (context->activity), (GWeakNotify) gtk_widget_destroy, composer); + g_object_weak_ref ( + G_OBJECT (context->activity), + (GWeakNotify) gtk_widget_destroy, composer); async_context_free (context); } diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c index 1aa7afc78a..fcd93ebfc6 100644 --- a/e-util/e-datetime-format.c +++ b/e-util/e-datetime-format.c @@ -530,7 +530,7 @@ unref_setup_keyfile (gpointer ptr) g_return_if_fail (setup_keyfile != NULL); g_return_if_fail (setup_keyfile_instances > 0); - /* this is never called :( */ + /* this is never called */ setup_keyfile_instances--; if (setup_keyfile_instances == 0) { save_keyfile (setup_keyfile); diff --git a/e-util/e-event.h b/e-util/e-event.h index 90a3b735fb..0b834c879d 100644 --- a/e-util/e-event.h +++ b/e-util/e-event.h @@ -61,7 +61,7 @@ typedef struct _EEventTarget EEventTarget; typedef void (*EEventItemsFunc)(EEvent *ee, GSList *items, gpointer data); typedef void (*EEventFunc)(EEvent *ee, EEventItem *item, gpointer data); -typedef void (*EEventFactoryFunc)(EEvent *ee, gpointer ); +typedef void (*EEventFactoryFunc)(EEvent *ee, gpointer); /** * enum _e_event_t - Event type. diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c index 3550aad336..7044107a92 100644 --- a/e-util/e-plugin.c +++ b/e-util/e-plugin.c @@ -391,7 +391,7 @@ ep_load (const gchar *filename, plugin_load_level = NULL; plugin_load_level = e_plugin_xml_prop (root, "load_level"); if (plugin_load_level) { - if ((atoi (plugin_load_level) == load_level) ) { + if ((atoi (plugin_load_level) == load_level)) { ep = ep_load_plugin (root, pdoc); if (ep && load_level == 1) diff --git a/e-util/e-ui-manager.c b/e-util/e-ui-manager.c index 928697606a..3308b500d2 100644 --- a/e-util/e-ui-manager.c +++ b/e-util/e-ui-manager.c @@ -213,7 +213,7 @@ e_ui_manager_set_express_mode (EUIManager *ui_manager, { g_return_if_fail (E_IS_UI_MANAGER (ui_manager)); - if ((ui_manager->priv->express_mode ? 1 : 0) == (express_mode ? 1 : 0)) + if (ui_manager->priv->express_mode == express_mode) return; ui_manager->priv->express_mode = express_mode; diff --git a/em-format/e-mail-extension-registry.c b/em-format/e-mail-extension-registry.c index 348228620c..3097d93212 100644 --- a/em-format/e-mail-extension-registry.c +++ b/em-format/e-mail-extension-registry.c @@ -129,8 +129,9 @@ e_mail_extension_registry_add_extension (EMailExtensionRegistry *reg, } if (camel_debug ("emformat:registry")) { - printf ("Added extension '%s' for type '%s'\n", - G_OBJECT_TYPE_NAME (extension), types[i]); + printf ( + "Added extension '%s' for type '%s'\n", + G_OBJECT_TYPE_NAME (extension), types[i]); } } } @@ -165,7 +166,8 @@ e_mail_extension_registry_remove_extension (EMailExtensionRegistry *reg, g_queue_remove (queue, extension); if (camel_debug ("emformat:registry")) { - printf ("Removed extension '%s' from type '%s'\n", + printf ( + "Removed extension '%s' from type '%s'\n", G_OBJECT_TYPE_NAME (extension), types[i]); } } diff --git a/em-format/e-mail-formatter-attachment-bar.c b/em-format/e-mail-formatter-attachment-bar.c index eea8962f84..83cb5cad8d 100644 --- a/em-format/e-mail-formatter-attachment-bar.c +++ b/em-format/e-mail-formatter-attachment-bar.c @@ -103,8 +103,9 @@ emfe_attachment_bar_get_widget (EMailFormatterExtension *extension, empab = (EMailPartAttachmentBar *) part; widget = e_attachment_bar_new (empab->store); g_object_set_data (G_OBJECT (empab->store), "attachment-bar", widget); - g_object_weak_ref (G_OBJECT (widget), - (GWeakNotify) unset_bar_from_store_data, empab->store); + g_object_weak_ref ( + G_OBJECT (widget), + (GWeakNotify) unset_bar_from_store_data, empab->store); return widget; } diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c index e0e6b90fbe..ffe16347c0 100644 --- a/em-format/e-mail-formatter-attachment.c +++ b/em-format/e-mail-formatter-attachment.c @@ -190,10 +190,12 @@ emfe_attachment_format (EMailFormatterExtension *extension, description = e_attachment_get_description (attachment); if (description && *description) { - name = g_strdup_printf ("<h2>Attachment: %s (%s)</h2>\n", + name = g_strdup_printf ( + "<h2>Attachment: %s (%s)</h2>\n", description, g_file_info_get_display_name (fi)); } else { - name = g_strdup_printf ("<h2>Attachment: %s</h2>\n", + name = g_strdup_printf ( + "<h2>Attachment: %s</h2>\n", g_file_info_get_display_name (fi)); } diff --git a/em-format/e-mail-formatter-error.c b/em-format/e-mail-formatter-error.c index f99a5fb1e3..505f1dd10f 100644 --- a/em-format/e-mail-formatter-error.c +++ b/em-format/e-mail-formatter-error.c @@ -104,7 +104,8 @@ emfe_error_format (EMailFormatterExtension *extension, camel_stream_flush (filtered_stream, cancellable, NULL); g_object_unref (filtered_stream); - camel_stream_write_string (stream, + camel_stream_write_string ( + stream, "</td>\n" "</tr>\n" "</table>\n" diff --git a/em-format/e-mail-formatter-headers.c b/em-format/e-mail-formatter-headers.c index c1a9285f77..dde0e5a682 100644 --- a/em-format/e-mail-formatter-headers.c +++ b/em-format/e-mail-formatter-headers.c @@ -92,9 +92,10 @@ format_short_headers (EMailFormatter *formatter, evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); from = g_string_new (""); - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" " - "id=\"__evo-short-headers\" style=\"display: %s\">", + "id=\"__evo-short-headers\" style=\"display: %s\">", flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED ? "block" : "none"); header = ((CamelMimePart *) part)->headers; @@ -269,9 +270,10 @@ format_full_headers (EMailFormatter *formatter, evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" " - "id=\"__evo-full-headers\" style=\"display: %s\" width=\"100%%\">", + "id=\"__evo-full-headers\" style=\"display: %s\" width=\"100%%\">", flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED ? "none" : "block"); header = ((CamelMimePart *) part)->headers; @@ -451,7 +453,8 @@ format_full_headers (EMailFormatter *formatter, only_local_photo = e_mail_formatter_get_only_local_photos (formatter); g_string_append (buffer, "<td align=\"right\" valign=\"top\">"); - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<img src=\"mail://contact-photo?mailaddr=&only-local-photo=1\" " "data-mailaddr=\"%s\" %s id=\"__evo-contact-photo\"/>", name, only_local_photo ? "data-onlylocal=1" : ""); @@ -543,9 +546,10 @@ emfe_headers_format (EMailFormatterExtension *extension, E_MAIL_FORMATTER_COLOR_HEADER))); if (context->flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSABLE) { - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<img src=\"evo-file://%s/%s\" class=\"navigable\" " - "id=\"__evo-collapse-headers-img\" />" + "id=\"__evo-collapse-headers-img\" />" "</td><td>", EVOLUTION_IMAGESDIR, (context->flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED) ? diff --git a/em-format/e-mail-formatter-message-rfc822.c b/em-format/e-mail-formatter-message-rfc822.c index 9ec393cd0a..614efca6df 100644 --- a/em-format/e-mail-formatter-message-rfc822.c +++ b/em-format/e-mail-formatter-message-rfc822.c @@ -201,7 +201,8 @@ emfe_message_rfc822_format (EMailFormatterExtension *extension, p = iter->data; - uri = e_mail_part_build_uri (context->folder, context->message_uid, + uri = e_mail_part_build_uri ( + context->folder, context->message_uid, "part_id", G_TYPE_STRING, p->id, "mode", G_TYPE_INT, E_MAIL_FORMATTER_MODE_RAW, "headers_collapsable", G_TYPE_INT, 0, diff --git a/em-format/e-mail-formatter-print.c b/em-format/e-mail-formatter-print.c index 48c9706dd5..1ca3bbae7f 100644 --- a/em-format/e-mail-formatter-print.c +++ b/em-format/e-mail-formatter-print.c @@ -46,8 +46,9 @@ write_attachments_list (EMailFormatter *formatter, str = g_string_new ( "<table border=\"0\" cellspacing=\"5\" cellpadding=\"0\" " - "class=\"attachments-list\" >\n"); - g_string_append_printf (str, + "class=\"attachments-list\" >\n"); + g_string_append_printf ( + str, "<tr><th colspan=\"2\"><h1>%s</h1></td></tr>\n" "<tr><th>%s</th><th>%s</th></tr>\n", _("Attachments"), _("Name"), _("Size")); @@ -68,7 +69,8 @@ write_attachments_list (EMailFormatter *formatter, if (e_attachment_get_description (attachment) && *e_attachment_get_description (attachment)) { - name = g_strdup_printf ("%s (%s)", + name = g_strdup_printf ( + "%s (%s)", e_attachment_get_description (attachment), g_file_info_get_display_name (fi)); } else { @@ -77,7 +79,8 @@ write_attachments_list (EMailFormatter *formatter, size = g_format_size (g_file_info_get_size (fi)); - g_string_append_printf (str, "<tr><td>%s</td><td>%s</td></tr>\n", + g_string_append_printf ( + str, "<tr><td>%s</td><td>%s</td></tr>\n", name, size); g_free (name); @@ -101,12 +104,13 @@ mail_formatter_print_run (EMailFormatter *formatter, context->mode = E_MAIL_FORMATTER_MODE_PRINTING; - camel_stream_write_string (stream, + camel_stream_write_string ( + stream, "<!DOCTYPE HTML>\n<html>\n" "<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\" />\n" "<title>Evolution Mail Display</title>\n" "<link type=\"text/css\" rel=\"stylesheet\" media=\"print\" " - "href=\"evo-file://" EVOLUTION_PRIVDATADIR "/theme/webview-print.css\" />\n" + "href=\"evo-file://" EVOLUTION_PRIVDATADIR "/theme/webview-print.css\" />\n" "</head>\n" "<body style=\"background: #FFF; color: #000;\">", cancellable, NULL); @@ -259,8 +263,9 @@ e_mail_formatter_print_get_type (void) NULL /* value_table */ }; - type = g_type_register_static (E_TYPE_MAIL_FORMATTER, - "EMailFormatterPrint", &type_info, 0); + type = g_type_register_static ( + E_TYPE_MAIL_FORMATTER, + "EMailFormatterPrint", &type_info, 0); } return type; diff --git a/em-format/e-mail-formatter-quote-attachment.c b/em-format/e-mail-formatter-quote-attachment.c index 655f676602..82f10239cb 100644 --- a/em-format/e-mail-formatter-quote-attachment.c +++ b/em-format/e-mail-formatter-quote-attachment.c @@ -90,30 +90,33 @@ emfqe_attachment_format (EMailFormatterExtension *extension, text_format_flags = e_mail_formatter_get_text_format_flags (formatter); - text = e_mail_part_describe (part->part, - empa ? empa->snoop_mime_type : part->mime_type); + text = e_mail_part_describe ( + part->part, + empa ? empa->snoop_mime_type : part->mime_type); html = camel_text_to_html ( - text, - text_format_flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, - 0); + text, + text_format_flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, + 0); camel_stream_write_string (stream, html, cancellable, NULL); camel_stream_write_string (stream, "<br>", cancellable, NULL); g_free (html); g_free (text); - camel_stream_write_string (stream, - "<!--+GtkHTML:<DATA class=\"ClueFlow\" " - "key=\"orig\" value=\"1\">-->\n" - "<blockquote type=cite>\n", cancellable, NULL); + camel_stream_write_string ( + stream, + "<!--+GtkHTML:<DATA class=\"ClueFlow\" " + "key=\"orig\" value=\"1\">-->\n" + "<blockquote type=cite>\n", cancellable, NULL); e_mail_formatter_format_as ( formatter, context, att_part, stream, NULL, cancellable); - camel_stream_write_string (stream, - "</blockquote><!--+GtkHTML:" - "<DATA class=\"ClueFlow\" clear=\"orig\">-->", - cancellable, NULL); + camel_stream_write_string ( + stream, + "</blockquote><!--+GtkHTML:" + "<DATA class=\"ClueFlow\" clear=\"orig\">-->", + cancellable, NULL); return TRUE; } diff --git a/em-format/e-mail-formatter-quote.c b/em-format/e-mail-formatter-quote.c index 71bfbcd6bb..2468a3110b 100644 --- a/em-format/e-mail-formatter-quote.c +++ b/em-format/e-mail-formatter-quote.c @@ -93,7 +93,8 @@ mail_formatter_quote_run (EMailFormatter *formatter, } if (qf->priv->flags & E_MAIL_FORMATTER_QUOTE_FLAG_CITE) { - camel_stream_write_string (stream, + camel_stream_write_string ( + stream, "<!--+GtkHTML:<DATA class=\"ClueFlow\" " "key=\"orig\" value=\"1\">-->\n" "<blockquote type=cite>\n", cancellable, NULL); @@ -215,8 +216,9 @@ e_mail_formatter_quote_get_type (void) NULL /* value_table */ }; - type = g_type_register_static (E_TYPE_MAIL_FORMATTER, - "EMailFormatterQuote", &type_info, 0); + type = g_type_register_static ( + E_TYPE_MAIL_FORMATTER, + "EMailFormatterQuote", &type_info, 0); } return type; diff --git a/em-format/e-mail-formatter-secure-button.c b/em-format/e-mail-formatter-secure-button.c index 755497a750..d95670cc9c 100644 --- a/em-format/e-mail-formatter-secure-button.c +++ b/em-format/e-mail-formatter-secure-button.c @@ -135,7 +135,8 @@ viewcert_clicked (GtkWidget *button, g_object_unref (ec); } else { - g_warning ("can't find certificate for %s <%s>", + g_warning ( + "can't find certificate for %s <%s>", info->name ? info->name : "", info->email ? info->email : ""); } @@ -289,19 +290,20 @@ secure_button_clicked_cb (GtkWidget *widget, gtk_text_buffer_set_text ( buffer, part->validity->sign.description, strlen (part->validity->sign.description)); - w = g_object_new (gtk_scrolled_window_get_type (), - "hscrollbar_policy", GTK_POLICY_AUTOMATIC, - "vscrollbar_policy", GTK_POLICY_AUTOMATIC, - "shadow_type", GTK_SHADOW_IN, - "expand", TRUE, - "child", g_object_new (gtk_text_view_get_type (), - "buffer", buffer, - "cursor_visible", FALSE, - "editable", FALSE, - "width_request", 500, - "height_request", 160, - NULL), - NULL); + w = g_object_new ( + gtk_scrolled_window_get_type (), + "hscrollbar_policy", GTK_POLICY_AUTOMATIC, + "vscrollbar_policy", GTK_POLICY_AUTOMATIC, + "shadow_type", GTK_SHADOW_IN, + "expand", TRUE, + "child", g_object_new (gtk_text_view_get_type (), + "buffer", buffer, + "cursor_visible", FALSE, + "editable", FALSE, + "width_request", 500, + "height_request", 160, + NULL), + NULL); g_object_unref (buffer); gtk_container_add (GTK_CONTAINER (grid), w); @@ -325,19 +327,20 @@ secure_button_clicked_cb (GtkWidget *widget, gtk_text_buffer_set_text ( buffer, part->validity->encrypt.description, strlen (part->validity->encrypt.description)); - w = g_object_new (gtk_scrolled_window_get_type (), - "hscrollbar_policy", GTK_POLICY_AUTOMATIC, - "vscrollbar_policy", GTK_POLICY_AUTOMATIC, - "shadow_type", GTK_SHADOW_IN, - "expand", TRUE, - "child", g_object_new (gtk_text_view_get_type (), - "buffer", buffer, - "cursor_visible", FALSE, - "editable", FALSE, - "width_request", 500, - "height_request", 160, - NULL), - NULL); + w = g_object_new ( + gtk_scrolled_window_get_type (), + "hscrollbar_policy", GTK_POLICY_AUTOMATIC, + "vscrollbar_policy", GTK_POLICY_AUTOMATIC, + "shadow_type", GTK_SHADOW_IN, + "expand", TRUE, + "child", g_object_new (gtk_text_view_get_type (), + "buffer", buffer, + "cursor_visible", FALSE, + "editable", FALSE, + "width_request", 500, + "height_request", 160, + NULL), + NULL); g_object_unref (buffer); gtk_container_add (GTK_CONTAINER (grid), w); @@ -403,7 +406,8 @@ emfe_secure_button_get_widget (EMailFormatterExtension *extension, box = gtk_event_box_new (); if (part->validity->sign.status != 0) - gtk_widget_override_background_color (box, GTK_STATE_FLAG_NORMAL, + gtk_widget_override_background_color ( + box, GTK_STATE_FLAG_NORMAL, &smime_sign_colour[part->validity->sign.status]); layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); @@ -411,7 +415,8 @@ emfe_secure_button_get_widget (EMailFormatterExtension *extension, button = gtk_button_new (); gtk_box_pack_start (GTK_BOX (layout), button, FALSE, FALSE, 0); - g_signal_connect (button, "clicked", + g_signal_connect ( + button, "clicked", G_CALLBACK (secure_button_clicked_cb), part); widget = gtk_image_new_from_icon_name ( diff --git a/em-format/e-mail-formatter-source.c b/em-format/e-mail-formatter-source.c index 518c2af050..c9d4e17890 100644 --- a/em-format/e-mail-formatter-source.c +++ b/em-format/e-mail-formatter-source.c @@ -114,7 +114,8 @@ emfe_source_format (EMailFormatterExtension *extension, camel_stream_write_string ( stream, "<code class=\"pre\">", cancellable, NULL); - camel_data_wrapper_write_to_stream_sync (dw, filtered_stream, + camel_data_wrapper_write_to_stream_sync ( + dw, filtered_stream, cancellable, NULL); camel_stream_flush (filtered_stream, cancellable, NULL); g_object_unref (filtered_stream); diff --git a/em-format/e-mail-formatter-text-enriched.c b/em-format/e-mail-formatter-text-enriched.c index cd01b4d3e2..344d7a62a6 100644 --- a/em-format/e-mail-formatter-text-enriched.c +++ b/em-format/e-mail-formatter-text-enriched.c @@ -85,7 +85,8 @@ emfe_text_enriched_format (EMailFormatterExtension *extension, buffer = g_string_new (""); - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<div class=\"part-container\" style=\"border-color: #%06x; " "background-color: #%06x; color: #%06x;\">" "<div class=\"part-container-inner-margin\">\n", diff --git a/em-format/e-mail-formatter-text-html.c b/em-format/e-mail-formatter-text-html.c index 5f493b2f4d..71c73f9266 100644 --- a/em-format/e-mail-formatter-text-html.c +++ b/em-format/e-mail-formatter-text-html.c @@ -264,7 +264,7 @@ emfe_text_html_format (EMailFormatterExtension *extension, } } - if (document_end ) { + if (document_end) { length = strlen (document_end); tag = string->str + string->len - 1; i = 0; diff --git a/em-format/e-mail-formatter-text-plain.c b/em-format/e-mail-formatter-text-plain.c index 5ef5ba3d1f..40b9358aa4 100644 --- a/em-format/e-mail-formatter-text-plain.c +++ b/em-format/e-mail-formatter-text-plain.c @@ -89,7 +89,8 @@ emfe_text_plain_format (EMailFormatterExtension *extension, g_free (header); /* No need for body margins within <iframe> */ - camel_stream_write_string (stream, + camel_stream_write_string ( + stream, "<style>body{ margin: 0; }</style>", cancellable, NULL); } @@ -137,8 +138,9 @@ emfe_text_plain_format (EMailFormatterExtension *extension, camel_stream_write_string (stream, "</div>\n", cancellable, NULL); if (context->mode == E_MAIL_FORMATTER_MODE_RAW) { - camel_stream_write_string (stream, "</body></html>", - cancellable, NULL); + camel_stream_write_string ( + stream, "</body></html>", + cancellable, NULL); } return TRUE; diff --git a/em-format/e-mail-formatter-utils.c b/em-format/e-mail-formatter-utils.c index 883d985510..7c01f323bb 100644 --- a/em-format/e-mail-formatter-utils.c +++ b/em-format/e-mail-formatter-utils.c @@ -58,7 +58,8 @@ e_mail_formatter_format_text_header (EMailFormatter *formatter, value++; if (!(flags & E_MAIL_FORMATTER_HEADER_FLAG_HTML)) - html = mhtml = camel_text_to_html (value, + html = mhtml = camel_text_to_html ( + value, e_mail_formatter_get_text_format_flags (formatter), 0); else html = value; @@ -90,7 +91,8 @@ e_mail_formatter_format_text_header (EMailFormatter *formatter, } } - g_string_append_printf (buffer, fmt, + g_string_append_printf ( + buffer, fmt, (flags & E_MAIL_FORMATTER_HEADER_FLAG_HIDDEN ? "none" : "table-row"), label, html); g_free (mhtml); @@ -186,12 +188,13 @@ e_mail_formatter_format_address (EMailFormatter *formatter, } if (id) { - g_string_append_printf (out, + g_string_append_printf ( + out, "<span id=\"__evo-moreaddr-%s\" " - "style=\"display: none;\">", id); + "style=\"display: none;\">", id); str = g_strdup_printf ( "<img src=\"evo-file://%s/plus.png\" " - "id=\"__evo-moreaddr-img-%s\" class=\"navigable\">", + "id=\"__evo-moreaddr-img-%s\" class=\"navigable\">", EVOLUTION_IMAGESDIR, id); } } @@ -209,7 +212,8 @@ e_mail_formatter_format_address (EMailFormatter *formatter, } if (id) { - g_string_append_printf (out, + g_string_append_printf ( + out, "</span>" "<span class=\"navigable\" " "id=\"__evo-moreaddr-ellipsis-%s\" " @@ -289,7 +293,8 @@ e_mail_formatter_format_header (EMailFormatter *formatter, g_free (buf); html = g_string_new (""); - img = e_mail_formatter_format_address (formatter, html, addrs, (gchar *) label, + img = e_mail_formatter_format_address ( + formatter, html, addrs, (gchar *) label, (flags & E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS), !(flags & E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE)); @@ -329,7 +334,8 @@ e_mail_formatter_format_header (EMailFormatter *formatter, while (*txt == ' ' || *txt == '\t') txt++; - html = camel_text_to_html (txt, + html = camel_text_to_html ( + txt, e_mail_formatter_get_text_format_flags (formatter), 0); msg_date = camel_header_decode_date (txt, &msg_offset); @@ -347,8 +353,9 @@ e_mail_formatter_format_header (EMailFormatter *formatter, } else { gchar *date_str; - date_str = e_datetime_format_format ("mail", "header", - DTFormatKindDateTime, msg_date); + date_str = e_datetime_format_format ( + "mail", "header", + DTFormatKindDateTime, msg_date); if (hide_real_date) { /* Show only the local-formatted date, losing all timezone @@ -382,7 +389,8 @@ e_mail_formatter_format_header (EMailFormatter *formatter, if (flags & E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS) g_string_append_printf (html, "%s", scan->newsgroup); else - g_string_append_printf (html, "<a href=\"news:%s\">%s</a>", + g_string_append_printf ( + html, "<a href=\"news:%s\">%s</a>", scan->newsgroup, scan->newsgroup); scan = scan->next; if (scan) diff --git a/em-format/e-mail-formatter.c b/em-format/e-mail-formatter.c index ac16647b7f..7d0f589b8a 100644 --- a/em-format/e-mail-formatter.c +++ b/em-format/e-mail-formatter.c @@ -185,9 +185,10 @@ mail_formatter_create_context (EMailFormatter *formatter) if (formatter_class->create_context) { if (!formatter_class->free_context) { - g_warning ("%s implements create_context() but " - "does not implement free_context()!", - G_OBJECT_TYPE_NAME (formatter)); + g_warning ( + "%s implements create_context() but " + "does not implement free_context()!", + G_OBJECT_TYPE_NAME (formatter)); } return formatter_class->create_context (formatter); @@ -353,36 +354,41 @@ e_mail_formatter_get_property (GObject *object, { switch (property_id) { case PROP_BODY_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_BODY)); return; case PROP_CITATION_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_CITATION)); return; case PROP_CONTENT_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_CONTENT)); return; case PROP_FRAME_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_FRAME)); return; case PROP_HEADER_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_HEADER)); return; @@ -396,50 +402,58 @@ e_mail_formatter_get_property (GObject *object, case PROP_MARK_CITATIONS: g_value_set_boolean ( - value, e_mail_formatter_get_mark_citations ( + value, + e_mail_formatter_get_mark_citations ( E_MAIL_FORMATTER (object))); return; case PROP_ONLY_LOCAL_PHOTOS: g_value_set_boolean ( - value, e_mail_formatter_get_only_local_photos ( + value, + e_mail_formatter_get_only_local_photos ( E_MAIL_FORMATTER (object))); return; case PROP_SHOW_SENDER_PHOTO: g_value_set_boolean ( - value, e_mail_formatter_get_show_sender_photo ( + value, + e_mail_formatter_get_show_sender_photo ( E_MAIL_FORMATTER (object))); return; case PROP_SHOW_REAL_DATE: g_value_set_boolean ( - value, e_mail_formatter_get_show_real_date ( + value, + e_mail_formatter_get_show_real_date ( E_MAIL_FORMATTER (object))); return; case PROP_TEXT_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_TEXT)); return; case PROP_ANIMATE_IMAGES: g_value_set_boolean ( - value, e_mail_formatter_get_animate_images ( + value, + e_mail_formatter_get_animate_images ( E_MAIL_FORMATTER (object))); return; case PROP_CHARSET: g_value_set_string ( - value, e_mail_formatter_get_charset ( + value, + e_mail_formatter_get_charset ( E_MAIL_FORMATTER (object))); return; case PROP_DEFAULT_CHARSET: g_value_set_string ( - value, e_mail_formatter_get_default_charset ( + value, + e_mail_formatter_get_default_charset ( E_MAIL_FORMATTER (object))); return; } @@ -746,11 +760,12 @@ e_mail_formatter_get_type (void) (GInterfaceInitFunc) e_mail_formatter_extensible_interface_init }; - type = g_type_register_static (G_TYPE_OBJECT, - "EMailFormatter", &type_info, 0); + type = g_type_register_static ( + G_TYPE_OBJECT, + "EMailFormatter", &type_info, 0); - g_type_add_interface_static (type, - E_TYPE_EXTENSIBLE, &e_extensible_interface_info); + g_type_add_interface_static ( + type, E_TYPE_EXTENSIBLE, &e_extensible_interface_info); } return type; @@ -825,8 +840,8 @@ e_mail_formatter_format (EMailFormatter *formatter, g_return_if_fail (formatter_class->run != NULL); simple = g_simple_async_result_new ( - G_OBJECT (formatter), callback, - user_data, e_mail_formatter_format); + G_OBJECT (formatter), callback, + user_data, e_mail_formatter_format); g_simple_async_result_set_check_cancellable (simple, cancellable); @@ -935,9 +950,10 @@ e_mail_formatter_format_as (EMailFormatter *formatter, ok = FALSE; - d (printf ("(%d) Formatting for part %s of type %s (found %d formatters)\n", - _call_i, part->id, as_mime_type, - formatters ? g_queue_get_length (formatters) : 0)); + d ( + printf ("(%d) Formatting for part %s of type %s (found %d formatters)\n", + _call_i, part->id, as_mime_type, + formatters ? g_queue_get_length (formatters) : 0)); if (formatters) { for (iter = formatters->head; iter; iter = iter->next) { @@ -952,7 +968,9 @@ e_mail_formatter_format_as (EMailFormatter *formatter, extension, formatter, context, part, stream, cancellable); - d (printf ("\t(%d) trying %s...%s\n", _call_i, + d ( + printf ( + "\t(%d) trying %s...%s\n", _call_i, G_OBJECT_TYPE_NAME (extension), ok ? "OK" : "failed")); @@ -1206,10 +1224,6 @@ e_mail_formatter_set_mark_citations (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if (((E_MAIL_FORMATTER_GET_CLASS (formatter)->text_html_flags - & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) ? 1 : 0) == (mark_citations ? 1 : 0)) - return; - if (mark_citations) E_MAIL_FORMATTER_GET_CLASS (formatter)->text_html_flags |= CAMEL_MIME_FILTER_TOHTML_MARK_CITATION; @@ -1234,7 +1248,7 @@ e_mail_formatter_set_only_local_photos (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if ((formatter->priv->only_local_photos ? 1 : 0) == (only_local_photos ? 1 : 0)) + if (formatter->priv->only_local_photos == only_local_photos) return; formatter->priv->only_local_photos = only_local_photos; @@ -1256,7 +1270,7 @@ e_mail_formatter_set_show_sender_photo (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if ((formatter->priv->show_sender_photo ? 1 : 0) == (show_sender_photo ? 1 : 0)) + if (formatter->priv->show_sender_photo == show_sender_photo) return; formatter->priv->show_sender_photo = show_sender_photo; @@ -1278,7 +1292,7 @@ e_mail_formatter_set_show_real_date (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if ((formatter->priv->show_real_date ? 1 : 0) == (show_real_date ? 1 : 0)) + if (formatter->priv->show_real_date == show_real_date) return; formatter->priv->show_real_date = show_real_date; @@ -1300,7 +1314,7 @@ e_mail_formatter_set_animate_images (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if ((formatter->priv->animate_images ? 1 : 0) == (animate_images ? 1 : 0)) + if (formatter->priv->animate_images == animate_images) return; formatter->priv->animate_images = animate_images; diff --git a/em-format/e-mail-inline-filter.c b/em-format/e-mail-inline-filter.c index 242ac5959a..1cd6781a06 100644 --- a/em-format/e-mail-inline-filter.c +++ b/em-format/e-mail-inline-filter.c @@ -426,7 +426,7 @@ e_mail_inline_filter_init (EMailInlineFilter *emif) EMailInlineFilter * e_mail_inline_filter_new (CamelTransferEncoding base_encoding, CamelContentType *base_type, - const gchar *filename) + const gchar *filename) { EMailInlineFilter *emif; diff --git a/em-format/e-mail-parser-application-mbox.c b/em-format/e-mail-parser-application-mbox.c index d8224e35c1..fb901afdea 100644 --- a/em-format/e-mail-parser-application-mbox.c +++ b/em-format/e-mail-parser-application-mbox.c @@ -73,7 +73,7 @@ empe_app_mbox_parse (EMailParserExtension *extension, gint old_len; gint messages; GSList *parts; - GError *error; + GError *error = NULL; if (g_cancellable_is_cancelled (cancellable)) return NULL; @@ -101,17 +101,15 @@ empe_app_mbox_parse (EMailParserExtension *extension, mem_stream, NULL, NULL); g_seekable_seek (G_SEEKABLE (mem_stream), 0, G_SEEK_SET, cancellable, NULL); - error = NULL; camel_mime_parser_init_with_stream (mime_parser, mem_stream, &error); - if (error) { - parts = e_mail_parser_error (parser, cancellable, - _("Error parsing MBOX part: %s"), - error->message ? - error->message : - _("Unknown error")); - g_clear_error (&error); + if (error != NULL) { + parts = e_mail_parser_error ( + parser, cancellable, + _("Error parsing MBOX part: %s"), + error->message); g_object_unref (mem_stream); g_object_unref (mime_parser); + g_error_free (error); return parts; } diff --git a/em-format/e-mail-parser-application-smime.c b/em-format/e-mail-parser-application-smime.c index 11513e3dc2..9fbf24e3ff 100644 --- a/em-format/e-mail-parser-application-smime.c +++ b/em-format/e-mail-parser-application-smime.c @@ -93,19 +93,18 @@ empe_app_smime_parse (EMailParserExtension *extension, opart = camel_mime_part_new (); valid = camel_cipher_context_decrypt_sync ( - context, part, opart, - cancellable, &local_error); + context, part, opart, + cancellable, &local_error); e_mail_part_preserve_charset_in_content_type (part, opart); - if (valid == NULL) { + if (local_error != NULL) { parts = e_mail_parser_error ( parser, cancellable, _("Could not parse S/MIME message: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); - g_clear_error (&local_error); + local_error->message); + g_error_free (local_error); + } else { gint len = part_id->len; @@ -123,7 +122,8 @@ empe_app_smime_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_SMIME); @@ -144,7 +144,8 @@ empe_app_smime_parse (EMailParserExtension *extension, if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_SMIME); } diff --git a/em-format/e-mail-parser-headers.c b/em-format/e-mail-parser-headers.c index 92e93f6f51..c66563aef1 100644 --- a/em-format/e-mail-parser-headers.c +++ b/em-format/e-mail-parser-headers.c @@ -77,7 +77,8 @@ empe_headers_bind_dom (EMailPart *part, addr = webkit_dom_element_get_attribute (photo, "data-mailaddr"); only_local = webkit_dom_element_has_attribute (photo, "data-onlylocal"); - uri = g_strdup_printf ("mail://contact-photo?mailaddr=%s%s", + uri = g_strdup_printf ( + "mail://contact-photo?mailaddr=%s%s", addr, only_local ? "&only-local-photo=1" : ""); webkit_dom_html_image_element_set_src ( diff --git a/em-format/e-mail-parser-inlinepgp-encrypted.c b/em-format/e-mail-parser-inlinepgp-encrypted.c index ebdc274738..3a61a5eeff 100644 --- a/em-format/e-mail-parser-inlinepgp-encrypted.c +++ b/em-format/e-mail-parser-inlinepgp-encrypted.c @@ -85,20 +85,19 @@ empe_inlinepgp_encrypted_parse (EMailParserExtension *extension, valid = camel_cipher_context_decrypt_sync ( cipher, part, opart, cancellable, &local_error); - if (!valid) { + if (local_error != NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Could not parse PGP message: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); - g_clear_error (&local_error); - - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as (parser, - part, part_id, - "application/vnd.evolution.source", - cancellable)); + parser, cancellable, + _("Could not parse PGP message: %s"), + local_error->message); + g_error_free (local_error); + + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as (parser, + part, part_id, + "application/vnd.evolution.source", + cancellable)); g_object_unref (cipher); g_object_unref (opart); @@ -136,7 +135,8 @@ empe_inlinepgp_encrypted_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_PGP); } @@ -156,7 +156,8 @@ empe_inlinepgp_encrypted_parse (EMailParserExtension *extension, if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_PGP); } diff --git a/em-format/e-mail-parser-inlinepgp-signed.c b/em-format/e-mail-parser-inlinepgp-signed.c index 82b8c98178..23461299d9 100644 --- a/em-format/e-mail-parser-inlinepgp-signed.c +++ b/em-format/e-mail-parser-inlinepgp-signed.c @@ -87,21 +87,21 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension, /* Verify the signature of the message */ valid = camel_cipher_context_verify_sync ( cipher, part, cancellable, &local_error); - if (!valid) { + + if (local_error != NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Error verifying signature: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); + parser, cancellable, + _("Error verifying signature: %s"), + local_error->message); - g_clear_error (&local_error); + g_error_free (local_error); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.source", - cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "application/vnd.evolution.source", + cancellable)); g_object_unref (cipher); return parts; @@ -148,7 +148,7 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension, g_string_append (part_id, ".inlinepgp_signed"); parts = e_mail_parser_parse_part ( - parser, opart, part_id, cancellable); + parser, opart, part_id, cancellable); for (iter = parts; iter; iter = iter->next) { EMailPart *mail_part; @@ -157,7 +157,8 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_SIGNED | E_MAIL_PART_VALIDITY_PGP); } @@ -173,13 +174,14 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension, g_string_append (part_id, ".inlinepgp_signed.button"); button = e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.widget.secure-button", - cancellable); + parser, part, part_id, + "application/vnd.evolution.widget.secure-button", + cancellable); if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_SIGNED | E_MAIL_PART_VALIDITY_PGP); } diff --git a/em-format/e-mail-parser-message.c b/em-format/e-mail-parser-message.c index 5f7f8a94d0..7b6e6201d5 100644 --- a/em-format/e-mail-parser-message.c +++ b/em-format/e-mail-parser-message.c @@ -90,7 +90,7 @@ empe_message_parse (EMailParserExtension *extension, if (mime_type && g_ascii_strcasecmp (mime_type, "message/rfc822") == 0) { /* get mime type of the content of the message, - instead of using a generic message/rfc822 */ + * instead of using a generic message/rfc822 */ CamelDataWrapper *content; content = camel_medium_get_content (CAMEL_MEDIUM (part)); diff --git a/em-format/e-mail-parser-multipart-digest.c b/em-format/e-mail-parser-multipart-digest.c index e723b7ee67..2acd8ee614 100644 --- a/em-format/e-mail-parser-multipart-digest.c +++ b/em-format/e-mail-parser-multipart-digest.c @@ -99,10 +99,11 @@ empe_mp_digest_parse (EMailParserExtension *extension, if (ct && !camel_content_type_is (ct, "message", "rfc822")) { cts = camel_content_type_simple (ct); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, subpart, part_id, - cts, cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, subpart, part_id, + cts, cancellable)); g_free (cts); } else { diff --git a/em-format/e-mail-parser-multipart-encrypted.c b/em-format/e-mail-parser-multipart-encrypted.c index e85bcd2a98..db417fabbf 100644 --- a/em-format/e-mail-parser-multipart-encrypted.c +++ b/em-format/e-mail-parser-multipart-encrypted.c @@ -77,15 +77,15 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, mpe = (CamelMultipartEncrypted *) camel_medium_get_content ((CamelMedium *) part); if (!CAMEL_IS_MULTIPART_ENCRYPTED (mpe)) { parts = e_mail_parser_error ( - parser, cancellable, - _("Could not parse MIME message. " - "Displaying as source.")); + parser, cancellable, + _("Could not parse MIME message. " + "Displaying as source.")); parts = g_slist_concat ( - parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution/source", - cancellable)); + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "application/vnd.evolution/source", + cancellable)); return parts; } @@ -95,14 +95,14 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, ((CamelDataWrapper *) mpe)->mime_type, "protocol"); if (!protocol || g_ascii_strcasecmp (protocol, "application/pgp-encrypted") != 0) { parts = e_mail_parser_error ( - parser, cancellable, - _("Unsupported encryption type for multipart/encrypted")); + parser, cancellable, + _("Unsupported encryption type for multipart/encrypted")); parts = g_slist_concat ( - parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "multipart/mixed", cancellable)); + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "multipart/mixed", cancellable)); return parts; } @@ -110,23 +110,23 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, opart = camel_mime_part_new (); valid = camel_cipher_context_decrypt_sync ( - context, part, opart, cancellable, &local_error); + context, part, opart, cancellable, &local_error); e_mail_part_preserve_charset_in_content_type (part, opart); - if (valid == NULL) { + + if (local_error != NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Could not parse PGP/MIME message: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); + parser, cancellable, + _("Could not parse PGP/MIME message: %s"), + local_error->message); - g_clear_error (&local_error); + g_error_free (local_error); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "multipart/mixed", cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "multipart/mixed", cancellable)); g_object_unref (opart); g_object_unref (context); @@ -138,7 +138,7 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, g_string_append (part_id, ".encrypted"); parts = e_mail_parser_parse_part ( - parser, opart, part_id, cancellable); + parser, opart, part_id, cancellable); g_string_truncate (part_id, len); @@ -150,27 +150,29 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_PGP); } /* Add a widget with details about the encryption, but only when - * the decrypted part isn't itself secured, in that case it has created - * the button itself */ + * the decrypted part isn't itself secured, in that case it has + * created the button itself. */ if (!e_mail_part_is_secured (opart)) { GSList *button; EMailPart *mail_part; g_string_append (part_id, ".encrypted.button"); button = e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.widget.secure-button", - cancellable); + parser, part, part_id, + "application/vnd.evolution.widget.secure-button", + cancellable); if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_PGP); } diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c index c8e2995ffc..69882739d9 100644 --- a/em-format/e-mail-parser-multipart-mixed.c +++ b/em-format/e-mail-parser-multipart-mixed.c @@ -105,10 +105,11 @@ empe_mp_mixed_parse (EMailParserExtension *extension, (E_MAIL_PART (new_parts->data)->cid != NULL) && !E_MAIL_PART (new_parts->data)->is_attachment) { - parts = g_slist_concat (parts, - e_mail_parser_wrap_as_attachment ( - parser, subpart, new_parts, - part_id, cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_wrap_as_attachment ( + parser, subpart, new_parts, + part_id, cancellable)); /* Force messages to be expandable */ } else if (!new_parts || @@ -116,10 +117,11 @@ empe_mp_mixed_parse (EMailParserExtension *extension, new_parts && new_parts->data && !E_MAIL_PART (new_parts->data)->is_attachment)) { - parts = g_slist_concat (parts, - e_mail_parser_wrap_as_attachment ( - parser, subpart, new_parts, - part_id, cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_wrap_as_attachment ( + parser, subpart, new_parts, + part_id, cancellable)); if (parts && parts->data) E_MAIL_PART (parts->data)->force_inline = TRUE; } else { @@ -165,5 +167,4 @@ e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) static void e_mail_parser_multipart_mixed_init (EMailParserMultipartMixed *parser) { - } diff --git a/em-format/e-mail-parser-multipart-signed.c b/em-format/e-mail-parser-multipart-signed.c index bd6e1e2970..b7d395ab05 100644 --- a/em-format/e-mail-parser-multipart-signed.c +++ b/em-format/e-mail-parser-multipart-signed.c @@ -88,18 +88,21 @@ empe_mp_signed_parse (EMailParserExtension *extension, mps = (CamelMultipartSigned *) camel_medium_get_content ((CamelMedium *) part); if (!CAMEL_IS_MULTIPART_SIGNED (mps) - || (cpart = camel_multipart_get_part ((CamelMultipart *) mps, + || ( + cpart = camel_multipart_get_part ( + (CamelMultipart *) mps, CAMEL_MULTIPART_SIGNED_CONTENT)) == NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Could not parse MIME message. " - "Displaying as source.")); - - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.source", - cancellable)); + parser, cancellable, + _("Could not parse MIME message. " + "Displaying as source.")); + + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "application/vnd.evolution.source", + cancellable)); return parts; } @@ -125,33 +128,34 @@ empe_mp_signed_parse (EMailParserExtension *extension, if (cipher == NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Unsupported signature format")); + parser, cancellable, + _("Unsupported signature format")); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "multipart/mixed", cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "multipart/mixed", cancellable)); return parts; } valid = camel_cipher_context_verify_sync ( cipher, part, cancellable, &local_error); - if (valid == NULL) { + + if (local_error != NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Error verifying signature: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); + parser, cancellable, + _("Error verifying signature: %s"), + local_error->message); - g_clear_error (&local_error); + g_error_free (local_error); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "multipart/mixed", cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "multipart/mixed", cancellable)); g_object_unref (cipher); return parts; @@ -169,7 +173,7 @@ empe_mp_signed_parse (EMailParserExtension *extension, g_string_append_printf (part_id, ".signed.%d", i); mail_parts = e_mail_parser_parse_part ( - parser, subpart, part_id, cancellable); + parser, subpart, part_id, cancellable); g_string_truncate (part_id, len); @@ -183,7 +187,8 @@ empe_mp_signed_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, validity_type | E_MAIL_PART_VALIDITY_SIGNED); } @@ -199,13 +204,14 @@ empe_mp_signed_parse (EMailParserExtension *extension, g_string_append (part_id, ".signed.button"); button = e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.widget.secure-button", - cancellable); + parser, part, part_id, + "application/vnd.evolution.widget.secure-button", + cancellable); if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, validity_type | E_MAIL_PART_VALIDITY_SIGNED); } @@ -247,5 +253,4 @@ e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) static void e_mail_parser_multipart_signed_init (EMailParserMultipartSigned *parser) { - } diff --git a/em-format/e-mail-parser-text-plain.c b/em-format/e-mail-parser-text-plain.c index 3503be5979..bdfcd15e5d 100644 --- a/em-format/e-mail-parser-text-plain.c +++ b/em-format/e-mail-parser-text-plain.c @@ -203,9 +203,10 @@ empe_text_plain_parse (EMailParserExtension *extension, g_object_unref (inline_filter); camel_content_type_unref (type); - return process_part (parser, part_id, 0, - part, e_mail_part_is_attachment (part), - cancellable); + return process_part ( + parser, part_id, 0, + part, e_mail_part_is_attachment (part), + cancellable); } mp = e_mail_inline_filter_get_multipart (inline_filter); @@ -229,11 +230,12 @@ empe_text_plain_parse (EMailParserExtension *extension, if (!newpart) continue; - parts = g_slist_concat (parts, - process_part ( - parser, part_id, i, - newpart, is_attachment, - cancellable)); + parts = g_slist_concat ( + parts, + process_part ( + parser, part_id, i, + newpart, is_attachment, + cancellable)); } g_object_unref (mp); diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c index 69d74af623..8f007a07f7 100644 --- a/em-format/e-mail-parser.c +++ b/em-format/e-mail-parser.c @@ -143,8 +143,9 @@ e_mail_parser_set_property (GObject *object, switch (property_id) { case PROP_SESSION: - mail_parser_set_session (parser, - CAMEL_SESSION (g_value_get_object (value))); + mail_parser_set_session ( + parser, + g_value_get_object (value)); return; } @@ -161,8 +162,9 @@ e_mail_parser_get_property (GObject *object, switch (property_id) { case PROP_SESSION: - g_value_set_object (value, - G_OBJECT (e_mail_parser_get_session (parser))); + g_value_set_object ( + value, + e_mail_parser_get_session (parser)); return; } @@ -261,7 +263,8 @@ e_mail_parser_get_type (void) EMailParser * e_mail_parser_new (CamelSession *session) { - return g_object_new (E_TYPE_MAIL_PARSER, + return g_object_new ( + E_TYPE_MAIL_PARSER, "session", session, NULL); } @@ -308,15 +311,18 @@ e_mail_parser_parse_sync (EMailParser *parser, if (camel_debug_start ("emformat:parser")) { GSList *iter; - printf ("%s finished with EMailPartList:\n", - G_OBJECT_TYPE_NAME (parser)); + printf ( + "%s finished with EMailPartList:\n", + G_OBJECT_TYPE_NAME (parser)); for (iter = parts_list->list; iter; iter = iter->next) { EMailPart *part = iter->data; if (!part) continue; - printf (" id: %s | cid: %s | mime_type: %s | is_hidden: %d | is_attachment: %d\n", + printf ( + " id: %s | cid: %s | mime_type: %s | is_hidden: %d | is_attachment: %d\n", part->id, part->cid, part->mime_type, - part->is_hidden ? 1 : 0, part->is_attachment ? 1 : 0); + part->is_hidden ? 1 : 0, + part->is_attachment ? 1 : 0); } camel_debug_end (); @@ -399,15 +405,18 @@ e_mail_parser_parse_finish (EMailParser *parser, if (camel_debug_start ("emformat:parser")) { GSList *iter; - printf ("%s finished with EMailPartList:\n", + printf ( + "%s finished with EMailPartList:\n", G_OBJECT_TYPE_NAME (parser)); for (iter = parts_list->list; iter; iter = iter->next) { EMailPart *part = iter->data; if (!part) continue; - printf (" id: %s | cid: %s | mime_type: %s | is_hidden: %d | is_attachment: %d\n", + printf ( + " id: %s | cid: %s | mime_type: %s | is_hidden: %d | is_attachment: %d\n", part->id, part->cid, part->mime_type, - part->is_hidden ? 1 : 0, part->is_attachment ? 1 : 0); + part->is_hidden ? 1 : 0, + part->is_attachment ? 1 : 0); } camel_debug_end (); @@ -520,7 +529,8 @@ e_mail_parser_error (EMailParser *parser, errmsg = g_strdup_vprintf (format, ap); part = camel_mime_part_new (); - camel_mime_part_set_content (part, + camel_mime_part_set_content ( + part, errmsg, strlen (errmsg), "application/vnd.evolution.error"); g_free (errmsg); @@ -561,7 +571,8 @@ attachment_loaded (EAttachment *attachment, static gboolean load_attachment_idle (EAttachment *attachment) { - e_attachment_load_async (attachment, + e_attachment_load_async ( + attachment, (GAsyncReadyCallback) attachment_loaded, NULL); return FALSE; @@ -638,7 +649,8 @@ e_mail_parser_wrap_as_attachment (EMailParser *parser, e_attachment_set_mime_part (empa->attachment, part); e_attachment_set_shown (empa->attachment, empa->shown); - e_attachment_set_can_show (empa->attachment, + e_attachment_set_can_show ( + empa->attachment, extensions && !g_queue_is_empty (extensions)); /* Try to guess size of the attachments */ diff --git a/em-format/e-mail-part-utils.c b/em-format/e-mail-part-utils.c index 9c7c91301f..b1c514d49e 100644 --- a/em-format/e-mail-part-utils.c +++ b/em-format/e-mail-part-utils.c @@ -399,10 +399,11 @@ e_mail_part_build_uri (CamelFolder *folder, } encoded_message_uid = soup_uri_encode (message_uid, NULL); - tmp = g_strdup_printf ("mail://%s/%s/%s", - service_uid, - folder_name, - encoded_message_uid); + tmp = g_strdup_printf ( + "mail://%s/%s/%s", + service_uid, + folder_name, + encoded_message_uid); g_free (encoded_message_uid); if (folder) { @@ -419,21 +420,24 @@ e_mail_part_build_uri (CamelFolder *folder, case G_TYPE_INT: case G_TYPE_BOOLEAN: { gint val = va_arg (ap, gint); - tmp2 = g_strdup_printf ("%s%c%s=%d", tmp, + tmp2 = g_strdup_printf ( + "%s%c%s=%d", tmp, separator, name, val); break; } case G_TYPE_FLOAT: case G_TYPE_DOUBLE: { gdouble val = va_arg (ap, double); - tmp2 = g_strdup_printf ("%s%c%s=%f", tmp, + tmp2 = g_strdup_printf ( + "%s%c%s=%f", tmp, separator, name, val); break; } case G_TYPE_STRING: { gchar *val = va_arg (ap, gchar *); gchar *escaped = soup_uri_encode (val, NULL); - tmp2 = g_strdup_printf ("%s%c%s=%s", tmp, + tmp2 = g_strdup_printf ( + "%s%c%s=%s", tmp, separator, name, escaped); g_free (escaped); break; diff --git a/filter/e-filter-color.c b/filter/e-filter-color.c index e267489b09..213530fbb2 100644 --- a/filter/e-filter-color.c +++ b/filter/e-filter-color.c @@ -112,7 +112,7 @@ filter_color_get_widget (EFilterElement *element) gtk_widget_show (color_button); g_signal_connect ( - G_OBJECT (color_button), "color_set", + color_button, "color_set", G_CALLBACK (set_color), element); return color_button; diff --git a/filter/e-filter-file.c b/filter/e-filter-file.c index e0c6c72552..4be1a10fda 100644 --- a/filter/e-filter-file.c +++ b/filter/e-filter-file.c @@ -85,7 +85,7 @@ filter_file_validate (EFilterElement *element, if (g_strcmp0 (file->type, "file") == 0) { if (!g_file_test (file->path, G_FILE_TEST_IS_REGULAR)) { if (alert) - *alert = e_alert_new ( "filter:bad-file", + *alert = e_alert_new ("filter:bad-file", file->path, NULL); return FALSE; } diff --git a/filter/e-filter-part.c b/filter/e-filter-part.c index ea18f5959c..c9e14e30c6 100644 --- a/filter/e-filter-part.c +++ b/filter/e-filter-part.c @@ -483,7 +483,7 @@ e_filter_part_expand_code (EFilterPart *part, start = source; while (start && (newstart = strstr (start, "${")) - && (end = strstr (newstart + 2, "}")) ) { + && (end = strstr (newstart + 2, "}"))) { EFilterElement *element; len = end - newstart - 2; diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c index f06ebcd1c7..020ef339d3 100644 --- a/libemail-engine/mail-ops.c +++ b/libemail-engine/mail-ops.c @@ -216,7 +216,8 @@ mail_filter_folder (EMailSession *session, static gchar * fetch_mail_desc (struct _fetch_mail_msg *m) { - return g_strdup_printf (_("Fetching mail from '%s'"), + return g_strdup_printf ( + _("Fetching mail from '%s'"), camel_service_get_display_name (CAMEL_SERVICE (m->store))); } @@ -360,7 +361,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m, if (!success) { /* re-enter known UIDs, thus they are not - re-fetched next time */ + * re-fetched next time */ for (i = 0; i < cache_uids->len; i++) { camel_uid_cache_save_uid (cache, cache_uids->pdata[i]); } @@ -547,7 +548,7 @@ get_submission_details_from_identity (EMailSession *session, const gchar *identity_uid, gchar **out_transport_uid, gchar **out_sent_folder_uri, - gboolean *out_replies_to_origin_folder) + gboolean *out_replies_to_origin_folder) { ESource *source; ESourceRegistry *registry; @@ -750,16 +751,14 @@ mail_send_message (struct _send_queue_msg *m, folder = e_mail_session_uri_to_folder_sync ( m->session, sent_folder_uri, 0, cancellable, &local_error); - if (folder == NULL) { + + if (local_error != NULL) { g_string_append_printf ( err, _("Failed to append to %s: %s\n" "Appending to local 'Sent' folder instead."), sent_folder_uri, - local_error ? - local_error->message : - _("Unknown error")); - if (local_error) - g_clear_error (&local_error); + local_error->message); + g_clear_error (&local_error); } } diff --git a/libemail-utils/mail-mt.c b/libemail-utils/mail-mt.c index d7ed6922de..2a3f841f19 100644 --- a/libemail-utils/mail-mt.c +++ b/libemail-utils/mail-mt.c @@ -550,42 +550,42 @@ do_call (struct _call_msg *m, switch (m->type) { case MAIL_CALL_p_p: - p1 = va_arg (ap, gpointer ); + p1 = va_arg (ap, gpointer); m->ret = m->func (p1); break; case MAIL_CALL_p_pp: - p1 = va_arg (ap, gpointer ); - p2 = va_arg (ap, gpointer ); + p1 = va_arg (ap, gpointer); + p2 = va_arg (ap, gpointer); m->ret = m->func (p1, p2); break; case MAIL_CALL_p_ppp: - p1 = va_arg (ap, gpointer ); - p2 = va_arg (ap, gpointer ); - p3 = va_arg (ap, gpointer ); + p1 = va_arg (ap, gpointer); + p2 = va_arg (ap, gpointer); + p3 = va_arg (ap, gpointer); m->ret = m->func (p1, p2, p3); break; case MAIL_CALL_p_pppp: - p1 = va_arg (ap, gpointer ); - p2 = va_arg (ap, gpointer ); - p3 = va_arg (ap, gpointer ); - p4 = va_arg (ap, gpointer ); + p1 = va_arg (ap, gpointer); + p2 = va_arg (ap, gpointer); + p3 = va_arg (ap, gpointer); + p4 = va_arg (ap, gpointer); m->ret = m->func (p1, p2, p3, p4); break; case MAIL_CALL_p_ppppp: - p1 = va_arg (ap, gpointer ); - p2 = va_arg (ap, gpointer ); - p3 = va_arg (ap, gpointer ); - p4 = va_arg (ap, gpointer ); - p5 = va_arg (ap, gpointer ); + p1 = va_arg (ap, gpointer); + p2 = va_arg (ap, gpointer); + p3 = va_arg (ap, gpointer); + p4 = va_arg (ap, gpointer); + p5 = va_arg (ap, gpointer); m->ret = m->func (p1, p2, p3, p4, p5); break; case MAIL_CALL_p_ppippp: - p1 = va_arg (ap, gpointer ); - p2 = va_arg (ap, gpointer ); + p1 = va_arg (ap, gpointer); + p2 = va_arg (ap, gpointer); i1 = va_arg (ap, gint); - p3 = va_arg (ap, gpointer ); - p4 = va_arg (ap, gpointer ); - p5 = va_arg (ap, gpointer ); + p3 = va_arg (ap, gpointer); + p4 = va_arg (ap, gpointer); + p5 = va_arg (ap, gpointer); m->ret = m->func (p1, p2, i1, p3, p4, p5); break; } diff --git a/libevolution-utils/e-xml-utils.h b/libevolution-utils/e-xml-utils.h index fa123a1d04..9796569774 100644 --- a/libevolution-utils/e-xml-utils.h +++ b/libevolution-utils/e-xml-utils.h @@ -72,7 +72,7 @@ gdouble e_xml_get_double_prop_by_name (const xmlNode *parent, gdouble e_xml_get_double_prop_by_name_with_default (const xmlNode *parent, const xmlChar *prop_name, gdouble def); -void e_xml_set_double_prop_by_name ( xmlNode *parent, +void e_xml_set_double_prop_by_name (xmlNode *parent, const xmlChar *prop_name, gdouble value); diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index 2b1c61e000..7daf42dc1c 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -1025,7 +1025,7 @@ gnome_canvas_item_reparent (GnomeCanvasItem *item, /* Everything is ok, now actually reparent the item */ - g_object_ref (G_OBJECT (item)); /* protect it from the unref in group_remove */ + g_object_ref (item); /* protect it from the unref in group_remove */ redraw_if_visible (item); @@ -1038,7 +1038,7 @@ gnome_canvas_item_reparent (GnomeCanvasItem *item, redraw_if_visible (item); item->canvas->need_repick = TRUE; - g_object_unref (G_OBJECT (item)); + g_object_unref (item); } /** @@ -1606,7 +1606,7 @@ static void group_add (GnomeCanvasGroup *group, GnomeCanvasItem *item) { - g_object_ref_sink (G_OBJECT (item)); + g_object_ref_sink (item); if (!group->item_list) { group->item_list = g_list_append (group->item_list, item); @@ -1644,7 +1644,7 @@ group_remove (GnomeCanvasGroup *group, /* Unparent the child */ item->parent = NULL; - g_object_unref (G_OBJECT (item)); + g_object_unref (item); /* Remove it from the list */ @@ -1949,7 +1949,7 @@ gnome_canvas_dispose (GObject *object) if (canvas->root) { g_object_weak_unref (G_OBJECT (canvas->root), panic_root_finalized, canvas); - g_object_unref (G_OBJECT (canvas->root)); + g_object_unref (canvas->root); canvas->root = NULL; } @@ -2383,14 +2383,14 @@ emit_event (GnomeCanvas *canvas, finished = FALSE; while (item && !finished) { - g_object_ref (G_OBJECT (item)); + g_object_ref (item); g_signal_emit ( item, item_signals[ITEM_EVENT], 0, ev, &finished); parent = item->parent; - g_object_unref (G_OBJECT (item)); + g_object_unref (item); item = parent; } diff --git a/mail/e-http-request.c b/mail/e-http-request.c index dd144f81a5..84b243ba7e 100644 --- a/mail/e-http-request.c +++ b/mail/e-http-request.c @@ -94,9 +94,10 @@ redirect_handler (SoupMessage *msg, new_uri = soup_uri_new_with_base (soup_message_get_uri (msg), new_loc); if (!new_uri) { - soup_message_set_status_full (msg, - SOUP_STATUS_MALFORMED, - "Invalid Redirect URL"); + soup_message_set_status_full ( + msg, + SOUP_STATUS_MALFORMED, + "Invalid Redirect URL"); return; } @@ -109,8 +110,8 @@ redirect_handler (SoupMessage *msg, static void send_and_handle_redirection (SoupSession *session, - SoupMessage *message, - gchar **new_location) + SoupMessage *message, + gchar **new_location) { gchar *old_uri = NULL; @@ -331,17 +332,16 @@ handle_http_request (GSimpleAsyncResult *res, /* Write the response body to cache */ error = NULL; cache_stream = camel_data_cache_add (cache, "http", uri_md5, &error); - if (!cache_stream) { + if (error != NULL) { g_warning ( "Failed to create cache file for '%s': %s", - uri, error ? error->message : "Unknown error"); + uri, error->message); g_clear_error (&error); } else { - error = NULL; camel_stream_write ( cache_stream, message->response_body->data, message->response_body->length, cancellable, &error); - if (error) { + if (error != NULL) { g_warning ( "Failed to write data to cache stream: %s", error->message); diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c index 9c777b5c6b..acbce1f20c 100644 --- a/mail/e-mail-account-store.c +++ b/mail/e-mail-account-store.c @@ -1095,7 +1095,7 @@ e_mail_account_store_set_express_mode (EMailAccountStore *store, { g_return_if_fail (E_IS_MAIL_ACCOUNT_STORE (store)); - if ((store->priv->express_mode ? 1 : 0) == (express_mode ? 1 : 0)) + if (store->priv->express_mode == express_mode) return; store->priv->express_mode = express_mode; diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index 6b1eb6cd11..d0aa556cd1 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -977,7 +977,7 @@ e_mail_browser_set_show_deleted (EMailBrowser *browser, { g_return_if_fail (E_IS_MAIL_BROWSER (browser)); - if ((browser->priv->show_deleted ? 1 : 0) == (show_deleted ? 1 : 0)) + if (browser->priv->show_deleted == show_deleted) return; browser->priv->show_deleted = show_deleted; diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c index f5d30d588f..4ca294fddc 100644 --- a/mail/e-mail-notebook-view.c +++ b/mail/e-mail-notebook-view.c @@ -904,7 +904,7 @@ emnv_show_prevtab (EMailNotebookView *view, priv->current_view)->parent_folder_view); pos = gtk_notebook_get_current_page (priv->book); - if (pos > 0 ) + if (pos > 0) gtk_notebook_set_current_page (priv->book, pos - 1); } diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index 8ba322539e..08bedb717b 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -1098,5 +1098,5 @@ void e_mail_paned_view_set_enable_show_folder (EMailPanedView *view, gboolean set) { - view->priv->enable_show_folder = set ? 1 : 0; + view->priv->enable_show_folder = set; } diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index b08a4fcea5..ff3cf2d0fb 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -1716,24 +1716,29 @@ mail_source_retrieved (GObject *object, { CamelMimeMessage *message; EMailDisplay *display; - GError *error; + GError *error = NULL; struct _source_retrieval_closure *data; data = user_data; display = e_mail_reader_get_mail_display (data->browser); - error = NULL; message = camel_folder_get_message_finish ( CAMEL_FOLDER (object), result, &error); - if (error || !message) { + + /* Sanity check. */ + g_return_if_fail ( + ((message != NULL) && (error == NULL)) || + ((message == NULL) && (error != NULL))); + + if (error != NULL) { gchar *status; status = g_strdup_printf ( "%s<br>%s", _("Failed to retrieve message:"), - error ? error->message : _("Unknown error")); + error->message); e_mail_display_set_status (display, status); + g_error_free (error); g_free (status); - g_clear_error (&error); goto free_data; } @@ -4597,7 +4602,7 @@ e_mail_reader_set_group_by_threads (EMailReader *reader, priv = E_MAIL_READER_GET_PRIVATE (reader); - if ((group_by_threads ? 1 : 0) == (priv->group_by_threads ? 1 : 0)) + if (priv->group_by_threads == group_by_threads) return; priv->group_by_threads = group_by_threads; diff --git a/mail/e-mail-tag-editor.c b/mail/e-mail-tag-editor.c index da87b18320..9039366563 100644 --- a/mail/e-mail-tag-editor.c +++ b/mail/e-mail-tag-editor.c @@ -382,7 +382,7 @@ e_mail_tag_editor_set_completed (EMailTagEditor *editor, { g_return_if_fail (E_IS_MAIL_TAG_EDITOR (editor)); - if ((completed ? 1 : 0) == (editor->priv->completed ? 1 : 0)) + if (editor->priv->completed == completed) return; editor->priv->completed = completed; @@ -428,7 +428,7 @@ e_mail_tag_editor_set_use_24_hour_format (EMailTagEditor *editor, { g_return_if_fail (E_IS_MAIL_TAG_EDITOR (editor)); - if ((use_24_hour_format ? 1 : 0) == (editor->priv->use_24_hour_format ? 1 : 0)) + if (editor->priv->use_24_hour_format == use_24_hour_format) return; editor->priv->use_24_hour_format = use_24_hour_format; diff --git a/mail/e-mail-view.c b/mail/e-mail-view.c index 1410d15f4e..35326a1677 100644 --- a/mail/e-mail-view.c +++ b/mail/e-mail-view.c @@ -204,7 +204,7 @@ static void mail_view_set_preview_visible (EMailView *view, gboolean preview_visible) { - if ((view->priv->preview_visible ? 1 : 0) == (preview_visible ? 1 : 0)) + if (view->priv->preview_visible == preview_visible) return; view->priv->preview_visible = preview_visible; @@ -222,7 +222,7 @@ static void mail_view_set_show_deleted (EMailView *view, gboolean show_deleted) { - if ((view->priv->show_deleted ? 1 : 0) == (show_deleted ? 1 : 0)) + if (view->priv->show_deleted == show_deleted) return; view->priv->show_deleted = show_deleted; diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 19784351ef..15cbebc767 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1564,9 +1564,9 @@ emu_update_composers_security (EMsgComposer *composer, static void get_real_folder_uri_and_message_uid (CamelFolder *folder, - const gchar *uid, - gchar **folder_uri, - gchar **message_uid) + const gchar *uid, + gchar **folder_uri, + gchar **message_uid) { g_return_if_fail (folder != NULL); g_return_if_fail (uid != NULL); diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 590ec684df..8061356ba4 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -667,14 +667,15 @@ folder_tree_cell_edited_cb (EMFolderTree *folder_tree, } /* FIXME camel_store_rename_folder_sync() may block. */ - if (!camel_store_rename_folder_sync ( - store, old_full_name, new_full_name, NULL, &local_error)) { + camel_store_rename_folder_sync ( + store, old_full_name, new_full_name, NULL, &local_error); + + if (local_error != NULL) { e_alert_run_dialog_for_args ( parent, "mail:no-rename-folder", old_full_name, new_full_name, - local_error ? local_error->message : _("Unknown error"), NULL); - if (local_error) - g_clear_error (&local_error); + local_error->message, NULL); + g_error_free (local_error); goto exit; } @@ -2003,13 +2004,17 @@ ask_drop_folder (EMFolderTree *folder_tree, g_free (set_value); session = em_folder_tree_get_session (folder_tree); - if (!e_mail_folder_uri_parse (CAMEL_SESSION (session), - src_folder_uri, NULL, &src_folder_name, &error)) { - g_debug ( + + e_mail_folder_uri_parse ( + CAMEL_SESSION (session), + src_folder_uri, NULL, &src_folder_name, &error); + + if (error != NULL) { + g_warning ( "%s: Failed to convert '%s' to folder name: %s", - G_STRFUNC, src_folder_uri, error ? error->message : "Unknown error"); - g_clear_error (&error); + G_STRFUNC, src_folder_uri, error->message); g_object_unref (settings); + g_error_free (error); return FALSE; } diff --git a/mail/em-utils.c b/mail/em-utils.c index 80967f1f52..ec4401f95c 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -348,7 +348,7 @@ em_filename_make_safe (gchar *string) * achieve, and whether it does that as currently * written? */ - if (!g_unichar_isprint (c) || ( c < 0xff && strchr (unsafe_chars, c&0xff ))) { + if (!g_unichar_isprint (c) || (c < 0xff && strchr (unsafe_chars, c&0xff))) { while (ts < p) *ts++ = '_'; } @@ -1230,7 +1230,7 @@ em_utils_get_proxy (void) static gboolean is_only_text_part_in_this_level (GSList *parts, - EMailPart *text_html_part) + EMailPart *text_html_part) { const gchar *dot; gint level_len; @@ -1340,7 +1340,7 @@ em_utils_message_to_html (CamelSession *session, continue; /* prefer-plain can hide HTML parts, even when it's the only - text part in the email, thus show it (and hide again later) */ + * text part in the email, thus show it (and hide again later) */ if (part->is_hidden && !hidden_text_html_part && part->mime_type && !part->is_attachment && g_ascii_strcasecmp (part->mime_type, "text/html") == 0 && diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index 789a7d3611..be821063a6 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -316,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; diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index baeea6e10b..7d4ebdaa1b 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -1017,7 +1017,8 @@ struct _refresh_folders_msg { static gchar * refresh_folders_desc (struct _refresh_folders_msg *m) { - return g_strdup_printf (_("Checking for new mail at '%s'"), + return g_strdup_printf ( + _("Checking for new mail at '%s'"), camel_service_get_display_name (CAMEL_SERVICE (m->store))); } diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index d2ce13f099..84c8b31699 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -703,7 +703,7 @@ e_book_shell_content_set_preview_visible (EBookShellContent *book_shell_content, { g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content)); - if ((book_shell_content->priv->preview_visible ? 1 : 0) == (preview_visible ? 1 : 0)) + if (book_shell_content->priv->preview_visible == preview_visible) return; book_shell_content->priv->preview_visible = preview_visible; @@ -726,7 +726,7 @@ e_book_shell_content_set_preview_show_maps (EBookShellContent *book_shell_conten { g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content)); - if ((book_shell_content->priv->preview_show_maps ? 1 : 0) == (show_maps ? 1 : 0)) + if (book_shell_content->priv->preview_show_maps == show_maps) return; book_shell_content->priv->preview_show_maps = show_maps; diff --git a/modules/bogofilter/evolution-bogofilter.c b/modules/bogofilter/evolution-bogofilter.c index 00bb763151..01374eaa0d 100644 --- a/modules/bogofilter/evolution-bogofilter.c +++ b/modules/bogofilter/evolution-bogofilter.c @@ -253,7 +253,7 @@ static void bogofilter_set_convert_to_unicode (EBogofilter *extension, gboolean convert_to_unicode) { - if ((extension->convert_to_unicode ? 1 : 0) == (convert_to_unicode ? 1 : 0)) + if (extension->convert_to_unicode == convert_to_unicode) return; extension->convert_to_unicode = convert_to_unicode; diff --git a/modules/book-config-ldap/e-source-ldap.c b/modules/book-config-ldap/e-source-ldap.c index 42d8a08eab..854552f2f5 100644 --- a/modules/book-config-ldap/e-source-ldap.c +++ b/modules/book-config-ldap/e-source-ldap.c @@ -485,7 +485,7 @@ e_source_ldap_set_can_browse (ESourceLDAP *extension, { g_return_if_fail (E_IS_SOURCE_LDAP (extension)); - if ((extension->priv->can_browse ? 1 : 0) == (can_browse ? 1 : 0)) + if (extension->priv->can_browse == can_browse) return; extension->priv->can_browse = can_browse; diff --git a/modules/book-config-ldap/evolution-book-config-ldap.c b/modules/book-config-ldap/evolution-book-config-ldap.c index 3aa83de243..42cea3b5d5 100644 --- a/modules/book-config-ldap/evolution-book-config-ldap.c +++ b/modules/book-config-ldap/evolution-book-config-ldap.c @@ -871,9 +871,10 @@ book_config_ldap_insert_widgets (ESourceConfigBackend *backend, book_config_ldap_active_to_port, NULL, (GDestroyNotify) NULL); - /* "active" doesn't change when setting custom port in entry, - thus check also on the "changed" signal */ - g_signal_connect (context->port_combo, "changed", + /* "active" doesn't change when setting custom port + * in entry, so check also on the "changed" signal. */ + g_signal_connect ( + context->port_combo, "changed", G_CALLBACK (book_config_ldap_port_combo_changed), NULL); g_object_bind_property ( @@ -929,10 +930,9 @@ book_config_ldap_insert_widgets (ESourceConfigBackend *backend, G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); - /* initialize values from UI into extension, if the source - is a fresh new source; bindings will take care of proper - values setting into extension properties - */ + /* Initialize values from UI into extension, if the source + * is a fresh new source; bindings will take care of proper + * values setting into extension properties. */ if (is_new_source) { g_object_notify (G_OBJECT (context->host_entry), "text"); g_object_notify (G_OBJECT (context->port_combo), "active"); diff --git a/modules/cal-config-contacts/e-source-contacts.c b/modules/cal-config-contacts/e-source-contacts.c index c19cc6694b..8d9364d87b 100644 --- a/modules/cal-config-contacts/e-source-contacts.c +++ b/modules/cal-config-contacts/e-source-contacts.c @@ -163,7 +163,7 @@ e_source_contacts_set_include_me (ESourceContacts *extension, { g_return_if_fail (E_IS_SOURCE_CONTACTS (extension)); - if ((extension->priv->include_me ? 1 : 0) == (include_me ? 1 : 0)) + if (extension->priv->include_me == include_me) return; extension->priv->include_me = include_me; diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index cb5fb243e9..84193d9623 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -577,17 +577,22 @@ ensure_alarm_notify_is_running (void) filename = g_build_filename (base_dir, "evolution-alarm-notify", NULL); - if (g_file_test (filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE)) { + if (g_file_test (filename, G_FILE_TEST_IS_EXECUTABLE)) { gchar *argv[2]; GError *error = NULL; argv[0] = filename; argv[1] = NULL; - if (!g_spawn_async (base_dir, argv, NULL, 0, NULL, NULL, NULL, &error)) - g_message ("Failed to start '%s': %s", filename, error ? error->message : "Unknown error"); + g_spawn_async ( + base_dir, argv, NULL, 0, NULL, NULL, NULL, &error); - g_clear_error (&error); + if (error != NULL) { + g_message ( + "Failed to start '%s': %s", + filename, error->message); + g_error_free (error); + } } g_free (filename); diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 9eb8d66dcc..8d20cd974a 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -204,7 +204,8 @@ cal_shell_view_date_navigator_selection_changed_cb (ECalShellView *cal_shell_vie gnome_calendar_notify_dates_shown_changed (calendar); - g_signal_handlers_block_by_func (calitem, + g_signal_handlers_block_by_func ( + calitem, cal_shell_view_date_navigator_selection_changed_cb, cal_shell_view); /* make sure the selected days in the calendar matches shown days */ @@ -217,7 +218,8 @@ cal_shell_view_date_navigator_selection_changed_cb (ECalShellView *cal_shell_vie e_calendar_item_set_selection (calitem, &start_date, &end_date); - g_signal_handlers_unblock_by_func (calitem, + g_signal_handlers_unblock_by_func ( + calitem, cal_shell_view_date_navigator_selection_changed_cb, cal_shell_view); } diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index ab9f3180be..bb92852956 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -745,7 +745,7 @@ e_memo_shell_content_set_preview_visible (EMemoShellContent *memo_shell_content, { g_return_if_fail (E_IS_MEMO_SHELL_CONTENT (memo_shell_content)); - if ((memo_shell_content->priv->preview_visible ? 1 : 0) == (preview_visible ? 1 : 0)) + if (memo_shell_content->priv->preview_visible == preview_visible) return; memo_shell_content->priv->preview_visible = preview_visible; diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index 1550afeae8..f1ae7ffefb 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -959,7 +959,7 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) ACTION (MEMO_VIEW_VERTICAL), "current-value", G_SETTINGS_BIND_DEFAULT); - g_object_unref (G_OBJECT (memo_settings)); + g_object_unref (memo_settings); /* Fine tuning. */ diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 3fe5f68f51..89d4bde096 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -301,7 +301,7 @@ task_shell_content_restore_state_cb (EShellWindow *shell_window, priv->paned, "vposition", G_SETTINGS_BIND_DEFAULT); - g_object_unref (G_OBJECT (settings)); + g_object_unref (settings); } static GtkOrientation @@ -770,7 +770,7 @@ e_task_shell_content_set_preview_visible (ETaskShellContent *task_shell_content, { g_return_if_fail (E_IS_TASK_SHELL_CONTENT (task_shell_content)); - if ((task_shell_content->priv->preview_visible ? 1 : 0) == (preview_visible ? 1 : 0)) + if (task_shell_content->priv->preview_visible == preview_visible) return; task_shell_content->priv->preview_visible = preview_visible; diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index e9898fe971..21043fb998 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -1158,7 +1158,7 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) ACTION (TASK_VIEW_VERTICAL), "current-value", G_SETTINGS_BIND_DEFAULT); - g_object_unref (G_OBJECT (settings)); + g_object_unref (settings); /* Fine tuning. */ diff --git a/modules/calendar/e-task-shell-view.c b/modules/calendar/e-task-shell-view.c index f8e8323c3e..b7684a30d8 100644 --- a/modules/calendar/e-task-shell-view.c +++ b/modules/calendar/e-task-shell-view.c @@ -531,7 +531,7 @@ e_task_shell_view_set_confirm_purge (ETaskShellView *task_shell_view, { g_return_if_fail (E_IS_TASK_SHELL_VIEW (task_shell_view)); - if ((task_shell_view->priv->confirm_purge ? 1 : 0) == (confirm_purge ? 1 : 0)) + if (task_shell_view->priv->confirm_purge == confirm_purge) return; task_shell_view->priv->confirm_purge = confirm_purge; diff --git a/modules/itip-formatter/e-source-conflict-search.c b/modules/itip-formatter/e-source-conflict-search.c index 4319b572cc..8cf436de3a 100644 --- a/modules/itip-formatter/e-source-conflict-search.c +++ b/modules/itip-formatter/e-source-conflict-search.c @@ -144,7 +144,7 @@ e_source_conflict_search_set_include_me (ESourceConflictSearch *extension, { g_return_if_fail (E_IS_SOURCE_CONFLICT_SEARCH (extension)); - if ((extension->priv->include_me ? 1 : 0) == (include_me ? 1 : 0)) + if (extension->priv->include_me == include_me) return; extension->priv->include_me = include_me; diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c index 9bf92965d8..c40746a8dc 100644 --- a/modules/itip-formatter/itip-view.c +++ b/modules/itip-formatter/itip-view.c @@ -761,7 +761,7 @@ button_clicked_cb (WebKitDOMElement *element, response = atoi (responseStr); //d (printf ("Clicked btton %d\n", response)); - g_signal_emit (G_OBJECT (data), signals[RESPONSE], 0, response); + g_signal_emit (data, signals[RESPONSE], 0, response); } static void @@ -885,9 +885,9 @@ append_text_table_row (GString *buffer, static void append_text_table_row_nonempty (GString *buffer, - const gchar *id, - const gchar *label, - const gchar *value) + const gchar *id, + const gchar *label, + const gchar *value) { if (!value || !*value) return; @@ -4087,7 +4087,7 @@ find_cal_opened_cb (GObject *source_object, static void itip_cancellable_cancelled (GCancellable *itip_cancellable, - GCancellable *fd_cancellable) + GCancellable *fd_cancellable) { g_cancellable_cancel (fd_cancellable); } @@ -4195,7 +4195,8 @@ find_server (EMailPartItip *pitip, fd->view = view; fd->itip_cancellable = g_object_ref (pitip->cancellable); fd->cancellable = g_cancellable_new (); - fd->cancelled_id = g_cancellable_connect (fd->itip_cancellable, + fd->cancelled_id = g_cancellable_connect ( + fd->itip_cancellable, G_CALLBACK (itip_cancellable_cancelled), fd->cancellable, NULL); fd->conflicts = g_hash_table_new (g_direct_hash, g_direct_equal); fd->uid = g_strdup (uid); @@ -4563,7 +4564,9 @@ receive_objects_ready_cb (GObject *ecalclient, EMailPartItip *pitip = itip_view_get_mail_part (view); GError *error = NULL; - if (!e_cal_client_receive_objects_finish (client, result, &error)) { + e_cal_client_receive_objects_finish (client, result, &error); + + if (error != NULL) { if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { update_item_progress_info (pitip, view, NULL); @@ -4571,9 +4574,10 @@ receive_objects_ready_cb (GObject *ecalclient, itip_view_add_lower_info_item_printf ( view, ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Unable to send item to calendar '%s'. %s"), - e_source_get_display_name (source), error ? error->message : _("Unknown error")); + e_source_get_display_name (source), + error->message); } - g_clear_error (&error); + g_error_free (error); return; } @@ -4910,21 +4914,22 @@ modify_object_cb (GObject *ecalclient, EMailPartItip *pitip = itip_view_get_mail_part (view); GError *error = NULL; - if (!e_cal_client_modify_object_finish (client, result, &error)) { - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || - g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { - g_clear_error (&error); - return; - } + e_cal_client_modify_object_finish (client, result, &error); + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || + g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { + g_error_free (error); + return; + } + + if (error != NULL) { update_item_progress_info (pitip, view, NULL); pitip->update_item_error_info_id = itip_view_add_lower_info_item_printf ( view, ITIP_VIEW_INFO_ITEM_TYPE_ERROR, _("Unable to update attendee. %s"), - error ? error->message : _("Unknown error")); - - g_clear_error (&error); + error->message); + g_error_free (error); } else { update_item_progress_info (pitip, view, NULL); itip_view_add_lower_info_item ( @@ -5803,7 +5808,7 @@ in_proper_folder (ESourceRegistry *registry, res = ((flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_TRASH && (flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_JUNK && /* it can be Inbox */ - ( (flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_INBOX || + ((flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_INBOX || /* or any other virtual folder */ CAMEL_IS_VEE_FOLDER (folder) || /* or anything else except of sent, outbox or drafts folder */ diff --git a/modules/mail-config/e-mail-config-sendmail-backend.c b/modules/mail-config/e-mail-config-sendmail-backend.c index 4487406811..f656caa6ee 100644 --- a/modules/mail-config/e-mail-config-sendmail-backend.c +++ b/modules/mail-config/e-mail-config-sendmail-backend.c @@ -34,7 +34,7 @@ G_DEFINE_DYNAMIC_TYPE ( static void mail_config_sendmail_backend_insert_widgets (EMailConfigServiceBackend *backend, - GtkBox *parent) + GtkBox *parent) { CamelSettings *settings; GtkLabel *label; @@ -171,7 +171,8 @@ mail_config_sendmail_backend_check_complete (EMailConfigServiceBackend *backend) settings = e_mail_config_service_backend_get_settings (backend); - g_object_get (G_OBJECT (settings), + g_object_get ( + G_OBJECT (settings), "use-custom-binary", &use_custom_binary, "custom-binary", &custom_binary, NULL); diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c index 69cbfe6d73..8bc2aad12d 100644 --- a/modules/mail/e-mail-attachment-handler.c +++ b/modules/mail/e-mail-attachment-handler.c @@ -98,7 +98,7 @@ mail_attachment_handler_forward (GtkAction *action, static void mail_attachment_handler_reply (EAttachmentHandler *handler, - EMailReplyType reply_type) + EMailReplyType reply_type) { EMailAttachmentHandlerPrivate *priv; EShellSettings *shell_settings; diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 83a4fa48fe..9376f437ae 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -258,7 +258,7 @@ mail_shell_view_folder_tree_popup_event_cb (EShellView *shell_view, static gboolean mail_shell_view_mail_display_needs_key (EMailDisplay *mail_display, - gboolean with_input) + gboolean with_input) { gboolean needs_key = FALSE; @@ -338,10 +338,10 @@ mail_shell_view_key_press_event_cb (EMailShellView *mail_shell_view, window = webkit_dom_document_get_default_view (document); /* Workaround WebKit bug for key navigation, when inner IFRAME is focused. - EMailView's inner IFRAMEs have disabled scrolling, but WebKit doesn't post - key navigation events to parent's frame, thus the view doesn't scroll. - This is a poor workaround for this issue, the main frame is focused, - which has scrolling enabled. + * EMailView's inner IFRAMEs have disabled scrolling, but WebKit doesn't post + * key navigation events to parent's frame, thus the view doesn't scroll. + * This is a poor workaround for this issue, the main frame is focused, + * which has scrolling enabled. */ webkit_dom_dom_window_focus (window); } diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c index 47d571b3e6..66ff32106c 100644 --- a/modules/prefer-plain/e-mail-parser-prefer-plain.c +++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c @@ -200,8 +200,9 @@ empe_prefer_plain_parse (EMailParserExtension *extension, if (emp_pp->mode != ONLY_PLAIN) return NULL; - /* Enforcing text/plain, but got only HTML part, thus add it as attachment, - to not show empty message preview, which is confusing */ + /* Enforcing text/plain, but got only HTML part, so add it + * as attachment, to not show empty message preview, which + * is confusing. */ return make_part_attachment ( parser, part, part_id, FALSE, cancellable); diff --git a/modules/spamassassin/evolution-spamassassin.c b/modules/spamassassin/evolution-spamassassin.c index 6a8affab83..2202f71003 100644 --- a/modules/spamassassin/evolution-spamassassin.c +++ b/modules/spamassassin/evolution-spamassassin.c @@ -334,7 +334,7 @@ static void spam_assassin_set_local_only (ESpamAssassin *extension, gboolean local_only) { - if ((extension->local_only ? 1 : 0) == (local_only ? 1 : 0)) + if (extension->local_only == local_only) return; extension->local_only = local_only; @@ -1090,16 +1090,16 @@ e_spam_assassin_init (ESpamAssassin *extension) g_settings_bind ( settings, "local-only", - G_OBJECT (extension), "local-only", + extension, "local-only", G_SETTINGS_BIND_DEFAULT); g_settings_bind ( settings, "socket-path", - G_OBJECT (extension), "socket-path", + extension, "socket-path", G_SETTINGS_BIND_DEFAULT); #ifdef HAVE_SPAM_DAEMON g_settings_bind ( settings, "use-daemon", - G_OBJECT (extension), "use-daemon", + extension, "use-daemon", G_SETTINGS_BIND_DEFAULT); #endif /* HAVE_SPAM_DAEMON */ diff --git a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c index 21bf74d849..3de54e627f 100644 --- a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c +++ b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c @@ -1204,7 +1204,7 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_BOOLEAN, 0x8506))) != MAPI_UNDEFINED) { dword_ptr = (DWORD *) filename->data; - fprintf (fptr, "CLASS:" ); + fprintf (fptr, "CLASS:"); if (*dword_ptr == 1) { fprintf (fptr,"PRIVATE\n"); } else { @@ -1338,7 +1338,7 @@ void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { PROP_TAG (PT_BOOLEAN, 0x8506)); if (filename != MAPI_UNDEFINED) { dword_ptr = (DWORD *) filename->data; - fprintf (fptr, "CLASS:" ); + fprintf (fptr, "CLASS:"); if (*dword_ptr == 1) { fprintf (fptr,"PRIVATE\n"); } else { diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c index b06d168fed..c19551944b 100644 --- a/plugins/bbdb/bbdb.c +++ b/plugins/bbdb/bbdb.c @@ -361,7 +361,7 @@ bbdb_do_it (EBookClient *client, g_error_free (error); } - g_object_unref (G_OBJECT (contact)); + g_object_unref (contact); g_free (uid); } @@ -383,7 +383,7 @@ bbdb_create_book_client (gint type) if (type == AUTOMATIC_CONTACTS_ADDRESSBOOK) enable = g_settings_get_boolean (settings, CONF_KEY_ENABLE); if (!enable) { - g_object_unref (G_OBJECT (settings)); + g_object_unref (settings); return NULL; } @@ -394,7 +394,7 @@ bbdb_create_book_client (gint type) else uid = g_settings_get_string ( settings, CONF_KEY_WHICH_ADDRESSBOOK); - g_object_unref (G_OBJECT (settings)); + g_object_unref (settings); shell = e_shell_get_default (); registry = e_shell_get_registry (shell); @@ -428,11 +428,14 @@ bbdb_open_book_client (EBookClient *client) if (!client) return FALSE; - if (!e_client_open_sync (E_CLIENT (client), FALSE, NULL, &error)) { - g_warning ("bbdb: failed to open addressbook: %s", error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + e_client_open_sync (E_CLIENT (client), FALSE, NULL, &error); + + if (error != NULL) { + g_warning ( + "bbdb: failed to open addressbook: %s", + error->message); g_object_unref (client); + g_error_free (error); return FALSE; } @@ -448,7 +451,7 @@ bbdb_check_gaim_enabled (void) settings = g_settings_new (CONF_SCHEMA); gaim_enabled = g_settings_get_boolean (settings, CONF_KEY_ENABLE_GAIM); - g_object_unref (G_OBJECT (settings)); + g_object_unref (settings); return gaim_enabled; } diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index 7f850ae631..5d00da5e19 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -359,7 +359,8 @@ static gboolean dbx_load_index_table (DbxImporter *m, guint32 pos, guint32 *inde return FALSE; } - d (printf ("Index at %x: indexCount %x, anotherTablePtr %x\n", + d ( + printf ("Index at %x: indexCount %x, anotherTablePtr %x\n", pos, tindex.indexCount, tindex.anotherTablePtr)); if (tindex.indexCount > 0) { @@ -658,8 +659,9 @@ dbx_import_file (DbxImporter *m) camel_operation_progress (cancellable, 100 * i / m->index_count); if (!dbx_read_email (m, m->indices[i], tmpfile, &dbx_flags)) { - d (printf ("Cannot read email index %d at %x\n", - i, m->indices[i])); + d ( + printf ("Cannot read email index %d at %x\n", + i, m->indices[i])); if (m->base.error != NULL) goto out; missing++; diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index 07d0f280ae..5f66489c07 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -151,7 +151,8 @@ epech_fill_widgets_with_data (CustomHeaderOptionsDialog *mch) if (priv->flag == 0) { gtk_combo_box_set_active ((GtkComboBox *) sub_combo_box_fill->header_value_combo_box,0); } else { - gtk_combo_box_set_active ((GtkComboBox *) sub_combo_box_fill->header_value_combo_box, + gtk_combo_box_set_active ( + (GtkComboBox *) sub_combo_box_fill->header_value_combo_box, g_array_index (priv->header_index_type, gint, set_index_column)); } } @@ -189,7 +190,7 @@ epech_header_options_cb (GtkDialog *dialog, break; } - g_signal_emit (G_OBJECT (func_data), signals[MCH_RESPONSE], 0, state); + g_signal_emit (func_data, signals[MCH_RESPONSE], 0, state); } static gboolean @@ -315,7 +316,9 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) str = g_dpgettext2 (GETTEXT_PACKAGE, "email-custom-header-Security", security_field); gtk_label_set_markup (GTK_LABEL (priv->header_type_name_label), str); - gtk_table_attach (GTK_TABLE (priv->header_table), priv->header_type_name_label, 0, 1, row, column, + gtk_table_attach ( + GTK_TABLE (priv->header_table), + priv->header_type_name_label, 0, 1, row, column, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); @@ -330,7 +333,8 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) temp = &g_array_index (priv->email_custom_header_details, EmailCustomHeaderDetails,sub_index); sub_combo_box_ptr = &g_array_index (priv->combo_box_header_value, HeaderValueComboBox,sub_index); - gtk_table_attach (GTK_TABLE (priv->header_table), + gtk_table_attach ( + GTK_TABLE (priv->header_table), sub_combo_box_ptr->header_value_combo_box, 1, 2, row_combo, column_combo, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); @@ -424,7 +428,8 @@ epech_append_to_custom_header (CustomHeaderOptionsDialog *dialog, temp_header_value_ptr = &g_array_index (temp_header_ptr->sub_header_type_value, CustomSubHeader,sub_type_index); if (sub_type_index == g_array_index (priv->header_index_type, gint, index_subtype)) { - e_msg_composer_set_header (composer, (temp_header_ptr->header_type_value)->str, + e_msg_composer_set_header ( + composer, (temp_header_ptr->header_type_value)->str, (temp_header_value_ptr->sub_header_string_value)->str); } } @@ -566,7 +571,8 @@ commit_changes (ConfigData *cd) while (valid) { gchar *keyword = NULL, *value = NULL; - gtk_tree_model_get (model, &iter, + gtk_tree_model_get ( + model, &iter, HEADER_KEY_COLUMN, &keyword, HEADER_VALUE_COLUMN, &value, -1); @@ -848,8 +854,9 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) gtk_tree_view_set_model (GTK_TREE_VIEW (cd->treeview), GTK_TREE_MODEL (cd->store)); renderer = gtk_cell_renderer_text_new (); - col_pos = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cd->treeview), -1, _("Key"), - renderer, "text", HEADER_KEY_COLUMN, NULL); + col_pos = gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (cd->treeview), -1, _("Key"), + renderer, "text", HEADER_KEY_COLUMN, NULL); 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); @@ -864,7 +871,8 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) G_CALLBACK (cell_editing_canceled_cb), cd); renderer = gtk_cell_renderer_text_new (); - col_pos = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cd->treeview), -1, _("Values"), + col_pos = gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (cd->treeview), -1, _("Values"), renderer, "text", HEADER_VALUE_COLUMN, NULL); col = gtk_tree_view_get_column (GTK_TREE_VIEW (cd->treeview), col_pos -1); gtk_tree_view_column_set_resizable (col, TRUE); diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index 42cdb9f9ff..0c43acbfdc 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -290,7 +290,7 @@ external_editor_thread (gpointer user_data) settings = g_settings_new ("org.gnome.evolution.plugin.external-editor"); editor_cmd = g_settings_get_string (settings, "command"); if (!editor_cmd) { - if (!(editor_cmd = g_strdup (g_getenv ("EDITOR"))) ) + 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. */ @@ -302,7 +302,7 @@ external_editor_thread (gpointer user_data) && gtk_html_get_cursor_pos ( gtkhtml_editor_get_html ( GTKHTML_EDITOR (composer)), &position, &offset) - && position >= 0 && offset >= 0) { + && position >= 0 && offset >= 0) { gchar *tmp = editor_cmd; gint lineno; gboolean set_nofork; @@ -365,8 +365,9 @@ external_editor_thread (gpointer user_data) htmltext = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_PRE, 0); - array = g_array_sized_new (TRUE, TRUE, - sizeof (gpointer), 2 * sizeof (gpointer)); + array = g_array_sized_new ( + TRUE, TRUE, + sizeof (gpointer), 2 * sizeof (gpointer)); array = g_array_append_val (array, composer); array = g_array_append_val (array, htmltext); diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index 94cfa6c6c1..cc01d65c30 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -509,13 +509,15 @@ do_play_sound (gboolean beep, if (!beep) { #ifdef HAVE_CANBERRA if (!use_theme && file && *file) - ca_context_play (mailnotification, 0, - CA_PROP_MEDIA_FILENAME, file, - NULL); + ca_context_play ( + mailnotification, 0, + CA_PROP_MEDIA_FILENAME, file, + NULL); else - ca_context_play (mailnotification, 0, - CA_PROP_EVENT_ID,"message-new-email", - NULL); + ca_context_play ( + mailnotification, 0, + CA_PROP_EVENT_ID,"message-new-email", + NULL); #endif } else gdk_beep (); diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 36801ccb99..a9a2042bef 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -291,9 +291,10 @@ set_description (ECalComponent *comp, /* convert to UTF-8 string */ if (str && content->mime_type->params && content->mime_type->params->value) { - convert_str = g_convert (str, strlen (str), - "UTF-8", content->mime_type->params->value, - &bytes_read, &bytes_written, NULL); + convert_str = g_convert ( + str, strlen (str), + "UTF-8", content->mime_type->params->value, + &bytes_read, &bytes_written, NULL); } text = g_new0 (ECalComponentText, 1); @@ -589,14 +590,16 @@ do_ask (const gchar *text, gboolean is_create_edit_add) { gint res; - GtkWidget *dialog = gtk_message_dialog_new (NULL, + GtkWidget *dialog = gtk_message_dialog_new ( + NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, is_create_edit_add ? GTK_BUTTONS_NONE : GTK_BUTTONS_YES_NO, "%s", text); if (is_create_edit_add) { - gtk_dialog_add_buttons (GTK_DIALOG (dialog), + gtk_dialog_add_buttons ( + GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_EDIT, GTK_RESPONSE_YES, GTK_STOCK_NEW, GTK_RESPONSE_NO, @@ -642,21 +645,24 @@ get_question_add_all_mails (ECalClientSourceType source_type, switch (source_type) { case E_CAL_CLIENT_SOURCE_TYPE_EVENTS: /* Translators: Note there are always more than 10 mails selected */ - ask = ngettext ("You have selected %d mails to be converted to events. Do you really want to add them all?", - "You have selected %d mails to be converted to events. Do you really want to add them all?", - count); + ask = ngettext ( + "You have selected %d mails to be converted to events. Do you really want to add them all?", + "You have selected %d mails to be converted to events. Do you really want to add them all?", + count); break; case E_CAL_CLIENT_SOURCE_TYPE_TASKS: /* Translators: Note there are always more than 10 mails selected */ - ask = ngettext ("You have selected %d mails to be converted to tasks. Do you really want to add them all?", - "You have selected %d mails to be converted to tasks. Do you really want to add them all?", - count); + ask = ngettext ( + "You have selected %d mails to be converted to tasks. Do you really want to add them all?", + "You have selected %d mails to be converted to tasks. Do you really want to add them all?", + count); break; case E_CAL_CLIENT_SOURCE_TYPE_MEMOS: /* Translators: Note there are always more than 10 mails selected */ - ask = ngettext ("You have selected %d mails to be converted to memos. Do you really want to add them all?", - "You have selected %d mails to be converted to memos. Do you really want to add them all?", - count); + ask = ngettext ( + "You have selected %d mails to be converted to memos. Do you really want to add them all?", + "You have selected %d mails to be converted to memos. Do you really want to add them all?", + count); break; default: g_assert_not_reached (); @@ -712,8 +718,9 @@ comp_editor_title_changed (GtkWidget *widget, comp_name = g_strndup (title, splitter - title - 1); task_name = g_strdup (splitter + 2); - new_title = g_strdup_printf ("%s (%d/%d) - %s", - comp_name, mc->mails_done, mc->mails_count, task_name); + new_title = g_strdup_printf ( + "%s (%d/%d) - %s", + 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 @@ -760,7 +767,8 @@ do_manage_comp_idle (struct _manage_comp *mc) if (!e_cal_component_set_icalcomponent (edit_comp, icalcomponent_new_clone (mc->stored_comp))) { g_object_unref (edit_comp); edit_comp = NULL; - error = g_error_new (E_CAL_CLIENT_ERROR, + error = g_error_new ( + E_CAL_CLIENT_ERROR, E_CAL_CLIENT_ERROR_INVALID_OBJECT, "%s", _("Invalid object returned from a server")); @@ -785,8 +793,9 @@ do_manage_comp_idle (struct _manage_comp *mc) /* FIXME Pass in the EShell instance. */ shell = e_shell_get_default (); - editor = get_component_editor (shell, mc->client, edit_comp, - edit_comp == mc->comp, &error); + editor = get_component_editor ( + shell, mc->client, edit_comp, + edit_comp == mc->comp, &error); if (editor && !error) { /* Force editor's title change */ @@ -838,8 +847,10 @@ do_mail_to_event (AsyncData *data) GError *err = NULL; /* open the task client */ - if (!e_client_open_sync (E_CLIENT (client), FALSE, NULL, &err)) { - report_error_idle (_("Cannot open calendar. %s"), err ? err->message : _("Unknown error.")); + e_client_open_sync (E_CLIENT (client), FALSE, NULL, &err); + + if (err != NULL) { + report_error_idle (_("Cannot open calendar. %s"), err->message); } else if (e_client_is_readonly (E_CLIENT (client))) { if (err) report_error_idle ("Check readonly failed. %s", err->message); @@ -1218,9 +1229,10 @@ mail_to_event (ECalClientSourceType source_type, else data->selected_text = NULL; - thread = g_thread_try_new (NULL, (GThreadFunc) do_mail_to_event, data, &error); - if (!thread) { - g_warning (G_STRLOC ": %s", error ? error->message : "Unknown error"); + thread = g_thread_try_new ( + NULL, (GThreadFunc) do_mail_to_event, data, &error); + if (error != NULL) { + g_warning (G_STRLOC ": %s", error->message); g_error_free (error); } else { g_thread_unref (thread); diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c index b31414276b..fb6be6ba1d 100644 --- a/plugins/mailing-list-actions/mailing-list-actions.c +++ b/plugins/mailing-list-actions/mailing-list-actions.c @@ -193,10 +193,13 @@ emla_list_action_cb (CamelFolder *folder, } for (t = 0; t < G_N_ELEMENTS (emla_action_headers); t++) { - if (emla_action_headers[t].action == context->action && - (header = camel_medium_get_header (CAMEL_MEDIUM (message), - emla_action_headers[t].header)) != NULL) - break; + if (emla_action_headers[t].action == context->action) { + header = camel_medium_get_header ( + CAMEL_MEDIUM (message), + emla_action_headers[t].header); + if (header != NULL) + break; + } } if (!header) { diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index 958b374ebc..e691962f67 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -1403,8 +1403,9 @@ pst_process_email (PstImporter *m, } else if (item->body.str) { camel_mime_part_set_content (CAMEL_MIME_PART (msg), item->body.str, strlen (item->body.str), "text/plain"); } else { - g_warning ("Email without body. Subject:%s", - (item->subject.str ? item->subject.str : "(empty)")); + g_warning ( + "Email without body. Subject:%s", + (item->subject.str ? item->subject.str : "(empty)")); camel_mime_part_set_content (CAMEL_MIME_PART (msg), "\n", 1, "text/plain"); } @@ -1510,7 +1511,7 @@ contact_set_date (EContact *contact, EContactField id, FILETIME *date) { - if (date && (date->dwLowDateTime || date->dwHighDateTime) ) { + if (date && (date->dwLowDateTime || date->dwHighDateTime)) { time_t t1; struct tm tm; EContactDate *bday; @@ -1580,17 +1581,20 @@ pst_process_contact (PstImporter *m, contact_set_string (ec, E_CONTACT_ORG_UNIT, c->department.str); contact_set_string (ec, E_CONTACT_TITLE, c->job_title.str); - contact_set_address (ec,E_CONTACT_ADDRESS_WORK, - c->business_address.str, c->business_city.str, c->business_country.str, - c->business_po_box.str, c->business_postal_code.str, c->business_state.str, c->business_street.str); + contact_set_address ( + ec,E_CONTACT_ADDRESS_WORK, + c->business_address.str, c->business_city.str, c->business_country.str, + c->business_po_box.str, c->business_postal_code.str, c->business_state.str, c->business_street.str); - contact_set_address (ec,E_CONTACT_ADDRESS_HOME, - c->home_address.str, c->home_city.str, c->home_country.str, - c->home_po_box.str, c->home_postal_code.str, c->home_state.str, c->home_street.str); + contact_set_address ( + ec,E_CONTACT_ADDRESS_HOME, + c->home_address.str, c->home_city.str, c->home_country.str, + c->home_po_box.str, c->home_postal_code.str, c->home_state.str, c->home_street.str); - contact_set_address (ec,E_CONTACT_ADDRESS_OTHER, - c->other_address.str, c->other_city.str, c->other_country.str, - c->other_po_box.str, c->other_postal_code.str, c->other_state.str, c->other_street.str); + contact_set_address ( + ec,E_CONTACT_ADDRESS_OTHER, + c->other_address.str, c->other_city.str, c->other_country.str, + c->other_po_box.str, c->other_postal_code.str, c->other_state.str, c->other_street.str); contact_set_string (ec, E_CONTACT_PHONE_ASSISTANT, c->assistant_phone.str); contact_set_string (ec, E_CONTACT_PHONE_BUSINESS_FAX, c->business_fax.str); @@ -1699,7 +1703,7 @@ struct icaltimetype get_ical_date (FILETIME *date, gboolean is_date) { - if (date && (date->dwLowDateTime || date->dwHighDateTime) ) { + if (date && (date->dwLowDateTime || date->dwHighDateTime)) { time_t t; t = pst_fileTimeToUnixTime (date); diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index ab3e36dd6d..9a06c45b38 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -182,9 +182,10 @@ publish_uri_async (EPublishUri *uri) GThread *thread = NULL; GError *error = NULL; - thread = g_thread_try_new (NULL, (GThreadFunc) publish_no_succ_info, uri, &error); - if (!thread) { - g_warning (G_STRLOC ": %s", error ? error->message : "Unknown error"); + thread = g_thread_try_new ( + NULL, (GThreadFunc) publish_no_succ_info, uri, &error); + if (error != NULL) { + g_warning (G_STRLOC ": %s", error->message); g_error_free (error); } else { g_thread_unref (thread); @@ -328,16 +329,21 @@ ask_password (GMountOperation *op, username = soup_uri_get_user (soup_uri); password = e_passwords_get_password (NULL, ms->uri->location); - req_pass = ((username && *username) && !(ms->uri->service_type == TYPE_ANON_FTP && - !strcmp (username, "anonymous"))) ? TRUE : FALSE; + req_pass = + ((username && *username) && + !(ms->uri->service_type == TYPE_ANON_FTP && + !strcmp (username, "anonymous"))); if (!password && req_pass) { 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, - &remember, - NULL); + password = e_passwords_ask_password ( + _("Enter password"), NULL, + ms->uri->location, message, + E_PASSWORDS_REMEMBER_FOREVER | + E_PASSWORDS_SECRET | + E_PASSWORDS_ONLINE, + &remember, NULL); if (!password) { /* user canceled password dialog */ @@ -379,9 +385,10 @@ ask_question (GMountOperation *op, primary = g_strndup (message, strlen (message) - strlen (primary)); } - dialog = gtk_message_dialog_new (NULL, - 0, GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, "%s", primary); + dialog = gtk_message_dialog_new ( + NULL, + 0, GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, "%s", primary); g_free (primary); if (secondary) { @@ -728,10 +735,11 @@ url_edit_clicked (GtkButton *button, url_editor = url_editor_dialog_new (model, uri); if (url_editor_dialog_run ((UrlEditorDialog *) url_editor)) { - 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); id = GPOINTER_TO_UINT (g_hash_table_lookup (uri_timeouts, uri)); if (id) @@ -771,9 +779,10 @@ url_remove_clicked (GtkButton *button, gtk_tree_model_get (model, &iter, URL_LIST_URL_COLUMN, &url, -1); - confirm = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, - _("Are you sure you want to remove this location?")); + confirm = gtk_message_dialog_new ( + NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, + _("Are you sure you want to remove this location?")); gtk_dialog_add_button (GTK_DIALOG (confirm), GTK_STOCK_CANCEL, GTK_RESPONSE_NO); gtk_dialog_add_button (GTK_DIALOG (confirm), GTK_STOCK_REMOVE, GTK_RESPONSE_YES); gtk_dialog_set_default_response (GTK_DIALOG (confirm), GTK_RESPONSE_CANCEL); @@ -863,14 +872,16 @@ publish_calendar_locations (EPlugin *epl, renderer = gtk_cell_renderer_toggle_new (); 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); + gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (ui->treeview), -1, _("Enabled"), + renderer, "active", URL_LIST_ENABLED_COLUMN, NULL); 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); + 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 ( @@ -910,10 +921,11 @@ publish_calendar_locations (EPlugin *epl, EPublishUri *url = (EPublishUri *) l->data; gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - URL_LIST_ENABLED_COLUMN, url->enabled, - URL_LIST_LOCATION_COLUMN, url->location, - URL_LIST_URL_COLUMN, url, -1); + gtk_list_store_set ( + store, &iter, + URL_LIST_ENABLED_COLUMN, url->enabled, + URL_LIST_LOCATION_COLUMN, url->location, + URL_LIST_URL_COLUMN, url, -1); l = g_slist_next (l); } @@ -995,9 +1007,13 @@ e_plugin_lib_enable (EPlugin *ep, uris = g_settings_get_strv (settings, PC_SETTINGS_URIS); g_object_unref (settings); - thread = g_thread_try_new (NULL, (GThreadFunc) publish_uris_set_timeout, uris, &error); - if (!thread) { - g_warning ("Could create thread to set timeout for publishing uris : %s", error ? error->message : "Unknown error"); + thread = g_thread_try_new ( + NULL, (GThreadFunc) + publish_uris_set_timeout, uris, &error); + if (error != NULL) { + g_warning ( + "Could create thread to set timeout " + "for publishing uris : %s", error->message); g_error_free (error); } else { g_thread_unref (thread); diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c index 3e97756d03..5f8a68e693 100644 --- a/plugins/publish-calendar/url-editor-dialog.c +++ b/plugins/publish-calendar/url-editor-dialog.c @@ -87,12 +87,13 @@ create_uri (UrlEditorDialog *dialog) if (uri->location) g_free (uri->location); - uri->location = g_strdup_printf ("%s://%s%s%s%s%s%s%s", - method, - username, (username[0] != '\0') ? "@" : "", - server, - (port[0] != '\0') ? ":" : "", port, - (file[0] != '/') ? "/" : "", file); + uri->location = g_strdup_printf ( + "%s://%s%s%s%s%s%s%s", + method, + username, (username[0] != '\0') ? "@" : "", + server, + (port[0] != '\0') ? ":" : "", port, + (file[0] != '/') ? "/" : "", file); g_free (server); g_free (file); diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c index c4326ccd0f..28e0b4c35f 100644 --- a/plugins/save-calendar/rdf-format.c +++ b/plugins/save-calendar/rdf-format.c @@ -75,8 +75,9 @@ display_error_message (GtkWidget *parent, { GtkWidget *dialog; - dialog = gtk_message_dialog_new (GTK_WINDOW (parent), 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, - "%s", error->message); + dialog = gtk_message_dialog_new ( + GTK_WINDOW (parent), 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + "%s", error->message); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } diff --git a/plugins/save-calendar/save-calendar.c b/plugins/save-calendar/save-calendar.c index 6577335519..9e2c99754e 100644 --- a/plugins/save-calendar/save-calendar.c +++ b/plugins/save-calendar/save-calendar.c @@ -87,7 +87,8 @@ on_type_combobox_changed (GtkComboBox *combobox, gtk_combo_box_get_active_iter (combobox, &iter); - gtk_tree_model_get (model, &iter, + gtk_tree_model_get ( + model, &iter, DEST_HANDLER, &handler, -1); if (handler->options_widget) @@ -152,18 +153,21 @@ ask_destination_and_save (ESourceSelector *selector, gtk_list_store_clear (store); renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), - renderer, "text", DEST_NAME_COLUMN, NULL); + gtk_cell_layout_set_attributes ( + GTK_CELL_LAYOUT (combo), + renderer, "text", DEST_NAME_COLUMN, NULL); while (format_handlers) { handler = format_handlers->data; gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, DEST_NAME_COLUMN, + gtk_list_store_set ( + store, &iter, DEST_NAME_COLUMN, handler->combo_label, -1); gtk_list_store_set (store, &iter, DEST_HANDLER, handler, -1); if (handler->options_widget) { - gtk_box_pack_start (GTK_BOX (extra_widget), + gtk_box_pack_start ( + GTK_BOX (extra_widget), GTK_WIDGET (handler->options_widget), TRUE, TRUE, 0); gtk_widget_hide (handler->options_widget); } @@ -182,12 +186,13 @@ ask_destination_and_save (ESourceSelector *selector, G_CALLBACK (on_type_combobox_changed), extra_widget); g_object_set_data (G_OBJECT (combo), "format-box", hbox); - dialog = gtk_file_chooser_dialog_new (_("Select destination file"), - NULL, - GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE_AS, GTK_RESPONSE_OK, - NULL); + dialog = gtk_file_chooser_dialog_new ( + _("Select destination file"), + NULL, + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE_AS, GTK_RESPONSE_OK, + NULL); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), extra_widget); @@ -201,7 +206,8 @@ ask_destination_and_save (ESourceSelector *selector, gchar *tmp = NULL; gtk_combo_box_get_active_iter (combo, &iter); - gtk_tree_model_get (model, &iter, + gtk_tree_model_get ( + model, &iter, DEST_HANDLER, &handler, -1); dest_uri = gtk_file_chooser_get_uri diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 75876f9507..8aa33f8605 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -168,7 +168,8 @@ commit_changes (UIData *ui) gchar *keyword, *value; gchar *key; - gtk_tree_model_get (model, &iter, + gtk_tree_model_get ( + model, &iter, CLUE_KEYWORD_COLUMN, &keyword, CLUE_VALUE_COLUMN, &value, -1); @@ -263,8 +264,9 @@ key_cell_edited_callback (GtkCellRendererText *cell, gtk_tree_model_get_iter_from_string (model, &iter, path_string); gtk_tree_model_get (model, &iter, CLUE_VALUE_COLUMN, &value, -1); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - CLUE_KEYWORD_COLUMN, new_text, CLUE_VALUE_COLUMN, value, -1); + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + CLUE_KEYWORD_COLUMN, new_text, CLUE_VALUE_COLUMN, value, -1); g_free (value); commit_changes (ui); @@ -286,8 +288,9 @@ value_cell_edited_callback (GtkCellRendererText *cell, gtk_tree_model_get (model, &iter, CLUE_KEYWORD_COLUMN, &keyword, -1); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - CLUE_KEYWORD_COLUMN, keyword, CLUE_VALUE_COLUMN, new_text, -1); + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + CLUE_KEYWORD_COLUMN, keyword, CLUE_VALUE_COLUMN, new_text, -1); g_free (keyword); commit_changes (ui); @@ -307,13 +310,16 @@ clue_add_clicked (GtkButton *button, gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc) clue_foreach_check_isempty, ui); /* Disconnect from signal so that we can create an empty row */ - g_signal_handlers_disconnect_matched (G_OBJECT (model), G_SIGNAL_MATCH_FUNC, 0, 0, NULL, clue_check_isempty, ui); + g_signal_handlers_disconnect_matched ( + model, G_SIGNAL_MATCH_FUNC, + 0, 0, NULL, clue_check_isempty, ui); /* TODO : Trim and check for blank strings */ new_clue = g_strdup (""); gtk_list_store_append (GTK_LIST_STORE (model), &iter); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - CLUE_KEYWORD_COLUMN, new_clue, CLUE_VALUE_COLUMN, new_clue, -1); + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + CLUE_KEYWORD_COLUMN, new_clue, CLUE_VALUE_COLUMN, new_clue, -1); focus_col = gtk_tree_view_get_column (GTK_TREE_VIEW (ui->treeview), CLUE_KEYWORD_COLUMN); path = gtk_tree_model_get_path (model, &iter); @@ -466,16 +472,18 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) gtk_tree_view_set_model (GTK_TREE_VIEW (ui->treeview), GTK_TREE_MODEL (ui->store)); 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); + gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"), + renderer_key, "text", CLUE_KEYWORD_COLUMN, NULL); 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); + gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (ui->treeview), -1, _("Values"), + renderer_value, "text", CLUE_VALUE_COLUMN, NULL); g_object_set (renderer_value, "editable", TRUE, NULL); g_signal_connect ( renderer_value, "edited", @@ -732,11 +740,13 @@ fill_template (CamelMimeMessage *message, g_object_unref (stream); if (template_html && !message_html) { - gchar *html = camel_text_to_html (message_body->str, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | - CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES | - CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | - CAMEL_MIME_FILTER_TOHTML_MARK_CITATION | - CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES, 0); + gchar *html = camel_text_to_html ( + message_body->str, + CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | + CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES | + CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | + CAMEL_MIME_FILTER_TOHTML_MARK_CITATION | + CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES, 0); g_string_assign (message_body, html); g_free (html); } else if (!template_html && message_html) { @@ -882,30 +892,37 @@ create_new_message (CamelFolder *folder, m_header = m_header->next; } /* Now replace $ORIG[subject] variable, handling possible base64 encryption */ - replace_template_variable (subject, "subject", + replace_template_variable ( + subject, "subject", camel_mime_message_get_subject (message)); header->value = g_strdup (subject->str); g_string_free (subject, TRUE); } - camel_medium_add_header (CAMEL_MEDIUM (new), - header->name, - header->value); + camel_medium_add_header ( + CAMEL_MEDIUM (new), + header->name, + header->value); } header = header->next; } /* Set the To: field to the same To: field of the message we are replying to. */ - camel_mime_message_set_recipients (new, CAMEL_RECIPIENT_TYPE_TO, - camel_mime_message_get_from (message)); + camel_mime_message_set_recipients ( + new, CAMEL_RECIPIENT_TYPE_TO, + camel_mime_message_get_from (message)); /* Copy the CC and BCC from the template.*/ - camel_mime_message_set_recipients (new, CAMEL_RECIPIENT_TYPE_CC, - camel_mime_message_get_recipients (template, CAMEL_RECIPIENT_TYPE_CC)); - - camel_mime_message_set_recipients (new, CAMEL_RECIPIENT_TYPE_BCC, - camel_mime_message_get_recipients (template, CAMEL_RECIPIENT_TYPE_BCC)); + camel_mime_message_set_recipients ( + new, CAMEL_RECIPIENT_TYPE_CC, + camel_mime_message_get_recipients ( + template, CAMEL_RECIPIENT_TYPE_CC)); + + camel_mime_message_set_recipients ( + new, CAMEL_RECIPIENT_TYPE_BCC, + camel_mime_message_get_recipients ( + template, CAMEL_RECIPIENT_TYPE_BCC)); /* Create the composer */ em_utils_edit_message (shell, folder, new, message_uid); diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index 002fc35f0a..4c7e670881 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -513,7 +513,8 @@ shell_searchbar_resize_idle_cb (gpointer user_data) column = 0; } - gtk_container_child_get (GTK_CONTAINER (widget), child, + gtk_container_child_get ( + GTK_CONTAINER (widget), child, "left-attach", &child_left, "top-attach", &child_top, NULL); @@ -866,7 +867,7 @@ shell_searchbar_map (GtkWidget *widget) static void shell_searchbar_size_allocate (GtkWidget *widget, - GdkRectangle *allocation) + GdkRectangle *allocation) { EShellSearchbar *searchbar; @@ -880,8 +881,8 @@ shell_searchbar_size_allocate (GtkWidget *widget, static void shell_searchbar_get_preferred_width (GtkWidget *widget, - gint *minimum_width, - gint *natural_width) + gint *minimum_width, + gint *natural_width) { GList *children, *iter; gint max_minimum = 0, max_natural = 0; @@ -1079,7 +1080,8 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) grid = GTK_GRID (searchbar); widget = gtk_grid_new (); - g_object_set (G_OBJECT (widget), + g_object_set ( + G_OBJECT (widget), "orientation", GTK_ORIENTATION_HORIZONTAL, "column-spacing", 3, "valign", GTK_ALIGN_CENTER, @@ -1121,7 +1123,8 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) grid = GTK_GRID (searchbar); widget = gtk_grid_new (); - g_object_set (G_OBJECT (widget), + g_object_set ( + G_OBJECT (widget), "orientation", GTK_ORIENTATION_HORIZONTAL, "column-spacing", 3, "valign", GTK_ALIGN_CENTER, @@ -1154,7 +1157,8 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) widget = gtk_entry_new (); gtk_label_set_mnemonic_widget (label, widget); - g_object_set (G_OBJECT (widget), + g_object_set ( + G_OBJECT (widget), "halign", GTK_ALIGN_FILL, "hexpand", TRUE, NULL); @@ -1197,7 +1201,8 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) grid = GTK_GRID (searchbar); widget = gtk_grid_new (); - g_object_set (G_OBJECT (widget), + g_object_set ( + G_OBJECT (widget), "orientation", GTK_ORIENTATION_HORIZONTAL, "column-spacing", 3, "valign", GTK_ALIGN_CENTER, @@ -1250,7 +1255,8 @@ e_shell_searchbar_new (EShellView *shell_view) { g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL); - return g_object_new (E_TYPE_SHELL_SEARCHBAR, + return g_object_new ( + E_TYPE_SHELL_SEARCHBAR, "shell-view", shell_view, "orientation", GTK_ORIENTATION_HORIZONTAL, NULL); @@ -1286,7 +1292,7 @@ e_shell_searchbar_set_express_mode (EShellSearchbar *searchbar, { g_return_if_fail (E_IS_SHELL_SEARCHBAR (searchbar)); - if ((searchbar->priv->express_mode ? 1 : 0) == (express_mode ? 1 : 0)) + if (searchbar->priv->express_mode == express_mode) return; searchbar->priv->express_mode = express_mode; @@ -1326,7 +1332,7 @@ e_shell_searchbar_set_labels_visible (EShellSearchbar *searchbar, { g_return_if_fail (E_IS_SHELL_SEARCHBAR (searchbar)); - if ((searchbar->priv->labels_visible ? 1 : 0) == (labels_visible ? 1 : 0)) + if (searchbar->priv->labels_visible == labels_visible) return; searchbar->priv->labels_visible = labels_visible; @@ -1352,7 +1358,7 @@ e_shell_searchbar_set_filter_visible (EShellSearchbar *searchbar, { g_return_if_fail (E_IS_SHELL_SEARCHBAR (searchbar)); - if ((searchbar->priv->filter_visible ? 1 : 0) == (filter_visible ? 1 : 0)) + if (searchbar->priv->filter_visible == filter_visible) return; searchbar->priv->filter_visible = filter_visible; @@ -1482,7 +1488,7 @@ e_shell_searchbar_set_search_visible (EShellSearchbar *searchbar, { g_return_if_fail (E_IS_SHELL_SEARCHBAR (searchbar)); - if ((searchbar->priv->search_visible ? 1 : 0) == (search_visible ? 1 : 0)) + if (searchbar->priv->search_visible == search_visible) return; searchbar->priv->search_visible = search_visible; @@ -1526,7 +1532,7 @@ e_shell_searchbar_set_scope_visible (EShellSearchbar *searchbar, { g_return_if_fail (E_IS_SHELL_SEARCHBAR (searchbar)); - if ((searchbar->priv->scope_visible ? 1 : 0) == (scope_visible ? 1 : 0)) + if (searchbar->priv->scope_visible == scope_visible) return; searchbar->priv->scope_visible = scope_visible; diff --git a/shell/e-shell-settings.c b/shell/e-shell-settings.c index 22ba9c8e5e..3b971b6ab1 100644 --- a/shell/e-shell-settings.c +++ b/shell/e-shell-settings.c @@ -90,7 +90,7 @@ shell_settings_value_equal (const GValue *v1, return g_value_get_double (v1) == g_value_get_double (v2); } else if (G_VALUE_HOLDS_BOOLEAN (v1) && G_VALUE_HOLDS_BOOLEAN (v2)) { - return (g_value_get_boolean (v1) ? 1 : 0) == (g_value_get_boolean (v2) ? 1 : 0); + return g_value_get_boolean (v1) == g_value_get_boolean (v2); } else if (G_VALUE_HOLDS_POINTER (v1) && G_VALUE_HOLDS_POINTER (v2)) { return g_value_get_pointer (v1) == g_value_get_pointer (v2); diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index b2830cac02..195dc7c896 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -773,7 +773,7 @@ e_shell_switcher_set_visible (EShellSwitcher *switcher, g_return_if_fail (E_IS_SHELL_SWITCHER (switcher)); - if ((switcher->priv->toolbar_visible ? 1 : 0) == (visible ? 1 : 0)) + if (switcher->priv->toolbar_visible == visible) return; switcher->priv->toolbar_visible = visible; diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index ece1c24d8b..cecc168345 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1222,7 +1222,8 @@ action_submit_bug_cb (GtkAction *action, g_spawn_command_line_async (command_line, &error); if (error != NULL) { - e_notice (shell_window, GTK_MESSAGE_ERROR, + e_notice ( + shell_window, GTK_MESSAGE_ERROR, error->code == G_SPAWN_ERROR_NOENT ? _("Bug Buddy is not installed.") : _("Bug Buddy could not be run.")); diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 8193b52da3..2202757bb1 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -1390,7 +1390,7 @@ e_shell_window_set_safe_mode (EShellWindow *shell_window, { g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - if ((shell_window->priv->safe_mode ? 1 : 0) == (safe_mode ? 1 : 0)) + if (shell_window->priv->safe_mode == safe_mode) return; shell_window->priv->safe_mode = safe_mode; @@ -1456,7 +1456,7 @@ e_shell_window_set_sidebar_visible (EShellWindow *shell_window, { g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - if ((shell_window->priv->sidebar_visible ? 1 : 0) == (sidebar_visible ? 1 : 0)) + if (shell_window->priv->sidebar_visible == sidebar_visible) return; shell_window->priv->sidebar_visible = sidebar_visible; @@ -1493,7 +1493,7 @@ e_shell_window_set_switcher_visible (EShellWindow *shell_window, { g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - if ((shell_window->priv->switcher_visible ? 1 : 0) == (switcher_visible ? 1 : 0)) + if (shell_window->priv->switcher_visible == switcher_visible) return; shell_window->priv->switcher_visible = switcher_visible; @@ -1530,7 +1530,7 @@ e_shell_window_set_taskbar_visible (EShellWindow *shell_window, { g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - if ((shell_window->priv->taskbar_visible ? 1 : 0) == (taskbar_visible ? 1 : 0)) + if (shell_window->priv->taskbar_visible == taskbar_visible) return; shell_window->priv->taskbar_visible = taskbar_visible; @@ -1567,7 +1567,7 @@ e_shell_window_set_toolbar_visible (EShellWindow *shell_window, { g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - if ((shell_window->priv->toolbar_visible ? 1 : 0) == (toolbar_visible ? 1 : 0)) + if (shell_window->priv->toolbar_visible == toolbar_visible) return; shell_window->priv->toolbar_visible = toolbar_visible; diff --git a/shell/e-shell.c b/shell/e-shell.c index 2f7cdcc8b5..b96cbb9a29 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -1701,7 +1701,7 @@ e_shell_set_network_available (EShell *shell, if (shell->priv->network_available_locked) return; - if ((network_available ? 1 : 0) == (shell->priv->network_available ? 1 : 0)) + if (shell->priv->network_available == network_available) return; shell->priv->network_available = network_available; diff --git a/shell/main.c b/shell/main.c index e1237cccbd..0869ef6f05 100644 --- a/shell/main.c +++ b/shell/main.c @@ -422,8 +422,10 @@ create_default_shell (void) /* Failure to register is fatal. */ if (error != NULL) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("Cannot start Evolution, other instance is probably running and is unresponsive. System error: %s"), + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("Cannot start Evolution. Another Evolution " + "instance may be unresponsive. System error: %s"), error->message); g_clear_error (&error); } diff --git a/smime/gui/cert-trust-dialog.c b/smime/gui/cert-trust-dialog.c index 3a52b82657..366a79748e 100644 --- a/smime/gui/cert-trust-dialog.c +++ b/smime/gui/cert-trust-dialog.c @@ -72,9 +72,10 @@ ctd_response (GtkWidget *w, icert = e_cert_get_internal_cert (data->cert); e_cert_trust_init (&trust); e_cert_trust_set_valid_peer (&trust); - e_cert_trust_add_peer_trust (&trust, FALSE, - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->trust_button)), - FALSE); + e_cert_trust_add_peer_trust ( + &trust, FALSE, + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->trust_button)), + FALSE); e_cert_db_change_cert_trust (icert, &trust); break; case GTK_RESPONSE_ACCEPT: { @@ -85,23 +86,26 @@ ctd_response (GtkWidget *w, g_signal_stop_emission_by_name (w, "response"); - ca_trust_dialog_set_trust (dialog, - e_cert_trust_has_trusted_ca (icert->trust, TRUE, FALSE, FALSE), - e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE), - e_cert_trust_has_trusted_ca (icert->trust, FALSE, FALSE, TRUE)); + ca_trust_dialog_set_trust ( + dialog, + e_cert_trust_has_trusted_ca (icert->trust, TRUE, FALSE, FALSE), + e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE), + e_cert_trust_has_trusted_ca (icert->trust, FALSE, FALSE, TRUE)); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { gboolean trust_ssl, trust_email, trust_objsign; - ca_trust_dialog_get_trust (dialog, - &trust_ssl, &trust_email, &trust_objsign); + ca_trust_dialog_get_trust ( + dialog, + &trust_ssl, &trust_email, &trust_objsign); e_cert_trust_init (&trust); e_cert_trust_set_valid_ca (&trust); - e_cert_trust_add_ca_trust (&trust, - trust_ssl, - trust_email, - trust_objsign); + e_cert_trust_add_ca_trust ( + &trust, + trust_ssl, + trust_email, + trust_objsign); e_cert_db_change_cert_trust (icert, &trust); } @@ -144,13 +148,15 @@ cert_trust_dialog_show (ECert *cert) icert = e_cert_get_internal_cert (ctd_data->cacert); if (e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE)) - gtk_label_set_text ((GtkLabel *) ctd_data->label, - _("Because you trust the certificate authority that issued this certificate, " - "then you trust the authenticity of this certificate unless otherwise indicated here")); + gtk_label_set_text ( + (GtkLabel *) ctd_data->label, + _("Because you trust the certificate authority that issued this certificate, " + "then you trust the authenticity of this certificate unless otherwise indicated here")); else - gtk_label_set_text ((GtkLabel *) ctd_data->label, - _("Because you do not trust the certificate authority that issued this certificate, " - "then you do not trust the authenticity of this certificate unless otherwise indicated here")); + gtk_label_set_text ( + (GtkLabel *) ctd_data->label, + _("Because you do not trust the certificate authority that issued this certificate, " + "then you do not trust the authenticity of this certificate unless otherwise indicated here")); return ctd_data->dialog; } diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index 3f8648feee..acddc8a974 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -297,7 +297,8 @@ load_treeview_state (GtkTreeView *treeview) } sortable = GTK_TREE_SORTABLE (gtk_tree_view_get_model (treeview)); - gtk_tree_sortable_set_sort_column_id (sortable, + gtk_tree_sortable_set_sort_column_id ( + sortable, g_key_file_get_integer (keyfile, tree_name, "sort-column", 0), g_key_file_get_integer (keyfile, tree_name, "sort-order", GTK_SORT_ASCENDING)); @@ -313,8 +314,10 @@ report_and_free_error (CertPage *cp, { g_return_if_fail (cp != NULL); - e_notice (gtk_widget_get_toplevel (GTK_WIDGET (cp->treeview)), - GTK_MESSAGE_ERROR, "%s: %s", where, error ? error->message : _("Unknown error")); + e_notice ( + gtk_widget_get_toplevel (GTK_WIDGET (cp->treeview)), + GTK_MESSAGE_ERROR, "%s: %s", where, + error ? error->message : _("Unknown error")); if (error) g_error_free (error); @@ -342,7 +345,8 @@ header_popup_item_toggled (GtkCheckMenuItem *item, { GtkTreeViewColumn *column = user_data; - gtk_tree_view_column_set_visible (column, + gtk_tree_view_column_set_visible ( + column, gtk_check_menu_item_get_active (item)); } @@ -353,7 +357,8 @@ treeview_column_visibility_changed (GtkTreeViewColumn *column, { GtkCheckMenuItem *menu_item = user_data; - gtk_check_menu_item_set_active (menu_item, + gtk_check_menu_item_set_active ( + menu_item, gtk_tree_view_column_get_visible (column)); } @@ -369,9 +374,10 @@ treeview_selection_changed (GtkTreeSelection *selection, if (gtk_tree_selection_get_selected (selection, &model, &iter)) { ECert *cert; - gtk_tree_model_get (model, &iter, - cp->columns_count - 1, &cert, - -1); + gtk_tree_model_get ( + model, &iter, + cp->columns_count - 1, &cert, + -1); if (cert) { cert_selected = TRUE; @@ -508,9 +514,10 @@ view_cert (GtkWidget *button, if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (cp->treeview), NULL, &iter)) { ECert *cert; - gtk_tree_model_get (GTK_TREE_MODEL (cp->streemodel), &iter, - cp->columns_count - 1, &cert, - -1); + gtk_tree_model_get ( + GTK_TREE_MODEL (cp->streemodel), &iter, + cp->columns_count - 1, &cert, + -1); if (cert) { GtkWidget *dialog = certificate_viewer_show (cert); @@ -532,9 +539,10 @@ edit_cert (GtkWidget *button, if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (cp->treeview), NULL, &iter)) { ECert *cert; - gtk_tree_model_get (GTK_TREE_MODEL (cp->streemodel), &iter, - cp->columns_count - 1, &cert, - -1); + gtk_tree_model_get ( + GTK_TREE_MODEL (cp->streemodel), &iter, + cp->columns_count - 1, &cert, + -1); if (cert) { GtkWidget *dialog; @@ -543,10 +551,11 @@ edit_cert (GtkWidget *button, switch (cp->cert_type) { case E_CERT_CA: dialog = ca_trust_dialog_show (cert, FALSE); - ca_trust_dialog_set_trust (dialog, - e_cert_trust_has_trusted_ca (icert->trust, TRUE, FALSE, FALSE), - e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE), - e_cert_trust_has_trusted_ca (icert->trust, FALSE, FALSE, TRUE)); + ca_trust_dialog_set_trust ( + dialog, + e_cert_trust_has_trusted_ca (icert->trust, TRUE, FALSE, FALSE), + e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE), + e_cert_trust_has_trusted_ca (icert->trust, FALSE, FALSE, TRUE)); break; case E_CERT_CONTACT: dialog = cert_trust_dialog_show (cert); @@ -561,13 +570,15 @@ edit_cert (GtkWidget *button, gboolean trust_ssl, trust_email, trust_objsign; CERTCertTrust trust; - ca_trust_dialog_get_trust (dialog, - &trust_ssl, &trust_email, &trust_objsign); + ca_trust_dialog_get_trust ( + dialog, + &trust_ssl, &trust_email, &trust_objsign); e_cert_trust_init (&trust); e_cert_trust_set_valid_ca (&trust); - e_cert_trust_add_ca_trust (&trust, - trust_ssl, trust_email, trust_objsign); + e_cert_trust_add_ca_trust ( + &trust, + trust_ssl, trust_email, trust_objsign); e_cert_db_change_cert_trust (icert, &trust); } @@ -586,9 +597,11 @@ import_cert (GtkWidget *button, GtkFileFilter *filter; gint i; - filesel = gtk_file_chooser_dialog_new (_("Select a certificate to import..."), - NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL); + filesel = gtk_file_chooser_dialog_new ( + _("Select a certificate to import..."), NULL, + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL); gtk_dialog_set_default_response (GTK_DIALOG (filesel), GTK_RESPONSE_OK); filter = gtk_file_filter_new (); @@ -618,8 +631,9 @@ import_cert (GtkWidget *button, break; case E_CERT_CONTACT: case E_CERT_CA: - import = e_cert_db_import_certs_from_file (e_cert_db_peek (), filename, - cp->cert_type, &imported_certs, &error); + import = e_cert_db_import_certs_from_file ( + e_cert_db_peek (), filename, + cp->cert_type, &imported_certs, &error); break; default: g_free (filename); @@ -653,9 +667,10 @@ delete_cert (GtkWidget *button, if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (cp->treeview), NULL, &iter)) { ECert *cert; - gtk_tree_model_get (GTK_TREE_MODEL (cp->streemodel), &iter, - cp->columns_count - 1, &cert, - -1); + gtk_tree_model_get ( + GTK_TREE_MODEL (cp->streemodel), &iter, + cp->columns_count - 1, &cert, + -1); if (cert && e_cert_db_delete_cert (e_cert_db_peek (), cert)) { GtkTreeIter child_iter, parent_iter; @@ -699,8 +714,9 @@ add_cert (CertPage *cp, /* create a new toplevel node */ gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL); - gtk_tree_store_set (GTK_TREE_STORE (model), &iter, - 0, organization, -1); + gtk_tree_store_set ( + GTK_TREE_STORE (model), &iter, + 0, organization, -1); /* now copy it off into parent_iter and insert it into * the hashtable */ @@ -722,11 +738,13 @@ add_cert (CertPage *cp, } if (cp->columns[i].type == G_TYPE_STRING) { - gtk_tree_store_set (GTK_TREE_STORE (model), &iter, - i, get_cert_data_func (cert), -1); + gtk_tree_store_set ( + GTK_TREE_STORE (model), &iter, + i, get_cert_data_func (cert), -1); } else if (cp->columns[i].type == G_TYPE_OBJECT) { - gtk_tree_store_set (GTK_TREE_STORE (model), &iter, - i, cert, -1); + gtk_tree_store_set ( + GTK_TREE_STORE (model), &iter, + i, cert, -1); } } } @@ -757,9 +775,11 @@ unload_certs (CertPage *cp) if (cp->root_hash) g_hash_table_destroy (cp->root_hash); - cp->root_hash = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, - (GDestroyNotify) gtk_tree_iter_free); + cp->root_hash = g_hash_table_new_full ( + (GHashFunc) g_str_hash, + (GEqualFunc) g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) gtk_tree_iter_free); } static void diff --git a/smime/gui/certificate-viewer.c b/smime/gui/certificate-viewer.c index 9273ae90e6..af1b3226ce 100644 --- a/smime/gui/certificate-viewer.c +++ b/smime/gui/certificate-viewer.c @@ -159,10 +159,11 @@ populate_fields_tree (CertificateViewerData *cvm_data, /* first insert a node for the current asn1 */ gtk_tree_store_insert (cvm_data->fields_store, &new_iter, root, -1); - gtk_tree_store_set (cvm_data->fields_store, &new_iter, - 0, e_asn1_object_get_display_name (asn1), - 1, asn1, - -1); + gtk_tree_store_set ( + cvm_data->fields_store, &new_iter, + 0, e_asn1_object_get_display_name (asn1), + 1, asn1, + -1); if (e_asn1_object_is_valid_container (asn1)) { GList *children = e_asn1_object_get_children (asn1); @@ -191,10 +192,11 @@ hierarchy_selection_changed (GtkTreeSelection *selection, EASN1Object *asn1_object; ECert *cert; - gtk_tree_model_get (model, - &iter, - 1, &cert, - -1); + gtk_tree_model_get ( + model, + &iter, + 1, &cert, + -1); if (!cert) return; @@ -204,8 +206,9 @@ hierarchy_selection_changed (GtkTreeSelection *selection, /* wipe out the old model */ cvm_data->fields_store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); - gtk_tree_view_set_model (GTK_TREE_VIEW (cvm_data->fields_tree), - GTK_TREE_MODEL (cvm_data->fields_store)); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (cvm_data->fields_tree), + GTK_TREE_MODEL (cvm_data->fields_store)); /* populate the fields from the newly selected cert */ populate_fields_tree (cvm_data, asn1_object, NULL); @@ -213,8 +216,9 @@ hierarchy_selection_changed (GtkTreeSelection *selection, g_object_unref (asn1_object); /* and blow away the field value */ - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), - "", 0); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), + "", 0); } } @@ -231,26 +235,30 @@ fields_selection_changed (GtkTreeSelection *selection, EASN1Object *asn1_object; const gchar *value; - gtk_tree_model_get (model, - &iter, - 1, &asn1_object, - -1); + gtk_tree_model_get ( + model, + &iter, + 1, &asn1_object, + -1); value = e_asn1_object_get_display_value (asn1_object); - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), - "", 0); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), + "", 0); if (value) { GtkTextIter text_iter; - gtk_text_buffer_get_start_iter (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), - &text_iter); + gtk_text_buffer_get_start_iter ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), + &text_iter); - gtk_text_buffer_insert_with_tags (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), - &text_iter, - value, strlen (value), - cvm_data->text_tag, NULL); + gtk_text_buffer_insert_with_tags ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), + &text_iter, + value, strlen (value), + cvm_data->text_tag, NULL); } } } @@ -266,12 +274,14 @@ fill_in_details (CertificateViewerData *cvm_data, /* hook up all the hierarchy tree foo */ cvm_data->hierarchy_store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_OBJECT); cvm_data->hierarchy_tree = e_builder_get_widget (cvm_data->builder, "cert-hierarchy-treeview"); - gtk_tree_view_set_model (GTK_TREE_VIEW (cvm_data->hierarchy_tree), - GTK_TREE_MODEL (cvm_data->hierarchy_store)); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (cvm_data->hierarchy_tree), + GTK_TREE_MODEL (cvm_data->hierarchy_store)); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cvm_data->hierarchy_tree), - -1, "Cert", gtk_cell_renderer_text_new (), - "text", 0, NULL); + gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (cvm_data->hierarchy_tree), + -1, "Cert", gtk_cell_renderer_text_new (), + "text", 0, NULL); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cvm_data->hierarchy_tree)); g_signal_connect ( @@ -281,9 +291,10 @@ fill_in_details (CertificateViewerData *cvm_data, /* hook up all the fields tree foo */ cvm_data->fields_tree = e_builder_get_widget (cvm_data->builder, "cert-fields-treeview"); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cvm_data->fields_tree), - -1, "Field", gtk_cell_renderer_text_new (), - "text", 0, NULL); + gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (cvm_data->fields_tree), + -1, "Field", gtk_cell_renderer_text_new (), + "text", 0, NULL); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cvm_data->fields_tree)); g_signal_connect ( @@ -295,10 +306,11 @@ fill_in_details (CertificateViewerData *cvm_data, /* set the font of the field value viewer to be some fixed * 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", - NULL); + cvm_data->text_tag = gtk_text_buffer_create_tag ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), + "mono", + "font", "Mono", + NULL); /* initially populate the hierarchy from the cert's chain */ cvm_data->cert_chain = e_cert_get_chain (cert); @@ -313,10 +325,11 @@ fill_in_details (CertificateViewerData *cvm_data, str = e_cert_get_subject_name (c); gtk_tree_store_insert (cvm_data->hierarchy_store, &new_iter, root, -1); - gtk_tree_store_set (cvm_data->hierarchy_store, &new_iter, - 0, str, - 1, c, - -1); + gtk_tree_store_set ( + cvm_data->hierarchy_store, &new_iter, + 0, str, + 1, c, + -1); root = &new_iter; } diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c index 71f3545770..2928b550ab 100644 --- a/smime/gui/e-cert-selector.c +++ b/smime/gui/e-cert-selector.c @@ -195,7 +195,8 @@ e_cert_selector_new (gint type, while (!CERT_LIST_END (node, certlist)) { if (node->cert->nickname || node->cert->emailAddr) { gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, node->cert->nickname ? node->cert->nickname : node->cert->emailAddr, -1); diff --git a/smime/lib/e-cert-db.c b/smime/lib/e-cert-db.c index c74ac0a176..a98d085c43 100644 --- a/smime/lib/e-cert-db.c +++ b/smime/lib/e-cert-db.c @@ -354,7 +354,8 @@ e_cert_db_get_certs_from_package (PRArenaPool *arena, return NULL; collectArgs->arena = arena; - sec_rv = CERT_DecodeCertPackage (data, + sec_rv = CERT_DecodeCertPackage ( + data, length, collect_certs, (gpointer) collectArgs); @@ -388,12 +389,13 @@ pk11_password (PK11SlotInfo *slot, gboolean rv = FALSE; - g_signal_emit (e_cert_db_peek (), - e_cert_db_signals[PK11_PASSWD], 0, - slot, - retry, - &pwd, - &rv); + g_signal_emit ( + e_cert_db_peek (), + e_cert_db_signals[PK11_PASSWD], 0, + slot, + retry, + &pwd, + &rv); if (pwd == NULL) return NULL; @@ -530,35 +532,35 @@ e_cert_db_class_init (ECertDBClass *class) /* check to see if you have a rootcert module installed */ install_loadable_roots (); - e_cert_db_signals[PK11_PASSWD] = - g_signal_new ("pk11_passwd", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECertDBClass, pk11_passwd), - NULL, NULL, - e_marshal_BOOLEAN__POINTER_BOOLEAN_POINTER, - G_TYPE_BOOLEAN, 3, - G_TYPE_POINTER, G_TYPE_BOOLEAN, G_TYPE_POINTER); - - e_cert_db_signals[PK11_CHANGE_PASSWD] = - g_signal_new ("pk11_change_passwd", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECertDBClass, pk11_change_passwd), - NULL, NULL, - e_marshal_BOOLEAN__POINTER_POINTER, - G_TYPE_BOOLEAN, 2, - G_TYPE_POINTER, G_TYPE_POINTER); - - e_cert_db_signals[CONFIRM_CA_CERT_IMPORT] = - g_signal_new ("confirm_ca_cert_import", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECertDBClass, confirm_ca_cert_import), - NULL, NULL, - e_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER, - G_TYPE_BOOLEAN, 4, - G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER); + e_cert_db_signals[PK11_PASSWD] = g_signal_new ( + "pk11_passwd", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECertDBClass, pk11_passwd), + NULL, NULL, + e_marshal_BOOLEAN__POINTER_BOOLEAN_POINTER, + G_TYPE_BOOLEAN, 3, + G_TYPE_POINTER, G_TYPE_BOOLEAN, G_TYPE_POINTER); + + e_cert_db_signals[PK11_CHANGE_PASSWD] = g_signal_new ( + "pk11_change_passwd", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECertDBClass, pk11_change_passwd), + NULL, NULL, + e_marshal_BOOLEAN__POINTER_POINTER, + G_TYPE_BOOLEAN, 2, + G_TYPE_POINTER, G_TYPE_POINTER); + + e_cert_db_signals[CONFIRM_CA_CERT_IMPORT] = g_signal_new ( + "confirm_ca_cert_import", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECertDBClass, confirm_ca_cert_import), + NULL, NULL, + e_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER, + G_TYPE_BOOLEAN, 4, + G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER); } static void @@ -630,8 +632,9 @@ e_cert_db_find_cert_by_key (ECertDB *certdb, return NULL; } - dummy = NSSBase64_DecodeBuffer (NULL, &keyItem, db_key, - (PRUint32) PL_strlen (db_key)); + dummy = NSSBase64_DecodeBuffer ( + NULL, &keyItem, db_key, + (PRUint32) PL_strlen (db_key)); /* someday maybe we can speed up the search using the moduleID and slotID*/ moduleID = NS_NSS_GET_LONG (keyItem.data); @@ -697,10 +700,11 @@ e_cert_db_find_cert_by_email_address (ECertDB *certdb, /* any_cert now contains a cert with the right subject, * but it might not have the correct usage. */ - certlist = CERT_CreateSubjectCertList (NULL, - CERT_GetDefaultCertDB (), - &any_cert->derSubject, - PR_Now (), PR_TRUE); + certlist = CERT_CreateSubjectCertList ( + NULL, + CERT_GetDefaultCertDB (), + &any_cert->derSubject, + PR_Now (), PR_TRUE); if (!certlist) { set_nss_error (error); CERT_DestroyCertificate (any_cert); @@ -743,13 +747,14 @@ confirm_download_ca_cert (ECertDB *cert_db, *trust_email = *trust_objsign = FALSE; - g_signal_emit (e_cert_db_peek (), - e_cert_db_signals[CONFIRM_CA_CERT_IMPORT], 0, - cert, - trust_ssl, - trust_email, - trust_objsign, - &rv); + g_signal_emit ( + e_cert_db_peek (), + e_cert_db_signals[CONFIRM_CA_CERT_IMPORT], 0, + cert, + trust_ssl, + trust_email, + trust_objsign, + &rv); return rv; } @@ -841,8 +846,9 @@ handle_ca_cert_download (ECertDB *cert_db, CERTCertDBHandle *certdb = CERT_GetDefaultCertDB (); tmpCert = CERT_FindCertByDERCert (certdb, &der); if (!tmpCert) { - tmpCert = CERT_NewTempCertificate (certdb, &der, - NULL, PR_FALSE, PR_TRUE); + tmpCert = CERT_NewTempCertificate ( + certdb, &der, + NULL, PR_FALSE, PR_TRUE); } if (!tmpCert) { g_warning ("Couldn't create cert from DER blob"); @@ -881,14 +887,16 @@ handle_ca_cert_download (ECertDB *cert_db, e_cert_trust_init (&trust); e_cert_trust_set_valid_ca (&trust); - e_cert_trust_add_ca_trust (&trust, - trust_ssl, - trust_email, - trust_objsign); + e_cert_trust_add_ca_trust ( + &trust, + trust_ssl, + trust_email, + trust_objsign); - srv = CERT_AddTempCertToPerm (tmpCert, - nickname, - &trust); + srv = CERT_AddTempCertToPerm ( + tmpCert, + nickname, + &trust); /* If we aren't logged into the token, then what *should* * happen is the above call should fail, and we should @@ -907,12 +915,14 @@ handle_ca_cert_download (ECertDB *cert_db, if (srv != SECSuccess && PORT_GetError () == SEC_ERROR_TOKEN_NOT_LOGGED_IN && e_cert_db_login_to_slot (NULL, PK11_GetInternalKeySlot ())) { - srv = CERT_ChangeCertTrust (CERT_GetDefaultCertDB (), - tmpCert, &trust); + srv = CERT_ChangeCertTrust ( + CERT_GetDefaultCertDB (), + tmpCert, &trust); if (srv != SECSuccess) - srv = CERT_AddTempCertToPerm (tmpCert, - nickname, - &trust); + srv = CERT_AddTempCertToPerm ( + tmpCert, + nickname, + &trust); } if (srv != SECSuccess) { set_nss_error (error); @@ -941,8 +951,9 @@ handle_ca_cert_download (ECertDB *cert_db, continue; /* Let's try to import the rest of 'em */ } nickname.Adopt (CERT_MakeCANickname (tmpCert2)); - CERT_AddTempCertToPerm (tmpCert2, NS_CONST_CAST (gchar *,nickname.get ()), - defaultTrust.GetTrust ()); + CERT_AddTempCertToPerm ( + tmpCert2, NS_CONST_CAST (gchar *,nickname.get ()), + defaultTrust.GetTrust ()); CERT_DestroyCertificate (tmpCert2); } #endif @@ -953,18 +964,21 @@ gboolean e_cert_db_change_cert_trust (CERTCertificate *cert, CERTCertTrust *trus { SECStatus srv; - srv = CERT_ChangeCertTrust (CERT_GetDefaultCertDB (), - cert, trust); + srv = CERT_ChangeCertTrust ( + CERT_GetDefaultCertDB (), + cert, trust); if (srv != SECSuccess && PORT_GetError () == SEC_ERROR_TOKEN_NOT_LOGGED_IN && e_cert_db_login_to_slot (NULL, PK11_GetInternalKeySlot ())) - srv = CERT_ChangeCertTrust (CERT_GetDefaultCertDB (), - cert, trust); + srv = CERT_ChangeCertTrust ( + CERT_GetDefaultCertDB (), + cert, trust); if (srv != SECSuccess) { glong err = PORT_GetError (); - g_warning ("CERT_ChangeCertTrust() failed: %s\n", - nss_error_to_string (err)); + g_warning ( + "CERT_ChangeCertTrust() failed: %s\n", + nss_error_to_string (err)); return FALSE; } return TRUE; @@ -1093,8 +1107,9 @@ e_cert_db_import_email_cert (ECertDB *certdb, return FALSE; } - cert = CERT_NewTempCertificate (CERT_GetDefaultCertDB (), certCollection->rawCerts, - (gchar *) NULL, PR_FALSE, PR_TRUE); + cert = CERT_NewTempCertificate ( + CERT_GetDefaultCertDB (), certCollection->rawCerts, + (gchar *) NULL, PR_FALSE, PR_TRUE); if (!cert) { set_nss_error (error); rv = FALSE; @@ -1112,9 +1127,10 @@ e_cert_db_import_email_cert (ECertDB *certdb, rawCerts[i] = &certCollection->rawCerts[i]; } - srv = CERT_ImportCerts (CERT_GetDefaultCertDB (), certUsageEmailSigner, - numcerts, rawCerts, NULL, PR_TRUE, PR_FALSE, - NULL); + srv = CERT_ImportCerts ( + CERT_GetDefaultCertDB (), certUsageEmailSigner, + numcerts, rawCerts, NULL, PR_TRUE, PR_FALSE, + NULL); if (srv != SECSuccess) { set_nss_error (error); rv = FALSE; @@ -1298,8 +1314,9 @@ e_cert_db_import_user_cert (ECertDB *certdb, goto loser; } - cert = CERT_NewTempCertificate (CERT_GetDefaultCertDB (), collectArgs->rawCerts, - (gchar *) NULL, PR_FALSE, PR_TRUE); + cert = CERT_NewTempCertificate ( + CERT_GetDefaultCertDB (), collectArgs->rawCerts, + (gchar *) NULL, PR_FALSE, PR_TRUE); if (!cert) { set_nss_error (error); goto loser; @@ -1479,11 +1496,12 @@ e_cert_db_login_to_slot (ECertDB *cert_db, printf ("initializing slot password\n"); - g_signal_emit (e_cert_db_peek (), - e_cert_db_signals[PK11_CHANGE_PASSWD], 0, - NULL, - &pwd, - &rv); + g_signal_emit ( + e_cert_db_peek (), + e_cert_db_signals[PK11_CHANGE_PASSWD], 0, + NULL, + &pwd, + &rv); if (!rv) return FALSE; @@ -1494,7 +1512,8 @@ e_cert_db_login_to_slot (ECertDB *cert_db, PK11_SetPasswordFunc (pk11_password); if (PK11_Authenticate (slot, PR_TRUE, NULL) != SECSuccess) { - printf ("PK11_Authenticate failed (err = %d/%d)\n", + printf ( + "PK11_Authenticate failed (err = %d/%d)\n", PORT_GetError (), PORT_GetError () + 0x2000); return FALSE; } diff --git a/smime/lib/e-cert.c b/smime/lib/e-cert.c index 7b06a80b59..cd92062779 100644 --- a/smime/lib/e-cert.c +++ b/smime/lib/e-cert.c @@ -217,17 +217,19 @@ e_cert_populate (ECert *cert) cert->priv->serial_number = CERT_Hexify (&cert->priv->cert->serialNumber, TRUE); memset (fingerprint, 0, sizeof fingerprint); - PK11_HashBuf (SEC_OID_SHA1, fingerprint, - cert->priv->cert->derCert.data, - cert->priv->cert->derCert.len); + PK11_HashBuf ( + SEC_OID_SHA1, fingerprint, + cert->priv->cert->derCert.data, + cert->priv->cert->derCert.len); fpItem.data = fingerprint; fpItem.len = SHA1_LENGTH; cert->priv->sha1_fingerprint = CERT_Hexify (&fpItem, TRUE); memset (fingerprint, 0, sizeof fingerprint); - PK11_HashBuf (SEC_OID_MD5, fingerprint, - cert->priv->cert->derCert.data, - cert->priv->cert->derCert.len); + PK11_HashBuf ( + SEC_OID_MD5, fingerprint, + cert->priv->cert->derCert.data, + cert->priv->cert->derCert.len); fpItem.data = fingerprint; fpItem.len = MD5_LENGTH; cert->priv->md5_fingerprint = CERT_Hexify (&fpItem, TRUE); diff --git a/smime/lib/e-pkcs12.c b/smime/lib/e-pkcs12.c index bc6377a0a1..fa61033151 100644 --- a/smime/lib/e-pkcs12.c +++ b/smime/lib/e-pkcs12.c @@ -65,7 +65,7 @@ #include "secerr.h" /* static callback functions for the NSS PKCS#12 library */ -static SECItem * PR_CALLBACK nickname_collision (SECItem *, PRBool *, gpointer ); +static SECItem * PR_CALLBACK nickname_collision (SECItem *, PRBool *, gpointer); static gboolean handle_error (gint myerr); @@ -123,9 +123,8 @@ input_to_decoder (SEC_PKCS12DecoderContext *dcx, } /* feed the file data into the decoder */ - srv = SEC_PKCS12DecoderUpdate (dcx, - (guchar *) buf, - amount); + srv = SEC_PKCS12DecoderUpdate ( + dcx, (guchar *) buf, amount); if (srv) { /* XXX g_error */ fclose (fp); @@ -206,13 +205,14 @@ import_from_file_helper (EPKCS12 *pkcs12, } /* initialize the decoder */ - dcx = SEC_PKCS12DecoderStart (&passwd, - slot, - /* we specify NULL for all the - funcs + data so it'll use the - default pk11wrap functions */ - NULL, NULL, NULL, - NULL, NULL, NULL); + dcx = SEC_PKCS12DecoderStart ( + &passwd, + slot, + /* we specify NULL for all the + * funcs + data so it'll use the + * default pk11wrap functions */ + NULL, NULL, NULL, + NULL, NULL, NULL); if (!dcx) { srv = SECFailure; goto finish; @@ -345,8 +345,9 @@ nickname_collision (SECItem *oldNick, g_free (nickname); nickname = g_strdup (default_nickname); } - cert = CERT_FindCertByNickname (CERT_GetDefaultCertDB (), - nickname); + cert = CERT_FindCertByNickname ( + CERT_GetDefaultCertDB (), + nickname); if (!cert) { break; } diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c index a35dd57105..337cb0ad99 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/widgets/e-timezone-dialog/e-timezone-dialog.c @@ -188,10 +188,11 @@ e_timezone_dialog_add_timezones (ETimezoneDialog *etd) location = _(icaltimezone_get_location (zone)); - e_map_add_point (priv->map, location, - icaltimezone_get_longitude (zone), - icaltimezone_get_latitude (zone), - E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); + e_map_add_point ( + priv->map, location, + icaltimezone_get_longitude (zone), + icaltimezone_get_latitude (zone), + E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); list_items = g_list_prepend (list_items, location); } @@ -268,9 +269,11 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) g_object_weak_ref (G_OBJECT (map), map_destroy_cb, priv); - gtk_widget_set_events (map, gtk_widget_get_events (map) - | GDK_LEAVE_NOTIFY_MASK - | GDK_VISIBILITY_NOTIFY_MASK); + gtk_widget_set_events ( + map, + gtk_widget_get_events (map) | + GDK_LEAVE_NOTIFY_MASK | + GDK_VISIBILITY_NOTIFY_MASK); e_timezone_dialog_add_timezones (etd); @@ -474,11 +477,13 @@ on_map_timeout (gpointer data) if (e_map_point_get_color_rgba (priv->point_selected) == E_TIMEZONE_DIALOG_MAP_POINT_SELECTED_1_RGBA) - e_map_point_set_color_rgba (priv->map, priv->point_selected, - E_TIMEZONE_DIALOG_MAP_POINT_SELECTED_2_RGBA); + e_map_point_set_color_rgba ( + priv->map, priv->point_selected, + E_TIMEZONE_DIALOG_MAP_POINT_SELECTED_2_RGBA); else - e_map_point_set_color_rgba (priv->map, priv->point_selected, - E_TIMEZONE_DIALOG_MAP_POINT_SELECTED_1_RGBA); + e_map_point_set_color_rgba ( + priv->map, priv->point_selected, + E_TIMEZONE_DIALOG_MAP_POINT_SELECTED_1_RGBA); return TRUE; } @@ -497,19 +502,23 @@ on_map_motion (GtkWidget *widget, etd = E_TIMEZONE_DIALOG (data); priv = etd->priv; - e_map_window_to_world (priv->map, (gdouble) event->x, (gdouble) event->y, - &longitude, &latitude); + e_map_window_to_world ( + priv->map, (gdouble) event->x, (gdouble) event->y, + &longitude, &latitude); if (priv->point_hover && priv->point_hover != priv->point_selected) - e_map_point_set_color_rgba (priv->map, priv->point_hover, - E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); + e_map_point_set_color_rgba ( + priv->map, priv->point_hover, + E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); - priv->point_hover = e_map_get_closest_point (priv->map, longitude, - latitude, TRUE); + priv->point_hover = e_map_get_closest_point ( + priv->map, longitude, + latitude, TRUE); if (priv->point_hover != priv->point_selected) - e_map_point_set_color_rgba (priv->map, priv->point_hover, - E_TIMEZONE_DIALOG_MAP_POINT_HOVER_RGBA); + e_map_point_set_color_rgba ( + priv->map, priv->point_hover, + E_TIMEZONE_DIALOG_MAP_POINT_HOVER_RGBA); new_zone = get_zone_from_point (etd, priv->point_hover); @@ -539,11 +548,13 @@ on_map_leave (GtkWidget *widget, return FALSE; if (priv->point_hover && priv->point_hover != priv->point_selected) - e_map_point_set_color_rgba (priv->map, priv->point_hover, - E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); + e_map_point_set_color_rgba ( + priv->map, priv->point_hover, + E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); - timezone_combo_set_active_text (GTK_COMBO_BOX (priv->timezone_combo), - zone_display_name (priv->zone)); + timezone_combo_set_active_text ( + GTK_COMBO_BOX (priv->timezone_combo), + zone_display_name (priv->zone)); gtk_label_set_text (GTK_LABEL (priv->preview_label), ""); priv->point_hover = NULL; @@ -590,25 +601,28 @@ on_map_button_pressed (GtkWidget *w, etd = E_TIMEZONE_DIALOG (data); priv = etd->priv; - e_map_window_to_world (priv->map, (gdouble) event->x, (gdouble) event->y, - &longitude, &latitude); + e_map_window_to_world ( + priv->map, (gdouble) event->x, (gdouble) event->y, + &longitude, &latitude); if (event->button != 1) { e_map_zoom_out (priv->map); } else { if (e_map_get_magnification (priv->map) <= 1.0) - e_map_zoom_to_location (priv->map, longitude, - latitude); + e_map_zoom_to_location ( + priv->map, longitude, latitude); if (priv->point_selected) - e_map_point_set_color_rgba (priv->map, - priv->point_selected, - E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); + e_map_point_set_color_rgba ( + priv->map, + priv->point_selected, + E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); priv->point_selected = priv->point_hover; priv->zone = get_zone_from_point (etd, priv->point_selected); - timezone_combo_set_active_text (GTK_COMBO_BOX (priv->timezone_combo), - zone_display_name (priv->zone)); + timezone_combo_set_active_text ( + GTK_COMBO_BOX (priv->timezone_combo), + zone_display_name (priv->zone)); } return TRUE; @@ -700,10 +714,12 @@ e_timezone_dialog_set_timezone (ETimezoneDialog *etd, priv->zone = zone; - gtk_label_set_text (GTK_LABEL (priv->preview_label), - zone ? display : ""); - timezone_combo_set_active_text (GTK_COMBO_BOX (priv->timezone_combo), - zone ? zone_display_name (zone) : ""); + gtk_label_set_text ( + GTK_LABEL (priv->preview_label), + zone ? display : ""); + timezone_combo_set_active_text ( + GTK_COMBO_BOX (priv->timezone_combo), + zone ? zone_display_name (zone) : ""); set_map_timezone (etd, zone); g_free (display); @@ -735,16 +751,18 @@ set_map_timezone (ETimezoneDialog *etd, if (zone) { zone_longitude = icaltimezone_get_longitude (zone); zone_latitude = icaltimezone_get_latitude (zone); - point = e_map_get_closest_point (priv->map, - zone_longitude, - zone_latitude, - FALSE); + point = e_map_get_closest_point ( + priv->map, + zone_longitude, + zone_latitude, + FALSE); } else point = NULL; if (priv->point_selected) - e_map_point_set_color_rgba (priv->map, priv->point_selected, - E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); + e_map_point_set_color_rgba ( + priv->map, priv->point_selected, + E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); priv->point_selected = point; } diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 79d3104a08..974cdad323 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -71,12 +71,15 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *class) object_class->get_property = gal_define_views_dialog_get_property; object_class->dispose = gal_define_views_dialog_dispose; - g_object_class_install_property (object_class, PROP_COLLECTION, - g_param_spec_object ("collection", - "Collection", - NULL, - GAL_VIEW_COLLECTION_TYPE, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_COLLECTION, + g_param_spec_object ( + "collection", + "Collection", + NULL, + GAL_VIEW_COLLECTION_TYPE, + G_PARAM_READWRITE)); } /* Button callbacks */ @@ -94,10 +97,11 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, switch (id) { case GTK_RESPONSE_OK: - g_object_get (widget, - "name", &name, - "factory", &factory, - NULL); + g_object_get ( + widget, + "name", &name, + "factory", &factory, + NULL); if (name && factory) { g_strchomp (name); @@ -107,10 +111,11 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, 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, - COL_GALVIEW_DATA, item, - -1); + gtk_list_store_set ( + GTK_LIST_STORE (dialog->model), &iter, + COL_GALVIEW_NAME, name, + COL_GALVIEW_DATA, item, + -1); if (view && GAL_VIEW_GET_CLASS (view)->edit) gal_view_edit (view, GTK_WINDOW (dialog)); @@ -268,9 +273,10 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog) g_object_unref (widget); - gtk_dialog_add_buttons (GTK_DIALOG (dialog), - GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, - NULL); + gtk_dialog_add_buttons ( + GTK_DIALOG (dialog), + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, + NULL); dialog->treeview = GTK_TREE_VIEW (e_builder_get_widget (dialog->builder, "treeview1")); gtk_tree_view_set_reorderable (GTK_TREE_VIEW (dialog->treeview), FALSE); @@ -330,16 +336,18 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, title = e_str_without_underscores (item->title); gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - COL_GALVIEW_NAME, title, - COL_GALVIEW_DATA, item, - -1); + gtk_list_store_set ( + store, &iter, + COL_GALVIEW_NAME, title, + COL_GALVIEW_DATA, item, + -1); g_free (title); } - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), - COL_GALVIEW_NAME, GTK_SORT_ASCENDING); + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (store), + COL_GALVIEW_NAME, GTK_SORT_ASCENDING); /* attaching treeview to model */ gtk_tree_view_set_model (dialog->treeview, GTK_TREE_MODEL (store)); @@ -348,30 +356,36 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, dialog->model = GTK_TREE_MODEL (store); renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (dialog->treeview, - COL_GALVIEW_NAME, _("Name"), - renderer, "text", COL_GALVIEW_NAME, - NULL); + gtk_tree_view_insert_column_with_attributes ( + dialog->treeview, + COL_GALVIEW_NAME, _("Name"), + renderer, "text", COL_GALVIEW_NAME, + NULL); /* set sort column */ - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (dialog->model), - COL_GALVIEW_NAME, GTK_SORT_ASCENDING); + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (dialog->model), + COL_GALVIEW_NAME, GTK_SORT_ASCENDING); if (dialog->builder) { GtkWidget *widget = e_builder_get_widget (dialog->builder, "label-views"); if (widget && GTK_IS_LABEL (widget)) { if (collection->title) { - gchar *text = g_strdup_printf (_("Define Views for %s"), - collection->title); - gtk_label_set_text (GTK_LABEL (widget), - text); + gchar *text = g_strdup_printf ( + _("Define Views for %s"), + collection->title); + gtk_label_set_text ( + GTK_LABEL (widget), + text); gtk_window_set_title (GTK_WINDOW (dialog), text); g_free (text); } else { - gtk_label_set_text (GTK_LABEL (widget), - _("Define Views")); - gtk_window_set_title (GTK_WINDOW (dialog), - _("Define Views")); + gtk_label_set_text ( + GTK_LABEL (widget), + _("Define Views")); + gtk_window_set_title ( + GTK_WINDOW (dialog), + _("Define Views")); } } } diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index 3fc6d701f5..d9432d24cc 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -245,19 +245,25 @@ gal_define_views_model_class_init (GalDefineViewsModelClass *class) object_class->set_property = gal_define_views_model_set_property; object_class->get_property = gal_define_views_model_get_property; - g_object_class_install_property (object_class, PROP_EDITABLE, - g_param_spec_boolean ("editable", - "Editable", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_COLLECTION, - g_param_spec_object ("collection", - "Collection", - NULL, - GAL_VIEW_COLLECTION_TYPE, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_EDITABLE, + g_param_spec_boolean ( + "editable", + "Editable", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_COLLECTION, + g_param_spec_object ( + "collection", + "Collection", + NULL, + GAL_VIEW_COLLECTION_TYPE, + G_PARAM_READWRITE)); model_class->column_count = gdvm_col_count; model_class->row_count = gdvm_row_count; diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index 662b928b95..85dcc32f13 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -63,9 +63,10 @@ gal_view_collection_display_view (GalViewCollection *collection, g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (GAL_IS_VIEW (view)); - g_signal_emit (collection, - gal_view_collection_signals[DISPLAY_VIEW], 0, - view); + g_signal_emit ( + collection, + gal_view_collection_signals[DISPLAY_VIEW], 0, + view); } static void @@ -73,8 +74,9 @@ gal_view_collection_changed (GalViewCollection *collection) { g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); - g_signal_emit (collection, - gal_view_collection_signals[CHANGED], 0); + g_signal_emit ( + collection, + gal_view_collection_signals[CHANGED], 0); } static void @@ -83,8 +85,9 @@ gal_view_collection_item_free (GalViewCollectionItem *item) g_free (item->id); if (item->view) { if (item->view_changed_id) - g_signal_handler_disconnect (item->view, - item->view_changed_id); + g_signal_handler_disconnect ( + item->view, + item->view_changed_id); g_object_unref (item->view); } g_free (item); @@ -196,23 +199,24 @@ gal_view_collection_class_init (GalViewCollectionClass *class) object_class->dispose = gal_view_collection_dispose; - gal_view_collection_signals[DISPLAY_VIEW] = - g_signal_new ("display_view", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GalViewCollectionClass, display_view), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, GAL_TYPE_VIEW); - - gal_view_collection_signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GalViewCollectionClass, changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + gal_view_collection_signals[DISPLAY_VIEW] = g_signal_new ( + "display_view", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GalViewCollectionClass, display_view), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GAL_TYPE_VIEW); + + gal_view_collection_signals[CHANGED] = g_signal_new ( + "changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GalViewCollectionClass, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); class->display_view = NULL; class->changed = NULL; @@ -310,9 +314,9 @@ view_changed (GalView *view, item->changed = TRUE; item->ever_changed = TRUE; - g_signal_handler_block (G_OBJECT (item->view), item->view_changed_id); + g_signal_handler_block (item->view, item->view_changed_id); gal_view_collection_changed (item->collection); - g_signal_handler_unblock (G_OBJECT (item->view), item->view_changed_id); + g_signal_handler_unblock (item->view, item->view_changed_id); } /* Use factory list to load a GalView file. */ @@ -788,8 +792,9 @@ gal_view_collection_set_nth_view (GalViewCollection *collection, gal_view_set_title (view, item->title); g_object_ref (view); if (item->view) { - g_signal_handler_disconnect (item->view, - item->view_changed_id); + g_signal_handler_disconnect ( + item->view, + item->view_changed_id); g_object_unref (item->view); } item->view = view; diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index c097db0ded..01435f94d3 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -36,8 +36,9 @@ detach_table (GalViewEtable *view) if (view->table == NULL) return; if (view->table_state_changed_id) { - g_signal_handler_disconnect (view->table, - view->table_state_changed_id); + g_signal_handler_disconnect ( + view->table, + view->table_state_changed_id); view->table_state_changed_id = 0; } g_object_unref (view->table); @@ -50,8 +51,9 @@ detach_tree (GalViewEtable *view) if (view->tree == NULL) return; if (view->tree_state_changed_id) { - g_signal_handler_disconnect (view->tree, - view->tree_state_changed_id); + g_signal_handler_disconnect ( + view->tree, + view->tree_state_changed_id); view->tree_state_changed_id = 0; } g_object_unref (view->tree); @@ -65,9 +67,10 @@ config_changed (ETableConfig *config, ETableState *state; if (view->state) g_object_unref (view->state); - g_object_get (config, - "state", &state, - NULL); + g_object_get ( + config, + "state", &state, + NULL); view->state = e_table_state_duplicate (state); g_object_unref (state); @@ -81,10 +84,11 @@ gal_view_etable_edit (GalView *view, GalViewEtable *etable_view = GAL_VIEW_ETABLE (view); ETableConfig *config; - config = e_table_config_new (etable_view->title, - etable_view->spec, - etable_view->state, - parent); + config = e_table_config_new ( + etable_view->title, + etable_view->spec, + etable_view->state, + parent); g_signal_connect ( config, "changed", diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index a213082702..df1d1ca743 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -68,15 +68,17 @@ gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dial title = e_str_without_underscores (item->title); gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - COL_GALVIEW_NAME, title, - COL_GALVIEW_DATA, item, - -1); + gtk_list_store_set ( + store, &iter, + COL_GALVIEW_NAME, title, + COL_GALVIEW_DATA, item, + -1); g_free (title); } - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (store), COL_GALVIEW_NAME, GTK_SORT_ASCENDING); /* attaching treeview to model */ @@ -87,14 +89,16 @@ gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dial renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (dialog->treeview, - COL_GALVIEW_NAME, _("Name"), - renderer, "text", COL_GALVIEW_NAME, - NULL); + gtk_tree_view_insert_column_with_attributes ( + dialog->treeview, + COL_GALVIEW_NAME, _("Name"), + renderer, "text", COL_GALVIEW_NAME, + NULL); /* set sort column */ - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (dialog->model), - COL_GALVIEW_NAME, GTK_SORT_ASCENDING); + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (dialog->model), + COL_GALVIEW_NAME, GTK_SORT_ASCENDING); } static void @@ -227,12 +231,15 @@ gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *c object_class->get_property = gal_view_instance_save_as_dialog_get_property; object_class->dispose = gal_view_instance_save_as_dialog_dispose; - g_object_class_install_property (object_class, PROP_INSTANCE, - g_param_spec_object ("instance", - "Instance", - NULL, - GAL_VIEW_INSTANCE_TYPE, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_INSTANCE, + g_param_spec_object ( + "instance", + "Instance", + NULL, + GAL_VIEW_INSTANCE_TYPE, + G_PARAM_READWRITE)); } static void diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index e73b6fb304..97ba252a0b 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -65,8 +65,9 @@ gal_view_instance_changed (GalViewInstance *instance) g_return_if_fail (instance != NULL); g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); - g_signal_emit (instance, - gal_view_instance_signals[CHANGED], 0); + g_signal_emit ( + instance, + gal_view_instance_signals[CHANGED], 0); } static void @@ -76,9 +77,10 @@ gal_view_instance_display_view (GalViewInstance *instance, g_return_if_fail (instance != NULL); g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); - g_signal_emit (instance, - gal_view_instance_signals[DISPLAY_VIEW], 0, - view); + g_signal_emit ( + instance, + gal_view_instance_signals[DISPLAY_VIEW], 0, + view); } static void @@ -120,8 +122,9 @@ disconnect_view (GalViewInstance *instance) { if (instance->current_view) { if (instance->view_changed_id) { - g_signal_handler_disconnect (instance->current_view, - instance->view_changed_id); + g_signal_handler_disconnect ( + instance->current_view, + instance->view_changed_id); } g_object_unref (instance->current_view); @@ -158,8 +161,9 @@ gal_view_instance_dispose (GObject *object) if (instance->collection) { if (instance->collection_changed_id) { - g_signal_handler_disconnect (instance->collection, - instance->collection_changed_id); + g_signal_handler_disconnect ( + instance->collection, + instance->collection_changed_id); } g_object_unref (instance->collection); } @@ -184,32 +188,33 @@ gal_view_instance_class_init (GalViewInstanceClass *class) object_class->dispose = gal_view_instance_dispose; - gal_view_instance_signals[DISPLAY_VIEW] = - g_signal_new ("display_view", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GalViewInstanceClass, display_view), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, GAL_TYPE_VIEW); - - gal_view_instance_signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GalViewInstanceClass, changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - gal_view_instance_signals[LOADED] = - g_signal_new ("loaded", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GalViewInstanceClass, loaded), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + gal_view_instance_signals[DISPLAY_VIEW] = g_signal_new ( + "display_view", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GalViewInstanceClass, display_view), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GAL_TYPE_VIEW); + + gal_view_instance_signals[CHANGED] = g_signal_new ( + "changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GalViewInstanceClass, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + gal_view_instance_signals[LOADED] = g_signal_new ( + "loaded", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GalViewInstanceClass, loaded), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); class->display_view = NULL; class->changed = NULL; @@ -270,12 +275,13 @@ load_current_view (GalViewInstance *instance) instance->current_id = g_strdup (gal_view_instance_get_default_view (instance)); if (instance->current_id) { - gint index = gal_view_collection_get_view_index_by_id (instance->collection, - instance->current_id); + gint index = gal_view_collection_get_view_index_by_id ( + instance->collection, + instance->current_id); if (index != -1) { - view = gal_view_collection_get_view (instance->collection, - index); + view = gal_view_collection_get_view ( + instance->collection, index); view = gal_view_clone (view); connect_view (instance, view); } @@ -287,21 +293,22 @@ load_current_view (GalViewInstance *instance) instance->current_id = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"current_view", NULL); if (instance->current_id != NULL) { - gint index = gal_view_collection_get_view_index_by_id (instance->collection, - instance->current_id); + gint index = gal_view_collection_get_view_index_by_id ( + instance->collection, + instance->current_id); if (index != -1) { - view = gal_view_collection_get_view (instance->collection, - index); + view = gal_view_collection_get_view ( + instance->collection, index); view = gal_view_clone (view); } } if (view == NULL) { gchar *type; type = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"current_view_type", NULL); - view = gal_view_collection_load_view_from_file (instance->collection, - type, - instance->custom_filename); + view = gal_view_collection_load_view_from_file ( + instance->collection, type, + instance->custom_filename); g_free (type); } diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index 0e99e3271c..b0de7156dc 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -179,8 +179,9 @@ GtkWidget * gal_view_new_dialog_new (GalViewCollection *collection) { GtkWidget *widget = - gal_view_new_dialog_construct (g_object_new (GAL_VIEW_NEW_DIALOG_TYPE, NULL), - collection); + gal_view_new_dialog_construct ( + g_object_new (GAL_VIEW_NEW_DIALOG_TYPE, NULL), + collection); return widget; } @@ -255,7 +256,7 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog, gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->list), column); iterator = dialog->collection->factory_list; - for (; iterator; iterator = g_list_next (iterator) ) { + for (; iterator; iterator = g_list_next (iterator)) { GalViewFactory *factory = iterator->data; GtkTreeIter iter; diff --git a/widgets/misc/e-alert-bar.c b/widgets/misc/e-alert-bar.c index 7700ef5f2a..2022af99f1 100644 --- a/widgets/misc/e-alert-bar.c +++ b/widgets/misc/e-alert-bar.c @@ -353,10 +353,12 @@ alert_bar_find_duplicate_cb (EAlert *alert, dd->found |= ( e_alert_get_message_type (alert) == e_alert_get_message_type (dd->looking_for) && - g_strcmp0 (e_alert_get_primary_text (alert), - e_alert_get_primary_text (dd->looking_for)) == 0 && - g_strcmp0 (e_alert_get_secondary_text (alert), - e_alert_get_secondary_text (dd->looking_for)) == 0); + g_strcmp0 ( + e_alert_get_primary_text (alert), + e_alert_get_primary_text (dd->looking_for)) == 0 && + g_strcmp0 ( + e_alert_get_secondary_text (alert), + e_alert_get_secondary_text (dd->looking_for)) == 0); } void diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c index 2f57a7f339..3fc4753055 100644 --- a/widgets/misc/e-attachment-bar.c +++ b/widgets/misc/e-attachment-bar.c @@ -126,9 +126,11 @@ attachment_bar_set_store (EAttachmentBar *bar, bar->priv->model = g_object_ref (store); - gtk_icon_view_set_model (GTK_ICON_VIEW (bar->priv->icon_view), + gtk_icon_view_set_model ( + GTK_ICON_VIEW (bar->priv->icon_view), bar->priv->model); - gtk_tree_view_set_model (GTK_TREE_VIEW (bar->priv->tree_view), + gtk_tree_view_set_model ( + GTK_TREE_VIEW (bar->priv->tree_view), bar->priv->model); g_signal_connect_object ( @@ -759,7 +761,7 @@ e_attachment_bar_set_expanded (EAttachmentBar *bar, { g_return_if_fail (E_IS_ATTACHMENT_BAR (bar)); - if ((bar->priv->expanded ? 1 : 0) == (expanded ? 1 : 0)) + if (bar->priv->expanded == expanded) return; bar->priv->expanded = expanded; diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c index d3fda0985a..a2057e3354 100644 --- a/widgets/misc/e-attachment-button.c +++ b/widgets/misc/e-attachment-button.c @@ -834,7 +834,7 @@ e_attachment_button_set_expandable (EAttachmentButton *button, { g_return_if_fail (E_IS_ATTACHMENT_BUTTON (button)); - if ((button->priv->expandable ? 1 : 0) == (expandable ? 1 : 0)) + if (button->priv->expandable == expandable) return; button->priv->expandable = expandable; @@ -859,7 +859,7 @@ e_attachment_button_set_expanded (EAttachmentButton *button, { g_return_if_fail (E_IS_ATTACHMENT_BUTTON (button)); - if ((button->priv->expanded ? 1 : 0) == (expanded ? 1 : 0)) + if (button->priv->expanded == expanded) return; button->priv->expanded = expanded; diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c index 565d91c4de..a3c4efb187 100644 --- a/widgets/misc/e-attachment-paned.c +++ b/widgets/misc/e-attachment-paned.c @@ -843,7 +843,7 @@ e_attachment_paned_set_expanded (EAttachmentPaned *paned, { g_return_if_fail (E_IS_ATTACHMENT_PANED (paned)); - if ((paned->priv->expanded ? 1 : 0) == (expanded ? 1 : 0)) + if (paned->priv->expanded == expanded) return; paned->priv->expanded = expanded; @@ -865,7 +865,7 @@ e_attachment_paned_set_resize_toplevel (EAttachmentPaned *paned, { g_return_if_fail (E_IS_ATTACHMENT_PANED (paned)); - if ((paned->priv->resize_toplevel ? 1 : 0) == (resize_toplevel ? 1 : 0)) + if (paned->priv->resize_toplevel == resize_toplevel) return; paned->priv->resize_toplevel = resize_toplevel; diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index 7b245e8b0d..113312ac48 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -1916,7 +1916,8 @@ e_attachment_load_async (EAttachment *attachment, } else if (mime_part != NULL) { g_object_set_data (G_OBJECT (load_context->simple), ATTACHMENT_LOAD_CONTEXT, load_context); - g_simple_async_result_run_in_thread (load_context->simple, + g_simple_async_result_run_in_thread ( + load_context->simple, attachment_load_from_mime_part_thread, G_PRIORITY_DEFAULT, cancellable); diff --git a/widgets/misc/e-buffer-tagger.c b/widgets/misc/e-buffer-tagger.c index c57632ea69..650abb3d9d 100644 --- a/widgets/misc/e-buffer-tagger.c +++ b/widgets/misc/e-buffer-tagger.c @@ -374,9 +374,10 @@ textview_query_tooltip (GtkTextView *text_view, gchar *url; GtkTextIter iter; - gtk_text_view_window_to_buffer_coords (text_view, - GTK_TEXT_WINDOW_WIDGET, - x, y, &x, &y); + gtk_text_view_window_to_buffer_coords ( + text_view, + GTK_TEXT_WINDOW_WIDGET, + x, y, &x, &y); gtk_text_view_get_iter_at_location (text_view, &iter, x, y); url = get_url_at_iter (buffer, &iter); @@ -493,9 +494,10 @@ textview_event_after (GtkTextView *textview, if (gtk_text_iter_get_offset (&start) != gtk_text_iter_get_offset (&end)) return FALSE; - gtk_text_view_window_to_buffer_coords (textview, - GTK_TEXT_WINDOW_WIDGET, - event->x, event->y, &x, &y); + gtk_text_view_window_to_buffer_coords ( + textview, + GTK_TEXT_WINDOW_WIDGET, + event->x, event->y, &x, &y); gtk_text_view_get_iter_at_location (textview, &iter, x, y); @@ -513,7 +515,8 @@ textview_motion_notify_event (GtkTextView *textview, g_return_val_if_fail (GTK_IS_TEXT_VIEW (textview), FALSE); - gtk_text_view_window_to_buffer_coords (textview, + gtk_text_view_window_to_buffer_coords ( + textview, GTK_TEXT_WINDOW_WIDGET, event->x, event->y, &x, &y); @@ -532,7 +535,8 @@ textview_visibility_notify_event (GtkTextView *textview, gdk_window_get_pointer (gtk_text_view_get_window (textview, GTK_TEXT_WINDOW_WIDGET), &wx, &wy, NULL); - gtk_text_view_window_to_buffer_coords (textview, + gtk_text_view_window_to_buffer_coords ( + textview, GTK_TEXT_WINDOW_WIDGET, wx, wy, &bx, &by); @@ -560,7 +564,8 @@ e_buffer_tagger_connect (GtkTextView *textview) /* if tag is there already, then it is connected, thus claim */ g_return_if_fail (tag == NULL); - gtk_text_buffer_create_tag (buffer, E_BUFFER_TAGGER_LINK_TAG, + gtk_text_buffer_create_tag ( + buffer, E_BUFFER_TAGGER_LINK_TAG, "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL); diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index 34f1696c5b..0f38c7b16a 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -528,30 +528,32 @@ e_calendar_item_class_init (ECalendarItemClass *class) TRUE, G_PARAM_READWRITE)); - e_calendar_item_signals[DATE_RANGE_CHANGED] = - g_signal_new ("date_range_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ECalendarItemClass, date_range_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - e_calendar_item_signals[SELECTION_CHANGED] = - g_signal_new ("selection_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ECalendarItemClass, selection_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - e_calendar_item_signals[SELECTION_PREVIEW_CHANGED] = - g_signal_new ("selection_preview_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalendarItemClass, selection_preview_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + e_calendar_item_signals[DATE_RANGE_CHANGED] = g_signal_new ( + "date_range_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ECalendarItemClass, date_range_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + e_calendar_item_signals[SELECTION_CHANGED] = g_signal_new ( + "selection_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ECalendarItemClass, selection_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + e_calendar_item_signals[SELECTION_PREVIEW_CHANGED] = g_signal_new ( + "selection_preview_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalendarItemClass, selection_preview_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); e_calendar_item_a11y_init (); } @@ -751,13 +753,13 @@ e_calendar_item_set_property (GObject *object, switch (property_id) { case PROP_YEAR: ivalue = g_value_get_int (value); - e_calendar_item_set_first_month (calitem, ivalue, - calitem->month); + e_calendar_item_set_first_month ( + calitem, ivalue, calitem->month); return; case PROP_MONTH: ivalue = g_value_get_int (value); - e_calendar_item_set_first_month (calitem, calitem->year, - ivalue); + e_calendar_item_set_first_month ( + calitem, calitem->year, ivalue); return; case PROP_X1: dvalue = g_value_get_double (value); @@ -935,8 +937,9 @@ e_calendar_item_update (GnomeCanvasItem *item, /* Set up Pango prerequisites */ font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (GTK_WIDGET (item->canvas)); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); /* * Calculate the new layout of the calendar. @@ -1029,8 +1032,9 @@ e_calendar_item_update (GnomeCanvasItem *item, space = MAX (0, space); calitem->x_offset = space / 2; - gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, - item->x2, item->y2); + gnome_canvas_request_redraw ( + item->canvas, item->x1, item->y1, + item->x2, item->y2); pango_font_metrics_unref (font_metrics); } @@ -1056,8 +1060,9 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, GdkColor base, bg; #if 0 - g_print ("In e_calendar_item_draw %i,%i %ix%i\n", - x, y, width, height); + g_print ( + "In e_calendar_item_draw %i,%i %ix%i\n", + x, y, width, height); #endif calitem = E_CALENDAR_ITEM (canvas_item); style = gtk_widget_get_style (GTK_WIDGET (canvas_item->canvas)); @@ -1067,8 +1072,9 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, if (!font_desc) font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (GTK_WIDGET (canvas_item->canvas)); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1082,18 +1088,20 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, /* Clear the entire background. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &base); - cairo_rectangle (cr, calitem->x1 - x, calitem->y1 - y, - calitem->x2 - calitem->x1 + 1, - calitem->y2 - calitem->y1 + 1); + cairo_rectangle ( + cr, calitem->x1 - x, calitem->y1 - y, + calitem->x2 - calitem->x1 + 1, + calitem->y2 - calitem->y1 + 1); cairo_fill (cr); cairo_restore (cr); /* Draw the shadow around the entire item. */ - gtk_paint_shadow (style, cr, GTK_STATE_NORMAL, GTK_SHADOW_IN, - NULL, "entry", - calitem->x1 - x, calitem->y1 - y, - calitem->x2 - calitem->x1 + 1, - calitem->y2 - calitem->y1 + 1); + gtk_paint_shadow ( + style, cr, GTK_STATE_NORMAL, GTK_SHADOW_IN, + NULL, "entry", + calitem->x1 - x, calitem->y1 - y, + calitem->x2 - calitem->x1 + 1, + calitem->y2 - calitem->y1 + 1); row_y = canvas_item->y1 + ythickness; bar_height = ythickness * 2 @@ -1106,36 +1114,40 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); gdk_cairo_set_source_color (cr, &bg); - cairo_rectangle (cr, calitem->x1 + xthickness - x, row_y - y, - calitem->x2 - calitem->x1 + 1 - - xthickness * 2, - bar_height); + cairo_rectangle ( + cr, calitem->x1 + xthickness - x, row_y - y, + calitem->x2 - calitem->x1 + 1 + - xthickness * 2, + bar_height); cairo_fill (cr); cairo_restore (cr); - gtk_paint_shadow (style, cr, - GTK_STATE_NORMAL, GTK_SHADOW_OUT, - NULL, "calendar-header", - calitem->x1 + xthickness - x, row_y - y, - calitem->x2 - calitem->x1 + 1 - - xthickness * 2, - bar_height); + gtk_paint_shadow ( + style, cr, + GTK_STATE_NORMAL, GTK_SHADOW_OUT, + NULL, "calendar-header", + calitem->x1 + xthickness - x, row_y - y, + calitem->x2 - calitem->x1 + 1 + - xthickness * 2, + bar_height); for (col = 0; col < calitem->cols; col++) { if (col != 0) { col_x = calitem->x1 + calitem->x_offset + calitem->month_width * col; - gtk_paint_vline (style, cr, - GTK_STATE_NORMAL, NULL, - "calendar-separator", - row_y + ythickness + 1 - y, - row_y + bar_height - - ythickness - 2 - y, - col_x - 1 - x); + gtk_paint_vline ( + style, cr, + GTK_STATE_NORMAL, NULL, + "calendar-separator", + row_y + ythickness + 1 - y, + row_y + bar_height + - ythickness - 2 - y, + col_x - 1 - x); } - e_calendar_item_draw_month (calitem, cr, x, y, - width, height, row, col); + e_calendar_item_draw_month ( + calitem, cr, x, y, + width, height, row, col); } row_y += calitem->month_height; @@ -1184,8 +1196,9 @@ e_calendar_item_draw_month (ECalendarItem *calitem, PangoLayout *layout; #if 0 - g_print ("In e_calendar_item_draw_month: %i,%i %ix%i row:%i col:%i\n", - x, y, width, height, row, col); + g_print ( + "In e_calendar_item_draw_month: %i,%i %ix%i row:%i col:%i\n", + x, y, width, height, row, col); #endif item = GNOME_CANVAS_ITEM (calitem); widget = GTK_WIDGET (item->canvas); @@ -1196,8 +1209,9 @@ e_calendar_item_draw_month (ECalendarItem *calitem, if (!font_desc) font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1215,8 +1229,8 @@ 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; + + ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + ? (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; @@ -1379,9 +1393,10 @@ e_calendar_item_draw_month (ECalendarItem *calitem, cairo_save (cr); gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_SELECTED]); - cairo_rectangle (cr, cells_x , - text_y - E_CALENDAR_ITEM_YPAD_ABOVE_CELLS - 1, - calitem->cell_width * 7 , cells_y - text_y ); + cairo_rectangle ( + cr, cells_x , + text_y - E_CALENDAR_ITEM_YPAD_ABOVE_CELLS - 1, + calitem->cell_width * 7 , cells_y - text_y); cairo_fill (cr); cairo_restore (cr); @@ -1393,9 +1408,10 @@ e_calendar_item_draw_month (ECalendarItem *calitem, for (day = 0; day < 7; day++) { cairo_save (cr); layout_set_day_text (calitem, layout, day_index); - cairo_move_to (cr, - text_x - calitem->day_widths[day_index], - text_y); + cairo_move_to ( + cr, + text_x - calitem->day_widths[day_index], + text_y); pango_cairo_show_layout (cr, layout); text_x += (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? -calitem->cell_width : calitem->cell_width; @@ -1409,7 +1425,8 @@ e_calendar_item_draw_month (ECalendarItem *calitem, if (calitem->show_week_numbers) { cairo_save (cr); gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_SELECTED]); - cairo_rectangle (cr, cells_x, cells_y - (cells_y - text_y + 2) , + cairo_rectangle ( + cr, cells_x, cells_y - (cells_y - text_y + 2) , -20, E_CALENDAR_ROWS_PER_MONTH * calitem->cell_height + 18); cairo_fill (cr); cairo_restore (cr); @@ -1496,8 +1513,9 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1607,8 +1625,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, for (dcol = 0; dcol < 7; dcol++) { if (draw_day) { day_x = cells_x + - ( (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - ? 7 - 1 - dcol : dcol ) * calitem->cell_width; + ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + ? 7 - 1 - dcol : dcol) * calitem->cell_width; day_y = cells_y + drow * calitem->cell_height; @@ -1658,20 +1676,20 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, else e_calendar_item_get_day_style ( calitem, - years[mon], - months[mon], - day_num, - day_style, - today, - mon != 1, - selected, - has_focus, - drop_target, - &bg_color, - &fg_color, - &box_color, - &bold, - &italic); + years[mon], + months[mon], + day_num, + day_style, + today, + mon != 1, + selected, + has_focus, + drop_target, + &bg_color, + &fg_color, + &box_color, + &bold, + &italic); /* Draw the background, if set. */ if (bg_color) { @@ -1860,11 +1878,13 @@ e_calendar_item_stop_selecting (ECalendarItem *calitem, * 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); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month - 1); else if (calitem->selection_start_month_offset == calitem->rows * calitem->cols) - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month + 1); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month + 1); calitem->selection_changed = TRUE; if (calitem->selecting_axis) { @@ -1931,11 +1951,10 @@ e_calendar_item_selection_add_days (ECalendarItem *calitem, calitem->selecting = TRUE; - e_calendar_item_set_selection_if_emission (calitem, - &gdate_start, &gdate_end, - FALSE); - g_signal_emit_by_name (G_OBJECT (calitem), - "selection_preview_changed"); + e_calendar_item_set_selection_if_emission ( + calitem, &gdate_start, &gdate_end, FALSE); + + g_signal_emit_by_name (calitem, "selection_preview_changed"); } static gint @@ -1952,20 +1971,24 @@ e_calendar_item_key_press_event (ECalendarItem *calitem, multi_selection = event->key.state & GDK_SHIFT_MASK; switch (keyval) { case GDK_KEY_Up: - e_calendar_item_selection_add_days (calitem, -7, - multi_selection); + e_calendar_item_selection_add_days ( + calitem, -7, + multi_selection); break; case GDK_KEY_Down: - e_calendar_item_selection_add_days (calitem, 7, - multi_selection); + e_calendar_item_selection_add_days ( + calitem, 7, + multi_selection); break; case GDK_KEY_Left: - e_calendar_item_selection_add_days (calitem, -1, - multi_selection); + e_calendar_item_selection_add_days ( + calitem, -1, + multi_selection); break; case GDK_KEY_Right: - e_calendar_item_selection_add_days (calitem, 1, - multi_selection); + e_calendar_item_selection_add_days ( + calitem, 1, + multi_selection); break; case GDK_KEY_space: case GDK_KEY_Return: @@ -2211,11 +2234,13 @@ e_calendar_item_button_press (ECalendarItem *calitem, gboolean all_week, round_up_end = FALSE, round_down_start = FALSE; if (event->button.button == 4) - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month - 1); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month - 1); else if (event->button.button == 5) - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month + 1); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month + 1); if (!e_calendar_item_convert_position_to_day (calitem, event->button.x, @@ -2227,9 +2252,10 @@ 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, - month_offset); + e_calendar_item_show_popup_menu ( + calitem, + (GdkEventButton *) event, + month_offset); return TRUE; } @@ -2398,25 +2424,29 @@ e_calendar_item_motion (ECalendarItem *calitem, } if (round_up_end) - e_calendar_item_round_up_selection (calitem, &end_month, - &end_day); + e_calendar_item_round_up_selection ( + calitem, &end_month, + &end_day); if (round_down_start) - e_calendar_item_round_down_selection (calitem, &start_month, - &start_day); + e_calendar_item_round_down_selection ( + calitem, &start_month, + &start_day); /* Check we don't go over the maximum number of days to select. */ if (calitem->selection_dragging_end) { - e_calendar_item_check_selection_end (calitem, - start_month, - start_day, - &end_month, - &end_day); + e_calendar_item_check_selection_end ( + calitem, + start_month, + start_day, + &end_month, + &end_day); } else { - e_calendar_item_check_selection_start (calitem, - &start_month, - &start_day, - end_month, - end_day); + e_calendar_item_check_selection_start ( + calitem, + &start_month, + &start_day, + end_month, + end_day); } if (start_month == calitem->selection_start_month_offset @@ -2547,8 +2577,9 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, if (!font_desc) font_desc = style->font_desc; pango_context = gtk_widget_create_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -2625,8 +2656,9 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, *day = day_row * E_CALENDAR_COLS_PER_MONTH + day_col; - e_calendar_item_get_month_info (calitem, row, col, &first_day_offset, - &days_in_month, &days_in_prev_month); + e_calendar_item_get_month_info ( + calitem, row, col, &first_day_offset, + &days_in_month, &days_in_prev_month); if (*day < first_day_offset) { if (*entire_week || (row == 0 && col == 0)) { (*month_offset)--; @@ -2957,8 +2989,9 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, /* Calculate the first day shown. This will be one of the greyed-out * 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); + e_calendar_item_get_month_info ( + calitem, 0, 0, &first_day_offset, + &days_in_month, &days_in_prev_month); *start_year = calitem->year; *start_month = calitem->month - 1; if (*start_month == -1) { @@ -2969,9 +3002,10 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, /* Calculate the last day shown. This will be one of the greyed-out * 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); + e_calendar_item_get_month_info ( + calitem, calitem->rows - 1, + calitem->cols - 1, &first_day_offset, + &days_in_month, &days_in_prev_month); *end_month = calitem->month + calitem->rows * calitem->cols; *end_year = calitem->year + *end_month / 12; *end_month %= 12; @@ -2993,8 +3027,9 @@ e_calendar_item_clear_marks (ECalendarItem *calitem) g_free (calitem->styles); calitem->styles = NULL; - gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, - item->x2, item->y2); + gnome_canvas_request_redraw ( + item->canvas, item->x1, item->y1, + item->x2, item->y2); } /* add_day_style - whether bit-or with the actual style or change the style fully */ @@ -3277,14 +3312,15 @@ e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, end_month = g_date_get_month (end_date) - 1; end_day = g_date_get_day (end_date); - need_update = e_calendar_item_ensure_days_visible (calitem, - start_year, - start_month, - start_day, - end_year, - end_month, - end_day, - emission); + need_update = e_calendar_item_ensure_days_visible ( + calitem, + start_year, + start_month, + start_day, + end_year, + end_month, + end_day, + emission); new_start_month_offset = (start_year - calitem->year) * 12 + start_month - calitem->month; @@ -3358,8 +3394,9 @@ e_calendar_item_set_selection (ECalendarItem *calitem, { /* If the user is in the middle of a selection, we must abort it. */ if (calitem->selecting) { - gnome_canvas_item_ungrab (GNOME_CANVAS_ITEM (calitem), - GDK_CURRENT_TIME); + gnome_canvas_item_ungrab ( + GNOME_CANVAS_ITEM (calitem), + GDK_CURRENT_TIME); calitem->selecting = FALSE; } @@ -3392,8 +3429,9 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, /* Calculate the range of months currently displayed. */ current_end_year = calitem->year; current_end_month = calitem->month + months_shown - 1; - e_calendar_item_normalize_date (calitem, ¤t_end_year, - ¤t_end_month); + e_calendar_item_normalize_date ( + calitem, ¤t_end_year, + ¤t_end_month); /* Try to ensure that the end month is shown. */ if ((end_year == current_end_year + 1 && @@ -3402,13 +3440,15 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, /* See if the end of the selection will fit in the * 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); + e_calendar_item_normalize_date ( + calitem, &calitem->year, + &calitem->month); - e_calendar_item_get_month_info (calitem, 0, 0, - &first_day_offset, - &days_in_month, - &days_in_prev_month); + e_calendar_item_get_month_info ( + calitem, 0, 0, + &first_day_offset, + &days_in_month, + &days_in_prev_month); if (end_day >= E_CALENDAR_ROWS_PER_MONTH * E_CALENDAR_COLS_PER_MONTH - first_day_offset - days_in_month) { @@ -3420,8 +3460,9 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, calitem->month -= (months_shown - 1); } - e_calendar_item_normalize_date (calitem, &calitem->year, - &calitem->month); + e_calendar_item_normalize_date ( + calitem, &calitem->year, + &calitem->month); } else if (end_year > current_end_year || (end_year == current_end_year && end_month > current_end_month)) { @@ -3432,8 +3473,9 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, calitem->year = end_year; calitem->month = end_month - months_shown + 1; - e_calendar_item_normalize_date (calitem, &calitem->year, - &calitem->month); + e_calendar_item_normalize_date ( + calitem, &calitem->year, + &calitem->month); } /* Now try to ensure that the start month is shown. We do this after @@ -3447,13 +3489,15 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, * 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, - &calitem->month); + e_calendar_item_normalize_date ( + calitem, &calitem->year, + &calitem->month); - e_calendar_item_get_month_info (calitem, 0, 0, - &first_day_offset, - &days_in_month, - &days_in_prev_month); + e_calendar_item_get_month_info ( + calitem, 0, 0, + &first_day_offset, + &days_in_month, + &days_in_prev_month); if (start_day <= days_in_prev_month - first_day_offset) { calitem->year = start_year; @@ -3504,10 +3548,12 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem, submenu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu); - g_object_set_data (G_OBJECT (submenu), "year", - GINT_TO_POINTER (year)); - g_object_set_data (G_OBJECT (submenu), "month_offset", - GINT_TO_POINTER (month_offset)); + g_object_set_data ( + G_OBJECT (submenu), "year", + GINT_TO_POINTER (year)); + g_object_set_data ( + G_OBJECT (submenu), "month_offset", + GINT_TO_POINTER (month_offset)); for (month = 0; month < 12; month++) { name = e_get_month_name (month + 1, FALSE); diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index fcad4edb4b..38336cb618 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -154,10 +154,12 @@ e_calendar_init (ECalendar *cal) canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (cal)->root); - cal->calitem = E_CALENDAR_ITEM (gnome_canvas_item_new (canvas_group, - e_calendar_item_get_type (), - "week_number_font_desc", small_font_desc, - NULL)); + cal->calitem = E_CALENDAR_ITEM ( + gnome_canvas_item_new ( + canvas_group, + e_calendar_item_get_type (), + "week_number_font_desc", small_font_desc, + NULL)); pango_font_description_free (small_font_desc); @@ -179,10 +181,11 @@ e_calendar_init (ECalendar *cal) gtk_widget_show (pixmap); gtk_container_add (GTK_CONTAINER (button), pixmap); - cal->prev_item = gnome_canvas_item_new (canvas_group, - gnome_canvas_widget_get_type (), - "widget", button, - NULL); + cal->prev_item = gnome_canvas_item_new ( + canvas_group, + gnome_canvas_widget_get_type (), + "widget", button, + NULL); a11y = gtk_widget_get_accessible (button); atk_object_set_name (a11y, _("Previous month")); @@ -203,10 +206,11 @@ e_calendar_init (ECalendar *cal) gtk_widget_show (pixmap); gtk_container_add (GTK_CONTAINER (button), pixmap); - cal->next_item = gnome_canvas_item_new (canvas_group, - gnome_canvas_widget_get_type (), - "widget", button, - NULL); + cal->next_item = gnome_canvas_item_new ( + canvas_group, + gnome_canvas_widget_get_type (), + "widget", button, + NULL); a11y = gtk_widget_get_accessible (button); atk_object_set_name (a11y, _("Next month")); @@ -214,42 +218,50 @@ e_calendar_init (ECalendar *cal) button = gtk_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_widget_show (button); - g_signal_connect_swapped (button, "pressed", - G_CALLBACK (e_calendar_on_prev_year_pressed), cal); - g_signal_connect_swapped (button, "released", - G_CALLBACK (e_calendar_on_prev_year_released), cal); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (e_calendar_on_prev_year_clicked), cal); + g_signal_connect_swapped ( + button, "pressed", + G_CALLBACK (e_calendar_on_prev_year_pressed), cal); + g_signal_connect_swapped ( + button, "released", + G_CALLBACK (e_calendar_on_prev_year_released), cal); + g_signal_connect_swapped ( + button, "clicked", + G_CALLBACK (e_calendar_on_prev_year_clicked), cal); pixmap = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE); gtk_widget_show (pixmap); gtk_container_add (GTK_CONTAINER (button), pixmap); - cal->prev_item_year = gnome_canvas_item_new (canvas_group, - gnome_canvas_widget_get_type (), - "widget", button, - NULL); + cal->prev_item_year = gnome_canvas_item_new ( + canvas_group, + gnome_canvas_widget_get_type (), + "widget", button, + NULL); a11y = gtk_widget_get_accessible (button); atk_object_set_name (a11y, _("Previous year")); button = gtk_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_widget_show (button); - g_signal_connect_swapped (button, "pressed", - G_CALLBACK (e_calendar_on_next_year_pressed), cal); - g_signal_connect_swapped (button, "released", - G_CALLBACK (e_calendar_on_next_year_released), cal); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (e_calendar_on_next_year_clicked), cal); + g_signal_connect_swapped ( + button, "pressed", + G_CALLBACK (e_calendar_on_next_year_pressed), cal); + g_signal_connect_swapped ( + button, "released", + G_CALLBACK (e_calendar_on_next_year_released), cal); + g_signal_connect_swapped ( + button, "clicked", + G_CALLBACK (e_calendar_on_next_year_clicked), cal); pixmap = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE); gtk_widget_show (pixmap); gtk_container_add (GTK_CONTAINER (button), pixmap); - cal->next_item_year = gnome_canvas_item_new (canvas_group, - gnome_canvas_widget_get_type (), - "widget", button, - NULL); + cal->next_item_year = gnome_canvas_item_new ( + canvas_group, + gnome_canvas_widget_get_type (), + "widget", button, + NULL); a11y = gtk_widget_get_accessible (button); atk_object_set_name (a11y, _("Next year")); @@ -396,26 +408,30 @@ e_calendar_size_allocate (GtkWidget *widget, /* Set up Pango prerequisites */ font_desc = gtk_widget_get_style (widget)->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); /* Set the scroll region to its allocated size, if changed. */ - gnome_canvas_get_scroll_region (GNOME_CANVAS (cal), - NULL, NULL, &old_x2, &old_y2); + gnome_canvas_get_scroll_region ( + GNOME_CANVAS (cal), + NULL, NULL, &old_x2, &old_y2); gtk_widget_get_allocation (widget, &old_allocation); new_x2 = old_allocation.width - 1; new_y2 = old_allocation.height - 1; if (old_x2 != new_x2 || old_y2 != new_y2) - gnome_canvas_set_scroll_region (GNOME_CANVAS (cal), - 0, 0, new_x2, new_y2); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (cal), + 0, 0, new_x2, new_y2); /* Take off space for line & buttons if shown. */ - gnome_canvas_item_set (GNOME_CANVAS_ITEM (cal->calitem), - "x1", 0.0, - "y1", 0.0, - "x2", new_x2, - "y2", new_y2, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (cal->calitem), + "x1", 0.0, + "y1", 0.0, + "x2", new_x2, + "y2", new_y2, + NULL); if (cal->calitem->month_width > 0) month_width = cal->calitem->month_width; @@ -436,41 +452,45 @@ e_calendar_size_allocate (GtkWidget *widget, (month_width - 2 * xthickness - E_CALENDAR_ARROW_BUTTON_X_PAD - arrow_button_size) : (xthickness); - gnome_canvas_item_set (cal->prev_item, - "x", current_x, - "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, - "width", arrow_button_size, - "height", arrow_button_size, - NULL); + gnome_canvas_item_set ( + cal->prev_item, + "x", current_x, + "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, + "width", arrow_button_size, + "height", arrow_button_size, + NULL); current_x += (is_rtl ? -1.0 : +1.0) * (cal->calitem->max_month_name_width - xthickness + 2 * arrow_button_size); - gnome_canvas_item_set (cal->next_item, - "x", current_x, - "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, - "width", arrow_button_size, - "height", arrow_button_size, - NULL); + gnome_canvas_item_set ( + cal->next_item, + "x", current_x, + "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, + "width", arrow_button_size, + "height", arrow_button_size, + NULL); current_x = is_rtl ? (xthickness) : (month_width - 2 * xthickness - E_CALENDAR_ARROW_BUTTON_X_PAD - arrow_button_size); - gnome_canvas_item_set (cal->next_item_year, - "x", current_x, - "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, - "width", arrow_button_size, - "height", arrow_button_size, - NULL); + gnome_canvas_item_set ( + cal->next_item_year, + "x", current_x, + "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, + "width", arrow_button_size, + "height", arrow_button_size, + NULL); current_x += (is_rtl ? +1.0 : -1.0) * (cal->calitem->max_digit_width * 5 - xthickness + 2 * arrow_button_size); - gnome_canvas_item_set (cal->prev_item_year, - "x", current_x, - "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, - "width", arrow_button_size, - "height", arrow_button_size, - NULL); + gnome_canvas_item_set ( + cal->prev_item_year, + "x", current_x, + "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, + "width", arrow_button_size, + "height", arrow_button_size, + NULL); pango_font_metrics_unref (font_metrics); } @@ -485,10 +505,11 @@ e_calendar_set_minimum_size (ECalendar *cal, cal->min_rows = rows; cal->min_cols = cols; - gnome_canvas_item_set (GNOME_CANVAS_ITEM (cal->calitem), - "minimum_rows", rows, - "minimum_columns", cols, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (cal->calitem), + "minimum_rows", rows, + "minimum_columns", cols, + NULL); gtk_widget_queue_resize (GTK_WIDGET (cal)); } @@ -503,10 +524,11 @@ e_calendar_set_maximum_size (ECalendar *cal, cal->max_rows = rows; cal->max_cols = cols; - gnome_canvas_item_set (GNOME_CANVAS_ITEM (cal->calitem), - "maximum_rows", rows, - "maximum_columns", cols, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (cal->calitem), + "maximum_rows", rows, + "maximum_columns", cols, + NULL); gtk_widget_queue_resize (GTK_WIDGET (cal)); } @@ -564,9 +586,10 @@ 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, - e_calendar_auto_move_handler, - cal); + cal->timeout_id = g_timeout_add ( + E_CALENDAR_AUTO_MOVE_TIMEOUT, + e_calendar_auto_move_handler, + cal); } cal->timeout_delay = E_CALENDAR_AUTO_MOVE_TIMEOUT_DELAY; cal->moving_forward = moving_forward; @@ -578,9 +601,10 @@ e_calendar_start_auto_move_year (ECalendar *cal, gboolean moving_forward) { if (cal->timeout_id == 0) { - cal->timeout_id = g_timeout_add (E_CALENDAR_AUTO_MOVE_TIMEOUT, - e_calendar_auto_move_year_handler, - cal); + cal->timeout_id = g_timeout_add ( + E_CALENDAR_AUTO_MOVE_TIMEOUT, + e_calendar_auto_move_year_handler, + cal); } cal->timeout_delay = E_CALENDAR_AUTO_MOVE_TIMEOUT_DELAY; cal->moving_forward = moving_forward; @@ -602,8 +626,9 @@ e_calendar_auto_move_year_handler (gpointer data) cal->timeout_delay--; } else { offset = cal->moving_forward ? 12 : -12; - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month + offset); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month + offset); } return TRUE; @@ -625,8 +650,9 @@ e_calendar_auto_move_handler (gpointer data) cal->timeout_delay--; } else { offset = cal->moving_forward ? 1 : -1; - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month + offset); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month + offset); } return TRUE; @@ -668,29 +694,33 @@ e_calendar_stop_auto_move (ECalendar *cal) static void e_calendar_on_prev_clicked (ECalendar *cal) { - e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, - cal->calitem->month - 1); + 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_item_set_first_month (cal->calitem, cal->calitem->year, - cal->calitem->month + 1); + e_calendar_item_set_first_month ( + cal->calitem, cal->calitem->year, + cal->calitem->month + 1); } static void e_calendar_on_prev_year_clicked (ECalendar *cal) { - e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, - cal->calitem->month - 12); + e_calendar_item_set_first_month ( + cal->calitem, cal->calitem->year, + cal->calitem->month - 12); } static void e_calendar_on_next_year_clicked (ECalendar *cal) { - e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, - cal->calitem->month + 12); + e_calendar_item_set_first_month ( + cal->calitem, cal->calitem->year, + cal->calitem->month + 12); } static gint diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index a12a36471d..0b1f05a6b8 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -188,11 +188,12 @@ ecb_draw (GnomeCanvasItem *item, ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); cairo_save (cr); - cairo_set_source_rgba (cr, - ((ecb->priv->rgba >> 24) & 0xff) / 255.0, - ((ecb->priv->rgba >> 16) & 0xff) / 255.0, - ((ecb->priv->rgba >> 8) & 0xff) / 255.0, - ( ecb->priv->rgba & 0xff) / 255.0); + cairo_set_source_rgba ( + cr, + ((ecb->priv->rgba >> 24) & 0xff) / 255.0, + ((ecb->priv->rgba >> 16) & 0xff) / 255.0, + ((ecb->priv->rgba >> 8) & 0xff) / 255.0, + ( ecb->priv->rgba & 0xff) / 255.0); cairo_paint (cr); cairo_restore (cr); } @@ -235,34 +236,44 @@ ecb_class_init (ECanvasBackgroundClass *ecb_class) ecb_class->style_set = ecb_style_set; - g_object_class_install_property (object_class, PROP_FILL_COLOR, - g_param_spec_string ("fill_color", - "Fill color", - "Fill color", - NULL, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_FILL_COLOR_GDK, - g_param_spec_boxed ("fill_color_gdk", - "GDK fill color", - "GDK fill color", - GDK_TYPE_COLOR, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_FILL_COLOR_RGBA, - g_param_spec_uint ("fill_color_rgba", - "GDK fill color", - "GDK fill color", - 0, G_MAXUINT, 0, - G_PARAM_READWRITE)); - - ecb_signals[STYLE_SET] = - g_signal_new ("style_set", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECanvasBackgroundClass, style_set), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, GTK_TYPE_STYLE); + g_object_class_install_property ( + object_class, + PROP_FILL_COLOR, + g_param_spec_string ( + "fill_color", + "Fill color", + "Fill color", + NULL, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_FILL_COLOR_GDK, + g_param_spec_boxed ( + "fill_color_gdk", + "GDK fill color", + "GDK fill color", + GDK_TYPE_COLOR, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_FILL_COLOR_RGBA, + g_param_spec_uint ( + "fill_color_rgba", + "GDK fill color", + "GDK fill color", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE)); + + ecb_signals[STYLE_SET] = g_signal_new ( + "style_set", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECanvasBackgroundClass, style_set), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_STYLE); } diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c index 888563c0d8..1767c1ac14 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/widgets/misc/e-canvas-vbox.c @@ -82,30 +82,42 @@ e_canvas_vbox_class_init (ECanvasVboxClass *class) item_class->event = e_canvas_vbox_event; item_class->realize = e_canvas_vbox_realize; - g_object_class_install_property (object_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - "Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH, - g_param_spec_double ("minimum_width", - "Minimum width", - "Minimum Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - "Height", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READABLE)); - g_object_class_install_property (object_class, PROP_SPACING, - g_param_spec_double ("spacing", - "Spacing", - "Spacing", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + "Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_MINIMUM_WIDTH, + g_param_spec_double ( + "minimum_width", + "Minimum width", + "Minimum Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + "Height", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE)); + g_object_class_install_property ( + object_class, + PROP_SPACING, + g_param_spec_double ( + "spacing", + "Spacing", + "Spacing", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); } static void @@ -187,10 +199,11 @@ disconnect_item_cb (gpointer data, vbox = E_CANVAS_VBOX (user_data); item = GNOME_CANVAS_ITEM (data); - g_signal_handlers_disconnect_matched (item, - G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, - vbox); + g_signal_handlers_disconnect_matched ( + item, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, + vbox); } static void @@ -268,12 +281,14 @@ 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), - e_canvas_vbox_remove_item, e_canvas_vbox); + g_object_weak_ref ( + G_OBJECT (item), + e_canvas_vbox_remove_item, e_canvas_vbox); if (GNOME_CANVAS_ITEM (e_canvas_vbox)->flags & GNOME_CANVAS_ITEM_REALIZED) { - gnome_canvas_item_set (item, - "width", (gdouble) e_canvas_vbox->minimum_width, - NULL); + gnome_canvas_item_set ( + item, + "width", (gdouble) e_canvas_vbox->minimum_width, + NULL); e_canvas_item_request_reflow (item); } } @@ -283,12 +298,14 @@ 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), - e_canvas_vbox_remove_item, e_canvas_vbox); + g_object_weak_ref ( + G_OBJECT (item), + e_canvas_vbox_remove_item, e_canvas_vbox); if (GNOME_CANVAS_ITEM (e_canvas_vbox)->flags & GNOME_CANVAS_ITEM_REALIZED) { - gnome_canvas_item_set (item, - "width", (gdouble) e_canvas_vbox->minimum_width, - NULL); + gnome_canvas_item_set ( + item, + "width", (gdouble) e_canvas_vbox->minimum_width, + NULL); e_canvas_item_request_reflow (item); } } @@ -302,9 +319,10 @@ e_canvas_vbox_resize_children (GnomeCanvasItem *item) e_canvas_vbox = E_CANVAS_VBOX (item); for (list = e_canvas_vbox->items; list; list = list->next) { GnomeCanvasItem *child = GNOME_CANVAS_ITEM (list->data); - gnome_canvas_item_set (child, - "width", (gdouble) e_canvas_vbox->minimum_width, - NULL); + gnome_canvas_item_set ( + child, + "width", (gdouble) e_canvas_vbox->minimum_width, + NULL); } } @@ -333,13 +351,15 @@ e_canvas_vbox_reflow (GnomeCanvasItem *item, gdouble item_width; list = e_canvas_vbox->items; - g_object_get (list->data, - "height", &item_height, - "width", &item_width, - NULL); - e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (list->data), - (gdouble) 0, - (gdouble) running_height); + g_object_get ( + list->data, + "height", &item_height, + "width", &item_width, + NULL); + e_canvas_item_move_absolute ( + GNOME_CANVAS_ITEM (list->data), + (gdouble) 0, + (gdouble) running_height); running_height += item_height; if (max_width < item_width) max_width = item_width; @@ -348,14 +368,16 @@ e_canvas_vbox_reflow (GnomeCanvasItem *item, for (; list; list = g_list_next (list)) { running_height += e_canvas_vbox->spacing; - g_object_get (list->data, - "height", &item_height, - "width", &item_width, - NULL); + g_object_get ( + list->data, + "height", &item_height, + "width", &item_width, + NULL); - e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (list->data), - (gdouble) 0, - (gdouble) running_height); + e_canvas_item_move_absolute ( + GNOME_CANVAS_ITEM (list->data), + (gdouble) 0, + (gdouble) running_height); running_height += item_height; if (max_width < item_width) diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 8cd1338db6..e2e9ddd0cc 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -356,7 +356,7 @@ canvas_style_set_recursive (GnomeCanvasItem *item, } } - if (GNOME_IS_CANVAS_GROUP (item) ) { + if (GNOME_IS_CANVAS_GROUP (item)) { GList *items = GNOME_CANVAS_GROUP (item)->item_list; for (; items; items = items->next) canvas_style_set_recursive ( @@ -379,8 +379,9 @@ canvas_dispose (GObject *object) if (canvas->toplevel) { if (canvas->visibility_notify_id) - g_signal_handler_disconnect (canvas->toplevel, - canvas->visibility_notify_id); + g_signal_handler_disconnect ( + canvas->toplevel, + canvas->visibility_notify_id); canvas->visibility_notify_id = 0; g_object_unref (canvas->toplevel); @@ -454,11 +455,12 @@ canvas_button_event (GtkWidget *widget, canvas = GNOME_CANVAS (widget); bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (canvas)); - d (g_print ("button %d, event type %d, grabbed=%p, current=%p\n", - event->button, - event->type, - canvas->grabbed_item, - canvas->current_item)); + d ( + g_print ("button %d, event type %d, grabbed=%p, current=%p\n", + event->button, + event->type, + canvas->grabbed_item, + canvas->current_item)); /* dispatch normally regardless of the event's window if an item has has a pointer grab in effect */ @@ -709,8 +711,9 @@ e_canvas_item_invoke_reflow (GnomeCanvasItem *item, if (item->flags & E_CANVAS_ITEM_NEEDS_REFLOW) { ECanvasItemReflowFunc func; func = (ECanvasItemReflowFunc) - g_object_get_data (G_OBJECT (item), - "ECanvasItem::reflow_callback"); + g_object_get_data ( + G_OBJECT (item), + "ECanvasItem::reflow_callback"); if (func) func (item, flags); } diff --git a/widgets/misc/e-contact-map-window.c b/widgets/misc/e-contact-map-window.c index 2d31cc8592..2e3aec5bcb 100644 --- a/widgets/misc/e-contact-map-window.c +++ b/widgets/misc/e-contact-map-window.c @@ -136,10 +136,12 @@ zoom_level_changed_cb (ChamplainView *view, EContactMapWindow *window = user_data; gint zoom_level = champlain_view_get_zoom_level (view); - gtk_widget_set_sensitive (window->priv->zoom_in_btn, + gtk_widget_set_sensitive ( + window->priv->zoom_in_btn, (zoom_level < champlain_view_get_max_zoom_level (view))); - gtk_widget_set_sensitive (window->priv->zoom_out_btn, + gtk_widget_set_sensitive ( + window->priv->zoom_out_btn, (zoom_level > champlain_view_get_min_zoom_level (view))); } @@ -158,11 +160,13 @@ map_contact_added_cb (EContactMap *map, name = champlain_label_get_text (CHAMPLAIN_LABEL (marker)); - g_hash_table_insert (priv->hash_table, + g_hash_table_insert ( + priv->hash_table, g_strdup (name), marker); gtk_list_store_append (priv->completion_model, &iter); - gtk_list_store_set (priv->completion_model, &iter, + gtk_list_store_set ( + priv->completion_model, &iter, 0, name, -1); g_signal_connect ( @@ -236,8 +240,9 @@ contact_map_window_find_contact_cb (GtkButton *button, EContactMapWindowPrivate *priv = E_CONTACT_MAP_WINDOW (user_data)->priv; ClutterActor *marker; - marker = g_hash_table_lookup (priv->hash_table, - gtk_entry_get_text (GTK_ENTRY (priv->search_entry))); + marker = g_hash_table_lookup ( + priv->hash_table, + gtk_entry_get_text (GTK_ENTRY (priv->search_entry))); if (marker) e_contact_map_zoom_on_marker (priv->map, marker); @@ -349,8 +354,11 @@ e_contact_map_window_init (EContactMapWindow *window) priv->tasks_cnt = 0; - hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, NULL); + hash_table = g_hash_table_new_full ( + (GHashFunc) g_str_hash, + (GEqualFunc) g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) NULL); priv->hash_table = hash_table; gtk_window_set_title (GTK_WINDOW (window), _("Contacts Map")); diff --git a/widgets/misc/e-contact-map.c b/widgets/misc/e-contact-map.c index 38ca2d9609..3ad17b441f 100644 --- a/widgets/misc/e-contact-map.c +++ b/widgets/misc/e-contact-map.c @@ -266,7 +266,8 @@ e_contact_map_init (EContactMap *map) map->priv = E_CONTACT_MAP_GET_PRIVATE (map); - hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, + hash_table = g_hash_table_new_full ( + g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL); map->priv->markers = hash_table; diff --git a/widgets/misc/e-contact-marker.c b/widgets/misc/e-contact-marker.c index 98f1ea1cd4..9ac9417c9f 100644 --- a/widgets/misc/e-contact-marker.c +++ b/widgets/misc/e-contact-marker.c @@ -106,7 +106,8 @@ texture_new_from_pixbuf (GdkPixbuf *pixbuf, rowstride = gdk_pixbuf_get_rowstride (pixbuf); texture = clutter_texture_new (); - success = clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (texture), + success = clutter_texture_set_from_rgb_data ( + CLUTTER_TEXTURE (texture), data, has_alpha, width, height, rowstride, (has_alpha ? 4: 3), flags, NULL); @@ -227,7 +228,8 @@ draw_shadow (EContactMarker *marker, clutter_container_add_actor (CLUTTER_CONTAINER (priv->content_group), shadow); if (priv->shadow != NULL) { - clutter_container_remove_actor (CLUTTER_CONTAINER (priv->content_group), + clutter_container_remove_actor ( + CLUTTER_CONTAINER (priv->content_group), priv->shadow); } @@ -263,7 +265,8 @@ draw_background (EContactMarker *marker, clutter_color_darken (color, &darker_color); - cairo_set_source_rgba (cr, + cairo_set_source_rgba ( + cr, color->red / 255.0, color->green / 255.0, color->blue / 255.0, @@ -271,7 +274,8 @@ draw_background (EContactMarker *marker, cairo_fill_preserve (cr); cairo_set_line_width (cr, 1.0); - cairo_set_source_rgba (cr, + cairo_set_source_rgba ( + cr, darker_color.red / 255.0, darker_color.green / 255.0, darker_color.blue / 255.0, @@ -282,7 +286,8 @@ draw_background (EContactMarker *marker, clutter_container_add_actor (CLUTTER_CONTAINER (priv->content_group), bg); if (priv->background != NULL) { - clutter_container_remove_actor (CLUTTER_CONTAINER (priv->content_group), + clutter_container_remove_actor ( + CLUTTER_CONTAINER (priv->content_group), priv->background); } @@ -307,33 +312,41 @@ draw_marker (EContactMarker *marker) } if (priv->text_actor == NULL) { - priv->text_actor = clutter_text_new_with_text ("Serif 8", - champlain_label_get_text (label)); + priv->text_actor = clutter_text_new_with_text ( + "Serif 8", + champlain_label_get_text (label)); champlain_label_set_font_name (label, "Serif 8"); } text = CLUTTER_TEXT (priv->text_actor); - clutter_text_set_text (text, + clutter_text_set_text ( + text, champlain_label_get_text (label)); - clutter_text_set_font_name (text, + clutter_text_set_font_name ( + text, champlain_label_get_font_name (label)); clutter_text_set_line_alignment (text, PANGO_ALIGN_CENTER); clutter_text_set_line_wrap (text, TRUE); clutter_text_set_line_wrap_mode (text, PANGO_WRAP_WORD); - clutter_text_set_ellipsize (text, + clutter_text_set_ellipsize ( + text, champlain_label_get_ellipsize (label)); - clutter_text_set_attributes (text, + clutter_text_set_attributes ( + text, champlain_label_get_attributes (label)); - clutter_text_set_use_markup (text, + clutter_text_set_use_markup ( + text, champlain_label_get_use_markup (label)); if (priv->image) { - clutter_actor_set_width (priv->text_actor, + 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; - clutter_actor_set_position (priv->text_actor, PADDING, + clutter_actor_set_position ( + priv->text_actor, PADDING, clutter_actor_get_height (priv->image) + 2 *PADDING + 3); } else { total_height = clutter_actor_get_height (priv->text_actor) + 2 *PADDING; @@ -345,8 +358,9 @@ draw_marker (EContactMarker *marker) if (height > total_height) total_height = height; - clutter_text_set_color (CLUTTER_TEXT (priv->text_actor), - (champlain_marker_get_selected (CHAMPLAIN_MARKER (marker)) ? + clutter_text_set_color ( + CLUTTER_TEXT (priv->text_actor), + (champlain_marker_get_selected (CHAMPLAIN_MARKER (marker)) ? champlain_marker_get_selection_text_color () : champlain_label_get_text_color (CHAMPLAIN_LABEL (marker)))); if (clutter_actor_get_parent (priv->text_actor) == NULL) @@ -390,7 +404,8 @@ queue_redraw (EContactMarker *marker) EContactMarkerPrivate *priv = marker->priv; if (!priv->redraw_id) { - priv->redraw_id = g_idle_add_full (G_PRIORITY_DEFAULT, + priv->redraw_id = g_idle_add_full ( + G_PRIORITY_DEFAULT, (GSourceFunc) redraw_on_idle, g_object_ref (marker), (GDestroyNotify) g_object_unref); @@ -457,7 +472,8 @@ pick (ClutterActor *self, cogl_path_new (); - cogl_set_source_color4ub (color->red, + cogl_set_source_color4ub ( + color->red, color->green, color->blue, color->alpha); diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 7418a7f4a9..45c4f7148b 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -541,8 +541,9 @@ create_children (EDateEdit *dedit) g_signal_connect ( priv->date_button, "clicked", G_CALLBACK (on_date_button_clicked), dedit); - gtk_box_pack_start (GTK_BOX (dedit), priv->date_button, - FALSE, FALSE, 0); + gtk_box_pack_start ( + GTK_BOX (dedit), priv->date_button, + FALSE, FALSE, 0); a11y = gtk_widget_get_accessible (priv->date_button); atk_object_set_description (a11y, _("Click this button to show a calendar")); atk_object_set_name (a11y, _("Date")); @@ -618,11 +619,13 @@ create_children (EDateEdit *dedit) gtk_widget_show (priv->space); priv->cal_popup = gtk_window_new (GTK_WINDOW_POPUP); - gtk_window_set_type_hint (GTK_WINDOW (priv->cal_popup), - GDK_WINDOW_TYPE_HINT_COMBO); - gtk_widget_set_events (priv->cal_popup, - gtk_widget_get_events (priv->cal_popup) - | GDK_KEY_PRESS_MASK); + gtk_window_set_type_hint ( + GTK_WINDOW (priv->cal_popup), + GDK_WINDOW_TYPE_HINT_COMBO); + gtk_widget_set_events ( + priv->cal_popup, + gtk_widget_get_events (priv->cal_popup) + | GDK_KEY_PRESS_MASK); g_signal_connect ( priv->cal_popup, "delete_event", G_CALLBACK (on_date_popup_delete_event), dedit); @@ -645,10 +648,11 @@ create_children (EDateEdit *dedit) priv->calendar = e_calendar_new (); calendar = E_CALENDAR (priv->calendar); - gnome_canvas_item_set (GNOME_CANVAS_ITEM (calendar->calitem), - "maximum_days_selected", 1, - "move_selection_when_moving", FALSE, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (calendar->calitem), + "maximum_days_selected", 1, + "move_selection_when_moving", FALSE, + NULL); g_signal_connect ( calendar->calitem, "selection_changed", @@ -813,10 +817,12 @@ e_date_edit_set_time (EDateEdit *dedit, priv = dedit->priv; if (the_time == -1) { - date_changed = e_date_edit_set_date_internal (dedit, TRUE, - TRUE, 0, 0, 0); - time_changed = e_date_edit_set_time_internal (dedit, TRUE, - TRUE, 0, 0); + date_changed = e_date_edit_set_date_internal ( + dedit, TRUE, + TRUE, 0, 0, 0); + time_changed = e_date_edit_set_time_internal ( + dedit, TRUE, + TRUE, 0, 0); } else { if (the_time == 0) { if (priv->time_callback) { @@ -829,15 +835,17 @@ e_date_edit_set_time (EDateEdit *dedit, tmp_tm = *localtime (&the_time); } - date_changed = e_date_edit_set_date_internal (dedit, TRUE, - FALSE, - tmp_tm.tm_year, - tmp_tm.tm_mon, - tmp_tm.tm_mday); - time_changed = e_date_edit_set_time_internal (dedit, TRUE, - FALSE, - tmp_tm.tm_hour, - tmp_tm.tm_min); + date_changed = e_date_edit_set_date_internal ( + dedit, TRUE, + FALSE, + tmp_tm.tm_year, + tmp_tm.tm_mon, + tmp_tm.tm_mday); + time_changed = e_date_edit_set_time_internal ( + dedit, TRUE, + FALSE, + tmp_tm.tm_hour, + tmp_tm.tm_min); } e_date_edit_update_date_entry (dedit); @@ -904,9 +912,10 @@ e_date_edit_set_date (EDateEdit *dedit, g_return_if_fail (E_IS_DATE_EDIT (dedit)); - date_changed = e_date_edit_set_date_internal (dedit, TRUE, FALSE, - year - 1900, month - 1, - day); + date_changed = e_date_edit_set_date_internal ( + dedit, TRUE, FALSE, + year - 1900, month - 1, + day); e_date_edit_update_date_entry (dedit); e_date_edit_update_time_combo_state (dedit); @@ -1004,10 +1013,12 @@ e_date_edit_set_date_and_time_of_day (EDateEdit *dedit, g_return_if_fail (E_IS_DATE_EDIT (dedit)); - date_changed = e_date_edit_set_date_internal (dedit, TRUE, FALSE, - year - 1900, month - 1, day); - time_changed = e_date_edit_set_time_internal (dedit, TRUE, FALSE, - hour, minute); + date_changed = e_date_edit_set_date_internal ( + dedit, TRUE, FALSE, + year - 1900, month - 1, day); + time_changed = e_date_edit_set_time_internal ( + dedit, TRUE, FALSE, + hour, minute); e_date_edit_update_date_entry (dedit); e_date_edit_update_time_entry (dedit); @@ -1050,7 +1061,7 @@ e_date_edit_set_show_date (EDateEdit *dedit, priv = dedit->priv; - if ((priv->show_date ? 1 : 0) == (show_date ? 1 : 0)) + if (priv->show_date == show_date) return; priv->show_date = show_date; @@ -1107,7 +1118,7 @@ e_date_edit_set_show_time (EDateEdit *dedit, priv = dedit->priv; - if ((priv->show_time ? 1 : 0) == (show_time ? 1 : 0)) + if (priv->show_time == show_time) return; priv->show_time = show_time; @@ -1250,7 +1261,7 @@ e_date_edit_set_use_24_hour_format (EDateEdit *dedit, { g_return_if_fail (E_IS_DATE_EDIT (dedit)); - if ((dedit->priv->use_24_hour_format ? 1 : 0) == (use_24_hour_format ? 1 : 0)) + if (dedit->priv->use_24_hour_format == use_24_hour_format) return; dedit->priv->use_24_hour_format = use_24_hour_format; @@ -1278,7 +1289,7 @@ e_date_edit_set_allow_no_date_set (EDateEdit *dedit, { g_return_if_fail (E_IS_DATE_EDIT (dedit)); - if ((dedit->priv->allow_no_date_set ? 1 : 0) == (allow_no_date_set ? 1 : 0)) + if (dedit->priv->allow_no_date_set == allow_no_date_set) return; dedit->priv->allow_no_date_set = allow_no_date_set; @@ -1369,10 +1380,12 @@ e_date_edit_show_date_popup (EDateEdit *dedit) e_calendar_item_set_selection (calendar->calitem, NULL, NULL); } else { g_date_clear (&selected_day, 1); - g_date_set_dmy (&selected_day, mtm.tm_mday, mtm.tm_mon + 1, - mtm.tm_year + 1900); - e_calendar_item_set_selection (calendar->calitem, - &selected_day, NULL); + g_date_set_dmy ( + &selected_day, mtm.tm_mday, mtm.tm_mon + 1, + mtm.tm_year + 1900); + e_calendar_item_set_selection ( + calendar->calitem, + &selected_day, NULL); } /* FIXME: Hack. Change ECalendarItem so it doesn't queue signal @@ -1450,9 +1463,10 @@ on_date_popup_date_selected (ECalendarItem *calitem, if (!e_calendar_item_get_selection (calitem, &start_date, &end_date)) return; - e_date_edit_set_date (dedit, g_date_get_year (&start_date), - g_date_get_month (&start_date), - g_date_get_day (&start_date)); + e_date_edit_set_date ( + dedit, g_date_get_year (&start_date), + g_date_get_month (&start_date), + g_date_get_day (&start_date)); } static void @@ -1482,8 +1496,9 @@ on_date_popup_today_button_clicked (GtkWidget *button, tmp_tm = *localtime (&t); } - e_date_edit_set_date (dedit, tmp_tm.tm_year + 1900, - tmp_tm.tm_mon + 1, tmp_tm.tm_mday); + e_date_edit_set_date ( + dedit, tmp_tm.tm_year + 1900, + tmp_tm.tm_mon + 1, tmp_tm.tm_mday); } static void @@ -1728,8 +1743,8 @@ on_date_entry_key_press (GtkWidget *widget, if (event->state & GDK_MOD1_MASK && (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down || event->keyval == GDK_KEY_Return)) { - g_signal_stop_emission_by_name (widget, - "key_press_event"); + g_signal_stop_emission_by_name ( + widget, "key_press_event"); e_date_edit_show_date_popup (dedit); return TRUE; } @@ -1769,7 +1784,8 @@ 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 (event->keyval == GDK_KEY_Return) { - g_signal_stop_emission_by_name (widget, + g_signal_stop_emission_by_name ( + widget, "key_press_event"); e_date_edit_check_time_changed (dedit); return TRUE; @@ -1793,7 +1809,8 @@ on_time_entry_key_release (GtkWidget *widget, EDateEdit *dedit) { if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down) { - g_signal_stop_emission_by_name (widget, + g_signal_stop_emission_by_name ( + widget, "key_release_event"); e_date_edit_check_time_changed (dedit); return TRUE; @@ -1817,11 +1834,12 @@ on_date_entry_focus_out (GtkEntry *entry, e_date_edit_check_date_changed (dedit); if (!e_date_edit_date_is_valid (dedit)) { - msg_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_OK, - "%s", _("Invalid Date Value")); + msg_dialog = gtk_message_dialog_new ( + NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", _("Invalid Date Value")); gtk_dialog_run (GTK_DIALOG (msg_dialog)); gtk_widget_destroy (msg_dialog); e_date_edit_get_date ( @@ -1861,11 +1879,12 @@ on_time_entry_focus_out (GtkEntry *entry, e_date_edit_check_time_changed (dedit); if (!e_date_edit_time_is_valid (dedit)) { - msg_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_OK, - "%s", _("Invalid Time Value")); + msg_dialog = gtk_message_dialog_new ( + NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", _("Invalid Time Value")); gtk_dialog_run (GTK_DIALOG (msg_dialog)); gtk_widget_destroy (msg_dialog); e_date_edit_set_time (dedit,e_date_edit_get_time (dedit)); @@ -1892,8 +1911,8 @@ add_relation (EDateEdit *dedit, set = atk_object_ref_relation_set (a11yWidget); if (set != NULL) { - relation = atk_relation_set_get_relation_by_type (set, - ATK_RELATION_LABELLED_BY); + relation = atk_relation_set_get_relation_by_type ( + set, ATK_RELATION_LABELLED_BY); /* check whether has a labelled_by relation already */ if (relation != NULL) return; @@ -1903,13 +1922,14 @@ add_relation (EDateEdit *dedit, if (!set) return; - relation = atk_relation_set_get_relation_by_type (set, - ATK_RELATION_LABELLED_BY); + relation = atk_relation_set_get_relation_by_type ( + set, ATK_RELATION_LABELLED_BY); if (relation != NULL) { target = atk_relation_get_target (relation); target_object = g_ptr_array_index (target, 0); if (ATK_IS_OBJECT (target_object)) { - atk_object_add_relationship (a11yWidget, + atk_object_add_relationship ( + a11yWidget, ATK_RELATION_LABELLED_BY, ATK_OBJECT (target_object)); } @@ -2127,10 +2147,11 @@ e_date_edit_check_date_changed (EDateEdit *dedit) tmp_tm.tm_mday = 0; } - date_changed = e_date_edit_set_date_internal (dedit, valid, none, - tmp_tm.tm_year, - tmp_tm.tm_mon, - tmp_tm.tm_mday); + date_changed = e_date_edit_set_date_internal ( + dedit, valid, none, + tmp_tm.tm_year, + tmp_tm.tm_mon, + tmp_tm.tm_mday); if (date_changed) { priv->has_been_changed = TRUE; @@ -2161,9 +2182,10 @@ e_date_edit_check_time_changed (EDateEdit *dedit) else if (!e_date_edit_parse_time (dedit, time_text, &tmp_tm)) valid = FALSE; - time_changed = e_date_edit_set_time_internal (dedit, valid, none, - tmp_tm.tm_hour, - tmp_tm.tm_min); + time_changed = e_date_edit_set_time_internal ( + dedit, valid, none, + tmp_tm.tm_hour, + tmp_tm.tm_min); if (time_changed) { e_date_edit_update_time_entry (dedit); diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index 75cee65e3c..9e06324ab6 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -914,7 +914,8 @@ prepare_simple_page (GtkAssistant *assistant, gchar *title; /* only one importer found, make it even simpler */ - gtk_label_set_text (GTK_LABEL (page->actionlabel), + gtk_label_set_text ( + GTK_LABEL (page->actionlabel), page->has_preview ? _("Preview data to be imported") : _("Choose the destination for this import")); @@ -931,7 +932,7 @@ prepare_simple_page (GtkAssistant *assistant, gtk_label_set_text ( GTK_LABEL (page->actionlabel), _("Select what type of file you " - "want to import from the list.")); + "want to import from the list.")); gtk_widget_show (page->filetypetable); diff --git a/widgets/misc/e-mail-signature-manager.c b/widgets/misc/e-mail-signature-manager.c index 56237541dd..66463336ea 100644 --- a/widgets/misc/e-mail-signature-manager.c +++ b/widgets/misc/e-mail-signature-manager.c @@ -691,7 +691,7 @@ e_mail_signature_manager_set_prefer_html (EMailSignatureManager *manager, { g_return_if_fail (E_IS_MAIL_SIGNATURE_MANAGER (manager)); - if ((manager->priv->prefer_html ? 1 : 0) == (prefer_html ? 1 : 0)) + if (manager->priv->prefer_html == prefer_html) return; manager->priv->prefer_html = prefer_html; diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index d35988cb50..40fe589a8c 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -342,9 +342,10 @@ e_map_tweens_compute_matrix (EMap *map, } gtk_widget_get_allocation (GTK_WIDGET (map), &allocation); - cairo_matrix_init_translate (matrix, - allocation.width / 2.0, - allocation.height / 2.0); + cairo_matrix_init_translate ( + matrix, + allocation.width / 2.0, + allocation.height / 2.0); e_map_world_to_render_surface (map, longitude, latitude, &x, &y); cairo_matrix_scale (matrix, zoom, zoom); @@ -385,7 +386,8 @@ e_map_set_hadjustment_values (EMap *map) old_value = gtk_adjustment_get_value (adj); new_upper = MAX (allocation.width, gdk_pixbuf_get_width (priv->map_pixbuf)); - g_object_set (adj, + g_object_set ( + adj, "lower", 0.0, "upper", new_upper, "page-size", (gdouble) allocation.height, @@ -413,7 +415,8 @@ e_map_set_vadjustment_values (EMap *map) old_value = gtk_adjustment_get_value (adj); new_upper = MAX (allocation.height, gdk_pixbuf_get_height (priv->map_pixbuf)); - g_object_set (adj, + g_object_set ( + adj, "lower", 0.0, "upper", new_upper, "page-size", (gdouble) allocation.height, @@ -1305,11 +1308,12 @@ update_render_point (EMap *map, cairo_mask_surface (cr, mask, px - 2, py - 2); cairo_surface_destroy (mask); - cairo_set_source_rgba (cr, - ((point->rgba >> 24) & 0xff) / 255.0, - ((point->rgba >> 16) & 0xff) / 255.0, - ((point->rgba >> 8) & 0xff) / 255.0, - ( point->rgba & 0xff) / 255.0); + cairo_set_source_rgba ( + cr, + ((point->rgba >> 24) & 0xff) / 255.0, + ((point->rgba >> 16) & 0xff) / 255.0, + ((point->rgba >> 8) & 0xff) / 255.0, + ( point->rgba & 0xff) / 255.0); mask = cairo_image_surface_create_for_data (mask2, CAIRO_FORMAT_A8, 3, 3, 4); cairo_mask_surface (cr, mask, px - 1, py - 1); cairo_surface_destroy (mask); @@ -1330,9 +1334,10 @@ repaint_point (EMap *map, e_map_world_to_window (map, point->longitude, point->latitude, &px, &py); - gtk_widget_queue_draw_area (GTK_WIDGET (map), - (gint) px - 2, (gint) py - 2, - 5, 5); + gtk_widget_queue_draw_area ( + GTK_WIDGET (map), + (gint) px - 2, (gint) py - 2, + 5, 5); } static void @@ -1407,18 +1412,20 @@ set_scroll_area (EMap *view, priv->xofs = CLAMP (priv->xofs, 0, width - allocation.width); priv->yofs = CLAMP (priv->yofs, 0, height - allocation.height); - gtk_adjustment_configure (priv->hadjustment, - priv->xofs, - 0, width, - SCROLL_STEP_SIZE, - allocation.width / 2, - allocation.width); - gtk_adjustment_configure (priv->vadjustment, - priv->yofs, - 0, height, - SCROLL_STEP_SIZE, - allocation.height / 2, - allocation.height); + gtk_adjustment_configure ( + priv->hadjustment, + priv->xofs, + 0, width, + SCROLL_STEP_SIZE, + allocation.width / 2, + allocation.width); + gtk_adjustment_configure ( + priv->vadjustment, + priv->yofs, + 0, height, + SCROLL_STEP_SIZE, + allocation.height / 2, + allocation.height); g_object_thaw_notify (G_OBJECT (priv->hadjustment)); g_object_thaw_notify (G_OBJECT (priv->vadjustment)); diff --git a/widgets/misc/e-online-button.c b/widgets/misc/e-online-button.c index 41b81f4b94..a3921a779f 100644 --- a/widgets/misc/e-online-button.c +++ b/widgets/misc/e-online-button.c @@ -190,7 +190,7 @@ e_online_button_set_online (EOnlineButton *button, g_return_if_fail (E_IS_ONLINE_BUTTON (button)); - if ((button->priv->online ? 1 : 0) == (online ? 1 : 0)) + if (button->priv->online == online) return; button->priv->online = online; diff --git a/widgets/misc/e-picture-gallery.c b/widgets/misc/e-picture-gallery.c index dc455400b3..40e621b1ca 100644 --- a/widgets/misc/e-picture-gallery.c +++ b/widgets/misc/e-picture-gallery.c @@ -66,7 +66,8 @@ update_file_iter (GtkListStore *list_store, uri = g_file_get_uri (file); - file_info = g_file_query_info (file, + file_info = g_file_query_info ( + file, G_FILE_ATTRIBUTE_THUMBNAIL_PATH "," G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "," G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," @@ -111,7 +112,8 @@ update_file_iter (GtkListStore *list_store, } res = TRUE; - gtk_list_store_set (list_store, iter, + gtk_list_store_set ( + list_store, iter, COL_PIXBUF, pixbuf, COL_URI, uri, COL_FILENAME_TEXT, filename_text ? filename_text : filename, @@ -165,7 +167,8 @@ find_file_uri (GtkListStore *list_store, do { gchar *iter_uri = NULL; - gtk_tree_model_get (model, iter, + gtk_tree_model_get ( + model, iter, COL_URI, &iter_uri, -1); diff --git a/widgets/misc/e-popup-action.c b/widgets/misc/e-popup-action.c index f5d8445d77..27c90f67c3 100644 --- a/widgets/misc/e-popup-action.c +++ b/widgets/misc/e-popup-action.c @@ -139,7 +139,7 @@ popup_action_set_use_action_appearance (EPopupAction *popup_action, GtkActivatable *activatable; GtkAction *related_action; - if ((popup_action->priv->use_action_appearance ? 1 : 0) == (use_action_appearance ? 1 : 0)) + if (popup_action->priv->use_action_appearance == use_action_appearance) return; popup_action->priv->use_action_appearance = use_action_appearance; diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c index 741cd74fd8..83c5ed0fd6 100644 --- a/widgets/misc/e-preferences-window.c +++ b/widgets/misc/e-preferences-window.c @@ -595,7 +595,8 @@ e_preferences_window_setup (EPreferencesWindow *window) gtk_scrolled_window_set_policy (scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (scrolled, GTK_SHADOW_NONE); - gtk_viewport_set_shadow_type (GTK_VIEWPORT (gtk_bin_get_child (GTK_BIN (scrolled))), + gtk_viewport_set_shadow_type ( + GTK_VIEWPORT (gtk_bin_get_child (GTK_BIN (scrolled))), GTK_SHADOW_NONE); gtk_widget_show (content); diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c index 29c85c5b29..2e98143b1a 100644 --- a/widgets/misc/e-printable.c +++ b/widgets/misc/e-printable.c @@ -53,53 +53,64 @@ e_printable_class_init (EPrintableClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - e_printable_signals[PRINT_PAGE] = - g_signal_new ("print_page", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, print_page), - NULL, NULL, - e_marshal_NONE__OBJECT_DOUBLE_DOUBLE_BOOLEAN, - G_TYPE_NONE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE, - G_TYPE_DOUBLE, G_TYPE_BOOLEAN); - - e_printable_signals[DATA_LEFT] = - g_signal_new ("data_left", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, data_left), - NULL, NULL, - e_marshal_BOOLEAN__NONE, - G_TYPE_BOOLEAN, 0, G_TYPE_NONE); - - e_printable_signals[RESET] = - g_signal_new ("reset", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, reset), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0, G_TYPE_NONE); - - e_printable_signals[HEIGHT] = - g_signal_new ("height", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, height), - NULL, NULL, - e_marshal_DOUBLE__OBJECT_DOUBLE_DOUBLE_BOOLEAN, - G_TYPE_DOUBLE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE, - G_TYPE_DOUBLE, G_TYPE_BOOLEAN); - - e_printable_signals[WILL_FIT] = - g_signal_new ("will_fit", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, will_fit), - NULL, NULL, - e_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLE_BOOLEAN, - G_TYPE_BOOLEAN, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE, - G_TYPE_DOUBLE, G_TYPE_BOOLEAN); + e_printable_signals[PRINT_PAGE] = g_signal_new ( + "print_page", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, print_page), + NULL, NULL, + e_marshal_NONE__OBJECT_DOUBLE_DOUBLE_BOOLEAN, + G_TYPE_NONE, 4, + G_TYPE_OBJECT, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + G_TYPE_BOOLEAN); + + e_printable_signals[DATA_LEFT] = g_signal_new ( + "data_left", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, data_left), + NULL, NULL, + e_marshal_BOOLEAN__NONE, + G_TYPE_BOOLEAN, 0, + G_TYPE_NONE); + + e_printable_signals[RESET] = g_signal_new ( + "reset", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, reset), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, + G_TYPE_NONE); + + e_printable_signals[HEIGHT] = g_signal_new ( + "height", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, height), + NULL, NULL, + e_marshal_DOUBLE__OBJECT_DOUBLE_DOUBLE_BOOLEAN, + G_TYPE_DOUBLE, 4, + G_TYPE_OBJECT, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + G_TYPE_BOOLEAN); + + e_printable_signals[WILL_FIT] = g_signal_new ( + "will_fit", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, will_fit), + NULL, NULL, + e_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLE_BOOLEAN, + G_TYPE_BOOLEAN, 4, + G_TYPE_OBJECT, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + G_TYPE_BOOLEAN); class->print_page = NULL; class->data_left = NULL; @@ -130,12 +141,13 @@ e_printable_print_page (EPrintable *e_printable, g_return_if_fail (e_printable != NULL); g_return_if_fail (E_IS_PRINTABLE (e_printable)); - g_signal_emit (e_printable, - e_printable_signals[PRINT_PAGE], 0, - context, - width, - height, - quantized); + g_signal_emit ( + e_printable, + e_printable_signals[PRINT_PAGE], 0, + context, + width, + height, + quantized); } gboolean @@ -146,9 +158,10 @@ e_printable_data_left (EPrintable *e_printable) g_return_val_if_fail (e_printable != NULL, FALSE); g_return_val_if_fail (E_IS_PRINTABLE (e_printable), FALSE); - g_signal_emit (e_printable, - e_printable_signals[DATA_LEFT], 0, - &ret_val); + g_signal_emit ( + e_printable, + e_printable_signals[DATA_LEFT], 0, + &ret_val); return ret_val; } @@ -159,8 +172,9 @@ e_printable_reset (EPrintable *e_printable) g_return_if_fail (e_printable != NULL); g_return_if_fail (E_IS_PRINTABLE (e_printable)); - g_signal_emit (e_printable, - e_printable_signals[RESET], 0); + g_signal_emit ( + e_printable, + e_printable_signals[RESET], 0); } gdouble @@ -175,13 +189,14 @@ e_printable_height (EPrintable *e_printable, g_return_val_if_fail (e_printable != NULL, -1); g_return_val_if_fail (E_IS_PRINTABLE (e_printable), -1); - g_signal_emit (e_printable, - e_printable_signals[HEIGHT], 0, - context, - width, - max_height, - quantized, - &ret_val); + g_signal_emit ( + e_printable, + e_printable_signals[HEIGHT], 0, + context, + width, + max_height, + quantized, + &ret_val); return ret_val; } @@ -198,13 +213,14 @@ e_printable_will_fit (EPrintable *e_printable, g_return_val_if_fail (e_printable != NULL, FALSE); g_return_val_if_fail (E_IS_PRINTABLE (e_printable), FALSE); - g_signal_emit (e_printable, - e_printable_signals[WILL_FIT], 0, - context, - width, - max_height, - quantized, - &ret_val); + g_signal_emit ( + e_printable, + e_printable_signals[WILL_FIT], 0, + context, + width, + max_height, + quantized, + &ret_val); return ret_val; } diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c index 71990f1bd3..f2f5b93379 100644 --- a/widgets/misc/e-selection-model-array.c +++ b/widgets/misc/e-selection-model-array.c @@ -421,7 +421,7 @@ esma_change_range (ESelectionModel *selection, ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); if (start != end) { if (selection->sorter && e_sorter_needs_sorting (selection->sorter)) { - for ( i = start; i < end; i++) { + for (i = start; i < end; i++) { e_bit_array_change_one_row (esma->eba, e_sorter_sorted_to_model (selection->sorter, i), grow); } } else { @@ -503,14 +503,18 @@ esma_real_move_selection_end (ESelectionModel *selection, gint new_start; gint new_end; if (selection->sorter && e_sorter_needs_sorting (selection->sorter)) { - old_start = MIN (e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), - e_sorter_model_to_sorted (selection->sorter, esma->cursor_row)); - old_end = MAX (e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), - e_sorter_model_to_sorted (selection->sorter, esma->cursor_row)) + 1; - new_start = MIN (e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), - e_sorter_model_to_sorted (selection->sorter, row)); - new_end = MAX (e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), - e_sorter_model_to_sorted (selection->sorter, row)) + 1; + old_start = MIN ( + e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), + e_sorter_model_to_sorted (selection->sorter, esma->cursor_row)); + old_end = MAX ( + e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), + e_sorter_model_to_sorted (selection->sorter, esma->cursor_row)) + 1; + new_start = MIN ( + e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), + e_sorter_model_to_sorted (selection->sorter, row)); + new_end = MAX ( + e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), + e_sorter_model_to_sorted (selection->sorter, row)) + 1; } else { old_start = MIN (esma->selection_start_row, esma->cursor_row); old_end = MAX (esma->selection_start_row, esma->cursor_row) + 1; @@ -620,18 +624,24 @@ e_selection_model_array_class_init (ESelectionModelArrayClass *class) class->get_row_count = NULL; - g_object_class_install_property (object_class, PROP_CURSOR_ROW, - g_param_spec_int ("cursor_row", - "Cursor Row", - NULL, - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_CURSOR_COL, - g_param_spec_int ("cursor_col", - "Cursor Column", - NULL, - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_CURSOR_ROW, + g_param_spec_int ( + "cursor_row", + "Cursor Row", + NULL, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_CURSOR_COL, + g_param_spec_int ( + "cursor_col", + "Cursor Column", + NULL, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); } diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index fc73df6b5e..fece615838 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -538,12 +538,14 @@ e_selection_model_do_something (ESelectionModel *selection, break; } e_selection_model_change_cursor (selection, row, col); - g_signal_emit (selection, - signals[CURSOR_CHANGED], 0, - row, col); - g_signal_emit (selection, - signals[CURSOR_ACTIVATED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_CHANGED], 0, + row, col); + g_signal_emit ( + selection, + signals[CURSOR_ACTIVATED], 0, + row, col); } } @@ -572,9 +574,10 @@ e_selection_model_maybe_do_something (ESelectionModel *selection, if (e_selection_model_is_row_selected (selection, row)) { e_selection_model_change_cursor (selection, row, col); - g_signal_emit (selection, - signals[CURSOR_CHANGED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_CHANGED], 0, + row, col); return FALSE; } else { e_selection_model_do_something (selection, row, col, state); @@ -649,13 +652,15 @@ e_selection_model_select_as_key_press (ESelectionModel *selection, } if (row != -1) { e_selection_model_change_cursor (selection, row, col); - g_signal_emit (selection, - signals[CURSOR_CHANGED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_CHANGED], 0, + row, col); if (cursor_activated) - g_signal_emit (selection, - signals[CURSOR_ACTIVATED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_ACTIVATED], 0, + row, col); } } @@ -722,9 +727,10 @@ e_selection_model_key_press (ESelectionModel *selection, break; e_selection_model_toggle_single_row (selection, row); - g_signal_emit (selection, - signals[CURSOR_ACTIVATED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_ACTIVATED], 0, + row, col); return TRUE; } break; @@ -734,9 +740,10 @@ e_selection_model_key_press (ESelectionModel *selection, gint row = e_selection_model_cursor_row (selection); gint col = e_selection_model_cursor_col (selection); e_selection_model_select_single_row (selection, row); - g_signal_emit (selection, - signals[CURSOR_ACTIVATED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_ACTIVATED], 0, + row, col); return TRUE; } break; diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c index 4b54c58157..748f7b83b5 100644 --- a/widgets/misc/e-send-options.c +++ b/widgets/misc/e-send-options.c @@ -648,7 +648,7 @@ e_send_options_cb (GtkDialog *dialog, break; } - g_signal_emit (G_OBJECT (func_data), signals[SOD_RESPONSE], 0, state); + g_signal_emit (func_data, signals[SOD_RESPONSE], 0, state); } gboolean diff --git a/widgets/misc/e-source-config.c b/widgets/misc/e-source-config.c index 9b4ad13f26..f5ef35287c 100644 --- a/widgets/misc/e-source-config.c +++ b/widgets/misc/e-source-config.c @@ -1335,9 +1335,9 @@ e_source_config_add_secure_connection (ESourceConfig *config, static gboolean secure_to_port_cb (GBinding *binding, - const GValue *source_value, - GValue *target_value, - gpointer user_data) + const GValue *source_value, + GValue *target_value, + gpointer user_data) { GObject *authentication_extension; guint16 port; diff --git a/widgets/misc/e-spell-entry.c b/widgets/misc/e-spell-entry.c index afc8c0e3bf..56f7c14f8c 100644 --- a/widgets/misc/e-spell-entry.c +++ b/widgets/misc/e-spell-entry.c @@ -323,8 +323,9 @@ replace_word (GtkWidget *menuitem, gtk_editable_delete_text (GTK_EDITABLE (entry), start, end); gtk_editable_set_position (GTK_EDITABLE (entry), start); - gtk_editable_insert_text (GTK_EDITABLE (entry), newword, strlen (newword), - &start); + gtk_editable_insert_text ( + GTK_EDITABLE (entry), newword, strlen (newword), + &start); gtk_editable_set_position (GTK_EDITABLE (entry), cursor); checker = g_object_get_data (G_OBJECT (menuitem), "spell-entry-checker"); @@ -382,7 +383,7 @@ build_suggestion_menu (ESpellEntry *entry, mi = gtk_menu_item_new_with_label (iter->data); g_object_set_data (G_OBJECT (mi), "spell-entry-checker", checker); - g_signal_connect (G_OBJECT (mi), "activate", G_CALLBACK (replace_word), entry); + g_signal_connect (mi, "activate", G_CALLBACK (replace_word), entry); gtk_widget_show (mi); gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi); } @@ -450,7 +451,7 @@ build_spelling_menu (ESpellEntry *entry, if (!entry->priv->checkers->next) { checker = entry->priv->checkers->data; g_object_set_data (G_OBJECT (mi), "spell-entry-checker", checker); - g_signal_connect (G_OBJECT (mi), "activate", G_CALLBACK (add_to_dictionary), entry); + g_signal_connect (mi, "activate", G_CALLBACK (add_to_dictionary), entry); } else { GSList *li; GtkWidget *menu, *submi; @@ -473,7 +474,7 @@ build_spelling_menu (ESpellEntry *entry, submi = gtk_menu_item_new_with_label (lang_name ? lang_name : "???"); g_object_set_data (G_OBJECT (submi), "spell-entry-checker", checker); - g_signal_connect (G_OBJECT (submi), "activate", G_CALLBACK (add_to_dictionary), entry); + g_signal_connect (submi, "activate", G_CALLBACK (add_to_dictionary), entry); gtk_widget_show (submi); gtk_menu_shell_append (GTK_MENU_SHELL (menu), submi); @@ -486,7 +487,7 @@ build_spelling_menu (ESpellEntry *entry, /* - Ignore All */ mi = gtk_image_menu_item_new_with_label (_("Ignore All")); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU)); - g_signal_connect (G_OBJECT (mi), "activate", G_CALLBACK (ignore_all), entry); + g_signal_connect (mi, "activate", G_CALLBACK (ignore_all), entry); gtk_widget_show_all (mi); gtk_menu_shell_append (GTK_MENU_SHELL (topmenu), mi); @@ -829,7 +830,8 @@ e_spell_entry_set_languages (ESpellEntry *spell_entry, const GtkhtmlSpellLanguage *language = iter->data; if (language) - spell_entry->priv->checkers = g_slist_prepend (spell_entry->priv->checkers, + spell_entry->priv->checkers = g_slist_prepend ( + spell_entry->priv->checkers, gtkhtml_spell_checker_new (language)); } @@ -853,7 +855,7 @@ e_spell_entry_set_checking_enabled (ESpellEntry *spell_entry, { g_return_if_fail (spell_entry != NULL); - if ((enable_checking ? 1 : 0) == (spell_entry->priv->checking_enabled ? 1 : 0)) + if (spell_entry->priv->checking_enabled == enable_checking) return; spell_entry->priv->checking_enabled = enable_checking; diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index 9c434d6cf8..0d0903c7bd 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -480,7 +480,8 @@ web_view_update_document_highlights (EWebView *web_view) webkit_dom_node_append_child ( WEBKIT_DOM_NODE (frag), WEBKIT_DOM_NODE (span), NULL); - replace_text (WEBKIT_DOM_NODE (document), + replace_text ( + WEBKIT_DOM_NODE (document), iter->data, WEBKIT_DOM_NODE (frag)); } } @@ -868,9 +869,9 @@ web_view_constructed (GObject *object) static gboolean web_view_context_menu_cb (WebKitWebView *webkit_web_view, - GtkWidget *default_menu, - WebKitHitTestResult *hit_test_result, - gboolean triggered_with_keyboard) + GtkWidget *default_menu, + WebKitHitTestResult *hit_test_result, + gboolean triggered_with_keyboard) { WebKitHitTestResultContext context; EWebView *web_view; @@ -1447,10 +1448,10 @@ web_view_selectable_select_all (ESelectable *selectable) static gboolean web_view_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time_) + GdkDragContext *context, + gint x, + gint y, + guint time_) { return FALSE; } @@ -2109,7 +2110,8 @@ e_web_view_set_enable_frame_flattening (EWebView *web_view, settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (web_view)); g_return_if_fail (settings != NULL); - g_object_set (G_OBJECT (settings), "enable-frame-flattening", + g_object_set ( + G_OBJECT (settings), "enable-frame-flattening", enable_frame_flattening, NULL); } @@ -2816,7 +2818,8 @@ e_web_view_update_fonts (EWebView *web_view) } stylesheet = g_string_new (""); - g_string_append_printf (stylesheet, + g_string_append_printf ( + stylesheet, "body {\n" " font-family: '%s';\n" " font-size: %dpt;\n" @@ -2848,7 +2851,8 @@ e_web_view_update_fonts (EWebView *web_view) g_string_append (stylesheet, "}\n"); - g_string_append_printf (stylesheet, + g_string_append_printf ( + stylesheet, "pre,code,.pre {\n" " font-family: '%s';\n" " font-size: %dpt;\n" @@ -2861,7 +2865,8 @@ e_web_view_update_fonts (EWebView *web_view) styles[pango_font_description_get_style (ms)]); context = gtk_widget_get_style_context (GTK_WIDGET (web_view)); - gtk_style_context_get_style (context, + gtk_style_context_get_style ( + context, "link-color", &link, "visited-link-color", &visited, NULL); @@ -2876,7 +2881,8 @@ e_web_view_update_fonts (EWebView *web_view) visited->red = G_MAXINT16; } - g_string_append_printf (stylesheet, + g_string_append_printf ( + stylesheet, "a {\n" " color: #%06x;\n" "}\n" @@ -2897,7 +2903,8 @@ e_web_view_update_fonts (EWebView *web_view) g_free (base64); settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (web_view)); - g_object_set (G_OBJECT (settings), + g_object_set ( + G_OBJECT (settings), "default-font-size", pango_font_description_get_size (vw) / PANGO_SCALE, "default-font-family", pango_font_description_get_family (vw), "monospace-font-family", pango_font_description_get_family (ms), diff --git a/widgets/misc/ea-calendar-cell.c b/widgets/misc/ea-calendar-cell.c index b66a991bba..90a889ef18 100644 --- a/widgets/misc/ea-calendar-cell.c +++ b/widgets/misc/ea-calendar-cell.c @@ -56,8 +56,9 @@ e_calendar_cell_get_type (void) NULL /* value table */ }; - type = g_type_register_static (G_TYPE_OBJECT, - "ECalendarCell", &tinfo, 0); + type = g_type_register_static ( + G_TYPE_OBJECT, + "ECalendarCell", &tinfo, 0); } return type; @@ -143,10 +144,12 @@ ea_calendar_cell_get_type (void) NULL }; - type = g_type_register_static (ATK_TYPE_GOBJECT_ACCESSIBLE, - "EaCalendarCell", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); + type = g_type_register_static ( + ATK_TYPE_GOBJECT_ACCESSIBLE, + "EaCalendarCell", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); } return type; @@ -198,7 +201,8 @@ ea_calendar_cell_new (GObject *obj) #ifdef ACC_DEBUG ++n_ea_calendar_cell_created; - g_print ("ACC_DEBUG: n_ea_calendar_cell_created = %d\n", + g_print ( + "ACC_DEBUG: n_ea_calendar_cell_created = %d\n", n_ea_calendar_cell_created); #endif return atk_object; @@ -210,7 +214,8 @@ static void ea_calendar_cell_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); ++n_ea_calendar_cell_destroyed; - g_print ("ACC_DEBUG: n_ea_calendar_cell_destroyed = %d\n", + g_print ( + "ACC_DEBUG: n_ea_calendar_cell_destroyed = %d\n", n_ea_calendar_cell_destroyed); } #endif @@ -238,8 +243,9 @@ ea_calendar_cell_get_name (AtkObject *accessible) cell = E_CALENDAR_CELL (g_obj); atk_obj = ea_calendar_cell_get_parent (accessible); ea_calitem = EA_CALENDAR_ITEM (atk_obj); - day_index = atk_table_get_index_at (ATK_TABLE (ea_calitem), - cell->row, cell->column); + day_index = atk_table_get_index_at ( + ATK_TABLE (ea_calitem), + cell->row, cell->column); e_calendar_item_get_date_for_offset (cell->calitem, day_index, &year, &month, &day); @@ -288,8 +294,9 @@ ea_calendar_cell_get_index_in_parent (AtkObject *accessible) return -1; cell = E_CALENDAR_CELL (g_obj); parent = atk_object_get_parent (accessible); - return atk_table_get_index_at (ATK_TABLE (parent), - cell->row, cell->column); + return atk_table_get_index_at ( + ATK_TABLE (parent), + cell->row, cell->column); } static AtkStateSet * @@ -346,8 +353,9 @@ component_interface_get_extents (AtkComponent *component, calitem = cell->calitem; atk_obj = atk_gobject_accessible_for_object (G_OBJECT (calitem)); ea_calitem = EA_CALENDAR_ITEM (atk_obj); - day_index = atk_table_get_index_at (ATK_TABLE (ea_calitem), - cell->row, cell->column); + day_index = atk_table_get_index_at ( + ATK_TABLE (ea_calitem), + cell->row, cell->column); e_calendar_item_get_date_for_offset (calitem, day_index, &year, &month, &day); @@ -356,10 +364,11 @@ component_interface_get_extents (AtkComponent *component, x, y, width, height)) return; atk_canvas = atk_object_get_parent (ATK_OBJECT (ea_calitem)); - atk_component_get_extents (ATK_COMPONENT (atk_canvas), - &canvas_x, &canvas_y, - &canvas_width, &canvas_height, - coord_type); + atk_component_get_extents ( + ATK_COMPONENT (atk_canvas), + &canvas_x, &canvas_y, + &canvas_width, &canvas_height, + coord_type); *x += canvas_x; *y += canvas_y; } diff --git a/widgets/misc/ea-calendar-item.c b/widgets/misc/ea-calendar-item.c index 80b90105d4..dc878c4e1d 100644 --- a/widgets/misc/ea-calendar-item.c +++ b/widgets/misc/ea-calendar-item.c @@ -182,20 +182,24 @@ ea_calendar_item_get_type (void) * we are run-time deriving from (GailCanvasItem, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - GNOME_TYPE_CANVAS_ITEM); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GNOME_TYPE_CANVAS_ITEM); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaCalendarItem", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_TABLE, - &atk_table_info); - g_type_add_interface_static (type, ATK_TYPE_SELECTION, - &atk_selection_info); + type = g_type_register_static ( + derived_atk_type, + "EaCalendarItem", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_TABLE, + &atk_table_info); + g_type_add_interface_static ( + type, ATK_TYPE_SELECTION, + &atk_selection_info); } return type; @@ -231,14 +235,15 @@ ea_calendar_item_new (GObject *obj) atk_object_initialize (atk_object, obj); atk_object->role = ATK_ROLE_CALENDAR; - item_cell = atk_selection_ref_selection (ATK_SELECTION (atk_object), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (atk_object), 0); if (item_cell) ea_calendar_set_focus_object (EA_CALENDAR_ITEM (atk_object), item_cell); #ifdef ACC_DEBUG ++n_ea_calendar_item_created; - g_print ("ACC_DEBUG: n_ea_calendar_item_created = %d\n", + g_print ( + "ACC_DEBUG: n_ea_calendar_item_created = %d\n", n_ea_calendar_item_created); #endif /* connect signal handlers */ @@ -267,7 +272,8 @@ ea_calendar_item_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); #ifdef ACC_DEBUG ++n_ea_calendar_item_destroyed; - printf ("ACC_DEBUG: n_ea_calendar_item_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_calendar_item_destroyed = %d\n", n_ea_calendar_item_destroyed); #endif } @@ -334,10 +340,11 @@ ea_calendar_item_get_name (AtkObject *accessible) month2 = g_date_get_month (&select_end); day2 = g_date_get_day (&select_end); - sprintf (new_name + strlen (new_name), - " : current selection: from %d-%d-%d to %d-%d-%d.", - year1, month1, day1, - year2, month2, day2); + sprintf ( + new_name + strlen (new_name), + " : current selection: from %d-%d-%d to %d-%d-%d.", + year1, month1, day1, + year2, month2, day2); } #endif @@ -440,16 +447,18 @@ ea_calendar_item_ref_child (AtkObject *accessible, cell = ea_cell_table_get_cell_at_index (cell_data, index); if (!cell) { - cell = e_calendar_cell_new (calitem, - index / EA_CALENDAR_COLUMN_NUM, - index % EA_CALENDAR_COLUMN_NUM); + cell = e_calendar_cell_new ( + calitem, + index / EA_CALENDAR_COLUMN_NUM, + index % EA_CALENDAR_COLUMN_NUM); ea_cell_table_set_cell_at_index (cell_data, index, cell); g_object_unref (cell); } #ifdef ACC_DEBUG - g_print ("AccDebug: ea_calendar_item children[%d]=%p\n", index, - (gpointer) cell); + g_print ( + "AccDebug: ea_calendar_item children[%d]=%p\n", index, + (gpointer) cell); #endif return g_object_ref (atk_gobject_accessible_for_object (G_OBJECT (cell))); } @@ -829,11 +838,12 @@ table_interface_get_column_description (AtkTable *table, description = ea_cell_table_get_column_label (cell_data, in_col); if (!description) { gchar buffer[128] = "column description"; - ea_calendar_item_get_column_label (ea_calitem, in_col, - buffer, sizeof (buffer)); + ea_calendar_item_get_column_label ( + ea_calitem, in_col, + buffer, sizeof (buffer)); ea_cell_table_set_column_label (cell_data, in_col, buffer); - description = ea_cell_table_get_column_label (cell_data, - in_col); + description = ea_cell_table_get_column_label ( + cell_data, in_col); } return description; } @@ -864,11 +874,13 @@ table_interface_get_row_description (AtkTable *table, description = ea_cell_table_get_row_label (cell_data, row); if (!description) { gchar buffer[128] = "row description"; - ea_calendar_item_get_row_label (ea_calitem, row, + ea_calendar_item_get_row_label ( + ea_calitem, row, buffer, sizeof (buffer)); ea_cell_table_set_row_label (cell_data, row, buffer); - description = ea_cell_table_get_row_label (cell_data, - row); + description = ea_cell_table_get_row_label ( + cell_data, + row); } return description; } @@ -1028,15 +1040,16 @@ selection_preview_change_cb (ECalendarItem *calitem) ea_calendar_item_destory_cell_data (EA_CALENDAR_ITEM (atk_obj)); /* only deal with the first selected child, for now */ - item_cell = atk_selection_ref_selection (ATK_SELECTION (atk_obj), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (atk_obj), 0); if (item_cell) ea_calendar_set_focus_object (EA_CALENDAR_ITEM (atk_obj), item_cell); - g_signal_emit_by_name (atk_obj, - "active-descendant-changed", - item_cell); + g_signal_emit_by_name ( + atk_obj, + "active-descendant-changed", + item_cell); g_signal_emit_by_name (atk_obj, "selection_changed"); } @@ -1050,8 +1063,8 @@ date_range_changed_cb (ECalendarItem *calitem) atk_obj = atk_gobject_accessible_for_object (G_OBJECT (calitem)); ea_calendar_item_destory_cell_data (EA_CALENDAR_ITEM (atk_obj)); - item_cell = atk_selection_ref_selection (ATK_SELECTION (atk_obj), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (atk_obj), 0); if (item_cell) ea_calendar_set_focus_object (EA_CALENDAR_ITEM (atk_obj), item_cell); @@ -1074,16 +1087,19 @@ ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem) if (!g_obj) return NULL; - cell_data = g_object_get_data (G_OBJECT (ea_calitem), - "ea-calendar-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_calitem), + "ea-calendar-cell-table"); 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, - EA_CALENDAR_COLUMN_NUM, - FALSE); - g_object_set_data (G_OBJECT (ea_calitem), - "ea-calendar-cell-table", cell_data); + 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), + "ea-calendar-cell-table", cell_data); } return cell_data; } @@ -1095,11 +1111,13 @@ ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem) g_return_if_fail (ea_calitem); - cell_data = g_object_get_data (G_OBJECT (ea_calitem), - "ea-calendar-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_calitem), + "ea-calendar-cell-table"); if (cell_data) { - g_object_set_data (G_OBJECT (ea_calitem), - "ea-calendar-cell-table", NULL); + g_object_set_data ( + G_OBJECT (ea_calitem), + "ea-calendar-cell-table", NULL); ea_cell_table_destroy (cell_data); } } @@ -1130,8 +1148,8 @@ ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, &year, &month, &day)) return FALSE; - week_num = e_calendar_item_get_week_number (calitem, - day, month, year); + week_num = e_calendar_item_get_week_number ( + calitem, day, month, year); g_snprintf (buffer, buffer_size, "week number : %d", week_num); return TRUE; @@ -1196,8 +1214,9 @@ e_calendar_item_get_day_extents (ECalendarItem *calitem, if (!font_desc) font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1234,9 +1253,8 @@ e_calendar_item_get_day_extents (ECalendarItem *calitem, + E_CALENDAR_ITEM_YPAD_BELOW_DAY_LETTERS + 1 + E_CALENDAR_ITEM_YPAD_ABOVE_CELLS; - days_from_week_start = - e_calendar_item_get_n_days_from_week_start (calitem, new_year, - new_month); + days_from_week_start = e_calendar_item_get_n_days_from_week_start ( + calitem, new_year, new_month); day_row = (date + days_from_week_start - 1) / EA_CALENDAR_COLUMN_NUM; day_col = (date + days_from_week_start - 1) % EA_CALENDAR_COLUMN_NUM; diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 2127fc0715..7d3584a424 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -85,10 +85,11 @@ main (gint argc, calitem, "selection_changed", G_CALLBACK (on_selection_changed), NULL); - gtk_drag_dest_set (cal, - GTK_DEST_DEFAULT_ALL, - target_table, G_N_ELEMENTS (target_table), - GDK_ACTION_COPY | GDK_ACTION_MOVE); + gtk_drag_dest_set ( + cal, + GTK_DEST_DEFAULT_ALL, + target_table, G_N_ELEMENTS (target_table), + GDK_ACTION_COPY | GDK_ACTION_MOVE); vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), cal, TRUE, TRUE, 0); @@ -108,19 +109,23 @@ on_date_range_changed (ECalendarItem *calitem) gint start_year, start_month, start_day; gint end_year, end_month, end_day; - e_calendar_item_get_date_range (calitem, - &start_year, &start_month, &start_day, - &end_year, &end_month, &end_day); + e_calendar_item_get_date_range ( + calitem, + &start_year, &start_month, &start_day, + &end_year, &end_month, &end_day); - g_print ("Date range changed (D/M/Y): %i/%i/%i - %i/%i/%i\n", - start_day, start_month + 1, start_year, - end_day, end_month + 1, end_year); + g_print ( + "Date range changed (D/M/Y): %i/%i/%i - %i/%i/%i\n", + start_day, start_month + 1, start_year, + end_day, end_month + 1, end_year); /* These days should windowear bold. Remember month is 0 to 11. */ - e_calendar_item_mark_day (calitem, 2000, 7, 26, /* 26th Aug 2000. */ - E_CALENDAR_ITEM_MARK_BOLD, FALSE); - e_calendar_item_mark_day (calitem, 2000, 8, 13, /* 13th Sep 2000. */ - E_CALENDAR_ITEM_MARK_BOLD, FALSE); + e_calendar_item_mark_day ( + calitem, 2000, 7, 26, /* 26th Aug 2000. */ + E_CALENDAR_ITEM_MARK_BOLD, FALSE); + e_calendar_item_mark_day ( + calitem, 2000, 8, 13, /* 13th Sep 2000. */ + E_CALENDAR_ITEM_MARK_BOLD, FALSE); } static void @@ -130,11 +135,12 @@ on_selection_changed (ECalendarItem *calitem) e_calendar_item_get_selection (calitem, &start_date, &end_date); - g_print ("Selection changed (D/M/Y): %i/%i/%i - %i/%i/%i\n", - g_date_get_day (&start_date), - g_date_get_month (&start_date), - g_date_get_year (&start_date), - g_date_get_day (&end_date), - g_date_get_month (&end_date), - g_date_get_year (&end_date)); + g_print ( + "Selection changed (D/M/Y): %i/%i/%i - %i/%i/%i\n", + g_date_get_day (&start_date), + g_date_get_month (&start_date), + g_date_get_year (&start_date), + g_date_get_day (&end_date), + g_date_get_month (&end_date), + g_date_get_year (&end_date)); } diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c index 46c853cea6..5592afbc70 100644 --- a/widgets/misc/test-dateedit.c +++ b/widgets/misc/test-dateedit.c @@ -78,8 +78,9 @@ main (gint argc, /* EDateEdit 1. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (dedit), - 0, 1, 0, 1, GTK_FILL, GTK_EXPAND, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), GTK_WIDGET (dedit), + 0, 1, 0, 1, GTK_FILL, GTK_EXPAND, 0, 0); gtk_widget_show (GTK_WIDGET (dedit)); #if 0 @@ -96,8 +97,9 @@ main (gint argc, #endif button = gtk_button_new_with_label ("Print Date"); - gtk_table_attach (GTK_TABLE (table), button, - 1, 2, 0, 1, 0, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), button, + 1, 2, 0, 1, 0, 0, 0, 0); gtk_widget_show (button); g_signal_connect ( button, "clicked", @@ -105,8 +107,9 @@ main (gint argc, /* EDateEdit 2. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, - 0, 1, 1, 2, GTK_FILL, GTK_EXPAND, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), (GtkWidget *) dedit, + 0, 1, 1, 2, GTK_FILL, GTK_EXPAND, 0, 0); gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); @@ -128,8 +131,9 @@ main (gint argc, #endif button = gtk_button_new_with_label ("Print Date"); - gtk_table_attach (GTK_TABLE (table), button, - 1, 2, 1, 2, 0, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), button, + 1, 2, 1, 2, 0, 0, 0, 0); gtk_widget_show (button); g_signal_connect ( button, "clicked", @@ -137,8 +141,9 @@ main (gint argc, /* EDateEdit 3. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, - 0, 1, 2, 3, GTK_FILL, GTK_EXPAND, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), (GtkWidget *) dedit, + 0, 1, 2, 3, GTK_FILL, GTK_EXPAND, 0, 0); gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); @@ -160,16 +165,18 @@ main (gint argc, #endif button = gtk_button_new_with_label ("Print Date"); - gtk_table_attach (GTK_TABLE (table), button, - 1, 2, 2, 3, 0, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), button, + 1, 2, 2, 3, 0, 0, 0, 0); gtk_widget_show (button); g_signal_connect ( button, "clicked", G_CALLBACK (on_get_date_clicked), dedit); button = gtk_button_new_with_label ("Toggle 24-hour"); - gtk_table_attach (GTK_TABLE (table), button, - 2, 3, 2, 3, 0, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), button, + 2, 3, 2, 3, 0, 0, 0, 0); gtk_widget_show (button); g_signal_connect ( button, "clicked", @@ -230,8 +237,9 @@ on_date_changed (EDateEdit *dedit, if (e_date_edit_date_is_valid (dedit)) { if (e_date_edit_get_date (dedit, &year, &month, &day)) { - g_print ("Date %s changed to: %i/%i/%i (M/D/Y)\n", - name, month, day, year); + g_print ( + "Date %s changed to: %i/%i/%i (M/D/Y)\n", + name, month, day, year); } else { g_print ("Date %s changed to: None\n", name); } @@ -248,8 +256,9 @@ on_time_changed (EDateEdit *dedit, if (e_date_edit_time_is_valid (dedit)) { if (e_date_edit_get_time_of_day (dedit, &hour, &minute)) { - g_print ("Time %s changed to: %02i:%02i\n", name, - hour, minute); + g_print ( + "Time %s changed to: %02i:%02i\n", name, + hour, minute); } else { g_print ("Time %s changed to: None\n", name); } diff --git a/widgets/misc/test-preferences-window.c b/widgets/misc/test-preferences-window.c index ae0a570c6d..4ad30e2245 100644 --- a/widgets/misc/test-preferences-window.c +++ b/widgets/misc/test-preferences-window.c @@ -58,15 +58,18 @@ create_page_two (EPreferencesWindow *preferences_window) static void add_pages (EPreferencesWindow *preferences_window) { - e_preferences_window_add_page (preferences_window, "page-0", - "gtk-properties", "title 0", NULL, - create_page_zero, 0); - e_preferences_window_add_page (preferences_window, "page-1", - "gtk-properties", "title 1", NULL, - create_page_one, 1); - e_preferences_window_add_page (preferences_window, "page-2", - "gtk-properties", "title 2", NULL, - create_page_two, 2); + e_preferences_window_add_page ( + preferences_window, "page-0", + "gtk-properties", "title 0", NULL, + create_page_zero, 0); + e_preferences_window_add_page ( + preferences_window, "page-1", + "gtk-properties", "title 1", NULL, + create_page_one, 1); + e_preferences_window_add_page ( + preferences_window, "page-2", + "gtk-properties", "title 2", NULL, + create_page_two, 2); } static gint diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c index 9e775761c7..0d30031397 100644 --- a/widgets/table/e-cell-checkbox.c +++ b/widgets/table/e-cell-checkbox.c @@ -52,10 +52,11 @@ ecc_print (ECellView *ecell_view, { cairo_t *cr = gtk_print_context_get_cairo_context (context); const gint value = GPOINTER_TO_INT ( - e_table_model_value_at (ecell_view->e_table_model, model_col, row)); + e_table_model_value_at ( + ecell_view->e_table_model, model_col, row)); cairo_save (cr); - if ( value == 1) { + if (value == 1) { cairo_set_line_width (cr, 2); cairo_move_to (cr, 3, 11); cairo_line_to (cr, 7, 14); diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 422f9da815..48bf24724d 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -319,8 +319,9 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); ecol = e_table_header_get_column (eti->header, ecp->popup_view_col); - cell_text = e_cell_text_get_text (ecell_text, ecv->e_table_model, - ecol->col_idx, ecp->popup_row); + cell_text = e_cell_text_get_text ( + ecell_text, ecv->e_table_model, + ecol->col_idx, ecp->popup_row); model = gtk_tree_view_get_model (GTK_TREE_VIEW (ecc->popup_tree_view)); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ecc->popup_tree_view)); @@ -432,25 +433,21 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, x1 = e_table_header_col_diff (eti->header, 0, view_col + 1); y1 = e_table_item_row_diff (eti, 0, row + 1); - column_width = e_table_header_col_diff (eti->header, view_col, - view_col + 1); - row_height = e_table_item_row_diff (eti, row, - row + 1); + column_width = e_table_header_col_diff ( + eti->header, view_col, view_col + 1); + row_height = e_table_item_row_diff (eti, row, row + 1); gnome_canvas_item_i2w (GNOME_CANVAS_ITEM (eti), &x1, &y1); - gnome_canvas_world_to_window (GNOME_CANVAS (canvas), - x1, - y1, - &wx, - &wy); + gnome_canvas_world_to_window ( + GNOME_CANVAS (canvas), x1, y1, &wx, &wy); x1 = wx; y1 = wy; *x += x1; /* The ETable positions don't include the grid lines, I think, so we add 1. */ - *y += y1 + 1 - - (gint) gtk_adjustment_get_value ( + *y += y1 + 1 - (gint) + gtk_adjustment_get_value ( gtk_scrollable_get_vadjustment ( GTK_SCROLLABLE (&((GnomeCanvas *) canvas)->layout))) + ((GnomeCanvas *) canvas)->zoom_yofs; @@ -712,13 +709,15 @@ e_cell_combo_update_cell (ECellCombo *ecc) /* Compare it with the existing cell contents. */ ecol = e_table_header_get_column (eti->header, ecp->popup_view_col); - old_text = e_cell_text_get_text (ecell_text, ecv->e_table_model, - ecol->col_idx, ecp->popup_row); + old_text = e_cell_text_get_text ( + ecell_text, ecv->e_table_model, + ecol->col_idx, ecp->popup_row); /* If they are different, update the cell contents. */ if (old_text && strcmp (old_text, text)) { - e_cell_text_set_value (ecell_text, ecv->e_table_model, - ecol->col_idx, ecp->popup_row, text); + e_cell_text_set_value ( + ecell_text, ecv->e_table_model, + ecol->col_idx, ecp->popup_row, text); } e_cell_text_free_text (ecell_text, old_text); diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index 70c15dfafd..46f224f315 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -222,8 +222,9 @@ e_cell_date_edit_init (ECellDateEdit *ecde) * 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), - GDK_WINDOW_TYPE_HINT_COMBO); + gtk_window_set_type_hint ( + GTK_WINDOW (ecde->popup_window), + GDK_WINDOW_TYPE_HINT_COMBO); gtk_window_set_resizable (GTK_WINDOW (ecde->popup_window), TRUE); frame = gtk_frame_new (NULL); @@ -240,9 +241,10 @@ e_cell_date_edit_init (ECellDateEdit *ecde) gtk_widget_show (hbox); ecde->calendar = e_calendar_new (); - gnome_canvas_item_set (GNOME_CANVAS_ITEM (E_CALENDAR (ecde->calendar)->calitem), - "move_selection_when_moving", FALSE, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (E_CALENDAR (ecde->calendar)->calitem), + "move_selection_when_moving", FALSE, + NULL); gtk_box_pack_start (GTK_BOX (hbox), ecde->calendar, TRUE, TRUE, 0); gtk_widget_show (ecde->calendar); @@ -252,15 +254,16 @@ e_cell_date_edit_init (ECellDateEdit *ecde) ecde->time_entry = gtk_entry_new (); gtk_widget_set_size_request (ecde->time_entry, 50, -1); - gtk_box_pack_start (GTK_BOX (vbox2), ecde->time_entry, - FALSE, FALSE, 0); + gtk_box_pack_start ( + GTK_BOX (vbox2), ecde->time_entry, + FALSE, FALSE, 0); gtk_widget_show (ecde->time_entry); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_box_pack_start (GTK_BOX (vbox2), scrolled_window, TRUE, TRUE, 0); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), - GTK_POLICY_NEVER, - GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (scrolled_window), + GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); gtk_widget_show (scrolled_window); store = gtk_list_store_new (1, G_TYPE_STRING); @@ -541,14 +544,18 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) if (is_date) { buffer[0] = '\0'; } else { - e_time_format_time (&date_tm, ecde->use_24_hour_format, - FALSE, buffer, sizeof (buffer)); + e_time_format_time ( + &date_tm, ecde->use_24_hour_format, + FALSE, buffer, sizeof (buffer)); } gtk_entry_set_text (GTK_ENTRY (ecde->time_entry), buffer); g_date_clear (&date, 1); - g_date_set_dmy (&date, date_tm.tm_mday, date_tm.tm_mon + 1, - date_tm.tm_year + 1900); + g_date_set_dmy ( + &date, + date_tm.tm_mday, + date_tm.tm_mon + 1, + date_tm.tm_year + 1900); e_calendar_item_set_selection (calitem, &date, &date); if (is_date) { @@ -660,17 +667,13 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, x1 = e_table_header_col_diff (eti->header, 0, view_col + 1); y1 = e_table_item_row_diff (eti, 0, row + 1); - column_width = e_table_header_col_diff (eti->header, view_col, - view_col + 1); - row_height = e_table_item_row_diff (eti, row, - row + 1); + column_width = e_table_header_col_diff ( + eti->header, view_col, view_col + 1); + row_height = e_table_item_row_diff (eti, row, row + 1); gnome_canvas_item_i2w (GNOME_CANVAS_ITEM (eti), &x1, &y1); - gnome_canvas_world_to_window (GNOME_CANVAS (canvas), - x1, - y1, - &wx, - &wy); + gnome_canvas_world_to_window ( + GNOME_CANVAS (canvas), x1, y1, &wx, &wy); x1 = wx; y1 = wy; @@ -816,8 +819,8 @@ e_cell_date_edit_on_ok_clicked (GtkWidget *button, gboolean is_date = FALSE; calitem = E_CALENDAR_ITEM (E_CALENDAR (ecde->calendar)->calitem); - day_selected = e_calendar_item_get_selection (calitem, &start_date, - &end_date); + day_selected = e_calendar_item_get_selection ( + calitem, &start_date, &end_date); text = gtk_entry_get_text (GTK_ENTRY (ecde->time_entry)); status = e_time_parse_time (text, &date_tm); diff --git a/widgets/table/e-cell-hbox.c b/widgets/table/e-cell-hbox.c index 6bca769174..74301a773c 100644 --- a/widgets/table/e-cell-hbox.c +++ b/widgets/table/e-cell-hbox.c @@ -166,7 +166,7 @@ ecv_draw (ECellView *ecell_view, /* 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]) width = hbox_view->def_size_cols[i]; - printf ("width of %d %d of %d\n", width,hbox_view->def_size_cols[i], allotted_width ); */ + printf ("width of %d %d of %d\n", width,hbox_view->def_size_cols[i], allotted_width); */ e_cell_draw ( hbox_view->subcell_views[i], cr, diff --git a/widgets/table/e-cell-percent.c b/widgets/table/e-cell-percent.c index 61543b0e0c..81465d5a62 100644 --- a/widgets/table/e-cell-percent.c +++ b/widgets/table/e-cell-percent.c @@ -115,8 +115,9 @@ ecp_set_value (ECellText *cell, } } - e_table_model_set_value_at (model, col, row, - GINT_TO_POINTER (percent)); + e_table_model_set_value_at ( + model, col, row, + GINT_TO_POINTER (percent)); } static void diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index b2cf3e2a2d..41b030ec5a 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -356,25 +356,34 @@ e_cell_pixbuf_class_init (ECellPixbufClass *class) ecc->print_height = pixbuf_print_height; ecc->max_width = pixbuf_max_width; - g_object_class_install_property (object_class, PROP_SELECTED_COLUMN, - g_param_spec_int ("selected_column", - "Selected Column", - NULL, - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_FOCUSED_COLUMN, - g_param_spec_int ("focused_column", - "Focused Column", - NULL, - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_UNSELECTED_COLUMN, - g_param_spec_int ("unselected_column", - "Unselected Column", - NULL, - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_SELECTED_COLUMN, + g_param_spec_int ( + "selected_column", + "Selected Column", + NULL, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_FOCUSED_COLUMN, + g_param_spec_int ( + "focused_column", + "Focused Column", + NULL, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_UNSELECTED_COLUMN, + g_param_spec_int ( + "unselected_column", + "Unselected Column", + NULL, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); } diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c index 65440b2465..0f549748fe 100644 --- a/widgets/table/e-cell-popup.c +++ b/widgets/table/e-cell-popup.c @@ -131,9 +131,9 @@ e_cell_popup_class_init (ECellPopupClass *class) ecc->max_width = ecp_max_width; ecc->get_bg_color = ecp_get_bg_color; - gal_a11y_e_cell_registry_add_cell_type (NULL, - E_TYPE_CELL_POPUP, - gal_a11y_e_cell_popup_new); + gal_a11y_e_cell_registry_add_cell_type ( + NULL, E_TYPE_CELL_POPUP, + gal_a11y_e_cell_popup_new); } static void @@ -190,8 +190,9 @@ ecp_new_view (ECell *ecell, ecp_view->cell_view.kill_view_cb = NULL; ecp_view->cell_view.kill_view_cb_data = NULL; - ecp_view->child_view = e_cell_new_view (ecp->child, table_model, - e_table_item_view); + ecp_view->child_view = e_cell_new_view ( + ecp->child, table_model, + e_table_item_view); return (ECellView *) ecp_view; } @@ -277,9 +278,9 @@ ecp_draw (ECellView *ecv, e_table_model_is_cell_editable ( ecv->e_table_model, model_col, row) && (flags & E_CELL_CURSOR || - (ecp->popup_shown && ecp->popup_view_col == view_col - && ecp->popup_row == row - && ecp->popup_model == ((ECellView *) ecp_view)->e_table_model)); + (ecp->popup_shown && ecp->popup_view_col == view_col + && ecp->popup_row == row + && ecp->popup_model == ((ECellView *) ecp_view)->e_table_model)); if (flags & E_CELL_CURSOR) ecp->popup_arrow_shown = show_popup_arrow; @@ -287,9 +288,10 @@ ecp_draw (ECellView *ecv, if (show_popup_arrow) { GtkStyle *style; - e_cell_draw (ecp_view->child_view, cr, model_col, - view_col, row, flags, - x1, y1, x2 - E_CELL_POPUP_ARROW_WIDTH, y2); + e_cell_draw ( + ecp_view->child_view, cr, model_col, + view_col, row, flags, + x1, y1, x2 - E_CELL_POPUP_ARROW_WIDTH, y2); rect.x = x2 - E_CELL_POPUP_ARROW_WIDTH; rect.y = y1 + 1; @@ -303,21 +305,24 @@ ecp_draw (ECellView *ecv, style = gtk_widget_get_style (canvas); - gtk_paint_box (style, cr, - GTK_STATE_NORMAL, shadow, - canvas, "ecellpopup", - rect.x, rect.y, rect.width, rect.height); - gtk_paint_arrow (style, cr, - GTK_STATE_NORMAL, GTK_SHADOW_NONE, - canvas, NULL, - GTK_ARROW_DOWN, TRUE, - rect.x + E_CELL_POPUP_ARROW_XPAD, - rect.y + E_CELL_POPUP_ARROW_YPAD, - rect.width - E_CELL_POPUP_ARROW_XPAD * 2, - rect.height - E_CELL_POPUP_ARROW_YPAD * 2); + gtk_paint_box ( + style, cr, + GTK_STATE_NORMAL, shadow, + canvas, "ecellpopup", + rect.x, rect.y, rect.width, rect.height); + gtk_paint_arrow ( + style, cr, + GTK_STATE_NORMAL, GTK_SHADOW_NONE, + canvas, NULL, + GTK_ARROW_DOWN, TRUE, + rect.x + E_CELL_POPUP_ARROW_XPAD, + rect.y + E_CELL_POPUP_ARROW_YPAD, + rect.width - E_CELL_POPUP_ARROW_XPAD * 2, + rect.height - E_CELL_POPUP_ARROW_YPAD * 2); } else { - e_cell_draw (ecp_view->child_view, cr, model_col, - view_col, row, flags, x1, y1, x2, y2); + e_cell_draw ( + ecp_view->child_view, cr, model_col, + view_col, row, flags, x1, y1, x2, y2); } cairo_restore (cr); @@ -345,8 +350,9 @@ ecp_event (ECellView *ecv, if (e_table_model_is_cell_editable (ecv->e_table_model, model_col, row) && flags & E_CELL_CURSOR && ecp->popup_arrow_shown) { - width = e_table_header_col_diff (eti->header, view_col, - view_col + 1); + width = e_table_header_col_diff ( + eti->header, 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. */ @@ -366,8 +372,9 @@ ecp_event (ECellView *ecv, break; } - return e_cell_event (ecp_view->child_view, event, model_col, view_col, - row, flags, actions); + return e_cell_event ( + ecp_view->child_view, event, model_col, view_col, + row, flags, actions); } /* @@ -410,8 +417,9 @@ ecp_leave_edit (ECellView *ecv, { ECellPopupView *ecp_view = (ECellPopupView *) ecv; - e_cell_leave_edit (ecp_view->child_view, model_col, view_col, row, - edit_context); + e_cell_leave_edit ( + ecp_view->child_view, model_col, view_col, row, + edit_context); } static void @@ -425,8 +433,9 @@ ecp_print (ECellView *ecv, { ECellPopupView *ecp_view = (ECellPopupView *) ecv; - e_cell_print (ecp_view->child_view, context, model_col, view_col, row, - width, height); + e_cell_print ( + ecp_view->child_view, context, model_col, view_col, row, + width, height); } static gdouble @@ -439,8 +448,9 @@ ecp_print_height (ECellView *ecv, { ECellPopupView *ecp_view = (ECellPopupView *) ecv; - return e_cell_print_height (ecp_view->child_view, context, model_col, - view_col, row, width); + return e_cell_print_height ( + ecp_view->child_view, context, model_col, + view_col, row, width); } static gint diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 6e28c8b7b2..f1d852a951 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -305,8 +305,9 @@ ect_stop_editing (ECellTextView *text_view, ECellText *ect = (ECellText *) ecell_view->ecell; if (strcmp (old_text, text)) { - e_cell_text_set_value (ect, ecell_view->e_table_model, - model_col, row, text); + e_cell_text_set_value ( + ect, ecell_view->e_table_model, + model_col, row, text); } } g_free (text); @@ -463,9 +464,10 @@ layout_with_preedit (ECellTextView *text_view, gint text_length = strlen (text); gint mlen = MIN (edit->selection_start,text_length); - gtk_im_context_get_preedit_string (edit->im_context, - &preedit_string,&preedit_attrs, - NULL); + gtk_im_context_get_preedit_string ( + edit->im_context, + &preedit_string,&preedit_attrs, + NULL); preedit_length = edit->preedit_length = strlen (preedit_string);; layout = edit->layout; @@ -770,9 +772,8 @@ ect_draw (ECellView *ecell_view, indices[0] = MIN (edit->selection_start, edit->selection_end); indices[1] = MAX (edit->selection_start, edit->selection_end); - clip_region = gdk_pango_layout_get_clip_region (layout, - x_origin, y_origin, - indices, 1); + clip_region = gdk_pango_layout_get_clip_region ( + layout, x_origin, y_origin, indices, 1); gdk_cairo_region (cr, clip_region); cairo_clip (cr); cairo_region_destroy (clip_region); @@ -815,8 +816,9 @@ ect_get_bg_color (ECellView *ecell_view, if (ect->bg_color_column == -1) return NULL; - color_spec = e_table_model_value_at (ecell_view->e_table_model, - ect->bg_color_column, row); + color_spec = e_table_model_value_at ( + ecell_view->e_table_model, + ect->bg_color_column, row); return color_spec; } @@ -867,7 +869,7 @@ ect_event (ECellView *ecell_view, if (!(flags & E_CELL_EDITING)) return 0; - if ( edit && !edit->preedit_length && flags & E_CELL_PREEDIT) + if (edit && !edit->preedit_length && flags & E_CELL_PREEDIT) return 1; if (edit && edit->view_col == view_col && edit->row == row) { @@ -970,8 +972,8 @@ ect_event (ECellView *ecell_view, e_tep_event.button.position = get_position_from_xy (edit, event->button.x, event->button.y); _get_tep (edit); edit->actions = 0; - return_val = e_text_event_processor_handle_event (edit->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event ( + edit->tep, &e_tep_event); *actions = edit->actions; if (event->button.button == 1) { if (event->type == GDK_BUTTON_PRESS) @@ -993,8 +995,8 @@ ect_event (ECellView *ecell_view, e_tep_event.button.position = get_position_from_xy (edit, event->button.x, event->button.y); _get_tep (edit); edit->actions = 0; - return_val = e_text_event_processor_handle_event (edit->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event ( + edit->tep, &e_tep_event); *actions = edit->actions; if (event->button.button == 1) { if (event->type == GDK_BUTTON_PRESS) @@ -1017,8 +1019,8 @@ ect_event (ECellView *ecell_view, e_tep_event.motion.position = get_position_from_xy (edit, event->motion.x, event->motion.y); _get_tep (edit); edit->actions = 0; - return_val = e_text_event_processor_handle_event (edit->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event ( + edit->tep, &e_tep_event); *actions = edit->actions; edit->lastx = motion.x; edit->lasty = motion.y; @@ -1421,7 +1423,7 @@ ect_print_height (ECellView *ecell_view, /* Checking if the text width goes beyond the column width to increase the * number of lines. */ - if ( text_width > width - 4) + if (text_width > width - 4) lines = (text_width / (width - 4)) + 1; return 16 *lines + 8; } @@ -1603,69 +1605,93 @@ e_cell_text_class_init (ECellTextClass *class) object_class->get_property = ect_get_property; object_class->set_property = ect_set_property; - signals[TEXT_INSERTED] = - g_signal_new ("text_inserted", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ECellTextClass, text_inserted), - NULL, NULL, - e_marshal_VOID__POINTER_INT_INT_INT_INT, - G_TYPE_NONE, 5, - G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT, - G_TYPE_INT, G_TYPE_INT); - - signals[TEXT_DELETED] = - g_signal_new ("text_deleted", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ECellTextClass, text_deleted), - NULL, NULL, - e_marshal_VOID__POINTER_INT_INT_INT_INT, - G_TYPE_NONE, 5, - G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT, - G_TYPE_INT, G_TYPE_INT); - - g_object_class_install_property (object_class, PROP_STRIKEOUT_COLUMN, - g_param_spec_int ("strikeout_column", - "Strikeout Column", - NULL, - -1, G_MAXINT, -1, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_UNDERLINE_COLUMN, - g_param_spec_int ("underline_column", - "Underline Column", - NULL, - -1, G_MAXINT, -1, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_BOLD_COLUMN, - g_param_spec_int ("bold_column", - "Bold Column", - NULL, - -1, G_MAXINT, -1, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_COLOR_COLUMN, - g_param_spec_int ("color_column", - "Color Column", - NULL, - -1, G_MAXINT, -1, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_EDITABLE, - g_param_spec_boolean ("editable", - "Editable", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_BG_COLOR_COLUMN, - g_param_spec_int ("bg_color_column", - "BG Color Column", - NULL, - -1, G_MAXINT, -1, - G_PARAM_READWRITE)); + signals[TEXT_INSERTED] = g_signal_new ( + "text_inserted", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ECellTextClass, text_inserted), + NULL, NULL, + e_marshal_VOID__POINTER_INT_INT_INT_INT, + G_TYPE_NONE, 5, + G_TYPE_POINTER, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_INT); + + signals[TEXT_DELETED] = g_signal_new ( + "text_deleted", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ECellTextClass, text_deleted), + NULL, NULL, + e_marshal_VOID__POINTER_INT_INT_INT_INT, + G_TYPE_NONE, 5, + G_TYPE_POINTER, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_INT); + + g_object_class_install_property ( + object_class, + PROP_STRIKEOUT_COLUMN, + g_param_spec_int ( + "strikeout_column", + "Strikeout Column", + NULL, + -1, G_MAXINT, -1, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_UNDERLINE_COLUMN, + g_param_spec_int ( + "underline_column", + "Underline Column", + NULL, + -1, G_MAXINT, -1, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_BOLD_COLUMN, + g_param_spec_int ( + "bold_column", + "Bold Column", + NULL, + -1, G_MAXINT, -1, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_COLOR_COLUMN, + g_param_spec_int ( + "color_column", + "Color Column", + NULL, + -1, G_MAXINT, -1, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_EDITABLE, + g_param_spec_boolean ( + "editable", + "Editable", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_BG_COLOR_COLUMN, + g_param_spec_int ( + "bg_color_column", + "BG Color Column", + NULL, + -1, G_MAXINT, -1, + G_PARAM_READWRITE)); if (!clipboard_atom) clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE); @@ -1702,8 +1728,8 @@ e_cell_text_get_cursor_locations (ECellTextView *tv, row = edit->row; col = edit->view_col; - e_table_item_get_cell_geometry (item, &row, &col, - &x, &y, NULL, &area.height); + e_table_item_get_cell_geometry ( + item, &row, &col, &x, &y, NULL, &area.height); gnome_canvas_item_get_bounds (GNOME_CANVAS_ITEM (parent_item), &x1, &y1, NULL, NULL); @@ -1711,10 +1737,11 @@ e_cell_text_get_cursor_locations (ECellTextView *tv, index = edit->selection_end + edit->preedit_pos; - pango_layout_get_cursor_pos (edit->layout, - index, - strong_pos ? &pango_strong_pos : NULL, - weak_pos ? &pango_weak_pos : NULL); + pango_layout_get_cursor_pos ( + edit->layout, + index, + strong_pos ? &pango_strong_pos : NULL, + weak_pos ? &pango_weak_pos : NULL); if (strong_pos) { strong_pos->x = x + x1 - cx - edit->xofs_edit + pango_strong_pos.x / PANGO_SCALE; @@ -1749,8 +1776,9 @@ e_cell_text_preedit_changed_cb (GtkIMContext *context, gchar *preedit_string; gint cursor_pos; CellEdit *edit = tv->edit; - gtk_im_context_get_preedit_string (edit->im_context, &preedit_string, - NULL, &cursor_pos); + gtk_im_context_get_preedit_string ( + edit->im_context, &preedit_string, + NULL, &cursor_pos); edit->preedit_length = strlen (preedit_string); cursor_pos = CLAMP (cursor_pos, 0, g_utf8_strlen (preedit_string, -1)); @@ -1784,11 +1812,11 @@ e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, { CellEdit *edit = tv->edit; - gtk_im_context_set_surrounding (context, - edit->text, - strlen (edit->text), - MIN (edit->selection_start, edit->selection_end) - ); + gtk_im_context_set_surrounding ( + context, + edit->text, + strlen (edit->text), + MIN (edit->selection_start, edit->selection_end)); return TRUE; } @@ -1804,8 +1832,9 @@ e_cell_text_delete_surrounding_cb (GtkIMContext *context, CellEdit *edit = tv->edit; text_len = g_utf8_strlen (edit->text, -1); - begin_pos = g_utf8_pointer_to_offset (edit->text, - edit->text + MIN (edit->selection_start, edit->selection_end)); + begin_pos = g_utf8_pointer_to_offset ( + edit->text, + edit->text + MIN (edit->selection_start, edit->selection_end)); begin_pos += offset; end_pos = begin_pos + n_chars; if (begin_pos < 0 || text_len < begin_pos) @@ -2023,8 +2052,9 @@ _blink_scroll_timeout (gpointer data) e_tep_event.motion.time = 0; e_tep_event.motion.position = get_position_from_xy (edit, edit->lastx, edit->lasty); _get_tep (edit); - e_text_event_processor_handle_event (edit->tep, - &e_tep_event); + e_text_event_processor_handle_event ( + edit->tep, + &e_tep_event); edit->scroll_start = current_time; } } @@ -2168,13 +2198,14 @@ _get_position (ECellTextView *text_view, return 0; case E_TEP_FORWARD_LINE: - pango_layout_move_cursor_visually (edit->layout, - TRUE, - edit->selection_end, - 0, - TRUE, - &index, - &trailing); + pango_layout_move_cursor_visually ( + edit->layout, + TRUE, + edit->selection_end, + 0, + TRUE, + &index, + &trailing); index = g_utf8_offset_to_pointer (edit->text + index, trailing) - edit->text; if (index < 0) return 0; @@ -2183,13 +2214,14 @@ _get_position (ECellTextView *text_view, return length; return index; case E_TEP_BACKWARD_LINE: - pango_layout_move_cursor_visually (edit->layout, - TRUE, - edit->selection_end, - 0, - TRUE, - &index, - &trailing); + pango_layout_move_cursor_visually ( + edit->layout, + TRUE, + edit->selection_end, + 0, + TRUE, + &index, + &trailing); index = g_utf8_offset_to_pointer (edit->text + index, trailing) - edit->text; if (index < 0) @@ -2360,9 +2392,10 @@ e_cell_text_view_command (ETextEventProcessor *tep, sel_start = MIN (edit->selection_start, edit->selection_end); sel_end = MAX (edit->selection_start, edit->selection_end); if (sel_start != sel_end) { - e_cell_text_view_supply_selection (edit, command->time, GDK_SELECTION_PRIMARY, - edit->text + sel_start, - sel_end - sel_start); + e_cell_text_view_supply_selection ( + edit, command->time, GDK_SELECTION_PRIMARY, + edit->text + sel_start, + sel_end - sel_start); } else if (edit->timer) { g_timer_reset (edit->timer); } @@ -2395,9 +2428,10 @@ e_cell_text_view_command (ETextEventProcessor *tep, sel_start = MIN (edit->selection_start, edit->selection_end); sel_end = MAX (edit->selection_start, edit->selection_end); if (sel_start != sel_end) { - e_cell_text_view_supply_selection (edit, command->time, clipboard_atom, - edit->text + sel_start, - sel_end - sel_start); + e_cell_text_view_supply_selection ( + edit, command->time, clipboard_atom, + edit->text + sel_start, + sel_end - sel_start); } if (edit->timer) { g_timer_reset (edit->timer); @@ -2520,9 +2554,10 @@ e_cell_text_view_get_selection (CellEdit *edit, guint32 time) { #if DO_SELECTION - gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (edit->text_view->canvas), - selection), - paste_received, edit); + gtk_clipboard_request_text ( + gtk_widget_get_clipboard (GTK_WIDGET (edit->text_view->canvas), + selection), + paste_received, edit); #endif } @@ -2764,8 +2799,9 @@ e_cell_text_get_text_by_view (ECellView *cell_view, if (edit && ectv->edit->row == row && ectv->edit->model_col == col) { /* being editted now */ ret = g_strdup (edit->text); } else{ - model_text = e_cell_text_get_text (E_CELL_TEXT (cell_view->ecell), - cell_view->e_table_model, col, row); + model_text = e_cell_text_get_text ( + E_CELL_TEXT (cell_view->ecell), + cell_view->e_table_model, col, row); ret = g_strdup (model_text); e_cell_text_free_text (E_CELL_TEXT (cell_view->ecell), model_text); } diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index cf5db5858a..f4de9d6922 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -186,7 +186,7 @@ cell_toggle_draw (ECellView *ecell_view, gint x, y; const gint value = GPOINTER_TO_INT ( - e_table_model_value_at (ecell_view->e_table_model, model_col, row)); + e_table_model_value_at (ecell_view->e_table_model, model_col, row)); priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell); @@ -307,9 +307,12 @@ cell_toggle_print (ECellView *ecell_view, image = gdk_pixbuf_add_alpha (image, TRUE, 255, 255, 255); image_width = (gdouble) gdk_pixbuf_get_width (image); image_height = (gdouble) gdk_pixbuf_get_height (image); - cairo_rectangle (cr, image_width / 7, image_height / 3, - image_width - image_width / 4, - image_width - image_height / 7); + cairo_rectangle ( + cr, + image_width / 7, + image_height / 3, + image_width - image_width / 4, + image_width - image_height / 7); cairo_clip (cr); gdk_cairo_set_source_pixbuf (cr, image, 0, image_height / 4); cairo_paint (cr); diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index e4bb093912..3a3bd7be99 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -280,9 +280,10 @@ ect_draw (ECellView *ecell_view, } if (node_image) { - gdk_cairo_set_source_pixbuf (cr, node_image, - x1 + subcell_offset, - y1 + (y2 - y1) / 2 - node_image_height / 2); + gdk_cairo_set_source_pixbuf ( + cr, node_image, + x1 + subcell_offset, + y1 + (y2 - y1) / 2 - node_image_height / 2); cairo_paint (cr); subcell_offset += node_image_width; @@ -291,9 +292,10 @@ ect_draw (ECellView *ecell_view, /* Now cause our subcell to draw its contents, shifted by * subcell_offset pixels */ - e_cell_draw (tree_view->subcell_view, cr, - model_col, view_col, row, flags, - x1 + subcell_offset, y1, x2, y2); + e_cell_draw ( + tree_view->subcell_view, cr, + model_col, view_col, row, flags, + x1 + subcell_offset, y1, x2, y2); cairo_restore (cr); } @@ -426,8 +428,9 @@ ect_event (ECellView *ecell_view, cairo_t *cr; gint hgt; - e_table_item_get_cell_geometry (tree_view->cell_view.e_table_item_view, - &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height); + e_table_item_get_cell_geometry ( + tree_view->cell_view.e_table_item_view, + &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height); area.width = offset - 2; hgt = e_cell_height (ecell_view, model_col, view_col, row); @@ -466,8 +469,9 @@ ect_event (ECellView *ecell_view, gint tmp_row = row; cairo_t *cr; - e_table_item_get_cell_geometry (tree_view->cell_view.e_table_item_view, - &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height); + e_table_item_get_cell_geometry ( + tree_view->cell_view.e_table_item_view, + &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height); area.width = offset - 2; cr = gdk_cairo_create (window); @@ -492,8 +496,9 @@ ect_event (ECellView *ecell_view, GdkRectangle area; cairo_t *cr; - e_table_item_get_cell_geometry (tree_view->cell_view.e_table_item_view, - &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height); + e_table_item_get_cell_geometry ( + tree_view->cell_view.e_table_item_view, + &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height); area.width = offset - 2; cr = gdk_cairo_create (window); @@ -666,16 +671,19 @@ ect_print (ECellView *ecell_view, if (!e_tree_model_node_is_root (tree_model, node) || e_tree_model_node_get_children (tree_model, node, NULL) > 0) { - cairo_move_to (cr, + cairo_move_to ( + cr, offset - INDENT_AMOUNT / 2, height / 2); cairo_line_to (cr, offset, height / 2); } if (visible_depth_of_node (ecell_view->e_table_model, row) != 0) { - cairo_move_to (cr, + cairo_move_to ( + cr, offset - INDENT_AMOUNT / 2, height); - cairo_line_to (cr, + cairo_line_to ( + cr, offset - INDENT_AMOUNT / 2, e_tree_table_adapter_node_get_next (tree_table_adapter, node) ? 0 : @@ -690,10 +698,12 @@ ect_print (ECellView *ecell_view, offset -= INDENT_AMOUNT; while (node && depth != 0) { if (e_tree_table_adapter_node_get_next (tree_table_adapter, node)) { - cairo_move_to (cr, + cairo_move_to ( + cr, offset - INDENT_AMOUNT / 2, height); - cairo_line_to (cr, + cairo_line_to ( + cr, offset - INDENT_AMOUNT / 2, 0); } node = e_tree_model_node_get_parent (tree_model, node); diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h index 830184c06d..38fcc68c32 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-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index d14350fa55..b08d3fcf39 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -68,9 +68,10 @@ etcta_cursor_change (GObject *object, gint col, ETableClickToAdd *etcta) { - g_signal_emit (etcta, - etcta_signals[CURSOR_CHANGE], 0, - row, col); + g_signal_emit ( + etcta, + etcta_signals[CURSOR_CHANGE], 0, + row, col); } static void @@ -105,9 +106,10 @@ etcta_add_table_header (ETableClickToAdd *etcta, if (etcta->eth) g_object_ref (etcta->eth); if (etcta->row) - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etcta->row), - "ETableHeader", header, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etcta->row), + "ETableHeader", header, + NULL); } static void @@ -128,12 +130,14 @@ etcta_add_one (ETableClickToAdd *etcta, if (etcta->one) g_object_ref (etcta->one); if (etcta->row) - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etcta->row), - "ETableModel", one, - NULL); - g_object_set (etcta->selection, - "model", one, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etcta->row), + "ETableModel", one, + NULL); + g_object_set ( + etcta->selection, + "model", one, + NULL); } static void @@ -143,9 +147,10 @@ etcta_drop_one (ETableClickToAdd *etcta) return; g_object_unref (etcta->one); etcta->one = NULL; - g_object_set (etcta->selection, - "model", NULL, - NULL); + g_object_set ( + etcta->selection, + "model", NULL, + NULL); } static void @@ -225,17 +230,20 @@ etcta_set_property (GObject *object, case PROP_WIDTH: etcta->width = g_value_get_double (value); if (etcta->row) - gnome_canvas_item_set (etcta->row, - "minimum_width", etcta->width, - NULL); + gnome_canvas_item_set ( + etcta->row, + "minimum_width", etcta->width, + NULL); if (etcta->text) - gnome_canvas_item_set (etcta->text, - "width", (etcta->width < 4 ? 4 : etcta->width) - 4, - NULL); + gnome_canvas_item_set ( + etcta->text, + "width", (etcta->width < 4 ? 4 : etcta->width) - 4, + NULL); if (etcta->rect) - gnome_canvas_item_set (etcta->rect, - "x2", etcta->width - 1, - NULL); + gnome_canvas_item_set ( + etcta->rect, + "x2", etcta->width - 1, + NULL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -352,9 +360,10 @@ item_key_press (ETableItem *item, static void set_initial_selection (ETableClickToAdd *etcta) { - e_selection_model_do_something (E_SELECTION_MODEL (etcta->selection), - 0, e_table_header_prioritized_column (etcta->eth), - 0); + e_selection_model_do_something ( + E_SELECTION_MODEL (etcta->selection), + 0, e_table_header_prioritized_column (etcta->eth), + 0); } static void @@ -375,16 +384,17 @@ finish_editing (ETableClickToAdd *etcta) e_selection_model_clear (E_SELECTION_MODEL (etcta->selection)); - etcta->row = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etcta), - e_table_item_get_type (), - "ETableHeader", etcta->eth, - "ETableModel", etcta->one, - "minimum_width", etcta->width, - "horizontal_draw_grid", TRUE, - "vertical_draw_grid", TRUE, - "selection_model", etcta->selection, - "cursor_mode", E_CURSOR_SPREADSHEET, - NULL); + etcta->row = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (etcta), + e_table_item_get_type (), + "ETableHeader", etcta->eth, + "ETableModel", etcta->one, + "minimum_width", etcta->width, + "horizontal_draw_grid", TRUE, + "vertical_draw_grid", TRUE, + "selection_model", etcta->selection, + "cursor_mode", E_CURSOR_SPREADSHEET, + NULL); g_signal_connect ( etcta->row, "key_press", @@ -425,16 +435,17 @@ etcta_event (GnomeCanvasItem *item, e_selection_model_clear (E_SELECTION_MODEL (etcta->selection)); - etcta->row = gnome_canvas_item_new (GNOME_CANVAS_GROUP (item), - e_table_item_get_type (), - "ETableHeader", etcta->eth, - "ETableModel", etcta->one, - "minimum_width", etcta->width, - "horizontal_draw_grid", TRUE, - "vertical_draw_grid", TRUE, - "selection_model", etcta->selection, - "cursor_mode", E_CURSOR_SPREADSHEET, - NULL); + etcta->row = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (item), + e_table_item_get_type (), + "ETableHeader", etcta->eth, + "ETableModel", etcta->one, + "minimum_width", etcta->width, + "horizontal_draw_grid", TRUE, + "vertical_draw_grid", TRUE, + "selection_model", etcta->selection, + "cursor_mode", E_CURSOR_SPREADSHEET, + NULL); g_signal_connect ( etcta->row, "key_press", @@ -483,21 +494,24 @@ etcta_reflow (GnomeCanvasItem *item, gdouble old_height = etcta->height; if (etcta->text) { - g_object_get (etcta->text, - "height", &etcta->height, - NULL); + g_object_get ( + etcta->text, + "height", &etcta->height, + NULL); etcta->height += 6; } if (etcta->row) { - g_object_get (etcta->row, - "height", &etcta->height, - NULL); + g_object_get ( + etcta->row, + "height", &etcta->height, + NULL); } if (etcta->rect) { - g_object_set (etcta->rect, - "y2", etcta->height - 1, - NULL); + g_object_set ( + etcta->rect, + "y2", etcta->height - 1, + NULL); } if (old_height != etcta->height) @@ -521,58 +535,78 @@ etcta_class_init (ETableClickToAddClass *class) item_class->unrealize = etcta_unrealize; item_class->event = etcta_event; - g_object_class_install_property (object_class, PROP_HEADER, - g_param_spec_object ("header", - "Header", - NULL, - E_TYPE_TABLE_HEADER, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_MODEL, - g_param_spec_object ("model", - "Model", - NULL, - E_TYPE_TABLE_MODEL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_MESSAGE, - g_param_spec_string ("message", - "Message", - NULL, - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - NULL, - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION)); - - g_object_class_install_property (object_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - NULL, - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READABLE | G_PARAM_LAX_VALIDATION)); - - etcta_signals[CURSOR_CHANGE] = - g_signal_new ("cursor_change", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableClickToAddClass, cursor_change), - NULL, NULL, - e_marshal_VOID__INT_INT, - G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - - etcta_signals[STYLE_SET] = - g_signal_new ("style_set", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableClickToAddClass, style_set), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, GTK_TYPE_STYLE); + g_object_class_install_property ( + object_class, + PROP_HEADER, + g_param_spec_object ( + "header", + "Header", + NULL, + E_TYPE_TABLE_HEADER, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_MODEL, + g_param_spec_object ( + "model", + "Model", + NULL, + E_TYPE_TABLE_MODEL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_MESSAGE, + g_param_spec_string ( + "message", + "Message", + NULL, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + NULL, + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE | + G_PARAM_LAX_VALIDATION)); + + g_object_class_install_property ( + object_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + NULL, + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE | + G_PARAM_LAX_VALIDATION)); + + etcta_signals[CURSOR_CHANGE] = g_signal_new ( + "cursor_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableClickToAddClass, cursor_change), + NULL, NULL, + e_marshal_VOID__INT_INT, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_INT); + + etcta_signals[STYLE_SET] = g_signal_new ( + "style_set", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableClickToAddClass, style_set), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_STYLE); gal_a11y_e_table_click_to_add_init (); } diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c index fc7da9c9f5..823aba415d 100644 --- a/widgets/table/e-table-col.c +++ b/widgets/table/e-table-col.c @@ -124,12 +124,15 @@ e_table_col_class_init (ETableColClass *class) object_class->set_property = etc_set_property; object_class->get_property = etc_get_property; - g_object_class_install_property (object_class, PROP_COMPARE_COL, - g_param_spec_int ("compare_col", - "Width", - "Width", - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_COMPARE_COL, + g_param_spec_int ( + "compare_col", + "Width", + "Width", + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); } static void diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 3547bb3169..3be7539ada 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -99,17 +99,19 @@ e_table_config_changed (ETableConfig *config, { g_return_if_fail (E_IS_TABLE_CONFIG (config)); - g_signal_emit (G_OBJECT (config), e_table_config_signals[CHANGED], 0, state); + g_signal_emit (config, e_table_config_signals[CHANGED], 0, state); } static void config_dialog_changed (ETableConfig *config) { /* enable the apply/ok buttons */ - gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel), - GTK_RESPONSE_APPLY, TRUE); - gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel), - GTK_RESPONSE_OK, TRUE); + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (config->dialog_toplevel), + GTK_RESPONSE_APPLY, TRUE); + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (config->dialog_toplevel), + GTK_RESPONSE_OK, TRUE); } static void @@ -139,21 +141,24 @@ e_table_config_class_init (ETableConfigClass *class) object_class->finalize = config_finalize; object_class->get_property = config_get_property; - e_table_config_signals[CHANGED] = - g_signal_new ("changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableConfigClass, changed), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - g_object_class_install_property (object_class, PROP_STATE, - g_param_spec_object ("state", - "State", - NULL, - E_TYPE_TABLE_STATE, - G_PARAM_READABLE)); + e_table_config_signals[CHANGED] = g_signal_new ( + "changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableConfigClass, changed), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + g_object_class_install_property ( + object_class, + PROP_STATE, + g_param_spec_object ( + "state", + "State", + NULL, + E_TYPE_TABLE_STATE, + G_PARAM_READABLE)); } static void @@ -1249,9 +1254,10 @@ configure_fields_dialog (ETableConfig *config, scrolled = e_builder_get_widget (builder, "available-scrolled"); gtk_container_add (GTK_CONTAINER (scrolled), etable); config->available = E_TABLE (etable); - g_object_get (config->available, - "model", &config->available_model, - NULL); + g_object_get ( + config->available, + "model", &config->available_model, + NULL); gtk_widget_show_all (etable); gtk_label_set_mnemonic_widget ( GTK_LABEL (e_builder_get_widget ( @@ -1263,9 +1269,10 @@ configure_fields_dialog (ETableConfig *config, scrolled = e_builder_get_widget (builder, "shown-scrolled"); gtk_container_add (GTK_CONTAINER (scrolled), etable); config->shown = E_TABLE (etable); - g_object_get (config->shown, - "model", &config->shown_model, - NULL); + g_object_get ( + config->shown, + "model", &config->shown_model, + NULL); gtk_widget_show_all (etable); gtk_label_set_mnemonic_widget ( GTK_LABEL (e_builder_get_widget ( @@ -1351,8 +1358,9 @@ setup_gui (ETableConfig *config) configure_group_dialog (config, builder); configure_fields_dialog (config, builder); - g_object_weak_ref (G_OBJECT (config->dialog_toplevel), - dialog_destroyed, config); + g_object_weak_ref ( + G_OBJECT (config->dialog_toplevel), + dialog_destroyed, config); g_signal_connect ( config->dialog_toplevel, "response", @@ -1449,8 +1457,9 @@ e_table_config_new (const gchar *header, widget = gtk_dialog_get_action_area (dialog); gtk_container_set_border_width (GTK_CONTAINER (widget), 12); - gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel), - GTK_RESPONSE_APPLY, FALSE); + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (config->dialog_toplevel), + GTK_RESPONSE_APPLY, FALSE); gtk_widget_show (config->dialog_toplevel); return E_TABLE_CONFIG (config); diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index 6e69ccd6ad..fb005ed30f 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -56,9 +56,10 @@ e_table_field_chooser_dialog_set_property (GObject *object, g_free (etfcd->dnd_code); etfcd->dnd_code = g_strdup (g_value_get_string (value)); if (etfcd->etfc) - g_object_set (etfcd->etfc, - "dnd_code", etfcd->dnd_code, - NULL); + g_object_set ( + etfcd->etfc, + "dnd_code", etfcd->dnd_code, + NULL); break; case PROP_FULL_HEADER: if (etfcd->full_header) @@ -70,9 +71,10 @@ e_table_field_chooser_dialog_set_property (GObject *object, if (etfcd->full_header) g_object_ref (etfcd->full_header); if (etfcd->etfc) - g_object_set (etfcd->etfc, - "full_header", etfcd->full_header, - NULL); + g_object_set ( + etfcd->etfc, + "full_header", etfcd->full_header, + NULL); break; case PROP_HEADER: if (etfcd->header) @@ -84,9 +86,10 @@ e_table_field_chooser_dialog_set_property (GObject *object, if (etfcd->header) g_object_ref (etfcd->header); if (etfcd->etfc) - g_object_set (etfcd->etfc, - "header", etfcd->header, - NULL); + g_object_set ( + etfcd->etfc, + "header", etfcd->header, + NULL); break; default: break; @@ -210,11 +213,12 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos widget = e_table_field_chooser_new (); e_table_field_chooser_dialog->etfc = E_TABLE_FIELD_CHOOSER (widget); - g_object_set (widget, - "dnd_code", e_table_field_chooser_dialog->dnd_code, - "full_header", e_table_field_chooser_dialog->full_header, - "header", e_table_field_chooser_dialog->header, - NULL); + g_object_set ( + widget, + "dnd_code", e_table_field_chooser_dialog->dnd_code, + "full_header", e_table_field_chooser_dialog->full_header, + "header", e_table_field_chooser_dialog->header, + NULL); content_area = gtk_dialog_get_content_area (dialog); gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index 32d2904bb9..3c6c33cdcf 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -425,11 +425,12 @@ etfci_drag_data_get (GtkWidget *widget, { if (etfci->drag_col != -1) { gchar *string = g_strdup_printf ("%d", etfci->drag_col); - gtk_selection_data_set (selection_data, - GDK_SELECTION_TYPE_STRING, - sizeof (string[0]), - (guchar *) string, - strlen (string)); + gtk_selection_data_set ( + selection_data, + GDK_SELECTION_TYPE_STRING, + sizeof (string[0]), + (guchar *) string, + strlen (string)); g_free (string); } } @@ -518,12 +519,13 @@ etfci_draw (GnomeCanvasItem *item, cairo_save (cr); - e_table_header_draw_button (cr, ecol, - GTK_WIDGET (canvas), - -x, y1 - y, - width, height, - etfci->width, y2 - y1, - E_TABLE_COL_ARROW_NONE); + e_table_header_draw_button ( + cr, ecol, + GTK_WIDGET (canvas), + -x, y1 - y, + width, height, + etfci->width, y2 - y1, + E_TABLE_COL_ARROW_NONE); cairo_restore (cr); } @@ -596,8 +598,9 @@ etfci_start_drag (ETableFieldChooserItem *etfci, g_free ((gpointer) etfci_drag_types[0].target); button_height = e_table_header_compute_height (ecol, widget); - cs = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - etfci->width, button_height); + cs = cairo_image_surface_create ( + CAIRO_FORMAT_ARGB32, + etfci->width, button_height); cr = cairo_create (cs); e_table_header_draw_button ( @@ -671,40 +674,55 @@ etfci_class_init (ETableFieldChooserItemClass *class) item_class->point = etfci_point; item_class->event = etfci_event; - g_object_class_install_property (object_class, PROP_DND_CODE, - g_param_spec_string ("dnd_code", - "DnD code", - NULL, - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_FULL_HEADER, - g_param_spec_object ("full_header", - "Full Header", - NULL, - E_TYPE_TABLE_HEADER, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_HEADER, - g_param_spec_object ("header", - "Header", - NULL, - E_TYPE_TABLE_HEADER, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - NULL, - 0, G_MAXDOUBLE, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - NULL, - 0, G_MAXDOUBLE, 0, - G_PARAM_READABLE)); + g_object_class_install_property ( + object_class, + PROP_DND_CODE, + g_param_spec_string ( + "dnd_code", + "DnD code", + NULL, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_FULL_HEADER, + g_param_spec_object ( + "full_header", + "Full Header", + NULL, + E_TYPE_TABLE_HEADER, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HEADER, + g_param_spec_object ( + "header", + "Header", + NULL, + E_TYPE_TABLE_HEADER, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + NULL, + 0, G_MAXDOUBLE, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + NULL, + 0, G_MAXDOUBLE, 0, + G_PARAM_READABLE)); } static void diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index 19791fb229..50f8267109 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -60,26 +60,35 @@ e_table_field_chooser_class_init (ETableFieldChooserClass *class) object_class->get_property = e_table_field_chooser_get_property; object_class->dispose = e_table_field_chooser_dispose; - g_object_class_install_property (object_class, PROP_DND_CODE, - g_param_spec_string ("dnd_code", - "DnD code", - NULL, - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_FULL_HEADER, - g_param_spec_object ("full_header", - "Full Header", - NULL, - E_TYPE_TABLE_HEADER, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_HEADER, - g_param_spec_object ("header", - "Header", - NULL, - E_TYPE_TABLE_HEADER, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_DND_CODE, + g_param_spec_string ( + "dnd_code", + "DnD code", + NULL, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_FULL_HEADER, + g_param_spec_object ( + "full_header", + "Full Header", + NULL, + E_TYPE_TABLE_HEADER, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HEADER, + g_param_spec_object ( + "header", + "Header", + NULL, + E_TYPE_TABLE_HEADER, + G_PARAM_READWRITE)); } static void @@ -104,35 +113,40 @@ static void allocate_callback (GtkWidget *canvas, GtkAllocation *allocation, ETa { gdouble height; etfc->last_alloc = *allocation; - gnome_canvas_item_set ( etfc->item, - "width", (gdouble) allocation->width, - NULL ); - g_object_get (etfc->item, - "height", &height, - NULL); + gnome_canvas_item_set ( + etfc->item, + "width", (gdouble) allocation->width, + NULL); + g_object_get ( + etfc->item, + "height", &height, + NULL); height = MAX (height, allocation->height); - gnome_canvas_set_scroll_region (GNOME_CANVAS ( etfc->canvas ), 0, 0, allocation->width - 1, height - 1); - gnome_canvas_item_set ( etfc->rect, - "x2", (gdouble) allocation->width, - "y2", (gdouble) height, - NULL ); + gnome_canvas_set_scroll_region (GNOME_CANVAS (etfc->canvas), 0, 0, allocation->width - 1, height - 1); + gnome_canvas_item_set ( + etfc->rect, + "x2", (gdouble) allocation->width, + "y2", (gdouble) height, + NULL); ensure_nonzero_step_increments (etfc); } static void resize (GnomeCanvas *canvas, ETableFieldChooser *etfc) { gdouble height; - g_object_get (etfc->item, - "height", &height, - NULL); + g_object_get ( + etfc->item, + "height", &height, + NULL); height = MAX (height, etfc->last_alloc.height); gnome_canvas_set_scroll_region (GNOME_CANVAS (etfc->canvas), 0, 0, etfc->last_alloc.width - 1, height - 1); - gnome_canvas_item_set ( etfc->rect, - "x2", (gdouble) etfc->last_alloc.width, - "y2", (gdouble) height, - NULL ); + gnome_canvas_item_set ( + etfc->rect, + "x2", (gdouble) etfc->last_alloc.width, + "y2", (gdouble) height, + NULL); ensure_nonzero_step_increments (etfc); } @@ -184,22 +198,24 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) gtk_widget_set_size_request (widget, -1, 250); gtk_box_pack_start (GTK_BOX (etfc), widget, TRUE, TRUE, 0); - etfc->rect = gnome_canvas_item_new (gnome_canvas_root ( GNOME_CANVAS ( etfc->canvas ) ), - gnome_canvas_rect_get_type (), - "x1", (gdouble) 0, - "y1", (gdouble) 0, - "x2", (gdouble) 100, - "y2", (gdouble) 100, - "fill_color", "white", - NULL ); - - etfc->item = gnome_canvas_item_new (gnome_canvas_root (etfc->canvas), - e_table_field_chooser_item_get_type (), - "width", (gdouble) 100, - "full_header", etfc->full_header, - "header", etfc->header, - "dnd_code", etfc->dnd_code, - NULL ); + etfc->rect = gnome_canvas_item_new ( + gnome_canvas_root (GNOME_CANVAS (etfc->canvas)), + gnome_canvas_rect_get_type (), + "x1", (gdouble) 0, + "y1", (gdouble) 0, + "x2", (gdouble) 100, + "y2", (gdouble) 100, + "fill_color", "white", + NULL); + + etfc->item = gnome_canvas_item_new ( + gnome_canvas_root (etfc->canvas), + e_table_field_chooser_item_get_type (), + "width", (gdouble) 100, + "full_header", etfc->full_header, + "header", etfc->header, + "dnd_code", etfc->dnd_code, + NULL); g_signal_connect ( etfc->canvas, "reflow", @@ -207,7 +223,7 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) gnome_canvas_set_scroll_region ( GNOME_CANVAS (etfc->canvas), - 0, 0, 100, 100 ); + 0, 0, 100, 100); /* Connect the signals */ g_signal_connect ( @@ -256,9 +272,10 @@ e_table_field_chooser_set_property (GObject *object, g_free (etfc->dnd_code); etfc->dnd_code = g_strdup (g_value_get_string (value)); if (etfc->item) - g_object_set (etfc->item, - "dnd_code", etfc->dnd_code, - NULL); + g_object_set ( + etfc->item, + "dnd_code", etfc->dnd_code, + NULL); break; case PROP_FULL_HEADER: if (etfc->full_header) @@ -270,9 +287,10 @@ e_table_field_chooser_set_property (GObject *object, if (etfc->full_header) g_object_ref (etfc->full_header); if (etfc->item) - g_object_set (etfc->item, - "full_header", etfc->full_header, - NULL); + g_object_set ( + etfc->item, + "full_header", etfc->full_header, + NULL); break; case PROP_HEADER: if (etfc->header) @@ -284,9 +302,10 @@ e_table_field_chooser_set_property (GObject *object, if (etfc->header) g_object_ref (etfc->header); if (etfc->item) - g_object_set (etfc->item, - "header", etfc->header, - NULL); + g_object_set ( + etfc->item, + "header", etfc->header, + NULL); break; default: break; diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 9841b99d99..602ef12e17 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -74,8 +74,9 @@ e_table_group_container_child_node_free (ETableGroupContainer *etgc, ETableGroup *child = child_node->child; g_object_run_dispose (G_OBJECT (child)); - e_table_model_free_value (etg->model, etgc->ecol->col_idx, - child_node->key); + e_table_model_free_value ( + etg->model, etgc->ecol->col_idx, + child_node->key); g_free (child_node->string); g_object_run_dispose (G_OBJECT (child_node->text)); g_object_run_dispose (G_OBJECT (child_node->rect)); @@ -201,8 +202,9 @@ e_table_group_container_new (GnomeCanvasGroup *parent, etgc = g_object_new (E_TYPE_TABLE_GROUP_CONTAINER, NULL); - e_table_group_container_construct (parent, etgc, full_header, header, - model, sort_info, n); + e_table_group_container_construct ( + parent, etgc, full_header, header, + model, sort_info, n); return E_TABLE_GROUP (etgc); } @@ -357,11 +359,13 @@ compute_text (ETableGroupContainer *etgc, * 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)", - child_node->count), - etgc->ecol->text, child_node->string, - (gint) child_node->count); + text = g_strdup_printf ( + ngettext ( + "%s: %s (%d item)", + "%s: %s (%d items)", + child_node->count), + etgc->ecol->text, child_node->string, + (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. @@ -369,15 +373,18 @@ compute_text (ETableGroupContainer *etgc, * 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)", - child_node->count), - child_node->string, - (gint) child_node->count); + text = g_strdup_printf ( + ngettext ( + "%s (%d item)", + "%s (%d items)", + child_node->count), + child_node->string, + (gint) child_node->count); } - gnome_canvas_item_set (child_node->text, - "text", text, - NULL); + gnome_canvas_item_set ( + child_node->text, + "text", text, + NULL); g_free (text); } @@ -456,28 +463,32 @@ create_child_node (ETableGroupContainer *etgc, ETableGroup *etg = E_TABLE_GROUP (etgc); child_node = g_new (ETableGroupContainerChildNode, 1); - child_node->rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etgc), - gnome_canvas_rect_get_type (), - "fill_color", "grey70", - "outline_color", "grey50", - NULL); - child_node->text = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etgc), - e_text_get_type (), - "fill_color", "black", - NULL); - child = e_table_group_new (GNOME_CANVAS_GROUP (etgc), etg->full_header, - etg->header, etg->model, etgc->sort_info, etgc->n + 1); - gnome_canvas_item_set (GNOME_CANVAS_ITEM (child), - "alternating_row_colors", etgc->alternating_row_colors, - "horizontal_draw_grid", etgc->horizontal_draw_grid, - "vertical_draw_grid", etgc->vertical_draw_grid, - "drawfocus", etgc->draw_focus, - "cursor_mode", etgc->cursor_mode, - "selection_model", etgc->selection_model, - "length_threshold", etgc->length_threshold, - "uniform_row_height", etgc->uniform_row_height, - "minimum_width", etgc->minimum_width - GROUP_INDENT, - NULL); + child_node->rect = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (etgc), + gnome_canvas_rect_get_type (), + "fill_color", "grey70", + "outline_color", "grey50", + NULL); + child_node->text = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (etgc), + e_text_get_type (), + "fill_color", "black", + NULL); + child = e_table_group_new ( + GNOME_CANVAS_GROUP (etgc), etg->full_header, + etg->header, etg->model, etgc->sort_info, etgc->n + 1); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (child), + "alternating_row_colors", etgc->alternating_row_colors, + "horizontal_draw_grid", etgc->horizontal_draw_grid, + "vertical_draw_grid", etgc->vertical_draw_grid, + "drawfocus", etgc->draw_focus, + "cursor_mode", etgc->cursor_mode, + "selection_model", etgc->selection_model, + "length_threshold", etgc->length_threshold, + "uniform_row_height", etgc->uniform_row_height, + "minimum_width", etgc->minimum_width - GROUP_INDENT, + NULL); g_signal_connect ( child, "cursor_change", @@ -673,8 +684,9 @@ etgc_increment (ETableGroup *etg, GList *list; for (list = etgc->children; list; list = g_list_next (list)) - e_table_group_increment (((ETableGroupContainerChildNode *) list->data)->child, - position, amount); + e_table_group_increment ( + ((ETableGroupContainerChildNode *) list->data)->child, + position, amount); } static void @@ -686,8 +698,9 @@ etgc_decrement (ETableGroup *etg, GList *list; for (list = etgc->children; list; list = g_list_next (list)) - e_table_group_decrement (((ETableGroupContainerChildNode *) list->data)->child, - position, amount); + e_table_group_decrement ( + ((ETableGroupContainerChildNode *) list->data)->child, + position, amount); } static void @@ -698,11 +711,13 @@ etgc_set_focus (ETableGroup *etg, ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); if (etgc->children) { if (direction == E_FOCUS_END) - e_table_group_set_focus (((ETableGroupContainerChildNode *) g_list_last (etgc->children)->data)->child, - direction, view_col); + e_table_group_set_focus ( + ((ETableGroupContainerChildNode *) g_list_last (etgc->children)->data)->child, + direction, view_col); else - e_table_group_set_focus (((ETableGroupContainerChildNode *) etgc->children->data)->child, - direction, view_col); + e_table_group_set_focus ( + ((ETableGroupContainerChildNode *) etgc->children->data)->child, + direction, view_col); } } @@ -850,27 +865,30 @@ etgc_set_property (GObject *object, for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; - g_object_set (child_node->child, - "minimum_width", etgc->minimum_width - GROUP_INDENT, - NULL); + g_object_set ( + child_node->child, + "minimum_width", etgc->minimum_width - GROUP_INDENT, + NULL); } break; case PROP_LENGTH_THRESHOLD: etgc->length_threshold = g_value_get_int (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; - g_object_set (child_node->child, - "length_threshold", etgc->length_threshold, - NULL); + g_object_set ( + child_node->child, + "length_threshold", etgc->length_threshold, + NULL); } break; case PROP_UNIFORM_ROW_HEIGHT: etgc->uniform_row_height = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; - g_object_set (child_node->child, - "uniform_row_height", etgc->uniform_row_height, - NULL); + g_object_set ( + child_node->child, + "uniform_row_height", etgc->uniform_row_height, + NULL); } break; @@ -882,9 +900,10 @@ etgc_set_property (GObject *object, g_object_ref (etgc->selection_model); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; - g_object_set (child_node->child, - "selection_model", etgc->selection_model, - NULL); + g_object_set ( + child_node->child, + "selection_model", etgc->selection_model, + NULL); } break; @@ -892,9 +911,10 @@ etgc_set_property (GObject *object, etgc->alternating_row_colors = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; - g_object_set (child_node->child, - "alternating_row_colors", etgc->alternating_row_colors, - NULL); + g_object_set ( + child_node->child, + "alternating_row_colors", etgc->alternating_row_colors, + NULL); } break; @@ -902,9 +922,10 @@ etgc_set_property (GObject *object, etgc->horizontal_draw_grid = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; - g_object_set (child_node->child, - "horizontal_draw_grid", etgc->horizontal_draw_grid, - NULL); + g_object_set ( + child_node->child, + "horizontal_draw_grid", etgc->horizontal_draw_grid, + NULL); } break; @@ -912,9 +933,10 @@ etgc_set_property (GObject *object, etgc->vertical_draw_grid = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; - g_object_set (child_node->child, - "vertical_draw_grid", etgc->vertical_draw_grid, - NULL); + g_object_set ( + child_node->child, + "vertical_draw_grid", etgc->vertical_draw_grid, + NULL); } break; @@ -922,9 +944,10 @@ etgc_set_property (GObject *object, etgc->draw_focus = g_value_get_boolean (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; - g_object_set (child_node->child, - "drawfocus", etgc->draw_focus, - NULL); + g_object_set ( + child_node->child, + "drawfocus", etgc->draw_focus, + NULL); } break; @@ -932,9 +955,10 @@ etgc_set_property (GObject *object, etgc->cursor_mode = g_value_get_int (value); for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; - g_object_set (child_node->child, - "cursor_mode", etgc->cursor_mode, - NULL); + g_object_set ( + child_node->child, + "cursor_mode", etgc->cursor_mode, + NULL); } break; default: @@ -1002,89 +1026,127 @@ etgc_class_init (ETableGroupContainerClass *class) e_group_class->get_mouse_over = etgc_get_mouse_over; e_group_class->get_cell_geometry = etgc_get_cell_geometry; - g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS, - g_param_spec_boolean ("alternating_row_colors", - "Alternating Row Colors", - "Alternating Row Colors", - FALSE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID, - g_param_spec_boolean ("horizontal_draw_grid", - "Horizontal Draw Grid", - "Horizontal Draw Grid", - FALSE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID, - g_param_spec_boolean ("vertical_draw_grid", - "Vertical Draw Grid", - "Vertical Draw Grid", - FALSE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS, - g_param_spec_boolean ("drawfocus", - "Draw focus", - "Draw focus", - FALSE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_CURSOR_MODE, - g_param_spec_int ("cursor_mode", - "Cursor mode", - "Cursor mode", - E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_SELECTION_MODEL, - g_param_spec_object ("selection_model", - "Selection model", - "Selection model", - E_TYPE_SELECTION_MODEL, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD, - g_param_spec_int ("length_threshold", - "Length Threshold", - "Length Threshold", - -1, G_MAXINT, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT, - g_param_spec_boolean ("uniform_row_height", - "Uniform row height", - "Uniform row height", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_FROZEN, - g_param_spec_boolean ("frozen", - "Frozen", - "Frozen", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - "Height", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - "Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH, - g_param_spec_double ("minimum_width", - "Minimum width", - "Minimum Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_TABLE_ALTERNATING_ROW_COLORS, + g_param_spec_boolean ( + "alternating_row_colors", + "Alternating Row Colors", + "Alternating Row Colors", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_HORIZONTAL_DRAW_GRID, + g_param_spec_boolean ( + "horizontal_draw_grid", + "Horizontal Draw Grid", + "Horizontal Draw Grid", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_VERTICAL_DRAW_GRID, + g_param_spec_boolean ( + "vertical_draw_grid", + "Vertical Draw Grid", + "Vertical Draw Grid", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_DRAW_FOCUS, + g_param_spec_boolean ( + "drawfocus", + "Draw focus", + "Draw focus", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_CURSOR_MODE, + g_param_spec_int ( + "cursor_mode", + "Cursor mode", + "Cursor mode", + E_CURSOR_LINE, + E_CURSOR_SPREADSHEET, + E_CURSOR_LINE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_SELECTION_MODEL, + g_param_spec_object ( + "selection_model", + "Selection model", + "Selection model", + E_TYPE_SELECTION_MODEL, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_LENGTH_THRESHOLD, + g_param_spec_int ( + "length_threshold", + "Length Threshold", + "Length Threshold", + -1, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_UNIFORM_ROW_HEIGHT, + g_param_spec_boolean ( + "uniform_row_height", + "Uniform row height", + "Uniform row height", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_FROZEN, + g_param_spec_boolean ( + "frozen", + "Frozen", + "Frozen", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + "Height", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + "Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_MINIMUM_WIDTH, + g_param_spec_double ( + "minimum_width", + "Minimum width", + "Minimum Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); } static void @@ -1094,9 +1156,10 @@ etgc_reflow (GnomeCanvasItem *item, ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item); gboolean frozen; - g_object_get (etgc, - "frozen", &frozen, - NULL); + g_object_get ( + etgc, + "frozen", &frozen, + NULL); if (frozen) return; @@ -1133,38 +1196,43 @@ etgc_reflow (GnomeCanvasItem *item, running_height = extra_height; - for ( list = etgc->children; list; list = g_list_next (list)) { + for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; ETableGroup *child = child_node->child; - g_object_get (child, - "width", &item_width, - NULL); + g_object_get ( + child, + "width", &item_width, + NULL); if (item_width > running_width) running_width = item_width; } - for ( list = etgc->children; list; list = g_list_next (list)) { + for (list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; ETableGroup *child = child_node->child; - g_object_get (child, - "height", &item_height, - NULL); - - e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (child_node->text), - GROUP_INDENT, - running_height - GROUP_INDENT - BUTTON_PADDING); - - e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (child), - GROUP_INDENT, - running_height); - - gnome_canvas_item_set (GNOME_CANVAS_ITEM (child_node->rect), - "x1", (gdouble) 0, - "x2", (gdouble) running_width + GROUP_INDENT, - "y1", (gdouble) running_height - extra_height, - "y2", (gdouble) running_height + item_height, - NULL); + g_object_get ( + child, + "height", &item_height, + NULL); + + e_canvas_item_move_absolute ( + GNOME_CANVAS_ITEM (child_node->text), + GROUP_INDENT, + running_height - GROUP_INDENT - BUTTON_PADDING); + + e_canvas_item_move_absolute ( + GNOME_CANVAS_ITEM (child), + GROUP_INDENT, + running_height); + + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (child_node->rect), + "x1", (gdouble) 0, + "x2", (gdouble) running_width + GROUP_INDENT, + "y1", (gdouble) running_height - extra_height, + "y2", (gdouble) running_height + item_height, + NULL); running_height += item_height + extra_height; } @@ -1217,8 +1285,9 @@ e_table_group_apply_to_leafs (ETableGroup *etg, } else if (E_IS_TABLE_GROUP_LEAF (etg)) { (*fn) (E_TABLE_GROUP_LEAF (etg)->item, closure); } else { - g_error ("Unknown ETableGroup found: %s", - g_type_name (G_TYPE_FROM_INSTANCE (etg))); + g_error ( + "Unknown ETableGroup found: %s", + g_type_name (G_TYPE_FROM_INSTANCE (etg))); } } @@ -1328,16 +1397,18 @@ e_table_group_container_print_page (EPrintable *ep, cairo_move_to (cr, 0, 0); if (groupcontext->etgc->ecol->text) - string = g_strdup_printf ("%s : %s (%d item%s)", - groupcontext->etgc->ecol->text, - child_node->string, - (gint) child_node->count, - child_node->count == 1 ? "" : "s"); + string = g_strdup_printf ( + "%s : %s (%d item%s)", + groupcontext->etgc->ecol->text, + child_node->string, + (gint) child_node->count, + child_node->count == 1 ? "" : "s"); else - string = g_strdup_printf ("%s (%d item%s)", - child_node->string, - (gint) child_node->count, - child_node->count == 1 ? "" : "s"); + string = g_strdup_printf ( + "%s (%d item%s)", + child_node->string, + (gint) child_node->count, + child_node->count == 1 ? "" : "s"); pango_layout_set_text (layout, string, -1); pango_cairo_show_layout (cr, layout); g_free (string); diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index fba38abfbb..2da75bf006 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -69,26 +69,33 @@ etgl_dispose (GObject *object) if (etgl->item) { if (etgl->etgl_cursor_change_id != 0) - g_signal_handler_disconnect (etgl->item, - etgl->etgl_cursor_change_id); + g_signal_handler_disconnect ( + etgl->item, + etgl->etgl_cursor_change_id); if (etgl->etgl_cursor_activated_id != 0) - g_signal_handler_disconnect (etgl->item, - etgl->etgl_cursor_activated_id); + g_signal_handler_disconnect ( + etgl->item, + etgl->etgl_cursor_activated_id); if (etgl->etgl_double_click_id != 0) - g_signal_handler_disconnect (etgl->item, - etgl->etgl_double_click_id); + g_signal_handler_disconnect ( + etgl->item, + etgl->etgl_double_click_id); if (etgl->etgl_right_click_id != 0) - g_signal_handler_disconnect (etgl->item, - etgl->etgl_right_click_id); + g_signal_handler_disconnect ( + etgl->item, + etgl->etgl_right_click_id); if (etgl->etgl_click_id != 0) - g_signal_handler_disconnect (etgl->item, - etgl->etgl_click_id); + g_signal_handler_disconnect ( + etgl->item, + etgl->etgl_click_id); if (etgl->etgl_key_press_id != 0) - g_signal_handler_disconnect (etgl->item, - etgl->etgl_key_press_id); + g_signal_handler_disconnect ( + etgl->item, + etgl->etgl_key_press_id); if (etgl->etgl_start_drag_id != 0) - g_signal_handler_disconnect (etgl->item, - etgl->etgl_start_drag_id); + g_signal_handler_disconnect ( + etgl->item, + etgl->etgl_start_drag_id); etgl->etgl_cursor_change_id = 0; etgl->etgl_cursor_activated_id = 0; @@ -502,17 +509,19 @@ etgl_set_property (GObject *object, case PROP_WIDTH: etgl->minimum_width = g_value_get_double (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), - "minimum_width", etgl->minimum_width, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etgl->item), + "minimum_width", etgl->minimum_width, + NULL); } break; case PROP_LENGTH_THRESHOLD: etgl->length_threshold = g_value_get_int (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), - "length_threshold", etgl->length_threshold, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etgl->item), + "length_threshold", etgl->length_threshold, + NULL); } break; case PROP_SELECTION_MODEL: @@ -523,63 +532,70 @@ etgl_set_property (GObject *object, g_object_ref (etgl->selection_model); } if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), - "selection_model", etgl->selection_model, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etgl->item), + "selection_model", etgl->selection_model, + NULL); } break; case PROP_UNIFORM_ROW_HEIGHT: etgl->uniform_row_height = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), - "uniform_row_height", etgl->uniform_row_height, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etgl->item), + "uniform_row_height", etgl->uniform_row_height, + NULL); } break; case PROP_TABLE_ALTERNATING_ROW_COLORS: etgl->alternating_row_colors = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), - "alternating_row_colors", etgl->alternating_row_colors, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etgl->item), + "alternating_row_colors", etgl->alternating_row_colors, + NULL); } break; case PROP_TABLE_HORIZONTAL_DRAW_GRID: etgl->horizontal_draw_grid = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), - "horizontal_draw_grid", etgl->horizontal_draw_grid, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etgl->item), + "horizontal_draw_grid", etgl->horizontal_draw_grid, + NULL); } break; case PROP_TABLE_VERTICAL_DRAW_GRID: etgl->vertical_draw_grid = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), - "vertical_draw_grid", etgl->vertical_draw_grid, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etgl->item), + "vertical_draw_grid", etgl->vertical_draw_grid, + NULL); } break; case PROP_TABLE_DRAW_FOCUS: etgl->draw_focus = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), - "drawfocus", etgl->draw_focus, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etgl->item), + "drawfocus", etgl->draw_focus, + NULL); } break; case PROP_CURSOR_MODE: etgl->cursor_mode = g_value_get_int (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), - "cursor_mode", etgl->cursor_mode, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etgl->item), + "cursor_mode", etgl->cursor_mode, + NULL); } break; default: diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index 8d820f861a..032ec7dd88 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -443,9 +443,10 @@ e_table_group_cursor_change (ETableGroup *e_table_group, g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); - g_signal_emit (e_table_group, - etg_signals[CURSOR_CHANGE], 0, - row); + g_signal_emit ( + e_table_group, + etg_signals[CURSOR_CHANGE], 0, + row); } /** @@ -462,9 +463,10 @@ e_table_group_cursor_activated (ETableGroup *e_table_group, g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); - g_signal_emit (e_table_group, - etg_signals[CURSOR_ACTIVATED], 0, - row); + g_signal_emit ( + e_table_group, + etg_signals[CURSOR_ACTIVATED], 0, + row); } /** @@ -485,9 +487,10 @@ e_table_group_double_click (ETableGroup *e_table_group, g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); - g_signal_emit (e_table_group, - etg_signals[DOUBLE_CLICK], 0, - row, col, event); + g_signal_emit ( + e_table_group, + etg_signals[DOUBLE_CLICK], 0, + row, col, event); } /** @@ -510,9 +513,10 @@ e_table_group_right_click (ETableGroup *e_table_group, g_return_val_if_fail (e_table_group != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE); - g_signal_emit (e_table_group, - etg_signals[RIGHT_CLICK], 0, - row, col, event, &return_val); + g_signal_emit ( + e_table_group, + etg_signals[RIGHT_CLICK], 0, + row, col, event, &return_val); return return_val; } @@ -537,9 +541,10 @@ e_table_group_click (ETableGroup *e_table_group, g_return_val_if_fail (e_table_group != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE); - g_signal_emit (e_table_group, - etg_signals[CLICK], 0, - row, col, event, &return_val); + g_signal_emit ( + e_table_group, + etg_signals[CLICK], 0, + row, col, event, &return_val); return return_val; } @@ -564,9 +569,10 @@ e_table_group_key_press (ETableGroup *e_table_group, g_return_val_if_fail (e_table_group != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE); - g_signal_emit (e_table_group, - etg_signals[KEY_PRESS], 0, - row, col, event, &return_val); + g_signal_emit ( + e_table_group, + etg_signals[KEY_PRESS], 0, + row, col, event, &return_val); return return_val; } @@ -591,9 +597,10 @@ e_table_group_start_drag (ETableGroup *e_table_group, g_return_val_if_fail (e_table_group != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE); - g_signal_emit (e_table_group, - etg_signals[START_DRAG], 0, - row, col, event, &return_val); + g_signal_emit ( + e_table_group, + etg_signals[START_DRAG], 0, + row, col, event, &return_val); return return_val; } @@ -678,83 +685,85 @@ etg_class_init (ETableGroupClass *class) class->get_mouse_over = NULL; class->get_cell_geometry = NULL; - etg_signals[CURSOR_CHANGE] = - g_signal_new ("cursor_change", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableGroupClass, cursor_change), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - - etg_signals[CURSOR_ACTIVATED] = - g_signal_new ("cursor_activated", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableGroupClass, cursor_activated), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - - etg_signals[DOUBLE_CLICK] = - g_signal_new ("double_click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableGroupClass, double_click), - NULL, NULL, - e_marshal_NONE__INT_INT_BOXED, - G_TYPE_NONE, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - etg_signals[RIGHT_CLICK] = - g_signal_new ("right_click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableGroupClass, right_click), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_INT_BOXED, - G_TYPE_BOOLEAN, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - etg_signals[CLICK] = - g_signal_new ("click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableGroupClass, click), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_INT_BOXED, - G_TYPE_BOOLEAN, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - etg_signals[KEY_PRESS] = - g_signal_new ("key_press", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableGroupClass, key_press), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_INT_BOXED, - G_TYPE_BOOLEAN, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - etg_signals[START_DRAG] = - g_signal_new ("start_drag", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableGroupClass, start_drag), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_INT_BOXED, - G_TYPE_BOOLEAN, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + etg_signals[CURSOR_CHANGE] = g_signal_new ( + "cursor_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, cursor_change), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + etg_signals[CURSOR_ACTIVATED] = g_signal_new ( + "cursor_activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, cursor_activated), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + etg_signals[DOUBLE_CLICK] = g_signal_new ( + "double_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, double_click), + NULL, NULL, + e_marshal_NONE__INT_INT_BOXED, + G_TYPE_NONE, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + etg_signals[RIGHT_CLICK] = g_signal_new ( + "right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, right_click), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_INT_BOXED, + G_TYPE_BOOLEAN, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + etg_signals[CLICK] = g_signal_new ( + "click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, click), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_INT_BOXED, + G_TYPE_BOOLEAN, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + etg_signals[KEY_PRESS] = g_signal_new ( + "key_press", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, key_press), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_INT_BOXED, + G_TYPE_BOOLEAN, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + etg_signals[START_DRAG] = g_signal_new ( + "start_drag", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableGroupClass, start_drag), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_INT_BOXED, + G_TYPE_BOOLEAN, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); } static void diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index ef24716e33..d8e0665b8e 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -165,8 +165,8 @@ e_table_header_item_get_height (ETableHeaderItem *ethi) ETableCol *ecol = e_table_header_get_column (eth, col); gint height; - height = e_table_header_compute_height (ecol, - GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas)); + height = e_table_header_compute_height ( + ecol, GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas)); if (height > maxheight) maxheight = height; @@ -742,8 +742,8 @@ ethi_drag_motion (GtkWidget *widget, targets = gdk_drag_context_list_targets (context); droptype = gdk_atom_name (GDK_POINTER_TO_ATOM (targets->data)); - headertype = g_strdup_printf ("%s-%s", TARGET_ETABLE_COL_TYPE, - ethi->dnd_code); + headertype = g_strdup_printf ( + "%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code); if (strcmp (droptype, headertype) != 0) { g_free (headertype); @@ -864,11 +864,12 @@ ethi_drag_data_get (GtkWidget *canvas, ETableCol *ecol = e_table_header_get_column (ethi->eth, ethi->drag_col); gchar *string = g_strdup_printf ("%d", ecol->col_idx); - gtk_selection_data_set (selection_data, - GDK_SELECTION_TYPE_STRING, - sizeof (string[0]), - (guchar *) string, - strlen (string)); + gtk_selection_data_set ( + selection_data, + GDK_SELECTION_TYPE_STRING, + sizeof (string[0]), + (guchar *) string, + strlen (string)); g_free (string); } } @@ -1268,9 +1269,10 @@ ethi_start_drag (ETableHeaderItem *ethi, g_hash_table_insert ( arrows, GINT_TO_POINTER ((gint) column.column), - GINT_TO_POINTER (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + GINT_TO_POINTER ( + column.ascending ? + E_TABLE_COL_ARROW_DOWN : + E_TABLE_COL_ARROW_UP)); } length = e_table_sort_info_sorting_get_count (ethi->sort_info); for (i = 0; i < length; i++) { @@ -1281,9 +1283,10 @@ ethi_start_drag (ETableHeaderItem *ethi, g_hash_table_insert ( arrows, GINT_TO_POINTER ((gint) column.column), - GINT_TO_POINTER (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + GINT_TO_POINTER ( + column.ascending ? + E_TABLE_COL_ARROW_DOWN : + E_TABLE_COL_ARROW_UP)); } } @@ -1488,11 +1491,12 @@ ethi_popup_field_chooser (GtkWidget *widget, g_object_add_weak_pointer (G_OBJECT (etfcd), &info->ethi->etfcd.pointer); - g_object_set (info->ethi->etfcd.widget, - "full_header", info->ethi->full_header, - "header", info->ethi->eth, - "dnd_code", info->ethi->dnd_code, - NULL); + g_object_set ( + info->ethi->etfcd.widget, + "full_header", info->ethi->full_header, + "header", info->ethi->eth, + "dnd_code", info->ethi->dnd_code, + NULL); gtk_widget_show (etfcd); } @@ -1510,9 +1514,10 @@ ethi_popup_best_fit (GtkWidget *widget, ETableHeaderItem *ethi = info->ethi; gint width; - g_signal_emit_by_name (ethi->eth, - "request_width", - info->col, &width); + g_signal_emit_by_name ( + ethi->eth, + "request_width", + info->col, &width); /* Add 10 to stop it from "..."ing */ e_table_header_set_size (ethi->eth, info->col, width + 10); @@ -1546,8 +1551,9 @@ apply_changes (ETableConfig *config, e_tree_set_state (ethi->tree, state); g_free (state); - gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel), - GTK_RESPONSE_APPLY, FALSE); + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (config->dialog_toplevel), + GTK_RESPONSE_APPLY, FALSE); } static void @@ -1573,8 +1579,9 @@ ethi_popup_customize_view (GtkWidget *widget, ethi->config = e_table_config_new ( _("Customize Current View"), spec, state, GTK_WINDOW (gtk_widget_get_toplevel (widget))); - g_object_weak_ref (G_OBJECT (ethi->config), - config_destroyed, ethi); + g_object_weak_ref ( + G_OBJECT (ethi->config), + config_destroyed, ethi); g_signal_connect ( ethi->config, "changed", G_CALLBACK (apply_changes), ethi); @@ -1675,7 +1682,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GtkWidget *menu_item, *sub_menu; ETableSortColumn column; gboolean ascending = TRUE; - d ( g_print ("ethi_header_context_menu: \n") ); + d (g_print ("ethi_header_context_menu: \n")); info->ethi = ethi; info->col = ethi_find_col_by_x (ethi, event->x); @@ -1892,11 +1899,12 @@ ethi_event (GnomeCanvasItem *item, /* Quick hack until I actually bind the views */ ethi->resize_guide = GINT_TO_POINTER (1); - gnome_canvas_item_grab (item, - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_RELEASE_MASK, - ethi->resize_cursor, - e->button.time); + gnome_canvas_item_grab ( + item, + GDK_POINTER_MOTION_MASK | + GDK_BUTTON_RELEASE_MASK, + ethi->resize_cursor, + e->button.time); } new_width = x - ethi->resize_start_pos; @@ -1963,9 +1971,10 @@ ethi_event (GnomeCanvasItem *item, break; else { gint width = 0; - g_signal_emit_by_name (ethi->eth, - "request_width", - (gint) ethi->resize_col, &width); + g_signal_emit_by_name ( + ethi->eth, + "request_width", + (gint) ethi->resize_col, &width); /* Add 10 to stop it from "..."ing */ e_table_header_set_size (ethi->eth, ethi->resize_col, width + 10); @@ -2077,64 +2086,85 @@ ethi_class_init (ETableHeaderItemClass *class) item_class->point = ethi_point; item_class->event = ethi_event; - g_object_class_install_property (object_class, PROP_DND_CODE, - g_param_spec_string ("dnd_code", - "DnD code", - NULL, - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_TABLE_FONT_DESC, - g_param_spec_boxed ("font-desc", - "Font Description", - NULL, - PANGO_TYPE_FONT_DESCRIPTION, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_FULL_HEADER, - g_param_spec_object ("full_header", - "Full Header", - NULL, - E_TYPE_TABLE_HEADER, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_TABLE_HEADER, - g_param_spec_object ("ETableHeader", - "Header", - NULL, - E_TYPE_TABLE_HEADER, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_SORT_INFO, - g_param_spec_object ("sort_info", - "Sort Info", - NULL, - E_TYPE_TABLE_SORT_INFO, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TABLE, - g_param_spec_object ("table", - "Table", - NULL, - E_TYPE_TABLE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TREE, - g_param_spec_object ("tree", - "Tree", - NULL, - E_TYPE_TREE, - G_PARAM_WRITABLE)); - - ethi_signals[BUTTON_PRESSED] = - g_signal_new ("button_pressed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableHeaderItemClass, button_pressed), - NULL, NULL, - g_cclosure_marshal_VOID__BOXED, - G_TYPE_NONE, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + g_object_class_install_property ( + object_class, + PROP_DND_CODE, + g_param_spec_string ( + "dnd_code", + "DnD code", + NULL, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_FONT_DESC, + g_param_spec_boxed ( + "font-desc", + "Font Description", + NULL, + PANGO_TYPE_FONT_DESCRIPTION, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_FULL_HEADER, + g_param_spec_object ( + "full_header", + "Full Header", + NULL, + E_TYPE_TABLE_HEADER, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_HEADER, + g_param_spec_object ( + "ETableHeader", + "Header", + NULL, + E_TYPE_TABLE_HEADER, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_SORT_INFO, + g_param_spec_object ( + "sort_info", + "Sort Info", + NULL, + E_TYPE_TABLE_SORT_INFO, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE, + g_param_spec_object ( + "table", + "Table", + NULL, + E_TYPE_TABLE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TREE, + g_param_spec_object ( + "tree", + "Tree", + NULL, + E_TYPE_TREE, + G_PARAM_WRITABLE)); + + ethi_signals[BUTTON_PRESSED] = g_signal_new ( + "button_pressed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableHeaderItemClass, button_pressed), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); } static void diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 68516d5b4d..325390d559 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -151,8 +151,9 @@ eth_do_remove (ETableHeader *eth, if (do_unref) g_object_unref (eth->columns[idx]); - memmove (ð->columns[idx], ð->columns[idx + 1], - sizeof (ETableCol *) * (eth->col_count - idx - 1)); + memmove ( + ð->columns[idx], ð->columns[idx + 1], + sizeof (ETableCol *) * (eth->col_count - idx - 1)); eth->col_count--; } @@ -165,8 +166,9 @@ eth_finalize (GObject *object) if (eth->sort_info) { if (eth->sort_info_group_change_id) - g_signal_handler_disconnect (G_OBJECT (eth->sort_info), - eth->sort_info_group_change_id); + g_signal_handler_disconnect ( + eth->sort_info, + eth->sort_info_group_change_id); g_object_unref (eth->sort_info); eth->sort_info = NULL; } @@ -224,7 +226,7 @@ eth_set_property (GObject *object, if (eth->sort_info) { if (eth->sort_info_group_change_id) g_signal_handler_disconnect ( - G_OBJECT (eth->sort_info), + eth->sort_info, eth->sort_info_group_change_id); g_object_unref (eth->sort_info); } @@ -252,7 +254,7 @@ eth_get_property (GObject *object, switch (property_id) { case PROP_SORT_INFO: - g_value_set_object (val, G_OBJECT (eth->sort_info)); + g_value_set_object (val, eth->sort_info); break; case PROP_WIDTH: g_value_set_double (val, eth->nominal_width); @@ -276,55 +278,70 @@ e_table_header_class_init (ETableHeaderClass *class) object_class->get_property = eth_get_property; g_object_class_install_property ( - object_class, PROP_WIDTH, - g_param_spec_double ("width", "Width", "Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", "Width", "Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); g_object_class_install_property ( - object_class, PROP_WIDTH_EXTRAS, - g_param_spec_double ("width_extras", "Width of Extras", "Width of Extras", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); + object_class, + PROP_WIDTH_EXTRAS, + g_param_spec_double ( + "width_extras", + "Width of Extras", + "Width of Extras", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); g_object_class_install_property ( - object_class, PROP_SORT_INFO, - g_param_spec_object ("sort_info", "Sort Info", "Sort Info", - E_TYPE_TABLE_SORT_INFO, - G_PARAM_READWRITE)); - - eth_signals[STRUCTURE_CHANGE] = - g_signal_new ("structure_change", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableHeaderClass, structure_change), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - eth_signals[DIMENSION_CHANGE] = - g_signal_new ("dimension_change", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableHeaderClass, dimension_change), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - eth_signals[EXPANSION_CHANGE] = - g_signal_new ("expansion_change", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableHeaderClass, expansion_change), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - eth_signals[REQUEST_WIDTH] = - g_signal_new ("request_width", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableHeaderClass, request_width), - (GSignalAccumulator) NULL, NULL, - e_marshal_INT__INT, - G_TYPE_INT, 1, G_TYPE_INT); + object_class, + PROP_SORT_INFO, + g_param_spec_object ( + "sort_info", + "Sort Info", + "Sort Info", + E_TYPE_TABLE_SORT_INFO, + G_PARAM_READWRITE)); + + eth_signals[STRUCTURE_CHANGE] = g_signal_new ( + "structure_change", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableHeaderClass, structure_change), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + eth_signals[DIMENSION_CHANGE] = g_signal_new ( + "dimension_change", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableHeaderClass, dimension_change), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + eth_signals[EXPANSION_CHANGE] = g_signal_new ( + "expansion_change", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableHeaderClass, expansion_change), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + eth_signals[REQUEST_WIDTH] = g_signal_new ( + "request_width", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableHeaderClass, request_width), + (GSignalAccumulator) NULL, NULL, + e_marshal_INT__INT, + G_TYPE_INT, 1, + G_TYPE_INT); class->structure_change = NULL; class->dimension_change = NULL; @@ -380,7 +397,8 @@ 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++; @@ -424,7 +442,7 @@ e_table_header_add_column (ETableHeader *eth, eth_do_insert (eth, pos, tc); enqueue (eth, -1, eth->nominal_width); - g_signal_emit (G_OBJECT (eth), eth_signals[STRUCTURE_CHANGE], 0); + g_signal_emit (eth, eth_signals[STRUCTURE_CHANGE], 0); } /** @@ -673,8 +691,8 @@ e_table_header_move (ETableHeader *eth, eth_do_insert (eth, target_index, old); eth_update_offsets (eth); - g_signal_emit (G_OBJECT (eth), eth_signals[DIMENSION_CHANGE], 0, eth->width); - g_signal_emit (G_OBJECT (eth), eth_signals[STRUCTURE_CHANGE], 0); + g_signal_emit (eth, eth_signals[DIMENSION_CHANGE], 0, eth->width); + g_signal_emit (eth, eth_signals[STRUCTURE_CHANGE], 0); } /** @@ -696,7 +714,7 @@ e_table_header_remove (ETableHeader *eth, eth_do_remove (eth, idx, TRUE); enqueue (eth, -1, eth->nominal_width); - g_signal_emit (G_OBJECT (eth), eth_signals[STRUCTURE_CHANGE], 0); + g_signal_emit (eth, eth_signals[STRUCTURE_CHANGE], 0); } /* @@ -771,7 +789,7 @@ eth_set_size (ETableHeader *eth, eth->columns[i]->expansion = 0; } - g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); + g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0); return; } @@ -781,7 +799,7 @@ eth_set_size (ETableHeader *eth, for (i = idx; i < eth->col_count; i++) { eth->columns[i]->expansion = 0; } - g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); + g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0); return; } @@ -798,7 +816,7 @@ eth_set_size (ETableHeader *eth, for (i = idx + 1; i < eth->col_count; i++) { eth->columns[i]->expansion = 0; } - g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); + g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0); return; } @@ -825,7 +843,7 @@ eth_set_size (ETableHeader *eth, eth->columns[i]->expansion = expansion / expandable_count; } } - g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); + g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0); return; } @@ -835,7 +853,7 @@ eth_set_size (ETableHeader *eth, eth->columns[i]->expansion *= expansion / old_expansion; } } - g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); + g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0); } /** @@ -922,7 +940,7 @@ eth_calc_widths (ETableHeader *eth) } g_free (widths); if (changed) - g_signal_emit (G_OBJECT (eth), eth_signals[DIMENSION_CHANGE], 0, eth->width); + g_signal_emit (eth, eth_signals[DIMENSION_CHANGE], 0, eth->width); eth_update_offsets (eth); } @@ -937,14 +955,13 @@ e_table_header_update_horizontal (ETableHeader *eth) for (i = 0; i < cols; i++) { gint width = 0; - g_signal_emit_by_name (G_OBJECT (eth), - "request_width", - i, &width); + g_signal_emit_by_name ( + eth, "request_width", i, &width); eth->columns[i]->min_width = width + 10; eth->columns[i]->expansion = 1; } enqueue (eth, -1, eth->nominal_width); - g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); + g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0); } gint diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index b9e2cce10d..1cb81f00dc 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -381,8 +381,9 @@ eti_free_save_state (ETableItem *eti) !eti->cell_views_realized) return; - e_cell_free_state (eti->cell_views[eti->save_col], view_to_model_col (eti, eti->save_col), - eti->save_col, eti->save_row, eti->save_state); + e_cell_free_state ( + eti->cell_views[eti->save_col], view_to_model_col (eti, eti->save_col), + eti->save_col, eti->save_row, eti->save_state); eti->save_row = -1; eti->save_col = -1; eti->save_state = NULL; @@ -564,8 +565,9 @@ eti_update (GnomeCanvasItem *item, } if (eti->needs_redraw) { - gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, - item->x2, item->y2); + gnome_canvas_request_redraw ( + item->canvas, item->x1, item->y1, + item->x2, item->y2); eti->needs_redraw = 0; } } @@ -581,20 +583,27 @@ eti_remove_table_model (ETableItem *eti) if (!eti->table_model) return; - g_signal_handler_disconnect (G_OBJECT (eti->table_model), - eti->table_model_pre_change_id); - g_signal_handler_disconnect (G_OBJECT (eti->table_model), - eti->table_model_no_change_id); - g_signal_handler_disconnect (G_OBJECT (eti->table_model), - eti->table_model_change_id); - g_signal_handler_disconnect (G_OBJECT (eti->table_model), - eti->table_model_row_change_id); - g_signal_handler_disconnect (G_OBJECT (eti->table_model), - eti->table_model_cell_change_id); - g_signal_handler_disconnect (G_OBJECT (eti->table_model), - eti->table_model_rows_inserted_id); - g_signal_handler_disconnect (G_OBJECT (eti->table_model), - eti->table_model_rows_deleted_id); + g_signal_handler_disconnect ( + eti->table_model, + eti->table_model_pre_change_id); + g_signal_handler_disconnect ( + eti->table_model, + eti->table_model_no_change_id); + g_signal_handler_disconnect ( + eti->table_model, + eti->table_model_change_id); + g_signal_handler_disconnect ( + eti->table_model, + eti->table_model_row_change_id); + g_signal_handler_disconnect ( + eti->table_model, + eti->table_model_cell_change_id); + g_signal_handler_disconnect ( + eti->table_model, + eti->table_model_rows_inserted_id); + g_signal_handler_disconnect ( + eti->table_model, + eti->table_model_rows_deleted_id); g_object_unref (eti->table_model); if (eti->source_model) g_object_unref (eti->source_model); @@ -622,14 +631,18 @@ eti_remove_selection_model (ETableItem *eti) if (!eti->selection) return; - g_signal_handler_disconnect (eti->selection, - eti->selection_change_id); - g_signal_handler_disconnect (eti->selection, - eti->selection_row_change_id); - g_signal_handler_disconnect (eti->selection, - eti->cursor_change_id); - g_signal_handler_disconnect (eti->selection, - eti->cursor_activated_id); + g_signal_handler_disconnect ( + eti->selection, + eti->selection_change_id); + g_signal_handler_disconnect ( + eti->selection, + eti->selection_row_change_id); + g_signal_handler_disconnect ( + eti->selection, + eti->cursor_change_id); + g_signal_handler_disconnect ( + eti->selection, + eti->cursor_activated_id); g_object_unref (eti->selection); eti->selection_change_id = 0; @@ -649,12 +662,15 @@ eti_remove_header_model (ETableItem *eti) if (!eti->header) return; - g_signal_handler_disconnect (G_OBJECT (eti->header), - eti->header_structure_change_id); - g_signal_handler_disconnect (G_OBJECT (eti->header), - eti->header_dim_change_id); - g_signal_handler_disconnect (G_OBJECT (eti->header), - eti->header_request_width_id); + g_signal_handler_disconnect ( + eti->header, + eti->header_structure_change_id); + g_signal_handler_disconnect ( + eti->header, + eti->header_dim_change_id); + g_signal_handler_disconnect ( + eti->header, + eti->header_request_width_id); if (eti->cell_views) { eti_unrealize_cell_views (eti); @@ -948,15 +964,18 @@ eti_request_region_redraw (ETableItem *eti, if (eti->rows > 0) { - eti_get_region (eti, - start_col, start_row, - end_col, end_row, - &x1, &y1, &x2, &y2); + eti_get_region ( + eti, + start_col, start_row, + end_col, end_row, + &x1, &y1, &x2, &y2); - eti_item_region_redraw (eti, x1 - border, - y1 - border, - x2 + 1 + border, - y2 + 1 + border); + eti_item_region_redraw ( + eti, + x1 - border, + y1 - border, + x2 + 1 + border, + y2 + 1 + border); } } @@ -976,15 +995,18 @@ eti_request_region_show (ETableItem *eti, { gint x1, y1, x2, y2; - eti_get_region (eti, - start_col, start_row, - end_col, end_row, - &x1, &y1, &x2, &y2); + eti_get_region ( + eti, + start_col, start_row, + end_col, end_row, + &x1, &y1, &x2, &y2); if (delay) - e_canvas_item_show_area_delayed (GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2, delay); + e_canvas_item_show_area_delayed ( + GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2, delay); else - e_canvas_item_show_area (GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2); + e_canvas_item_show_area ( + GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2); } static void @@ -1005,9 +1027,10 @@ eti_show_cursor (ETableItem *eti, } #if 0 - g_object_get (eti->selection, - "cursor_row", &cursor_row, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &cursor_row, + NULL); #else cursor_row = e_selection_model_cursor_row (eti->selection); #endif @@ -1016,9 +1039,10 @@ eti_show_cursor (ETableItem *eti, if (cursor_row != -1) { cursor_row = model_to_view_row (eti, cursor_row); - eti_request_region_show (eti, - 0, cursor_row, eti->cols - 1, cursor_row, - delay); + eti_request_region_show ( + eti, + 0, cursor_row, eti->cols - 1, cursor_row, + delay); } } @@ -1038,9 +1062,10 @@ eti_check_cursor_bounds (ETableItem *eti) return; } - g_object_get (eti->selection, - "cursor_row", &cursor_row, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &cursor_row, + NULL); if (cursor_row == -1) { eti->cursor_x1 = -1; @@ -1057,9 +1082,10 @@ eti_check_cursor_bounds (ETableItem *eti) d (g_print ("%s: cursor row: %d\n", __FUNCTION__, cursor_row)); - eti_get_region (eti, - 0, cursor_row, eti->cols - 1, cursor_row, - &x1, &y1, &x2, &y2); + eti_get_region ( + eti, + 0, cursor_row, eti->cols - 1, cursor_row, + &x1, &y1, &x2, &y2); eti->cursor_x1 = x1; eti->cursor_y1 = y1; eti->cursor_x2 = x2; @@ -1325,10 +1351,11 @@ e_table_item_redraw_range (ETableItem *eti, g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); - g_object_get (eti->selection, - "cursor_col", &cursor_col, - "cursor_row", &cursor_row, - NULL); + g_object_get ( + eti->selection, + "cursor_col", &cursor_col, + "cursor_row", &cursor_row, + NULL); if ((start_col == cursor_col) || (end_col == cursor_col) || @@ -1359,31 +1386,31 @@ eti_add_table_model (ETableItem *eti, g_object_ref (eti->table_model); eti->table_model_pre_change_id = g_signal_connect ( - G_OBJECT (table_model), "model_pre_change", + table_model, "model_pre_change", G_CALLBACK (eti_table_model_pre_change), eti); eti->table_model_no_change_id = g_signal_connect ( - G_OBJECT (table_model), "model_no_change", + table_model, "model_no_change", G_CALLBACK (eti_table_model_no_change), eti); eti->table_model_change_id = g_signal_connect ( - G_OBJECT (table_model), "model_changed", + table_model, "model_changed", G_CALLBACK (eti_table_model_changed), eti); eti->table_model_row_change_id = g_signal_connect ( - G_OBJECT (table_model), "model_row_changed", + table_model, "model_row_changed", G_CALLBACK (eti_table_model_row_changed), eti); eti->table_model_cell_change_id = g_signal_connect ( - G_OBJECT (table_model), "model_cell_changed", + table_model, "model_cell_changed", G_CALLBACK (eti_table_model_cell_changed), eti); eti->table_model_rows_inserted_id = g_signal_connect ( - G_OBJECT (table_model), "model_rows_inserted", + table_model, "model_rows_inserted", G_CALLBACK (eti_table_model_rows_inserted), eti); eti->table_model_rows_deleted_id = g_signal_connect ( - G_OBJECT (table_model), "model_rows_deleted", + table_model, "model_rows_deleted", G_CALLBACK (eti_table_model_rows_deleted), eti); if (eti->header) { @@ -1429,8 +1456,7 @@ eti_add_selection_model (ETableItem *eti, G_CALLBACK (eti_cursor_activated), eti); eti_selection_change (selection, eti); - g_signal_emit_by_name (G_OBJECT (eti), - "selection_model_added", eti->selection); + g_signal_emit_by_name (eti, "selection_model_added", eti->selection); } static void @@ -1498,16 +1524,16 @@ eti_add_header_model (ETableItem *eti, eti_header_structure_changed (header, eti); eti->header_dim_change_id = g_signal_connect ( - G_OBJECT (header), "dimension_change", + header, "dimension_change", G_CALLBACK (eti_header_dim_changed), eti); eti->header_structure_change_id = g_signal_connect ( - G_OBJECT (header), "structure_change", + header, "structure_change", G_CALLBACK (eti_header_structure_changed), eti); - eti->header_request_width_id = g_signal_connect - (G_OBJECT (header), "request_width", - G_CALLBACK (eti_request_column_width), eti); + eti->header_request_width_id = g_signal_connect ( + header, "request_width", + G_CALLBACK (eti_request_column_width), eti); } /* @@ -1563,8 +1589,8 @@ eti_set_property (GObject *object, break; case PROP_SELECTION_MODEL: - g_signal_emit_by_name (G_OBJECT (eti), - "selection_model_removed", eti->selection); + g_signal_emit_by_name ( + eti, "selection_model_removed", eti->selection); eti_remove_selection_model (eti); if (g_value_get_object (value)) eti_add_selection_model (eti, E_SELECTION_MODEL (g_value_get_object (value))); @@ -1604,9 +1630,10 @@ eti_set_property (GObject *object, eti->minimum_width = g_value_get_double (value); break; case PROP_CURSOR_ROW: - g_object_get (eti->selection, - "cursor_col", &cursor_col, - NULL); + g_object_get ( + eti->selection, + "cursor_col", &cursor_col, + NULL); e_table_item_focus (eti, cursor_col != -1 ? cursor_col : 0, view_to_model_row (eti, g_value_get_int (value)), 0); break; @@ -1649,9 +1676,10 @@ eti_get_property (GObject *object, g_value_set_double (value, eti->minimum_width); break; case PROP_CURSOR_ROW: - g_object_get (eti->selection, - "cursor_row", &row, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &row, + NULL); g_value_set_int (value, model_to_view_row (eti, row)); break; case PROP_UNIFORM_ROW_HEIGHT: @@ -1972,10 +2000,11 @@ eti_draw (GnomeCanvasItem *item, selected = e_selection_model_is_row_selected (E_SELECTION_MODEL (eti->selection), view_to_model_row (eti,row)); - g_object_get (eti->selection, - "cursor_col", &cursor_col, - "cursor_row", &cursor_row, - NULL); + g_object_get ( + eti->selection, + "cursor_col", &cursor_col, + "cursor_row", &cursor_row, + NULL); for (col = first_col; col < last_col; col++) { ETableCol *ecol = e_table_header_get_column (eti->header, col); @@ -2010,17 +2039,20 @@ eti_draw (GnomeCanvasItem *item, 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_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); @@ -2031,17 +2063,19 @@ eti_draw (GnomeCanvasItem *item, 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); @@ -2069,8 +2103,9 @@ eti_draw (GnomeCanvasItem *item, break; } - e_cell_draw (ecell_view, cr, ecol->col_idx, col, row, flags, - xd, yd, xd + ecol->width, yd + height); + e_cell_draw ( + ecell_view, cr, ecol->col_idx, col, row, flags, + xd, yd, xd + ecol->width, yd + height); if (!f_found && !selected) { switch (eti->cursor_mode) { @@ -2128,9 +2163,10 @@ eti_draw (GnomeCanvasItem *item, if (eti->draw_focus && f_found) { static const double dash[] = { 1.0, 1.0 }; cairo_set_line_width (cr, 1.0); - cairo_rectangle (cr, - f_x1 + 0.5, f_x2 + 0.5, - f_x2 - f_x1 - 1, f_y2 - f_y1); + cairo_rectangle ( + cr, + f_x1 + 0.5, f_x2 + 0.5, + f_x2 - f_x1 - 1, f_y2 - f_y1); gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]); cairo_stroke_preserve (cr); @@ -2236,10 +2272,11 @@ static void eti_cursor_move_left (ETableItem *eti) { gint cursor_col, cursor_row; - g_object_get (eti->selection, - "cursor_col", &cursor_col, - "cursor_row", &cursor_row, - NULL); + g_object_get ( + eti->selection, + "cursor_col", &cursor_col, + "cursor_row", &cursor_row, + NULL); eti_cursor_move (eti, model_to_view_row (eti, cursor_row), model_to_view_col (eti, cursor_col) - 1); } @@ -2248,10 +2285,11 @@ static void eti_cursor_move_right (ETableItem *eti) { gint cursor_col, cursor_row; - g_object_get (eti->selection, - "cursor_col", &cursor_col, - "cursor_row", &cursor_row, - NULL); + g_object_get ( + eti->selection, + "cursor_col", &cursor_col, + "cursor_row", &cursor_row, + NULL); eti_cursor_move (eti, model_to_view_row (eti, cursor_row), model_to_view_col (eti, cursor_col) + 1); } @@ -2335,10 +2373,11 @@ eti_event (GnomeCanvasItem *item, button.x = x1; button.y = y1; - g_object_get (eti->selection, - "cursor_row", &cursor_row, - "cursor_col", &cursor_col, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &cursor_row, + "cursor_col", &cursor_col, + NULL); if (cursor_col == view_to_model_col (eti, col) && cursor_row == view_to_model_row (eti, row)) { flags = E_CELL_CURSOR; @@ -2350,25 +2389,28 @@ eti_event (GnomeCanvasItem *item, if (return_val) return TRUE; - g_signal_emit (eti, eti_signals[CLICK], 0, - row, view_to_model_col (eti, col), &button, &return_val); + g_signal_emit ( + eti, eti_signals[CLICK], 0, + row, view_to_model_col (eti, col), &button, &return_val); if (return_val) { eti->click_count = 0; return TRUE; } - g_object_get (eti->selection, - "cursor_row", &cursor_row, - "cursor_col", &cursor_col, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &cursor_row, + "cursor_col", &cursor_col, + NULL); eti->maybe_did_something = e_selection_model_maybe_do_something (E_SELECTION_MODEL (eti->selection), view_to_model_row (eti, row), view_to_model_col (eti, col), button.state); - g_object_get (eti->selection, - "cursor_row", &new_cursor_row, - "cursor_col", &new_cursor_col, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &new_cursor_row, + "cursor_col", &new_cursor_col, + NULL); if (cursor_row != new_cursor_row || cursor_col != new_cursor_col) { eti->click_count = 1; @@ -2385,8 +2427,9 @@ eti_event (GnomeCanvasItem *item, */ if (eti_editing (eti)) { - return_val = eti_e_cell_event (eti, ecell_view, (GdkEvent *) &button, button.time, - view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR); + return_val = eti_e_cell_event ( + eti, ecell_view, (GdkEvent *) &button, button.time, + view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR); if (return_val) return TRUE; } @@ -2415,8 +2458,9 @@ eti_event (GnomeCanvasItem *item, e_selection_model_right_click_down (E_SELECTION_MODEL (eti->selection), view_to_model_row (eti, row), view_to_model_col (eti, col), 0); - g_signal_emit (eti, eti_signals[RIGHT_CLICK], 0, - row, view_to_model_col (eti, col), e, &return_val); + g_signal_emit ( + eti, eti_signals[RIGHT_CLICK], 0, + row, view_to_model_col (eti, col), e, &return_val); if (!return_val) e_selection_model_right_click_up (E_SELECTION_MODEL (eti->selection)); break; @@ -2459,7 +2503,8 @@ eti_event (GnomeCanvasItem *item, #if d(!)0 { gboolean cell_found = find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1); - g_print ("%s: find_cell(%f, %f) = %s(%d, %d, %f, %f)\n", __FUNCTION__, e->button.x, e->button.y, + g_print ( + "%s: find_cell(%f, %f) = %s(%d, %d, %f, %f)\n", __FUNCTION__, e->button.x, e->button.y, cell_found?"true":"false", col, row, x1, y1); } #endif @@ -2467,14 +2512,11 @@ eti_event (GnomeCanvasItem *item, if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1)) return TRUE; - g_object_get (eti->selection, - "cursor_row", &cursor_row, - "cursor_col", &cursor_col, - NULL); - - d (g_print ("%s: GDK_BUTTON_RELEASE received, button %d, line: %d\n" - "eti_editing: %s, row:%d:%d, col:%d:%d\n", __FUNCTION__, e->button.button, __LINE__, - eti_editing (eti)?"true":"false", cursor_row, view_to_model_row (eti, row), cursor_col, view_to_model_col (eti, col))); + g_object_get ( + eti->selection, + "cursor_row", &cursor_row, + "cursor_col", &cursor_col, + NULL); if (eti_editing (eti) && cursor_row == view_to_model_row (eti, row) && cursor_col == view_to_model_col (eti, col)) { @@ -2489,8 +2531,9 @@ eti_event (GnomeCanvasItem *item, e->button.x = x1; e->button.y = y1; - return_val = eti_e_cell_event (eti, ecell_view, e, e->button.time, - view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR); + return_val = eti_e_cell_event ( + eti, ecell_view, e, e->button.time, + view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR); } break; case 3: @@ -2527,10 +2570,11 @@ eti_event (GnomeCanvasItem *item, return TRUE; #endif - g_object_get (eti->selection, - "cursor_row", &model_row, - "cursor_col", &model_col, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &model_row, + "cursor_col", &model_col, + NULL); e->button.x -= e_table_header_col_diff (eti->header, 0, model_to_view_col (eti, model_col)); e->button.y -= e_table_item_row_diff (eti, 0, model_to_view_row (eti, model_row)); @@ -2555,8 +2599,9 @@ eti_event (GnomeCanvasItem *item, } if (model_row != -1 && model_col != -1) { - g_signal_emit (eti, eti_signals[DOUBLE_CLICK], 0, - model_row, model_col, e); + g_signal_emit ( + eti, eti_signals[DOUBLE_CLICK], 0, + model_row, model_col, e); } } break; @@ -2574,8 +2619,9 @@ eti_event (GnomeCanvasItem *item, gboolean drag_handled; eti->maybe_in_drag = 0; - g_signal_emit (eti, eti_signals[START_DRAG], 0, - eti->drag_row, eti->drag_col, e, &drag_handled); + g_signal_emit ( + eti, eti_signals[START_DRAG], 0, + eti->drag_row, eti->drag_col, e, &drag_handled); if (drag_handled) eti->in_drag = 1; else @@ -2590,19 +2636,21 @@ eti_event (GnomeCanvasItem *item, (row != eti->motion_row || col != eti->motion_col)) { GdkEvent *cross = gdk_event_new (GDK_LEAVE_NOTIFY); cross->crossing.time = e->motion.time; - return_val = eti_e_cell_event (eti, eti->cell_views[eti->motion_col], - cross, cross->crossing.time, - view_to_model_col (eti, eti->motion_col), - eti->motion_col, eti->motion_row, 0); + return_val = eti_e_cell_event ( + eti, eti->cell_views[eti->motion_col], + cross, cross->crossing.time, + view_to_model_col (eti, eti->motion_col), + eti->motion_col, eti->motion_row, 0); } eti->motion_row = row; eti->motion_col = col; - g_object_get (eti->selection, - "cursor_row", &cursor_row, - "cursor_col", &cursor_col, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &cursor_row, + "cursor_col", &cursor_col, + NULL); flags = 0; if (cursor_row == view_to_model_row (eti, row) && cursor_col == view_to_model_col (eti, col)) { @@ -2617,8 +2665,9 @@ eti_event (GnomeCanvasItem *item, e->motion.x = x1; e->motion.y = y1; - return_val = eti_e_cell_event (eti, ecell_view, e, e->motion.time, - view_to_model_col (eti, col), col, row, flags); + return_val = eti_e_cell_event ( + eti, ecell_view, e, e->motion.time, + view_to_model_col (eti, col), col, row, flags); break; } @@ -2628,10 +2677,11 @@ eti_event (GnomeCanvasItem *item, d (g_print ("%s: GDK_KEY_PRESS received, keyval: %d\n", __FUNCTION__, (gint) e->key.keyval)); - g_object_get (eti->selection, - "cursor_row", &cursor_row, - "cursor_col", &cursor_col, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &cursor_row, + "cursor_col", &cursor_col, + NULL); if (cursor_row == -1 && cursor_col == -1) return FALSE; @@ -2646,8 +2696,9 @@ eti_event (GnomeCanvasItem *item, break; } - g_signal_emit (eti, eti_signals[KEY_PRESS], 0, - model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit ( + eti, eti_signals[KEY_PRESS], 0, + model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); if ((!return_val) && (atk_get_root () || eti->cursor_mode != E_CURSOR_LINE) && cursor_col != view_to_model_col (eti, 0)) @@ -2662,8 +2713,9 @@ eti_event (GnomeCanvasItem *item, break; } - g_signal_emit (eti, eti_signals[KEY_PRESS], 0, - model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit ( + eti, eti_signals[KEY_PRESS], 0, + model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); if ((!return_val) && (atk_get_root () || eti->cursor_mode != E_CURSOR_LINE) && cursor_col != view_to_model_col (eti, eti->cols - 1)) @@ -2676,7 +2728,7 @@ eti_event (GnomeCanvasItem *item, case GDK_KEY_Down: case GDK_KEY_KP_Down: if ((e->key.state & GDK_MOD1_MASK) - && ((e->key.keyval == GDK_KEY_Down ) || (e->key.keyval == GDK_KEY_KP_Down))) { + && ((e->key.keyval == GDK_KEY_Down) || (e->key.keyval == GDK_KEY_KP_Down))) { gint view_col = model_to_view_col (eti, cursor_col); if ((view_col >= 0) && (view_col < eti->cols)) @@ -2735,10 +2787,11 @@ eti_event (GnomeCanvasItem *item, else return_val = FALSE; } - g_object_get (eti->selection, - "cursor_row", &cursor_row, - "cursor_col", &cursor_col, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &cursor_row, + "cursor_col", &cursor_col, + NULL); if (cursor_col >= 0 && cursor_row >= 0 && return_val && (!eti_editing (eti)) && e_table_model_is_cell_editable (eti->table_model, cursor_col, model_to_view_row (eti, cursor_row))) { @@ -2757,14 +2810,16 @@ eti_event (GnomeCanvasItem *item, case GDK_KEY_3270_Enter: if (eti_editing (eti)) { ecell_view = eti->cell_views[eti->editing_col]; - return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time, - view_to_model_col (eti, eti->editing_col), - eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR | E_CELL_PREEDIT); + return_val = eti_e_cell_event ( + eti, ecell_view, e, e->key.time, + view_to_model_col (eti, eti->editing_col), + eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR | E_CELL_PREEDIT); if (!return_val) break; } - g_signal_emit (eti, eti_signals[KEY_PRESS], 0, - model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit ( + eti, eti_signals[KEY_PRESS], 0, + model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); if (!return_val) return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; @@ -2805,15 +2860,17 @@ eti_event (GnomeCanvasItem *item, } } if (!eti_editing (eti)) { - g_signal_emit (eti, eti_signals[KEY_PRESS], 0, - model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit ( + eti, eti_signals[KEY_PRESS], 0, + model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); if (!return_val) e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); } else { ecell_view = eti->cell_views[eti->editing_col]; - return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time, - view_to_model_col (eti, eti->editing_col), - eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR); + return_val = eti_e_cell_event ( + eti, ecell_view, e, e->key.time, + view_to_model_col (eti, eti->editing_col), + eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR); if (!return_val) e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); } @@ -2829,19 +2886,21 @@ eti_event (GnomeCanvasItem *item, d (g_print ("%s: GDK_KEY_RELEASE received, keyval: %d\n", __FUNCTION__, (gint) e->key.keyval)); - g_object_get (eti->selection, - "cursor_row", &cursor_row, - "cursor_col", &cursor_col, - NULL); + g_object_get ( + eti->selection, + "cursor_row", &cursor_row, + "cursor_col", &cursor_col, + NULL); if (cursor_col == -1) return FALSE; if (eti_editing (eti)) { ecell_view = eti->cell_views[eti->editing_col]; - return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time, - view_to_model_col (eti, eti->editing_col), - eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR); + return_val = eti_e_cell_event ( + eti, ecell_view, e, e->key.time, + view_to_model_col (eti, eti->editing_col), + eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR); } break; } @@ -2851,10 +2910,11 @@ eti_event (GnomeCanvasItem *item, case GDK_ENTER_NOTIFY: d (g_print ("%s: %s received\n", __FUNCTION__, leave ? "GDK_LEAVE_NOTIFY" : "GDK_ENTER_NOTIFY")); if (eti->motion_row != -1 && eti->motion_col != -1) - return_val = eti_e_cell_event (eti, eti->cell_views[eti->motion_col], - e, e->crossing.time, - view_to_model_col (eti, eti->motion_col), - eti->motion_col, eti->motion_row, 0); + return_val = eti_e_cell_event ( + eti, eti->cell_views[eti->motion_col], + e, e->crossing.time, + view_to_model_col (eti, eti->motion_col), + eti->motion_col, eti->motion_row, 0); eti->motion_row = -1; eti->motion_col = -1; @@ -2868,8 +2928,9 @@ eti_event (GnomeCanvasItem *item, !eti_editing (eti) && e_table_model_is_cell_editable (eti->table_model, view_to_model_col (eti, eti->save_col), eti->save_row)) { e_table_item_enter_edit (eti, eti->save_col, eti->save_row); - e_cell_load_state (eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->save_col), - eti->save_col, eti->save_row, eti->edit_ctx, eti->save_state); + e_cell_load_state ( + eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->save_col), + eti->save_col, eti->save_row, eti->edit_ctx, eti->save_state); eti_free_save_state (eti); } } else { @@ -2878,8 +2939,9 @@ eti_event (GnomeCanvasItem *item, eti->save_row = eti->editing_row; eti->save_col = eti->editing_col; - eti->save_state = e_cell_save_state (eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->editing_col), - eti->editing_col, eti->editing_row, eti->edit_ctx); + eti->save_state = e_cell_save_state ( + eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->editing_col), + eti->editing_col, eti->editing_row, eti->edit_ctx); e_table_item_leave_edit_(eti); } } @@ -2948,209 +3010,257 @@ eti_class_init (ETableItemClass *class) class->selection_model_removed = NULL; class->selection_model_added = NULL; - g_object_class_install_property (object_class, PROP_TABLE_HEADER, - g_param_spec_object ("ETableHeader", - "Table header", - "Table header", - E_TYPE_TABLE_HEADER, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TABLE_MODEL, - g_param_spec_object ("ETableModel", - "Table model", - "Table model", - E_TYPE_TABLE_MODEL, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_SELECTION_MODEL, - g_param_spec_object ("selection_model", - "Selection model", - "Selection model", - E_TYPE_SELECTION_MODEL, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS, - g_param_spec_boolean ("alternating_row_colors", - "Alternating Row Colors", - "Alternating Row Colors", - FALSE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID, - g_param_spec_boolean ("horizontal_draw_grid", - "Horizontal Draw Grid", - "Horizontal Draw Grid", - FALSE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID, - g_param_spec_boolean ("vertical_draw_grid", - "Vertical Draw Grid", - "Vertical Draw Grid", - FALSE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS, - g_param_spec_boolean ("drawfocus", - "Draw focus", - "Draw focus", - FALSE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_CURSOR_MODE, - g_param_spec_int ("cursor_mode", - "Cursor mode", - "Cursor mode", - E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD, - g_param_spec_int ("length_threshold", - "Length Threshold", - "Length Threshold", - -1, G_MAXINT, 0, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH, - g_param_spec_double ("minimum_width", - "Minimum width", - "Minimum Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - "Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - "Height", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_CURSOR_ROW, - g_param_spec_int ("cursor_row", - "Cursor row", - "Cursor row", - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT, - g_param_spec_boolean ("uniform_row_height", - "Uniform row height", - "Uniform row height", - FALSE, - G_PARAM_READWRITE)); - - eti_signals[CURSOR_CHANGE] = - g_signal_new ("cursor_change", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableItemClass, cursor_change), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - - eti_signals[CURSOR_ACTIVATED] = - g_signal_new ("cursor_activated", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableItemClass, cursor_activated), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - - eti_signals[DOUBLE_CLICK] = - g_signal_new ("double_click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableItemClass, double_click), - NULL, NULL, - e_marshal_NONE__INT_INT_BOXED, - G_TYPE_NONE, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - eti_signals[START_DRAG] = - g_signal_new ("start_drag", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableItemClass, start_drag), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_INT_BOXED, - G_TYPE_BOOLEAN, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - eti_signals[RIGHT_CLICK] = - g_signal_new ("right_click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableItemClass, right_click), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_INT_BOXED, - G_TYPE_BOOLEAN, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - eti_signals[CLICK] = - g_signal_new ("click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableItemClass, click), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_INT_BOXED, - G_TYPE_BOOLEAN, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - eti_signals[KEY_PRESS] = - g_signal_new ("key_press", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableItemClass, key_press), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_INT_BOXED, - G_TYPE_BOOLEAN, 3, - G_TYPE_INT, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - eti_signals[STYLE_SET] = - g_signal_new ("style_set", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableItemClass, style_set), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, GTK_TYPE_STYLE); - - eti_signals[SELECTION_MODEL_REMOVED] = - g_signal_new ("selection_model_removed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (ETableItemClass, selection_model_removed), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, - G_TYPE_POINTER); - - eti_signals[SELECTION_MODEL_ADDED] = - g_signal_new ("selection_model_added", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (ETableItemClass, selection_model_added), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, - G_TYPE_POINTER); + g_object_class_install_property ( + object_class, + PROP_TABLE_HEADER, + g_param_spec_object ( + "ETableHeader", + "Table header", + "Table header", + E_TYPE_TABLE_HEADER, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_MODEL, + g_param_spec_object ( + "ETableModel", + "Table model", + "Table model", + E_TYPE_TABLE_MODEL, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_SELECTION_MODEL, + g_param_spec_object ( + "selection_model", + "Selection model", + "Selection model", + E_TYPE_SELECTION_MODEL, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_ALTERNATING_ROW_COLORS, + g_param_spec_boolean ( + "alternating_row_colors", + "Alternating Row Colors", + "Alternating Row Colors", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_HORIZONTAL_DRAW_GRID, + g_param_spec_boolean ( + "horizontal_draw_grid", + "Horizontal Draw Grid", + "Horizontal Draw Grid", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_VERTICAL_DRAW_GRID, + g_param_spec_boolean ( + "vertical_draw_grid", + "Vertical Draw Grid", + "Vertical Draw Grid", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_TABLE_DRAW_FOCUS, + g_param_spec_boolean ( + "drawfocus", + "Draw focus", + "Draw focus", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_CURSOR_MODE, + g_param_spec_int ( + "cursor_mode", + "Cursor mode", + "Cursor mode", + E_CURSOR_LINE, + E_CURSOR_SPREADSHEET, + E_CURSOR_LINE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_LENGTH_THRESHOLD, + g_param_spec_int ( + "length_threshold", + "Length Threshold", + "Length Threshold", + -1, G_MAXINT, 0, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_MINIMUM_WIDTH, + g_param_spec_double ( + "minimum_width", + "Minimum width", + "Minimum Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + "Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + "Height", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE)); + + g_object_class_install_property ( + object_class, + PROP_CURSOR_ROW, + g_param_spec_int ( + "cursor_row", + "Cursor row", + "Cursor row", + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_UNIFORM_ROW_HEIGHT, + g_param_spec_boolean ( + "uniform_row_height", + "Uniform row height", + "Uniform row height", + FALSE, + G_PARAM_READWRITE)); + + eti_signals[CURSOR_CHANGE] = g_signal_new ( + "cursor_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, cursor_change), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + eti_signals[CURSOR_ACTIVATED] = g_signal_new ( + "cursor_activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, cursor_activated), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + eti_signals[DOUBLE_CLICK] = g_signal_new ( + "double_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, double_click), + NULL, NULL, + e_marshal_NONE__INT_INT_BOXED, + G_TYPE_NONE, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + eti_signals[START_DRAG] = g_signal_new ( + "start_drag", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, start_drag), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_INT_BOXED, + G_TYPE_BOOLEAN, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + eti_signals[RIGHT_CLICK] = g_signal_new ( + "right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, right_click), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_INT_BOXED, + G_TYPE_BOOLEAN, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + eti_signals[CLICK] = g_signal_new ( + "click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, click), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_INT_BOXED, + G_TYPE_BOOLEAN, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + eti_signals[KEY_PRESS] = g_signal_new ( + "key_press", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, key_press), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_INT_BOXED, + G_TYPE_BOOLEAN, 3, + G_TYPE_INT, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + eti_signals[STYLE_SET] = g_signal_new ( + "style_set", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableItemClass, style_set), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_STYLE); + + eti_signals[SELECTION_MODEL_REMOVED] = g_signal_new ( + "selection_model_removed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (ETableItemClass, selection_model_removed), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + + eti_signals[SELECTION_MODEL_ADDED] = g_signal_new ( + "selection_model_added", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (ETableItemClass, selection_model_added), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); /* A11y Init */ gal_a11y_e_table_item_init (); @@ -3190,9 +3300,9 @@ e_table_item_focus (ETableItem *eti, } if (row != -1) { - e_selection_model_do_something (E_SELECTION_MODEL (eti->selection), - row, col, - state); + e_selection_model_do_something ( + E_SELECTION_MODEL (eti->selection), + row, col, state); } } @@ -3212,9 +3322,10 @@ e_table_item_get_focused_column (ETableItem *eti) g_return_val_if_fail (eti != NULL, -1); g_return_val_if_fail (E_IS_TABLE_ITEM (eti), -1); - g_object_get (eti->selection, - "cursor_col", &cursor_col, - NULL); + g_object_get ( + eti->selection, + "cursor_col", &cursor_col, + NULL); return cursor_col; } @@ -3253,8 +3364,8 @@ eti_cursor_change (ESelectionModel *selection, e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (eti), FALSE); if (eti_editing (eti)) e_table_item_leave_edit_(eti); - g_signal_emit (eti, eti_signals[CURSOR_CHANGE], 0, - view_row); + + g_signal_emit (eti, eti_signals[CURSOR_CHANGE], 0, view_row); e_table_item_redraw_row (eti, view_row); @@ -3292,8 +3403,8 @@ eti_cursor_activated (ESelectionModel *selection, e_table_item_leave_edit_(eti); if (view_row != -1) - g_signal_emit (eti, eti_signals[CURSOR_ACTIVATED], 0, - view_row); + g_signal_emit ( + eti, eti_signals[CURSOR_ACTIVATED], 0, view_row); } static void @@ -3380,9 +3491,10 @@ e_table_item_leave_edit (ETableItem *eti) eti->editing_row = -1; eti->edit_ctx = NULL; - e_cell_leave_edit (eti->cell_views[col], - view_to_model_col (eti, col), - col, row, edit_ctx); + e_cell_leave_edit ( + eti->cell_views[col], + view_to_model_col (eti, col), + col, row, edit_ctx); } /** @@ -3517,8 +3629,9 @@ eti_printed_row_height (ETableItem *eti, gdouble height = 0; for (col = 0; col < cols; col++) { ECellView *ecell_view = eti->cell_views[col]; - gdouble this_height = e_cell_print_height (ecell_view, context, view_to_model_col (eti, col), col, row, - widths[col] - 1); + gdouble this_height = e_cell_print_height ( + ecell_view, context, view_to_model_col (eti, col), col, row, + widths[col] - 1); if (this_height > height) height = this_height; } @@ -3599,12 +3712,13 @@ e_table_item_print_page (EPrintable *ep, cairo_rectangle (cr, 0, 0, widths[col] - 1, row_height); cairo_clip (cr); - e_cell_print (ecell_view, context, - view_to_model_col (eti, col), - col, - row, - widths[col] - 1, - row_height + 2 ); + e_cell_print ( + ecell_view, context, + view_to_model_col (eti, col), + col, + row, + widths[col] - 1, + row_height + 2); cairo_restore (cr); diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c index 56c1dee33b..950b58e31e 100644 --- a/widgets/table/e-table-memory-store.c +++ b/widgets/table/e-table-memory-store.c @@ -377,9 +377,10 @@ e_table_memory_store_insert_array (ETableMemoryStore *etms, if (row == -1) row = row_count - 1; etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (gpointer)); - memmove (etms->priv->store + etms->priv->col_count * (row + 1), - etms->priv->store + etms->priv->col_count * row, - etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer)); + memmove ( + etms->priv->store + etms->priv->col_count * (row + 1), + etms->priv->store + etms->priv->col_count * row, + etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer)); for (i = 0; i < etms->priv->col_count; i++) { STORE_LOCATOR (etms, i, row) = duplicate_value (etms, i, store[i]); @@ -402,7 +403,7 @@ e_table_memory_store_insert (ETableMemoryStore *etms, va_start (args, data); for (i = 0; i < etms->priv->col_count; i++) { - store[i] = va_arg (args, gpointer ); + store[i] = va_arg (args, gpointer); } va_end (args); @@ -424,9 +425,10 @@ e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, if (row == -1) row = row_count - 1; etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (gpointer)); - memmove (etms->priv->store + etms->priv->col_count * (row + 1), - etms->priv->store + etms->priv->col_count * row, - etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer)); + memmove ( + etms->priv->store + etms->priv->col_count * (row + 1), + etms->priv->store + etms->priv->col_count * row, + etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer)); for (i = 0; i < etms->priv->col_count; i++) { STORE_LOCATOR (etms, i, row) = store[i]; @@ -449,7 +451,7 @@ e_table_memory_store_insert_adopt (ETableMemoryStore *etms, va_start (args, data); for (i = 0; i < etms->priv->col_count; i++) { - store[i] = va_arg (args, gpointer ); + store[i] = va_arg (args, gpointer); } va_end (args); @@ -515,7 +517,7 @@ e_table_memory_store_change (ETableMemoryStore *etms, va_start (args, data); for (i = 0; i < etms->priv->col_count; i++) { - store[i] = va_arg (args, gpointer ); + store[i] = va_arg (args, gpointer); } va_end (args); @@ -580,7 +582,7 @@ e_table_memory_store_change_adopt (ETableMemoryStore *etms, va_start (args, data); for (i = 0; i < etms->priv->col_count; i++) { - store[i] = va_arg (args, gpointer ); + store[i] = va_arg (args, gpointer); } va_end (args); @@ -604,9 +606,10 @@ e_table_memory_store_remove (ETableMemoryStore *etms, e_table_model_free_value (model, i, e_table_model_value_at (model, i, row)); row_count = e_table_model_row_count (E_TABLE_MODEL (etms)) - 1; - memmove (etms->priv->store + etms->priv->col_count * row, - etms->priv->store + etms->priv->col_count * (row + 1), - etms->priv->col_count * (row_count - row) * sizeof (gpointer)); + memmove ( + etms->priv->store + etms->priv->col_count * row, + etms->priv->store + etms->priv->col_count * (row + 1), + etms->priv->col_count * (row_count - row) * sizeof (gpointer)); etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (gpointer)); e_table_memory_remove (E_TABLE_MEMORY (etms), row); diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c index 7c12496af9..99479f94ee 100644 --- a/widgets/table/e-table-model.c +++ b/widgets/table/e-table-model.c @@ -457,8 +457,7 @@ e_table_model_pre_change (ETableModel *e_table_model) d (print_tabs ()); d (depth++); - g_signal_emit (G_OBJECT (e_table_model), - signals[MODEL_PRE_CHANGE], 0); + g_signal_emit (e_table_model, signals[MODEL_PRE_CHANGE], 0); d (depth--); } @@ -485,8 +484,7 @@ e_table_model_no_change (ETableModel *e_table_model) d (print_tabs ()); d (depth++); - g_signal_emit (G_OBJECT (e_table_model), - signals[MODEL_NO_CHANGE], 0); + g_signal_emit (e_table_model, signals[MODEL_NO_CHANGE], 0); d (depth--); } @@ -513,8 +511,7 @@ e_table_model_changed (ETableModel *e_table_model) d (print_tabs ()); d (depth++); - g_signal_emit (G_OBJECT (e_table_model), - signals[MODEL_CHANGED], 0); + g_signal_emit (e_table_model, signals[MODEL_CHANGED], 0); d (depth--); } @@ -539,8 +536,7 @@ e_table_model_row_changed (ETableModel *e_table_model, d (print_tabs ()); d (depth++); - g_signal_emit (G_OBJECT (e_table_model), - signals[MODEL_ROW_CHANGED], 0, row); + g_signal_emit (e_table_model, signals[MODEL_ROW_CHANGED], 0, row); d (depth--); } @@ -567,8 +563,8 @@ e_table_model_cell_changed (ETableModel *e_table_model, d (print_tabs ()); d (depth++); - g_signal_emit (G_OBJECT (e_table_model), - signals[MODEL_CELL_CHANGED], 0, col, row); + g_signal_emit ( + e_table_model, signals[MODEL_CELL_CHANGED], 0, col, row); d (depth--); } @@ -595,8 +591,8 @@ e_table_model_rows_inserted (ETableModel *e_table_model, d (print_tabs ()); d (depth++); - g_signal_emit (G_OBJECT (e_table_model), - signals[MODEL_ROWS_INSERTED], 0, row, count); + g_signal_emit ( + e_table_model, signals[MODEL_ROWS_INSERTED], 0, row, count); d (depth--); } diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 99a0d7b9ab..e084bc9602 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -63,9 +63,10 @@ e_table_search_search (ETableSearch *e_table_search, gboolean ret_val; g_return_val_if_fail (E_IS_TABLE_SEARCH (e_table_search), FALSE); - g_signal_emit (G_OBJECT (e_table_search), - e_table_search_signals[SEARCH_SEARCH], - 0, string, flags, &ret_val); + g_signal_emit ( + e_table_search, + e_table_search_signals[SEARCH_SEARCH], 0, + string, flags, &ret_val); return ret_val; } @@ -75,8 +76,9 @@ e_table_search_accept (ETableSearch *e_table_search) { g_return_if_fail (E_IS_TABLE_SEARCH (e_table_search)); - g_signal_emit (G_OBJECT (e_table_search), - e_table_search_signals[SEARCH_ACCEPT], 0); + g_signal_emit ( + e_table_search, + e_table_search_signals[SEARCH_ACCEPT], 0); } static gboolean @@ -134,23 +136,25 @@ e_table_search_class_init (ETableSearchClass *class) object_class = G_OBJECT_CLASS (class); object_class->finalize = e_table_search_finalize; - e_table_search_signals[SEARCH_SEARCH] = - g_signal_new ("search", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableSearchClass, search), - (GSignalAccumulator) NULL, NULL, - e_marshal_BOOLEAN__STRING_INT, - G_TYPE_BOOLEAN, 2, G_TYPE_STRING, G_TYPE_INT); - - e_table_search_signals[SEARCH_ACCEPT] = - g_signal_new ("accept", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableSearchClass, accept), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + e_table_search_signals[SEARCH_SEARCH] = g_signal_new ( + "search", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableSearchClass, search), + (GSignalAccumulator) NULL, NULL, + e_marshal_BOOLEAN__STRING_INT, + G_TYPE_BOOLEAN, 2, + G_TYPE_STRING, + G_TYPE_INT); + + e_table_search_signals[SEARCH_ACCEPT] = g_signal_new ( + "accept", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableSearchClass, accept), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); class->search = NULL; class->accept = NULL; diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index 0320663e8e..2ee44a7ffe 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -80,9 +80,10 @@ model_pre_change (ETableModel *etm, (GDestroyNotify) NULL); e_selection_model_foreach (E_SELECTION_MODEL (etsm), save_to_hash, etsm); - g_object_get (etsm, - "cursor_row", &cursor_row, - NULL); + g_object_get ( + etsm, + "cursor_row", &cursor_row, + NULL); g_free (etsm->cursor_id); if (cursor_row != -1) etsm->cursor_id = e_table_model_get_save_id (etm, cursor_row); @@ -234,18 +235,24 @@ inline static void drop_model (ETableSelectionModel *etsm) { if (etsm->model) { - g_signal_handler_disconnect (G_OBJECT (etsm->model), - etsm->model_pre_change_id); - g_signal_handler_disconnect (G_OBJECT (etsm->model), - etsm->model_changed_id); - g_signal_handler_disconnect (G_OBJECT (etsm->model), - etsm->model_row_changed_id); - g_signal_handler_disconnect (G_OBJECT (etsm->model), - etsm->model_cell_changed_id); - g_signal_handler_disconnect (G_OBJECT (etsm->model), - etsm->model_rows_inserted_id); - g_signal_handler_disconnect (G_OBJECT (etsm->model), - etsm->model_rows_deleted_id); + g_signal_handler_disconnect ( + etsm->model, + etsm->model_pre_change_id); + g_signal_handler_disconnect ( + etsm->model, + etsm->model_changed_id); + g_signal_handler_disconnect ( + etsm->model, + etsm->model_row_changed_id); + g_signal_handler_disconnect ( + etsm->model, + etsm->model_cell_changed_id); + g_signal_handler_disconnect ( + etsm->model, + etsm->model_rows_inserted_id); + g_signal_handler_disconnect ( + etsm->model, + etsm->model_rows_deleted_id); g_object_unref (etsm->model); } @@ -332,19 +339,25 @@ e_table_selection_model_class_init (ETableSelectionModelClass *class) esma_class->get_row_count = etsm_get_row_count; - g_object_class_install_property (object_class, PROP_MODEL, - g_param_spec_object ("model", - "Model", - NULL, - E_TYPE_TABLE_MODEL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_HEADER, - g_param_spec_object ("header", - "Header", - NULL, - E_TYPE_TABLE_HEADER, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_MODEL, + g_param_spec_object ( + "model", + "Model", + NULL, + E_TYPE_TABLE_MODEL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_HEADER, + g_param_spec_object ( + "header", + "Header", + NULL, + E_TYPE_TABLE_HEADER, + G_PARAM_READWRITE)); } /** diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index 4740c0fb50..7ce56d7c75 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -79,23 +79,23 @@ e_table_sort_info_class_init (ETableSortInfoClass *class) object_class->finalize = etsi_finalize; - e_table_sort_info_signals[SORT_INFO_CHANGED] = - g_signal_new ("sort_info_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableSortInfoClass, sort_info_changed), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - e_table_sort_info_signals[GROUP_INFO_CHANGED] = - g_signal_new ("group_info_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETableSortInfoClass, group_info_changed), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + e_table_sort_info_signals[SORT_INFO_CHANGED] = g_signal_new ( + "sort_info_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableSortInfoClass, sort_info_changed), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + e_table_sort_info_signals[GROUP_INFO_CHANGED] = g_signal_new ( + "group_info_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETableSortInfoClass, group_info_changed), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); class->sort_info_changed = NULL; class->group_info_changed = NULL; @@ -110,7 +110,7 @@ e_table_sort_info_sort_info_changed (ETableSortInfo *info) if (info->frozen) { info->sort_info_changed = 1; } else { - g_signal_emit (G_OBJECT (info), e_table_sort_info_signals[SORT_INFO_CHANGED], 0); + g_signal_emit (info, e_table_sort_info_signals[SORT_INFO_CHANGED], 0); } } @@ -123,7 +123,7 @@ e_table_sort_info_group_info_changed (ETableSortInfo *info) if (info->frozen) { info->group_info_changed = 1; } else { - g_signal_emit (G_OBJECT (info), e_table_sort_info_signals[GROUP_INFO_CHANGED], 0); + g_signal_emit (info, e_table_sort_info_signals[GROUP_INFO_CHANGED], 0); } } @@ -405,7 +405,7 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, } } } - g_signal_emit (G_OBJECT (info), e_table_sort_info_signals[SORT_INFO_CHANGED], 0); + g_signal_emit (info, e_table_sort_info_signals[SORT_INFO_CHANGED], 0); } /** diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c index 7792795477..73a92c35ef 100644 --- a/widgets/table/e-table-sorted-variable.c +++ b/widgets/table/e-table-sorted-variable.c @@ -54,8 +54,9 @@ etsv_dispose (GObject *object) ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (object); if (etsv->sort_info_changed_id) - g_signal_handler_disconnect (G_OBJECT (etsv->sort_info), - etsv->sort_info_changed_id); + g_signal_handler_disconnect ( + etsv->sort_info, + etsv->sort_info_changed_id); etsv->sort_info_changed_id = 0; if (etsv->sort_idle_id) { diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c index 022e4e9582..31f0fa60b4 100644 --- a/widgets/table/e-table-sorted.c +++ b/widgets/table/e-table-sorted.c @@ -65,8 +65,9 @@ ets_dispose (GObject *object) ets->insert_idle_id = 0; if (ets->sort_info) { - g_signal_handler_disconnect (G_OBJECT (ets->sort_info), - ets->sort_info_changed_id); + g_signal_handler_disconnect ( + ets->sort_info, + ets->sort_info_changed_id); g_object_unref (ets->sort_info); ets->sort_info = NULL; } diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index 022c27a3a1..2815d13b1b 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -69,26 +69,33 @@ ets_dispose (GObject *object) if (ets->sort_info) { if (ets->table_model_changed_id) - g_signal_handler_disconnect (ets->source, - ets->table_model_changed_id); + g_signal_handler_disconnect ( + ets->source, + ets->table_model_changed_id); if (ets->table_model_row_changed_id) - g_signal_handler_disconnect (ets->source, - ets->table_model_row_changed_id); + g_signal_handler_disconnect ( + ets->source, + ets->table_model_row_changed_id); if (ets->table_model_cell_changed_id) - g_signal_handler_disconnect (ets->source, - ets->table_model_cell_changed_id); + g_signal_handler_disconnect ( + ets->source, + ets->table_model_cell_changed_id); if (ets->table_model_rows_inserted_id) - g_signal_handler_disconnect (ets->source, - ets->table_model_rows_inserted_id); + g_signal_handler_disconnect ( + ets->source, + ets->table_model_rows_inserted_id); if (ets->table_model_rows_deleted_id) - g_signal_handler_disconnect (ets->source, - ets->table_model_rows_deleted_id); + g_signal_handler_disconnect ( + ets->source, + ets->table_model_rows_deleted_id); if (ets->sort_info_changed_id) - g_signal_handler_disconnect (ets->sort_info, - ets->sort_info_changed_id); + g_signal_handler_disconnect ( + ets->sort_info, + ets->sort_info_changed_id); if (ets->group_info_changed_id) - g_signal_handler_disconnect (ets->sort_info, - ets->group_info_changed_id); + g_signal_handler_disconnect ( + ets->sort_info, + ets->group_info_changed_id); ets->table_model_changed_id = 0; ets->table_model_row_changed_id = 0; @@ -177,12 +184,15 @@ ets_class_init (ETableSorterClass *class) sorter_class->get_sorted_to_model_array = ets_get_sorted_to_model_array; sorter_class->needs_sorting = ets_needs_sorting; - g_object_class_install_property (object_class, PROP_SORT_INFO, - g_param_spec_object ("sort_info", - "Sort Info", - NULL, - E_TYPE_TABLE_SORT_INFO, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_SORT_INFO, + g_param_spec_object ( + "sort_info", + "Sort Info", + NULL, + E_TYPE_TABLE_SORT_INFO, + G_PARAM_READWRITE)); } static void diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index e5f5b17757..9f301f6852 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -159,7 +159,7 @@ e_table_specification_load_from_string (ETableSpecification *specification, const gchar *xml) { xmlDoc *doc; - doc = xmlParseMemory ( (gchar *) xml, strlen (xml)); + doc = xmlParseMemory ((gchar *) xml, strlen (xml)); if (doc) { xmlNode *node = xmlDocGetRootElement (doc); e_table_specification_load_from_node (specification, node); diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index ae4e891ac9..411102eac1 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -114,20 +114,27 @@ etss_dispose (GObject *object) ETableSubset *etss = E_TABLE_SUBSET (object); if (etss->source) { - g_signal_handler_disconnect (G_OBJECT (etss->source), - etss->table_model_pre_change_id); - g_signal_handler_disconnect (G_OBJECT (etss->source), - etss->table_model_no_change_id); - g_signal_handler_disconnect (G_OBJECT (etss->source), - etss->table_model_changed_id); - g_signal_handler_disconnect (G_OBJECT (etss->source), - etss->table_model_row_changed_id); - g_signal_handler_disconnect (G_OBJECT (etss->source), - etss->table_model_cell_changed_id); - g_signal_handler_disconnect (G_OBJECT (etss->source), - etss->table_model_rows_inserted_id); - g_signal_handler_disconnect (G_OBJECT (etss->source), - etss->table_model_rows_deleted_id); + g_signal_handler_disconnect ( + etss->source, + etss->table_model_pre_change_id); + g_signal_handler_disconnect ( + etss->source, + etss->table_model_no_change_id); + g_signal_handler_disconnect ( + etss->source, + etss->table_model_changed_id); + g_signal_handler_disconnect ( + etss->source, + etss->table_model_row_changed_id); + g_signal_handler_disconnect ( + etss->source, + etss->table_model_cell_changed_id); + g_signal_handler_disconnect ( + etss->source, + etss->table_model_rows_inserted_id); + g_signal_handler_disconnect ( + etss->source, + etss->table_model_rows_deleted_id); g_object_unref (etss->source); etss->source = NULL; diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c index 8b10837b3f..d233a4d16f 100644 --- a/widgets/table/e-table-utils.c +++ b/widgets/table/e-table-utils.c @@ -135,9 +135,10 @@ et_col_spec_to_col (ETableColumnSpecification *col_spec, g_free (title); } if (col && col_spec->compare_col != col_spec->model_col) - g_object_set (col, - "compare_col", col_spec->compare_col, - NULL); + g_object_set ( + col, + "compare_col", col_spec->compare_col, + NULL); return col; } diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index a555353193..b73ae55ba6 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -224,10 +224,11 @@ current_search_col (ETable *et) { if (!et->search_col_set) { et->current_search_col = - e_table_util_calculate_current_search_col (et->header, - et->full_header, - et->sort_info, - et->always_search); + e_table_util_calculate_current_search_col ( + et->header, + et->full_header, + et->sort_info, + et->always_search); et->search_col_set = TRUE; } @@ -471,9 +472,10 @@ et_search_search (ETableSearch *search, rows = e_table_model_row_count (et->model); - g_object_get (et->selection, - "cursor_row", &cursor, - NULL); + g_object_get ( + et->selection, + "cursor_row", &cursor, + NULL); if ((flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST) && cursor < rows && cursor >= 0 && @@ -650,17 +652,19 @@ set_header_canvas_width (ETable *e_table) if (!(e_table->header_item && e_table->header_canvas && e_table->table_canvas)) return; - gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->table_canvas), - NULL, NULL, &width, NULL); - gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->header_canvas), - NULL, NULL, &oldwidth, &oldheight); + gnome_canvas_get_scroll_region ( + GNOME_CANVAS (e_table->table_canvas), + NULL, NULL, &width, NULL); + gnome_canvas_get_scroll_region ( + GNOME_CANVAS (e_table->header_canvas), + NULL, NULL, &oldwidth, &oldheight); if (oldwidth != width || oldheight != E_TABLE_HEADER_ITEM (e_table->header_item)->height - 1) gnome_canvas_set_scroll_region ( - GNOME_CANVAS (e_table->header_canvas), - 0, 0, width, /* COLUMN_HEADER_HEIGHT - 1 */ - E_TABLE_HEADER_ITEM (e_table->header_item)->height - 1); + GNOME_CANVAS (e_table->header_canvas), + 0, 0, width, /* COLUMN_HEADER_HEIGHT - 1 */ + E_TABLE_HEADER_ITEM (e_table->header_item)->height - 1); } @@ -759,13 +763,15 @@ table_canvas_reflow_idle (ETable *e_table) height = MAX ((gint) height, allocation.height); width = MAX ((gint) width, allocation.width); /* I have no idea why this needs to be -1, but it works. */ - gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->table_canvas), - NULL, NULL, &oldwidth, &oldheight); + gnome_canvas_get_scroll_region ( + GNOME_CANVAS (e_table->table_canvas), + NULL, NULL, &oldwidth, &oldheight); if (oldwidth != width - 1 || oldheight != height - 1) { - gnome_canvas_set_scroll_region (GNOME_CANVAS (e_table->table_canvas), - 0, 0, width - 1, height - 1); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (e_table->table_canvas), + 0, 0, width - 1, height - 1); set_header_canvas_width (e_table); } e_table->reflow_idle_id = 0; @@ -784,14 +790,16 @@ table_canvas_size_allocate (GtkWidget *widget, width = alloc->width; g_value_set_double (val, width); - g_object_get (e_table->canvas_vbox, - "height", &height, - NULL); + g_object_get ( + e_table->canvas_vbox, + "height", &height, + NULL); height = MAX ((gint) height, alloc->height); - g_object_set (e_table->canvas_vbox, - "width", width, - NULL); + g_object_set ( + e_table->canvas_vbox, + "width", width, + NULL); g_object_set_property (G_OBJECT (e_table->header), "width", val); g_free (val); if (e_table->reflow_idle_id) @@ -1065,12 +1073,13 @@ et_build_groups (ETable *et) et->is_grouped = e_table_sort_info_grouping_get_count (et->sort_info) > 0; - et->group = e_table_group_new (GNOME_CANVAS_GROUP (et->canvas_vbox), - et->full_header, - et->header, - et->model, - et->sort_info, - 0); + et->group = e_table_group_new ( + GNOME_CANVAS_GROUP (et->canvas_vbox), + et->full_header, + et->header, + et->model, + et->sort_info, + 0); if (et->use_click_to_add_end) e_canvas_vbox_add_item_start ( @@ -1549,18 +1558,21 @@ e_table_set_state_object (ETable *e_table, e_table->sort_info = NULL; if (e_table->sorter) - g_object_set (e_table->sorter, - "sort_info", e_table->sort_info, - NULL); + g_object_set ( + e_table->sorter, + "sort_info", e_table->sort_info, + NULL); if (e_table->header_item) - g_object_set (e_table->header_item, - "ETableHeader", e_table->header, - "sort_info", e_table->sort_info, - NULL); + g_object_set ( + e_table->header_item, + "ETableHeader", e_table->header, + "sort_info", e_table->sort_info, + NULL); if (e_table->click_to_add) - g_object_set (e_table->click_to_add, - "header", e_table->header, - NULL); + g_object_set ( + e_table->click_to_add, + "header", e_table->header, + NULL); e_table->need_rebuild = TRUE; if (!e_table->rebuild_idle_id) @@ -1746,7 +1758,8 @@ et_real_construct (ETable *e_table, e_table->use_click_to_add = specification->click_to_add; e_table->use_click_to_add_end = specification->click_to_add_end; e_table->click_to_add_message = specification->click_to_add_message ? - g_strdup (dgettext (e_table->domain, + g_strdup ( + dgettext (e_table->domain, specification->click_to_add_message)) : NULL; e_table->alternating_row_colors = specification->alternating_row_colors; e_table->horizontal_draw_grid = specification->horizontal_draw_grid; @@ -1826,17 +1839,19 @@ et_real_construct (ETable *e_table, if (!specification->no_headers) { /* The header */ - gtk_table_attach (GTK_TABLE (e_table), GTK_WIDGET (e_table->header_canvas), - 0, 1, 0 + row, 1 + row, - GTK_FILL | GTK_EXPAND, - GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (e_table), GTK_WIDGET (e_table->header_canvas), + 0, 1, 0 + row, 1 + row, + GTK_FILL | GTK_EXPAND, + GTK_FILL, 0, 0); row++; } - gtk_table_attach (GTK_TABLE (e_table), GTK_WIDGET (e_table->table_canvas), - 0, 1, 0 + row, 1 + row, - GTK_FILL | GTK_EXPAND, - GTK_FILL | GTK_EXPAND, - 0, 0); + gtk_table_attach ( + GTK_TABLE (e_table), GTK_WIDGET (e_table->table_canvas), + 0, 1, 0 + row, 1 + row, + GTK_FILL | GTK_EXPAND, + GTK_FILL | GTK_EXPAND, + 0, 0); g_object_unref (ete); @@ -2057,9 +2072,10 @@ e_table_set_cursor_row (ETable *e_table, g_return_if_fail (E_IS_TABLE (e_table)); g_return_if_fail (row >= 0); - g_object_set (e_table->selection, - "cursor_row", row, - NULL); + g_object_set ( + e_table->selection, + "cursor_row", row, + NULL); } /** @@ -2077,9 +2093,10 @@ e_table_get_cursor_row (ETable *e_table) gint row; g_return_val_if_fail (E_IS_TABLE (e_table), -1); - g_object_get (e_table->selection, - "cursor_row", &row, - NULL); + g_object_get ( + e_table->selection, + "cursor_row", &row, + NULL); return row; } @@ -2686,10 +2703,11 @@ e_table_drag_get_data (ETable *table, { g_return_if_fail (E_IS_TABLE (table)); - gtk_drag_get_data (GTK_WIDGET (table), - context, - target, - time); + gtk_drag_get_data ( + GTK_WIDGET (table), + context, + target, + time); } /** @@ -2740,12 +2758,13 @@ e_table_drag_highlight (ETable *table, "outline_color_gdk", &style->fg[GTK_STATE_NORMAL], NULL); } - gnome_canvas_item_set (table->drop_highlight, - "x1", (gdouble) x, - "x2", (gdouble) x + width - 1, - "y1", (gdouble) y, - "y2", (gdouble) y + height - 1, - NULL); + gnome_canvas_item_set ( + table->drop_highlight, + "x1", (gdouble) x, + "x2", (gdouble) x + width - 1, + "y1", (gdouble) y, + "y2", (gdouble) y + height - 1, + NULL); } else { if (table->drop_highlight) { g_object_run_dispose (G_OBJECT (table->drop_highlight)); @@ -2825,19 +2844,21 @@ et_real_start_drag (ETable *table, site = table->site; site->state = 0; - context = e_table_drag_begin (table, row, col, - site->target_list, - site->actions, - 1, event); + context = e_table_drag_begin ( + table, row, col, + site->target_list, + site->actions, + 1, event); if (context) { info = g_dataset_get_data (context, "gtk-info"); if (info && !info->icon_window) { if (site->pixbuf) - gtk_drag_set_icon_pixbuf (context, - site->pixbuf, - -2, -2); + gtk_drag_set_icon_pixbuf ( + context, + site->pixbuf, + -2, -2); else gtk_drag_set_icon_default (context); } @@ -2872,10 +2893,11 @@ e_table_drag_source_set (ETable *table, canvas = GTK_WIDGET (table->table_canvas); site = table->site; - gtk_widget_add_events (canvas, - gtk_widget_get_events (canvas) | - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK); + gtk_widget_add_events ( + canvas, + gtk_widget_get_events (canvas) | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK); table->do_drag = TRUE; diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index ec7092433a..f779405d0e 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -89,7 +89,7 @@ check_children (ETreeMemory *memory, { ETreeMemoryPath *path = node; if (!path->children_computed) { - g_signal_emit (G_OBJECT (memory), signals[FILL_IN_CHILDREN], 0, node); + g_signal_emit (memory, signals[FILL_IN_CHILDREN], 0, node); path->children_computed = TRUE; } } @@ -101,7 +101,7 @@ e_tree_memory_path_depth (ETreeMemoryPath *path) g_return_val_if_fail (path != NULL, -1); - for ( path = path->parent; path; path = path->parent) + for (path = path->parent; path; path = path->parent) depth++; return depth; } @@ -392,14 +392,15 @@ e_tree_memory_class_init (ETreeMemoryClass *class) class->fill_in_children = NULL; - signals[FILL_IN_CHILDREN] = - g_signal_new ("fill_in_children", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeMemoryClass, fill_in_children), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); + signals[FILL_IN_CHILDREN] = g_signal_new ( + "fill_in_children", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeMemoryClass, fill_in_children), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); } static void diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index 9280f3c302..944572dfb4 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -66,95 +66,106 @@ e_tree_model_class_init (ETreeModelClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - signals[PRE_CHANGE] = - g_signal_new ("pre_change", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, pre_change), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[NO_CHANGE] = - g_signal_new ("no_change", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, no_change), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[REBUILT] = - g_signal_new ("rebuilt", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, rebuilt), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[NODE_CHANGED] = - g_signal_new ("node_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, node_changed), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - signals[NODE_DATA_CHANGED] = - g_signal_new ("node_data_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, node_data_changed), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - signals[NODE_COL_CHANGED] = - g_signal_new ("node_col_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, node_col_changed), - (GSignalAccumulator) NULL, NULL, - e_marshal_VOID__POINTER_INT, - G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT); - - signals[NODE_INSERTED] = - g_signal_new ("node_inserted", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, node_inserted), - (GSignalAccumulator) NULL, NULL, - e_marshal_VOID__POINTER_POINTER, - G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER); - - signals[NODE_REMOVED] = - g_signal_new ("node_removed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, node_removed), - (GSignalAccumulator) NULL, NULL, - e_marshal_VOID__POINTER_POINTER_INT, - G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_INT); - - signals[NODE_DELETED] = - g_signal_new ("node_deleted", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, node_deleted), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - signals[NODE_REQUEST_COLLAPSE] = - g_signal_new ("node_request_collapse", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeModelClass, node_request_collapse), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); + signals[PRE_CHANGE] = g_signal_new ( + "pre_change", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, pre_change), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[NO_CHANGE] = g_signal_new ( + "no_change", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, no_change), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[REBUILT] = g_signal_new ( + "rebuilt", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, rebuilt), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[NODE_CHANGED] = g_signal_new ( + "node_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, node_changed), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + + signals[NODE_DATA_CHANGED] = g_signal_new ( + "node_data_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, node_data_changed), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + + signals[NODE_COL_CHANGED] = g_signal_new ( + "node_col_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, node_col_changed), + (GSignalAccumulator) NULL, NULL, + e_marshal_VOID__POINTER_INT, + G_TYPE_NONE, 2, + G_TYPE_POINTER, + G_TYPE_INT); + + signals[NODE_INSERTED] = g_signal_new ( + "node_inserted", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, node_inserted), + (GSignalAccumulator) NULL, NULL, + e_marshal_VOID__POINTER_POINTER, + G_TYPE_NONE, 2, + G_TYPE_POINTER, + G_TYPE_POINTER); + + signals[NODE_REMOVED] = g_signal_new ( + "node_removed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, node_removed), + (GSignalAccumulator) NULL, NULL, + e_marshal_VOID__POINTER_POINTER_INT, + G_TYPE_NONE, 3, + G_TYPE_POINTER, + G_TYPE_POINTER, + G_TYPE_INT); + + signals[NODE_DELETED] = g_signal_new ( + "node_deleted", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, node_deleted), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + + signals[NODE_REQUEST_COLLAPSE] = g_signal_new ( + "node_request_collapse", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeModelClass, node_request_collapse), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); class->get_root = NULL; diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index e88deb469b..0b8f1c4447 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -512,11 +512,12 @@ resort_node (ETreeSorted *ets, if (needs_regen) regenerate_children (ets, path); d (g_print ("Regened sort of node %p\n", path)); - e_table_sorting_utils_tree_sort (E_TREE_MODEL (ets), - ets->priv->sort_info, - ets->priv->full_header, - (ETreePath *) path->children, - path->num_children); + e_table_sorting_utils_tree_sort ( + E_TREE_MODEL (ets), + ets->priv->sort_info, + ets->priv->full_header, + (ETreePath *) path->children, + path->num_children); d (g_print ("Renumbering sort of node %p\n", path)); for (i = 0; i < path->num_children; i++) { path->children[i]->position = i; @@ -1258,14 +1259,15 @@ e_tree_sorted_class_init (ETreeSortedClass *class) tree_model_class->value_is_empty = ets_value_is_empty; tree_model_class->value_to_string = ets_value_to_string; - signals[NODE_RESORTED] = - g_signal_new ("node_resorted", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeSortedClass, node_resorted), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); + signals[NODE_RESORTED] = g_signal_new ( + "node_resorted", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeSortedClass, node_resorted), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); } static void @@ -1393,7 +1395,7 @@ e_tree_sorted_node_resorted (ETreeSorted *sorted, g_return_if_fail (sorted != NULL); g_return_if_fail (E_IS_TREE_SORTED (sorted)); - g_signal_emit (G_OBJECT (sorted), signals[NODE_RESORTED], 0, node); + g_signal_emit (sorted, signals[NODE_RESORTED], 0, node); } void @@ -1405,8 +1407,9 @@ e_tree_sorted_set_sort_info (ETreeSorted *ets, if (ets->priv->sort_info) { if (ets->priv->sort_info_changed_id != 0) - g_signal_handler_disconnect (G_OBJECT (ets->priv->sort_info), - ets->priv->sort_info_changed_id); + g_signal_handler_disconnect ( + ets->priv->sort_info, + ets->priv->sort_info_changed_id); ets->priv->sort_info_changed_id = 0; g_object_unref (ets->priv->sort_info); } diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 4a668d1ba3..c610039c83 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -779,14 +779,15 @@ etta_class_init (ETreeTableAdapterClass *class) class->sorting_changed = NULL; - signals[SORTING_CHANGED] = - g_signal_new ("sorting_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeTableAdapterClass, sorting_changed), - NULL, NULL, - e_marshal_BOOLEAN__NONE, - G_TYPE_BOOLEAN, 0, G_TYPE_NONE); + signals[SORTING_CHANGED] = g_signal_new ( + "sorting_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeTableAdapterClass, sorting_changed), + NULL, NULL, + e_marshal_BOOLEAN__NONE, + G_TYPE_BOOLEAN, 0, + G_TYPE_NONE); } static void @@ -1360,8 +1361,9 @@ 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), - etta->priv->sort_info_changed_id); + g_signal_handler_disconnect ( + etta->priv->sort_info, + etta->priv->sort_info_changed_id); g_object_unref (etta->priv->sort_info); } diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index a25ef8cac4..3f3351d840 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -266,17 +266,21 @@ static void et_disconnect_from_etta (ETree *et) { if (et->priv->table_model_change_id != 0) - g_signal_handler_disconnect (G_OBJECT (et->priv->etta), - et->priv->table_model_change_id); + g_signal_handler_disconnect ( + et->priv->etta, + et->priv->table_model_change_id); if (et->priv->table_row_change_id != 0) - g_signal_handler_disconnect (G_OBJECT (et->priv->etta), - et->priv->table_row_change_id); + g_signal_handler_disconnect ( + et->priv->etta, + et->priv->table_row_change_id); if (et->priv->table_cell_change_id != 0) - g_signal_handler_disconnect (G_OBJECT (et->priv->etta), - et->priv->table_cell_change_id); + g_signal_handler_disconnect ( + et->priv->etta, + et->priv->table_cell_change_id); if (et->priv->table_rows_delete_id != 0) - g_signal_handler_disconnect (G_OBJECT (et->priv->etta), - et->priv->table_rows_delete_id); + g_signal_handler_disconnect ( + et->priv->etta, + et->priv->table_rows_delete_id); et->priv->table_model_change_id = 0; et->priv->table_row_change_id = 0; @@ -295,10 +299,11 @@ current_search_col (ETree *et) { if (!et->priv->search_col_set) { et->priv->current_search_col = - e_table_util_calculate_current_search_col (et->priv->header, - et->priv->full_header, - et->priv->sort_info, - et->priv->always_search); + e_table_util_calculate_current_search_col ( + et->priv->header, + et->priv->full_header, + et->priv->sort_info, + et->priv->always_search); et->priv->search_col_set = TRUE; } @@ -311,7 +316,7 @@ e_tree_state_change (ETree *et) if (et->priv->state_change_freeze) et->priv->state_changed = TRUE; else - g_signal_emit (G_OBJECT (et), et_signals[STATE_CHANGE], 0); + g_signal_emit (et, et_signals[STATE_CHANGE], 0); } static void @@ -336,18 +341,22 @@ disconnect_header (ETree *e_tree) return; if (e_tree->priv->structure_change_id) - g_signal_handler_disconnect (G_OBJECT (e_tree->priv->header), - e_tree->priv->structure_change_id); + g_signal_handler_disconnect ( + e_tree->priv->header, + e_tree->priv->structure_change_id); if (e_tree->priv->expansion_change_id) - g_signal_handler_disconnect (G_OBJECT (e_tree->priv->header), - e_tree->priv->expansion_change_id); + g_signal_handler_disconnect ( + e_tree->priv->header, + e_tree->priv->expansion_change_id); if (e_tree->priv->sort_info) { if (e_tree->priv->sort_info_change_id) - g_signal_handler_disconnect (G_OBJECT (e_tree->priv->sort_info), - e_tree->priv->sort_info_change_id); + g_signal_handler_disconnect ( + e_tree->priv->sort_info, + e_tree->priv->sort_info_change_id); if (e_tree->priv->group_info_change_id) - g_signal_handler_disconnect (G_OBJECT (e_tree->priv->sort_info), - e_tree->priv->group_info_change_id); + g_signal_handler_disconnect ( + e_tree->priv->sort_info, + e_tree->priv->group_info_change_id); g_object_unref (e_tree->priv->sort_info); } @@ -847,14 +856,16 @@ tree_canvas_size_allocate (GtkWidget *widget, width = alloc->width; g_value_set_double (val, width); - g_object_get (e_tree->priv->item, - "height", &height, - NULL); + g_object_get ( + e_tree->priv->item, + "height", &height, + NULL); height = MAX ((gint) height, alloc->height); - g_object_set (e_tree->priv->item, - "width", width, - NULL); + g_object_set ( + e_tree->priv->item, + "width", width, + NULL); g_object_set_property (G_OBJECT (e_tree->priv->header), "width", val); g_free (val); @@ -1051,9 +1062,10 @@ item_key_press (ETableItem *eti, e_table_search_input_character (et->priv->search, key->keyval); } path = e_tree_table_adapter_node_at_row (et->priv->etta, row); - g_signal_emit (et, - et_signals[KEY_PRESS], 0, - row, path, col, event, &return_val); + g_signal_emit ( + et, + et_signals[KEY_PRESS], 0, + row, path, col, event, &return_val); break; } return return_val; @@ -1155,9 +1167,10 @@ white_item_event (GnomeCanvasItem *white_item, ETree *e_tree) { gboolean return_val = 0; - g_signal_emit (e_tree, - et_signals[WHITE_SPACE_EVENT], 0, - event, &return_val); + g_signal_emit ( + e_tree, + et_signals[WHITE_SPACE_EVENT], 0, + event, &return_val); return return_val; } @@ -1327,15 +1340,17 @@ e_tree_set_state_object (ETree *e_tree, g_free (val); if (e_tree->priv->header_item) - g_object_set (e_tree->priv->header_item, - "ETableHeader", e_tree->priv->header, - "sort_info", e_tree->priv->sort_info, - NULL); + g_object_set ( + e_tree->priv->header_item, + "ETableHeader", e_tree->priv->header, + "sort_info", e_tree->priv->sort_info, + NULL); if (e_tree->priv->item) - g_object_set (e_tree->priv->item, - "ETableHeader", e_tree->priv->header, - NULL); + g_object_set ( + e_tree->priv->item, + "ETableHeader", e_tree->priv->header, + NULL); if (e_tree->priv->etta) e_tree_table_adapter_set_sort_info ( @@ -1607,17 +1622,18 @@ et_real_construct (ETree *e_tree, e_tree->priv->sorter = e_sorter_new (); - g_object_set (e_tree->priv->selection, - "sorter", e_tree->priv->sorter, + g_object_set ( + e_tree->priv->selection, + "sorter", e_tree->priv->sorter, #ifdef E_TREE_USE_TREE_SELECTION - "model", e_tree->priv->model, - "etta", e_tree->priv->etta, + "model", e_tree->priv->model, + "etta", e_tree->priv->etta, #else - "model", e_tree->priv->etta, + "model", e_tree->priv->etta, #endif - "selection_mode", specification->selection_mode, - "cursor_mode", specification->cursor_mode, - NULL); + "selection_mode", specification->selection_mode, + "cursor_mode", specification->cursor_mode, + NULL); g_signal_connect ( e_tree->priv->selection, "selection_changed", @@ -1913,9 +1929,10 @@ e_tree_set_cursor (ETree *e_tree, if (row == -1) return; - g_object_set (e_tree->priv->selection, - "cursor_row", row, - NULL); + g_object_set ( + e_tree->priv->selection, + "cursor_row", row, + NULL); #endif } @@ -1930,9 +1947,10 @@ e_tree_get_cursor (ETree *e_tree) g_return_val_if_fail (e_tree != NULL, NULL); g_return_val_if_fail (E_IS_TREE (e_tree), NULL); - g_object_get (e_tree->priv->selection, - "cursor_row", &row, - NULL); + g_object_get ( + e_tree->priv->selection, + "cursor_row", &row, + NULL); if (row == -1) return NULL; @@ -2622,10 +2640,11 @@ e_tree_drag_get_data (ETree *tree, g_return_if_fail (tree != NULL); g_return_if_fail (E_IS_TREE (tree)); - gtk_drag_get_data (GTK_WIDGET (tree), - context, - target, - time); + gtk_drag_get_data ( + GTK_WIDGET (tree), + context, + target, + time); } @@ -2712,11 +2731,12 @@ void e_tree_drag_dest_set (ETree *tree, g_return_if_fail (tree != NULL); g_return_if_fail (E_IS_TREE (tree)); - gtk_drag_dest_set (GTK_WIDGET (tree), - flags, - targets, - n_targets, - actions); + gtk_drag_dest_set ( + GTK_WIDGET (tree), + flags, + targets, + n_targets, + actions); } void e_tree_drag_dest_set_proxy (ETree *tree, @@ -2727,10 +2747,11 @@ void e_tree_drag_dest_set_proxy (ETree *tree, g_return_if_fail (tree != NULL); g_return_if_fail (E_IS_TREE (tree)); - gtk_drag_dest_set_proxy (GTK_WIDGET (tree), - proxy_window, - protocol, - use_coordinates); + gtk_drag_dest_set_proxy ( + GTK_WIDGET (tree), + proxy_window, + protocol, + use_coordinates); } /* @@ -2764,19 +2785,21 @@ et_real_start_drag (ETree *tree, site = tree->priv->site; site->state = 0; - context = e_tree_drag_begin (tree, row, col, - site->target_list, - site->actions, - 1, event); + context = e_tree_drag_begin ( + tree, row, col, + site->target_list, + site->actions, + 1, event); if (context) { info = g_dataset_get_data (context, "gtk-info"); if (info && !info->icon_window) { if (site->pixbuf) - gtk_drag_set_icon_pixbuf (context, - site->pixbuf, - -2, -2); + gtk_drag_set_icon_pixbuf ( + context, + site->pixbuf, + -2, -2); else gtk_drag_set_icon_default (context); } @@ -2804,10 +2827,11 @@ e_tree_drag_source_set (ETree *tree, tree->priv->do_drag = TRUE; - gtk_widget_add_events (canvas, - gtk_widget_get_events (canvas) | - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK); + gtk_widget_add_events ( + canvas, + gtk_widget_get_events (canvas) | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK); if (site) { if (site->target_list) @@ -2868,11 +2892,12 @@ e_tree_drag_begin (ETree *tree, tree->priv->drag_path = path; tree->priv->drag_col = col; - return gtk_drag_begin (GTK_WIDGET (tree->priv->table_canvas), - targets, - actions, - button, - event); + return gtk_drag_begin ( + GTK_WIDGET (tree->priv->table_canvas), + targets, + actions, + button, + event); } /** @@ -2994,12 +3019,13 @@ et_drag_begin (GtkWidget *widget, { et->priv->is_dragging = TRUE; - g_signal_emit (et, - et_signals[TREE_DRAG_BEGIN], 0, - et->priv->drag_row, - et->priv->drag_path, - et->priv->drag_col, - context); + g_signal_emit ( + et, + et_signals[TREE_DRAG_BEGIN], 0, + et->priv->drag_row, + et->priv->drag_path, + et->priv->drag_col, + context); } static void @@ -3009,12 +3035,13 @@ et_drag_end (GtkWidget *widget, { et->priv->is_dragging = FALSE; - g_signal_emit (et, - et_signals[TREE_DRAG_END], 0, - et->priv->drag_row, - et->priv->drag_path, - et->priv->drag_col, - context); + g_signal_emit ( + et, + et_signals[TREE_DRAG_END], 0, + et->priv->drag_row, + et->priv->drag_path, + et->priv->drag_col, + context); } static void @@ -3025,15 +3052,16 @@ et_drag_data_get (GtkWidget *widget, guint time, ETree *et) { - g_signal_emit (et, - et_signals[TREE_DRAG_DATA_GET], 0, - et->priv->drag_row, - et->priv->drag_path, - et->priv->drag_col, - context, - selection_data, - info, - time); + g_signal_emit ( + et, + et_signals[TREE_DRAG_DATA_GET], 0, + et->priv->drag_row, + et->priv->drag_path, + et->priv->drag_col, + context, + selection_data, + info, + time); } static void @@ -3041,12 +3069,13 @@ et_drag_data_delete (GtkWidget *widget, GdkDragContext *context, ETree *et) { - g_signal_emit (et, - et_signals[TREE_DRAG_DATA_DELETE], 0, - et->priv->drag_row, - et->priv->drag_path, - et->priv->drag_col, - context); + g_signal_emit ( + et, + et_signals[TREE_DRAG_DATA_DELETE], 0, + et->priv->drag_row, + et->priv->drag_path, + et->priv->drag_col, + context); } static gboolean @@ -3060,19 +3089,16 @@ do_drag_motion (ETree *et, gint row, col; ETreePath path; - e_tree_get_cell_at (et, - x, - y, - &row, - &col); + e_tree_get_cell_at (et, x, y, &row, &col); + if (row != et->priv->drop_row && col != et->priv->drop_col) { - g_signal_emit (et, - et_signals[TREE_DRAG_LEAVE], 0, - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - time); + g_signal_emit ( + et, et_signals[TREE_DRAG_LEAVE], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + time); } path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -3080,16 +3106,15 @@ do_drag_motion (ETree *et, et->priv->drop_row = row; et->priv->drop_path = path; et->priv->drop_col = col; - g_signal_emit (et, - et_signals[TREE_DRAG_MOTION], 0, - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - x, - y, - time, - &ret_val); + g_signal_emit ( + et, et_signals[TREE_DRAG_MOTION], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + x, y, + time, + &ret_val); return ret_val; } @@ -3185,11 +3210,7 @@ hover_timeout (gpointer data) gint row, col; ETreePath path; - e_tree_get_cell_at (et, - x, - y, - &row, - &col); + e_tree_get_cell_at (et, x, y, &row, &col); path = e_tree_table_adapter_node_at_row (et->priv->etta, row); if (path && e_tree_model_node_is_expandable (et->priv->model, path)) { @@ -3310,13 +3331,14 @@ et_drag_leave (GtkWidget *widget, guint time, ETree *et) { - g_signal_emit (et, - et_signals[TREE_DRAG_LEAVE], 0, - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - time); + g_signal_emit ( + et, + et_signals[TREE_DRAG_LEAVE], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + time); et->priv->drop_row = -1; et->priv->drop_col = -1; @@ -3383,46 +3405,44 @@ et_drag_drop (GtkWidget *widget, gboolean ret_val = FALSE; gint row, col; ETreePath path; - e_tree_get_cell_at (et, - x, - y, - &row, - &col); + + e_tree_get_cell_at (et, x, y, &row, &col); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); if (row != et->priv->drop_row && col != et->priv->drop_row) { - g_signal_emit (et, - et_signals[TREE_DRAG_LEAVE], 0, - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - time); - g_signal_emit (et, - et_signals[TREE_DRAG_MOTION], 0, - row, - path, - col, - context, - x, - y, - time, - &ret_val); + g_signal_emit ( + et, et_signals[TREE_DRAG_LEAVE], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + time); + g_signal_emit ( + et, et_signals[TREE_DRAG_MOTION], 0, + row, + path, + col, + context, + x, + y, + time, + &ret_val); } et->priv->drop_row = row; et->priv->drop_path = path; et->priv->drop_col = col; - g_signal_emit (et, - et_signals[TREE_DRAG_DROP], 0, - et->priv->drop_row, - et->priv->drop_path, - et->priv->drop_col, - context, - x, - y, - time, - &ret_val); + g_signal_emit ( + et, et_signals[TREE_DRAG_DROP], 0, + et->priv->drop_row, + et->priv->drop_path, + et->priv->drop_col, + context, + x, + y, + time, + &ret_val); et->priv->drop_row = -1; et->priv->drop_path = NULL; @@ -3446,23 +3466,21 @@ et_drag_data_received (GtkWidget *widget, { gint row, col; ETreePath path; - e_tree_get_cell_at (et, - x, - y, - &row, - &col); + + e_tree_get_cell_at (et, x, y, &row, &col); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); - g_signal_emit (et, - et_signals[TREE_DRAG_DATA_RECEIVED], 0, - row, - path, - col, - context, - x, - y, - selection_data, - info, - time); + g_signal_emit ( + et, et_signals[TREE_DRAG_DATA_RECEIVED], 0, + row, + path, + col, + context, + x, + y, + selection_data, + info, + time); } static void @@ -3486,284 +3504,318 @@ e_tree_class_init (ETreeClass *class) class->start_drag = et_real_start_drag; - et_signals[CURSOR_CHANGE] = - g_signal_new ("cursor_change", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, cursor_change), - NULL, NULL, - e_marshal_NONE__INT_POINTER, - G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER); - - et_signals[CURSOR_ACTIVATED] = - g_signal_new ("cursor_activated", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, cursor_activated), - NULL, NULL, - e_marshal_NONE__INT_POINTER, - G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER); - - et_signals[SELECTION_CHANGE] = - g_signal_new ("selection_change", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, selection_change), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - et_signals[DOUBLE_CLICK] = - g_signal_new ("double_click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, double_click), - NULL, NULL, - e_marshal_NONE__INT_POINTER_INT_BOXED, - G_TYPE_NONE, 4, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - et_signals[RIGHT_CLICK] = - g_signal_new ("right_click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, right_click), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_POINTER_INT_BOXED, - G_TYPE_BOOLEAN, 4, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - et_signals[CLICK] = - g_signal_new ("click", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, click), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_POINTER_INT_BOXED, - G_TYPE_BOOLEAN, 4, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - et_signals[KEY_PRESS] = - g_signal_new ("key_press", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, key_press), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__INT_POINTER_INT_BOXED, - G_TYPE_BOOLEAN, 4, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - et_signals[START_DRAG] = - g_signal_new ("start_drag", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, start_drag), - NULL, NULL, - e_marshal_NONE__INT_POINTER_INT_BOXED, - G_TYPE_NONE, 4, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - et_signals[STATE_CHANGE] = - g_signal_new ("state_change", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, state_change), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - et_signals[WHITE_SPACE_EVENT] = - g_signal_new ("white_space_event", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, white_space_event), - g_signal_accumulator_true_handled, NULL, - e_marshal_BOOLEAN__POINTER, - G_TYPE_BOOLEAN, 1, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - et_signals[TREE_DRAG_BEGIN] = - g_signal_new ("tree_drag_begin", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, tree_drag_begin), - NULL, NULL, - e_marshal_NONE__INT_POINTER_INT_BOXED, - G_TYPE_NONE, 4, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT); - et_signals[TREE_DRAG_END] = - g_signal_new ("tree_drag_end", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, tree_drag_end), - NULL, NULL, - e_marshal_NONE__INT_POINTER_INT_BOXED, - G_TYPE_NONE, 4, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT); - et_signals[TREE_DRAG_DATA_GET] = - g_signal_new ("tree_drag_data_get", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, tree_drag_data_get), - NULL, NULL, - e_marshal_NONE__INT_POINTER_INT_OBJECT_BOXED_UINT_UINT, - G_TYPE_NONE, 7, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE, - G_TYPE_UINT, - G_TYPE_UINT); - et_signals[TREE_DRAG_DATA_DELETE] = - g_signal_new ("tree_drag_data_delete", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, tree_drag_data_delete), - NULL, NULL, - e_marshal_NONE__INT_POINTER_INT_OBJECT, - G_TYPE_NONE, 4, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT); - - et_signals[TREE_DRAG_LEAVE] = - g_signal_new ("tree_drag_leave", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, tree_drag_leave), - NULL, NULL, - e_marshal_NONE__INT_POINTER_INT_OBJECT_UINT, - G_TYPE_NONE, 5, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - G_TYPE_UINT); - et_signals[TREE_DRAG_MOTION] = - g_signal_new ("tree_drag_motion", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, tree_drag_motion), - NULL, NULL, - e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT, - G_TYPE_BOOLEAN, 7, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - G_TYPE_INT, - G_TYPE_INT, - G_TYPE_UINT); - et_signals[TREE_DRAG_DROP] = - g_signal_new ("tree_drag_drop", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, tree_drag_drop), - NULL, NULL, - e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT, - G_TYPE_BOOLEAN, 7, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - G_TYPE_INT, - G_TYPE_INT, - G_TYPE_UINT); - et_signals[TREE_DRAG_DATA_RECEIVED] = - g_signal_new ("tree_drag_data_received", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETreeClass, tree_drag_data_received), - NULL, NULL, - e_marshal_NONE__INT_POINTER_INT_OBJECT_INT_INT_BOXED_UINT_UINT, - G_TYPE_NONE, 9, - G_TYPE_INT, - G_TYPE_POINTER, - G_TYPE_INT, - GDK_TYPE_DRAG_CONTEXT, - G_TYPE_INT, - G_TYPE_INT, - GTK_TYPE_SELECTION_DATA, - G_TYPE_UINT, - G_TYPE_UINT); - - g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD, - g_param_spec_int ("length_threshold", - "Length Threshold", - "Length Threshold", - 0, G_MAXINT, 0, - G_PARAM_WRITABLE)); - g_object_class_install_property (object_class, PROP_HORIZONTAL_DRAW_GRID, - g_param_spec_boolean ("horizontal_draw_grid", - "Horizontal Draw Grid", - "Horizontal Draw Grid", - FALSE, - G_PARAM_WRITABLE)); - g_object_class_install_property (object_class, PROP_VERTICAL_DRAW_GRID, - g_param_spec_boolean ("vertical_draw_grid", - "Vertical Draw Grid", - "Vertical Draw Grid", - FALSE, - G_PARAM_WRITABLE)); - g_object_class_install_property (object_class, PROP_DRAW_FOCUS, - g_param_spec_boolean ("drawfocus", - "Draw focus", - "Draw focus", - FALSE, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_ETTA, - g_param_spec_object ("ETreeTableAdapter", - "ETree table adapter", - "ETree table adapter", - E_TYPE_TREE_TABLE_ADAPTER, - G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT, - g_param_spec_boolean ("uniform_row_height", - "Uniform row height", - "Uniform row height", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_ALWAYS_SEARCH, - g_param_spec_boolean ("always_search", - "Always search", - "Always search", - FALSE, - G_PARAM_READWRITE)); - - gtk_widget_class_install_style_property (widget_class, - g_param_spec_int ("expander_size", - "Expander Size", - "Size of the expander arrow", - 0, - G_MAXINT, - 10, - G_PARAM_READABLE)); + et_signals[CURSOR_CHANGE] = g_signal_new ( + "cursor_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, cursor_change), + NULL, NULL, + e_marshal_NONE__INT_POINTER, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_POINTER); + + et_signals[CURSOR_ACTIVATED] = g_signal_new ( + "cursor_activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, cursor_activated), + NULL, NULL, + e_marshal_NONE__INT_POINTER, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_POINTER); + + et_signals[SELECTION_CHANGE] = g_signal_new ( + "selection_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, selection_change), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + et_signals[DOUBLE_CLICK] = g_signal_new ( + "double_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, double_click), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_BOXED, + G_TYPE_NONE, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + et_signals[RIGHT_CLICK] = g_signal_new ( + "right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, right_click), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_POINTER_INT_BOXED, + G_TYPE_BOOLEAN, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + et_signals[CLICK] = g_signal_new ( + "click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, click), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_POINTER_INT_BOXED, + G_TYPE_BOOLEAN, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + et_signals[KEY_PRESS] = g_signal_new ( + "key_press", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, key_press), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_POINTER_INT_BOXED, + G_TYPE_BOOLEAN, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + et_signals[START_DRAG] = g_signal_new ( + "start_drag", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, start_drag), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_BOXED, + G_TYPE_NONE, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + et_signals[STATE_CHANGE] = g_signal_new ( + "state_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, state_change), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + et_signals[WHITE_SPACE_EVENT] = g_signal_new ( + "white_space_event", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, white_space_event), + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__POINTER, + G_TYPE_BOOLEAN, 1, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + et_signals[TREE_DRAG_BEGIN] = g_signal_new ( + "tree_drag_begin", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_begin), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_BOXED, + G_TYPE_NONE, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT); + + et_signals[TREE_DRAG_END] = g_signal_new ( + "tree_drag_end", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_end), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_BOXED, + G_TYPE_NONE, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT); + + et_signals[TREE_DRAG_DATA_GET] = g_signal_new ( + "tree_drag_data_get", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_data_get), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_OBJECT_BOXED_UINT_UINT, + G_TYPE_NONE, 7, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE, + G_TYPE_UINT, + G_TYPE_UINT); + + et_signals[TREE_DRAG_DATA_DELETE] = g_signal_new ( + "tree_drag_data_delete", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_data_delete), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_OBJECT, + G_TYPE_NONE, 4, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT); + + et_signals[TREE_DRAG_LEAVE] = g_signal_new ( + "tree_drag_leave", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_leave), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_OBJECT_UINT, + G_TYPE_NONE, 5, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + G_TYPE_UINT); + + et_signals[TREE_DRAG_MOTION] = g_signal_new ( + "tree_drag_motion", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_motion), + NULL, NULL, + e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT, + G_TYPE_BOOLEAN, 7, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_UINT); + + et_signals[TREE_DRAG_DROP] = g_signal_new ( + "tree_drag_drop", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_drop), + NULL, NULL, + e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT, + G_TYPE_BOOLEAN, 7, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + G_TYPE_INT, + G_TYPE_INT, + G_TYPE_UINT); + + et_signals[TREE_DRAG_DATA_RECEIVED] = g_signal_new ( + "tree_drag_data_received", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETreeClass, tree_drag_data_received), + NULL, NULL, + e_marshal_NONE__INT_POINTER_INT_OBJECT_INT_INT_BOXED_UINT_UINT, + G_TYPE_NONE, 9, + G_TYPE_INT, + G_TYPE_POINTER, + G_TYPE_INT, + GDK_TYPE_DRAG_CONTEXT, + G_TYPE_INT, + G_TYPE_INT, + GTK_TYPE_SELECTION_DATA, + G_TYPE_UINT, + G_TYPE_UINT); + + g_object_class_install_property ( + object_class, + PROP_LENGTH_THRESHOLD, + g_param_spec_int ( + "length_threshold", + "Length Threshold", + "Length Threshold", + 0, G_MAXINT, 0, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_HORIZONTAL_DRAW_GRID, + g_param_spec_boolean ( + "horizontal_draw_grid", + "Horizontal Draw Grid", + "Horizontal Draw Grid", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_VERTICAL_DRAW_GRID, + g_param_spec_boolean ( + "vertical_draw_grid", + "Vertical Draw Grid", + "Vertical Draw Grid", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_DRAW_FOCUS, + g_param_spec_boolean ( + "drawfocus", + "Draw focus", + "Draw focus", + FALSE, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_ETTA, + g_param_spec_object ( + "ETreeTableAdapter", + "ETree table adapter", + "ETree table adapter", + E_TYPE_TREE_TABLE_ADAPTER, + G_PARAM_READABLE)); + + g_object_class_install_property ( + object_class, + PROP_UNIFORM_ROW_HEIGHT, + g_param_spec_boolean ( + "uniform_row_height", + "Uniform row height", + "Uniform row height", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_ALWAYS_SEARCH, + g_param_spec_boolean ( + "always_search", + "Always search", + "Always search", + FALSE, + G_PARAM_READWRITE)); + + gtk_widget_class_install_style_property ( + widget_class, + g_param_spec_int ( + "expander_size", + "Expander Size", + "Size of the expander arrow", + 0, G_MAXINT, 10, + G_PARAM_READABLE)); gtk_widget_class_install_style_property ( widget_class, diff --git a/widgets/table/gal-a11y-e-cell-popup.c b/widgets/table/gal-a11y-e-cell-popup.c index b1232a6b84..1c97ee3198 100644 --- a/widgets/table/gal-a11y-e-cell-popup.c +++ b/widgets/table/gal-a11y-e-cell-popup.c @@ -100,31 +100,34 @@ gal_a11y_e_cell_popup_new (ETableItem *item, child_view = popupcell->popup_cell_view->child_view; if (child_view && child_view->ecell) { - a11y = gal_a11y_e_cell_registry_get_object (NULL, - item, - child_view, - parent, - model_col, - view_col, - row); + a11y = gal_a11y_e_cell_registry_get_object ( + NULL, + item, + child_view, + parent, + model_col, + view_col, + row); } else { a11y = g_object_new (GAL_A11Y_TYPE_E_CELL_POPUP, NULL); - gal_a11y_e_cell_construct (a11y, - item, - cell_view, - parent, - model_col, - view_col, - row); + gal_a11y_e_cell_construct ( + a11y, + item, + cell_view, + parent, + model_col, + view_col, + row); } g_return_val_if_fail (a11y != NULL, NULL); cell = GAL_A11Y_E_CELL (a11y); - gal_a11y_e_cell_add_action (cell, - "popup", - /* Translators: description of a "popup" action */ - _("popup a child"), - "<Alt>Down", /* action keybinding */ - popup_cell_action); + gal_a11y_e_cell_add_action ( + cell, + "popup", + /* Translators: description of a "popup" action */ + _("popup a child"), + "<Alt>Down", /* action keybinding */ + popup_cell_action); a11y->role = ATK_ROLE_TABLE_CELL; return a11y; diff --git a/widgets/table/gal-a11y-e-cell-toggle.c b/widgets/table/gal-a11y-e-cell-toggle.c index 046f3f52d1..33d9e4fd32 100644 --- a/widgets/table/gal-a11y-e-cell-toggle.c +++ b/widgets/table/gal-a11y-e-cell-toggle.c @@ -164,28 +164,31 @@ gal_a11y_e_cell_toggle_new (ETableItem *item, toggle_cell = GAL_A11Y_E_CELL_TOGGLE (a11y); a11y->role = ATK_ROLE_TABLE_CELL; - gal_a11y_e_cell_construct (a11y, - item, - cell_view, - parent, - model_col, - view_col, - row); - - gal_a11y_e_cell_add_action (cell, - "toggle", - /* Translators: description of a "toggle" action */ - _("toggle the cell"), - NULL, /* action keybinding */ - toggle_cell_action); + gal_a11y_e_cell_construct ( + a11y, + item, + cell_view, + parent, + model_col, + view_col, + row); + + gal_a11y_e_cell_add_action ( + cell, + "toggle", + /* Translators: description of a "toggle" action */ + _("toggle the cell"), + NULL, /* action keybinding */ + toggle_cell_action); toggle_cell->model_id = g_signal_connect ( item->table_model, "model_cell_changed", (GCallback) model_change_cb, a11y); value = GPOINTER_TO_INT ( - e_table_model_value_at (cell->cell_view->e_table_model, - cell->model_col, cell->row)); + e_table_model_value_at ( + cell->cell_view->e_table_model, + cell->model_col, cell->row)); if (value) gal_a11y_e_cell_add_state (cell, ATK_STATE_CHECKED, FALSE); else diff --git a/widgets/table/gal-a11y-e-cell-tree.c b/widgets/table/gal-a11y-e-cell-tree.c index 32085fbfba..599b660ca5 100644 --- a/widgets/table/gal-a11y-e-cell-tree.c +++ b/widgets/table/gal-a11y-e-cell-tree.c @@ -94,8 +94,9 @@ ectr_subcell_weak_ref (GalA11yECellTree *a11y, if (subcell_a11y && subcell_view && subcell_view->kill_view_cb_data) subcell_view->kill_view_cb_data = g_list_remove (subcell_view->kill_view_cb_data, subcell_a11y); - g_signal_handler_disconnect (GAL_A11Y_E_CELL (a11y)->item->table_model, - a11y->model_row_changed_id); + g_signal_handler_disconnect ( + GAL_A11Y_E_CELL (a11y)->item->table_model, + a11y->model_row_changed_id); g_object_unref (a11y); } @@ -115,9 +116,8 @@ ectr_do_action_expand (AtkAction *action) tree_table_adapter = e_table_model_value_at (table_model, -3, a11y->row); if (e_tree_model_node_is_expandable (tree_model, node)) { - e_tree_table_adapter_node_set_expanded (tree_table_adapter, - node, - TRUE); + e_tree_table_adapter_node_set_expanded ( + tree_table_adapter, node, TRUE); gal_a11y_e_cell_add_state (a11y, ATK_STATE_EXPANDED, TRUE); } } @@ -138,9 +138,8 @@ ectr_do_action_collapse (AtkAction *action) tree_table_adapter = e_table_model_value_at (table_model, -3, a11y->row); if (e_tree_model_node_is_expandable (tree_model, node)) { - e_tree_table_adapter_node_set_expanded (tree_table_adapter, - node, - FALSE); + e_tree_table_adapter_node_set_expanded ( + tree_table_adapter, node, FALSE); gal_a11y_e_cell_remove_state (a11y, ATK_STATE_EXPANDED, TRUE); } } @@ -201,26 +200,29 @@ gal_a11y_e_cell_tree_new (ETableItem *item, subcell_view = e_cell_tree_view_get_subcell_view (cell_view); if (subcell_view->ecell) { - subcell_a11y = gal_a11y_e_cell_registry_get_object (NULL, - item, - subcell_view, - parent, - model_col, - view_col, - row); - gal_a11y_e_cell_add_action (GAL_A11Y_E_CELL (subcell_a11y), - "expand", - /* Translators: description of an "expand" action */ - _("expands the row in the ETree containing this cell"), - NULL, - (ACTION_FUNC) ectr_do_action_expand); - - gal_a11y_e_cell_add_action (GAL_A11Y_E_CELL (subcell_a11y), - "collapse", - /* Translators: description of a "collapse" action */ - _("collapses the row in the ETree containing this cell"), - NULL, - (ACTION_FUNC) ectr_do_action_collapse); + subcell_a11y = gal_a11y_e_cell_registry_get_object ( + NULL, + item, + subcell_view, + parent, + model_col, + view_col, + row); + gal_a11y_e_cell_add_action ( + GAL_A11Y_E_CELL (subcell_a11y), + "expand", + /* Translators: description of an "expand" action */ + _("expands the row in the ETree containing this cell"), + NULL, + (ACTION_FUNC) ectr_do_action_expand); + + gal_a11y_e_cell_add_action ( + GAL_A11Y_E_CELL (subcell_a11y), + "collapse", + /* Translators: description of a "collapse" action */ + _("collapses the row in the ETree containing this cell"), + NULL, + (ACTION_FUNC) ectr_do_action_collapse); /* init AtkStates for the cell's a11y object */ node = e_table_model_value_at (item->table_model, -1, row); @@ -239,13 +241,14 @@ gal_a11y_e_cell_tree_new (ETableItem *item, * 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, - cell_view, - parent, - model_col, - view_col, - row); + gal_a11y_e_cell_construct ( + ATK_OBJECT (a11y), + item, + cell_view, + parent, + model_col, + view_col, + row); a11y->model_row_changed_id = g_signal_connect ( item->table_model, "model_row_changed", G_CALLBACK (ectr_model_row_changed_cb), subcell_a11y); diff --git a/widgets/table/gal-a11y-e-cell-vbox.c b/widgets/table/gal-a11y-e-cell-vbox.c index d0b9d26036..d00547c877 100644 --- a/widgets/table/gal-a11y-e-cell-vbox.c +++ b/widgets/table/gal-a11y-e-cell-vbox.c @@ -80,7 +80,8 @@ ecv_ref_child (AtkObject *a11y, subcell_view = ecvv->subcell_views[i]; /* FIXME Should the view column use a fake * one or the same as its parent? */ - ret = gal_a11y_e_cell_registry_get_object (NULL, + ret = gal_a11y_e_cell_registry_get_object ( + NULL, gaec->item, subcell_view, a11y, @@ -89,9 +90,10 @@ ecv_ref_child (AtkObject *a11y, row); gaev->a11y_subcells[i] = ret; g_object_ref (ret); - g_object_weak_ref (G_OBJECT (ret), - (GWeakNotify) subcell_destroyed, - ret); + g_object_weak_ref ( + G_OBJECT (ret), + (GWeakNotify) subcell_destroyed, + ret); } else { ret = (AtkObject *) gaev->a11y_subcells[i]; if (ATK_IS_OBJECT (ret)) @@ -140,7 +142,7 @@ ecv_ref_accessible_at_point (AtkComponent *component, subcell_height = e_cell_height ( ecvv->subcell_views[i], ecvv->model_cols[i], gaec->view_col, gaec->row); - if ( 0 <= y && y <= subcell_height) { + if (0 <= y && y <= subcell_height) { return ecv_ref_child ((AtkObject *) component, i); } else y -= subcell_height; diff --git a/widgets/table/gal-a11y-e-cell.c b/widgets/table/gal-a11y-e-cell.c index 4a75c97ce4..d42aa6425f 100644 --- a/widgets/table/gal-a11y-e-cell.c +++ b/widgets/table/gal-a11y-e-cell.c @@ -87,9 +87,9 @@ gal_a11y_e_cell_dispose (GObject *object) #if 0 if (a11y->item) - g_object_unref (G_OBJECT (a11y->item)); /*, unref_item, a11y); */ + g_object_unref (a11y->item); /*, unref_item, a11y); */ if (a11y->cell_view) - g_object_unref (G_OBJECT (a11y->cell_view)); /*, unref_cell, a11y); */ + g_object_unref (a11y->cell_view); /*, unref_cell, a11y); */ if (a11y->parent) g_object_unref (a11y->parent); #endif @@ -174,17 +174,20 @@ gal_a11y_e_cell_get_extents (AtkComponent *component, tableOrTree = gtk_widget_get_parent (GTK_WIDGET (a11y->item->parent.canvas)); if (E_IS_TREE (tableOrTree)) { - e_tree_get_cell_geometry (E_TREE (tableOrTree), - row, col, &xval, &yval, - width, height); + e_tree_get_cell_geometry ( + E_TREE (tableOrTree), + row, col, &xval, &yval, + width, height); } else { - e_table_get_cell_geometry (E_TABLE (tableOrTree), - row, col, &xval, &yval, - width, height); + e_table_get_cell_geometry ( + E_TABLE (tableOrTree), + row, col, &xval, &yval, + width, height); } - atk_component_get_position (ATK_COMPONENT (a11y->parent), - x, y, coord_type); + atk_component_get_position ( + ATK_COMPONENT (a11y->parent), + x, y, coord_type); if (x && *x != G_MININT) *x += xval; if (y && *y != G_MININT) @@ -490,8 +493,9 @@ gal_a11y_e_cell_type_add_action_interface (GType type) NULL }; - g_type_add_interface_static (type, ATK_TYPE_ACTION, - &atk_action_info); + g_type_add_interface_static ( + type, ATK_TYPE_ACTION, + &atk_action_info); } gboolean @@ -604,13 +608,14 @@ gal_a11y_e_cell_new (ETableItem *item, a11y = g_object_new (gal_a11y_e_cell_get_type (), NULL); - gal_a11y_e_cell_construct (a11y, - item, - cell_view, - parent, - model_col, - view_col, - row); + gal_a11y_e_cell_construct ( + a11y, + item, + cell_view, + parent, + model_col, + view_col, + row); return a11y; } @@ -633,14 +638,14 @@ gal_a11y_e_cell_construct (AtkObject *object, ATK_OBJECT (a11y) ->role = ATK_ROLE_TABLE_CELL; if (item) - g_object_ref (G_OBJECT (item)); + g_object_ref (item); #if 0 if (parent) g_object_ref (parent); if (cell_view) - g_object_ref (G_OBJECT (cell_view)); + g_object_ref (cell_view); #endif } 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 1f116ee6b3..52466cd7cb 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add.c +++ b/widgets/table/gal-a11y-e-table-click-to-add.c @@ -82,7 +82,7 @@ idle_do_action (gpointer data) ETableClickToAdd * etcta; gint finished; - g_return_val_if_fail ( data!= NULL, FALSE); + g_return_val_if_fail (data!= NULL, FALSE); etcta = E_TABLE_CLICK_TO_ADD ( atk_gobject_accessible_get_object ( @@ -242,9 +242,9 @@ gal_a11y_e_table_click_to_add_get_type (void) GNOME_TYPE_CANVAS_ITEM); parent_type = atk_object_factory_get_accessible_type (factory); - type = gal_a11y_type_register_static_with_private (PARENT_TYPE, - "GalA11yETableClickToAdd", &info, 0, - sizeof (GalA11yETableClickToAddPrivate), &priv_offset); + type = gal_a11y_type_register_static_with_private ( + PARENT_TYPE, "GalA11yETableClickToAdd", &info, 0, + sizeof (GalA11yETableClickToAddPrivate), &priv_offset); g_type_add_interface_static (type, ATK_TYPE_ACTION, &atk_action_info); diff --git a/widgets/table/gal-a11y-e-table-item.c b/widgets/table/gal-a11y-e-table-item.c index 1806011875..d5a0edefdc 100644 --- a/widgets/table/gal-a11y-e-table-item.c +++ b/widgets/table/gal-a11y-e-table-item.c @@ -304,9 +304,11 @@ eti_get_extents (AtkComponent *component, parent = ATK_OBJECT (component)->accessible_parent; if (parent && ATK_IS_COMPONENT (parent)) - atk_component_get_extents (ATK_COMPONENT (parent), x, y, - width, height, - coord_type); + atk_component_get_extents ( + ATK_COMPONENT (parent), + x, y, + width, height, + coord_type); if (parent && GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD (parent)) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD ( @@ -335,10 +337,11 @@ eti_ref_accessible_at_point (AtkComponent *component, if (!item) return NULL; - atk_component_get_position (component, - &x_origin, - &y_origin, - coord_type); + atk_component_get_position ( + component, + &x_origin, + &y_origin, + coord_type); x -= x_origin; y -= y_origin; @@ -397,17 +400,19 @@ eti_ref_at (AtkTable *table, item->cell_views_realized) { ECellView *cell_view = item->cell_views[column]; ETableCol *ecol = e_table_header_get_column (item->header, column); - ret = gal_a11y_e_cell_registry_get_object (NULL, - item, - cell_view, - ATK_OBJECT (table), - ecol->col_idx, - column, - row); + ret = gal_a11y_e_cell_registry_get_object ( + NULL, + item, + cell_view, + ATK_OBJECT (table), + ecol->col_idx, + column, + row); if (ATK_IS_OBJECT (ret)) { - g_object_weak_ref (G_OBJECT (ret), - (GWeakNotify) cell_destroyed, - ret); + g_object_weak_ref ( + G_OBJECT (ret), + (GWeakNotify) cell_destroyed, + ret); /* if current cell is focused, add FOCUSED state */ if (e_selection_model_cursor_row (item->selection) == GAL_A11Y_E_CELL (ret)->row && @@ -501,13 +506,14 @@ eti_get_column_extent_at (AtkTable *table, if (!item) return -1; - e_table_item_get_cell_geometry (item, - &row, - &column, - NULL, - NULL, - &width, - NULL); + e_table_item_get_cell_geometry ( + item, + &row, + &column, + NULL, + NULL, + &width, + NULL); return width; } @@ -524,13 +530,14 @@ eti_get_row_extent_at (AtkTable *table, if (!item) return -1; - e_table_item_get_cell_geometry (item, - &row, - &column, - NULL, - NULL, - NULL, - &height); + e_table_item_get_cell_geometry ( + item, + &row, + &column, + NULL, + NULL, + NULL, + &height); return height; } @@ -672,8 +679,9 @@ table_add_row_selection (AtkTable *table, if (table_is_row_selected (table, row)) return TRUE; - e_selection_model_toggle_single_row (item->selection, - view_to_model_row (item, row)); + e_selection_model_toggle_single_row ( + item->selection, + view_to_model_row (item, row)); return TRUE; } @@ -758,14 +766,16 @@ eti_rows_inserted (ETableModel *model, GET_PRIVATE (table_item)->rows = n_rows; - g_signal_emit_by_name (table_item, "row-inserted", row, - count, NULL); + g_signal_emit_by_name ( + table_item, "row-inserted", row, + count, NULL); for (i = row; i < (row + count); i++) { for (j = 0; j < n_cols; j++) { - g_signal_emit_by_name (table_item, - "children_changed::add", - ( ((i + 1) * n_cols) + j), NULL, NULL); + g_signal_emit_by_name ( + table_item, + "children_changed::add", + (((i + 1) * n_cols) + j), NULL, NULL); } } @@ -788,18 +798,20 @@ eti_rows_deleted (ETableModel *model, 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; - g_signal_emit_by_name (table_item, "row-deleted", row, - count, NULL); + g_signal_emit_by_name ( + table_item, "row-deleted", row, + count, NULL); for (i = row; i < (row + count); i++) { for (j = 0; j < n_cols; j++) { - g_signal_emit_by_name (table_item, - "children_changed::remove", - ( ((i + 1) * n_cols) + j), NULL, NULL); + g_signal_emit_by_name ( + table_item, + "children_changed::remove", + (((i + 1) * n_cols) + j), NULL, NULL); } } g_signal_emit_by_name (table_item, "visible-data-changed"); @@ -909,17 +921,16 @@ eti_header_structure_changed (ETableHeader *eth, /* Emit signals */ if (reorder_found) - g_signal_emit_by_name (G_OBJECT (a11y_item), "column_reordered"); + g_signal_emit_by_name (a11y_item, "column_reordered"); if (removed_found) { - for (i = 0; i < prev_n_cols; i ++ ) { + for (i = 0; i < prev_n_cols; i++) { if (prev_state[i] == ETI_HEADER_REMOVED) { g_signal_emit_by_name ( - G_OBJECT (a11y_item), - "column-deleted", i, 1); + a11y_item, "column-deleted", i, 1); for (j = 0; j < n_rows; j++) g_signal_emit_by_name ( - G_OBJECT (a11y_item), + a11y_item, "children_changed::remove", ((j + 1) * prev_n_cols + i), NULL, NULL); @@ -931,11 +942,10 @@ eti_header_structure_changed (ETableHeader *eth, for (i = 0; i < n_cols; i++) { if (state[i] == ETI_HEADER_NEW_ADDED) { g_signal_emit_by_name ( - G_OBJECT (a11y_item), - "column-inserted", i, 1); + a11y_item, "column-inserted", i, 1); for (j = 0; j < n_rows; j++) g_signal_emit_by_name ( - G_OBJECT (a11y_item), + a11y_item, "children_changed::add", ((j + 1) * n_cols + i), NULL, NULL); @@ -1127,7 +1137,7 @@ gal_a11y_e_table_item_new (ETableItem *item) GET_PRIVATE (a11y)->rows = item->rows; GET_PRIVATE (a11y)->columns = e_table_header_get_columns (item->header); - if ( GET_PRIVATE (a11y)->columns == NULL) + if (GET_PRIVATE (a11y)->columns == NULL) return NULL; if (item) { @@ -1138,8 +1148,9 @@ gal_a11y_e_table_item_new (ETableItem *item) 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); + gal_a11y_e_table_item_ref_selection ( + a11y, + item->selection); /* find the TableItem's parent: table or tree */ GET_PRIVATE (a11y)->widget = gtk_widget_get_parent ( @@ -1184,11 +1195,11 @@ gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y, priv = GET_PRIVATE (a11y); priv->selection_change_id = g_signal_connect ( - G_OBJECT (selection), "selection_changed", - G_CALLBACK (eti_a11y_selection_changed_cb), a11y); + selection, "selection_changed", + G_CALLBACK (eti_a11y_selection_changed_cb), a11y); priv->cursor_change_id = g_signal_connect ( - G_OBJECT (selection), "cursor_changed", - G_CALLBACK (eti_a11y_cursor_changed_cb), a11y); + selection, "cursor_changed", + G_CALLBACK (eti_a11y_cursor_changed_cb), a11y); priv->selection = selection; g_object_ref (selection); @@ -1208,10 +1219,12 @@ gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y) g_return_val_if_fail (priv->selection_change_id != 0, FALSE); g_return_val_if_fail (priv->cursor_change_id != 0, FALSE); - g_signal_handler_disconnect (priv->selection, - priv->selection_change_id); - g_signal_handler_disconnect (priv->selection, - priv->cursor_change_id); + g_signal_handler_disconnect ( + priv->selection, + priv->selection_change_id); + g_signal_handler_disconnect ( + priv->selection, + priv->cursor_change_id); priv->cursor_change_id = 0; priv->selection_change_id = 0; @@ -1345,15 +1358,18 @@ selection_add_selection (AtkSelection *selection, atk_table_add_row_selection (table, row); } - e_selection_model_change_cursor (item->selection, - model_row, - model_col); - e_selection_model_cursor_changed (item->selection, - model_row, - model_col); - e_selection_model_cursor_activated (item->selection, - model_row, - model_col); + e_selection_model_change_cursor ( + item->selection, + model_row, + model_col); + e_selection_model_cursor_changed ( + item->selection, + model_row, + model_col); + e_selection_model_cursor_activated ( + item->selection, + model_row, + model_col); return TRUE; } @@ -1413,8 +1429,9 @@ void gal_a11y_e_table_item_init (void) { if (atk_get_root ()) - atk_registry_set_factory_type (atk_get_default_registry (), - E_TYPE_TABLE_ITEM, - gal_a11y_e_table_item_factory_get_type ()); + atk_registry_set_factory_type ( + atk_get_default_registry (), + E_TYPE_TABLE_ITEM, + gal_a11y_e_table_item_factory_get_type ()); } diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c index 6ba51303ed..ec0025c6b8 100644 --- a/widgets/table/gal-a11y-e-table.c +++ b/widgets/table/gal-a11y-e-table.c @@ -268,8 +268,9 @@ gal_a11y_e_table_get_type (void) factory = atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET); parent_type = atk_object_factory_get_accessible_type (factory); - type = gal_a11y_type_register_static_with_private (PARENT_TYPE, "GalA11yETable", &info, 0, - sizeof (GalA11yETablePrivate), &priv_offset); + type = gal_a11y_type_register_static_with_private ( + PARENT_TYPE, "GalA11yETable", &info, 0, + sizeof (GalA11yETablePrivate), &priv_offset); g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info); } @@ -305,7 +306,8 @@ void gal_a11y_e_table_init (void) { if (atk_get_root ()) - atk_registry_set_factory_type (atk_get_default_registry (), + atk_registry_set_factory_type ( + atk_get_default_registry (), E_TYPE_TABLE, gal_a11y_e_table_factory_get_type ()); diff --git a/widgets/table/gal-a11y-e-tree.c b/widgets/table/gal-a11y-e-tree.c index 12697f4535..26d2f24e7b 100644 --- a/widgets/table/gal-a11y-e-tree.c +++ b/widgets/table/gal-a11y-e-tree.c @@ -163,8 +163,9 @@ gal_a11y_e_tree_get_type (void) factory = atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET); parent_type = atk_object_factory_get_accessible_type (factory); - type = gal_a11y_type_register_static_with_private (PARENT_TYPE, "GalA11yETree", &info, 0, - sizeof (GalA11yETreePrivate), &priv_offset); + type = gal_a11y_type_register_static_with_private ( + PARENT_TYPE, "GalA11yETree", &info, 0, + sizeof (GalA11yETreePrivate), &priv_offset); g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info); } @@ -187,9 +188,9 @@ void gal_a11y_e_tree_init (void) { if (atk_get_root ()) - atk_registry_set_factory_type (atk_get_default_registry (), - E_TYPE_TREE, - gal_a11y_e_tree_factory_get_type ()); - + atk_registry_set_factory_type ( + atk_get_default_registry (), + E_TYPE_TREE, + gal_a11y_e_tree_factory_get_type ()); } diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index edfaadc157..1c3b0da4fe 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -126,9 +126,10 @@ e_reflow_resize_children (GnomeCanvasItem *item) count = reflow->count; for (i = 0; i < count; i++) { if (reflow->items[i]) - gnome_canvas_item_set (reflow->items[i], - "width", (gdouble) reflow->column_width, - NULL); + gnome_canvas_item_set ( + reflow->items[i], + "width", (gdouble) reflow->column_width, + NULL); } } @@ -137,15 +138,17 @@ e_reflow_update_selection_row (EReflow *reflow, gint row) { if (reflow->items[row]) { - g_object_set (reflow->items[row], - "selected", e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), row), - NULL); + g_object_set ( + reflow->items[row], + "selected", e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), row), + NULL); } else if (e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), row)) { reflow->items[row] = e_reflow_model_incarnate (reflow->model, row, GNOME_CANVAS_GROUP (reflow)); - g_object_set (reflow->items[row], - "selected", e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), row), - "width", (gdouble) reflow->column_width, - NULL); + g_object_set ( + reflow->items[row], + "selected", e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), row), + "width", (gdouble) reflow->column_width, + NULL); } } @@ -226,9 +229,10 @@ cursor_changed (ESelectionModel *selection, if (old_cursor < count && old_cursor >= 0) { if (reflow->items[old_cursor]) { - g_object_set (reflow->items[old_cursor], - "has_cursor", FALSE, - NULL); + g_object_set ( + reflow->items[old_cursor], + "has_cursor", FALSE, + NULL); } } @@ -236,15 +240,17 @@ cursor_changed (ESelectionModel *selection, if (row < count && row >= 0) { if (reflow->items[row]) { - g_object_set (reflow->items[row], - "has_cursor", TRUE, - NULL); + g_object_set ( + reflow->items[row], + "has_cursor", TRUE, + NULL); } else { reflow->items[row] = e_reflow_model_incarnate (reflow->model, row, GNOME_CANVAS_GROUP (reflow)); - g_object_set (reflow->items[row], - "has_cursor", TRUE, - "width", (gdouble) reflow->column_width, - NULL); + g_object_set ( + reflow->items[row], + "has_cursor", TRUE, + "width", (gdouble) reflow->column_width, + NULL); } } @@ -297,10 +303,11 @@ incarnate (EReflow *reflow) if (reflow->items[unsorted] == NULL) { if (reflow->model) { reflow->items[unsorted] = e_reflow_model_incarnate (reflow->model, unsorted, GNOME_CANVAS_GROUP (reflow)); - g_object_set (reflow->items[unsorted], - "selected", e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), unsorted), - "width", (gdouble) reflow->column_width, - NULL); + g_object_set ( + reflow->items[unsorted], + "selected", e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), unsorted), + "width", (gdouble) reflow->column_width, + NULL); } } } @@ -552,31 +559,34 @@ set_empty (EReflow *reflow) if (reflow->count == 0) { if (reflow->empty_text) { if (reflow->empty_message) { - gnome_canvas_item_set (reflow->empty_text, - "width", reflow->minimum_width, - "text", reflow->empty_message, - NULL); - e_canvas_item_move_absolute (reflow->empty_text, - reflow->minimum_width / 2, - 0); + gnome_canvas_item_set ( + reflow->empty_text, + "width", reflow->minimum_width, + "text", reflow->empty_message, + NULL); + e_canvas_item_move_absolute ( + reflow->empty_text, + reflow->minimum_width / 2, + 0); } else { g_object_run_dispose (G_OBJECT (reflow->empty_text)); reflow->empty_text = NULL; } } else { if (reflow->empty_message) { - reflow->empty_text = - gnome_canvas_item_new (GNOME_CANVAS_GROUP (reflow), - e_text_get_type (), - "width", reflow->minimum_width, - "clip", TRUE, - "use_ellipsis", TRUE, - "justification", GTK_JUSTIFY_CENTER, - "text", reflow->empty_message, - NULL); - e_canvas_item_move_absolute (reflow->empty_text, - reflow->minimum_width / 2, - 0); + reflow->empty_text = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (reflow), + e_text_get_type (), + "width", reflow->minimum_width, + "clip", TRUE, + "use_ellipsis", TRUE, + "justification", GTK_JUSTIFY_CENTER, + "text", reflow->empty_message, + NULL); + e_canvas_item_move_absolute ( + reflow->empty_text, + reflow->minimum_width / 2, + 0); } } } else { @@ -593,16 +603,21 @@ disconnect_model (EReflow *reflow) if (reflow->model == NULL) return; - g_signal_handler_disconnect (reflow->model, - reflow->model_changed_id); - g_signal_handler_disconnect (reflow->model, - reflow->comparison_changed_id); - g_signal_handler_disconnect (reflow->model, - reflow->model_items_inserted_id); - g_signal_handler_disconnect (reflow->model, - reflow->model_item_removed_id); - g_signal_handler_disconnect (reflow->model, - reflow->model_item_changed_id); + g_signal_handler_disconnect ( + reflow->model, + reflow->model_changed_id); + g_signal_handler_disconnect ( + reflow->model, + reflow->comparison_changed_id); + g_signal_handler_disconnect ( + reflow->model, + reflow->model_items_inserted_id); + g_signal_handler_disconnect ( + reflow->model, + reflow->model_item_removed_id); + g_signal_handler_disconnect ( + reflow->model, + reflow->model_item_changed_id); g_object_unref (reflow->model); reflow->model_changed_id = 0; @@ -619,12 +634,15 @@ disconnect_selection (EReflow *reflow) if (reflow->selection == NULL) return; - g_signal_handler_disconnect (reflow->selection, - reflow->selection_changed_id); - g_signal_handler_disconnect (reflow->selection, - reflow->selection_row_changed_id); - g_signal_handler_disconnect (reflow->selection, - reflow->cursor_changed_id); + g_signal_handler_disconnect ( + reflow->selection, + reflow->selection_changed_id); + g_signal_handler_disconnect ( + reflow->selection, + reflow->selection_row_changed_id); + g_signal_handler_disconnect ( + reflow->selection, + reflow->cursor_changed_id); g_object_unref (reflow->selection); reflow->selection_changed_id = 0; @@ -681,10 +699,12 @@ disconnect_adjustment (EReflow *reflow) if (reflow->adjustment == NULL) return; - g_signal_handler_disconnect (reflow->adjustment, - reflow->adjustment_changed_id); - g_signal_handler_disconnect (reflow->adjustment, - reflow->adjustment_value_changed_id); + g_signal_handler_disconnect ( + reflow->adjustment, + reflow->adjustment_changed_id); + g_signal_handler_disconnect ( + reflow->adjustment, + reflow->adjustment_value_changed_id); g_object_unref (reflow->adjustment); @@ -737,8 +757,9 @@ static void disconnect_set_adjustment (EReflow *reflow) { if (reflow->set_scroll_adjustments_id != 0) { - g_signal_handler_disconnect (GNOME_CANVAS_ITEM (reflow)->canvas, - reflow->set_scroll_adjustments_id); + g_signal_handler_disconnect ( + GNOME_CANVAS_ITEM (reflow)->canvas, + reflow->set_scroll_adjustments_id); reflow->set_scroll_adjustments_id = 0; } } @@ -909,9 +930,10 @@ e_reflow_realize (GnomeCanvasItem *item) count = reflow->count; for (i = 0; i < count; i++) { if (reflow->items[i]) - gnome_canvas_item_set (reflow->items[i], - "width", reflow->column_width, - NULL); + gnome_canvas_item_set ( + reflow->items[i], + "width", reflow->column_width, + NULL); } set_empty (reflow); @@ -981,9 +1003,10 @@ e_reflow_event (GnomeCanvasItem *item, GnomeCanvasItem *item = reflow->items[unsorted]; EFocus has_focus; if (item) { - g_object_get (item, - "has_focus", &has_focus, - NULL); + g_object_get ( + item, + "has_focus", &has_focus, + NULL); if (has_focus) { if (event->key.state & GDK_SHIFT_MASK) { if (i == 0) @@ -1001,9 +1024,10 @@ e_reflow_event (GnomeCanvasItem *item, } item = reflow->items[unsorted]; - gnome_canvas_item_set (item, - "has_focus", (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START, - NULL); + gnome_canvas_item_set ( + item, + "has_focus", (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START, + NULL); return TRUE; } } @@ -1030,10 +1054,11 @@ e_reflow_event (GnomeCanvasItem *item, reflow->temp_column_width = reflow->column_width; reflow->column_drag = TRUE; - gnome_canvas_item_grab (item, - GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, - reflow->arrow_cursor, - button->time); + gnome_canvas_item_grab ( + item, + GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, + reflow->arrow_cursor, + button->time); reflow->previous_temp_column_width = -1; reflow->need_column_resize = TRUE; @@ -1193,7 +1218,7 @@ e_reflow_event (GnomeCanvasItem *item, window = gtk_widget_get_window (GTK_WIDGET (item->canvas)); - if (!( crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER )) { + if (!(crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER)) { if (!reflow->default_cursor_shown) { gdk_window_set_cursor (window, reflow->default_cursor); reflow->default_cursor_shown = TRUE; @@ -1206,8 +1231,8 @@ e_reflow_event (GnomeCanvasItem *item, } if (return_val) return return_val; - else if (GNOME_CANVAS_ITEM_CLASS ( e_reflow_parent_class )->event) - return (* GNOME_CANVAS_ITEM_CLASS ( e_reflow_parent_class )->event) (item, event); + else if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->event) + return (* GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->event) (item, event); else return FALSE; } @@ -1246,16 +1271,17 @@ e_reflow_draw (GnomeCanvasItem *item, if (running_width > x + width) break; x_rect = running_width; - gtk_paint_flat_box (style, - cr, - GTK_STATE_ACTIVE, - GTK_SHADOW_NONE, - GTK_WIDGET (item->canvas), - "reflow", - x_rect - x, - y_rect - y, - width_rect, - height_rect); + gtk_paint_flat_box ( + style, + cr, + GTK_STATE_ACTIVE, + GTK_SHADOW_NONE, + GTK_WIDGET (item->canvas), + "reflow", + x_rect - x, + y_rect - y, + width_rect, + height_rect); running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } if (reflow->column_drag) { @@ -1290,11 +1316,12 @@ e_reflow_draw (GnomeCanvasItem *item, if (running_width > x + width) break; x_rect = running_width; - cairo_rectangle (cr, - x_rect - x, - y_rect - y, - width_rect - 1, - height_rect - 1); + cairo_rectangle ( + cr, + x_rect - x, + y_rect - y, + width_rect - 1, + height_rect - 1); cairo_fill (cr); running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } @@ -1366,7 +1393,7 @@ e_reflow_update (GnomeCanvasItem *item, width_rect = E_REFLOW_DIVIDER_WIDTH; height_rect = reflow->height - (E_REFLOW_BORDER_WIDTH * 2); - for ( i = 0; i < reflow->column_count; i++) { + for (i = 0; i < reflow->column_count; i++) { x_rect = running_width; gnome_canvas_request_redraw (item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; @@ -1382,7 +1409,7 @@ e_reflow_update (GnomeCanvasItem *item, width_rect = E_REFLOW_DIVIDER_WIDTH; height_rect = reflow->height - (E_REFLOW_BORDER_WIDTH * 2); - for ( i = 0; i < reflow->column_count; i++) { + for (i = 0; i < reflow->column_count; i++) { x_rect = running_width; gnome_canvas_request_redraw (item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; @@ -1456,9 +1483,10 @@ e_reflow_reflow (GnomeCanvasItem *item, } if (unsorted >= 0 && reflow->items[unsorted]) { - e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (reflow->items[unsorted]), - (gdouble) running_width, - (gdouble) running_height); + e_canvas_item_move_absolute ( + GNOME_CANVAS_ITEM (reflow->items[unsorted]), + (gdouble) running_width, + (gdouble) running_height); running_height += reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH; } } @@ -1545,67 +1573,86 @@ e_reflow_class_init (EReflowClass *class) class->selection_event = e_reflow_selection_event_real; class->column_width_changed = NULL; - g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH, - g_param_spec_double ("minimum_width", - "Minimum width", - "Minimum Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - "Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READABLE)); - - g_object_class_install_property (object_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - "Height", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_EMPTY_MESSAGE, - g_param_spec_string ("empty_message", - "Empty message", - "Empty message", - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_MODEL, - g_param_spec_object ("model", - "Reflow model", - "Reflow model", - E_TYPE_REFLOW_MODEL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_COLUMN_WIDTH, - g_param_spec_double ("column_width", - "Column width", - "Column width", - 0.0, G_MAXDOUBLE, 150.0, - G_PARAM_READWRITE)); - - signals[SELECTION_EVENT] = - g_signal_new ("selection_event", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EReflowClass, selection_event), - NULL, NULL, - e_marshal_INT__OBJECT_BOXED, - G_TYPE_INT, 2, - G_TYPE_OBJECT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - - signals[COLUMN_WIDTH_CHANGED] = - g_signal_new ("column_width_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EReflowClass, column_width_changed), - NULL, NULL, - g_cclosure_marshal_VOID__DOUBLE, - G_TYPE_NONE, 1, G_TYPE_DOUBLE); + g_object_class_install_property ( + object_class, + PROP_MINIMUM_WIDTH, + g_param_spec_double ( + "minimum_width", + "Minimum width", + "Minimum Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + "Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE)); + + g_object_class_install_property ( + object_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + "Height", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_EMPTY_MESSAGE, + g_param_spec_string ( + "empty_message", + "Empty message", + "Empty message", + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_MODEL, + g_param_spec_object ( + "model", + "Reflow model", + "Reflow model", + E_TYPE_REFLOW_MODEL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_COLUMN_WIDTH, + g_param_spec_double ( + "column_width", + "Column width", + "Column width", + 0.0, G_MAXDOUBLE, 150.0, + G_PARAM_READWRITE)); + + signals[SELECTION_EVENT] = g_signal_new ( + "selection_event", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EReflowClass, selection_event), + NULL, NULL, + e_marshal_INT__OBJECT_BOXED, + G_TYPE_INT, 2, + G_TYPE_OBJECT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + signals[COLUMN_WIDTH_CHANGED] = g_signal_new ( + "column_width_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EReflowClass, column_width_changed), + NULL, NULL, + g_cclosure_marshal_VOID__DOUBLE, + G_TYPE_NONE, 1, + G_TYPE_DOUBLE); } static void @@ -1650,9 +1697,10 @@ e_reflow_init (EReflow *reflow) reflow->selection = E_SELECTION_MODEL (e_selection_model_simple_new ()); reflow->sorter = e_sorter_array_new (er_create_cmp_cache, er_compare, reflow); - g_object_set (reflow->selection, - "sorter", reflow->sorter, - NULL); + g_object_set ( + reflow->selection, + "sorter", reflow->sorter, + NULL); reflow->selection_changed_id = g_signal_connect ( reflow->selection, "selection_changed", diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c index b9b2a09154..e1a7ee8526 100644 --- a/widgets/text/e-text-model.c +++ b/widgets/text/e-text-model.c @@ -98,43 +98,44 @@ e_text_model_class_init (ETextModelClass *class) object_class = G_OBJECT_CLASS (class); object_class->finalize = e_text_model_finalize; - signals[E_TEXT_MODEL_CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextModelClass, changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[E_TEXT_MODEL_REPOSITION] = - g_signal_new ("reposition", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextModelClass, reposition), - NULL, NULL, - e_marshal_NONE__POINTER_POINTER, - G_TYPE_NONE, 2, - G_TYPE_POINTER, G_TYPE_POINTER); - - signals[E_TEXT_MODEL_OBJECT_ACTIVATED] = - g_signal_new ("object_activated", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextModelClass, object_activated), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, - G_TYPE_INT); - - signals[E_TEXT_MODEL_CANCEL_COMPLETION] = - g_signal_new ("cancel_completion", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextModelClass, cancel_completion), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + signals[E_TEXT_MODEL_CHANGED] = g_signal_new ( + "changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETextModelClass, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[E_TEXT_MODEL_REPOSITION] = g_signal_new ( + "reposition", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETextModelClass, reposition), + NULL, NULL, + e_marshal_NONE__POINTER_POINTER, + G_TYPE_NONE, 2, + G_TYPE_POINTER, + G_TYPE_POINTER); + + signals[E_TEXT_MODEL_OBJECT_ACTIVATED] = g_signal_new ( + "object_activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETextModelClass, object_activated), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + signals[E_TEXT_MODEL_CANCEL_COMPLETION] = g_signal_new ( + "cancel_completion", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETextModelClass, cancel_completion), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); /* No default signal handlers. */ class->changed = NULL; @@ -251,9 +252,10 @@ e_text_model_real_insert_length (ETextModel *model, byte_length = p - text; - g_string_insert_len (model->priv->text, - offs - model->priv->text->str, - text, byte_length); + g_string_insert_len ( + model->priv->text, + offs - model->priv->text->str, + text, byte_length); e_text_model_changed (model); @@ -283,8 +285,9 @@ e_text_model_real_delete (ETextModel *model, byte_length = p - offs; - g_string_erase (model->priv->text, - byte_position, byte_length); + g_string_erase ( + model->priv->text, + byte_position, byte_length); e_text_model_changed (model); diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index c46de3adfc..1a56f9af40 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -167,13 +167,15 @@ e_text_dispose (GObject *object) text = E_TEXT (object); if (text->model_changed_signal_id) - g_signal_handler_disconnect (text->model, - text->model_changed_signal_id); + g_signal_handler_disconnect ( + text->model, + text->model_changed_signal_id); text->model_changed_signal_id = 0; if (text->model_repos_signal_id) - g_signal_handler_disconnect (text->model, - text->model_repos_signal_id); + g_signal_handler_disconnect ( + text->model, + text->model_repos_signal_id); text->model_repos_signal_id = 0; if (text->model) @@ -181,8 +183,9 @@ e_text_dispose (GObject *object) text->model = NULL; if (text->tep_command_id) - g_signal_handler_disconnect (text->tep, - text->tep_command_id); + g_signal_handler_disconnect ( + text->tep, + text->tep_command_id); text->tep_command_id = 0; if (text->tep) @@ -388,12 +391,15 @@ reset_layout (EText *text) } text->font_desc = pango_font_description_new (); if (!pango_font_description_get_size_is_absolute (style->font_desc)) - pango_font_description_set_size (text->font_desc, + pango_font_description_set_size ( + text->font_desc, pango_font_description_get_size (style->font_desc)); else - pango_font_description_set_absolute_size (text->font_desc, + pango_font_description_set_absolute_size ( + text->font_desc, pango_font_description_get_size (style->font_desc)); - pango_font_description_set_family (text->font_desc, + pango_font_description_set_family ( + text->font_desc, pango_font_description_get_family (style->font_desc)); pango_layout_set_font_description (text->layout, text->font_desc); @@ -584,12 +590,14 @@ e_text_set_property (GObject *object, case PROP_MODEL: if (text->model_changed_signal_id) - g_signal_handler_disconnect (text->model, - text->model_changed_signal_id); + g_signal_handler_disconnect ( + text->model, + text->model_changed_signal_id); if (text->model_repos_signal_id) - g_signal_handler_disconnect (text->model, - text->model_repos_signal_id); + g_signal_handler_disconnect ( + text->model, + text->model_repos_signal_id); g_object_unref (text->model); text->model = E_TEXT_MODEL (g_value_get_object (value)); @@ -612,8 +620,9 @@ e_text_set_property (GObject *object, case PROP_EVENT_PROCESSOR: if (text->tep && text->tep_command_id) - g_signal_handler_disconnect (text->tep, - text->tep_command_id); + g_signal_handler_disconnect ( + text->tep, + text->tep_command_id); if (text->tep) { g_object_unref (text->tep); } @@ -625,9 +634,10 @@ e_text_set_property (GObject *object, G_CALLBACK (e_text_command), text); if (!text->allow_newlines) - g_object_set (text->tep, - "allow_newlines", FALSE, - NULL); + g_object_set ( + text->tep, + "allow_newlines", FALSE, + NULL); break; case PROP_TEXT: @@ -791,7 +801,7 @@ e_text_set_property (GObject *object, text->break_characters = NULL; } if (g_value_get_string (value)) - text->break_characters = g_strdup ( g_value_get_string (value) ); + text->break_characters = g_strdup (g_value_get_string (value)); text->needs_split_into_lines = 1; needs_reflow = 1; break; @@ -822,9 +832,10 @@ e_text_set_property (GObject *object, case PROP_ALLOW_NEWLINES: text->allow_newlines = g_value_get_boolean (value); _get_tep (text); - g_object_set (text->tep, - "allow_newlines", g_value_get_boolean (value), - NULL); + g_object_set ( + text->tep, + "allow_newlines", g_value_get_boolean (value), + NULL); break; case PROP_CURSOR_POS: { @@ -1040,13 +1051,13 @@ e_text_update (GnomeCanvasItem *item, GNOME_CANVAS_ITEM_CLASS (e_text_parent_class)->update ( item, i2c, flags); - if ( text->needs_recalc_bounds + if (text->needs_recalc_bounds || (flags & GNOME_CANVAS_UPDATE_AFFINE)) { get_bounds (text, &x1, &y1, &x2, &y2); - if ( item->x1 != x1 || - item->x2 != x2 || - item->y1 != y1 || - item->y2 != y2 ) { + if (item->x1 != x1 || + item->x2 != x2 || + item->y1 != y1 || + item->y2 != y2) { gnome_canvas_request_redraw ( item->canvas, item->x1, item->y1, item->x2, item->y2); @@ -1214,11 +1225,12 @@ e_text_draw (GnomeCanvasItem *item, if (!text->rgba_set) { gdk_cairo_set_source_color (cr, &style->fg[state]); } else { - cairo_set_source_rgba (cr, - ((text->rgba >> 24) & 0xff) / 255.0, - ((text->rgba >> 16) & 0xff) / 255.0, - ((text->rgba >> 8) & 0xff) / 255.0, - ( text->rgba & 0xff) / 255.0); + cairo_set_source_rgba ( + cr, + ((text->rgba >> 24) & 0xff) / 255.0, + ((text->rgba >> 16) & 0xff) / 255.0, + ((text->rgba >> 8) & 0xff) / 255.0, + ( text->rgba & 0xff) / 255.0); } /* Insert preedit text only when im_context signals are connected & @@ -1485,8 +1497,9 @@ _blink_scroll_timeout (gpointer data) get_position_from_xy ( text, text->lastx, text->lasty); _get_tep (text); - e_text_event_processor_handle_event (text->tep, - &e_tep_event); + e_text_event_processor_handle_event ( + text->tep, + &e_tep_event); text->scroll_start = current_time; redraw = TRUE; } @@ -1660,7 +1673,7 @@ e_text_event (GnomeCanvasItem *item, if (event->key.keyval == GDK_KEY_F10 && (event->key.state & GDK_SHIFT_MASK) - && text->handle_popup ) { + && text->handle_popup) { /* Simulate a GdkEventButton here, so that we can * call e_text_do_popup directly */ @@ -1711,8 +1724,9 @@ e_text_event (GnomeCanvasItem *item, ret = e_text_event_processor_handle_event (text->tep, &e_tep_event); if (event->type == GDK_KEY_PRESS) - g_signal_emit (text, e_text_signals[E_TEXT_KEYPRESS], 0, - e_tep_event.key.keyval, e_tep_event.key.state); + g_signal_emit ( + text, e_text_signals[E_TEXT_KEYPRESS], 0, + e_tep_event.key.keyval, e_tep_event.key.state); if (e_tep_event.key.string) g_free ((gpointer) e_tep_event.key.string); @@ -1915,9 +1929,10 @@ primary_get_cb (GtkClipboard *clipboard, sel_end = g_utf8_offset_to_pointer (text->text, sel_end) - text->text; if (sel_start != sel_end) { - gtk_selection_data_set_text (selection_data, - text->text + sel_start, - sel_end - sel_start); + gtk_selection_data_set_text ( + selection_data, + text->text + sel_start, + sel_end - sel_start); } } @@ -2036,9 +2051,10 @@ popup_targets_received (GtkClipboard *clipboard, g_free (closure); - gtk_menu_attach_to_widget (GTK_MENU (popup_menu), - GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), - popup_menu_detach); + gtk_menu_attach_to_widget ( + GTK_MENU (popup_menu), + GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), + popup_menu_detach); /* cut menu item */ menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_CUT, NULL); @@ -2091,8 +2107,9 @@ popup_targets_received (GtkClipboard *clipboard, gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), menuitem); - gtk_im_multicontext_append_menuitems (GTK_IM_MULTICONTEXT (text->im_context), - GTK_MENU_SHELL (submenu)); + gtk_im_multicontext_append_menuitems ( + GTK_IM_MULTICONTEXT (text->im_context), + GTK_MENU_SHELL (submenu)); } g_signal_emit (text, @@ -2738,19 +2755,21 @@ e_text_command (ETextEventProcessor *tep, text->select_by_word = command->value; break; case E_TEP_GRAB: - e_canvas_item_grab (E_CANVAS (GNOME_CANVAS_ITEM (text)->canvas), - GNOME_CANVAS_ITEM (text), - GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, - text->i_cursor, - command->time, - NULL, - NULL); + e_canvas_item_grab ( + E_CANVAS (GNOME_CANVAS_ITEM (text)->canvas), + GNOME_CANVAS_ITEM (text), + GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, + text->i_cursor, + command->time, + NULL, + NULL); scroll = FALSE; break; case E_TEP_UNGRAB: - e_canvas_item_ungrab (E_CANVAS (GNOME_CANVAS_ITEM (text)->canvas), - GNOME_CANVAS_ITEM (text), - command->time); + e_canvas_item_ungrab ( + E_CANVAS (GNOME_CANVAS_ITEM (text)->canvas), + GNOME_CANVAS_ITEM (text), + command->time); scroll = FALSE; break; case E_TEP_CAPS: @@ -2895,244 +2914,336 @@ e_text_class_init (ETextClass *class) class->changed = NULL; class->activate = NULL; - e_text_signals[E_TEXT_CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextClass, changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - e_text_signals[E_TEXT_ACTIVATE] = - g_signal_new ("activate", - G_OBJECT_CLASS_TYPE (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextClass, activate), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - e_text_signals[E_TEXT_KEYPRESS] = - g_signal_new ("keypress", - G_OBJECT_CLASS_TYPE (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextClass, keypress), - NULL, NULL, - e_marshal_NONE__INT_INT, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - - e_text_signals[E_TEXT_POPULATE_POPUP] = - g_signal_new ("populate_popup", - G_OBJECT_CLASS_TYPE (gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextClass, populate_popup), - NULL, NULL, - e_marshal_NONE__POINTER_INT_OBJECT, - G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_INT, GTK_TYPE_MENU); - - g_object_class_install_property (gobject_class, PROP_MODEL, - g_param_spec_object ("model", - "Model", - "Model", - E_TYPE_TEXT_MODEL, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_EVENT_PROCESSOR, - g_param_spec_object ("event_processor", - "Event Processor", - "Event Processor", - E_TEXT_EVENT_PROCESSOR_TYPE, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_TEXT, - g_param_spec_string ("text", - "Text", - "Text", - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_BOLD, - g_param_spec_boolean ("bold", - "Bold", - "Bold", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_STRIKEOUT, - g_param_spec_boolean ("strikeout", - "Strikeout", - "Strikeout", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_JUSTIFICATION, - g_param_spec_enum ("justification", - "Justification", - "Justification", - GTK_TYPE_JUSTIFICATION, GTK_JUSTIFY_LEFT, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_CLIP_WIDTH, - g_param_spec_double ("clip_width", - "Clip Width", - "Clip Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_CLIP_HEIGHT, - g_param_spec_double ("clip_height", - "Clip Height", - "Clip Height", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_CLIP, - g_param_spec_boolean ("clip", - "Clip", - "Clip", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_FILL_CLIP_RECTANGLE, - g_param_spec_boolean ("fill_clip_rectangle", - "Fill clip rectangle", - "Fill clip rectangle", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_X_OFFSET, - g_param_spec_double ("x_offset", - "X Offset", - "X Offset", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_Y_OFFSET, - g_param_spec_double ("y_offset", - "Y Offset", - "Y Offset", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_FILL_COLOR, - g_param_spec_string ("fill_color", - "Fill color", - "Fill color", - NULL, - G_PARAM_WRITABLE)); - - g_object_class_install_property (gobject_class, PROP_FILL_COLOR_GDK, - g_param_spec_boxed ("fill_color_gdk", - "GDK fill color", - "GDK fill color", - GDK_TYPE_COLOR, - G_PARAM_WRITABLE)); - - g_object_class_install_property (gobject_class, PROP_FILL_COLOR_RGBA, - g_param_spec_uint ("fill_color_rgba", - "GDK fill color", - "GDK fill color", - 0, G_MAXUINT, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_TEXT_WIDTH, - g_param_spec_double ("text_width", - "Text width", - "Text width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READABLE)); - - g_object_class_install_property (gobject_class, PROP_TEXT_HEIGHT, - g_param_spec_double ("text_height", - "Text height", - "Text height", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READABLE)); - - g_object_class_install_property (gobject_class, PROP_EDITABLE, - g_param_spec_boolean ("editable", - "Editable", - "Editable", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_USE_ELLIPSIS, - g_param_spec_boolean ("use_ellipsis", - "Use ellipsis", - "Use ellipsis", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_ELLIPSIS, - g_param_spec_string ("ellipsis", - "Ellipsis", - "Ellipsis", - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_LINE_WRAP, - g_param_spec_boolean ("line_wrap", - "Line wrap", - "Line wrap", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_BREAK_CHARACTERS, - g_param_spec_string ("break_characters", - "Break characters", - "Break characters", - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_MAX_LINES, - g_param_spec_int ("max_lines", - "Max lines", - "Max lines", - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - "Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - "Height", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_ALLOW_NEWLINES, - g_param_spec_boolean ("allow_newlines", - "Allow newlines", - "Allow newlines", - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_CURSOR_POS, - g_param_spec_int ("cursor_pos", - "Cursor position", - "Cursor position", - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_IM_CONTEXT, - g_param_spec_object ("im_context", - "IM Context", - "IM Context", - GTK_TYPE_IM_CONTEXT, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_HANDLE_POPUP, - g_param_spec_boolean ("handle_popup", - "Handle Popup", - "Handle Popup", - FALSE, - G_PARAM_READWRITE)); + e_text_signals[E_TEXT_CHANGED] = g_signal_new ( + "changed", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETextClass, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + e_text_signals[E_TEXT_ACTIVATE] = g_signal_new ( + "activate", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETextClass, activate), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + e_text_signals[E_TEXT_KEYPRESS] = g_signal_new ( + "keypress", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETextClass, keypress), + NULL, NULL, + e_marshal_NONE__INT_INT, + G_TYPE_NONE, 2, + G_TYPE_UINT, + G_TYPE_UINT); + + e_text_signals[E_TEXT_POPULATE_POPUP] = g_signal_new ( + "populate_popup", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETextClass, populate_popup), + NULL, NULL, + e_marshal_NONE__POINTER_INT_OBJECT, + G_TYPE_NONE, 3, + G_TYPE_POINTER, + G_TYPE_INT, + GTK_TYPE_MENU); + + g_object_class_install_property ( + gobject_class, + PROP_MODEL, + g_param_spec_object ( + "model", + "Model", + "Model", + E_TYPE_TEXT_MODEL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_EVENT_PROCESSOR, + g_param_spec_object ( + "event_processor", + "Event Processor", + "Event Processor", + E_TEXT_EVENT_PROCESSOR_TYPE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_TEXT, + g_param_spec_string ( + "text", + "Text", + "Text", + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_BOLD, + g_param_spec_boolean ( + "bold", + "Bold", + "Bold", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_STRIKEOUT, + g_param_spec_boolean ( + "strikeout", + "Strikeout", + "Strikeout", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_JUSTIFICATION, + g_param_spec_enum ( + "justification", + "Justification", + "Justification", + GTK_TYPE_JUSTIFICATION, + GTK_JUSTIFY_LEFT, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_CLIP_WIDTH, + g_param_spec_double ( + "clip_width", + "Clip Width", + "Clip Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_CLIP_HEIGHT, + g_param_spec_double ( + "clip_height", + "Clip Height", + "Clip Height", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_CLIP, + g_param_spec_boolean ( + "clip", + "Clip", + "Clip", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_FILL_CLIP_RECTANGLE, + g_param_spec_boolean ( + "fill_clip_rectangle", + "Fill clip rectangle", + "Fill clip rectangle", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_X_OFFSET, + g_param_spec_double ( + "x_offset", + "X Offset", + "X Offset", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_Y_OFFSET, + g_param_spec_double ( + "y_offset", + "Y Offset", + "Y Offset", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_FILL_COLOR, + g_param_spec_string ( + "fill_color", + "Fill color", + "Fill color", + NULL, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + gobject_class, + PROP_FILL_COLOR_GDK, + g_param_spec_boxed ( + "fill_color_gdk", + "GDK fill color", + "GDK fill color", + GDK_TYPE_COLOR, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + gobject_class, + PROP_FILL_COLOR_RGBA, + g_param_spec_uint ( + "fill_color_rgba", + "GDK fill color", + "GDK fill color", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_TEXT_WIDTH, + g_param_spec_double ( + "text_width", + "Text width", + "Text width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE)); + + g_object_class_install_property ( + gobject_class, + PROP_TEXT_HEIGHT, + g_param_spec_double ( + "text_height", + "Text height", + "Text height", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE)); + + g_object_class_install_property ( + gobject_class, + PROP_EDITABLE, + g_param_spec_boolean ( + "editable", + "Editable", + "Editable", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_USE_ELLIPSIS, + g_param_spec_boolean ( + "use_ellipsis", + "Use ellipsis", + "Use ellipsis", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_ELLIPSIS, + g_param_spec_string ( + "ellipsis", + "Ellipsis", + "Ellipsis", + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_LINE_WRAP, + g_param_spec_boolean ( + "line_wrap", + "Line wrap", + "Line wrap", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_BREAK_CHARACTERS, + g_param_spec_string ( + "break_characters", + "Break characters", + "Break characters", + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, PROP_MAX_LINES, + g_param_spec_int ( + "max_lines", + "Max lines", + "Max lines", + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + "Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + "Height", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_ALLOW_NEWLINES, + g_param_spec_boolean ( + "allow_newlines", + "Allow newlines", + "Allow newlines", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_CURSOR_POS, + g_param_spec_int ( + "cursor_pos", + "Cursor position", + "Cursor position", + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_IM_CONTEXT, + g_param_spec_object ( + "im_context", + "IM Context", + "IM Context", + GTK_TYPE_IM_CONTEXT, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + gobject_class, + PROP_HANDLE_POPUP, + g_param_spec_boolean ( + "handle_popup", + "Handle Popup", + "Handle Popup", + FALSE, + G_PARAM_READWRITE)); if (!clipboard_atom) clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE); @@ -3241,8 +3352,9 @@ e_text_preedit_changed_cb (GtkIMContext *context, gchar *preedit_string = NULL; gint cursor_pos; - gtk_im_context_get_preedit_string (context, &preedit_string, - NULL, &cursor_pos); + gtk_im_context_get_preedit_string ( + context, &preedit_string, + NULL, &cursor_pos); cursor_pos = CLAMP (cursor_pos, 0, g_utf8_strlen (preedit_string, -1)); etext->preedit_len = strlen (preedit_string); @@ -3271,9 +3383,10 @@ e_text_delete_surrounding_cb (GtkIMContext *context, gint n_chars, EText *text) { - e_text_model_delete (text->model, - MIN (text->selection_start, text->selection_end) + offset, - n_chars); + e_text_model_delete ( + text->model, + MIN (text->selection_start, text->selection_end) + offset, + n_chars); return TRUE; } diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c index 6f62ae74c6..44b069d3a7 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/widgets/text/gal-a11y-e-text.c @@ -79,10 +79,11 @@ et_get_extents (AtkComponent *component, &fake_height, coord_type); - g_object_get (item, - "text_width", &real_width, - "text_height", &real_height, - NULL); + g_object_get ( + item, + "text_width", &real_width, + "text_height", &real_height, + NULL); if (width) *width = real_width; @@ -646,11 +647,12 @@ et_get_offset_at_point (AtkText *text, x -= etext->cx; y -= etext->cy; - pango_layout_xy_to_index (etext->layout, - x * PANGO_SCALE - PANGO_SCALE / 2, - y * PANGO_SCALE - PANGO_SCALE / 2, - &index, - &trailing); + pango_layout_xy_to_index ( + etext->layout, + x * PANGO_SCALE - PANGO_SCALE / 2, + y * PANGO_SCALE - PANGO_SCALE / 2, + &index, + &trailing); return g_utf8_pointer_to_offset (etext->text, etext->text + index + trailing); } @@ -1130,9 +1132,10 @@ void gal_a11y_e_text_init (void) { if (atk_get_root ()) - atk_registry_set_factory_type (atk_get_default_registry (), - E_TYPE_TEXT, - gal_a11y_e_text_factory_get_type ()); + atk_registry_set_factory_type ( + atk_get_default_registry (), + E_TYPE_TEXT, + gal_a11y_e_text_factory_get_type ()); } |