license_set_position (ChamplainView *view)
{
ChamplainViewPrivate *priv = view->priv;
- guint width, height;
+ gfloat width, height;
if (!priv->license_actor)
return;
* is higher and if the points are far away
*/
duration = 500 * priv->zoom_level / 2.0;
- ctx->timeline = clutter_timeline_new_for_duration (duration);
+ ctx->timeline = clutter_timeline_new (duration);
ctx->alpha = clutter_alpha_new_full (ctx->timeline, CLUTTER_EASE_IN_OUT_CIRC);
g_signal_connect (ctx->timeline, "new-frame", G_CALLBACK (timeline_new_frame),
{
g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), FALSE);
ChamplainViewPrivate *priv = view->priv;
- gint actor_x, actor_y;
- gint rel_x, rel_y;
+ gfloat actor_x, actor_y;
+ gdouble rel_x, rel_y;
clutter_actor_get_transformed_position (priv->finger_scroll, &actor_x, &actor_y);
ClutterActor *group, *new_group;
gdouble lon, lat;
gint x_diff, y_diff;
- gint actor_x, actor_y;
- gint rel_x, rel_y;
- gint x2, y2;
+ gfloat actor_x, actor_y;
+ gdouble rel_x, rel_y;
+ gfloat x2, y2;
gdouble lat2, lon2;
if (zoom_level == priv->zoom_level || ZOOM_LEVEL_OUT_OF_RANGE(priv, zoom_level))
clutter_actor_set_anchor_point_from_gravity (bg, CLUTTER_GRAVITY_CENTER);
/* Animate the echo circle */
- timeline = clutter_timeline_new_for_duration (1000);
+ timeline = clutter_timeline_new (1000);
clutter_timeline_set_loop (timeline, TRUE);
alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_OUT_SINE);
ClutterActor *button, *button_bg, *button_text;
ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
ClutterColor black = { 0x00, 0x00, 0x00, 0xff };
- guint width, height;
+ gfloat width, height;
button = clutter_group_new ();
{
ClutterActor* actor, *stage, *buttons, *button;
ChamplainLayer *layer;
- guint width, total_width = 0;;
+ gfloat width, total_width = 0;;
g_thread_init (NULL);
clutter_init (&argc, &argv);
ClutterActor *button, *button_bg, *button_text;
ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
ClutterColor black = { 0x00, 0x00, 0x00, 0xff };
- guint width, height;
+ gfloat width, height;
button = clutter_group_new ();
{
ClutterActor* actor, *stage, *buttons, *button;
ChamplainPolygon *polygon;
- guint width, total_width = 0;;
+ gfloat width, total_width = 0;;
g_thread_init (NULL);
clutter_init (&argc, &argv);
}
}
-void
-tidy_adjustment_set_valuesx (TidyAdjustment *adjustment,
- gdouble value,
- gdouble lower,
- gdouble upper,
- gdouble step_increment,
- gdouble page_increment,
- gdouble page_size)
-{
- TidyAdjustmentPrivate *priv;
- gboolean emit_changed = FALSE;
-
- g_return_if_fail (TIDY_IS_ADJUSTMENT (adjustment));
-
- priv = adjustment->priv;
-
- stop_interpolation (adjustment);
-
- emit_changed = FALSE;
-
- g_object_freeze_notify (G_OBJECT (adjustment));
-
- if (priv->lower != lower)
- {
- priv->lower = lower;
- emit_changed = TRUE;
-
- g_object_notify (G_OBJECT (adjustment), "lower");
- }
-
- if (priv->upper != upper)
- {
- priv->upper = upper;
- emit_changed = TRUE;
-
- g_object_notify (G_OBJECT (adjustment), "upper");
- }
-
- if (priv->step_increment != step_increment)
- {
- priv->step_increment = step_increment;
- emit_changed = TRUE;
-
- g_object_notify (G_OBJECT (adjustment), "step-increment");
- }
-
- if (priv->page_increment != page_increment)
- {
- priv->page_increment = page_increment;
- emit_changed = TRUE;
-
- g_object_notify (G_OBJECT (adjustment), "page-increment");
- }
-
- if (priv->page_size != page_size)
- {
- priv->page_size = page_size;
- emit_changed = TRUE;
-
- g_object_notify (G_OBJECT (adjustment), "page-size");
- }
-
- tidy_adjustment_set_value (adjustment, value);
-
- if (emit_changed)
- g_signal_emit (G_OBJECT (adjustment), signals[CHANGED], 0);
-
- g_object_thaw_notify (G_OBJECT (adjustment));
-}
-
-void
-tidy_adjustment_get_valuesx (TidyAdjustment *adjustment,
- gdouble *value,
- gdouble *lower,
- gdouble *upper,
- gdouble *step_increment,
- gdouble *page_increment,
- gdouble *page_size)
-{
- TidyAdjustmentPrivate *priv;
-
- g_return_if_fail (TIDY_IS_ADJUSTMENT (adjustment));
-
- priv = adjustment->priv;
-
- if (lower)
- *lower = priv->lower;
-
- if (upper)
- *upper = priv->upper;
-
- if (value)
- *value = tidy_adjustment_get_value (adjustment);
-
- if (step_increment)
- *step_increment = priv->step_increment;
-
- if (page_increment)
- *page_increment = priv->page_increment;
-
- if (page_size)
- *page_size = priv->page_size;
-}
-
void
tidy_adjustment_get_values (TidyAdjustment *adjustment,
gdouble *value,
priv->new_position = value;
priv->dx = (priv->new_position - priv->old_position) * n_frames;
- priv->interpolation = clutter_timeline_new (n_frames, fps);
+ priv->interpolation = clutter_timeline_new (((float)n_frames / fps) * 1000);
if (priv->elastic)
priv->bounce_alpha = clutter_alpha_new_full (priv->interpolation,
&hadjust,
&vadjust);
- for (i = 0; i < clutter_timeline_get_delta (timeline, NULL); i++)
+ for (i = 0; i < clutter_timeline_get_delta (timeline) / 15; i++)
{
tidy_adjustment_set_value (hadjust,
priv->dx +
}
/* Check if we've hit the upper or lower bounds and stop the timeline */
- tidy_adjustment_get_valuesx (hadjust, &value, &lower, &upper,
+ tidy_adjustment_get_values (hadjust, &value, &lower, &upper,
NULL, NULL, &page_size);
if (((priv->dx > 0) && (value < upper - page_size)) ||
((priv->dx < 0) && (value > lower)))
if (stop)
{
- tidy_adjustment_get_valuesx (vadjust, &value, &lower, &upper,
+ tidy_adjustment_get_values (vadjust, &value, &lower, &upper,
NULL, NULL, &page_size);
if (((priv->dy > 0) && (value < upper - page_size)) ||
((priv->dy < 0) && (value > lower)))
* either fix that, or calculate the correct maximum
* value for the buffer size
*/
+
x_origin += motion->x;
y_origin += motion->y;
motion_time.tv_sec += motion->time.tv_sec;
motion_time.tv_usec += motion->time.tv_usec;
}
- x_origin = x_origin / priv->last_motion;
- y_origin = y_origin / priv->last_motion;
+ x_origin /= priv->last_motion;
+ y_origin /= priv->last_motion;
motion_time.tv_sec /= priv->last_motion;
motion_time.tv_usec /= priv->last_motion;
step_increment) + lower) - value;
priv->dy = (d / a);
- priv->deceleration_timeline = clutter_timeline_new ((gint)n, 60);
+ priv->deceleration_timeline = clutter_timeline_new ((n / 60) * 1000.0);
}
else
{
step_increment) + lower) - value;
priv->dy = (d / a);
- priv->deceleration_timeline = clutter_timeline_new (4, 60);
+ priv->deceleration_timeline = clutter_timeline_new (250);
}
g_signal_connect (priv->deceleration_timeline, "new_frame",
static void
tidy_scroll_view_get_preferred_width (ClutterActor *actor,
- ClutterUnit for_height,
- ClutterUnit *min_width_p,
- ClutterUnit *natural_width_p)
+ gfloat for_height,
+ gfloat *min_width_p,
+ gfloat *natural_width_p)
{
TidyScrollViewPrivate *priv = TIDY_SCROLL_VIEW (actor)->priv;
static void
tidy_scroll_view_get_preferred_height (ClutterActor *actor,
- ClutterUnit for_width,
- ClutterUnit *min_height_p,
- ClutterUnit *natural_height_p)
+ gfloat for_width,
+ gfloat *min_height_p,
+ gfloat *natural_height_p)
{
TidyScrollViewPrivate *priv = TIDY_SCROLL_VIEW (actor)->priv;
static void
tidy_scroll_view_allocate (ClutterActor *actor,
const ClutterActorBox *box,
- gboolean absolute_origin_changed)
+ ClutterAllocationFlags flags)
{
ClutterActorBox child_box;
-
+
TidyScrollViewPrivate *priv = TIDY_SCROLL_VIEW (actor)->priv;
-
+
/* Chain up */
CLUTTER_ACTOR_CLASS (tidy_scroll_view_parent_class)->
- allocate (actor, box, absolute_origin_changed);
-
-
+ allocate (actor, box, flags);
-
/* Child */
child_box.x1 = 0;
child_box.x2 = box->x2 - box->x1;
child_box.y1 = 0;
child_box.y2 = box->y2 - box->y1;
-
-
+
if (priv->child)
{
- clutter_actor_allocate (priv->child, &child_box, absolute_origin_changed);
- clutter_actor_set_clipu (priv->child,
- child_box.x1,
- child_box.y1,
- child_box.x2 - child_box.x1,
- child_box.y2 - child_box.y1);
+ clutter_actor_allocate (priv->child, &child_box, flags);
+ clutter_actor_set_clip (priv->child,
+ child_box.x1,
+ child_box.y1,
+ child_box.x2 - child_box.x1,
+ child_box.y2 - child_box.y1);
}
-
+
}
static void
struct _TidyViewportPrivate
{
- ClutterUnit x;
- ClutterUnit y;
- ClutterUnit z;
+ gfloat x;
+ gfloat y;
+ gfloat z;
TidyAdjustment *hadjustment;
TidyAdjustment *vadjustment;
static void
tidy_viewport_allocate (ClutterActor *self,
const ClutterActorBox *box,
- gboolean absolute_origin_changed)
+ ClutterAllocationFlags flags)
{
CoglFixed prev_value;
/* Chain up */
CLUTTER_ACTOR_CLASS (tidy_viewport_parent_class)->
- allocate (self, box, absolute_origin_changed);
+ allocate (self, box, flags);
/* Refresh adjustments */
if (priv->sync_adjustments)
GParamSpec *pspec,
TidyViewport *self)
{
- gint width, height;
+ gfloat width, height;
TidyViewportPrivate *priv = self->priv;
if (!priv->sync_adjustments)