diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-12-01 10:53:20 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-02-20 23:04:25 +0800 |
commit | 23f5773903d64a554d977ae7d0ebbaca73528f1f (patch) | |
tree | 104e1a59da8bf96b004bce204b79f47bbe0a6d13 /widgets/misc | |
parent | 49bc4c2d765ee1780c23fdc9f42152850dabb220 (diff) | |
download | gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.gz gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.zst gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets/misc')
50 files changed, 815 insertions, 658 deletions
diff --git a/widgets/misc/e-account-combo-box.c b/widgets/misc/e-account-combo-box.c index a649df5f8b..9c750f9ec4 100644 --- a/widgets/misc/e-account-combo-box.c +++ b/widgets/misc/e-account-combo-box.c @@ -27,6 +27,10 @@ #include <string.h> +#define E_ACCOUNT_COMBO_BOX_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ACCOUNT_COMBO_BOX, EAccountComboBoxPrivate)) + enum { COLUMN_STRING, COLUMN_ACCOUNT @@ -255,7 +259,7 @@ account_combo_box_dispose (GObject *object) { EAccountComboBoxPrivate *priv; - priv = E_ACCOUNT_COMBO_BOX (object)->priv; + priv = E_ACCOUNT_COMBO_BOX_GET_PRIVATE (object); if (priv->account_list != NULL) { g_signal_handlers_disconnect_by_func ( @@ -276,7 +280,7 @@ account_combo_box_finalize (GObject *object) { EAccountComboBoxPrivate *priv; - priv = E_ACCOUNT_COMBO_BOX (object)->priv; + priv = E_ACCOUNT_COMBO_BOX_GET_PRIVATE (object); g_hash_table_destroy (priv->index); @@ -316,8 +320,7 @@ e_account_combo_box_init (EAccountComboBox *combo_box) (GDestroyNotify) g_object_unref, (GDestroyNotify) gtk_tree_row_reference_free); - combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - combo_box, E_TYPE_ACCOUNT_COMBO_BOX, EAccountComboBoxPrivate); + combo_box->priv = E_ACCOUNT_COMBO_BOX_GET_PRIVATE (combo_box); combo_box->priv->index = index; } @@ -364,7 +367,7 @@ e_account_combo_box_set_account_list (EAccountComboBox *combo_box, if (account_list != NULL) g_return_if_fail (E_IS_ACCOUNT_LIST (account_list)); - priv = combo_box->priv; + priv = E_ACCOUNT_COMBO_BOX_GET_PRIVATE (combo_box); if (priv->account_list != NULL) { g_signal_handlers_disconnect_by_func ( diff --git a/widgets/misc/e-action-combo-box.c b/widgets/misc/e-action-combo-box.c index cd99c346fb..0747a6ed27 100644 --- a/widgets/misc/e-action-combo-box.c +++ b/widgets/misc/e-action-combo-box.c @@ -26,6 +26,10 @@ #include <glib/gi18n.h> +#define E_ACTION_COMBO_BOX_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ACTION_COMBO_BOX, EActionComboBoxPrivate)) + enum { COLUMN_ACTION, COLUMN_SORT @@ -319,7 +323,7 @@ action_combo_box_get_property (GObject *object, static void action_combo_box_dispose (GObject *object) { - EActionComboBoxPrivate *priv = E_ACTION_COMBO_BOX (object)->priv; + EActionComboBoxPrivate *priv = E_ACTION_COMBO_BOX_GET_PRIVATE (object); if (priv->action != NULL) { g_object_unref (priv->action); @@ -340,7 +344,7 @@ action_combo_box_dispose (GObject *object) static void action_combo_box_finalize (GObject *object) { - EActionComboBoxPrivate *priv = E_ACTION_COMBO_BOX (object)->priv; + EActionComboBoxPrivate *priv = E_ACTION_COMBO_BOX_GET_PRIVATE (object); g_hash_table_destroy (priv->index); @@ -431,8 +435,7 @@ e_action_combo_box_class_init (EActionComboBoxClass *class) static void e_action_combo_box_init (EActionComboBox *combo_box) { - combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - combo_box, E_TYPE_ACTION_COMBO_BOX, EActionComboBoxPrivate); + combo_box->priv = E_ACTION_COMBO_BOX_GET_PRIVATE (combo_box); combo_box->priv->index = g_hash_table_new_full ( g_direct_hash, g_direct_equal, diff --git a/widgets/misc/e-alert-bar.c b/widgets/misc/e-alert-bar.c index 75bf55ff25..eb4afdde8c 100644 --- a/widgets/misc/e-alert-bar.c +++ b/widgets/misc/e-alert-bar.c @@ -25,6 +25,10 @@ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_ALERT_BAR, EAlertBarPrivate)) +#define E_ALERT_BAR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ALERT_BAR, EAlertBarPrivate)) + /* GTK_ICON_SIZE_DIALOG is a tad too big. */ #define ICON_SIZE GTK_ICON_SIZE_DND diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c index efc184b090..4847cd204a 100644 --- a/widgets/misc/e-attachment-button.c +++ b/widgets/misc/e-attachment-button.c @@ -27,6 +27,10 @@ #include "e-attachment-button.h" +#define E_ATTACHMENT_BUTTON_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ATTACHMENT_BUTTON, EAttachmentButtonPrivate)) + struct _EAttachmentButtonPrivate { EAttachmentView *view; @@ -450,7 +454,7 @@ attachment_button_dispose (GObject *object) { EAttachmentButtonPrivate *priv; - priv = E_ATTACHMENT_BUTTON (object)->priv; + priv = E_ATTACHMENT_BUTTON_GET_PRIVATE (object); if (priv->view != NULL) { g_object_unref (priv->view); @@ -577,8 +581,7 @@ e_attachment_button_init (EAttachmentButton *button) GtkWidget *widget; gint n_targets; - button->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - button, E_TYPE_ATTACHMENT_BUTTON, EAttachmentButtonPrivate); + button->priv = E_ATTACHMENT_BUTTON_GET_PRIVATE (button); /* Configure Widgets */ diff --git a/widgets/misc/e-attachment-dialog.c b/widgets/misc/e-attachment-dialog.c index 1f31f9d5a3..9a9a1e7942 100644 --- a/widgets/misc/e-attachment-dialog.c +++ b/widgets/misc/e-attachment-dialog.c @@ -27,6 +27,10 @@ #include <glib/gi18n.h> +#define E_ATTACHMENT_DIALOG_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ATTACHMENT_DIALOG, EAttachmentDialogPrivate)) + struct _EAttachmentDialogPrivate { EAttachment *attachment; GtkWidget *display_name_entry; @@ -158,7 +162,7 @@ attachment_dialog_dispose (GObject *object) { EAttachmentDialogPrivate *priv; - priv = E_ATTACHMENT_DIALOG (object)->priv; + priv = E_ATTACHMENT_DIALOG_GET_PRIVATE (object); if (priv->attachment != NULL) { g_object_unref (priv->attachment); @@ -223,7 +227,7 @@ attachment_dialog_response (GtkDialog *dialog, if (response_id != GTK_RESPONSE_OK) return; - priv = E_ATTACHMENT_DIALOG (dialog)->priv; + priv = E_ATTACHMENT_DIALOG_GET_PRIVATE (dialog); g_return_if_fail (E_IS_ATTACHMENT (priv->attachment)); attachment = priv->attachment; @@ -295,8 +299,7 @@ e_attachment_dialog_init (EAttachmentDialog *dialog) GtkWidget *container; GtkWidget *widget; - dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - dialog, E_TYPE_ATTACHMENT_DIALOG, EAttachmentDialogPrivate); + dialog->priv = E_ATTACHMENT_DIALOG_GET_PRIVATE (dialog); gtk_dialog_add_button ( GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); diff --git a/widgets/misc/e-attachment-handler-image.c b/widgets/misc/e-attachment-handler-image.c index a66aa1d5a6..a8c29f24c0 100644 --- a/widgets/misc/e-attachment-handler-image.c +++ b/widgets/misc/e-attachment-handler-image.c @@ -30,6 +30,10 @@ #include <e-util/e-util.h> +#define E_ATTACHMENT_HANDLER_IMAGE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ATTACHMENT_HANDLER_IMAGE, EAttachmentHandlerImagePrivate)) + struct _EAttachmentHandlerImagePrivate { gint placeholder; }; @@ -240,7 +244,5 @@ e_attachment_handler_image_class_init (EAttachmentHandlerImageClass *class) static void e_attachment_handler_image_init (EAttachmentHandlerImage *handler) { - handler->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - handler, E_TYPE_ATTACHMENT_HANDLER_IMAGE, - EAttachmentHandlerImagePrivate); + handler->priv = E_ATTACHMENT_HANDLER_IMAGE_GET_PRIVATE (handler); } diff --git a/widgets/misc/e-attachment-handler.c b/widgets/misc/e-attachment-handler.c index 054cd24a1e..87b9abddb5 100644 --- a/widgets/misc/e-attachment-handler.c +++ b/widgets/misc/e-attachment-handler.c @@ -25,6 +25,10 @@ #include "e-attachment-handler.h" +#define E_ATTACHMENT_HANDLER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ATTACHMENT_HANDLER, EAttachmentHandlerPrivate)) + struct _EAttachmentHandlerPrivate { gpointer placeholder; }; @@ -77,8 +81,7 @@ e_attachment_handler_class_init (EAttachmentHandlerClass *class) static void e_attachment_handler_init (EAttachmentHandler *handler) { - handler->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - handler, E_TYPE_ATTACHMENT_HANDLER, EAttachmentHandlerPrivate); + handler->priv = E_ATTACHMENT_HANDLER_GET_PRIVATE (handler); } EAttachmentView * diff --git a/widgets/misc/e-attachment-icon-view.c b/widgets/misc/e-attachment-icon-view.c index cf14d97746..26ffe9e056 100644 --- a/widgets/misc/e-attachment-icon-view.c +++ b/widgets/misc/e-attachment-icon-view.c @@ -32,6 +32,10 @@ #include "e-attachment-store.h" #include "e-attachment-view.h" +#define E_ATTACHMENT_ICON_VIEW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ATTACHMENT_ICON_VIEW, EAttachmentIconViewPrivate)) + struct _EAttachmentIconViewPrivate { EAttachmentViewPrivate view_priv; }; @@ -348,7 +352,7 @@ attachment_icon_view_get_private (EAttachmentView *view) { EAttachmentIconViewPrivate *priv; - priv = E_ATTACHMENT_ICON_VIEW (view)->priv; + priv = E_ATTACHMENT_ICON_VIEW_GET_PRIVATE (view); return &priv->view_priv; } @@ -531,9 +535,7 @@ e_attachment_icon_view_class_init (EAttachmentIconViewClass *class) static void e_attachment_icon_view_init (EAttachmentIconView *icon_view) { - icon_view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - icon_view, E_TYPE_ATTACHMENT_ICON_VIEW, - EAttachmentIconViewPrivate); + icon_view->priv = E_ATTACHMENT_ICON_VIEW_GET_PRIVATE (icon_view); e_attachment_view_init (E_ATTACHMENT_VIEW (icon_view)); diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c index c5fb9b43b5..c0048fcd31 100644 --- a/widgets/misc/e-attachment-paned.c +++ b/widgets/misc/e-attachment-paned.c @@ -32,6 +32,10 @@ #include "e-attachment-icon-view.h" #include "e-attachment-tree-view.h" +#define E_ATTACHMENT_PANED_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ATTACHMENT_PANED, EAttachmentPanedPrivate)) + #define NUM_VIEWS 2 /* Initial height of the lower pane. */ @@ -283,7 +287,7 @@ attachment_paned_dispose (GObject *object) { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (object)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (object); if (priv->model != NULL) { e_attachment_store_remove_all (E_ATTACHMENT_STORE (priv->model)); @@ -346,7 +350,7 @@ attachment_paned_constructed (GObject *object) EAttachmentPanedPrivate *priv; GSettings *settings; - priv = E_ATTACHMENT_PANED (object)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (object); settings = g_settings_new ("org.gnome.evolution.shell"); @@ -407,7 +411,11 @@ attachment_paned_constructed (GObject *object) G_BINDING_SYNC_CREATE); /* Set up property-to-GSettings bindings. */ - g_settings_bind (settings, "attachment-view", object, "active-view", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "attachment-view", + object, "active-view", + G_SETTINGS_BIND_DEFAULT); + g_object_unref (settings); /* Chain up to parent's constructed() method. */ @@ -419,7 +427,7 @@ attachment_paned_get_private (EAttachmentView *view) { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_get_private (view); @@ -430,7 +438,7 @@ attachment_paned_get_store (EAttachmentView *view) { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_get_store (view); @@ -443,7 +451,7 @@ attachment_paned_get_path_at_pos (EAttachmentView *view, { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_get_path_at_pos (view, x, y); @@ -454,7 +462,7 @@ attachment_paned_get_selected_paths (EAttachmentView *view) { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_get_selected_paths (view); @@ -466,7 +474,7 @@ attachment_paned_path_is_selected (EAttachmentView *view, { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); return e_attachment_view_path_is_selected (view, path); @@ -478,7 +486,7 @@ attachment_paned_select_path (EAttachmentView *view, { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_select_path (view, path); @@ -490,7 +498,7 @@ attachment_paned_unselect_path (EAttachmentView *view, { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_unselect_path (view, path); @@ -501,7 +509,7 @@ attachment_paned_select_all (EAttachmentView *view) { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_select_all (view); @@ -512,7 +520,7 @@ attachment_paned_unselect_all (EAttachmentView *view) { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_unselect_all (view); @@ -523,7 +531,7 @@ attachment_paned_update_actions (EAttachmentView *view) { EAttachmentPanedPrivate *priv; - priv = E_ATTACHMENT_PANED (view)->priv; + priv = E_ATTACHMENT_PANED_GET_PRIVATE (view); view = E_ATTACHMENT_VIEW (priv->icon_view); e_attachment_view_update_actions (view); @@ -596,8 +604,7 @@ e_attachment_paned_init (EAttachmentPaned *paned) GtkWidget *widget; GtkAction *action; - paned->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - paned, E_TYPE_ATTACHMENT_PANED, EAttachmentPanedPrivate); + paned->priv = E_ATTACHMENT_PANED_GET_PRIVATE (paned); paned->priv->model = e_attachment_store_new (); /* Keep the expander label and combo box the same height. */ diff --git a/widgets/misc/e-attachment-store.c b/widgets/misc/e-attachment-store.c index c6208b6866..95465eba81 100644 --- a/widgets/misc/e-attachment-store.c +++ b/widgets/misc/e-attachment-store.c @@ -31,6 +31,10 @@ #include "e-util/e-util.h" #include "e-util/e-mktemp.h" +#define E_ATTACHMENT_STORE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ATTACHMENT_STORE, EAttachmentStorePrivate)) + struct _EAttachmentStorePrivate { GHashTable *attachment_index; @@ -95,7 +99,7 @@ attachment_store_finalize (GObject *object) { EAttachmentStorePrivate *priv; - priv = E_ATTACHMENT_STORE (object)->priv; + priv = E_ATTACHMENT_STORE_GET_PRIVATE (object); g_hash_table_destroy (priv->attachment_index); @@ -164,8 +168,7 @@ e_attachment_store_init (EAttachmentStore *store) (GDestroyNotify) g_object_unref, (GDestroyNotify) gtk_tree_row_reference_free); - store->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - store, E_TYPE_ATTACHMENT_STORE, EAttachmentStorePrivate); + store->priv = E_ATTACHMENT_STORE_GET_PRIVATE (store); store->priv->attachment_index = attachment_index; types[column++] = E_TYPE_ATTACHMENT; /* COLUMN_ATTACHMENT */ diff --git a/widgets/misc/e-attachment-tree-view.c b/widgets/misc/e-attachment-tree-view.c index 7c67fdb917..59a9e43436 100644 --- a/widgets/misc/e-attachment-tree-view.c +++ b/widgets/misc/e-attachment-tree-view.c @@ -32,6 +32,10 @@ #include "e-attachment-store.h" #include "e-attachment-view.h" +#define E_ATTACHMENT_TREE_VIEW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ATTACHMENT_TREE_VIEW, EAttachmentTreeViewPrivate)) + struct _EAttachmentTreeViewPrivate { EAttachmentViewPrivate view_priv; }; @@ -305,7 +309,7 @@ attachment_tree_view_get_private (EAttachmentView *view) { EAttachmentTreeViewPrivate *priv; - priv = E_ATTACHMENT_TREE_VIEW (view)->priv; + priv = E_ATTACHMENT_TREE_VIEW_GET_PRIVATE (view); return &priv->view_priv; } @@ -508,9 +512,7 @@ e_attachment_tree_view_init (EAttachmentTreeView *tree_view) GtkTreeViewColumn *column; GtkCellRenderer *renderer; - tree_view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - tree_view, E_TYPE_ATTACHMENT_TREE_VIEW, - EAttachmentTreeViewPrivate); + tree_view->priv = E_ATTACHMENT_TREE_VIEW_GET_PRIVATE (tree_view); e_attachment_view_init (E_ATTACHMENT_VIEW (tree_view)); diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index 166020596e..0678296767 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -36,6 +36,10 @@ #include "e-util/e-mktemp.h" #include "e-attachment-store.h" +#define E_ATTACHMENT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ATTACHMENT, EAttachmentPrivate)) + /* Fallback Icon */ #define DEFAULT_ICON_NAME "mail-attachment" @@ -162,7 +166,8 @@ attachment_get_default_charset (void) charset = g_settings_get_string (settings, "composer-charset"); if (charset == NULL || *charset == '\0') { g_free (charset); - /* FIXME: this was "/apps/evolution/mail/format/charset", not sure it relates to "charset" */ + /* FIXME This was "/apps/evolution/mail/format/charset", + * not sure it relates to "charset" */ charset = g_settings_get_string (settings, "charset"); if (charset == NULL || *charset == '\0') { g_free (charset); @@ -665,7 +670,7 @@ attachment_dispose (GObject *object) { EAttachmentPrivate *priv; - priv = E_ATTACHMENT (object)->priv; + priv = E_ATTACHMENT_GET_PRIVATE (object); if (priv->file != NULL) { g_object_unref (priv->file); @@ -710,7 +715,7 @@ attachment_finalize (GObject *object) { EAttachmentPrivate *priv; - priv = E_ATTACHMENT (object)->priv; + priv = E_ATTACHMENT_GET_PRIVATE (object); g_free (priv->disposition); @@ -879,8 +884,7 @@ e_attachment_class_init (EAttachmentClass *class) static void e_attachment_init (EAttachment *attachment) { - attachment->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - attachment, E_TYPE_ATTACHMENT, EAttachmentPrivate); + attachment->priv = E_ATTACHMENT_GET_PRIVATE (attachment); attachment->priv->cancellable = g_cancellable_new (); attachment->priv->encrypted = CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE; attachment->priv->signed_ = CAMEL_CIPHER_VALIDITY_SIGN_NONE; diff --git a/widgets/misc/e-buffer-tagger.c b/widgets/misc/e-buffer-tagger.c index cd260252de..0baa96ce69 100644 --- a/widgets/misc/e-buffer-tagger.c +++ b/widgets/misc/e-buffer-tagger.c @@ -565,17 +565,33 @@ e_buffer_tagger_connect (GtkTextView *textview) set_state (buffer, E_BUFFER_TAGGER_STATE_NONE); - g_signal_connect (buffer, "insert-text", G_CALLBACK (buffer_insert_text), NULL); - g_signal_connect (buffer, "delete-range", G_CALLBACK (buffer_delete_range), NULL); - g_signal_connect (buffer, "notify::cursor-position", G_CALLBACK (buffer_cursor_position), NULL); + g_signal_connect ( + buffer, "insert-text", + G_CALLBACK (buffer_insert_text), NULL); + g_signal_connect ( + buffer, "delete-range", + G_CALLBACK (buffer_delete_range), NULL); + g_signal_connect ( + buffer, "notify::cursor-position", + G_CALLBACK (buffer_cursor_position), NULL); gtk_widget_set_has_tooltip (GTK_WIDGET (textview), TRUE); - g_signal_connect (textview, "query-tooltip", G_CALLBACK (textview_query_tooltip), NULL); - g_signal_connect (textview, "key-press-event", G_CALLBACK (textview_key_press_event), NULL); - g_signal_connect (textview, "event-after", G_CALLBACK (textview_event_after), NULL); - g_signal_connect (textview, "motion-notify-event", G_CALLBACK (textview_motion_notify_event), NULL); - g_signal_connect (textview, "visibility-notify-event", G_CALLBACK (textview_visibility_notify_event), NULL); + g_signal_connect ( + textview, "query-tooltip", + G_CALLBACK (textview_query_tooltip), NULL); + g_signal_connect ( + textview, "key-press-event", + G_CALLBACK (textview_key_press_event), NULL); + g_signal_connect ( + textview, "event-after", + G_CALLBACK (textview_event_after), NULL); + g_signal_connect ( + textview, "motion-notify-event", + G_CALLBACK (textview_motion_notify_event), NULL); + g_signal_connect ( + textview, "visibility-notify-event", + G_CALLBACK (textview_visibility_notify_event), NULL); } void diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index c7f2e049d9..577741054b 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -47,150 +47,169 @@ static const gint e_calendar_item_days_in_month[12] = { e_calendar_item_days_in_month[month] + (((month) == 1 \ && ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))) ? 1 : 0) -static void e_calendar_item_dispose (GObject *object); -static void e_calendar_item_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); -static void e_calendar_item_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); -static void e_calendar_item_realize (GnomeCanvasItem *item); -static void e_calendar_item_unmap (GnomeCanvasItem *item); -static void e_calendar_item_update (GnomeCanvasItem *item, - const cairo_matrix_t *i2c, - gint flags); -static void e_calendar_item_draw (GnomeCanvasItem *item, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height); -static void e_calendar_item_draw_month (ECalendarItem *calitem, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height, - gint row, - gint col); -static void e_calendar_item_draw_day_numbers (ECalendarItem *calitem, - cairo_t *cr, - gint width, - gint height, - gint row, - gint col, - gint year, - gint month, - gint start_weekday, - gint cells_x, - gint cells_y); +static void e_calendar_item_dispose (GObject *object); +static void e_calendar_item_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); +static void e_calendar_item_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void e_calendar_item_realize (GnomeCanvasItem *item); +static void e_calendar_item_unmap (GnomeCanvasItem *item); +static void e_calendar_item_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags); +static void e_calendar_item_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height); +static void e_calendar_item_draw_month (ECalendarItem *calitem, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height, + gint row, + gint col); +static void e_calendar_item_draw_day_numbers + (ECalendarItem *calitem, + cairo_t *cr, + gint width, + gint height, + gint row, + gint col, + gint year, + gint month, + gint start_weekday, + gint cells_x, + gint cells_y); static GnomeCanvasItem *e_calendar_item_point (GnomeCanvasItem *item, - gdouble x, - gdouble y, - gint cx, - gint cy); -static void e_calendar_item_stop_selecting (ECalendarItem *calitem, - guint32 time); -static void e_calendar_item_selection_add_days (ECalendarItem *calitem, - gint n_days, - gboolean multi_selection); -static gint e_calendar_item_key_press_event (ECalendarItem *item, - GdkEvent *event); -static gint e_calendar_item_event (GnomeCanvasItem *item, - GdkEvent *event); -static void e_calendar_item_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, - gdouble *x2, gdouble *y2); - -static gboolean e_calendar_item_button_press (ECalendarItem *calitem, - GdkEvent *event); -static gboolean e_calendar_item_button_release (ECalendarItem *calitem, - GdkEvent *event); -static gboolean e_calendar_item_motion (ECalendarItem *calitem, - GdkEvent *event); - -static gboolean e_calendar_item_convert_position_to_day (ECalendarItem *calitem, - gint x, - gint y, - gboolean round_empty_positions, - gint *month_offset, - gint *day, - gboolean *entire_week); -static void e_calendar_item_get_month_info (ECalendarItem *calitem, - gint row, - gint col, - gint *first_day_offset, - gint *days_in_month, - gint *days_in_prev_month); -static void e_calendar_item_recalc_sizes (ECalendarItem *calitem); - -static void e_calendar_item_get_day_style (ECalendarItem *calitem, - gint year, - gint month, - gint day, - gint day_style, - gboolean today, - gboolean prev_or_next_month, - gboolean selected, - gboolean has_focus, - gboolean drop_target, - GdkColor **bg_color, - GdkColor **fg_color, - GdkColor **box_color, - gboolean *bold, - gboolean *italic); -static void e_calendar_item_check_selection_end (ECalendarItem *calitem, - gint start_month, - gint start_day, - gint *end_month, - gint *end_day); -static void e_calendar_item_check_selection_start (ECalendarItem *calitem, - gint *start_month, - gint *start_day, - gint end_month, - gint end_day); -static void e_calendar_item_add_days_to_selection (ECalendarItem *calitem, - gint days); -static void e_calendar_item_round_up_selection (ECalendarItem *calitem, - gint *month_offset, - gint *day); -static void e_calendar_item_round_down_selection (ECalendarItem *calitem, - gint *month_offset, - gint *day); -static gint e_calendar_item_get_inclusive_days (ECalendarItem *calitem, - gint start_month_offset, - gint start_day, - gint end_month_offset, - gint end_day); -static void e_calendar_item_ensure_valid_day (ECalendarItem *calitem, - gint *month_offset, - gint *day); -static gboolean e_calendar_item_ensure_days_visible (ECalendarItem *calitem, - gint start_year, - gint start_month, - gint start_day, - gint end_year, - gint end_month, - gint end_day, - gboolean emission); -static void e_calendar_item_show_popup_menu (ECalendarItem *calitem, - GdkEventButton *event, - gint month_offset); -static void e_calendar_item_on_menu_item_activate (GtkWidget *menuitem, - ECalendarItem *calitem); -static void e_calendar_item_position_menu (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data); -static void e_calendar_item_date_range_changed (ECalendarItem *calitem); -static void e_calendar_item_queue_signal_emission (ECalendarItem *calitem); -static gboolean e_calendar_item_signal_emission_idle_cb (gpointer data); -static void e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, - const GDate *start_date, - const GDate *end_date, - gboolean emission); + gdouble x, + gdouble y, + gint cx, + gint cy); +static void e_calendar_item_stop_selecting (ECalendarItem *calitem, + guint32 time); +static void e_calendar_item_selection_add_days + (ECalendarItem *calitem, + gint n_days, + gboolean multi_selection); +static gint e_calendar_item_key_press_event (ECalendarItem *item, + GdkEvent *event); +static gint e_calendar_item_event (GnomeCanvasItem *item, + GdkEvent *event); +static void e_calendar_item_bounds (GnomeCanvasItem *item, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2); + +static gboolean e_calendar_item_button_press (ECalendarItem *calitem, + GdkEvent *event); +static gboolean e_calendar_item_button_release (ECalendarItem *calitem, + GdkEvent *event); +static gboolean e_calendar_item_motion (ECalendarItem *calitem, + GdkEvent *event); + +static gboolean e_calendar_item_convert_position_to_day + (ECalendarItem *calitem, + gint x, + gint y, + gboolean round_empty_positions, + gint *month_offset, + gint *day, + gboolean *entire_week); +static void e_calendar_item_get_month_info (ECalendarItem *calitem, + gint row, + gint col, + gint *first_day_offset, + gint *days_in_month, + gint *days_in_prev_month); +static void e_calendar_item_recalc_sizes (ECalendarItem *calitem); + +static void e_calendar_item_get_day_style (ECalendarItem *calitem, + gint year, + gint month, + gint day, + gint day_style, + gboolean today, + gboolean prev_or_next_month, + gboolean selected, + gboolean has_focus, + gboolean drop_target, + GdkColor **bg_color, + GdkColor **fg_color, + GdkColor **box_color, + gboolean *bold, + gboolean *italic); +static void e_calendar_item_check_selection_end + (ECalendarItem *calitem, + gint start_month, + gint start_day, + gint *end_month, + gint *end_day); +static void e_calendar_item_check_selection_start + (ECalendarItem *calitem, + gint *start_month, + gint *start_day, + gint end_month, + gint end_day); +static void e_calendar_item_add_days_to_selection + (ECalendarItem *calitem, + gint days); +static void e_calendar_item_round_up_selection + (ECalendarItem *calitem, + gint *month_offset, + gint *day); +static void e_calendar_item_round_down_selection + (ECalendarItem *calitem, + gint *month_offset, + gint *day); +static gint e_calendar_item_get_inclusive_days + (ECalendarItem *calitem, + gint start_month_offset, + gint start_day, + gint end_month_offset, + gint end_day); +static void e_calendar_item_ensure_valid_day + (ECalendarItem *calitem, + gint *month_offset, + gint *day); +static gboolean e_calendar_item_ensure_days_visible + (ECalendarItem *calitem, + gint start_year, + gint start_month, + gint start_day, + gint end_year, + gint end_month, + gint end_day, + gboolean emission); +static void e_calendar_item_show_popup_menu (ECalendarItem *calitem, + GdkEventButton *event, + gint month_offset); +static void e_calendar_item_on_menu_item_activate + (GtkWidget *menuitem, + ECalendarItem *calitem); +static void e_calendar_item_position_menu (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data); +static void e_calendar_item_date_range_changed + (ECalendarItem *calitem); +static void e_calendar_item_queue_signal_emission + (ECalendarItem *calitem); +static gboolean e_calendar_item_signal_emission_idle_cb + (gpointer data); +static void e_calendar_item_set_selection_if_emission + (ECalendarItem *calitem, + const GDate *start_date, + const GDate *end_date, + gboolean emission); /* Our arguments. */ enum { @@ -1483,7 +1502,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, /* Get today's date, so we can highlight it. */ if (calitem->time_callback) { - today_tm = (*calitem->time_callback) (calitem, calitem->time_callback_data); + today_tm = calitem->time_callback ( + calitem, calitem->time_callback_data); } else { t = time (NULL); today_tm = *localtime (&t); @@ -1499,10 +1519,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, for (drow = 0; drow < 6; drow++) { /* Draw the week number. */ if (calitem->show_week_numbers) { - week_num = e_calendar_item_get_week_number (calitem, - day_num, - months[mon], - years[mon]); + week_num = e_calendar_item_get_week_number ( + calitem, day_num, months[mon], years[mon]); text_x = cells_x - E_CALENDAR_ITEM_XPAD_BEFORE_CELLS - 1 - E_CALENDAR_ITEM_XPAD_AFTER_WEEK_NUMBERS; @@ -1513,15 +1531,20 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, if (week_num >= 10) { digit = week_num / 10; text_x -= calitem->week_number_digit_widths[digit]; - num_chars += sprintf (&buffer[num_chars], get_digit_fomat (), digit); + num_chars += sprintf ( + &buffer[num_chars], + get_digit_fomat (), digit); } digit = week_num % 10; text_x -= calitem->week_number_digit_widths[digit] + 6; - num_chars += sprintf (&buffer[num_chars], get_digit_fomat (), digit); + num_chars += sprintf ( + &buffer[num_chars], + get_digit_fomat (), digit); cairo_save (cr); - gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_ACTIVE]); + gdk_cairo_set_source_color ( + cr, &style->text[GTK_STATE_ACTIVE]); pango_layout_set_font_description (layout, font_desc); pango_layout_set_text (layout, buffer, num_chars); cairo_move_to (cr, text_x, text_y); @@ -1564,8 +1587,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, italic = FALSE; if (calitem->style_callback) - (*calitem->style_callback) - (calitem, + calitem->style_callback ( + calitem, years[mon], months[mon], day_num, @@ -1582,8 +1605,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, &italic, calitem->style_callback_data); else - e_calendar_item_get_day_style - (calitem, + e_calendar_item_get_day_style ( + calitem, years[mon], months[mon], day_num, @@ -1603,9 +1626,10 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, if (bg_color) { cairo_save (cr); gdk_cairo_set_source_color (cr, bg_color); - cairo_rectangle (cr, day_x , day_y, - calitem->cell_width, - calitem->cell_height); + cairo_rectangle ( + cr, day_x , day_y, + calitem->cell_width, + calitem->cell_height); cairo_fill (cr); cairo_restore (cr); } @@ -1614,9 +1638,10 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, if (box_color) { cairo_save (cr); gdk_cairo_set_source_color (cr, box_color); - cairo_rectangle (cr, day_x , day_y, - calitem->cell_width - 1, - calitem->cell_height - 1); + cairo_rectangle ( + cr, day_x , day_y, + calitem->cell_width - 1, + calitem->cell_height - 1); cairo_stroke (cr); cairo_restore (cr); } @@ -1640,25 +1665,33 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, digit = day_num % 10; day_x -= calitem->digit_widths[digit]; - num_chars += sprintf (&buffer[num_chars], get_digit_fomat (), digit); + num_chars += sprintf ( + &buffer[num_chars], + get_digit_fomat (), digit); cairo_save (cr); if (fg_color) { - gdk_cairo_set_source_color (cr, fg_color); + gdk_cairo_set_source_color ( + cr, fg_color); } else { - gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]); + gdk_cairo_set_source_color ( + cr, &style->fg[GTK_STATE_NORMAL]); } if (bold) { - pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD); + pango_font_description_set_weight ( + font_desc, PANGO_WEIGHT_BOLD); } else { - pango_font_description_set_weight (font_desc, PANGO_WEIGHT_NORMAL); + pango_font_description_set_weight ( + font_desc, PANGO_WEIGHT_NORMAL); } if (italic) { - pango_font_description_set_style (font_desc, PANGO_STYLE_ITALIC); + pango_font_description_set_style ( + font_desc, PANGO_STYLE_ITALIC); } else { - pango_font_description_set_style (font_desc, PANGO_STYLE_NORMAL); + pango_font_description_set_style ( + font_desc, PANGO_STYLE_NORMAL); } pango_layout_set_font_description (layout, font_desc); @@ -1715,7 +1748,8 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, g_date_clear (&date, 1); g_date_set_dmy (&date, day, month + 1, year); - /* This results in a value of 0 (Monday) - 6 (Sunday). (or -1 on error - oops!!) */ + /* This results in a value of 0 (Monday) - 6 (Sunday). + * (or -1 on error - oops!!) */ weekday = g_date_get_weekday (&date) - 1; if (weekday > 0) { @@ -1962,9 +1996,11 @@ e_calendar_item_recalc_sizes (ECalendarItem *calitem) if (!font_desc) font_desc = style->font_desc; - pango_context = gtk_widget_create_pango_context (GTK_WIDGET (canvas_item->canvas)); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + pango_context = gtk_widget_create_pango_context ( + GTK_WIDGET (canvas_item->canvas)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); layout = pango_layout_new (pango_context); char_height = @@ -2067,8 +2103,10 @@ e_calendar_item_get_day_style (ECalendarItem *calitem, *fg_color = NULL; *box_color = NULL; - *bold = (day_style & E_CALENDAR_ITEM_MARK_BOLD) == E_CALENDAR_ITEM_MARK_BOLD; - *italic = (day_style & E_CALENDAR_ITEM_MARK_ITALIC) == E_CALENDAR_ITEM_MARK_ITALIC; + *bold = (day_style & E_CALENDAR_ITEM_MARK_BOLD) == + E_CALENDAR_ITEM_MARK_BOLD; + *italic = (day_style & E_CALENDAR_ITEM_MARK_ITALIC) == + E_CALENDAR_ITEM_MARK_ITALIC; if (today) *box_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_TODAY_BOX]; @@ -3399,18 +3437,25 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem, gtk_widget_show (label); gtk_container_add (GTK_CONTAINER (menuitem), label); - g_object_set_data(G_OBJECT(menuitem), "month", - GINT_TO_POINTER (month)); + g_object_set_data ( + G_OBJECT (menuitem), "month", + GINT_TO_POINTER (month)); - g_signal_connect ((menuitem), "activate", - G_CALLBACK (e_calendar_item_on_menu_item_activate), calitem); + g_signal_connect ( + menuitem, "activate", + G_CALLBACK (e_calendar_item_on_menu_item_activate), + calitem); } } - g_signal_connect (menu, "deactivate", G_CALLBACK (deactivate_menu_cb), NULL); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, - e_calendar_item_position_menu, calitem, - event->button, event->time); + g_signal_connect ( + menu, "deactivate", + G_CALLBACK (deactivate_menu_cb), NULL); + + gtk_menu_popup ( + GTK_MENU (menu), NULL, NULL, + e_calendar_item_position_menu, calitem, + event->button, event->time); } static void diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index ea45aab4d5..a12a36471d 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -40,6 +40,10 @@ #include "e-canvas-background.h" +#define E_CANVAS_BACKGROUND_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_CANVAS_BACKGROUND_TYPE, ECanvasBackgroundPrivate)) + /* workaround for avoiding API broken */ #define ecb_get_type e_canvas_background_get_type G_DEFINE_TYPE ( @@ -103,20 +107,6 @@ ecb_update (GnomeCanvasItem *item, } static void -ecb_dispose (GObject *object) -{ - ECanvasBackground *ecb = E_CANVAS_BACKGROUND (object); - - if (ecb->priv) { - g_free (ecb->priv); - ecb->priv = NULL; - } - - /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (ecb_parent_class)->dispose (object); -} - -static void ecb_set_property (GObject *object, guint property_id, const GValue *value, @@ -184,7 +174,7 @@ ecb_get_property (GObject *object, static void ecb_init (ECanvasBackground *ecb) { - ecb->priv = g_new (ECanvasBackgroundPrivate, 1); + ecb->priv = E_CANVAS_BACKGROUND_GET_PRIVATE (ecb); } static void @@ -233,7 +223,8 @@ ecb_class_init (ECanvasBackgroundClass *ecb_class) GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS (ecb_class); GObjectClass *object_class = G_OBJECT_CLASS (ecb_class); - object_class->dispose = ecb_dispose; + g_type_class_add_private (ecb_class, sizeof (ECanvasBackgroundPrivate)); + object_class->set_property = ecb_set_property; object_class->get_property = ecb_get_property; diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c index 1b7e6ac900..db5ad51319 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/widgets/misc/e-canvas-vbox.c @@ -64,16 +64,16 @@ G_DEFINE_TYPE ( GNOME_TYPE_CANVAS_GROUP) static void -e_canvas_vbox_class_init (ECanvasVboxClass *klass) +e_canvas_vbox_class_init (ECanvasVboxClass *class) { GObjectClass *object_class; GnomeCanvasItemClass *item_class; - object_class = (GObjectClass *) klass; - item_class = (GnomeCanvasItemClass *) klass; + object_class = (GObjectClass *) class; + item_class = (GnomeCanvasItemClass *) class; - klass->add_item = e_canvas_vbox_real_add_item; - klass->add_item_start = e_canvas_vbox_real_add_item_start; + class->add_item = e_canvas_vbox_real_add_item; + class->add_item_start = e_canvas_vbox_real_add_item_start; object_class->set_property = e_canvas_vbox_set_property; object_class->get_property = e_canvas_vbox_get_property; diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 5e6889fa8e..91bd7c4091 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -262,11 +262,15 @@ pick_current_item (GnomeCanvas *canvas, /* these fields don't have the same offsets in both types of events */ if (canvas->pick_event.type == GDK_ENTER_NOTIFY) { - x = canvas->pick_event.crossing.x + canvas->scroll_x1 - canvas->zoom_xofs; - y = canvas->pick_event.crossing.y + canvas->scroll_y1 - canvas->zoom_yofs; + x = canvas->pick_event.crossing.x + + canvas->scroll_x1 - canvas->zoom_xofs; + y = canvas->pick_event.crossing.y + + canvas->scroll_y1 - canvas->zoom_yofs; } else { - x = canvas->pick_event.motion.x + canvas->scroll_x1 - canvas->zoom_xofs; - y = canvas->pick_event.motion.y + canvas->scroll_y1 - canvas->zoom_yofs; + x = canvas->pick_event.motion.x + + canvas->scroll_x1 - canvas->zoom_xofs; + y = canvas->pick_event.motion.y + + canvas->scroll_y1 - canvas->zoom_yofs; } /* canvas pixel coords */ diff --git a/widgets/misc/e-charset-combo-box.c b/widgets/misc/e-charset-combo-box.c index a2ec3489f6..01a814ad10 100644 --- a/widgets/misc/e-charset-combo-box.c +++ b/widgets/misc/e-charset-combo-box.c @@ -30,6 +30,10 @@ #include "e-util/e-charset.h" #include "e-util/e-util.h" +#define E_CHARSET_COMBO_BOX_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_CHARSET_COMBO_BOX, ECharsetComboBoxPrivate)) + #define DEFAULT_CHARSET "UTF-8" #define OTHER_VALUE G_MAXINT @@ -221,7 +225,7 @@ charset_combo_box_dispose (GObject *object) { ECharsetComboBoxPrivate *priv; - priv = E_CHARSET_COMBO_BOX (object)->priv; + priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (object); if (priv->action_group != NULL) { g_object_unref (priv->action_group); @@ -244,7 +248,7 @@ charset_combo_box_finalize (GObject *object) { ECharsetComboBoxPrivate *priv; - priv = E_CHARSET_COMBO_BOX (object)->priv; + priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (object); g_hash_table_destroy (priv->charset_index); @@ -257,7 +261,7 @@ charset_combo_box_changed (GtkComboBox *combo_box) { ECharsetComboBoxPrivate *priv; - priv = E_CHARSET_COMBO_BOX (combo_box)->priv; + priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (combo_box); /* Chain up to parent's changed() method. */ GTK_COMBO_BOX_CLASS (e_charset_combo_box_parent_class)-> @@ -312,8 +316,7 @@ e_charset_combo_box_init (ECharsetComboBox *combo_box) (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref); - combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - combo_box, E_TYPE_CHARSET_COMBO_BOX, ECharsetComboBoxPrivate); + combo_box->priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (combo_box); combo_box->priv->action_group = action_group; combo_box->priv->charset_index = charset_index; diff --git a/widgets/misc/e-contact-map-window.c b/widgets/misc/e-contact-map-window.c index 9612f0d6ac..87ce665793 100644 --- a/widgets/misc/e-contact-map-window.c +++ b/widgets/misc/e-contact-map-window.c @@ -165,7 +165,8 @@ map_contact_added_cb (EContactMap *map, gtk_list_store_set (priv->completion_model, &iter, 0, name, -1); - g_signal_connect (E_CONTACT_MARKER (marker), "double-clicked", + g_signal_connect ( + marker, "double-clicked", G_CALLBACK (marker_doubleclick_cb), user_data); priv->tasks_cnt--; @@ -342,8 +343,7 @@ e_contact_map_window_init (EContactMapWindow *window) ChamplainView *view; GHashTable *hash_table; - priv = G_TYPE_INSTANCE_GET_PRIVATE ( - window, E_TYPE_CONTACT_MAP_WINDOW, EContactMapWindowPrivate); + priv = E_CONTACT_MAP_WINDOW_GET_PRIVATE (window); window->priv = priv; priv->tasks_cnt = 0; @@ -361,15 +361,20 @@ e_contact_map_window_init (EContactMapWindow *window) view = e_contact_map_get_view (E_CONTACT_MAP (map)); champlain_view_set_zoom_level (view, 2); priv->map = E_CONTACT_MAP (map); - g_signal_connect (view, "notify::zoom-level", + g_signal_connect ( + view, "notify::zoom-level", G_CALLBACK (zoom_level_changed_cb), window); - g_signal_connect (map, "contact-added", + g_signal_connect ( + map, "contact-added", G_CALLBACK (map_contact_added_cb), window); - g_signal_connect (map, "contact-removed", + g_signal_connect ( + map, "contact-removed", G_CALLBACK (map_contact_removed_cb), window); - g_signal_connect (map, "geocoding-started", + g_signal_connect ( + map, "geocoding-started", G_CALLBACK (map_contact_geocoding_started_cb), window); - g_signal_connect (map, "geocoding-failed", + g_signal_connect ( + map, "geocoding-failed", G_CALLBACK (map_contact_geocoding_failed_cb), window); /* HBox container */ @@ -383,14 +388,16 @@ e_contact_map_window_init (EContactMapWindow *window) /* Zoom-in button */ button = gtk_button_new_from_stock (GTK_STOCK_ZOOM_IN); - g_signal_connect (button, "clicked", + g_signal_connect ( + button, "clicked", G_CALLBACK (contact_map_window_zoom_in_cb), window); priv->zoom_in_btn = button; gtk_container_add (GTK_CONTAINER (hbox), button); /* Zoom-out button */ button = gtk_button_new_from_stock (GTK_STOCK_ZOOM_OUT); - g_signal_connect (button, "clicked", + g_signal_connect ( + button, "clicked", G_CALLBACK (contact_map_window_zoom_out_cb), window); priv->zoom_out_btn = button; gtk_container_add (GTK_CONTAINER (hbox), button); @@ -404,20 +411,23 @@ e_contact_map_window_init (EContactMapWindow *window) gtk_entry_completion_set_model ( entry_completion, GTK_TREE_MODEL (completion_model)); gtk_entry_completion_set_text_column (entry_completion, 0); - g_signal_connect (entry_completion, "match-selected", + g_signal_connect ( + entry_completion, "match-selected", G_CALLBACK (entry_completion_match_selected_cb), window); /* Search entry */ entry = gtk_entry_new (); gtk_entry_set_completion (GTK_ENTRY (entry), entry_completion); - g_signal_connect (entry, "key-press-event", + g_signal_connect ( + entry, "key-press-event", G_CALLBACK (contact_map_window_entry_key_pressed_cb), window); window->priv->search_entry = entry; gtk_container_add (GTK_CONTAINER (hbox), entry); /* Search button */ button = gtk_button_new_from_stock (GTK_STOCK_FIND); - g_signal_connect (button, "clicked", + g_signal_connect ( + button, "clicked", G_CALLBACK (contact_map_window_find_contact_cb), window); gtk_container_add (GTK_CONTAINER (hbox), button); diff --git a/widgets/misc/e-contact-map.c b/widgets/misc/e-contact-map.c index b2f6ff591e..7158aaeed5 100644 --- a/widgets/misc/e-contact-map.c +++ b/widgets/misc/e-contact-map.c @@ -205,7 +205,7 @@ e_contact_map_class_init (EContactMapClass *class) { GObjectClass *object_class; - g_type_class_add_private (class, sizeof (EContactMap)); + g_type_class_add_private (class, sizeof (EContactMapPrivate)); object_class = G_OBJECT_CLASS (class); object_class->finalize = contact_map_finalize; @@ -254,8 +254,7 @@ e_contact_map_init (EContactMap *map) ChamplainMarkerLayer *layer; ChamplainView *view; - map->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - map, E_TYPE_CONTACT_MAP, EContactMapPrivate); + map->priv = E_CONTACT_MAP_GET_PRIVATE (map); hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL); diff --git a/widgets/misc/e-contact-marker.c b/widgets/misc/e-contact-marker.c index 7d7f57db25..2f7c2cbf45 100644 --- a/widgets/misc/e-contact-marker.c +++ b/widgets/misc/e-contact-marker.c @@ -546,8 +546,7 @@ e_contact_marker_init (EContactMarker *marker) { EContactMarkerPrivate *priv; - priv = G_TYPE_INSTANCE_GET_PRIVATE ( - marker, E_TYPE_CONTACT_MARKER, EContactMarkerPrivate); + priv = E_CONTACT_MARKER_GET_PRIVATE (marker); marker->priv = priv; priv->contact_uid = NULL; @@ -565,9 +564,11 @@ e_contact_marker_init (EContactMarker *marker) priv->total_width = 0; priv->total_height = 0; - g_signal_connect (marker, "notify::selected", + g_signal_connect ( + marker, "notify::selected", G_CALLBACK (notify_selected), NULL); - g_signal_connect (CLUTTER_ACTOR (marker), "button-release-event", + g_signal_connect ( + marker, "button-release-event", G_CALLBACK (contact_marker_clicked_cb), NULL); } diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 970a06b402..4513aec28f 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -43,6 +43,10 @@ #include <e-util/e-util.h> #include "e-calendar.h" +#define E_DATE_EDIT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_DATE_EDIT, EDateEditPrivate)) + struct _EDateEditPrivate { GtkWidget *date_entry; GtkWidget *date_button; @@ -451,8 +455,7 @@ e_date_edit_class_init (EDateEditClass *class) static void e_date_edit_init (EDateEdit *dedit) { - dedit->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - dedit, E_TYPE_DATE_EDIT, EDateEditPrivate); + dedit->priv = E_DATE_EDIT_GET_PRIVATE (dedit); dedit->priv->show_date = TRUE; dedit->priv->show_time = TRUE; @@ -524,20 +527,20 @@ create_children (EDateEdit *dedit) gtk_box_pack_start (GTK_BOX (dedit), priv->date_entry, FALSE, TRUE, 0); gtk_widget_set_size_request (priv->date_entry, 100, -1); - g_signal_connect (priv->date_entry, "key_press_event", - G_CALLBACK (on_date_entry_key_press), - dedit); - g_signal_connect (priv->date_entry, "key_release_event", - G_CALLBACK (on_date_entry_key_release), - dedit); - g_signal_connect_after (priv->date_entry, - "focus_out_event", - G_CALLBACK (on_date_entry_focus_out), - dedit); + g_signal_connect ( + priv->date_entry, "key_press_event", + G_CALLBACK (on_date_entry_key_press), dedit); + g_signal_connect ( + priv->date_entry, "key_release_event", + G_CALLBACK (on_date_entry_key_release), dedit); + g_signal_connect_after ( + priv->date_entry, "focus_out_event", + G_CALLBACK (on_date_entry_focus_out), dedit); priv->date_button = gtk_button_new (); - g_signal_connect (priv->date_button, "clicked", - G_CALLBACK (on_date_button_clicked), 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); a11y = gtk_widget_get_accessible (priv->date_button); @@ -620,15 +623,15 @@ create_children (EDateEdit *dedit) 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); - g_signal_connect (priv->cal_popup, "key_press_event", - G_CALLBACK (on_date_popup_key_press), - dedit); - g_signal_connect (priv->cal_popup, "button_press_event", - G_CALLBACK (on_date_popup_button_press), - dedit); + g_signal_connect ( + priv->cal_popup, "delete_event", + G_CALLBACK (on_date_popup_delete_event), dedit); + g_signal_connect ( + priv->cal_popup, "key_press_event", + G_CALLBACK (on_date_popup_key_press), dedit); + g_signal_connect ( + priv->cal_popup, "button_press_event", + G_CALLBACK (on_date_popup_button_press), dedit); gtk_window_set_resizable (GTK_WINDOW (priv->cal_popup), TRUE); frame = gtk_frame_new (NULL); @@ -647,9 +650,9 @@ create_children (EDateEdit *dedit) "move_selection_when_moving", FALSE, NULL); - g_signal_connect (calendar->calitem, - "selection_changed", - G_CALLBACK (on_date_popup_date_selected), dedit); + g_signal_connect ( + calendar->calitem, "selection_changed", + G_CALLBACK (on_date_popup_date_selected), dedit); gtk_box_pack_start (GTK_BOX (vbox), priv->calendar, FALSE, FALSE, 0); gtk_widget_show (priv->calendar); @@ -663,21 +666,24 @@ create_children (EDateEdit *dedit) priv->now_button = gtk_button_new_with_mnemonic (_("No_w")); gtk_container_add (GTK_CONTAINER (bbox), priv->now_button); gtk_widget_show (priv->now_button); - g_signal_connect (priv->now_button, "clicked", - G_CALLBACK (on_date_popup_now_button_clicked), dedit); + g_signal_connect ( + priv->now_button, "clicked", + G_CALLBACK (on_date_popup_now_button_clicked), dedit); priv->today_button = gtk_button_new_with_mnemonic (_("_Today")); gtk_container_add (GTK_CONTAINER (bbox), priv->today_button); gtk_widget_show (priv->today_button); - g_signal_connect (priv->today_button, "clicked", - G_CALLBACK (on_date_popup_today_button_clicked), dedit); + g_signal_connect ( + priv->today_button, "clicked", + G_CALLBACK (on_date_popup_today_button_clicked), dedit); /* Note that we don't show this here, since by default a 'None' date * is not permitted. */ priv->none_button = gtk_button_new_with_mnemonic (_("_None")); gtk_container_add (GTK_CONTAINER (bbox), priv->none_button); - g_signal_connect (priv->none_button, "clicked", - G_CALLBACK (on_date_popup_none_button_clicked), dedit); + g_signal_connect ( + priv->none_button, "clicked", + G_CALLBACK (on_date_popup_none_button_clicked), dedit); g_object_bind_property ( dedit, "allow-no-date-set", priv->none_button, "visible", diff --git a/widgets/misc/e-focus-tracker.c b/widgets/misc/e-focus-tracker.c index 1e7082b207..505d991a2f 100644 --- a/widgets/misc/e-focus-tracker.c +++ b/widgets/misc/e-focus-tracker.c @@ -29,6 +29,10 @@ #include <misc/e-selectable.h> +#define E_FOCUS_TRACKER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_FOCUS_TRACKER, EFocusTrackerPrivate)) + struct _EFocusTrackerPrivate { GtkWidget *focus; /* not referenced */ GtkWindow *window; @@ -356,7 +360,7 @@ focus_tracker_dispose (GObject *object) { EFocusTrackerPrivate *priv; - priv = E_FOCUS_TRACKER (object)->priv; + priv = E_FOCUS_TRACKER_GET_PRIVATE (object); g_signal_handlers_disconnect_matched ( gtk_clipboard_get (GDK_SELECTION_PRIMARY), @@ -538,8 +542,7 @@ e_focus_tracker_init (EFocusTracker *focus_tracker) { GtkAction *action; - focus_tracker->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - focus_tracker, E_TYPE_FOCUS_TRACKER, EFocusTrackerPrivate); + focus_tracker->priv = E_FOCUS_TRACKER_GET_PRIVATE (focus_tracker); /* Define dummy actions. These will most likely be overridden, * but for cases where they're not it ensures ESelectable objects diff --git a/widgets/misc/e-image-chooser.c b/widgets/misc/e-image-chooser.c index 932d4ebc51..5fe6941d58 100644 --- a/widgets/misc/e-image-chooser.c +++ b/widgets/misc/e-image-chooser.c @@ -32,6 +32,10 @@ #include "e-util/e-util.h" #include "e-util/e-icon-factory.h" +#define E_IMAGE_CHOOSER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_IMAGE_CHOOSER, EImageChooserPrivate)) + struct _EImageChooserPrivate { GtkWidget *frame; GtkWidget *image; @@ -372,7 +376,7 @@ image_chooser_dispose (GObject *object) { EImageChooserPrivate *priv; - priv = E_IMAGE_CHOOSER (object)->priv; + priv = E_IMAGE_CHOOSER_GET_PRIVATE (object); if (priv->frame != NULL) { g_object_unref (priv->frame); @@ -393,7 +397,7 @@ image_chooser_finalize (GObject *object) { EImageChooserPrivate *priv; - priv = E_IMAGE_CHOOSER (object)->priv; + priv = E_IMAGE_CHOOSER_GET_PRIVATE (object); g_free (priv->image_buf); g_free (priv->icon_name); @@ -442,8 +446,7 @@ e_image_chooser_init (EImageChooser *chooser) GtkWidget *container; GtkWidget *widget; - chooser->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - chooser, E_TYPE_IMAGE_CHOOSER, EImageChooserPrivate); + chooser->priv = E_IMAGE_CHOOSER_GET_PRIVATE (chooser); container = GTK_WIDGET (chooser); diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index a2588cd075..6bda3952b2 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -37,6 +37,10 @@ #include <e-util/e-import.h> #include <e-util/e-util-private.h> +#define E_IMPORT_ASSISTANT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_IMPORT_ASSISTANT, EImportAssistantPrivate)) + typedef struct _ImportFilePage ImportFilePage; typedef struct _ImportDestinationPage ImportDestinationPage; typedef struct _ImportTypePage ImportTypePage; @@ -147,12 +151,15 @@ filename_changed (GtkWidget *widget, const gchar *filename; gint fileok; - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); page = &priv->file_page; filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget)); - fileok = filename && filename[0] && g_file_test (filename, G_FILE_TEST_IS_REGULAR); + fileok = + filename != NULL && *filename != '\0' && + g_file_test (filename, G_FILE_TEST_IS_REGULAR); + if (fileok) { GtkTreeIter iter; GtkTreeModel *model; @@ -219,7 +226,7 @@ filetype_changed_cb (GtkComboBox *combo_box, GtkTreeModel *model; GtkTreeIter iter; - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); g_return_if_fail (gtk_combo_box_get_active_iter (combo_box, &iter)); @@ -503,7 +510,7 @@ prepare_intelligent_page (GtkAssistant *assistant, gint row; ImportSelectionPage *page; - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); page = &priv->selection_page; if (page->target != NULL) { @@ -666,7 +673,7 @@ prepare_file_page (GtkAssistant *assistant, GtkListStore *store; ImportFilePage *page; - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); page = &priv->file_page; if (page->target != NULL) { @@ -729,7 +736,7 @@ prepare_destination_page (GtkAssistant *assistant, EImportAssistantPrivate *priv; ImportDestinationPage *page; - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); page = &priv->destination_page; if (page->control) @@ -756,7 +763,7 @@ prepare_progress_page (GtkAssistant *assistant, gboolean intelligent_import; gboolean is_simple = FALSE; - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); page = &priv->selection_page; /* Because we're a GTK_ASSISTANT_PAGE_PROGRESS, this will @@ -820,7 +827,7 @@ simple_filetype_changed_cb (GtkComboBox *combo_box, GtkWidget *vbox; GtkWidget *control; - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); page = &priv->simple_page; g_return_if_fail (gtk_combo_box_get_active_iter (combo_box, &iter)); @@ -864,7 +871,7 @@ prepare_simple_page (GtkAssistant *assistant, ImportSimplePage *page; gchar *uri; - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); page = &priv->simple_page; g_return_if_fail (priv->fileuris != NULL); @@ -942,7 +949,7 @@ prepare_simple_destination_page (GtkAssistant *assistant, ImportDestinationPage *page; ImportSimplePage *simple_page; - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); page = &priv->destination_page; simple_page = &priv->simple_page; @@ -1004,7 +1011,7 @@ set_import_uris (EImportAssistant *assistant, g_return_val_if_fail (assistant->priv->import != NULL, FALSE); g_return_val_if_fail (uris != NULL, FALSE); - priv = E_IMPORT_ASSISTANT (assistant)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant); for (i = 0; uris[i]; i++) { const gchar *uri = uris[i]; @@ -1014,7 +1021,8 @@ set_import_uris (EImportAssistant *assistant, if (!filename) filename = g_strdup (uri); - if (filename && *filename && g_file_test (filename, G_FILE_TEST_IS_REGULAR)) { + if (filename && *filename && + g_file_test (filename, G_FILE_TEST_IS_REGULAR)) { gchar *furi; if (!g_path_is_absolute (filename)) { @@ -1069,11 +1077,49 @@ set_import_uris (EImportAssistant *assistant, } static void +import_assistant_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + EImportAssistantPrivate *priv; + + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (object); + + switch (property_id) { + case PROP_IS_SIMPLE: + priv->is_simple = g_value_get_boolean (value); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +import_assistant_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + EImportAssistantPrivate *priv; + + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (object); + + switch (property_id) { + case PROP_IS_SIMPLE: + g_value_set_boolean (value, priv->is_simple); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void import_assistant_dispose (GObject *object) { EImportAssistantPrivate *priv; - priv = E_IMPORT_ASSISTANT (object)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (object); if (priv->file_page.target != NULL) { e_import_target_free ( @@ -1116,7 +1162,7 @@ import_assistant_finalize (GObject *object) { EImportAssistantPrivate *priv; - priv = E_IMPORT_ASSISTANT (object)->priv; + priv = E_IMPORT_ASSISTANT_GET_PRIVATE (object); g_slist_free (priv->selection_page.importers); @@ -1124,37 +1170,6 @@ import_assistant_finalize (GObject *object) G_OBJECT_CLASS (e_import_assistant_parent_class)->finalize (object); } -static void -import_assistant_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) -{ - switch (property_id) { - case PROP_IS_SIMPLE: - E_IMPORT_ASSISTANT (object)->priv->is_simple = g_value_get_boolean (value); - return; - } - - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); -} - -static void -import_assistant_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) -{ - switch (property_id) { - case PROP_IS_SIMPLE: - g_value_set_boolean (value, - E_IMPORT_ASSISTANT (object)->priv->is_simple); - return; - } - - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); -} - static gboolean import_assistant_key_press_event (GtkWidget *widget, GdkEventKey *event) @@ -1372,9 +1387,8 @@ import_assistant_construct (EImportAssistant *import_assistant) static void e_import_assistant_init (EImportAssistant *import_assistant) { - import_assistant->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - import_assistant, E_TYPE_IMPORT_ASSISTANT, - EImportAssistantPrivate); + import_assistant->priv = + E_IMPORT_ASSISTANT_GET_PRIVATE (import_assistant); } GtkWidget * diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index a239709415..1d114d0c07 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -36,6 +36,10 @@ #include "e-map.h" +#define E_MAP_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_MAP, EMapPrivate)) + #define E_MAP_TWEEN_TIMEOUT_MSECS 25 #define E_MAP_TWEEN_DURATION_MSECS 150 @@ -563,9 +567,6 @@ e_map_finalize (GObject *object) /* gone in unrealize */ g_assert (map->priv->map_render_surface == NULL); - g_free (map->priv); - map->priv = NULL; - G_OBJECT_CLASS (e_map_parent_class)->finalize (object); } @@ -807,10 +808,12 @@ e_map_class_init (EMapClass *class) GObjectClass *object_class; GtkWidgetClass *widget_class; + g_type_class_add_private (class, sizeof (EMapPrivate)); + object_class = G_OBJECT_CLASS (class); - object_class->finalize = e_map_finalize; object_class->set_property = e_map_set_property; object_class->get_property = e_map_get_property; + object_class->finalize = e_map_finalize; /* Scrollable interface properties */ g_object_class_override_property ( @@ -846,7 +849,7 @@ e_map_init (EMap *map) widget = GTK_WIDGET (map); - map->priv = g_new0 (EMapPrivate, 1); + map->priv = E_MAP_GET_PRIVATE (map); load_map_background (map, map_file_name); g_free (map_file_name); @@ -1244,10 +1247,12 @@ update_render_surface (EMap *map, /* Scale the original map into the rendering pixbuf */ - if (width > 1 && height > 1) - { + if (width > 1 && height > 1) { cairo_t *cr = cairo_create (map->priv->map_render_surface); - cairo_scale (cr, (gdouble) width / orig_width, (gdouble) height / orig_height); + cairo_scale ( + cr, + (gdouble) width / orig_width, + (gdouble) height / orig_height); gdk_cairo_set_source_pixbuf (cr, map->priv->map_pixbuf, 0, 0); cairo_paint (cr); cairo_destroy (cr); @@ -1260,8 +1265,7 @@ update_render_surface (EMap *map, if (render_overlays) { /* Add points */ - for (i = 0; i < map->priv->points->len; i++) - { + for (i = 0; i < map->priv->points->len; i++) { point = g_ptr_array_index (map->priv->points, i); update_render_point (map, point); } diff --git a/widgets/misc/e-menu-tool-button.c b/widgets/misc/e-menu-tool-button.c index 5a052a1844..c2a68d0c05 100644 --- a/widgets/misc/e-menu-tool-button.c +++ b/widgets/misc/e-menu-tool-button.c @@ -25,16 +25,19 @@ #include "e-menu-tool-button.h" +#define E_MENU_TOOL_BUTTON_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_MENU_TOOL_BUTTON, EMenuToolButtonPrivate)) + +struct _EMenuToolButtonPrivate { + gchar *prefer_item; +}; + enum { PROP_0, PROP_PREFER_ITEM }; -struct _EMenuToolButtonPrivate -{ - gchar *prefer_item; -}; - G_DEFINE_TYPE ( EMenuToolButton, e_menu_tool_button, @@ -73,8 +76,9 @@ menu_tool_button_get_prefer_menu_item (GtkMenuToolButton *menu_tool_button) if (children == NULL) return NULL; - prefer_item = e_menu_tool_button_get_prefer_item (E_MENU_TOOL_BUTTON (menu_tool_button)); - if (prefer_item && *prefer_item) { + prefer_item = e_menu_tool_button_get_prefer_item ( + E_MENU_TOOL_BUTTON (menu_tool_button)); + if (prefer_item != NULL && *prefer_item != '\0') { GtkAction *action; GList *iter; @@ -84,7 +88,8 @@ menu_tool_button_get_prefer_menu_item (GtkMenuToolButton *menu_tool_button) if (!item) continue; - action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (item)); + action = gtk_activatable_get_related_action ( + GTK_ACTIVATABLE (item)); if (action && g_strcmp0 (gtk_action_get_name (action), prefer_item) == 0) break; else if (!action && g_strcmp0 (gtk_widget_get_name (GTK_WIDGET (item)), prefer_item) == 0) @@ -227,8 +232,7 @@ e_menu_tool_button_class_init (EMenuToolButtonClass *class) static void e_menu_tool_button_init (EMenuToolButton *button) { - button->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - button, E_TYPE_MENU_TOOL_BUTTON, EMenuToolButtonPrivate); + button->priv = E_MENU_TOOL_BUTTON_GET_PRIVATE (button); button->priv->prefer_item = NULL; @@ -245,7 +249,7 @@ e_menu_tool_button_new (const gchar *label) void e_menu_tool_button_set_prefer_item (EMenuToolButton *button, - const gchar *prefer_item) + const gchar *prefer_item) { g_return_if_fail (button != NULL); g_return_if_fail (E_IS_MENU_TOOL_BUTTON (button)); diff --git a/widgets/misc/e-online-button.c b/widgets/misc/e-online-button.c index 351413e954..07ff998dc3 100644 --- a/widgets/misc/e-online-button.c +++ b/widgets/misc/e-online-button.c @@ -23,6 +23,10 @@ #include <glib/gi18n.h> +#define E_ONLINE_BUTTON_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ONLINE_BUTTON, EOnlineButtonPrivate)) + #define ONLINE_TOOLTIP \ _("Evolution is currently online. Click this button to work offline.") @@ -101,7 +105,7 @@ online_button_dispose (GObject *object) { EOnlineButtonPrivate *priv; - priv = E_ONLINE_BUTTON (object)->priv; + priv = E_ONLINE_BUTTON_GET_PRIVATE (object); if (priv->image != NULL) { g_object_unref (priv->image); @@ -141,8 +145,7 @@ e_online_button_init (EOnlineButton *button) { GtkWidget *widget; - button->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - button, E_TYPE_ONLINE_BUTTON, EOnlineButtonPrivate); + button->priv = E_ONLINE_BUTTON_GET_PRIVATE (button); gtk_widget_set_can_focus (GTK_WIDGET (button), FALSE); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); diff --git a/widgets/misc/e-paned.c b/widgets/misc/e-paned.c index c90d40c140..3b8f16bbec 100644 --- a/widgets/misc/e-paned.c +++ b/widgets/misc/e-paned.c @@ -27,6 +27,10 @@ #include <glib/gi18n-lib.h> +#define E_PANED_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_PANED, EPanedPrivate)) + #define SYNC_REQUEST_NONE 0 #define SYNC_REQUEST_POSITION 1 #define SYNC_REQUEST_PROPORTION 2 @@ -224,7 +228,7 @@ paned_realize (GtkWidget *widget) GdkWindowState state; GdkWindow *window; - priv = E_PANED (widget)->priv; + priv = E_PANED_GET_PRIVATE (widget); /* Chain up to parent's realize() method. */ GTK_WIDGET_CLASS (e_paned_parent_class)->realize (widget); @@ -367,8 +371,7 @@ e_paned_class_init (EPanedClass *class) static void e_paned_init (EPaned *paned) { - paned->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - paned, E_TYPE_PANED, EPanedPrivate); + paned->priv = E_PANED_GET_PRIVATE (paned); paned->priv->proportion = 0.5; paned->priv->fixed_resize = TRUE; diff --git a/widgets/misc/e-picture-gallery.c b/widgets/misc/e-picture-gallery.c index a742a5e37c..372e70146c 100644 --- a/widgets/misc/e-picture-gallery.c +++ b/widgets/misc/e-picture-gallery.c @@ -27,6 +27,10 @@ #include "e-picture-gallery.h" +#define E_PICTURE_GALLERY_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_PICTURE_GALLERY, EPictureGalleryPrivate)) + struct _EPictureGalleryPrivate { gboolean initialized; gchar *path; @@ -262,7 +266,10 @@ picture_gallery_start_loading_cb (EPictureGallery *gallery) g_object_unref (file); if (gallery->priv->monitor) - g_signal_connect (gallery->priv->monitor, "changed", G_CALLBACK (picture_gallery_dir_changed_cb), gallery); + g_signal_connect ( + gallery->priv->monitor, "changed", + G_CALLBACK (picture_gallery_dir_changed_cb), + gallery); } g_object_unref (icon_view); @@ -414,8 +421,7 @@ e_picture_gallery_class_init (EPictureGalleryClass *class) static void e_picture_gallery_init (EPictureGallery *gallery) { - gallery->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - gallery, E_TYPE_PICTURE_GALLERY, EPictureGalleryPrivate); + gallery->priv = E_PICTURE_GALLERY_GET_PRIVATE (gallery); gallery->priv->initialized = FALSE; gallery->priv->monitor = NULL; picture_gallery_set_path (gallery, NULL); diff --git a/widgets/misc/e-popup-action.c b/widgets/misc/e-popup-action.c index 52813c570d..2fd000ccad 100644 --- a/widgets/misc/e-popup-action.c +++ b/widgets/misc/e-popup-action.c @@ -27,6 +27,10 @@ #include <glib/gi18n.h> +#define E_POPUP_ACTION_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_POPUP_ACTION, EPopupActionPrivate)) + enum { PROP_0, PROP_RELATED_ACTION, @@ -197,7 +201,7 @@ popup_action_dispose (GObject *object) { EPopupActionPrivate *priv; - priv = E_POPUP_ACTION (object)->priv; + priv = E_POPUP_ACTION_GET_PRIVATE (object); if (priv->related_action != NULL) { g_signal_handler_disconnect ( @@ -334,8 +338,7 @@ e_popup_action_class_init (EPopupActionClass *class) static void e_popup_action_init (EPopupAction *popup_action) { - popup_action->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - popup_action, E_TYPE_POPUP_ACTION, EPopupActionPrivate); + popup_action->priv = E_POPUP_ACTION_GET_PRIVATE (popup_action); popup_action->priv->use_action_appearance = TRUE; /* Remain invisible until we have a related action. */ diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c index 4d90640796..3bce24371e 100644 --- a/widgets/misc/e-preferences-window.c +++ b/widgets/misc/e-preferences-window.c @@ -31,6 +31,10 @@ #define SWITCH_PAGE_INTERVAL 250 +#define E_PREFERENCES_WINDOW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_PREFERENCES_WINDOW, EPreferencesWindowPrivate)) + struct _EPreferencesWindowPrivate { gboolean setup; gpointer shell; @@ -138,19 +142,25 @@ preferences_window_help_clicked_cb (EPreferencesWindow *window) g_return_if_fail (window != NULL); model = GTK_TREE_MODEL (window->priv->filter); - list = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (window->priv->icon_view)); + list = gtk_icon_view_get_selected_items ( + GTK_ICON_VIEW (window->priv->icon_view)); + if (list != NULL) { gtk_tree_model_get_iter (model, &iter, list->data); gtk_tree_model_get (model, &iter, COLUMN_HELP, &help, -1); + } else if (gtk_tree_model_get_iter_first (model, &iter)) { gint page_index, current_index; - current_index = gtk_notebook_get_current_page (GTK_NOTEBOOK (window->priv->notebook)); + current_index = gtk_notebook_get_current_page ( + GTK_NOTEBOOK (window->priv->notebook)); do { - gtk_tree_model_get (model, &iter, COLUMN_PAGE, &page_index, -1); + gtk_tree_model_get ( + model, &iter, COLUMN_PAGE, &page_index, -1); if (page_index == current_index) { - gtk_tree_model_get (model, &iter, COLUMN_HELP, &help, -1); + gtk_tree_model_get ( + model, &iter, COLUMN_HELP, &help, -1); break; } } while (gtk_tree_model_iter_next (model, &iter)); @@ -194,7 +204,7 @@ preferences_window_dispose (GObject *object) { EPreferencesWindowPrivate *priv; - priv = E_PREFERENCES_WINDOW (object)->priv; + priv = E_PREFERENCES_WINDOW_GET_PRIVATE (object); if (priv->icon_view != NULL) { g_object_unref (priv->icon_view); @@ -222,7 +232,7 @@ preferences_window_finalize (GObject *object) { EPreferencesWindowPrivate *priv; - priv = E_PREFERENCES_WINDOW (object)->priv; + priv = E_PREFERENCES_WINDOW_GET_PRIVATE (object); g_hash_table_destroy (priv->index); @@ -237,7 +247,7 @@ preferences_window_show (GtkWidget *widget) GtkIconView *icon_view; GtkTreePath *path; - priv = E_PREFERENCES_WINDOW (widget)->priv; + priv = E_PREFERENCES_WINDOW_GET_PRIVATE (widget); if (!priv->setup) g_warning ("Preferences window has not been setup correctly"); @@ -287,8 +297,7 @@ e_preferences_window_init (EPreferencesWindow *window) (GDestroyNotify) g_free, (GDestroyNotify) gtk_tree_row_reference_free); - window->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - window, E_TYPE_PREFERENCES_WINDOW, EPreferencesWindowPrivate); + window->priv = E_PREFERENCES_WINDOW_GET_PRIVATE (window); window->priv->index = index; window->priv->filter_view = NULL; @@ -419,7 +428,7 @@ e_preferences_window_add_page (EPreferencesWindow *window, const gchar *page_name, const gchar *icon_name, const gchar *caption, - const gchar *help_target, + const gchar *help_target, EPreferencesWindowCreatePageFn create_fn, gint sort_order) { @@ -546,7 +555,7 @@ e_preferences_window_setup (EPreferencesWindow *window) g_return_if_fail (E_IS_PREFERENCES_WINDOW (window)); - priv = window->priv; + priv = E_PREFERENCES_WINDOW_GET_PRIVATE (window); notebook = GTK_NOTEBOOK (priv->notebook); num = gtk_notebook_get_n_pages (notebook); diff --git a/widgets/misc/e-preview-pane.c b/widgets/misc/e-preview-pane.c index 42f338c75b..f9750c5885 100644 --- a/widgets/misc/e-preview-pane.c +++ b/widgets/misc/e-preview-pane.c @@ -32,6 +32,10 @@ #include "e-alert-bar.h" +#define E_PREVIEW_PANE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_PREVIEW_PANE, EPreviewPanePrivate)) + struct _EPreviewPanePrivate { GtkWidget *alert_bar; GtkWidget *web_view; @@ -118,7 +122,7 @@ preview_pane_dispose (GObject *object) { EPreviewPanePrivate *priv; - priv = E_PREVIEW_PANE (object)->priv; + priv = E_PREVIEW_PANE_GET_PRIVATE (object); if (priv->alert_bar != NULL) { g_object_unref (priv->alert_bar); @@ -145,7 +149,7 @@ preview_pane_constructed (GObject *object) EPreviewPanePrivate *priv; GtkWidget *widget; - priv = E_PREVIEW_PANE (object)->priv; + priv = E_PREVIEW_PANE_GET_PRIVATE (object); widget = e_alert_bar_new (); gtk_box_pack_start (GTK_BOX (object), widget, FALSE, FALSE, 0); @@ -273,8 +277,7 @@ e_preview_pane_alert_sink_init (EAlertSinkInterface *interface) static void e_preview_pane_init (EPreviewPane *preview_pane) { - preview_pane->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - preview_pane, E_TYPE_PREVIEW_PANE, EPreviewPanePrivate); + preview_pane->priv = E_PREVIEW_PANE_GET_PRIVATE (preview_pane); gtk_box_set_spacing (GTK_BOX (preview_pane), 1); } diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c index ada5398523..29c85c5b29 100644 --- a/widgets/misc/e-printable.c +++ b/widgets/misc/e-printable.c @@ -30,7 +30,7 @@ #include "e-printable.h" -#define EP_CLASS(e) ((EPrintableClass *)((GObject *)e)->klass) +#define EP_CLASS(e) ((EPrintableClass *)((GObject *)e)->class) G_DEFINE_TYPE ( EPrintable, @@ -49,9 +49,9 @@ enum { static guint e_printable_signals[LAST_SIGNAL] = { 0, }; static void -e_printable_class_init (EPrintableClass *klass) +e_printable_class_init (EPrintableClass *class) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (class); e_printable_signals[PRINT_PAGE] = g_signal_new ("print_page", @@ -101,11 +101,11 @@ e_printable_class_init (EPrintableClass *klass) G_TYPE_BOOLEAN, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_BOOLEAN); - klass->print_page = NULL; - klass->data_left = NULL; - klass->reset = NULL; - klass->height = NULL; - klass->will_fit = NULL; + class->print_page = NULL; + class->data_left = NULL; + class->reset = NULL; + class->height = NULL; + class->will_fit = NULL; } static void diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index d70106e060..eafb1b6ad4 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -29,6 +29,10 @@ #include <gdk/gdkkeysyms.h> #include <gtkhtml/gtkhtml-search.h> +#define E_SEARCH_BAR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SEARCH_BAR, ESearchBarPrivate)) + struct _ESearchBarPrivate { EWebView *web_view; GtkWidget *entry; @@ -316,7 +320,7 @@ search_bar_dispose (GObject *object) { ESearchBarPrivate *priv; - priv = E_SEARCH_BAR (object)->priv; + priv = E_SEARCH_BAR_GET_PRIVATE (object); if (priv->web_view != NULL) { g_object_unref (priv->web_view); @@ -362,7 +366,7 @@ search_bar_finalize (GObject *object) { ESearchBarPrivate *priv; - priv = E_SEARCH_BAR (object)->priv; + priv = E_SEARCH_BAR_GET_PRIVATE (object); g_free (priv->active_search); @@ -375,7 +379,7 @@ search_bar_constructed (GObject *object) { ESearchBarPrivate *priv; - priv = E_SEARCH_BAR (object)->priv; + priv = E_SEARCH_BAR_GET_PRIVATE (object); g_object_bind_property ( object, "case-sensitive", @@ -537,8 +541,7 @@ e_search_bar_init (ESearchBar *search_bar) GtkWidget *widget; GtkWidget *container; - search_bar->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - search_bar, E_TYPE_SEARCH_BAR, ESearchBarPrivate); + search_bar->priv = E_SEARCH_BAR_GET_PRIVATE (search_bar); search_bar->priv->tokenizer = e_searching_tokenizer_new (); g_signal_connect_swapped ( diff --git a/widgets/misc/e-searching-tokenizer.c b/widgets/misc/e-searching-tokenizer.c index c3a7dfff2e..878efa1654 100644 --- a/widgets/misc/e-searching-tokenizer.c +++ b/widgets/misc/e-searching-tokenizer.c @@ -37,6 +37,10 @@ #define d(x) +#define E_SEARCHING_TOKENIZER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SEARCHING_TOKENIZER, ESearchingTokenizerPrivate)) + enum { MATCH_SIGNAL, LAST_SIGNAL @@ -969,7 +973,7 @@ searching_tokenizer_finalize (GObject *object) { ESearchingTokenizerPrivate *priv; - priv = E_SEARCHING_TOKENIZER (object)->priv; + priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (object); search_info_free (priv->primary); search_info_free (priv->secondary); @@ -987,7 +991,7 @@ searching_tokenizer_begin (HTMLTokenizer *tokenizer, { ESearchingTokenizerPrivate *priv; - priv = E_SEARCHING_TOKENIZER (tokenizer)->priv; + priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer); /* reset search */ if (priv->engine != NULL) { @@ -1011,7 +1015,7 @@ searching_tokenizer_peek_token (HTMLTokenizer *tokenizer) { ESearchingTokenizerPrivate *priv; - priv = E_SEARCHING_TOKENIZER (tokenizer)->priv; + priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer); if (priv->engine != NULL) return searcher_peek_token (priv->engine); @@ -1028,7 +1032,7 @@ searching_tokenizer_next_token (HTMLTokenizer *tokenizer) gint oldmatched; gchar *token; - priv = E_SEARCHING_TOKENIZER (tokenizer)->priv; + priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer); /* If no search is active, just use the default method. */ if (priv->engine == NULL) @@ -1054,7 +1058,7 @@ searching_tokenizer_has_more (HTMLTokenizer *tokenizer) { ESearchingTokenizerPrivate *priv; - priv = E_SEARCHING_TOKENIZER (tokenizer)->priv; + priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer); return (priv->engine != NULL && searcher_pending (priv->engine)) || HTML_TOKENIZER_CLASS (e_searching_tokenizer_parent_class)-> @@ -1112,9 +1116,7 @@ e_searching_tokenizer_class_init (ESearchingTokenizerClass *class) static void e_searching_tokenizer_init (ESearchingTokenizer *tokenizer) { - tokenizer->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - tokenizer, E_TYPE_SEARCHING_TOKENIZER, - ESearchingTokenizerPrivate); + tokenizer->priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer); tokenizer->priv->primary = search_info_new (); search_info_set_flags ( diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c index d744111bb4..71990f1bd3 100644 --- a/widgets/misc/e-selection-model-array.c +++ b/widgets/misc/e-selection-model-array.c @@ -588,13 +588,13 @@ e_selection_model_array_init (ESelectionModelArray *esma) } static void -e_selection_model_array_class_init (ESelectionModelArrayClass *klass) +e_selection_model_array_class_init (ESelectionModelArrayClass *class) { GObjectClass *object_class; ESelectionModelClass *esm_class; - object_class = G_OBJECT_CLASS (klass); - esm_class = E_SELECTION_MODEL_CLASS (klass); + object_class = G_OBJECT_CLASS (class); + esm_class = E_SELECTION_MODEL_CLASS (class); object_class->dispose = esma_dispose; object_class->get_property = esma_get_property; @@ -618,7 +618,7 @@ e_selection_model_array_class_init (ESelectionModelArrayClass *klass) esm_class->move_selection_end = esma_move_selection_end; esm_class->set_selection_end = esma_set_selection_end; - klass->get_row_count = NULL; + class->get_row_count = NULL; g_object_class_install_property (object_class, PROP_CURSOR_ROW, g_param_spec_int ("cursor_row", diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c index 2af95a4080..54507d22e5 100644 --- a/widgets/misc/e-send-options.c +++ b/widgets/misc/e-send-options.c @@ -36,6 +36,10 @@ #include "e-dateedit.h" #include "e-send-options.h" +#define E_SEND_OPTIONS_DIALOG_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SEND_OPTIONS_DIALOG, ESendOptionsDialogPrivate)) + struct _ESendOptionsDialogPrivate { GtkBuilder *builder; @@ -404,16 +408,30 @@ init_widgets (ESendOptionsDialog *sod) priv = sod->priv; - g_signal_connect (priv->expiration, "toggled", G_CALLBACK (expiration_toggled_cb), sod); - g_signal_connect (priv->reply_request, "toggled", G_CALLBACK (reply_request_toggled_cb), sod); - g_signal_connect (priv->delay_delivery, "toggled", G_CALLBACK (delay_delivery_toggled_cb), sod); - g_signal_connect (priv->create_sent, "toggled", G_CALLBACK (sent_item_toggled_cb), sod); - - g_signal_connect (GTK_DIALOG (priv->main), "response", G_CALLBACK(e_send_options_cb), sod); - g_signal_connect (priv->delay_until, "changed", G_CALLBACK (delay_until_date_changed_cb), sod); + g_signal_connect ( + priv->expiration, "toggled", + G_CALLBACK (expiration_toggled_cb), sod); + g_signal_connect ( + priv->reply_request, "toggled", + G_CALLBACK (reply_request_toggled_cb), sod); + g_signal_connect ( + priv->delay_delivery, "toggled", + G_CALLBACK (delay_delivery_toggled_cb), sod); + g_signal_connect ( + priv->create_sent, "toggled", + G_CALLBACK (sent_item_toggled_cb), sod); + + g_signal_connect ( + priv->main, "response", + G_CALLBACK (e_send_options_cb), sod); + g_signal_connect ( + priv->delay_until, "changed", + G_CALLBACK (delay_until_date_changed_cb), sod); if (priv->global) - g_signal_connect (priv->notebook, "switch-page", G_CALLBACK (page_changed_cb), sod); + g_signal_connect ( + priv->notebook, "switch-page", + G_CALLBACK (page_changed_cb), sod); } @@ -571,7 +589,7 @@ e_send_options_dialog_new (void) { ESendOptionsDialog *sod; - sod = g_object_new (E_TYPE_SENDOPTIONS_DIALOG, NULL); + sod = g_object_new (E_TYPE_SEND_OPTIONS_DIALOG, NULL); return sod; } @@ -580,7 +598,7 @@ void e_send_options_set_need_general_options (ESendOptionsDialog *sod, gboolean needed) { - g_return_if_fail (E_IS_SENDOPTIONS_DIALOG (sod)); + g_return_if_fail (E_IS_SEND_OPTIONS_DIALOG (sod)); sod->priv->gopts_needed = needed; } @@ -588,7 +606,7 @@ e_send_options_set_need_general_options (ESendOptionsDialog *sod, gboolean e_send_options_get_need_general_options (ESendOptionsDialog *sod) { - g_return_val_if_fail (E_IS_SENDOPTIONS_DIALOG (sod), FALSE); + g_return_val_if_fail (E_IS_SEND_OPTIONS_DIALOG (sod), FALSE); return sod->priv->gopts_needed; } @@ -597,7 +615,7 @@ gboolean e_send_options_set_global (ESendOptionsDialog *sod, gboolean set) { - g_return_val_if_fail (E_IS_SENDOPTIONS_DIALOG (sod), FALSE); + g_return_val_if_fail (E_IS_SEND_OPTIONS_DIALOG (sod), FALSE); sod->priv->global = set; @@ -641,7 +659,7 @@ e_send_options_dialog_run (ESendOptionsDialog *sod, ESendOptionsDialogPrivate *priv; GtkWidget *toplevel; - g_return_val_if_fail (sod != NULL || E_IS_SENDOPTIONS_DIALOG (sod), FALSE); + g_return_val_if_fail (sod != NULL || E_IS_SEND_OPTIONS_DIALOG (sod), FALSE); priv = sod->priv; @@ -683,59 +701,30 @@ e_send_options_dialog_run (ESendOptionsDialog *sod, static void e_send_options_dialog_finalize (GObject *object) { - ESendOptionsDialog *sod = (ESendOptionsDialog *) object; - ESendOptionsDialogPrivate *priv; + ESendOptionsDialog *sod; - g_return_if_fail (E_IS_SENDOPTIONS_DIALOG (sod)); - priv = sod->priv; + sod = E_SEND_OPTIONS_DIALOG (object); - g_free (priv->help_section); + g_free (sod->priv->help_section); - if (sod->data->gopts) { - g_free (sod->data->gopts); - sod->data->gopts = NULL; - } + g_free (sod->data->gopts); - if (!priv->global && sod->data->sopts) { + if (!sod->priv->global) g_free (sod->data->sopts); - sod->data->sopts = NULL; - } - if (sod->data->mopts) { - g_free (sod->data->mopts); - sod->data->mopts = NULL; - } - - if (sod->data->copts) { - g_free (sod->data->copts); - sod->data->copts = NULL; - } - - if (sod->data->topts) { - g_free (sod->data->topts); - sod->data->topts = NULL; - } - - if (sod->data) { - g_free (sod->data); - sod->data = NULL; - } - - if (sod->priv) { - g_free (sod->priv); - sod->priv = NULL; - } + g_free (sod->data->mopts); + g_free (sod->data->copts); + g_free (sod->data->topts); + g_free (sod->data); /* Chain up to parent's finalize() method. */ G_OBJECT_CLASS (e_send_options_dialog_parent_class)->finalize (object); - } /* Object initialization function for the task page */ static void e_send_options_dialog_init (ESendOptionsDialog *sod) { - ESendOptionsDialogPrivate *priv; ESendOptionsData *new; new = g_new0 (ESendOptionsData, 1); @@ -744,45 +733,14 @@ e_send_options_dialog_init (ESendOptionsDialog *sod) new->mopts = g_new0 (ESendOptionsStatusTracking, 1); new->copts = g_new0 (ESendOptionsStatusTracking, 1); new->topts = g_new0 (ESendOptionsStatusTracking, 1); - priv = g_new0 (ESendOptionsDialogPrivate, 1); - sod->priv = priv; + sod->priv = E_SEND_OPTIONS_DIALOG_GET_PRIVATE (sod); + sod->data = new; sod->data->initialized = FALSE; sod->data->gopts->security = 0; - priv->gopts_needed = TRUE; - priv->builder = NULL; - - priv->main = NULL; - priv->notebook = NULL; - priv->priority = NULL; - priv->status = NULL; - priv->security = NULL; - priv->reply_request = NULL; - priv->reply_convenient = NULL; - priv->within_days = NULL; - priv->delay_delivery = NULL; - priv->delay_until = NULL; - priv->expiration = NULL; - priv->expire_after = NULL; - priv->create_sent = NULL; - priv->delivered =NULL; - priv->delivered_opened = NULL; - priv->global = FALSE; - priv->all_info = NULL; - priv->when_opened = NULL; - priv->when_declined = NULL; - priv->when_accepted = NULL; - priv->when_completed = NULL; - priv->security_label = NULL; - priv->priority_label = NULL; - priv->opened_label = NULL; - priv->gopts_label = NULL; - priv-> declined_label = NULL; - priv->accepted_label = NULL; - priv->completed_label = NULL; - + sod->priv->gopts_needed = TRUE; } /* Class initialization function for the Send Options */ @@ -791,16 +749,19 @@ e_send_options_dialog_class_init (ESendOptionsDialogClass *class) { GObjectClass *object_class; + g_type_class_add_private (class, sizeof (ESendOptionsDialogPrivate)); + object_class = G_OBJECT_CLASS (class); object_class->finalize = e_send_options_dialog_finalize; - signals[SOD_RESPONSE] = g_signal_new ("sod_response", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ESendOptionsDialogClass, sod_response), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, - G_TYPE_INT); + signals[SOD_RESPONSE] = g_signal_new ( + "sod_response", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ESendOptionsDialogClass, sod_response), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); } diff --git a/widgets/misc/e-send-options.h b/widgets/misc/e-send-options.h index 2e25974dc3..2e8ef1d381 100644 --- a/widgets/misc/e-send-options.h +++ b/widgets/misc/e-send-options.h @@ -21,17 +21,17 @@ * */ -#ifndef __E_SENDOPTIONS_DIALOG_H__ -#define __E_SENDOPTIONS_DIALOG_H__ +#ifndef __E_SEND_OPTIONS_DIALOG_H__ +#define __E_SEND_OPTIONS_DIALOG_H__ #include <gtk/gtk.h> #include <time.h> -#define E_TYPE_SENDOPTIONS_DIALOG (e_send_options_dialog_get_type ()) -#define E_SENDOPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SENDOPTIONS_DIALOG, ESendOptionsDialog)) -#define E_SENDOPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SENDOPTIONS_DIALOG, ESendOptionsDialogClass)) -#define E_IS_SENDOPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SENDOPTIONS_DIALOG)) -#define E_IS_SENDOPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SENDOPTIONS_DIALOG)) +#define E_TYPE_SEND_OPTIONS_DIALOG (e_send_options_dialog_get_type ()) +#define E_SEND_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SEND_OPTIONS_DIALOG, ESendOptionsDialog)) +#define E_SEND_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SEND_OPTIONS_DIALOG, ESendOptionsDialogClass)) +#define E_IS_SEND_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SEND_OPTIONS_DIALOG)) +#define E_IS_SEND_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SEND_OPTIONS_DIALOG)) typedef struct _ESendOptionsDialog ESendOptionsDialog; typedef struct _ESendOptionsDialogClass ESendOptionsDialogClass; diff --git a/widgets/misc/e-signature-combo-box.c b/widgets/misc/e-signature-combo-box.c index 9f3b6d9f99..e24cb14b7a 100644 --- a/widgets/misc/e-signature-combo-box.c +++ b/widgets/misc/e-signature-combo-box.c @@ -27,6 +27,10 @@ #include <glib/gi18n-lib.h> +#define E_SIGNATURE_COMBO_BOX_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SIGNATURE_COMBO_BOX, ESignatureComboBoxPrivate)) + enum { COLUMN_STRING, COLUMN_SIGNATURE @@ -158,7 +162,7 @@ signature_combo_box_dispose (GObject *object) { ESignatureComboBoxPrivate *priv; - priv = E_SIGNATURE_COMBO_BOX (object)->priv; + priv = E_SIGNATURE_COMBO_BOX_GET_PRIVATE (object); if (priv->signature_list != NULL) { g_signal_handlers_disconnect_by_func ( @@ -179,7 +183,7 @@ signature_combo_box_finalize (GObject *object) { ESignatureComboBoxPrivate *priv; - priv = E_SIGNATURE_COMBO_BOX (object)->priv; + priv = E_SIGNATURE_COMBO_BOX_GET_PRIVATE (object); g_hash_table_destroy (priv->index); @@ -219,9 +223,7 @@ e_signature_combo_box_init (ESignatureComboBox *combo_box) (GDestroyNotify) g_object_unref, (GDestroyNotify) gtk_tree_row_reference_free); - combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - combo_box, E_TYPE_SIGNATURE_COMBO_BOX, - ESignatureComboBoxPrivate); + combo_box->priv = E_SIGNATURE_COMBO_BOX_GET_PRIVATE (combo_box); combo_box->priv->index = index; } @@ -250,7 +252,7 @@ e_signature_combo_box_set_signature_list (ESignatureComboBox *combo_box, if (signature_list != NULL) g_return_if_fail (E_IS_SIGNATURE_LIST (signature_list)); - priv = combo_box->priv; + priv = E_SIGNATURE_COMBO_BOX_GET_PRIVATE (combo_box); if (priv->signature_list != NULL) { g_signal_handlers_disconnect_by_func ( diff --git a/widgets/misc/e-signature-editor.c b/widgets/misc/e-signature-editor.c index d968debe8f..ef5466d1d1 100644 --- a/widgets/misc/e-signature-editor.c +++ b/widgets/misc/e-signature-editor.c @@ -33,6 +33,10 @@ #include <libemail-utils/e-signature-utils.h> #include <misc/e-web-view.h> +#define E_SIGNATURE_EDITOR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SIGNATURE_EDITOR, ESignatureEditorPrivate)) + enum { PROP_0, PROP_FOCUS_TRACKER, @@ -283,7 +287,7 @@ signature_editor_dispose (GObject *object) { ESignatureEditorPrivate *priv; - priv = E_SIGNATURE_EDITOR (object)->priv; + priv = E_SIGNATURE_EDITOR_GET_PRIVATE (object); if (priv->action_group != NULL) { g_object_unref (priv->action_group); @@ -314,7 +318,7 @@ signature_editor_finalize (GObject *object) { ESignatureEditorPrivate *priv; - priv = E_SIGNATURE_EDITOR (object)->priv; + priv = E_SIGNATURE_EDITOR_GET_PRIVATE (object); g_free (priv->original_name); @@ -400,8 +404,7 @@ e_signature_editor_init (ESignatureEditor *editor) GtkWidget *vbox; GError *error = NULL; - editor->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - editor, E_TYPE_SIGNATURE_EDITOR, ESignatureEditorPrivate); + editor->priv = E_SIGNATURE_EDITOR_GET_PRIVATE (editor); vbox = GTKHTML_EDITOR (editor)->vbox; gtkhtml_editor = GTKHTML_EDITOR (editor); diff --git a/widgets/misc/e-signature-manager.c b/widgets/misc/e-signature-manager.c index 9e62c02d6c..eb68dd251d 100644 --- a/widgets/misc/e-signature-manager.c +++ b/widgets/misc/e-signature-manager.c @@ -31,6 +31,10 @@ #include "e-signature-tree-view.h" #include "e-signature-script-dialog.h" +#define E_SIGNATURE_MANAGER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SIGNATURE_MANAGER, ESignatureManagerPrivate)) + struct _ESignatureManagerPrivate { ESignatureList *signature_list; @@ -234,7 +238,7 @@ signature_manager_dispose (GObject *object) { ESignatureManagerPrivate *priv; - priv = E_SIGNATURE_MANAGER (object)->priv; + priv = E_SIGNATURE_MANAGER_GET_PRIVATE (object); if (priv->signature_list != NULL) { g_object_unref (priv->signature_list); @@ -526,8 +530,7 @@ e_signature_manager_init (ESignatureManager *manager) GtkWidget *container; GtkWidget *widget; - manager->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - manager, E_TYPE_SIGNATURE_MANAGER, ESignatureManagerPrivate); + manager->priv = E_SIGNATURE_MANAGER_GET_PRIVATE (manager); gtk_table_resize (GTK_TABLE (manager), 1, 2); gtk_table_set_col_spacings (GTK_TABLE (manager), 6); diff --git a/widgets/misc/e-signature-preview.c b/widgets/misc/e-signature-preview.c index 6de03c0881..75b19328c0 100644 --- a/widgets/misc/e-signature-preview.c +++ b/widgets/misc/e-signature-preview.c @@ -32,6 +32,10 @@ #include <libemail-utils/e-signature-utils.h> +#define E_SIGNATURE_PREVIEW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SIGNATURE_PREVIEW, ESignaturePreviewPrivate)) + enum { PROP_0, PROP_DISABLE_COMMAND_LINE, @@ -108,7 +112,7 @@ signature_preview_dispose (GObject *object) { ESignaturePreviewPrivate *priv; - priv = E_SIGNATURE_PREVIEW (object)->priv; + priv = E_SIGNATURE_PREVIEW_GET_PRIVATE (object); if (priv->signature != NULL) { g_object_unref (priv->signature); @@ -239,8 +243,7 @@ e_signature_preview_class_init (ESignaturePreviewClass *class) static void e_signature_preview_init (ESignaturePreview *preview) { - preview->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - preview, E_TYPE_SIGNATURE_PREVIEW, ESignaturePreviewPrivate); + preview->priv = E_SIGNATURE_PREVIEW_GET_PRIVATE (preview); } GtkWidget * diff --git a/widgets/misc/e-signature-script-dialog.c b/widgets/misc/e-signature-script-dialog.c index f864f823c6..20eef7ec15 100644 --- a/widgets/misc/e-signature-script-dialog.c +++ b/widgets/misc/e-signature-script-dialog.c @@ -27,6 +27,10 @@ #include <glib/gi18n.h> +#define E_SIGNATURE_SCRIPT_DIALOG_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SIGNATURE_SCRIPT_DIALOG, ESignatureScriptDialogPrivate)) + struct _ESignatureScriptDialogPrivate { GtkWidget *entry; GtkWidget *file_chooser; @@ -144,7 +148,7 @@ signature_script_dialog_dispose (GObject *object) { ESignatureScriptDialogPrivate *priv; - priv = E_SIGNATURE_SCRIPT_DIALOG (object)->priv; + priv = E_SIGNATURE_SCRIPT_DIALOG_GET_PRIVATE (object); if (priv->entry != NULL) { g_object_unref (priv->entry); @@ -230,9 +234,7 @@ e_signature_script_dialog_init (ESignatureScriptDialog *dialog) GtkWidget *widget; gchar *markup; - dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - dialog, E_TYPE_SIGNATURE_SCRIPT_DIALOG, - ESignatureScriptDialogPrivate); + dialog->priv = E_SIGNATURE_SCRIPT_DIALOG_GET_PRIVATE (dialog); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); diff --git a/widgets/misc/e-signature-tree-view.c b/widgets/misc/e-signature-tree-view.c index 62a923d8b9..5631c62949 100644 --- a/widgets/misc/e-signature-tree-view.c +++ b/widgets/misc/e-signature-tree-view.c @@ -25,6 +25,10 @@ #include "e-signature-tree-view.h" +#define E_SIGNATURE_TREE_VIEW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SIGNATURE_TREE_VIEW, ESignatureTreeViewPrivate)) + enum { COLUMN_STRING, COLUMN_SIGNATURE @@ -217,7 +221,7 @@ signature_tree_view_dispose (GObject *object) { ESignatureTreeViewPrivate *priv; - priv = E_SIGNATURE_TREE_VIEW (object)->priv; + priv = E_SIGNATURE_TREE_VIEW_GET_PRIVATE (object); if (priv->signature_list != NULL) { g_signal_handlers_disconnect_by_func ( @@ -238,7 +242,7 @@ signature_tree_view_finalize (GObject *object) { ESignatureTreeViewPrivate *priv; - priv = E_SIGNATURE_TREE_VIEW (object)->priv; + priv = E_SIGNATURE_TREE_VIEW_GET_PRIVATE (object); g_hash_table_destroy (priv->index); @@ -302,9 +306,7 @@ e_signature_tree_view_init (ESignatureTreeView *tree_view) (GDestroyNotify) g_object_unref, (GDestroyNotify) gtk_tree_row_reference_free); - tree_view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - tree_view, E_TYPE_SIGNATURE_TREE_VIEW, - ESignatureTreeViewPrivate); + tree_view->priv = E_SIGNATURE_TREE_VIEW_GET_PRIVATE (tree_view); tree_view->priv->index = index; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); @@ -340,7 +342,7 @@ e_signature_tree_view_set_signature_list (ESignatureTreeView *tree_view, if (signature_list != NULL) g_return_if_fail (E_IS_SIGNATURE_LIST (signature_list)); - priv = tree_view->priv; + priv = E_SIGNATURE_TREE_VIEW_GET_PRIVATE (tree_view); if (priv->signature_list != NULL) { g_signal_handlers_disconnect_by_func ( diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c index c59cf0739c..68b8a8fac0 100644 --- a/widgets/misc/e-url-entry.c +++ b/widgets/misc/e-url-entry.c @@ -29,13 +29,15 @@ #include "e-url-entry.h" #include "e-util/e-util.h" +#define E_URL_ENTRY_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_URL_ENTRY, EUrlEntryPrivate)) + struct _EUrlEntryPrivate { GtkWidget *entry; GtkWidget *button; }; -static void finalize (GObject *object); - static void button_clicked_cb (GtkWidget *widget, gpointer data); static void entry_changed_cb (GtkEditable *editable, gpointer data); @@ -49,11 +51,9 @@ G_DEFINE_TYPE ( static void e_url_entry_class_init (EUrlEntryClass *class) { - GObjectClass *object_class; GtkWidgetClass *widget_class; - object_class = G_OBJECT_CLASS (class); - object_class->finalize = finalize; + g_type_class_add_private (class, sizeof (EUrlEntryPrivate)); widget_class = GTK_WIDGET_CLASS (class); widget_class->mnemonic_activate = mnemonic_activate; @@ -62,46 +62,33 @@ e_url_entry_class_init (EUrlEntryClass *class) static void e_url_entry_init (EUrlEntry *url_entry) { - EUrlEntryPrivate *priv; GtkWidget *pixmap; - priv = g_new0 (EUrlEntryPrivate, 1); - url_entry->priv = priv; + url_entry->priv = E_URL_ENTRY_GET_PRIVATE (url_entry); - priv->entry = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (url_entry), priv->entry, TRUE, TRUE, 0); - priv->button = gtk_button_new (); - gtk_widget_set_sensitive (priv->button, FALSE); - gtk_box_pack_start (GTK_BOX (url_entry), priv->button, FALSE, FALSE, 0); + url_entry->priv->entry = gtk_entry_new (); + gtk_box_pack_start ( + GTK_BOX (url_entry), url_entry->priv->entry, TRUE, TRUE, 0); + url_entry->priv->button = gtk_button_new (); + gtk_widget_set_sensitive (url_entry->priv->button, FALSE); + gtk_box_pack_start ( + GTK_BOX (url_entry), url_entry->priv->button, FALSE, FALSE, 0); atk_object_set_name ( - gtk_widget_get_accessible (priv->button), + gtk_widget_get_accessible (url_entry->priv->button), _("Click here to go to URL")); pixmap = gtk_image_new_from_icon_name ("go-jump", GTK_ICON_SIZE_BUTTON); - gtk_container_add (GTK_CONTAINER (priv->button), pixmap); + gtk_container_add (GTK_CONTAINER (url_entry->priv->button), pixmap); gtk_widget_show (pixmap); - gtk_widget_show (priv->button); - gtk_widget_show (priv->entry); - - g_signal_connect (priv->button, "clicked", - G_CALLBACK (button_clicked_cb), url_entry); - g_signal_connect (priv->entry, "changed", - G_CALLBACK (entry_changed_cb), url_entry); -} - -static void -finalize (GObject *object) -{ - EUrlEntry *url_entry; - - url_entry = E_URL_ENTRY (object); - if (url_entry->priv) { - g_free (url_entry->priv); - url_entry->priv = NULL; - } + gtk_widget_show (url_entry->priv->button); + gtk_widget_show (url_entry->priv->entry); - /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (e_url_entry_parent_class)->finalize (object); + g_signal_connect ( + url_entry->priv->button, "clicked", + G_CALLBACK (button_clicked_cb), url_entry); + g_signal_connect ( + url_entry->priv->entry, "changed", + G_CALLBACK (entry_changed_cb), url_entry); } /* GtkWidget::mnemonic_activate() handler for the EUrlEntry */ diff --git a/widgets/misc/e-web-view-preview.c b/widgets/misc/e-web-view-preview.c index 12270da0b7..b75814fa83 100644 --- a/widgets/misc/e-web-view-preview.c +++ b/widgets/misc/e-web-view-preview.c @@ -28,6 +28,10 @@ #include <string.h> #include <glib/gi18n-lib.h> +#define E_WEB_VIEW_PREVIEW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_WEB_VIEW_PREVIEW, EWebViewPreviewPrivate)) + struct _EWebViewPreviewPrivate { gboolean escape_values; GString *updating_content; /* is NULL when not between begin_update/end_update */ @@ -96,7 +100,7 @@ web_view_preview_dispose (GObject *object) { EWebViewPreviewPrivate *priv; - priv = E_WEB_VIEW_PREVIEW (object)->priv; + priv = E_WEB_VIEW_PREVIEW_GET_PRIVATE (object); if (priv->updating_content != NULL) { g_string_free (priv->updating_content, TRUE); @@ -172,8 +176,7 @@ e_web_view_preview_init (EWebViewPreview *preview) { GtkWidget *tree_view_sw, *web_view_sw; - preview->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - preview, E_TYPE_WEB_VIEW_PREVIEW, EWebViewPreviewPrivate); + preview->priv = E_WEB_VIEW_PREVIEW_GET_PRIVATE (preview); preview->priv->escape_values = TRUE; tree_view_sw = in_scrolled_window (gtk_tree_view_new ()); diff --git a/widgets/misc/ea-calendar-item.c b/widgets/misc/ea-calendar-item.c index 98a715eacf..a483460226 100644 --- a/widgets/misc/ea-calendar-item.c +++ b/widgets/misc/ea-calendar-item.c @@ -38,7 +38,7 @@ #define EA_CALENDAR_COLUMN_NUM E_CALENDAR_COLS_PER_MONTH /* EaCalendarItem */ -static void ea_calendar_item_class_init (EaCalendarItemClass *klass); +static void ea_calendar_item_class_init (EaCalendarItemClass *class); static void ea_calendar_item_finalize (GObject *object); static const gchar * ea_calendar_item_get_name (AtkObject *accessible); @@ -240,12 +240,12 @@ ea_calendar_item_new (GObject *obj) n_ea_calendar_item_created); #endif /* connect signal handlers */ - g_signal_connect (obj, "selection_preview_changed", - G_CALLBACK (selection_preview_change_cb), - atk_object); - g_signal_connect (obj, "date_range_changed", - G_CALLBACK (date_range_changed_cb), - atk_object); + g_signal_connect ( + obj, "selection_preview_changed", + G_CALLBACK (selection_preview_change_cb), atk_object); + g_signal_connect ( + obj, "date_range_changed", + G_CALLBACK (date_range_changed_cb), atk_object); return atk_object; } diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 7a4d2f8954..c6d1a8eee6 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -69,18 +69,21 @@ main (gint argc, gtk_window_set_resizable (GTK_WINDOW (window), TRUE); gtk_container_set_border_width (GTK_CONTAINER (window), 8); - g_signal_connect (window, "delete_event", - G_CALLBACK (delete_event_cb), NULL); + g_signal_connect ( + window, "delete_event", + G_CALLBACK (delete_event_cb), NULL); cal = e_calendar_new (); e_calendar_set_minimum_size (E_CALENDAR (cal), 1, 1); calitem = E_CALENDAR (cal)->calitem; gtk_widget_show (cal); - g_signal_connect (calitem, "date_range_changed", - G_CALLBACK (on_date_range_changed), NULL); - g_signal_connect (calitem, "selection_changed", - G_CALLBACK (on_selection_changed), NULL); + g_signal_connect ( + calitem, "date_range_changed", + G_CALLBACK (on_date_range_changed), NULL); + g_signal_connect ( + calitem, "selection_changed", + G_CALLBACK (on_selection_changed), NULL); gtk_drag_dest_set (cal, GTK_DEST_DEFAULT_ALL, diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c index 2629fad4e0..46c853cea6 100644 --- a/widgets/misc/test-dateedit.c +++ b/widgets/misc/test-dateedit.c @@ -65,8 +65,9 @@ main (gint argc, gtk_window_set_resizable (GTK_WINDOW (window), TRUE); gtk_container_set_border_width (GTK_CONTAINER (window), 8); - g_signal_connect (window, "delete_event", - G_CALLBACK (delete_event_cb), window); + g_signal_connect ( + window, "delete_event", + G_CALLBACK (delete_event_cb), window); table = gtk_table_new (3, 3, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 4); @@ -82,21 +83,25 @@ main (gint argc, gtk_widget_show (GTK_WIDGET (dedit)); #if 0 - g_signal_connect (dedit, "date_changed", - G_CALLBACK (on_date_changed), (gpointer) "1"); - g_signal_connect (dedit, "time_changed", - G_CALLBACK (on_time_changed), (gpointer) "1"); + g_signal_connect ( + dedit, "date_changed", + G_CALLBACK (on_date_changed), (gpointer) "1"); + g_signal_connect ( + dedit, "time_changed", + G_CALLBACK (on_time_changed), (gpointer) "1"); #else - g_signal_connect (dedit, "changed", - G_CALLBACK (on_changed), (gpointer) "1"); + g_signal_connect ( + dedit, "changed", + G_CALLBACK (on_changed), (gpointer) "1"); #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_widget_show (button); - g_signal_connect ((button), "clicked", - G_CALLBACK (on_get_date_clicked), dedit); + g_signal_connect ( + button, "clicked", + G_CALLBACK (on_get_date_clicked), dedit); /* EDateEdit 2. */ dedit = E_DATE_EDIT (e_date_edit_new ()); @@ -110,21 +115,25 @@ main (gint argc, e_date_edit_set_show_time (dedit, FALSE); #if 0 - g_signal_connect (dedit, "date_changed", - G_CALLBACK (on_date_changed), (gpointer) "2"); - g_signal_connect (dedit, "time_changed", - G_CALLBACK (on_time_changed), (gpointer) "2"); + g_signal_connect ( + dedit, "date_changed", + G_CALLBACK (on_date_changed), (gpointer) "2"); + g_signal_connect ( + dedit, "time_changed", + G_CALLBACK (on_time_changed), (gpointer) "2"); #else - g_signal_connect (dedit, "changed", - G_CALLBACK (on_changed), (gpointer) "2"); + g_signal_connect ( + dedit, "changed", + G_CALLBACK (on_changed), (gpointer) "2"); #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_widget_show (button); - g_signal_connect (button, "clicked", - G_CALLBACK (on_get_date_clicked), dedit); + g_signal_connect ( + button, "clicked", + G_CALLBACK (on_get_date_clicked), dedit); /* EDateEdit 3. */ dedit = E_DATE_EDIT (e_date_edit_new ()); @@ -138,28 +147,33 @@ main (gint argc, e_date_edit_set_allow_no_date_set (dedit, TRUE); #if 0 - g_signal_connect (dedit, "date_changed", - G_CALLBACK (on_date_changed), (gpointer) "3"); - g_signal_connect (dedit, "time_changed", - G_CALLBACK (on_time_changed), (gpointer) "3"); + g_signal_connect ( + dedit, "date_changed", + G_CALLBACK (on_date_changed), (gpointer) "3"); + g_signal_connect ( + dedit, "time_changed", + G_CALLBACK (on_time_changed), (gpointer) "3"); #else - g_signal_connect (dedit, "changed", - G_CALLBACK (on_changed), (gpointer) "3"); + g_signal_connect ( + dedit, "changed", + G_CALLBACK (on_changed), (gpointer) "3"); #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_widget_show (button); - g_signal_connect (button, "clicked", - G_CALLBACK (on_get_date_clicked), dedit); + 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_widget_show (button); - g_signal_connect (button, "clicked", - G_CALLBACK (on_toggle_24_hour_clicked), dedit); + g_signal_connect ( + button, "clicked", + G_CALLBACK (on_toggle_24_hour_clicked), dedit); gtk_widget_show (window); |