shoes 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +12 -0
- data/CHANGELOG +29 -0
- data/COPYING +30 -0
- data/README.md +76 -0
- data/README.old +117 -0
- data/Rakefile +130 -0
- data/Rakefile.bk +651 -0
- data/app.yaml +7 -0
- data/bin/main.skel +104 -0
- data/bugs/issue-012e9468ddc7b0cb7e1503413a8a11c4f8707b67.yaml +21 -0
- data/bugs/issue-0711ff8b67baa63586f11d0096fee9dd4436bf58.yaml +23 -0
- data/bugs/issue-07f87998d93eb401e22395c11085676389b935c4.yaml +22 -0
- data/bugs/issue-0bff2d80008803cbc7efbcdacdc60ef2163664d2.yaml +22 -0
- data/bugs/issue-0c66f223d19efbca7b692f3b91961f407ad7abec.yaml +24 -0
- data/bugs/issue-183bc3c7a8f575aff2b24e0bf22aa0dfcc8e4fc2.yaml +29 -0
- data/bugs/issue-1bad1e60a04cb3adb6a8f3ded128af2e16b56ffe.yaml +18 -0
- data/bugs/issue-1f1d43f76bf4de79d7f94adbae6dd506a9d81633.yaml +41 -0
- data/bugs/issue-320924117cadb045cc91f2a6fca922b4d81d4bb5.yaml +20 -0
- data/bugs/issue-33e5c8355fbf65252ea9e939714651df8bd8cb3b.yaml +25 -0
- data/bugs/issue-36f7c8262a72bcd5e28cfa4ed29328b8237ea79b.yaml +20 -0
- data/bugs/issue-39bf04ee50c3bef67b89b8e9beb28657805587ce.yaml +18 -0
- data/bugs/issue-3e28ba7754f73d02ef416eef989af707a8c00f01.yaml +23 -0
- data/bugs/issue-3f638cc03f41f9c3fdf217355321f1563f8fee45.yaml +22 -0
- data/bugs/issue-41e48e14f1ef4f6deb69be68165d7dd3ffd99156.yaml +22 -0
- data/bugs/issue-4c9408166a2aa5dd333bbb05520deebf4ded08e0.yaml +22 -0
- data/bugs/issue-55c687e108ecd5aeb8e0d0aeb4294984f84acd3e.yaml +18 -0
- data/bugs/issue-5811d34692cc292717a58ec1df1f8948cf30d826.yaml +28 -0
- data/bugs/issue-5a7c1f59a0526f9cea7fb366867cf1e6ed8ef69d.yaml +22 -0
- data/bugs/issue-688a2c2566bef6a03efa57a4ae1f7cfa8fc74444.yaml +21 -0
- data/bugs/issue-78b16c7988ade2ef96e716fa8cb9a004bd4ced65.yaml +33 -0
- data/bugs/issue-804ee49f9800154eddf0650690c7a9bb5626253f.yaml +27 -0
- data/bugs/issue-807dd1c610b2e941a5d454e26b2eac27e89a0ab4.yaml +22 -0
- data/bugs/issue-822ee33ec11ebd25f90ea86e8438de7891e63aee.yaml +18 -0
- data/bugs/issue-82ff7152cebb8a1cb065b864cb4fe22de2328146.yaml +29 -0
- data/bugs/issue-856afbdcdd4970ad54b8ce4a6c017fbaab45f49d.yaml +31 -0
- data/bugs/issue-8d49e32fb21522651c67490adb4d80076dbb14e1.yaml +24 -0
- data/bugs/issue-91583359653a9d530c1e32be72d874d847a306e7.yaml +21 -0
- data/bugs/issue-af41a5229613172764e7d3c98431172db337053d.yaml +20 -0
- data/bugs/issue-bd9856b3788dd429c998a5af1b2aae8221cb80b7.yaml +28 -0
- data/bugs/issue-be22aef5c564fb7b5e9938343136a9cd6a2edb7b.yaml +22 -0
- data/bugs/issue-bf8697523c77c326e7e35fc82cf3dd739ae92310.yaml +27 -0
- data/bugs/issue-cdd4b4795f34d6ff46e56ece10f8216a4a5456b2.yaml +25 -0
- data/bugs/issue-d9bfb5581d745ef9deb3b9b2e08ef74d1cd43082.yaml +20 -0
- data/bugs/issue-e0ce2f687cc096f35715d28b0af88589f4ab6cc6.yaml +18 -0
- data/bugs/issue-e4b0aca4a10a574b333aeaecaaf221dbc5ed22c6.yaml +38 -0
- data/bugs/issue-f263746594b95ba778455730478ee8df60ee639d.yaml +22 -0
- data/bugs/project.yaml +72 -0
- data/builddeps.sh +102 -0
- data/fonts/Coolvetica.ttf +0 -0
- data/fonts/Lacuna.ttf +0 -0
- data/gemlib/shoes.rb +1 -0
- data/lib/shoes.rb +548 -0
- data/lib/shoes/cache.rb +54 -0
- data/lib/shoes/chipmunk.rb +35 -0
- data/lib/shoes/data.rb +39 -0
- data/lib/shoes/help.rb +468 -0
- data/lib/shoes/image.rb +25 -0
- data/lib/shoes/inspect.rb +128 -0
- data/lib/shoes/log.rb +48 -0
- data/lib/shoes/minitar.rb +986 -0
- data/lib/shoes/override.rb +38 -0
- data/lib/shoes/pack.rb +543 -0
- data/lib/shoes/search.rb +46 -0
- data/lib/shoes/setup.rb +329 -0
- data/lib/shoes/shy.rb +131 -0
- data/lib/shoes/shybuilder.rb +44 -0
- data/lib/shoes/version.rb +3 -0
- data/make/darwin/deps.vlc +12 -0
- data/make/darwin/dylibs.shoes +22 -0
- data/make/darwin/dylibs.video +11 -0
- data/make/darwin/env.rb +81 -0
- data/make/darwin/tasks.rb +105 -0
- data/make/linux/env.rb +65 -0
- data/make/linux/tasks.rb +61 -0
- data/make/make.rb +85 -0
- data/make/mingw/dlls +19 -0
- data/make/mingw/env.rb +69 -0
- data/make/mingw/tasks.rb +70 -0
- data/make/rakefile_common.rb +8 -0
- data/manual-snapshots/class-book.png +0 -0
- data/manual-snapshots/expert-definr.png +0 -0
- data/manual-snapshots/expert-funnies.png +0 -0
- data/manual-snapshots/expert-irb.png +0 -0
- data/manual-snapshots/expert-minesweeper.png +0 -0
- data/manual-snapshots/expert-othello.png +0 -0
- data/manual-snapshots/expert-pong.png +0 -0
- data/manual-snapshots/expert-tankspank.png +0 -0
- data/manual-snapshots/good-arc.png +0 -0
- data/manual-snapshots/good-clock.png +0 -0
- data/manual-snapshots/good-follow.png +0 -0
- data/manual-snapshots/good-reminder.png +0 -0
- data/manual-snapshots/good-vjot.png +0 -0
- data/manual-snapshots/simple-accordion.png +0 -0
- data/manual-snapshots/simple-anim-shapes.png +0 -0
- data/manual-snapshots/simple-anim-text.png +0 -0
- data/manual-snapshots/simple-arc.png +0 -0
- data/manual-snapshots/simple-bounce.png +0 -0
- data/manual-snapshots/simple-calc.png +0 -0
- data/manual-snapshots/simple-chipmunk.png +0 -0
- data/manual-snapshots/simple-control-sizes.png +0 -0
- data/manual-snapshots/simple-curve.png +0 -0
- data/manual-snapshots/simple-dialogs.png +0 -0
- data/manual-snapshots/simple-downloader.png +0 -0
- data/manual-snapshots/simple-draw.png +0 -0
- data/manual-snapshots/simple-editor.png +0 -0
- data/manual-snapshots/simple-form.png +0 -0
- data/manual-snapshots/simple-mask.png +0 -0
- data/manual-snapshots/simple-menu.png +0 -0
- data/manual-snapshots/simple-menu1.png +0 -0
- data/manual-snapshots/simple-rubygems.png +0 -0
- data/manual-snapshots/simple-slide.png +0 -0
- data/manual-snapshots/simple-sphere.png +0 -0
- data/manual-snapshots/simple-sqlite3.png +0 -0
- data/manual-snapshots/simple-timer.png +0 -0
- data/manual-snapshots/simple-video.png +0 -0
- data/platform/mac/Info.plist +55 -0
- data/platform/mac/build-deps.sh +658 -0
- data/platform/mac/command-manual.rb +1 -0
- data/platform/mac/deps-osx.patch +159 -0
- data/platform/mac/dmg_ds_store +0 -0
- data/platform/mac/pangorc +2 -0
- data/platform/mac/pkg-dmg +1447 -0
- data/platform/mac/shoes +31 -0
- data/platform/mac/shoes-launch +7 -0
- data/platform/mac/stub.m +178 -0
- data/platform/mac/version.plist +14 -0
- data/platform/msw/base.nsi +644 -0
- data/platform/msw/installer-1.bmp +0 -0
- data/platform/msw/installer-2.bmp +0 -0
- data/platform/msw/shoes.exe.manifest +17 -0
- data/platform/msw/shoes.ico +0 -0
- data/platform/msw/stub-inject.c +59 -0
- data/platform/msw/stub.c +271 -0
- data/platform/msw/stub32.h +14 -0
- data/platform/msw/stub32.rc +16 -0
- data/platform/nix/INSTALL +56 -0
- data/platform/nix/Makefile +144 -0
- data/platform/nix/shoes.launch +20 -0
- data/platform/skel.rb +27 -0
- data/rakefile_darwin.rb +7 -0
- data/rakefile_linux.rb +3 -0
- data/rakefile_mingw.rb +7 -0
- data/samples/class-book.rb +43 -0
- data/samples/class-book.yaml +387 -0
- data/samples/expert-definr.rb +23 -0
- data/samples/expert-funnies.rb +51 -0
- data/samples/expert-irb.rb +112 -0
- data/samples/expert-minesweeper.rb +267 -0
- data/samples/expert-othello.rb +319 -0
- data/samples/expert-pong.rb +62 -0
- data/samples/expert-tankspank.rb +385 -0
- data/samples/good-arc.rb +37 -0
- data/samples/good-clock.rb +51 -0
- data/samples/good-follow.rb +26 -0
- data/samples/good-reminder.rb +174 -0
- data/samples/good-vjot.rb +56 -0
- data/samples/simple-accordion.rb +75 -0
- data/samples/simple-anim-shapes.rb +17 -0
- data/samples/simple-anim-text.rb +13 -0
- data/samples/simple-arc.rb +23 -0
- data/samples/simple-bounce.rb +24 -0
- data/samples/simple-calc.rb +70 -0
- data/samples/simple-chipmunk.rb +26 -0
- data/samples/simple-control-sizes.rb +24 -0
- data/samples/simple-curve.rb +26 -0
- data/samples/simple-dialogs.rb +29 -0
- data/samples/simple-downloader.rb +27 -0
- data/samples/simple-draw.rb +13 -0
- data/samples/simple-editor.rb +28 -0
- data/samples/simple-form.rb +28 -0
- data/samples/simple-form.shy +0 -0
- data/samples/simple-mask.rb +21 -0
- data/samples/simple-menu.rb +31 -0
- data/samples/simple-menu1.rb +35 -0
- data/samples/simple-rubygems.rb +29 -0
- data/samples/simple-slide.rb +45 -0
- data/samples/simple-sphere.rb +28 -0
- data/samples/simple-sqlite3.rb +13 -0
- data/samples/simple-timer.rb +13 -0
- data/samples/simple-video.rb +13 -0
- data/shoes.gemspec +21 -0
- data/shoes/app.c +591 -0
- data/shoes/app.h +110 -0
- data/shoes/appwin32.h +13 -0
- data/shoes/appwin32.rc +28 -0
- data/shoes/canvas.c +2202 -0
- data/shoes/canvas.h +682 -0
- data/shoes/code.h +14 -0
- data/shoes/config.h +232 -0
- data/shoes/effects.c +243 -0
- data/shoes/effects.h +7 -0
- data/shoes/http.h +44 -0
- data/shoes/http/common.h +86 -0
- data/shoes/http/curl.c +259 -0
- data/shoes/http/nsurl.m +274 -0
- data/shoes/http/windownload.c +114 -0
- data/shoes/http/winhttp.c +216 -0
- data/shoes/http/winhttp.h +19 -0
- data/shoes/image.c +1020 -0
- data/shoes/internal.c +46 -0
- data/shoes/internal.h +63 -0
- data/shoes/native.h +110 -0
- data/shoes/native/cocoa.h +105 -0
- data/shoes/native/cocoa.m +1557 -0
- data/shoes/native/gtk.c +1257 -0
- data/shoes/native/windows.c +2392 -0
- data/shoes/ruby.c +5221 -0
- data/shoes/ruby.h +299 -0
- data/shoes/world.c +243 -0
- data/shoes/world.h +63 -0
- data/static/Shoes.icns +0 -0
- data/static/avatar.png +0 -0
- data/static/code_highlighter.js +188 -0
- data/static/code_highlighter_ruby.js +26 -0
- data/static/icon-debug.png +0 -0
- data/static/icon-error.png +0 -0
- data/static/icon-info.png +0 -0
- data/static/icon-warn.png +0 -0
- data/static/listbox_button1.png +0 -0
- data/static/listbox_button2.png +0 -0
- data/static/man-app.png +0 -0
- data/static/man-builds.png +0 -0
- data/static/man-builds1.png +0 -0
- data/static/man-editor-notepad.png +0 -0
- data/static/man-editor-osx.png +0 -0
- data/static/man-ele-background.png +0 -0
- data/static/man-ele-border.png +0 -0
- data/static/man-ele-button.png +0 -0
- data/static/man-ele-check.png +0 -0
- data/static/man-ele-editbox.png +0 -0
- data/static/man-ele-editline.png +0 -0
- data/static/man-ele-image.png +0 -0
- data/static/man-ele-listbox.png +0 -0
- data/static/man-ele-progress.png +0 -0
- data/static/man-ele-radio.png +0 -0
- data/static/man-ele-shape.png +0 -0
- data/static/man-ele-textblock.png +0 -0
- data/static/man-ele-video.png +0 -0
- data/static/man-intro-dmg.png +0 -0
- data/static/man-intro-exe.png +0 -0
- data/static/man-look-tiger.png +0 -0
- data/static/man-look-ubuntu.png +0 -0
- data/static/man-look-vista.png +0 -0
- data/static/man-run-osx.png +0 -0
- data/static/man-run-vista.png +0 -0
- data/static/man-run-xp.png +0 -0
- data/static/man-shot1.png +0 -0
- data/static/manual-en.txt +3531 -0
- data/static/manual-ja.txt +2825 -0
- data/static/manual.css +167 -0
- data/static/menu-corner1.png +0 -0
- data/static/menu-corner2.png +0 -0
- data/static/menu-gray.png +0 -0
- data/static/menu-left.png +0 -0
- data/static/menu-right.png +0 -0
- data/static/menu-top.png +0 -0
- data/static/shoes-dmg.jpg +0 -0
- data/static/shoes-icon-blue.png +0 -0
- data/static/shoes-icon.png +0 -0
- data/static/shoes-manual-apps.gif +0 -0
- data/static/shoes_main_window.png +0 -0
- data/static/stripe.png +0 -0
- data/static/stubs/blank.exe +0 -0
- data/static/stubs/blank.hfz +0 -0
- data/static/stubs/blank.run +375 -0
- data/static/stubs/cocoa-install +0 -0
- data/static/stubs/sh-install +49 -0
- data/static/stubs/shoes-stub-inject.exe +0 -0
- data/static/stubs/shoes-stub.exe +0 -0
- data/static/tutor-back.png +0 -0
- data/test/shoes_test.rb +8 -0
- data/test/test_helper.rb +25 -0
- data/use-deps +12 -0
- data/use-tmp-dep +8 -0
- metadata +509 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
--- !ditz.rubyforge.org,2008-03-06/issue
|
2
|
+
title: Updated OSX distro's cairo to 1.6
|
3
|
+
desc: |-
|
4
|
+
The 1.6 series has a few updates that I'd really like to see in Raisins. The gradient fix is one. And, beyond that, the new support for the CGFont API rather than ATSUI. Unfortunately, Pango is still working on their side of things.
|
5
|
+
|
6
|
+
http://bugzilla.gnome.org/show_bug.cgi?id=527015
|
7
|
+
type: :feature
|
8
|
+
component: shoes
|
9
|
+
release: Raisins
|
10
|
+
reporter: _why <why@whytheluckystiff.net>
|
11
|
+
status: :closed
|
12
|
+
disposition: :fixed
|
13
|
+
creation_time: 2008-04-15 16:24:16.442475 Z
|
14
|
+
references: []
|
15
|
+
|
16
|
+
id: cdd4b4795f34d6ff46e56ece10f8216a4a5456b2
|
17
|
+
log_events:
|
18
|
+
- - 2008-04-15 16:24:19.931744 Z
|
19
|
+
- _why <why@whytheluckystiff.net>
|
20
|
+
- created
|
21
|
+
- ""
|
22
|
+
- - 2008-04-15 18:13:16.318535 Z
|
23
|
+
- _why <why@whytheluckystiff.net>
|
24
|
+
- closed issue with disposition fixed
|
25
|
+
- Okay, discovered that Cairo 1.6.4 and Pango 1.20.2 do the trick.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
--- !ditz.rubyforge.org,2008-03-06/issue
|
2
|
+
title: Standalone mode
|
3
|
+
desc: |-
|
4
|
+
Allow Shoes apps to run in their own process on all platforms, with a limited menu,
|
5
|
+
no Shoes-specific hotkeys or dialog boxes.
|
6
|
+
type: :feature
|
7
|
+
component: shoes
|
8
|
+
release: Murder
|
9
|
+
reporter: _why <why@whytheluckystiff.net>
|
10
|
+
status: :unstarted
|
11
|
+
disposition:
|
12
|
+
creation_time: 2008-12-03 16:04:52.121243 Z
|
13
|
+
references: []
|
14
|
+
|
15
|
+
id: d9bfb5581d745ef9deb3b9b2e08ef74d1cd43082
|
16
|
+
log_events:
|
17
|
+
- - 2008-12-03 16:04:53.460146 Z
|
18
|
+
- _why <why@whytheluckystiff.net>
|
19
|
+
- created
|
20
|
+
- ""
|
@@ -0,0 +1,18 @@
|
|
1
|
+
--- !ditz.rubyforge.org,2008-03-06/issue
|
2
|
+
title: Warn (possible error) on invalid element stylings.
|
3
|
+
desc: As raised by Phlip in [shoes:2580], developers should be notified when a styling is passed to an element that the element is not equipped to handle.
|
4
|
+
type: :bugfix
|
5
|
+
component: shoes
|
6
|
+
release: Murder
|
7
|
+
reporter: _why <why@whytheluckystiff.net>
|
8
|
+
status: :unstarted
|
9
|
+
disposition:
|
10
|
+
creation_time: 2008-04-07 17:30:56.711031 Z
|
11
|
+
references: []
|
12
|
+
|
13
|
+
id: e0ce2f687cc096f35715d28b0af88589f4ab6cc6
|
14
|
+
log_events:
|
15
|
+
- - 2008-04-07 17:30:57.709967 Z
|
16
|
+
- _why <why@whytheluckystiff.net>
|
17
|
+
- created
|
18
|
+
- ""
|
@@ -0,0 +1,38 @@
|
|
1
|
+
--- !ditz.rubyforge.org,2008-03-06/issue
|
2
|
+
title: alignment of text blocks
|
3
|
+
desc: "\n\
|
4
|
+
Win32, Revision 258. Using this tiny app for testing:\n\n\
|
5
|
+
Shoes.app do\n\
|
6
|
+
banner \"banner\"\n\
|
7
|
+
title \"title\"\n\
|
8
|
+
subtitle \"subtitle\"\n\
|
9
|
+
tagline \"tagline\"\n\
|
10
|
+
caption \"caption\"\n\
|
11
|
+
para \"para\"\n\
|
12
|
+
inscription \"inscription\"\n\
|
13
|
+
end\n\n\
|
14
|
+
steps to reproduce \xC2\xB6\n\n\
|
15
|
+
start with full width window, everything looks as expected. now start to make it smaller (in width)\n\n\
|
16
|
+
* inscription wraps when the window is at ri (in the middle of the word), should wrap at the end\n\
|
17
|
+
* when wrapping, it is not below banner but right in the (vertical) middle of \"ba\"\n\
|
18
|
+
* para wraps at the right position (window-size)\n\
|
19
|
+
* x position of inscription after wrapping of para is correct but inscription is at y=0\n\n\
|
20
|
+
... and so on.\n\
|
21
|
+
Results \xC2\xB6\n\n\
|
22
|
+
Everything but \"para\" wraps too late.\n\n\
|
23
|
+
valign is a mess - couldn't identify the problem just by adding some fields and resizing\n\n"
|
24
|
+
type: :feature
|
25
|
+
component: shoes
|
26
|
+
release: Murder
|
27
|
+
reporter: beb
|
28
|
+
status: :unstarted
|
29
|
+
disposition:
|
30
|
+
creation_time: 2008-04-02 16:30:37.627434 Z
|
31
|
+
references: []
|
32
|
+
|
33
|
+
id: e4b0aca4a10a574b333aeaecaaf221dbc5ed22c6
|
34
|
+
log_events:
|
35
|
+
- - 2008-04-02 16:30:41.935158 Z
|
36
|
+
- _why <why@whytheluckystiff.net>
|
37
|
+
- created
|
38
|
+
- ""
|
@@ -0,0 +1,22 @@
|
|
1
|
+
--- !ditz.rubyforge.org,2008-03-06/issue
|
2
|
+
title: Vista window width is wrong
|
3
|
+
desc: See simple-bounce.rb on Vista.
|
4
|
+
type: :bugfix
|
5
|
+
component: shoes
|
6
|
+
release: Murder
|
7
|
+
reporter: _why <why@whytheluckystiff.net>
|
8
|
+
status: :unstarted
|
9
|
+
disposition:
|
10
|
+
creation_time: 2008-12-04 22:29:16.463896 Z
|
11
|
+
references: []
|
12
|
+
|
13
|
+
id: f263746594b95ba778455730478ee8df60ee639d
|
14
|
+
log_events:
|
15
|
+
- - 2008-12-04 22:29:17.170279 Z
|
16
|
+
- _why <why@whytheluckystiff.net>
|
17
|
+
- created
|
18
|
+
- ""
|
19
|
+
- - 2008-12-05 22:08:00.787639 Z
|
20
|
+
- _why <why@whytheluckystiff.net>
|
21
|
+
- assigned to release Murder from Raisins
|
22
|
+
- Haven't found the cause of this yet, moving to Murder.
|
data/bugs/project.yaml
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ditz.rubyforge.org,2008-03-06/project
|
2
|
+
name: shoes
|
3
|
+
version: "0.1"
|
4
|
+
components:
|
5
|
+
- !ditz.rubyforge.org,2008-03-06/component
|
6
|
+
name: shoes
|
7
|
+
releases:
|
8
|
+
- !ditz.rubyforge.org,2008-03-06/release
|
9
|
+
name: Curious
|
10
|
+
status: :released
|
11
|
+
release_time: 2008-01-08 15:00:00 Z
|
12
|
+
log_events:
|
13
|
+
- - 2008-04-02 15:15:31.384943 Z
|
14
|
+
- _why <why@whytheluckystiff.net>
|
15
|
+
- created
|
16
|
+
- The first version of Shoes. Right before r400.
|
17
|
+
- - 2008-04-02 15:18:48.506461 Z
|
18
|
+
- _why <why@whytheluckystiff.net>
|
19
|
+
- released
|
20
|
+
- The first release of Shoes.
|
21
|
+
- !ditz.rubyforge.org,2008-03-06/release
|
22
|
+
name: Raisins
|
23
|
+
status: :released
|
24
|
+
release_time: 2008-12-05 18:37:37.981489 Z
|
25
|
+
log_events:
|
26
|
+
- - 2008-04-02 15:17:12.803117 Z
|
27
|
+
- _why <why@whytheluckystiff.net>
|
28
|
+
- created
|
29
|
+
- |-
|
30
|
+
* Multiple window support
|
31
|
+
* Error / logging console
|
32
|
+
* OS X improvements
|
33
|
+
* Shape events and shape positioning
|
34
|
+
- - 2008-12-09 18:37:37.981511 Z
|
35
|
+
- _why <why@whytheluckystiff.net>
|
36
|
+
- released
|
37
|
+
- http://shoooes.net/about/raisins/
|
38
|
+
- !ditz.rubyforge.org,2008-03-06/release
|
39
|
+
name: Policeman
|
40
|
+
status: :unreleased
|
41
|
+
release_time:
|
42
|
+
log_events:
|
43
|
+
- - 2008-12-09 18:37:12.140305 Z
|
44
|
+
- _why <why@whytheluckystiff.net>
|
45
|
+
- created
|
46
|
+
- |-
|
47
|
+
* Stability: fewer crashes, faster painting and text layout.
|
48
|
+
* Upgrade all the dependencies to the latest.
|
49
|
+
* Focus on Windows and OS X improvements.
|
50
|
+
- !ditz.rubyforge.org,2008-03-06/release
|
51
|
+
name: Murder
|
52
|
+
status: :unreleased
|
53
|
+
release_time:
|
54
|
+
log_events:
|
55
|
+
- - 2008-04-02 15:17:45.417106 Z
|
56
|
+
- _why <why@whytheluckystiff.net>
|
57
|
+
- created
|
58
|
+
- |-
|
59
|
+
* Basic menuing
|
60
|
+
* An `audio` object
|
61
|
+
* The `image` block syntax
|
62
|
+
- !ditz.rubyforge.org,2008-03-06/release
|
63
|
+
name: Feinstein
|
64
|
+
status: :unreleased
|
65
|
+
release_time:
|
66
|
+
log_events:
|
67
|
+
- - 2008-04-02 15:18:08.652997 Z
|
68
|
+
- _why <why@whytheluckystiff.net>
|
69
|
+
- created
|
70
|
+
- |-
|
71
|
+
* Shy installer / builder.
|
72
|
+
* Completion of the manual.
|
data/builddeps.sh
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
rm -rf /tmp/deps
|
4
|
+
cd /usr/local/src
|
5
|
+
|
6
|
+
#make clean all deps
|
7
|
+
cd pkg-config-0.20
|
8
|
+
make clean
|
9
|
+
cd ../libpng-1.4.1
|
10
|
+
make clean
|
11
|
+
cd ../jpeg-8a
|
12
|
+
make clean
|
13
|
+
cd ../giflib-4.1.6
|
14
|
+
make clean
|
15
|
+
cd ../gettext-0.17
|
16
|
+
make clean
|
17
|
+
cd ../libiconv-1.13
|
18
|
+
make clean
|
19
|
+
cd ../glib-2.24.0
|
20
|
+
make clean
|
21
|
+
cd ../pixman-0.18.0
|
22
|
+
make clean
|
23
|
+
cd ../cairo-1.8.10
|
24
|
+
make clean
|
25
|
+
cd ../pango-1.28.0
|
26
|
+
make clean
|
27
|
+
cd ../portaudio
|
28
|
+
make clean
|
29
|
+
cd ../ruby-1.9.1-p378
|
30
|
+
make clean
|
31
|
+
|
32
|
+
#build pkg-config
|
33
|
+
cd ../pkg-config-0.20
|
34
|
+
./configure --prefix=/tmp/dep
|
35
|
+
make && make install
|
36
|
+
export MACOSX_DEPLOYMENT_TARGET=10.6
|
37
|
+
export PATH=/tmp/dep/bin:$PATH
|
38
|
+
export CFLAGS="-I/tmp/dep/include -w"
|
39
|
+
export LDFLAGS=-L/tmp/dep/lib
|
40
|
+
export PKG_CONFIG_PATH=/tmp/dep/lib/pkgconfig
|
41
|
+
|
42
|
+
#build libpng
|
43
|
+
cd ../libpng-1.4.1
|
44
|
+
./configure --prefix=/tmp/dep
|
45
|
+
make && make install
|
46
|
+
|
47
|
+
#build libjpeg
|
48
|
+
cd ../jpeg-8a/
|
49
|
+
./configure --prefix=/tmp/dep --enable-shared
|
50
|
+
make && make install
|
51
|
+
|
52
|
+
#build giflib
|
53
|
+
cd ../giflib-4.1.6
|
54
|
+
./configure --prefix=/tmp/dep
|
55
|
+
make && make install
|
56
|
+
|
57
|
+
#build gettext
|
58
|
+
cd ../gettext-0.17
|
59
|
+
./configure --prefix=/tmp/dep
|
60
|
+
make && make install
|
61
|
+
|
62
|
+
#build libiconv
|
63
|
+
cd ../libiconv-1.13
|
64
|
+
./configure --prefix=/tmp/dep
|
65
|
+
make && make install
|
66
|
+
|
67
|
+
#build glib
|
68
|
+
cd ../glib-2.24.0
|
69
|
+
./configure --prefix=/tmp/dep
|
70
|
+
make && make install
|
71
|
+
|
72
|
+
#build pixman
|
73
|
+
cd ../pixman-0.18.0
|
74
|
+
./configure --prefix=/tmp/dep
|
75
|
+
make && make install
|
76
|
+
|
77
|
+
#build cairo
|
78
|
+
cd ../cairo-1.8.10
|
79
|
+
./configure --prefix=/tmp/dep --enable-quartz=yes --enable-quartz-font=yes --enable-xlib=no
|
80
|
+
make && make install
|
81
|
+
|
82
|
+
#build pango
|
83
|
+
cd ../pango-1.28.0
|
84
|
+
./configure --prefix=/tmp/dep --with-x=no
|
85
|
+
make && make install
|
86
|
+
|
87
|
+
#build Port Audio
|
88
|
+
cd ../portaudio/
|
89
|
+
./configure --prefix=/tmp/dep --disable-mac-universal
|
90
|
+
make && make install
|
91
|
+
|
92
|
+
#build ruby
|
93
|
+
cd ../ruby-1.9.1-p378
|
94
|
+
./configure --prefix=/tmp/dep --enable-shared
|
95
|
+
make && make install
|
96
|
+
|
97
|
+
#install RubyGems.
|
98
|
+
cd ../rubygems-1.3.6
|
99
|
+
/tmp/dep/bin/ruby setup.rb
|
100
|
+
|
101
|
+
#install rake.
|
102
|
+
/tmp/dep/bin/gem install rake
|
Binary file
|
data/fonts/Lacuna.ttf
ADDED
Binary file
|
data/gemlib/shoes.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
puts "Sorry, this gem currently does nothing. Team Shoes is working on Gemifying Shoes, and this is just a placeholder until then."
|
data/lib/shoes.rb
ADDED
@@ -0,0 +1,548 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# lib/shoes.rb
|
4
|
+
# The Shoes base app, both a demonstration and the learning tool for
|
5
|
+
# using Shoes.
|
6
|
+
#
|
7
|
+
ARGV.delete_if { |x| x =~ /-psn_/ }
|
8
|
+
|
9
|
+
require 'open-uri'
|
10
|
+
require 'optparse'
|
11
|
+
require 'resolv-replace' if RUBY_PLATFORM =~ /win/
|
12
|
+
require 'shoes/inspect'
|
13
|
+
require 'shoes/cache'
|
14
|
+
if Object.const_defined? :Shoes
|
15
|
+
require 'shoes/image'
|
16
|
+
end
|
17
|
+
require 'shoes/shybuilder'
|
18
|
+
|
19
|
+
def Shoes.hook; end
|
20
|
+
|
21
|
+
class Encoding
|
22
|
+
%w[ASCII_8BIT UTF_16BE UTF_16LE UTF_32BE UTF_32LE US_ASCII].each do |ec|
|
23
|
+
eval "#{ec} = '#{ec.sub '_', '-'}'"
|
24
|
+
end unless RUBY_PLATFORM =~ /linux/
|
25
|
+
end
|
26
|
+
|
27
|
+
class Range
|
28
|
+
def rand
|
29
|
+
conv = (Integer === self.end && Integer === self.begin ? :to_i : :to_f)
|
30
|
+
((Kernel.rand * (self.end - self.begin)) + self.begin).send(conv)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
unless Time.respond_to? :today
|
35
|
+
def Time.today
|
36
|
+
t = Time.now
|
37
|
+
t - (t.to_i % 86400)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class Shoes
|
42
|
+
RELEASES = %w[Curious Raisins Policeman]
|
43
|
+
|
44
|
+
NotFound = proc do
|
45
|
+
para "404 NOT FOUND, GUYS!"
|
46
|
+
end
|
47
|
+
|
48
|
+
class << self; attr_accessor :locale, :language end
|
49
|
+
@locale = ENV["SHOES_LANG"] || ENV["LC_MESSAGES"] || ENV["LC_ALL"] || ENV["LANG"] || "C"
|
50
|
+
@language = @locale[/^(\w{2})_/, 1] || "en"
|
51
|
+
|
52
|
+
@mounts = []
|
53
|
+
|
54
|
+
OPTS = OptionParser.new do |opts|
|
55
|
+
opts.banner = "Usage: shoes [options] (app.rb or app.shy)"
|
56
|
+
|
57
|
+
opts.on("-m", "--manual",
|
58
|
+
"Open the built-in manual.") do
|
59
|
+
show_manual
|
60
|
+
end
|
61
|
+
|
62
|
+
opts.on("-p", "--package",
|
63
|
+
"Package a Shoes app for Windows, OS X and Linux.") do |s|
|
64
|
+
make_pack
|
65
|
+
end
|
66
|
+
|
67
|
+
opts.on("-g", "--gem",
|
68
|
+
"Passes commands to RubyGems.") do
|
69
|
+
require 'shoes/setup'
|
70
|
+
require 'rubygems/gem_runner'
|
71
|
+
Gem::GemRunner.new.run(ARGV)
|
72
|
+
raise SystemExit, ""
|
73
|
+
end
|
74
|
+
|
75
|
+
opts.on("--manual-html DIRECTORY", "Saves the manual to a directory as HTML.") do |dir|
|
76
|
+
manual_as :html, dir
|
77
|
+
raise SystemExit, "HTML manual in: #{dir}"
|
78
|
+
end
|
79
|
+
|
80
|
+
opts.on("--install MODE SRC DEST", "Installs a file.") do |mode|
|
81
|
+
src, dest = ARGV
|
82
|
+
FileUtils.install src, dest, :mode => mode.to_i(8), :preserve => true
|
83
|
+
raise SystemExit, ""
|
84
|
+
end
|
85
|
+
|
86
|
+
opts.on("--nolayered", "No WS_EX_LAYERED style option.") do
|
87
|
+
$NOLAYERED = 1
|
88
|
+
Shoes.args!
|
89
|
+
end
|
90
|
+
|
91
|
+
opts.on_tail("-v", "--version", "Display the version info.") do
|
92
|
+
raise SystemExit, File.read("#{DIR}/VERSION.txt").strip
|
93
|
+
end
|
94
|
+
|
95
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
96
|
+
raise SystemExit, opts.to_s
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
class SettingUp < StandardError; end
|
101
|
+
|
102
|
+
@setups = {}
|
103
|
+
|
104
|
+
def self.setup &blk
|
105
|
+
require 'shoes/setup'
|
106
|
+
line = caller[0]
|
107
|
+
return if @setups[line]
|
108
|
+
script = line[/^(.+?):/, 1]
|
109
|
+
set = Shoes::Setup.new(script, &blk)
|
110
|
+
@setups[line] = true
|
111
|
+
unless set.no_steps?
|
112
|
+
raise SettingUp
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def self.show_selector
|
117
|
+
fname = ask_open_file
|
118
|
+
Shoes.visit(fname) if fname
|
119
|
+
end
|
120
|
+
|
121
|
+
def self.package_app
|
122
|
+
fname = ask_open_file
|
123
|
+
return false unless fname
|
124
|
+
start_shy_builder fname
|
125
|
+
end
|
126
|
+
|
127
|
+
def self.splash
|
128
|
+
font "#{DIR}/fonts/Lacuna.ttf"
|
129
|
+
Shoes.app :width => 400, :height => 300, :resizable => false do
|
130
|
+
style(Para, :align => "center", :weight => "bold", :font => "Lacuna Regular", :size => 13)
|
131
|
+
style(Link, :stroke => yellow, :underline => nil)
|
132
|
+
style(LinkHover, :stroke => yellow, :fill => nil)
|
133
|
+
|
134
|
+
x1 = 77; y1 = 122
|
135
|
+
x2 = 148; y2 = -122
|
136
|
+
x3 = 245; y3 = 0
|
137
|
+
|
138
|
+
nofill
|
139
|
+
strokewidth 40.0
|
140
|
+
|
141
|
+
@waves = stack :top => 0, :left => 0
|
142
|
+
|
143
|
+
require 'shoes/search'
|
144
|
+
require 'shoes/help'
|
145
|
+
|
146
|
+
stack :margin => 18 do
|
147
|
+
para "Welcome to", :stroke => "#DFA", :margin => 0
|
148
|
+
para "SHOES", :size => 48, :stroke => "#DFA", :margin_top => 0
|
149
|
+
stack do
|
150
|
+
background black(0.2), :curve => 8
|
151
|
+
para link("Open an App.") { Shoes.show_selector and close }, :margin => 10, :margin_bottom => 4
|
152
|
+
#para link("Package an App.") { Shoes.package_app and close }, :margin => 10, :margin_bottom => 4
|
153
|
+
para link("Package an App.") { Shoes.make_pack and close }, :margin => 10, :margin_bottom => 4
|
154
|
+
para link("Read the Manual.") { Shoes.show_manual and close }, :margin => 10
|
155
|
+
end
|
156
|
+
inscription "Alt-Slash opens the console.", :stroke => "#DFA", :align => "center"
|
157
|
+
end
|
158
|
+
|
159
|
+
animate(10) do |ani|
|
160
|
+
a = Math.sin(ani * 0.02) * 20
|
161
|
+
@waves.clear do
|
162
|
+
background white
|
163
|
+
y = -30
|
164
|
+
16.times do |i|
|
165
|
+
shape do
|
166
|
+
move_to x = (-300 - (i*(a*0.8))), y
|
167
|
+
c = (a + 14) * 0.01
|
168
|
+
stroke rgb(i * 0.06, c + 0.1, 0.1, 1.0 - (ani * 0.0003))
|
169
|
+
4.times do
|
170
|
+
curve_to x1 + x, (y1-(i*a)) + y, x2 + x, (y2+(i*a)) + y, x3 + x, y3 + y
|
171
|
+
x += x3
|
172
|
+
end
|
173
|
+
end
|
174
|
+
y += 30
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
def self.make_pack
|
182
|
+
require 'shoes/pack'
|
183
|
+
Shoes.app(:width => 500, :height => 480, :resizable => true, &PackMake)
|
184
|
+
end
|
185
|
+
|
186
|
+
def self.manual_p(str, path)
|
187
|
+
str.gsub(/\n+\s*/, " ").
|
188
|
+
gsub(/&/, '&').gsub(/>/, '>').gsub(/>/, '<').gsub(/"/, '"').
|
189
|
+
gsub(/`(.+?)`/m, '<code>\1</code>').gsub(/\[\[BR\]\]/i, "<br />\n").
|
190
|
+
gsub(/\^(.+?)\^/m, '\1').
|
191
|
+
gsub(/'''(.+?)'''/m, '<strong>\1</strong>').gsub(/''(.+?)''/m, '<em>\1</em>').
|
192
|
+
gsub(/\[\[(http:\/\/\S+?)\]\]/m, '<a href="\1" target="_new">\1</a>').
|
193
|
+
gsub(/\[\[(http:\/\/\S+?) (.+?)\]\]/m, '<a href="\1" target="_new">\2</a>').
|
194
|
+
gsub(/\[\[(\S+?)\]\]/m) do
|
195
|
+
ms, mn = $1.split(".", 2)
|
196
|
+
if mn
|
197
|
+
'<a href="' + ms + '.html#' + mn + '">' + mn + '</a>'
|
198
|
+
else
|
199
|
+
'<a href="' + ms + '.html">' + ms + '</a>'
|
200
|
+
end
|
201
|
+
end.
|
202
|
+
gsub(/\[\[(\S+?) (.+?)\]\]/m, '<a href="\1.html">\2</a>').
|
203
|
+
gsub(/\!(\{[^}\n]+\})?([^!\n]+\.\w+)\!/) do
|
204
|
+
x = "static/#$2"
|
205
|
+
FileUtils.cp("#{DIR}/#{x}", "#{path}/#{x}") if File.exists? "#{DIR}/#{x}"
|
206
|
+
'<img src="' + x + '" />'
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
def self.manual_link(sect)
|
211
|
+
end
|
212
|
+
|
213
|
+
TITLES = {:title => :h1, :subtitle => :h2, :tagline => :h3, :caption => :h4}
|
214
|
+
|
215
|
+
def self.manual_as format, *args
|
216
|
+
require 'shoes/search'
|
217
|
+
require 'shoes/help'
|
218
|
+
|
219
|
+
case format
|
220
|
+
when :shoes
|
221
|
+
Shoes.app(:width => 720, :height => 640, &Shoes::Help)
|
222
|
+
else
|
223
|
+
extend Shoes::Manual
|
224
|
+
man = self
|
225
|
+
dir, = args
|
226
|
+
FileUtils.mkdir_p File.join(dir, 'static')
|
227
|
+
FileUtils.cp "#{DIR}/static/shoes-icon.png", "#{dir}/static"
|
228
|
+
%w[manual.css code_highlighter.js code_highlighter_ruby.js].
|
229
|
+
each { |x| FileUtils.cp "#{DIR}/static/#{x}", "#{dir}/static" }
|
230
|
+
html_bits = proc do
|
231
|
+
proc do |sym, text|
|
232
|
+
case sym when :intro
|
233
|
+
div.intro { p { self << man.manual_p(text, dir) } }
|
234
|
+
when :code
|
235
|
+
pre { code.rb text.gsub(/^\s*?\n/, '') }
|
236
|
+
when :colors
|
237
|
+
color_names = (Shoes::COLORS.keys*"\n").split("\n").sort
|
238
|
+
color_names.each do |color|
|
239
|
+
c = Shoes::COLORS[color.intern]
|
240
|
+
f = c.dark? ? "white" : "black"
|
241
|
+
div.color(:style => "background: #{c}; color: #{f}") { h3 color; p c }
|
242
|
+
end
|
243
|
+
when :index
|
244
|
+
tree = man.class_tree
|
245
|
+
shown = []
|
246
|
+
i = 0
|
247
|
+
index_p = proc do |k, subs|
|
248
|
+
unless shown.include? k
|
249
|
+
i += 1
|
250
|
+
p "▸ #{k}", :style => "margin-left: #{20*i}px"
|
251
|
+
subs.uniq.sort.each do |s|
|
252
|
+
index_p[s, tree[s]]
|
253
|
+
end if subs
|
254
|
+
i -= 1
|
255
|
+
shown << k
|
256
|
+
end
|
257
|
+
end
|
258
|
+
tree.sort.each &index_p
|
259
|
+
# index_page
|
260
|
+
when :list
|
261
|
+
ul { text.each { |x| li { self << man.manual_p(x, dir) } } }
|
262
|
+
when :samples
|
263
|
+
folder = File.join DIR, 'samples'
|
264
|
+
h = {}
|
265
|
+
Dir.glob(File.join folder, '*').each do |file|
|
266
|
+
if File.extname(file) == '.rb'
|
267
|
+
key = File.basename(file).split('-')[0]
|
268
|
+
h[key] ? h[key].push(file) : h[key] = [file]
|
269
|
+
end
|
270
|
+
end
|
271
|
+
h.each do |k, v|
|
272
|
+
p "<h4>#{k}</h4>"
|
273
|
+
samples = []
|
274
|
+
v.each do |file|
|
275
|
+
sample = File.basename(file).split('-')[1..-1].join('-')[0..-4]
|
276
|
+
samples << "<a href=\"http://github.com/shoes/shoes/raw/master/manual-snapshots/#{k}-#{sample}.png\">#{sample}</a>"
|
277
|
+
end
|
278
|
+
p samples.join ' '
|
279
|
+
end
|
280
|
+
else
|
281
|
+
send(TITLES[sym] || :p) { self << man.manual_p(text, dir) }
|
282
|
+
end
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
docs = load_docs(Shoes::Manual::path)
|
287
|
+
sections = docs.map { |x,| x }
|
288
|
+
|
289
|
+
docn = 1
|
290
|
+
docs.each do |title1, opt1|
|
291
|
+
subsect = opt1['sections'].map { |x,| x }
|
292
|
+
menu = sections.map do |x|
|
293
|
+
[x, (subsect if x == title1)]
|
294
|
+
end
|
295
|
+
|
296
|
+
path1 = File.join(dir, title1.gsub(/\W/, ''))
|
297
|
+
make_html("#{path1}.html", title1, menu) do
|
298
|
+
h2 "The Shoes Manual"
|
299
|
+
h1 title1
|
300
|
+
man.wiki_tokens opt1['description'], true, &instance_eval(&html_bits)
|
301
|
+
p.next { text "Next: "
|
302
|
+
a opt1['sections'].first[1]['title'], :href => "#{opt1['sections'].first[0]}.html" }
|
303
|
+
end
|
304
|
+
|
305
|
+
optn = 1
|
306
|
+
opt1['sections'].each do |title2, opt2|
|
307
|
+
path2 = File.join(dir, title2)
|
308
|
+
make_html("#{path2}.html", opt2['title'], menu) do
|
309
|
+
h2 "The Shoes Manual"
|
310
|
+
h1 opt2['title']
|
311
|
+
man.wiki_tokens opt2['description'], true, &instance_eval(&html_bits)
|
312
|
+
opt2['methods'].each do |title3, desc3|
|
313
|
+
sig, val = title3.split(/\s+»\s+/, 2)
|
314
|
+
aname = sig[/^[^(=]+=?/].gsub(/\s/, '').downcase
|
315
|
+
a :name => aname
|
316
|
+
div.method do
|
317
|
+
a sig, :href => "##{aname}"
|
318
|
+
text " » #{val}" if val
|
319
|
+
end
|
320
|
+
div.sample do
|
321
|
+
man.wiki_tokens desc3, &instance_eval(&html_bits)
|
322
|
+
end
|
323
|
+
end
|
324
|
+
if opt1['sections'][optn]
|
325
|
+
p.next { text "Next: "
|
326
|
+
a opt1['sections'][optn][1]['title'], :href => "#{opt1['sections'][optn][0]}.html" }
|
327
|
+
elsif docs[docn]
|
328
|
+
p.next { text "Next: "
|
329
|
+
a docs[docn][0], :href => "#{docs[docn][0].gsub(/\W/, '')}.html" }
|
330
|
+
end
|
331
|
+
optn += 1
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
docn += 1
|
336
|
+
end
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
def self.show_manual
|
341
|
+
manual_as :shoes
|
342
|
+
end
|
343
|
+
|
344
|
+
def self.show_log
|
345
|
+
require 'shoes/log'
|
346
|
+
return if @log_app and Shoes.APPS.include? @log_app
|
347
|
+
@log_app =
|
348
|
+
Shoes.app do
|
349
|
+
extend Shoes::LogWindow
|
350
|
+
setup
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
def self.mount(path, meth, &blk)
|
355
|
+
@mounts << [path, meth || blk]
|
356
|
+
end
|
357
|
+
|
358
|
+
SHOES_URL_RE = %r!^@([^/]+)(.*)$!
|
359
|
+
|
360
|
+
def self.run(path)
|
361
|
+
uri = URI(path)
|
362
|
+
@mounts.each do |mpath, rout|
|
363
|
+
m, *args = *path.match(/^#{mpath}$/)
|
364
|
+
if m
|
365
|
+
unless rout.is_a? Proc
|
366
|
+
rout = rout[0].instance_method(rout[1])
|
367
|
+
end
|
368
|
+
return [rout, args]
|
369
|
+
end
|
370
|
+
end
|
371
|
+
case uri.path when "/"
|
372
|
+
[nil]
|
373
|
+
when SHOES_URL_RE
|
374
|
+
[proc { eval(URI("http://#$1:53045#$2").read) }]
|
375
|
+
else
|
376
|
+
[NotFound]
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
def self.args!
|
381
|
+
if RUBY_PLATFORM !~ /darwin/ and ARGV.empty?
|
382
|
+
Shoes.splash
|
383
|
+
end
|
384
|
+
OPTS.parse! ARGV
|
385
|
+
ARGV[0] or true
|
386
|
+
end
|
387
|
+
|
388
|
+
def self.uri(str)
|
389
|
+
if str =~ SHOES_URL_RE
|
390
|
+
URI("http://#$1:53045#$2")
|
391
|
+
else
|
392
|
+
URI(str) rescue nil
|
393
|
+
end
|
394
|
+
end
|
395
|
+
|
396
|
+
def self.visit(path)
|
397
|
+
uri = Shoes.uri(path)
|
398
|
+
|
399
|
+
case uri
|
400
|
+
when URI::HTTP
|
401
|
+
str = uri.read
|
402
|
+
if str !~ /Shoes\.app/
|
403
|
+
Shoes.app do
|
404
|
+
eval(uri.read)
|
405
|
+
end
|
406
|
+
else
|
407
|
+
eval(uri.read)
|
408
|
+
end
|
409
|
+
else
|
410
|
+
path = File.expand_path(path.gsub(/\\/, "/"))
|
411
|
+
if path =~ /\.shy$/
|
412
|
+
@shy = true
|
413
|
+
require 'shoes/shy'
|
414
|
+
base = File.basename(path, ".shy")
|
415
|
+
tmpdir = "%s/shoes-%s.%d" % [Dir.tmpdir, base, $$]
|
416
|
+
shy = Shy.x(path, tmpdir)
|
417
|
+
Dir.chdir(tmpdir)
|
418
|
+
Shoes.debug "Loaded SHY: #{shy.name} #{shy.version} by #{shy.creator}"
|
419
|
+
path = shy.launch
|
420
|
+
else
|
421
|
+
@shy = false
|
422
|
+
Dir.chdir(File.dirname(path))
|
423
|
+
path = File.basename(path)
|
424
|
+
end
|
425
|
+
|
426
|
+
$0.replace path
|
427
|
+
|
428
|
+
code = read_file(path)
|
429
|
+
eval(code, TOPLEVEL_BINDING, path)
|
430
|
+
end
|
431
|
+
rescue SettingUp
|
432
|
+
rescue Object => e
|
433
|
+
error(e)
|
434
|
+
show_log
|
435
|
+
end
|
436
|
+
|
437
|
+
def self.read_file path
|
438
|
+
if RUBY_VERSION =~ /^1\.9/ and !@shy
|
439
|
+
#File.open(path, 'r:utf-8') { |f| f.read }
|
440
|
+
IO.read(path).force_encoding("UTF-8")
|
441
|
+
else
|
442
|
+
File.read(path)
|
443
|
+
end
|
444
|
+
end
|
445
|
+
|
446
|
+
def self.url(path, meth)
|
447
|
+
Shoes.mount(path, [self, meth])
|
448
|
+
end
|
449
|
+
|
450
|
+
module Basic
|
451
|
+
def tween opts, &blk
|
452
|
+
opts = opts.dup
|
453
|
+
|
454
|
+
if opts[:upward]
|
455
|
+
opts[:top] = self.top - opts.delete(:upward)
|
456
|
+
elsif opts[:downward]
|
457
|
+
opts[:top] = self.top + opts.delete(:downward)
|
458
|
+
end
|
459
|
+
|
460
|
+
if opts[:sideways]
|
461
|
+
opts[:left] = self.left + opts.delete(:sideways)
|
462
|
+
end
|
463
|
+
|
464
|
+
@TWEEN.remove if @TWEEN
|
465
|
+
@TWEEN = parent.animate(opts[:speed] || 20) do
|
466
|
+
|
467
|
+
# figure out a coordinate halfway between here and there
|
468
|
+
cont = opts.select do |k, v|
|
469
|
+
if self.respond_to? k
|
470
|
+
n, o = v, self.send(k)
|
471
|
+
if n != o
|
472
|
+
n = o + ((n - o) / 2)
|
473
|
+
n = v if o == n
|
474
|
+
self.send("#{k}=", n)
|
475
|
+
end
|
476
|
+
self.style[k] != v
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
480
|
+
# if we're there, get rid of the animation
|
481
|
+
if cont.empty?
|
482
|
+
@TWEEN.remove
|
483
|
+
@TWEEN = nil
|
484
|
+
blk.call if blk
|
485
|
+
end
|
486
|
+
end
|
487
|
+
end
|
488
|
+
end
|
489
|
+
|
490
|
+
# complete list of styles
|
491
|
+
BASIC_S = [:left, :top, :right, :bottom, :width, :height, :attach, :hidden,
|
492
|
+
:displace_left, :displace_top, :margin, :margin_left, :margin_top,
|
493
|
+
:margin_right, :margin_bottom]
|
494
|
+
TEXT_S = [:strikecolor, :undercolor, :font, :size, :family, :weight,
|
495
|
+
:rise, :kerning, :emphasis, :strikethrough, :stretch, :underline,
|
496
|
+
:variant]
|
497
|
+
MOUSE_S = [:click, :motion, :release, :hover, :leave]
|
498
|
+
KEY_S = [:keydown, :keypress, :keyup]
|
499
|
+
COLOR_S = [:stroke, :fill]
|
500
|
+
|
501
|
+
{Background => [:angle, :radius, :curve, *BASIC_S],
|
502
|
+
Border => [:angle, :radius, :curve, :strokewidth, *BASIC_S],
|
503
|
+
Canvas => [:scroll, :start, :finish, *(KEY_S|MOUSE_S|BASIC_S)],
|
504
|
+
Check => [:click, :checked, *BASIC_S],
|
505
|
+
Radio => [:click, :checked, :group, *BASIC_S],
|
506
|
+
EditLine => [:change, :secret, :text, *BASIC_S],
|
507
|
+
EditBox => [:change, :text, *BASIC_S],
|
508
|
+
Effect => [:radius, :distance, :inner, *(COLOR_S|BASIC_S)],
|
509
|
+
Image => MOUSE_S|BASIC_S,
|
510
|
+
ListBox => [:change, :items, :choose, *BASIC_S],
|
511
|
+
# Pattern => [:angle, :radius, *BASIC_S],
|
512
|
+
Progress => BASIC_S,
|
513
|
+
Shape => COLOR_S|MOUSE_S|BASIC_S,
|
514
|
+
TextBlock => [:justify, :align, :leading, *(COLOR_S|MOUSE_S|TEXT_S|BASIC_S)],
|
515
|
+
Text => COLOR_S|MOUSE_S|TEXT_S|BASIC_S}.
|
516
|
+
each do |klass, styles|
|
517
|
+
klass.class_eval do
|
518
|
+
include Basic
|
519
|
+
styles.each do |m|
|
520
|
+
case m when *MOUSE_S
|
521
|
+
else
|
522
|
+
define_method(m) { style[m] } unless klass.method_defined? m
|
523
|
+
define_method("#{m}=") { |v| style(m => v) } unless klass.method_defined? "#{m}="
|
524
|
+
end
|
525
|
+
end
|
526
|
+
end
|
527
|
+
end
|
528
|
+
|
529
|
+
class Types::Widget
|
530
|
+
@types = {}
|
531
|
+
def self.inherited subc
|
532
|
+
methc = subc.to_s[/(^|::)(\w+)$/, 2].
|
533
|
+
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
|
534
|
+
gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase
|
535
|
+
@types[methc] = subc
|
536
|
+
Shoes.class_eval %{
|
537
|
+
def #{methc}(*a, &b)
|
538
|
+
a.unshift Widget.instance_variable_get("@types")[#{methc.dump}]
|
539
|
+
widget(*a, &b)
|
540
|
+
end
|
541
|
+
}
|
542
|
+
end
|
543
|
+
end
|
544
|
+
end
|
545
|
+
|
546
|
+
def window(*a, &b)
|
547
|
+
Shoes.app(*a, &b)
|
548
|
+
end
|