[clutter/wip/master-next: 24/31] Remove usage of ClutterLayoutManager easing API
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/master-next: 24/31] Remove usage of ClutterLayoutManager easing API
- Date: Wed, 11 Jul 2012 14:41:31 +0000 (UTC)
commit b1b3bfb74ee88ef6349c2094a229171d9afa2f49
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Jul 11 13:21:33 2012 +0100
Remove usage of ClutterLayoutManager easing API
It is going away.
examples/box-layout.c | 9 ---------
examples/flow-layout.c | 9 ---------
examples/grid-layout.c | 8 --------
examples/layout-manager.c | 22 ++--------------------
4 files changed, 2 insertions(+), 46 deletions(-)
---
diff --git a/examples/box-layout.c b/examples/box-layout.c
index 5f71fb4..455dd95 100644
--- a/examples/box-layout.c
+++ b/examples/box-layout.c
@@ -24,7 +24,6 @@
"Press h\t\342\236\236\tSwitch homogeneous\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 a\t\342\236\236\tSwitch animations on/off\n" \
"Press +\t\342\236\236\tAdd a new actor\n" \
"Press q\t\342\236\236\tQuit"
@@ -190,13 +189,6 @@ key_release_cb (ClutterActor *stage,
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:
{
ClutterOrientation orientation;
@@ -273,7 +265,6 @@ main (int argc, char *argv[])
clutter_actor_set_x_expand (box, TRUE);
clutter_actor_set_y_expand (box, TRUE);
layout = clutter_box_layout_new ();
- clutter_layout_manager_set_use_animations (layout, TRUE);
clutter_actor_set_layout_manager (box, layout);
clutter_actor_add_child (stage, box);
diff --git a/examples/flow-layout.c b/examples/flow-layout.c
index ef21d9b..f21c3a4 100644
--- a/examples/flow-layout.c
+++ b/examples/flow-layout.c
@@ -9,7 +9,6 @@ static gboolean is_homogeneous = FALSE;
static gboolean vertical = FALSE;
static gboolean random_size = FALSE;
static gboolean fixed_size = FALSE;
-static gboolean use_animations = FALSE;
static gint n_rects = N_RECTS;
static gint x_spacing = 0;
@@ -65,13 +64,6 @@ static GOptionEntry entries[] = {
&fixed_size,
"Fix the layout size", NULL
},
- {
- "use-animations", 'a',
- 0,
- G_OPTION_ARG_NONE,
- &use_animations,
- "Use animations", NULL
- },
{ NULL }
};
@@ -110,7 +102,6 @@ main (int argc, char *argv[])
x_spacing);
clutter_flow_layout_set_row_spacing (CLUTTER_FLOW_LAYOUT (layout),
y_spacing);
- clutter_layout_manager_set_use_animations (layout, use_animations);
box = clutter_actor_new ();
clutter_actor_set_layout_manager (box, layout);
diff --git a/examples/grid-layout.c b/examples/grid-layout.c
index ffeefaf..c47d881 100644
--- a/examples/grid-layout.c
+++ b/examples/grid-layout.c
@@ -23,7 +23,6 @@
"Press r\t\342\236\236\tSwitch row 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 a\t\342\236\236\tSwitch animations on/off\n" \
"Press q\t\342\236\236\tQuit\n\n" \
"Left/right click\t\t\342\236\236\tChange actor align\n" \
"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))
{
- 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:
toggle = clutter_grid_layout_get_column_homogeneous (layout);
clutter_grid_layout_set_column_homogeneous (layout, !toggle);
diff --git a/examples/layout-manager.c b/examples/layout-manager.c
index 1ad4042..f8e50e3 100644
--- a/examples/layout-manager.c
+++ b/examples/layout-manager.c
@@ -193,9 +193,6 @@ multi_layout_allocate (ClutterLayoutManager *manager,
int n_items, n_items_per_row = 0, item_index;
ClutterPoint center = CLUTTER_POINT_INIT_ZERO;
double radius = 0, theta = 0;
- gboolean use_animations;
- ClutterAnimationMode easing_mode;
- guint easing_duration, easing_delay;
n_items = get_visible_children (CLUTTER_ACTOR (container));
if (n_items == 0)
@@ -224,11 +221,6 @@ multi_layout_allocate (ClutterLayoutManager *manager,
(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));
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;
}
- 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);
- if (use_animations)
- clutter_actor_restore_easing_state (child);
-
item_index += 1;
}
}
@@ -404,7 +385,6 @@ main (int argc, char *argv[])
manager = multi_layout_new ();
multi_layout_set_spacing ((MultiLayout *) manager, PADDING);
- clutter_layout_manager_set_use_animations (manager, TRUE);
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_background_color (rect, &color);
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);
g_signal_connect (rect, "enter-event", G_CALLBACK (on_enter), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]