[libchamplain/libchamplain-0-12] Replace some deprecated functions



commit 6117e0da34a24b8532067b0a0981e8584c7b2870
Author: JiÅÃ Techet <techet gmail com>
Date:   Sun Nov 20 16:03:17 2011 +0100

    Replace some deprecated functions

 demos/animated-marker.c |   18 +++++++++---------
 demos/launcher-gtk.c    |    7 ++++---
 demos/local-rendering.c |   25 +++++++++++++------------
 demos/minimal-gtk.c     |    3 ++-
 4 files changed, 28 insertions(+), 25 deletions(-)
---
diff --git a/demos/animated-marker.c b/demos/animated-marker.c
index 71580a7..d00b81d 100644
--- a/demos/animated-marker.c
+++ b/demos/animated-marker.c
@@ -30,8 +30,6 @@ create_marker ()
   ClutterActor *marker;
   ClutterActor *bg;
   ClutterTimeline *timeline;
-  ClutterBehaviour *behaviour;
-  ClutterAlpha *alpha;
   cairo_t *cr;
 
   /* Create the marker */
@@ -86,13 +84,15 @@ create_marker ()
   /* Animate the echo circle */
   timeline = clutter_timeline_new (1000);
   clutter_timeline_set_loop (timeline, TRUE);
-  alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_OUT_SINE);
-
-  behaviour = clutter_behaviour_scale_new (alpha, 0.5, 0.5, 2.0, 2.0);
-  clutter_behaviour_apply (behaviour, bg);
-
-  behaviour = clutter_behaviour_opacity_new (alpha, 255, 0);
-  clutter_behaviour_apply (behaviour, bg);
+  clutter_actor_set_opacity (CLUTTER_ACTOR (bg), 255);
+  clutter_actor_set_scale (CLUTTER_ACTOR (bg), 0.5, 0.5);
+  clutter_actor_animate_with_timeline (CLUTTER_ACTOR (bg),
+      CLUTTER_EASE_OUT_SINE, 
+      timeline, 
+      "opacity", 0, 
+      "scale-x", 2.0, 
+      "scale-y", 2.0, 
+      NULL);
 
   clutter_timeline_start (timeline);
 
diff --git a/demos/launcher-gtk.c b/demos/launcher-gtk.c
index 8e699a9..7828036 100644
--- a/demos/launcher-gtk.c
+++ b/demos/launcher-gtk.c
@@ -223,7 +223,8 @@ main (int argc,
   ClutterActor *scale;
   ChamplainLicense *license_actor;
 
-  gtk_clutter_init (&argc, &argv);
+  if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   /* create the main, top level, window */
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -241,7 +242,7 @@ main (int argc,
   g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (on_destroy),
       NULL);
 
-  vbox = gtk_vbox_new (FALSE, 10);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
 
   widget = gtk_champlain_embed_new ();
   view = gtk_champlain_embed_get_view (GTK_CHAMPLAIN_EMBED (widget));
@@ -286,7 +287,7 @@ main (int argc,
 
   gtk_widget_set_size_request (widget, 640, 480);
 
-  bbox = gtk_hbox_new (FALSE, 10);
+  bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
   button = gtk_button_new_from_stock (GTK_STOCK_ZOOM_IN);
   g_signal_connect (button, "clicked", G_CALLBACK (zoom_in), view);
   gtk_container_add (GTK_CONTAINER (bbox), button);
diff --git a/demos/local-rendering.c b/demos/local-rendering.c
index 98208b9..37ca179 100644
--- a/demos/local-rendering.c
+++ b/demos/local-rendering.c
@@ -237,7 +237,7 @@ gtk_memphis_prop_new (gint type, ChamplainMemphisRuleAttr *attr)
   GtkWidget *hbox, *cb, *sb1, *sb2, *sb3;
   GdkColor gcolor;
 
-  hbox = gtk_hbox_new (FALSE, 0);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
 
   gcolor.red = ((guint16) attr->color_red) << 8;
   gcolor.green = ((guint16) attr->color_green) << 8;
@@ -353,7 +353,7 @@ create_rule_edit_window (ChamplainMemphisRule *rule, gchar *id,
       gtk_table_attach_defaults (GTK_TABLE (table), props, 1, 2, 4, 5);
     }
 
-  GtkWidget *vbox = gtk_hbox_new (TRUE, 0);
+  GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
 
   button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
   gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
@@ -364,7 +364,7 @@ create_rule_edit_window (ChamplainMemphisRule *rule, gchar *id,
       G_CALLBACK (rule_apply_cb), renderer);
   gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
 
-  GtkWidget *mainbox = gtk_vbox_new (FALSE, 0);
+  GtkWidget *mainbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_box_pack_start (GTK_BOX (mainbox), table, FALSE, FALSE, 0);
   gtk_box_pack_start (GTK_BOX (mainbox), vbox, FALSE, FALSE, 0);
 
@@ -730,7 +730,8 @@ main (int argc,
 {
   GtkWidget *widget, *hbox, *bbox, *menubox, *button, *viewport, *label;
 
-  gtk_clutter_init (&argc, &argv);
+  if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   /* create the main, top level, window */
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -748,13 +749,13 @@ main (int argc,
   g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (on_destroy),
       NULL);
 
-  hbox = gtk_hbox_new (FALSE, 10);
-  menubox = gtk_vbox_new (FALSE, 10);
-  memphis_box = gtk_vbox_new (FALSE, 10);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
+  menubox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
+  memphis_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
   gtk_widget_set_no_show_all (memphis_box, TRUE);
-  memphis_net_box = gtk_hbox_new (FALSE, 10);
+  memphis_net_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
   gtk_widget_set_no_show_all (memphis_net_box, TRUE);
-  memphis_local_box = gtk_hbox_new (FALSE, 10);
+  memphis_local_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
   gtk_widget_set_no_show_all (memphis_local_box, TRUE);
 
   widget = gtk_champlain_embed_new ();
@@ -766,7 +767,7 @@ main (int argc,
   gtk_widget_set_size_request (widget, 640, 480);
 
   /* first line of buttons */
-  bbox = gtk_hbox_new (FALSE, 10);
+  bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
   button = gtk_button_new_from_stock (GTK_STOCK_ZOOM_IN);
   g_signal_connect (button, "clicked", G_CALLBACK (zoom_in), champlain_view);
   gtk_container_add (GTK_CONTAINER (bbox), button);
@@ -828,7 +829,7 @@ main (int argc,
   gtk_box_pack_start (GTK_BOX (memphis_box), button, FALSE, FALSE, 0);
 
   /* bg chooser */
-  bbox = gtk_hbox_new (FALSE, 10);
+  bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
 
   label = gtk_label_new (NULL);
   gtk_label_set_markup (GTK_LABEL (label), "Background color");
@@ -843,7 +844,7 @@ main (int argc,
 
   /* rules list */
   label = gtk_label_new ("Rules");
-  bbox = gtk_hbox_new (FALSE, 10);
+  bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
   gtk_box_pack_start (GTK_BOX (bbox), label, FALSE, FALSE, 0);
   gtk_box_pack_start (GTK_BOX (memphis_box), bbox, FALSE, FALSE, 0);
 
diff --git a/demos/minimal-gtk.c b/demos/minimal-gtk.c
index 195f9e4..eb1014e 100644
--- a/demos/minimal-gtk.c
+++ b/demos/minimal-gtk.c
@@ -29,7 +29,8 @@ main (int argc, char *argv[])
   GtkWidget *window, *widget;
 
   /* initialize threads and clutter */
-  gtk_clutter_init (&argc, &argv);
+  if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   /* create the top-level window and quit the main loop when it's closed */
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);



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