[evince] Remove use of deprecated g_type_class_add_private function



commit e73364886a3261e89cbb43cf149fb412d30c3c1c
Author: Jason Crain <jcrain src gnome org>
Date:   Fri Aug 2 14:31:56 2019 -0600

     Remove use of deprecated g_type_class_add_private function
    
     The g_type_class_add_private function and G_TYPE_INSTANCE_GET_PRIVATE
     macro are deprecated. Replace with the G_DEFINE_TYPE_PRIVATE and
     G_ADD_PRIVATE macros, and *_get_instance_private functions.
    
     Issue #1023

 browser-plugin/EvBrowserPluginToolbar.cpp |   6 +-
 libdocument/ev-document.c                 |   8 +-
 libdocument/ev-image.c                    |   9 +--
 libdocument/ev-layer.c                    |  10 +--
 libdocument/ev-link-action.c              |   9 +--
 libdocument/ev-link-dest.c                |   9 +--
 libdocument/ev-link.c                     |   9 +--
 libdocument/ev-media.c                    |   6 +-
 libdocument/ev-transition-effect.c        |  12 +--
 libview/ev-form-field-accessible.c        |   5 +-
 libview/ev-image-accessible.c             |   5 +-
 libview/ev-link-accessible.c              |   5 +-
 libview/ev-page-accessible.c              |   5 +-
 libview/ev-timeline.c                     |  79 ++++++++++---------
 libview/ev-transition-animation.c         | 121 +++++++++++++++---------------
 libview/ev-view-accessible.c              |   5 +-
 shell/ev-sidebar-annotations.c            |   8 +-
 shell/ev-sidebar-attachments.c            |   8 +-
 shell/ev-sidebar-bookmarks.c              |   7 +-
 shell/ev-sidebar-layers.c                 |   8 +-
 shell/ev-sidebar-links.c                  |   8 +-
 shell/ev-sidebar-thumbnails.c             |   8 +-
 22 files changed, 139 insertions(+), 211 deletions(-)
---
diff --git a/browser-plugin/EvBrowserPluginToolbar.cpp b/browser-plugin/EvBrowserPluginToolbar.cpp
index 2c4e2be2..9d6aeaca 100644
--- a/browser-plugin/EvBrowserPluginToolbar.cpp
+++ b/browser-plugin/EvBrowserPluginToolbar.cpp
@@ -40,7 +40,7 @@ struct _EvBrowserPluginToolbarPrivate {
         GtkWidget *searchPopover;
 };
 
-G_DEFINE_TYPE(EvBrowserPluginToolbar, ev_browser_plugin_toolbar, GTK_TYPE_TOOLBAR)
+G_DEFINE_TYPE_WITH_PRIVATE(EvBrowserPluginToolbar, ev_browser_plugin_toolbar, GTK_TYPE_TOOLBAR)
 
 static void goToPreviousPage(EvBrowserPluginToolbar *toolbar)
 {
@@ -480,13 +480,11 @@ static void ev_browser_plugin_toolbar_class_init(EvBrowserPluginToolbarClass *kl
                                                               "Plugin",
                                                               "The plugin",
                                                               static_cast<GParamFlags>(G_PARAM_WRITABLE | 
G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)));
-
-        g_type_class_add_private(gObjectClass, sizeof(EvBrowserPluginToolbarPrivate));
 }
 
 static void ev_browser_plugin_toolbar_init(EvBrowserPluginToolbar *toolbar)
 {
-        toolbar->priv = G_TYPE_INSTANCE_GET_PRIVATE(toolbar, EV_TYPE_BROWSER_PLUGIN_TOOLBAR, 
EvBrowserPluginToolbarPrivate);
+        toolbar->priv = static_cast<EvBrowserPluginToolbarPrivate 
*>(ev_browser_plugin_toolbar_get_instance_private(toolbar));
 }
 
 GtkWidget *ev_browser_plugin_toolbar_new(EvBrowserPlugin *plugin)
diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c
index 9b2c323f..30a96895 100644
--- a/libdocument/ev-document.c
+++ b/libdocument/ev-document.c
@@ -28,8 +28,6 @@
 #include "ev-document-misc.h"
 #include "synctex_parser.h"
 
-#define EV_DOCUMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EV_TYPE_DOCUMENT, 
EvDocumentPrivate))
-
 enum {
        PROP_0,
        PROP_MODIFIED
@@ -82,7 +80,7 @@ static gboolean        _ev_document_support_synctex (EvDocument *document);
 static GMutex ev_doc_mutex;
 static GMutex ev_fc_mutex;
 
-G_DEFINE_ABSTRACT_TYPE (EvDocument, ev_document, G_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (EvDocument, ev_document, G_TYPE_OBJECT)
 
 GQuark
 ev_document_error_quark (void)
@@ -175,7 +173,7 @@ ev_document_get_property (GObject     *object,
 static void
 ev_document_init (EvDocument *document)
 {
-       document->priv = EV_DOCUMENT_GET_PRIVATE (document);
+       document->priv = ev_document_get_instance_private (document);
 
        /* Assume all pages are the same size until proven otherwise */
        document->priv->uniform = TRUE;
@@ -186,8 +184,6 @@ ev_document_class_init (EvDocumentClass *klass)
 {
        GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (g_object_class, sizeof (EvDocumentPrivate));
-
        klass->get_page = ev_document_impl_get_page;
        klass->get_info = ev_document_impl_get_info;
        klass->get_backend_info = NULL;
diff --git a/libdocument/ev-image.c b/libdocument/ev-image.c
index bf1cc38f..a31c9e51 100644
--- a/libdocument/ev-image.c
+++ b/libdocument/ev-image.c
@@ -33,10 +33,7 @@ struct _EvImagePrivate {
        gchar     *tmp_uri;
 };
 
-#define EV_IMAGE_GET_PRIVATE(object) \
-                (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_IMAGE, EvImagePrivate))
-
-G_DEFINE_TYPE (EvImage, ev_image, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (EvImage, ev_image, G_TYPE_OBJECT)
 
 static void
 ev_image_finalize (GObject *object)
@@ -68,15 +65,13 @@ ev_image_class_init (EvImageClass *klass)
 
        g_object_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (g_object_class, sizeof (EvImagePrivate));
-
        g_object_class->finalize = ev_image_finalize;
 }
 
 static void
 ev_image_init (EvImage *image)
 {
-       image->priv = EV_IMAGE_GET_PRIVATE (image);
+       image->priv = ev_image_get_instance_private (image);
 }
 
 EvImage *
diff --git a/libdocument/ev-layer.c b/libdocument/ev-layer.c
index 533cf657..6ed98dc7 100644
--- a/libdocument/ev-layer.c
+++ b/libdocument/ev-layer.c
@@ -26,23 +26,17 @@ struct _EvLayerPrivate {
        gint     rb_group;
 };
 
-#define EV_LAYER_GET_PRIVATE(object) \
-                (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LAYER, EvLayerPrivate))
-
-G_DEFINE_TYPE (EvLayer, ev_layer, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (EvLayer, ev_layer, G_TYPE_OBJECT)
 
 static void
 ev_layer_class_init (EvLayerClass *klass)
 {
-       GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
-
-       g_type_class_add_private (g_object_class, sizeof (EvLayerPrivate));
 }
 
 static void
 ev_layer_init (EvLayer *layer)
 {
-       layer->priv = EV_LAYER_GET_PRIVATE (layer);
+       layer->priv = ev_layer_get_instance_private (layer);
 }
 
 EvLayer *
diff --git a/libdocument/ev-link-action.c b/libdocument/ev-link-action.c
index 87fb8c61..0e7761d7 100644
--- a/libdocument/ev-link-action.c
+++ b/libdocument/ev-link-action.c
@@ -57,10 +57,7 @@ struct _EvLinkActionPrivate {
        GList            *toggle_list;
 };
 
-G_DEFINE_TYPE (EvLinkAction, ev_link_action, G_TYPE_OBJECT)
-
-#define EV_LINK_ACTION_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LINK_ACTION, EvLinkActionPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (EvLinkAction, ev_link_action, G_TYPE_OBJECT)
 
 EvLinkActionType
 ev_link_action_get_action_type (EvLinkAction *self)
@@ -305,7 +302,7 @@ ev_link_action_finalize (GObject *object)
 static void
 ev_link_action_init (EvLinkAction *ev_link_action)
 {
-       ev_link_action->priv = EV_LINK_ACTION_GET_PRIVATE (ev_link_action);
+       ev_link_action->priv = ev_link_action_get_instance_private (ev_link_action);
 
        ev_link_action->priv->dest = NULL;
        ev_link_action->priv->uri = NULL;
@@ -326,8 +323,6 @@ ev_link_action_class_init (EvLinkActionClass *ev_link_action_class)
 
        g_object_class->finalize = ev_link_action_finalize;
 
-       g_type_class_add_private (g_object_class, sizeof (EvLinkActionPrivate));
-
        g_object_class_install_property (g_object_class,
                                         PROP_TYPE,
                                         g_param_spec_enum  ("type",
diff --git a/libdocument/ev-link-dest.c b/libdocument/ev-link-dest.c
index 71a29aab..6bfdea95 100644
--- a/libdocument/ev-link-dest.c
+++ b/libdocument/ev-link-dest.c
@@ -66,10 +66,7 @@ struct _EvLinkDestPrivate {
        gchar         *page_label;
 };
 
-G_DEFINE_TYPE (EvLinkDest, ev_link_dest, G_TYPE_OBJECT)
-
-#define EV_LINK_DEST_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LINK_DEST, EvLinkDestPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (EvLinkDest, ev_link_dest, G_TYPE_OBJECT)
 
 EvLinkDestType
 ev_link_dest_get_dest_type (EvLinkDest *self)
@@ -273,7 +270,7 @@ ev_link_dest_finalize (GObject *object)
 static void
 ev_link_dest_init (EvLinkDest *ev_link_dest)
 {
-       ev_link_dest->priv = EV_LINK_DEST_GET_PRIVATE (ev_link_dest);
+       ev_link_dest->priv = ev_link_dest_get_instance_private (ev_link_dest);
 
        ev_link_dest->priv->named = NULL;
 }
@@ -290,8 +287,6 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
 
        g_object_class->finalize = ev_link_dest_finalize;
 
-       g_type_class_add_private (g_object_class, sizeof (EvLinkDestPrivate));
-
        g_object_class_install_property (g_object_class,
                                         PROP_TYPE,
                                         g_param_spec_enum  ("type",
diff --git a/libdocument/ev-link.c b/libdocument/ev-link.c
index d5cef0f0..4a71e111 100644
--- a/libdocument/ev-link.c
+++ b/libdocument/ev-link.c
@@ -41,10 +41,7 @@ struct _EvLinkPrivate {
        EvLinkAction *action;
 };
 
-G_DEFINE_TYPE (EvLink, ev_link, G_TYPE_OBJECT)
-
-#define EV_LINK_GET_PRIVATE(object) \
-       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LINK, EvLinkPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (EvLink, ev_link, G_TYPE_OBJECT)
 
 const gchar *
 ev_link_get_title (EvLink *self)
@@ -136,7 +133,7 @@ ev_link_finalize (GObject *object)
 static void
 ev_link_init (EvLink *ev_link)
 {
-       ev_link->priv = EV_LINK_GET_PRIVATE (ev_link);
+       ev_link->priv = ev_link_get_instance_private (ev_link);
 
        ev_link->priv->title = NULL;
        ev_link->priv->action = NULL;
@@ -154,8 +151,6 @@ ev_link_class_init (EvLinkClass *ev_window_class)
 
        g_object_class->finalize = ev_link_finalize;
 
-       g_type_class_add_private (g_object_class, sizeof (EvLinkPrivate));
-
        g_object_class_install_property (g_object_class,
                                         PROP_TITLE,
                                         g_param_spec_string ("title",
diff --git a/libdocument/ev-media.c b/libdocument/ev-media.c
index a8ee36ed..a5b24a9f 100644
--- a/libdocument/ev-media.c
+++ b/libdocument/ev-media.c
@@ -27,7 +27,7 @@ struct _EvMediaPrivate {
         gboolean show_controls;
 };
 
-G_DEFINE_TYPE (EvMedia, ev_media, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (EvMedia, ev_media, G_TYPE_OBJECT)
 
 static void
 ev_media_finalize (GObject *object)
@@ -45,14 +45,12 @@ ev_media_class_init (EvMediaClass *klass)
         GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
 
         g_object_class->finalize = ev_media_finalize;
-
-        g_type_class_add_private (g_object_class, sizeof (EvMediaPrivate));
 }
 
 static void
 ev_media_init (EvMedia *media)
 {
-        media->priv = G_TYPE_INSTANCE_GET_PRIVATE (media, EV_TYPE_MEDIA, EvMediaPrivate);
+        media->priv = ev_media_get_instance_private (media);
 }
 
 EvMedia *
diff --git a/libdocument/ev-transition-effect.c b/libdocument/ev-transition-effect.c
index 9250abc0..13370278 100644
--- a/libdocument/ev-transition-effect.c
+++ b/libdocument/ev-transition-effect.c
@@ -24,8 +24,6 @@
 
 #include "ev-document-type-builtins.h"
 
-#define EV_TRANSITION_EFFECT_GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EV_TYPE_TRANSITION_EFFECT, 
EvTransitionEffectPrivate))
-
 typedef struct EvTransitionEffectPrivate EvTransitionEffectPrivate;
 
 struct EvTransitionEffectPrivate {
@@ -51,7 +49,7 @@ enum {
        PROP_RECTANGULAR
 };
 
-G_DEFINE_TYPE (EvTransitionEffect, ev_transition_effect, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (EvTransitionEffect, ev_transition_effect, G_TYPE_OBJECT)
 
 static void
 ev_transition_effect_set_property (GObject     *object,
@@ -61,7 +59,7 @@ ev_transition_effect_set_property (GObject    *object,
 {
        EvTransitionEffectPrivate *priv;
 
-       priv = EV_TRANSITION_EFFECT_GET_PRIV (object);
+       priv = ev_transition_effect_get_instance_private (EV_TRANSITION_EFFECT (object));
 
        switch (prop_id) {
        case PROP_TYPE:
@@ -99,7 +97,7 @@ ev_transition_effect_get_property (GObject    *object,
 {
        EvTransitionEffectPrivate *priv;
 
-       priv = EV_TRANSITION_EFFECT_GET_PRIV (object);
+       priv = ev_transition_effect_get_instance_private (EV_TRANSITION_EFFECT (object));
 
        switch (prop_id) {
        case PROP_TYPE:
@@ -134,7 +132,7 @@ ev_transition_effect_init (EvTransitionEffect *effect)
 {
        EvTransitionEffectPrivate *priv;
 
-       priv = EV_TRANSITION_EFFECT_GET_PRIV (effect);
+       priv = ev_transition_effect_get_instance_private (effect);
 
        priv->scale = 1.;
 }
@@ -207,8 +205,6 @@ ev_transition_effect_class_init (EvTransitionEffectClass *klass)
                                                               FALSE,
                                                               G_PARAM_READWRITE |
                                                                G_PARAM_STATIC_STRINGS));
-
-       g_type_class_add_private (klass, sizeof (EvTransitionEffectPrivate));
 }
 
 EvTransitionEffect *
diff --git a/libview/ev-form-field-accessible.c b/libview/ev-form-field-accessible.c
index 8187d83e..3500e530 100644
--- a/libview/ev-form-field-accessible.c
+++ b/libview/ev-form-field-accessible.c
@@ -39,6 +39,7 @@ struct _EvFormFieldAccessiblePrivate {
 static void ev_form_field_accessible_component_iface_init (AtkComponentIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (EvFormFieldAccessible, ev_form_field_accessible, ATK_TYPE_OBJECT,
+                        G_ADD_PRIVATE (EvFormFieldAccessible)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, 
ev_form_field_accessible_component_iface_init))
 
 static void
@@ -360,14 +361,12 @@ ev_form_field_accessible_class_init (EvFormFieldAccessibleClass *klass)
        atk_class->get_parent = ev_form_field_accessible_get_parent;
        atk_class->get_role = ev_form_field_accessible_get_role;
        atk_class->ref_state_set = ev_form_field_accessible_ref_state_set;
-
-       g_type_class_add_private (klass, sizeof (EvFormFieldAccessiblePrivate));
 }
 
 static void
 ev_form_field_accessible_init (EvFormFieldAccessible *accessible)
 {
-       accessible->priv = G_TYPE_INSTANCE_GET_PRIVATE (accessible, EV_TYPE_FORM_FIELD_ACCESSIBLE, 
EvFormFieldAccessiblePrivate);
+       accessible->priv = ev_form_field_accessible_get_instance_private (accessible);
        accessible->priv->start_index = -1;
        accessible->priv->end_index = -1;
 }
diff --git a/libview/ev-image-accessible.c b/libview/ev-image-accessible.c
index efc37cfa..5e4c77d3 100644
--- a/libview/ev-image-accessible.c
+++ b/libview/ev-image-accessible.c
@@ -34,6 +34,7 @@ static void ev_image_accessible_component_iface_init (AtkComponentIface *iface);
 static void ev_image_accessible_image_iface_init     (AtkImageIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (EvImageAccessible, ev_image_accessible, ATK_TYPE_OBJECT,
+                        G_ADD_PRIVATE (EvImageAccessible)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, ev_image_accessible_component_iface_init)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, ev_image_accessible_image_iface_init))
 
@@ -171,8 +172,6 @@ ev_image_accessible_class_init (EvImageAccessibleClass *klass)
        object_class->finalize = ev_image_accessible_finalize;
        atk_class->get_parent = ev_image_accessible_get_parent;
        atk_class->ref_state_set = ev_image_accessible_ref_state_set;
-
-       g_type_class_add_private (klass, sizeof (EvImageAccessiblePrivate));
 }
 
 static void
@@ -180,7 +179,7 @@ ev_image_accessible_init (EvImageAccessible *image)
 {
        atk_object_set_role (ATK_OBJECT (image), ATK_ROLE_IMAGE);
 
-       image->priv = G_TYPE_INSTANCE_GET_PRIVATE (image, EV_TYPE_IMAGE_ACCESSIBLE, EvImageAccessiblePrivate);
+       image->priv = ev_image_accessible_get_instance_private (image);
 }
 
 static void
diff --git a/libview/ev-link-accessible.c b/libview/ev-link-accessible.c
index 80cca432..db43b17f 100644
--- a/libview/ev-link-accessible.c
+++ b/libview/ev-link-accessible.c
@@ -207,6 +207,7 @@ static void ev_link_accessible_action_interface_init     (AtkActionIface
 static void ev_link_accessible_component_iface_init      (AtkComponentIface     *iface);
 
 G_DEFINE_TYPE_WITH_CODE (EvLinkAccessible, ev_link_accessible, ATK_TYPE_OBJECT,
+                        G_ADD_PRIVATE (EvLinkAccessible)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERLINK_IMPL, 
ev_link_accessible_hyperlink_impl_iface_init)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, ev_link_accessible_action_interface_init)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, ev_link_accessible_component_iface_init))
@@ -289,8 +290,6 @@ ev_link_accessible_class_init (EvLinkAccessibleClass *klass)
 
         object_class->finalize = ev_link_accessible_finalize;
 
-        g_type_class_add_private (klass, sizeof (EvLinkAccessiblePrivate));
-
         atk_class->get_parent = ev_link_accessible_get_parent;
         atk_class->get_name = ev_link_accessible_get_name;
         atk_class->ref_state_set = ev_link_accessible_ref_state_set;
@@ -300,7 +299,7 @@ static void
 ev_link_accessible_init (EvLinkAccessible *link)
 {
         atk_object_set_role (ATK_OBJECT (link), ATK_ROLE_LINK);
-        link->priv = G_TYPE_INSTANCE_GET_PRIVATE (link, EV_TYPE_LINK_ACCESSIBLE, EvLinkAccessiblePrivate);
+        link->priv = ev_link_accessible_get_instance_private (link);
         link->priv->start_index = -1;
         link->priv->end_index = -1;
 }
diff --git a/libview/ev-page-accessible.c b/libview/ev-page-accessible.c
index 5ba820eb..9d8e2c4b 100644
--- a/libview/ev-page-accessible.c
+++ b/libview/ev-page-accessible.c
@@ -49,6 +49,7 @@ static void ev_page_accessible_hypertext_iface_init (AtkHypertextIface *iface);
 static void ev_page_accessible_text_iface_init (AtkTextIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (EvPageAccessible, ev_page_accessible, ATK_TYPE_OBJECT,
+                        G_ADD_PRIVATE (EvPageAccessible)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, ev_page_accessible_component_iface_init)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERTEXT, ev_page_accessible_hypertext_iface_init)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, ev_page_accessible_text_iface_init))
@@ -347,8 +348,6 @@ ev_page_accessible_class_init (EvPageAccessibleClass *klass)
        GObjectClass   *g_object_class = G_OBJECT_CLASS (klass);
        AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (EvPageAccessiblePrivate));
-
        atk_class->get_parent  = ev_page_accessible_get_parent;
        atk_class->ref_relation_set = ev_page_accessible_ref_relation_set;
        atk_class->ref_state_set = ev_page_accessible_ref_state_set;
@@ -1048,7 +1047,7 @@ ev_page_accessible_init (EvPageAccessible *page)
 {
        atk_object_set_role (ATK_OBJECT (page), ATK_ROLE_PAGE);
 
-        page->priv = G_TYPE_INSTANCE_GET_PRIVATE (page, EV_TYPE_PAGE_ACCESSIBLE, EvPageAccessiblePrivate);
+        page->priv = ev_page_accessible_get_instance_private (page);
 }
 
 static void
diff --git a/libview/ev-timeline.c b/libview/ev-timeline.c
index 34809d88..339c62d5 100644
--- a/libview/ev-timeline.c
+++ b/libview/ev-timeline.c
@@ -24,14 +24,13 @@
 #include <gdk/gdk.h>
 #include "ev-timeline.h"
 
-#define EV_TIMELINE_GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EV_TYPE_TIMELINE, EvTimelinePriv))
 #define MSECS_PER_SEC 1000
 #define FRAME_INTERVAL(nframes) (MSECS_PER_SEC / nframes)
 #define DEFAULT_FPS 30
 
-typedef struct EvTimelinePriv EvTimelinePriv;
+typedef struct EvTimelinePrivate EvTimelinePrivate;
 
-struct EvTimelinePriv {
+struct EvTimelinePrivate {
        guint duration;
        guint fps;
        guint source_id;
@@ -59,15 +58,15 @@ enum {
 static guint signals [LAST_SIGNAL] = { 0, };
 
 
-G_DEFINE_TYPE (EvTimeline, ev_timeline, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (EvTimeline, ev_timeline, G_TYPE_OBJECT)
 
 
 static void
 ev_timeline_init (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        priv->fps = DEFAULT_FPS;
        priv->duration = 0;
@@ -104,11 +103,11 @@ ev_timeline_get_property (GObject    *object,
                          GValue     *value,
                          GParamSpec *pspec)
 {
-       EvTimeline     *timeline;
-       EvTimelinePriv *priv;
+       EvTimeline        *timeline;
+       EvTimelinePrivate *priv;
 
        timeline = EV_TIMELINE (object);
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        switch (prop_id) {
        case PROP_FPS:
@@ -128,9 +127,9 @@ ev_timeline_get_property (GObject    *object,
 static void
 ev_timeline_finalize (GObject *object)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
-       priv = EV_TIMELINE_GET_PRIV (object);
+       priv = ev_timeline_get_instance_private (EV_TIMELINE (object));
 
        if (priv->source_id) {
                g_source_remove (priv->source_id);
@@ -146,11 +145,11 @@ ev_timeline_finalize (GObject *object)
 static gboolean
 ev_timeline_run_frame (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
-       gdouble         progress;
-       guint           elapsed_time;
+       EvTimelinePrivate *priv;
+       gdouble            progress;
+       guint              elapsed_time;
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        elapsed_time = (guint) (g_timer_elapsed (priv->timer, NULL) * 1000);
        progress = (gdouble) elapsed_time / priv->duration;
@@ -178,9 +177,9 @@ ev_timeline_run_frame (EvTimeline *timeline)
 static void
 ev_timeline_real_start (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        if (!priv->source_id) {
                if (priv->timer)
@@ -274,8 +273,6 @@ ev_timeline_class_init (EvTimelineClass *class)
                              g_cclosure_marshal_VOID__DOUBLE,
                              G_TYPE_NONE, 1,
                              G_TYPE_DOUBLE);
-
-       g_type_class_add_private (class, sizeof (EvTimelinePriv));
 }
 
 EvTimeline *
@@ -297,11 +294,11 @@ ev_timeline_start (EvTimeline *timeline)
 void
 ev_timeline_pause (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
        g_return_if_fail (EV_IS_TIMELINE (timeline));
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        if (priv->source_id) {
                g_source_remove (priv->source_id);
@@ -314,11 +311,11 @@ ev_timeline_pause (EvTimeline *timeline)
 void
 ev_timeline_rewind (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
        g_return_if_fail (EV_IS_TIMELINE (timeline));
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        /* destroy and re-create timer if neccesary  */
        if (priv->timer) {
@@ -334,11 +331,11 @@ ev_timeline_rewind (EvTimeline *timeline)
 gboolean
 ev_timeline_is_running (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
        g_return_val_if_fail (EV_IS_TIMELINE (timeline), FALSE);
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        return (priv->source_id != 0);
 }
@@ -346,11 +343,11 @@ ev_timeline_is_running (EvTimeline *timeline)
 guint
 ev_timeline_get_fps (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
        g_return_val_if_fail (EV_IS_TIMELINE (timeline), 1);
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
        return priv->fps;
 }
 
@@ -358,11 +355,11 @@ void
 ev_timeline_set_fps (EvTimeline *timeline,
                     guint       fps)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
        g_return_if_fail (EV_IS_TIMELINE (timeline));
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        priv->fps = fps;
 
@@ -379,11 +376,11 @@ ev_timeline_set_fps (EvTimeline *timeline,
 gboolean
 ev_timeline_get_loop (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
        g_return_val_if_fail (EV_IS_TIMELINE (timeline), FALSE);
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
        return priv->loop;
 }
 
@@ -391,11 +388,11 @@ void
 ev_timeline_set_loop (EvTimeline *timeline,
                      gboolean    loop)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
        g_return_if_fail (EV_IS_TIMELINE (timeline));
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
        priv->loop = loop;
 
        g_object_notify (G_OBJECT (timeline), "loop");
@@ -405,11 +402,11 @@ void
 ev_timeline_set_duration (EvTimeline *timeline,
                          guint       duration)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
        g_return_if_fail (EV_IS_TIMELINE (timeline));
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        priv->duration = duration;
 
@@ -419,11 +416,11 @@ ev_timeline_set_duration (EvTimeline *timeline,
 guint
 ev_timeline_get_duration (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
+       EvTimelinePrivate *priv;
 
        g_return_val_if_fail (EV_IS_TIMELINE (timeline), 0);
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        return priv->duration;
 }
@@ -431,13 +428,13 @@ ev_timeline_get_duration (EvTimeline *timeline)
 gdouble
 ev_timeline_get_progress (EvTimeline *timeline)
 {
-       EvTimelinePriv *priv;
-       gdouble         progress;
-       guint           elapsed_time;
+       EvTimelinePrivate *priv;
+       gdouble            progress;
+       guint              elapsed_time;
 
        g_return_val_if_fail (EV_IS_TIMELINE (timeline), 0.0);
 
-       priv = EV_TIMELINE_GET_PRIV (timeline);
+       priv = ev_timeline_get_instance_private (timeline);
 
        if (!priv->timer)
                return 0.;
diff --git a/libview/ev-transition-animation.c b/libview/ev-transition-animation.c
index ddcaadf2..7b52b70c 100644
--- a/libview/ev-transition-animation.c
+++ b/libview/ev-transition-animation.c
@@ -24,12 +24,11 @@
 #include "ev-transition-animation.h"
 #include "ev-timeline.h"
 
-#define EV_TRANSITION_ANIMATION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), 
EV_TYPE_TRANSITION_ANIMATION, EvTransitionAnimationPriv))
 #define N_BLINDS 6
 
-typedef struct EvTransitionAnimationPriv EvTransitionAnimationPriv;
+typedef struct EvTransitionAnimationPrivate EvTransitionAnimationPrivate;
 
-struct EvTransitionAnimationPriv {
+struct EvTransitionAnimationPrivate {
        EvTransitionEffect *effect;
        cairo_surface_t *origin_surface;
        cairo_surface_t *dest_surface;
@@ -43,7 +42,7 @@ enum {
 };
 
 
-G_DEFINE_TYPE (EvTransitionAnimation, ev_transition_animation, EV_TYPE_TIMELINE)
+G_DEFINE_TYPE_WITH_PRIVATE (EvTransitionAnimation, ev_transition_animation, EV_TYPE_TIMELINE)
 
 
 static void
@@ -57,9 +56,9 @@ ev_transition_animation_set_property (GObject      *object,
                                      const GValue *value,
                                      GParamSpec   *pspec)
 {
-       EvTransitionAnimationPriv *priv;
+       EvTransitionAnimationPrivate *priv;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (object);
+       priv = ev_transition_animation_get_instance_private (EV_TRANSITION_ANIMATION (object));
 
        switch (prop_id) {
        case PROP_EFFECT:
@@ -87,9 +86,9 @@ ev_transition_animation_get_property (GObject      *object,
                                      GValue       *value,
                                      GParamSpec   *pspec)
 {
-       EvTransitionAnimationPriv *priv;
+       EvTransitionAnimationPrivate *priv;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (object);
+       priv = ev_transition_animation_get_instance_private (EV_TRANSITION_ANIMATION (object));
 
        switch (prop_id) {
        case PROP_EFFECT:
@@ -109,9 +108,9 @@ ev_transition_animation_get_property (GObject      *object,
 static void
 ev_transition_animation_finalize (GObject *object)
 {
-       EvTransitionAnimationPriv *priv;
+       EvTransitionAnimationPrivate *priv;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (object);
+       priv = ev_transition_animation_get_instance_private (EV_TRANSITION_ANIMATION (object));
 
        if (priv->effect)
                g_object_unref (priv->effect);
@@ -130,16 +129,16 @@ ev_transition_animation_constructor (GType                  type,
                                     guint                  n_construct_properties,
                                     GObjectConstructParam *construct_params)
 {
-       GObject *object;
-       EvTransitionAnimationPriv *priv;
-       EvTransitionEffect *effect;
-       gint duration;
+       GObject                      *object;
+       EvTransitionAnimationPrivate *priv;
+       EvTransitionEffect           *effect;
+       gint                          duration;
 
        object = G_OBJECT_CLASS (ev_transition_animation_parent_class)->constructor (type,
                                                                                     n_construct_properties,
                                                                                     construct_params);
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (object);
+       priv = ev_transition_animation_get_instance_private (EV_TRANSITION_ANIMATION (object));
        effect = priv->effect;
 
        g_object_get (effect, "duration", &duration, NULL);
@@ -180,8 +179,6 @@ ev_transition_animation_class_init (EvTransitionAnimationClass *klass)
                                                               "Cairo surface to which the animation will 
happen",
                                                               G_PARAM_READWRITE |
                                                                G_PARAM_STATIC_STRINGS));
-
-       g_type_class_add_private (klass, sizeof (EvTransitionAnimationPriv));
 }
 
 static void
@@ -215,12 +212,12 @@ ev_transition_animation_split (cairo_t               *cr,
                               gdouble                progress,
                               GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
-       EvTransitionEffectAlignment alignment;
-       EvTransitionEffectDirection direction;
-       gint width, height;
+       EvTransitionAnimationPrivate *priv;
+       EvTransitionEffectAlignment   alignment;
+       EvTransitionEffectDirection   direction;
+       gint                          width, height;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
        width = page_area.width;
        height = page_area.height;
 
@@ -279,11 +276,11 @@ ev_transition_animation_blinds (cairo_t               *cr,
                                gdouble                progress,
                                GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
-       EvTransitionEffectAlignment alignment;
-       gint width, height, i;
+       EvTransitionAnimationPrivate *priv;
+       EvTransitionEffectAlignment   alignment;
+       gint                          width, height, i;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
        width = page_area.width;
        height = page_area.height;
 
@@ -323,11 +320,11 @@ ev_transition_animation_box (cairo_t               *cr,
                             gdouble                progress,
                             GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
-       EvTransitionEffectDirection direction;
-       gint width, height;
+       EvTransitionAnimationPrivate *priv;
+       EvTransitionEffectDirection   direction;
+       gint                          width, height;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
        width = page_area.width;
        height = page_area.height;
 
@@ -367,11 +364,11 @@ ev_transition_animation_wipe (cairo_t               *cr,
                              gdouble                progress,
                              GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
-       gint width, height;
-       gint angle;
+       EvTransitionAnimationPrivate *priv;
+       gint                          width, height;
+       gint                          angle;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
        width = page_area.width;
        height = page_area.height;
 
@@ -421,9 +418,9 @@ ev_transition_animation_dissolve (cairo_t               *cr,
                                  gdouble                progress,
                                  GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
+       EvTransitionAnimationPrivate *priv;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
 
        paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
        paint_surface (cr, priv->origin_surface, 0, 0, 1 - progress, page_area);
@@ -436,11 +433,11 @@ ev_transition_animation_push (cairo_t               *cr,
                              gdouble                progress,
                              GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
-       gint width, height;
-       gint angle;
+       EvTransitionAnimationPrivate *priv;
+       gint                          width, height;
+       gint                          angle;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
        width = page_area.width;
        height = page_area.height;
 
@@ -466,11 +463,11 @@ ev_transition_animation_cover (cairo_t               *cr,
                               gdouble                progress,
                               GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
-       gint width, height;
-       gint angle;
+       EvTransitionAnimationPrivate *priv;
+       gint                          width, height;
+       gint                          angle;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
        width = page_area.width;
        height = page_area.height;
 
@@ -496,11 +493,11 @@ ev_transition_animation_uncover (cairo_t               *cr,
                                 gdouble                progress,
                                 GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
-       gint width, height;
-       gint angle;
+       EvTransitionAnimationPrivate *priv;
+       gint                          width, height;
+       gint                          angle;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
        width = page_area.width;
        height = page_area.height;
 
@@ -526,9 +523,9 @@ ev_transition_animation_fade (cairo_t               *cr,
                              gdouble                progress,
                              GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
+       EvTransitionAnimationPrivate *priv;
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
 
        paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
        paint_surface (cr, priv->dest_surface, 0, 0, progress, page_area);
@@ -539,13 +536,13 @@ ev_transition_animation_paint (EvTransitionAnimation *animation,
                               cairo_t               *cr,
                               GdkRectangle           page_area)
 {
-       EvTransitionAnimationPriv *priv;
-       EvTransitionEffectType type;
-       gdouble progress;
+       EvTransitionAnimationPrivate *priv;
+       EvTransitionEffectType        type;
+       gdouble                       progress;
 
        g_return_if_fail (EV_IS_TRANSITION_ANIMATION (animation));
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
 
        if (!priv->dest_surface) {
                /* animation is still not ready, paint the origin surface */
@@ -619,12 +616,12 @@ void
 ev_transition_animation_set_origin_surface (EvTransitionAnimation *animation,
                                            cairo_surface_t       *origin_surface)
 {
-       EvTransitionAnimationPriv *priv;
-       cairo_surface_t *surface;
+       EvTransitionAnimationPrivate *priv;
+       cairo_surface_t              *surface;
 
        g_return_if_fail (EV_IS_TRANSITION_ANIMATION (animation));
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
 
        if (priv->origin_surface == origin_surface)
                return;
@@ -645,12 +642,12 @@ void
 ev_transition_animation_set_dest_surface (EvTransitionAnimation *animation,
                                          cairo_surface_t       *dest_surface)
 {
-       EvTransitionAnimationPriv *priv;
-       cairo_surface_t *surface;
+       EvTransitionAnimationPrivate *priv;
+       cairo_surface_t              *surface;
 
        g_return_if_fail (EV_IS_TRANSITION_ANIMATION (animation));
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
 
        if (priv->dest_surface == dest_surface)
                return;
@@ -670,11 +667,11 @@ ev_transition_animation_set_dest_surface (EvTransitionAnimation *animation,
 gboolean
 ev_transition_animation_ready (EvTransitionAnimation *animation)
 {
-       EvTransitionAnimationPriv *priv;
+       EvTransitionAnimationPrivate *priv;
 
        g_return_val_if_fail (EV_IS_TRANSITION_ANIMATION (animation), FALSE);
 
-       priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+       priv = ev_transition_animation_get_instance_private (animation);
 
        return (priv->origin_surface != NULL);
 }
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c
index 92e16561..0f104c8c 100644
--- a/libview/ev-view-accessible.c
+++ b/libview/ev-view-accessible.c
@@ -69,6 +69,7 @@ struct _EvViewAccessiblePrivate {
 };
 
 G_DEFINE_TYPE_WITH_CODE (EvViewAccessible, ev_view_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
+                        G_ADD_PRIVATE (EvViewAccessible)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, ev_view_accessible_action_iface_init)
                         G_IMPLEMENT_INTERFACE (ATK_TYPE_DOCUMENT, ev_view_accessible_document_iface_init)
        )
@@ -175,14 +176,12 @@ ev_view_accessible_class_init (EvViewAccessibleClass *klass)
        atk_class->initialize = ev_view_accessible_initialize;
        atk_class->get_n_children = ev_view_accessible_get_n_children;
        atk_class->ref_child = ev_view_accessible_ref_child;
-
-       g_type_class_add_private (klass, sizeof (EvViewAccessiblePrivate));
 }
 
 static void
 ev_view_accessible_init (EvViewAccessible *accessible)
 {
-       accessible->priv = G_TYPE_INSTANCE_GET_PRIVATE (accessible, EV_TYPE_VIEW_ACCESSIBLE, 
EvViewAccessiblePrivate);
+       accessible->priv = ev_view_accessible_get_instance_private (accessible);
 }
 
 #if ATK_CHECK_VERSION (2, 11, 3)
diff --git a/shell/ev-sidebar-annotations.c b/shell/ev-sidebar-annotations.c
index 05de7340..4451e2c5 100644
--- a/shell/ev-sidebar-annotations.c
+++ b/shell/ev-sidebar-annotations.c
@@ -75,12 +75,10 @@ G_DEFINE_TYPE_EXTENDED (EvSidebarAnnotations,
                         ev_sidebar_annotations,
                         GTK_TYPE_BOX,
                         0,
+                        G_ADD_PRIVATE (EvSidebarAnnotations)
                         G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE,
                                               ev_sidebar_annotations_page_iface_init))
 
-#define EV_SIDEBAR_ANNOTATIONS_GET_PRIVATE(object) \
-       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_SIDEBAR_ANNOTATIONS, EvSidebarAnnotationsPrivate))
-
 #define ANNOT_ICON_SIZE 16
 
 static void
@@ -131,7 +129,7 @@ ev_sidebar_annotations_init (EvSidebarAnnotations *ev_annots)
        GtkTreeSelection  *selection;
        GtkBuilder        *builder;
 
-        ev_annots->priv = EV_SIDEBAR_ANNOTATIONS_GET_PRIVATE (ev_annots);
+        ev_annots->priv = ev_sidebar_annotations_get_instance_private (ev_annots);
 
        ev_annots->priv->swindow = gtk_scrolled_window_new (NULL, NULL);
 
@@ -202,8 +200,6 @@ ev_sidebar_annotations_class_init (EvSidebarAnnotationsClass *klass)
        g_object_class->dispose = ev_sidebar_annotations_dispose;
        gtk_widget_class->popup_menu = ev_sidebar_annotations_popup_menu;
 
-       g_type_class_add_private (g_object_class, sizeof (EvSidebarAnnotationsPrivate));
-
        g_object_class_override_property (g_object_class, PROP_WIDGET, "main-widget");
 
        signals[ANNOT_ACTIVATED] =
diff --git a/shell/ev-sidebar-attachments.c b/shell/ev-sidebar-attachments.c
index 0eaf188a..b82ce60d 100644
--- a/shell/ev-sidebar-attachments.c
+++ b/shell/ev-sidebar-attachments.c
@@ -86,12 +86,10 @@ G_DEFINE_TYPE_EXTENDED (EvSidebarAttachments,
                         ev_sidebar_attachments,
                         GTK_TYPE_BOX,
                         0, 
+                        G_ADD_PRIVATE (EvSidebarAttachments)
                         G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, 
                                               ev_sidebar_attachments_page_iface_init))
 
-#define EV_SIDEBAR_ATTACHMENTS_GET_PRIVATE(object) \
-                (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_SIDEBAR_ATTACHMENTS, 
EvSidebarAttachmentsPrivate))
-
 /* Icon cache */
 static void
 ev_sidebar_attachments_icon_cache_add (EvSidebarAttachments *ev_attachbar,
@@ -696,8 +694,6 @@ ev_sidebar_attachments_class_init (EvSidebarAttachmentsClass *ev_attachbar_class
        gtk_widget_class->popup_menu = ev_sidebar_attachments_popup_menu;
        gtk_widget_class->screen_changed = ev_sidebar_attachments_screen_changed;
 
-       g_type_class_add_private (g_object_class, sizeof (EvSidebarAttachmentsPrivate));
-
        /* Signals */
        signals[SIGNAL_POPUP_MENU] =
                g_signal_new ("popup",
@@ -733,7 +729,7 @@ ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar)
        static const GtkTargetEntry targets[] = { {"text/uri-list", 0, EV_DND_TARGET_TEXT_URI_LIST},
                                                  {"XdndDirectSave0", 0, EV_DND_TARGET_XDS}};
 
-       ev_attachbar->priv = EV_SIDEBAR_ATTACHMENTS_GET_PRIVATE (ev_attachbar);
+       ev_attachbar->priv = ev_sidebar_attachments_get_instance_private (ev_attachbar);
 
        swindow = gtk_scrolled_window_new (NULL, NULL);
        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
diff --git a/shell/ev-sidebar-bookmarks.c b/shell/ev-sidebar-bookmarks.c
index 7fb59afb..df55c904 100644
--- a/shell/ev-sidebar-bookmarks.c
+++ b/shell/ev-sidebar-bookmarks.c
@@ -62,6 +62,7 @@ G_DEFINE_TYPE_EXTENDED (EvSidebarBookmarks,
                         ev_sidebar_bookmarks,
                         GTK_TYPE_BOX,
                         0,
+                        G_ADD_PRIVATE (EvSidebarBookmarks)
                         G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE,
                                                ev_sidebar_bookmarks_page_iface_init))
 
@@ -422,9 +423,7 @@ ev_sidebar_bookmarks_init (EvSidebarBookmarks *sidebar_bookmarks)
         GtkCellRenderer           *renderer;
         GtkTreeSelection          *selection;
 
-        sidebar_bookmarks->priv = G_TYPE_INSTANCE_GET_PRIVATE (sidebar_bookmarks,
-                                                               EV_TYPE_SIDEBAR_BOOKMARKS,
-                                                               EvSidebarBookmarksPrivate);
+        sidebar_bookmarks->priv = ev_sidebar_bookmarks_get_instance_private (sidebar_bookmarks);
         priv = sidebar_bookmarks->priv;
 
         swindow = gtk_scrolled_window_new (NULL, NULL);
@@ -534,8 +533,6 @@ ev_sidebar_bookmarks_class_init (EvSidebarBookmarksClass *klass)
 
         widget_class->popup_menu = ev_sidebar_bookmarks_popup_menu;
 
-        g_type_class_add_private (g_object_class, sizeof (EvSidebarBookmarksPrivate));
-
         g_object_class_override_property (g_object_class, PROP_WIDGET, "main-widget");
 }
 
diff --git a/shell/ev-sidebar-layers.c b/shell/ev-sidebar-layers.c
index ddb23b70..beb26b19 100644
--- a/shell/ev-sidebar-layers.c
+++ b/shell/ev-sidebar-layers.c
@@ -57,12 +57,10 @@ G_DEFINE_TYPE_EXTENDED (EvSidebarLayers,
                         ev_sidebar_layers,
                         GTK_TYPE_BOX,
                         0, 
+                        G_ADD_PRIVATE (EvSidebarLayers)
                         G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, 
                                               ev_sidebar_layers_page_iface_init))
 
-#define EV_SIDEBAR_LAYERS_GET_PRIVATE(object) \
-       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_SIDEBAR_LAYERS, EvSidebarLayersPrivate))
-
 static void
 ev_sidebar_layers_dispose (GObject *object)
 {
@@ -284,7 +282,7 @@ ev_sidebar_layers_init (EvSidebarLayers *ev_layers)
        GtkWidget    *swindow;
        GtkTreeModel *model;
        
-       ev_layers->priv = EV_SIDEBAR_LAYERS_GET_PRIVATE (ev_layers);
+       ev_layers->priv = ev_sidebar_layers_get_instance_private (ev_layers);
 
        swindow = gtk_scrolled_window_new (NULL, NULL);
        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
@@ -313,8 +311,6 @@ ev_sidebar_layers_class_init (EvSidebarLayersClass *ev_layers_class)
        g_object_class->get_property = ev_sidebar_layers_get_property;
        g_object_class->dispose = ev_sidebar_layers_dispose;
 
-       g_type_class_add_private (g_object_class, sizeof (EvSidebarLayersPrivate));
-
        g_object_class_override_property (g_object_class, PROP_WIDGET, "main-widget");
 
        signals[LAYERS_VISIBILITY_CHANGED] =
diff --git a/shell/ev-sidebar-links.c b/shell/ev-sidebar-links.c
index e34156a3..a35cc1eb 100644
--- a/shell/ev-sidebar-links.c
+++ b/shell/ev-sidebar-links.c
@@ -87,13 +87,11 @@ G_DEFINE_TYPE_EXTENDED (EvSidebarLinks,
                         ev_sidebar_links, 
                         GTK_TYPE_BOX,
                         0, 
+                        G_ADD_PRIVATE (EvSidebarLinks)
                         G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, 
                                               ev_sidebar_links_page_iface_init))
 
 
-#define EV_SIDEBAR_LINKS_GET_PRIVATE(object) \
-       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_SIDEBAR_LINKS, EvSidebarLinksPrivate))
-
 static void
 ev_sidebar_links_set_property (GObject      *object,
                               guint         prop_id,
@@ -218,8 +216,6 @@ ev_sidebar_links_class_init (EvSidebarLinksClass *ev_sidebar_links_class)
        g_object_class_override_property (g_object_class,
                                          PROP_WIDGET,
                                          "main-widget");
-
-       g_type_class_add_private (g_object_class, sizeof (EvSidebarLinksPrivate));
 }
 
 static void
@@ -688,7 +684,7 @@ ev_sidebar_links_construct (EvSidebarLinks *ev_sidebar_links)
 static void
 ev_sidebar_links_init (EvSidebarLinks *ev_sidebar_links)
 {
-       ev_sidebar_links->priv = EV_SIDEBAR_LINKS_GET_PRIVATE (ev_sidebar_links);
+       ev_sidebar_links->priv = ev_sidebar_links_get_instance_private (ev_sidebar_links);
 
        ev_sidebar_links_construct (ev_sidebar_links);
 }
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c
index 8311eca4..c903e87f 100644
--- a/shell/ev-sidebar-thumbnails.c
+++ b/shell/ev-sidebar-thumbnails.c
@@ -106,12 +106,10 @@ G_DEFINE_TYPE_EXTENDED (EvSidebarThumbnails,
                         ev_sidebar_thumbnails, 
                         GTK_TYPE_BOX,
                         0, 
+                        G_ADD_PRIVATE (EvSidebarThumbnails)
                         G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, 
                                               ev_sidebar_thumbnails_page_iface_init))
 
-#define EV_SIDEBAR_THUMBNAILS_GET_PRIVATE(object) \
-       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_SIDEBAR_THUMBNAILS, EvSidebarThumbnailsPrivate));
-
 /* Thumbnails dimensions cache */
 #define EV_THUMBNAILS_SIZE_CACHE_KEY "ev-thumbnails-size-cache"
 
@@ -361,8 +359,6 @@ ev_sidebar_thumbnails_class_init (EvSidebarThumbnailsClass *ev_sidebar_thumbnail
        g_object_class_override_property (g_object_class,
                                          PROP_WIDGET,
                                          "main-widget");
-
-       g_type_class_add_private (g_object_class, sizeof (EvSidebarThumbnailsPrivate));
 }
 
 GtkWidget *
@@ -789,7 +785,7 @@ ev_sidebar_thumbnails_init (EvSidebarThumbnails *ev_sidebar_thumbnails)
        EvSidebarThumbnailsPrivate *priv;
        guint signal_id;
 
-       priv = ev_sidebar_thumbnails->priv = EV_SIDEBAR_THUMBNAILS_GET_PRIVATE (ev_sidebar_thumbnails);
+       priv = ev_sidebar_thumbnails->priv = ev_sidebar_thumbnails_get_instance_private 
(ev_sidebar_thumbnails);
        priv->blank_first_dual_mode = FALSE;
 
        priv->list_store = gtk_list_store_new (NUM_COLUMNS,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]