Pratt 1.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (283) hide show
  1. data/.exrc +61 -0
  2. data/.gitignore +4 -0
  3. data/History.txt +6 -0
  4. data/Manifest.txt +46 -0
  5. data/Pratt.gemspec +351 -0
  6. data/README.txt +66 -0
  7. data/Rakefile +85 -0
  8. data/TODO +54 -0
  9. data/VERSION +1 -0
  10. data/bin/pratt.rb +13 -0
  11. data/config.rb +34 -0
  12. data/lib/pratt.rb +527 -0
  13. data/lib/pratt/array.rb +11 -0
  14. data/lib/pratt/string.rb +18 -0
  15. data/models/app.rb +40 -0
  16. data/models/customer.rb +24 -0
  17. data/models/payment.rb +22 -0
  18. data/models/pratt.rb +19 -0
  19. data/models/project.rb +82 -0
  20. data/models/whence.rb +70 -0
  21. data/pkgs/tile-0.8.2.tar.gz +0 -0
  22. data/pkgs/tile-0.8.2/ANNOUNCE.txt +95 -0
  23. data/pkgs/tile-0.8.2/ChangeLog +4651 -0
  24. data/pkgs/tile-0.8.2/Makefile +250 -0
  25. data/pkgs/tile-0.8.2/Makefile.in +250 -0
  26. data/pkgs/tile-0.8.2/README.txt +86 -0
  27. data/pkgs/tile-0.8.2/aclocal.m4 +2 -0
  28. data/pkgs/tile-0.8.2/altTheme.o +0 -0
  29. data/pkgs/tile-0.8.2/blink.o +0 -0
  30. data/pkgs/tile-0.8.2/button.o +0 -0
  31. data/pkgs/tile-0.8.2/cache.o +0 -0
  32. data/pkgs/tile-0.8.2/clamTheme.o +0 -0
  33. data/pkgs/tile-0.8.2/classicTheme.o +0 -0
  34. data/pkgs/tile-0.8.2/config.log +1330 -0
  35. data/pkgs/tile-0.8.2/config.status +795 -0
  36. data/pkgs/tile-0.8.2/configure +15248 -0
  37. data/pkgs/tile-0.8.2/configure.in +89 -0
  38. data/pkgs/tile-0.8.2/demos/autocomplete.tcl +59 -0
  39. data/pkgs/tile-0.8.2/demos/demo.tcl +870 -0
  40. data/pkgs/tile-0.8.2/demos/dirbrowser.tcl +167 -0
  41. data/pkgs/tile-0.8.2/demos/dlgtest.tcl +97 -0
  42. data/pkgs/tile-0.8.2/demos/iconlib.tcl +110 -0
  43. data/pkgs/tile-0.8.2/demos/repeater.tcl +117 -0
  44. data/pkgs/tile-0.8.2/demos/toolbutton.tcl +101 -0
  45. data/pkgs/tile-0.8.2/doc/Geometry.3 +230 -0
  46. data/pkgs/tile-0.8.2/doc/INDEX.MAP +153 -0
  47. data/pkgs/tile-0.8.2/doc/Makefile +36 -0
  48. data/pkgs/tile-0.8.2/doc/TILE.XML +45 -0
  49. data/pkgs/tile-0.8.2/doc/Theme.3 +34 -0
  50. data/pkgs/tile-0.8.2/doc/button.n +75 -0
  51. data/pkgs/tile-0.8.2/doc/checkbutton.n +61 -0
  52. data/pkgs/tile-0.8.2/doc/combobox.n +98 -0
  53. data/pkgs/tile-0.8.2/doc/converting.txt +97 -0
  54. data/pkgs/tile-0.8.2/doc/dialog.n +122 -0
  55. data/pkgs/tile-0.8.2/doc/entry.n +438 -0
  56. data/pkgs/tile-0.8.2/doc/frame.n +43 -0
  57. data/pkgs/tile-0.8.2/doc/html/Geometry.html +304 -0
  58. data/pkgs/tile-0.8.2/doc/html/Theme.html +48 -0
  59. data/pkgs/tile-0.8.2/doc/html/button.html +120 -0
  60. data/pkgs/tile-0.8.2/doc/html/category-index.html +18 -0
  61. data/pkgs/tile-0.8.2/doc/html/checkbutton.html +94 -0
  62. data/pkgs/tile-0.8.2/doc/html/combobox.html +164 -0
  63. data/pkgs/tile-0.8.2/doc/html/converting.txt +97 -0
  64. data/pkgs/tile-0.8.2/doc/html/dialog.html +159 -0
  65. data/pkgs/tile-0.8.2/doc/html/entry.html +613 -0
  66. data/pkgs/tile-0.8.2/doc/html/frame.html +76 -0
  67. data/pkgs/tile-0.8.2/doc/html/image.html +100 -0
  68. data/pkgs/tile-0.8.2/doc/html/index.html +25 -0
  69. data/pkgs/tile-0.8.2/doc/html/keyword-index.html +228 -0
  70. data/pkgs/tile-0.8.2/doc/html/label.html +133 -0
  71. data/pkgs/tile-0.8.2/doc/html/labelframe.html +91 -0
  72. data/pkgs/tile-0.8.2/doc/html/manpage.css +212 -0
  73. data/pkgs/tile-0.8.2/doc/html/menubutton.html +63 -0
  74. data/pkgs/tile-0.8.2/doc/html/notebook.html +280 -0
  75. data/pkgs/tile-0.8.2/doc/html/paned.html +149 -0
  76. data/pkgs/tile-0.8.2/doc/html/progressbar.html +138 -0
  77. data/pkgs/tile-0.8.2/doc/html/radiobutton.html +89 -0
  78. data/pkgs/tile-0.8.2/doc/html/scrollbar.html +221 -0
  79. data/pkgs/tile-0.8.2/doc/html/separator.html +48 -0
  80. data/pkgs/tile-0.8.2/doc/html/sizegrip.html +62 -0
  81. data/pkgs/tile-0.8.2/doc/html/style.html +172 -0
  82. data/pkgs/tile-0.8.2/doc/html/tile-intro.html +164 -0
  83. data/pkgs/tile-0.8.2/doc/html/treeview.html +634 -0
  84. data/pkgs/tile-0.8.2/doc/html/widget.html +342 -0
  85. data/pkgs/tile-0.8.2/doc/image.n +81 -0
  86. data/pkgs/tile-0.8.2/doc/internals.txt +409 -0
  87. data/pkgs/tile-0.8.2/doc/label.n +75 -0
  88. data/pkgs/tile-0.8.2/doc/labelframe.n +64 -0
  89. data/pkgs/tile-0.8.2/doc/man.macros +239 -0
  90. data/pkgs/tile-0.8.2/doc/menubutton.n +41 -0
  91. data/pkgs/tile-0.8.2/doc/notebook.n +188 -0
  92. data/pkgs/tile-0.8.2/doc/paned.n +95 -0
  93. data/pkgs/tile-0.8.2/doc/progressbar.n +79 -0
  94. data/pkgs/tile-0.8.2/doc/radiobutton.n +57 -0
  95. data/pkgs/tile-0.8.2/doc/scrollbar.n +160 -0
  96. data/pkgs/tile-0.8.2/doc/separator.n +30 -0
  97. data/pkgs/tile-0.8.2/doc/sizegrip.n +53 -0
  98. data/pkgs/tile-0.8.2/doc/style.n +119 -0
  99. data/pkgs/tile-0.8.2/doc/tile-intro.n +165 -0
  100. data/pkgs/tile-0.8.2/doc/tmml.options +4 -0
  101. data/pkgs/tile-0.8.2/doc/treeview.n +415 -0
  102. data/pkgs/tile-0.8.2/doc/widget.n +227 -0
  103. data/pkgs/tile-0.8.2/doc/xml/Geometry.tmml +379 -0
  104. data/pkgs/tile-0.8.2/doc/xml/INDEX.MAP +153 -0
  105. data/pkgs/tile-0.8.2/doc/xml/Theme.tmml +63 -0
  106. data/pkgs/tile-0.8.2/doc/xml/button.tmml +134 -0
  107. data/pkgs/tile-0.8.2/doc/xml/checkbutton.tmml +119 -0
  108. data/pkgs/tile-0.8.2/doc/xml/combobox.tmml +184 -0
  109. data/pkgs/tile-0.8.2/doc/xml/dialog.tmml +195 -0
  110. data/pkgs/tile-0.8.2/doc/xml/entry.tmml +630 -0
  111. data/pkgs/tile-0.8.2/doc/xml/frame.tmml +98 -0
  112. data/pkgs/tile-0.8.2/doc/xml/image.tmml +101 -0
  113. data/pkgs/tile-0.8.2/doc/xml/label.tmml +154 -0
  114. data/pkgs/tile-0.8.2/doc/xml/labelframe.tmml +116 -0
  115. data/pkgs/tile-0.8.2/doc/xml/menubutton.tmml +80 -0
  116. data/pkgs/tile-0.8.2/doc/xml/notebook.tmml +306 -0
  117. data/pkgs/tile-0.8.2/doc/xml/paned.tmml +154 -0
  118. data/pkgs/tile-0.8.2/doc/xml/progressbar.tmml +151 -0
  119. data/pkgs/tile-0.8.2/doc/xml/radiobutton.tmml +109 -0
  120. data/pkgs/tile-0.8.2/doc/xml/scrollbar.tmml +233 -0
  121. data/pkgs/tile-0.8.2/doc/xml/separator.tmml +59 -0
  122. data/pkgs/tile-0.8.2/doc/xml/sizegrip.tmml +82 -0
  123. data/pkgs/tile-0.8.2/doc/xml/style.tmml +171 -0
  124. data/pkgs/tile-0.8.2/doc/xml/tile-intro.tmml +192 -0
  125. data/pkgs/tile-0.8.2/doc/xml/treeview.tmml +604 -0
  126. data/pkgs/tile-0.8.2/doc/xml/widget.tmml +372 -0
  127. data/pkgs/tile-0.8.2/entry.o +0 -0
  128. data/pkgs/tile-0.8.2/frame.o +0 -0
  129. data/pkgs/tile-0.8.2/generic/Makefile.in +221 -0
  130. data/pkgs/tile-0.8.2/generic/TODO +493 -0
  131. data/pkgs/tile-0.8.2/generic/altTheme.c +1172 -0
  132. data/pkgs/tile-0.8.2/generic/blink.c +168 -0
  133. data/pkgs/tile-0.8.2/generic/button.c +858 -0
  134. data/pkgs/tile-0.8.2/generic/cache.c +354 -0
  135. data/pkgs/tile-0.8.2/generic/clamTheme.c +974 -0
  136. data/pkgs/tile-0.8.2/generic/classicTheme.c +518 -0
  137. data/pkgs/tile-0.8.2/generic/configure +10334 -0
  138. data/pkgs/tile-0.8.2/generic/configure.in +100 -0
  139. data/pkgs/tile-0.8.2/generic/entry.c +1922 -0
  140. data/pkgs/tile-0.8.2/generic/frame.c +648 -0
  141. data/pkgs/tile-0.8.2/generic/gunk.h +44 -0
  142. data/pkgs/tile-0.8.2/generic/image.c +416 -0
  143. data/pkgs/tile-0.8.2/generic/label.c +663 -0
  144. data/pkgs/tile-0.8.2/generic/layout.c +1215 -0
  145. data/pkgs/tile-0.8.2/generic/manager.c +554 -0
  146. data/pkgs/tile-0.8.2/generic/manager.h +91 -0
  147. data/pkgs/tile-0.8.2/generic/notebook.c +1380 -0
  148. data/pkgs/tile-0.8.2/generic/paned.c +958 -0
  149. data/pkgs/tile-0.8.2/generic/pkgIndex.tcl.in +7 -0
  150. data/pkgs/tile-0.8.2/generic/progress.c +549 -0
  151. data/pkgs/tile-0.8.2/generic/scale.c +526 -0
  152. data/pkgs/tile-0.8.2/generic/scroll.c +253 -0
  153. data/pkgs/tile-0.8.2/generic/scrollbar.c +346 -0
  154. data/pkgs/tile-0.8.2/generic/separator.c +132 -0
  155. data/pkgs/tile-0.8.2/generic/square.c +306 -0
  156. data/pkgs/tile-0.8.2/generic/tagset.c +147 -0
  157. data/pkgs/tile-0.8.2/generic/tile.c +296 -0
  158. data/pkgs/tile-0.8.2/generic/tkElements.c +1280 -0
  159. data/pkgs/tile-0.8.2/generic/tkTheme.c +1708 -0
  160. data/pkgs/tile-0.8.2/generic/tkTheme.h +419 -0
  161. data/pkgs/tile-0.8.2/generic/tkThemeInt.h +45 -0
  162. data/pkgs/tile-0.8.2/generic/tkstate.c +268 -0
  163. data/pkgs/tile-0.8.2/generic/trace.c +145 -0
  164. data/pkgs/tile-0.8.2/generic/track.c +174 -0
  165. data/pkgs/tile-0.8.2/generic/treeview.c +3211 -0
  166. data/pkgs/tile-0.8.2/generic/ttk.decls +154 -0
  167. data/pkgs/tile-0.8.2/generic/ttkDecls.h +340 -0
  168. data/pkgs/tile-0.8.2/generic/ttkStubInit.c +61 -0
  169. data/pkgs/tile-0.8.2/generic/ttkStubLib.c +70 -0
  170. data/pkgs/tile-0.8.2/generic/widget.c +785 -0
  171. data/pkgs/tile-0.8.2/generic/widget.h +263 -0
  172. data/pkgs/tile-0.8.2/image.o +0 -0
  173. data/pkgs/tile-0.8.2/label.o +0 -0
  174. data/pkgs/tile-0.8.2/layout.o +0 -0
  175. data/pkgs/tile-0.8.2/library/altTheme.tcl +101 -0
  176. data/pkgs/tile-0.8.2/library/aquaTheme.tcl +62 -0
  177. data/pkgs/tile-0.8.2/library/button.tcl +85 -0
  178. data/pkgs/tile-0.8.2/library/clamTheme.tcl +139 -0
  179. data/pkgs/tile-0.8.2/library/classicTheme.tcl +108 -0
  180. data/pkgs/tile-0.8.2/library/combobox.tcl +439 -0
  181. data/pkgs/tile-0.8.2/library/cursors.tcl +36 -0
  182. data/pkgs/tile-0.8.2/library/defaults.tcl +118 -0
  183. data/pkgs/tile-0.8.2/library/dialog.tcl +274 -0
  184. data/pkgs/tile-0.8.2/library/entry.tcl +580 -0
  185. data/pkgs/tile-0.8.2/library/fonts.tcl +153 -0
  186. data/pkgs/tile-0.8.2/library/icons.tcl +105 -0
  187. data/pkgs/tile-0.8.2/library/keynav.tcl +192 -0
  188. data/pkgs/tile-0.8.2/library/menubutton.tcl +171 -0
  189. data/pkgs/tile-0.8.2/library/notebook.tcl +193 -0
  190. data/pkgs/tile-0.8.2/library/paned.tcl +87 -0
  191. data/pkgs/tile-0.8.2/library/progress.tcl +51 -0
  192. data/pkgs/tile-0.8.2/library/scale.tcl +54 -0
  193. data/pkgs/tile-0.8.2/library/scrollbar.tcl +125 -0
  194. data/pkgs/tile-0.8.2/library/sizegrip.tcl +77 -0
  195. data/pkgs/tile-0.8.2/library/tile.tcl +211 -0
  196. data/pkgs/tile-0.8.2/library/treeview.tcl +382 -0
  197. data/pkgs/tile-0.8.2/library/utils.tcl +254 -0
  198. data/pkgs/tile-0.8.2/library/winTheme.tcl +77 -0
  199. data/pkgs/tile-0.8.2/library/xpTheme.tcl +63 -0
  200. data/pkgs/tile-0.8.2/libtile0.8.2.so +0 -0
  201. data/pkgs/tile-0.8.2/libttkstub.a +0 -0
  202. data/pkgs/tile-0.8.2/license.terms +24 -0
  203. data/pkgs/tile-0.8.2/macosx/aquaTheme.c +1076 -0
  204. data/pkgs/tile-0.8.2/manager.o +0 -0
  205. data/pkgs/tile-0.8.2/notebook.o +0 -0
  206. data/pkgs/tile-0.8.2/paned.o +0 -0
  207. data/pkgs/tile-0.8.2/pkgIndex.tcl +3 -0
  208. data/pkgs/tile-0.8.2/progress.o +0 -0
  209. data/pkgs/tile-0.8.2/scale.o +0 -0
  210. data/pkgs/tile-0.8.2/scroll.o +0 -0
  211. data/pkgs/tile-0.8.2/scrollbar.o +0 -0
  212. data/pkgs/tile-0.8.2/separator.o +0 -0
  213. data/pkgs/tile-0.8.2/tagset.o +0 -0
  214. data/pkgs/tile-0.8.2/tclconfig/install-sh +119 -0
  215. data/pkgs/tile-0.8.2/tclconfig/tcl.m4 +4069 -0
  216. data/pkgs/tile-0.8.2/tclconfig/teax.m4 +109 -0
  217. data/pkgs/tile-0.8.2/tests/all.tcl +18 -0
  218. data/pkgs/tile-0.8.2/tests/bwidget.test +103 -0
  219. data/pkgs/tile-0.8.2/tests/cbtest.tcl +125 -0
  220. data/pkgs/tile-0.8.2/tests/combobox.test +51 -0
  221. data/pkgs/tile-0.8.2/tests/compound.tcl +92 -0
  222. data/pkgs/tile-0.8.2/tests/entry.test +285 -0
  223. data/pkgs/tile-0.8.2/tests/entrytest.tcl +78 -0
  224. data/pkgs/tile-0.8.2/tests/image.test +94 -0
  225. data/pkgs/tile-0.8.2/tests/labelframe.tcl +41 -0
  226. data/pkgs/tile-0.8.2/tests/labelframe.test +137 -0
  227. data/pkgs/tile-0.8.2/tests/layout.test +33 -0
  228. data/pkgs/tile-0.8.2/tests/misc.test +35 -0
  229. data/pkgs/tile-0.8.2/tests/nbtest.tcl +66 -0
  230. data/pkgs/tile-0.8.2/tests/notebook.test +500 -0
  231. data/pkgs/tile-0.8.2/tests/paned.test +298 -0
  232. data/pkgs/tile-0.8.2/tests/progress.test +92 -0
  233. data/pkgs/tile-0.8.2/tests/pwtest.tcl +90 -0
  234. data/pkgs/tile-0.8.2/tests/sbtest.tcl +79 -0
  235. data/pkgs/tile-0.8.2/tests/scrollbar.test +77 -0
  236. data/pkgs/tile-0.8.2/tests/sgtest.tcl +52 -0
  237. data/pkgs/tile-0.8.2/tests/testutils.tcl +20 -0
  238. data/pkgs/tile-0.8.2/tests/tile.test +674 -0
  239. data/pkgs/tile-0.8.2/tests/treetags.test +78 -0
  240. data/pkgs/tile-0.8.2/tests/treeview.test +563 -0
  241. data/pkgs/tile-0.8.2/tests/tvtest.tcl +332 -0
  242. data/pkgs/tile-0.8.2/tests/validate.test +278 -0
  243. data/pkgs/tile-0.8.2/tile.o +0 -0
  244. data/pkgs/tile-0.8.2/tkElements.o +0 -0
  245. data/pkgs/tile-0.8.2/tkTheme.o +0 -0
  246. data/pkgs/tile-0.8.2/tkstate.o +0 -0
  247. data/pkgs/tile-0.8.2/tools/genStubs.tcl +861 -0
  248. data/pkgs/tile-0.8.2/trace.o +0 -0
  249. data/pkgs/tile-0.8.2/track.o +0 -0
  250. data/pkgs/tile-0.8.2/treeview.o +0 -0
  251. data/pkgs/tile-0.8.2/ttkStubInit.o +0 -0
  252. data/pkgs/tile-0.8.2/ttkStubLib.o +0 -0
  253. data/pkgs/tile-0.8.2/widget.o +0 -0
  254. data/pkgs/tile-0.8.2/win/Tile.dsp +261 -0
  255. data/pkgs/tile-0.8.2/win/makefile.vc +527 -0
  256. data/pkgs/tile-0.8.2/win/monitor.c +164 -0
  257. data/pkgs/tile-0.8.2/win/nmakehlp.c +483 -0
  258. data/pkgs/tile-0.8.2/win/rules.vc +512 -0
  259. data/pkgs/tile-0.8.2/win/tile.rc +40 -0
  260. data/pkgs/tile-0.8.2/win/winTheme.c +734 -0
  261. data/pkgs/tile-0.8.2/win/xpTheme.c +1029 -0
  262. data/spec/app_spec.rb +48 -0
  263. data/spec/customer_spec.rb +31 -0
  264. data/spec/fixtures/graph.expectation +18 -0
  265. data/spec/payment_spec.rb +19 -0
  266. data/spec/pratt_spec.rb +148 -0
  267. data/spec/project_spec.rb +163 -0
  268. data/spec/rcov.opts +0 -0
  269. data/spec/spec.opts +1 -0
  270. data/spec/spec_helper.rb +21 -0
  271. data/spec/whence_spec.rb +54 -0
  272. data/tasks/pratt.rb +84 -0
  273. data/templates/model.eruby +12 -0
  274. data/templates/spec.eruby +8 -0
  275. data/views/env.rb +22 -0
  276. data/views/graph.eruby +20 -0
  277. data/views/invoice.eruby +148 -0
  278. data/views/main.rb +92 -0
  279. data/views/pid.eruby +3 -0
  280. data/views/pop.rb +94 -0
  281. data/views/pop2.rb +75 -0
  282. data/views/raw.eruby +11 -0
  283. metadata +390 -0
@@ -0,0 +1,164 @@
1
+ /* monitor.c,v 1.17 2006/11/19 19:35:28 jenglish Exp
2
+ */
3
+
4
+ #ifdef _MSC_VER
5
+ #define WIN32_LEAN_AND_MEAN
6
+ #endif
7
+
8
+ #include <windows.h>
9
+ #include <tcl.h>
10
+ #include <tk.h>
11
+ #include <tkPlatDecls.h>
12
+ #include "tkTheme.h"
13
+
14
+ #if !defined(WM_THEMECHANGED)
15
+ #define WM_THEMECHANGED 0x031A
16
+ #endif
17
+
18
+ static LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
19
+
20
+ /*
21
+ * RegisterSystemColors --
22
+ * Register all known Windows system colors (as per GetSysColor)
23
+ * as Tk named colors.
24
+ */
25
+
26
+ typedef struct {
27
+ const char *name;
28
+ int index;
29
+ } SystemColorEntry;
30
+
31
+ static SystemColorEntry sysColors[] = {
32
+ { "System3dDarkShadow", COLOR_3DDKSHADOW },
33
+ { "System3dLight", COLOR_3DLIGHT },
34
+ { "SystemActiveBorder", COLOR_ACTIVEBORDER },
35
+ { "SystemActiveCaption", COLOR_ACTIVECAPTION },
36
+ { "SystemAppWorkspace", COLOR_APPWORKSPACE },
37
+ { "SystemBackground", COLOR_BACKGROUND },
38
+ { "SystemButtonFace", COLOR_BTNFACE },
39
+ { "SystemButtonHighlight", COLOR_BTNHIGHLIGHT },
40
+ { "SystemButtonShadow", COLOR_BTNSHADOW },
41
+ { "SystemButtonText", COLOR_BTNTEXT },
42
+ { "SystemCaptionText", COLOR_CAPTIONTEXT },
43
+ { "SystemDisabledText", COLOR_GRAYTEXT },
44
+ { "SystemGrayText", COLOR_GRAYTEXT },
45
+ { "SystemHighlight", COLOR_HIGHLIGHT },
46
+ { "SystemHighlightText", COLOR_HIGHLIGHTTEXT },
47
+ { "SystemInactiveBorder", COLOR_INACTIVEBORDER },
48
+ { "SystemInactiveCaption", COLOR_INACTIVECAPTION },
49
+ { "SystemInactiveCaptionText", COLOR_INACTIVECAPTIONTEXT },
50
+ { "SystemInfoBackground", COLOR_INFOBK },
51
+ { "SystemInfoText", COLOR_INFOTEXT },
52
+ { "SystemMenu", COLOR_MENU },
53
+ { "SystemMenuText", COLOR_MENUTEXT },
54
+ { "SystemScrollbar", COLOR_SCROLLBAR },
55
+ { "SystemWindow", COLOR_WINDOW },
56
+ { "SystemWindowFrame", COLOR_WINDOWFRAME },
57
+ { "SystemWindowText", COLOR_WINDOWTEXT },
58
+ { NULL, 0 }
59
+ };
60
+
61
+ static void RegisterSystemColors(Tcl_Interp *interp)
62
+ {
63
+ Ttk_ResourceCache cache = Ttk_GetResourceCache(interp);
64
+ SystemColorEntry *sysColor;
65
+
66
+ for (sysColor = sysColors; sysColor->name; ++sysColor) {
67
+ DWORD pixel = GetSysColor(sysColor->index);
68
+ XColor colorSpec;
69
+ colorSpec.red = GetRValue(pixel) * 257;
70
+ colorSpec.green = GetGValue(pixel) * 257;
71
+ colorSpec.blue = GetBValue(pixel) * 257;
72
+ Ttk_RegisterNamedColor(cache, sysColor->name, &colorSpec);
73
+ }
74
+ }
75
+
76
+ static HWND
77
+ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
78
+ {
79
+ WNDCLASSEX wc;
80
+ HWND hwnd = NULL;
81
+ CHAR title[32] = "TtkMonitorWindow";
82
+ CHAR name[32] = "TtkMonitorClass";
83
+
84
+ wc.cbSize = sizeof(WNDCLASSEX);
85
+ wc.style = CS_HREDRAW | CS_VREDRAW;
86
+ wc.lpfnWndProc = (WNDPROC)WndProc;
87
+ wc.cbClsExtra = 0;
88
+ wc.cbWndExtra = 0;
89
+ wc.hInstance = hinst;
90
+ wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
91
+ wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
92
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
93
+ wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
94
+ wc.lpszMenuName = name;
95
+ wc.lpszClassName = name;
96
+
97
+ if (RegisterClassEx(&wc)) {
98
+ hwnd = CreateWindow( name, title, WS_OVERLAPPEDWINDOW,
99
+ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
100
+ NULL, NULL, hinst, NULL );
101
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)interp);
102
+ ShowWindow(hwnd, SW_HIDE);
103
+ UpdateWindow(hwnd);
104
+ }
105
+ return hwnd;
106
+ }
107
+
108
+ static void
109
+ DestroyThemeMonitorWindow(void *clientData)
110
+ {
111
+ HWND hwnd = (HWND)clientData;
112
+ DestroyWindow(hwnd);
113
+ }
114
+
115
+ static LRESULT WINAPI
116
+ WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
117
+ {
118
+ Tcl_Interp *interp = (Tcl_Interp *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
119
+ Ttk_Theme theme;
120
+
121
+ switch (msg) {
122
+ case WM_DESTROY:
123
+ break;
124
+
125
+ case WM_SYSCOLORCHANGE:
126
+ RegisterSystemColors(interp);
127
+ break;
128
+
129
+ case WM_THEMECHANGED:
130
+ /*
131
+ * Reset the application theme to 'xpnative' if present,
132
+ * which will in turn fall back to 'winnative' if XP theming
133
+ * is disabled.
134
+ */
135
+ theme = Ttk_GetTheme(interp, "xpnative");
136
+ if (theme) {
137
+ Ttk_UseTheme(interp, theme);
138
+ /* @@@ What to do about errors here? */
139
+ }
140
+ break;
141
+ }
142
+ return DefWindowProc(hwnd, msg, wp, lp);
143
+ }
144
+
145
+ /*
146
+ * Windows-specific platform initialization:
147
+ */
148
+
149
+ extern int TtkWinTheme_Init(Tcl_Interp *, HWND hwnd);
150
+ extern int TtkXPTheme_Init(Tcl_Interp *, HWND hwnd);
151
+
152
+ int Ttk_WinPlatformInit(Tcl_Interp *interp)
153
+ {
154
+ HWND hwnd;
155
+
156
+ hwnd = CreateThemeMonitorWindow(Tk_GetHINSTANCE(), interp);
157
+ Ttk_RegisterCleanup(interp, (ClientData)hwnd, DestroyThemeMonitorWindow);
158
+
159
+ TtkWinTheme_Init(interp, hwnd);
160
+ TtkXPTheme_Init(interp, hwnd);
161
+
162
+ return TCL_OK;
163
+ }
164
+
@@ -0,0 +1,483 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * nmakehlp.c --
3
+ *
4
+ * This is used to fix limitations within nmake and the environment.
5
+ *
6
+ * Copyright (c) 2002 by David Gravereaux.
7
+ * Copyright (c) 2003 by Patrick Thoyts
8
+ *
9
+ * See the file "license.terms" for information on usage and redistribution
10
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
+ *
12
+ * ----------------------------------------------------------------------------
13
+ * RCS: @(#) nmakehlp.c,v 1.2 2006/07/11 21:36:26 patthoyts Exp
14
+ * ----------------------------------------------------------------------------
15
+ */
16
+
17
+ #define _CRT_SECURE_NO_DEPRECATE
18
+ #include <windows.h>
19
+ #pragma comment (lib, "user32.lib")
20
+ #pragma comment (lib, "kernel32.lib")
21
+ #include <stdio.h>
22
+
23
+ /* protos */
24
+
25
+ int CheckForCompilerFeature(const char *option);
26
+ int CheckForLinkerFeature(const char *option);
27
+ int IsIn(const char *string, const char *substring);
28
+ int GetVersionFromHeader(const char *tclh, const char *tkh);
29
+ DWORD WINAPI ReadFromPipe(LPVOID args);
30
+
31
+ /* globals */
32
+
33
+ #define CHUNK 25
34
+ #define STATICBUFFERSIZE 1000
35
+ typedef struct {
36
+ HANDLE pipe;
37
+ char buffer[STATICBUFFERSIZE];
38
+ } pipeinfo;
39
+
40
+ pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'};
41
+ pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'};
42
+
43
+ /*
44
+ * exitcodes: 0 == no, 1 == yes, 2 == error
45
+ */
46
+
47
+ int
48
+ main (int argc, char *argv[])
49
+ {
50
+ char msg[300];
51
+ DWORD dwWritten;
52
+ int chars;
53
+
54
+ /*
55
+ * Make sure children (cl.exe and link.exe) are kept quiet.
56
+ */
57
+
58
+ SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
59
+
60
+ /*
61
+ * Make sure the compiler and linker aren't effected by the outside world.
62
+ */
63
+
64
+ SetEnvironmentVariable("CL", "");
65
+ SetEnvironmentVariable("LINK", "");
66
+
67
+ if (argc > 1 && *argv[1] == '-') {
68
+ switch (*(argv[1]+1)) {
69
+ case 'c':
70
+ if (argc != 3) {
71
+ chars = wsprintf(msg, "usage: %s -c <compiler option>\n"
72
+ "Tests for whether cl.exe supports an option\n"
73
+ "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
74
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
75
+ return 2;
76
+ }
77
+ return CheckForCompilerFeature(argv[2]);
78
+ case 'l':
79
+ if (argc != 3) {
80
+ chars = wsprintf(msg, "usage: %s -l <linker option>\n"
81
+ "Tests for whether link.exe supports an option\n"
82
+ "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
83
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
84
+ return 2;
85
+ }
86
+ return CheckForLinkerFeature(argv[2]);
87
+ case 'f':
88
+ if (argc == 2) {
89
+ chars = wsprintf(msg, "usage: %s -f <string> <substring>\n"
90
+ "Find a substring within another\n"
91
+ "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
92
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
93
+ return 2;
94
+ } else if (argc == 3) {
95
+ /*
96
+ * If the string is blank, there is no match.
97
+ */
98
+
99
+ return 0;
100
+ } else {
101
+ return IsIn(argv[2], argv[3]);
102
+ }
103
+ case 'v':
104
+ if (argc != 4) {
105
+ chars = wsprintf(msg, "usage: %s -v <tcl.h> <tk.h>\n"
106
+ "Search for versions from the tcl and tk headers.",
107
+ argv[0]);
108
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
109
+ return 0;
110
+ }
111
+ return GetVersionFromHeader(argv[2], argv[3]);
112
+ }
113
+ }
114
+ chars = wsprintf(msg, "usage: %s -c|-l|-f ...\n"
115
+ "This is a little helper app to equalize shell differences between WinNT and\n"
116
+ "Win9x and get nmake.exe to accomplish its job.\n",
117
+ argv[0]);
118
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
119
+ return 2;
120
+ }
121
+
122
+ int
123
+ CheckForCompilerFeature(
124
+ const char *option)
125
+ {
126
+ STARTUPINFO si;
127
+ PROCESS_INFORMATION pi;
128
+ SECURITY_ATTRIBUTES sa;
129
+ DWORD threadID;
130
+ char msg[300];
131
+ BOOL ok;
132
+ HANDLE hProcess, h, pipeThreads[2];
133
+ char cmdline[100];
134
+
135
+ hProcess = GetCurrentProcess();
136
+
137
+ ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
138
+ ZeroMemory(&si, sizeof(STARTUPINFO));
139
+ si.cb = sizeof(STARTUPINFO);
140
+ si.dwFlags = STARTF_USESTDHANDLES;
141
+ si.hStdInput = INVALID_HANDLE_VALUE;
142
+
143
+ ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
144
+ sa.nLength = sizeof(SECURITY_ATTRIBUTES);
145
+ sa.lpSecurityDescriptor = NULL;
146
+ sa.bInheritHandle = FALSE;
147
+
148
+ /*
149
+ * Create a non-inheritible pipe.
150
+ */
151
+
152
+ CreatePipe(&Out.pipe, &h, &sa, 0);
153
+
154
+ /*
155
+ * Dupe the write side, make it inheritible, and close the original.
156
+ */
157
+
158
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE,
159
+ DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
160
+
161
+ /*
162
+ * Same as above, but for the error side.
163
+ */
164
+
165
+ CreatePipe(&Err.pipe, &h, &sa, 0);
166
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE,
167
+ DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
168
+
169
+ /*
170
+ * Base command line.
171
+ */
172
+
173
+ strcpy(cmdline, "cl.exe -nologo -c -TC -Zs -X ");
174
+
175
+ /*
176
+ * Append our option for testing
177
+ */
178
+
179
+ strcat(cmdline, option);
180
+
181
+ /*
182
+ * Filename to compile, which exists, but is nothing and empty.
183
+ */
184
+
185
+ strcat(cmdline, " .\\nul");
186
+
187
+ ok = CreateProcess(
188
+ NULL, /* Module name. */
189
+ cmdline, /* Command line. */
190
+ NULL, /* Process handle not inheritable. */
191
+ NULL, /* Thread handle not inheritable. */
192
+ TRUE, /* yes, inherit handles. */
193
+ DETACHED_PROCESS, /* No console for you. */
194
+ NULL, /* Use parent's environment block. */
195
+ NULL, /* Use parent's starting directory. */
196
+ &si, /* Pointer to STARTUPINFO structure. */
197
+ &pi); /* Pointer to PROCESS_INFORMATION structure. */
198
+
199
+ if (!ok) {
200
+ DWORD err = GetLastError();
201
+ int chars = wsprintf(msg,
202
+ "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
203
+
204
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|
205
+ FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars],
206
+ (300-chars), 0);
207
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err,NULL);
208
+ return 2;
209
+ }
210
+
211
+ /*
212
+ * Close our references to the write handles that have now been inherited.
213
+ */
214
+
215
+ CloseHandle(si.hStdOutput);
216
+ CloseHandle(si.hStdError);
217
+
218
+ WaitForInputIdle(pi.hProcess, 5000);
219
+ CloseHandle(pi.hThread);
220
+
221
+ /*
222
+ * Start the pipe reader threads.
223
+ */
224
+
225
+ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
226
+ pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
227
+
228
+ /*
229
+ * Block waiting for the process to end.
230
+ */
231
+
232
+ WaitForSingleObject(pi.hProcess, INFINITE);
233
+ CloseHandle(pi.hProcess);
234
+
235
+ /*
236
+ * Wait for our pipe to get done reading, should it be a little slow.
237
+ */
238
+
239
+ WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
240
+ CloseHandle(pipeThreads[0]);
241
+ CloseHandle(pipeThreads[1]);
242
+
243
+ #ifdef _DEBUG
244
+ {
245
+ DWORD err = 0;
246
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), Out.buffer,
247
+ strlen(Out.buffer), &err,NULL);
248
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), Err.buffer,
249
+ strlen(Out.buffer), &err,NULL);
250
+ }
251
+ #endif
252
+
253
+ /*
254
+ * Look for the commandline warning code in both streams.
255
+ * - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002.
256
+ */
257
+
258
+ return !(strstr(Out.buffer, "D4002") != NULL
259
+ || strstr(Err.buffer, "D4002") != NULL
260
+ || strstr(Out.buffer, "D9002") != NULL
261
+ || strstr(Err.buffer, "D9002") != NULL);
262
+ }
263
+
264
+ int
265
+ CheckForLinkerFeature(
266
+ const char *option)
267
+ {
268
+ STARTUPINFO si;
269
+ PROCESS_INFORMATION pi;
270
+ SECURITY_ATTRIBUTES sa;
271
+ DWORD threadID;
272
+ char msg[300];
273
+ BOOL ok;
274
+ HANDLE hProcess, h, pipeThreads[2];
275
+ char cmdline[100];
276
+
277
+ hProcess = GetCurrentProcess();
278
+
279
+ ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
280
+ ZeroMemory(&si, sizeof(STARTUPINFO));
281
+ si.cb = sizeof(STARTUPINFO);
282
+ si.dwFlags = STARTF_USESTDHANDLES;
283
+ si.hStdInput = INVALID_HANDLE_VALUE;
284
+
285
+ ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
286
+ sa.nLength = sizeof(SECURITY_ATTRIBUTES);
287
+ sa.lpSecurityDescriptor = NULL;
288
+ sa.bInheritHandle = TRUE;
289
+
290
+ /*
291
+ * Create a non-inheritible pipe.
292
+ */
293
+
294
+ CreatePipe(&Out.pipe, &h, &sa, 0);
295
+
296
+ /*
297
+ * Dupe the write side, make it inheritible, and close the original.
298
+ */
299
+
300
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE,
301
+ DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
302
+
303
+ /*
304
+ * Same as above, but for the error side.
305
+ */
306
+
307
+ CreatePipe(&Err.pipe, &h, &sa, 0);
308
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE,
309
+ DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
310
+
311
+ /*
312
+ * Base command line.
313
+ */
314
+
315
+ strcpy(cmdline, "link.exe -nologo ");
316
+
317
+ /*
318
+ * Append our option for testing.
319
+ */
320
+
321
+ strcat(cmdline, option);
322
+
323
+ ok = CreateProcess(
324
+ NULL, /* Module name. */
325
+ cmdline, /* Command line. */
326
+ NULL, /* Process handle not inheritable. */
327
+ NULL, /* Thread handle not inheritable. */
328
+ TRUE, /* yes, inherit handles. */
329
+ DETACHED_PROCESS, /* No console for you. */
330
+ NULL, /* Use parent's environment block. */
331
+ NULL, /* Use parent's starting directory. */
332
+ &si, /* Pointer to STARTUPINFO structure. */
333
+ &pi); /* Pointer to PROCESS_INFORMATION structure. */
334
+
335
+ if (!ok) {
336
+ DWORD err = GetLastError();
337
+ int chars = wsprintf(msg,
338
+ "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
339
+
340
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|
341
+ FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars],
342
+ (300-chars), 0);
343
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err,NULL);
344
+ return 2;
345
+ }
346
+
347
+ /*
348
+ * Close our references to the write handles that have now been inherited.
349
+ */
350
+
351
+ CloseHandle(si.hStdOutput);
352
+ CloseHandle(si.hStdError);
353
+
354
+ WaitForInputIdle(pi.hProcess, 5000);
355
+ CloseHandle(pi.hThread);
356
+
357
+ /*
358
+ * Start the pipe reader threads.
359
+ */
360
+
361
+ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
362
+ pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
363
+
364
+ /*
365
+ * Block waiting for the process to end.
366
+ */
367
+
368
+ WaitForSingleObject(pi.hProcess, INFINITE);
369
+ CloseHandle(pi.hProcess);
370
+
371
+ /*
372
+ * Wait for our pipe to get done reading, should it be a little slow.
373
+ */
374
+
375
+ WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
376
+ CloseHandle(pipeThreads[0]);
377
+ CloseHandle(pipeThreads[1]);
378
+
379
+ /*
380
+ * Look for the commandline warning code in the stderr stream.
381
+ */
382
+
383
+ return !(strstr(Out.buffer, "LNK1117") != NULL ||
384
+ strstr(Err.buffer, "LNK1117") != NULL);
385
+ }
386
+
387
+ #if USE_DG_CODE
388
+ DWORD WINAPI
389
+ ReadFromPipe(
390
+ LPVOID args)
391
+ {
392
+ pipeinfo *pi = (pipeinfo *) args;
393
+ char *lastBuf = pi->buffer;
394
+ DWORD dwRead;
395
+ BOOL ok;
396
+
397
+ again:
398
+ if (lastBuf - pi->buffer + CHUNK > STATICBUFFERSIZE) {
399
+ CloseHandle(pi->pipe);
400
+ return -1;
401
+ }
402
+ ok = ReadFile(pi->pipe, lastBuf, CHUNK, &dwRead, 0L);
403
+ if (!ok || dwRead == 0) {
404
+ CloseHandle(pi->pipe);
405
+ return 0;
406
+ }
407
+ lastBuf += dwRead;
408
+ goto again;
409
+
410
+ return 0; /* makes the compiler happy */
411
+ }
412
+ #else
413
+ DWORD WINAPI
414
+ ReadFromPipe (LPVOID args)
415
+ {
416
+ pipeinfo *pi = (pipeinfo *) args;
417
+ char *lastBuf = pi->buffer;
418
+ DWORD dwRead;
419
+ BOOL ok;
420
+
421
+ again:
422
+ ok = ReadFile(pi->pipe, lastBuf, 25, &dwRead, 0L);
423
+ if (!ok || dwRead == 0) {
424
+ CloseHandle(pi->pipe);
425
+ return 0;
426
+ }
427
+ lastBuf += dwRead;
428
+ goto again;
429
+
430
+ return 0; /* makes the compiler happy */
431
+ }
432
+ #endif
433
+
434
+ int
435
+ IsIn (const char *string, const char *substring)
436
+ {
437
+ return (strstr(string, substring) != NULL);
438
+ }
439
+
440
+ static double
441
+ ReadVersionFromHeader(const char *file, const char *macro)
442
+ {
443
+ double d = 0.0;
444
+ CHAR szBuffer[100];
445
+ LPSTR p;
446
+ DWORD cbBuffer = 100;
447
+ FILE *fp = fopen(file, "r");
448
+ if (fp != NULL) {
449
+ while (fgets(szBuffer, cbBuffer, fp) != NULL) {
450
+ if ((p = strstr(szBuffer, macro)) != NULL) {
451
+ while (*p && !isdigit(*p)) ++p;
452
+ d = strtod(p, NULL);
453
+ break;
454
+ }
455
+ }
456
+ fclose(fp);
457
+ }
458
+ return d;
459
+ }
460
+
461
+ int
462
+ GetVersionFromHeader(const char *tclh, const char *tkh)
463
+ {
464
+ double dTcl = 0.0, dTk = 0.0;
465
+
466
+ if (tclh != NULL)
467
+ dTcl = ReadVersionFromHeader(tclh, "TCL_VERSION");
468
+ if (tkh != NULL)
469
+ dTk = ReadVersionFromHeader(tkh, "TK_VERSION");
470
+
471
+ if (dTcl > 0 || dTk > 0) {
472
+ FILE *ofp = fopen("version.vc", "w");
473
+ if (dTcl > 0)
474
+ fprintf(ofp, "TCL_DOTVERSION\t= %0.1f\nTCL_VERSION\t= %u\n",
475
+ dTcl, (int)(dTcl * 10.0));
476
+ if (dTk > 0)
477
+ fprintf(ofp, "TK_DOTVERSION\t= %0.1f\nTK_VERSION\t= %u\n",
478
+ dTk, (int)(dTk * 10.0));
479
+ fclose(ofp);
480
+ return 0;
481
+ }
482
+ return 1;
483
+ }