shoes 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. data/.gitignore +12 -0
  2. data/CHANGELOG +29 -0
  3. data/COPYING +30 -0
  4. data/README.md +76 -0
  5. data/README.old +117 -0
  6. data/Rakefile +130 -0
  7. data/Rakefile.bk +651 -0
  8. data/app.yaml +7 -0
  9. data/bin/main.skel +104 -0
  10. data/bugs/issue-012e9468ddc7b0cb7e1503413a8a11c4f8707b67.yaml +21 -0
  11. data/bugs/issue-0711ff8b67baa63586f11d0096fee9dd4436bf58.yaml +23 -0
  12. data/bugs/issue-07f87998d93eb401e22395c11085676389b935c4.yaml +22 -0
  13. data/bugs/issue-0bff2d80008803cbc7efbcdacdc60ef2163664d2.yaml +22 -0
  14. data/bugs/issue-0c66f223d19efbca7b692f3b91961f407ad7abec.yaml +24 -0
  15. data/bugs/issue-183bc3c7a8f575aff2b24e0bf22aa0dfcc8e4fc2.yaml +29 -0
  16. data/bugs/issue-1bad1e60a04cb3adb6a8f3ded128af2e16b56ffe.yaml +18 -0
  17. data/bugs/issue-1f1d43f76bf4de79d7f94adbae6dd506a9d81633.yaml +41 -0
  18. data/bugs/issue-320924117cadb045cc91f2a6fca922b4d81d4bb5.yaml +20 -0
  19. data/bugs/issue-33e5c8355fbf65252ea9e939714651df8bd8cb3b.yaml +25 -0
  20. data/bugs/issue-36f7c8262a72bcd5e28cfa4ed29328b8237ea79b.yaml +20 -0
  21. data/bugs/issue-39bf04ee50c3bef67b89b8e9beb28657805587ce.yaml +18 -0
  22. data/bugs/issue-3e28ba7754f73d02ef416eef989af707a8c00f01.yaml +23 -0
  23. data/bugs/issue-3f638cc03f41f9c3fdf217355321f1563f8fee45.yaml +22 -0
  24. data/bugs/issue-41e48e14f1ef4f6deb69be68165d7dd3ffd99156.yaml +22 -0
  25. data/bugs/issue-4c9408166a2aa5dd333bbb05520deebf4ded08e0.yaml +22 -0
  26. data/bugs/issue-55c687e108ecd5aeb8e0d0aeb4294984f84acd3e.yaml +18 -0
  27. data/bugs/issue-5811d34692cc292717a58ec1df1f8948cf30d826.yaml +28 -0
  28. data/bugs/issue-5a7c1f59a0526f9cea7fb366867cf1e6ed8ef69d.yaml +22 -0
  29. data/bugs/issue-688a2c2566bef6a03efa57a4ae1f7cfa8fc74444.yaml +21 -0
  30. data/bugs/issue-78b16c7988ade2ef96e716fa8cb9a004bd4ced65.yaml +33 -0
  31. data/bugs/issue-804ee49f9800154eddf0650690c7a9bb5626253f.yaml +27 -0
  32. data/bugs/issue-807dd1c610b2e941a5d454e26b2eac27e89a0ab4.yaml +22 -0
  33. data/bugs/issue-822ee33ec11ebd25f90ea86e8438de7891e63aee.yaml +18 -0
  34. data/bugs/issue-82ff7152cebb8a1cb065b864cb4fe22de2328146.yaml +29 -0
  35. data/bugs/issue-856afbdcdd4970ad54b8ce4a6c017fbaab45f49d.yaml +31 -0
  36. data/bugs/issue-8d49e32fb21522651c67490adb4d80076dbb14e1.yaml +24 -0
  37. data/bugs/issue-91583359653a9d530c1e32be72d874d847a306e7.yaml +21 -0
  38. data/bugs/issue-af41a5229613172764e7d3c98431172db337053d.yaml +20 -0
  39. data/bugs/issue-bd9856b3788dd429c998a5af1b2aae8221cb80b7.yaml +28 -0
  40. data/bugs/issue-be22aef5c564fb7b5e9938343136a9cd6a2edb7b.yaml +22 -0
  41. data/bugs/issue-bf8697523c77c326e7e35fc82cf3dd739ae92310.yaml +27 -0
  42. data/bugs/issue-cdd4b4795f34d6ff46e56ece10f8216a4a5456b2.yaml +25 -0
  43. data/bugs/issue-d9bfb5581d745ef9deb3b9b2e08ef74d1cd43082.yaml +20 -0
  44. data/bugs/issue-e0ce2f687cc096f35715d28b0af88589f4ab6cc6.yaml +18 -0
  45. data/bugs/issue-e4b0aca4a10a574b333aeaecaaf221dbc5ed22c6.yaml +38 -0
  46. data/bugs/issue-f263746594b95ba778455730478ee8df60ee639d.yaml +22 -0
  47. data/bugs/project.yaml +72 -0
  48. data/builddeps.sh +102 -0
  49. data/fonts/Coolvetica.ttf +0 -0
  50. data/fonts/Lacuna.ttf +0 -0
  51. data/gemlib/shoes.rb +1 -0
  52. data/lib/shoes.rb +548 -0
  53. data/lib/shoes/cache.rb +54 -0
  54. data/lib/shoes/chipmunk.rb +35 -0
  55. data/lib/shoes/data.rb +39 -0
  56. data/lib/shoes/help.rb +468 -0
  57. data/lib/shoes/image.rb +25 -0
  58. data/lib/shoes/inspect.rb +128 -0
  59. data/lib/shoes/log.rb +48 -0
  60. data/lib/shoes/minitar.rb +986 -0
  61. data/lib/shoes/override.rb +38 -0
  62. data/lib/shoes/pack.rb +543 -0
  63. data/lib/shoes/search.rb +46 -0
  64. data/lib/shoes/setup.rb +329 -0
  65. data/lib/shoes/shy.rb +131 -0
  66. data/lib/shoes/shybuilder.rb +44 -0
  67. data/lib/shoes/version.rb +3 -0
  68. data/make/darwin/deps.vlc +12 -0
  69. data/make/darwin/dylibs.shoes +22 -0
  70. data/make/darwin/dylibs.video +11 -0
  71. data/make/darwin/env.rb +81 -0
  72. data/make/darwin/tasks.rb +105 -0
  73. data/make/linux/env.rb +65 -0
  74. data/make/linux/tasks.rb +61 -0
  75. data/make/make.rb +85 -0
  76. data/make/mingw/dlls +19 -0
  77. data/make/mingw/env.rb +69 -0
  78. data/make/mingw/tasks.rb +70 -0
  79. data/make/rakefile_common.rb +8 -0
  80. data/manual-snapshots/class-book.png +0 -0
  81. data/manual-snapshots/expert-definr.png +0 -0
  82. data/manual-snapshots/expert-funnies.png +0 -0
  83. data/manual-snapshots/expert-irb.png +0 -0
  84. data/manual-snapshots/expert-minesweeper.png +0 -0
  85. data/manual-snapshots/expert-othello.png +0 -0
  86. data/manual-snapshots/expert-pong.png +0 -0
  87. data/manual-snapshots/expert-tankspank.png +0 -0
  88. data/manual-snapshots/good-arc.png +0 -0
  89. data/manual-snapshots/good-clock.png +0 -0
  90. data/manual-snapshots/good-follow.png +0 -0
  91. data/manual-snapshots/good-reminder.png +0 -0
  92. data/manual-snapshots/good-vjot.png +0 -0
  93. data/manual-snapshots/simple-accordion.png +0 -0
  94. data/manual-snapshots/simple-anim-shapes.png +0 -0
  95. data/manual-snapshots/simple-anim-text.png +0 -0
  96. data/manual-snapshots/simple-arc.png +0 -0
  97. data/manual-snapshots/simple-bounce.png +0 -0
  98. data/manual-snapshots/simple-calc.png +0 -0
  99. data/manual-snapshots/simple-chipmunk.png +0 -0
  100. data/manual-snapshots/simple-control-sizes.png +0 -0
  101. data/manual-snapshots/simple-curve.png +0 -0
  102. data/manual-snapshots/simple-dialogs.png +0 -0
  103. data/manual-snapshots/simple-downloader.png +0 -0
  104. data/manual-snapshots/simple-draw.png +0 -0
  105. data/manual-snapshots/simple-editor.png +0 -0
  106. data/manual-snapshots/simple-form.png +0 -0
  107. data/manual-snapshots/simple-mask.png +0 -0
  108. data/manual-snapshots/simple-menu.png +0 -0
  109. data/manual-snapshots/simple-menu1.png +0 -0
  110. data/manual-snapshots/simple-rubygems.png +0 -0
  111. data/manual-snapshots/simple-slide.png +0 -0
  112. data/manual-snapshots/simple-sphere.png +0 -0
  113. data/manual-snapshots/simple-sqlite3.png +0 -0
  114. data/manual-snapshots/simple-timer.png +0 -0
  115. data/manual-snapshots/simple-video.png +0 -0
  116. data/platform/mac/Info.plist +55 -0
  117. data/platform/mac/build-deps.sh +658 -0
  118. data/platform/mac/command-manual.rb +1 -0
  119. data/platform/mac/deps-osx.patch +159 -0
  120. data/platform/mac/dmg_ds_store +0 -0
  121. data/platform/mac/pangorc +2 -0
  122. data/platform/mac/pkg-dmg +1447 -0
  123. data/platform/mac/shoes +31 -0
  124. data/platform/mac/shoes-launch +7 -0
  125. data/platform/mac/stub.m +178 -0
  126. data/platform/mac/version.plist +14 -0
  127. data/platform/msw/base.nsi +644 -0
  128. data/platform/msw/installer-1.bmp +0 -0
  129. data/platform/msw/installer-2.bmp +0 -0
  130. data/platform/msw/shoes.exe.manifest +17 -0
  131. data/platform/msw/shoes.ico +0 -0
  132. data/platform/msw/stub-inject.c +59 -0
  133. data/platform/msw/stub.c +271 -0
  134. data/platform/msw/stub32.h +14 -0
  135. data/platform/msw/stub32.rc +16 -0
  136. data/platform/nix/INSTALL +56 -0
  137. data/platform/nix/Makefile +144 -0
  138. data/platform/nix/shoes.launch +20 -0
  139. data/platform/skel.rb +27 -0
  140. data/rakefile_darwin.rb +7 -0
  141. data/rakefile_linux.rb +3 -0
  142. data/rakefile_mingw.rb +7 -0
  143. data/samples/class-book.rb +43 -0
  144. data/samples/class-book.yaml +387 -0
  145. data/samples/expert-definr.rb +23 -0
  146. data/samples/expert-funnies.rb +51 -0
  147. data/samples/expert-irb.rb +112 -0
  148. data/samples/expert-minesweeper.rb +267 -0
  149. data/samples/expert-othello.rb +319 -0
  150. data/samples/expert-pong.rb +62 -0
  151. data/samples/expert-tankspank.rb +385 -0
  152. data/samples/good-arc.rb +37 -0
  153. data/samples/good-clock.rb +51 -0
  154. data/samples/good-follow.rb +26 -0
  155. data/samples/good-reminder.rb +174 -0
  156. data/samples/good-vjot.rb +56 -0
  157. data/samples/simple-accordion.rb +75 -0
  158. data/samples/simple-anim-shapes.rb +17 -0
  159. data/samples/simple-anim-text.rb +13 -0
  160. data/samples/simple-arc.rb +23 -0
  161. data/samples/simple-bounce.rb +24 -0
  162. data/samples/simple-calc.rb +70 -0
  163. data/samples/simple-chipmunk.rb +26 -0
  164. data/samples/simple-control-sizes.rb +24 -0
  165. data/samples/simple-curve.rb +26 -0
  166. data/samples/simple-dialogs.rb +29 -0
  167. data/samples/simple-downloader.rb +27 -0
  168. data/samples/simple-draw.rb +13 -0
  169. data/samples/simple-editor.rb +28 -0
  170. data/samples/simple-form.rb +28 -0
  171. data/samples/simple-form.shy +0 -0
  172. data/samples/simple-mask.rb +21 -0
  173. data/samples/simple-menu.rb +31 -0
  174. data/samples/simple-menu1.rb +35 -0
  175. data/samples/simple-rubygems.rb +29 -0
  176. data/samples/simple-slide.rb +45 -0
  177. data/samples/simple-sphere.rb +28 -0
  178. data/samples/simple-sqlite3.rb +13 -0
  179. data/samples/simple-timer.rb +13 -0
  180. data/samples/simple-video.rb +13 -0
  181. data/shoes.gemspec +21 -0
  182. data/shoes/app.c +591 -0
  183. data/shoes/app.h +110 -0
  184. data/shoes/appwin32.h +13 -0
  185. data/shoes/appwin32.rc +28 -0
  186. data/shoes/canvas.c +2202 -0
  187. data/shoes/canvas.h +682 -0
  188. data/shoes/code.h +14 -0
  189. data/shoes/config.h +232 -0
  190. data/shoes/effects.c +243 -0
  191. data/shoes/effects.h +7 -0
  192. data/shoes/http.h +44 -0
  193. data/shoes/http/common.h +86 -0
  194. data/shoes/http/curl.c +259 -0
  195. data/shoes/http/nsurl.m +274 -0
  196. data/shoes/http/windownload.c +114 -0
  197. data/shoes/http/winhttp.c +216 -0
  198. data/shoes/http/winhttp.h +19 -0
  199. data/shoes/image.c +1020 -0
  200. data/shoes/internal.c +46 -0
  201. data/shoes/internal.h +63 -0
  202. data/shoes/native.h +110 -0
  203. data/shoes/native/cocoa.h +105 -0
  204. data/shoes/native/cocoa.m +1557 -0
  205. data/shoes/native/gtk.c +1257 -0
  206. data/shoes/native/windows.c +2392 -0
  207. data/shoes/ruby.c +5221 -0
  208. data/shoes/ruby.h +299 -0
  209. data/shoes/world.c +243 -0
  210. data/shoes/world.h +63 -0
  211. data/static/Shoes.icns +0 -0
  212. data/static/avatar.png +0 -0
  213. data/static/code_highlighter.js +188 -0
  214. data/static/code_highlighter_ruby.js +26 -0
  215. data/static/icon-debug.png +0 -0
  216. data/static/icon-error.png +0 -0
  217. data/static/icon-info.png +0 -0
  218. data/static/icon-warn.png +0 -0
  219. data/static/listbox_button1.png +0 -0
  220. data/static/listbox_button2.png +0 -0
  221. data/static/man-app.png +0 -0
  222. data/static/man-builds.png +0 -0
  223. data/static/man-builds1.png +0 -0
  224. data/static/man-editor-notepad.png +0 -0
  225. data/static/man-editor-osx.png +0 -0
  226. data/static/man-ele-background.png +0 -0
  227. data/static/man-ele-border.png +0 -0
  228. data/static/man-ele-button.png +0 -0
  229. data/static/man-ele-check.png +0 -0
  230. data/static/man-ele-editbox.png +0 -0
  231. data/static/man-ele-editline.png +0 -0
  232. data/static/man-ele-image.png +0 -0
  233. data/static/man-ele-listbox.png +0 -0
  234. data/static/man-ele-progress.png +0 -0
  235. data/static/man-ele-radio.png +0 -0
  236. data/static/man-ele-shape.png +0 -0
  237. data/static/man-ele-textblock.png +0 -0
  238. data/static/man-ele-video.png +0 -0
  239. data/static/man-intro-dmg.png +0 -0
  240. data/static/man-intro-exe.png +0 -0
  241. data/static/man-look-tiger.png +0 -0
  242. data/static/man-look-ubuntu.png +0 -0
  243. data/static/man-look-vista.png +0 -0
  244. data/static/man-run-osx.png +0 -0
  245. data/static/man-run-vista.png +0 -0
  246. data/static/man-run-xp.png +0 -0
  247. data/static/man-shot1.png +0 -0
  248. data/static/manual-en.txt +3531 -0
  249. data/static/manual-ja.txt +2825 -0
  250. data/static/manual.css +167 -0
  251. data/static/menu-corner1.png +0 -0
  252. data/static/menu-corner2.png +0 -0
  253. data/static/menu-gray.png +0 -0
  254. data/static/menu-left.png +0 -0
  255. data/static/menu-right.png +0 -0
  256. data/static/menu-top.png +0 -0
  257. data/static/shoes-dmg.jpg +0 -0
  258. data/static/shoes-icon-blue.png +0 -0
  259. data/static/shoes-icon.png +0 -0
  260. data/static/shoes-manual-apps.gif +0 -0
  261. data/static/shoes_main_window.png +0 -0
  262. data/static/stripe.png +0 -0
  263. data/static/stubs/blank.exe +0 -0
  264. data/static/stubs/blank.hfz +0 -0
  265. data/static/stubs/blank.run +375 -0
  266. data/static/stubs/cocoa-install +0 -0
  267. data/static/stubs/sh-install +49 -0
  268. data/static/stubs/shoes-stub-inject.exe +0 -0
  269. data/static/stubs/shoes-stub.exe +0 -0
  270. data/static/tutor-back.png +0 -0
  271. data/test/shoes_test.rb +8 -0
  272. data/test/test_helper.rb +25 -0
  273. data/use-deps +12 -0
  274. data/use-tmp-dep +8 -0
  275. metadata +509 -0
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3
+ <dependency>
4
+ <dependentAssembly>
5
+ <assemblyIdentity
6
+ type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="x86" />
7
+ </dependentAssembly>
8
+ </dependency>
9
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
10
+ <security>
11
+ <requestedPrivileges>
12
+ <requestedExecutionLevel
13
+ level="asInvoker"/>
14
+ </requestedPrivileges>
15
+ </security>
16
+ </trustInfo>
17
+ </assembly>
Binary file
@@ -0,0 +1,59 @@
1
+ #include <stdio.h>
2
+ #include <windows.h>
3
+
4
+ #define BUFSIZE 512
5
+
6
+ int WINAPI
7
+ WinMain(HINSTANCE inst, HINSTANCE inst2, LPSTR arg, int style)
8
+ {
9
+ LPBYTE data = NULL;
10
+ HANDLE payload = CreateFile(arg, GENERIC_READ, FILE_SHARE_READ,
11
+ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
12
+ if (payload != INVALID_HANDLE_VALUE)
13
+ {
14
+ DWORD rlen = 0;
15
+ TCHAR outPath[BUFSIZE];
16
+ DWORD len = GetFileSize(payload, NULL);
17
+ data = (LPBYTE)LocalAlloc(LPTR, len + 1);
18
+ SetFilePointer(payload, 0, 0, FILE_BEGIN);
19
+ ReadFile(payload, data, len, &rlen, NULL);
20
+ CloseHandle(payload);
21
+
22
+ LPTSTR fname = strrchr(arg, '\\');
23
+ if (fname == NULL)
24
+ fname = arg;
25
+ else
26
+ fname += 1;
27
+
28
+ strcpy(outPath, arg);
29
+ LPSTR ext = strrchr(outPath, '.');
30
+ if (ext != NULL)
31
+ *ext = '\0';
32
+ strcat(outPath, ".exe");
33
+
34
+ CopyFile("shoes-stub.exe", outPath, FALSE);
35
+ HANDLE exe = BeginUpdateResource(outPath, FALSE);
36
+ UpdateResource(exe, RT_STRING, "SHOES_FILENAME",
37
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), fname, strlen(fname));
38
+ UpdateResource(exe, RT_RCDATA, "SHOES_PAYLOAD",
39
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), data, rlen);
40
+
41
+ payload = CreateFile("shoes-setup.exe", GENERIC_READ, FILE_SHARE_READ,
42
+ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
43
+ if (payload != INVALID_HANDLE_VALUE)
44
+ {
45
+ LPBYTE setup = NULL;
46
+ DWORD setuplen = 0;
47
+ len = GetFileSize(payload, NULL);
48
+ setup = (LPBYTE)LocalAlloc(LPTR, len + 1);
49
+ SetFilePointer(payload, 0, 0, FILE_BEGIN);
50
+ ReadFile(payload, setup, len, &setuplen, NULL);
51
+ CloseHandle(payload);
52
+ UpdateResource(exe, RT_RCDATA, "SHOES_SETUP",
53
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), setup, setuplen);
54
+ }
55
+ EndUpdateResource(exe, FALSE);
56
+ LocalFree(data);
57
+ LocalFree(fname);
58
+ }
59
+ }
@@ -0,0 +1,271 @@
1
+ #include <stdio.h>
2
+ #include <stdlib.h>
3
+
4
+ #define LONG_LONG long long
5
+ #define SHOES_TIME DWORD
6
+ #define SHOES_DOWNLOAD_ERROR DWORD
7
+
8
+ #include "shoes/version.h"
9
+ #include "shoes/internal.h"
10
+ #include "shoes/http/winhttp.h"
11
+ #include "stub32.h"
12
+
13
+ #define BUFSIZE 512
14
+
15
+ HWND dlg;
16
+ BOOL http_abort = FALSE;
17
+
18
+ int
19
+ StubDownloadingShoes(shoes_http_event *event, void *data)
20
+ {
21
+ TCHAR msg[512];
22
+ if (http_abort) return SHOES_DOWNLOAD_HALT;
23
+ if (event->stage == SHOES_HTTP_TRANSFER)
24
+ {
25
+ sprintf(msg, "Shoes is downloading. (%d%% done)", event->percent);
26
+ SetDlgItemText(dlg, IDSHOE, msg);
27
+ SendMessage(GetDlgItem(dlg, IDPROG), PBM_SETPOS, event->percent, 0L);
28
+ }
29
+ return SHOES_DOWNLOAD_CONTINUE;
30
+ }
31
+
32
+ void
33
+ CenterWindow(HWND hwnd)
34
+ {
35
+ RECT rc;
36
+
37
+ GetWindowRect (hwnd, &rc);
38
+
39
+ SetWindowPos(hwnd, 0,
40
+ (GetSystemMetrics(SM_CXSCREEN) - rc.right)/2,
41
+ (GetSystemMetrics(SM_CYSCREEN) - rc.bottom)/2,
42
+ 0, 0, SWP_NOZORDER|SWP_NOSIZE );
43
+ }
44
+
45
+ BOOL CALLBACK
46
+ stub_win32proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
47
+ {
48
+ switch (message)
49
+ {
50
+ case WM_INITDIALOG:
51
+ CenterWindow(hwnd);
52
+ return TRUE;
53
+
54
+ case WM_COMMAND:
55
+ if (LOWORD(wParam) == IDCANCEL)
56
+ {
57
+ http_abort = TRUE;
58
+ EndDialog(hwnd, LOWORD(wParam));
59
+ return TRUE;
60
+ }
61
+ break;
62
+
63
+ case WM_CLOSE:
64
+ http_abort = TRUE;
65
+ EndDialog(hwnd, 0);
66
+ return FALSE;
67
+ }
68
+ return FALSE;
69
+ }
70
+
71
+ void
72
+ shoes_silent_install(TCHAR *path)
73
+ {
74
+ SHELLEXECUTEINFO shell = {0};
75
+ SetDlgItemText(dlg, IDSHOE, "Setting up Shoes...");
76
+ shell.cbSize = sizeof(SHELLEXECUTEINFO);
77
+ shell.fMask = SEE_MASK_NOCLOSEPROCESS;
78
+ shell.hwnd = NULL;
79
+ shell.lpVerb = NULL;
80
+ shell.lpFile = path;
81
+ shell.lpParameters = "/S";
82
+ shell.lpDirectory = NULL;
83
+ shell.nShow = SW_SHOW;
84
+ shell.hInstApp = NULL;
85
+ ShellExecuteEx(&shell);
86
+ WaitForSingleObject(shell.hProcess,INFINITE);
87
+ }
88
+
89
+ char *setup_exe = "shoes-setup.exe";
90
+
91
+ DWORD WINAPI
92
+ shoes_auto_setup(IN DWORD mid, IN WPARAM w, LPARAM &l, IN LPVOID vinst)
93
+ {
94
+ HINSTANCE inst = (HINSTANCE)vinst;
95
+ TCHAR setup_path[BUFSIZE];
96
+ GetTempPath(BUFSIZE, setup_path);
97
+ strncat(setup_path, setup_exe, strlen(setup_exe));
98
+
99
+ HANDLE install = CreateFile(setup_path, GENERIC_READ | GENERIC_WRITE,
100
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
101
+ HRSRC setupres = FindResource(inst, "SHOES_SETUP", RT_RCDATA);
102
+ DWORD len = 0, rlen = 0;
103
+ LPVOID data = NULL;
104
+ len = SizeofResource(inst, setupres);
105
+ if (GetFileSize(install, NULL) != len)
106
+ {
107
+ HGLOBAL resdata = LoadResource(inst, setupres);
108
+ data = LockResource(resdata);
109
+ SetFilePointer(install, 0, 0, FILE_BEGIN);
110
+ SetEndOfFile(install);
111
+ WriteFile(install, (LPBYTE)data, len, &rlen, NULL);
112
+ }
113
+ CloseHandle(install);
114
+ SendMessage(GetDlgItem(dlg, IDPROG), PBM_SETPOS, 50, 0L);
115
+
116
+ shoes_silent_install(setup_path);
117
+ return 0;
118
+ }
119
+
120
+ DWORD WINAPI
121
+ shoes_http_thread(IN DWORD mid, IN WPARAM w, LPARAM &l, IN LPVOID data)
122
+ {
123
+ DWORD len = 0;
124
+ WCHAR path[BUFSIZE];
125
+ TCHAR *buf = SHOE_ALLOC_N(TCHAR, BUFSIZE);
126
+ TCHAR *empty = NULL;
127
+ HANDLE file;
128
+ TCHAR *nl;
129
+ TCHAR setup_path[BUFSIZE];
130
+ GetTempPath(BUFSIZE, setup_path);
131
+ strncat(setup_path, setup_exe, strlen(setup_exe));
132
+
133
+ shoes_winhttp(NULL, L"www.rin-shun.com", 80, L"/pkg/win32/shoes",
134
+ NULL, NULL, NULL, 0, &buf, BUFSIZE,
135
+ INVALID_HANDLE_VALUE, &len, SHOES_DL_DEFAULTS, NULL, NULL);
136
+ if (len == 0)
137
+ return 0;
138
+
139
+ nl = strstr(buf, "\n");
140
+ if (nl) nl[0] = '\0';
141
+
142
+ len = 0;
143
+ MultiByteToWideChar(CP_ACP, 0, buf, -1, path, BUFSIZE);
144
+ file = CreateFile(setup_path, GENERIC_READ | GENERIC_WRITE,
145
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
146
+ shoes_winhttp(NULL, L"www.rin-shun.com", 80, path,
147
+ NULL, NULL, NULL, 0, &empty, 0, file, &len,
148
+ SHOES_DL_DEFAULTS, HTTP_HANDLER(StubDownloadingShoes), NULL);
149
+ CloseHandle(file);
150
+
151
+ shoes_silent_install(setup_path);
152
+ return 0;
153
+ }
154
+
155
+ static BOOL
156
+ file_exists(char *fname)
157
+ {
158
+ WIN32_FIND_DATA data;
159
+ if (FindFirstFile(fname, &data) != INVALID_HANDLE_VALUE)
160
+ return !(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
161
+ return FALSE;
162
+ }
163
+
164
+ static BOOL
165
+ reg_s(HKEY key, char* sub_key, char* val, LPBYTE data, LPDWORD data_len) {
166
+ HKEY hkey;
167
+ BOOL ret = FALSE;
168
+ LONG retv;
169
+
170
+ retv = RegOpenKeyEx(key, sub_key, 0, KEY_QUERY_VALUE, &hkey);
171
+ if (retv == ERROR_SUCCESS)
172
+ {
173
+ retv = RegQueryValueEx(hkey, val, NULL, NULL, data, data_len);
174
+ if (retv == ERROR_SUCCESS)
175
+ return TRUE;
176
+ }
177
+ return FALSE;
178
+ }
179
+
180
+ int WINAPI
181
+ WinMain(HINSTANCE inst, HINSTANCE inst2, LPSTR arg, int style)
182
+ {
183
+ HRSRC nameres, shyres, setupres;
184
+ DWORD len = 0, rlen = 0, tid = 0;
185
+ LPVOID data = NULL;
186
+ TCHAR buf[BUFSIZE], path[BUFSIZE], cmd[BUFSIZE];
187
+ HKEY hkey;
188
+ BOOL shoes;
189
+ DWORD plen;
190
+ HANDLE payload, th;
191
+ MSG msg;
192
+ char *key = "SOFTWARE\\Hackety.org\\Shoes";
193
+
194
+ nameres = FindResource(inst, "SHOES_FILENAME", RT_STRING);
195
+ shyres = FindResource(inst, "SHOES_PAYLOAD", RT_RCDATA);
196
+ if (nameres == NULL || shyres == NULL)
197
+ {
198
+ MessageBox(NULL, "This is an empty Shoes stub.", "shoes!! feel yeah!!", MB_OK);
199
+ return 0;
200
+ }
201
+
202
+ setupres = FindResource(inst, "SHOES_SETUP", RT_RCDATA);
203
+ plen = sizeof(path);
204
+ if (!(shoes = reg_s((hkey=HKEY_LOCAL_MACHINE), key, "", (LPBYTE)&path, &plen)))
205
+ shoes = reg_s((hkey=HKEY_CURRENT_USER), key, "", (LPBYTE)&path, &plen);
206
+
207
+ if (shoes)
208
+ {
209
+ sprintf(cmd, "%s\\shoes.exe", path);
210
+ if (!file_exists(cmd)) shoes = FALSE;
211
+ memset(cmd, 0, BUFSIZE);
212
+ }
213
+
214
+ if (!shoes)
215
+ {
216
+ LPTHREAD_START_ROUTINE back_action = (LPTHREAD_START_ROUTINE)shoes_auto_setup;
217
+
218
+ INITCOMMONCONTROLSEX InitCtrlEx;
219
+ InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
220
+ InitCtrlEx.dwICC = ICC_PROGRESS_CLASS;
221
+ InitCommonControlsEx(&InitCtrlEx);
222
+
223
+ dlg = CreateDialog(inst, MAKEINTRESOURCE(ASKDLG), NULL, stub_win32proc);
224
+ ShowWindow(dlg, SW_SHOW);
225
+
226
+ if (setupres == NULL)
227
+ back_action = (LPTHREAD_START_ROUTINE)shoes_http_thread;
228
+
229
+ if (!(th = CreateThread(0, 0, back_action, inst, 0, &tid)))
230
+ return 0;
231
+
232
+ while (WaitForSingleObject(th, 10) != WAIT_OBJECT_0)
233
+ {
234
+ while (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE))
235
+ {
236
+ TranslateMessage(&msg);
237
+ DispatchMessage(&msg);
238
+ }
239
+ }
240
+ CloseHandle(th);
241
+
242
+ if (!(shoes = reg_s((hkey=HKEY_LOCAL_MACHINE), key, "", (LPBYTE)&path, &plen)))
243
+ shoes = reg_s((hkey=HKEY_CURRENT_USER), key, "", (LPBYTE)&path, &plen);
244
+ }
245
+
246
+ if (shoes)
247
+ {
248
+ GetTempPath(BUFSIZE, buf);
249
+ data = LoadResource(inst, nameres);
250
+ len = SizeofResource(inst, nameres);
251
+ strncat(buf, (LPTSTR)data, len);
252
+
253
+ payload = CreateFile(buf, GENERIC_READ | GENERIC_WRITE,
254
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
255
+ len = SizeofResource(inst, shyres);
256
+ if (GetFileSize(payload, NULL) != len)
257
+ {
258
+ HGLOBAL resdata = LoadResource(inst, shyres);
259
+ data = LockResource(resdata);
260
+ SetFilePointer(payload, 0, 0, FILE_BEGIN);
261
+ SetEndOfFile(payload);
262
+ WriteFile(payload, (LPBYTE)data, len, &rlen, NULL);
263
+ }
264
+ CloseHandle(payload);
265
+
266
+ sprintf(cmd, "%s\\..\\shoes.bat", path);
267
+ ShellExecute(NULL, "open", cmd, buf, NULL, 0);
268
+ }
269
+
270
+ return 0;
271
+ }
@@ -0,0 +1,14 @@
1
+ //
2
+ // shoes/stub32.h
3
+ // Resource IDs (see stub32.rc also)
4
+ //
5
+ #ifndef SHOES_APPWIN32_H
6
+ #define SHOES_APPWIN32_H
7
+
8
+ #include <commctrl.h>
9
+
10
+ #define ASKDLG 1
11
+ #define IDSHOE 111
12
+ #define IDPROG 112
13
+
14
+ #endif
@@ -0,0 +1,16 @@
1
+ #include <windows.h>
2
+ #include "stub32.h"
3
+
4
+ IDI_APPLICATION ICON
5
+ "..\\..\\shoes\\appwin32.ico"
6
+
7
+ ASKDLG DIALOG 20, 20, 199, 59
8
+ STYLE DS_SETFONT |DS_MODALFRAME |WS_POPUP |WS_VISIBLE |WS_SYSMENU |WS_CAPTION
9
+ CAPTION "shoes!! feel yeah!!"
10
+ FONT 8, "MS Shell Dlg"
11
+ BEGIN
12
+ CONTROL "Shoes is downloading.",IDSHOE,"STATIC",SS_LEFT |WS_CHILD |WS_VISIBLE ,8,8,179,14
13
+ CONTROL "",IDPROG,PROGRESS_CLASS,WS_CHILD |PBS_SMOOTH,8,24,179,8
14
+ CONTROL "&Cancel",IDCANCEL,"BUTTON",BS_PUSHBUTTON |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,88,38,40,14
15
+ END
16
+
@@ -0,0 +1,56 @@
1
+
2
+ READYING ONE'S SELF TO BUILD SHOES
3
+
4
+ Before building, be sure you have all the right libraries installed.
5
+ Shoes relies on Cairo, Pango, libungif, libjpeg, GTK+ 2.0, and Ruby,
6
+ as well as GCC and its linker.
7
+
8
+ To install all of these libraries on Ubuntu or Debian:
9
+
10
+ # aptitude install libcairo2-dev libpixman-1-dev libpango1.0-dev \
11
+ libungif4-dev libjpeg62-dev libgtk2.0-dev vlc libvlc-dev \
12
+ libsqlite3-dev libcurl4-openssl-dev libportaudio19-dev \
13
+ ruby1.8-dev rake
14
+
15
+ (On Ubuntu older than 8.10, actually you'll need libvlc0-dev.)
16
+
17
+ To install these libraries on Fedora:
18
+
19
+ # yum install -y giflib-devel cairo-devel libpixman-devel \
20
+ pango-devel libjpeg-devel gtk2-devel sqlite-devel vlc-devel \
21
+ libcurl-devel libportaudio-devel ruby-devel
22
+
23
+ //////////////////////////////////////////////////////////////////////////
24
+
25
+ BUILDING AND INSTALLING SHOES
26
+
27
+ To build from the source tarball:
28
+
29
+ $ make
30
+ # make install
31
+
32
+ A few options to be aware of:
33
+
34
+ * VIDEO=1 will build in VideoLAN support.
35
+ * PREFIX=/opt/shoes will install to /opt/shoes.
36
+
37
+ So, a practical use of the two options would be:
38
+
39
+ $ make VIDEO=1
40
+ # make PREFIX=/opt/shoes install
41
+
42
+ This source tarball should work for all Linux and BSD variants, but
43
+ if you need help building on your platform, consult the Shoes wiki.
44
+ <http://github.com/why/shoes/wikis>
45
+
46
+ Or, come join the Shoes mailing list, by sending an email.
47
+
48
+ To: shoes@code.whytheluckystiff.net
49
+ Cc: why@whytheluckystiff.net
50
+ Subject: subscribe
51
+
52
+ Be sure to CC the owner of the list, just as shown above.
53
+
54
+ //////////////////////////////////////////////////////////////////////////
55
+
56
+ STAYING CURRENT WITH SHOES
@@ -0,0 +1,144 @@
1
+ # shoes - abstract windowing for gtk, osx, and win32
2
+ # by why the lucky stiff, released to you under the MIT license
3
+
4
+ SRC = shoes/app.c shoes/canvas.c shoes/effects.c shoes/image.c shoes/internal.c shoes/ruby.c shoes/world.c shoes/native/gtk.c shoes/http/curl.c
5
+ OBJ = ${SRC:.c=.o}
6
+
7
+ PREFIX = /usr/local
8
+ INCS = -I. -I/usr/include -I/usr/local/include
9
+ LIBS = -L/usr/lib -L/usr/local/lib -lcairo -lpangocairo-1.0 -lgif -ljpeg -lrt
10
+
11
+ REVISION = `git rev-list HEAD | wc -l`
12
+ RUBY_INCS = `ruby -rrbconfig -e 'puts Config::CONFIG["archdir"]'`
13
+ RUBY_SO = `ruby -rrbconfig -e 'puts Config::CONFIG["RUBY_SO_NAME"]'`
14
+ RUBY_LIBS = `ruby -rrbconfig -e 'puts Config::CONFIG["LIBRUBYARG_SHARED"]'` -l${RUBY_SO}
15
+ RUBY_PREFIX = `ruby -rrbconfig -e 'puts Config::CONFIG["prefix"]'`
16
+ RUBY_PLATFORM = `ruby -rrbconfig -e 'puts RUBY_PLATFORM'`
17
+ RUBY_VERSION = `ruby -rrbconfig -e 'puts Config::CONFIG["ruby_version"]'`
18
+ CAIRO_CFLAGS = `pkg-config --cflags cairo`
19
+ CAIRO_LIB = `pkg-config --libs cairo`
20
+ PANGO_CFLAGS = `pkg-config --cflags pango`
21
+ PANGO_LIB = `pkg-config --libs pango`
22
+ GTK_CFLAGS = `pkg-config --cflags gtk+-2.0`
23
+ GTK_LIB = `pkg-config --libs gtk+-2.0`
24
+ CURL_CFLAGS = `curl-config --cflags`
25
+ CURL_LIB = `curl-config --libs`
26
+ RELEASE_NAME = `cat shoes/version.h | ruby -ne 'puts $$1.downcase if ~/SHOES_RELEASE_NAME "(.+)"/'`
27
+ HPRICOT_NAME = `ruby -rubygems -e 'puts eval(File.read("req/hpricot/gemspec")).full_name'`
28
+ SQLITE_NAME = `ruby -rubygems -e 'puts eval(File.read("req/sqlite3/gemspec")).full_name'`
29
+ JSON_NAME = `ruby -rubygems -e 'puts eval(File.read("req/json/gemspec")).full_name'`
30
+ GEM_DIR = "dist/ruby/gems/${RUBY_VERSION}"
31
+ SHOES_IDENT = "shoes ${RELEASE_NAME} (0.r${REVISION}) [${RUBY_PLATFORM}]"
32
+
33
+ VERSION = 0.r${REVISION}
34
+ CFLAGS = -DSHOES_GTK -fPIC ${INCS} ${CAIRO_CFLAGS} ${PANGO_CFLAGS} ${GTK_CFLAGS} ${CURL_CFLAGS} -I${RUBY_INCS}
35
+ LDFLAGS = -fPIC ${LIBS} ${CAIRO_LIB} ${PANGO_LIB} ${GTK_LIB} ${CURL_LIB} ${RUBY_LIBS}
36
+ OPTIONS =
37
+
38
+ ifeq (${DEBUG}, 1)
39
+ CFLAGS += -DDEBUG
40
+ OPTIONS += DEBUG
41
+ SHOES_IDENT += +debug
42
+ endif
43
+
44
+ ifeq (${VIDEO}, 1)
45
+ VLC_0_8 = $(shell vlc --version 2>/dev/null | ruby -ne 'puts $$1 if ~/VLC version (\d+\.\d+)/')
46
+ CFLAGS += -DVIDEO $(if $(filter 0.8, $(VLC_0_8)), -DVLC_0_8, -I/usr/include/vlc/plugins)
47
+ LIBS += -lvlc
48
+ OPTIONS += VIDEO
49
+ SHOES_IDENT += +video
50
+ endif
51
+
52
+ all: options dist/shoes.launch
53
+
54
+ options:
55
+ @echo build options: ${SHOES_IDENT}
56
+ @echo "CC = ${CC}"
57
+ @echo "RUBY = ${RUBY_PREFIX}"
58
+ @echo "OPTIONS =${OPTIONS}"
59
+
60
+ .c.o:
61
+ @echo CC $<
62
+ @${CC} -c ${CFLAGS} -o $@ $<
63
+
64
+ dist/libshoes.so: ${OBJ}
65
+ @echo CC -o $@
66
+ @mkdir dist
67
+ @${CC} -o $@ ${OBJ} ${LDFLAGS} -shared
68
+
69
+ dist/shoes-bin: dist/libshoes.so bin/main.o
70
+ @echo CC -o $@
71
+ @${CC} -o $@ ${LDFLAGS} bin/main.o -Ldist -lshoes
72
+
73
+ dist/shoes.launch: dist/shoes-bin
74
+ @cp platform/nix/shoes.launch dist/
75
+ @mkdir -p dist/ruby
76
+ @ln -s ${RUBY_PREFIX}/lib/ruby/1.8 dist/ruby/lib
77
+ @cp ${RUBY_PREFIX}/lib/lib${RUBY_SO}.so dist
78
+ @ln -s lib${RUBY_SO}.so dist/libruby.so.1.8
79
+ @cp -r lib dist/lib
80
+ @cp -r req/rubygems/* dist/lib
81
+ @mkdir -p ${GEM_DIR}/specifications
82
+ @mkdir -p ${GEM_DIR}/gems/${HPRICOT_NAME}
83
+ @cp -r req/hpricot/lib ${GEM_DIR}/gems/${HPRICOT_NAME}/lib
84
+ @cd req/hpricot/ext/hpricot_scan && ruby extconf.rb && make
85
+ @cp req/hpricot/ext/hpricot_scan/*.so ${GEM_DIR}/gems/${HPRICOT_NAME}/lib
86
+ @cp req/hpricot/gemspec ${GEM_DIR}/specifications/${HPRICOT_NAME}.gemspec
87
+ @mkdir -p ${GEM_DIR}/gems/${SQLITE_NAME}
88
+ @cp -r req/sqlite3/lib ${GEM_DIR}/gems/${SQLITE_NAME}/lib
89
+ @cd req/sqlite3/ext/sqlite3 && ruby extconf.rb && make
90
+ @cp req/sqlite3/ext/sqlite3/*.so ${GEM_DIR}/gems/${SQLITE_NAME}/lib
91
+ @cp req/sqlite3/gemspec ${GEM_DIR}/specifications/${SQLITE_NAME}.gemspec
92
+ @mkdir -p ${GEM_DIR}/gems/${JSON_NAME}
93
+ @cp -r req/json/lib ${GEM_DIR}/gems/${JSON_NAME}/lib
94
+ @cd req/json/ext/generator && ruby extconf.rb && make
95
+ @cd req/json/ext/parser && ruby extconf.rb && make
96
+ @mkdir -p ${GEM_DIR}/gems/${JSON_NAME}/lib/json/ext
97
+ @cp req/json/ext/**/*.so ${GEM_DIR}/gems/${JSON_NAME}/lib/json/ext
98
+ @cp req/json/gemspec ${GEM_DIR}/specifications/${JSON_NAME}.gemspec
99
+ @cp -r req/ftsearch/lib/* dist/lib
100
+ @cd req/ftsearch/ext/ftsearchrt && ruby extconf.rb && make
101
+ @cp req/ftsearch/ext/ftsearchrt/*.so dist/lib
102
+ @cd req/binject/ext/binject_c && ruby extconf.rb && make
103
+ @cp req/binject/ext/binject_c/*.so dist/lib
104
+ @cp -r samples dist/samples
105
+ @cp -r static dist/static
106
+ @rm -rf dist/**/.svn
107
+ @echo ${SHOES_IDENT} > dist/VERSION.txt
108
+ @cp README COPYING dist
109
+ @echo 'LD_LIBRARY_PATH="$$APPPATH/../lib/shoes" $$APPPATH/../lib/shoes/shoes-bin $$@' >> dist/shoes.launch
110
+ @chmod 755 dist/shoes.launch
111
+
112
+ clean:
113
+ @echo cleaning
114
+ @rm -rf dist
115
+ @rm -f ${OBJ} bin/main.o shoes-${VERSION}.tar.gz
116
+
117
+ dist: clean
118
+ @echo creating dist tarball
119
+ @mkdir -p shoes-${VERSION}
120
+ @cp -R COPYING Makefile README bin shoes samples static \
121
+ shoes-${VERSION}
122
+ @rm -f shoes-${VERSION}/bin/main.skel
123
+ @rm -rf shoes-${VERSION}/**/.svn
124
+ @tar -cf shoes-${VERSION}.tar shoes-${VERSION}
125
+ @gzip shoes-${VERSION}.tar
126
+ @rm -rf shoes-${VERSION}
127
+
128
+ install: all
129
+ @echo installing executable file to ${DESTDIR}${PREFIX}/bin
130
+ @mkdir -p ${DESTDIR}${PREFIX}/bin
131
+ @cp -f dist/shoes.launch ${DESTDIR}${PREFIX}/bin/shoes
132
+ @chmod 755 ${DESTDIR}${PREFIX}/bin/shoes
133
+ @echo installing libraries to ${DESTDIR}${PREFIX}/lib/shoes
134
+ @rm -rf ${DESTDIR}${PREFIX}/lib/shoes
135
+ @mkdir -p ${DESTDIR}${PREFIX}/lib/shoes
136
+ @cp -r dist/* ${DESTDIR}${PREFIX}/lib/shoes/
137
+
138
+ uninstall:
139
+ @echo removing executable file from ${DESTDIR}${PREFIX}/bin
140
+ @rm -f ${DESTDIR}${PREFIX}/bin/shoes
141
+ # @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
142
+ # @rm -f ${DESTDIR}${MANPREFIX}/man1/shoes.1
143
+
144
+ .PHONY: all options clean dist install uninstall