Commit 8b948baf authored by Jiří Techet's avatar Jiří Techet

Remove some unnecessary code from tidy

parent 154e8aee
......@@ -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 ||
......
......@@ -350,7 +350,7 @@ tidy_adjustment_set_value (TidyAdjustment *adjustment,
}
}
void
static void
tidy_adjustment_clamp_page (TidyAdjustment *adjustment,
double lower,
double upper)
......
......@@ -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,
......
......@@ -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);
......@@ -287,15 +272,6 @@ tidy_viewport_class_init (TidyViewportClass *klass)
0,
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",
......@@ -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;
}
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment