goocanvas r32 - in trunk: . demo src



Author: damon
Date: Wed Nov 19 11:13:51 2008
New Revision: 32
URL: http://svn.gnome.org/viewvc/goocanvas?rev=32&view=rev

Log:
2008-11-19  Damon Chaplin  <damon gnome org>

	    * src/goocanvasitemmodel.c (goo_canvas_item_model_stop_animation): 
	    * src/goocanvasitem.c (goo_canvas_item_animate_cb)
	    (goo_canvas_item_stop_animation): remove the current animation data
	    before emitting "animation-finished", so signal handlers can start a
	    new animation.




Modified:
   trunk/ChangeLog
   trunk/demo/demo-animation.c
   trunk/src/goocanvasitem.c
   trunk/src/goocanvasitemmodel.c

Modified: trunk/demo/demo-animation.c
==============================================================================
--- trunk/demo/demo-animation.c	(original)
+++ trunk/demo/demo-animation.c	Wed Nov 19 11:13:51 2008
@@ -56,6 +56,12 @@
 		       gpointer       data)
 {
   g_print ("Animation finished stopped: %i\n", stopped);
+
+#if 0
+  /* Test starting another animation. */
+  goo_canvas_item_animate (ellipse1, 500, 200, 2, 720, TRUE, 2000, 40,
+			   GOO_CANVAS_ANIMATE_BOUNCE);
+#endif
 }
 
 

Modified: trunk/src/goocanvasitem.c
==============================================================================
--- trunk/src/goocanvasitem.c	(original)
+++ trunk/src/goocanvasitem.c	Wed Nov 19 11:13:51 2008
@@ -1230,13 +1230,13 @@
 	     above. We've set the timeout_id to 0 so it isn't removed twice. */
 	  if (model)
 	    {
-	      g_signal_emit_by_name (model, "animation-finished", FALSE);
 	      g_object_set_data (G_OBJECT (model), animation_key, NULL);
+	      g_signal_emit_by_name (model, "animation-finished", FALSE);
 	    }
 	  else
 	    {
-	      g_signal_emit_by_name (item, "animation-finished", FALSE);
 	      g_object_set_data (G_OBJECT (item), animation_key, NULL);
+	      g_signal_emit_by_name (item, "animation-finished", FALSE);
 	    }
 	  break;
 
@@ -1416,10 +1416,10 @@
 void
 goo_canvas_item_stop_animation (GooCanvasItem *item)
 {
-  g_signal_emit_by_name (item, "animation-finished", TRUE);
-
   /* This will result in a call to goo_canvas_item_free_animation() above. */
   g_object_set_data (G_OBJECT (item), animation_key, NULL);
+
+  g_signal_emit_by_name (item, "animation-finished", TRUE);
 }
 
 

Modified: trunk/src/goocanvasitemmodel.c
==============================================================================
--- trunk/src/goocanvasitemmodel.c	(original)
+++ trunk/src/goocanvasitemmodel.c	Wed Nov 19 11:13:51 2008
@@ -917,10 +917,10 @@
 void
 goo_canvas_item_model_stop_animation (GooCanvasItemModel *model)
 {
-  g_signal_emit_by_name (model, "animation-finished", TRUE);
-
   /* This will result in a call to goo_canvas_item_free_animation() above. */
   g_object_set_data (G_OBJECT (model), animation_key, NULL);
+
+  g_signal_emit_by_name (model, "animation-finished", TRUE);
 }
 
 



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