Commit e7336488 authored by Jason Crain's avatar Jason Crain

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
parent 1b7e5ca4
Pipeline #101768 passed with stage
in 7 minutes and 2 seconds
......@@ -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)
......
......@@ -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;
......
......@@ -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 *
......
......@@ -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 *
......
......@@ -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",
......
......@@ -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",
......
......@@ -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",
......
......@@ -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 *
......
......@@ -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 *
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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.;
......
......@@ -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;