Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS10
-rwxr-xr-xactivity.py651
-rw-r--r--activity/activity.info1
-rw-r--r--cardlist.py204
-rwxr-xr-xcardtable.py3
-rw-r--r--createcardpanel.py278
-rwxr-xr-xcreatetoolbar.py94
-rw-r--r--demos/addition.zipbin0 -> 372 bytes
-rw-r--r--demos/capitals.zipbin0 -> 516 bytes
-rw-r--r--demos/drumgit.zipbin0 -> 687926 bytes
-rw-r--r--demos/letters.zipbin0 -> 124667 bytes
-rw-r--r--demos/numbers.zipbin0 -> 258731 bytes
-rw-r--r--demos/phonemes.zipbin0 -> 388651 bytes
-rwxr-xr-xgame.py57
-rw-r--r--games/addition/addition.mem23
-rwxr-xr-xgames/capitals/capitals.mem23
-rw-r--r--games/drumgit/drumgit.mem29
-rwxr-xr-xgames/drumgit/images/drumkit10_b.jpgbin16416 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit11_b.jpgbin16488 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit12_b.jpgbin16755 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit1_b.jpgbin17279 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit2_b.jpgbin17257 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit3_b.jpgbin17294 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit4_b.jpgbin17157 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit5_b.jpgbin17248 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit6_b.jpgbin17376 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit7_b.jpgbin17223 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit8_b.jpgbin17257 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/drumkit9_b.jpgbin16014 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar10_2.jpgbin14457 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar11_2.jpgbin14497 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar12_2.jpgbin14590 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar1_2.jpgbin13943 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar2_2.jpgbin13949 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar3_2.jpgbin13925 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar4_2.jpgbin13922 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar5_2.jpgbin13943 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar6_2.jpgbin14468 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar7_2.jpgbin13909 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar8_2.jpgbin13930 -> 0 bytes
-rwxr-xr-xgames/drumgit/images/guitar9_2.jpgbin14525 -> 0 bytes
-rw-r--r--games/drumgit/images/reference18
-rwxr-xr-xgames/drumgit/sounds/beat10.oggbin24387 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat14.oggbin30321 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat16.oggbin34426 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat17.oggbin26427 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat1_a.oggbin27784 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat1_b.oggbin27659 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat1_c.oggbin28136 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat2.oggbin22029 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat3.oggbin30222 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat4.oggbin21131 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat6_2.oggbin24348 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/beat8.oggbin25783 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/bending_a.oggbin25468 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/bending_b.oggbin25419 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/flashcomp2a.oggbin25377 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/flashcomp2b.oggbin20944 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/flasholet4.oggbin26221 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/gedaempft.oggbin13286 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/git_hit1.oggbin22803 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/git_hit4.oggbin23736 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/guitcello.oggbin30374 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/jimi1.oggbin10546 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/jimi4.oggbin10602 -> 0 bytes
-rwxr-xr-xgames/drumgit/sounds/ungedaempft.oggbin22413 -> 0 bytes
-rwxr-xr-xgames/letters/letters.mem31
-rw-r--r--games/letters/sounds/a.oggbin5956 -> 0 bytes
-rw-r--r--games/letters/sounds/b.oggbin5241 -> 0 bytes
-rw-r--r--games/letters/sounds/c.oggbin5533 -> 0 bytes
-rw-r--r--games/letters/sounds/d.oggbin5099 -> 0 bytes
-rw-r--r--games/letters/sounds/e.oggbin4906 -> 0 bytes
-rw-r--r--games/letters/sounds/f.oggbin5660 -> 0 bytes
-rw-r--r--games/letters/sounds/g.oggbin5229 -> 0 bytes
-rw-r--r--games/letters/sounds/h.oggbin5628 -> 0 bytes
-rw-r--r--games/letters/sounds/i.oggbin4722 -> 0 bytes
-rw-r--r--games/letters/sounds/j.oggbin5874 -> 0 bytes
-rw-r--r--games/letters/sounds/k.oggbin5352 -> 0 bytes
-rw-r--r--games/letters/sounds/l.oggbin5183 -> 0 bytes
-rw-r--r--games/letters/sounds/m.oggbin5679 -> 0 bytes
-rw-r--r--games/letters/sounds/n.oggbin5460 -> 0 bytes
-rw-r--r--games/letters/sounds/o.oggbin4873 -> 0 bytes
-rw-r--r--games/letters/sounds/p.oggbin4832 -> 0 bytes
-rw-r--r--games/letters/sounds/q.oggbin5281 -> 0 bytes
-rwxr-xr-xgames/letters/sounds/r.oggbin5695 -> 0 bytes
-rwxr-xr-xgames/letters/sounds/s.oggbin5377 -> 0 bytes
-rwxr-xr-xgames/letters/sounds/t.oggbin5024 -> 0 bytes
-rw-r--r--games/letters/sounds/u.oggbin5069 -> 0 bytes
-rwxr-xr-xgames/letters/sounds/v.oggbin4979 -> 0 bytes
-rwxr-xr-xgames/letters/sounds/w.oggbin5976 -> 0 bytes
-rwxr-xr-xgames/letters/sounds/x.oggbin5542 -> 0 bytes
-rwxr-xr-xgames/letters/sounds/y.oggbin5624 -> 0 bytes
-rwxr-xr-xgames/letters/sounds/z.oggbin4995 -> 0 bytes
-rwxr-xr-xgames/numbers/images/01x.jpgbin7084 -> 0 bytes
-rwxr-xr-xgames/numbers/images/02x.jpgbin8317 -> 0 bytes
-rwxr-xr-xgames/numbers/images/03x.jpgbin5421 -> 0 bytes
-rwxr-xr-xgames/numbers/images/04x.jpgbin8574 -> 0 bytes
-rwxr-xr-xgames/numbers/images/05x.jpgbin6632 -> 0 bytes
-rwxr-xr-xgames/numbers/images/06x.jpgbin8132 -> 0 bytes
-rwxr-xr-xgames/numbers/images/07x.jpgbin10302 -> 0 bytes
-rwxr-xr-xgames/numbers/images/08x.jpgbin8105 -> 0 bytes
-rwxr-xr-xgames/numbers/images/09x.jpgbin8458 -> 0 bytes
-rwxr-xr-xgames/numbers/images/10x.jpgbin8471 -> 0 bytes
-rwxr-xr-xgames/numbers/images/11x.jpgbin8573 -> 0 bytes
-rwxr-xr-xgames/numbers/images/12x.jpgbin10726 -> 0 bytes
-rwxr-xr-xgames/numbers/images/13x.jpgbin7400 -> 0 bytes
-rwxr-xr-xgames/numbers/images/14x.jpgbin8037 -> 0 bytes
-rwxr-xr-xgames/numbers/images/15x.jpgbin10862 -> 0 bytes
-rw-r--r--games/numbers/images/16x.jpgbin9395 -> 0 bytes
-rw-r--r--games/numbers/images/17x.jpgbin9215 -> 0 bytes
-rw-r--r--games/numbers/images/18x.jpgbin9798 -> 0 bytes
-rwxr-xr-xgames/numbers/numbers.mem23
-rw-r--r--games/numbers/sounds/01.oggbin5574 -> 0 bytes
-rw-r--r--games/numbers/sounds/02.oggbin6429 -> 0 bytes
-rw-r--r--games/numbers/sounds/03.oggbin6218 -> 0 bytes
-rw-r--r--games/numbers/sounds/04.oggbin5949 -> 0 bytes
-rw-r--r--games/numbers/sounds/05.oggbin6629 -> 0 bytes
-rw-r--r--games/numbers/sounds/06.oggbin6666 -> 0 bytes
-rw-r--r--games/numbers/sounds/07.oggbin6890 -> 0 bytes
-rw-r--r--games/numbers/sounds/08.oggbin6126 -> 0 bytes
-rw-r--r--games/numbers/sounds/09.oggbin6678 -> 0 bytes
-rw-r--r--games/numbers/sounds/10.oggbin6080 -> 0 bytes
-rw-r--r--games/numbers/sounds/11.oggbin6110 -> 0 bytes
-rw-r--r--games/numbers/sounds/12.oggbin5881 -> 0 bytes
-rw-r--r--games/numbers/sounds/13.oggbin6532 -> 0 bytes
-rw-r--r--games/numbers/sounds/14.oggbin6791 -> 0 bytes
-rw-r--r--games/numbers/sounds/15.oggbin6834 -> 0 bytes
-rw-r--r--games/numbers/sounds/16.oggbin5684 -> 0 bytes
-rw-r--r--games/numbers/sounds/17.oggbin7453 -> 0 bytes
-rw-r--r--games/numbers/sounds/18.oggbin6931 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/agua1.jpgbin4216 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/agua2.jpgbin4682 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/bola1.jpgbin6062 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/bola2.jpgbin5634 -> 0 bytes
-rw-r--r--games/phonemes/images/cama1.jpgbin6444 -> 0 bytes
-rw-r--r--games/phonemes/images/cama2.jpgbin6692 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/casa1.jpgbin5979 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/casa2.jpgbin6094 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/ema1.jpgbin4154 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/ema2.jpgbin4704 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/frutas1.jpgbin7482 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/frutas2.jpgbin7658 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/homem1.jpgbin5297 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/homem2.jpgbin5574 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/ioio1.jpgbin4866 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/ioio2.jpgbin5026 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/kiwi1.jpgbin6605 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/kiwi2.jpgbin6969 -> 0 bytes
-rw-r--r--games/phonemes/images/livro1.jpgbin5052 -> 0 bytes
-rw-r--r--games/phonemes/images/livro2.jpgbin6223 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/ovo1.jpgbin2923 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/ovo2.jpgbin3428 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/peixe1.jpgbin7289 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/peixe2.jpgbin7369 -> 0 bytes
-rw-r--r--games/phonemes/images/porco1.jpgbin5979 -> 0 bytes
-rw-r--r--games/phonemes/images/porco2.jpgbin5824 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/queijo1.jpgbin5989 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/queijo2.jpgbin5402 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/roda1.jpgbin5776 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/roda2.jpgbin5683 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/sapo1.jpgbin7399 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/sapo2.jpgbin7191 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/uva1.jpgbin4264 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/uva2.jpgbin4932 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/zebra1.jpgbin6607 -> 0 bytes
-rwxr-xr-xgames/phonemes/images/zebra2.jpgbin7280 -> 0 bytes
-rwxr-xr-xgames/phonemes/phonemes.mem41
-rw-r--r--games/phonemes/sounds/agua1.oggbin5564 -> 0 bytes
-rw-r--r--games/phonemes/sounds/agua2.oggbin5573 -> 0 bytes
-rw-r--r--games/phonemes/sounds/bola1.oggbin5617 -> 0 bytes
-rw-r--r--games/phonemes/sounds/bola2.oggbin5652 -> 0 bytes
-rw-r--r--games/phonemes/sounds/cama1.oggbin6035 -> 0 bytes
-rw-r--r--games/phonemes/sounds/cama2.oggbin5436 -> 0 bytes
-rw-r--r--games/phonemes/sounds/casa1.oggbin6352 -> 0 bytes
-rw-r--r--games/phonemes/sounds/casa2.oggbin6226 -> 0 bytes
-rw-r--r--games/phonemes/sounds/ema1.oggbin5300 -> 0 bytes
-rw-r--r--games/phonemes/sounds/ema2.oggbin5338 -> 0 bytes
-rw-r--r--games/phonemes/sounds/frutas1.oggbin5458 -> 0 bytes
-rw-r--r--games/phonemes/sounds/frutas2.oggbin5636 -> 0 bytes
-rw-r--r--games/phonemes/sounds/homem1.oggbin5326 -> 0 bytes
-rw-r--r--games/phonemes/sounds/homem2.oggbin5260 -> 0 bytes
-rw-r--r--games/phonemes/sounds/ioio1.oggbin5425 -> 0 bytes
-rw-r--r--games/phonemes/sounds/ioio2.oggbin5449 -> 0 bytes
-rw-r--r--games/phonemes/sounds/kiwi1.oggbin5314 -> 0 bytes
-rw-r--r--games/phonemes/sounds/kiwi2.oggbin5096 -> 0 bytes
-rw-r--r--games/phonemes/sounds/livro1.oggbin6318 -> 0 bytes
-rw-r--r--games/phonemes/sounds/livro2.oggbin5697 -> 0 bytes
-rw-r--r--games/phonemes/sounds/ovo1.oggbin5454 -> 0 bytes
-rw-r--r--games/phonemes/sounds/ovo2.oggbin5179 -> 0 bytes
-rw-r--r--games/phonemes/sounds/peixe1.oggbin5264 -> 0 bytes
-rw-r--r--games/phonemes/sounds/peixe2.oggbin5323 -> 0 bytes
-rw-r--r--games/phonemes/sounds/porco1.oggbin5611 -> 0 bytes
-rw-r--r--games/phonemes/sounds/porco2.oggbin5511 -> 0 bytes
-rw-r--r--games/phonemes/sounds/queijo1.oggbin5666 -> 0 bytes
-rw-r--r--games/phonemes/sounds/queijo2.oggbin5561 -> 0 bytes
-rw-r--r--games/phonemes/sounds/roda1.oggbin5834 -> 0 bytes
-rw-r--r--games/phonemes/sounds/roda2.oggbin5607 -> 0 bytes
-rw-r--r--games/phonemes/sounds/sapo1.oggbin6266 -> 0 bytes
-rw-r--r--games/phonemes/sounds/sapo2.oggbin4950 -> 0 bytes
-rw-r--r--games/phonemes/sounds/uva1.oggbin5149 -> 0 bytes
-rw-r--r--games/phonemes/sounds/uva2.oggbin5305 -> 0 bytes
-rw-r--r--games/phonemes/sounds/zebra1.oggbin5901 -> 0 bytes
-rw-r--r--games/phonemes/sounds/zebra2.oggbin5927 -> 0 bytes
-rw-r--r--images/equal_pairs1.svg106
-rw-r--r--images/equal_pairs2.svg150
-rw-r--r--images/game-load.svg20
-rwxr-xr-ximages/game-new.svg37
-rw-r--r--images/game-restart.svg130
-rw-r--r--images/game-save.svg114
-rw-r--r--images/import_picture.svg111
-rw-r--r--images/import_sound.svg87
-rw-r--r--images/pair-add.svg99
-rw-r--r--images/pair-update.svg110
-rw-r--r--memorize.dtd17
-rwxr-xr-xmemorizetoolbar.py99
-rw-r--r--messenger.py12
-rw-r--r--model.py721
-rwxr-xr-xplayerscoreboard.py4
-rwxr-xr-xscoreboard.py8
-rwxr-xr-xsvgcard.py51
220 files changed, 2277 insertions, 1085 deletions
diff --git a/NEWS b/NEWS
index 64738ed..a6ce158 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,13 @@
+
+* Set create tab as default (Muriel)
+* Games tab renamed to Play (Muriel)
+* New icon and tooltip for reset game button #3965 (Muriel)
+* Only enable add-pair/update-pair buttons when the card has content (Muriel)
+* Import pictures and audio from journal (Muriel)
+* Create mode read/write in datastore (Muriel)
+* New memorize game file format based on zip file (Muriel)
+* New icons to create mode (Muriel)
+* New system to svgcards using cache, decreasing memory usage #3106 (Muriel)
* Adopt to actvivity launch changes (erikos)
* Start on game toolbar (erikos)
* Do not set title #3061 (erikos)
diff --git a/activity.py b/activity.py
index 68c2e04..51b0af2 100755
--- a/activity.py
+++ b/activity.py
@@ -1,20 +1,20 @@
#! /usr/bin/env python
#
-# Copyright (C) 2006, 2007, One Laptop Per Child
+# Copyright (C) 2006, 2007, One Laptop Per Child
#
-# 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 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.
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import logging
@@ -24,6 +24,7 @@ import os
import dbus
import gtk
import pygtk
+import pickle
import telepathy
import telepathy.client
@@ -48,287 +49,353 @@ SERVICE = "org.laptop.Memorize"
IFACE = SERVICE
PATH = "/org/laptop/Memorize"
-_TOOLBAR_GAME = 1
-_TOOLBAR_CREATE = 2
+_TOOLBAR_CREATE = 1
+_TOOLBAR_PLAY = 2
_logger = logging.getLogger('memorize-activity')
class MemorizeActivity(Activity):
- def __init__(self, handle):
- Activity.__init__(self, handle)
-
- self.table = cardtable.CardTable()
- self.scoreboard = scoreboard.Scoreboard()
- self.game = game.MemorizeGame()
-
- self.create_load = False
- self.create_mode = False
-
- self.hbox = gtk.HBox(False)
- self.hbox.pack_start(self.scoreboard, False, False)
- self.hbox.pack_start(self.table)
-
- toolbox = ActivityToolbox(self)
- toolbox.connect('current-toolbar-changed', self.change_mode)
- activity_toolbar = toolbox.get_activity_toolbar()
-
- self._memorizeToolbar = memorizetoolbar.MemorizeToolbar(self)
- toolbox.add_toolbar(_('Games'), self._memorizeToolbar)
- self._memorizeToolbar.show()
-
- self._createToolbar = createtoolbar.CreateToolbar(self)
- toolbox.add_toolbar('Create', self._createToolbar)
- self._createToolbar.show()
-
- self.set_toolbox(toolbox)
- toolbox.show()
- self.set_canvas(self.hbox)
-
- self.table.connect('key-press-event', self.table.key_press_event)
- self.connect('shared', self._shared_cb)
-
- self.table.connect('card-flipped', self.game.card_flipped)
- self.table.connect('card-highlighted', self.game.card_highlighted)
-
- self.game.connect('reset_scoreboard', self.scoreboard.reset)
- self.game.connect('reset_table', self.table.reset)
- self.game.connect('load_game', self.table.load_game)
- self.game.connect('change_game', self.table.change_game)
- self.game.connect('load_game', self._memorizeToolbar.update_toolbar)
- self.game.connect('change_game', self._memorizeToolbar.update_toolbar)
- self.game.connect('set-border', self.table.set_border)
- self.game.connect('flop-card', self.table.flop_card)
- self.game.connect('flip-card', self.table.flip_card)
- self.game.connect('highlight-card', self.table.highlight_card)
- self.game.connect('add_buddy', self.scoreboard.add_buddy)
- self.game.connect('rem_buddy', self.scoreboard.rem_buddy)
- self.game.connect('increase-score', self.scoreboard.increase_score)
- self.game.connect('wait_mode_buddy', self.scoreboard.set_wait_mode)
- self.game.connect('change-turn', self.scoreboard.set_selected)
-
- # connect to the in/out events of the memorize activity
- self.connect('focus_in_event', self._focus_in)
- self.connect('focus_out_event', self._focus_out)
- self.connect('destroy', self._cleanup_cb)
-
- # start on the game toolbar, might change this to the create toolbar later
- self.toolbox.set_current_toolbar(_TOOLBAR_GAME)
-
- # Get the Presence Service
- self.pservice = presenceservice.get_instance()
- try:
- name, path = self.pservice.get_preferred_connection()
- self.tp_conn_name = name
- self.tp_conn_path = path
- self.conn = telepathy.client.Connection(name, path)
- except TypeError:
- _logger.debug('Offline')
- self.initiating = None
-
- # Buddy object for you
- owner = self.pservice.get_owner()
- self.owner = owner
- self.current = 0
- self.game.set_myself(self.owner)
- # Owner.props.key
- if self._shared_activity:
- # We are joining the activity
- # _logger.debug("Joined activity, add myself to buddy list nick=%s" %self.owner.props.nick)
- # self.game.add_buddy(self.owner)
- self.connect('joined', self._joined_cb)
- if self.get_shared():
- # We've already joined
- self._joined_cb()
- else:
- _logger.debug("buddy joined - __init__: %s", self.owner.props.nick)
- self.game.load_game('addition', 4)
- self.game.add_buddy(self.owner)
- self.show_all()
-
- def change_mode(self, notebook, index):
- if index == 2:
- if not self.create_load:
- # Create mode components
- self.cardlist = cardlist.CardList()
- self.createcardpanel = createcardpanel.CreateCardPanel()
- self.createcardpanel.connect('add-pair', self.cardlist.add_pair)
- self.createcardpanel.connect('update-pair', self.cardlist.update_selected)
- self.cardlist.connect('pair-selected', self.createcardpanel.load_pair)
- self._createToolbar.connect('create_new_game', self.cardlist.clean_list)
- self._createToolbar.connect('create_load_game', self.cardlist.load_game)
- self._createToolbar.connect('create_save_game', self.cardlist.save_game)
- self.create_load = True
- self.hbox.remove(self.scoreboard)
- self.hbox.remove(self.table)
- self.hbox.pack_start(self.createcardpanel)
- self.hbox.pack_start(self.cardlist, False, False)
- self.create_mode = True
- else:
- if self.create_mode:
- self.hbox.remove(self.cardlist)
- self.hbox.remove(self.createcardpanel)
- self.hbox.pack_start(self.scoreboard, False, False)
- self.hbox.pack_start(self.table)
- self.create_mode = False
-
- def restart(self, widget):
- self.game.reset()
-
- def change_game(self, game_name, size):
- self.game.change_game(game_name, size)
-
- def _shared_cb(self, activity):
- _logger.debug('My activity was shared')
- self.initiating = True
- self._setup()
-
- for buddy in self._shared_activity.get_joined_buddies():
- pass # Can do stuff with newly acquired buddies here
-
- self._shared_activity.connect('buddy-joined', self._buddy_joined_cb)
- self._shared_activity.connect('buddy-left', self._buddy_left_cb)
-
- _logger.debug('This is my activity: making a tube...')
- id = self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].OfferDBusTube(
- SERVICE, {})
-
- def _setup(self):
- if self._shared_activity is None:
- _logger.error('Failed to share or join activity')
- return
-
- bus_name, conn_path, channel_paths =\
- self._shared_activity.get_channels()
-
- # Work out what our room is called and whether we have Tubes already
- room = None
- tubes_chan = None
- text_chan = None
- for channel_path in channel_paths:
- channel = telepathy.client.Channel(bus_name, channel_path)
- htype, handle = channel.GetHandle()
- if htype == telepathy.HANDLE_TYPE_ROOM:
- _logger.debug('Found our room: it has handle#%d "%s"',
- handle, self.conn.InspectHandles(htype, [handle])[0])
- room = handle
- ctype = channel.GetChannelType()
- if ctype == telepathy.CHANNEL_TYPE_TUBES:
- _logger.debug('Found our Tubes channel at %s', channel_path)
- tubes_chan = channel
- elif ctype == telepathy.CHANNEL_TYPE_TEXT:
- _logger.debug('Found our Text channel at %s', channel_path)
- text_chan = channel
-
- if room is None:
- _logger.error("Presence service didn't create a room")
- return
- if text_chan is None:
- _logger.error("Presence service didn't create a text channel")
- return
-
- # Make sure we have a Tubes channel - PS doesn't yet provide one
- if tubes_chan is None:
- _logger.debug("Didn't find our Tubes channel, requesting one...")
- tubes_chan = self.conn.request_channel(telepathy.CHANNEL_TYPE_TUBES,
- telepathy.HANDLE_TYPE_ROOM, room, True)
-
- self.tubes_chan = tubes_chan
- self.text_chan = text_chan
-
- tubes_chan[telepathy.CHANNEL_TYPE_TUBES].connect_to_signal('NewTube',
- self._new_tube_cb)
-
- def _list_tubes_reply_cb(self, tubes):
- for tube_info in tubes:
- self._new_tube_cb(*tube_info)
-
- def _list_tubes_error_cb(self, e):
- _logger.error('ListTubes() failed: %s', e)
-
- def _joined_cb(self, activity):
- if not self._shared_activity:
- return
-
- _logger.debug('Joined an existing shared activity')
-
- self.found = 0
- for buddy in self._shared_activity.get_joined_buddies():
- _logger.debug("buddy joined - _joined_cb: %s (get buddies of activity and add them to my list)", buddy.props.nick)
- self.game.add_buddy(buddy)
- if buddy == self.owner:
- self.found = 1
-
- if self.found == 0:
- _logger.debug("buddy joined - _joined_cb: Not foud myself in buddy list - will add myself at end of the list.")
- self.game.add_buddy(self.owner)
-
- self.initiating = False
- self._setup()
-
- self._shared_activity.connect('buddy-joined', self._buddy_joined_cb)
- self._shared_activity.connect('buddy-left', self._buddy_left_cb)
-
- _logger.debug('This is not my activity: waiting for a tube...')
- self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].ListTubes(
- reply_handler=self._list_tubes_reply_cb,
- error_handler=self._list_tubes_error_cb)
-
- def _new_tube_cb(self, id, initiator, type, service, params, state):
- _logger.debug('New tube: ID=%d initator=%d type=%d service=%s '
- 'params=%r state=%d', id, initiator, type, service,
- params, state)
-
- if (type == telepathy.TUBE_TYPE_DBUS and
- service == SERVICE):
- if state == telepathy.TUBE_STATE_LOCAL_PENDING:
- self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].AcceptDBusTube(id)
-
- self.tube_conn = TubeConnection(self.conn,
- self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES],
- id, group_iface=self.text_chan[telepathy.CHANNEL_INTERFACE_GROUP])
-
- self.messenger = messenger.Messenger(self.tube_conn, self.initiating, self._get_buddy, self.game)
- self.game.connect('flip-card-signal', self.messenger.flip)
- self.game.connect('change_game_signal', self.messenger.change_game)
-
- def _get_buddy(self, cs_handle):
- """Get a Buddy from a channel specific handle."""
- group = self.text_chan[telepathy.CHANNEL_INTERFACE_GROUP]
- my_csh = group.GetSelfHandle()
- if my_csh == cs_handle:
- handle = self.conn.GetSelfHandle()
- else:
- handle = group.GetHandleOwners([cs_handle])[0]
- assert handle != 0
- return self.pservice.get_buddy_by_telepathy_handle(self.tp_conn_name,
- self.tp_conn_path, handle)
-
- def _buddy_joined_cb (self, activity, buddy):
- if buddy <> self.owner:
- if buddy.props.nick == '':
- _logger.debug("buddy joined - _buddy_joined_cb: buddy name empty nick=%s. Will not add." %(buddy.props.nick))
- else:
- _logger.debug("buddy joined - _buddy_joined_cb: %s", buddy.props.nick)
- self.game.add_buddy(buddy)
-
- def _buddy_left_cb (self, activity, buddy):
- if buddy.props.nick == '':
- _logger.debug("buddy joined - _buddy_left_cb: buddy name empty nick=%s. Will not remove" %(buddy.props.nick))
- else:
- _logger.debug("buddy left - _buddy_left_cb: %s", buddy.props.nick)
- self.game.rem_buddy(buddy)
-
- def _focus_in(self, event, data=None):
- if self.game.sound == 1:
- self.game.cs.start()
- _logger.debug(" Memorize is visible: start csound server. ")
-
- def _focus_out(self, event, data=None):
- if self.game.sound == 1:
- self.game.cs.pause()
- _logger.debug(" Memorize is invisible: pause csound server. ")
-
- def _cleanup_cb(self, data=None):
- if self.game.sound == 1:
- self.game.cs.quit()
- _logger.debug(" Memorize closes: close csound server. ")
+ def __init__(self, handle):
+ Activity.__init__(self, handle)
+
+ self.play_load = False
+ self.play_mode = False
+
+ toolbox = ActivityToolbox(self)
+ toolbox.connect('current-toolbar-changed', self.change_mode)
+ activity_toolbar = toolbox.get_activity_toolbar()
+
+ self._createToolbar = createtoolbar.CreateToolbar(self)
+ toolbox.add_toolbar('Create', self._createToolbar)
+ self._createToolbar.show()
+
+ self._memorizeToolbar = memorizetoolbar.MemorizeToolbar(self)
+ toolbox.add_toolbar(_('Play'), self._memorizeToolbar)
+ self._memorizeToolbar.show()
+
+ self.set_toolbox(toolbox)
+ toolbox.show()
+
+ self.cardlist = cardlist.CardList()
+ self.createcardpanel = createcardpanel.CreateCardPanel()
+ self.createcardpanel.connect('add-pair', self.cardlist.add_pair)
+ self.createcardpanel.connect('update-pair', self.cardlist.update_selected)
+ self.cardlist.connect('pair-selected', self.createcardpanel.load_pair)
+ self.cardlist.connect('update-create-toolbar', self._createToolbar.update_create_toolbar)
+ self.cardlist.connect('update-create-buttons', self._createToolbar.update_buttons_status)
+ self._createToolbar.connect('create_new_game', self.cardlist.clean_list)
+ self._createToolbar.connect('create_new_game', self.createcardpanel.clean)
+ self._createToolbar.connect('create_load_game', self.cardlist.load_game)
+ self._createToolbar.connect('create_save_game', self.cardlist.save_game)
+ self._createToolbar.connect('create_equal_pairs', self.createcardpanel.change_equal_pairs)
+
+ self.hbox = gtk.HBox(False)
+ self.hbox.pack_start(self.createcardpanel)
+ self.hbox.pack_start(self.cardlist, False, False)
+ self.set_canvas(self.hbox)
+
+ # create csound instance to play sound files
+ self.sound = 0
+ try:
+ import csnd
+ del csnd
+ self.sound = 1
+ except:
+ self.sound = 0
+
+ if self.sound == 1:
+ from csound.csoundserver import CsoundServer
+ cs = CsoundServer()
+ if cs.start() != 0:
+ self.sound = 0
+ else:
+ cs.quit()
+
+ # connect to the in/out events of the memorize activity
+ self.connect('focus_in_event', self._focus_in)
+ self.connect('focus_out_event', self._focus_out)
+ self.connect('destroy', self._cleanup_cb)
+
+ # start on the game toolbar, might change this to the create toolbar later
+ self.toolbox.set_current_toolbar(_TOOLBAR_CREATE)
+
+ # Get the Presence Service
+ self.pservice = presenceservice.get_instance()
+ try:
+ name, path = self.pservice.get_preferred_connection()
+ self.tp_conn_name = name
+ self.tp_conn_path = path
+ self.conn = telepathy.client.Connection(name, path)
+ except TypeError:
+ _logger.debug('Offline')
+ self.initiating = None
+
+ # Buddy object for you
+ owner = self.pservice.get_owner()
+ self.owner = owner
+ self.current = 0
+ # Owner.props.key
+ if self._shared_activity:
+ # We are joining the activity
+ #_logger.debug("Joined activity, add myself to buddy list nick=%s" %self.owner.props.nick)
+ #self.game.add_buddy(self.owner)
+ self.toolbox.set_current_toolbar(_TOOLBAR_PLAY)
+ self.connect('joined', self._joined_cb)
+ if self.get_shared():
+ # We've already joined
+ self._joined_cb()
+ else:
+ _logger.debug("buddy joined - __init__: %s", self.owner.props.nick)
+ #game_file = game_file = os.path.join(os.path.dirname(__file__),'demos','addition.zip')
+ #self.game.load_game(game_file, 4)
+ _logger.debug('loading conventional')
+ #self.game.add_buddy(self.owner)
+ self.show_all()
+
+ def read_file(self, file_path):
+ if self.metadata['mime_type'] == 'plain/text':
+ f = open(file_path, 'r')
+ try:
+ data = pickle.load(f)
+ finally:
+ f.close()
+
+ _logger.debug('reading from datastore')
+
+ self.game.load_remote(data[0], data[1])
+ self.game.set_wait_list(data[2])
+ elif self.metadata['mime_type'] == 'application/memorizegame':
+ self.game.change_game(file_path, 4)
+
+ def write_file(self, file_path):
+ if not self.metadata['mime_type']:
+ self.metadata['mime_type'] = 'plain/text'
+
+ if self.metadata['mime_type'] == 'plain/text':
+
+
+ data=[self.game.get_grid(), self.game.get_data(), self.game.get_players_data()]
+
+ _logger.debug('writing to datastore')
+ f = open(file_path, 'w')
+ try:
+ pickle.dump(data, f)
+ finally:
+ f.close()
+
+ def change_mode(self, notebook, index):
+ if index != _TOOLBAR_CREATE:
+ if not self.play_load:
+ # Create play components
+ self.table = cardtable.CardTable()
+ self.scoreboard = scoreboard.Scoreboard()
+ self.game = game.MemorizeGame()
+ self.game.set_myself(self.owner)
+ self.hbox.remove(self.createcardpanel)
+ self.hbox.remove(self.cardlist)
+ self.hbox.pack_start(self.scoreboard, False, False)
+ self.hbox.pack_start(self.table)
+
+ self.table.connect('key-press-event', self.table.key_press_event)
+ self.table.connect('card-flipped', self.game.card_flipped)
+ self.table.connect('card-highlighted', self.game.card_highlighted)
+
+ self.game.connect('reset_scoreboard', self.scoreboard.reset)
+ self.game.connect('reset_table', self.table.reset)
+ self.game.connect('load_game', self.table.load_game)
+ self.game.connect('change_game', self.table.change_game)
+ self.game.connect('load_game', self._memorizeToolbar.update_toolbar)
+ self.game.connect('change_game', self._memorizeToolbar.update_toolbar)
+ self.game.connect('set-border', self.table.set_border)
+ self.game.connect('flop-card', self.table.flop_card)
+ self.game.connect('flip-card', self.table.flip_card)
+ self.game.connect('highlight-card', self.table.highlight_card)
+ self.game.connect('add_buddy', self.scoreboard.add_buddy)
+ self.game.connect('rem_buddy', self.scoreboard.rem_buddy)
+ self.game.connect('increase-score', self.scoreboard.increase_score)
+ self.game.connect('wait_mode_buddy', self.scoreboard.set_wait_mode)
+ self.game.connect('change-turn', self.scoreboard.set_selected)
+ self.connect('shared', self._shared_cb)
+ self.play_load = True
+ if not self._shared_activity:
+ self.game.add_buddy(self.owner)
+ #game_file = os.path.join(os.path.dirname(__file__), 'demos', 'addition.zip')
+ #self.game.load_game(game_file, 4)
+ else:
+ self.hbox.remove(self.createcardpanel)
+ self.hbox.remove(self.cardlist)
+ self.hbox.pack_start(self.scoreboard, False, False)
+ self.hbox.pack_start(self.table)
+ self.play_mode = True
+ else:
+ if self.play_mode:
+ self.hbox.remove(self.scoreboard)
+ self.hbox.remove(self.table)
+ self.hbox.pack_start(self.createcardpanel)
+ self.hbox.pack_start(self.cardlist, False, False)
+ self.play_mode = False
+
+ def restart(self, widget):
+ self.game.reset()
+
+ def change_game(self, game_name, size):
+ self.game.change_game(game_name, size)
+
+ def _shared_cb(self, activity):
+ _logger.debug('My activity was shared')
+ self.initiating = True
+ self._setup()
+
+ for buddy in self._shared_activity.get_joined_buddies():
+ pass # Can do stuff with newly acquired buddies here
+
+ self._shared_activity.connect('buddy-joined', self._buddy_joined_cb)
+ self._shared_activity.connect('buddy-left', self._buddy_left_cb)
+
+ _logger.debug('This is my activity: making a tube...')
+ id = self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].OfferDBusTube(
+ SERVICE, {})
+
+ def _setup(self):
+ if self._shared_activity is None:
+ _logger.error('Failed to share or join activity')
+ return
+
+ bus_name, conn_path, channel_paths =\
+ self._shared_activity.get_channels()
+
+ # Work out what our room is called and whether we have Tubes already
+ room = None
+ tubes_chan = None
+ text_chan = None
+ for channel_path in channel_paths:
+ channel = telepathy.client.Channel(bus_name, channel_path)
+ htype, handle = channel.GetHandle()
+ if htype == telepathy.HANDLE_TYPE_ROOM:
+ _logger.debug('Found our room: it has handle#%d "%s"',
+ handle, self.conn.InspectHandles(htype, [handle])[0])
+ room = handle
+ ctype = channel.GetChannelType()
+ if ctype == telepathy.CHANNEL_TYPE_TUBES:
+ _logger.debug('Found our Tubes channel at %s', channel_path)
+ tubes_chan = channel
+ elif ctype == telepathy.CHANNEL_TYPE_TEXT:
+ _logger.debug('Found our Text channel at %s', channel_path)
+ text_chan = channel
+
+ if room is None:
+ _logger.error("Presence service didn't create a room")
+ return
+ if text_chan is None:
+ _logger.error("Presence service didn't create a text channel")
+ return
+
+ # Make sure we have a Tubes channel - PS doesn't yet provide one
+ if tubes_chan is None:
+ _logger.debug("Didn't find our Tubes channel, requesting one...")
+ tubes_chan = self.conn.request_channel(telepathy.CHANNEL_TYPE_TUBES,
+ telepathy.HANDLE_TYPE_ROOM, room, True)
+
+ self.tubes_chan = tubes_chan
+ self.text_chan = text_chan
+
+ tubes_chan[telepathy.CHANNEL_TYPE_TUBES].connect_to_signal('NewTube',
+ self._new_tube_cb)
+
+ def _list_tubes_reply_cb(self, tubes):
+ for tube_info in tubes:
+ self._new_tube_cb(*tube_info)
+
+ def _list_tubes_error_cb(self, e):
+ _logger.error('ListTubes() failed: %s', e)
+
+ def _joined_cb(self, activity):
+ if not self._shared_activity:
+ return
+
+ _logger.debug('Joined an existing shared activity')
+
+ self.found = 0
+ for buddy in self._shared_activity.get_joined_buddies():
+ _logger.debug("buddy joined - _joined_cb: %s (get buddies of activity and add them to my list)", buddy.props.nick)
+ self.game.add_buddy(buddy)
+ if buddy == self.owner:
+ self.found = 1
+
+ if self.found == 0:
+ _logger.debug("buddy joined - _joined_cb: Not foud myself in buddy list - will add myself at end of the list.")
+ self.game.add_buddy(self.owner)
+
+ self.initiating = False
+ self._setup()
+
+ self._shared_activity.connect('buddy-joined', self._buddy_joined_cb)
+ self._shared_activity.connect('buddy-left', self._buddy_left_cb)
+
+ _logger.debug('This is not my activity: waiting for a tube...')
+ self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].ListTubes(
+ reply_handler=self._list_tubes_reply_cb,
+ error_handler=self._list_tubes_error_cb)
+
+ def _new_tube_cb(self, id, initiator, type, service, params, state):
+ _logger.debug('New tube: ID=%d initator=%d type=%d service=%s '
+ 'params=%r state=%d', id, initiator, type, service,
+ params, state)
+
+ if (type == telepathy.TUBE_TYPE_DBUS and
+ service == SERVICE):
+ if state == telepathy.TUBE_STATE_LOCAL_PENDING:
+ self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].AcceptDBusTube(id)
+
+ self.tube_conn = TubeConnection(self.conn,
+ self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES],
+ id, group_iface=self.text_chan[telepathy.CHANNEL_INTERFACE_GROUP])
+
+ self.messenger = messenger.Messenger(self.tube_conn, self.initiating, self._get_buddy, self.game)
+ self.game.connect('flip-card-signal', self.messenger.flip)
+ self.game.connect('change_game_signal', self.messenger.change_game)
+
+ def _get_buddy(self, cs_handle):
+ """Get a Buddy from a channel specific handle."""
+ group = self.text_chan[telepathy.CHANNEL_INTERFACE_GROUP]
+ my_csh = group.GetSelfHandle()
+ if my_csh == cs_handle:
+ handle = self.conn.GetSelfHandle()
+ else:
+ handle = group.GetHandleOwners([cs_handle])[0]
+ assert handle != 0
+ return self.pservice.get_buddy_by_telepathy_handle(self.tp_conn_name,
+ self.tp_conn_path, handle)
+
+ def _buddy_joined_cb (self, activity, buddy):
+ if buddy <> self.owner:
+ if buddy.props.nick == '':
+ _logger.debug("buddy joined - _buddy_joined_cb: buddy name empty nick=%s. Will not add." %(buddy.props.nick))
+ else:
+ _logger.debug("buddy joined - _buddy_joined_cb: %s", buddy.props.nick)
+ self.game.add_buddy(buddy)
+
+ def _buddy_left_cb (self, activity, buddy):
+ if buddy.props.nick == '':
+ _logger.debug("buddy joined - _buddy_left_cb: buddy name empty nick=%s. Will not remove" %(buddy.props.nick))
+ else:
+ _logger.debug("buddy left - _buddy_left_cb: %s", buddy.props.nick)
+ self.game.rem_buddy(buddy)
+
+ def _focus_in(self, event, data=None):
+ if self.sound == 1:
+ pass
+ #self.game.cs.start()
+ #_logger.debug(" Memorize is visible: start csound server. ")
+
+ def _focus_out(self, event, data=None):
+ if self.sound == 1:
+ pass
+ #self.game.cs.pause()
+ #_logger.debug(" Memorize is invisible: pause csound server. ")
+
+ def _cleanup_cb(self, data=None):
+ if self.sound == 1:
+ pass
+ #self.game.cs.quit()
+ #_logger.debug(" Memorize closes: close csound server. ")
diff --git a/activity/activity.info b/activity/activity.info
index 8f0a9c0..47f9f1d 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -5,3 +5,4 @@ exec = sugar-activity activity.MemorizeActivity
icon = activity-memorize
activity_version = 18
show_launcher = yes
+mime_types = application/memorizegame;
diff --git a/cardlist.py b/cardlist.py
index b84e2fe..237d05d 100644
--- a/cardlist.py
+++ b/cardlist.py
@@ -21,15 +21,23 @@ import gtk
import svgcard
import gobject
import logging
+from os.path import join
import os
import model
+import zipfile
+import tempfile
+import random
+from sugar import profile
+from sugar.datastore import datastore
_logger = logging.getLogger('memorize-activity')
class CardList(gtk.EventBox):
__gsignals__ = {
- 'pair-selected': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT]),
+ 'pair-selected': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT,gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT]),
+ 'update-create-toolbar': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT]),
+ 'update-create-buttons': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT]),
}
def __init__(self):
@@ -41,51 +49,147 @@ class CardList(gtk.EventBox):
self.set_size_request(450, 150)
self.vbox = gtk.VBox(False)
- fill_box = gtk.EventBox()
+ fill_box = gtk.Label()
fill_box.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('#000000'))
fill_box.show()
self.vbox.pack_end(fill_box, True, True)
scroll = gtk.ScrolledWindow()
- #scroll.props.shadow_type = gtk.SHADOW_NONE
scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
scroll.add_with_viewport(self.vbox)
scroll.set_border_width(0)
- #scroll.get_child().set_property('shadow-type', gtk.SHADOW_NONE)
scroll.get_child().modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('#000000'))
self.add(scroll)
- self.add_pair(self, '', '')
- self.pairs[0].set_selected(True)
- self.current_pair = self.pairs[0]
- self.show()
+ self.show_all()
def load_game(self, widget, game_name):
self.model.read(game_name)
+ self.current_game_key = self.model.data['game_file']
+ self.emit('update-create-toolbar', self.model.data['name'], self.model.data.get('equal_pairs', 'False'), self.model.data.get('divided', '0'))
game_pairs = self.model.pairs
+ game_data = self.model.data
self.clean_list()
- map(lambda key: self.add_pair(None, game_pairs[key].props.achar, game_pairs[key].props.bchar, False) , game_pairs)
-
- def save_game(self, widget, game_name):
- game_model = model.Model(os.path.dirname(__file__))
- game_model.data['name'] = 'game_name'
- for pair in range(len(self.pairs)):
- pair_card = model.Pair()
- pair_card.set_property('achar', self.pairs[pair].get_text())
- pair_card.set_property('bchar', self.pairs[pair].get_text())
- game_model.pairs[pair] = pair_card
- game_model.write()
+ for key in game_pairs:
+ if game_pairs[key].props.aimg != None:
+ aimg = gtk.gdk.pixbuf_new_from_file(os.path.join(self.model.data['pathimg'], game_pairs[key].props.aimg))
+ else:
+ aimg = None
+
+ if game_pairs[key].props.bimg != None:
+ bimg = gtk.gdk.pixbuf_new_from_file(os.path.join(self.model.data['pathimg'], game_pairs[key].props.bimg))
+ else:
+ bimg = None
+
+ asnd = os.path.join(self.data['pathsnd'],game_pairs[key].props.asnd)
+ bsnd = os.path.join(self.data['pathsnd'],game_pairs[key].props.bsnd)
+
+ self.add_pair(None, game_pairs[key].props.achar, game_pairs[key].props.bchar, aimg, bimg, asnd, bsnd, False)
+
+ def save_game(self, widget, game_name, equal_pairs, grouped):
+
+ temp_folder = tempfile.mkdtemp()
+ temp_img_folder = join(temp_folder, 'images')
+ temp_snd_folder = join(temp_folder, 'sounds')
+
+ os.makedirs(temp_img_folder)
+ os.makedirs(temp_snd_folder)
+
+ zip = zipfile.ZipFile(join(temp_folder, 'game.zip'), 'w')
+
+ game_model = model.Model(temp_folder)
+ game_model.data['name'] = game_name
+ for pair in range(len(self.pairs)):
+ pair_card = model.Pair()
+
+ # achar
+ achar = self.pairs[pair].get_text(1)
+ if achar != '':
+ pair_card.set_property('achar', achar)
+
+ # bchar
+ bchar = self.pairs[pair].get_text(2)
+ if bchar != '':
+ pair_card.set_property('bchar', bchar)
+
+ # aimg
+ aimg = self.pairs[pair].get_pixbuf(1)
+ if aimg != None:
+
+ if equal_pairs:
+ aimgfile = 'img'+str(pair)+'.jpg'
+ else:
+ aimgfile = 'aimg'+str(pair)+'.jpg'
+ aimg.save(join(temp_img_folder, aimgfile), 'jpeg', {'quality':'85'})
+ zip.write(join(temp_img_folder, aimgfile), join('images', aimgfile))
+ pair_card.set_property('aimg', aimgfile)
+
+ # bimg
+ bimg = self.pairs[pair].get_pixbuf(2)
+ if bimg != None:
+ if equal_pairs:
+ bimgfile = 'img'+str(pair)+'.jpg'
+ else:
+ bimgfile = 'bimg'+str(pair)+'.jpg'
+ bimg.save(join(temp_img_folder, bimgfile), 'jpeg', {'quality':'85'})
+ zip.write(join(temp_img_folder, bimgfile), join('images', bimgfile))
+ pair_card.set_property('bimg', bimgfile)
+ # asnd
+ asnd = self.pairs[pair].get_sound(1)
+ if asnd != None:
+ if equal_pairs:
+ asndfile = 'snd'+str(pair)+'.wav'
+ else:
+ asndfile = 'asnd'+str(pair)+'.wav'
+ _logger.error(asndfile+': '+ asnd)
+ zip.write(asnd, join('sounds', asndfile))
+ pair_card.set_property('asnd', asndfile)
+
+ # bsnd
+ bsnd = self.pairs[pair].get_sound(2)
+ if bsnd != None:
+ if equal_pairs:
+ bsndfile = 'snd'+str(pair)+'.wav'
+ else:
+ bsndfile = 'bsnd'+str(pair)+'.wav'
+ zip.write(bsnd, join('sounds', bsndfile))
+ _logger.error(bsndfile+': '+ bsnd)
+ pair_card.set_property('bsnd', bsndfile)
+
+ game_model.pairs[pair] = pair_card
+ game_model.write(equal_pairs, grouped)
+ zip.write(join(temp_folder, 'game.xml'), 'game.xml')
+ zip.close()
+
+ # Saves the zip in datastore
+ gameObject = datastore.create()
+ gameObject.metadata['title'] = game_name
+ gameObject.metadata['mime_type'] = 'application/memorizegame'
+ gameObject.metadata['icon-color'] = profile.get_color().to_string()
+ gameObject.file_path = join(temp_folder, 'game.zip')
+ datastore.write(gameObject)
def clean_list(self, button = None):
+ if button != None:
+ self.current_game_key = None
map(lambda x: self.vbox.remove(x), self.pairs)
del self.pairs
self.pairs = []
+
+ def clean_tmp_folder(self, path):
+ for root, dirs, files in os.walk(path, topdown=False):
+ for name in files:
+ os.remove(join(root, name))
+ for name in dirs:
+ os.rmdir(join(root, name))
+ os.rmdir(path)
- def add_pair(self, widget, achar, bchar, show = True):
- pair = Pair(achar, bchar)
+ def add_pair(self, widget, achar, bchar, aimg, bimg, asnd, bsnd, show = True):
+ pair = Pair(achar, bchar, aimg, bimg, asnd, bsnd)
self.vbox.pack_end(pair, False, True)
self.pairs.append(pair)
pair.connect('pair-selected', self.set_selected)
pair.connect('pair-closed', self.rem_pair)
+ self.emit('update-create-buttons', True, True)
if show:
self.show_all()
@@ -93,17 +197,22 @@ class CardList(gtk.EventBox):
self.vbox.remove(widget)
self.pairs.remove(widget)
del widget
-
+ self.emit('update-create-buttons', True, True)
+
def set_selected(self, widget, event):
if self.current_pair <> None:
self.old = self.current_pair
self.old.set_selected(False)
self.current_pair = widget
widget.set_selected(True)
- self.emit('pair-selected', self.current_pair.get_text())
+ self.emit('pair-selected', self.current_pair.get_text(1), self.current_pair.get_text(2), self.current_pair.get_pixbuf(1), self.current_pair.get_pixbuf(2), self.current_pair.get_sound(1),self.current_pair.get_sound(2))
+
+ def update_selected(self, widget, newtext1, newtext2, aimg, bimg, asnd, bsnd):
+ self.current_pair.change_text(newtext1, newtext2)
+ self.current_pair.change_pixbuf(aimg, bimg)
+ self.current_pair.change_sound(asnd,bsnd)
- def update_selected(self, widget, newtext1, newtext2):
- self.current_pair.change_text(newtext1)
+ self.emit('update-create-buttons', True, True)
class Pair(gtk.EventBox):
@@ -112,7 +221,7 @@ class Pair(gtk.EventBox):
'pair-closed': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT]),
}
- def __init__(self, text1, text2 = None):
+ def __init__(self, text1, text2 = None, aimg = None, bimg = None, asnd = None, bsnd = None):
gtk.EventBox.__init__(self)
self.bg_color = '#000000'
if text2 == None:
@@ -121,16 +230,24 @@ class Pair(gtk.EventBox):
self.text2 = text2
self.text1 = text1
+ self.asnd = asnd
+ self.bsnd = bsnd
+
+ self.current_game_key = None
+
close_button = gtk.Button('X')
close_button.connect('button-press-event', self.emit_close)
table = gtk.Table()
table.connect('button-press-event', self.emit_selected)
- table.set_col_spacings(5)
+ table.set_col_spacings(0)
table.set_border_width(10)
self.bcard1 = svgcard.SvgCard(-1, {'front_text':{'card_text':text1, 'text_color':'#ffffff'}, 'front':{'fill_color':'#4c4d4f', 'stroke_color':'#ffffff', 'opacity':'1'}}, None, 184, 1, self.bg_color)
self.bcard2 = svgcard.SvgCard(-1, {'front_text':{'card_text':text2, 'text_color':'#ffffff'}, 'front':{'fill_color':'#4c4d4f', 'stroke_color':'#ffffff', 'opacity':'1'}}, None, 184, 1, self.bg_color)
+
self.bcard1.flip()
self.bcard2.flip()
+ self.bcard1.set_pixbuf(aimg)
+ self.bcard2.set_pixbuf(bimg)
table.attach(self.bcard1, 0, 1, 0, 8)
table.attach(self.bcard2, 1, 2, 0, 8)
@@ -156,9 +273,32 @@ class Pair(gtk.EventBox):
self.bcard1.set_background(self.bg_color)
self.bcard2.set_background(self.bg_color)
- def change_text(self, newtext):
- self.bcard1.change_text(newtext)
- self.bcard2.change_text(newtext)
+ def change_pixbuf(self, aimg, bimg):
+ self.bcard1.set_pixbuf(aimg)
+ self.bcard2.set_pixbuf(bimg)
- def get_text(self):
- return self.bcard1.get_text() \ No newline at end of file
+ def change_text(self, text1, text2):
+ self.bcard1.change_text(text1)
+ self.bcard2.change_text(text2)
+
+ def change_sound(self, asnd, bsnd):
+ self.asnd = asnd
+ self.bsnd = bsnd
+
+ def get_text(self, card):
+ if card == 1:
+ return self.bcard1.get_text()
+ else:
+ return self.bcard2.get_text()
+
+ def get_pixbuf(self, card):
+ if card == 1:
+ return self.bcard1.get_pixbuf()
+ else:
+ return self.bcard2.get_pixbuf()
+
+ def get_sound(self, card):
+ if card == 1:
+ return self.asnd
+ else:
+ return self.bsnd \ No newline at end of file
diff --git a/cardtable.py b/cardtable.py
index f1a992c..a612647 100755
--- a/cardtable.py
+++ b/cardtable.py
@@ -47,11 +47,14 @@ class CardTable(gtk.EventBox):
self.table.set_resize_mode(gtk.RESIZE_IMMEDIATE)
self.set_property('child', self.table)
self.fist_load = True
+ self.show_all()
def load_game(self, widget, data, grid):
self.data = data
self.cards_data = grid
self.size = int(math.ceil(math.sqrt(len(grid))))
+ if self.size < 4:
+ self.size = 4
self.table.resize(self.size, self.size)
self.card_size = self.get_card_size(self.size)
self.cards = {}
diff --git a/createcardpanel.py b/createcardpanel.py
index e2de4bc..5812d99 100644
--- a/createcardpanel.py
+++ b/createcardpanel.py
@@ -18,100 +18,292 @@
#
import gtk
+import os
+import shutil
+import tempfile
+from gettext import gettext as _
import svgcard
import logging
import gobject
+from xml.dom.minidom import parse
+from sugar.graphics.objectchooser import ObjectChooser
_logger = logging.getLogger('memorize-activity')
class CreateCardPanel(gtk.EventBox):
__gsignals__ = {
- 'add-pair': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT]),
- 'update-pair': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT,gobject.TYPE_PYOBJECT]),
+ 'add-pair': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT]),
+ 'update-pair': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT]),
}
def __init__(self):
gtk.EventBox.__init__(self)
+ self.set_size_request(650, 320)
- table = gtk.Table()
- table.set_col_spacings(10)
- table.set_row_spacings(10)
- table.set_border_width(200)
+ self.equal_pairs = False
- addbutton = gtk.Button('Add as new pair')
- addbutton.connect('button-press-event',self.emit_add_pair)
+ # Set the add new pair buttom
+ add_icon = os.path.join(os.path.dirname(__file__), "images/pair-add.svg")
+ add_image = gtk.Image()
+ add_image.set_from_file(add_icon)
+ self._addbutton = gtk.Button(' ' + _('Add as new pair'))
+ self._addbutton.set_image(add_image)
+ self._addbutton.connect('button-press-event', self.emit_add_pair)
- updatebutton = gtk.Button('Update selected pair')
- updatebutton.connect('button-press-event',self.emit_update_pair)
+ # Set update selected pair buttom
+ update_icon = os.path.join(os.path.dirname(__file__), "images/pair-update.svg")
+ update_image = gtk.Image()
+ update_image.set_from_file(update_icon)
+ self._updatebutton = gtk.Button(' ' + _('Update selected pair'))
+ self._updatebutton.set_image(update_image)
+ self._updatebutton.connect('button-press-event', self.emit_update_pair)
- self.cardeditor = CardEditor()
- table.attach(self.cardeditor, 0, 2, 0, 1)
- table.attach(addbutton, 0, 1, 1, 2)
- table.attach(updatebutton, 1, 2, 1, 2)
+ # Set card editors
+ self.cardeditor1 = CardEditor()
+ self.cardeditor2 = CardEditor()
+ self.clean(None)
+ self.cardeditor1.connect('has-text', self.receive_text_signals)
+ self.cardeditor2.connect('has-text', self.receive_text_signals)
+ self.cardeditor1.connect('has-picture', self.receive_picture_signals)
+ self.cardeditor2.connect('has-picture', self.receive_picture_signals)
- self.add(table)
+ # Create table and add components to the table
+ self.table = gtk.Table()
+ self.table.set_homogeneous(False)
+ self.table.set_col_spacings(10)
+ self.table.set_row_spacings(10)
+ self.table.set_border_width(10)
+ self.table.attach(self.cardeditor1, 0, 2, 0, 1, gtk.SHRINK|gtk.FILL, gtk.SHRINK, 10, 30)
+ self.table.attach(self.cardeditor2, 2, 4, 0, 1, gtk.SHRINK|gtk.FILL, gtk.SHRINK, 10, 30)
+ self.table.attach(self._addbutton, 1, 2, 1, 2, gtk.SHRINK|gtk.FILL, gtk.SHRINK)
+ self.table.attach(self._updatebutton, 2, 3, 1, 2, gtk.SHRINK|gtk.FILL, gtk.SHRINK)
+ self.add(self.table)
self.show_all()
def emit_add_pair(self, widget, event):
- self.emit('add-pair',self.cardeditor.get_text(),self.cardeditor.get_text())
+ if self.equal_pairs:
+ self.emit('add-pair', self.cardeditor1.get_text(), self.cardeditor1.get_text(), self.cardeditor1.get_pixbuf(), self.cardeditor1.get_pixbuf(), self.cardeditor1.get_snd(), self.cardeditor1.get_snd())
+ else:
+ self.emit('add-pair', self.cardeditor1.get_text(), self.cardeditor2.get_text(), self.cardeditor1.get_pixbuf(), self.cardeditor2.get_pixbuf(), self.cardeditor1.get_snd(), self.cardeditor2.get_snd())
+ self.clean(None)
+
def emit_update_pair(self, widget, event):
- self.emit('update-pair',self.cardeditor.get_text(),self.cardeditor.get_text())
-
- def load_pair(self, widget, newtext):
- self.cardeditor.set_text(newtext)
+ if self.equal_pairs:
+ self.emit('update-pair', self.cardeditor1.get_text(), self.cardeditor1.get_text(), self.cardeditor1.get_pixbuf(), self.cardeditor1.get_pixbuf(), self.cardeditor1.get_snd(), self.cardeditor1.get_snd())
+ else:
+ self.emit('update-pair', self.cardeditor1.get_text(), self.cardeditor2.get_text(), self.cardeditor1.get_pixbuf(), self.cardeditor2.get_pixbuf(), self.cardeditor1.get_snd(), self.cardeditor2.get_snd())
+ self.clean(None)
+
+ def load_pair(self, widget, newtext1, newtext2, aimg, bimg, asnd, bsnd):
+ self.cardeditor1.set_text(newtext1)
+ self.cardeditor2.set_text(newtext2)
+ self.cardeditor1.set_pixbuf(aimg)
+ self.cardeditor2.set_pixbuf(bimg)
+ self.cardeditor1.set_snd(asnd)
+ self.cardeditor2.set_snd(bsnd)
+ self._addbutton.set_sensitive(True)
+ self._updatebutton.set_sensitive(True)
+ def change_equal_pairs(self, widget, state):
+ self.equal_pairs = state
+ self.clean(None)
+ if self.equal_pairs:
+ self.table.remove(self.cardeditor1)
+ self.table.remove(self.cardeditor2)
+ self.table.attach(self.cardeditor1, 0, 4, 0, 1, gtk.SHRINK|gtk.FILL, gtk.SHRINK, 200, 30)
+ else:
+ self.table.remove(self.cardeditor1)
+ self.table.attach(self.cardeditor1, 0, 2, 0, 1, gtk.SHRINK|gtk.FILL, gtk.SHRINK, 10, 30)
+ self.table.attach(self.cardeditor2, 2, 4, 0, 1, gtk.SHRINK|gtk.FILL, gtk.SHRINK, 10, 30)
+
+ def clean(self, widget):
+ self.cardeditor1.clean()
+ self.cardeditor2.clean()
+ self._addbutton.set_sensitive(False)
+ self._updatebutton.set_sensitive(False)
+ self._card1_has_text = False
+ self._card2_has_text = False
+ self._card1_has_picture = False
+ self._card2_has_picture = False
+
+ def receive_text_signals(self, widget, has_text):
+ if widget == self.cardeditor1:
+ self._card1_has_text = has_text
+ if widget == self.cardeditor2:
+ self._card2_has_text = has_text
+ self._update_buttom_status()
+
+ def receive_picture_signals(self, widget, has_picture):
+ if widget == self.cardeditor1:
+ self._card1_has_picture = has_picture
+ if widget == self.cardeditor2:
+ self._card2_has_picture = has_picture
+ self._update_buttom_status()
+
+ def _update_buttom_status(self):
+ if not self.equal_pairs:
+ if (self._card1_has_text or self._card1_has_picture) and (self._card2_has_text or self._card2_has_picture):
+ self._addbutton.set_sensitive(True)
+ self._updatebutton.set_sensitive(True)
+ else:
+ self._addbutton.set_sensitive(False)
+ self._updatebutton.set_sensitive(False)
+ else:
+ if self._card1_has_text or self._card1_has_picture:
+ self._addbutton.set_sensitive(True)
+ self._updatebutton.set_sensitive(True)
+ else:
+ self._addbutton.set_sensitive(False)
+ self._updatebutton.set_sensitive(False)
+
class CardEditor(gtk.EventBox):
+ __gsignals__ = {
+ 'has-text': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT]),
+ 'has-picture': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT]),
+ }
+
def __init__(self):
gtk.EventBox.__init__(self)
- self.set_size_request(400, 400)
+ self.set_size_request(310, 320)
+ self.temp_folder = tempfile.mkdtemp()
+
table = gtk.Table()
- self.previewlabel = gtk.Label('Preview:')
+ self.previewlabel = gtk.Label(_('Preview:'))
self.previewlabel.set_alignment(1, 0.5)
- self.textlabel = gtk.Label('Text:')
+ self.textlabel = gtk.Label(_('Text:'))
self.textlabel.set_alignment(1, 0.5)
- self.picturelabel = gtk.Label('Picture:')
- self.picturelabel.set_alignment(1, 0.5)
- self.soundlabel = gtk.Label('Sound:')
- self.soundlabel.set_alignment(1, 0.5)
-
- self.browsepicture = gtk.Button('Browse')
- self.capturepicture = gtk.Button('Capture')
- self.browsesound = gtk.Button('Browse')
- self.recordsound = gtk.Button('Record')
+
+ picture_icon = os.path.join(os.path.dirname(__file__), 'images/import_picture.svg')
+ picture_image = gtk.Image()
+ picture_image.set_from_file(picture_icon)
+ self.browsepicture = gtk.Button()
+ self.browsepicture.set_image(picture_image)
+ self.browsepicture.connect('button-press-event', self._import_image)
+
+ sound_icon = os.path.join(os.path.dirname(__file__), 'images/import_sound.svg')
+ sound_image = gtk.Image()
+ sound_image.set_from_file(sound_icon)
+ self.browsesound = gtk.Button()
+ self.browsesound.set_image(sound_image)
+ self.browsesound.connect('button-press-event', self._import_audio)
+ self.snd = None
self.textentry = gtk.Entry()
self.textentry.connect('changed', self.update_text)
+ table.set_homogeneous(False)
table.set_col_spacings(10)
table.set_row_spacings(10)
- table.set_border_width(20)
+ table.set_border_width(10)
self.card = svgcard.SvgCard(-1, {'front_text':{'card_text':'', 'text_color':'#ffffff'}, 'front_border':{'fill_color':'#4c4d4f', 'stroke_color':'#ffffff', 'opacity':'1'}}, None, 184, 1, '#c0c0c0')
self.card.flip()
- table.attach(self.previewlabel, 0, 1, 1, 2)
- table.attach(self.card, 1, 3, 1, 2)
+ table.attach(self.previewlabel, 0, 1, 1, 2, gtk.EXPAND, gtk.EXPAND)
+ table.attach(self.card, 1, 3, 1, 2, gtk.EXPAND, gtk.EXPAND, 10)
#Text label and entry
- table.attach(self.textlabel, 0, 1, 2, 3)
- table.attach(self.textentry, 1, 3, 2, 3)
+ table.attach(self.textlabel, 0, 1, 2, 3, gtk.EXPAND|gtk.FILL, gtk.EXPAND)
+ table.attach(self.textentry, 1, 3, 2, 3, gtk.EXPAND|gtk.FILL, gtk.EXPAND)
#Picture label and entry
- table.attach(self.picturelabel, 0, 1, 3, 4)
- table.attach(self.browsepicture, 1, 2, 3, 4)
- table.attach(self.capturepicture, 2, 3, 3, 4)
+ table.attach(self.browsepicture, 1, 2, 3, 4, gtk.EXPAND|gtk.FILL, gtk.EXPAND)
#Sound label and entry
- table.attach(self.soundlabel, 0, 1, 4, 5)
- table.attach(self.browsesound, 1, 2, 4, 5)
- table.attach(self.recordsound, 2, 3, 4, 5)
+ table.attach(self.browsesound, 2, 3, 3, 4, gtk.EXPAND|gtk.FILL, gtk.EXPAND)
self.add(table)
def update_text(self, entry):
self.card.change_text(entry.get_text())
+ if len(entry.get_text()) == 0:
+ self.emit('has-text', False)
+ else:
+ self.emit('has-text', True)
def get_text(self):
return self.textentry.get_text()
def set_text(self, newtext):
+ if newtext == None:
+ newtext = ''
self.textentry.set_text(newtext)
+
+ def get_pixbuf(self):
+ return self.card.get_pixbuf()
+
+ def set_pixbuf(self, pixbuf):
+ self.card.set_pixbuf(pixbuf)
+
+ def _import_image(self, widget, event):
+ chooser = ObjectChooser(_('Choose image'), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
+ try:
+ result = chooser.run()
+ if result == gtk.RESPONSE_ACCEPT:
+ _logger.debug('ObjectChooser: %r' % chooser.get_selected_object())
+ jobject = chooser.get_selected_object()
+ if jobject and jobject.file_path:
+ self._load_image(jobject.file_path)
+ finally:
+ chooser.destroy()
+ del chooser
+
+ def _load_image(self, index):
+ pixbuf_t = gtk.gdk.pixbuf_new_from_file(index)
+ self.card.set_pixbuf(self.to_card_pixbuf(pixbuf_t))
+ _logger.error('Picture Loaded: '+index)
+ self.emit('has-picture', True)
+ del pixbuf_t
+
+ def _import_audio(self, widget, event):
+ chooser = ObjectChooser(_('Choose audio'), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
+ jobject = ''
+ try:
+ result = chooser.run()
+ if result == gtk.RESPONSE_ACCEPT:
+ _logger.debug('ObjectChooser: %r' % chooser.get_selected_object())
+ jobject = chooser.get_selected_object()
+ if not jobject or not jobject.file_path:
+ return
+ finally:
+ chooser.destroy()
+ del chooser
+
+ if jobject and jobject.file_path:
+ self._load_audio(jobject.file_path)
+
+ def _load_audio(self, index):
+ dst = os.path.join(self.temp_folder, os.path.basename(index))
+ shutil.copy(index, dst)
+ self.set_snd(dst)
+ _logger.error('Audio Loaded: '+dst)
+
+ def set_snd(self, snd):
+ self.snd = snd
+
+ def get_snd(self):
+ return self.snd
+
+ def clean(self):
+ self.textentry.set_text('')
+ self.card.set_pixbuf(None)
+ self.emit('has-text', False)
+ self.emit('has-picture', False)
+
+ def to_card_pixbuf(self, pixbuf):
+ if pixbuf.get_width() == pixbuf.get_height():
+ new = pixbuf_t.scale_simple(162, 162, gtk.gdk.INTERP_BILINEAR)
+ elif pixbuf.get_width() > pixbuf.get_height():
+ new = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, 162, 162)
+ aspect = float(pixbuf.get_width()) / float(pixbuf.get_height())
+ pixbuf_t = pixbuf.scale_simple(int(float(162)*aspect) , 162, gtk.gdk.INTERP_BILINEAR)
+ diff = pixbuf_t.get_width() - pixbuf_t.get_height()
+ pixbuf_t.scale(new, 0, 0, 162, 162, -(diff/2), 0, 1, 1, gtk.gdk.INTERP_BILINEAR)
+ del pixbuf_t
+ elif pixbuf.get_width() < pixbuf.get_height():
+ new = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, 162, 162)
+ aspect = float(pixbuf.get_height()) / float(pixbuf.get_width())
+ pixbuf_t = pixbuf.scale_simple(162 , int(float(162)*aspect), gtk.gdk.INTERP_BILINEAR)
+ diff = pixbuf_t.get_height() - pixbuf_t.get_width()
+ pixbuf_t.scale(new, 0, 0, 162, 162, 0, -(diff/2), 1, 1, gtk.gdk.INTERP_BILINEAR)
+ del pixbuf_t
+ return new \ No newline at end of file
diff --git a/createtoolbar.py b/createtoolbar.py
index af6a2dc..385dc99 100755
--- a/createtoolbar.py
+++ b/createtoolbar.py
@@ -25,7 +25,9 @@ import os
import gobject
from sugar.graphics.toolbutton import ToolButton
+from sugar.graphics.toggletoolbutton import ToggleToolButton
from sugar.graphics.toolcombobox import ToolComboBox
+from sugar.graphics.objectchooser import ObjectChooser
class CreateToolbar(gtk.Toolbar):
__gtype_name__ = 'CreateToolbar'
@@ -33,7 +35,8 @@ class CreateToolbar(gtk.Toolbar):
__gsignals__ = {
'create_new_game': (gobject.SIGNAL_RUN_FIRST, None, []),
'create_load_game': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT]),
- 'create_save_game': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT]),
+ 'create_save_game': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT]),
+ 'create_equal_pairs': (gobject.SIGNAL_RUN_FIRST, None, [gobject.TYPE_PYOBJECT]),
}
def __init__(self, activity):
@@ -47,7 +50,7 @@ class CreateToolbar(gtk.Toolbar):
new_image.set_from_file(new_icon)
self._new_button = ToolButton()
self._new_button.set_icon_widget(new_image)
- self._new_button.set_tooltip(_('New game set'))
+ self._new_button.set_tooltip(_('New game'))
self._new_button.connect('clicked', self._new_game_bt)
self._add_widget(self._new_button)
@@ -57,17 +60,9 @@ class CreateToolbar(gtk.Toolbar):
load_image.set_from_file(load_icon)
self._load_button = ToolButton()
self._load_button.set_icon_widget(load_image)
- self._load_button.set_tooltip(_('Load game set'))
- self._load_button.connect('enter-notify-event', self._drop_palette)
+ self._load_button.set_tooltip(_('Load game'))
+ self._load_button.connect('clicked', self._load_game)
self._add_widget(self._load_button)
- self.games = os.listdir(os.path.join(os.path.dirname(__file__), 'games'))
- self.games.sort()
- palette = self._load_button.get_palette()
- for game in self.games:
- menu_item = gtk.MenuItem(game)
- menu_item.connect('activate', self._game_changed_cb, game)
- palette.menu.prepend(menu_item)
- menu_item.show()
# Save Button
save_icon = os.path.join(os.path.dirname(__file__), "images/game-save.svg")
@@ -75,8 +70,9 @@ class CreateToolbar(gtk.Toolbar):
save_image.set_from_file(save_icon)
self._save_button = ToolButton()
self._save_button.set_icon_widget(save_image)
- self._save_button.set_tooltip(_('Save game set'))
+ self._save_button.set_tooltip(_('Save game'))
self._save_button.connect('clicked', self._save_game_bt)
+ self._save_button.set_sensitive(False)
self._add_widget(self._save_button)
# Separator
@@ -87,12 +83,23 @@ class CreateToolbar(gtk.Toolbar):
self._add_widget(gtk.Label(_('Game name: ')))
self.game_name_entry = gtk.Entry()
self._add_widget(self.game_name_entry)
-
- self._add_widget(gtk.CheckButton('Equal pairs'))
-
- self._add_widget(gtk.CheckButton('Grouped'))
-
+
+ self._equal_pairs = gtk.CheckButton(_('Equal pairs'))
+ self._add_widget(self._equal_pairs)
+ self._equal_pairs.connect('toggled', self._emit_equal_pairs)
+ self._grouped_icon1 = os.path.join(os.path.dirname(__file__), "images/equal_pairs1.svg")
+ self._grouped_icon2 = os.path.join(os.path.dirname(__file__), "images/equal_pairs2.svg")
+ self._grouped_image1 = gtk.Image()
+ self._grouped_image2 = gtk.Image()
+ self._grouped_image1.set_from_file(self._grouped_icon1)
+ self._grouped_image2.set_from_file(self._grouped_icon2)
+ self._grouped = ToggleToolButton()
+ self._grouped.set_icon_widget(self._grouped_image1)
+ self._grouped.set_tooltip(_('Click for grouped game'))
+ self._grouped.connect('toggled', self._grouped_cb)
+ self._add_widget(self._grouped)
+
def _add_widget(self, widget, expand=False):
tool_item = gtk.ToolItem()
tool_item.set_expand(expand)
@@ -105,12 +112,57 @@ class CreateToolbar(gtk.Toolbar):
self.game_name_entry.set_text(game_name)
self.emit('create_load_game',game_name)
- def _drop_palette(self, button):
- button.get_palette().popdown(False)
+ def _load_game(self, button):
+ chooser = ObjectChooser(_('Choose memorize game'), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
+ jobject = ''
+ try:
+ result = chooser.run()
+ if result == gtk.RESPONSE_ACCEPT:
+ logging.debug('ObjectChooser: %r' % chooser.get_selected_object())
+ jobject = chooser.get_selected_object()
+ if not jobject or not jobject.file_path:
+ return
+ finally:
+ chooser.destroy()
+ del chooser
+
+ if jobject and jobject.file_path:
+ self.emit('create_load_game',jobject.file_path)
+ self._save_button.set_sensitive(False)
def _new_game_bt(self, button):
self.game_name_entry.set_text('')
+ self._equal_pairs.set_active(False)
+ self._grouped.set_active(False)
self.emit('create_new_game')
+ self._new_button.set_sensitive(False)
+ self._save_button.set_sensitive(False)
def _save_game_bt(self, button):
- self.emit('create_save_game',self.game_name_entry.get_text()) \ No newline at end of file
+ self.emit('create_save_game',self.game_name_entry.get_text(), self._equal_pairs.get_active(), self._grouped.get_active())
+ self._save_button.set_sensitive(False)
+
+ def _emit_equal_pairs(self,checkbutton):
+ self.emit('create_equal_pairs',checkbutton.get_active())
+ self._save_button.set_sensitive(True)
+
+ def _grouped_cb(self,widget):
+ self._save_button.set_sensitive(True)
+ if self._grouped.get_active():
+ self._grouped.set_icon_widget(self._grouped_image2)
+ self._grouped_image2.show()
+ self._grouped.set_tooltip(_('Click for ungrouped game'))
+ else:
+ self._grouped.set_icon_widget(self._grouped_image1)
+ self._grouped_image1.show()
+ self._grouped.set_tooltip(_('Click for grouped game'))
+
+ def update_create_toolbar(self, widget, game_name, equal_pairs, grouped):
+ self.game_name_entry.set_text(game_name)
+ self._equal_pairs.set_active(equal_pairs == 'True')
+ self._grouped.set_active(grouped == '1')
+
+ def update_buttons_status(self, widget, new, save):
+ self._new_button.set_sensitive(new)
+ self._save_button.set_sensitive(save)
+ \ No newline at end of file
diff --git a/demos/addition.zip b/demos/addition.zip
new file mode 100644
index 0000000..1633af3
--- /dev/null
+++ b/demos/addition.zip
Binary files differ
diff --git a/demos/capitals.zip b/demos/capitals.zip
new file mode 100644
index 0000000..ca908f9
--- /dev/null
+++ b/demos/capitals.zip
Binary files differ
diff --git a/demos/drumgit.zip b/demos/drumgit.zip
new file mode 100644
index 0000000..f544d19
--- /dev/null
+++ b/demos/drumgit.zip
Binary files differ
diff --git a/demos/letters.zip b/demos/letters.zip
new file mode 100644
index 0000000..5159a9b
--- /dev/null
+++ b/demos/letters.zip
Binary files differ
diff --git a/demos/numbers.zip b/demos/numbers.zip
new file mode 100644
index 0000000..d601b89
--- /dev/null
+++ b/demos/numbers.zip
Binary files differ
diff --git a/demos/phonemes.zip b/demos/phonemes.zip
new file mode 100644
index 0000000..1c22642
--- /dev/null
+++ b/demos/phonemes.zip
Binary files differ
diff --git a/game.py b/game.py
index 4b2776d..e825a0d 100755
--- a/game.py
+++ b/game.py
@@ -18,11 +18,8 @@
#
import os
-import random
import logging
import gobject
-import time
-import gtk
from sugar import profile
from dbus.service import method, signal
@@ -92,7 +89,8 @@ class MemorizeGame(gobject.GObject):
self.sound = 0
- def load_game(self, game_name, size):
+ def load_game(self, game_name, size):
+
if self.model.read(game_name) == 0:
self.model.def_grid(size)
self.model.data['running'] = 'False'
@@ -106,6 +104,7 @@ class MemorizeGame(gobject.GObject):
self.players.append(buddy)
self.players_score[buddy] = score
self.emit('add_buddy', buddy, score)
+ logging.debug(str(buddy))
if self.current_player == None:
self.current_player = buddy
@@ -121,6 +120,8 @@ class MemorizeGame(gobject.GObject):
self.emit('rem_buddy', buddy)
def change_turn(self):
+ if len(self.players) == 0:
+ return
if self.current_player == None:
self.current_player = self.players[0]
elif self.current_player == self.players[-1]:
@@ -138,7 +139,7 @@ class MemorizeGame(gobject.GObject):
# do not process flips when flipping back
if self.flip_block is True:
return
-
+
# Handle groups if needed
if self.model.data['divided'] == '1':
if self.last_flipped == -1 and id >= (len(self.model.grid)/2):
@@ -151,8 +152,12 @@ class MemorizeGame(gobject.GObject):
if self.sound == 1:
snd = self.model.grid[id].get('snd', None)
if snd != None:
- self.cs.perform('i 108 0.0 3.0 "%s" 1 0.9 0'%(os.path.join(os.path.dirname(__file__), snd)))
- _logger.debug('Audio: play sound=%s'%snd)
+ if snd.endswith('.wav'):
+ pass
+ # code to csound play wav
+ else:
+ self.cs.perform('i 108 0.0 3.0 "%s" 1 0.9 0'%(os.path.join(os.path.dirname(__file__), snd)))
+ _logger.debug('Audio: play sound=%s'%snd)
# First card case
if self.last_flipped == -1:
@@ -170,7 +175,8 @@ class MemorizeGame(gobject.GObject):
self.emit('set-border', id, stroke_color, fill_color)
self.emit('set-border', self.last_flipped, stroke_color, fill_color)
self.increase_point(self.current_player)
- self.model.grid[id]['state'] = '1'
+ self.model.grid[id]['state'] = self.current_player.props.color
+ self.model.grid[self.last_flipped]['state'] = self.current_player.props.color
self.emit('flip-card', id)
if self.model.data['divided'] == '1':
self.card_highlighted(widget, -1, False)
@@ -234,7 +240,13 @@ class MemorizeGame(gobject.GObject):
self.model.def_grid(size)
self.load_remote(self.model.grid, self.model.data, False)
else:
- logging.error(' Reading setup file %s'%game_name)
+ logging.error(' Reading setup file %s'%game_name)
+
+ def reset_game(self, size = None):
+ if size == None:
+ size = int(self.model.data['size'])
+ self.model.def_grid(size)
+ self.load_remote(self.model.grid, self.model.data, False)
def load_remote(self, grid, data, signal = False):
self.model.grid = grid
@@ -250,7 +262,15 @@ class MemorizeGame(gobject.GObject):
self.last_highlight = 1
self.change_turn()
self.model.data['running'] = 'False'
-
+ for card in self.model.grid:
+ if card['state'] == '1':
+ self.emit('flip-card', self.model.grid.index(card))
+ self.last_flipped = self.model.grid.index(card)
+ elif card['state'] != '0':
+ stroke_color, fill_color = card['state'].split(',')
+ self.emit('flip-card', self.model.grid.index(card))
+ self.emit('set-border',self.model.grid.index(card), stroke_color, fill_color)
+
def set_messenger(self, messenger):
self.messenger = messenger
@@ -266,6 +286,21 @@ class MemorizeGame(gobject.GObject):
def get_current_player(self):
return self.current_player
+ def get_players_data(self):
+ data = []
+ for player,score in self.players_score.items():
+ data.append([player.props.key,player.props.nick,player.props.color,score])
+ return data
+
+ def set_wait_list(self, list):
+ self.waiting_players = list
+ for w in list:
+ for p in self.players:
+ if w[0] == p.props.key:
+ list.remove(w)
+ for i in range(w[3]):
+ self.increase_point(p)
+
def set_myself(self, buddy):
self.myself = buddy
@@ -273,7 +308,7 @@ class MemorizeGame(gobject.GObject):
self.players.remove(buddy)
self.waiting_players.append(buddy)
self.emit('wait_mode_buddy',buddy,True)
-
+
def rem_to_waiting_list(self,buddy):
self.waiting_players.remove(buddy)
self.players.append(buddy)
diff --git a/games/addition/addition.mem b/games/addition/addition.mem
deleted file mode 100644
index 86b552d..0000000
--- a/games/addition/addition.mem
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<memorize name="addition" scoresnd="score.wav" winsnd="win.wav" divided="1" align="1" face1="1" face2="2" >
-
- <pair achar="1+1" bchar="2"/>q
- <pair achar="1+2" bchar="3" />
- <pair achar="2+2" bchar="4" />
- <pair achar="2+3" bchar="5" />
- <pair achar="3+3" bchar="6" />
- <pair achar="3+4" bchar="7" />
- <pair achar="4+4" bchar="8"/>
- <pair achar="4+5" bchar="9" />
- <pair achar="5+5" bchar="10" />
- <pair achar="5+6" bchar="11" />
- <pair achar="6+6" bchar="12" />
- <pair achar="6+7" bchar="13" />
- <pair achar="7+7" bchar="14" />
- <pair achar="7+8" bchar="15" />
- <pair achar="8+8" bchar="16" />
- <pair achar="8+9" bchar="17" />
- <pair achar="9+9" bchar="18" />
- <pair achar="10+9" bchar="19" />
-
-</memorize>
diff --git a/games/capitals/capitals.mem b/games/capitals/capitals.mem
deleted file mode 100755
index 7c62955..0000000
--- a/games/capitals/capitals.mem
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<memorize name="capitals" scoresnd="score.wav" winsnd="win.wav" divided="1" align="1" face1="1" face2="2" >
-
- <pair achar="Brazil" bchar="Brasilia"/>
- <pair achar="Argentina" bchar="Buenos Aires" />
- <pair achar="Uruguay" bchar="Montevideo" />
- <pair achar="Libya" bchar="Tripoli" />
- <pair achar="Nigeria" bchar="Abuja" />
- <pair achar="Rwanda" bchar="Kigali" />
- <pair achar="United States" bchar=" Washington"/>
- <pair achar="India" bchar="New Delhi" />
- <pair achar="Australia" bchar="Canberra" />
- <pair achar="Paraguay" bchar="Asunción" />
- <pair achar="Chile" bchar="Santiago" />
- <pair achar="Bolivia" bchar="La Paz" />
- <pair achar="China" bchar="Beijing" />
- <pair achar="Canada" bchar="Ottawa" />
- <pair achar="Venezuela" bchar="Caracas" />
- <pair achar="Ecuador" bchar="Quito" />
- <pair achar="Peru" bchar="Lima" />
- <pair achar="Colombia" bchar="Bogotá" />
-
-</memorize>
diff --git a/games/drumgit/drumgit.mem b/games/drumgit/drumgit.mem
deleted file mode 100644
index bd70d35..0000000
--- a/games/drumgit/drumgit.mem
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<memorize name="drumgit" scoresnd="score.wav" winsnd="win.wav" divided="0" >
-
- <pair aimg="drumkit1_b.jpg" asnd="beat1_a.ogg" bimg="drumkit1_b.jpg" bsnd="beat1_a.ogg" color="100" />
- <pair aimg="drumkit2_b.jpg" asnd="beat1_b.ogg" bimg="drumkit2_b.jpg" bsnd="beat1_b.ogg" color="100" />
- <pair aimg="drumkit3_b.jpg" asnd="beat1_c.ogg" bimg="drumkit3_b.jpg" bsnd="beat1_c.ogg" color="100" />
- <pair aimg="drumkit4_b.jpg" asnd="beat8.ogg" bimg="drumkit4_b.jpg" bsnd="beat8.ogg" color="100" />
- <pair aimg="drumkit5_b.jpg" asnd="beat10.ogg" bimg="drumkit5_b.jpg" bsnd="beat10.ogg" color="100" />
- <pair aimg="drumkit6_b.jpg" asnd="beat3.ogg" bimg="drumkit6_b.jpg" bsnd="beat3.ogg" color="100" />
- <pair aimg="drumkit7_b.jpg" asnd="beat4.ogg" bimg="drumkit7_b.jpg" bsnd="beat4.ogg" color="100" />
- <pair aimg="drumkit8_b.jpg" asnd="beat14.ogg" bimg="drumkit8_b.jpg" bsnd="beat14.ogg" color="100" />
- <pair aimg="drumkit9_b.jpg" asnd="beat6_2.ogg" bimg="drumkit9_b.jpg" bsnd="beat6_2.ogg" color="100" />
- <pair aimg="drumkit10_b.jpg" asnd="beat2.ogg" bimg="drumkit10_b.jpg" bsnd="beat2.ogg" color="100" />
- <pair aimg="drumkit11_b.jpg" asnd="beat16.ogg" bimg="drumkit11_b.jpg" bsnd="beat16.ogg" color="100" />
- <pair aimg="drumkit12_b.jpg" asnd="beat17.ogg" bimg="drumkit12_b.jpg" bsnd="beat17.ogg" color="100" />
-
- <pair aimg="guitar1_2.jpg" asnd="bending_a.ogg" bimg="guitar1_2.jpg" bsnd="bending_a.ogg" color="100" />
- <pair aimg="guitar2_2.jpg" asnd="bending_b.ogg" bimg="guitar2_2.jpg" bsnd="bending_b.ogg" color="100" />
- <pair aimg="guitar3_2.jpg" asnd="flashcomp2a.ogg" bimg="guitar3_2.jpg" bsnd="flashcomp2a.ogg" color="100" />
- <pair aimg="guitar4_2.jpg" asnd="flashcomp2b.ogg" bimg="guitar4_2.jpg" bsnd="flashcomp2b.ogg" color="100" />
- <pair aimg="guitar5_2.jpg" asnd="gedaempft.ogg" bimg="guitar5_2.jpg" bsnd="gedaempft.ogg" color="100" />
- <pair aimg="guitar6_2.jpg" asnd="ungedaempft.ogg" bimg="guitar6_2.jpg" bsnd="ungedaempft.ogg" color="100" />
- <pair aimg="guitar7_2.jpg" asnd="jimi4.ogg" bimg="guitar7_2.jpg" bsnd="jimi4.ogg" color="100" />
- <pair aimg="guitar8_2.jpg" asnd="git_hit1.ogg" bimg="guitar8_2.jpg" bsnd="git_hit1.ogg" color="100" />
- <pair aimg="guitar9_2.jpg" asnd="git_hit4.ogg" bimg="guitar9_2.jpg" bsnd="git_hit4.ogg" color="100" />
- <pair aimg="guitar10_2.jpg" asnd="jimi1.ogg" bimg="guitar10_2.jpg" bsnd="jimi1.ogg" color="100" />
- <pair aimg="guitar11_2.jpg" asnd="flasholet4.ogg" bimg="guitar11_2.jpg" bsnd="flasholet4.ogg" color="100" />
- <pair aimg="guitar12_2.jpg" asnd="guitcello.ogg" bimg="guitar12_2.jpg" bsnd="guitcello.ogg" color="100" />
-</memorize>
diff --git a/games/drumgit/images/drumkit10_b.jpg b/games/drumgit/images/drumkit10_b.jpg
deleted file mode 100755
index 9288d4c..0000000
--- a/games/drumgit/images/drumkit10_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit11_b.jpg b/games/drumgit/images/drumkit11_b.jpg
deleted file mode 100755
index cd169ce..0000000
--- a/games/drumgit/images/drumkit11_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit12_b.jpg b/games/drumgit/images/drumkit12_b.jpg
deleted file mode 100755
index f10ade8..0000000
--- a/games/drumgit/images/drumkit12_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit1_b.jpg b/games/drumgit/images/drumkit1_b.jpg
deleted file mode 100755
index 98ab27d..0000000
--- a/games/drumgit/images/drumkit1_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit2_b.jpg b/games/drumgit/images/drumkit2_b.jpg
deleted file mode 100755
index e1a7fc7..0000000
--- a/games/drumgit/images/drumkit2_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit3_b.jpg b/games/drumgit/images/drumkit3_b.jpg
deleted file mode 100755
index 3a75f41..0000000
--- a/games/drumgit/images/drumkit3_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit4_b.jpg b/games/drumgit/images/drumkit4_b.jpg
deleted file mode 100755
index a4c5b97..0000000
--- a/games/drumgit/images/drumkit4_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit5_b.jpg b/games/drumgit/images/drumkit5_b.jpg
deleted file mode 100755
index 063ef59..0000000
--- a/games/drumgit/images/drumkit5_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit6_b.jpg b/games/drumgit/images/drumkit6_b.jpg
deleted file mode 100755
index 991edd8..0000000
--- a/games/drumgit/images/drumkit6_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit7_b.jpg b/games/drumgit/images/drumkit7_b.jpg
deleted file mode 100755
index 4f993e7..0000000
--- a/games/drumgit/images/drumkit7_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit8_b.jpg b/games/drumgit/images/drumkit8_b.jpg
deleted file mode 100755
index dfdd67c..0000000
--- a/games/drumgit/images/drumkit8_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/drumkit9_b.jpg b/games/drumgit/images/drumkit9_b.jpg
deleted file mode 100755
index 16197e4..0000000
--- a/games/drumgit/images/drumkit9_b.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar10_2.jpg b/games/drumgit/images/guitar10_2.jpg
deleted file mode 100755
index cc1f29b..0000000
--- a/games/drumgit/images/guitar10_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar11_2.jpg b/games/drumgit/images/guitar11_2.jpg
deleted file mode 100755
index a738ef2..0000000
--- a/games/drumgit/images/guitar11_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar12_2.jpg b/games/drumgit/images/guitar12_2.jpg
deleted file mode 100755
index 2998cfe..0000000
--- a/games/drumgit/images/guitar12_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar1_2.jpg b/games/drumgit/images/guitar1_2.jpg
deleted file mode 100755
index 89dbd7c..0000000
--- a/games/drumgit/images/guitar1_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar2_2.jpg b/games/drumgit/images/guitar2_2.jpg
deleted file mode 100755
index 6766232..0000000
--- a/games/drumgit/images/guitar2_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar3_2.jpg b/games/drumgit/images/guitar3_2.jpg
deleted file mode 100755
index 3cf7431..0000000
--- a/games/drumgit/images/guitar3_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar4_2.jpg b/games/drumgit/images/guitar4_2.jpg
deleted file mode 100755
index ea12232..0000000
--- a/games/drumgit/images/guitar4_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar5_2.jpg b/games/drumgit/images/guitar5_2.jpg
deleted file mode 100755
index a5cec0d..0000000
--- a/games/drumgit/images/guitar5_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar6_2.jpg b/games/drumgit/images/guitar6_2.jpg
deleted file mode 100755
index 6212245..0000000
--- a/games/drumgit/images/guitar6_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar7_2.jpg b/games/drumgit/images/guitar7_2.jpg
deleted file mode 100755
index 356a90f..0000000
--- a/games/drumgit/images/guitar7_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar8_2.jpg b/games/drumgit/images/guitar8_2.jpg
deleted file mode 100755
index 2b33f99..0000000
--- a/games/drumgit/images/guitar8_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/guitar9_2.jpg b/games/drumgit/images/guitar9_2.jpg
deleted file mode 100755
index 691423d..0000000
--- a/games/drumgit/images/guitar9_2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/images/reference b/games/drumgit/images/reference
deleted file mode 100644
index 79ce4c4..0000000
--- a/games/drumgit/images/reference
+++ /dev/null
@@ -1,18 +0,0 @@
-The guitar pictures are distributed under the Creative Commons Attribution ShareAlike 2.0 Germany License since they derive of the following work:
-
-guitar:
- creator: Martin Moeller
- name: Classical_Guitar_two_views
- licence: Creative Commons Attribution ShareAlike 2.0 Germany License
- (http://creativecommons.org/licenses/by-sa/2.0/de/)
- link: http://de.wikipedia.org/wiki/Bild:Classical_Guitar_two_views.jpg
-
-
-The drumkit pictures are distributed under the GNU Free Documentation License since they derive of the following work:
-
-drumkit:
- creator: Clngre
- name: Illustration of a drum kit for "drum kit component"
- licence: GNU-Lizenz für freie Dokumentation
- (http://commons.wikimedia.org/wiki/Commons:GNU_Free_Documentation_License)
- found at: http://de.wikipedia.org/wiki/Bild:Drum_kit_illustration_template.png \ No newline at end of file
diff --git a/games/drumgit/sounds/beat10.ogg b/games/drumgit/sounds/beat10.ogg
deleted file mode 100755
index 8539dbd..0000000
--- a/games/drumgit/sounds/beat10.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat14.ogg b/games/drumgit/sounds/beat14.ogg
deleted file mode 100755
index 5356ad0..0000000
--- a/games/drumgit/sounds/beat14.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat16.ogg b/games/drumgit/sounds/beat16.ogg
deleted file mode 100755
index 63578ea..0000000
--- a/games/drumgit/sounds/beat16.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat17.ogg b/games/drumgit/sounds/beat17.ogg
deleted file mode 100755
index 6f07ce1..0000000
--- a/games/drumgit/sounds/beat17.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat1_a.ogg b/games/drumgit/sounds/beat1_a.ogg
deleted file mode 100755
index 52f5ad4..0000000
--- a/games/drumgit/sounds/beat1_a.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat1_b.ogg b/games/drumgit/sounds/beat1_b.ogg
deleted file mode 100755
index 972fed2..0000000
--- a/games/drumgit/sounds/beat1_b.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat1_c.ogg b/games/drumgit/sounds/beat1_c.ogg
deleted file mode 100755
index 0256d07..0000000
--- a/games/drumgit/sounds/beat1_c.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat2.ogg b/games/drumgit/sounds/beat2.ogg
deleted file mode 100755
index c8a5406..0000000
--- a/games/drumgit/sounds/beat2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat3.ogg b/games/drumgit/sounds/beat3.ogg
deleted file mode 100755
index 61483ff..0000000
--- a/games/drumgit/sounds/beat3.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat4.ogg b/games/drumgit/sounds/beat4.ogg
deleted file mode 100755
index 19f00fd..0000000
--- a/games/drumgit/sounds/beat4.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat6_2.ogg b/games/drumgit/sounds/beat6_2.ogg
deleted file mode 100755
index d6021f9..0000000
--- a/games/drumgit/sounds/beat6_2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/beat8.ogg b/games/drumgit/sounds/beat8.ogg
deleted file mode 100755
index 0266665..0000000
--- a/games/drumgit/sounds/beat8.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/bending_a.ogg b/games/drumgit/sounds/bending_a.ogg
deleted file mode 100755
index c30c44d..0000000
--- a/games/drumgit/sounds/bending_a.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/bending_b.ogg b/games/drumgit/sounds/bending_b.ogg
deleted file mode 100755
index a3ba1b1..0000000
--- a/games/drumgit/sounds/bending_b.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/flashcomp2a.ogg b/games/drumgit/sounds/flashcomp2a.ogg
deleted file mode 100755
index 4814311..0000000
--- a/games/drumgit/sounds/flashcomp2a.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/flashcomp2b.ogg b/games/drumgit/sounds/flashcomp2b.ogg
deleted file mode 100755
index eb9457f..0000000
--- a/games/drumgit/sounds/flashcomp2b.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/flasholet4.ogg b/games/drumgit/sounds/flasholet4.ogg
deleted file mode 100755
index 4662472..0000000
--- a/games/drumgit/sounds/flasholet4.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/gedaempft.ogg b/games/drumgit/sounds/gedaempft.ogg
deleted file mode 100755
index 9ce892b..0000000
--- a/games/drumgit/sounds/gedaempft.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/git_hit1.ogg b/games/drumgit/sounds/git_hit1.ogg
deleted file mode 100755
index 3fa6f03..0000000
--- a/games/drumgit/sounds/git_hit1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/git_hit4.ogg b/games/drumgit/sounds/git_hit4.ogg
deleted file mode 100755
index 9b9840f..0000000
--- a/games/drumgit/sounds/git_hit4.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/guitcello.ogg b/games/drumgit/sounds/guitcello.ogg
deleted file mode 100755
index 4ae7217..0000000
--- a/games/drumgit/sounds/guitcello.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/jimi1.ogg b/games/drumgit/sounds/jimi1.ogg
deleted file mode 100755
index 7866ebd..0000000
--- a/games/drumgit/sounds/jimi1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/jimi4.ogg b/games/drumgit/sounds/jimi4.ogg
deleted file mode 100755
index f3fd1f0..0000000
--- a/games/drumgit/sounds/jimi4.ogg
+++ /dev/null
Binary files differ
diff --git a/games/drumgit/sounds/ungedaempft.ogg b/games/drumgit/sounds/ungedaempft.ogg
deleted file mode 100755
index dad403e..0000000
--- a/games/drumgit/sounds/ungedaempft.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/letters.mem b/games/letters/letters.mem
deleted file mode 100755
index 2e7ac99..0000000
--- a/games/letters/letters.mem
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<memorize name="letters" scoresnd="score.wav" winsnd="win.wav" divided="1" face1="1" face2="2" >
-
- <pair achar="A" asnd="a.ogg" bchar="a" bsnd="a.ogg"/>
- <pair achar="E" asnd="e.ogg" bchar="e" bsnd="e.ogg"/>
- <pair achar="I" asnd="i.ogg" bchar="i" bsnd="i.ogg"/>
- <pair achar="O" asnd="o.ogg" bchar="o" bsnd="o.ogg"/>
- <pair achar="U" asnd="u.ogg" bchar="u" bsnd="u.ogg"/>
- <pair achar="B" asnd="b.ogg" bchar="b" bsnd="b.ogg"/>
- <pair achar="C" asnd="c.ogg" bchar="c" bsnd="c.ogg"/>
- <pair achar="D" asnd="d.ogg" bchar="d" bsnd="d.ogg"/>
- <pair achar="F" asnd="f.ogg" bchar="f" bsnd="f.ogg"/>
- <pair achar="G" asnd="g.ogg" bchar="g" bsnd="g.ogg"/>
- <pair achar="H" asnd="h.ogg" bchar="h" bsnd="h.ogg"/>
- <pair achar="J" asnd="j.ogg" bchar="j" bsnd="j.ogg"/>
- <pair achar="K" asnd="k.ogg" bchar="k" bsnd="k.ogg"/>
- <pair achar="L" asnd="l.ogg" bchar="l" bsnd="l.ogg"/>
- <pair achar="M" asnd="m.ogg" bchar="m" bsnd="m.ogg"/>
- <pair achar="N" asnd="n.ogg" bchar="n" bsnd="n.ogg"/>
- <pair achar="P" asnd="p.ogg" bchar="p" bsnd="p.ogg"/>
- <pair achar="Q" asnd="q.ogg" bchar="q" bsnd="q.ogg"/>
- <pair achar="R" asnd="r.ogg" bchar="r" bsnd="r.ogg" />
- <pair achar="S" asnd="s.ogg" bchar="s" bsnd="s.ogg" />
- <pair achar="T" asnd="t.ogg" bchar="t" bsnd="t.ogg" />
- <pair achar="V" asnd="v.ogg" bchar="v" bsnd="v.ogg" />
- <pair achar="W" asnd="w.ogg" bchar="w" bsnd="w.ogg" />
- <pair achar="X" asnd="x.ogg" bchar="x" bsnd="x.ogg" />
- <pair achar="Y" asnd="y.ogg" bchar="y" bsnd="y.ogg" />
- <pair achar="Z" asnd="z.ogg" bchar="z" bsnd="z.ogg" />
-
-</memorize>
diff --git a/games/letters/sounds/a.ogg b/games/letters/sounds/a.ogg
deleted file mode 100644
index e56a27c..0000000
--- a/games/letters/sounds/a.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/b.ogg b/games/letters/sounds/b.ogg
deleted file mode 100644
index ebb0b0c..0000000
--- a/games/letters/sounds/b.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/c.ogg b/games/letters/sounds/c.ogg
deleted file mode 100644
index 237a564..0000000
--- a/games/letters/sounds/c.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/d.ogg b/games/letters/sounds/d.ogg
deleted file mode 100644
index 73eea5b..0000000
--- a/games/letters/sounds/d.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/e.ogg b/games/letters/sounds/e.ogg
deleted file mode 100644
index d08f166..0000000
--- a/games/letters/sounds/e.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/f.ogg b/games/letters/sounds/f.ogg
deleted file mode 100644
index 3552848..0000000
--- a/games/letters/sounds/f.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/g.ogg b/games/letters/sounds/g.ogg
deleted file mode 100644
index d3515e4..0000000
--- a/games/letters/sounds/g.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/h.ogg b/games/letters/sounds/h.ogg
deleted file mode 100644
index d87d7e2..0000000
--- a/games/letters/sounds/h.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/i.ogg b/games/letters/sounds/i.ogg
deleted file mode 100644
index 1428e96..0000000
--- a/games/letters/sounds/i.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/j.ogg b/games/letters/sounds/j.ogg
deleted file mode 100644
index 02a285e..0000000
--- a/games/letters/sounds/j.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/k.ogg b/games/letters/sounds/k.ogg
deleted file mode 100644
index 2079f22..0000000
--- a/games/letters/sounds/k.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/l.ogg b/games/letters/sounds/l.ogg
deleted file mode 100644
index c8569ee..0000000
--- a/games/letters/sounds/l.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/m.ogg b/games/letters/sounds/m.ogg
deleted file mode 100644
index 7b8a553..0000000
--- a/games/letters/sounds/m.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/n.ogg b/games/letters/sounds/n.ogg
deleted file mode 100644
index bfd48a0..0000000
--- a/games/letters/sounds/n.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/o.ogg b/games/letters/sounds/o.ogg
deleted file mode 100644
index 74b48e4..0000000
--- a/games/letters/sounds/o.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/p.ogg b/games/letters/sounds/p.ogg
deleted file mode 100644
index eccd963..0000000
--- a/games/letters/sounds/p.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/q.ogg b/games/letters/sounds/q.ogg
deleted file mode 100644
index e991c5f..0000000
--- a/games/letters/sounds/q.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/r.ogg b/games/letters/sounds/r.ogg
deleted file mode 100755
index 66d805e..0000000
--- a/games/letters/sounds/r.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/s.ogg b/games/letters/sounds/s.ogg
deleted file mode 100755
index 640c2c7..0000000
--- a/games/letters/sounds/s.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/t.ogg b/games/letters/sounds/t.ogg
deleted file mode 100755
index 6dc8fd5..0000000
--- a/games/letters/sounds/t.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/u.ogg b/games/letters/sounds/u.ogg
deleted file mode 100644
index 8f00984..0000000
--- a/games/letters/sounds/u.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/v.ogg b/games/letters/sounds/v.ogg
deleted file mode 100755
index ce5796e..0000000
--- a/games/letters/sounds/v.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/w.ogg b/games/letters/sounds/w.ogg
deleted file mode 100755
index 95254b9..0000000
--- a/games/letters/sounds/w.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/x.ogg b/games/letters/sounds/x.ogg
deleted file mode 100755
index 09ed36a..0000000
--- a/games/letters/sounds/x.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/y.ogg b/games/letters/sounds/y.ogg
deleted file mode 100755
index c1647e7..0000000
--- a/games/letters/sounds/y.ogg
+++ /dev/null
Binary files differ
diff --git a/games/letters/sounds/z.ogg b/games/letters/sounds/z.ogg
deleted file mode 100755
index c74771f..0000000
--- a/games/letters/sounds/z.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/01x.jpg b/games/numbers/images/01x.jpg
deleted file mode 100755
index 4b8b35a..0000000
--- a/games/numbers/images/01x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/02x.jpg b/games/numbers/images/02x.jpg
deleted file mode 100755
index bfd6f1b..0000000
--- a/games/numbers/images/02x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/03x.jpg b/games/numbers/images/03x.jpg
deleted file mode 100755
index 44329a2..0000000
--- a/games/numbers/images/03x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/04x.jpg b/games/numbers/images/04x.jpg
deleted file mode 100755
index 63c1d8f..0000000
--- a/games/numbers/images/04x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/05x.jpg b/games/numbers/images/05x.jpg
deleted file mode 100755
index 0e0df29..0000000
--- a/games/numbers/images/05x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/06x.jpg b/games/numbers/images/06x.jpg
deleted file mode 100755
index be5b5cf..0000000
--- a/games/numbers/images/06x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/07x.jpg b/games/numbers/images/07x.jpg
deleted file mode 100755
index 17f09bb..0000000
--- a/games/numbers/images/07x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/08x.jpg b/games/numbers/images/08x.jpg
deleted file mode 100755
index 8ce3123..0000000
--- a/games/numbers/images/08x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/09x.jpg b/games/numbers/images/09x.jpg
deleted file mode 100755
index 5120b45..0000000
--- a/games/numbers/images/09x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/10x.jpg b/games/numbers/images/10x.jpg
deleted file mode 100755
index 866446f..0000000
--- a/games/numbers/images/10x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/11x.jpg b/games/numbers/images/11x.jpg
deleted file mode 100755
index 93a949c..0000000
--- a/games/numbers/images/11x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/12x.jpg b/games/numbers/images/12x.jpg
deleted file mode 100755
index 1e4bf75..0000000
--- a/games/numbers/images/12x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/13x.jpg b/games/numbers/images/13x.jpg
deleted file mode 100755
index 708f705..0000000
--- a/games/numbers/images/13x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/14x.jpg b/games/numbers/images/14x.jpg
deleted file mode 100755
index 9ea6403..0000000
--- a/games/numbers/images/14x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/15x.jpg b/games/numbers/images/15x.jpg
deleted file mode 100755
index 7a57cf8..0000000
--- a/games/numbers/images/15x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/16x.jpg b/games/numbers/images/16x.jpg
deleted file mode 100644
index ed089e1..0000000
--- a/games/numbers/images/16x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/17x.jpg b/games/numbers/images/17x.jpg
deleted file mode 100644
index 347f929..0000000
--- a/games/numbers/images/17x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/images/18x.jpg b/games/numbers/images/18x.jpg
deleted file mode 100644
index 0633155..0000000
--- a/games/numbers/images/18x.jpg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/numbers.mem b/games/numbers/numbers.mem
deleted file mode 100755
index 2fe7811..0000000
--- a/games/numbers/numbers.mem
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<memorize name="numbers" scoresnd="score.wav" winsnd="win.wav" divided="1" face1="1" face2="2" >
-
- <pair achar="1" asnd="01.ogg" bimg="01x.jpg" bsnd="01.ogg" />
- <pair achar="2" asnd="02.ogg" bimg="02x.jpg" bsnd="02.ogg" />
- <pair achar="3" asnd="03.ogg" bimg="03x.jpg" bsnd="03.ogg" />
- <pair achar="4" asnd="04.ogg" bimg="04x.jpg" bsnd="04.ogg" />
- <pair achar="5" asnd="05.ogg" bimg="05x.jpg" bsnd="05.ogg" />
- <pair achar="6" asnd="06.ogg" bimg="06x.jpg" bsnd="06.ogg" />
- <pair achar="7" asnd="07.ogg" bimg="07x.jpg" bsnd="07.ogg" />
- <pair achar="8" asnd="08.ogg" bimg="08x.jpg" bsnd="08.ogg" />
- <pair achar="9" asnd="09.ogg" bimg="09x.jpg" bsnd="09.ogg" />
- <pair achar="10" asnd="10.ogg" bimg="10x.jpg" bsnd="10.ogg" />
- <pair achar="11" asnd="11.ogg" bimg="11x.jpg" bsnd="11.ogg" />
- <pair achar="12" asnd="12.ogg" bimg="12x.jpg" bsnd="12.ogg" />
- <pair achar="13" asnd="13.ogg" bimg="13x.jpg" bsnd="13.ogg" />
- <pair achar="14" asnd="14.ogg" bimg="14x.jpg" bsnd="14.ogg" />
- <pair achar="15" asnd="15.ogg" bimg="15x.jpg" bsnd="15.ogg" />
- <pair achar="16" asnd="16.ogg" bimg="16x.jpg" bsnd="16.ogg" />
- <pair achar="17" asnd="17.ogg" bimg="17x.jpg" bsnd="17.ogg" />
- <pair achar="18" asnd="18.ogg" bimg="18x.jpg" bsnd="18.ogg" />
-</memorize>
-
diff --git a/games/numbers/sounds/01.ogg b/games/numbers/sounds/01.ogg
deleted file mode 100644
index 6f3632c..0000000
--- a/games/numbers/sounds/01.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/02.ogg b/games/numbers/sounds/02.ogg
deleted file mode 100644
index 8cd5d55..0000000
--- a/games/numbers/sounds/02.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/03.ogg b/games/numbers/sounds/03.ogg
deleted file mode 100644
index 5c9c78b..0000000
--- a/games/numbers/sounds/03.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/04.ogg b/games/numbers/sounds/04.ogg
deleted file mode 100644
index bc6d9be..0000000
--- a/games/numbers/sounds/04.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/05.ogg b/games/numbers/sounds/05.ogg
deleted file mode 100644
index dbcb4b4..0000000
--- a/games/numbers/sounds/05.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/06.ogg b/games/numbers/sounds/06.ogg
deleted file mode 100644
index d5f8d39..0000000
--- a/games/numbers/sounds/06.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/07.ogg b/games/numbers/sounds/07.ogg
deleted file mode 100644
index 050754c..0000000
--- a/games/numbers/sounds/07.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/08.ogg b/games/numbers/sounds/08.ogg
deleted file mode 100644
index b2d0946..0000000
--- a/games/numbers/sounds/08.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/09.ogg b/games/numbers/sounds/09.ogg
deleted file mode 100644
index 3302c03..0000000
--- a/games/numbers/sounds/09.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/10.ogg b/games/numbers/sounds/10.ogg
deleted file mode 100644
index b28e724..0000000
--- a/games/numbers/sounds/10.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/11.ogg b/games/numbers/sounds/11.ogg
deleted file mode 100644
index ce89998..0000000
--- a/games/numbers/sounds/11.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/12.ogg b/games/numbers/sounds/12.ogg
deleted file mode 100644
index 1f09abd..0000000
--- a/games/numbers/sounds/12.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/13.ogg b/games/numbers/sounds/13.ogg
deleted file mode 100644
index fbdf4ce..0000000
--- a/games/numbers/sounds/13.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/14.ogg b/games/numbers/sounds/14.ogg
deleted file mode 100644
index 9f7efe5..0000000
--- a/games/numbers/sounds/14.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/15.ogg b/games/numbers/sounds/15.ogg
deleted file mode 100644
index 3ca52ef..0000000
--- a/games/numbers/sounds/15.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/16.ogg b/games/numbers/sounds/16.ogg
deleted file mode 100644
index 432e5d2..0000000
--- a/games/numbers/sounds/16.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/17.ogg b/games/numbers/sounds/17.ogg
deleted file mode 100644
index b3d950d..0000000
--- a/games/numbers/sounds/17.ogg
+++ /dev/null
Binary files differ
diff --git a/games/numbers/sounds/18.ogg b/games/numbers/sounds/18.ogg
deleted file mode 100644
index 7555479..0000000
--- a/games/numbers/sounds/18.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/agua1.jpg b/games/phonemes/images/agua1.jpg
deleted file mode 100755
index 3175d47..0000000
--- a/games/phonemes/images/agua1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/agua2.jpg b/games/phonemes/images/agua2.jpg
deleted file mode 100755
index e680fc1..0000000
--- a/games/phonemes/images/agua2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/bola1.jpg b/games/phonemes/images/bola1.jpg
deleted file mode 100755
index 8cb1e53..0000000
--- a/games/phonemes/images/bola1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/bola2.jpg b/games/phonemes/images/bola2.jpg
deleted file mode 100755
index 1531c51..0000000
--- a/games/phonemes/images/bola2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/cama1.jpg b/games/phonemes/images/cama1.jpg
deleted file mode 100644
index 4269b77..0000000
--- a/games/phonemes/images/cama1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/cama2.jpg b/games/phonemes/images/cama2.jpg
deleted file mode 100644
index f0017b2..0000000
--- a/games/phonemes/images/cama2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/casa1.jpg b/games/phonemes/images/casa1.jpg
deleted file mode 100755
index 628fab9..0000000
--- a/games/phonemes/images/casa1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/casa2.jpg b/games/phonemes/images/casa2.jpg
deleted file mode 100755
index 40892d9..0000000
--- a/games/phonemes/images/casa2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/ema1.jpg b/games/phonemes/images/ema1.jpg
deleted file mode 100755
index 64c6706..0000000
--- a/games/phonemes/images/ema1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/ema2.jpg b/games/phonemes/images/ema2.jpg
deleted file mode 100755
index 3e20812..0000000
--- a/games/phonemes/images/ema2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/frutas1.jpg b/games/phonemes/images/frutas1.jpg
deleted file mode 100755
index 925d8e8..0000000
--- a/games/phonemes/images/frutas1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/frutas2.jpg b/games/phonemes/images/frutas2.jpg
deleted file mode 100755
index a7a178c..0000000
--- a/games/phonemes/images/frutas2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/homem1.jpg b/games/phonemes/images/homem1.jpg
deleted file mode 100755
index b08e612..0000000
--- a/games/phonemes/images/homem1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/homem2.jpg b/games/phonemes/images/homem2.jpg
deleted file mode 100755
index 0d3d5e1..0000000
--- a/games/phonemes/images/homem2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/ioio1.jpg b/games/phonemes/images/ioio1.jpg
deleted file mode 100755
index aa3ba6d..0000000
--- a/games/phonemes/images/ioio1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/ioio2.jpg b/games/phonemes/images/ioio2.jpg
deleted file mode 100755
index d339f6a..0000000
--- a/games/phonemes/images/ioio2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/kiwi1.jpg b/games/phonemes/images/kiwi1.jpg
deleted file mode 100755
index cd9e24d..0000000
--- a/games/phonemes/images/kiwi1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/kiwi2.jpg b/games/phonemes/images/kiwi2.jpg
deleted file mode 100755
index 7c7250b..0000000
--- a/games/phonemes/images/kiwi2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/livro1.jpg b/games/phonemes/images/livro1.jpg
deleted file mode 100644
index 78237d3..0000000
--- a/games/phonemes/images/livro1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/livro2.jpg b/games/phonemes/images/livro2.jpg
deleted file mode 100644
index 3a242c0..0000000
--- a/games/phonemes/images/livro2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/ovo1.jpg b/games/phonemes/images/ovo1.jpg
deleted file mode 100755
index fc83ec4..0000000
--- a/games/phonemes/images/ovo1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/ovo2.jpg b/games/phonemes/images/ovo2.jpg
deleted file mode 100755
index 8876749..0000000
--- a/games/phonemes/images/ovo2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/peixe1.jpg b/games/phonemes/images/peixe1.jpg
deleted file mode 100755
index 0e7c1d0..0000000
--- a/games/phonemes/images/peixe1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/peixe2.jpg b/games/phonemes/images/peixe2.jpg
deleted file mode 100755
index daab513..0000000
--- a/games/phonemes/images/peixe2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/porco1.jpg b/games/phonemes/images/porco1.jpg
deleted file mode 100644
index b22911a..0000000
--- a/games/phonemes/images/porco1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/porco2.jpg b/games/phonemes/images/porco2.jpg
deleted file mode 100644
index 2f3b728..0000000
--- a/games/phonemes/images/porco2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/queijo1.jpg b/games/phonemes/images/queijo1.jpg
deleted file mode 100755
index e23c8c2..0000000
--- a/games/phonemes/images/queijo1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/queijo2.jpg b/games/phonemes/images/queijo2.jpg
deleted file mode 100755
index ed744b8..0000000
--- a/games/phonemes/images/queijo2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/roda1.jpg b/games/phonemes/images/roda1.jpg
deleted file mode 100755
index 8df6d11..0000000
--- a/games/phonemes/images/roda1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/roda2.jpg b/games/phonemes/images/roda2.jpg
deleted file mode 100755
index d9a213e..0000000
--- a/games/phonemes/images/roda2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/sapo1.jpg b/games/phonemes/images/sapo1.jpg
deleted file mode 100755
index 4409d47..0000000
--- a/games/phonemes/images/sapo1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/sapo2.jpg b/games/phonemes/images/sapo2.jpg
deleted file mode 100755
index 632fb6a..0000000
--- a/games/phonemes/images/sapo2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/uva1.jpg b/games/phonemes/images/uva1.jpg
deleted file mode 100755
index b4f702c..0000000
--- a/games/phonemes/images/uva1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/uva2.jpg b/games/phonemes/images/uva2.jpg
deleted file mode 100755
index c0242f5..0000000
--- a/games/phonemes/images/uva2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/zebra1.jpg b/games/phonemes/images/zebra1.jpg
deleted file mode 100755
index 46d2516..0000000
--- a/games/phonemes/images/zebra1.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/images/zebra2.jpg b/games/phonemes/images/zebra2.jpg
deleted file mode 100755
index 6002fd8..0000000
--- a/games/phonemes/images/zebra2.jpg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/phonemes.mem b/games/phonemes/phonemes.mem
deleted file mode 100755
index 1ef8a1e..0000000
--- a/games/phonemes/phonemes.mem
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<memorize name="phonemes" scoresnd="score.wav" winsnd="win.wav" divided="1" face1="1" face2="2" >
-
- <pair aimg="agua1.jpg" asnd="agua1.ogg" bimg="agua2.jpg" bsnd="agua2.ogg" />
- <pair aimg="bola1.jpg" asnd="bola1.ogg" bimg="bola2.jpg" bsnd="bola2.ogg" />
- <pair aimg="cama1.jpg" asnd="cama1.ogg" bimg="cama2.jpg" bsnd="cama2.ogg" />
- <pair aimg="casa1.jpg" asnd="casa1.ogg" bimg="casa2.jpg" bsnd="casa2.ogg" />
- <pair aimg="ema1.jpg" asnd="ema1.ogg" bimg="ema2.jpg" bsnd="ema2.ogg" />
- <pair aimg="frutas1.jpg" asnd="frutas1.ogg" bimg="frutas2.jpg" bsnd="frutas2.ogg" />
- <pair aimg="homem1.jpg" asnd="homem1.ogg" bimg="homem2.jpg" bsnd="homem2.ogg" />
- <pair aimg="ioio1.jpg" asnd="ioio1.ogg" bimg="ioio2.jpg" bsnd="ioio2.ogg" />
- <pair aimg="kiwi1.jpg" asnd="kiwi1.ogg" bimg="kiwi2.jpg" bsnd="kiwi2.ogg" />
- <pair aimg="livro1.jpg" asnd="livro1.ogg" bimg="livro2.jpg" bsnd="livro2.ogg" />
- <pair aimg="ovo1.jpg" asnd="ovo1.ogg" bimg="ovo2.jpg" bsnd="ovo2.ogg" />
- <pair aimg="peixe1.jpg" asnd="peixe1.ogg" bimg="peixe2.jpg" bsnd="peixe2.ogg" />
- <pair aimg="porco1.jpg" asnd="porco1.ogg" bimg="porco2.jpg" bsnd="porco2.ogg"/>
- <pair aimg="queijo1.jpg" asnd="queijo1.ogg" bimg="queijo2.jpg" bsnd="queijo2.ogg" />
- <pair aimg="roda1.jpg" asnd="roda1.ogg" bimg="roda2.jpg" bsnd="roda2.ogg" />
- <pair aimg="sapo1.jpg" asnd="sapo1.ogg" bimg="sapo2.jpg" bsnd="sapo2.ogg" />
- <pair aimg="uva1.jpg" asnd="uva1.ogg" bimg="uva2.jpg" bsnd="uva2.ogg" />
- <pair aimg="zebra1.jpg" asnd="zebra1.ogg" bimg="zebra2.jpg" bsnd="zebra2.ogg" />
-
-</memorize>
-
-<!--
-1,agua1.jpg,agua1.wav,,,,,Á_ _ _,2,agua2.jpg,agua2.wav,,,,,_GUA
-1,bola1.jpg,bola1.wav,,,,,BO_ _,2,bola2.jpg,bola2.wav,,,,,_ _LA
-1,casa1.jpg,casa1.wav,,,,,CA_ _,2,casa2.jpg,casa2.wav,,,,,_ _SA
-1,ema1.jpg,ema1.wav,,,,,E_ _,2,ema2.jpg,ema2.wav,,,,,_MA
-1,frutas1.jpg,frutas1.wav,,,,,FRU_ _ _,2,frutas2.jpg,frutas2.wav,,,,,_ _ _TAS
-1,homem1.jpg,homem1.wav,,,,,HO_ _ _,2,homem2.jpg,homem2.wav,,,,,_ _MEM
-1,ioio1.jpg,ioio1.wav,,,,,IO_ _,2,ioio2.jpg,ioio2.wav,,,,,_ _IO
-1,kiwi1.jpg,kiwi1.wav,,,,,KI_ _,2,kiwi2.jpg,kiwi2.wav,,,,,_ _WI
-1,ovo1.jpg,ovo1.wav,,,,,O_ _,2,ovo2.jpg,ovo2.wav,,,,,_VO
-1,peixe1.jpg,peixe1.wav,,,,,PEI_ _,2,peixe2.jpg,peixe2.wav,,,,,_ _ _XE
-1,queijo1.jpg,queijo1.wav,,,,,QUEI_ _,2,queijo2.jpg,queijo2.wav,,,,,_ _ _ _JO
-1,roda1.jpg,roda1.wav,,,,,RO_ _,2,roda2.jpg,roda2.wav,,,,,_ _DA
-1,sapo1.jpg,sapo1.wav,,,,,SA_ _,2,sapo2.jpg,sapo2.wav,,,,,_ _PO
-1,uva1.jpg,uva1.wav,,,,,U_ _,2,uva2.jpg,uva2.wav,,,,,_VA
-1,zebra1.jpg,zebra1.wav,,,,,ZE_ _ _,2,zebra2.jpg,zebra2.wav,,,,,_ _BRA
--->
diff --git a/games/phonemes/sounds/agua1.ogg b/games/phonemes/sounds/agua1.ogg
deleted file mode 100644
index 6feb745..0000000
--- a/games/phonemes/sounds/agua1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/agua2.ogg b/games/phonemes/sounds/agua2.ogg
deleted file mode 100644
index c01a10f..0000000
--- a/games/phonemes/sounds/agua2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/bola1.ogg b/games/phonemes/sounds/bola1.ogg
deleted file mode 100644
index 646c48c..0000000
--- a/games/phonemes/sounds/bola1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/bola2.ogg b/games/phonemes/sounds/bola2.ogg
deleted file mode 100644
index de29e6c..0000000
--- a/games/phonemes/sounds/bola2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/cama1.ogg b/games/phonemes/sounds/cama1.ogg
deleted file mode 100644
index 6cfb1d8..0000000
--- a/games/phonemes/sounds/cama1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/cama2.ogg b/games/phonemes/sounds/cama2.ogg
deleted file mode 100644
index 8a2a2c1..0000000
--- a/games/phonemes/sounds/cama2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/casa1.ogg b/games/phonemes/sounds/casa1.ogg
deleted file mode 100644
index b371208..0000000
--- a/games/phonemes/sounds/casa1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/casa2.ogg b/games/phonemes/sounds/casa2.ogg
deleted file mode 100644
index c288e2a..0000000
--- a/games/phonemes/sounds/casa2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/ema1.ogg b/games/phonemes/sounds/ema1.ogg
deleted file mode 100644
index 0f93bd4..0000000
--- a/games/phonemes/sounds/ema1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/ema2.ogg b/games/phonemes/sounds/ema2.ogg
deleted file mode 100644
index 44c60bc..0000000
--- a/games/phonemes/sounds/ema2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/frutas1.ogg b/games/phonemes/sounds/frutas1.ogg
deleted file mode 100644
index 5c2097a..0000000
--- a/games/phonemes/sounds/frutas1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/frutas2.ogg b/games/phonemes/sounds/frutas2.ogg
deleted file mode 100644
index 3b5bc98..0000000
--- a/games/phonemes/sounds/frutas2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/homem1.ogg b/games/phonemes/sounds/homem1.ogg
deleted file mode 100644
index 62402c4..0000000
--- a/games/phonemes/sounds/homem1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/homem2.ogg b/games/phonemes/sounds/homem2.ogg
deleted file mode 100644
index bac8306..0000000
--- a/games/phonemes/sounds/homem2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/ioio1.ogg b/games/phonemes/sounds/ioio1.ogg
deleted file mode 100644
index 151535e..0000000
--- a/games/phonemes/sounds/ioio1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/ioio2.ogg b/games/phonemes/sounds/ioio2.ogg
deleted file mode 100644
index c8f2799..0000000
--- a/games/phonemes/sounds/ioio2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/kiwi1.ogg b/games/phonemes/sounds/kiwi1.ogg
deleted file mode 100644
index 6421524..0000000
--- a/games/phonemes/sounds/kiwi1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/kiwi2.ogg b/games/phonemes/sounds/kiwi2.ogg
deleted file mode 100644
index 6e643c9..0000000
--- a/games/phonemes/sounds/kiwi2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/livro1.ogg b/games/phonemes/sounds/livro1.ogg
deleted file mode 100644
index 7cc136d..0000000
--- a/games/phonemes/sounds/livro1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/livro2.ogg b/games/phonemes/sounds/livro2.ogg
deleted file mode 100644
index 4f53cbf..0000000
--- a/games/phonemes/sounds/livro2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/ovo1.ogg b/games/phonemes/sounds/ovo1.ogg
deleted file mode 100644
index 763bd6a..0000000
--- a/games/phonemes/sounds/ovo1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/ovo2.ogg b/games/phonemes/sounds/ovo2.ogg
deleted file mode 100644
index c3ffb0f..0000000
--- a/games/phonemes/sounds/ovo2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/peixe1.ogg b/games/phonemes/sounds/peixe1.ogg
deleted file mode 100644
index fea7689..0000000
--- a/games/phonemes/sounds/peixe1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/peixe2.ogg b/games/phonemes/sounds/peixe2.ogg
deleted file mode 100644
index 6671484..0000000
--- a/games/phonemes/sounds/peixe2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/porco1.ogg b/games/phonemes/sounds/porco1.ogg
deleted file mode 100644
index 96280d3..0000000
--- a/games/phonemes/sounds/porco1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/porco2.ogg b/games/phonemes/sounds/porco2.ogg
deleted file mode 100644
index 3520b59..0000000
--- a/games/phonemes/sounds/porco2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/queijo1.ogg b/games/phonemes/sounds/queijo1.ogg
deleted file mode 100644
index daef7d3..0000000
--- a/games/phonemes/sounds/queijo1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/queijo2.ogg b/games/phonemes/sounds/queijo2.ogg
deleted file mode 100644
index 3699851..0000000
--- a/games/phonemes/sounds/queijo2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/roda1.ogg b/games/phonemes/sounds/roda1.ogg
deleted file mode 100644
index 6e238e9..0000000
--- a/games/phonemes/sounds/roda1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/roda2.ogg b/games/phonemes/sounds/roda2.ogg
deleted file mode 100644
index af478fb..0000000
--- a/games/phonemes/sounds/roda2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/sapo1.ogg b/games/phonemes/sounds/sapo1.ogg
deleted file mode 100644
index 329640c..0000000
--- a/games/phonemes/sounds/sapo1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/sapo2.ogg b/games/phonemes/sounds/sapo2.ogg
deleted file mode 100644
index ecc8c9f..0000000
--- a/games/phonemes/sounds/sapo2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/uva1.ogg b/games/phonemes/sounds/uva1.ogg
deleted file mode 100644
index e54fab9..0000000
--- a/games/phonemes/sounds/uva1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/uva2.ogg b/games/phonemes/sounds/uva2.ogg
deleted file mode 100644
index f4f6e12..0000000
--- a/games/phonemes/sounds/uva2.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/zebra1.ogg b/games/phonemes/sounds/zebra1.ogg
deleted file mode 100644
index 8adbb89..0000000
--- a/games/phonemes/sounds/zebra1.ogg
+++ /dev/null
Binary files differ
diff --git a/games/phonemes/sounds/zebra2.ogg b/games/phonemes/sounds/zebra2.ogg
deleted file mode 100644
index f831843..0000000
--- a/games/phonemes/sounds/zebra2.ogg
+++ /dev/null
Binary files differ
diff --git a/images/equal_pairs1.svg b/images/equal_pairs1.svg
new file mode 100644
index 0000000..47544eb
--- /dev/null
+++ b/images/equal_pairs1.svg
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="55"
+ height="55"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ sodipodi:docname="equal_pairs1.svg"
+ sodipodi:docbase="/home/msgodoi/olpc/workspace/Memorize.activity/images"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#404040"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="1"
+ inkscape:pageshadow="2"
+ inkscape:zoom="12.309091"
+ inkscape:cx="27.5"
+ inkscape:cy="27.5"
+ inkscape:document-units="px"
+ inkscape:current-layer="g5562"
+ width="55px"
+ height="55px"
+ inkscape:window-width="1432"
+ inkscape:window-height="871"
+ inkscape:window-x="4"
+ inkscape:window-y="25" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <g
+ id="g5499"
+ transform="translate(-0.7444609,-1.3648449)">
+ <g
+ id="g5512"
+ transform="matrix(1.0512821,0,0,1.051282,-6.381851e-2,0.8717949)">
+ <g
+ id="g5562"
+ transform="translate(0.4512195,17.493391)">
+ <rect
+ style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.42682922;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4522"
+ width="23.304878"
+ height="23.304878"
+ x="1.9822657"
+ y="-15.359758"
+ ry="2.184521"
+ rx="2.184521" />
+ <rect
+ style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.42682922;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4470"
+ width="23.304878"
+ height="23.304878"
+ x="27.665192"
+ y="-15.359757"
+ ry="2.184521"
+ rx="2.184521" />
+ <rect
+ style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.42682922;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4476"
+ width="23.304878"
+ height="23.304878"
+ x="1.9822657"
+ y="10.32317"
+ ry="2.184521"
+ rx="2.184521" />
+ <rect
+ style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.42682922;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4482"
+ width="23.304878"
+ height="23.304878"
+ x="27.665192"
+ y="10.323171"
+ ry="2.184521"
+ rx="2.184521" />
+ </g>
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/images/equal_pairs2.svg b/images/equal_pairs2.svg
new file mode 100644
index 0000000..700d0cb
--- /dev/null
+++ b/images/equal_pairs2.svg
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="55"
+ height="55"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ sodipodi:docname="equal_pairs2.svg"
+ sodipodi:docbase="/home/msgodoi/olpc/workspace/Memorize.activity/images"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#404040"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="1"
+ inkscape:pageshadow="2"
+ inkscape:zoom="12.309091"
+ inkscape:cx="27.5"
+ inkscape:cy="27.5"
+ inkscape:document-units="px"
+ inkscape:current-layer="g5562"
+ width="55px"
+ height="55px"
+ inkscape:window-width="1432"
+ inkscape:window-height="871"
+ inkscape:window-x="4"
+ inkscape:window-y="25" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <g
+ id="g5499"
+ transform="translate(-0.7444609,-1.3648449)">
+ <g
+ id="g5512"
+ transform="matrix(1.0512821,0,0,1.051282,-6.381851e-2,0.8717949)">
+ <g
+ id="g5562"
+ transform="translate(0.4512195,17.493391)">
+ <rect
+ style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.42682922;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4522"
+ width="23.304878"
+ height="23.304878"
+ x="1.9822657"
+ y="-15.359758"
+ ry="2.184521"
+ rx="2.184521" />
+ <text
+ xml:space="preserve"
+ style="font-size:11.1061306px;font-style:normal;font-weight:normal;fill:#c7c8cc;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="5.497498"
+ y="4.3117237"
+ id="text4526"><tspan
+ sodipodi:role="line"
+ id="tspan4528"
+ x="5.497498"
+ y="4.3117237"
+ style="font-size:22px;font-weight:bold;fill:#c7c8cc;fill-opacity:1">1</tspan></text>
+ <rect
+ style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.42682922;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4470"
+ width="23.304878"
+ height="23.304878"
+ x="27.665192"
+ y="-15.359757"
+ ry="2.184521"
+ rx="2.184521" />
+ <text
+ xml:space="preserve"
+ style="font-size:11.1061306px;font-style:normal;font-weight:normal;fill:#c7c8cc;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="31.180424"
+ y="4.3117247"
+ id="text4472"><tspan
+ sodipodi:role="line"
+ id="tspan4474"
+ x="31.180424"
+ y="4.3117247"
+ style="font-size:22px;font-weight:bold;fill:#c7c8cc;fill-opacity:1">1</tspan></text>
+ <rect
+ style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.42682922;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4476"
+ width="23.304878"
+ height="23.304878"
+ x="1.9822657"
+ y="10.32317"
+ ry="2.184521"
+ rx="2.184521" />
+ <text
+ xml:space="preserve"
+ style="font-size:11.1061306px;font-style:normal;font-weight:normal;fill:#c7c8cc;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="6.066834"
+ y="30.139671"
+ id="text4478"><tspan
+ sodipodi:role="line"
+ id="tspan4480"
+ x="6.066834"
+ y="30.139671"
+ style="font-size:22px;font-weight:bold;fill:#c7c8cc;fill-opacity:1">2</tspan></text>
+ <rect
+ style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.42682922;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4482"
+ width="23.304878"
+ height="23.304878"
+ x="27.665192"
+ y="10.323171"
+ ry="2.184521"
+ rx="2.184521" />
+ <text
+ xml:space="preserve"
+ style="font-size:11.1061306px;font-style:normal;font-weight:normal;fill:#c7c8cc;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="31.74976"
+ y="30.139671"
+ id="text4484"><tspan
+ sodipodi:role="line"
+ id="tspan4486"
+ x="31.74976"
+ y="30.139671"
+ style="font-size:22px;font-weight:bold;fill:#c7c8cc;fill-opacity:1">2</tspan></text>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/images/game-load.svg b/images/game-load.svg
index deaaa2a..78dcc35 100644
--- a/images/game-load.svg
+++ b/images/game-load.svg
@@ -56,7 +56,7 @@
inkscape:cy="30.793413"
inkscape:window-x="4"
inkscape:window-y="25"
- inkscape:current-layer="svg5142" /><g
+ inkscape:current-layer="g4140" /><g
id="g5125"
transform="translate(-2,2)"><g
id="g5147">
@@ -94,55 +94,55 @@
x1="13.209" /></g><g
id="g4140"
transform="matrix(0.8372116,0,0,0.8372116,8.751416,-7.2720533e-2)"><rect
- style="fill:#ffffff;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.79166175;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect2221"
height="5.0509453"
width="5.0529833"
y="2.5764074"
x="32.505089" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
+ style="fill:#404040;stroke:#ffffff;stroke-width:1.79166175;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
id="rect2223"
height="5.0509453"
width="5.0529833"
y="2.5764074"
x="40.25333" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
+ style="fill:#404040;stroke:#ffffff;stroke-width:1.79166175;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
id="rect2225"
height="5.0509453"
width="5.0529833"
y="2.5764074"
x="47.70649" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
+ style="fill:#404040;stroke:#ffffff;stroke-width:1.79166175;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
id="rect2227"
height="5.0509453"
width="5.0529833"
y="10.110903"
x="32.505089" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
+ style="fill:#404040;stroke:#ffffff;stroke-width:1.79166175;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
id="rect2229"
height="5.0509453"
width="5.0529833"
y="10.110903"
x="40.25333" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
+ style="fill:#404040;stroke:#ffffff;stroke-width:1.79166175;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
id="rect2231"
height="5.0509453"
width="5.0529833"
y="10.110903"
x="47.70649" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
+ style="fill:#404040;stroke:#ffffff;stroke-width:1.79166175;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
id="rect2233"
height="5.0509453"
width="5.0529833"
y="17.624184"
x="32.505089" /><rect
- style="fill:#ffffff;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.79166175;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect2235"
height="5.0509453"
width="5.0529833"
y="17.624184"
x="40.25333" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
+ style="fill:#404040;stroke:#ffffff;stroke-width:1.79166175;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
id="rect2237"
height="5.0509453"
width="5.0529833"
diff --git a/images/game-new.svg b/images/game-new.svg
index 4dc4b64..e54ff7e 100755
--- a/images/game-new.svg
+++ b/images/game-new.svg
@@ -17,16 +17,15 @@
enable-background="new 0 0 43.584 43.292"
xml:space="preserve"
sodipodi:version="0.32"
- inkscape:version="0.45"
- sodipodi:docname="new.svg"
- sodipodi:docbase="/home/msgodoi/olpc/jhbuild/sugar-jhbuild/build/share/activities/Memorize.activity/images"
- inkscape:output_extension="org.inkscape.output.svg.inkscape"
- sodipodi:modified="true"><metadata
+ inkscape:version="0.45.1"
+ sodipodi:docname="game-new.svg"
+ sodipodi:docbase="/home/msgodoi/olpc/workspace/Memorize.activity/images"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata
id="metadata2242"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs2240" /><sodipodi:namedview
- inkscape:window-height="847"
+ inkscape:window-height="871"
inkscape:window-width="1432"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
@@ -37,11 +36,11 @@
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
- inkscape:zoom="15.407004"
+ inkscape:zoom="15.637993"
inkscape:cx="21.792"
- inkscape:cy="43.004242"
- inkscape:window-x="0"
- inkscape:window-y="0"
+ inkscape:cy="21.646"
+ inkscape:window-x="4"
+ inkscape:window-y="25"
inkscape:current-layer="Icon" />
<rect
x="1.5007635"
@@ -49,63 +48,63 @@
width="8.5757914"
height="8.5757914"
id="rect2221"
- style="fill:#ffffff;stroke:#000000;stroke-width:3.00152707" />
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:3.00152707;stroke-opacity:1" />
<rect
x="14.650882"
y="1.5007635"
width="8.5757914"
height="8.5757914"
id="rect2223"
- style="fill:#aaaaaa;stroke:#000000;stroke-width:3.00152707" />
+ style="fill:#404040;stroke:#ffffff;stroke-width:3.00152707;stroke-opacity:1;fill-opacity:1" />
<rect
x="27.300175"
y="1.5007635"
width="8.5757914"
height="8.5757914"
id="rect2225"
- style="fill:#aaaaaa;stroke:#000000;stroke-width:3.00152707" />
+ style="fill:#404040;stroke:#ffffff;stroke-width:3.00152707;stroke-opacity:1;fill-opacity:1" />
<rect
x="1.5007635"
y="14.293271"
width="8.5757914"
height="8.5757914"
id="rect2227"
- style="fill:#aaaaaa;stroke:#000000;stroke-width:3.00152707" />
+ style="fill:#404040;stroke:#ffffff;stroke-width:3.00152707;stroke-opacity:1;fill-opacity:1" />
<rect
x="14.650882"
y="14.293271"
width="8.5757914"
height="8.5757914"
id="rect2229"
- style="fill:#aaaaaa;stroke:#000000;stroke-width:3.00152707" />
+ style="fill:#404040;stroke:#ffffff;stroke-width:3.00152707;stroke-opacity:1;fill-opacity:1" />
<rect
x="27.300175"
y="14.293271"
width="8.5757914"
height="8.5757914"
id="rect2231"
- style="fill:#aaaaaa;stroke:#000000;stroke-width:3.00152707" />
+ style="fill:#404040;stroke:#ffffff;stroke-width:3.00152707;stroke-opacity:1;fill-opacity:1" />
<rect
x="1.5007635"
y="27.049763"
width="8.5757914"
height="8.5757914"
id="rect2233"
- style="fill:#aaaaaa;stroke:#000000;stroke-width:3.00152707" />
+ style="fill:#404040;stroke:#ffffff;stroke-width:3.00152707;stroke-opacity:1;fill-opacity:1" />
<rect
x="14.650882"
y="27.049763"
width="8.5757914"
height="8.5757914"
id="rect2235"
- style="fill:#ffffff;stroke:#000000;stroke-width:3.00152707" />
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:3.00152707;stroke-opacity:1" />
<rect
x="27.300175"
y="27.049763"
width="8.5757914"
height="8.5757914"
id="rect2237"
- style="fill:#aaaaaa;stroke:#000000;stroke-width:3.00152707" />
+ style="fill:#404040;stroke:#ffffff;stroke-width:3.00152707;stroke-opacity:1;fill-opacity:1" />
<g
id="g8128"
transform="matrix(1.1533304,0,0,1.1849266,74.491613,11.842114)"
diff --git a/images/game-restart.svg b/images/game-restart.svg
new file mode 100644
index 0000000..326d4c8
--- /dev/null
+++ b/images/game-restart.svg
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 12.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ id="Icon"
+ width="55"
+ height="55"
+ viewBox="0 0 43.584 43.292"
+ overflow="visible"
+ enable-background="new 0 0 43.584 43.292"
+ xml:space="preserve"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ sodipodi:docname="game-restart.svg"
+ sodipodi:docbase="/home/msgodoi/olpc/workspace/Memorize.activity/images"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata
+ id="metadata2242"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs2240" /><sodipodi:namedview
+ inkscape:window-height="871"
+ inkscape:window-width="1432"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="1"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#404040"
+ id="base"
+ inkscape:zoom="1"
+ inkscape:cx="27.5"
+ inkscape:cy="27.5"
+ inkscape:window-x="4"
+ inkscape:window-y="25"
+ inkscape:current-layer="g7707"
+ width="55px"
+ height="55px" />
+<rect
+ x="6.5091267"
+ y="12.102893"
+ width="9.3666306"
+ height="9.3634796"
+ id="rect2221"
+ style="fill:#ffffff;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+<rect
+ x="17.313606"
+ y="12.102893"
+ width="9.3666306"
+ height="9.3634796"
+ id="rect2223"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+<rect
+ x="28.118086"
+ y="12.102893"
+ width="9.3666306"
+ height="9.3634796"
+ id="rect2225"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+<rect
+ x="6.5091267"
+ y="22.765926"
+ width="9.3666306"
+ height="9.3634796"
+ id="rect2227"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+<rect
+ x="17.313606"
+ y="22.765926"
+ width="9.3666306"
+ height="9.3634796"
+ id="rect2229"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+<rect
+ x="28.118086"
+ y="22.765926"
+ width="9.3666306"
+ height="9.3634796"
+ id="rect2231"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+<rect
+ x="6.5091267"
+ y="33.428959"
+ width="9.3666306"
+ height="9.3634796"
+ id="rect2233"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+<rect
+ x="17.313606"
+ y="33.428959"
+ width="9.3666306"
+ height="9.3634796"
+ id="rect2235"
+ style="fill:#ffffff;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+<rect
+ x="28.118086"
+ y="33.428959"
+ width="9.3666306"
+ height="9.3634796"
+ id="rect2237"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+<g
+ transform="matrix(0.8205513,0,0,0.8205513,6.0016399,6.8019757)"
+ id="g3696"><g
+ id="g6733"
+ transform="matrix(1.4726213,0,0,1.7601655,-10.157993,1.3703924)"><g
+ id="g7707"
+ transform="matrix(0.7791286,0,0,0.7791286,3.4314416,-1.0263174)"><g
+ id="g8681"
+ transform="translate(-0.2716888,-0.7287783)"><path
+ style="fill:none;fill-rule:evenodd;stroke:#8c8c8c;stroke-width:2.91463447;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 21.479131,-3.6648374 C 21.479131,12.592068 21.479131,3.5218581 21.479131,9.1531062"
+ id="path8177"
+ sodipodi:nodetypes="cc" /><path
+ style="fill:none;fill-rule:evenodd;stroke:#8c8c8c;stroke-width:2.91463447;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 26.27629,4.3453376 C 20.432698,10.18893 23.693011,6.9286162 21.668843,8.9527852"
+ id="path9150"
+ sodipodi:nodetypes="cc" /><path
+ style="fill:none;fill-rule:evenodd;stroke:#8c8c8c;stroke-width:2.91463447;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 16.709475,4.3879849 C 22.553067,10.231577 19.292754,6.9712635 21.316922,8.9954325"
+ id="path9152"
+ sodipodi:nodetypes="cc" /></g></g></g></g></svg> \ No newline at end of file
diff --git a/images/game-save.svg b/images/game-save.svg
index 8d43d4b..bc3e149 100644
--- a/images/game-save.svg
+++ b/images/game-save.svg
@@ -91,63 +91,7 @@
y2="11.505"
y1="46.533001"
x2="13.209"
- x1="13.209" /></g><g
- id="g4140"
- transform="matrix(0.8372116,0,0,0.8372116,8.751416,-7.2720533e-2)"><rect
- style="fill:#ffffff;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
- id="rect2221"
- height="5.0509453"
- width="5.0529833"
- y="2.5764074"
- x="32.505089" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
- id="rect2223"
- height="5.0509453"
- width="5.0529833"
- y="2.5764074"
- x="40.25333" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
- id="rect2225"
- height="5.0509453"
- width="5.0529833"
- y="2.5764074"
- x="47.70649" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
- id="rect2227"
- height="5.0509453"
- width="5.0529833"
- y="10.110903"
- x="32.505089" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
- id="rect2229"
- height="5.0509453"
- width="5.0529833"
- y="10.110903"
- x="40.25333" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
- id="rect2231"
- height="5.0509453"
- width="5.0529833"
- y="10.110903"
- x="47.70649" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
- id="rect2233"
- height="5.0509453"
- width="5.0529833"
- y="17.624184"
- x="32.505089" /><rect
- style="fill:#ffffff;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
- id="rect2235"
- height="5.0509453"
- width="5.0529833"
- y="17.624184"
- x="40.25333" /><rect
- style="fill:#aaaaaa;stroke:#000000;stroke-width:2.38888216;stroke-miterlimit:4;stroke-dasharray:none"
- id="rect2237"
- height="5.0509453"
- width="5.0529833"
- y="17.624184"
- x="47.70649" /></g><line
+ x1="13.209" /></g><line
style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="line5169"
y2="36.425068"
@@ -163,4 +107,58 @@
y2="36.52364"
y1="36.329655"
x2="45.78508"
- x1="37.750839" /></svg> \ No newline at end of file
+ x1="37.750839" /><rect
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2221"
+ height="4.2287102"
+ width="4.2304163"
+ y="1.6075182"
+ x="36.39415" /><rect
+ style="fill:#404040;fill-opacity:1;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2223"
+ height="4.2287102"
+ width="4.2304163"
+ y="1.6075182"
+ x="42.881065" /><rect
+ style="fill:#404040;fill-opacity:1;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2225"
+ height="4.2287102"
+ width="4.2304163"
+ y="1.6075182"
+ x="49.120937" /><rect
+ style="fill:#404040;fill-opacity:1;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2227"
+ height="4.2287102"
+ width="4.2304163"
+ y="7.9154854"
+ x="36.39415" /><rect
+ style="fill:#404040;fill-opacity:1;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2229"
+ height="4.2287102"
+ width="4.2304163"
+ y="7.9154854"
+ x="42.881065" /><rect
+ style="fill:#404040;fill-opacity:1;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2231"
+ height="4.2287102"
+ width="4.2304163"
+ y="7.9154854"
+ x="49.120937" /><rect
+ style="fill:#404040;fill-opacity:1;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2233"
+ height="4.2287102"
+ width="4.2304163"
+ y="14.20569"
+ x="36.39415" /><rect
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2235"
+ height="4.2287102"
+ width="4.2304163"
+ y="14.20569"
+ x="42.881065" /><rect
+ style="fill:#404040;fill-opacity:1;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2237"
+ height="4.2287102"
+ width="4.2304163"
+ y="14.20569"
+ x="49.120937" /></svg> \ No newline at end of file
diff --git a/images/import_picture.svg b/images/import_picture.svg
new file mode 100644
index 0000000..3029498
--- /dev/null
+++ b/images/import_picture.svg
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="42"
+ height="42"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ sodipodi:docbase="/home/msgodoi/olpc/workspace/Memorize.activity/images"
+ sodipodi:docname="import_picture2.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16.119048"
+ inkscape:cx="21"
+ inkscape:cy="21"
+ inkscape:document-units="px"
+ inkscape:current-layer="g6207"
+ width="42px"
+ height="42px"
+ inkscape:window-width="1432"
+ inkscape:window-height="871"
+ inkscape:window-x="4"
+ inkscape:window-y="25" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <g
+ id="g6207"
+ transform="matrix(1.1572772,0,0,1.1572772,-4.2605572,6.7107864)">
+ <path
+ id="path4267"
+ d="M 5.4593796,20.224519 C 38.339735,20.224519 38.339735,20.472673 38.339735,20.472673"
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.59229163;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.59229159;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 21.479131,-4.0705774 C 21.479131,12.654873 21.479131,3.3232479 21.479131,9.1167959"
+ id="path8177"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.59229183;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 26.27629,4.3453376 C 20.432698,10.18893 23.693011,6.9286162 21.668843,8.9527852"
+ id="path9150"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.59229183;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 16.709475,4.3879849 C 22.553067,10.231577 19.292754,6.9712635 21.316922,8.9954325"
+ id="path9152"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:#404040;stroke-width:0.39234692;stroke-opacity:1;overflow:visible"
+ id="path9"
+ d="M 21.827577,10.566639 C 12.107601,10.566639 4.0271383,20.247579 4.0271383,20.247579 C 4.0271383,20.247579 12.107601,29.967555 21.827577,29.967555 C 31.547554,29.967555 39.628016,20.208542 39.628016,20.208542 C 39.628016,20.208542 31.547554,10.566639 21.827577,10.566639 z M 21.827577,27.078888 C 18.080116,27.078888 14.996268,24.034076 14.996268,20.247579 C 14.996268,16.500118 18.041081,13.41627 21.827577,13.41627 C 25.575038,13.41627 28.658886,16.461082 28.658886,20.247579 C 28.658886,24.034076 25.614075,27.078888 21.827577,27.078888 z "
+ class="st0" />
+ <circle
+ style="fill:#404040;fill-opacity:1;stroke:#404040;stroke-width:0.44639024;stroke-opacity:1;overflow:visible"
+ sodipodi:ry="7.9000001"
+ sodipodi:rx="7.9000001"
+ sodipodi:cy="25.4"
+ sodipodi:cx="46.299999"
+ id="circle2362"
+ r="7.9000001"
+ cy="25.4"
+ cx="46.299999"
+ class="st0"
+ transform="matrix(0.8789325,0,0,0.8789325,-18.866997,-2.0353805)" />
+ <circle
+ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.00508869;stroke-opacity:1;overflow:visible"
+ sodipodi:ry="7.9000001"
+ sodipodi:rx="7.9000001"
+ sodipodi:cy="25.4"
+ sodipodi:cx="46.299999"
+ id="circle11"
+ r="7.9000001"
+ cy="25.4"
+ cx="46.299999"
+ class="st0"
+ transform="matrix(0.3903605,0,0,0.3903605,3.7538862,10.371458)" />
+ </g>
+ </g>
+</svg>
diff --git a/images/import_sound.svg b/images/import_sound.svg
new file mode 100644
index 0000000..a2c5ba8
--- /dev/null
+++ b/images/import_sound.svg
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="42"
+ height="42"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ sodipodi:docbase="/home/msgodoi/olpc/workspace/Memorize.activity/images"
+ sodipodi:docname="import_sound.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16.119048"
+ inkscape:cx="21"
+ inkscape:cy="22.457633"
+ inkscape:document-units="px"
+ inkscape:current-layer="g6207"
+ width="42px"
+ height="42px"
+ inkscape:window-width="1432"
+ inkscape:window-height="871"
+ inkscape:window-x="4"
+ inkscape:window-y="25" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <g
+ id="g6207"
+ transform="matrix(1.1572772,0,0,1.1572772,-4.2605572,6.7107864)">
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path2327"
+ d="M 5.211226,20.224521 C 16.756465,32.39809 27.826101,31.198735 38.711967,20.22452 C 34.369968,16.906754 27.814245,8.5157151 21.961596,13.896602 C 13.884782,9.0002916 10.160766,16.276986 5.211226,20.224521 z "
+ style="fill:#404040;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.59229163;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1" />
+ <path
+ id="path4267"
+ d="M 5.4593796,20.224519 C 38.339735,20.224519 38.339735,20.472673 38.339735,20.472673"
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.59229163;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.59229159;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 21.479131,-4.0705774 C 21.479131,12.654873 21.479131,3.3232479 21.479131,9.1167959"
+ id="path8177"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.59229183;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 26.27629,4.3453376 C 20.432698,10.18893 23.693011,6.9286162 21.668843,8.9527852"
+ id="path9150"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.59229183;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 16.709475,4.3879849 C 22.553067,10.231577 19.292754,6.9712635 21.316922,8.9954325"
+ id="path9152"
+ sodipodi:nodetypes="cc" />
+ </g>
+ </g>
+</svg>
diff --git a/images/pair-add.svg b/images/pair-add.svg
new file mode 100644
index 0000000..37d1e4d
--- /dev/null
+++ b/images/pair-add.svg
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="42"
+ height="42"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ sodipodi:docname="pair-new.svg"
+ sodipodi:docbase="/home/msgodoi/olpc/workspace/Memorize.activity/images"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="12.238095"
+ inkscape:cx="21"
+ inkscape:cy="21"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ width="42px"
+ height="42px"
+ inkscape:window-width="806"
+ inkscape:window-height="718"
+ inkscape:window-x="522"
+ inkscape:window-y="132" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="fill:#4c4d4f;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect7017"
+ width="30.046175"
+ height="30.046175"
+ x="1.9769126"
+ y="1.9769124"
+ ry="4.5299301" />
+ <rect
+ style="fill:#4c4d4f;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect3133"
+ width="30.046175"
+ height="30.046175"
+ x="9.9769125"
+ y="9.9769125"
+ ry="4.5299301" />
+ <g
+ id="g8128"
+ transform="matrix(1.1533304,0,0,1.1849266,64.979745,2.4656882)"
+ style="stroke:#ffffff;stroke-opacity:1">
+ <path
+ sodipodi:nodetypes="cccccc"
+ id="path6167"
+ d="M -27.423669,19.213102 L -34.384959,18.667751 L -41.332006,19.051133 L -34.303975,19.649604 L -27.488656,19.213102 L -34.44067,18.736178"
+ style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;marker-start:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccccc"
+ id="path6165"
+ d="M -34.432262,26.112846 L -33.886911,19.151556 L -34.270293,12.204509 L -34.868764,19.23254 L -34.432262,26.047859 L -33.955338,19.095845"
+ style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;marker-start:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccccc"
+ id="path6169"
+ d="M -29.517762,24.133282 L -34.054516,18.825285 L -39.237912,14.184073 L -34.691527,19.576825 L -29.563716,24.087329 L -34.142295,18.834277"
+ style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;marker-start:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccccc"
+ id="path6171"
+ d="M -29.403233,14.298603 L -34.71123,18.835357 L -39.352442,24.018753 L -33.959691,19.472367 L -29.449186,14.344555 L -34.702238,18.923135"
+ style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;marker-start:none;stroke-opacity:1" />
+ </g>
+ </g>
+</svg>
diff --git a/images/pair-update.svg b/images/pair-update.svg
new file mode 100644
index 0000000..d251be5
--- /dev/null
+++ b/images/pair-update.svg
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="42"
+ height="42"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ sodipodi:docname="pair-update.svg"
+ sodipodi:docbase="/home/msgodoi/olpc/workspace/Memorize.activity/images"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1"
+ inkscape:cx="21"
+ inkscape:cy="21"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ width="42px"
+ height="42px"
+ inkscape:window-width="1432"
+ inkscape:window-height="871"
+ inkscape:window-x="4"
+ inkscape:window-y="25" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="fill:#4c4d4f;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect7017"
+ width="30.046175"
+ height="30.046175"
+ x="1.9769126"
+ y="1.9769124"
+ ry="4.5299301" />
+ <rect
+ style="fill:#4c4d4f;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect3133"
+ width="30.046175"
+ height="30.046175"
+ x="9.9769125"
+ y="9.9769125"
+ ry="4.5299301" />
+ <g
+ id="g7384"
+ transform="matrix(0.7398804,-0.1417707,0.1417707,0.7398804,3.1769353,8.481073)">
+ <g
+ id="g8361"
+ style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.32742107;stroke-linecap:round;stroke-opacity:1"
+ transform="matrix(-0.9813845,-0.1920532,0.1920532,-0.9813845,45.325983,56.360102)">
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.65484214;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 17.241246,23.778211 C 18.873784,13.334226 32.631006,13.66595 33.910507,23.614787"
+ id="path8363"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.65484214;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 14.571628,18.545494 L 17.02506,23.922425 L 22.654737,22.143297 L 22.654737,22.143297"
+ id="path8365" />
+ </g>
+ </g>
+ <g
+ id="g8380"
+ transform="matrix(-0.7454146,0.108991,-0.108991,-0.7454146,47.363957,41.428291)">
+ <g
+ id="g8382"
+ style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.32742107;stroke-linecap:round;stroke-opacity:1"
+ transform="matrix(-0.9813845,-0.1920532,0.1920532,-0.9813845,45.325983,56.360102)">
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.65484214;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 17.241246,23.778211 C 18.873784,13.334226 32.631006,13.66595 33.910507,23.614787"
+ id="path8384"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.65484214;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 14.571628,18.545494 L 17.02506,23.922425 L 22.654737,22.143297 L 22.654737,22.143297"
+ id="path8386" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/memorize.dtd b/memorize.dtd
index 56ca6c6..870e18d 100644
--- a/memorize.dtd
+++ b/memorize.dtd
@@ -2,14 +2,15 @@
<!ELEMENT memorize (#PCDATA|pair)*>
<!ATTLIST memorize
- name CDATA #REQUIRED
- scoresnd CDATA #IMPLIED
- winsnd CDATA #IMPLIED
- divided CDATA #IMPLIED
- face CDATA #IMPLIED
- face1 CDATA #IMPLIED
- face2 CDATA #IMPLIED
- align CDATA #IMPLIED
+ name CDATA #REQUIRED
+ scoresnd CDATA #IMPLIED
+ winsnd CDATA #IMPLIED
+ divided CDATA #IMPLIED
+ face CDATA #IMPLIED
+ face1 CDATA #IMPLIED
+ face2 CDATA #IMPLIED
+ align CDATA #IMPLIED
+ equal_pairs CDATA #IMPLIED
>
<!ELEMENT pair (#PCDATA)* >
diff --git a/memorizetoolbar.py b/memorizetoolbar.py
index bb17ba2..68b7d1c 100755
--- a/memorizetoolbar.py
+++ b/memorizetoolbar.py
@@ -17,21 +17,22 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
-import logging
-
import gtk
import os
from gettext import gettext as _
from sugar.graphics.toolbutton import ToolButton
from sugar.graphics.toolcombobox import ToolComboBox
+from sugar.graphics.objectchooser import ObjectChooser
+import logging
+_logger = logging.getLogger('memorize-activity')
class MemorizeToolbar(gtk.Toolbar):
__gtype_name__ = 'MemoryToolbar'
- standard_game_names = ["addition", "capitals", "drumgit", "letters", "numbers", "phonemes"]
- translated_game_names = [_("addition"), _("capitals"), _("drumgit"), _("letters"), _("numbers"), _("phonemes")]
+ standard_game_names = ['Load demo games', 'addition', 'capitals', 'drumgit', 'letters', 'numbers', 'phonemes']
+ translated_game_names = [_('Load demo games'), _('addition'), _('capitals'), _('drumgit'), _('letters'), _('numbers'), _('phonemes')]
def __init__(self, activity):
gtk.Toolbar.__init__(self)
@@ -40,41 +41,53 @@ class MemorizeToolbar(gtk.Toolbar):
# Reset Button
- self._reset_button = ToolButton('insert-image')
- self._reset_button.connect('clicked', self._game_changed_cb)
- self._reset_button.set_tooltip(_('Restart Game'))
- self.insert(self._reset_button, -1)
- self._reset_button.show()
+ restart_icon = os.path.join(os.path.dirname(__file__), "images/game-restart.svg")
+ restart_image = gtk.Image()
+ restart_image.set_from_file(restart_icon)
+ self._restart_button = ToolButton()
+ self._restart_button.set_icon_widget(restart_image)
+ self._restart_button.connect('clicked', self._game_reset_cb)
+ self._restart_button.set_tooltip(_('Restart Game'))
+ self.insert(self._restart_button, -1)
+ self._restart_button.show()
- # Separator
- separator = gtk.SeparatorToolItem()
- separator.set_draw(True)
- self.insert(separator, -1)
-
- # Change game combobox
- self.games = os.listdir(os.path.join(os.path.dirname(__file__), 'games'))
- self.games.sort()
- self._game_combo = ToolComboBox()
- for i, f in enumerate(self.games):
- if f in self.standard_game_names:
- f = _(f)
- self._game_combo.combo.append_item(i, f)
- self._game_combo.combo.connect('changed', self._game_changed_cb)
- self._add_widget(self._game_combo)
+ # Load Button
+ load_icon = os.path.join(os.path.dirname(__file__), "images/game-load.svg")
+ load_image = gtk.Image()
+ load_image.set_from_file(load_icon)
+ self._load_button = ToolButton()
+ self._load_button.set_icon_widget(load_image)
+ self._load_button.set_tooltip(_('Load game'))
+ self._load_button.connect('clicked', self._load_game)
+ self._add_widget(self._load_button)
+ # Separator
separator = gtk.SeparatorToolItem()
separator.set_draw(True)
self.insert(separator, -1)
- self._lock = False
# Change size combobox
self._size_combo = ToolComboBox()
self._sizes = ['4 X 4', '5 X 5', '6 X 6']
for i, f in enumerate(self._sizes):
self._size_combo.combo.append_item(i, f)
- self._size_combo.combo.connect('changed', self._game_changed_cb)
+ self._size_combo.combo.connect('changed', self._game_size_cb)
self._add_widget(self._size_combo)
+ separator = gtk.SeparatorToolItem()
+ separator.set_draw(True)
+ self.insert(separator, -1)
+ self._lock = False
+
+ # Change demo games combobox
+ self._game_combo = ToolComboBox()
+ for i, f in enumerate(self.standard_game_names):
+ f = _(f)
+ self._game_combo.combo.append_item(i, f)
+ self._game_combo.combo.set_active(0)
+ self._game_combo.combo.connect('changed', self._game_changed_cb)
+ self._add_widget(self._game_combo)
+
def _add_widget(self, widget, expand=False):
tool_item = gtk.ToolItem()
tool_item.set_expand(expand)
@@ -83,21 +96,45 @@ class MemorizeToolbar(gtk.Toolbar):
self.insert(tool_item, -1)
tool_item.show()
+ def _game_reset_cb(self, widget):
+ self.activity.game.reset_game()
+
+ def _load_game(self, button):
+ chooser = ObjectChooser(_('Choose memorize game'), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
+ jobject = ''
+ try:
+ result = chooser.run()
+ if result == gtk.RESPONSE_ACCEPT:
+ logging.debug('ObjectChooser: %r' % chooser.get_selected_object())
+ jobject = chooser.get_selected_object()
+ if not jobject or not jobject.file_path:
+ return
+ finally:
+ chooser.destroy()
+ del chooser
+
+ if jobject and jobject.file_path:
+ self.activity.change_game(jobject.file_path, 4)
+
+ def _game_size_cb(self, widget):
+ game_size = int(self._sizes[self._size_combo.combo.get_active()][0])
+ self.activity.game.reset_game(game_size)
+
def _game_changed_cb(self, combobox):
+ if combobox.get_active() == 0: return
if not self._lock:
- game_name = self.games[self._game_combo.combo.get_active()]
+ game_name = self.standard_game_names[self._game_combo.combo.get_active()]
+ game_file = os.path.join(os.path.dirname(__file__),'demos',game_name+'.zip')
game_size = int(self._sizes[self._size_combo.combo.get_active()][0])
if game_name in self.translated_game_names:
index = self.translated_game_names.index(game_name)
game_name = self.standard_game_names[index]
- self.activity.change_game(game_name, game_size)
+ self.activity.change_game(game_file, game_size)
+ self._game_combo.combo.set_active(0)
def update_toolbar(self, widget, data, grid):
- game = data.get('name')
size = data.get('size')
self._lock = True
- game_index = self.games.index(game)
- self._game_combo.combo.set_active(game_index)
size_index = self._sizes.index(size+' X '+size)
self._size_combo.combo.set_active(int(size_index))
self._lock = False
diff --git a/messenger.py b/messenger.py
index 173ad14..f23dcf9 100644
--- a/messenger.py
+++ b/messenger.py
@@ -68,8 +68,6 @@ class Messenger(ExportedGObject):
self._tube.get_object(sender, PATH).load_game(self.ordered_bus_names, self.game.get_grid(), self.game.get_data(), self.game.players.index(self.game.current_player), self.game.waiting_players, dbus_interface=IFACE)
_logger.debug('Sent the game state')
- #@dbus.service.method(dbus_interface=IFACE, in_signature='asss', out_signature='')
- #@dbus.service.method(dbus_interface=IFACE, in_signature='asa(ssssssssiii)a{ss}av', out_signature='')
@dbus.service.method(dbus_interface=IFACE, in_signature='asaa{ss}a{ss}nav', out_signature='')
def load_game(self, bus_names, grid, data, current_player, list):
''' Sync the game with with players '''
@@ -77,9 +75,9 @@ class Messenger(ExportedGObject):
_logger.debug('grid %s '%grid)
self.ordered_bus_names = bus_names
self.player_id = bus_names.index(self._tube.get_unique_name())
- self._change_game_receiver(grid,data,self.ordered_bus_names[0])
+ self.game.load_remote(grid, data, True)
self.game.load_waiting_list(list)
- _logger.debug('Current plater id=%d' %current_player)
+ _logger.debug('Current player id=%d' %current_player)
self.game.current_player = self.game.players[current_player]
def flip(self, widget, id):
@@ -105,7 +103,6 @@ class Messenger(ExportedGObject):
_logger.debug('Sending changed game message')
self._change_game_signal(grid, data)
- #@dbus.service.signal(IFACE, signature='a(ssssssssiii)a{ss}')
@dbus.service.signal(IFACE, signature='aa{ss}a{ss}')
def _change_game_signal(self, grid, data):
_logger.debug('Notifing other players that you changed the game')
@@ -117,8 +114,5 @@ class Messenger(ExportedGObject):
if self._tube.self_handle <> handle:
_logger.debug('Game changed by other player')
- #new_grid = []
- #for card in grid:
- # new_grid.append(map(lambda x: str(x), card[:8])+[int(card[8]), int(card[9]), int(card[10])])
self.game.load_remote(grid, data, True)
-
+ \ No newline at end of file
diff --git a/model.py b/model.py
index 224daa6..857d7ee 100644
--- a/model.py
+++ b/model.py
@@ -1,20 +1,20 @@
#! /usr/bin/env python
#
-# Copyright (C) 2006, 2007, One Laptop Per Child
+# Copyright (C) 2006, 2007, One Laptop Per Child
#
-# 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 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.
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import libxml2
@@ -22,367 +22,396 @@ import os
import logging
import random
import gobject
+import zipfile
+import tempfile
_logger = logging.getLogger('model')
-class Pair(gobject.GObject):
- __gproperties__ = {
- 'aimg' : (str, None, None, None, gobject.PARAM_READWRITE),
- 'asnd' : (str, None, None, None, gobject.PARAM_READWRITE),
- 'achar' : (str, None, None, None, gobject.PARAM_READWRITE),
- 'bimg' : (str, None, None, None, gobject.PARAM_READWRITE),
- 'bsnd' : (str, None, None, None, gobject.PARAM_READWRITE),
- 'bchar' : (str, None, None, None, gobject.PARAM_READWRITE),
- 'color': (gobject.TYPE_INT, 'Base', 'Base', 0, 10, 0, gobject.PARAM_READWRITE)
- }
-
- def __init__(self):
- gobject.GObject.__init__(self)
- self._properties = {'aimg':None, 'asnd':None, 'achar':None, 'bimg':None,
- 'bsnd':None, 'bchar':None, 'color':100}
-
- def do_get_property(self, pspec):
- """Retrieve a particular property from our property dictionary
- """
- if pspec.name == "aimg":
- return self._properties["aimg"]
- elif pspec.name == "asnd":
- return self._properties["asnd"]
- elif pspec.name == "achar":
- return self._properties["achar"]
- elif pspec.name == "bimg":
- return self._properties["bimg"]
- elif pspec.name == "bsnd":
- return self._properties["bsnd"]
- elif pspec.name == "bchar":
- return self._properties["bchar"]
- elif pspec.name == "color":
- return self._properties["color"]
+class Pair(gobject.GObject):
+ __gproperties__ = {
+ 'aimg' : (str, None, None, None, gobject.PARAM_READWRITE),
+ 'asnd' : (str, None, None, None, gobject.PARAM_READWRITE),
+ 'achar' : (str, None, None, None, gobject.PARAM_READWRITE),
+ 'bimg' : (str, None, None, None, gobject.PARAM_READWRITE),
+ 'bsnd' : (str, None, None, None, gobject.PARAM_READWRITE),
+ 'bchar' : (str, None, None, None, gobject.PARAM_READWRITE),
+ 'color': (gobject.TYPE_INT, 'Base', 'Base', 0, 10, 0, gobject.PARAM_READWRITE)
+ }
+
+ def __init__(self):
+ gobject.GObject.__init__(self)
+ self._properties = {'aimg':None, 'asnd':None, 'achar':None, 'bimg':None,
+ 'bsnd':None, 'bchar':None, 'color':100}
+
+ def do_get_property(self, pspec):
+ """Retrieve a particular property from our property dictionary
+ """
+ if pspec.name == "aimg":
+ return self._properties["aimg"]
+ elif pspec.name == "asnd":
+ return self._properties["asnd"]
+ elif pspec.name == "achar":
+ return self._properties["achar"]
+ elif pspec.name == "bimg":
+ return self._properties["bimg"]
+ elif pspec.name == "bsnd":
+ return self._properties["bsnd"]
+ elif pspec.name == "bchar":
+ return self._properties["bchar"]
+ elif pspec.name == "color":
+ return self._properties["color"]
- def set_property(self, name, value):
- if name == 'aimg':
- self._properties['aimg'] = value
- elif name == "asnd":
- self._properties["asnd"] = value
- elif name == "achar":
- self._properties["achar"] = value
- elif name == "bimg":
- self._properties["bimg"] = value
- elif name == "bsnd":
- self._properties["bsnd"] = value
- elif name == "bchar":
- self._properties["bchar"] = value
- elif name == "color":
- self._properties["color"] = value
+ def set_property(self, name, value):
+ if name == 'aimg':
+ self._properties['aimg'] = value
+ elif name == "asnd":
+ self._properties["asnd"] = value
+ elif name == "achar":
+ self._properties["achar"] = value
+ elif name == "bimg":
+ self._properties["bimg"] = value
+ elif name == "bsnd":
+ self._properties["bsnd"] = value
+ elif name == "bchar":
+ self._properties["bchar"] = value
+ elif name == "color":
+ self._properties["color"] = value
class Model(object):
- ''' The model of the activity. Contains methods to read and write
- the configuration for a game from xml. Stores the pairs and grid
- information.
- '''
-
- def __init__(self, dtdpath, gamespath=None):
- self.data = {}
- self.dtdpath = dtdpath
- if gamespath == None:
- self._GAMES_PATH = 'games'
- else:
- if os.path.isdir(gamespath) is False:
- os.makedirs(gamespath)
- self._GAMES_PATH = gamespath
-
- self.data['face'] = ''
- self.data['align'] = '1'
-
- try:
- self.dtd = libxml2.parseDTD(None, os.path.join(self.dtdpath, 'memorize.dtd'))
- except libxml2.parserError, e:
- _logger.error('Init: no memorize.dtd found ' +str(e))
- self.dtd = None
- self.ctxt = libxml2.newValidCtxt()
+ ''' The model of the activity. Contains methods to read and write
+ the configuration for a game from xml. Stores the pairs and grid
+ information.
+ '''
+
+ def __init__(self, game_path, dtd_path = None):
+ self.data = {}
+ if dtd_path == None:
+ self.dtd_path = os.path.dirname(__file__)
+ else:
+ self.dtd_path = dtd_path
+
+ if os.path.isdir(game_path):
+ self.game_path = game_path
+ else:
+ _logger.error('Game_path not found ' +str(e))
+ return
+
+ self.data['face'] = ''
+ self.data['align'] = '1'
+
+ try:
+ self.dtd = libxml2.parseDTD(None, os.path.join(self.dtd_path, 'memorize.dtd'))
+ except libxml2.parserError, e:
+ _logger.error('Init: no memorize.dtd found ' +str(e))
+ self.dtd = None
+ self.ctxt = libxml2.newValidCtxt()
- self.pairs = {}
- self.grid = []
+ self.pairs = {}
+ self.grid = []
- # used by the leader of the game to keep track of the game state
- self.players = {}
- self.player_active = 0
- self.selected = 0
- self.turn = 0
- self.started = 0
- self.count = 0
+ # used by the leader of the game to keep track of the game state
+ self.players = {}
+ self.player_active = 0
+ self.selected = 0
+ self.turn = 0
+ self.started = 0
+ self.count = 0
- def read(self, gamename):
- ''' reads the configuration from an xml file '''
- self.data['path'] = os.path.join( self._GAMES_PATH, gamename)
- self.data['pathimg'] = os.path.join(self.data['path'], 'images')
- self.data['pathsnd'] = os.path.join(self.data['path'], 'sounds')
- self.pairs = {}
+ def read(self, game_file):
+ if game_file in ["addition", "capitals", "drumgit", "letters", "numbers", "phonemes"]:
+ game_file = os.path.join(os.path.dirname(__file__), 'games', game_file+'.zip')
+ game_name = os.path.basename(game_file)[:-4]
+
+ temp_folder = tempfile.mkdtemp()
+ self.data['key'] = os.path.basename(game_file)
+ self.data['game_file'] = game_file
+ self.data['path'] = temp_folder
+ self.data['pathimg'] = os.path.join(self.data['path'], 'images')
+ self.data['pathsnd'] = os.path.join(self.data['path'], 'sounds')
+
+ ''' extracts files in the zip file '''
+ game_name = os.path.basename(game_file)[:-4]
+ zipFile = zipfile.ZipFile(game_file, "r")
+ for each in zipFile.namelist():
+ if not each.endswith('/'):
+ root, name = os.path.split(each)
+ directory = os.path.normpath(os.path.join(self.data['path'], root))
+ if not os.path.isdir(directory):
+ os.makedirs(directory)
+ file(os.path.join(directory, name), 'wb').write(zipFile.read(each))
- try:
- doc = libxml2.parseFile(os.path.join(os.path.dirname(__file__), os.path.join(self.data['path'], gamename+'.mem')))
- if doc.validateDtd(self.ctxt, self.dtd):
-
- # get the requested nodes
- xpa = doc.xpathNewContext()
- res = xpa.xpathEval("//*")
+ self.pairs = {}
+
+ ''' reads the configuration from an xml file '''
+ try:
+ doc = libxml2.parseFile(os.path.join(os.path.dirname(__file__), os.path.join(self.data['path'], 'game.xml')))
+ if doc.validateDtd(self.ctxt, self.dtd):
+
+ # get the requested nodes
+ xpa = doc.xpathNewContext()
+ res = xpa.xpathEval("//*")
- # write their content to the data structure
- self.idpair = 0
- for elem in res:
- attributes = elem.get_properties()
- pair = Pair()
- if( elem.name == 'pair' ):
- for attribute in attributes:
- if(attribute.name == 'text'):
- pass
- else:
- pair.set_property(attribute.name, attribute.content)
- self.pairs[str(self.idpair)] = pair
- self.idpair+=1
- elif( elem.name == 'memorize' ):
- for attribute in attributes:
- if(attribute.name == 'text'):
- pass
- elif(attribute.name == 'name'):
- self.data['name'] = attribute.content
- elif(attribute.name == 'scoresnd'):
- self.data['scoresnd'] = attribute.content
- elif(attribute.name == 'winsnd'):
- self.data['winsnd'] = attribute.content
- elif(attribute.name == 'divided'):
- self.data['divided'] = attribute.content
- elif(attribute.name == 'face'):
- self.data['face'] = attribute.content
- elif(attribute.name == 'face1'):
- self.data['face1'] = attribute.content
- elif(attribute.name == 'face2'):
- self.data['face2'] = attribute.content
- elif(attribute.name == 'align'):
- self.data['align'] = attribute.content
-
- xpa.xpathFreeContext()
- else:
- _logger.error('Read: Error in validation of the file')
- doc.freeDoc()
- return 1
- doc.freeDoc()
- return 0
- except libxml2.parserError, e:
- _logger.error('Read: Error parsing file ' +str(e))
- return 2
-
- def write(self):
- ''' writes the configuration to an xml file '''
- doc = libxml2.newDoc("1.0")
- root = doc.newChild(None, "memorize", None)
-
- if(self.data.get('name', None) != None):
- root.setProp("name", self.data['name'])
- else:
- _logger.error('Write: No name is specified. Can not write game.')
- return 1
-
- if(self.data.get('scoresnd', None) != None):
- root.setProp("scoresnd", self.data['scoresnd'])
- if(self.data.get('winsnd', None) != None):
- root.setProp("winsnd", self.data['winsnd'])
- if(self.data.get('divided', None) != None):
- root.setProp("divided", self.data['divided'])
- if(self.data.get('face', None) != None):
- root.setProp("face", self.data['face'])
- if(self.data.get('face1', None) != None):
- root.setProp("face1", self.data['face1'])
- if(self.data.get('face2', None) != None):
- root.setProp("face2", self.data['face2'])
- if(self.data.get('align', None) != None):
- root.setProp("align", self.data['align'])
+ # write their content to the data structure
+ self.idpair = 0
+ for elem in res:
+ attributes = elem.get_properties()
+ pair = Pair()
+ if(elem.name == 'pair'):
+ for attribute in attributes:
+ if(attribute.name == 'text'):
+ pass
+ else:
+ pair.set_property(attribute.name, attribute.content)
+ self.pairs[str(self.idpair)] = pair
+ self.idpair+=1
+ elif(elem.name == 'memorize'):
+ for attribute in attributes:
+ if(attribute.name == 'text'):
+ pass
+ elif(attribute.name == 'name'):
+ self.data['name'] = attribute.content
+ elif(attribute.name == 'scoresnd'):
+ self.data['scoresnd'] = attribute.content
+ elif(attribute.name == 'winsnd'):
+ self.data['winsnd'] = attribute.content
+ elif(attribute.name == 'divided'):
+ self.data['divided'] = attribute.content
+ elif(attribute.name == 'face'):
+ self.data['face'] = attribute.content
+ elif(attribute.name == 'face1'):
+ self.data['face1'] = attribute.content
+ elif(attribute.name == 'face2'):
+ self.data['face2'] = attribute.content
+ elif(attribute.name == 'align'):
+ self.data['align'] = attribute.content
+ elif(attribute.name == 'equal_pairs'):
+ self.data['equal_pairs'] = attribute.content
+ xpa.xpathFreeContext()
+ else:
+ _logger.error('Read: Error in validation of the file')
+ doc.freeDoc()
+ return 1
+ doc.freeDoc()
+ return 0
+ except libxml2.parserError, e:
+ _logger.error('Read: Error parsing file ' +str(e))
+ return 2
+
+ def write(self, equal_pairs, divided):
+ ''' writes the configuration to an xml file '''
+ doc = libxml2.newDoc("1.0")
+ root = doc.newChild(None, "memorize", None)
+
+ if(self.data.get('name', None) != None):
+ root.setProp("name", self.data['name'])
+
+ if divided:
+ root.setProp('divided', '1')
+ root.setProp('face1', '1')
+ root.setProp('face2', '2')
+ else:
+ root.setProp('divided', '0')
+
+ if equal_pairs:
+ root.setProp('equal_pairs', str(equal_pairs))
+
+ if(self.data.get('scoresnd', None) != None):
+ root.setProp("scoresnd", self.data['scoresnd'])
+ if(self.data.get('winsnd', None) != None):
+ root.setProp("winsnd", self.data['winsnd'])
+ if(self.data.get('divided', None) != None):
+ root.setProp("divided", self.data['divided'])
+ if(self.data.get('face', None) != None):
+ root.setProp("face", self.data['face'])
+ if(self.data.get('face1', None) != None):
+ root.setProp("face1", self.data['face1'])
+ if(self.data.get('face2', None) != None):
+ root.setProp("face2", self.data['face2'])
+ if(self.data.get('align', None) != None):
+ root.setProp("align", self.data['align'])
- for key in self.pairs:
- elem = root.newChild(None, "pair", None)
- if self.pairs[key].props.aimg != None:
- elem.setProp("aimg", self.pairs[key].props.aimg)
- if self.pairs[key].props.asnd != None:
- elem.setProp("asnd", self.pairs[key].props.asnd)
- if self.pairs[key].props.achar != None:
- elem.setProp("achar", self.pairs[key].props.achar)
- if self.pairs[key].props.bimg != None:
- elem.setProp("bimg", self.pairs[key].props.bimg)
- if self.pairs[key].props.bsnd != None:
- elem.setProp("bsnd", self.pairs[key].props.bsnd)
- if self.pairs[key].props.bchar != None:
- elem.setProp("bchar", self.pairs[key].props.bchar)
- # elem.setProp("color", str(self.pairs[key].props.color))
-
- if doc.validateDtd(self.ctxt, self.dtd):
- path = os.path.join(self._GAMES_PATH, self.data['name'])
- if os.path.isdir(path) is False:
- os.makedirs(path)
- doc.saveFormatFile(os.path.join(path, self.data['name']+'.mem'), 1)
- else:
- _logger.error('Write: Error in validation of the file')
- doc.freeDoc()
- return 2
- doc.freeDoc()
- return 0
-
+ for key in self.pairs:
+ elem = root.newChild(None, "pair", None)
+ if self.pairs[key].props.aimg != None:
+ elem.setProp("aimg", self.pairs[key].props.aimg)
+ if self.pairs[key].props.asnd != None:
+ elem.setProp("asnd", self.pairs[key].props.asnd)
+ if self.pairs[key].props.achar != None:
+ elem.setProp("achar", self.pairs[key].props.achar)
+ if self.pairs[key].props.bimg != None:
+ elem.setProp("bimg", self.pairs[key].props.bimg)
+ if self.pairs[key].props.bsnd != None:
+ elem.setProp("bsnd", self.pairs[key].props.bsnd)
+ if self.pairs[key].props.bchar != None:
+ elem.setProp("bchar", self.pairs[key].props.bchar)
+ # elem.setProp("color", str(self.pairs[key].props.color))
+
+ if doc.validateDtd(self.ctxt, self.dtd):
+ doc.saveFormatFile(os.path.join(self.game_path, 'game.xml'), 1)
+ else:
+ _logger.error('Write: Error in validation of the file')
+ doc.freeDoc()
+ return 2
+ doc.freeDoc()
+ return 0
+
- def def_grid(self, size):
- ''' create the grid for the play from the pairs information
- and shuffles the grid so they always appear in a different
- place
- '''
- psize=(size*size/2)
- _logger.debug('Size requested: %d' %psize)
- self.grid = []
- temp1 = []
- temp2 = []
- i=0
+ def def_grid(self, size):
+ ''' create the grid for the play from the pairs information
+ and shuffles the grid so they always appear in a different
+ place
+ '''
+ psize=(size*size/2)
+ _logger.debug('Size requested: %d' %psize)
+ self.grid = []
+ temp1 = []
+ temp2 = []
+ i=0
- # shuffle the pairs first to avoid only taking the first ones when there are more
- # pairs in the config file then the grid is using
- keys = self.pairs.keys()
- random.shuffle(keys)
+ # shuffle the pairs first to avoid only taking the first ones when there are more
+ # pairs in the config file then the grid is using
+ keys = self.pairs.keys()
+ random.shuffle(keys)
- for key in keys:
- if i < psize:
- elem = {}
- elem['pairkey'] = key
- elem['state'] = '0'
- elem['ab'] = 'a'
- if self.pairs[key].props.aimg != None:
- elem['img'] = os.path.join(self.data['pathimg'], self.pairs[key].props.aimg)
- if self.pairs[key].props.asnd != None:
- #if os.path.isfile(os.path.join(self.data['pathsnd'], self.pairs[key].props.asnd)):
- elem['snd'] = os.path.join(self.data['pathsnd'], self.pairs[key].props.asnd)
- if self.pairs[key].props.achar != None:
- elem['char'] = self.pairs[key].props.achar
- temp1.append(elem)
-
- elem = {}
- elem['pairkey'] = key
- elem['state'] = '0'
- elem['ab'] = 'b'
- if self.pairs[key].props.bimg != None:
- elem['img'] = os.path.join(self.data['pathimg'], self.pairs[key].props.bimg)
- if self.pairs[key].props.bsnd != None:
- #if os.path.isfile(os.path.join(self.data['pathsnd'], self.pairs[key].props.bsnd)):
- elem['snd'] = os.path.join(self.data['pathsnd'], self.pairs[key].props.bsnd)
- if self.pairs[key].props.bchar != None:
- elem['char'] = self.pairs[key].props.bchar
- temp2.append(elem)
- i+=1
- else:
- break
-
- numpairs = len(self.pairs)
- if numpairs < psize:
- _logger.debug('Defgrid: We did not have enough pairs. requested=%s had=%s' %(psize, numpairs))
- self.data['size'] = str(size)
+ for key in keys:
+ if i < psize:
+ elem = {}
+ elem['pairkey'] = key
+ elem['state'] = '0'
+ elem['ab'] = 'a'
+ if self.pairs[key].props.aimg != None:
+ elem['img'] = os.path.join(self.data['pathimg'], self.pairs[key].props.aimg)
+ if self.pairs[key].props.asnd != None:
+ elem['snd'] = os.path.join(self.data['pathsnd'], self.pairs[key].props.asnd)
+ if self.pairs[key].props.achar != None:
+ elem['char'] = self.pairs[key].props.achar
+ temp1.append(elem)
+
+ elem = {}
+ elem['pairkey'] = key
+ elem['state'] = '0'
+ elem['ab'] = 'b'
+ if self.pairs[key].props.bimg != None:
+ elem['img'] = os.path.join(self.data['pathimg'], self.pairs[key].props.bimg)
+ if self.pairs[key].props.bsnd != None:
+ elem['snd'] = os.path.join(self.data['pathsnd'], self.pairs[key].props.bsnd)
+ if self.pairs[key].props.bchar != None:
+ elem['char'] = self.pairs[key].props.bchar
+ temp2.append(elem)
+ i+=1
+ else:
+ break
+
+ numpairs = len(self.pairs)
+ if numpairs < psize:
+ _logger.debug('Defgrid: We did not have enough pairs. requested=%s had=%s' %(psize, numpairs))
+ self.data['size'] = str(size)
- if self.data['divided'] == '1':
- random.shuffle(temp1)
- random.shuffle(temp2)
- temp1.extend(temp2)
- else:
- temp1.extend(temp2)
- random.shuffle(temp1)
- self.grid = temp1
- _logger.debug('Defgrid: grid( size=%s ): %s' %(self.data['size'], self.grid))
+ if self.data['divided'] == '1':
+ random.shuffle(temp1)
+ random.shuffle(temp2)
+ temp1.extend(temp2)
+ else:
+ temp1.extend(temp2)
+ random.shuffle(temp1)
+ self.grid = temp1
+ _logger.debug('Defgrid: grid( size=%s ): %s' %(self.data['size'], self.grid))
-
+ def set_data_grid(self, data, grid):
+ self.data = data
+ self.grid = grid
if __name__ == '__main__':
- model = Model(os.path.dirname(__file__))
- model.data['name'] = 'hilde'
- pair = Pair()
- id = '0'
- model.pairs[id] = pair
-
- model.pairs[id].set_property('aimg', 'eva.png')
+ model = Model(os.path.dirname(__file__))
+ model.data['name'] = 'hilde'
+ pair = Pair()
+ id = '0'
+ model.pairs[id] = pair
+
+ model.pairs[id].set_property('aimg', 'eva.png')
- print [model.pairs[key].props.aimg for key in model.pairs]
- if model.write('/tmp/save.mem') != 0:
- print 'error'
-
- '''
- print 'name=%s scoresnd=%s winsnd=%s div=%s' %(model.data['name'], model.data['scoresnd'],
- model.data['winsnd'], model.data['divided'])
+ print [model.pairs[key].props.aimg for key in model.pairs]
+ if model.write('/tmp/save.mem') != 0:
+ print 'error'
+
+ '''
+ print 'name=%s scoresnd=%s winsnd=%s div=%s' %(model.data['name'], model.data['scoresnd'],
+ model.data['winsnd'], model.data['divided'])
- model.def_grid(4)
- print 'grid %s'%model.grid #['size']
+ model.def_grid(4)
+ print 'grid %s'%model.grid #['size']
- print 'Test set state of tile 7:'
- tilenum = 7
- model.grid[tilenum]['state'] = '1'
- print ' %s' %model.grid[tilenum]
+ print 'Test set state of tile 7:'
+ tilenum = 7
+ model.grid[tilenum]['state'] = '1'
+ print ' %s' %model.grid[tilenum]
- print 'Test sound:'
- snd = model.grid[tilenum].get('snd', None)
- if snd == None:
- print ' no sound'
- else:
- print ' play sound=%s'%snd
+ print 'Test sound:'
+ snd = model.grid[tilenum].get('snd', None)
+ if snd == None:
+ print ' no sound'
+ else:
+ print ' play sound=%s'%snd
- print 'Test the same function: 0 1'
- if model.grid[0]['pairkey'] == model.grid[1]['pairkey']:
- print ' they are the same'
- else:
- print ' they are NOT the same'
+ print 'Test the same function: 0 1'
+ if model.grid[0]['pairkey'] == model.grid[1]['pairkey']:
+ print ' they are the same'
+ else:
+ print ' they are NOT the same'
- for tile in model.grid:
- id = model.grid.index(tile)
- if tile.get('img', None):
- print 'we got an image=%s '%tile['img']
- elif tile.get('char', None):
- print 'we got an char=%s'%tile.get('char')
- else:
- print 'we got no pic so prepare for sound game'
-
- print '\n_______________________________\n'
-
- if model.read('addition') == 0:
- print '%s' %model.pairs[0]._properties
- print 'name=%s' %model.data['name']
- print 'scoresnd=%s' %model.data['scoresnd']
- print 'winsnd=%s' %model.data['winsnd']
- print 'div=%d' %model.data['divided']
-
- model.def_grid(12)
- for tile in model.grid:
- id = model.grid.index(tile)
- if tile.get('img', None):
- print 'we got an image=%s '%tile.get('img')
- elif tile.get('char', None):
- print 'we got an char=%s'%tile.get('char')
- else:
- print 'we got no img so prepare for sound game'
+ for tile in model.grid:
+ id = model.grid.index(tile)
+ if tile.get('img', None):
+ print 'we got an image=%s '%tile['img']
+ elif tile.get('char', None):
+ print 'we got an char=%s'%tile.get('char')
+ else:
+ print 'we got no pic so prepare for sound game'
+
+ print '\n_______________________________\n'
+
+ if model.read('addition') == 0:
+ print '%s' %model.pairs[0]._properties
+ print 'name=%s' %model.data['name']
+ print 'scoresnd=%s' %model.data['scoresnd']
+ print 'winsnd=%s' %model.data['winsnd']
+ print 'div=%d' %model.data['divided']
+
+ model.def_grid(12)
+ for tile in model.grid:
+ id = model.grid.index(tile)
+ if tile.get('img', None):
+ print 'we got an image=%s '%tile.get('img')
+ elif tile.get('char', None):
+ print 'we got an char=%s'%tile.get('char')
+ else:
+ print 'we got no img so prepare for sound game'
- else:
- print 'error during reading of the game'
+ else:
+ print 'error during reading of the game'
- print '\n_______________________________\n'
- if model.read('numbers') == 0:
- print '%s' %model.pairs[0]._properties
- print 'name=%s' %model.data['name']
- print 'scoresnd=%s' %model.data['scoresnd']
- print 'winsnd=%s' %model.data['winsnd']
- print 'div=%d' %model.data['divided']
- print 'face1=%s' %model.data['face1']
- print 'face2=%s' %model.data['face2']
-
- model.def_grid(12)
- for tile in model.grid:
- id = model.grid.index(tile)
- if tile.get('img', None):
- print 'we got an image=%s '%tile.get('img')
- elif tile.get('char', None):
- print 'we got an char=%s'%tile.get('char')
- else:
- print 'we got no img so prepare for sound game'
+ print '\n_______________________________\n'
+ if model.read('numbers') == 0:
+ print '%s' %model.pairs[0]._properties
+ print 'name=%s' %model.data['name']
+ print 'scoresnd=%s' %model.data['scoresnd']
+ print 'winsnd=%s' %model.data['winsnd']
+ print 'div=%d' %model.data['divided']
+ print 'face1=%s' %model.data['face1']
+ print 'face2=%s' %model.data['face2']
+
+ model.def_grid(12)
+ for tile in model.grid:
+ id = model.grid.index(tile)
+ if tile.get('img', None):
+ print 'we got an image=%s '%tile.get('img')
+ elif tile.get('char', None):
+ print 'we got an char=%s'%tile.get('char')
+ else:
+ print 'we got no img so prepare for sound game'
- else:
- print 'error during reading of the game'
- '''
+ else:
+ print 'error during reading of the game'
+ '''
diff --git a/playerscoreboard.py b/playerscoreboard.py
index 32bf551..e7f2835 100755
--- a/playerscoreboard.py
+++ b/playerscoreboard.py
@@ -21,9 +21,12 @@ import gtk, pygtk
import pango
import svglabel
+import logging
import os
from score import Score
+_logger = logging.getLogger('memorize-activity')
+
class PlayerScoreboard(gtk.EventBox):
def __init__(self, nick, fill_color, stroke_color,score = 0):
@@ -77,6 +80,7 @@ class PlayerScoreboard(gtk.EventBox):
self.increase_score()
def increase_score(self):
+ _logger.debug('Increase to: '+self.nick.get_text())
if len(self.scores) == 0:
# Cache the score icon
score_label = Score(self.fill_color, self.stroke_color)
diff --git a/scoreboard.py b/scoreboard.py
index 9b88c27..847c38d 100755
--- a/scoreboard.py
+++ b/scoreboard.py
@@ -18,8 +18,11 @@
#
import gtk
+import logging
from playerscoreboard import PlayerScoreboard
+_logger = logging.getLogger('memorize-activity')
+
class Scoreboard(gtk.EventBox):
def __init__(self):
gtk.EventBox.__init__(self)
@@ -42,7 +45,7 @@ class Scoreboard(gtk.EventBox):
scroll.set_border_width(0)
scroll.get_child().set_property('shadow-type', gtk.SHADOW_NONE)
self.add(scroll)
- self.show()
+ self.show_all()
def add_buddy(self, widget, buddy, score):
### FIXME: this breaks when the body is empty
@@ -55,9 +58,7 @@ class Scoreboard(gtk.EventBox):
if score == -1:
player.set_wait_mode(True)
self.show_all()
-
-
def rem_buddy(self, widget, buddy):
self.vbox.remove(self.players[buddy])
del self.players[buddy] ### fix for self.players[id]
@@ -71,6 +72,7 @@ class Scoreboard(gtk.EventBox):
player.set_selected(True)
def increase_score(self, widget, buddy):
+ _logger.debug('Increase to: '+buddy.props.nick)
self.players[buddy].increase_score()
def reset(self, widget):
diff --git a/svgcard.py b/svgcard.py
index cd88743..7423b38 100755
--- a/svgcard.py
+++ b/svgcard.py
@@ -67,7 +67,7 @@ class SvgCard(gtk.DrawingArea):
self.props[view].update(self.default_props[view])
self.props[view].update(pprops.get(view, {}))
- if len(self.props['back_text'].get('card_text','')) > 0:
+ if len(self.props['back_text'].get('card_text', '')) > 0:
self.back_layout = self.get_text_layout(self.props['back_text']['card_text'], self.size-12)
self.back_layout_position = (self.size -(self.back_layout.get_size()[1]/1000))/2
self.current_layout = self.back_layout
@@ -123,8 +123,27 @@ class SvgCard(gtk.DrawingArea):
self.props['front'].update({'fill_color':fill_color, 'stroke_color':stroke_color})
self.queue_draw()
while gtk.events_pending():
- gtk.main_iteration()
-
+ gtk.main_iteration()
+
+ def set_pixbuf(self, pixbuf):
+ if pixbuf == None:
+ self.jpeg = None
+ self.show_jpeg = False
+ else:
+ if self.jpeg != None:
+ del self.jpeg
+
+ self.jpeg = pixbuf
+ del pixbuf
+ self.show_jpeg = True
+
+ self.queue_draw()
+ while gtk.events_pending():
+ gtk.main_iteration()
+
+ def get_pixbuf(self):
+ return self.jpeg
+
def set_highlight(self, status, mouse = False):
if self.flipped:
if mouse:
@@ -145,16 +164,21 @@ class SvgCard(gtk.DrawingArea):
if not self.flipped_once:
if self.jpeg <> None:
pixbuf_t = gtk.gdk.pixbuf_new_from_file(self.jpeg)
- self.jpeg = pixbuf_t.scale_simple(self.size-22, self.size-22, gtk.gdk.INTERP_BILINEAR)
- del pixbuf_t
- if len(self.props.get('front_text',[]).get('card_text','')) > 0:
+ if pixbuf_t.get_width() != self.size-22 or pixbuf_t.get_height() != self.size-22:
+ self.jpeg = pixbuf_t.scale_simple(self.size-22, self.size-22, gtk.gdk.INTERP_BILINEAR)
+ del pixbuf_t
+ else:
+ self.jpeg = pixbuf_t
+ text = self.props.get('front_text', {}).get('card_text', '')
+ if text != None and len(text) > 0:
self.front_layout = self.get_text_layout(self.props['front_text']['card_text'], self.size-12)
self.front_layout_position = (self.size -(self.front_layout.get_size()[1]/1000))/2
self.flipped_once = True
if self.jpeg <> None:
self.show_jpeg = True
- if len(self.props['front_text'].get('card_text','')) > 0:
+ text = self.props.get('front_text', {}).get('card_text', '')
+ if text != None and len(text) > 0:
self.current_layout = self.front_layout
self.current_layout_position = self.front_layout_position
self.current_text_color = self.props['front_text']['text_color']
@@ -173,7 +197,7 @@ class SvgCard(gtk.DrawingArea):
def flop(self):
self.current_face = 'back'
- if len(self.props['back_text'].get('card_text','')) > 0:
+ if len(self.props['back_text'].get('card_text', '')) > 0:
self.current_layout = self.back_layout
self.current_layout_position = self.back_layout_position
self.current_text_color = self.props['back_text']['text_color']
@@ -198,13 +222,12 @@ class SvgCard(gtk.DrawingArea):
self.flop()
def get_text_layout(self, text, size):
- if self.size == 184:
- font_sizes = [50, 40, 26, 20, 17, 13, 11, 8]
+ if self.size == 119:
+ font_sizes = [30, 24, 16, 13, 10, 8, 8, 8]
elif self.size == 145:
font_sizes = [45, 28, 20, 16, 13, 11, 9, 8]
- elif self.size == 119:
- font_sizes = [30, 24, 16, 13, 10, 8, 8, 8]
-
+ else:
+ font_sizes = [50, 40, 26, 20, 17, 13, 11, 8]
# Set font size considering string length
if len(text) <= 8:
font_size = font_sizes[len(text)-1]
@@ -241,4 +264,4 @@ class SvgCard(gtk.DrawingArea):
self.show_text = True
self.queue_draw()
def get_text(self):
- return self.props['front_text']['card_text'] \ No newline at end of file
+ return self.props['front_text'].get('card_text', '')