diff options
author | Milan Crha <mcrha@redhat.com> | 2011-02-25 23:20:41 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-02-25 23:20:41 +0800 |
commit | 1301cf02efdacd20fb5ce3e2554ae15b8f146e8a (patch) | |
tree | 8d5f3985a82ec7d330af27ee0a29a79a2f0ecfa3 /modules | |
parent | 1a4be6c521d674c4a60e54203521e2721b81b921 (diff) | |
download | gsoc2013-evolution-1301cf02efdacd20fb5ce3e2554ae15b8f146e8a.tar.gz gsoc2013-evolution-1301cf02efdacd20fb5ce3e2554ae15b8f146e8a.tar.zst gsoc2013-evolution-1301cf02efdacd20fb5ce3e2554ae15b8f146e8a.zip |
Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
Diffstat (limited to 'modules')
33 files changed, 103 insertions, 227 deletions
diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c index 02d16d640b..b76764c81d 100644 --- a/modules/addressbook/e-book-shell-backend.c +++ b/modules/addressbook/e-book-shell-backend.c @@ -54,10 +54,6 @@ #include "smime/gui/certificate-manager.h" #endif -#define E_BOOK_SHELL_BACKEND_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_BOOK_SHELL_BACKEND, EBookShellBackendPrivate)) - struct _EBookShellBackendPrivate { ESourceList *source_list; }; @@ -85,7 +81,7 @@ book_shell_backend_ensure_sources (EShellBackend *shell_backend) on_this_computer = NULL; personal = NULL; - priv = E_BOOK_SHELL_BACKEND_GET_PRIVATE (shell_backend); + priv = E_BOOK_SHELL_BACKEND (shell_backend)->priv; if (!e_book_get_addressbooks (&priv->source_list, NULL)) { g_warning ("Could not get addressbook sources from GConf!"); @@ -458,7 +454,7 @@ book_shell_backend_dispose (GObject *object) { EBookShellBackendPrivate *priv; - priv = E_BOOK_SHELL_BACKEND_GET_PRIVATE (object); + priv = E_BOOK_SHELL_BACKEND (object)->priv; if (priv->source_list != NULL) { g_object_unref (priv->source_list); @@ -553,8 +549,7 @@ book_shell_backend_class_init (EBookShellBackendClass *class) static void book_shell_backend_init (EBookShellBackend *book_shell_backend) { - book_shell_backend->priv = - E_BOOK_SHELL_BACKEND_GET_PRIVATE (book_shell_backend); + book_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (book_shell_backend, E_TYPE_BOOK_SHELL_BACKEND, EBookShellBackendPrivate); } GType diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index b4bd8d2ac3..2077510056 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -30,10 +30,6 @@ #include "widgets/misc/e-preview-pane.h" #include "e-book-shell-view.h" -#define E_BOOK_SHELL_CONTENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_BOOK_SHELL_CONTENT, EBookShellContentPrivate)) - struct _EBookShellContentPrivate { GtkWidget *paned; GtkWidget *notebook; @@ -84,7 +80,7 @@ book_shell_content_restore_state_cb (EShellWindow *shell_window, GObject *object; const gchar *key; - priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (shell_content); + priv = E_BOOK_SHELL_CONTENT (shell_content)->priv; /* Bind GObject properties to GConf keys. */ @@ -193,7 +189,7 @@ book_shell_content_dispose (GObject *object) { EBookShellContentPrivate *priv; - priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_BOOK_SHELL_CONTENT (object)->priv; if (priv->paned != NULL) { g_object_unref (priv->paned); @@ -226,7 +222,7 @@ book_shell_content_constructed (GObject *object) GtkWidget *container; GtkWidget *widget; - priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_BOOK_SHELL_CONTENT (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -456,8 +452,7 @@ book_shell_content_class_init (EBookShellContentClass *class) static void book_shell_content_init (EBookShellContent *book_shell_content) { - book_shell_content->priv = - E_BOOK_SHELL_CONTENT_GET_PRIVATE (book_shell_content); + book_shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE (book_shell_content, E_TYPE_BOOK_SHELL_CONTENT, EBookShellContentPrivate); /* Postpone widget construction until we have a shell view. */ } diff --git a/modules/addressbook/e-book-shell-sidebar.c b/modules/addressbook/e-book-shell-sidebar.c index 3c61f5e55d..57f3b288df 100644 --- a/modules/addressbook/e-book-shell-sidebar.c +++ b/modules/addressbook/e-book-shell-sidebar.c @@ -30,10 +30,6 @@ #include "e-book-shell-backend.h" #include "e-addressbook-selector.h" -#define E_BOOK_SHELL_SIDEBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_BOOK_SHELL_SIDEBAR, EBookShellSidebarPrivate)) - struct _EBookShellSidebarPrivate { GtkWidget *selector; }; @@ -68,7 +64,7 @@ book_shell_sidebar_dispose (GObject *object) { EBookShellSidebarPrivate *priv; - priv = E_BOOK_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_BOOK_SHELL_SIDEBAR (object)->priv; if (priv->selector != NULL) { g_object_unref (priv->selector); @@ -92,7 +88,7 @@ book_shell_sidebar_constructed (GObject *object) GtkContainer *container; GtkWidget *widget; - priv = E_BOOK_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_BOOK_SHELL_SIDEBAR (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -204,8 +200,7 @@ book_shell_sidebar_class_init (EBookShellSidebarClass *class) static void book_shell_sidebar_init (EBookShellSidebar *book_shell_sidebar) { - book_shell_sidebar->priv = - E_BOOK_SHELL_SIDEBAR_GET_PRIVATE (book_shell_sidebar); + book_shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (book_shell_sidebar, E_TYPE_BOOK_SHELL_SIDEBAR, EBookShellSidebarPrivate); /* Postpone widget construction until we have a shell view. */ } diff --git a/modules/addressbook/e-book-shell-view-private.h b/modules/addressbook/e-book-shell-view-private.h index 7c2a2721f1..528a34d282 100644 --- a/modules/addressbook/e-book-shell-view-private.h +++ b/modules/addressbook/e-book-shell-view-private.h @@ -55,10 +55,6 @@ #include "e-book-shell-sidebar.h" #include "e-book-shell-view-actions.h" -#define E_BOOK_SHELL_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_BOOK_SHELL_VIEW, EBookShellViewPrivate)) - /* Shorthand, requires a variable named "shell_window". */ #define ACTION(name) \ (E_SHELL_WINDOW_ACTION_##name (shell_window)) diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c index 8b5d816eaa..777793ad45 100644 --- a/modules/addressbook/e-book-shell-view.c +++ b/modules/addressbook/e-book-shell-view.c @@ -141,7 +141,7 @@ book_shell_view_execute_search (EShellView *shell_view) gchar *search_text = NULL; EFilterRule *advanced_search = NULL; - priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (shell_view); + priv = E_BOOK_SHELL_VIEW (shell_view)->priv; if (priv->search_locked) return; @@ -414,8 +414,7 @@ static void book_shell_view_init (EBookShellView *book_shell_view, EShellViewClass *shell_view_class) { - book_shell_view->priv = - E_BOOK_SHELL_VIEW_GET_PRIVATE (book_shell_view); + book_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (book_shell_view, E_TYPE_BOOK_SHELL_VIEW, EBookShellViewPrivate); e_book_shell_view_private_init (book_shell_view, shell_view_class); } @@ -455,7 +454,7 @@ e_book_shell_view_disable_searching (EBookShellView *book_shell_view) g_return_if_fail (book_shell_view != NULL); g_return_if_fail (E_IS_BOOK_SHELL_VIEW (book_shell_view)); - priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (book_shell_view); + priv = book_shell_view->priv; priv->search_locked++; } @@ -467,7 +466,7 @@ e_book_shell_view_enable_searching (EBookShellView *book_shell_view) g_return_if_fail (book_shell_view != NULL); g_return_if_fail (E_IS_BOOK_SHELL_VIEW (book_shell_view)); - priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (book_shell_view); + priv = book_shell_view->priv; g_return_if_fail (priv->search_locked > 0); priv->search_locked--; diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c index dfc8f58c34..25677877fc 100644 --- a/modules/calendar/e-cal-attachment-handler.c +++ b/modules/calendar/e-cal-attachment-handler.c @@ -29,10 +29,6 @@ #include "calendar/common/authentication.h" -#define E_CAL_ATTACHMENT_HANDLER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_CAL_ATTACHMENT_HANDLER, ECalAttachmentHandlerPrivate)) - typedef struct _ImportContext ImportContext; struct _ECalAttachmentHandlerPrivate { @@ -492,7 +488,7 @@ cal_attachment_handler_class_init (ECalAttachmentHandlerClass *class) static void cal_attachment_handler_init (ECalAttachmentHandler *handler) { - handler->priv = E_CAL_ATTACHMENT_HANDLER_GET_PRIVATE (handler); + handler->priv = G_TYPE_INSTANCE_GET_PRIVATE (handler, E_TYPE_CAL_ATTACHMENT_HANDLER, ECalAttachmentHandlerPrivate); } GType diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 6c80f71965..b9cb894c50 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -51,10 +51,6 @@ #include "e-calendar-preferences.h" -#define E_CAL_SHELL_BACKEND_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_CAL_SHELL_BACKEND, ECalShellBackendPrivate)) - struct _ECalShellBackendPrivate { ESourceList *source_list; }; @@ -707,7 +703,7 @@ cal_shell_backend_dispose (GObject *object) { ECalShellBackendPrivate *priv; - priv = E_CAL_SHELL_BACKEND_GET_PRIVATE (object); + priv = E_CAL_SHELL_BACKEND (object)->priv; if (priv->source_list != NULL) { g_object_unref (priv->source_list); @@ -800,8 +796,7 @@ cal_shell_backend_init (ECalShellBackend *cal_shell_backend) icalarray *builtin_timezones; gint ii; - cal_shell_backend->priv = - E_CAL_SHELL_BACKEND_GET_PRIVATE (cal_shell_backend); + cal_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (cal_shell_backend, E_TYPE_CAL_SHELL_BACKEND, ECalShellBackendPrivate); /* XXX Pre-load all built-in timezones in libical. * diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index e7a082bc05..1fbedd22b1 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -39,10 +39,6 @@ #include "e-cal-shell-view-private.h" -#define E_CAL_SHELL_CONTENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_CAL_SHELL_CONTENT, ECalShellContentPrivate)) - struct _ECalShellContentPrivate { GtkWidget *hpaned; GtkWidget *notebook; @@ -202,7 +198,7 @@ e_cal_shell_content_save_state (ECalShellContent *cal_shell_content) g_return_if_fail (cal_shell_content != NULL); g_return_if_fail (E_IS_CAL_SHELL_CONTENT (cal_shell_content)); - priv = E_CAL_SHELL_CONTENT_GET_PRIVATE (cal_shell_content); + priv = cal_shell_content->priv; if (priv->task_table != NULL) cal_shell_content_save_table_state ( @@ -261,7 +257,7 @@ cal_shell_content_dispose (GObject *object) { ECalShellContentPrivate *priv; - priv = E_CAL_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_CAL_SHELL_CONTENT (object)->priv; if (priv->hpaned != NULL) { g_object_unref (priv->hpaned); @@ -339,7 +335,7 @@ cal_shell_content_constructed (GObject *object) gchar *markup; gint ii; - priv = E_CAL_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_CAL_SHELL_CONTENT (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -545,7 +541,7 @@ cal_shell_content_map (GtkWidget *widget) * callback in GnomeCalendar that requires the date navigator. * Ordinarily we would do this at the end of constructed(), but * that's too soon in this case. (This feels kind of kludgy.) */ - priv = E_CAL_SHELL_CONTENT_GET_PRIVATE (widget); + priv = E_CAL_SHELL_CONTENT (widget)->priv; gal_view_instance_load (priv->view_instance); /* Chain up to parent's map() method. */ @@ -624,8 +620,7 @@ cal_shell_content_class_init (ECalShellContentClass *class) static void cal_shell_content_init (ECalShellContent *cal_shell_content) { - cal_shell_content->priv = - E_CAL_SHELL_CONTENT_GET_PRIVATE (cal_shell_content); + cal_shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE (cal_shell_content, E_TYPE_CAL_SHELL_CONTENT, ECalShellContentPrivate); /* Postpone widget construction until we have a shell view. */ } diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 5227df6bcd..be0a3443e2 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -37,10 +37,6 @@ #include "e-cal-shell-backend.h" #include "e-cal-shell-content.h" -#define E_CAL_SHELL_SIDEBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_CAL_SHELL_SIDEBAR, ECalShellSidebarPrivate)) - struct _ECalShellSidebarPrivate { GtkWidget *paned; GtkWidget *selector; @@ -239,7 +235,7 @@ cal_shell_sidebar_default_loaded_cb (ESource *source, ECal *client; GError *error = NULL; - priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); + priv = E_CAL_SHELL_SIDEBAR (shell_sidebar)->priv; shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_content = e_shell_view_get_shell_content (shell_view); @@ -420,7 +416,7 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window, GObject *object; const gchar *key; - priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); + priv = E_CAL_SHELL_SIDEBAR (shell_sidebar)->priv; shell = e_shell_window_get_shell (shell_window); shell_settings = e_shell_get_shell_settings (shell); @@ -522,7 +518,7 @@ cal_shell_sidebar_dispose (GObject *object) { ECalShellSidebarPrivate *priv; - priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_CAL_SHELL_SIDEBAR (object)->priv; if (priv->paned != NULL) { g_object_unref (priv->paned); @@ -561,7 +557,7 @@ cal_shell_sidebar_finalize (GObject *object) { ECalShellSidebarPrivate *priv; - priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_CAL_SHELL_SIDEBAR (object)->priv; g_hash_table_destroy (priv->client_table); @@ -598,7 +594,7 @@ cal_shell_sidebar_constructed (GObject *object) GtkWidget *widget; AtkObject *a11y; - priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_CAL_SHELL_SIDEBAR (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -848,8 +844,7 @@ cal_shell_sidebar_init (ECalShellSidebar *cal_shell_sidebar) (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref); - cal_shell_sidebar->priv = - E_CAL_SHELL_SIDEBAR_GET_PRIVATE (cal_shell_sidebar); + cal_shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (cal_shell_sidebar, E_TYPE_CAL_SHELL_SIDEBAR, ECalShellSidebarPrivate); cal_shell_sidebar->priv->client_table = client_table; diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 0a20ea2000..61aff5aa5c 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -239,7 +239,7 @@ cal_shell_view_popup_event_cb (EShellView *shell_view, const gchar *widget_path; gint n_selected; - priv = E_CAL_SHELL_VIEW_GET_PRIVATE (shell_view); + priv = E_CAL_SHELL_VIEW (shell_view)->priv; calendar = e_cal_shell_content_get_calendar (priv->cal_shell_content); diff --git a/modules/calendar/e-cal-shell-view-private.h b/modules/calendar/e-cal-shell-view-private.h index d6f37ba7bf..0f9235046c 100644 --- a/modules/calendar/e-cal-shell-view-private.h +++ b/modules/calendar/e-cal-shell-view-private.h @@ -63,10 +63,6 @@ #include "e-cal-shell-sidebar.h" #include "e-cal-shell-view-actions.h" -#define E_CAL_SHELL_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_CAL_SHELL_VIEW, ECalShellViewPrivate)) - /* Shorthand, requires a variable named "shell_window". */ #define ACTION(name) \ (E_SHELL_WINDOW_ACTION_##name (shell_window)) diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c index 1210d2d267..72ce261a6a 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -310,7 +310,7 @@ cal_shell_view_update_actions (EShellView *shell_view) /* Chain up to parent's update_actions() method. */ E_SHELL_VIEW_CLASS (parent_class)->update_actions (shell_view); - priv = E_CAL_SHELL_VIEW_GET_PRIVATE (shell_view); + priv = E_CAL_SHELL_VIEW (shell_view)->priv; shell_window = e_shell_view_get_shell_window (shell_view); shell = e_shell_window_get_shell (shell_window); @@ -517,8 +517,7 @@ static void cal_shell_view_init (ECalShellView *cal_shell_view, EShellViewClass *shell_view_class) { - cal_shell_view->priv = - E_CAL_SHELL_VIEW_GET_PRIVATE (cal_shell_view); + cal_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (cal_shell_view, E_TYPE_CAL_SHELL_VIEW, ECalShellViewPrivate); e_cal_shell_view_private_init (cal_shell_view, shell_view_class); } diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c index d60421c49c..5c02cdd98a 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -41,10 +41,6 @@ #include "e-memo-shell-migrate.h" #include "e-memo-shell-view.h" -#define E_MEMO_SHELL_BACKEND_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MEMO_SHELL_BACKEND, EMemoShellBackendPrivate)) - #define WEB_BASE_URI "webcal://" #define PERSONAL_RELATIVE_URI "system" @@ -489,7 +485,7 @@ memo_shell_backend_dispose (GObject *object) { EMemoShellBackendPrivate *priv; - priv = E_MEMO_SHELL_BACKEND_GET_PRIVATE (object); + priv = E_MEMO_SHELL_BACKEND (object)->priv; if (priv->source_list != NULL) { g_object_unref (priv->source_list); @@ -563,8 +559,7 @@ memo_shell_backend_class_init (EMemoShellBackendClass *class) static void memo_shell_backend_init (EMemoShellBackend *memo_shell_backend) { - memo_shell_backend->priv = - E_MEMO_SHELL_BACKEND_GET_PRIVATE (memo_shell_backend); + memo_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (memo_shell_backend, E_TYPE_MEMO_SHELL_BACKEND, EMemoShellBackendPrivate); } GType diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index a9d299e221..37e96fe47a 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -35,10 +35,6 @@ #include "calendar/gui/e-cal-model-memos.h" #include "calendar/gui/e-memo-table.h" -#define E_MEMO_SHELL_CONTENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MEMO_SHELL_CONTENT, EMemoShellContentPrivate)) - #define E_MEMO_TABLE_DEFAULT_STATE \ "<?xml version=\"1.0\"?>" \ "<ETableState>" \ @@ -277,7 +273,7 @@ memo_shell_content_restore_state_cb (EShellWindow *shell_window, GObject *object; const gchar *key; - priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (shell_content); + priv = E_MEMO_SHELL_CONTENT (shell_content)->priv; /* Bind GObject properties to GConf keys. */ @@ -367,7 +363,7 @@ memo_shell_content_dispose (GObject *object) { EMemoShellContentPrivate *priv; - priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_MEMO_SHELL_CONTENT (object)->priv; if (priv->paned != NULL) { g_object_unref (priv->paned); @@ -403,7 +399,7 @@ memo_shell_content_finalize (GObject *object) { EMemoShellContentPrivate *priv; - priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_MEMO_SHELL_CONTENT (object)->priv; g_free (priv->current_uid); @@ -428,7 +424,7 @@ memo_shell_content_constructed (GObject *object) GtkWidget *widget; gint n_targets; - priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_MEMO_SHELL_CONTENT (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -606,7 +602,7 @@ memo_shell_content_focus_search_results (EShellContent *shell_content) { EMemoShellContentPrivate *priv; - priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (shell_content); + priv = E_MEMO_SHELL_CONTENT (shell_content)->priv; gtk_widget_grab_focus (priv->memo_table); } @@ -659,8 +655,7 @@ memo_shell_content_class_init (EMemoShellContentClass *class) static void memo_shell_content_init (EMemoShellContent *memo_shell_content) { - memo_shell_content->priv = - E_MEMO_SHELL_CONTENT_GET_PRIVATE (memo_shell_content); + memo_shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE (memo_shell_content, E_TYPE_MEMO_SHELL_CONTENT, EMemoShellContentPrivate); /* Postpone widget construction until we have a shell view. */ } diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index b7e52a9095..612b83126b 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -35,10 +35,6 @@ #include "e-memo-shell-backend.h" #include "e-memo-shell-content.h" -#define E_MEMO_SHELL_SIDEBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MEMO_SHELL_SIDEBAR, EMemoShellSidebarPrivate)) - struct _EMemoShellSidebarPrivate { GtkWidget *selector; @@ -234,7 +230,7 @@ memo_shell_sidebar_default_loaded_cb (ESource *source, ECal *client; GError *error = NULL; - priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); + priv = E_MEMO_SHELL_SIDEBAR (shell_sidebar)->priv; shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_content = e_shell_view_get_shell_content (shell_view); @@ -412,7 +408,7 @@ memo_shell_sidebar_restore_state_cb (EShellWindow *shell_window, GtkTreeModel *model; GSList *list, *iter; - priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); + priv = E_MEMO_SHELL_SIDEBAR (shell_sidebar)->priv; shell = e_shell_window_get_shell (shell_window); shell_settings = e_shell_get_shell_settings (shell); @@ -499,7 +495,7 @@ memo_shell_sidebar_dispose (GObject *object) { EMemoShellSidebarPrivate *priv; - priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_MEMO_SHELL_SIDEBAR (object)->priv; if (priv->selector != NULL) { g_object_unref (priv->selector); @@ -528,7 +524,7 @@ memo_shell_sidebar_finalize (GObject *object) { EMemoShellSidebarPrivate *priv; - priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_MEMO_SHELL_SIDEBAR (object)->priv; g_hash_table_destroy (priv->client_table); @@ -549,7 +545,7 @@ memo_shell_sidebar_constructed (GObject *object) GtkWidget *widget; AtkObject *a11y; - priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_MEMO_SHELL_SIDEBAR (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -744,8 +740,7 @@ memo_shell_sidebar_init (EMemoShellSidebar *memo_shell_sidebar) (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref); - memo_shell_sidebar->priv = - E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (memo_shell_sidebar); + memo_shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (memo_shell_sidebar, E_TYPE_MEMO_SHELL_SIDEBAR, EMemoShellSidebarPrivate); memo_shell_sidebar->priv->client_table = client_table; diff --git a/modules/calendar/e-memo-shell-view-private.h b/modules/calendar/e-memo-shell-view-private.h index 0b8867a5b3..0a6a390004 100644 --- a/modules/calendar/e-memo-shell-view-private.h +++ b/modules/calendar/e-memo-shell-view-private.h @@ -50,10 +50,6 @@ #include "e-memo-shell-sidebar.h" #include "e-memo-shell-view-actions.h" -#define E_MEMO_SHELL_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MEMO_SHELL_VIEW, EMemoShellViewPrivate)) - /* Shorthand, requires a variable named "shell_window". */ #define ACTION(name) \ (E_SHELL_WINDOW_ACTION_##name (shell_window)) diff --git a/modules/calendar/e-memo-shell-view.c b/modules/calendar/e-memo-shell-view.c index 219497577c..4cef169ae8 100644 --- a/modules/calendar/e-memo-shell-view.c +++ b/modules/calendar/e-memo-shell-view.c @@ -302,8 +302,7 @@ static void memo_shell_view_init (EMemoShellView *memo_shell_view, EShellViewClass *shell_view_class) { - memo_shell_view->priv = - E_MEMO_SHELL_VIEW_GET_PRIVATE (memo_shell_view); + memo_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (memo_shell_view, E_TYPE_MEMO_SHELL_VIEW, EMemoShellViewPrivate); e_memo_shell_view_private_init (memo_shell_view, shell_view_class); } diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c index a55bd75fcc..9d85dc87b8 100644 --- a/modules/calendar/e-task-shell-backend.c +++ b/modules/calendar/e-task-shell-backend.c @@ -43,10 +43,6 @@ #include "e-task-shell-sidebar.h" #include "e-task-shell-view.h" -#define E_TASK_SHELL_BACKEND_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_TASK_SHELL_BACKEND, ETaskShellBackendPrivate)) - struct _ETaskShellBackendPrivate { ESourceList *source_list; }; @@ -494,7 +490,7 @@ task_shell_backend_dispose (GObject *object) { ETaskShellBackendPrivate *priv; - priv = E_TASK_SHELL_BACKEND_GET_PRIVATE (object); + priv = E_TASK_SHELL_BACKEND (object)->priv; if (priv->source_list != NULL) { g_object_unref (priv->source_list); @@ -568,8 +564,7 @@ task_shell_backend_class_init (ETaskShellBackendClass *class) static void task_shell_backend_init (ETaskShellBackend *task_shell_backend) { - task_shell_backend->priv = - E_TASK_SHELL_BACKEND_GET_PRIVATE (task_shell_backend); + task_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (task_shell_backend, E_TYPE_TASK_SHELL_BACKEND, ETaskShellBackendPrivate); } GType diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 9cc924642c..78680bc307 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -34,10 +34,6 @@ #include "calendar/gui/e-cal-component-preview.h" #include "calendar/gui/e-cal-model-tasks.h" -#define E_TASK_SHELL_CONTENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_TASK_SHELL_CONTENT, ETaskShellContentPrivate)) - #define E_TASK_TABLE_DEFAULT_STATE \ "<?xml version=\"1.0\"?>" \ "<ETableState>" \ @@ -275,7 +271,7 @@ task_shell_content_restore_state_cb (EShellWindow *shell_window, GObject *object; const gchar *key; - priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (shell_content); + priv = E_TASK_SHELL_CONTENT (shell_content)->priv; /* Bind GObject properties to GConf keys. */ @@ -365,7 +361,7 @@ task_shell_content_dispose (GObject *object) { ETaskShellContentPrivate *priv; - priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_TASK_SHELL_CONTENT (object)->priv; if (priv->paned != NULL) { g_object_unref (priv->paned); @@ -401,7 +397,7 @@ task_shell_content_finalize (GObject *object) { ETaskShellContentPrivate *priv; - priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_TASK_SHELL_CONTENT (object)->priv; g_free (priv->current_uid); @@ -425,7 +421,7 @@ task_shell_content_constructed (GObject *object) GtkWidget *widget; gint n_targets; - priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_TASK_SHELL_CONTENT (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -627,7 +623,7 @@ task_shell_content_focus_search_results (EShellContent *shell_content) { ETaskShellContentPrivate *priv; - priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (shell_content); + priv = E_TASK_SHELL_CONTENT (shell_content)->priv; gtk_widget_grab_focus (priv->task_table); } @@ -680,8 +676,7 @@ task_shell_content_class_init (ETaskShellContentClass *class) static void task_shell_content_init (ETaskShellContent *task_shell_content) { - task_shell_content->priv = - E_TASK_SHELL_CONTENT_GET_PRIVATE (task_shell_content); + task_shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE (task_shell_content, E_TYPE_TASK_SHELL_CONTENT, ETaskShellContentPrivate); /* Postpone widget construction until we have a shell view. */ } diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index 62973d2efc..c6f6e1526d 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -35,10 +35,6 @@ #include "e-task-shell-backend.h" #include "e-task-shell-content.h" -#define E_TASK_SHELL_SIDEBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_TASK_SHELL_SIDEBAR, ETaskShellSidebarPrivate)) - struct _ETaskShellSidebarPrivate { GtkWidget *selector; @@ -234,7 +230,7 @@ task_shell_sidebar_default_loaded_cb (ESource *source, ECal *client; GError *error = NULL; - priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); + priv = E_TASK_SHELL_SIDEBAR (shell_sidebar)->priv; shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_content = e_shell_view_get_shell_content (shell_view); @@ -412,7 +408,7 @@ task_shell_sidebar_restore_state_cb (EShellWindow *shell_window, GtkTreeModel *model; GSList *list, *iter; - priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); + priv = E_TASK_SHELL_SIDEBAR (shell_sidebar)->priv; shell = e_shell_window_get_shell (shell_window); shell_settings = e_shell_get_shell_settings (shell); @@ -499,7 +495,7 @@ task_shell_sidebar_dispose (GObject *object) { ETaskShellSidebarPrivate *priv; - priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_TASK_SHELL_SIDEBAR (object)->priv; if (priv->selector != NULL) { g_object_unref (priv->selector); @@ -528,7 +524,7 @@ task_shell_sidebar_finalize (GObject *object) { ETaskShellSidebarPrivate *priv; - priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_TASK_SHELL_SIDEBAR (object)->priv; g_hash_table_destroy (priv->client_table); @@ -549,7 +545,7 @@ task_shell_sidebar_constructed (GObject *object) GtkWidget *widget; AtkObject *a11y; - priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_TASK_SHELL_SIDEBAR (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -744,8 +740,7 @@ task_shell_sidebar_init (ETaskShellSidebar *task_shell_sidebar) (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref); - task_shell_sidebar->priv = - E_TASK_SHELL_SIDEBAR_GET_PRIVATE (task_shell_sidebar); + task_shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (task_shell_sidebar, E_TYPE_TASK_SHELL_SIDEBAR, ETaskShellSidebarPrivate); task_shell_sidebar->priv->client_table = client_table; diff --git a/modules/calendar/e-task-shell-view-private.h b/modules/calendar/e-task-shell-view-private.h index b95c0d5e5b..b7dace83b7 100644 --- a/modules/calendar/e-task-shell-view-private.h +++ b/modules/calendar/e-task-shell-view-private.h @@ -54,10 +54,6 @@ #include "e-task-shell-sidebar.h" #include "e-task-shell-view-actions.h" -#define E_TASK_SHELL_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_TASK_SHELL_VIEW, ETaskShellViewPrivate)) - /* Shorthand, requires a variable named "shell_window". */ #define ACTION(name) \ (E_SHELL_WINDOW_ACTION_##name (shell_window)) diff --git a/modules/calendar/e-task-shell-view.c b/modules/calendar/e-task-shell-view.c index 7b575f84d4..e4b5e03a5b 100644 --- a/modules/calendar/e-task-shell-view.c +++ b/modules/calendar/e-task-shell-view.c @@ -467,8 +467,7 @@ static void task_shell_view_init (ETaskShellView *task_shell_view, EShellViewClass *shell_view_class) { - task_shell_view->priv = - E_TASK_SHELL_VIEW_GET_PRIVATE (task_shell_view); + task_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (task_shell_view, E_TYPE_TASK_SHELL_VIEW, ETaskShellViewPrivate); e_task_shell_view_private_init (task_shell_view, shell_view_class); } diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c index b868c3069d..c2b0cf5460 100644 --- a/modules/mail/e-mail-attachment-handler.c +++ b/modules/mail/e-mail-attachment-handler.c @@ -27,10 +27,6 @@ #include "mail/e-mail-backend.h" #include "mail/em-composer-utils.h" -#define E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_ATTACHMENT_HANDLER, EMailAttachmentHandlerPrivate)) - struct _EMailAttachmentHandlerPrivate { EShell *shell; EMailSession *session; @@ -71,7 +67,7 @@ mail_attachment_handler_forward (GtkAction *action, GList *selected; view = e_attachment_handler_get_view (handler); - priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler); + priv = E_MAIL_ATTACHMENT_HANDLER (handler)->priv; selected = e_attachment_view_get_selected_attachments (view); g_return_if_fail (g_list_length (selected) == 1); @@ -106,7 +102,7 @@ mail_attachment_handler_reply_all (GtkAction *action, GList *selected; view = e_attachment_handler_get_view (handler); - priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler); + priv = E_MAIL_ATTACHMENT_HANDLER (handler)->priv; selected = e_attachment_view_get_selected_attachments (view); g_return_if_fail (g_list_length (selected) == 1); @@ -142,7 +138,7 @@ mail_attachment_handler_reply_sender (GtkAction *action, GList *selected; view = e_attachment_handler_get_view (handler); - priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler); + priv = E_MAIL_ATTACHMENT_HANDLER (handler)->priv; selected = e_attachment_view_get_selected_attachments (view); g_return_if_fail (g_list_length (selected) == 1); @@ -286,7 +282,7 @@ mail_attachment_handler_x_uid_list (EAttachmentView *view, return; store = e_attachment_view_get_store (view); - priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler); + priv = E_MAIL_ATTACHMENT_HANDLER (handler)->priv; parent = gtk_widget_get_toplevel (GTK_WIDGET (view)); parent = gtk_widget_is_toplevel (parent) ? parent : NULL; @@ -453,7 +449,7 @@ mail_attachment_handler_dispose (GObject *object) { EMailAttachmentHandlerPrivate *priv; - priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (object); + priv = E_MAIL_ATTACHMENT_HANDLER (object)->priv; if (priv->shell != NULL) { g_object_unref (priv->shell); @@ -483,7 +479,7 @@ mail_attachment_handler_constructed (GObject *object) GError *error = NULL; handler = E_ATTACHMENT_HANDLER (object); - priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (object); + priv = E_MAIL_ATTACHMENT_HANDLER (object)->priv; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -563,7 +559,7 @@ mail_attachment_handler_class_init (EMailAttachmentHandlerClass *class) static void mail_attachment_handler_init (EMailAttachmentHandler *handler) { - handler->priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler); + handler->priv = G_TYPE_INSTANCE_GET_PRIVATE (handler, E_TYPE_MAIL_ATTACHMENT_HANDLER, EMailAttachmentHandlerPrivate); } GType diff --git a/modules/mail/e-mail-junk-hook.c b/modules/mail/e-mail-junk-hook.c index 24c1ac77fc..5ee982f27f 100644 --- a/modules/mail/e-mail-junk-hook.c +++ b/modules/mail/e-mail-junk-hook.c @@ -31,10 +31,6 @@ #include "mail/e-mail-backend.h" #include "mail/e-mail-session.h" -#define E_MAIL_JUNK_HOOK_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_JUNK_HOOK, EMailJunkHookPrivate)) - struct _EMailJunkHookPrivate { EMJunkInterface interface; }; @@ -195,7 +191,7 @@ mail_junk_hook_finalize (GObject *object) { EMailJunkHookPrivate *priv; - priv = E_MAIL_JUNK_HOOK_GET_PRIVATE (object); + priv = E_MAIL_JUNK_HOOK (object)->priv; g_free (priv->interface.check_junk); g_free (priv->interface.report_junk); @@ -220,7 +216,7 @@ mail_junk_hook_construct (EPluginHook *hook, EMailSession *session; gchar *property; - priv = E_MAIL_JUNK_HOOK_GET_PRIVATE (hook); + priv = E_MAIL_JUNK_HOOK (hook)->priv; /* Chain up to parent's construct() method. */ if (E_PLUGIN_HOOK_CLASS (parent_class)->construct (hook, plugin, node) == -1) @@ -302,7 +298,7 @@ mail_junk_hook_init (EMailJunkHook *mail_junk_hook) { EMJunkInterface *interface; - mail_junk_hook->priv = E_MAIL_JUNK_HOOK_GET_PRIVATE (mail_junk_hook); + mail_junk_hook->priv = G_TYPE_INSTANCE_GET_PRIVATE (mail_junk_hook, E_TYPE_MAIL_JUNK_HOOK, EMailJunkHookPrivate); interface = &mail_junk_hook->priv->interface; interface->camel.get_name = mail_junk_hook_get_name; diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c index d5096c6185..d30dd2efda 100644 --- a/modules/mail/e-mail-shell-backend.c +++ b/modules/mail/e-mail-shell-backend.c @@ -55,10 +55,6 @@ #include "mail-vfolder.h" #include "importers/mail-importer.h" -#define E_MAIL_SHELL_BACKEND_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_SHELL_BACKEND, EMailShellBackendPrivate)) - #define BACKEND_NAME "mail" struct _EMailShellBackendPrivate { @@ -374,7 +370,7 @@ mail_shell_backend_prepare_for_quit_cb (EShell *shell, { EMailShellBackendPrivate *priv; - priv = E_MAIL_SHELL_BACKEND_GET_PRIVATE (shell_backend); + priv = E_MAIL_SHELL_BACKEND (shell_backend)->priv; /* Prevent a sync from starting while trying to shutdown. */ if (priv->mail_sync_source_id > 0) { @@ -535,7 +531,7 @@ mail_shell_backend_start (EShellBackend *shell_backend) gboolean enable_search_folders; const gchar *data_dir; - priv = E_MAIL_SHELL_BACKEND_GET_PRIVATE (shell_backend); + priv = E_MAIL_SHELL_BACKEND (shell_backend)->priv; shell = e_shell_backend_get_shell (shell_backend); shell_settings = e_shell_get_shell_settings (shell); @@ -706,8 +702,7 @@ mail_shell_backend_class_init (EMailShellBackendClass *class) static void mail_shell_backend_init (EMailShellBackend *mail_shell_backend) { - mail_shell_backend->priv = - E_MAIL_SHELL_BACKEND_GET_PRIVATE (mail_shell_backend); + mail_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (mail_shell_backend, E_TYPE_MAIL_SHELL_BACKEND, EMailShellBackendPrivate); } GType diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index 2f7bea3017..d367994086 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -43,10 +43,6 @@ #include "e-mail-shell-backend.h" #include "e-mail-shell-view-actions.h" -#define E_MAIL_SHELL_CONTENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_SHELL_CONTENT, EMailShellContentPrivate)) - struct _EMailShellContentPrivate { EMailView *mail_view; }; @@ -154,7 +150,7 @@ mail_shell_content_dispose (GObject *object) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_MAIL_SHELL_CONTENT (object)->priv; if (priv->mail_view != NULL) { g_object_unref (priv->mail_view); @@ -174,7 +170,7 @@ mail_shell_content_constructed (GObject *object) GtkWidget *container; GtkWidget *widget; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_MAIL_SHELL_CONTENT (object)->priv; /* Chain up to parent's constructed () method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -213,7 +209,7 @@ mail_shell_content_check_state (EShellContent *shell_content) EMailShellContentPrivate *priv; EMailReader *reader; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (shell_content); + priv = E_MAIL_SHELL_CONTENT (shell_content)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -229,7 +225,7 @@ mail_shell_content_focus_search_results (EShellContent *shell_content) GtkWidget *message_list; EMailReader *reader; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (shell_content); + priv = E_MAIL_SHELL_CONTENT (shell_content)->priv; reader = E_MAIL_READER (priv->mail_view); message_list = e_mail_reader_get_message_list (reader); @@ -242,7 +238,7 @@ mail_shell_content_open_selected_mail (EMailReader *reader) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -270,7 +266,7 @@ mail_shell_content_get_alert_sink (EMailReader *reader) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -284,7 +280,7 @@ mail_shell_content_get_backend (EMailReader *reader) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -298,7 +294,7 @@ mail_shell_content_get_formatter (EMailReader *reader) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -312,7 +308,7 @@ mail_shell_content_get_hide_deleted (EMailReader *reader) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -326,7 +322,7 @@ mail_shell_content_get_message_list (EMailReader *reader) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -340,7 +336,7 @@ mail_shell_content_get_popup_menu (EMailReader *reader) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -354,7 +350,7 @@ mail_shell_content_get_window (EMailReader *reader) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -370,7 +366,7 @@ mail_shell_content_set_folder (EMailReader *reader, { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -384,7 +380,7 @@ mail_shell_content_show_search_bar (EMailReader *reader) { EMailShellContentPrivate *priv; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + priv = E_MAIL_SHELL_CONTENT (reader)->priv; /* Forward this to our internal EMailView, which * also implements the EMailReader interface. */ @@ -444,8 +440,7 @@ mail_shell_content_class_init (EMailShellContentClass *class) static void mail_shell_content_init (EMailShellContent *mail_shell_content) { - mail_shell_content->priv = - E_MAIL_SHELL_CONTENT_GET_PRIVATE (mail_shell_content); + mail_shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE (mail_shell_content, E_TYPE_MAIL_SHELL_CONTENT, EMailShellContentPrivate); /* Postpone widget construction until we have a shell view. */ } diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c index 8a3587b1c8..5e5e515a9a 100644 --- a/modules/mail/e-mail-shell-sidebar.c +++ b/modules/mail/e-mail-shell-sidebar.c @@ -25,10 +25,6 @@ #include "mail/e-mail-sidebar.h" #include "mail/em-folder-utils.h" -#define E_MAIL_SHELL_SIDEBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_SHELL_SIDEBAR, EMailShellSidebarPrivate)) - struct _EMailShellSidebarPrivate { GtkWidget *folder_tree; }; @@ -99,7 +95,7 @@ mail_shell_sidebar_dispose (GObject *object) { EMailShellSidebarPrivate *priv; - priv = E_MAIL_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_MAIL_SHELL_SIDEBAR (object)->priv; if (priv->folder_tree != NULL) { g_object_unref (priv->folder_tree); @@ -294,7 +290,7 @@ mail_shell_sidebar_check_state (EShellSidebar *shell_sidebar) EMailShellSidebarPrivate *priv; EMailSidebar *sidebar; - priv = E_MAIL_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); + priv = E_MAIL_SHELL_SIDEBAR (shell_sidebar)->priv; sidebar = E_MAIL_SIDEBAR (priv->folder_tree); return e_mail_sidebar_check_state (sidebar); @@ -336,8 +332,7 @@ mail_shell_sidebar_class_init (EMailShellSidebarClass *class) static void mail_shell_sidebar_init (EMailShellSidebar *mail_shell_sidebar) { - mail_shell_sidebar->priv = - E_MAIL_SHELL_SIDEBAR_GET_PRIVATE (mail_shell_sidebar); + mail_shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (mail_shell_sidebar, E_TYPE_MAIL_SHELL_SIDEBAR, EMailShellSidebarPrivate); /* Postpone widget construction until we have a shell view. */ } diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index d69ba8da3b..08ed7a97e7 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -1537,7 +1537,7 @@ e_mail_shell_view_update_send_receive_menus (EMailShellView *mail_shell_view) g_return_if_fail (E_IS_MAIL_SHELL_VIEW (mail_shell_view)); - priv = E_MAIL_SHELL_VIEW_GET_PRIVATE (mail_shell_view); + priv = mail_shell_view->priv; shell_view = E_SHELL_VIEW (mail_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); diff --git a/modules/mail/e-mail-shell-view-private.h b/modules/mail/e-mail-shell-view-private.h index a3aa3455e4..ac460a7b40 100644 --- a/modules/mail/e-mail-shell-view-private.h +++ b/modules/mail/e-mail-shell-view-private.h @@ -66,10 +66,6 @@ #include "e-mail-shell-sidebar.h" #include "e-mail-shell-view-actions.h" -#define E_MAIL_SHELL_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_MAIL_SHELL_VIEW, EMailShellViewPrivate)) - /* Shorthand, requires a variable named "shell_window". */ #define ACTION(name) \ (E_SHELL_WINDOW_ACTION_##name (shell_window)) diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c index f43b1f3732..c808ea3d7a 100644 --- a/modules/mail/e-mail-shell-view.c +++ b/modules/mail/e-mail-shell-view.c @@ -174,7 +174,7 @@ mail_shell_view_toggled (EShellView *shell_view) const gchar *basename; gboolean view_is_active; - priv = E_MAIL_SHELL_VIEW_GET_PRIVATE (shell_view); + priv = E_MAIL_SHELL_VIEW (shell_view)->priv; shell_window = e_shell_view_get_shell_window (shell_view); ui_manager = e_shell_window_get_ui_manager (shell_window); @@ -243,7 +243,7 @@ mail_shell_view_execute_search (EShellView *shell_view) const gchar *use_tag; gint value; - priv = E_MAIL_SHELL_VIEW_GET_PRIVATE (shell_view); + priv = E_MAIL_SHELL_VIEW (shell_view)->priv; shell_window = e_shell_view_get_shell_window (shell_view); shell_backend = e_shell_view_get_shell_backend (shell_view); @@ -1059,8 +1059,7 @@ static void mail_shell_view_init (EMailShellView *mail_shell_view, EShellViewClass *shell_view_class) { - mail_shell_view->priv = - E_MAIL_SHELL_VIEW_GET_PRIVATE (mail_shell_view); + mail_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (mail_shell_view, E_TYPE_MAIL_SHELL_VIEW, EMailShellViewPrivate); e_mail_shell_view_private_init (mail_shell_view, shell_view_class); } diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c index e309d2c4ba..378207c365 100644 --- a/modules/mail/em-account-prefs.c +++ b/modules/mail/em-account-prefs.c @@ -42,10 +42,6 @@ #include "shell/e-shell.h" #include "capplet/settings/mail-capplet-shell.h" -#define EM_ACCOUNT_PREFS_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), EM_TYPE_ACCOUNT_PREFS, EMAccountPrefsPrivate)) - struct _EMAccountPrefsPrivate { EMailSession *session; gpointer assistant; /* weak pointer */ @@ -162,7 +158,7 @@ account_prefs_dispose (GObject *object) { EMAccountPrefsPrivate *priv; - priv = EM_ACCOUNT_PREFS_GET_PRIVATE (object); + priv = EM_ACCOUNT_PREFS (object)->priv; if (priv->session != NULL) { g_object_unref (priv->session); @@ -192,7 +188,7 @@ account_prefs_add_account (EAccountManager *manager) EMAccountEditor *emae; gpointer parent; - priv = EM_ACCOUNT_PREFS_GET_PRIVATE (manager); + priv = EM_ACCOUNT_PREFS (manager)->priv; if (priv->assistant != NULL) { gtk_window_present (GTK_WINDOW (priv->assistant)); @@ -239,7 +235,7 @@ account_prefs_edit_account (EAccountManager *manager) EAccount *account; gpointer parent; - priv = EM_ACCOUNT_PREFS_GET_PRIVATE (manager); + priv = EM_ACCOUNT_PREFS (manager)->priv; if (priv->editor != NULL) { gtk_window_present (GTK_WINDOW (priv->editor)); @@ -286,7 +282,7 @@ account_prefs_delete_account (EAccountManager *manager) gpointer parent; gint response; - priv = EM_ACCOUNT_PREFS_GET_PRIVATE (manager); + priv = EM_ACCOUNT_PREFS (manager)->priv; account_list = e_account_manager_get_account_list (manager); tree_view = e_account_manager_get_tree_view (manager); @@ -364,7 +360,7 @@ em_account_prefs_init (EMAccountPrefs *prefs) EAccountManager *manager; EAccountTreeView *tree_view; - prefs->priv = EM_ACCOUNT_PREFS_GET_PRIVATE (prefs); + prefs->priv = G_TYPE_INSTANCE_GET_PRIVATE (prefs, EM_TYPE_ACCOUNT_PREFS, EMAccountPrefsPrivate); manager = E_ACCOUNT_MANAGER (prefs); tree_view = e_account_manager_get_tree_view (manager); diff --git a/modules/plugin-mono/e-plugin-mono.c b/modules/plugin-mono/e-plugin-mono.c index e47c9ac29c..8fc3fc02c1 100644 --- a/modules/plugin-mono/e-plugin-mono.c +++ b/modules/plugin-mono/e-plugin-mono.c @@ -34,10 +34,6 @@ #include <mono/metadata/mono-config.h> #include <mono/jit/jit.h> -#define E_PLUGIN_MONO_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_PLUGIN_MONO, EPluginMonoPrivate)) - struct _EPluginMonoPrivate { MonoAssembly *assembly; MonoClass *class; @@ -234,7 +230,7 @@ plugin_mono_init (EPluginMono *plugin_mono) (GDestroyNotify) g_free, (GDestroyNotify) NULL); - plugin_mono->priv = E_PLUGIN_MONO_GET_PRIVATE (plugin_mono); + plugin_mono->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin_mono, E_TYPE_PLUGIN_MONO, EPluginMonoPrivate); plugin_mono->priv->methods = methods; } diff --git a/modules/plugin-python/e-plugin-python.c b/modules/plugin-python/e-plugin-python.c index 1b8057c6b7..2cbee6512f 100644 --- a/modules/plugin-python/e-plugin-python.c +++ b/modules/plugin-python/e-plugin-python.c @@ -28,10 +28,6 @@ #include <sys/types.h> #include <string.h> -#define E_PLUGIN_PYTHON_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_PLUGIN_PYTHON, EPluginPythonPrivate)) - struct _EPluginPythonPrivate { PyObject *pModule; PyObject *pClass; @@ -197,7 +193,7 @@ plugin_python_init (EPluginPython *plugin_python) (GDestroyNotify) g_free, (GDestroyNotify) NULL); - plugin_python->priv = E_PLUGIN_PYTHON_GET_PRIVATE (plugin_python); + plugin_python->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin_python, E_TYPE_PLUGIN_PYTHON, EPluginPythonPrivate); plugin_python->priv->methods = methods; } |