[clutter] interactive: Use ClutterActor instead of deprecated classes



commit 8f1575b970936762039083df49925afaec9c48f7
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue Jan 17 16:20:41 2012 +0000

    interactive: Use ClutterActor instead of deprecated classes

 tests/interactive/test-actors.c    |    2 +-
 tests/interactive/test-scrolling.c |   14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/tests/interactive/test-actors.c b/tests/interactive/test-actors.c
index 950798c..54b4125 100644
--- a/tests/interactive/test-actors.c
+++ b/tests/interactive/test-actors.c
@@ -212,7 +212,7 @@ test_actors_main (int argc, char *argv[])
   g_free (file);
 
   /* create a new group to hold multiple actors in a group */
-  oh->group = clutter_group_new();
+  oh->group = clutter_actor_new ();
   clutter_actor_set_name (oh->group, "Group");
   g_signal_connect (oh->group, "destroy", G_CALLBACK (on_group_destroy), oh);
   clutter_actor_add_constraint (oh->group, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
diff --git a/tests/interactive/test-scrolling.c b/tests/interactive/test-scrolling.c
index 9699d55..87aed0e 100644
--- a/tests/interactive/test-scrolling.c
+++ b/tests/interactive/test-scrolling.c
@@ -85,8 +85,8 @@ test_scrolling_main (int argc, char *argv[])
    * size to be the same as one rectangle, position it in the middle of
    * the stage and set it to clip its contents to the allocated size
    */
-  scroll = clutter_group_new ();
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), scroll);
+  scroll = clutter_actor_new ();
+  clutter_actor_add_child (stage, scroll);
   clutter_actor_set_size (scroll, RECT_WIDTH, RECT_HEIGHT);
   clutter_actor_add_constraint (scroll, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
   clutter_actor_set_clip_to_allocation (scroll, TRUE);
@@ -96,8 +96,9 @@ test_scrolling_main (int argc, char *argv[])
    * the dragging ends we check whether we're dragging past the end of
    * the viewport
    */
-  viewport = clutter_box_new (clutter_box_layout_new ());
-  clutter_container_add_actor (CLUTTER_CONTAINER (scroll), viewport);
+  viewport = clutter_actor_new ();
+  clutter_actor_set_layout_manager (viewport, clutter_box_layout_new ());
+  clutter_actor_add_child (scroll, viewport);
 
   /* add dragging capabilities to the viewport; the heavy lifting is
    * all done by the DragAction itself, plus the ::drag-end signal
@@ -117,8 +118,9 @@ test_scrolling_main (int argc, char *argv[])
 
       clutter_color_from_string (&color, rect_color[i]);
 
-      rectangle[i] = clutter_rectangle_new_with_color (&color);
-      clutter_container_add_actor (CLUTTER_CONTAINER (viewport), rectangle[i]);
+      rectangle[i] = clutter_actor_new ();
+      clutter_actor_set_background_color (rectangle[i], &color);
+      clutter_actor_add_child (viewport, rectangle[i]);
       clutter_actor_set_size (rectangle[i], RECT_WIDTH, RECT_HEIGHT);
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]