gdk: Use new macros for defining private data

Drop the g_type_class_add_private() function, and use the macros
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=702996
This commit is contained in:
Emmanuele Bassi 2013-06-24 18:54:05 +01:00
parent e77733ea2c
commit 9f2ca8d851
2 changed files with 6 additions and 15 deletions

View File

@ -69,8 +69,6 @@
* they will stay exactly synchronized.
*/
G_DEFINE_ABSTRACT_TYPE (GdkFrameClock, gdk_frame_clock, G_TYPE_OBJECT)
enum {
FLUSH_EVENTS,
BEFORE_PAINT,
@ -94,6 +92,8 @@ struct _GdkFrameClockPrivate
GdkFrameTimings *timings[FRAME_HISTORY_MAX_LENGTH];
};
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GdkFrameClock, gdk_frame_clock, G_TYPE_OBJECT)
static void
gdk_frame_clock_finalize (GObject *object)
{
@ -236,8 +236,6 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_type_class_add_private (klass, sizeof (GdkFrameClockPrivate));
}
static void
@ -245,10 +243,7 @@ gdk_frame_clock_init (GdkFrameClock *clock)
{
GdkFrameClockPrivate *priv;
clock->priv = G_TYPE_INSTANCE_GET_PRIVATE (clock,
GDK_TYPE_FRAME_CLOCK,
GdkFrameClockPrivate);
priv = clock->priv;
clock->priv = priv = gdk_frame_clock_get_instance_private (clock);
priv->frame_counter = -1;
priv->current = FRAME_HISTORY_MAX_LENGTH - 1;

View File

@ -63,7 +63,7 @@ struct _GdkFrameClockIdlePrivate
static gboolean gdk_frame_clock_flush_idle (void *data);
static gboolean gdk_frame_clock_paint_idle (void *data);
G_DEFINE_TYPE (GdkFrameClockIdle, gdk_frame_clock_idle, GDK_TYPE_FRAME_CLOCK)
G_DEFINE_TYPE_WITH_PRIVATE (GdkFrameClockIdle, gdk_frame_clock_idle, GDK_TYPE_FRAME_CLOCK)
static gint64 sleep_serial;
static gint64 sleep_source_prepare_time;
@ -122,10 +122,8 @@ gdk_frame_clock_idle_init (GdkFrameClockIdle *frame_clock_idle)
{
GdkFrameClockIdlePrivate *priv;
frame_clock_idle->priv = G_TYPE_INSTANCE_GET_PRIVATE (frame_clock_idle,
GDK_TYPE_FRAME_CLOCK_IDLE,
GdkFrameClockIdlePrivate);
priv = frame_clock_idle->priv;
frame_clock_idle->priv = priv =
gdk_frame_clock_idle_get_instance_private (frame_clock_idle);
priv->freeze_count = 0;
}
@ -581,8 +579,6 @@ gdk_frame_clock_idle_class_init (GdkFrameClockIdleClass *klass)
frame_clock_class->end_updating = gdk_frame_clock_idle_end_updating;
frame_clock_class->freeze = gdk_frame_clock_idle_freeze;
frame_clock_class->thaw = gdk_frame_clock_idle_thaw;
g_type_class_add_private (klass, sizeof (GdkFrameClockIdlePrivate));
}
GdkFrameClock *