Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Stoner <ed@whsd.net>2007-10-09 13:05:19 (GMT)
committer Ed Stoner <ed@whsd.net>2007-10-09 13:05:19 (GMT)
commit6afdf50013c25bbf8ed0ad5ef7c789590a28046a (patch)
tree8b1c63534a1beb5bdb605cbeff9c46b394674c4e
Initial import
-rwxr-xr-xactivity/activity-cartoonbuilder.svg8
-rwxr-xr-xactivity/activity.info7
-rw-r--r--backpics/bigbg01.gifbin0 -> 2942 bytes
-rw-r--r--backpics/bigbg02.gifbin0 -> 3860 bytes
-rw-r--r--backpics/bigbg03.gifbin0 -> 3015 bytes
-rw-r--r--backpics/bigbg04.gifbin0 -> 2185 bytes
-rw-r--r--backpics/bigbg05.gifbin0 -> 2456 bytes
-rw-r--r--backpics/bigbg06.gifbin0 -> 4966 bytes
-rw-r--r--backpics/bigbg07.gifbin0 -> 3413 bytes
-rw-r--r--backpics/bigbg08.gifbin0 -> 768 bytes
-rw-r--r--backpics/bigbg09.gifbin0 -> 2175 bytes
-rw-r--r--backpics/bigbg10.gifbin0 -> 1894 bytes
-rw-r--r--backpics/bigbg11.gifbin0 -> 4402 bytes
-rw-r--r--backpics/bigbg12.gifbin0 -> 8529 bytes
-rw-r--r--backpics/bigbg13.gifbin0 -> 1026 bytes
-rw-r--r--backpics/bigbg14.gifbin0 -> 936 bytes
-rw-r--r--backpics/bigbg15.gifbin0 -> 1067 bytes
-rw-r--r--backpics/bigbg16.gifbin0 -> 1848 bytes
-rw-r--r--backpics/biggb17.gifbin0 -> 2253 bytes
-rwxr-xr-xcartoonbuilder.py1419
-rw-r--r--config.backpics17
-rw-r--r--config.imgdirs3
-rw-r--r--config.sounds4
-rw-r--r--icons/50x50blank-trans.pngbin0 -> 167 bytes
-rw-r--r--icons/clear.pngbin0 -> 1469 bytes
-rw-r--r--icons/down_arrow.pngbin0 -> 419 bytes
-rw-r--r--icons/filmstrip.pngbin0 -> 1670 bytes
-rw-r--r--icons/left_arrow.pngbin0 -> 422 bytes
-rw-r--r--icons/logo.pngbin0 -> 16550 bytes
-rw-r--r--icons/pause.pngbin0 -> 223 bytes
-rw-r--r--icons/pink_arrow.pngbin0 -> 361 bytes
-rw-r--r--icons/right_arrow.pngbin0 -> 424 bytes
-rw-r--r--icons/sound_icon.pngbin0 -> 3227 bytes
-rw-r--r--icons/up_arrow.pngbin0 -> 405 bytes
-rw-r--r--icons/yellow_arrow.pngbin0 -> 375 bytes
-rw-r--r--lp-en/An_Overview.txt26
-rw-r--r--lp-en/Lesson_Plan_1.txt28
-rw-r--r--lp-en/Lesson_Plan_2.txt22
-rw-r--r--lp-en/Lesson_Plan_3.txt34
-rw-r--r--lp-en/Lesson_Plan_4.txt26
-rw-r--r--lp-en/Lesson_Plan_5.txt41
-rw-r--r--lp-es/0Una_Descripcion.txt26
-rw-r--r--lp-es/Plan_1.txt28
-rw-r--r--lp-es/Plan_2.txt22
-rw-r--r--lp-es/Plan_3.txt34
-rw-r--r--lp-es/Plan_4.txt26
-rw-r--r--lp-es/Plan_5.txt41
-rwxr-xr-xmanifest16
-rw-r--r--pics/Elephant/bigelephant0.gifbin0 -> 3186 bytes
-rw-r--r--pics/Elephant/bigelephant1.gifbin0 -> 3160 bytes
-rw-r--r--pics/Elephant/bigelephant10.gifbin0 -> 2442 bytes
-rw-r--r--pics/Elephant/bigelephant11.gifbin0 -> 2852 bytes
-rw-r--r--pics/Elephant/bigelephant12.gifbin0 -> 2879 bytes
-rw-r--r--pics/Elephant/bigelephant13.gifbin0 -> 2595 bytes
-rw-r--r--pics/Elephant/bigelephant2.gifbin0 -> 2554 bytes
-rw-r--r--pics/Elephant/bigelephant3.gifbin0 -> 3029 bytes
-rw-r--r--pics/Elephant/bigelephant4.gifbin0 -> 2492 bytes
-rw-r--r--pics/Elephant/bigelephant5.gifbin0 -> 3138 bytes
-rw-r--r--pics/Elephant/bigelephant6.gifbin0 -> 2408 bytes
-rw-r--r--pics/Elephant/bigelephant7.gifbin0 -> 2311 bytes
-rw-r--r--pics/Elephant/bigelephant8.gifbin0 -> 2644 bytes
-rw-r--r--pics/Elephant/bigelephant9.gifbin0 -> 2681 bytes
-rw-r--r--pics/SpaceBlob/bigblob0.gifbin0 -> 2677 bytes
-rw-r--r--pics/SpaceBlob/bigblob1.gifbin0 -> 2834 bytes
-rw-r--r--pics/SpaceBlob/bigblob10.gifbin0 -> 2628 bytes
-rw-r--r--pics/SpaceBlob/bigblob11.gifbin0 -> 2112 bytes
-rw-r--r--pics/SpaceBlob/bigblob12.gifbin0 -> 2340 bytes
-rw-r--r--pics/SpaceBlob/bigblob13.gifbin0 -> 2397 bytes
-rw-r--r--pics/SpaceBlob/bigblob2.gifbin0 -> 2231 bytes
-rw-r--r--pics/SpaceBlob/bigblob3.gifbin0 -> 2362 bytes
-rw-r--r--pics/SpaceBlob/bigblob4.gifbin0 -> 2661 bytes
-rw-r--r--pics/SpaceBlob/bigblob5.gifbin0 -> 2248 bytes
-rw-r--r--pics/SpaceBlob/bigblob6.gifbin0 -> 2297 bytes
-rw-r--r--pics/SpaceBlob/bigblob7.gifbin0 -> 2217 bytes
-rw-r--r--pics/SpaceBlob/bigblob8.gifbin0 -> 2750 bytes
-rw-r--r--pics/SpaceBlob/bigblob9.gifbin0 -> 2482 bytes
-rw-r--r--pics/Turkey/bigturkey1.gifbin0 -> 1703 bytes
-rw-r--r--pics/Turkey/bigturkey10.gifbin0 -> 1600 bytes
-rw-r--r--pics/Turkey/bigturkey11.gifbin0 -> 1597 bytes
-rw-r--r--pics/Turkey/bigturkey12.gifbin0 -> 1589 bytes
-rw-r--r--pics/Turkey/bigturkey13.gifbin0 -> 1595 bytes
-rw-r--r--pics/Turkey/bigturkey14.gifbin0 -> 1550 bytes
-rw-r--r--pics/Turkey/bigturkey2.gifbin0 -> 1651 bytes
-rw-r--r--pics/Turkey/bigturkey3.gifbin0 -> 1527 bytes
-rw-r--r--pics/Turkey/bigturkey4.gifbin0 -> 1571 bytes
-rw-r--r--pics/Turkey/bigturkey5.gifbin0 -> 1610 bytes
-rw-r--r--pics/Turkey/bigturkey6.gifbin0 -> 1809 bytes
-rw-r--r--pics/Turkey/bigturkey7.gifbin0 -> 1570 bytes
-rw-r--r--pics/Turkey/bigturkey8.gifbin0 -> 1620 bytes
-rw-r--r--pics/Turkey/bigturkey9.gifbin0 -> 1581 bytes
-rwxr-xr-xsetup.py3
-rw-r--r--sounds/funk.wavbin0 -> 173176 bytes
-rw-r--r--sounds/giggle.wavbin0 -> 78642 bytes
-rw-r--r--sounds/gobble.wavbin0 -> 5334 bytes
-rw-r--r--sounds/jungle.wavbin0 -> 136612 bytes
95 files changed, 1831 insertions, 0 deletions
diff --git a/activity/activity-cartoonbuilder.svg b/activity/activity-cartoonbuilder.svg
new file mode 100755
index 0000000..b9278b0
--- /dev/null
+++ b/activity/activity-cartoonbuilder.svg
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY fill_color "#FFFFFF">
+ <!ENTITY stroke_color "#000000">
+]>
+<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
+<rect x="1" y="1" width="48" height="48" style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:2"/>
+</svg>
diff --git a/activity/activity.info b/activity/activity.info
new file mode 100755
index 0000000..e1ea944
--- /dev/null
+++ b/activity/activity.info
@@ -0,0 +1,7 @@
+[Activity]
+name = CartoonBuilder
+service_name = com.ywwg.CartoonBuilderActivity
+class = cartoonbuilder.cartoonbuilderActivity
+icon = activity-cartoonbuilder
+activity_version = 1
+show_launcher = no
diff --git a/backpics/bigbg01.gif b/backpics/bigbg01.gif
new file mode 100644
index 0000000..dd3b442
--- /dev/null
+++ b/backpics/bigbg01.gif
Binary files differ
diff --git a/backpics/bigbg02.gif b/backpics/bigbg02.gif
new file mode 100644
index 0000000..45f6cbd
--- /dev/null
+++ b/backpics/bigbg02.gif
Binary files differ
diff --git a/backpics/bigbg03.gif b/backpics/bigbg03.gif
new file mode 100644
index 0000000..284c53c
--- /dev/null
+++ b/backpics/bigbg03.gif
Binary files differ
diff --git a/backpics/bigbg04.gif b/backpics/bigbg04.gif
new file mode 100644
index 0000000..728cb29
--- /dev/null
+++ b/backpics/bigbg04.gif
Binary files differ
diff --git a/backpics/bigbg05.gif b/backpics/bigbg05.gif
new file mode 100644
index 0000000..2ce3a01
--- /dev/null
+++ b/backpics/bigbg05.gif
Binary files differ
diff --git a/backpics/bigbg06.gif b/backpics/bigbg06.gif
new file mode 100644
index 0000000..19ef057
--- /dev/null
+++ b/backpics/bigbg06.gif
Binary files differ
diff --git a/backpics/bigbg07.gif b/backpics/bigbg07.gif
new file mode 100644
index 0000000..63c08fb
--- /dev/null
+++ b/backpics/bigbg07.gif
Binary files differ
diff --git a/backpics/bigbg08.gif b/backpics/bigbg08.gif
new file mode 100644
index 0000000..28975b9
--- /dev/null
+++ b/backpics/bigbg08.gif
Binary files differ
diff --git a/backpics/bigbg09.gif b/backpics/bigbg09.gif
new file mode 100644
index 0000000..7081235
--- /dev/null
+++ b/backpics/bigbg09.gif
Binary files differ
diff --git a/backpics/bigbg10.gif b/backpics/bigbg10.gif
new file mode 100644
index 0000000..8472741
--- /dev/null
+++ b/backpics/bigbg10.gif
Binary files differ
diff --git a/backpics/bigbg11.gif b/backpics/bigbg11.gif
new file mode 100644
index 0000000..94e53d3
--- /dev/null
+++ b/backpics/bigbg11.gif
Binary files differ
diff --git a/backpics/bigbg12.gif b/backpics/bigbg12.gif
new file mode 100644
index 0000000..d2f2235
--- /dev/null
+++ b/backpics/bigbg12.gif
Binary files differ
diff --git a/backpics/bigbg13.gif b/backpics/bigbg13.gif
new file mode 100644
index 0000000..d631e2d
--- /dev/null
+++ b/backpics/bigbg13.gif
Binary files differ
diff --git a/backpics/bigbg14.gif b/backpics/bigbg14.gif
new file mode 100644
index 0000000..c90ff31
--- /dev/null
+++ b/backpics/bigbg14.gif
Binary files differ
diff --git a/backpics/bigbg15.gif b/backpics/bigbg15.gif
new file mode 100644
index 0000000..cfdd076
--- /dev/null
+++ b/backpics/bigbg15.gif
Binary files differ
diff --git a/backpics/bigbg16.gif b/backpics/bigbg16.gif
new file mode 100644
index 0000000..f358416
--- /dev/null
+++ b/backpics/bigbg16.gif
Binary files differ
diff --git a/backpics/biggb17.gif b/backpics/biggb17.gif
new file mode 100644
index 0000000..49ca132
--- /dev/null
+++ b/backpics/biggb17.gif
Binary files differ
diff --git a/cartoonbuilder.py b/cartoonbuilder.py
new file mode 100755
index 0000000..5fa9c83
--- /dev/null
+++ b/cartoonbuilder.py
@@ -0,0 +1,1419 @@
+#!/usr/bin/env python
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+
+### cartoonbuilder
+###
+### author: Ed Stoner (ed@whsd.net)
+### (c) 2007 World Wide Workshop Foundation
+
+import time
+import pygtk
+pygtk.require('2.0')
+import gtk
+import gobject
+import gettext
+import os
+import zipfile
+import textwrap
+# should really put a try in front of this
+# in case there is no sound support
+import gst
+
+_ = gettext.lgettext
+
+TRANSIMG = '50x50blank-trans.png'
+BGHEIGHT = 300
+BGWIDTH = 300
+IMGHEIGHT = 75
+IMGWIDTH = 75
+
+BORDER_LEFT = 1
+BORDER_RIGHT = 2
+BORDER_TOP = 4
+BORDER_BOTTOM = 8
+BORDER_VERTICAL = BORDER_TOP | BORDER_BOTTOM
+BORDER_HORIZONTAL = BORDER_LEFT | BORDER_RIGHT
+BORDER_ALL = BORDER_VERTICAL | BORDER_HORIZONTAL
+BORDER_ALL_BUT_BOTTOM = BORDER_HORIZONTAL | BORDER_TOP
+BORDER_ALL_BUT_LEFT = BORDER_VERTICAL | BORDER_RIGHT
+
+SLICE_BTN_WIDTH = 40
+
+# Colors from the Rich's UI design
+
+GRAY = "#B7B7B7" # gray
+PINK = "#FF0099" # pink
+YELLOW = "#FFFF00" # yellow
+WHITE = "#FFFFFF"
+BLACK = "#000000"
+BACKGROUND = "#66CC00" # light green
+BUTTON_FOREGROUND = "#CCFB99" # very light green
+BUTTON_BACKGROUND = "#027F01" # dark green
+COLOR_FG_BUTTONS = (
+ (gtk.STATE_NORMAL,"#CCFF99"),
+ (gtk.STATE_ACTIVE,"#CCFF99"),
+ (gtk.STATE_PRELIGHT,"#CCFF99"),
+ (gtk.STATE_SELECTED,"#CCFF99"),
+ (gtk.STATE_INSENSITIVE,"#CCFF99"),
+ ) # very light green
+COLOR_BG_BUTTONS = (
+ (gtk.STATE_NORMAL,"#027F01"),
+ (gtk.STATE_ACTIVE,"#CCFF99"),
+ (gtk.STATE_PRELIGHT,"#016D01"),
+ (gtk.STATE_SELECTED,"#CCFF99"),
+ (gtk.STATE_INSENSITIVE,"#027F01"),
+ )
+OLD_COLOR_BG_BUTTONS = (
+ (gtk.STATE_NORMAL,"#027F01"),
+ (gtk.STATE_ACTIVE,"#014D01"),
+ (gtk.STATE_PRELIGHT,"#016D01"),
+ (gtk.STATE_SELECTED,"#027F01"),
+ (gtk.STATE_INSENSITIVE,"#027F01"),
+ )
+
+SPANISH = u'Espa\xf1ol'
+#SPANISH = 'Espanol'
+LANGLIST = ['English',SPANISH]
+LANG = {'English':{'character':'My Character',
+ 'sound':'My Sound',
+ 'background':'My Background',
+ 'lessonplan':'Lesson Plans',
+ 'lpdir':'lp-en'},
+ SPANISH:{'character':u'Mi car\xe1cter',
+ 'sound':'Mi sonido',
+ 'background':'Mi fondo',
+ 'lessonplan':u'Planes de la lecci\xf3n',
+ 'lpdir':'lp-es'}}
+
+def getwrappedfile(filepath,linelength):
+ text = []
+ f = file(filepath)
+ for line in f:
+ if line == '\n':
+ text.append(line)
+ else:
+ for wline in textwrap.wrap(line.strip()):
+ text.append('%s\n' % wline)
+ return ''.join(text)
+
+def prepare_btn(btn, w=-1, h=-1):
+ for state, color in COLOR_BG_BUTTONS:
+ btn.modify_bg(state, gtk.gdk.color_parse(color))
+ c = btn.get_child()
+ if c is not None:
+ for state, color in COLOR_FG_BUTTONS:
+ c.modify_fg(state, gtk.gdk.color_parse(color))
+ else:
+ for state, color in COLOR_FG_BUTTONS:
+ btn.modify_fg(state, gtk.gdk.color_parse(color))
+ if w>0 or h>0:
+ btn.set_size_request(w, h)
+ return btn
+
+class FrameWidget(gtk.DrawingArea):
+ def __init__(self,bgpixbuf,fgpixbuf):
+ gtk.DrawingArea.__init__(self)
+ self.gc = None # initialized in realize-event handler
+ self.width = 0 # updated in size-allocate handler
+ self.height = 0 # idem
+ self.bgpixbuf = bgpixbuf
+ self.fgpixbuf = fgpixbuf
+ self.connect('size-allocate', self.on_size_allocate)
+ self.connect('expose-event', self.on_expose_event)
+ self.connect('realize', self.on_realize)
+
+ def on_realize(self, widget):
+ self.gc = widget.window.new_gc()
+
+ def on_size_allocate(self, widget, allocation):
+ self.width = allocation.width
+ self.height = allocation.height
+
+ def on_expose_event(self, widget, event):
+ # This is where the drawing takes place
+ if self.bgpixbuf:
+ #bgpixbuf = gtk.gdk.pixbuf_new_from_file(self.bgimgpath)
+ widget.window.draw_pixbuf(self.gc,self.bgpixbuf,0,0,0,0,-1,-1,0,0)
+ if self.fgpixbuf:
+ #fgpixbuf = gtk.gdk.pixbuf_new_from_file(self.fgimgpath)
+ #widget.window.draw_pixbuf(self.gc,fgpixbuf,0,0,75,75,-1,-1,0,0)
+ widget.window.draw_pixbuf(self.gc,self.fgpixbuf,0,0,0,0,-1,-1,0,0)
+
+
+class cartoonbuilder:
+ def delete_event(self, widget, event, data=None):
+ return False
+
+ def destroy(self, widget, data=None):
+ gtk.main_quit()
+
+ def on_gstmessage(self, bus, message):
+ t = message.type
+ if t == gst.MESSAGE_EOS:
+ # END OF SOUND FILE
+ self.player.set_state(gst.STATE_NULL)
+ self.player.set_state(gst.STATE_PLAYING)
+ elif t == gst.MESSAGE_ERROR:
+ self.player.set_state(gst.STATE_NULL)
+
+ def clearframe(self, widget, data=None):
+ transpixbuf = self.gettranspixbuf(IMGWIDTH,IMGHEIGHT)
+ self.frameimgs[self.frame_selected].set_from_pixbuf(transpixbuf)
+ self.fgpixbufs[self.frame_selected] = self.gettranspixbuf(BGWIDTH,BGHEIGHT)
+ self.fgpixbuf = self.gettranspixbuf(BGWIDTH,BGHEIGHT)
+ self.drawmain()
+
+ def clearall(self, widget, data=None):
+ for i in range(6):
+ transpixbuf = self.gettranspixbuf(IMGWIDTH,IMGHEIGHT)
+ self.frameimgs[i].set_from_pixbuf(transpixbuf)
+ self.fgpixbufs[i] = self.gettranspixbuf(BGWIDTH,BGHEIGHT)
+ self.fgpixbuf = self.gettranspixbuf(BGWIDTH,BGHEIGHT)
+
+ def selectframe(self, widget, event, data=None):
+ if data:
+ i = data-1
+ self.framebuttons[i].modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(YELLOW))
+ self.framebuttons[i].modify_bg(gtk.STATE_PRELIGHT,gtk.gdk.color_parse(YELLOW))
+ if self.frame_selected != i:
+ self.framebuttons[self.frame_selected].modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BLACK))
+ self.framebuttons[self.frame_selected].modify_bg(gtk.STATE_PRELIGHT,gtk.gdk.color_parse(BLACK))
+ #self.framebuttons[self.frame_selected].set_style(self.fbstyle)
+ self.frame_selected = i
+ self.fgpixbuf = self.fgpixbufs[self.frame_selected]
+ self.drawmain()
+
+ def pickimage(self, widget, event, data=None):
+ if data:
+ pixbuf = self.posepixbufs[data-1]
+
+ scaled_buf = pixbuf.scale_simple(IMGWIDTH,IMGHEIGHT,gtk.gdk.INTERP_BILINEAR)
+ self.frameimgs[self.frame_selected].set_from_pixbuf(scaled_buf)
+ fgpixbuf = pixbuf.scale_simple(BGWIDTH,BGHEIGHT,gtk.gdk.INTERP_BILINEAR)
+ self.fgpixbufs[self.frame_selected] = fgpixbuf
+ self.fgpixbuf = fgpixbuf
+ self.drawmain()
+
+ def lastback(self, widget, data=None):
+ if self.backnum == 0:
+ self.backnum = len(self.backpicpaths)-1
+ else:
+ self.backnum -= 1
+ bgimgpath = self.backpicpaths[self.backnum]
+ self.setback(bgimgpath)
+
+ def nextback(self, widget, data=None):
+ if self.backnum == (len(self.backpicpaths)-1):
+ self.backnum = 0
+ else:
+ self.backnum += 1
+ bgimgpath = self.backpicpaths[self.backnum]
+ self.setback(bgimgpath)
+
+ def setback(self,imgpath):
+ #self.mfdraw.queue_draw()
+ #pixbuf = gtk.gdk.pixbuf_new_from_file(self.bgimgpath)
+ pixbuf = gtk.gdk.pixbuf_new_from_file(imgpath)
+ self.bgpixbuf = pixbuf.scale_simple(BGWIDTH,BGHEIGHT,gtk.gdk.INTERP_BILINEAR)
+ scaled_buf = pixbuf.scale_simple(60,60,gtk.gdk.INTERP_BILINEAR)
+ self.bgsmall.set_from_pixbuf(scaled_buf)
+ self.drawmain()
+
+ def setcharacter(self):
+ pics = self.getpics(self.imgdir)
+ pixbuf = gtk.gdk.pixbuf_new_from_file(pics[self.imgstartindex])
+ scaled_buf = pixbuf.scale_simple(60,60,gtk.gdk.INTERP_BILINEAR)
+ self.ccismall.set_from_pixbuf(scaled_buf)
+ self.charlabel.set_label(os.path.split(self.imgdir)[1])
+
+ def lastcharacter(self, widget, data=None):
+ if self.imgdirindex == 0:
+ self.imgdirindex = (len(self.imgdirs)-1)
+ else:
+ self.imgdirindex -= 1
+ self.imgstartindex = 0
+ self.imgdir = self.imgdirs[self.imgdirindex]
+ self.loadimages()
+ self.setcharacter()
+ self.drawmain()
+
+ def nextcharacter(self, widget, data=None):
+ if self.imgdirindex == (len(self.imgdirs)-1):
+ self.imgdirindex = 0
+ else:
+ self.imgdirindex += 1
+ self.imgstartindex = 0
+ self.imgdir = self.imgdirs[self.imgdirindex]
+ self.loadimages()
+ self.setcharacter()
+ self.drawmain()
+
+ def changesound(self):
+ if self.soundfile:
+ soundname = os.path.splitext(os.path.split(self.soundfile)[1])[0]
+ self.player.set_property('uri', 'file://' + self.soundfile)
+ if self.playing:
+ self.player.set_state(gst.STATE_NULL)
+ self.player.set_state(gst.STATE_PLAYING)
+ else:
+ soundname = 'No Sound'
+ if self.playing:
+ self.player.set_state(gst.STATE_NULL)
+ self.soundlabel.set_text(soundname.capitalize())
+
+ def lastsound(self, widget, data=None):
+ if self.soundindex == 0:
+ self.soundindex = (len(self.sounds)-1)
+ else:
+ self.soundindex -= 1
+ self.soundfile = self.sounds[self.soundindex]
+ self.changesound()
+
+ def nextsound(self, widget, data=None):
+ if self.soundindex == (len(self.sounds)-1):
+ self.soundindex = 0
+ else:
+ self.soundindex += 1
+ self.soundfile = self.sounds[self.soundindex]
+ self.changesound()
+
+ def go(self, widget, data=None):
+ self.playframenum = 0
+ if self.playing:
+ if self.soundfile:
+ self.player.set_state(gst.STATE_NULL)
+ #widget.set_label('GO!')
+ playimg = gtk.Image()
+ #playimg.set_from_stock(gtk.STOCK_MEDIA_PLAY,gtk.ICON_SIZE_BUTTON)
+ playimg.set_from_file(os.path.join(self.iconsdir,'right_arrow.png'))
+ playimg.show()
+ widget.set_image(playimg)
+ self.playing = False
+ else:
+ if self.soundfile:
+ #self.player.set_property('uri', 'file://' + self.soundfile)
+ self.player.set_state(gst.STATE_PLAYING)
+ #widget.set_label('STOP')
+ stopimg = gtk.Image()
+ #stopimg.set_from_stock(gtk.STOCK_MEDIA_STOP,gtk.ICON_SIZE_BUTTON)
+ stopimg.set_from_file(os.path.join(self.iconsdir,'pause.png'))
+ stopimg.show()
+ widget.set_image(stopimg)
+ self.playing = gobject.timeout_add(self.waittime, self.playframe)
+
+ def oldplayframe(self):
+ self.mfdraw.fgimgpath = self.frameimgpaths[self.playframenum]
+ self.mfdraw.queue_draw()
+ self.playframenum += 1
+ if self.playframenum == 6:
+ self.playframenum = 0
+ if self.playing:
+ return True
+ else:
+ return False
+
+ def playframe(self):
+ self.fgpixbuf = self.fgpixbufs[self.playframenum]
+ self.drawmain()
+ self.playframenum += 1
+ if self.playframenum == 6:
+ self.playframenum = 0
+ # SOUND HANDLING
+ #if self.bus.have_pending:
+ # print 'PENDING ITEMS ON SOUND BUS'
+ # END OF SOUND HANDLING
+ if self.playing:
+ return True
+ else:
+ return False
+
+ def drawmain(self):
+ #if not self.fgimgpath:
+ # pixbuf2 = gtk.gdk.pixbuf_new_from_file(self.bgimgpath)
+ # sbuf2 = pixbuf2.scale_simple(BGHEIGHT,BGWIDTH,gtk.gdk.INTERP_BILINEAR)
+ # self.mainimage.set_from_pixbuf(sbuf2)
+ # return
+
+ # COMPOSITING FROM FILE PATHS
+ #pixbuf = gtk.gdk.pixbuf_new_from_file(self.fgimgpath)
+ #sbuf = pixbuf.scale_simple(BGHEIGHT,BGWIDTH,gtk.gdk.INTERP_BILINEAR)
+ #pixbuf2 = gtk.gdk.pixbuf_new_from_file(self.bgimgpath)
+ #sbuf2 = pixbuf2.scale_simple(BGHEIGHT,BGWIDTH,gtk.gdk.INTERP_BILINEAR)
+ #sbuf.composite(sbuf2,0,0,sbuf.props.width,sbuf.props.height,
+ # 0,0,1.0,1.0,gtk.gdk.INTERP_HYPER,255)
+
+ # COMPOSITING FROM PIXBUFS
+ #sbuf = self.fgpixbuf.copy()
+ #sbuf2 = self.bgpixbuf.copy()
+ #sbuf.composite(sbuf2,0,0,sbuf.props.width,sbuf.props.height,
+ # 0,0,1.0,1.0,gtk.gdk.INTERP_HYPER,255)
+ #self.mainimage.set_from_pixbuf(sbuf2)
+
+ # USING DRAWING AREA
+ self.mfdraw.fgpixbuf = self.fgpixbuf
+ self.mfdraw.bgpixbuf = self.bgpixbuf
+ self.mfdraw.queue_draw()
+
+ def getbackgroundfile(self, widget, data=None):
+ dialog = gtk.FileChooserDialog(title="Open..",
+ action=gtk.FILE_CHOOSER_ACTION_OPEN,
+ buttons=(gtk.STOCK_CANCEL,
+ gtk.RESPONSE_CANCEL,
+ gtk.STOCK_OPEN, gtk.RESPONSE_OK))
+ if self.insugar:
+ dialog.set_current_folder('/home/olpc')
+ dialog.set_default_response(gtk.RESPONSE_OK)
+
+ #filter = gtk.FileFilter()
+ #filter.set_name("All files")
+ #filter.add_pattern("*")
+ #dialog.add_filter(filter)
+
+ filter = gtk.FileFilter()
+ filter.set_name("Images")
+ filter.add_mime_type("image/png")
+ filter.add_mime_type("image/jpeg")
+ filter.add_mime_type("image/gif")
+ filter.add_pattern("*.png")
+ filter.add_pattern("*.jpg")
+ filter.add_pattern("*.gif")
+ dialog.add_filter(filter)
+
+ response = dialog.run()
+ if response == gtk.RESPONSE_OK:
+ #print dialog.get_filename(), 'selected'
+ bgimgpath = dialog.get_filename()
+ self.backpicpaths.append(bgimgpath)
+ self.backnum = self.backpicpaths.index(bgimgpath)
+ self.setback(bgimgpath)
+ f = file(os.path.join(self.mdirpath,'config.backpics'),'a')
+ f.write('%s\n' % bgimgpath)
+ f.close()
+ elif response == gtk.RESPONSE_CANCEL:
+ # print 'Closed, no files selected'
+ pass
+ dialog.destroy()
+
+ def getimgdir(self, widget, data=None):
+ daction = gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER
+ dialog = gtk.FileChooserDialog(title='Select Folder',
+ action=daction,
+ buttons=(gtk.STOCK_CANCEL,
+ gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,
+ gtk.RESPONSE_OK))
+ if self.insugar:
+ dialog.set_current_folder('/home/olpc')
+ dialog.set_default_response(gtk.RESPONSE_OK)
+ response = dialog.run()
+ if response == gtk.RESPONSE_OK:
+ #print dialog.get_filename(), 'selected'
+ imgdir = dialog.get_filename()
+ pics = self.getpics(imgdir)
+ if pics:
+ self.imgdir = imgdir
+ self.imgdirs.append(imgdir)
+ self.imgdirindex = self.imgdirs.index(imgdir)
+ self.loadimages()
+ self.setcharacter()
+ self.drawmain()
+ f = file(os.path.join(self.mdirpath,'config.imgdirs'),'a')
+ f.write('%s\n' % imgdir)
+ f.close()
+ elif response == gtk.RESPONSE_CANCEL:
+ pass
+ dialog.destroy()
+
+ def getsoundfile(self, widget, data=None):
+ dialog = gtk.FileChooserDialog(title="Open..",
+ action=gtk.FILE_CHOOSER_ACTION_OPEN,
+ buttons=(gtk.STOCK_CANCEL,
+ gtk.RESPONSE_CANCEL,
+ gtk.STOCK_OPEN, gtk.RESPONSE_OK))
+ if self.insugar:
+ dialog.set_current_folder('/home/olpc')
+ dialog.set_default_response(gtk.RESPONSE_OK)
+
+ filter = gtk.FileFilter()
+ filter.set_name("Sounds")
+ #filter.add_mime_type("image/png")
+ filter.add_pattern('*.wav')
+ filter.add_pattern('*.mp3')
+ filter.add_pattern('*.ogg')
+ dialog.add_filter(filter)
+
+ response = dialog.run()
+ if response == gtk.RESPONSE_OK:
+ soundfilepath = dialog.get_filename()
+ self.sounds.append(soundfilepath)
+ self.soundfile = soundfilepath
+ self.soundindex = self.sounds.index(soundfilepath)
+ self.changesound()
+ f = file(os.path.join(self.mdirpath,'config.sounds'),'a')
+ f.write('%s\n' % soundfilepath)
+ f.close()
+ elif response == gtk.RESPONSE_CANCEL:
+ # print 'Closed, no files selected'
+ pass
+ dialog.destroy()
+
+ def savefile(self, widget, data=None):
+ daction = gtk.FILE_CHOOSER_ACTION_SAVE
+ dialog = gtk.FileChooserDialog(title='Save Animation',
+ action=daction,
+ buttons=(gtk.STOCK_CANCEL,
+ gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE,
+ gtk.RESPONSE_OK))
+ if self.insugar:
+ dialog.set_current_folder('/home/olpc')
+ dialog.set_current_name('cartoon.zip')
+ dialog.set_default_response(gtk.RESPONSE_OK)
+ response = dialog.run()
+ if response == gtk.RESPONSE_OK:
+ filepath = dialog.get_filename()
+ # print filepath
+ zf = zipfile.ZipFile(filepath,'w')
+ # add the background file
+ tmpimgdir = os.path.join(self.mdirpath,'tmpimg')
+ tmpbgpath = os.path.join(tmpimgdir,'back.png')
+ self.bgpixbuf.save(tmpbgpath,'png')
+ zf.write(tmpbgpath)
+ os.remove(tmpbgpath)
+ # add the frames
+ count = 1
+ for pixbuf in self.fgpixbufs:
+ filename = '%02d.png' % count
+ filepath = os.path.join(tmpimgdir,filename)
+ pixbuf.save(filepath,'png')
+ zf.write(filepath)
+ os.remove(filepath)
+ count += 1
+ zf.close()
+ elif response == gtk.RESPONSE_CANCEL:
+ pass
+ dialog.destroy()
+
+ def loadfile(self, widget, data=None):
+ daction = gtk.FILE_CHOOSER_ACTION_OPEN
+ dialog = gtk.FileChooserDialog(title='Select File',
+ action=daction,
+ buttons=(gtk.STOCK_CANCEL,
+ gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,
+ gtk.RESPONSE_OK))
+ if self.insugar:
+ dialog.set_current_folder('/home/olpc')
+ dialog.set_default_response(gtk.RESPONSE_OK)
+ filter = gtk.FileFilter()
+ filter.set_name("Zipfiles")
+ #filter.add_mime_type("image/gif")
+ filter.add_pattern("*.zip")
+ dialog.add_filter(filter)
+ response = dialog.run()
+ if response == gtk.RESPONSE_OK:
+ filepath = dialog.get_filename()
+ # print filepath
+ zf = zipfile.ZipFile(filepath,'r')
+ fnames = zf.namelist()
+ framenames = []
+ for fname in fnames:
+ if fname[-8:] == 'back.png':
+ backname = fname
+ else:
+ framenames.append(fname)
+ framenames.sort()
+ # set the background
+ tmpimgdir = os.path.join(self.mdirpath,'tmpimg')
+ tmpbgpath = os.path.join(tmpimgdir,'back.png')
+ f = file(tmpbgpath,'w')
+ f.write(zf.read(backname))
+ f.close()
+ self.setback(tmpbgpath)
+ os.remove(tmpbgpath)
+ self.imgdir = tmpimgdir
+ for filepath in framenames:
+ fname = os.path.split(filepath)[1]
+ tmpfilepath = os.path.join(tmpimgdir,fname)
+ f = file(tmpfilepath,'w')
+ f.write(zf.read(filepath))
+ f.close()
+ zf.close()
+ self.loadimages()
+ #self.setcharacter()
+ # setup the filmstrip frames
+ pics = self.getpics(self.imgdir)
+ count = 0
+ for imgpath in pics:
+ pixbuf = gtk.gdk.pixbuf_new_from_file(imgpath)
+ fgpixbuf = pixbuf.scale_simple(BGWIDTH,BGHEIGHT,gtk.gdk.INTERP_BILINEAR)
+ self.fgpixbufs[count] = fgpixbuf
+ if count == 0:
+ self.fgpixbuf = fgpixbuf
+ self.drawmain()
+ scaled_buf = pixbuf.scale_simple(IMGWIDTH,IMGHEIGHT,gtk.gdk.INTERP_BILINEAR)
+ self.frameimgs[count].set_from_pixbuf(scaled_buf)
+ count += 1
+ entries = os.listdir(tmpimgdir)
+ for entry in entries:
+ entrypath = os.path.join(tmpimgdir,entry)
+ os.remove(entrypath)
+
+ elif response == gtk.RESPONSE_CANCEL:
+ pass
+ dialog.destroy()
+
+ def setplayspeed(self,adj):
+ self.waittime = int((6-adj.value)*150)
+ if self.playing:
+ gobject.source_remove(self.playing)
+ self.playing = gobject.timeout_add(self.waittime, self.playframe)
+
+ def loadimages(self):
+ self.posepixbufs = []
+ pics = self.getpics(self.imgdir)
+ count = 0
+ for imgpath in pics[self.imgstartindex:self.imgstartindex+10]:
+ pixbuf = gtk.gdk.pixbuf_new_from_file(imgpath)
+ scaled_buf = pixbuf.scale_simple(IMGWIDTH,IMGHEIGHT,gtk.gdk.INTERP_BILINEAR)
+ self.posepixbufs.append(pixbuf)
+ self.images[count].set_from_pixbuf(scaled_buf)
+ count += 1
+ for i in range(count,10):
+ transpixbuf = self.gettranspixbuf(IMGWIDTH,IMGHEIGHT)
+ imgpath = os.path.join(self.iconsdir,TRANSIMG)
+ img = gtk.Image()
+ img.set_from_pixbuf(transpixbuf)
+ img.show()
+ self.posepixbufs.append(pixbuf)
+ self.images[i].set_from_pixbuf(transpixbuf)
+
+ def getpics(self, dirpath):
+ pics = []
+ entries = os.listdir(dirpath)
+ entries.sort()
+ for entry in entries:
+ if entry[-4:].lower() in ['.png','.gif','.jpg']:
+ filepath = os.path.join(dirpath,entry)
+ pics.append(filepath)
+ return pics
+
+
+ def imgup(self, widget, data=None):
+ pics = self.getpics(self.imgdir)
+ if self.imgstartindex > 0:
+ self.imgstartindex -= 2
+ self.loadimages()
+ self.setcharacter()
+ self.drawmain()
+
+ def imgdown(self, widget, data=None):
+ pics = self.getpics(self.imgdir)
+ if len(pics[self.imgstartindex:]) > 10:
+ self.imgstartindex += 2
+ self.loadimages()
+ self.setcharacter()
+ self.drawmain()
+
+ def gettranspixbuf(self, width=50, height=50):
+ transimgpath = os.path.join(self.iconsdir,TRANSIMG)
+ pixbuf = gtk.gdk.pixbuf_new_from_file(transimgpath)
+ if width == 50 and height == 50:
+ return pixbuf
+ scaled_buf = pixbuf.scale_simple(width,height,gtk.gdk.INTERP_BILINEAR)
+ return scaled_buf
+
+ def showlessonplans(self, widget, data=None):
+ dia = gtk.Dialog(title='Lesson Plans',
+ parent=None,
+ flags=0,
+ buttons=None)
+ dia.set_default_size(500,500)
+ dia.show()
+
+ #dia.vbox.pack_start(scrolled_window, True, True, 0)
+ notebook = gtk.Notebook()
+ # uncomment below to highlight tabs
+ notebook.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(WHITE))
+ notebook.set_tab_pos(gtk.POS_TOP)
+ #notebook.set_default_size(400,400)
+ notebook.show()
+ lessonplans = {}
+ lpdir = os.path.join(self.mdirpath,LANG[self.language]['lpdir'])
+ lpentries = os.listdir(lpdir)
+ for entry in lpentries:
+ fpath = os.path.join(lpdir,entry)
+ lessonplans[entry] = getwrappedfile(fpath,80)
+ lpkeys = lessonplans.keys()
+ lpkeys.sort()
+ for lpkey in lpkeys:
+ lpname = lpkey.replace('_',' ').replace('0','')[:-4]
+ label = gtk.Label(lessonplans[lpkey])
+ #if self.insugar:
+ # label.modify_fg(gtk.STATE_NORMAL,gtk.gdk.color_parse(WHITE))
+ eb = gtk.EventBox()
+ eb.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(WHITE))
+ #label.set_line_wrap(True)
+ label.show()
+ eb.add(label)
+ eb.show()
+ #tlabel = gtk.Label('Lesson Plan %s' % str(i+1))
+ tlabel = gtk.Label(lpname)
+ tlabel.show()
+ scrolled_window = gtk.ScrolledWindow()
+ scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
+ scrolled_window.show()
+ scrolled_window.add_with_viewport(eb)
+ notebook.append_page(scrolled_window, tlabel)
+ #dia.action_area.pack_start(notebook, True, True, 0)
+ dia.vbox.pack_start(notebook, True, True, 0)
+ result = dia.run()
+ dia.destroy()
+
+ def changed_cb(self, combobox):
+ model = combobox.get_model()
+ index = combobox.get_active()
+ if index:
+ lang = model[index][0]
+ if lang in LANG:
+ self.lessonplans.set_label(LANG[lang]['lessonplan'])
+ prepare_btn(self.lessonplans)
+ self.character.set_label(LANG[lang]['character'])
+ prepare_btn(self.character)
+ self.bgbutton.set_label(LANG[lang]['background'])
+ prepare_btn(self.bgbutton)
+ self.soundbutton.set_label(LANG[lang]['sound'])
+ prepare_btn(self.soundbutton)
+ else:
+ print repr(lang)
+ return
+
+ def changebuttonlang(self):
+ self.lessonplans.set_label(LANG[self.language]['lessonplan'])
+ prepare_btn(self.lessonplans)
+ self.character.set_label(LANG[self.language]['character'])
+ prepare_btn(self.character)
+ self.bgbutton.set_label(LANG[self.language]['background'])
+ prepare_btn(self.bgbutton)
+ self.soundbutton.set_label(LANG[self.language]['sound'])
+ prepare_btn(self.soundbutton)
+ self.lang.set_label(self.language)
+ prepare_btn(self.lang)
+
+ def setlastlanguage(self, widget, data=None):
+ li = LANGLIST.index(self.language)
+ if li == 0:
+ self.language = LANGLIST[len(LANGLIST)-1]
+ else:
+ self.language = LANGLIST[li-1]
+ self.changebuttonlang()
+
+ def setnextlanguage(self, widget, data=None):
+ li = LANGLIST.index(self.language)
+ if li == (len(LANGLIST)-1):
+ self.language = LANGLIST[0]
+ else:
+ self.language = LANGLIST[li+1]
+ self.changebuttonlang()
+
+ def getdefaultlang(self):
+ return 'English'
+
+ def __init__(self,toplevel_window,mdirpath):
+ self.mdirpath = mdirpath
+ self.iconsdir = os.path.join(self.mdirpath,'icons')
+ self.playing = False
+ self.backnum = 0
+ self.backpicpaths = []
+ bpfile = file(os.path.join(self.mdirpath,'config.backpics'))
+ for line in bpfile:
+ bpfilepath = line.strip()
+ if bpfilepath[0] != '/':
+ bpfilepath = os.path.join(self.mdirpath,line.strip())
+ if os.path.isfile(bpfilepath):
+ self.backpicpaths.append(bpfilepath)
+ bpfile.close()
+ self.waittime = 3*150
+ self.insugar = False
+ self.language = self.getdefaultlang()
+ self.imgdirs = []
+ imgdirfile = file(os.path.join(self.mdirpath,'config.imgdirs'))
+ for line in imgdirfile:
+ imgdirpath = line.strip()
+ if imgdirpath[0] != '/':
+ imgdirpath = os.path.join(self.mdirpath,line.strip())
+ if os.path.isdir(imgdirpath):
+ self.imgdirs.append(imgdirpath)
+ imgdirfile.close()
+ self.imgdirindex = 0
+ self.imgstartindex = 0
+ self.sounds = ['']
+ soundfile = file(os.path.join(self.mdirpath,'config.sounds'))
+ for line in soundfile:
+ soundfilepath = line.strip()
+ if soundfilepath[0] != '/':
+ soundfilepath = os.path.join(self.mdirpath,line.strip())
+ if os.path.isfile(soundfilepath):
+ self.sounds.append(soundfilepath)
+ soundfile.close()
+ self.soundindex = 0
+ self.soundfile = self.sounds[self.soundindex]
+ # START GSTREAMER STUFF
+ self.player = gst.element_factory_make("playbin", "player")
+ fakesink = gst.element_factory_make('fakesink', "my-fakesink")
+ self.player.set_property("video-sink", fakesink)
+ self.bus = self.player.get_bus()
+ self.bus.add_signal_watch()
+ self.bus.connect('message', self.on_gstmessage)
+ # END GSTREAMER STUFF
+ self.fgpixbuf = self.gettranspixbuf(BGWIDTH,BGHEIGHT)
+
+ self.mpbox = gtk.VBox()
+
+ self.main = gtk.EventBox()
+ self.main.show()
+ self.main.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(GRAY))
+ self.mainbox = gtk.EventBox()
+ self.mainbox.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BACKGROUND))
+ self.mainbox.set_border_width(5)
+ self.mainbox.show()
+ self.main.add(self.mainbox)
+ self.mpbox.show()
+ self.logobox = gtk.HBox(False,0)
+ self.logobox.show()
+ self.logo = gtk.Image()
+ self.logo.show()
+ self.logo.set_from_file(os.path.join(self.iconsdir,'logo.png'))
+ self.logobox.pack_start(self.logo,False,False,0)
+ self.lessonplans = gtk.Button('Lesson Plans')
+ self.lessonplans.connect('clicked',self.showlessonplans, None)
+ prepare_btn(self.lessonplans)
+ self.lessonplans.show()
+ self.lpvbox = gtk.VBox()
+ self.lpvbox.show()
+ self.lpvbox.pack_start(self.lessonplans,True,False,0)
+ self.lpoframe = gtk.EventBox()
+ self.lpoframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(YELLOW))
+ self.lpoframe.show()
+ self.lpframe = gtk.EventBox()
+ self.lpframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BACKGROUND))
+ self.lpframe.show()
+ self.lpalign = gtk.Alignment(1.0,1.0,1.0,1.0)
+ self.lpalign.add(self.lpframe)
+ self.lpalign.set_padding(5,0,5,0)
+ self.lpalign.show()
+ self.lpoframe.add(self.lpalign)
+ self.lphbox = gtk.HBox()
+ self.lphbox.show()
+ self.lphbox.pack_start(self.lpvbox,True,False,0)
+ self.lpframe.add(self.lphbox)
+ self.logobox.pack_start(self.lpoframe,True,True,0)
+ #self.lang = gtk.combo_box_new_text()
+ #self.lang.append_text('Language')
+ #self.lang.append_text('English')
+ #self.lang.append_text(SPANISH)
+ #self.lang.connect('changed', self.changed_cb)
+ #self.lang.set_active(0)
+ #prepare_btn(self.lang)
+ #self.lang.show()
+ self.lastlang = gtk.Button()
+ self.lastlang.connect('clicked', self.setlastlanguage, None)
+ llla = gtk.Image()
+ llla.set_from_file(os.path.join(self.iconsdir,'left_arrow.png'))
+ llla.show()
+ self.lastlang.add(llla)
+ prepare_btn(self.lastlang)
+ self.lastlang.show()
+ self.llvbox = gtk.VBox()
+ self.llvbox.show()
+ self.llvbox.pack_start(self.lastlang,True,False,0)
+ self.lang = gtk.Button(self.language)
+ prepare_btn(self.lang)
+ self.lang.show()
+ self.nextlang = gtk.Button()
+ self.nextlang.connect('clicked', self.setnextlanguage, None)
+ nlra = gtk.Image()
+ nlra.set_from_file(os.path.join(self.iconsdir,'right_arrow.png'))
+ nlra.show()
+ self.nextlang.add(nlra)
+ prepare_btn(self.nextlang)
+ self.nextlang.show()
+ self.nlvbox = gtk.VBox()
+ self.nlvbox.show()
+ self.nlvbox.pack_start(self.nextlang,True,False,0)
+ self.langvbox = gtk.VBox()
+ self.langvbox.show()
+ self.langvbox.pack_start(self.lang,True,False,0)
+ self.langoframe = gtk.EventBox()
+ self.langoframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(YELLOW))
+ self.langoframe.show()
+ self.langframe = gtk.EventBox()
+ self.langframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BACKGROUND))
+ self.langframe.show()
+ self.langalign = gtk.Alignment(1.0,1.0,1.0,1.0)
+ self.langalign.add(self.langframe)
+ self.langalign.set_padding(5,0,5,0)
+ self.langalign.show()
+ self.langoframe.add(self.langalign)
+ self.langhbox = gtk.HBox()
+ self.langhbox.show()
+ self.langhbox.pack_start(self.llvbox,True,False,0)
+ self.langhbox.pack_start(self.langvbox,True,False,0)
+ self.langhbox.pack_start(self.nlvbox,True,False,0)
+ self.langframe.add(self.langhbox)
+ self.logobox.pack_start(self.langoframe,True,True,0)
+
+ self.sooframe = gtk.EventBox()
+ self.sooframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(YELLOW))
+ self.sooframe.show()
+ self.soframe = gtk.EventBox()
+ self.soframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BACKGROUND))
+ self.soframe.show()
+ self.soalign = gtk.Alignment(1.0,1.0,1.0,1.0)
+ self.soalign.add(self.soframe)
+ self.soalign.set_padding(5,0,5,5)
+ self.soalign.show()
+ self.sooframe.add(self.soalign)
+ self.fileopen = gtk.Button()
+ openimg = gtk.Image()
+ openimg.set_from_stock(gtk.STOCK_OPEN,gtk.ICON_SIZE_BUTTON)
+ openimg.show()
+ prepare_btn(self.fileopen)
+ self.fileopen.set_label('')
+ self.fileopen.set_image(openimg)
+ self.fileopen.connect('clicked',self.loadfile, None)
+ self.fileopen.show()
+ self.fovbox = gtk.VBox()
+ self.fovbox.show()
+ self.fovbox.pack_start(self.fileopen,True,False,0)
+ self.fohbox = gtk.HBox()
+ self.fohbox.show()
+ self.fohbox.pack_start(self.fovbox,True,False,0)
+ self.filesave = gtk.Button()
+ saveimg = gtk.Image()
+ saveimg.set_from_stock(gtk.STOCK_SAVE,gtk.ICON_SIZE_BUTTON)
+ saveimg.show()
+ prepare_btn(self.filesave)
+ self.filesave.set_label('')
+ self.filesave.set_image(saveimg)
+ self.filesave.connect('clicked',self.savefile, None)
+ self.filesave.show()
+ self.fsvbox = gtk.VBox()
+ self.fsvbox.show()
+ self.fsvbox.pack_start(self.filesave,True,False,0)
+ self.fohbox.pack_start(self.fsvbox,True,False,0)
+ self.soframe.add(self.fohbox)
+ self.logobox.pack_start(self.sooframe,True,True,0)
+
+ self.mpbox.pack_start(self.logobox,False,False,0)
+
+ self.centerframeborder = gtk.EventBox()
+ self.centerframeborder.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(YELLOW))
+ self.centerframeborder.show()
+ self.ocenterframe = gtk.EventBox()
+ self.ocenterframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BACKGROUND))
+ self.ocenterframe.set_border_width(5)
+ self.ocenterframe.show()
+ self.centerframeborder.add(self.ocenterframe)
+ self.centerframe = gtk.EventBox()
+ self.centerframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BACKGROUND))
+ self.centerframe.set_border_width(5)
+ self.centerframe.show()
+ self.ocenterframe.add(self.centerframe)
+ self.hbox = gtk.HBox()
+ self.hbox.show()
+ self.mainbox.add(self.mpbox)
+ self.centerframe.add(self.hbox)
+ self.mpbox.pack_start(self.centerframeborder,True,True,0)
+
+
+ self.tvbox = gtk.VBox()
+ self.tvbox.show()
+ # flow arrows
+ flowbox = gtk.HBox()
+ flowbox.show()
+ yellow_arrow = gtk.Image()
+ yellow_arrow.set_from_file(os.path.join(self.iconsdir, 'yellow_arrow.png'))
+ yellow_arrow.show()
+ flowbox.pack_end(yellow_arrow,True,False,0)
+ topspace = gtk.EventBox()
+ topspace.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BACKGROUND))
+ topspace.show()
+ topspace.set_border_width(15)
+ self.tvbox.pack_start(topspace,False,False,0)
+ self.tvbox.pack_start(flowbox,False,False,0)
+ self.table = gtk.Table(rows=7, columns=2, homogeneous=False)
+
+ self.imgbuttons = []
+ self.images = []
+ # POSE CHOOSER BUTTONS
+ for i in range(1,11):
+ ib = gtk.EventBox()
+ #ib = gtk.Button()
+ #ib.connect('clicked', self.pickimage, i)
+ ib.set_events(gtk.gdk.BUTTON_PRESS_MASK)
+ ib.connect('button_press_event', self.pickimage, i)
+ ib.set_border_width(1)
+ #ib.add(img)
+ ib.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BLACK))
+ ib.modify_bg(gtk.STATE_PRELIGHT,gtk.gdk.color_parse(BLACK))
+ ib.show()
+ img = gtk.Image()
+ img.show()
+ #ib.set_label('')
+ #ib.set_image(img)
+ ib.add(img)
+ self.imgbuttons.append(ib)
+ self.images.append(img)
+
+ self.imgupbutton = gtk.Button()
+ self.imgupbutton.connect('clicked', self.imgup, None)
+ self.imgupbutton.show()
+ #upa = gtk.Arrow(gtk.ARROW_UP,gtk.SHADOW_OUT)
+ #upa.show()
+ upa = gtk.Image()
+ upa.set_from_file(os.path.join(self.iconsdir,'up_arrow.png'))
+ upa.show()
+ self.imgupbutton.add(upa)
+ prepare_btn(self.imgupbutton)
+ self.iubhbox = gtk.HBox()
+ self.iubhbox.show()
+ self.iubhbox.pack_start(self.imgupbutton,True,False,0)
+ self.tvbox.pack_start(self.iubhbox,False,False,0)
+
+ self.table.attach(self.imgbuttons[0],0,1,0,1)
+ self.table.attach(self.imgbuttons[1],1,2,0,1)
+ self.table.attach(self.imgbuttons[2],0,1,1,2)
+ self.table.attach(self.imgbuttons[3],1,2,1,2)
+ self.table.attach(self.imgbuttons[4],0,1,2,3)
+ self.table.attach(self.imgbuttons[5],1,2,2,3)
+ self.table.attach(self.imgbuttons[6],0,1,3,4)
+ self.table.attach(self.imgbuttons[7],1,2,3,4)
+ self.table.attach(self.imgbuttons[8],0,1,4,5)
+ self.table.attach(self.imgbuttons[9],1,2,4,5)
+ self.table.show()
+
+ self.tableframeborder = gtk.EventBox()
+ self.tableframeborder.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(YELLOW))
+ self.tableframeborder.show()
+ self.tableframe = gtk.EventBox()
+ self.tableframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BACKGROUND))
+ self.tableframe.show()
+ self.tableframe.set_border_width(5)
+ self.tableframeborder.add(self.tableframe)
+ self.tableframe.add(self.table)
+
+ self.tfhbox = gtk.HBox()
+ self.tfhbox.show()
+ self.tfhbox.pack_start(self.tableframeborder,True,False,20)
+ self.tvbox.pack_start(self.tfhbox,False,False,0)
+
+ self.imgdownbutton = gtk.Button()
+ self.imgdownbutton.connect('clicked', self.imgdown, None)
+ self.imgdownbutton.show()
+ #downa = gtk.Arrow(gtk.ARROW_DOWN,gtk.SHADOW_OUT)
+ #downa.show()
+ downa = gtk.Image()
+ downa.set_from_file(os.path.join(self.iconsdir,'down_arrow.png'))
+ downa.show()
+ self.imgdownbutton.add(downa)
+ prepare_btn(self.imgdownbutton)
+ self.idbhbox = gtk.HBox()
+ self.idbhbox.show()
+ self.idbhbox.pack_start(self.imgdownbutton,True,False,0)
+ self.tvbox.pack_start(self.idbhbox,False,False,0)
+ self.hbox.pack_start(self.tvbox,True,True,0)
+
+ self.imgdir = self.imgdirs[self.imgdirindex]
+ self.loadimages()
+
+ self.rightbox = gtk.VBox()
+ self.rightbox.show()
+
+ # ANIMATION FRAMES / FILMSTRIP
+ self.tophbox = gtk.HBox()
+ self.tophbox.show()
+ # animation frames
+ self.animhbox = gtk.HBox()
+ self.animhbox.show()
+ self.framebuttons = []
+ self.frameimgs = []
+ self.fgpixbufs = []
+ for i in range(6):
+ #fb = gtk.Button()
+ #fb.connect('clicked', self.selectframe, i+1)
+ fb = gtk.EventBox()
+ fb.set_events(gtk.gdk.BUTTON_PRESS_MASK)
+ fb.connect('button_press_event', self.selectframe, i+1)
+ fb.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BLACK))
+ fb.modify_bg(gtk.STATE_PRELIGHT,gtk.gdk.color_parse(BLACK))
+ fb.show()
+ self.framebuttons.append(fb)
+ tpixbuf = self.gettranspixbuf(BGWIDTH,BGHEIGHT)
+ self.fgpixbufs.append(tpixbuf)
+ #fb.set_label('')
+ transimg = gtk.Image()
+ transimg.set_from_pixbuf(self.gettranspixbuf(IMGWIDTH,IMGHEIGHT))
+ transimg.show()
+ self.frameimgs.append(transimg)
+ #fb.set_image(transimg)
+ fb.add(transimg)
+ self.animhbox.pack_start(fb,True,True,2)
+ #if i != 5:
+ # ra = gtk.Arrow(gtk.ARROW_RIGHT,gtk.SHADOW_OUT)
+ # ra.show()
+ # self.tophbox.pack_start(ra,True,True,0)
+
+
+ self.animborder = gtk.EventBox()
+ self.animborder.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(PINK))
+ self.animborder.show()
+ self.animframe = gtk.EventBox()
+ self.animframe.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BACKGROUND))
+ self.animframe.set_border_width(5)
+ self.animframe.show()
+ self.animborder.add(self.animframe)
+ self.animfilmstrip = gtk.VBox()
+ self.animfilmstrip.show()
+ self.filmstriptopimg = gtk.Image()
+ self.filmstriptopimg.set_from_file(os.path.join(self.iconsdir,'filmstrip.png'))
+ self.filmstriptopimg.show()
+ self.animfilmstrip.pack_start(self.filmstriptopimg,False,False,0)
+ self.animfilmstrip.pack_start(self.animhbox,False,False,0)
+ self.filmstripbottomimg = gtk.Image()
+ self.filmstripbottomimg.set_from_file(os.path.join(self.iconsdir,'filmstrip.png'))
+ self.filmstripbottomimg.show()
+ self.animfilmstrip.pack_start(self.filmstripbottomimg,False,False,0)
+ self.animframe.add(self.animfilmstrip)
+ self.afvbox = gtk.VBox()
+ self.afvbox.show()
+ self.afvbox.pack_start(self.animborder,False,False,0)
+ self.tophbox.pack_start(self.afvbox,False,False,0)
+ #self.clrframe = gtk.Button('CLEAR FRAME')
+ cancelimg = gtk.Image()
+ #cancelimg.set_from_stock(gtk.STOCK_CANCEL,gtk.ICON_SIZE_BUTTON)
+ cancelimg.set_from_file(os.path.join(self.iconsdir,'clear.png'))
+ cancelimg.show()
+ self.clrframe = gtk.Button()
+ self.clrframe.set_label('')
+ self.clrframe.set_image(cancelimg)
+ self.clrframe.connect('clicked', self.clearall, None)
+ prepare_btn(self.clrframe)
+ self.clrframe.show()
+
+ #self.cfbox.pack_start(self.clrframe,True,True,0)
+ #self.clrall = gtk.Button('CLEAR ALL')
+ #self.clrall.connect('clicked', self.clearall, None)
+ #self.clrall.show()
+ #self.cfbox.pack_start(self.clrall,True,True,0)
+ #self.controlbox.pack_start(self.cfbox,True,True,0)
+ self.cfvbox = gtk.VBox()
+ self.cfvbox.show()
+ self.cfvbox.pack_start(self.clrframe,True,False,0)
+ self.tophbox.pack_start(self.cfvbox,False,False,5)
+
+ pink_arrow = gtk.Image()
+ pink_arrow.set_from_file(os.path.join(self.iconsdir, 'pink_arrow.png'))
+ pink_arrow.show()
+ self.pahbox = gtk.HBox()
+ self.pahbox.show()
+ self.pahbox.pack_start(pink_arrow,False,False,150)
+ self.topvbox = gtk.VBox()
+ self.topvbox.show()
+ self.topvbox.pack_start(self.tophbox,False,False,0)
+ self.topvbox.pack_start(self.pahbox,False,False,0)
+
+ self.rightbox.pack_start(self.topvbox,False,False,5)
+ self.frame_selected = 0
+ self.fbstyle = self.framebuttons[0].get_style()
+ self.framebuttons[0].modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(YELLOW))
+ self.framebuttons[0].modify_bg(gtk.STATE_PRELIGHT,gtk.gdk.color_parse(YELLOW))
+
+ self.bottomhbox = gtk.HBox()
+ self.bottomhbox.show()
+
+ self.centervbox = gtk.VBox()
+ self.centervbox.show()
+ # MAIN IMAGE
+ self.mfdraw = FrameWidget(None,self.fgpixbuf)
+ self.mfdraw.set_size_request(BGWIDTH,BGHEIGHT)
+ self.mfdraw.show()
+ self.mfdrawborder = gtk.EventBox()
+ self.mfdrawborder.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(PINK))
+ self.mfdrawborder.show()
+ self.mfdrawbox = gtk.EventBox()
+ self.mfdrawbox.set_border_width(5)
+ self.mfdrawbox.show()
+ self.mfdrawbox.add(self.mfdraw)
+ self.mfdrawborder.add(self.mfdrawbox)
+ self.centervbox.pack_start(self.mfdrawborder,False,False,0)
+
+ self.bcontrolbox = gtk.HBox()
+ self.bcontrolbox.set_border_width(5)
+ self.bcontrolbox.show()
+ # GO BUTTON
+ playimg = gtk.Image()
+ #playimg.set_from_stock(gtk.STOCK_MEDIA_PLAY,gtk.ICON_SIZE_BUTTON)
+ playimg.set_from_file(os.path.join(self.iconsdir,'right_arrow.png'))
+ playimg.show()
+ self.gobutton = gtk.Button()
+ self.gobutton.set_label('')
+ self.gobutton.set_image(playimg)
+ self.gobutton.connect('clicked', self.go, None)
+ prepare_btn(self.gobutton)
+ self.gobutton.show()
+ self.bcontrolbox.pack_start(self.gobutton,True,True,5)
+
+ # SPEED CONTROLS
+ self.sbox = gtk.VBox()
+ self.sbox.show()
+ adj = gtk.Adjustment(2.5,1,5,.5,1)
+ adj.connect('value_changed',self.setplayspeed)
+ self.playspeed = gtk.HScale(adj)
+ self.playspeed.set_draw_value(False)
+ for state, color in COLOR_BG_BUTTONS:
+ self.playspeed.modify_bg(state, gtk.gdk.color_parse(color))
+ self.playspeed.show()
+ self.sbox.pack_start(self.playspeed,True,True,0)
+ #self.pslabel = gtk.Label('Speed')
+ #self.pslabel.show()
+ #self.sbox.pack_start(self.pslabel,True,True,0)
+ self.bcontrolbox.pack_start(self.sbox,True,True,5)
+ self.centervbox.pack_start(self.bcontrolbox,False,False,0)
+ self.bottomhbox.pack_start(self.centervbox,False,False,0)
+
+ self.controlbox = gtk.VBox()
+ self.controlbox.show()
+
+ # CHARACTER CONTROLS
+ self.ccbox = gtk.VBox()
+ self.ccbox.show()
+ self.cchbox = gtk.HBox()
+ self.cchbox.show()
+ self.cclbutton = gtk.Button()
+ self.cclbutton.connect('clicked',self.lastcharacter,None)
+ self.cclbutton.show()
+ ccla = gtk.Image()
+ ccla.set_from_file(os.path.join(self.iconsdir,'left_arrow.png'))
+ ccla.show()
+ prepare_btn(self.cclbutton)
+ self.cclbutton.add(ccla)
+ self.cclbvbox = gtk.VBox()
+ self.cclbvbox.show()
+ self.cclbvbox.pack_start(self.cclbutton,True,False,0)
+ self.cchbox.pack_start(self.cclbvbox,True,False,5)
+ self.ccibutton = gtk.Button()
+ self.ccibutton.show()
+ self.ccismall = gtk.Image()
+ self.ccismall.show()
+ self.cciebox = gtk.EventBox()
+ self.cciebox.modify_bg(gtk.STATE_NORMAL,gtk.gdk.color_parse(BLACK))
+ self.cciebox.show()
+ self.cciebox.add(self.ccismall)
+ self.ccibvbox = gtk.VBox()
+ self.ccibvbox.show()
+ self.ccibvbox.pack_start(self.cciebox,True,False,0)
+ self.cchbox.pack_start(self.ccibvbox,False,False,0)
+ self.ccrbutton = gtk.Button()
+ self.ccrbutton.connect('clicked',self.nextcharacter,None)
+ self.ccrbutton.show()
+ ccra = gtk.Image()
+ ccra.set_from_file(os.path.join(self.iconsdir,'right_arrow.png'))
+ ccra.show()
+ self.ccrbutton.add(ccra)
+ prepare_btn(self.ccrbutton)
+ self.ccrbvbox = gtk.VBox()
+ self.ccrbvbox.show()
+ self.ccrbvbox.pack_start(self.ccrbutton,True,False,0)
+ self.cchbox.pack_start(self.ccrbvbox,True,False,5)
+ self.ccbox.pack_start(self.cchbox,True,True,0)
+ self.charlabel = gtk.Label('')
+ self.charlabel.show()
+ self.charlabelhbox = gtk.HBox()
+ self.charlabelhbox.show()
+ self.charlabelhbox.pack_start(self.charlabel,True,False,0)
+ self.ccbox.pack_start(self.charlabelhbox,False,False,0)
+ self.character = gtk.Button('My Character')
+ self.character.connect('clicked',self.getimgdir,None)
+ prepare_btn(self.character)
+ self.character.show()
+ self.characterhbox = gtk.HBox()
+ self.characterhbox.show()
+ self.characterhbox.pack_start(self.character,True,False,0)
+ self.ccbox.pack_start(self.characterhbox,False,False,5)
+ self.setcharacter()
+
+
+ self.controlbox.pack_start(self.ccbox,False,False,5)
+
+ # BACKGROUND CONTROLS
+ self.bgbox = gtk.VBox()
+ self.bgbox.show()
+ self.bghbox = gtk.HBox()
+ self.bghbox.show()
+ self.blbutton = gtk.Button()
+ self.blbutton.connect('clicked',self.lastback,None)
+ self.blbutton.show()
+ bla = gtk.Image()
+ bla.set_from_file(os.path.join(self.iconsdir,'left_arrow.png'))
+ bla.show()
+ self.blbutton.add(bla)
+ prepare_btn(self.blbutton)
+ self.blbvbox = gtk.VBox()
+ self.blbvbox.show()
+ self.blbvbox.pack_start(self.blbutton,True,False,0)
+ self.bghbox.pack_start(self.blbvbox,True,False,5)
+ self.bgsmall = gtk.Image()
+ bgimgpath = os.path.join(self.mdirpath,'backpics/bigbg01.gif')
+ self.setback(bgimgpath)
+ self.bgsmall.show()
+ self.bghbox.pack_start(self.bgsmall,False,False,0)
+ self.brbutton = gtk.Button()
+ self.brbutton.connect('clicked',self.nextback,None)
+ self.brbutton.show()
+ bra = gtk.Image()
+ bra.set_from_file(os.path.join(self.iconsdir,'right_arrow.png'))
+ bra.show()
+ self.brbutton.add(bra)
+ prepare_btn(self.brbutton)
+ self.brbvbox = gtk.VBox()
+ self.brbvbox.show()
+ self.brbvbox.pack_start(self.brbutton,True,False,0)
+ self.bghbox.pack_start(self.brbvbox,True,False,5)
+ self.bgbox.pack_start(self.bghbox,True,True,0)
+ self.bgbutton = gtk.Button('My Background')
+ self.bgbutton.connect('clicked',self.getbackgroundfile,None)
+ prepare_btn(self.bgbutton)
+ self.bgbutton.show()
+ self.bgbuttonhbox = gtk.HBox()
+ self.bgbuttonhbox.show()
+ self.bgbuttonhbox.pack_start(self.bgbutton,True,False,0)
+ self.bgbox.pack_start(self.bgbuttonhbox,False,False,5)
+ self.controlbox.pack_start(self.bgbox,False,False,5)
+
+ # SOUND CONTROLS
+ self.soundbox = gtk.VBox()
+ self.soundbox.show()
+ self.soundhbox = gtk.HBox()
+ self.soundhbox.show()
+ self.slbutton = gtk.Button()
+ self.slbutton.connect('clicked',self.lastsound,None)
+ self.slbutton.show()
+ sla = gtk.Image()
+ sla.set_from_file(os.path.join(self.iconsdir,'left_arrow.png'))
+ sla.show()
+ self.slbutton.add(sla)
+ prepare_btn(self.slbutton)
+ self.slbvbox = gtk.VBox()
+ self.slbvbox.show()
+ self.slbvbox.pack_start(self.slbutton,True,False,0)
+ self.soundhbox.pack_start(self.slbvbox,True,False,5)
+ self.soundimg = gtk.Image()
+ self.soundimg.set_from_file(os.path.join(self.iconsdir,'sound_icon.png'))
+ self.soundimg.show()
+ self.soundhbox.pack_start(self.soundimg,False,False,0)
+ self.srbutton = gtk.Button()
+ self.srbutton.connect('clicked',self.nextsound,None)
+ self.srbutton.show()
+ sra = gtk.Image()
+ sra.set_from_file(os.path.join(self.iconsdir,'right_arrow.png'))
+ sra.show()
+ self.srbutton.add(sra)
+ prepare_btn(self.srbutton)
+ self.srbvbox = gtk.VBox()
+ self.srbvbox.show()
+ self.srbvbox.pack_start(self.srbutton,True,False,0)
+ self.soundhbox.pack_start(self.srbvbox,True,False,5)
+ self.soundbox.pack_start(self.soundhbox,True,True,0)
+ self.soundlabel = gtk.Label('No Sound')
+ self.soundlabel.show()
+ self.soundlabelhbox = gtk.HBox()
+ self.soundlabelhbox.show()
+ self.soundlabelhbox.pack_start(self.soundlabel,True,False,0)
+ self.soundbox.pack_start(self.soundlabelhbox,False,False,0)
+ self.soundbutton = gtk.Button('My Sound')
+ self.soundbutton.connect('clicked',self.getsoundfile,None)
+ prepare_btn(self.soundbutton)
+ self.soundbutton.show()
+ self.soundbuttonhbox = gtk.HBox()
+ self.soundbuttonhbox.show()
+ self.soundbuttonhbox.pack_start(self.soundbutton,True,False,0)
+ self.soundbox.pack_start(self.soundbuttonhbox,False,False,5)
+ self.controlbox.pack_start(self.soundbox,False,False,5)
+
+ # FINISHING DETAILS
+ self.bottomhbox.pack_start(self.controlbox,True,True,10)
+ self.rightbox.pack_start(self.bottomhbox,True,True,10)
+ self.hbox.pack_start(self.rightbox,True,True,0)
+
+ def main(self):
+ gtk.main()
+
+try:
+ from sugar.activity import activity
+ class cartoonbuilderActivity(activity.Activity):
+ def __init__(self, handle):
+ activity.Activity.__init__(self,handle)
+ self.connect("destroy",self.destroy_cb)
+ #app = cartoonbuilder(self,'/home/olpc/Activities/CartoonBuilder.activity')
+ bundle_path = activity.get_bundle_path()
+ os.chdir(bundle_path)
+ self.set_title('CartoonBuilder')
+ toolbox = activity.ActivityToolbox(self)
+ self.set_toolbox(toolbox)
+ toolbox.show()
+ if hasattr(self, '_jobject'):
+ self._jobject.metadata['title'] = 'CartoonBuilder'
+ title_widget = toolbox._activity_toolbar.title
+ title_widget.set_size_request(title_widget.get_layout().get_pixel_size()[0] + 20, -1)
+ app = cartoonbuilder(self, bundle_path)
+ app.insugar = True
+ outerframe = gtk.EventBox()
+ outerframe.show()
+ innerframe = gtk.EventBox()
+ innerframe.show()
+ ifalign = gtk.Alignment(1.0,1.0,1.0,1.0)
+ ifalign.add(innerframe)
+ ifalign.set_padding(85,90,160,160) # top,bottom,left,right
+ ifalign.show()
+ #innerframe.set_border_width(150)
+ outerframe.add(ifalign)
+ innerframe.add(app.main)
+ self.set_canvas(outerframe)
+
+ def destroy_cb(self, data=None):
+ return True
+
+except ImportError:
+ pass
+
+if __name__ == "__main__":
+ # have to do toplevel window stuff here because Sugar does it on the OLPC
+ toplevel_window = gtk.Window(gtk.WINDOW_TOPLEVEL)
+ #mdirpath = '.'
+ mdirpath = os.path.abspath(os.curdir)
+ app = cartoonbuilder(toplevel_window,mdirpath)
+ toplevel_window.add(app.main)
+ toplevel_window.set_title('Cartoon Builder')
+ # FULLSCREEN
+
+ #toplevel_window.set_decorated(False)
+ #toplevel_window.fullscreen()
+
+ toplevel_window.connect("delete_event", app.delete_event)
+ toplevel_window.connect("destroy", app.destroy)
+ #toplevel_window.set_border_width(10)
+ toplevel_window.show()
+ gtk.main()
diff --git a/config.backpics b/config.backpics
new file mode 100644
index 0000000..8c601a8
--- /dev/null
+++ b/config.backpics
@@ -0,0 +1,17 @@
+backpics/bigbg01.gif
+backpics/bigbg02.gif
+backpics/bigbg03.gif
+backpics/bigbg04.gif
+backpics/bigbg05.gif
+backpics/bigbg06.gif
+backpics/bigbg07.gif
+backpics/bigbg08.gif
+backpics/bigbg09.gif
+backpics/bigbg10.gif
+backpics/bigbg11.gif
+backpics/bigbg12.gif
+backpics/bigbg13.gif
+backpics/bigbg14.gif
+backpics/bigbg15.gif
+backpics/bigbg16.gif
+backpics/bigbg17.gif
diff --git a/config.imgdirs b/config.imgdirs
new file mode 100644
index 0000000..249246c
--- /dev/null
+++ b/config.imgdirs
@@ -0,0 +1,3 @@
+pics/SpaceBlob
+pics/Elephant
+pics/Turkey
diff --git a/config.sounds b/config.sounds
new file mode 100644
index 0000000..872147a
--- /dev/null
+++ b/config.sounds
@@ -0,0 +1,4 @@
+sounds/gobble.wav
+sounds/funk.wav
+sounds/giggle.wav
+sounds/jungle.wav
diff --git a/icons/50x50blank-trans.png b/icons/50x50blank-trans.png
new file mode 100644
index 0000000..b8de5ee
--- /dev/null
+++ b/icons/50x50blank-trans.png
Binary files differ
diff --git a/icons/clear.png b/icons/clear.png
new file mode 100644
index 0000000..4885eea
--- /dev/null
+++ b/icons/clear.png
Binary files differ
diff --git a/icons/down_arrow.png b/icons/down_arrow.png
new file mode 100644
index 0000000..df950cd
--- /dev/null
+++ b/icons/down_arrow.png
Binary files differ
diff --git a/icons/filmstrip.png b/icons/filmstrip.png
new file mode 100644
index 0000000..5429616
--- /dev/null
+++ b/icons/filmstrip.png
Binary files differ
diff --git a/icons/left_arrow.png b/icons/left_arrow.png
new file mode 100644
index 0000000..bde58b9
--- /dev/null
+++ b/icons/left_arrow.png
Binary files differ
diff --git a/icons/logo.png b/icons/logo.png
new file mode 100644
index 0000000..e2b3df8
--- /dev/null
+++ b/icons/logo.png
Binary files differ
diff --git a/icons/pause.png b/icons/pause.png
new file mode 100644
index 0000000..59dc8b4
--- /dev/null
+++ b/icons/pause.png
Binary files differ
diff --git a/icons/pink_arrow.png b/icons/pink_arrow.png
new file mode 100644
index 0000000..bb0ac73
--- /dev/null
+++ b/icons/pink_arrow.png
Binary files differ
diff --git a/icons/right_arrow.png b/icons/right_arrow.png
new file mode 100644
index 0000000..1dd5e10
--- /dev/null
+++ b/icons/right_arrow.png
Binary files differ
diff --git a/icons/sound_icon.png b/icons/sound_icon.png
new file mode 100644
index 0000000..e953394
--- /dev/null
+++ b/icons/sound_icon.png
Binary files differ
diff --git a/icons/up_arrow.png b/icons/up_arrow.png
new file mode 100644
index 0000000..e37d71c
--- /dev/null
+++ b/icons/up_arrow.png
Binary files differ
diff --git a/icons/yellow_arrow.png b/icons/yellow_arrow.png
new file mode 100644
index 0000000..f3a35f2
--- /dev/null
+++ b/icons/yellow_arrow.png
Binary files differ
diff --git a/lp-en/An_Overview.txt b/lp-en/An_Overview.txt
new file mode 100644
index 0000000..de375e3
--- /dev/null
+++ b/lp-en/An_Overview.txt
@@ -0,0 +1,26 @@
+Cartoon Builder: Lesson Plans Overview
+
+Cartoon Builder lets you explore the cartoon-making process called "cell-animation" which uses a sequence of pictures with small differences to create the illusion of movement.
+
+You can create your own cartoon by placing different pictures of a cartoon character inside the squares ("cells") of a filmstrip, adding different backgrounds and sound effects, and playing the pictures back in order like a little movie. You can save your cartoon on the XO laptop, and share it with friends and family.
+
+Cartoon Builder helps you explore how cartoons are created, and learn how to put creative ideas into action.
+
+Creating a story with pictures can also help you to express ideas that you may not yet have words for.
+
+In the process of creating and sharing your cartoons, you will also learn how to use many XO activities, including Paint, Camera, and Microphone.
+
+Throughout the school year, the Cartoon Builder can be integrated into different subject areas (example: creative writing, art and drama). You can make Cartoon Builder images that relate to a subject the class is studying, and share them with peers.
+
+Skills:
+Practice working with a partner
+Learn to translate ideas into artistic images
+Learn how to act out stories
+Learn to articulate creative ideas to peers
+Learn from classmates
+Learn how to use specific programs of the XO Laptop
+Learn how to use the Paint Program
+Learn to express ideas you are studying through an original project
+Learn the sequence or order of a story
+Learn about cell animation
+
diff --git a/lp-en/Lesson_Plan_1.txt b/lp-en/Lesson_Plan_1.txt
new file mode 100644
index 0000000..8c3a14b
--- /dev/null
+++ b/lp-en/Lesson_Plan_1.txt
@@ -0,0 +1,28 @@
+Lesson Plan 1: Explore Animation with Cartoon Builder
+Do you like cartoons? Who are some of your favorite cartoon characters?
+
+A cartoon is made from a series of drawing with small differences that, when viewed quickly, seem to move. This movement is called animation.
+Try the Cartoon Builder to learn more about how animation works.
+
+1)Open the MaMaMedia Activity Center from the XO Home screen.
+
+2)Open the Cartoon Builder from the MaMaMedia Activity Center.
+
+3)A space alien will appear in the activity. You can play with this character, or choose a different one using the Character chooser on the right. Click on the arrows to see more characters.
+
+4)After you choose a character, decide which 6 movements you would like your character to make.
+
+5)Click on the first box in the filmstrip at the top of the screen, and then click on an image in the pose gallery on the left. The image you chose will appear in the first box. Repeat this process for all six boxes.
+
+6)Press the Play arrow under the big picture to make your cartoon go.
+
+7)Explore the backgrounds and sounds on the right of the screen. Click on the arrows to see more backgrounds and hear different sounds.
+
+8)Save your animation when you are happy with it. Click the "Save" (computer disc) button in the top right corner of the screen. Give it a name you will remember, like "Cartoon1" and click "Save."
+
+9) To find "Cartoon1" later, click on the "Open" (folder) button in the top right corner (next to "Save"). Click "Cartoon1" on the list that appears to load your animation in the Cartoon Builder.
+
+10) Share your cartoons with classmates, and look at the cartoons they made. Talk about making the cartoons. What was hard? What was fun? What did you learn?
+
+11) Record the ideas your class had using the "Write" activity on your XO. If you have poster paper, you can create a set of 'Cartoon Making tips' to put up on the wall.
+
diff --git a/lp-en/Lesson_Plan_2.txt b/lp-en/Lesson_Plan_2.txt
new file mode 100644
index 0000000..22d76f1
--- /dev/null
+++ b/lp-en/Lesson_Plan_2.txt
@@ -0,0 +1,22 @@
+Lesson Plan 2: Make a Spinning Thaumatrope
+
+Animation is an illusion that happens when you look at two or more pictures and they seem to blend into one moving image.
+
+A thaumatrope is a piece of paper with two pictures, one on each side. If you have access to paper or note cards, tape and a pencil, a thaumatrope is fun and helpful tool for understanding how pictures appear to become animated.
+
+Materials
+Index card (cut in half)
+Pencil, crayon or marker to draw with
+Stick to tape cards on (pencil is OK too)
+Tape, glue or something to stick paper to the pencil or stick.
+
+Instructions:
+
+1)Think of the animation that you want to make. For example, a fish in a bowl or a cat in a tree.
+
+2)Draw one part of the picture on one half of the card (example: fish) and draw the second part of the picture (example: the fish bowl) on the second half.
+
+3)Tape the pencil or stick to the back of one card and then tape the second card to the pencil so that the drawings are back-to-back.
+
+4)Spin the thaumatrope by rolling the pencil between your hands. What do you see?
+
diff --git a/lp-en/Lesson_Plan_3.txt b/lp-en/Lesson_Plan_3.txt
new file mode 100644
index 0000000..e167c56
--- /dev/null
+++ b/lp-en/Lesson_Plan_3.txt
@@ -0,0 +1,34 @@
+Lesson Plan 3: Create "Dancing Pictures"
+
+Cartoons are like dancing pictures. When you dance, you move your body through a set of poses. Each pose is a little bit different from the one before it. When you make a cartoon, you draw a set of picture poses where each one is just a little bit different than the one before it. Flipping through all the pictures quickly creates the illusion of movement.
+
+Materials
+6 index cards (or one piece of paper cut into 6 pieces)
+Pencil, crayon or marker
+
+Instructions:
+1.Think of a dance (or an exercise or a silly movement) with six poses.
+
+2.Slowly demonstrate the poses of that dance for your class. Then do the dance faster. (If you prefer, you could ask a volunteer from the class to demonstrate the dance.)
+
+3.Invite the whole class to get up and try the dance. Remind them to think about each of the poses as they dance.
+
+4.After a few minutes of dancing, ask everyone sit back down.
+
+5.Now take out a pencil and six index cards.
+
+6.Draw a stick figure doing each pose on separate index cards.
+
+7.Act out each pose to help other students draw.
+
+8.Put your 6 cards into a stack and either staple it or hold it tightly by the upper left corner.
+
+9.You can make the cartoon stick figure "dance", by holding the book on the stapled edge with you left hand and flipping the lower left corner of the stack with your right thumb.
+
+10. Flipping the images trick your eye! It seems like the stick person dances, but it is an illusion caused by looking at the pictures quickly.
+
+11.Customize your cartoon flipbooks further by coloring them or adding more poses.
+
+Alternative to dancing:
+Try acting out the movements of a non-human character, like a frog hopping. Perform these movements for your class and have them guess who your character might be.
+
diff --git a/lp-en/Lesson_Plan_4.txt b/lp-en/Lesson_Plan_4.txt
new file mode 100644
index 0000000..6f685f0
--- /dev/null
+++ b/lp-en/Lesson_Plan_4.txt
@@ -0,0 +1,26 @@
+Lesson Plan 4: Add Your Own Backgrounds to Cartoon Builder
+
+Use the Paint or Camera activity on your XO to make your own original background images for your cartoon.
+
+Make a background picture with Paint:
+1)Open the Paint or Camera activity from the Home screen of your XO.
+
+2)With Paint, draw a scene (place where the character can be) such as a school room or a field or the edge of a river.
+
+3)With Camera, take a photo of a place, such as school or your house.
+
+4)Save the picture with a name you will remember like "background1"
+
+Add your background to the Cartoon Builder:
+5)From the Home screen of your XO, click on the Mama Media icon.
+
+6)Open the Cartoon Builder activity from the MaMaMedia Activity Center.
+
+7)Click on the "My Background" button and find your picture called "background1" in the list of files that appears. Click on it and then click the "Open" button.
+
+8)Your "background1" picture will load into the Cartoon Builder
+
+9)Choose a character and place it in your background. Add sound and save it.
+
+10)Show it to your friends and classmates, and tell them how you did it Help others to create their own background pictures.
+
diff --git a/lp-en/Lesson_Plan_5.txt b/lp-en/Lesson_Plan_5.txt
new file mode 100644
index 0000000..ced6437
--- /dev/null
+++ b/lp-en/Lesson_Plan_5.txt
@@ -0,0 +1,41 @@
+Lesson Plan 5: Draw and Animate Your Own Character
+
+You can use Paint to make your own original cartoon character in lots of poses. Then you can use the "My Own" functionality in the Cartoon Builder to import the poses and create original cartoons. Learn the steps by creating a simple cartoon face.
+
+First create four face pictures using Paint on your XO:
+1)Open the Paint activity from the Home screen of your XO.
+
+2)Use the Paint tools to draw a face with eyes, nose, ears and hair. Do not draw a mouth yet.
+
+3)Click "Save Image" button
+
+4)When the Save window appears, click on the button "New folder" and type "Face" into the folder name field. Click the "Create" button.
+
+5)A new folder called "Face" will appear in the list of places where you can save your picture. Double click on "Face" to open it.
+
+6)Save the picture here with the name "Face1" and click OK.
+
+7)Now draw a frowning mouth on the face and save it as "Face 2"
+
+8)Erase the frown and draw a straight line mouth. Save it as "Face 3"
+
+9)Erase the straight line mouth and draw a smile. Save it as "Face 4"
+
+Now put your pictures into the Cartoon Builder and animate the face:
+10) From the Home screen of your XO, click on the MaMaMedia icon.
+
+11)Open the Cartoon Builder from the MaMaMedia Activity Center.
+
+12) Click the "My Character" button, find the "Face" folder and open it.
+
+13) The three facial images you created will appear in the poses list on the left side of your screen.
+
+14) Place them in box 1, 2, and 3 in the slides on top of your screen, and then press Play to see the face animate.
+
+15) Save this cartoon and share it with your class.
+
+16) Discuss what you were able to do with your images. Did you learn anything new about animation?
+
+17) Open the "Write" activity on your XO and write down the ideas from your discussion.
+
+NOTE: Drawings you make with Paint only have one layer, so your character will completely cover the backgrounds offered in Cartoon Builder. Try drawing a background around your character in Paint.
diff --git a/lp-es/0Una_Descripcion.txt b/lp-es/0Una_Descripcion.txt
new file mode 100644
index 0000000..de375e3
--- /dev/null
+++ b/lp-es/0Una_Descripcion.txt
@@ -0,0 +1,26 @@
+Cartoon Builder: Lesson Plans Overview
+
+Cartoon Builder lets you explore the cartoon-making process called "cell-animation" which uses a sequence of pictures with small differences to create the illusion of movement.
+
+You can create your own cartoon by placing different pictures of a cartoon character inside the squares ("cells") of a filmstrip, adding different backgrounds and sound effects, and playing the pictures back in order like a little movie. You can save your cartoon on the XO laptop, and share it with friends and family.
+
+Cartoon Builder helps you explore how cartoons are created, and learn how to put creative ideas into action.
+
+Creating a story with pictures can also help you to express ideas that you may not yet have words for.
+
+In the process of creating and sharing your cartoons, you will also learn how to use many XO activities, including Paint, Camera, and Microphone.
+
+Throughout the school year, the Cartoon Builder can be integrated into different subject areas (example: creative writing, art and drama). You can make Cartoon Builder images that relate to a subject the class is studying, and share them with peers.
+
+Skills:
+Practice working with a partner
+Learn to translate ideas into artistic images
+Learn how to act out stories
+Learn to articulate creative ideas to peers
+Learn from classmates
+Learn how to use specific programs of the XO Laptop
+Learn how to use the Paint Program
+Learn to express ideas you are studying through an original project
+Learn the sequence or order of a story
+Learn about cell animation
+
diff --git a/lp-es/Plan_1.txt b/lp-es/Plan_1.txt
new file mode 100644
index 0000000..8c3a14b
--- /dev/null
+++ b/lp-es/Plan_1.txt
@@ -0,0 +1,28 @@
+Lesson Plan 1: Explore Animation with Cartoon Builder
+Do you like cartoons? Who are some of your favorite cartoon characters?
+
+A cartoon is made from a series of drawing with small differences that, when viewed quickly, seem to move. This movement is called animation.
+Try the Cartoon Builder to learn more about how animation works.
+
+1)Open the MaMaMedia Activity Center from the XO Home screen.
+
+2)Open the Cartoon Builder from the MaMaMedia Activity Center.
+
+3)A space alien will appear in the activity. You can play with this character, or choose a different one using the Character chooser on the right. Click on the arrows to see more characters.
+
+4)After you choose a character, decide which 6 movements you would like your character to make.
+
+5)Click on the first box in the filmstrip at the top of the screen, and then click on an image in the pose gallery on the left. The image you chose will appear in the first box. Repeat this process for all six boxes.
+
+6)Press the Play arrow under the big picture to make your cartoon go.
+
+7)Explore the backgrounds and sounds on the right of the screen. Click on the arrows to see more backgrounds and hear different sounds.
+
+8)Save your animation when you are happy with it. Click the "Save" (computer disc) button in the top right corner of the screen. Give it a name you will remember, like "Cartoon1" and click "Save."
+
+9) To find "Cartoon1" later, click on the "Open" (folder) button in the top right corner (next to "Save"). Click "Cartoon1" on the list that appears to load your animation in the Cartoon Builder.
+
+10) Share your cartoons with classmates, and look at the cartoons they made. Talk about making the cartoons. What was hard? What was fun? What did you learn?
+
+11) Record the ideas your class had using the "Write" activity on your XO. If you have poster paper, you can create a set of 'Cartoon Making tips' to put up on the wall.
+
diff --git a/lp-es/Plan_2.txt b/lp-es/Plan_2.txt
new file mode 100644
index 0000000..22d76f1
--- /dev/null
+++ b/lp-es/Plan_2.txt
@@ -0,0 +1,22 @@
+Lesson Plan 2: Make a Spinning Thaumatrope
+
+Animation is an illusion that happens when you look at two or more pictures and they seem to blend into one moving image.
+
+A thaumatrope is a piece of paper with two pictures, one on each side. If you have access to paper or note cards, tape and a pencil, a thaumatrope is fun and helpful tool for understanding how pictures appear to become animated.
+
+Materials
+Index card (cut in half)
+Pencil, crayon or marker to draw with
+Stick to tape cards on (pencil is OK too)
+Tape, glue or something to stick paper to the pencil or stick.
+
+Instructions:
+
+1)Think of the animation that you want to make. For example, a fish in a bowl or a cat in a tree.
+
+2)Draw one part of the picture on one half of the card (example: fish) and draw the second part of the picture (example: the fish bowl) on the second half.
+
+3)Tape the pencil or stick to the back of one card and then tape the second card to the pencil so that the drawings are back-to-back.
+
+4)Spin the thaumatrope by rolling the pencil between your hands. What do you see?
+
diff --git a/lp-es/Plan_3.txt b/lp-es/Plan_3.txt
new file mode 100644
index 0000000..e167c56
--- /dev/null
+++ b/lp-es/Plan_3.txt
@@ -0,0 +1,34 @@
+Lesson Plan 3: Create "Dancing Pictures"
+
+Cartoons are like dancing pictures. When you dance, you move your body through a set of poses. Each pose is a little bit different from the one before it. When you make a cartoon, you draw a set of picture poses where each one is just a little bit different than the one before it. Flipping through all the pictures quickly creates the illusion of movement.
+
+Materials
+6 index cards (or one piece of paper cut into 6 pieces)
+Pencil, crayon or marker
+
+Instructions:
+1.Think of a dance (or an exercise or a silly movement) with six poses.
+
+2.Slowly demonstrate the poses of that dance for your class. Then do the dance faster. (If you prefer, you could ask a volunteer from the class to demonstrate the dance.)
+
+3.Invite the whole class to get up and try the dance. Remind them to think about each of the poses as they dance.
+
+4.After a few minutes of dancing, ask everyone sit back down.
+
+5.Now take out a pencil and six index cards.
+
+6.Draw a stick figure doing each pose on separate index cards.
+
+7.Act out each pose to help other students draw.
+
+8.Put your 6 cards into a stack and either staple it or hold it tightly by the upper left corner.
+
+9.You can make the cartoon stick figure "dance", by holding the book on the stapled edge with you left hand and flipping the lower left corner of the stack with your right thumb.
+
+10. Flipping the images trick your eye! It seems like the stick person dances, but it is an illusion caused by looking at the pictures quickly.
+
+11.Customize your cartoon flipbooks further by coloring them or adding more poses.
+
+Alternative to dancing:
+Try acting out the movements of a non-human character, like a frog hopping. Perform these movements for your class and have them guess who your character might be.
+
diff --git a/lp-es/Plan_4.txt b/lp-es/Plan_4.txt
new file mode 100644
index 0000000..6f685f0
--- /dev/null
+++ b/lp-es/Plan_4.txt
@@ -0,0 +1,26 @@
+Lesson Plan 4: Add Your Own Backgrounds to Cartoon Builder
+
+Use the Paint or Camera activity on your XO to make your own original background images for your cartoon.
+
+Make a background picture with Paint:
+1)Open the Paint or Camera activity from the Home screen of your XO.
+
+2)With Paint, draw a scene (place where the character can be) such as a school room or a field or the edge of a river.
+
+3)With Camera, take a photo of a place, such as school or your house.
+
+4)Save the picture with a name you will remember like "background1"
+
+Add your background to the Cartoon Builder:
+5)From the Home screen of your XO, click on the Mama Media icon.
+
+6)Open the Cartoon Builder activity from the MaMaMedia Activity Center.
+
+7)Click on the "My Background" button and find your picture called "background1" in the list of files that appears. Click on it and then click the "Open" button.
+
+8)Your "background1" picture will load into the Cartoon Builder
+
+9)Choose a character and place it in your background. Add sound and save it.
+
+10)Show it to your friends and classmates, and tell them how you did it Help others to create their own background pictures.
+
diff --git a/lp-es/Plan_5.txt b/lp-es/Plan_5.txt
new file mode 100644
index 0000000..ced6437
--- /dev/null
+++ b/lp-es/Plan_5.txt
@@ -0,0 +1,41 @@
+Lesson Plan 5: Draw and Animate Your Own Character
+
+You can use Paint to make your own original cartoon character in lots of poses. Then you can use the "My Own" functionality in the Cartoon Builder to import the poses and create original cartoons. Learn the steps by creating a simple cartoon face.
+
+First create four face pictures using Paint on your XO:
+1)Open the Paint activity from the Home screen of your XO.
+
+2)Use the Paint tools to draw a face with eyes, nose, ears and hair. Do not draw a mouth yet.
+
+3)Click "Save Image" button
+
+4)When the Save window appears, click on the button "New folder" and type "Face" into the folder name field. Click the "Create" button.
+
+5)A new folder called "Face" will appear in the list of places where you can save your picture. Double click on "Face" to open it.
+
+6)Save the picture here with the name "Face1" and click OK.
+
+7)Now draw a frowning mouth on the face and save it as "Face 2"
+
+8)Erase the frown and draw a straight line mouth. Save it as "Face 3"
+
+9)Erase the straight line mouth and draw a smile. Save it as "Face 4"
+
+Now put your pictures into the Cartoon Builder and animate the face:
+10) From the Home screen of your XO, click on the MaMaMedia icon.
+
+11)Open the Cartoon Builder from the MaMaMedia Activity Center.
+
+12) Click the "My Character" button, find the "Face" folder and open it.
+
+13) The three facial images you created will appear in the poses list on the left side of your screen.
+
+14) Place them in box 1, 2, and 3 in the slides on top of your screen, and then press Play to see the face animate.
+
+15) Save this cartoon and share it with your class.
+
+16) Discuss what you were able to do with your images. Did you learn anything new about animation?
+
+17) Open the "Write" activity on your XO and write down the ideas from your discussion.
+
+NOTE: Drawings you make with Paint only have one layer, so your character will completely cover the backgrounds offered in Cartoon Builder. Try drawing a background around your character in Paint.
diff --git a/manifest b/manifest
new file mode 100755
index 0000000..de8562f
--- /dev/null
+++ b/manifest
@@ -0,0 +1,16 @@
+cartoonbuilder.py
+50x50blank-trans.png
+50x50yellow.png
+backpics/01.png
+backpics/02.png
+backpics/03.png
+pics/01.png
+pics/02.png
+pics/03.png
+pics/04.png
+pics/05.png
+pics/06.png
+pics/07.png
+pics/08.png
+pics/09.png
+pics/10.png
diff --git a/pics/Elephant/bigelephant0.gif b/pics/Elephant/bigelephant0.gif
new file mode 100644
index 0000000..32e2998
--- /dev/null
+++ b/pics/Elephant/bigelephant0.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant1.gif b/pics/Elephant/bigelephant1.gif
new file mode 100644
index 0000000..aa4b639
--- /dev/null
+++ b/pics/Elephant/bigelephant1.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant10.gif b/pics/Elephant/bigelephant10.gif
new file mode 100644
index 0000000..5719a27
--- /dev/null
+++ b/pics/Elephant/bigelephant10.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant11.gif b/pics/Elephant/bigelephant11.gif
new file mode 100644
index 0000000..0832e05
--- /dev/null
+++ b/pics/Elephant/bigelephant11.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant12.gif b/pics/Elephant/bigelephant12.gif
new file mode 100644
index 0000000..cc2950d
--- /dev/null
+++ b/pics/Elephant/bigelephant12.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant13.gif b/pics/Elephant/bigelephant13.gif
new file mode 100644
index 0000000..3395865
--- /dev/null
+++ b/pics/Elephant/bigelephant13.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant2.gif b/pics/Elephant/bigelephant2.gif
new file mode 100644
index 0000000..5d03ccc
--- /dev/null
+++ b/pics/Elephant/bigelephant2.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant3.gif b/pics/Elephant/bigelephant3.gif
new file mode 100644
index 0000000..7fd718a
--- /dev/null
+++ b/pics/Elephant/bigelephant3.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant4.gif b/pics/Elephant/bigelephant4.gif
new file mode 100644
index 0000000..0df7c12
--- /dev/null
+++ b/pics/Elephant/bigelephant4.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant5.gif b/pics/Elephant/bigelephant5.gif
new file mode 100644
index 0000000..35ce9a5
--- /dev/null
+++ b/pics/Elephant/bigelephant5.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant6.gif b/pics/Elephant/bigelephant6.gif
new file mode 100644
index 0000000..a91695b
--- /dev/null
+++ b/pics/Elephant/bigelephant6.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant7.gif b/pics/Elephant/bigelephant7.gif
new file mode 100644
index 0000000..bcf485a
--- /dev/null
+++ b/pics/Elephant/bigelephant7.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant8.gif b/pics/Elephant/bigelephant8.gif
new file mode 100644
index 0000000..429cc51
--- /dev/null
+++ b/pics/Elephant/bigelephant8.gif
Binary files differ
diff --git a/pics/Elephant/bigelephant9.gif b/pics/Elephant/bigelephant9.gif
new file mode 100644
index 0000000..dc682da
--- /dev/null
+++ b/pics/Elephant/bigelephant9.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob0.gif b/pics/SpaceBlob/bigblob0.gif
new file mode 100644
index 0000000..5af8edd
--- /dev/null
+++ b/pics/SpaceBlob/bigblob0.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob1.gif b/pics/SpaceBlob/bigblob1.gif
new file mode 100644
index 0000000..1e2e9ae
--- /dev/null
+++ b/pics/SpaceBlob/bigblob1.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob10.gif b/pics/SpaceBlob/bigblob10.gif
new file mode 100644
index 0000000..0f538f9
--- /dev/null
+++ b/pics/SpaceBlob/bigblob10.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob11.gif b/pics/SpaceBlob/bigblob11.gif
new file mode 100644
index 0000000..3f912e5
--- /dev/null
+++ b/pics/SpaceBlob/bigblob11.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob12.gif b/pics/SpaceBlob/bigblob12.gif
new file mode 100644
index 0000000..e5308d9
--- /dev/null
+++ b/pics/SpaceBlob/bigblob12.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob13.gif b/pics/SpaceBlob/bigblob13.gif
new file mode 100644
index 0000000..7348e6b
--- /dev/null
+++ b/pics/SpaceBlob/bigblob13.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob2.gif b/pics/SpaceBlob/bigblob2.gif
new file mode 100644
index 0000000..9eee50a
--- /dev/null
+++ b/pics/SpaceBlob/bigblob2.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob3.gif b/pics/SpaceBlob/bigblob3.gif
new file mode 100644
index 0000000..30f6250
--- /dev/null
+++ b/pics/SpaceBlob/bigblob3.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob4.gif b/pics/SpaceBlob/bigblob4.gif
new file mode 100644
index 0000000..1dd33f0
--- /dev/null
+++ b/pics/SpaceBlob/bigblob4.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob5.gif b/pics/SpaceBlob/bigblob5.gif
new file mode 100644
index 0000000..bd6f791
--- /dev/null
+++ b/pics/SpaceBlob/bigblob5.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob6.gif b/pics/SpaceBlob/bigblob6.gif
new file mode 100644
index 0000000..e7d17e5
--- /dev/null
+++ b/pics/SpaceBlob/bigblob6.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob7.gif b/pics/SpaceBlob/bigblob7.gif
new file mode 100644
index 0000000..9073b5d
--- /dev/null
+++ b/pics/SpaceBlob/bigblob7.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob8.gif b/pics/SpaceBlob/bigblob8.gif
new file mode 100644
index 0000000..f8faf8d
--- /dev/null
+++ b/pics/SpaceBlob/bigblob8.gif
Binary files differ
diff --git a/pics/SpaceBlob/bigblob9.gif b/pics/SpaceBlob/bigblob9.gif
new file mode 100644
index 0000000..a627d6f
--- /dev/null
+++ b/pics/SpaceBlob/bigblob9.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey1.gif b/pics/Turkey/bigturkey1.gif
new file mode 100644
index 0000000..f49b34f
--- /dev/null
+++ b/pics/Turkey/bigturkey1.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey10.gif b/pics/Turkey/bigturkey10.gif
new file mode 100644
index 0000000..709d92e
--- /dev/null
+++ b/pics/Turkey/bigturkey10.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey11.gif b/pics/Turkey/bigturkey11.gif
new file mode 100644
index 0000000..b80765f
--- /dev/null
+++ b/pics/Turkey/bigturkey11.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey12.gif b/pics/Turkey/bigturkey12.gif
new file mode 100644
index 0000000..dd043f7
--- /dev/null
+++ b/pics/Turkey/bigturkey12.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey13.gif b/pics/Turkey/bigturkey13.gif
new file mode 100644
index 0000000..91a5bd7
--- /dev/null
+++ b/pics/Turkey/bigturkey13.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey14.gif b/pics/Turkey/bigturkey14.gif
new file mode 100644
index 0000000..c777887
--- /dev/null
+++ b/pics/Turkey/bigturkey14.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey2.gif b/pics/Turkey/bigturkey2.gif
new file mode 100644
index 0000000..195d1c6
--- /dev/null
+++ b/pics/Turkey/bigturkey2.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey3.gif b/pics/Turkey/bigturkey3.gif
new file mode 100644
index 0000000..c0f219d
--- /dev/null
+++ b/pics/Turkey/bigturkey3.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey4.gif b/pics/Turkey/bigturkey4.gif
new file mode 100644
index 0000000..8b93529
--- /dev/null
+++ b/pics/Turkey/bigturkey4.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey5.gif b/pics/Turkey/bigturkey5.gif
new file mode 100644
index 0000000..6ecedba
--- /dev/null
+++ b/pics/Turkey/bigturkey5.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey6.gif b/pics/Turkey/bigturkey6.gif
new file mode 100644
index 0000000..ed56a65
--- /dev/null
+++ b/pics/Turkey/bigturkey6.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey7.gif b/pics/Turkey/bigturkey7.gif
new file mode 100644
index 0000000..f6fc8f8
--- /dev/null
+++ b/pics/Turkey/bigturkey7.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey8.gif b/pics/Turkey/bigturkey8.gif
new file mode 100644
index 0000000..41115ed
--- /dev/null
+++ b/pics/Turkey/bigturkey8.gif
Binary files differ
diff --git a/pics/Turkey/bigturkey9.gif b/pics/Turkey/bigturkey9.gif
new file mode 100644
index 0000000..4f43698
--- /dev/null
+++ b/pics/Turkey/bigturkey9.gif
Binary files differ
diff --git a/setup.py b/setup.py
new file mode 100755
index 0000000..6ea61a6
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,3 @@
+#!/usr/bin/python
+from sugar.activity import bundlebuilder
+bundlebuilder.start()
diff --git a/sounds/funk.wav b/sounds/funk.wav
new file mode 100644
index 0000000..cf9f930
--- /dev/null
+++ b/sounds/funk.wav
Binary files differ
diff --git a/sounds/giggle.wav b/sounds/giggle.wav
new file mode 100644
index 0000000..901c409
--- /dev/null
+++ b/sounds/giggle.wav
Binary files differ
diff --git a/sounds/gobble.wav b/sounds/gobble.wav
new file mode 100644
index 0000000..573cee5
--- /dev/null
+++ b/sounds/gobble.wav
Binary files differ
diff --git a/sounds/jungle.wav b/sounds/jungle.wav
new file mode 100644
index 0000000..e36ec93
--- /dev/null
+++ b/sounds/jungle.wav
Binary files differ