From: Debarshi Ray Date: Fri, 3 Apr 2009 07:28:48 +0000 (+0300) Subject: Fix Bug 577592 for ChamplainZoomLevel X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0f0752586f69f072e8c92eaf866b634c97ce147;p=libchamplain Fix Bug 577592 for ChamplainZoomLevel --- diff --git a/AUTHORS b/AUTHORS index b7f2a65..118026c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,5 +12,5 @@ Emmanuele Bassi Lionel Dricot Simon Wenner Kritarth Upadhyay -Debarshi Ray +Debarshi Ray Sjoerd Simons diff --git a/champlain/champlain-zoom-level.c b/champlain/champlain-zoom-level.c index 4d0dedc..cfae4f7 100644 --- a/champlain/champlain-zoom-level.c +++ b/champlain/champlain-zoom-level.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Pierre-Luc Beaudoin + * Copyright (C) 2008, 2009 Pierre-Luc Beaudoin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -47,8 +47,6 @@ enum PROP_ACTOR }; -typedef struct _ChamplainZoomLevelPrivate ChamplainZoomLevelPrivate; - struct _ChamplainZoomLevelPrivate { guint width; guint height; @@ -112,8 +110,8 @@ champlain_zoom_level_dispose (GObject *object) { //FIXME: Get rid of tiles here? guint k; - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (object); ChamplainZoomLevel *level = CHAMPLAIN_ZOOM_LEVEL (object); + ChamplainZoomLevelPrivate *priv = level->priv; g_object_unref (priv->actor); @@ -201,6 +199,7 @@ champlain_zoom_level_init (ChamplainZoomLevel *self) priv->tiles = g_ptr_array_sized_new (64); priv->actor = g_object_ref (clutter_group_new ()); + self->priv = priv; } ChamplainZoomLevel* @@ -215,7 +214,7 @@ champlain_zoom_level_add_tile (ChamplainZoomLevel *self, { g_return_if_fail (CHAMPLAIN_ZOOM_LEVEL (self)); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; g_object_ref (tile); g_ptr_array_add (priv->tiles, tile); @@ -228,7 +227,7 @@ champlain_zoom_level_remove_tile (ChamplainZoomLevel *self, { g_return_if_fail (CHAMPLAIN_ZOOM_LEVEL (self)); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; g_signal_emit (self, signals[SIGNAL_TILE_REMOVED], 0, tile); g_ptr_array_remove_fast (priv->tiles, tile); @@ -240,7 +239,7 @@ champlain_zoom_level_tile_count (ChamplainZoomLevel *self) { g_return_val_if_fail (CHAMPLAIN_ZOOM_LEVEL (self), 0); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; return priv->tiles->len; } @@ -251,7 +250,7 @@ champlain_zoom_level_get_nth_tile (ChamplainZoomLevel *self, { g_return_val_if_fail (CHAMPLAIN_ZOOM_LEVEL (self), NULL); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; return g_ptr_array_index (priv->tiles, index); } @@ -262,7 +261,7 @@ champlain_zoom_level_get_width (ChamplainZoomLevel *self) g_return_val_if_fail (CHAMPLAIN_ZOOM_LEVEL (self), 0); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; return priv->width; } @@ -272,7 +271,7 @@ champlain_zoom_level_get_height (ChamplainZoomLevel *self) { g_return_val_if_fail (CHAMPLAIN_ZOOM_LEVEL (self), 0); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; return priv->height; } @@ -282,7 +281,7 @@ champlain_zoom_level_get_zoom_level (ChamplainZoomLevel *self) { g_return_val_if_fail (CHAMPLAIN_ZOOM_LEVEL (self), 0); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; return priv->zoom_level; } @@ -293,7 +292,7 @@ champlain_zoom_level_set_width (ChamplainZoomLevel *self, { g_return_if_fail (CHAMPLAIN_ZOOM_LEVEL (self)); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; priv->width = width; g_object_notify (G_OBJECT (self), "width"); @@ -305,7 +304,7 @@ champlain_zoom_level_set_height (ChamplainZoomLevel *self, { g_return_if_fail (CHAMPLAIN_ZOOM_LEVEL (self)); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; priv->height = height; g_object_notify (G_OBJECT (self), "height"); @@ -318,7 +317,7 @@ champlain_zoom_level_set_zoom_level (ChamplainZoomLevel *self, { g_return_if_fail (CHAMPLAIN_ZOOM_LEVEL (self)); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; priv->zoom_level = zoom_level; g_object_notify (G_OBJECT (self), "zoom-level"); @@ -330,7 +329,7 @@ champlain_zoom_level_get_actor (ChamplainZoomLevel *self) { g_return_val_if_fail (CHAMPLAIN_ZOOM_LEVEL (self), NULL); - ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self); + ChamplainZoomLevelPrivate *priv = self->priv; return priv->actor; } diff --git a/champlain/champlain-zoom-level.h b/champlain/champlain-zoom-level.h index d1e9b99..b252b90 100644 --- a/champlain/champlain-zoom-level.h +++ b/champlain/champlain-zoom-level.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Pierre-Luc Beaudoin + * Copyright (C) 2008, 2009 Pierre-Luc Beaudoin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,8 +43,11 @@ G_BEGIN_DECLS #define CHAMPLAIN_ZOOM_LEVEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_ZOOM_LEVEL, ChamplainZoomLevelClass)) +typedef struct _ChamplainZoomLevelPrivate ChamplainZoomLevelPrivate; + typedef struct { GObject parent; + ChamplainZoomLevelPrivate *priv; } ChamplainZoomLevel; typedef struct {