aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-11-23 07:22:14 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-11-23 09:43:04 +0800
commite64d6fe05c30c2cc1d7625a202afba3ba2da07cd (patch)
treef99df204ecdd5629acdc9f7e7b00d1c0d7903d6d /shell
parent2e60b6a4a21105bb4a1e2badd1be51b3e684d165 (diff)
downloadgsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.tar
gsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.tar.gz
gsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.tar.bz2
gsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.tar.lz
gsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.tar.xz
gsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.tar.zst
gsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.zip
Miscellaneous cleanups.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-backend.c11
-rw-r--r--shell/e-shell-searchbar.c9
-rw-r--r--shell/e-shell-settings.c17
-rw-r--r--shell/e-shell-sidebar.c17
-rw-r--r--shell/e-shell-switcher.c19
-rw-r--r--shell/e-shell-taskbar.c11
-rw-r--r--shell/e-shell-view.c11
-rw-r--r--shell/e-shell-window-private.h4
-rw-r--r--shell/e-shell-window.c3
9 files changed, 63 insertions, 39 deletions
diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c
index d8af58c6b3..e5700d4b2c 100644
--- a/shell/e-shell-backend.c
+++ b/shell/e-shell-backend.c
@@ -41,6 +41,10 @@
#include "e-shell.h"
#include "e-shell-view.h"
+#define E_SHELL_BACKEND_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_BACKEND, EShellBackendPrivate))
+
struct _EShellBackendPrivate {
/* We keep a reference to corresponding EShellView subclass
@@ -171,7 +175,7 @@ shell_backend_dispose (GObject *object)
{
EShellBackendPrivate *priv;
- priv = E_SHELL_BACKEND (object)->priv;
+ priv = E_SHELL_BACKEND_GET_PRIVATE (object);
if (priv->shell_view_class != NULL) {
g_type_class_unref (priv->shell_view_class);
@@ -187,7 +191,7 @@ shell_backend_finalize (GObject *object)
{
EShellBackendPrivate *priv;
- priv = E_SHELL_BACKEND (object)->priv;
+ priv = E_SHELL_BACKEND_GET_PRIVATE (object);
g_warn_if_fail (g_queue_is_empty (priv->activities));
g_queue_free (priv->activities);
@@ -294,8 +298,7 @@ e_shell_backend_class_init (EShellBackendClass *class)
static void
e_shell_backend_init (EShellBackend *shell_backend)
{
- shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- shell_backend, E_TYPE_SHELL_BACKEND, EShellBackendPrivate);
+ shell_backend->priv = E_SHELL_BACKEND_GET_PRIVATE (shell_backend);
shell_backend->priv->activities = g_queue_new ();
}
diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c
index 370d6b4f5e..ff3f06b403 100644
--- a/shell/e-shell-searchbar.c
+++ b/shell/e-shell-searchbar.c
@@ -39,6 +39,10 @@
#include "e-shell-window-actions.h"
+#define E_SHELL_SEARCHBAR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_SEARCHBAR, EShellSearchbarPrivate))
+
#define SEARCH_OPTION_ADVANCED (-1)
/* Default "state key file" group: [Search Bar] */
@@ -629,7 +633,7 @@ shell_searchbar_dispose (GObject *object)
{
EShellSearchbarPrivate *priv;
- priv = E_SHELL_SEARCHBAR (object)->priv;
+ priv = E_SHELL_SEARCHBAR_GET_PRIVATE (object);
if (priv->shell_view != NULL) {
g_object_remove_weak_pointer (
@@ -911,8 +915,7 @@ e_shell_searchbar_init (EShellSearchbar *searchbar)
GtkLabel *label;
GtkWidget *widget;
- searchbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- searchbar, E_TYPE_SHELL_SEARCHBAR, EShellSearchbarPrivate);
+ searchbar->priv = E_SHELL_SEARCHBAR_GET_PRIVATE (searchbar);
gtk_box_set_spacing (GTK_BOX (searchbar), 24);
diff --git a/shell/e-shell-settings.c b/shell/e-shell-settings.c
index 11d8eca3ad..a46123f325 100644
--- a/shell/e-shell-settings.c
+++ b/shell/e-shell-settings.c
@@ -31,6 +31,10 @@
#include "e-shell-settings.h"
+#define E_SHELL_SETTINGS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_SETTINGS, EShellSettingsPrivate))
+
struct _EShellSettingsPrivate {
GArray *value_array;
guint debug : 1;
@@ -42,7 +46,7 @@ static gpointer parent_class;
static GParamSpec *
shell_settings_pspec_for_key (const gchar *property_name,
- const gchar *schema,
+ const gchar *schema,
const gchar *key)
{
GSettings *settings;
@@ -138,7 +142,7 @@ shell_settings_set_property (GObject *object,
EShellSettingsPrivate *priv;
GValue *dest_value;
- priv = E_SHELL_SETTINGS (object)->priv;
+ priv = E_SHELL_SETTINGS_GET_PRIVATE (object);
dest_value = &g_array_index (
priv->value_array, GValue, property_id - 1);
@@ -166,7 +170,7 @@ shell_settings_get_property (GObject *object,
EShellSettingsPrivate *priv;
GValue *src_value;
- priv = E_SHELL_SETTINGS (object)->priv;
+ priv = E_SHELL_SETTINGS_GET_PRIVATE (object);
src_value = &g_array_index (
priv->value_array, GValue, property_id - 1);
@@ -180,7 +184,7 @@ shell_settings_finalize (GObject *object)
EShellSettingsPrivate *priv;
guint ii;
- priv = E_SHELL_SETTINGS (object)->priv;
+ priv = E_SHELL_SETTINGS_GET_PRIVATE (object);
for (ii = 0; ii < priv->value_array->len; ii++)
g_value_unset (&g_array_index (priv->value_array, GValue, ii));
@@ -218,8 +222,7 @@ shell_settings_init (EShellSettings *shell_settings,
value_array = g_array_new (FALSE, TRUE, sizeof (GValue));
g_array_set_size (value_array, property_count);
- shell_settings->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- shell_settings, E_TYPE_SHELL_SETTINGS, EShellSettingsPrivate);
+ shell_settings->priv = E_SHELL_SETTINGS_GET_PRIVATE (shell_settings);
shell_settings->priv->value_array = value_array;
g_object_freeze_notify (G_OBJECT (shell_settings));
@@ -338,7 +341,7 @@ e_shell_settings_install_property (GParamSpec *pspec)
**/
void
e_shell_settings_install_property_for_key (const gchar *property_name,
- const gchar *schema,
+ const gchar *schema,
const gchar *key)
{
GParamSpec *pspec;
diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c
index 62652dee1f..b7e523f733 100644
--- a/shell/e-shell-sidebar.c
+++ b/shell/e-shell-sidebar.c
@@ -37,6 +37,10 @@
#include <e-util/e-unicode.h>
#include <shell/e-shell-view.h>
+#define E_SHELL_SIDEBAR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_SIDEBAR, EShellSidebarPrivate))
+
struct _EShellSidebarPrivate {
gpointer shell_view; /* weak pointer */
@@ -157,7 +161,7 @@ shell_sidebar_dispose (GObject *object)
{
EShellSidebarPrivate *priv;
- priv = E_SHELL_SIDEBAR (object)->priv;
+ priv = E_SHELL_SIDEBAR_GET_PRIVATE (object);
if (priv->shell_view != NULL) {
g_object_remove_weak_pointer (
@@ -184,7 +188,7 @@ shell_sidebar_finalize (GObject *object)
{
EShellSidebarPrivate *priv;
- priv = E_SHELL_SIDEBAR (object)->priv;
+ priv = E_SHELL_SIDEBAR_GET_PRIVATE (object);
g_free (priv->icon_name);
g_free (priv->primary_text);
@@ -249,7 +253,7 @@ shell_sidebar_get_preferred_height (GtkWidget *widget,
gint child_min, child_nat;
GtkWidget *child;
- priv = E_SHELL_SIDEBAR (widget)->priv;
+ priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget);
child = gtk_bin_get_child (GTK_BIN (widget));
gtk_widget_get_preferred_height (child, minimum, natural);
@@ -270,7 +274,7 @@ shell_sidebar_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition;
GtkWidget *child;
- priv = E_SHELL_SIDEBAR (widget)->priv;
+ priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget);
gtk_widget_set_allocation (widget, allocation);
@@ -301,7 +305,7 @@ shell_sidebar_forall (GtkContainer *container,
{
EShellSidebarPrivate *priv;
- priv = E_SHELL_SIDEBAR (container)->priv;
+ priv = E_SHELL_SIDEBAR_GET_PRIVATE (container);
if (include_internals && callback && priv->event_box)
callback (priv->event_box, callback_data);
@@ -434,8 +438,7 @@ e_shell_sidebar_init (EShellSidebar *shell_sidebar)
const GdkColor *color;
const gchar *icon_name;
- shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- shell_sidebar, E_TYPE_SHELL_SIDEBAR, EShellSidebarPrivate);
+ shell_sidebar->priv = E_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar);
gtk_widget_set_has_window (GTK_WIDGET (shell_sidebar), FALSE);
diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c
index 77c1fd2929..3a72851f97 100644
--- a/shell/e-shell-switcher.c
+++ b/shell/e-shell-switcher.c
@@ -34,6 +34,10 @@
#include <glib/gi18n.h>
#include <libebackend/e-extensible.h>
+#define E_SHELL_SWITCHER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate))
+
#define H_PADDING 6
#define V_PADDING 6
@@ -235,7 +239,7 @@ shell_switcher_dispose (GObject *object)
{
EShellSwitcherPrivate *priv;
- priv = E_SHELL_SWITCHER (object)->priv;
+ priv = E_SHELL_SWITCHER_GET_PRIVATE (object);
while (priv->proxies != NULL) {
GtkWidget *widget = priv->proxies->data;
@@ -255,7 +259,7 @@ shell_switcher_get_preferred_width (GtkWidget *widget,
GtkWidget *child;
GList *iter;
- priv = E_SHELL_SWITCHER (widget)->priv;
+ priv = E_SHELL_SWITCHER_GET_PRIVATE (widget);
*minimum = *natural = 0;
@@ -290,7 +294,7 @@ shell_switcher_get_preferred_height (GtkWidget *widget,
GtkWidget *child;
GList *iter;
- priv = E_SHELL_SWITCHER (widget)->priv;
+ priv = E_SHELL_SWITCHER_GET_PRIVATE (widget);
*minimum = *natural = 0;
@@ -351,7 +355,7 @@ shell_switcher_screen_changed (GtkWidget *widget,
EShellSwitcherPrivate *priv;
GtkSettings *settings;
- priv = E_SHELL_SWITCHER (widget)->priv;
+ priv = E_SHELL_SWITCHER_GET_PRIVATE (widget);
if (gtk_widget_has_screen (widget))
settings = gtk_widget_get_settings (widget);
@@ -386,7 +390,7 @@ shell_switcher_remove (GtkContainer *container,
EShellSwitcherPrivate *priv;
GList *link;
- priv = E_SHELL_SWITCHER (container)->priv;
+ priv = E_SHELL_SWITCHER_GET_PRIVATE (container);
/* Look in the internal widgets first. */
@@ -413,7 +417,7 @@ shell_switcher_forall (GtkContainer *container,
{
EShellSwitcherPrivate *priv;
- priv = E_SHELL_SWITCHER (container)->priv;
+ priv = E_SHELL_SWITCHER_GET_PRIVATE (container);
if (include_internals)
g_list_foreach (
@@ -551,8 +555,7 @@ e_shell_switcher_class_init (EShellSwitcherClass *class)
static void
e_shell_switcher_init (EShellSwitcher *switcher)
{
- switcher->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- switcher, E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate);
+ switcher->priv = E_SHELL_SWITCHER_GET_PRIVATE (switcher);
gtk_widget_set_has_window (GTK_WIDGET (switcher), FALSE);
diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c
index adc0d27980..3dd995ded1 100644
--- a/shell/e-shell-taskbar.c
+++ b/shell/e-shell-taskbar.c
@@ -36,6 +36,10 @@
#include <e-shell-view.h>
#include <misc/e-activity-proxy.h>
+#define E_SHELL_TASKBAR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_TASKBAR, EShellTaskbarPrivate))
+
struct _EShellTaskbarPrivate {
gpointer shell_view; /* weak pointer */
@@ -204,7 +208,7 @@ shell_taskbar_dispose (GObject *object)
{
EShellTaskbarPrivate *priv;
- priv = E_SHELL_TASKBAR (object)->priv;
+ priv = E_SHELL_TASKBAR_GET_PRIVATE (object);
g_hash_table_foreach_remove (
priv->proxy_table, (GHRFunc)
@@ -243,7 +247,7 @@ shell_taskbar_finalize (GObject *object)
{
EShellTaskbarPrivate *priv;
- priv = E_SHELL_TASKBAR (object)->priv;
+ priv = E_SHELL_TASKBAR_GET_PRIVATE (object);
g_hash_table_destroy (priv->proxy_table);
@@ -371,8 +375,7 @@ e_shell_taskbar_init (EShellTaskbar *shell_taskbar)
{
GtkWidget *widget;
- shell_taskbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- shell_taskbar, E_TYPE_SHELL_TASKBAR, EShellTaskbarPrivate);
+ shell_taskbar->priv = E_SHELL_TASKBAR_GET_PRIVATE (shell_taskbar);
shell_taskbar->priv->proxy_table = g_hash_table_new (NULL, NULL);
gtk_box_set_spacing (GTK_BOX (shell_taskbar), 12);
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index a2fc00e3b5..89ac929160 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -45,6 +45,10 @@
#include "e-shell-searchbar.h"
#include "e-shell-window-actions.h"
+#define E_SHELL_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_VIEW, EShellViewPrivate))
+
#define SIMPLE_SEARCHBAR_WIDTH 300
#define STATE_SAVE_TIMEOUT_SECONDS 3
@@ -502,7 +506,7 @@ shell_view_dispose (GObject *object)
{
EShellViewPrivate *priv;
- priv = E_SHELL_VIEW (object)->priv;
+ priv = E_SHELL_VIEW_GET_PRIVATE (object);
/* Expedite any pending state saves. */
if (priv->state_save_timeout_id > 0) {
@@ -568,7 +572,7 @@ shell_view_finalize (GObject *object)
{
EShellViewPrivate *priv;
- priv = E_SHELL_VIEW (object)->priv;
+ priv = E_SHELL_VIEW_GET_PRIVATE (object);
g_key_file_free (priv->state_key_file);
@@ -1107,8 +1111,7 @@ e_shell_view_init (EShellView *shell_view,
size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
- shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- shell_view, E_TYPE_SHELL_VIEW, EShellViewPrivate);
+ shell_view->priv = E_SHELL_VIEW_GET_PRIVATE (shell_view);
shell_view->priv->state_key_file = g_key_file_new ();
shell_view->priv->size_group = size_group;
}
diff --git a/shell/e-shell-window-private.h b/shell/e-shell-window-private.h
index d36a3e64f6..e3a0e50665 100644
--- a/shell/e-shell-window-private.h
+++ b/shell/e-shell-window-private.h
@@ -49,6 +49,10 @@
#include <e-shell-window-actions.h>
#include <e-shell-utils.h>
+#define E_SHELL_WINDOW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_WINDOW, EShellWindowPrivate))
+
/* Shorthand, requires a variable named "shell_window". */
#define ACTION(name) \
(E_SHELL_WINDOW_ACTION_##name (shell_window))
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 1a969de8c9..19178f8292 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -958,8 +958,7 @@ e_shell_window_alert_sink_init (EAlertSinkInterface *interface)
static void
e_shell_window_init (EShellWindow *shell_window)
{
- shell_window->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- shell_window, E_TYPE_SHELL_WINDOW, EShellWindowPrivate);
+ shell_window->priv = E_SHELL_WINDOW_GET_PRIVATE (shell_window);
e_shell_window_private_init (shell_window);
}