[libchamplain] Remove some unnecessary code from tidy
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Remove some unnecessary code from tidy
- Date: Sat, 26 Feb 2011 12:58:29 +0000 (UTC)
commit 8b948bafae69335df7ff438fc34fb7cd1c3830c5
Author: JiÅ?Ã Techet <techet gmail com>
Date: Thu Feb 24 22:29:30 2011 +0100
Remove some unnecessary code from tidy
champlain/champlain-view.c | 8 +++---
tidy/tidy-adjustment.c | 2 +-
tidy/tidy-adjustment.h | 3 --
tidy/tidy-viewport.c | 49 +++++--------------------------------------
tidy/tidy-viewport.h | 6 +---
5 files changed, 13 insertions(+), 55 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index b43e889..73687cb 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -266,8 +266,7 @@ update_viewport (ChamplainView *view,
g_signal_handlers_block_by_func (priv->viewport, G_CALLBACK (viewport_pos_changed_cb), view);
tidy_viewport_set_origin (TIDY_VIEWPORT (priv->viewport),
priv->viewport_x,
- priv->viewport_y,
- 0);
+ priv->viewport_y);
g_signal_handlers_unblock_by_func (priv->viewport, G_CALLBACK (viewport_pos_changed_cb), view);
g_signal_emit_by_name (view, "layer-relocated", NULL);
@@ -293,7 +292,7 @@ panning_completed (G_GNUC_UNUSED TidyFingerScroll *scroll,
gfloat absolute_x, absolute_y;
gfloat x, y;
- tidy_viewport_get_origin (TIDY_VIEWPORT (priv->viewport), &x, &y, NULL);
+ tidy_viewport_get_origin (TIDY_VIEWPORT (priv->viewport), &x, &y);
absolute_x = x + priv->anchor_x + priv->viewport_width / 2.0;
absolute_y = y + priv->anchor_y + priv->viewport_height / 2.0;
@@ -533,6 +532,7 @@ champlain_view_dispose (GObject *object)
if (priv->viewport != NULL)
{
+ tidy_viewport_stop (TIDY_VIEWPORT (priv->viewport));
g_object_unref (priv->viewport);
priv->viewport = NULL;
}
@@ -1084,7 +1084,7 @@ viewport_pos_changed_cb (G_GNUC_UNUSED GObject *gobject,
ChamplainViewPrivate *priv = view->priv;
gfloat x, y;
- tidy_viewport_get_origin (TIDY_VIEWPORT (priv->viewport), &x, &y, NULL);
+ tidy_viewport_get_origin (TIDY_VIEWPORT (priv->viewport), &x, &y);
if (fabs (x - priv->viewport_x) > 100 ||
fabs (y - priv->viewport_y) > 100 ||
diff --git a/tidy/tidy-adjustment.c b/tidy/tidy-adjustment.c
index cd0417e..6976ebb 100644
--- a/tidy/tidy-adjustment.c
+++ b/tidy/tidy-adjustment.c
@@ -350,7 +350,7 @@ tidy_adjustment_set_value (TidyAdjustment *adjustment,
}
}
-void
+static void
tidy_adjustment_clamp_page (TidyAdjustment *adjustment,
double lower,
double upper)
diff --git a/tidy/tidy-adjustment.h b/tidy/tidy-adjustment.h
index 3215354..ac34f19 100644
--- a/tidy/tidy-adjustment.h
+++ b/tidy/tidy-adjustment.h
@@ -80,9 +80,6 @@ TidyAdjustment *tidy_adjustment_new (gdouble value,
gdouble tidy_adjustment_get_value (TidyAdjustment *adjustment);
void tidy_adjustment_set_value (TidyAdjustment *adjustment,
gdouble value);
-void tidy_adjustment_clamp_page (TidyAdjustment *adjustment,
- gdouble lower,
- gdouble upper);
void tidy_adjustment_set_values (TidyAdjustment *adjustment,
gdouble value,
gdouble lower,
diff --git a/tidy/tidy-viewport.c b/tidy/tidy-viewport.c
index 63258e6..fd94d8b 100644
--- a/tidy/tidy-viewport.c
+++ b/tidy/tidy-viewport.c
@@ -40,7 +40,6 @@ struct _TidyViewportPrivate
{
gfloat x;
gfloat y;
- gfloat z;
TidyAdjustment *hadjustment;
TidyAdjustment *vadjustment;
@@ -54,7 +53,6 @@ enum
PROP_X_ORIGIN,
PROP_Y_ORIGIN,
- PROP_Z_ORIGIN,
PROP_HADJUST,
PROP_VADJUST,
PROP_SYNC_ADJUST,
@@ -80,10 +78,6 @@ tidy_viewport_get_property (GObject *object,
g_value_set_int (value, priv->y);
break;
- case PROP_Z_ORIGIN:
- g_value_set_int (value, priv->z);
- break;
-
case PROP_HADJUST :
tidy_viewport_get_adjustments (TIDY_VIEWPORT (object), &adjustment, NULL);
g_value_set_object (value, adjustment);
@@ -118,21 +112,12 @@ tidy_viewport_set_property (GObject *object,
case PROP_X_ORIGIN:
tidy_viewport_set_origin (viewport,
g_value_get_int (value),
- priv->y,
- priv->z);
+ priv->y);
break;
case PROP_Y_ORIGIN:
tidy_viewport_set_origin (viewport,
priv->x,
- g_value_get_int (value),
- priv->z);
- break;
-
- case PROP_Z_ORIGIN:
- tidy_viewport_set_origin (viewport,
- priv->x,
- priv->y,
g_value_get_int (value));
break;
@@ -198,7 +183,7 @@ tidy_viewport_paint (ClutterActor *self)
cogl_translate ((priv->x) * -1.0,
(priv->y) * -1.0,
- (priv->z) * -1.0);
+ 0.0);
CLUTTER_ACTOR_CLASS (tidy_viewport_parent_class)->paint (self);
@@ -288,15 +273,6 @@ tidy_viewport_class_init (TidyViewportClass *klass)
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
- PROP_Z_ORIGIN,
- g_param_spec_int ("z-origin",
- "Z Origin",
- "Origin's Z coordinate in pixels",
- -G_MAXINT, G_MAXINT,
- 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class,
PROP_SYNC_ADJUST,
g_param_spec_boolean ("sync-adjustments",
"Synchronise "
@@ -338,8 +314,7 @@ hadjustment_value_notify_cb (TidyAdjustment *adjustment,
tidy_viewport_set_origin (viewport,
value,
- priv->y,
- priv->z);
+ priv->y);
}
static void
@@ -353,8 +328,7 @@ vadjustment_value_notify_cb (TidyAdjustment *adjustment, GParamSpec *arg1,
tidy_viewport_set_origin (viewport,
priv->x,
- value,
- priv->z);
+ value);
}
void
@@ -521,8 +495,7 @@ tidy_viewport_new (void)
void
tidy_viewport_set_origin (TidyViewport *viewport,
float x,
- float y,
- float z)
+ float y)
{
TidyViewportPrivate *priv;
@@ -552,12 +525,6 @@ tidy_viewport_set_origin (TidyViewport *viewport,
y);
}
- if (z != priv->z)
- {
- priv->z = z;
- g_object_notify (G_OBJECT (viewport), "z-origin");
- }
-
g_object_thaw_notify (G_OBJECT (viewport));
clutter_actor_queue_redraw (CLUTTER_ACTOR (viewport));
@@ -566,8 +533,7 @@ tidy_viewport_set_origin (TidyViewport *viewport,
void
tidy_viewport_get_origin (TidyViewport *viewport,
float *x,
- float *y,
- float *z)
+ float *y)
{
TidyViewportPrivate *priv;
@@ -580,7 +546,4 @@ tidy_viewport_get_origin (TidyViewport *viewport,
if (y)
*y = priv->y;
-
- if (z)
- *z = priv->z;
}
diff --git a/tidy/tidy-viewport.h b/tidy/tidy-viewport.h
index d1e4efd..b6dcb96 100644
--- a/tidy/tidy-viewport.h
+++ b/tidy/tidy-viewport.h
@@ -58,13 +58,11 @@ ClutterActor * tidy_viewport_new (void);
void tidy_viewport_set_origin (TidyViewport *viewport,
float x,
- float y,
- float z);
+ float y);
void tidy_viewport_get_origin (TidyViewport *viewport,
gfloat *x,
- gfloat *y,
- gfloat *z);
+ gfloat *y);
void tidy_viewport_stop (TidyViewport *viewport);
void tidy_viewport_get_adjustments (TidyViewport *viewport,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]