From 7780f9d4e9cbd1a392cba7f81e6da4d7ece650b0 Mon Sep 17 00:00:00 2001 From: Bert Freudenberg Date: Wed, 11 Mar 2009 13:40:10 +0000 Subject: Initial commit --- diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..79105cd --- /dev/null +++ b/COPYING @@ -0,0 +1,19 @@ +Copyright (c) 2009 Bert Freudenberg + +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. diff --git a/FreeCell.st b/FreeCell.st new file mode 100644 index 0000000..fff7aad --- /dev/null +++ b/FreeCell.st @@ -0,0 +1,55 @@ +" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " +Copyright (c) 2009 Bert Freudenberg + +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. +" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " +! + +!SugarLauncher methods! +quit + """override to not save Etoys project on stopping""" + self leaveSharedActivity. + Smalltalk quitPrimitive +! +invite: aBuddy + """override to not enable sharing""" + self inform: 'Invitation ignored: sharing is not supported'. +! ! + +!FreeCell methods! +quit + """the game's quit button calls the regular Sugar quit sequence""" + SugarLauncher current quit +! ! +| freecell | + +"""Do not show Sugar tool bar. Ctrl-Enter toggles it""" +Project current flapsSuppressed: true. + +"""Black makes the game's colors stand out better""" +World color: Color black. + +"""Open and keep centered""" +freecell := FreeCell new openInWorld. +freecell setToAdhereToEdge: #center. + +"""zoom to screen extent""" +OLPCVirtualScreen virtualScreenExtent: freecell extent. +OLPCVirtualScreen install + diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..814a231 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,6 @@ +NEWS +COPYING +FreeCell.st +bin/FreeCell.sh +activity/activity.info +activity/FreeCell-icon.svg diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..4efb6f8 --- /dev/null +++ b/NEWS @@ -0,0 +1,2 @@ +1 +* initial version diff --git a/activity/FreeCell-icon.svg b/activity/FreeCell-icon.svg new file mode 100644 index 0000000..e2d4cf9 --- /dev/null +++ b/activity/FreeCell-icon.svg @@ -0,0 +1,37 @@ + + +]> + + + + + + + + diff --git a/activity/activity.info b/activity/activity.info new file mode 100644 index 0000000..4a1594d --- /dev/null +++ b/activity/activity.info @@ -0,0 +1,8 @@ +[Activity] +name = FreeCell +activity_version = 1 +host_version = 1 +bundle_id = org.squeak.FreeCell +icon = FreeCell-icon +exec = FreeCell.sh +show_launcher = yes diff --git a/bin/FreeCell.sh b/bin/FreeCell.sh new file mode 100755 index 0000000..5a68d81 --- /dev/null +++ b/bin/FreeCell.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# Author: Bert Freudenberg +# Purpose: Run FreeCell.st in Etoys + +# arguments are unordered, have to loop +args="" +while [ -n "$2" ] ; do + case "$1" in + -b | --bundle-id) bundle_id="$2" ; args="$args BUNDLE_ID $2" ;; + -a | --activity-id) activity_id="$2" ; args="$args ACTIVITY_ID $2";; + -o | --object-id) object_id="$2" ; args="$args OBJECT_ID $2";; + -u | --uri) uri="$2" ; args="$args URI $2";; + *) echo unknown argument $1 $2 ;; + esac + shift;shift +done + +# really need bundle id and activity id +if [ -z "$bundle_id" -o -z "$activity_id" ] ; then + echo ERROR: bundle-id and activity-id arguments required + echo Aborting + exit 1 +fi + +# some debug output +echo launching $bundle_id instance $activity_id +[ -n "$object_id" ] && echo with journal obj $object_id +[ -n "$uri" ] && echo loading uri $uri +echo + +# sanitize +[ -z "$SUGAR_PROFILE" ] && SUGAR_PROFILE=default +[ -z "$SUGAR_ACTIVITY_ROOT" ] && SUGAR_ACTIVITY_ROOT="$HOME/.sugar/$SUGAR_PROFILE/etoys" + +# rainbow-enforced locations +export SQUEAK_SECUREDIR="$SUGAR_ACTIVITY_ROOT/data/private" +export SQUEAK_USERDIR="$SUGAR_ACTIVITY_ROOT/data/MyEtoys" + +# make group-writable for rainbow +umask 0002 +[ ! -d "$SQUEAK_SECUREDIR" ] && mkdir -p "$SQUEAK_SECUREDIR" && chmod o-rwx "$SQUEAK_SECUREDIR" +[ ! -d "$SQUEAK_USERDIR" ] && mkdir -p "$SQUEAK_USERDIR" + +# do not crash on dbus errors +export DBUS_FATAL_WARNINGS=0 + +# now run Squeak VM with Etoys image +exec etoys \ + -sugarBundleId $bundle_id \ + -sugarActivityId $activity_id \ + --document "FreeCell.st" \ + BUNDLE_PATH "$SUGAR_BUNDLE_PATH" \ + MO_PATH "$SUGAR_BUNDLE_PATH/locale" \ + $args -- cgit v0.9.1