Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSai Vineet <saivineet89@gmail.com>2014-01-06 10:54:57 (GMT)
committer Sai Vineet <saivineet89@gmail.com>2014-01-06 14:02:07 (GMT)
commit017a3bee19e677289f63f6eaef3495458ae7400c (patch)
tree132078ef4abee09ca5ce5159f24ce2940dc79c41
parentd44edb28f684caef741442e83bda63fbbbe5e44f (diff)
Added Palette frameworkHEADmaster
Also a bugix about the clear trace and the clear all tool's active or non active state.
-rw-r--r--activity.py132
-rw-r--r--icons/anvil.svg48
-rw-r--r--icons/basketball.svg86
-rw-r--r--icons/bowling-ball.svg50
-rw-r--r--icons/feather.svg55
-rw-r--r--icons/grass.svg48
-rw-r--r--icons/ice-skate.svg52
-rw-r--r--icons/motor-rabbit.svg64
-rw-r--r--icons/motor-turtle.svg64
-rw-r--r--icons/sandpaper.svg55
-rw-r--r--icons/tennis-ball.svg60
-rw-r--r--icons/wood.svg398
-rw-r--r--physics.py9
-rw-r--r--tools.py332
14 files changed, 1340 insertions, 113 deletions
diff --git a/activity.py b/activity.py
index 129974b..823143a 100644
--- a/activity.py
+++ b/activity.py
@@ -41,6 +41,8 @@ from sugar.graphics.toolbarbox import ToolbarBox
from sugar.graphics.toolbarbox import ToolbarButton
from sugar.graphics.style import GRID_CELL_SIZE
from sugar.datastore import datastore
+from sugar.graphics.icon import Icon
+from sugar.graphics import style
import tools
import physics
@@ -214,19 +216,122 @@ class PhysicsActivity(activity.Activity):
button.set_group(None)
firstButton = button
- if c.name == tools.EraseAllTool.name:
- # Add a separator - Erase all tool is a dangerous tool
- separator = gtk.SeparatorToolItem()
- _insert_item(create_toolbar, separator, -1)
- separator.show()
-
button.set_tooltip(c.toolTip)
button.set_accelerator(c.toolAccelerator)
button.connect('clicked', self.radioClicked)
+ palette = self._build_palette(c)
+ if palette is not None:
+ button.get_palette().set_content(palette)
_insert_item(create_toolbar, button, -1)
button.show()
self.radioList[button] = c.name
+ def __icon_path(self, name):
+ activity_path = activity.get_bundle_path()
+ icon_path = os.path.join(activity_path, 'icons',
+ name+".svg")
+ return icon_path
+
+ def _build_palette(self, tool):
+ if tool.palette_enabled:
+ if tool.palette_mode == tools.PALETTE_MODE_SLIDER_ICON:
+ settings = tool.palette_settings
+ hbox = gtk.HBox()
+ hbox.set_size_request(-1, 50)
+
+ icon1 = Icon()
+ icon1.set_file(self.__icon_path(settings['icon1']))
+ icon2 = Icon()
+ icon2.set_file(self.__icon_path(settings['icon2']))
+
+ adj = gtk.Adjustment(lower=settings['min'],
+ upper=settings['max'],
+ step_incr=1)
+ slider = gtk.HScale(adjustment=adj)
+ slider.set_size_request(200, 25)
+ slider.connect("value-changed", self._slider_palette,
+ tool.name)
+ slider.set_value(settings['min'])
+
+ hbox.pack_start(icon1, False, False, 0)
+ hbox.pack_start(slider, True, True, 0)
+ hbox.pack_start(icon2, False, False, 0)
+ hbox.show_all()
+ return hbox
+ elif tool.palette_mode == tools.PALETTE_MODE_SLIDER_LABEL:
+ table = gtk.Table(rows=len(tool.palette_settings), columns=2)
+
+ table.set_row_spacings(spacing=style.DEFAULT_SPACING)
+ table.set_col_spacings(spacing=style.DEFAULT_SPACING)
+ for row, settings in enumerate(tool.palette_settings):
+ label = gtk.Label(settings["label"])
+
+ adj = gtk.Adjustment(lower=settings['min'],
+ upper=settings['max'],
+ step_incr=1)
+ slider = gtk.HScale(adjustment=adj)
+
+ slider.set_size_request(200, 50)
+ slider.connect("value-changed", self._slider_label_palette,
+ tool.name, settings['data'])
+ slider.set_value(settings['min'])
+
+ table.attach(label,
+ left_attach=0,
+ right_attach=1,
+ top_attach=row,
+ bottom_attach=row+1)
+ table.attach(slider,
+ left_attach=1,
+ right_attach=2,
+ top_attach=row,
+ bottom_attach=row+1)
+ table.show_all()
+ return table
+ elif tool.palette_mode == tools.PALETTE_MODE_ICONS:
+ vbox = gtk.VBox()
+ for settings in tool.palette_settings:
+ hbox = gtk.HBox()
+ firstButton = None
+ for i in range(0, settings['icon_count']):
+ button = RadioToolButton(
+ named_icon=settings['icons'][i])
+ if firstButton:
+ button.set_group(firstButton)
+ else:
+ button.set_group(None)
+ firstButton = button
+ button.connect('clicked',
+ self._palette_icon_clicked,
+ tool.name,
+ settings['name'],
+ settings['icon_values'][i])
+ if settings['active'] == settings['icons'][i]:
+ button.set_active(True)
+ hbox.pack_start(button, False, False, 0)
+ vbox.add(hbox)
+ vbox.show_all()
+ return vbox
+
+ return None
+
+ def _palette_icon_clicked(self, button, toolname, value_name, value):
+ for tool in tools.allTools:
+ if tool.name == toolname:
+ tool.palette_data[value_name] = value
+
+ def _slider_label_palette(self, slider, toolname, dataname):
+ value = slider.get_value()
+ for tool in tools.allTools:
+ if tool.name == toolname:
+ tool.palette_data[dataname] = value
+
+ def _slider_palette(self, slider, toolname):
+ value = slider.get_value()
+ for tool in tools.allTools:
+ if tool.name == toolname:
+ tool.palette_data = value
+
def clear_trace_alert_cb(self, alert, response):
self.remove_alert(alert)
if response is gtk.RESPONSE_OK:
@@ -259,13 +364,14 @@ class PhysicsActivity(activity.Activity):
if response_id is gtk.RESPONSE_OK:
pygame.event.post(pygame.event.Event(pygame.USEREVENT,
action='clear_all'))
-
- clear_all_alert = ConfirmationAlert()
- clear_all_alert.props.title = _('Are You Sure?')
- clear_all_alert.props.msg = \
- _('All your work will be discarded. This cannot be undone!')
- clear_all_alert.connect('response', clear_all_alert_cb)
- self.add_alert(clear_all_alert)
+ if len(self.game.world.world.GetBodyList()) > 2:
+ print len(self.game.world.world.GetBodyList())
+ clear_all_alert = ConfirmationAlert()
+ clear_all_alert.props.title = _('Are You Sure?')
+ clear_all_alert.props.msg = \
+ _('All your work will be discarded. This cannot be undone!')
+ clear_all_alert.connect('response', clear_all_alert_cb)
+ self.add_alert(clear_all_alert)
def radioClicked(self, button):
pygame.event.post(pygame.event.Event(pygame.USEREVENT,
diff --git a/icons/anvil.svg b/icons/anvil.svg
new file mode 100644
index 0000000..f088e41
--- /dev/null
+++ b/icons/anvil.svg
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="52px"
+ viewBox="0 571.25 100 52"
+ enable-background="new 0 571.25 100 52"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_3891.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="761"
+ inkscape:window-height="480"
+ id="namedview5"
+ showgrid="false"
+ inkscape:zoom="2.92"
+ inkscape:cx="50"
+ inkscape:cy="26"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" />
+<path
+ d="M85.615,572.219v2.505c-0.718,1.113-1.968,1.853-3.39,1.853c-1.319,0-2.491-0.64-3.226-1.622v-3.704H24.781v0.969H0.094 v1.238c0.93,11.716,11.686,19.36,21.513,20.015c0.221,0.016,0.444,0.025,0.665,0.033c3.686,0.35,6.543,3.495,6.543,7.273 c0,2.02-0.826,3.847-2.157,5.164h-2.266v17.308h54.381v-17.308h-2.266c-2.514-1.188-4.253-3.746-4.253-6.712 c0-4.1,3.324-7.424,7.425-7.424c2.425,0,4.581,1.166,5.937,2.968v0.194h14.291v-22.75H85.615L85.615,572.219z"
+ id="path3"
+ style="fill:#ffffff;fill-opacity:1" />
+</svg> \ No newline at end of file
diff --git a/icons/basketball.svg b/icons/basketball.svg
new file mode 100644
index 0000000..4b9ecfe
--- /dev/null
+++ b/icons/basketball.svg
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="100px"
+ viewBox="0 0 100 100"
+ enable-background="new 0 0 100 100"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_3016.svg"><metadata
+ id="metadata23"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs21" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="761"
+ inkscape:window-height="480"
+ id="namedview19"
+ showgrid="false"
+ inkscape:zoom="2.36"
+ inkscape:cx="50"
+ inkscape:cy="50"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" />
+<path
+ fill="#010101"
+ d="M34.096,87.131c0.733,3.924,1.772,7.68,3.125,11.215c4.081,1.075,8.362,1.654,12.78,1.654 c5.802,0,11.368-0.999,16.548-2.816c-7.291-1.649-12.67-3.692-17.502-5.533C44.073,89.756,39.628,88.066,34.096,87.131z"
+ id="path3"
+ style="fill:#ffffff;fill-opacity:1" />
+<path
+ fill="#010101"
+ d="M16.133,86.771c5.212,4.804,11.446,8.506,18.341,10.756c-1.199-3.428-2.121-7.026-2.791-10.745 C27.406,86.266,22.433,86.189,16.133,86.771z"
+ id="path5"
+ style="fill:#ffffff;fill-opacity:1" />
+<path
+ fill="#010101"
+ d="M31.297,84.459c-0.35-2.314-0.606-4.67-0.78-7.052c-12.685-2.49-22.74-7.078-28.392-12.974 c2.32,7.705,6.451,14.619,11.895,20.265C21.036,83.939,26.587,83.943,31.297,84.459z"
+ id="path7"
+ style="fill:#ffffff;fill-opacity:1" />
+<path
+ fill="#010101"
+ d="M26.386,62.896c1.147,0.599,2.469,1.125,3.967,1.49C31.544,36.795,41.811,8.892,50.14,0.004 C50.093,0.003,50.049,0,50.001,0C35.055,0,21.646,6.568,12.483,16.967C7.823,29.952,12.04,55.42,26.386,62.896z"
+ id="path9"
+ style="fill:#ffffff;fill-opacity:1" />
+<path
+ fill="#010101"
+ d="M30.372,75.027c-0.136-2.754-0.165-5.533-0.097-8.323c-1.888-0.408-3.536-1.05-4.943-1.783 C11.51,57.719,6.447,36.023,8.99,21.413C3.33,29.516,0,39.367,0,50c0,2.982,0.276,5.898,0.777,8.738 C4.521,66.052,15.61,72,30.372,75.027z"
+ id="path11"
+ style="fill:#ffffff;fill-opacity:1" />
+<path
+ fill="#010101"
+ d="M32.713,64.798c10.769,1.151,28.922-6.379,55.191-47.383C79.42,7.554,67.164,1.044,53.369,0.126 C45.312,5.787,33.938,35.678,32.713,64.798z"
+ id="path13"
+ style="fill:#ffffff;fill-opacity:1" />
+<path
+ fill="#010101"
+ d="M45.622,79.277c-4.445-0.256-8.703-0.741-12.724-1.432c0.179,2.346,0.442,4.656,0.796,6.926 c6.188,0.946,10.987,2.772,16.163,4.744c5.467,2.082,11.645,4.428,20.527,6.137c12.652-5.658,22.519-16.418,26.988-29.668 C85.82,77.213,63.209,80.294,45.622,79.277z"
+ id="path15"
+ style="fill:#ffffff;fill-opacity:1" />
+<path
+ fill="#010101"
+ d="M32.64,67.068c-0.066,2.826-0.034,5.639,0.11,8.414c4.106,0.735,8.462,1.254,13.003,1.517 c18.884,1.091,43.675-2.563,53.067-16.218C99.584,57.309,100,53.704,100,50c0-11.591-3.957-22.251-10.576-30.732 C62.98,60.32,44.125,68.164,32.64,67.068z"
+ id="path17"
+ style="fill:#ffffff;fill-opacity:1" />
+</svg> \ No newline at end of file
diff --git a/icons/bowling-ball.svg b/icons/bowling-ball.svg
new file mode 100644
index 0000000..f18f465
--- /dev/null
+++ b/icons/bowling-ball.svg
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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="Layer_1"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="100px"
+ viewBox="0 0 100 100"
+ enable-background="new 0 0 100 100"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_657.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="761"
+ inkscape:window-height="480"
+ id="namedview5"
+ showgrid="false"
+ inkscape:zoom="2.36"
+ inkscape:cx="50"
+ inkscape:cy="50"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" />
+<path
+ d="M50,0C22.385,0,0,22.385,0,50S22.385,100,50,100c27.614,0,50-22.387,50-50.001S77.614,0,50,0z M55.407,31.781 c-3.286,0-5.951-2.665-5.951-5.951c0.001-3.287,2.665-5.951,5.952-5.952c3.286,0,5.951,2.665,5.951,5.952 C61.359,29.117,58.694,31.781,55.407,31.781z M73.166,49.541c-3.285,0-5.95-2.665-5.95-5.951c0-3.287,2.665-5.951,5.951-5.951 c3.287,0,5.95,2.665,5.95,5.951C79.117,46.876,76.454,49.541,73.166,49.541z M76.374,28.576c-3.287,0-5.951-2.665-5.951-5.951 c0-3.287,2.664-5.951,5.951-5.952c3.286,0,5.95,2.665,5.95,5.952C82.324,25.911,79.661,28.576,76.374,28.576z"
+ id="path3"
+ style="fill:#ffffff;fill-opacity:1" />
+</svg> \ No newline at end of file
diff --git a/icons/feather.svg b/icons/feather.svg
new file mode 100644
index 0000000..e05c446
--- /dev/null
+++ b/icons/feather.svg
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="100px"
+ viewBox="0 0 100 100"
+ enable-background="new 0 0 100 100"
+ xml:space="preserve"
+ id="svg2"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_23173.svg"><metadata
+ id="metadata12"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs10" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="761"
+ inkscape:window-height="480"
+ id="namedview8"
+ showgrid="false"
+ inkscape:zoom="2.36"
+ inkscape:cx="50"
+ inkscape:cy="50"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg2" />
+<g
+ id="Your_Icon">
+</g>
+<g
+ id="ICONS"
+ style="fill:#ffffff;fill-opacity:1">
+ <path
+ d="M27.705,98.258c0.728-10.187,1.262-13.813,3.688-19.877c1.021-2.552-11.873-16.319-1.02-30.325 c-2.096,5.91,3.671,12.707,2.85,19.826c1.723-6.641-4.302-18.099-1.308-22.404c0,0,8.205-14.292,15.116-19.112 c-2.001,4.957-1.591,9.14-1.182,11.095c0.5-7.821,2.819-13.187,5.729-15.46c0,0-2.273,3.501-2.318,11.595 c1.416-6.218,2.91-15.051,7.002-17.825c0,0,16.917-13.248,21.161-13.672c-0.282,0.472-0.448,0.588-0.448,1.497 c0,0,1.509-1.891,5.025-1.982c-1.698,1.303-3.032,2.638-2.729,3.365c0.303,0.727,1.334,0.424,1.879-0.152 c0.546-0.576-4.789,11.763-20.25,23.767c-1.365,0.637,8.912-4.547,11.551-9.094c-0.933,5.862-2.365,11.096-8.096,14.916 c-0.637,1.091-0.734,1.8-2,2.364c-2.092,2.41-12.323,5.457-12.959,6.23c0,0,8.684-1.91,12.231-4.82 c0.456-0.682-3.091,8.777-6.639,12.705c-2.728,2.984-0.454,11.713-18.006,19.626c4.367-1.453,6.093-2.183,7.548-3.001 c1.456-0.819,3.615-2.107,3.547-3.093C47.168,74.976,33.49,78.428,32.98,80.16c-2.687,1.195-2.972,13.85-2.638,14.551 C31.252,96.621,27.705,98.258,27.705,98.258z"
+ id="path6"
+ style="fill:#ffffff;fill-opacity:1" />
+</g>
+</svg> \ No newline at end of file
diff --git a/icons/grass.svg b/icons/grass.svg
new file mode 100644
index 0000000..0e52491
--- /dev/null
+++ b/icons/grass.svg
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="100px"
+ viewBox="0 0 100 100"
+ enable-background="new 0 0 100 100"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_18888.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="761"
+ inkscape:window-height="406"
+ id="namedview5"
+ showgrid="false"
+ inkscape:zoom="2.36"
+ inkscape:cx="50"
+ inkscape:cy="50"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" />
+<path
+ d="M14.68,87.788h73.267c-1.915-23.132,8.985-60.614,8.985-60.614s-13.685,9.321-22.387,30.897 c2.923-23.423,13.946-45.859,13.946-45.859S68.824,23.559,58.147,51.52c-7.315-22.784-20.296-28.566-20.296-28.566 s8.222,19.635,5.287,44.735C35.588,29.466,9.72,17.328,9.72,17.328S23.896,43.341,25.742,67.71 C17.113,47.687,3.068,38.299,3.068,38.299S16.46,69.961,14.68,87.788z"
+ id="path3"
+ style="fill:#ffffff;fill-opacity:1" />
+</svg> \ No newline at end of file
diff --git a/icons/ice-skate.svg b/icons/ice-skate.svg
new file mode 100644
index 0000000..c2215bd
--- /dev/null
+++ b/icons/ice-skate.svg
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="100px"
+ viewBox="0 0 100 100"
+ enable-background="new 0 0 100 100"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_1694.svg"><metadata
+ id="metadata11"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs9" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="761"
+ inkscape:window-height="480"
+ id="namedview7"
+ showgrid="false"
+ inkscape:zoom="2.36"
+ inkscape:cx="50"
+ inkscape:cy="50"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" />
+<g
+ id="g3"
+ style="fill:#ffffff;fill-opacity:1">
+ <path
+ d="M24.133,75.455c1.672,4.369,5.093,8.401,12.127,8.401h24.675c0,0,5.488,0.176,4.754-5.537 c-0.094-0.734-0.406-1.713-0.852-2.496c-7.48,0.131-13.525-0.302-17.884-3.232c-7.837-5.271-15.544-4.968-15.544-4.968 l-0.102,7.832H24.133L24.133,75.455z M70.914,75.796c0.424,0.872,0.814,1.657,1.146,2.282c2.041,3.837,3.266,5.778,10.531,5.778 c7.264,0,14.127-0.391,7.186-9.213c-0.098-0.126-0.199-0.246-0.303-0.372c-3.057,0.404-7.562,0.872-13.988,1.263 C73.918,75.626,72.395,75.719,70.914,75.796L70.914,75.796z M48.743,13.077c0,0-0.182,14.146,1.385,20.079 c4.181,15.837,18.185,23.736,34.294,26.437c14.861,2.489,10.697,13.685,10.697,13.685s-0.588,0.173-2.062,0.443 c2.195,3.013,4.027,6.214,5.439,9.56c-1.971,1.694-4.293,3.261-6.92,4.673c-14.049,1.158-30.301,1.823-48.922,1.823 c-14.659,0-28.558-0.644-41.596-1.416c-0.271-0.255-0.364-0.965-0.207-1.547c0.932-3.435,4.083-3.348,4.083-3.348l9.813-0.576 c2.798-0.099,5.503-1.812,4.313-5.06c-0.188-0.509-1.089-2.375-1.089-2.375h-5.163h-0.32l-0.474-9.473 c-0.17-1.597-0.368-3.109-0.584-4.27c-2.023-10.896,2.077-17.075,4.024-25.359c0.182-0.771,0.308-1.707,0.391-2.773 c0.083-4.627-0.036-9.637-0.036-16.783l25.477-8.616C46.038,6.647,48.906,8.888,48.743,13.077L48.743,13.077z"
+ id="path5"
+ style="fill:#ffffff;fill-opacity:1" />
+</g>
+</svg> \ No newline at end of file
diff --git a/icons/motor-rabbit.svg b/icons/motor-rabbit.svg
new file mode 100644
index 0000000..cc146d7
--- /dev/null
+++ b/icons/motor-rabbit.svg
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="84px"
+ viewBox="0 0 100 84"
+ enable-background="new 0 0 100 84"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="motor-turtle.svg"><metadata
+ id="metadata3876"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>Slice 1</dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs3874" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1360"
+ inkscape:window-height="711"
+ id="namedview3872"
+ showgrid="false"
+ inkscape:zoom="2.8095238"
+ inkscape:cx="50"
+ inkscape:cy="42"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_1" />
+<title
+ id="title3864">Slice 1</title>
+<description
+ id="description3866">Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
+<g
+ id="Page_1"
+ style="fill:#ffffff;fill-opacity:1">
+ <g
+ id="Path_1"
+ style="fill:#ffffff;fill-opacity:1">
+ </g>
+ <path
+ id="Path_1_1_"
+ d="M88,33c0,0,11,6,11,11c-2,8-11,3-13,8c-2,14-13,17-13,17s0,2,1,3s9,9,3,9c-7,0-9-10-15-8c-3,1-5,2-8,3 c1,0,2,0,2,0c7,3,5,5,5,5H20c-1-1-1-3,0-4c-3-2-7-6-8-10l0,0C5,67,0,62,0,56c0-5,5-10,12-10c1,0,1,0,2,1c0-1,1-1,1-1 c17-28,47-8,47-8s8,3,11-3C55,17,52,2,55,2c5,0,18,18,18,18S56-8,70,2C84,13,88,33,88,33z"
+ style="fill:#ffffff;fill-opacity:1" />
+ <path
+ id="Path_1_decoration"
+ d="M0,0"
+ style="fill:#ffffff;fill-opacity:1" />
+</g>
+</svg> \ No newline at end of file
diff --git a/icons/motor-turtle.svg b/icons/motor-turtle.svg
new file mode 100644
index 0000000..b7fb511
--- /dev/null
+++ b/icons/motor-turtle.svg
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="77px"
+ viewBox="0 0 100 77"
+ enable-background="new 0 0 100 77"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_5353.svg"><metadata
+ id="metadata15"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>Slice 1</dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs13" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="761"
+ inkscape:window-height="480"
+ id="namedview11"
+ showgrid="false"
+ inkscape:zoom="2.92"
+ inkscape:cx="50"
+ inkscape:cy="38.5"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" />
+<title
+ id="title3">Slice 1</title>
+<description
+ id="description5">Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
+<g
+ id="Page_1"
+ style="fill:#ffffff;fill-opacity:1">
+ <g
+ id="Path_2"
+ style="fill:#ffffff;fill-opacity:1">
+ </g>
+ <path
+ id="Path_2_1_"
+ d="M63,25c2-2,12-13,23-13c13,1,24,29-10,24c-3-1-5,0-6,0c2,6,1,12,1,14c0,1-2,3-6,5c0,3,1,9-1,11 c-3,3-11,3-15,0c-1-1-2-4-1-7c-3,0-5,0-6,0c-3,0-5,0-8,0c0,3,0,6-1,7c-3,3-11,3-15,0c-2-2-2-6-1-10c-1,0-3-1-4-2c-5,2-12,3-13,2 c0-3,6-4,11-8c-1-10-4-32,28-31C50,17,58,21,63,25z"
+ style="fill:#ffffff;fill-opacity:1" />
+ <path
+ id="Path_2_decoration"
+ d="M0,0"
+ style="fill:#ffffff;fill-opacity:1" />
+</g>
+</svg> \ No newline at end of file
diff --git a/icons/sandpaper.svg b/icons/sandpaper.svg
new file mode 100644
index 0000000..414fc8f
--- /dev/null
+++ b/icons/sandpaper.svg
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ x="0px"
+ y="0px"
+ width="99.917px"
+ height="59.587px"
+ viewBox="0 0 99.917 59.587"
+ enable-background="new 0 0 99.917 59.587"
+ xml:space="preserve"
+ id="svg2"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_24412.svg"><metadata
+ id="metadata12"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs10" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="761"
+ inkscape:window-height="480"
+ id="namedview8"
+ showgrid="false"
+ inkscape:zoom="2.9224256"
+ inkscape:cx="49.9585"
+ inkscape:cy="29.793501"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg2" />
+<g
+ id="Your_Icon">
+</g>
+<g
+ id="_x31_col"
+ style="fill:#ffffff;fill-opacity:1">
+ <path
+ d="M96.174,38.827c-4.369-3.158-23.038-14.079-39.141-35.068C55.748,2.044,54.38-0.022,51.471,0c-0.02,0-0.034,0-0.048,0.003 V0c-0.022,0-0.042,0.003-0.062,0.006h-0.02c-3.054,0.128-4.733,2.345-6.538,4.444C30.356,21.774,9.74,35.752,4.185,38.214 c-2.45,1.05-4.196,2.94-4.185,5.302c0.22,4.094,4.127,7.188,10.272,10.096c6.811,3.068,23.178,5.95,41.168,5.976 c8.712,0,17.765-0.695,26.188-2.455c16.309-3.548,21.895-7.168,22.289-12.324C99.856,42.046,97.973,40.155,96.174,38.827z M93.003,48.589c-1.666,0.958-4.062,1.963-7.278,2.963c0.002-0.034,0.02-0.064,0.02-0.098c0-0.886-0.714-1.601-1.596-1.601 c-0.886,0-1.604,0.715-1.604,1.601c0,0.348,0.136,0.656,0.328,0.922c-1.746,0.468-3.679,0.93-5.836,1.384 c-0.276-0.477-0.771-0.811-1.362-0.811c-0.782,0-1.405,0.579-1.542,1.325c-7.334,1.303-15.12,1.894-22.693,1.894 c-7.192,0.012-14.182-0.495-20.34-1.275c0.295-0.406,0.504-0.882,0.504-1.423c0-1.379-1.12-2.503-2.5-2.503 c-1.379,0-2.501,1.124-2.501,2.503c0,0.287,0.075,0.557,0.165,0.816c-1.278-0.204-2.498-0.419-3.67-0.639 c0.025-0.111,0.067-0.214,0.067-0.334c0-0.889-0.719-1.601-1.601-1.601c-0.78,0-1.403,0.568-1.542,1.312 c-3.625-0.805-6.502-1.68-8.329-2.522C5.851,47.94,3.2,44.688,3.425,43.516c0.006-0.579,0.301-1.301,2.158-2.172 c2.489-1.137,7.128-3.954,12.73-8.011c0.083,0.804,0.738,1.439,1.562,1.439c0.88,0,1.593-0.712,1.593-1.599 c0-0.652-0.393-1.208-0.952-1.459c5.221-3.909,11.099-8.787,16.823-14.318c-0.005,0.059-0.034,0.106-0.034,0.163 c0,1.664,1.337,3.012,3.008,3.012c1.66,0,3.001-1.348,3.001-3.012c0-1.661-1.342-3.005-3.001-3.005 c-0.047,0-0.086,0.024-0.134,0.024c2.498-2.536,4.945-5.179,7.253-7.933c1.863-2.277,3.026-3.293,4.013-3.221h0.077l0.033-0.006 c1.028,0.039,1.14,0.368,2.763,2.425c16.45,21.49,35.78,32.793,39.848,35.749c1.465,1.042,2.393,2.355,2.331,3.214 C96.512,45.536,95.979,46.873,93.003,48.589z M9.562,45.657c-0.88,0-1.599,0.715-1.599,1.595c0,0.883,0.719,1.601,1.599,1.601 c0.886,0,1.598-0.718,1.598-1.601C11.16,46.372,10.448,45.657,9.562,45.657z M12.798,40.155c-0.88,0-1.602,0.715-1.602,1.595 c0,0.886,0.721,1.601,1.602,1.601c0.879,0,1.592-0.715,1.592-1.601C14.39,40.87,13.677,40.155,12.798,40.155z M29.877,45.248 c-0.879,0-1.598,0.715-1.598,1.597c0,0.884,0.719,1.603,1.598,1.603c0.886,0,1.604-0.719,1.604-1.603 C31.481,45.963,30.763,45.248,29.877,45.248z M60.183,40.765c-0.88,0-1.596,0.716-1.596,1.601c0,0.883,0.716,1.599,1.596,1.599 c0.888,0,1.604-0.716,1.604-1.599C61.787,41.48,61.071,40.765,60.183,40.765z M28.379,34.461c0.883,0,1.602-0.719,1.602-1.599 c0-0.883-0.719-1.596-1.602-1.596c-0.882,0-1.598,0.712-1.598,1.596C26.781,33.742,27.497,34.461,28.379,34.461z M27.151,35.73 c0-0.88-0.716-1.599-1.598-1.599c-0.883,0-1.601,0.719-1.601,1.599s0.718,1.598,1.601,1.598 C26.436,37.328,27.151,36.61,27.151,35.73z M29.381,42.947c0-0.88-0.718-1.596-1.604-1.596c-0.88,0-1.598,0.716-1.598,1.596 c0,0.888,0.718,1.604,1.598,1.604C28.664,44.552,29.381,43.835,29.381,42.947z M35.61,33.09c-1.381,0-2.503,1.113-2.503,2.496 c0,1.38,1.122,2.503,2.503,2.503c1.375,0,2.498-1.123,2.498-2.503C38.108,34.204,36.985,33.09,35.61,33.09z M52.117,13.371 c-0.889,0-1.596,0.71-1.596,1.599c0,0.879,0.707,1.596,1.596,1.596c0.883,0,1.595-0.717,1.595-1.596 C53.711,14.082,53,13.371,52.117,13.371z M49.786,9.796c0.883,0,1.596-0.721,1.596-1.601c0-0.885-0.713-1.596-1.596-1.596 c-0.885,0-1.595,0.71-1.595,1.596C48.19,9.075,48.901,9.796,49.786,9.796z M47.224,26.706c-0.883,0-1.596,0.719-1.596,1.595 c0,0.888,0.713,1.604,1.596,1.604s1.599-0.716,1.599-1.604C48.823,27.424,48.107,26.706,47.224,26.706z M48.41,15.771 c-0.88,0-1.595,0.718-1.595,1.601c0,0.885,0.715,1.596,1.595,1.596c0.886,0,1.601-0.71,1.601-1.596 C50.011,16.489,49.296,15.771,48.41,15.771z M33.959,25.227c0-0.883-0.713-1.601-1.595-1.601c-0.877,0-1.596,0.718-1.596,1.601 c0,0.885,0.719,1.599,1.596,1.599C33.246,26.826,33.959,26.112,33.959,25.227z M46.166,34.31c0-0.88-0.713-1.597-1.593-1.597 c-0.885,0-1.598,0.717-1.598,1.597c0,0.887,0.713,1.604,1.598,1.604C45.453,35.913,46.166,35.196,46.166,34.31z M46.222,49.658 c-0.88,0-1.595,0.715-1.595,1.599c0,0.888,0.715,1.598,1.595,1.598c0.883,0,1.599-0.71,1.599-1.598 C47.82,50.373,47.104,49.658,46.222,49.658z M59.326,50.994c-0.88,0-1.596,0.719-1.596,1.599c0,0.883,0.716,1.599,1.596,1.599 c0.882,0,1.598-0.716,1.598-1.599C60.923,51.713,60.208,50.994,59.326,50.994z M18.89,46.745c-0.885,0-1.601,0.716-1.601,1.599 c0,0.886,0.715,1.598,1.601,1.598c0.883,0,1.599-0.712,1.599-1.598C20.488,47.461,19.772,46.745,18.89,46.745z M90.917,44.635 c-0.88,0-1.596,0.719-1.596,1.604c0,0.884,0.716,1.596,1.596,1.596c0.892,0,1.604-0.712,1.604-1.596 C92.521,45.354,91.809,44.635,90.917,44.635z M19.547,40.587c-1.27,0-2.3,1.026-2.3,2.293c0,1.27,1.03,2.301,2.3,2.301 s2.3-1.031,2.3-2.301C21.847,41.613,20.816,40.587,19.547,40.587z"
+ id="path6"
+ style="fill:#ffffff;fill-opacity:1" />
+</g>
+</svg> \ No newline at end of file
diff --git a/icons/tennis-ball.svg b/icons/tennis-ball.svg
new file mode 100644
index 0000000..fc8d418
--- /dev/null
+++ b/icons/tennis-ball.svg
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ id="Your_Icon"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="100px"
+ viewBox="0 0 100 100"
+ enable-background="new 0 0 100 100"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_10605.svg"><metadata
+ id="metadata15"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs13" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="761"
+ inkscape:window-height="480"
+ id="namedview11"
+ showgrid="false"
+ inkscape:zoom="2.36"
+ inkscape:cx="50"
+ inkscape:cy="50"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Your_Icon" />
+<g
+ id="g3"
+ style="fill:#ffffff;fill-opacity:1">
+ <path
+ d="M68,50c0,8.834,4.242,16.675,10.801,21.601C83.32,65.584,86,58.105,86,50s-2.68-15.584-7.199-21.601 C72.242,33.325,68,41.166,68,50z"
+ id="path5"
+ style="fill:#ffffff;fill-opacity:1" />
+ <path
+ d="M21.2,28.399C16.68,34.416,14,41.895,14,50s2.68,15.584,7.2,21.601C27.758,66.675,32,58.833,32,50 S27.758,33.325,21.2,28.399z"
+ id="path7"
+ style="fill:#ffffff;fill-opacity:1" />
+ <path
+ d="M59,50c0-11.366,5.273-21.496,13.5-28.094C66.336,16.963,58.516,14,50,14s-16.336,2.964-22.5,7.907 C35.728,28.504,41,38.634,41,50s-5.272,21.496-13.5,28.093C33.664,83.036,41.484,86,50,86s16.336-2.963,22.5-7.906 C64.273,71.496,59,61.366,59,50z"
+ id="path9"
+ style="fill:#ffffff;fill-opacity:1" />
+</g>
+</svg> \ No newline at end of file
diff --git a/icons/wood.svg b/icons/wood.svg
new file mode 100644
index 0000000..1f0bc6d
--- /dev/null
+++ b/icons/wood.svg
@@ -0,0 +1,398 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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.1"
+ id="Calque_1"
+ x="0px"
+ y="0px"
+ width="100px"
+ height="100px"
+ viewBox="0 0 100 100"
+ enable-background="new 0 0 100 100"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="icon_8496.svg"><metadata
+ id="metadata233"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs231" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1360"
+ inkscape:window-height="711"
+ id="namedview229"
+ showgrid="false"
+ inkscape:zoom="2.36"
+ inkscape:cx="-51.177966"
+ inkscape:cy="117.79661"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Calque_1" />
+<g
+ id="Captions">
+ <rect
+ x="-744"
+ y="-414"
+ width="185"
+ height="99"
+ id="rect4" />
+ <rect
+ x="-552"
+ y="-450"
+ width="100"
+ height="30"
+ id="rect6" />
+ <text
+ transform="matrix(1 0 0 1 -485.9995 -433.5)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text8">http://thenounproject.com</text>
+
+ <text
+ transform="matrix(1 0 0 1 -544.8335 -438.5)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="6.1578"
+ id="text10">The Noun Project</text>
+
+ <text
+ transform="matrix(1 0 0 1 -543.7144 -433.6992)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="4"
+ id="text12">Icon Template</text>
+
+ <text
+ transform="matrix(1 0 0 1 -730.4995 -403.5)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="6.1578"
+ id="text14">Reminders</text>
+
+ <line
+ fill="#000000"
+ stroke="#FFFFFF"
+ stroke-miterlimit="10"
+ x1="-544"
+ y1="-428.5"
+ x2="-534"
+ y2="-428.5"
+ id="line16" />
+ <line
+ fill="#000000"
+ stroke="#FFFFFF"
+ stroke-miterlimit="10"
+ x1="-731"
+ y1="-397.5"
+ x2="-714"
+ y2="-397.5"
+ id="line18" />
+ <g
+ id="g20">
+ <g
+ id="g22">
+ <g
+ id="g24">
+ <rect
+ x="-722.802"
+ y="-382.682"
+ fill="#000000"
+ width="8.721"
+ height="8.642"
+ id="rect26" />
+ <path
+ fill="#000000"
+ d="M-716.455-371.688h4.747v-4.703h-4.747V-371.688z M-711.266-371.251h-5.63v-5.579h5.63V-371.251 L-711.266-371.251z M-718.221-369.938h8.279v-8.203h-8.279V-369.938L-718.221-369.938z M-709.5-369.5h-9.163v-9.079h9.163 V-369.5L-709.5-369.5z"
+ id="path28" />
+ <polygon
+ fill="#000000"
+ points="-718.149,-369.867 -718.292,-370.009 -710.013,-378.213 -709.871,-378.071 "
+ id="polygon30" />
+ </g>
+ </g>
+ </g>
+ <rect
+ x="-731"
+ y="-356"
+ fill="none"
+ width="35"
+ height="32.5"
+ id="rect32" />
+ <text
+ transform="matrix(1 0 0 1 -730.9995 -353.8418)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="3"
+ id="text34">Strokes</text>
+
+ <text
+ transform="matrix(1 0 0 1 -730.9995 -348.8418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text36">Try to keep strokes at 4px</text>
+
+ <text
+ transform="matrix(1 0 0 1 -730.9995 -343.8418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text38">Minimum stroke weight is 2px</text>
+
+ <text
+ transform="matrix(1 0 0 1 -730.9995 -339.3418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text40">For thicker strokes use even </text>
+
+ <text
+ transform="matrix(1 0 0 1 -730.9995 -336.3418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text42">numbers: 6px, 8px etc.</text>
+
+ <text
+ transform="matrix(1 0 0 1 -730.9995 -331.8418)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="2.4"
+ id="text44">Remember to expand strokes </text>
+
+ <text
+ transform="matrix(1 0 0 1 -730.9995 -328.8418)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="2.4"
+ id="text46">before saving as an SVG </text>
+
+ <rect
+ x="-688.5"
+ y="-356"
+ fill="none"
+ width="35"
+ height="32.5"
+ id="rect48" />
+ <text
+ transform="matrix(1 0 0 1 -688.4995 -353.8418)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="3"
+ id="text50">Size</text>
+
+ <text
+ transform="matrix(1 0 0 1 -688.4995 -348.8418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text52">Cannot be wider or taller than </text>
+
+ <text
+ transform="matrix(1 0 0 1 -688.4995 -345.3418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text54">100px (artboard size)</text>
+
+ <text
+ transform="matrix(1 0 0 1 -688.4995 -340.3418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text56">Scale your icon to fill as much of </text>
+
+ <text
+ transform="matrix(1 0 0 1 -688.4995 -337.3418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text58">the artboard as possible</text>
+
+ <rect
+ x="-646"
+ y="-356"
+ fill="none"
+ width="35"
+ height="32.5"
+ id="rect60" />
+ <text
+ transform="matrix(1 0 0 1 -645.9995 -353.8418)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="3"
+ id="text62">Ungroup</text>
+
+ <text
+ transform="matrix(1 0 0 1 -645.9995 -348.8418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text64">If your design has more than one </text>
+
+ <text
+ transform="matrix(1 0 0 1 -645.9995 -345.8418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text66">shape, make sure to ungroup</text>
+
+ <rect
+ x="-602"
+ y="-356"
+ fill="none"
+ width="35"
+ height="32.5"
+ id="rect68" />
+ <text
+ transform="matrix(1 0 0 1 -601.9995 -353.8418)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="3"
+ id="text70">Save as</text>
+
+ <text
+ transform="matrix(1 0 0 1 -601.9995 -348.8418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text72">Save as .SVG and make sure </text>
+
+ <text
+ transform="matrix(1 0 0 1 -601.9995 -345.8418)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.4"
+ id="text74">“Use Artboards” is checked</text>
+
+ <text
+ transform="matrix(1.0074 0 0 1 -677.5425 -383.4062)"
+ fill="#000000"
+ font-family="'Helvetica'"
+ font-size="2.5731"
+ id="text76">100px</text>
+
+ <text
+ transform="matrix(1.0074 0 0 1 -592.9995 -375)"
+ fill="#000000"
+ font-family="'Helvetica-Bold'"
+ font-size="5.1462"
+ id="text78">.SVG</text>
+
+ <rect
+ x="-678.514"
+ y="-379.185"
+ fill="#000000"
+ width="10.261"
+ height="10.185"
+ id="rect80" />
+ <rect
+ x="-678.477"
+ y="-382.234"
+ fill="#000000"
+ width="0.522"
+ height="2.337"
+ id="rect82" />
+ <rect
+ x="-668.812"
+ y="-382.234"
+ fill="#000000"
+ width="0.523"
+ height="2.337"
+ id="rect84" />
+ <rect
+ x="-679"
+ y="-381.663"
+ fill="#000000"
+ width="11.233"
+ height="0.572"
+ id="rect86" />
+ <g
+ id="g88">
+ <rect
+ x="-635.805"
+ y="-380.156"
+ fill="#000000"
+ width="10.305"
+ height="10.156"
+ id="rect90" />
+ <rect
+ x="-628.809"
+ y="-385.293"
+ fill="#000000"
+ width="3.308"
+ height="3.261"
+ id="rect92" />
+ </g>
+ <rect
+ x="-730.5"
+ y="-391.5"
+ fill="#000000"
+ stroke="#FFFFFF"
+ stroke-miterlimit="10"
+ width="30"
+ height="30"
+ id="rect94" />
+ <rect
+ x="-688.5"
+ y="-391.5"
+ fill="#000000"
+ stroke="#FFFFFF"
+ stroke-miterlimit="10"
+ width="30"
+ height="30"
+ id="rect96" />
+ <rect
+ x="-645.5"
+ y="-391.5"
+ fill="#000000"
+ stroke="#FFFFFF"
+ stroke-miterlimit="10"
+ width="30"
+ height="30"
+ id="rect98" />
+ <rect
+ x="-601.5"
+ y="-391.5"
+ fill="#000000"
+ stroke="#FFFFFF"
+ stroke-miterlimit="10"
+ width="30"
+ height="30"
+ id="rect100" />
+</g>
+
+<g
+ id="g221"
+ style="fill:#ffffff;fill-opacity:1">
+ <path
+ fill="#000000"
+ d="M90.379,32.314c-0.038,0-0.074,0.005-0.112,0.006v-0.001c-0.005,0-0.013,0.001-0.019,0.002 c-0.22,0.005-0.438,0.026-0.652,0.061c-0.61,0.058-1.484,0.143-2.557,0.247c-5.958,0.58-19.909,1.937-22.111,1.826 c-0.005,0-0.01-0.001-0.016-0.001c0.037-0.701,0.815-2.373,1.298-3.409c0.353-0.757,0.717-1.54,0.993-2.265 c0.61-1.604-0.071-3.115-1.777-3.943c-1.945-0.945-5.596-1.072-6.651,0.688c-0.764,1.273-5.367,6.731-8.701,9.51 c-1.375,1.146-9.522,2.393-16.71,3.493c-9.204,1.409-19.635,3.005-26.107,5.414L7.13,43.996c-4.465,2.232-7.326,7.768-7.119,13.775 c0.128,3.718,1.725,12.907,13.756,17.92l0.37,0.154l0.392-0.083c20.645-4.404,58.386-4.4,74.5-4.391h1.351 c5.396,0,9.621-8.578,9.621-19.529C100,40.892,95.774,32.314,90.379,32.314z M90.379,34.88c3.337,0,7.056,6.966,7.056,16.962 c0,4.991-0.927,9.226-2.271,12.217l-0.616-1.285c1.137-2.639,1.959-6.36,1.959-10.932c0-9.389-3.63-15.381-6.128-15.381 c-1.499,0-3.342,2.008-4.614,5.584l-0.632-1.3C86.521,37.066,88.51,34.88,90.379,34.88z M64.015,67.338 c-10.777,1.082-24.398,2.45-35.351,3.322c-5.228,0.259-10.353,0.496-15.17,0.703c11.121-1.282,41.836-3.749,67.074-5.646 C76.72,66.072,71.396,66.597,64.015,67.338z M62.354,34.707c-0.274,0.016-0.586,0.036-0.954,0.062 c0.318-0.051,0.634-0.1,0.952-0.15C62.354,34.648,62.354,34.678,62.354,34.707z M81.506,38.832c0.562-0.024,1.119-0.047,1.673-0.07 c-0.055,0.125-0.109,0.254-0.163,0.383c-0.882,0.077-1.827,0.159-2.837,0.247c-5.281,0.417-12.175,0.824-19.342,1.209 c2.277-0.241,4.533-0.476,6.727-0.695C72.773,39.486,77.633,39.107,81.506,38.832z M74.903,41.426 c2.79-0.16,5.282-0.272,7.398-0.329c-0.089,0.278-0.174,0.561-0.256,0.849c-6.084,0.747-16.822,1.68-35.726,2.725 c-5.764,0.318-11.516,0.604-16.816,0.851c5.516-0.381,12.497-0.943,21.335-1.749C59.413,42.992,67.957,42.141,74.903,41.426z M80.921,55.492c0.007,0.08,0.013,0.161,0.021,0.241c-6.264,0.488-13.625,1.057-21.297,1.641c0.061-0.007,0.121-0.013,0.181-0.02 L80.921,55.492z M69,45.957c-4.529,0.33-9.409,0.679-14.243,1.023c-2.522,0.18-5.062,0.361-7.592,0.542 c2.96-0.311,5.921-0.617,8.826-0.908c1.275-0.082,2.503-0.163,3.685-0.244c0.241-0.01,0.482-0.021,0.723-0.031 C63.573,46.201,66.43,46.074,69,45.957z M20.136,49.034c-5.452,0.507-10.085,0.843-13.054,0.857 c0.79-0.132,1.736-0.271,2.871-0.416C12.299,49.436,15.567,49.306,20.136,49.034z M54.849,48.26 c9.229-0.659,17.959-1.282,24.454-1.787c-0.394,0.043-0.801,0.088-1.222,0.135c-8.091,0.896-18.979,2.104-30.032,3.204 l-30.367,2.124c-5.637,0.246-10.222,0.428-12.998,0.534c-0.307-0.03-0.569-0.064-0.793-0.1 C10.301,51.438,35.732,49.624,54.849,48.26z M20.823,55.195l-17.301,1.33C6.528,56.01,13.058,55.578,20.823,55.195z M3.806,58.819 c3.906,0.056,12.079-0.558,26.738-1.899c1.336-0.055,2.681-0.108,4.022-0.16C20.262,58.197,6.498,59.44,2.782,59.065 C3.06,58.981,3.402,58.899,3.806,58.819z M15.66,59.966l-5.034,0.444c-1.109,0.039-2.075,0.061-2.916,0.068 C9.898,60.339,12.594,60.166,15.66,59.966z M16.187,66.316c1.357-0.063,2.801-0.131,4.316-0.204 c-5.838,0.479-10.64,0.796-13.308,0.805C9.116,66.837,11.977,66.646,16.187,66.316z M56.717,64.633 c-3.499,0.314-7.22,0.648-10.992,0.983c-6.057,0.42-12.312,0.824-18.459,1.2c5.883-0.527,13.097-1.212,21.871-2.062 c1.463-0.142,2.941-0.285,4.425-0.428c12.323-0.762,20.517-1.411,25.982-1.959c0.943-0.061,1.815-0.122,2.632-0.184 c0.024,0.081,0.05,0.16,0.075,0.24C77.269,62.807,69.352,63.496,56.717,64.633z M84.583,42.396l0.755,0.984 c-0.11,0.386-0.212,0.788-0.309,1.202l-0.809-0.821C84.333,43.29,84.454,42.835,84.583,42.396z M91.859,57.627 c-0.479,0.989-1.029,1.545-1.48,1.545c-1.035,0-2.601-2.924-2.601-7.33c0-4.405,1.565-7.329,2.601-7.329s2.601,2.923,2.601,7.329 c0,2.344-0.444,4.262-1.015,5.55l-0.269-0.561L91.859,57.627z M93.407,51.842c0-4.57-1.596-7.756-3.028-7.756 c-0.814,0-1.683,1.034-2.279,2.764l-0.495-1.02c0.769-2.426,1.904-3.858,2.774-3.858c1.446,0,3.634,3.937,3.634,9.87 c0,2.968-0.547,5.436-1.274,7.161l-0.526-1.097C92.905,56.532,93.407,54.405,93.407,51.842z M88.07,46.943 c-0.435,1.299-0.72,2.974-0.72,4.899c0,4.572,1.596,7.758,3.028,7.758c0.549,0,1.121-0.471,1.618-1.305l0.324,1.571 c-0.639,1.182-1.352,1.847-1.942,1.847c-1.447,0-3.634-3.937-3.634-9.871c0-2.189,0.299-4.104,0.747-5.652L88.07,46.943z M86.317,51.842c0,5.895,2.145,10.299,4.062,10.299c0.7,0,1.431-0.59,2.076-1.624l0.327,1.588c-0.796,1.382-1.673,2.15-2.403,2.15 c-1.858,0-4.667-4.951-4.667-12.413c0-2.133,0.23-4.061,0.602-5.728l0.25,0.026l-0.207-0.21c0.073-0.315,0.151-0.622,0.233-0.917 l0.577,0.751C86.648,47.444,86.317,49.527,86.317,51.842z M85.986,45.554l-0.578-0.587c0.087-0.389,0.181-0.765,0.28-1.129 l0.562,0.732C86.156,44.886,86.068,45.214,85.986,45.554z M85.868,46.067c-0.363,1.674-0.584,3.61-0.584,5.774 c0,7.956,2.967,12.841,5.095,12.841c0.793,0,1.704-0.681,2.534-1.946l0.328,1.595c-0.953,1.587-1.992,2.466-2.862,2.466 c-2.27,0-5.7-5.965-5.7-14.955c0-2.132,0.194-4.092,0.52-5.845L85.868,46.067z M92.987,59.522c0.851-1.854,1.453-4.558,1.453-7.681 c0-5.894-2.145-10.298-4.062-10.298c-1.088,0-2.248,1.418-3.049,3.722l-0.504-1.036c0.987-3.025,2.44-4.8,3.553-4.8 c1.857,0,4.667,4.951,4.667,12.412c0,3.598-0.653,6.608-1.538,8.765L92.987,59.522z M95.474,51.842 c0-7.955-2.968-12.839-5.095-12.839c-1.244,0-2.774,1.673-3.832,4.652l-0.495-1.019c1.206-3.623,2.973-5.748,4.327-5.748 c2.27,0,5.7,5.964,5.7,14.954c0,4.229-0.759,7.788-1.8,10.372l-0.512-1.067C94.752,58.935,95.474,55.763,95.474,51.842z M50.85,37.549c1.898-0.22,3.904-0.434,5.593-0.614c2.005-0.213,3.899-0.415,5.271-0.583c0.477-0.058,0.874-0.107,1.21-0.155 c0.131,0.151,0.295,0.3,0.504,0.429c-1.53,0.138-3.073,0.277-4.614,0.417c-2.988,0.271-5.776,0.524-8.359,0.762 c-0.067,0.003-0.13,0.006-0.195,0.009C50.472,37.726,50.669,37.638,50.85,37.549z M90.379,68.805 c-3.338,0-7.056-6.966-7.056-16.963c0-2.15,0.173-4.16,0.476-5.991l0.951,0.1c-0.313,1.759-0.499,3.729-0.499,5.892 c0,9.53,3.569,15.383,6.128,15.383c0.938,0,2.01-0.789,2.994-2.254l0.336,1.631C92.659,68.019,91.497,68.805,90.379,68.805z"
+ id="path223"
+ style="fill:#ffffff;fill-opacity:1" />
+ <path
+ fill="#000000"
+ d="M90.379,46.627c-1.082,0-1.995,2.388-1.995,5.214c0,2.827,0.913,5.216,1.995,5.216 c1.081,0,1.995-2.389,1.995-5.216C92.374,49.016,91.46,46.627,90.379,46.627z M90.379,56.63c-0.625,0-1.568-1.909-1.568-4.788 c0-2.877,0.943-4.787,1.568-4.787c0.624,0,1.567,1.909,1.567,4.787C91.946,54.721,91.003,56.63,90.379,56.63z"
+ id="path225"
+ style="fill:#ffffff;fill-opacity:1" />
+ <path
+ fill="#000000"
+ d="M90.379,49.169c-0.661,0-0.962,1.386-0.962,2.673c0,1.288,0.301,2.674,0.962,2.674s0.962-1.386,0.962-2.674 C91.341,50.555,91.04,49.169,90.379,49.169z"
+ id="path227"
+ style="fill:#ffffff;fill-opacity:1" />
+</g>
+</svg> \ No newline at end of file
diff --git a/physics.py b/physics.py
index b1894ad..c44f5ea 100644
--- a/physics.py
+++ b/physics.py
@@ -36,7 +36,7 @@ from pygame.color import *
sys.path.append('lib/')
# If your architecture is different, comment these lines and install
# the modules in your system.
-sys.path.append('lib/Box2D-2.0.2b1-py2.5-linux-i686.egg')
+sys.path.append('lib/Box2D-2.0.2b2-py2.7-linux-i686.egg')
import Box2D as box2d
import elements
@@ -54,9 +54,6 @@ class PhysicsGame:
# Create the name --> instance map for components
self.toolList = {}
for c in tools.allTools:
- if c.name == tools.EraseAllTool.name:
- self.toolList[c.name] = c(self, activity)
- continue
self.toolList[c.name] = c(self)
self.currentTool = self.toolList[tools.allTools[0].name]
# Set up the world (instance of Elements)
@@ -148,9 +145,9 @@ class PhysicsGame:
if self.world.run_physics:
bodies_present = len(self.world.world.GetBodyList())
clear_all_active = self.activity.clear_all.get_sensitive()
- if (bodies_present > 1) and clear_all_active is False:
+ if (bodies_present > 2) and clear_all_active is False:
self.activity.clear_all.set_sensitive(True)
- elif (bodies_present > 1) is False and \
+ elif (bodies_present > 2) is False and \
clear_all_active is True:
self.activity.clear_all.set_sensitive(False)
diff --git a/tools.py b/tools.py
index 7911168..bb9dbf8 100644
--- a/tools.py
+++ b/tools.py
@@ -31,6 +31,10 @@ from sugar.activity import activity
import gtk
import math
+PALETTE_MODE_SLIDER_ICON = 0
+PALETTE_MODE_ICONS = 1
+PALETTE_MODE_SLIDER_LABEL = 2
+
# Tools that can be superlcassed
class Tool(object):
@@ -38,6 +42,8 @@ class Tool(object):
icon = 'icon'
toolTip = 'Tool Tip'
toolAccelerator = None
+ palette_enabled = False
+ palette_data = None
def __init__(self, gameInstance):
self.game = gameInstance
@@ -53,16 +59,15 @@ class Tool(object):
toggle = self.game.world.run_physics
self.game.world.run_physics = not toggle
elif event.action == 'clear_all':
- if len(self.game.world.world.GetBodyList()) > 1:
- # Get bodies and destroy them too
- for body in self.game.world.world.GetBodyList():
- self.game.world.world.DestroyBody(body)
-
- # Add ground, because we destroyed it before
- self.game.world.add.ground()
- # Also clear the points recorded in pens.
- self.game.full_pos_list = \
- [[] for _ in self.game.full_pos_list]
+ # Get bodies and destroy them too
+ for body in self.game.world.world.GetBodyList():
+ self.game.world.world.DestroyBody(body)
+
+ # Add ground, because we destroyed it before
+ self.game.world.add.ground()
+ # Also clear the points recorded in pens.
+ self.game.full_pos_list = \
+ [[] for _ in self.game.full_pos_list]
elif event.action == 'focus_in':
self.game.in_focus = True
elif event.action == 'focus_out':
@@ -132,6 +137,36 @@ class CircleTool(Tool):
toolTip = _('Circle')
toolAccelerator = _('<ctrl>c')
+ palette_enabled = True
+ palette_mode = PALETTE_MODE_ICONS
+ palette_settings = [
+ {
+ "name": "density",
+ "icon_count": 3,
+ "icons": ["feather", "wood", "anvil"],
+ "icon_values": [0.5, 1.0, 10.0],
+ "active": "wood"
+ },
+ {
+ "name": "restitution",
+ "icon_count": 3,
+ "icons": ["basketball", "tennis-ball", "bowling-ball"],
+ "icon_values": [1, 0.16, 0.01],
+ "active": "tennis-ball"
+ },
+ {
+ "name": "friction",
+ "icon_count": 3,
+ "icons": ["ice-skate", "grass", "sandpaper"],
+ "icon_values": [0.5, 1, 2],
+ "active": "grass"
+ }]
+ palette_data = {
+ "density": 1.0,
+ "restitution": 0.16,
+ "friction": 1
+ }
+
def __init__(self, gameInstance):
Tool.__init__(self, gameInstance)
self.pt1 = None
@@ -144,9 +179,11 @@ class CircleTool(Tool):
self.pt1 = tuple_to_int(event.pos)
elif event.type == MOUSEBUTTONUP:
if event.button == 1:
- self.game.world.add.ball(self.pt1, self.radius,
- dynamic=True, density=1.0,
- restitution=0.16, friction=0.5)
+ self.game.world.add.ball(
+ self.pt1, self.radius,
+ dynamic=True, density=self.palette_data['density'],
+ restitution=self.palette_data['restitution'],
+ friction=self.palette_data['friction'])
self.pt1 = None
def draw(self):
@@ -173,6 +210,36 @@ class BoxTool(Tool):
toolTip = _('Box')
toolAccelerator = _('<ctrl>b')
+ palette_enabled = True
+ palette_mode = PALETTE_MODE_ICONS
+ palette_settings = [
+ {
+ "name": "density",
+ "icon_count": 3,
+ "icons": ["feather", "wood", "anvil"],
+ "icon_values": [0.5, 1.0, 10.0],
+ "active": "wood"
+ },
+ {
+ "name": "restitution",
+ "icon_count": 3,
+ "icons": ["basketball", "tennis-ball", "bowling-ball"],
+ "icon_values": [1, 0.16, 0.01],
+ "active": "tennis-ball"
+ },
+ {
+ "name": "friction",
+ "icon_count": 3,
+ "icons": ["ice-skate", "grass", "sandpaper"],
+ "icon_values": [0.5, 1, 2],
+ "active": "grass"
+ }]
+ palette_data = {
+ "density": 1.0,
+ "restitution": 0.16,
+ "friction": 1
+ }
+
def __init__(self, gameInstance):
Tool.__init__(self, gameInstance)
self.pt1 = None
@@ -192,13 +259,14 @@ class BoxTool(Tool):
self.rect = pygame.Rect(self.pt1,
(-self.width, -self.height))
self.rect.normalize()
- self.game.world.add.rect(self.rect.center,
- max(self.rect.width, 10) / 2,
- max(self.rect.height, 10) / 2,
- dynamic=True,
- density=1.0,
- restitution=0.16,
- friction=0.5)
+ self.game.world.add.rect(
+ self.rect.center,
+ max(self.rect.width, 10) / 2,
+ max(self.rect.height, 10) / 2,
+ dynamic=True,
+ density=self.palette_data['density'],
+ restitution=self.palette_data['restitution'],
+ friction=self.palette_data['friction'])
self.pt1 = None
def draw(self):
@@ -226,6 +294,36 @@ class TriangleTool(Tool):
toolTip = _('Triangle')
toolAccelerator = _('<ctrl>t')
+ palette_enabled = True
+ palette_mode = PALETTE_MODE_ICONS
+ palette_settings = [
+ {
+ "name": "density",
+ "icon_count": 3,
+ "icons": ["feather", "wood", "anvil"],
+ "icon_values": [0.5, 1.0, 10.0],
+ "active": "wood"
+ },
+ {
+ "name": "restitution",
+ "icon_count": 3,
+ "icons": ["basketball", "tennis-ball", "bowling-ball"],
+ "icon_values": [1, 0.16, 0.01],
+ "active": "tennis-ball"
+ },
+ {
+ "name": "friction",
+ "icon_count": 3,
+ "icons": ["ice-skate", "grass", "sandpaper"],
+ "icon_values": [0.5, 1, 2],
+ "active": "grass"
+ }]
+ palette_data = {
+ "density": 1.0,
+ "restitution": 0.16,
+ "friction": 1
+ }
+
def __init__(self, gameInstance):
Tool.__init__(self, gameInstance)
self.pt1 = None
@@ -262,11 +360,12 @@ class TriangleTool(Tool):
self.vertices = constructTriangleFromLine(self.pt1,
mouse_x_y)
- self.game.world.add.convexPoly(self.vertices,
- dynamic=True,
- density=1.0,
- restitution=0.16,
- friction=0.5)
+ self.game.world.add.convexPoly(
+ self.vertices,
+ dynamic=True,
+ density=self.palette_data['density'],
+ restitution=self.palette_data['restitution'],
+ friction=self.palette_data['friction'])
self.pt1 = None
self.vertices = None
@@ -296,6 +395,36 @@ class PolygonTool(Tool):
toolTip = _('Polygon')
toolAccelerator = _('<ctrl>p')
+ palette_enabled = True
+ palette_mode = PALETTE_MODE_ICONS
+ palette_settings = [
+ {
+ "name": "density",
+ "icon_count": 3,
+ "icons": ["feather", "wood", "anvil"],
+ "icon_values": [0.5, 1.0, 10.0],
+ "active": "wood"
+ },
+ {
+ "name": "restitution",
+ "icon_count": 3,
+ "icons": ["basketball", "tennis-ball", "bowling-ball"],
+ "icon_values": [1, 0.16, 0.01],
+ "active": "tennis-ball"
+ },
+ {
+ "name": "friction",
+ "icon_count": 3,
+ "icons": ["ice-skate", "grass", "sandpaper"],
+ "icon_values": [0.5, 1, 2],
+ "active": "grass"
+ }]
+ palette_data = {
+ "density": 1.0,
+ "restitution": 0.16,
+ "friction": 1
+ }
+
def __init__(self, gameInstance):
Tool.__init__(self, gameInstance)
self.vertices = None
@@ -319,11 +448,12 @@ class PolygonTool(Tool):
self.vertices = [[i[0] - delta_x, i[1] - delta_y]
for i in self.previous_vertices]
self.safe = True
- self.game.world.add.complexPoly(self.vertices,
- dynamic=True,
- density=1.0,
- restitution=0.16,
- friction=0.5)
+ self.game.world.add.complexPoly(
+ self.vertices,
+ dynamic=True,
+ density=self.palette_data['density'],
+ restitution=self.palette_data['restitution'],
+ friction=self.palette_data['friction'])
self.vertices = None
elif (event.type == MOUSEBUTTONUP or
event.type == MOUSEBUTTONDOWN):
@@ -336,11 +466,12 @@ class PolygonTool(Tool):
if distance(tuple_to_int(event.pos), self.vertices[0]) < 15 \
and self.safe:
self.vertices.append(self.vertices[0]) # Connect polygon
- self.game.world.add.complexPoly(self.vertices,
- dynamic=True,
- density=1.0,
- restitution=0.16,
- friction=0.5)
+ self.game.world.add.complexPoly(
+ self.vertices,
+ dynamic=True,
+ density=self.palette_data['density'],
+ restitution=self.palette_data['restitution'],
+ friction=self.palette_data['friction'])
self.previous_vertices = self.vertices[:]
self.vertices = None
elif distance(tuple_to_int(event.pos), self.vertices[0]) < 15:
@@ -375,6 +506,36 @@ class MagicPenTool(Tool):
toolTip = _('Draw')
toolAccelerator = _('<ctrl>d')
+ palette_enabled = True
+ palette_mode = PALETTE_MODE_ICONS
+ palette_settings = [
+ {
+ "name": "density",
+ "icon_count": 3,
+ "icons": ["feather", "wood", "anvil"],
+ "icon_values": [0.5, 1.0, 10.0],
+ "active": "wood"
+ },
+ {
+ "name": "restitution",
+ "icon_count": 3,
+ "icons": ["basketball", "tennis-ball", "bowling-ball"],
+ "icon_values": [1, 0.16, 0.01],
+ "active": "tennis-ball"
+ },
+ {
+ "name": "friction",
+ "icon_count": 3,
+ "icons": ["ice-skate", "grass", "sandpaper"],
+ "icon_values": [0.5, 1, 2],
+ "active": "grass"
+ }]
+ palette_data = {
+ "density": 1.0,
+ "restitution": 0.16,
+ "friction": 1
+ }
+
def __init__(self, gameInstance):
Tool.__init__(self, gameInstance)
self.vertices = None
@@ -395,10 +556,11 @@ class MagicPenTool(Tool):
for i in self.previous_vertices]
self.safe = True
if self.vertices and self.safe:
- self.game.world.add.complexPoly(self.vertices, dynamic=True,
- density=1.0,
- restitution=0.16,
- friction=0.5)
+ self.game.world.add.complexPoly(
+ self.vertices, dynamic=True,
+ density=self.palette_data['density'],
+ restitution=self.palette_data['restitution'],
+ friction=self.palette_data['friction'])
self.previous_vertices = self.vertices[:]
self.vertices = None
elif event.type == MOUSEMOTION and self.vertices:
@@ -554,6 +716,17 @@ class MotorTool(Tool):
icon = 'motor'
toolTip = _('Motor')
toolAccelerator = _('<ctrl>m')
+ # Palette settings
+ palette_enabled = True
+ palette_mode = PALETTE_MODE_SLIDER_ICON
+ palette_settings = {
+ "icon1": "motor-turtle",
+ "icon2": "motor-rabbit",
+ "min": 0,
+ "max": 500
+ }
+ # Default Value
+ palette_data = 10
def __init__(self, gameInstance):
Tool.__init__(self, gameInstance)
@@ -568,7 +741,9 @@ class MotorTool(Tool):
self.jb1 = self.game.world.get_bodies_at_pos(
tuple_to_int(event.pos))
if self.jb1:
- self.game.world.add.motor(self.jb1[0], self.jb1pos)
+ self.game.world.add.motor(
+ self.jb1[0], self.jb1pos,
+ speed=self.palette_data)
self.jb1 = self.jb1pos = None
def cancel(self):
@@ -657,54 +832,6 @@ class DestroyTool(Tool):
self.vertices = None
-class EraseAllTool(Tool):
- name = 'Erase All'
- icon = 'destroy-all'
- toolTip = _('Erase all')
-
- def __init__(self, gameInstance, activity=None):
- super(EraseAllTool, self).__init__(gameInstance)
- self.game = gameInstance
- self.response_alert = None
- self.activity = activity
-
- def handleToolEvent(self, event, action=False):
- if event.type == MOUSEBUTTONDOWN:
- if not action:
- # Add alert for confirm the delete all action.
- alert = ConfirmationAlert()
- alert.props.title = _('Delete all shapes?')
- alert.props.msg = _('This cannot be undone!')
- alert.connect('response', self.alert_info, event)
- self.activity.add_alert(alert)
- return
- else:
- if self.response_alert:
- self.response_alert = False
- # Obtain all figures
- bodys = []
- for body in self.game.world.world.GetBodyList():
- bodys.append(body)
-
- # Erase all ;)
- for body in bodys:
- self.game.world.world.DestroyBody(body)
-
- # The ground has deleted, restore..
- self.game.world.add.ground()
- else:
- pass
-
- def alert_info(self, alert, response_id, event):
- self.activity.remove_alert(alert)
- if response_id is gtk.RESPONSE_OK:
- self.response_alert = True
- elif response_id is gtk.RESPONSE_CANCEL:
- self.response_alert = False
-
- self.handleToolEvent(event, True)
-
-
# Track tool
class TrackTool(Tool):
name = 'Track'
@@ -762,11 +889,30 @@ class ChainTool(Tool):
toolTip = _("Chain")
toolAccelerator = "<ctrl>i"
+ # Palette settings
+ palette_enabled = True
+ palette_mode = PALETTE_MODE_SLIDER_LABEL
+ palette_settings = [
+ {
+ "label": "Chain Distance",
+ "min": 25,
+ "max": 50,
+ "data": "distance"
+ },
+ {
+ "label": "Chain Circle Size",
+ "min": 1,
+ "max": 10,
+ "data": "radius"
+ }]
+ palette_data = {
+ "distance": 25,
+ "radius": 1
+ }
+
def __init__(self, gameInstance):
Tool.__init__(self, gameInstance)
self.jb1 = self.jb2 = self.jb1pos = self.jb2pos = None
- self.circle_distance = 25
- self.circle_radius = 5
def handleToolEvent(self, event):
Tool.handleToolEvent(self, event)
@@ -806,14 +952,12 @@ class ChainTool(Tool):
first_iter = True
prevcircle = None
prevpos = None
- for p in range(5, d, self.circle_distance):
+ for p in range(5, d, int(self.palette_data['distance'])):
x = x1 + p * math.cos(bearing)
y = y1 + p * math.sin(bearing)
circle = self.game.world.add.ball(
- (x, y), self.circle_radius, dynamic=True)
+ (x, y), self.palette_data['radius'], dynamic=True)
circle.userData['color'] = (0, 0, 0)
- circle = self.game.world.get_bodies_at_pos(
- tuple_to_int((x, y)))[0]
if first_iter:
self.game.world.add.joint(circle, bodyA, (x, y), pos1, False)
first_iter = False