From a01525c9316b13153cb00fa99cdc587e3ce7c350 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 7 Dec 2011 15:25:02 -0500 Subject: Miscellaneous EShellView-related cleanups. --- modules/calendar/e-cal-shell-backend.c | 66 +++++++++----------- modules/calendar/e-cal-shell-backend.h | 2 +- modules/calendar/e-cal-shell-content.c | 74 +++++++++++----------- modules/calendar/e-cal-shell-content.h | 2 +- modules/calendar/e-cal-shell-sidebar.c | 70 ++++++++++----------- modules/calendar/e-cal-shell-sidebar.h | 16 ++--- modules/calendar/e-cal-shell-view-private.c | 10 +-- modules/calendar/e-cal-shell-view-private.h | 4 ++ modules/calendar/e-cal-shell-view.c | 17 +++-- modules/calendar/e-memo-shell-backend.c | 60 ++++++++---------- modules/calendar/e-memo-shell-backend.h | 2 +- modules/calendar/e-memo-shell-content.c | 93 ++++++++++++---------------- modules/calendar/e-memo-shell-content.h | 2 +- modules/calendar/e-memo-shell-sidebar.c | 70 ++++++++++----------- modules/calendar/e-memo-shell-sidebar.h | 18 +++--- modules/calendar/e-memo-shell-view-actions.c | 13 ++-- modules/calendar/e-memo-shell-view-private.h | 4 ++ modules/calendar/e-memo-shell-view.c | 5 +- modules/calendar/e-task-shell-backend.c | 60 ++++++++---------- modules/calendar/e-task-shell-backend.h | 2 +- modules/calendar/e-task-shell-content.c | 93 ++++++++++++---------------- modules/calendar/e-task-shell-content.h | 2 +- modules/calendar/e-task-shell-sidebar.c | 70 ++++++++++----------- modules/calendar/e-task-shell-sidebar.h | 20 +++--- modules/calendar/e-task-shell-view-actions.c | 13 ++-- modules/calendar/e-task-shell-view-private.h | 4 ++ modules/calendar/e-task-shell-view.c | 5 +- modules/calendar/evolution-module-calendar.c | 18 +++--- 28 files changed, 385 insertions(+), 430 deletions(-) (limited to 'modules/calendar') diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 74bc62daa8..6541863b32 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -55,6 +55,10 @@ #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; }; @@ -64,8 +68,10 @@ enum { PROP_SOURCE_LIST }; -static gpointer parent_class; -static GType cal_shell_backend_type; +G_DEFINE_DYNAMIC_TYPE ( + ECalShellBackend, + e_cal_shell_backend, + E_TYPE_SHELL_BACKEND) static void cal_shell_backend_ensure_sources (EShellBackend *shell_backend) @@ -741,7 +747,7 @@ cal_shell_backend_dispose (GObject *object) { ECalShellBackendPrivate *priv; - priv = E_CAL_SHELL_BACKEND (object)->priv; + priv = E_CAL_SHELL_BACKEND_GET_PRIVATE (object); if (priv->source_list != NULL) { g_object_unref (priv->source_list); @@ -749,7 +755,7 @@ cal_shell_backend_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_cal_shell_backend_parent_class)->dispose (object); } static void @@ -790,16 +796,15 @@ cal_shell_backend_constructed (GObject *object) 600); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_cal_shell_backend_parent_class)->constructed (object); } static void -cal_shell_backend_class_init (ECalShellBackendClass *class) +e_cal_shell_backend_class_init (ECalShellBackendClass *class) { GObjectClass *object_class; EShellBackendClass *shell_backend_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (ECalShellBackendPrivate)); object_class = G_OBJECT_CLASS (class); @@ -829,14 +834,18 @@ cal_shell_backend_class_init (ECalShellBackendClass *class) } static void -cal_shell_backend_init (ECalShellBackend *cal_shell_backend) +e_cal_shell_backend_class_finalize (ECalShellBackendClass *class) +{ +} + +static void +e_cal_shell_backend_init (ECalShellBackend *cal_shell_backend) { icalarray *builtin_timezones; gint ii; - cal_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - cal_shell_backend, E_TYPE_CAL_SHELL_BACKEND, - ECalShellBackendPrivate); + cal_shell_backend->priv = + E_CAL_SHELL_BACKEND_GET_PRIVATE (cal_shell_backend); /* XXX Pre-load all built-in timezones in libical. * @@ -862,31 +871,13 @@ cal_shell_backend_init (ECalShellBackend *cal_shell_backend) } } -GType -e_cal_shell_backend_get_type (void) -{ - return cal_shell_backend_type; -} - void -e_cal_shell_backend_register_type (GTypeModule *type_module) +e_cal_shell_backend_type_register (GTypeModule *type_module) { - const GTypeInfo type_info = { - sizeof (ECalShellBackendClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) cal_shell_backend_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (ECalShellBackend), - 0, /* n_preallocs */ - (GInstanceInitFunc) cal_shell_backend_init, - NULL /* value_table */ - }; - - cal_shell_backend_type = g_type_module_register_type ( - type_module, E_TYPE_SHELL_BACKEND, - "ECalShellBackend", &type_info, 0); + /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration + * function, so we have to wrap it with a public function in + * order to register types from a separate compilation unit. */ + e_cal_shell_backend_register_type (type_module); } ESourceList * @@ -915,7 +906,8 @@ e_cal_shell_backend_get_selected_calendars (ECalShellBackend *cal_shell_backend) if (strv != NULL) { for (ii = 0; strv[ii] != NULL; ii++) - selected_calendars = g_slist_append (selected_calendars, g_strdup (strv[ii])); + selected_calendars = g_slist_append ( + selected_calendars, g_strdup (strv[ii])); g_strfreev (strv); } @@ -938,7 +930,9 @@ e_cal_shell_backend_set_selected_calendars (ECalShellBackend *cal_shell_backend, g_ptr_array_add (array, NULL); settings = g_settings_new ("org.gnome.evolution.calendar"); - g_settings_set_strv (settings, "selected-calendars", (const gchar *const *) array->pdata); + g_settings_set_strv ( + settings, "selected-calendars", + (const gchar *const *) array->pdata); g_object_unref (settings); g_ptr_array_free (array, FALSE); diff --git a/modules/calendar/e-cal-shell-backend.h b/modules/calendar/e-cal-shell-backend.h index 32fca7f53b..0907c7edee 100644 --- a/modules/calendar/e-cal-shell-backend.h +++ b/modules/calendar/e-cal-shell-backend.h @@ -60,7 +60,7 @@ struct _ECalShellBackendClass { }; GType e_cal_shell_backend_get_type (void); -void e_cal_shell_backend_register_type +void e_cal_shell_backend_type_register (GTypeModule *type_module); ESourceList * e_cal_shell_backend_get_source_list (ECalShellBackend *cal_shell_backend); diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 5c2d1bd994..faa6422737 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -42,6 +42,10 @@ #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; @@ -69,8 +73,10 @@ typedef enum { FOCUS_OTHER } FocusLocation; -static gpointer parent_class; -static GType cal_shell_content_type; +G_DEFINE_DYNAMIC_TYPE ( + ECalShellContent, + e_cal_shell_content, + E_TYPE_SHELL_CONTENT) static void cal_shell_content_display_view_cb (ECalShellContent *cal_shell_content, @@ -127,7 +133,10 @@ cal_shell_content_notify_view_id_cb (ECalShellContent *cal_shell_content) g_settings_unbind (paned, "hposition"); - g_settings_bind (settings, key, G_OBJECT (paned), "hposition", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, key, + paned, "hposition", + G_SETTINGS_BIND_DEFAULT); g_object_unref (settings); } @@ -254,7 +263,7 @@ cal_shell_content_dispose (GObject *object) { ECalShellContentPrivate *priv; - priv = E_CAL_SHELL_CONTENT (object)->priv; + priv = E_CAL_SHELL_CONTENT_GET_PRIVATE (object); if (priv->hpaned != NULL) { g_object_unref (priv->hpaned); @@ -292,7 +301,7 @@ cal_shell_content_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_cal_shell_content_parent_class)->dispose (object); } static time_t @@ -331,10 +340,10 @@ cal_shell_content_constructed (GObject *object) gchar *markup; gint ii; - priv = E_CAL_SHELL_CONTENT (object)->priv; + priv = E_CAL_SHELL_CONTENT_GET_PRIVATE (object); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_cal_shell_content_parent_class)->constructed (object); shell_content = E_SHELL_CONTENT (object); shell_view = e_shell_content_get_shell_view (shell_content); @@ -515,8 +524,10 @@ cal_shell_content_constructed (GObject *object) settings = g_settings_new ("org.gnome.evolution.calendar"); - object = G_OBJECT (priv->vpaned); - g_settings_bind (settings, "tag-vpane-position", object, "proportion", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "tag-vpane-position", + priv->vpaned, "proportion", + G_SETTINGS_BIND_DEFAULT); g_object_unref (settings); } @@ -538,11 +549,11 @@ 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 (widget)->priv; + priv = E_CAL_SHELL_CONTENT_GET_PRIVATE (widget); gal_view_instance_load (priv->view_instance); /* Chain up to parent's map() method. */ - GTK_WIDGET_CLASS (parent_class)->map (widget); + GTK_WIDGET_CLASS (e_cal_shell_content_parent_class)->map (widget); } static void @@ -562,13 +573,12 @@ cal_shell_content_focus_search_results (EShellContent *shell_content) } static void -cal_shell_content_class_init (ECalShellContentClass *class) +e_cal_shell_content_class_init (ECalShellContentClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; EShellContentClass *shell_content_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (ECalShellContentPrivate)); object_class = G_OBJECT_CLASS (class); @@ -615,40 +625,26 @@ cal_shell_content_class_init (ECalShellContentClass *class) } static void -cal_shell_content_init (ECalShellContent *cal_shell_content) +e_cal_shell_content_class_finalize (ECalShellContentClass *class) { - 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. */ } -GType -e_cal_shell_content_get_type (void) +static void +e_cal_shell_content_init (ECalShellContent *cal_shell_content) { - return cal_shell_content_type; + cal_shell_content->priv = + E_CAL_SHELL_CONTENT_GET_PRIVATE (cal_shell_content); + + /* Postpone widget construction until we have a shell view. */ } void -e_cal_shell_content_register_type (GTypeModule *type_module) +e_cal_shell_content_type_register (GTypeModule *type_module) { - static const GTypeInfo type_info = { - sizeof (ECalShellContentClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) cal_shell_content_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (ECalShellContent), - 0, /* n_preallocs */ - (GInstanceInitFunc) cal_shell_content_init, - NULL /* value_table */ - }; - - cal_shell_content_type = g_type_module_register_type ( - type_module, E_TYPE_SHELL_CONTENT, - "ECalShellContent", &type_info, 0); + /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration + * function, so we have to wrap it with a public function in + * order to register types from a separate compilation unit. */ + e_cal_shell_content_register_type (type_module); } GtkWidget * diff --git a/modules/calendar/e-cal-shell-content.h b/modules/calendar/e-cal-shell-content.h index 9ef66d968d..906fe80bc0 100644 --- a/modules/calendar/e-cal-shell-content.h +++ b/modules/calendar/e-cal-shell-content.h @@ -80,7 +80,7 @@ struct _ECalShellContentClass { }; GType e_cal_shell_content_get_type (void); -void e_cal_shell_content_register_type +void e_cal_shell_content_type_register (GTypeModule *type_module); GtkWidget * e_cal_shell_content_new (EShellView *shell_view); ECalModel * e_cal_shell_content_get_model diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index c73ca8ab77..8b91a4c22c 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -40,6 +40,10 @@ #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; @@ -75,9 +79,12 @@ enum { LAST_SIGNAL }; -static gpointer parent_class; static guint signals[LAST_SIGNAL]; -static GType cal_shell_sidebar_type; + +G_DEFINE_DYNAMIC_TYPE ( + ECalShellSidebar, + e_cal_shell_sidebar, + E_TYPE_SHELL_SIDEBAR) static void cal_shell_sidebar_emit_client_added (ECalShellSidebar *cal_shell_sidebar, @@ -347,7 +354,7 @@ cal_shell_sidebar_default_loaded_cb (GObject *source_object, EClient *client = NULL; GError *error = NULL; - priv = E_CAL_SHELL_SIDEBAR (shell_sidebar)->priv; + priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_content = e_shell_view_get_shell_content (shell_view); @@ -527,7 +534,7 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window, GSList *list, *iter; GObject *object; - priv = E_CAL_SHELL_SIDEBAR (shell_sidebar)->priv; + priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); shell = e_shell_window_get_shell (shell_window); shell_settings = e_shell_get_shell_settings (shell); @@ -630,7 +637,7 @@ cal_shell_sidebar_dispose (GObject *object) { ECalShellSidebarPrivate *priv; - priv = E_CAL_SHELL_SIDEBAR (object)->priv; + priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (object); if (priv->paned != NULL) { g_object_unref (priv->paned); @@ -667,7 +674,7 @@ cal_shell_sidebar_dispose (GObject *object) g_hash_table_remove_all (priv->client_table); /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_cal_shell_sidebar_parent_class)->dispose (object); } static void @@ -675,12 +682,12 @@ cal_shell_sidebar_finalize (GObject *object) { ECalShellSidebarPrivate *priv; - priv = E_CAL_SHELL_SIDEBAR (object)->priv; + priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (object); g_hash_table_destroy (priv->client_table); /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (e_cal_shell_sidebar_parent_class)->finalize (object); } static void @@ -712,10 +719,10 @@ cal_shell_sidebar_constructed (GObject *object) GtkWidget *widget; AtkObject *a11y; - priv = E_CAL_SHELL_SIDEBAR (object)->priv; + priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (object); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_cal_shell_sidebar_parent_class)->constructed (object); shell_sidebar = E_SHELL_SIDEBAR (object); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); @@ -873,12 +880,11 @@ cal_shell_sidebar_client_removed (ECalShellSidebar *cal_shell_sidebar, } static void -cal_shell_sidebar_class_init (ECalShellSidebarClass *class) +e_cal_shell_sidebar_class_init (ECalShellSidebarClass *class) { GObjectClass *object_class; EShellSidebarClass *shell_sidebar_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (ECalShellSidebarPrivate)); object_class = G_OBJECT_CLASS (class); @@ -954,7 +960,12 @@ cal_shell_sidebar_class_init (ECalShellSidebarClass *class) } static void -cal_shell_sidebar_init (ECalShellSidebar *cal_shell_sidebar) +e_cal_shell_sidebar_class_finalize (ECalShellSidebarClass *class) +{ +} + +static void +e_cal_shell_sidebar_init (ECalShellSidebar *cal_shell_sidebar) { GHashTable *client_table; @@ -963,9 +974,8 @@ cal_shell_sidebar_init (ECalShellSidebar *cal_shell_sidebar) (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref); - cal_shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - cal_shell_sidebar, E_TYPE_CAL_SHELL_SIDEBAR, - ECalShellSidebarPrivate); + cal_shell_sidebar->priv = + E_CAL_SHELL_SIDEBAR_GET_PRIVATE (cal_shell_sidebar); cal_shell_sidebar->priv->client_table = client_table; cal_shell_sidebar->priv->loading_clients = g_cancellable_new (); @@ -973,31 +983,13 @@ cal_shell_sidebar_init (ECalShellSidebar *cal_shell_sidebar) /* Postpone widget construction until we have a shell view. */ } -GType -e_cal_shell_sidebar_get_type (void) -{ - return cal_shell_sidebar_type; -} - void -e_cal_shell_sidebar_register_type (GTypeModule *type_module) +e_cal_shell_sidebar_type_register (GTypeModule *type_module) { - static const GTypeInfo type_info = { - sizeof (ECalShellSidebarClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) cal_shell_sidebar_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (ECalShellSidebar), - 0, /* n_preallocs */ - (GInstanceInitFunc) cal_shell_sidebar_init, - NULL /* value_table */ - }; - - cal_shell_sidebar_type = g_type_module_register_type ( - type_module, E_TYPE_SHELL_SIDEBAR, - "ECalShellSidebar", &type_info, 0); + /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration + * function, so we have to wrap it with a public function in + * order to register types from a separate compilation unit. */ + e_cal_shell_sidebar_register_type (type_module); } GtkWidget * diff --git a/modules/calendar/e-cal-shell-sidebar.h b/modules/calendar/e-cal-shell-sidebar.h index 3e4d00a87f..016ade2a7b 100644 --- a/modules/calendar/e-cal-shell-sidebar.h +++ b/modules/calendar/e-cal-shell-sidebar.h @@ -70,16 +70,18 @@ struct _ECalShellSidebarClass { EShellSidebarClass parent_class; /* Signals */ - void (*client_added) (ECalShellSidebar *cal_shell_sidebar, - ECalClient *client); - void (*client_removed) (ECalShellSidebar *cal_shell_sidebar, - ECalClient *client); - void (*status_message) (ECalShellSidebar *cal_shell_sidebar, - const gchar *status_message); + void (*client_added) (ECalShellSidebar *cal_shell_sidebar, + ECalClient *client); + void (*client_removed) + (ECalShellSidebar *cal_shell_sidebar, + ECalClient *client); + void (*status_message) + (ECalShellSidebar *cal_shell_sidebar, + const gchar *status_message); }; GType e_cal_shell_sidebar_get_type (void); -void e_cal_shell_sidebar_register_type +void e_cal_shell_sidebar_type_register (GTypeModule *type_module); GtkWidget * e_cal_shell_sidebar_new (EShellView *shell_view); GList * e_cal_shell_sidebar_get_clients diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index c2f39c5f9b..37cdc0738b 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -249,7 +249,7 @@ cal_shell_view_popup_event_cb (EShellView *shell_view, const gchar *widget_path; gint n_selected; - priv = E_CAL_SHELL_VIEW (shell_view)->priv; + priv = E_CAL_SHELL_VIEW_GET_PRIVATE (shell_view); calendar = e_cal_shell_content_get_calendar (priv->cal_shell_content); @@ -490,10 +490,10 @@ init_timezone_monitors (ECalShellView *view) g_object_unref (file); if (priv->monitors[i]) - g_signal_connect_object (G_OBJECT (priv->monitors[i]), - "changed", - G_CALLBACK (system_timezone_monitor_changed), - view, 0); + g_signal_connect_object ( + priv->monitors[i], "changed", + G_CALLBACK (system_timezone_monitor_changed), + view, 0); } } diff --git a/modules/calendar/e-cal-shell-view-private.h b/modules/calendar/e-cal-shell-view-private.h index 6653632662..27aaca6e9e 100644 --- a/modules/calendar/e-cal-shell-view-private.h +++ b/modules/calendar/e-cal-shell-view-private.h @@ -64,6 +64,10 @@ #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 f644402080..ad3477c5ea 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -171,7 +171,9 @@ cal_shell_view_execute_search (EShellView *shell_view) end = isodate_from_time_t (end_range); temp = g_strdup_printf ( - "(and %s (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\"))", + "(and %s (occur-in-time-range? " + "(make-time \"%s\") " + "(make-time \"%s\") \"%s\"))", query, start, end, default_tzloc); g_free (query); query = temp; @@ -186,7 +188,9 @@ cal_shell_view_execute_search (EShellView *shell_view) end = isodate_from_time_t (end_range); temp = g_strdup_printf ( - "(and %s (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\"))", + "(and %s (occur-in-time-range? " + "(make-time \"%s\") " + "(make-time \"%s\") \"%s\"))", query, start, end, default_tzloc); g_free (query); query = temp; @@ -195,7 +199,8 @@ cal_shell_view_execute_search (EShellView *shell_view) break; case CALENDAR_FILTER_OCCURS_LESS_THAN_5_TIMES: - temp = g_strdup_printf ("(and %s (< (occurrences-count?) 5))", query); + temp = g_strdup_printf ( + "(and %s (< (occurrences-count?) 5))", query); g_free (query); query = temp; break; @@ -334,7 +339,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 (shell_view)->priv; + priv = E_CAL_SHELL_VIEW_GET_PRIVATE (shell_view); shell_window = e_shell_view_get_shell_window (shell_view); shell = e_shell_window_get_shell (shell_window); @@ -543,8 +548,8 @@ static void cal_shell_view_init (ECalShellView *cal_shell_view, EShellViewClass *shell_view_class) { - cal_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - cal_shell_view, E_TYPE_CAL_SHELL_VIEW, ECalShellViewPrivate); + cal_shell_view->priv = + E_CAL_SHELL_VIEW_GET_PRIVATE (cal_shell_view); 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 c83c0fdfd9..93d2084885 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -48,6 +48,10 @@ #define WEB_BASE_URI "webcal://" #define PERSONAL_RELATIVE_URI "system" +#define E_MEMO_SHELL_BACKEND_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_MEMO_SHELL_BACKEND, EMemoShellBackendPrivate)) + struct _EMemoShellBackendPrivate { ESourceList *source_list; }; @@ -57,8 +61,10 @@ enum { PROP_SOURCE_LIST }; -static gpointer parent_class; -static GType memo_shell_backend_type; +G_DEFINE_DYNAMIC_TYPE ( + EMemoShellBackend, + e_memo_shell_backend, + E_TYPE_SHELL_BACKEND) static void memo_shell_backend_ensure_sources (EShellBackend *shell_backend) @@ -527,7 +533,7 @@ memo_shell_backend_dispose (GObject *object) { EMemoShellBackendPrivate *priv; - priv = E_MEMO_SHELL_BACKEND (object)->priv; + priv = E_MEMO_SHELL_BACKEND_GET_PRIVATE (object); if (priv->source_list != NULL) { g_object_unref (priv->source_list); @@ -535,7 +541,7 @@ memo_shell_backend_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_memo_shell_backend_parent_class)->dispose (object); } static void @@ -560,16 +566,15 @@ memo_shell_backend_constructed (GObject *object) shell_backend); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_memo_shell_backend_parent_class)->constructed (object); } static void -memo_shell_backend_class_init (EMemoShellBackendClass *class) +e_memo_shell_backend_class_init (EMemoShellBackendClass *class) { GObjectClass *object_class; EShellBackendClass *shell_backend_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EMemoShellBackendPrivate)); object_class = G_OBJECT_CLASS (class); @@ -599,38 +604,24 @@ memo_shell_backend_class_init (EMemoShellBackendClass *class) } static void -memo_shell_backend_init (EMemoShellBackend *memo_shell_backend) +e_memo_shell_backend_class_finalize (EMemoShellBackendClass *class) { - memo_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - memo_shell_backend, E_TYPE_MEMO_SHELL_BACKEND, - EMemoShellBackendPrivate); } -GType -e_memo_shell_backend_get_type (void) +static void +e_memo_shell_backend_init (EMemoShellBackend *memo_shell_backend) { - return memo_shell_backend_type; + memo_shell_backend->priv = + E_MEMO_SHELL_BACKEND_GET_PRIVATE (memo_shell_backend); } void -e_memo_shell_backend_register_type (GTypeModule *type_module) +e_memo_shell_backend_type_register (GTypeModule *type_module) { - const GTypeInfo type_info = { - sizeof (EMemoShellBackendClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) memo_shell_backend_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EMemoShellBackend), - 0, /* n_preallocs */ - (GInstanceInitFunc) memo_shell_backend_init, - NULL /* value_table */ - }; - - memo_shell_backend_type = g_type_module_register_type ( - type_module, E_TYPE_SHELL_BACKEND, - "EMemoShellBackend", &type_info, 0); + /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration + * function, so we have to wrap it with a public function in + * order to register types from a separate compilation unit. */ + e_memo_shell_backend_register_type (type_module); } ESourceList * @@ -659,7 +650,8 @@ e_memo_shell_backend_get_selected_memo_lists (EMemoShellBackend *memo_shell_back if (strv != NULL) { for (ii = 0; strv[ii] != NULL; ii++) - selected_memo_lists = g_slist_append (selected_memo_lists, g_strdup (strv[ii])); + selected_memo_lists = g_slist_append ( + selected_memo_lists, g_strdup (strv[ii])); g_strfreev (strv); } @@ -682,7 +674,9 @@ e_memo_shell_backend_set_selected_memo_lists (EMemoShellBackend *memo_shell_back g_ptr_array_add (array, NULL); settings = g_settings_new ("org.gnome.evolution.calendar"); - g_settings_set_strv (settings, "selected-memos", (const gchar *const *) array->pdata); + g_settings_set_strv ( + settings, "selected-memos", + (const gchar *const *) array->pdata); g_object_unref (settings); g_ptr_array_free (array, FALSE); diff --git a/modules/calendar/e-memo-shell-backend.h b/modules/calendar/e-memo-shell-backend.h index 8a005c4385..5bf66b37a3 100644 --- a/modules/calendar/e-memo-shell-backend.h +++ b/modules/calendar/e-memo-shell-backend.h @@ -60,7 +60,7 @@ struct _EMemoShellBackendClass { }; GType e_memo_shell_backend_get_type (void); -void e_memo_shell_backend_register_type +void e_memo_shell_backend_type_register (GTypeModule *type_module); ESourceList * e_memo_shell_backend_get_source_list (EMemoShellBackend *memo_shell_backend); diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index 60936ccb8c..528db0911b 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -38,6 +38,10 @@ #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 \ "" \ "" \ @@ -68,8 +72,13 @@ enum { PROP_PREVIEW_VISIBLE }; -static gpointer parent_class; -static GType memo_shell_content_type; +G_DEFINE_DYNAMIC_TYPE_EXTENDED ( + EMemoShellContent, + e_memo_shell_content, + E_TYPE_SHELL_CONTENT, + 0, + G_IMPLEMENT_INTERFACE_DYNAMIC ( + GTK_TYPE_ORIENTABLE, NULL)) static void memo_shell_content_display_view_cb (EMemoShellContent *memo_shell_content, @@ -273,19 +282,22 @@ memo_shell_content_restore_state_cb (EShellWindow *shell_window, { EMemoShellContentPrivate *priv; GSettings *settings; - GObject *object; - priv = E_MEMO_SHELL_CONTENT (shell_content)->priv; + priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (shell_content); /* Bind GObject properties to settings keys. */ settings = g_settings_new ("org.gnome.evolution.calendar"); - object = G_OBJECT (priv->paned); - g_settings_bind (settings, "memo-hpane-position", object, "hposition", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "memo-hpane-position", + priv->paned, "hposition", + G_SETTINGS_BIND_DEFAULT); - object = G_OBJECT (priv->paned); - g_settings_bind (settings, "memo-vpane-position", object, "vposition", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "memo-vpane-position", + priv->paned, "vposition", + G_SETTINGS_BIND_DEFAULT); } static GtkOrientation @@ -363,7 +375,7 @@ memo_shell_content_dispose (GObject *object) { EMemoShellContentPrivate *priv; - priv = E_MEMO_SHELL_CONTENT (object)->priv; + priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object); if (priv->paned != NULL) { g_object_unref (priv->paned); @@ -391,7 +403,7 @@ memo_shell_content_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_memo_shell_content_parent_class)->dispose (object); } static void @@ -399,12 +411,12 @@ memo_shell_content_finalize (GObject *object) { EMemoShellContentPrivate *priv; - priv = E_MEMO_SHELL_CONTENT (object)->priv; + priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object); g_free (priv->current_uid); /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (e_memo_shell_content_parent_class)->finalize (object); } static void @@ -422,10 +434,10 @@ memo_shell_content_constructed (GObject *object) GtkWidget *widget; gint n_targets; - priv = E_MEMO_SHELL_CONTENT (object)->priv; + priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_memo_shell_content_parent_class)->constructed (object); shell_content = E_SHELL_CONTENT (object); shell_view = e_shell_content_get_shell_view (shell_content); @@ -597,18 +609,17 @@ memo_shell_content_focus_search_results (EShellContent *shell_content) { EMemoShellContentPrivate *priv; - priv = E_MEMO_SHELL_CONTENT (shell_content)->priv; + priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (shell_content); gtk_widget_grab_focus (priv->memo_table); } static void -memo_shell_content_class_init (EMemoShellContentClass *class) +e_memo_shell_content_class_init (EMemoShellContentClass *class) { GObjectClass *object_class; EShellContentClass *shell_content_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EMemoShellContentPrivate)); object_class = G_OBJECT_CLASS (class); @@ -649,50 +660,26 @@ memo_shell_content_class_init (EMemoShellContentClass *class) } static void -memo_shell_content_init (EMemoShellContent *memo_shell_content) +e_memo_shell_content_class_finalize (EMemoShellContentClass *class) { - 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. */ } -GType -e_memo_shell_content_get_type (void) +static void +e_memo_shell_content_init (EMemoShellContent *memo_shell_content) { - return memo_shell_content_type; + memo_shell_content->priv = + E_MEMO_SHELL_CONTENT_GET_PRIVATE (memo_shell_content); + + /* Postpone widget construction until we have a shell view. */ } void -e_memo_shell_content_register_type (GTypeModule *type_module) +e_memo_shell_content_type_register (GTypeModule *type_module) { - static const GTypeInfo type_info = { - sizeof (EMemoShellContentClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) memo_shell_content_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EMemoShellContent), - 0, /* n_preallocs */ - (GInstanceInitFunc) memo_shell_content_init, - NULL /* value_table */ - }; - - static const GInterfaceInfo orientable_info = { - (GInterfaceInitFunc) NULL, - (GInterfaceFinalizeFunc) NULL, - NULL /* interface_data */ - }; - - memo_shell_content_type = g_type_module_register_type ( - type_module, E_TYPE_SHELL_CONTENT, - "EMemoShellContent", &type_info, 0); - - g_type_module_add_interface ( - type_module, memo_shell_content_type, - GTK_TYPE_ORIENTABLE, &orientable_info); + /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration + * function, so we have to wrap it with a public function in + * order to register types from a separate compilation unit. */ + e_memo_shell_content_register_type (type_module); } GtkWidget * diff --git a/modules/calendar/e-memo-shell-content.h b/modules/calendar/e-memo-shell-content.h index 3ab68db440..18ee590fc7 100644 --- a/modules/calendar/e-memo-shell-content.h +++ b/modules/calendar/e-memo-shell-content.h @@ -73,7 +73,7 @@ struct _EMemoShellContentClass { }; GType e_memo_shell_content_get_type (void); -void e_memo_shell_content_register_type +void e_memo_shell_content_type_register (GTypeModule *type_module); GtkWidget * e_memo_shell_content_new (EShellView *shell_view); diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index df9ea9a59a..9763a5d9e0 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -39,6 +39,10 @@ #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; @@ -71,9 +75,12 @@ enum { LAST_SIGNAL }; -static gpointer parent_class; static guint signals[LAST_SIGNAL]; -static GType memo_shell_sidebar_type; + +G_DEFINE_DYNAMIC_TYPE ( + EMemoShellSidebar, + e_memo_shell_sidebar, + E_TYPE_SHELL_SIDEBAR) static void memo_shell_sidebar_emit_client_added (EMemoShellSidebar *memo_shell_sidebar, @@ -342,7 +349,7 @@ memo_shell_sidebar_default_loaded_cb (GObject *source_object, EClient *client = NULL; GError *error = NULL; - priv = E_MEMO_SHELL_SIDEBAR (shell_sidebar)->priv; + priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_content = e_shell_view_get_shell_content (shell_view); @@ -520,7 +527,7 @@ memo_shell_sidebar_restore_state_cb (EShellWindow *shell_window, GtkTreeModel *model; GSList *list, *iter; - priv = E_MEMO_SHELL_SIDEBAR (shell_sidebar)->priv; + priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); shell = e_shell_window_get_shell (shell_window); shell_settings = e_shell_get_shell_settings (shell); @@ -607,7 +614,7 @@ memo_shell_sidebar_dispose (GObject *object) { EMemoShellSidebarPrivate *priv; - priv = E_MEMO_SHELL_SIDEBAR (object)->priv; + priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (object); if (priv->selector != NULL) { g_object_unref (priv->selector); @@ -634,7 +641,7 @@ memo_shell_sidebar_dispose (GObject *object) g_hash_table_remove_all (priv->client_table); /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_memo_shell_sidebar_parent_class)->dispose (object); } static void @@ -642,12 +649,12 @@ memo_shell_sidebar_finalize (GObject *object) { EMemoShellSidebarPrivate *priv; - priv = E_MEMO_SHELL_SIDEBAR (object)->priv; + priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (object); g_hash_table_destroy (priv->client_table); /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (e_memo_shell_sidebar_parent_class)->finalize (object); } static void @@ -663,10 +670,10 @@ memo_shell_sidebar_constructed (GObject *object) GtkWidget *widget; AtkObject *a11y; - priv = E_MEMO_SHELL_SIDEBAR (object)->priv; + priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (object); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_memo_shell_sidebar_parent_class)->constructed (object); shell_sidebar = E_SHELL_SIDEBAR (object); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); @@ -778,12 +785,11 @@ memo_shell_sidebar_client_removed (EMemoShellSidebar *memo_shell_sidebar, } static void -memo_shell_sidebar_class_init (EMemoShellSidebarClass *class) +e_memo_shell_sidebar_class_init (EMemoShellSidebarClass *class) { GObjectClass *object_class; EShellSidebarClass *shell_sidebar_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EMemoShellSidebarPrivate)); object_class = G_OBJECT_CLASS (class); @@ -850,7 +856,12 @@ memo_shell_sidebar_class_init (EMemoShellSidebarClass *class) } static void -memo_shell_sidebar_init (EMemoShellSidebar *memo_shell_sidebar) +e_memo_shell_sidebar_class_finalize (EMemoShellSidebarClass *class) +{ +} + +static void +e_memo_shell_sidebar_init (EMemoShellSidebar *memo_shell_sidebar) { GHashTable *client_table; @@ -859,9 +870,8 @@ memo_shell_sidebar_init (EMemoShellSidebar *memo_shell_sidebar) (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref); - memo_shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - memo_shell_sidebar, E_TYPE_MEMO_SHELL_SIDEBAR, - EMemoShellSidebarPrivate); + memo_shell_sidebar->priv = + E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (memo_shell_sidebar); memo_shell_sidebar->priv->client_table = client_table; memo_shell_sidebar->priv->loading_clients = g_cancellable_new (); @@ -869,31 +879,13 @@ memo_shell_sidebar_init (EMemoShellSidebar *memo_shell_sidebar) /* Postpone widget construction until we have a shell view. */ } -GType -e_memo_shell_sidebar_get_type (void) -{ - return memo_shell_sidebar_type; -} - void -e_memo_shell_sidebar_register_type (GTypeModule *type_module) +e_memo_shell_sidebar_type_register (GTypeModule *type_module) { - static const GTypeInfo type_info = { - sizeof (EMemoShellSidebarClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) memo_shell_sidebar_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EMemoShellSidebar), - 0, /* n_preallocs */ - (GInstanceInitFunc) memo_shell_sidebar_init, - NULL /* value_table */ - }; - - memo_shell_sidebar_type = g_type_module_register_type ( - type_module, E_TYPE_SHELL_SIDEBAR, - "EMemoShellSidebar", &type_info, 0); + /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration + * function, so we have to wrap it with a public function in + * order to register types from a separate compilation unit. */ + e_memo_shell_sidebar_register_type (type_module); } GtkWidget * diff --git a/modules/calendar/e-memo-shell-sidebar.h b/modules/calendar/e-memo-shell-sidebar.h index 24e73f11d1..f233aef290 100644 --- a/modules/calendar/e-memo-shell-sidebar.h +++ b/modules/calendar/e-memo-shell-sidebar.h @@ -69,17 +69,19 @@ struct _EMemoShellSidebarClass { EShellSidebarClass parent_class; /* Signals */ - void (*client_added) (EMemoShellSidebar *memo_shell_sidebar, - ECalClient *client); - void (*client_removed) (EMemoShellSidebar *memo_shell_sidebar, - ECalClient *client); - void (*status_message) (EMemoShellSidebar *memo_shell_sidebar, - const gchar *status_message, - gdouble percent); + void (*client_added) (EMemoShellSidebar *memo_shell_sidebar, + ECalClient *client); + void (*client_removed) + (EMemoShellSidebar *memo_shell_sidebar, + ECalClient *client); + void (*status_message) + (EMemoShellSidebar *memo_shell_sidebar, + const gchar *status_message, + gdouble percent); }; GType e_memo_shell_sidebar_get_type (void); -void e_memo_shell_sidebar_register_type +void e_memo_shell_sidebar_type_register (GTypeModule *type_module); GtkWidget * e_memo_shell_sidebar_new (EShellView *shell_view); diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index 3a0874616f..f8715eebb1 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -865,7 +865,6 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) GtkActionGroup *action_group; GSettings *memo_settings; GtkAction *action; - GObject *object; shell_view = E_SHELL_VIEW (memo_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); @@ -925,11 +924,15 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) memo_settings = g_settings_new ("org.gnome.evolution.calendar"); - object = G_OBJECT (ACTION (MEMO_PREVIEW)); - g_settings_bind (memo_settings, "show-memo-preview", object, "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + memo_settings, "show-memo-preview", + ACTION (MEMO_PREVIEW), "active", + G_SETTINGS_BIND_DEFAULT); - object = G_OBJECT (ACTION (MEMO_VIEW_VERTICAL)); - g_settings_bind (memo_settings, "memo-layout", object, "current-value", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + memo_settings, "memo-layout", + ACTION (MEMO_VIEW_VERTICAL), "current-value", + G_SETTINGS_BIND_DEFAULT); g_object_unref (G_OBJECT (memo_settings)); diff --git a/modules/calendar/e-memo-shell-view-private.h b/modules/calendar/e-memo-shell-view-private.h index 444bc0f307..85b2418439 100644 --- a/modules/calendar/e-memo-shell-view-private.h +++ b/modules/calendar/e-memo-shell-view-private.h @@ -49,6 +49,10 @@ #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 6679b3436b..acf95e92f3 100644 --- a/modules/calendar/e-memo-shell-view.c +++ b/modules/calendar/e-memo-shell-view.c @@ -306,9 +306,8 @@ static void memo_shell_view_init (EMemoShellView *memo_shell_view, EShellViewClass *shell_view_class) { - memo_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - memo_shell_view, E_TYPE_MEMO_SHELL_VIEW, - EMemoShellViewPrivate); + memo_shell_view->priv = + E_MEMO_SHELL_VIEW_GET_PRIVATE (memo_shell_view); 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 84500e4427..1bb7ca338f 100644 --- a/modules/calendar/e-task-shell-backend.c +++ b/modules/calendar/e-task-shell-backend.c @@ -47,6 +47,10 @@ #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; }; @@ -56,8 +60,10 @@ enum { PROP_SOURCE_LIST }; -static gpointer parent_class; -static GType task_shell_backend_type; +G_DEFINE_DYNAMIC_TYPE ( + ETaskShellBackend, + e_task_shell_backend, + E_TYPE_SHELL_BACKEND) static void task_shell_backend_ensure_sources (EShellBackend *shell_backend) @@ -532,7 +538,7 @@ task_shell_backend_dispose (GObject *object) { ETaskShellBackendPrivate *priv; - priv = E_TASK_SHELL_BACKEND (object)->priv; + priv = E_TASK_SHELL_BACKEND_GET_PRIVATE (object); if (priv->source_list != NULL) { g_object_unref (priv->source_list); @@ -540,7 +546,7 @@ task_shell_backend_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_task_shell_backend_parent_class)->dispose (object); } static void @@ -565,16 +571,15 @@ task_shell_backend_constructed (GObject *object) shell_backend); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_task_shell_backend_parent_class)->constructed (object); } static void -task_shell_backend_class_init (ETaskShellBackendClass *class) +e_task_shell_backend_class_init (ETaskShellBackendClass *class) { GObjectClass *object_class; EShellBackendClass *shell_backend_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (ETaskShellBackendPrivate)); object_class = G_OBJECT_CLASS (class); @@ -604,38 +609,24 @@ task_shell_backend_class_init (ETaskShellBackendClass *class) } static void -task_shell_backend_init (ETaskShellBackend *task_shell_backend) +e_task_shell_backend_class_finalize (ETaskShellBackendClass *class) { - task_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - task_shell_backend, E_TYPE_TASK_SHELL_BACKEND, - ETaskShellBackendPrivate); } -GType -e_task_shell_backend_get_type (void) +static void +e_task_shell_backend_init (ETaskShellBackend *task_shell_backend) { - return task_shell_backend_type; + task_shell_backend->priv = + E_TASK_SHELL_BACKEND_GET_PRIVATE (task_shell_backend); } void -e_task_shell_backend_register_type (GTypeModule *type_module) +e_task_shell_backend_type_register (GTypeModule *type_module) { - const GTypeInfo type_info = { - sizeof (ETaskShellBackendClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) task_shell_backend_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (ETaskShellBackend), - 0, /* n_preallocs */ - (GInstanceInitFunc) task_shell_backend_init, - NULL /* value_table */ - }; - - task_shell_backend_type = g_type_module_register_type ( - type_module, E_TYPE_SHELL_BACKEND, - "ETaskShellBackend", &type_info, 0); + /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration + * function, so we have to wrap it with a public function in + * order to register types from a separate compilation unit. */ + e_task_shell_backend_register_type (type_module); } ESourceList * @@ -664,7 +655,8 @@ e_task_shell_backend_get_selected_task_lists (ETaskShellBackend *task_shell_back if (strv != NULL) { for (ii = 0; strv[ii] != NULL; ii++) - selected_task_lists = g_slist_append (selected_task_lists, g_strdup (strv[ii])); + selected_task_lists = g_slist_append ( + selected_task_lists, g_strdup (strv[ii])); g_strfreev (strv); } @@ -687,7 +679,9 @@ e_task_shell_backend_set_selected_task_lists (ETaskShellBackend *task_shell_back g_ptr_array_add (array, NULL); settings = g_settings_new ("org.gnome.evolution.calendar"); - g_settings_set_strv (settings, "selected-tasks", (const gchar *const *) array->pdata); + g_settings_set_strv ( + settings, "selected-tasks", + (const gchar *const *) array->pdata); g_object_unref (settings); g_ptr_array_free (array, FALSE); diff --git a/modules/calendar/e-task-shell-backend.h b/modules/calendar/e-task-shell-backend.h index ba56e91dd9..3b489a7ceb 100644 --- a/modules/calendar/e-task-shell-backend.h +++ b/modules/calendar/e-task-shell-backend.h @@ -60,7 +60,7 @@ struct _ETaskShellBackendClass { }; GType e_task_shell_backend_get_type (void); -void e_task_shell_backend_register_type +void e_task_shell_backend_type_register (GTypeModule *type_module); ESourceList * e_task_shell_backend_get_source_list (ETaskShellBackend *task_shell_backend); diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index cb2443f19d..67b1e368b3 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -37,6 +37,10 @@ #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 \ "" \ "" \ @@ -68,8 +72,13 @@ enum { PROP_PREVIEW_VISIBLE }; -static gpointer parent_class; -static GType task_shell_content_type; +G_DEFINE_DYNAMIC_TYPE_EXTENDED ( + ETaskShellContent, + e_task_shell_content, + E_TYPE_SHELL_CONTENT, + 0, + G_IMPLEMENT_INTERFACE_DYNAMIC ( + GTK_TYPE_ORIENTABLE, NULL)) static void task_shell_content_display_view_cb (ETaskShellContent *task_shell_content, @@ -271,19 +280,22 @@ task_shell_content_restore_state_cb (EShellWindow *shell_window, { ETaskShellContentPrivate *priv; GSettings *settings; - GObject *object; - priv = E_TASK_SHELL_CONTENT (shell_content)->priv; + priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (shell_content); /* Bind GObject properties to settings keys. */ settings = g_settings_new ("org.gnome.evolution.calendar"); - object = G_OBJECT (priv->paned); - g_settings_bind (settings, "task-hpane-position", object, "hposition", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "task-hpane-position", + priv->paned, "hposition", + G_SETTINGS_BIND_DEFAULT); - object = G_OBJECT (priv->paned); - g_settings_bind (settings, "task-vpane-position", object, "vposition", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "task-vpane-position", + priv->paned, "vposition", + G_SETTINGS_BIND_DEFAULT); g_object_unref (G_OBJECT (settings)); } @@ -363,7 +375,7 @@ task_shell_content_dispose (GObject *object) { ETaskShellContentPrivate *priv; - priv = E_TASK_SHELL_CONTENT (object)->priv; + priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object); if (priv->paned != NULL) { g_object_unref (priv->paned); @@ -391,7 +403,7 @@ task_shell_content_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_task_shell_content_parent_class)->dispose (object); } static void @@ -399,12 +411,12 @@ task_shell_content_finalize (GObject *object) { ETaskShellContentPrivate *priv; - priv = E_TASK_SHELL_CONTENT (object)->priv; + priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object); g_free (priv->current_uid); /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (e_task_shell_content_parent_class)->finalize (object); } static void @@ -422,10 +434,10 @@ task_shell_content_constructed (GObject *object) GtkWidget *widget; gint n_targets; - priv = E_TASK_SHELL_CONTENT (object)->priv; + priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_task_shell_content_parent_class)->constructed (object); shell_content = E_SHELL_CONTENT (object); shell_view = e_shell_content_get_shell_view (shell_content); @@ -622,18 +634,17 @@ task_shell_content_focus_search_results (EShellContent *shell_content) { ETaskShellContentPrivate *priv; - priv = E_TASK_SHELL_CONTENT (shell_content)->priv; + priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (shell_content); gtk_widget_grab_focus (priv->task_table); } static void -task_shell_content_class_init (ETaskShellContentClass *class) +e_task_shell_content_class_init (ETaskShellContentClass *class) { GObjectClass *object_class; EShellContentClass *shell_content_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (ETaskShellContentPrivate)); object_class = G_OBJECT_CLASS (class); @@ -674,50 +685,26 @@ task_shell_content_class_init (ETaskShellContentClass *class) } static void -task_shell_content_init (ETaskShellContent *task_shell_content) +e_task_shell_content_class_finalize (ETaskShellContentClass *class) { - 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. */ } -GType -e_task_shell_content_get_type (void) +static void +e_task_shell_content_init (ETaskShellContent *task_shell_content) { - return task_shell_content_type; + task_shell_content->priv = + E_TASK_SHELL_CONTENT_GET_PRIVATE (task_shell_content); + + /* Postpone widget construction until we have a shell view. */ } void -e_task_shell_content_register_type (GTypeModule *type_module) +e_task_shell_content_type_register (GTypeModule *type_module) { - static const GTypeInfo type_info = { - sizeof (ETaskShellContentClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) task_shell_content_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (ETaskShellContent), - 0, /* n_preallocs */ - (GInstanceInitFunc) task_shell_content_init, - NULL /* value_table */ - }; - - static const GInterfaceInfo orientable_info = { - (GInterfaceInitFunc) NULL, - (GInterfaceFinalizeFunc) NULL, - NULL /* interface_data */ - }; - - task_shell_content_type = g_type_module_register_type ( - type_module, E_TYPE_SHELL_CONTENT, - "ETaskShellContent", &type_info, 0); - - g_type_module_add_interface ( - type_module, task_shell_content_type, - GTK_TYPE_ORIENTABLE, &orientable_info); + /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration + * function, so we have to wrap it with a public function in + * order to register types from a separate compilation unit. */ + e_task_shell_content_register_type (type_module); } GtkWidget * diff --git a/modules/calendar/e-task-shell-content.h b/modules/calendar/e-task-shell-content.h index eb327afdb7..84a5f675da 100644 --- a/modules/calendar/e-task-shell-content.h +++ b/modules/calendar/e-task-shell-content.h @@ -77,7 +77,7 @@ struct _ETaskShellContentClass { }; GType e_task_shell_content_get_type (void); -void e_task_shell_content_register_type +void e_task_shell_content_type_register (GTypeModule *type_module); GtkWidget * e_task_shell_content_new (EShellView *shell_view); diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index 7987071eb8..1a59112489 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -39,6 +39,10 @@ #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; @@ -71,9 +75,12 @@ enum { LAST_SIGNAL }; -static gpointer parent_class; static guint signals[LAST_SIGNAL]; -static GType task_shell_sidebar_type; + +G_DEFINE_DYNAMIC_TYPE ( + ETaskShellSidebar, + e_task_shell_sidebar, + E_TYPE_SHELL_SIDEBAR) static void task_shell_sidebar_emit_client_added (ETaskShellSidebar *task_shell_sidebar, @@ -342,7 +349,7 @@ task_shell_sidebar_default_loaded_cb (GObject *source_object, EClient *client = NULL; GError *error = NULL; - priv = E_TASK_SHELL_SIDEBAR (shell_sidebar)->priv; + priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_content = e_shell_view_get_shell_content (shell_view); @@ -520,7 +527,7 @@ task_shell_sidebar_restore_state_cb (EShellWindow *shell_window, GtkTreeModel *model; GSList *list, *iter; - priv = E_TASK_SHELL_SIDEBAR (shell_sidebar)->priv; + priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); shell = e_shell_window_get_shell (shell_window); shell_settings = e_shell_get_shell_settings (shell); @@ -607,7 +614,7 @@ task_shell_sidebar_dispose (GObject *object) { ETaskShellSidebarPrivate *priv; - priv = E_TASK_SHELL_SIDEBAR (object)->priv; + priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (object); if (priv->selector != NULL) { g_object_unref (priv->selector); @@ -634,7 +641,7 @@ task_shell_sidebar_dispose (GObject *object) g_hash_table_remove_all (priv->client_table); /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_task_shell_sidebar_parent_class)->dispose (object); } static void @@ -642,12 +649,12 @@ task_shell_sidebar_finalize (GObject *object) { ETaskShellSidebarPrivate *priv; - priv = E_TASK_SHELL_SIDEBAR (object)->priv; + priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (object); g_hash_table_destroy (priv->client_table); /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (e_task_shell_sidebar_parent_class)->finalize (object); } static void @@ -663,10 +670,10 @@ task_shell_sidebar_constructed (GObject *object) GtkWidget *widget; AtkObject *a11y; - priv = E_TASK_SHELL_SIDEBAR (object)->priv; + priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (object); /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (parent_class)->constructed (object); + G_OBJECT_CLASS (e_task_shell_sidebar_parent_class)->constructed (object); shell_sidebar = E_SHELL_SIDEBAR (object); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); @@ -779,12 +786,11 @@ task_shell_sidebar_client_removed (ETaskShellSidebar *task_shell_sidebar, } static void -task_shell_sidebar_class_init (ETaskShellSidebarClass *class) +e_task_shell_sidebar_class_init (ETaskShellSidebarClass *class) { GObjectClass *object_class; EShellSidebarClass *shell_sidebar_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (ETaskShellSidebarPrivate)); object_class = G_OBJECT_CLASS (class); @@ -851,7 +857,12 @@ task_shell_sidebar_class_init (ETaskShellSidebarClass *class) } static void -task_shell_sidebar_init (ETaskShellSidebar *task_shell_sidebar) +e_task_shell_sidebar_class_finalize (ETaskShellSidebarClass *class) +{ +} + +static void +e_task_shell_sidebar_init (ETaskShellSidebar *task_shell_sidebar) { GHashTable *client_table; @@ -860,9 +871,8 @@ task_shell_sidebar_init (ETaskShellSidebar *task_shell_sidebar) (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref); - task_shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - task_shell_sidebar, E_TYPE_TASK_SHELL_SIDEBAR, - ETaskShellSidebarPrivate); + task_shell_sidebar->priv = + E_TASK_SHELL_SIDEBAR_GET_PRIVATE (task_shell_sidebar); task_shell_sidebar->priv->client_table = client_table; task_shell_sidebar->priv->loading_clients = g_cancellable_new (); @@ -870,31 +880,13 @@ task_shell_sidebar_init (ETaskShellSidebar *task_shell_sidebar) /* Postpone widget construction until we have a shell view. */ } -GType -e_task_shell_sidebar_get_type (void) -{ - return task_shell_sidebar_type; -} - void -e_task_shell_sidebar_register_type (GTypeModule *type_module) +e_task_shell_sidebar_type_register (GTypeModule *type_module) { - static const GTypeInfo type_info = { - sizeof (ETaskShellSidebarClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) task_shell_sidebar_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (ETaskShellSidebar), - 0, /* n_preallocs */ - (GInstanceInitFunc) task_shell_sidebar_init, - NULL /* value_table */ - }; - - task_shell_sidebar_type = g_type_module_register_type ( - type_module, E_TYPE_SHELL_SIDEBAR, - "ETaskShellSidebar", &type_info, 0); + /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration + * function, so we have to wrap it with a public function in + * order to register types from a separate compilation unit. */ + e_task_shell_sidebar_register_type (type_module); } GtkWidget * diff --git a/modules/calendar/e-task-shell-sidebar.h b/modules/calendar/e-task-shell-sidebar.h index 24c64cf2af..07b9df38ad 100644 --- a/modules/calendar/e-task-shell-sidebar.h +++ b/modules/calendar/e-task-shell-sidebar.h @@ -69,23 +69,25 @@ struct _ETaskShellSidebarClass { EShellSidebarClass parent_class; /* Signals */ - void (*client_added) (ETaskShellSidebar *task_shell_sidebar, - ECalClient *client); - void (*client_removed) (ETaskShellSidebar *task_shell_sidebar, - ECalClient *client); - void (*status_message) (ETaskShellSidebar *task_shell_sidebar, - const gchar *status_message, - gdouble percent); + void (*client_added) (ETaskShellSidebar *task_shell_sidebar, + ECalClient *client); + void (*client_removed) + (ETaskShellSidebar *task_shell_sidebar, + ECalClient *client); + void (*status_message) + (ETaskShellSidebar *task_shell_sidebar, + const gchar *status_message, + gdouble percent); }; GType e_task_shell_sidebar_get_type (void); -void e_task_shell_sidebar_register_type +void e_task_shell_sidebar_type_register (GTypeModule *type_module); GtkWidget * e_task_shell_sidebar_new (EShellView *shell_view); GList * e_task_shell_sidebar_get_clients (ETaskShellSidebar *task_shell_sidebar); -ECalClient * e_task_shell_sidebar_get_default_client +ECalClient * e_task_shell_sidebar_get_default_client (ETaskShellSidebar *task_shell_sidebar); ESourceSelector * e_task_shell_sidebar_get_selector diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index c7e91d2955..6c13d04354 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -1064,7 +1064,6 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) GtkActionGroup *action_group; GSettings *settings; GtkAction *action; - GObject *object; shell_view = E_SHELL_VIEW (task_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); @@ -1124,11 +1123,15 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) settings = g_settings_new ("org.gnome.evolution.calendar"); - object = G_OBJECT (ACTION (TASK_PREVIEW)); - g_settings_bind (settings, "show-task-preview", object, "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "show-task-preview", + ACTION (TASK_PREVIEW), "active", + G_SETTINGS_BIND_DEFAULT); - object = G_OBJECT (ACTION (TASK_VIEW_VERTICAL)); - g_settings_bind (settings, "task-layout", object, "current-value", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "task-layout", + ACTION (TASK_VIEW_VERTICAL), "current-value", + G_SETTINGS_BIND_DEFAULT); g_object_unref (G_OBJECT (settings)); diff --git a/modules/calendar/e-task-shell-view-private.h b/modules/calendar/e-task-shell-view-private.h index 1903ec58fc..cf890c5c27 100644 --- a/modules/calendar/e-task-shell-view-private.h +++ b/modules/calendar/e-task-shell-view-private.h @@ -53,6 +53,10 @@ #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 21004cc9ec..0654ef3eea 100644 --- a/modules/calendar/e-task-shell-view.c +++ b/modules/calendar/e-task-shell-view.c @@ -471,9 +471,8 @@ static void task_shell_view_init (ETaskShellView *task_shell_view, EShellViewClass *shell_view_class) { - task_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - task_shell_view, E_TYPE_TASK_SHELL_VIEW, - ETaskShellViewPrivate); + task_shell_view->priv = + E_TASK_SHELL_VIEW_GET_PRIVATE (task_shell_view); e_task_shell_view_private_init (task_shell_view, shell_view_class); } diff --git a/modules/calendar/evolution-module-calendar.c b/modules/calendar/evolution-module-calendar.c index ebc11b6117..9b24bf3854 100644 --- a/modules/calendar/evolution-module-calendar.c +++ b/modules/calendar/evolution-module-calendar.c @@ -67,19 +67,19 @@ e_module_load (GTypeModule *type_module) e_cal_config_hook_register_type (type_module); e_cal_event_hook_register_type (type_module); - e_cal_shell_backend_register_type (type_module); - e_cal_shell_content_register_type (type_module); - e_cal_shell_sidebar_register_type (type_module); + e_cal_shell_backend_type_register (type_module); + e_cal_shell_content_type_register (type_module); + e_cal_shell_sidebar_type_register (type_module); e_cal_shell_view_register_type (type_module); - e_memo_shell_backend_register_type (type_module); - e_memo_shell_content_register_type (type_module); - e_memo_shell_sidebar_register_type (type_module); + e_memo_shell_backend_type_register (type_module); + e_memo_shell_content_type_register (type_module); + e_memo_shell_sidebar_type_register (type_module); e_memo_shell_view_register_type (type_module); - e_task_shell_backend_register_type (type_module); - e_task_shell_content_register_type (type_module); - e_task_shell_sidebar_register_type (type_module); + e_task_shell_backend_type_register (type_module); + e_task_shell_content_type_register (type_module); + e_task_shell_sidebar_type_register (type_module); e_task_shell_view_register_type (type_module); e_cal_config_calendar_item_register_type (type_module); -- cgit v1.2.3