[libchamplain] Eliminate the easier-to-fix Clutter warnings in demos



commit 602e50c7d5bdb1a07cbe178e79d7d5b2b0cd0986
Author: Jiří Techet <techet gmail com>
Date:   Fri Apr 12 02:22:25 2013 +0200

    Eliminate the easier-to-fix Clutter warnings in demos

 demos/animated-marker.c     |    6 +++---
 demos/create-destroy-test.c |    2 +-
 demos/launcher.c            |   19 ++++++++++---------
 demos/minimal.c             |    4 ++--
 demos/polygons.c            |   19 ++++++++++---------
 demos/url-marker.c          |    4 ++--
 6 files changed, 28 insertions(+), 26 deletions(-)
---
diff --git a/demos/animated-marker.c b/demos/animated-marker.c
index e47af55..8736298 100644
--- a/demos/animated-marker.c
+++ b/demos/animated-marker.c
@@ -55,7 +55,7 @@ create_marker ()
   cairo_destroy (cr);
 
   /* Add the circle to the marker */
-  clutter_container_add_actor (CLUTTER_CONTAINER (marker), bg);
+  clutter_actor_add_child (marker, bg);
   clutter_actor_set_anchor_point_from_gravity (bg, CLUTTER_GRAVITY_CENTER);
   clutter_actor_set_position (bg, 0, 0);
 
@@ -76,7 +76,7 @@ create_marker ()
   cairo_destroy (cr);
 
   /* Add the circle to the marker */
-  clutter_container_add_actor (CLUTTER_CONTAINER (marker), bg);
+  clutter_actor_add_child (marker, bg);
   clutter_actor_lower_bottom (bg); /* Ensure it is under the previous circle */
   clutter_actor_set_position (bg, 0, 0);
   clutter_actor_set_anchor_point_from_gravity (bg, CLUTTER_GRAVITY_CENTER);
@@ -137,7 +137,7 @@ main (int argc, char *argv[])
   /* Create the map view */
   actor = champlain_view_new ();
   clutter_actor_set_size (CLUTTER_ACTOR (actor), 800, 600);
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
+  clutter_actor_add_child (stage, actor);
 
   /* Create the marker layer */
   layer = champlain_marker_layer_new_full (CHAMPLAIN_SELECTION_SINGLE);
diff --git a/demos/create-destroy-test.c b/demos/create-destroy-test.c
index 73a7966..237681e 100644
--- a/demos/create-destroy-test.c
+++ b/demos/create-destroy-test.c
@@ -28,7 +28,7 @@ create_actor ()
   /* Create the map view */
   actor = champlain_view_new ();
   clutter_actor_set_size (CLUTTER_ACTOR (actor), 800, 600);
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
+  clutter_actor_add_child (stage, actor);
 
   champlain_view_set_zoom_level (CHAMPLAIN_VIEW (actor), 12);
   champlain_view_center_on (CHAMPLAIN_VIEW (actor), 45.466, -73.75);
diff --git a/demos/launcher.c b/demos/launcher.c
index a22b479..c758d1b 100644
--- a/demos/launcher.c
+++ b/demos/launcher.c
@@ -68,14 +68,15 @@ make_button (char *text)
   ClutterColor black = { 0x00, 0x00, 0x00, 0xff };
   gfloat width, height;
 
-  button = clutter_group_new ();
+  button = clutter_actor_new ();
 
-  button_bg = clutter_rectangle_new_with_color (&white);
-  clutter_container_add_actor (CLUTTER_CONTAINER (button), button_bg);
+  button_bg = clutter_actor_new ();
+  clutter_actor_set_background_color (button_bg, &white);
+  clutter_actor_add_child (button, button_bg);
   clutter_actor_set_opacity (button_bg, 0xcc);
 
   button_text = clutter_text_new_full ("Sans 10", text, &black);
-  clutter_container_add_actor (CLUTTER_CONTAINER (button), button_text);
+  clutter_actor_add_child (button, button_text);
   clutter_actor_get_size (button_text, &width, &height);
 
   clutter_actor_set_size (button_bg, width + PADDING * 2, height + PADDING * 2);
@@ -105,14 +106,14 @@ main (int argc,
   /* Create the map view */
   actor = champlain_view_new ();
   clutter_actor_set_size (CLUTTER_ACTOR (actor), 800, 600);
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
+  clutter_actor_add_child (stage, actor);
 
   /* Create the buttons */
-  buttons = clutter_group_new ();
+  buttons = clutter_actor_new ();
   clutter_actor_set_position (buttons, PADDING, PADDING);
 
   button = make_button ("Zoom in");
-  clutter_container_add_actor (CLUTTER_CONTAINER (buttons), button);
+  clutter_actor_add_child (buttons, button);
   clutter_actor_set_reactive (button, TRUE);
   clutter_actor_get_size (button, &width, NULL);
   total_width += width + PADDING;
@@ -121,7 +122,7 @@ main (int argc,
       actor);
 
   button = make_button ("Zoom out");
-  clutter_container_add_actor (CLUTTER_CONTAINER (buttons), button);
+  clutter_actor_add_child (buttons, button);
   clutter_actor_set_reactive (button, TRUE);
   clutter_actor_set_position (button, total_width, 0);
   clutter_actor_get_size (button, &width, NULL);
@@ -129,7 +130,7 @@ main (int argc,
       G_CALLBACK (zoom_out),
       actor);
 
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), buttons);
+  clutter_actor_add_child (stage, buttons);
 
   /* Create the markers and marker layer */
   layer = create_marker_layer (CHAMPLAIN_VIEW (actor), &path);
diff --git a/demos/minimal.c b/demos/minimal.c
index 2fd8c38..734f183 100644
--- a/demos/minimal.c
+++ b/demos/minimal.c
@@ -32,8 +32,8 @@ main (int argc, char *argv[])
 
   /* Create the map view */
   actor = champlain_view_new ();
-  clutter_actor_set_size (CLUTTER_ACTOR (actor), 800, 600);
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
+  clutter_actor_set_size (actor, 800, 600);
+  clutter_actor_add_child (stage, actor);
 
   clutter_actor_show (stage);
   clutter_main ();
diff --git a/demos/polygons.c b/demos/polygons.c
index 256d5cd..1ce5b82 100644
--- a/demos/polygons.c
+++ b/demos/polygons.c
@@ -48,14 +48,15 @@ make_button (char *text)
   ClutterColor black = { 0x00, 0x00, 0x00, 0xff };
   gfloat width, height;
 
-  button = clutter_group_new ();
+  button = clutter_actor_new ();
 
-  button_bg = clutter_rectangle_new_with_color (&white);
-  clutter_container_add_actor (CLUTTER_CONTAINER (button), button_bg);
+  button_bg = clutter_actor_new ();
+  clutter_actor_set_background_color (button_bg, &white);
+  clutter_actor_add_child (button, button_bg);
   clutter_actor_set_opacity (button_bg, 0xcc);
 
   button_text = clutter_text_new_full ("Sans 10", text, &black);
-  clutter_container_add_actor (CLUTTER_CONTAINER (button), button_text);
+  clutter_actor_add_child (button, button_text);
   clutter_actor_get_size (button_text, &width, &height);
 
   clutter_actor_set_size (button_bg, width + PADDING * 2, height + PADDING * 2);
@@ -95,14 +96,14 @@ main (int argc,
   /* Create the map view */
   actor = champlain_view_new ();
   clutter_actor_set_size (CLUTTER_ACTOR (actor), 800, 600);
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
+  clutter_actor_add_child (stage, actor);
 
   /* Create the buttons */
-  buttons = clutter_group_new ();
+  buttons = clutter_actor_new ();
   clutter_actor_set_position (buttons, PADDING, PADDING);
 
   button = make_button ("Zoom in");
-  clutter_container_add_actor (CLUTTER_CONTAINER (buttons), button);
+  clutter_actor_add_child (buttons, button);
   clutter_actor_set_reactive (button, TRUE);
   clutter_actor_get_size (button, &width, NULL);
   total_width += width + PADDING;
@@ -111,7 +112,7 @@ main (int argc,
       actor);
 
   button = make_button ("Zoom out");
-  clutter_container_add_actor (CLUTTER_CONTAINER (buttons), button);
+  clutter_actor_add_child (buttons, button);
   clutter_actor_set_reactive (button, TRUE);
   clutter_actor_set_position (button, total_width, 0);
   clutter_actor_get_size (button, &width, NULL);
@@ -119,7 +120,7 @@ main (int argc,
       G_CALLBACK (zoom_out),
       actor);
 
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), buttons);
+  clutter_actor_add_child (stage, buttons);
 
   /* draw a line */
   layer = champlain_path_layer_new ();
diff --git a/demos/url-marker.c b/demos/url-marker.c
index 0ca2de7..c9133be 100644
--- a/demos/url-marker.c
+++ b/demos/url-marker.c
@@ -253,7 +253,7 @@ main (int argc, char *argv[])
   /* Create the map view */
   view = champlain_view_new ();
   clutter_actor_set_size (CLUTTER_ACTOR (view), 800, 600);
-  clutter_container_add_actor (CLUTTER_CONTAINER (stage), view);
+  clutter_actor_add_child (stage, view);
 
   /* Create the markers and marker layer */
   layer = champlain_marker_layer_new_full (CHAMPLAIN_SELECTION_SINGLE);
@@ -271,7 +271,7 @@ main (int argc, char *argv[])
       "kinetic-mode", TRUE, NULL);
   champlain_view_center_on (CHAMPLAIN_VIEW (view), 48.22, 16.8);
 
-  clutter_actor_show_all (stage);
+  clutter_actor_show (stage);
   clutter_main ();
 
   g_object_unref (session);


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