gcompris r3625 - in branches/gcomprixogoo: . src/goocanvas/src src/watercycle-activity src/watercycle-activity/resources/watercycle
- From: bcoudoin svn gnome org
- To: svn-commits-list gnome org
- Subject: gcompris r3625 - in branches/gcomprixogoo: . src/goocanvas/src src/watercycle-activity src/watercycle-activity/resources/watercycle
- Date: Thu, 20 Nov 2008 23:47:57 +0000 (UTC)
Author: bcoudoin
Date: Thu Nov 20 23:47:57 2008
New Revision: 3625
URL: http://svn.gnome.org/viewvc/gcompris?rev=3625&view=rev
Log:
- Imported goocanvas commit r31, it allows animation to be
called again in an animation-finished event
- Improved watercycle, uncomplete yet
Modified:
branches/gcomprixogoo/ChangeLog
branches/gcomprixogoo/src/goocanvas/src/goocanvasitem.c
branches/gcomprixogoo/src/goocanvas/src/goocanvasitemmodel.c
branches/gcomprixogoo/src/watercycle-activity/resources/watercycle/watercycle.svgz
branches/gcomprixogoo/src/watercycle-activity/watercycle.py
Modified: branches/gcomprixogoo/src/goocanvas/src/goocanvasitem.c
==============================================================================
--- branches/gcomprixogoo/src/goocanvas/src/goocanvasitem.c (original)
+++ branches/gcomprixogoo/src/goocanvas/src/goocanvasitem.c Thu Nov 20 23:47:57 2008
@@ -1186,13 +1186,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;
@@ -1372,10 +1372,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: branches/gcomprixogoo/src/goocanvas/src/goocanvasitemmodel.c
==============================================================================
--- branches/gcomprixogoo/src/goocanvas/src/goocanvasitemmodel.c (original)
+++ branches/gcomprixogoo/src/goocanvas/src/goocanvasitemmodel.c Thu Nov 20 23:47:57 2008
@@ -915,10 +915,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);
}
Modified: branches/gcomprixogoo/src/watercycle-activity/resources/watercycle/watercycle.svgz
==============================================================================
Binary files. No diff available.
Modified: branches/gcomprixogoo/src/watercycle-activity/watercycle.py
==============================================================================
--- branches/gcomprixogoo/src/watercycle-activity/watercycle.py (original)
+++ branches/gcomprixogoo/src/watercycle-activity/watercycle.py Thu Nov 20 23:47:57 2008
@@ -43,7 +43,6 @@
self.timerinc = 50
# Need to manage the timers to quit properly
- self.sun_timer = 0
self.waterlevel_timer = 0
gcompris.bar_set(0)
@@ -138,10 +137,7 @@
visibility = goocanvas.ITEM_INVISIBLE
)
self.clouditem.props.visibility = goocanvas.ITEM_INVISIBLE
- self.clouditem.connect("button_press_event", self.cloud_item_event)
self.clouditem.connect("animation-finished", self.cloud_arrived)
- # This item is clickeable and it must be seen
- gcompris.utils.item_focus_init(self.clouditem, None)
self.cloud_on = 0
# The vapor
@@ -278,8 +274,6 @@
def end(self):
# Remove all the timer first
- if self.sun_timer :
- gobject.source_remove(self.sun_timer)
if self.waterlevel_timer :
gobject.source_remove(self.waterlevel_timer)
@@ -351,15 +345,15 @@
# Now display tux in the shower
self.tuxshoweritem.props.visibility = goocanvas.ITEM_VISIBLE
self.shower_tux.props.visibility = goocanvas.ITEM_VISIBLE
- self.showerbuttonitem_off.props.visibility = goocanvas.ITEM_VISIBLE
+ self.showerbuttonitem_on.props.visibility = goocanvas.ITEM_VISIBLE
def sun_down(self):
# Move the sun down
- sun_timer = 0
trip_y = self.sunitem_orig_y1 - self.sunitem_target_y1
if self.sun_connect_handler:
self.sunitem.disconnect(self.sun_connect_handler)
- self.sun_connect_handler = self.sunitem.connect("animation-finished", self.sun_down_arrived)
+ self.sun_connect_handler = self.sunitem.connect("animation-finished",
+ self.sun_down_arrived)
self.sunitem.animate(0,
0,
1,
@@ -371,7 +365,6 @@
return False
def sun_up_arrived(self, item, status):
- self.sun_timer = gobject.timeout_add(15000, self.sun_down)
# Start the vapor
self.init_vapor()
# Remove the snow
@@ -384,17 +377,16 @@
self.sun_on = 0
def cloud_arrived(self, item, status):
- print "cloud_arrived"
- self.clouditem.props.visibility = goocanvas.ITEM_INVISIBLE
- self.cloud_on = 0
+ self.sun_down()
+ self.clouditem.connect("button_press_event", self.cloud_item_event)
+ gcompris.utils.item_focus_init(self.clouditem, None)
def move_cloud(self):
- print "move_cloud"
if (self.cloud_on):
return
self.cloud_on = 1
self.clouditem.props.visibility = goocanvas.ITEM_VISIBLE
- trip_x = 700
+ trip_x = 270
self.clouditem.animate(trip_x,
0,
1,
@@ -402,7 +394,7 @@
True,
40*trip_x,
40,
- goocanvas.ANIMATE_RESET)
+ goocanvas.ANIMATE_FREEZE)
def move_cloud_old(self):
if(self.cloud_on):
@@ -435,7 +427,6 @@
self.rainitem.props.visibility = goocanvas.ITEM_INVISIBLE
def vapor_arrived(self, item, state):
- print "vapor_arrived"
self.vapor_on = 0
self.vaporitem.props.visibility = goocanvas.ITEM_INVISIBLE
# Start the cloud
@@ -490,7 +481,11 @@
if event.type == gtk.gdk.BUTTON_PRESS:
if event.button == 1:
gcompris.sound.play_ogg("sounds/Water5.wav")
+ self.rainitem.props.visibility = goocanvas.ITEM_VISIBLE
+ self.snowitem.props.visibility = goocanvas.ITEM_VISIBLE
+ self.riveritem.props.visibility = goocanvas.ITEM_VISIBLE
self.rain_on = 1
+ self.riverfull = 1
return True
return False
@@ -499,18 +494,18 @@
if event.button == 1:
if self.riverfull:
gcompris.sound.play_ogg("sounds/bubble.wav")
+ self.cleanwateritem.props.visibility = goocanvas.ITEM_VISIBLE
self.waterpump_on = 1
- self.pumpwateritem.props.pixbuf = gcompris.utils.load_pixmap("watercycle/pumpwater.png");
return True
return False
def watercleaning_item_event(self, widget, target, event=None):
if event.type == gtk.gdk.BUTTON_PRESS:
if event.button == 1:
- if self.waterpump_on:
+ if self.riverfull:
gcompris.sound.play_ogg("sounds/bubble.wav")
self.watercleaning_on = 1
- self.dirtywater.props.pixbuf = gcompris.utils.load_pixmap("watercycle/badwater.png");
+ self.dirtywater.props.visibility = goocanvas.ITEM_VISIBLE
return True
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]