From b01506e3eebfac7419cf1e3cb0662b61ec91fa2d Mon Sep 17 00:00:00 2001 From: Pierre-Luc Beaudoin Date: Tue, 25 Aug 2009 18:33:57 -0400 Subject: [PATCH] Final fix for 577592: Use _priv instead of the GET_PRIVATE macro --- champlain-gtk/gtk-champlain-embed.c | 4 +- champlain/champlain-polygon.c | 4 +- champlain/champlain-tile.c | 58 +++++++++++++---------------- champlain/champlain-tile.h | 4 ++ 4 files changed, 34 insertions(+), 36 deletions(-) diff --git a/champlain-gtk/gtk-champlain-embed.c b/champlain-gtk/gtk-champlain-embed.c index 81c3775..bb4c141 100644 --- a/champlain-gtk/gtk-champlain-embed.c +++ b/champlain-gtk/gtk-champlain-embed.c @@ -53,7 +53,7 @@ enum //static guint gtk_champlain_embed_embed_signals[LAST_SIGNAL] = { 0, }; -#define GTK_CHAMPLAIN_EMBED_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_TYPE_CHAMPLAIN_EMBED, GtkChamplainEmbedPrivate)) +#define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_TYPE_CHAMPLAIN_EMBED, GtkChamplainEmbedPrivate)) struct _GtkChamplainEmbedPrivate { @@ -211,7 +211,7 @@ gtk_champlain_embed_init (GtkChamplainEmbed *embed) ClutterActor *stage; GtkStyle *style; - GtkChamplainEmbedPrivate *priv = GTK_CHAMPLAIN_EMBED_GET_PRIVATE (embed); + GtkChamplainEmbedPrivate *priv = GET_PRIVATE (embed); embed->priv = priv; priv->clutter_embed = gtk_clutter_embed_new (); diff --git a/champlain/champlain-polygon.c b/champlain/champlain-polygon.c index 730af64..6ca6545 100644 --- a/champlain/champlain-polygon.c +++ b/champlain/champlain-polygon.c @@ -59,7 +59,7 @@ champlain_polygon_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - ChamplainPolygonPrivate *priv = GET_PRIVATE (object); + ChamplainPolygonPrivate *priv = CHAMPLAIN_POLYGON (object)->priv; switch (property_id) { @@ -95,7 +95,7 @@ champlain_polygon_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - ChamplainPolygonPrivate *priv = GET_PRIVATE (object); + ChamplainPolygonPrivate *priv = CHAMPLAIN_POLYGON (object)->priv; switch (property_id) { diff --git a/champlain/champlain-tile.c b/champlain/champlain-tile.c index 07ff07b..7b22f84 100644 --- a/champlain/champlain-tile.c +++ b/champlain/champlain-tile.c @@ -55,8 +55,6 @@ enum PROP_ETAG }; -typedef struct _ChamplainTilePrivate ChamplainTilePrivate; - struct _ChamplainTilePrivate { gint x; gint y; @@ -162,7 +160,7 @@ champlain_tile_set_property (GObject *object, static void champlain_tile_dispose (GObject *object) { - ChamplainTilePrivate *priv = GET_PRIVATE (object); + ChamplainTilePrivate *priv = CHAMPLAIN_TILE (object)->priv; if (priv->actor != NULL) { @@ -182,7 +180,7 @@ champlain_tile_dispose (GObject *object) static void champlain_tile_finalize (GObject *object) { - ChamplainTilePrivate *priv = GET_PRIVATE (object); + ChamplainTilePrivate *priv = CHAMPLAIN_TILE (object)->priv; g_free (priv->uri); g_free (priv->filename); @@ -374,6 +372,7 @@ static void champlain_tile_init (ChamplainTile *self) { ChamplainTilePrivate *priv = GET_PRIVATE (self); + self->priv = priv; priv->state = CHAMPLAIN_STATE_INIT; priv->x = 0; @@ -415,7 +414,7 @@ champlain_tile_get_x (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), 0); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; return priv->x; } @@ -433,7 +432,7 @@ champlain_tile_get_y (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), 0); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; return priv->y; } @@ -451,7 +450,7 @@ champlain_tile_get_zoom_level (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), 0); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; return priv->zoom_level; } @@ -469,7 +468,7 @@ champlain_tile_get_size (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), 0); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; return priv->size; } @@ -487,7 +486,7 @@ champlain_tile_get_state (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), CHAMPLAIN_STATE_NONE); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; return priv->state; } @@ -505,7 +504,7 @@ champlain_tile_get_uri (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; return priv->uri; } @@ -523,7 +522,7 @@ champlain_tile_get_filename (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; return priv->filename; } @@ -542,9 +541,7 @@ champlain_tile_get_actor (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); - - return priv->actor; + return self->priv->actor; } /** @@ -562,7 +559,7 @@ champlain_tile_set_x (ChamplainTile *self, { g_return_if_fail(CHAMPLAIN_TILE(self)); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; priv->x = x; @@ -588,7 +585,7 @@ champlain_tile_set_y (ChamplainTile *self, { g_return_if_fail(CHAMPLAIN_TILE(self)); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; priv->y = y; if (priv->actor != NULL) @@ -612,7 +609,7 @@ champlain_tile_set_zoom_level (ChamplainTile *self, { g_return_if_fail(CHAMPLAIN_TILE(self)); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; priv->zoom_level = zoom_level; g_object_notify (G_OBJECT (self), "zoom-level"); @@ -633,7 +630,7 @@ champlain_tile_set_size (ChamplainTile *self, { g_return_if_fail(CHAMPLAIN_TILE(self)); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; priv->size = size; @@ -658,7 +655,7 @@ champlain_tile_set_state (ChamplainTile *self, { g_return_if_fail(CHAMPLAIN_TILE(self)); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; priv->state = state; g_object_notify (G_OBJECT (self), "state"); @@ -702,7 +699,7 @@ champlain_tile_set_uri (ChamplainTile *self, g_return_if_fail(CHAMPLAIN_TILE(self)); g_return_if_fail(uri != NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; g_free (priv->uri); priv->uri = g_strdup (uri); @@ -725,7 +722,7 @@ champlain_tile_set_filename (ChamplainTile *self, g_return_if_fail(CHAMPLAIN_TILE(self)); g_return_if_fail(filename != NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; g_free (priv->filename); priv->filename = g_strdup (filename); @@ -745,7 +742,7 @@ champlain_tile_get_modified_time (ChamplainTile *self) { g_return_val_if_fail (CHAMPLAIN_TILE(self), NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; return priv->modified_time; } @@ -766,7 +763,7 @@ champlain_tile_set_modified_time (ChamplainTile *self, g_return_if_fail (CHAMPLAIN_TILE(self)); g_return_if_fail (time != NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; g_free (priv->modified_time); priv->modified_time = g_memdup(time_, sizeof (GTimeVal)); @@ -784,7 +781,7 @@ gchar * champlain_tile_get_modified_time_string (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; if (priv->modified_time == NULL) return NULL; @@ -809,9 +806,8 @@ const gchar * champlain_tile_get_etag (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), ""); - ChamplainTilePrivate *priv = GET_PRIVATE (self); - return priv->etag; + return self->priv->etag; } /** @@ -829,7 +825,7 @@ champlain_tile_set_etag (ChamplainTile *self, { g_return_if_fail(CHAMPLAIN_TILE(self)); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; g_free (priv->etag); priv->etag = g_strdup (etag); @@ -846,7 +842,7 @@ fade_in_completed (ClutterAnimation *animation, gpointer data) { AnimationContext* ctx = (AnimationContext*) data; - ChamplainTilePrivate *priv = GET_PRIVATE (ctx->tile); + ChamplainTilePrivate *priv = ctx->tile->priv; if (ctx->old_actor != NULL) { @@ -877,7 +873,7 @@ champlain_tile_set_content (ChamplainTile *self, g_return_if_fail(CHAMPLAIN_TILE(self)); g_return_if_fail(actor != NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); + ChamplainTilePrivate *priv = self->priv; ClutterActor *old_actor = NULL; if (priv->content_actor != NULL) @@ -925,8 +921,6 @@ champlain_tile_get_content (ChamplainTile *self) { g_return_val_if_fail(CHAMPLAIN_TILE(self), NULL); - ChamplainTilePrivate *priv = GET_PRIVATE (self); - - return priv->content_actor; + return self->priv->content_actor; } diff --git a/champlain/champlain-tile.h b/champlain/champlain-tile.h index 095f324..01c7fe4 100644 --- a/champlain/champlain-tile.h +++ b/champlain/champlain-tile.h @@ -43,8 +43,12 @@ G_BEGIN_DECLS #define CHAMPLAIN_TILE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_TILE, ChamplainTileClass)) +typedef struct _ChamplainTilePrivate ChamplainTilePrivate; + typedef struct { GObject parent; + + ChamplainTilePrivate *priv; } ChamplainTile; typedef struct { -- 2.39.5