Remove usage of ClutterLayoutManager easing API

It is going away.
This commit is contained in:
Emmanuele Bassi 2012-07-11 13:21:33 +01:00
parent b985c4035e
commit b1b3bfb74e
4 changed files with 2 additions and 46 deletions

View File

@ -24,7 +24,6 @@
"Press h\t\342\236\236\tSwitch homogeneous\n" \ "Press h\t\342\236\236\tSwitch homogeneous\n" \
"Press p\t\342\236\236\tSwitch pack start/end\n" \ "Press p\t\342\236\236\tSwitch pack start/end\n" \
"Press s\t\342\236\236\tIncrement spacing (up to 12px)\n" \ "Press s\t\342\236\236\tIncrement spacing (up to 12px)\n" \
"Press a\t\342\236\236\tSwitch animations on/off\n" \
"Press +\t\342\236\236\tAdd a new actor\n" \ "Press +\t\342\236\236\tAdd a new actor\n" \
"Press q\t\342\236\236\tQuit" "Press q\t\342\236\236\tQuit"
@ -190,13 +189,6 @@ key_release_cb (ClutterActor *stage,
switch (clutter_event_get_key_symbol (event)) switch (clutter_event_get_key_symbol (event))
{ {
case CLUTTER_KEY_a:
toggle = clutter_layout_manager_get_use_animations
(CLUTTER_LAYOUT_MANAGER (layout));
clutter_layout_manager_set_use_animations
(CLUTTER_LAYOUT_MANAGER (layout), !toggle);
break;
case CLUTTER_KEY_v: case CLUTTER_KEY_v:
{ {
ClutterOrientation orientation; ClutterOrientation orientation;
@ -273,7 +265,6 @@ main (int argc, char *argv[])
clutter_actor_set_x_expand (box, TRUE); clutter_actor_set_x_expand (box, TRUE);
clutter_actor_set_y_expand (box, TRUE); clutter_actor_set_y_expand (box, TRUE);
layout = clutter_box_layout_new (); layout = clutter_box_layout_new ();
clutter_layout_manager_set_use_animations (layout, TRUE);
clutter_actor_set_layout_manager (box, layout); clutter_actor_set_layout_manager (box, layout);
clutter_actor_add_child (stage, box); clutter_actor_add_child (stage, box);

View File

@ -9,7 +9,6 @@ static gboolean is_homogeneous = FALSE;
static gboolean vertical = FALSE; static gboolean vertical = FALSE;
static gboolean random_size = FALSE; static gboolean random_size = FALSE;
static gboolean fixed_size = FALSE; static gboolean fixed_size = FALSE;
static gboolean use_animations = FALSE;
static gint n_rects = N_RECTS; static gint n_rects = N_RECTS;
static gint x_spacing = 0; static gint x_spacing = 0;
@ -65,13 +64,6 @@ static GOptionEntry entries[] = {
&fixed_size, &fixed_size,
"Fix the layout size", NULL "Fix the layout size", NULL
}, },
{
"use-animations", 'a',
0,
G_OPTION_ARG_NONE,
&use_animations,
"Use animations", NULL
},
{ NULL } { NULL }
}; };
@ -110,7 +102,6 @@ main (int argc, char *argv[])
x_spacing); x_spacing);
clutter_flow_layout_set_row_spacing (CLUTTER_FLOW_LAYOUT (layout), clutter_flow_layout_set_row_spacing (CLUTTER_FLOW_LAYOUT (layout),
y_spacing); y_spacing);
clutter_layout_manager_set_use_animations (layout, use_animations);
box = clutter_actor_new (); box = clutter_actor_new ();
clutter_actor_set_layout_manager (box, layout); clutter_actor_set_layout_manager (box, layout);

View File

@ -23,7 +23,6 @@
"Press r\t\342\236\236\tSwitch row homogeneous\n" \ "Press r\t\342\236\236\tSwitch row homogeneous\n" \
"Press c\t\342\236\236\tSwitch column homogeneous\n" \ "Press c\t\342\236\236\tSwitch column homogeneous\n" \
"Press s\t\342\236\236\tIncrement spacing (up to 12px)\n" \ "Press s\t\342\236\236\tIncrement spacing (up to 12px)\n" \
"Press a\t\342\236\236\tSwitch animations on/off\n" \
"Press q\t\342\236\236\tQuit\n\n" \ "Press q\t\342\236\236\tQuit\n\n" \
"Left/right click\t\t\342\236\236\tChange actor align\n" \ "Left/right click\t\t\342\236\236\tChange actor align\n" \
"Shift left/right click\t\342\236\236\tChange actor expand" "Shift left/right click\t\342\236\236\tChange actor expand"
@ -277,13 +276,6 @@ key_release_cb (ClutterActor *stage,
switch (clutter_event_get_key_symbol (event)) switch (clutter_event_get_key_symbol (event))
{ {
case CLUTTER_KEY_a:
toggle = clutter_layout_manager_get_use_animations
(CLUTTER_LAYOUT_MANAGER (layout));
clutter_layout_manager_set_use_animations
(CLUTTER_LAYOUT_MANAGER (layout), !toggle);
break;
case CLUTTER_KEY_c: case CLUTTER_KEY_c:
toggle = clutter_grid_layout_get_column_homogeneous (layout); toggle = clutter_grid_layout_get_column_homogeneous (layout);
clutter_grid_layout_set_column_homogeneous (layout, !toggle); clutter_grid_layout_set_column_homogeneous (layout, !toggle);

View File

@ -193,9 +193,6 @@ multi_layout_allocate (ClutterLayoutManager *manager,
int n_items, n_items_per_row = 0, item_index; int n_items, n_items_per_row = 0, item_index;
ClutterPoint center = CLUTTER_POINT_INIT_ZERO; ClutterPoint center = CLUTTER_POINT_INIT_ZERO;
double radius = 0, theta = 0; double radius = 0, theta = 0;
gboolean use_animations;
ClutterAnimationMode easing_mode;
guint easing_duration, easing_delay;
n_items = get_visible_children (CLUTTER_ACTOR (container)); n_items = get_visible_children (CLUTTER_ACTOR (container));
if (n_items == 0) if (n_items == 0)
@ -224,11 +221,6 @@ multi_layout_allocate (ClutterLayoutManager *manager,
(avail_height - self->cell_height) / 2.0); (avail_height - self->cell_height) / 2.0);
} }
use_animations = clutter_layout_manager_get_easing_state (manager,
&easing_mode,
&easing_duration,
&easing_delay);
clutter_actor_iter_init (&iter, CLUTTER_ACTOR (container)); clutter_actor_iter_init (&iter, CLUTTER_ACTOR (container));
while (clutter_actor_iter_next (&iter, &child)) while (clutter_actor_iter_next (&iter, &child))
{ {
@ -262,19 +254,8 @@ multi_layout_allocate (ClutterLayoutManager *manager,
child_allocation.y2 = child_allocation.y1 + self->cell_height; child_allocation.y2 = child_allocation.y1 + self->cell_height;
} }
if (use_animations)
{
clutter_actor_save_easing_state (child);
clutter_actor_set_easing_mode (child, easing_mode);
clutter_actor_set_easing_duration (child, easing_duration);
clutter_actor_set_easing_delay (child, easing_delay);
}
clutter_actor_allocate (child, &child_allocation, flags); clutter_actor_allocate (child, &child_allocation, flags);
if (use_animations)
clutter_actor_restore_easing_state (child);
item_index += 1; item_index += 1;
} }
} }
@ -404,7 +385,6 @@ main (int argc, char *argv[])
manager = multi_layout_new (); manager = multi_layout_new ();
multi_layout_set_spacing ((MultiLayout *) manager, PADDING); multi_layout_set_spacing ((MultiLayout *) manager, PADDING);
clutter_layout_manager_set_use_animations (manager, TRUE);
margin.top = margin.bottom = margin.left = margin.right = PADDING; margin.top = margin.bottom = margin.left = margin.right = PADDING;
@ -431,6 +411,8 @@ main (int argc, char *argv[])
clutter_actor_set_pivot_point (rect, .5f, .5f); clutter_actor_set_pivot_point (rect, .5f, .5f);
clutter_actor_set_background_color (rect, &color); clutter_actor_set_background_color (rect, &color);
clutter_actor_set_reactive (rect, TRUE); clutter_actor_set_reactive (rect, TRUE);
clutter_actor_set_easing_duration (rect, 250);
clutter_actor_set_easing_mode (rect, CLUTTER_EASE_OUT_CUBIC);
clutter_actor_add_child (box, rect); clutter_actor_add_child (box, rect);
g_signal_connect (rect, "enter-event", G_CALLBACK (on_enter), NULL); g_signal_connect (rect, "enter-event", G_CALLBACK (on_enter), NULL);