From 4838262bd363d18156424676929ba621d9e8d801 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Mon, 06 Jul 2009 22:14:47 +0000 Subject: adding positioning tiles --- diff --git a/images/en/sensors/bottompos.svg b/images/en/sensors/bottompos.svg new file mode 100644 index 0000000..acf79cb --- /dev/null +++ b/images/en/sensors/bottompos.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + bottom + + diff --git a/images/en/sensors/leftpos.svg b/images/en/sensors/leftpos.svg new file mode 100644 index 0000000..33b35b0 --- /dev/null +++ b/images/en/sensors/leftpos.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + left + + diff --git a/images/en/sensors/rightpos.svg b/images/en/sensors/rightpos.svg new file mode 100644 index 0000000..7a364bf --- /dev/null +++ b/images/en/sensors/rightpos.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + right + + diff --git a/images/en/sensors/sensorsgroup.svg b/images/en/sensors/sensorsgroup.svg index 3075b82..112bba6 100644 --- a/images/en/sensors/sensorsgroup.svg +++ b/images/en/sensors/sensorsgroup.svg @@ -1,444 +1,604 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - X - - - - - - - Keyboard - - - - query - - - kb - - - - keyboard - - - - - width - - - - - - height - - - - - - - - - - x - - - - - - - pop - - - - - - - show - - - heap - - - - - - empty - - - heap - - - - - - - - push - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + X + + + + + + + Keyboard + + + + query + + + kb + + + + keyboard + + + + + width + + + + + + height + + + + + + + + + + x + + + + + + + pop + + + + + + + show + + + heap + + + + + + empty + + + heap + + + + + + + + push + + + + + + + + + left + + + + + + top + + + + + + right + + + + + + bottom + + + diff --git a/images/en/sensors/sensorsmask.svg b/images/en/sensors/sensorsmask.svg index 07151f0..77d3b07 100644 --- a/images/en/sensors/sensorsmask.svg +++ b/images/en/sensors/sensorsmask.svg @@ -1,133 +1,81 @@ + - - - - image/svg+xml - - - - - + id="svg2646"> - + offset="0" /> + offset="1" /> - - - + + + y2="226.65366" + id="linearGradient2501" + xlink:href="#linearGradient3712" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-32.502549,-96.17004)" /> + + x2="74" + y2="22" + id="linearGradient3172" + xlink:href="#linearGradient3166" + gradientUnits="userSpaceOnUse" /> + offset="0" /> + offset="1" /> - + style="fill:#404040;fill-opacity:1;stroke:none;stroke-width:1.5;stroke-opacity:1" /> + style="fill:#404040;fill-opacity:1;stroke:none;stroke-width:1.5;stroke-opacity:1" /> + style="fill:#202020;fill-opacity:1;stroke:none"> + + + + + + + + + + + + diff --git a/images/en/sensors/toppos.svg b/images/en/sensors/toppos.svg new file mode 100644 index 0000000..7b9e287 --- /dev/null +++ b/images/en/sensors/toppos.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + top + + diff --git a/po/TurtleArt.pot b/po/TurtleArt.pot index d62144c..7b86376 100644 --- a/po/TurtleArt.pot +++ b/po/TurtleArt.pot @@ -512,3 +512,11 @@ msgstr "" #: /home/walter/Desktop/turtleart-activity/svg/setxy.py:40 msgid "set xy" msgstr "" + +#: /home/walter/Desktop/turtleart-activity/svg/toppos.py:40 +msgid "top" +msgstr "" + +#: /home/walter/Desktop/turtleart-activity/svg/bottompos.py:40 +msgid "bottom" +msgstr "" diff --git a/svg/bottompos.py b/svg/bottompos.py new file mode 100644 index 0000000..c166441 --- /dev/null +++ b/svg/bottompos.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "bottompos" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring = _("bottom") + mygroup = "sensors" + + print mystring + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + \n" + + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(mystring.encode("utf-8")) + FILE.write(data1) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/leftpos.py b/svg/leftpos.py new file mode 100644 index 0000000..47a3063 --- /dev/null +++ b/svg/leftpos.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "leftpos" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring = _("left") + mygroup = "sensors" + + print mystring + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + \n" + + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(mystring.encode("utf-8")) + FILE.write(data1) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/rightpos.py b/svg/rightpos.py new file mode 100644 index 0000000..b942e13 --- /dev/null +++ b/svg/rightpos.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "rightpos" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring = _("right") + mygroup = "sensors" + + print mystring + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + \n" + + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(mystring.encode("utf-8")) + FILE.write(data1) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/svg/toppos.py b/svg/toppos.py new file mode 100644 index 0000000..69860b4 --- /dev/null +++ b/svg/toppos.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#Copyright (c) 2009, Sugar Labs + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import sys +import os +import os.path +import gettext + +def main(): + + myname = "toppos" + if len(sys.argv) != 2: + print "Error: Usage is " + myname + ".py lang" + return + + t = gettext.translation("org.laptop.TurtleArtActivity", "../locale", languages=[sys.argv[1]]) + _ = t.ugettext + t.install() + + mystring = _("top") + mygroup = "sensors" + + print mystring + data0 = \ +" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + " + + data1 = \ +" \n \ + \n \ + \n" + + + FILE = open(os.path.join("../images", sys.argv[1], mygroup, myname + ".svg"), "w") + FILE.write(data0) + FILE.write(mystring.encode("utf-8")) + FILE.write(data1) + FILE.close() + return + +if __name__ == "__main__": + main() diff --git a/talogo.py b/talogo.py index 94dced9..3b606e6 100644 --- a/talogo.py +++ b/talogo.py @@ -424,6 +424,10 @@ def lcNew(tw): defprim(lc,'myfunc', 2, lambda lc,f,x: callmyfunc(lc, f, x)) defprim(lc,'hres', 0, lambda lc: lc.tw.turtle.width) # canvas width defprim(lc,'vres', 0, lambda lc: lc.tw.turtle.height) # canvas height + defprim(lc,'leftpos', 0, lambda lc: -(lc.tw.turtle.width/2)) + defprim(lc,'toppos', 0, lambda lc: lc.tw.turtle.height/2) + defprim(lc,'rightpos', 0, lambda lc: lc.tw.turtle.width/2) + defprim(lc,'bottompos', 0, lambda lc: -(lc.tw.turtle.height/2)) # turtle primitives defprim(lc,'clean', 0, lambda lc: clear(lc)) diff --git a/tasetup.py b/tasetup.py index 5a13fa4..f37d657 100644 --- a/tasetup.py +++ b/tasetup.py @@ -110,7 +110,11 @@ selectors = ( ('push','push','onearg'), ('pop','pop','num'), ('printheap','heap','noarg2'), - ('clearheap','emptyheap','noarg2'))), + ('clearheap','emptyheap','noarg2'), + ('leftpos','leftpos','num'), + ('toppos','toppos','num'), + ('rightpos','rightpos','num'), + ('bottompos','bottompos','num'))), ('flow', 55, (('wait','wait','onearg',10), ('forever','forever','forever'), -- cgit v0.9.1