scarpe 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. checksums.yaml +4 -4
  2. data/.cursor/rules/commit-style-preferences.mdc +72 -0
  3. data/.cursor/rules/component_context.mdc +82 -0
  4. data/.cursor/rules/debug-failed-tests.mdc +100 -0
  5. data/.cursor/rules/display_service_context.mdc +80 -0
  6. data/.cursor/rules/event_handling_context.mdc +100 -0
  7. data/.cursor/rules/git-pager-handling.mdc +64 -0
  8. data/.cursor/rules/lacci-context.mdc +52 -0
  9. data/.cursor/rules/scarpe_design_context.mdc +46 -0
  10. data/.cursor/rules/shoes_compatibility_context.mdc +75 -0
  11. data/.cursor/rules/timeout_context.mdc +78 -0
  12. data/.cursor/rules/update_lacci_and_wv.mdc +8 -0
  13. data/.cursor/rules/what_is_scarpe.mdc +22 -0
  14. data/.cursor/rules/writing-new-rules.mdc +73 -0
  15. data/CHANGELOG.md +46 -5
  16. data/CLAUDE.md +223 -0
  17. data/Gemfile +2 -2
  18. data/Gemfile.lock +85 -55
  19. data/LICENSE.txt +7 -1
  20. data/README.md +80 -20
  21. data/Rakefile +73 -14
  22. data/docs/SCARPE_FEATURES.md +38 -0
  23. data/docs/_config.yml +13 -0
  24. data/docs/calzini_components_and_updates.md +78 -0
  25. data/docs/display_service_separation.md +39 -0
  26. data/docs/documentation.md +43 -0
  27. data/docs/event_loops.md +66 -0
  28. data/docs/image.png +0 -0
  29. data/docs/index.md +118 -0
  30. data/docs/lacci.md +121 -0
  31. data/docs/scarpe_shoes_incompatibilities.md +71 -0
  32. data/docs/shoes_and_display_events.md +55 -0
  33. data/docs/shoes_implementations.md +79 -0
  34. data/docs/static/manual.md +5 -0
  35. data/docs/static/scarpe-logo.png +0 -0
  36. data/docs/timeouts_and_handlers.md +66 -0
  37. data/docs/web_archaeology.md +76 -0
  38. data/examples/Edit_box_Styles.rb +8 -0
  39. data/examples/Kerning.rb +7 -0
  40. data/examples/background_with_image.rb +14 -5
  41. data/examples/bloopsaphone/working/feepogram.rb +1 -1
  42. data/examples/bloopsaphone/working/le_dance_des_rubis.rb +135 -0
  43. data/examples/bloopsaphone/working/pixel_dreams_in_ruby.rb +131 -0
  44. data/examples/bloopsaphone/working/type_rebellion.rb +157 -0
  45. data/examples/border.rb +11 -0
  46. data/examples/check.rb +2 -0
  47. data/examples/download_and_show_image.rb +3 -0
  48. data/examples/flags/finland.rb +15 -0
  49. data/examples/flags/italy.rb +11 -0
  50. data/examples/flags/mauritius.rb +14 -0
  51. data/examples/font_family.rb +17 -0
  52. data/examples/font_shorthand.rb +9 -0
  53. data/examples/gen.rb +4 -0
  54. data/examples/internal_link_navigation.rb +19 -0
  55. data/examples/legacy/not_checked/shoes-manual/append.rb +10 -0
  56. data/examples/legacy/not_checked/shoes-manual/background_change.rb +12 -0
  57. data/examples/legacy/not_checked/shoes-manual/background_pattern.rb +5 -0
  58. data/examples/legacy/not_checked/shoes-manual/basic_app.rb +8 -0
  59. data/examples/legacy/not_checked/shoes-manual/border.rb +9 -0
  60. data/examples/legacy/not_checked/shoes-manual/builtins/FONTS.rb +5 -0
  61. data/examples/legacy/not_checked/shoes-manual/builtins/ask.rb +2 -0
  62. data/examples/legacy/not_checked/shoes-manual/builtins/ask_color.rb +5 -0
  63. data/examples/legacy/not_checked/shoes-manual/builtins/ask_open_file.rb +5 -0
  64. data/examples/legacy/not_checked/shoes-manual/builtins/ask_save_folder.rb +2 -0
  65. data/examples/legacy/not_checked/shoes-manual/builtins/confirm.rb +4 -0
  66. data/examples/legacy/not_checked/shoes-manual/builtins/debug.rb +2 -0
  67. data/examples/legacy/not_checked/shoes-manual/builtins/info.rb +3 -0
  68. data/examples/legacy/not_checked/shoes-manual/button.rb +9 -0
  69. data/examples/legacy/not_checked/shoes-manual/clear.rb +7 -0
  70. data/examples/legacy/not_checked/shoes-manual/custom_header.rb +13 -0
  71. data/examples/legacy/not_checked/shoes-manual/displace.rb +14 -0
  72. data/examples/legacy/not_checked/shoes-manual/edit_box.rb +8 -0
  73. data/examples/legacy/not_checked/shoes-manual/fill_pattern.rb +5 -0
  74. data/examples/legacy/not_checked/shoes-manual/fonts.rb +7 -0
  75. data/examples/legacy/not_checked/shoes-manual/gutter.rb +6 -0
  76. data/examples/legacy/not_checked/shoes-manual/image_web.rb +4 -0
  77. data/examples/legacy/not_checked/shoes-manual/keypress.rb +7 -0
  78. data/examples/legacy/not_checked/shoes-manual/list_box.rb +10 -0
  79. data/examples/legacy/not_checked/shoes-manual/motion.rb +10 -0
  80. data/examples/legacy/not_checked/shoes-manual/mouse.rb +8 -0
  81. data/examples/legacy/not_checked/shoes-manual/move.rb +14 -0
  82. data/examples/legacy/not_checked/shoes-manual/nested_ovals.rb +8 -0
  83. data/examples/legacy/not_checked/shoes-manual/oval.rb +7 -0
  84. data/examples/legacy/not_checked/shoes-manual/ovals.rb +6 -0
  85. data/examples/legacy/not_checked/shoes-manual/ovals_image.rb +8 -0
  86. data/examples/legacy/not_checked/shoes-manual/prepend.rb +7 -0
  87. data/examples/legacy/not_checked/shoes-manual/progress_bar.rb +10 -0
  88. data/examples/legacy/not_checked/shoes-manual/radio.rb +18 -0
  89. data/examples/legacy/not_checked/shoes-manual/radio_alternative_1.rb +7 -0
  90. data/examples/legacy/not_checked/shoes-manual/radio_alternative_2.rb +9 -0
  91. data/examples/legacy/not_checked/shoes-manual/rotate_rectangle.rb +6 -0
  92. data/examples/legacy/not_checked/shoes-manual/shape.rb +11 -0
  93. data/examples/legacy/not_checked/shoes-manual/static/avatar.png +0 -0
  94. data/examples/legacy/not_checked/shoes-manual/stroke.rb +5 -0
  95. data/examples/legacy/not_checked/shoes-manual/style.rb +3 -0
  96. data/examples/legacy/not_checked/shoes-manual/style_alternative_1.rb +4 -0
  97. data/examples/legacy/not_checked/shoes-manual/style_alternative_2.rb +5 -0
  98. data/examples/legacy/not_checked/shoes-manual/style_length.rb +5 -0
  99. data/examples/legacy/not_checked/shoes-manual/timer.rb +6 -0
  100. data/examples/legacy/not_checked/shoes-manual/trigger_window.rb +8 -0
  101. data/examples/legacy/not_checked/shoes-manual/window_owner.rb +8 -0
  102. data/examples/legacy/working/shoes_manual/alert_button.rb +2 -0
  103. data/examples/legacy/working/shoes_manual/animate.rb +7 -0
  104. data/examples/legacy/working/shoes_manual/background_para.rb +4 -0
  105. data/examples/legacy/working/shoes_manual/button_alternative.rb +7 -0
  106. data/examples/legacy/working/shoes_manual/checkbox.rb +17 -0
  107. data/examples/legacy/working/shoes_manual/download.rb +12 -0
  108. data/examples/legacy/working/shoes_manual/edit_box.rb +6 -0
  109. data/examples/legacy/working/shoes_manual/editline.rb +7 -0
  110. data/examples/legacy/working/shoes_manual/fixed_height.rb +8 -0
  111. data/examples/legacy/working/shoes_manual/fixed_width.rb +12 -0
  112. data/examples/legacy/working/shoes_manual/image.rb +5 -0
  113. data/examples/legacy/working/shoes_manual/instance_variable_check.rb +10 -0
  114. data/examples/legacy/working/shoes_manual/message.rb +18 -0
  115. data/examples/legacy/working/shoes_manual/rectangle.rb +6 -0
  116. data/examples/legacy/working/shoes_manual/save_download.rb +12 -0
  117. data/examples/legacy/working/shoes_manual/self_check.rb +10 -0
  118. data/examples/legacy/working/shoes_manual/stack.rb +7 -0
  119. data/examples/legacy/working/shoes_manual/style_info.rb +8 -0
  120. data/examples/legacy/working/shoes_manual/utf8_support.rb +8 -0
  121. data/examples/legacy/working/shoes_manual/width.rb +4 -0
  122. data/examples/local_assets/multi_image.rb +5 -0
  123. data/examples/local_assets/small.png +0 -0
  124. data/examples/local_fonts.rb +3 -0
  125. data/examples/margin.rb +13 -0
  126. data/examples/margin_check.rb +27 -0
  127. data/examples/oval-with-kwargs.rb +3 -0
  128. data/examples/oval.rb +26 -0
  129. data/examples/page_navigation_single_app.rb +42 -0
  130. data/examples/para_font_styles.rb +17 -0
  131. data/examples/para_font_variant.rb +6 -0
  132. data/examples/para_fontweight.rb +13 -0
  133. data/examples/parse_xl_funnies.rb +3 -0
  134. data/examples/rect.rb +1 -1
  135. data/examples/scarpe_ext.rb +3 -0
  136. data/examples/shapes/star.rb +1 -3
  137. data/examples/shoes_subclass_app.rb +25 -0
  138. data/examples/spacing.rb +1 -1
  139. data/examples/span.rb +4 -2
  140. data/examples/url_routing_example.rb +67 -0
  141. data/lacci/Gemfile +0 -2
  142. data/lacci/Gemfile.lock +4 -32
  143. data/lacci/lacci.gemspec +3 -3
  144. data/lacci/lib/lacci/scarpe_cli.rb +0 -1
  145. data/lacci/lib/lacci/version.rb +1 -1
  146. data/lacci/lib/scarpe/niente/app.rb +12 -1
  147. data/lacci/lib/scarpe/niente/display_service.rb +5 -1
  148. data/lacci/lib/scarpe/niente/drawable.rb +2 -0
  149. data/lacci/lib/scarpe/niente/shoes_spec.rb +10 -5
  150. data/lacci/lib/scarpe/niente.rb +15 -2
  151. data/lacci/lib/shoes/app.rb +204 -105
  152. data/lacci/lib/shoes/constants.rb +24 -2
  153. data/lacci/lib/shoes/display_service.rb +43 -4
  154. data/lacci/lib/shoes/drawable.rb +326 -36
  155. data/lacci/lib/shoes/drawables/arc.rb +4 -26
  156. data/lacci/lib/shoes/drawables/arrow.rb +3 -23
  157. data/lacci/lib/shoes/drawables/border.rb +28 -0
  158. data/lacci/lib/shoes/drawables/button.rb +5 -21
  159. data/lacci/lib/shoes/drawables/check.rb +7 -3
  160. data/lacci/lib/shoes/drawables/document_root.rb +4 -4
  161. data/lacci/lib/shoes/drawables/edit_box.rb +6 -5
  162. data/lacci/lib/shoes/drawables/edit_line.rb +5 -4
  163. data/lacci/lib/shoes/drawables/flow.rb +4 -6
  164. data/lacci/lib/shoes/drawables/font_helper.rb +62 -0
  165. data/lacci/lib/shoes/drawables/image.rb +2 -2
  166. data/lacci/lib/shoes/drawables/line.rb +3 -6
  167. data/lacci/lib/shoes/drawables/link.rb +16 -9
  168. data/lacci/lib/shoes/drawables/list_box.rb +8 -5
  169. data/lacci/lib/shoes/drawables/oval.rb +48 -0
  170. data/lacci/lib/shoes/drawables/para.rb +106 -18
  171. data/lacci/lib/shoes/drawables/progress.rb +2 -1
  172. data/lacci/lib/shoes/drawables/radio.rb +5 -3
  173. data/lacci/lib/shoes/drawables/rect.rb +7 -6
  174. data/lacci/lib/shoes/drawables/shape.rb +4 -3
  175. data/lacci/lib/shoes/drawables/slot.rb +102 -9
  176. data/lacci/lib/shoes/drawables/stack.rb +7 -12
  177. data/lacci/lib/shoes/drawables/star.rb +9 -31
  178. data/lacci/lib/shoes/drawables/text_drawable.rb +93 -34
  179. data/lacci/lib/shoes/drawables/video.rb +3 -2
  180. data/lacci/lib/shoes/drawables/widget.rb +9 -4
  181. data/lacci/lib/shoes/drawables.rb +2 -1
  182. data/lacci/lib/shoes/errors.rb +13 -3
  183. data/lacci/lib/shoes/margin_helper.rb +79 -0
  184. data/lacci/lib/shoes.rb +98 -20
  185. data/lacci/test/.gitignore +1 -0
  186. data/lacci/test/test_draw_context.rb +167 -0
  187. data/lacci/test/test_font_helper.rb +57 -0
  188. data/lacci/test/test_helper.rb +31 -4
  189. data/lacci/test/test_lacci.rb +93 -6
  190. data/lacci/test/test_margin_helper.rb +82 -0
  191. data/lacci/test/test_niente_test_infra.rb +40 -0
  192. data/lacci/test/test_oval.rb +82 -0
  193. data/lacci/test/test_parenting.rb +140 -0
  194. data/lacci/test/test_shoes_errors.rb +15 -13
  195. data/lacci/test/test_text_drawables.rb +23 -0
  196. data/lib/scarpe/assets.rb +19 -0
  197. data/lib/scarpe/cats_cradle.rb +57 -98
  198. data/lib/scarpe/shoes_spec.rb +24 -44
  199. data/lib/scarpe/version.rb +1 -1
  200. data/lib/scarpe/wv/app.rb +1 -0
  201. data/lib/scarpe/wv/arc.rb +0 -4
  202. data/lib/scarpe/wv/border.rb +15 -0
  203. data/lib/scarpe/wv/control_interface.rb +2 -10
  204. data/lib/scarpe/wv/document_root.rb +2 -2
  205. data/lib/scarpe/wv/drawable.rb +6 -40
  206. data/lib/scarpe/wv/edit_box.rb +4 -1
  207. data/lib/scarpe/wv/edit_line.rb +4 -1
  208. data/lib/scarpe/wv/image.rb +2 -5
  209. data/lib/scarpe/wv/link.rb +4 -2
  210. data/lib/scarpe/wv/oval.rb +13 -0
  211. data/lib/scarpe/wv/para.rb +1 -0
  212. data/lib/scarpe/wv/scarpe_extensions.rb +8 -0
  213. data/lib/scarpe/wv/shape.rb +10 -5
  214. data/lib/scarpe/wv/text_drawable.rb +72 -14
  215. data/lib/scarpe/wv/web_wrangler.rb +33 -11
  216. data/lib/scarpe/wv/webview_local_display.rb +6 -2
  217. data/lib/scarpe/wv.rb +16 -2
  218. data/scarpe-components/Gemfile +4 -3
  219. data/scarpe-components/Gemfile.lock +6 -37
  220. data/scarpe-components/README.md +2 -2
  221. data/scarpe-components/assets/bootstrap-themes/bootstrap-cerulean.css +12229 -0
  222. data/scarpe-components/assets/bootstrap-themes/bootstrap-cosmo.css +11810 -0
  223. data/scarpe-components/assets/bootstrap-themes/bootstrap-cyborg.css +12210 -0
  224. data/scarpe-components/assets/bootstrap-themes/bootstrap-darkly.css +12153 -0
  225. data/scarpe-components/assets/bootstrap-themes/bootstrap-flatly.css +12126 -0
  226. data/scarpe-components/assets/bootstrap-themes/bootstrap-icons.min.css +5 -0
  227. data/scarpe-components/assets/bootstrap-themes/bootstrap-journal.css +12099 -0
  228. data/scarpe-components/assets/bootstrap-themes/bootstrap-litera.css +12211 -0
  229. data/scarpe-components/assets/bootstrap-themes/bootstrap-lumen.css +12369 -0
  230. data/scarpe-components/assets/bootstrap-themes/bootstrap-lux.css +11928 -0
  231. data/scarpe-components/assets/bootstrap-themes/bootstrap-materia.css +13184 -0
  232. data/scarpe-components/assets/bootstrap-themes/bootstrap-minty.css +12177 -0
  233. data/scarpe-components/assets/bootstrap-themes/bootstrap-morph.css +12750 -0
  234. data/scarpe-components/assets/bootstrap-themes/bootstrap-pulse.css +11890 -0
  235. data/scarpe-components/assets/bootstrap-themes/bootstrap-quartz.css +12622 -0
  236. data/scarpe-components/assets/bootstrap-themes/bootstrap-sandstone.css +12201 -0
  237. data/scarpe-components/assets/bootstrap-themes/bootstrap-simplex.css +12186 -0
  238. data/scarpe-components/assets/bootstrap-themes/bootstrap-sketchy.css +12451 -0
  239. data/scarpe-components/assets/bootstrap-themes/bootstrap-slate.css +12492 -0
  240. data/scarpe-components/assets/bootstrap-themes/bootstrap-solar.css +12149 -0
  241. data/scarpe-components/assets/bootstrap-themes/bootstrap-spacelab.css +12266 -0
  242. data/scarpe-components/assets/bootstrap-themes/bootstrap-superhero.css +12216 -0
  243. data/scarpe-components/assets/bootstrap-themes/bootstrap-united.css +12077 -0
  244. data/scarpe-components/assets/bootstrap-themes/bootstrap-vapor.css +12549 -0
  245. data/scarpe-components/assets/bootstrap-themes/bootstrap-yeti.css +12325 -0
  246. data/scarpe-components/assets/bootstrap-themes/bootstrap-zephyr.css +12283 -0
  247. data/scarpe-components/assets/bootstrap-themes/bootstrap.bundle.min.js +7 -0
  248. data/scarpe-components/lib/scarpe/components/asset_server.rb +219 -0
  249. data/scarpe-components/lib/scarpe/components/base64.rb +22 -0
  250. data/scarpe-components/lib/scarpe/components/calzini/{art_widgets.rb → art_drawables.rb} +42 -18
  251. data/scarpe-components/lib/scarpe/components/calzini/border.rb +38 -0
  252. data/scarpe-components/lib/scarpe/components/calzini/button.rb +6 -8
  253. data/scarpe-components/lib/scarpe/components/calzini/misc.rb +14 -16
  254. data/scarpe-components/lib/scarpe/components/calzini/para.rb +218 -11
  255. data/scarpe-components/lib/scarpe/components/calzini/slots.rb +16 -60
  256. data/scarpe-components/lib/scarpe/components/calzini.rb +88 -1
  257. data/scarpe-components/lib/scarpe/components/errors.rb +4 -0
  258. data/scarpe-components/lib/scarpe/components/html.rb +4 -1
  259. data/scarpe-components/lib/scarpe/components/minitest_export_reporter.rb +11 -3
  260. data/scarpe-components/lib/scarpe/components/minitest_result.rb +41 -0
  261. data/scarpe-components/lib/scarpe/components/port_helpers.rb +30 -0
  262. data/scarpe-components/lib/scarpe/components/print_logger.rb +17 -2
  263. data/scarpe-components/lib/scarpe/components/process_helpers.rb +37 -0
  264. data/scarpe-components/lib/scarpe/components/segmented_file_loader.rb +1 -1
  265. data/scarpe-components/lib/scarpe/components/tiranti.rb +42 -100
  266. data/scarpe-components/lib/scarpe/components/unit_test_helpers.rb +3 -1
  267. data/scarpe-components/lib/scarpe/components/version.rb +1 -1
  268. data/scarpe-components/scarpe-components.gemspec +1 -1
  269. data/scarpe-components/test/assets/big-image.png +0 -0
  270. data/scarpe-components/test/assets/big-stylesheet.css +497 -0
  271. data/scarpe-components/test/assets/little-image.png +0 -0
  272. data/scarpe-components/test/assets/little-stylesheet.css +1 -0
  273. data/scarpe-components/test/calzini/test_calzini_art_drawables.rb +7 -7
  274. data/scarpe-components/test/calzini/test_calzini_button.rb +7 -5
  275. data/scarpe-components/test/calzini/test_calzini_misc.rb +9 -9
  276. data/scarpe-components/test/calzini/test_calzini_para.rb +6 -9
  277. data/scarpe-components/test/calzini/test_calzini_slots.rb +12 -57
  278. data/scarpe-components/test/calzini/test_calzini_text_drawables.rb +83 -18
  279. data/scarpe-components/test/calzini/test_various.rb +133 -0
  280. data/scarpe-components/test/test_asset_server.rb +72 -0
  281. data/scarpe-components/test/test_components.rb +31 -2
  282. data/scarpe-components/test/test_helper.rb +0 -1
  283. data/scarpe-components/test/test_minitest_result.rb +7 -0
  284. data/scarpe-components/test/test_port_helpers.rb +12 -0
  285. data/scarpe-components/test/test_segmented_app_files.rb +2 -0
  286. data/tasks/check_html_fixtures.rb +140 -0
  287. data/tasks/regenerate_html_fixtures.rb +104 -0
  288. data/templates/class_template_with_shapes.erb +0 -11
  289. metadata +225 -39
  290. data/.rubocop.yml +0 -88
  291. data/lacci/lib/scarpe/niente/logger.rb +0 -29
  292. data/lacci/lib/shoes/drawables/span.rb +0 -27
  293. data/lacci/lib/shoes/spacing.rb +0 -9
  294. data/lib/scarpe/evented_assertions.rb +0 -121
  295. data/lib/scarpe/wv/span.rb +0 -44
  296. data/scarpe-components/lib/scarpe/components/calzini/text_widgets.rb +0 -65
  297. /data/examples/legacy/{not_checked → working}/shoes3-tests/editline/editline.rb +0 -0
data/docs/lacci.md ADDED
@@ -0,0 +1,121 @@
1
+ ---
2
+ layout: default
3
+ title: Lacci
4
+ ---
5
+
6
+ # Lacci: The Shoes4 Compatibility Layer
7
+
8
+ ## Overview
9
+
10
+ Lacci (Italian for "laces") serves as the compatibility layer between Shoes4 applications and Scarpe's display services. Think of it as the translator that allows your classic Shoes4 code to work seamlessly with modern display backends.
11
+
12
+ ## Core Concepts
13
+
14
+ ### 1. Event Handling and Drawing Model
15
+
16
+ Lacci implements the Shoes4 drawing model, which includes:
17
+ - Slot-based layout system (stacks, flows)
18
+ - Event propagation
19
+ - Drawing context inheritance
20
+ - Margin and positioning calculations
21
+
22
+ ### 2. Display Service Abstraction
23
+
24
+ Lacci abstracts away the details of different display services (like Webview or Qt) by:
25
+ - Translating Shoes4 drawing commands into display-agnostic operations
26
+ - Managing widget lifecycles
27
+ - Handling parent-child relationships between elements
28
+ - Coordinating style inheritance
29
+
30
+ ### 3. Test Infrastructure
31
+
32
+ The test infrastructure in Lacci uses Niente (Italian for "nothing"), a null display service that:
33
+ - Allows testing without a real display backend
34
+ - Verifies drawing operations and event handling
35
+ - Supports multiple simultaneous Shoes apps in test environments
36
+ - Provides fast, reliable test execution
37
+
38
+ ## Key Components
39
+
40
+ ### MarginHelper
41
+ Handles margin calculations with support for:
42
+ - Numeric values
43
+ - Array-based margins
44
+ - Hash-based margins
45
+ - String-based margin definitions
46
+
47
+ ### FontHelper
48
+ Manages font parsing and styling with support for:
49
+ - Font families
50
+ - Font sizes
51
+ - Font weights
52
+ - Font variants
53
+ - Font styles
54
+
55
+ ### DrawContext
56
+ Manages the drawing context inheritance system:
57
+ - Style propagation (fill, stroke, etc.)
58
+ - Context stacking
59
+ - Property overrides
60
+
61
+ ## Usage Examples
62
+
63
+ ```ruby
64
+ # Basic Shoes4 App
65
+ Shoes.app do
66
+ stack do
67
+ para "Hello from Lacci!"
68
+ button "Click me" do
69
+ alert "Button clicked!"
70
+ end
71
+ end
72
+ end
73
+ ```
74
+
75
+ ## Error Handling
76
+
77
+ Lacci provides rich error handling through the `Shoes::Errors` module:
78
+ - `InvalidAttributeValueError`
79
+ - `BadArgumentListError`
80
+ - `UnsupportedFeatureError`
81
+ - `MultipleDrawablesFoundError`
82
+ - `NoDrawablesFoundError`
83
+
84
+ ## Display Service Requirements
85
+
86
+ For a display service to be compatible with Lacci, it must:
87
+ 1. Implement the basic drawing primitives
88
+ 2. Support parent-child relationships
89
+ 3. Handle event propagation
90
+ 4. Manage drawing contexts
91
+ 5. Support style inheritance
92
+
93
+ ## Testing
94
+
95
+ Lacci uses a comprehensive test suite with:
96
+ - Unit tests for helpers and utilities
97
+ - Integration tests for drawing operations
98
+ - Feature tests for end-to-end functionality
99
+ - Niente-based tests for display service compatibility
100
+
101
+ ## Future Development
102
+
103
+ Areas for future enhancement include:
104
+ - Additional drawing primitives
105
+ - Enhanced animation support
106
+ - Improved error reporting
107
+ - Extended display service capabilities
108
+
109
+ ## Contributing
110
+
111
+ When contributing to Lacci:
112
+ 1. Ensure tests pass with Niente
113
+ 2. Maintain backward compatibility
114
+ 3. Follow the existing error handling patterns
115
+ 4. Document new features and changes
116
+
117
+ ## Related Components
118
+
119
+ - Scarpe: The main project
120
+ - Niente: The null display service for testing
121
+ - Display Services: Various backend implementations
@@ -0,0 +1,71 @@
1
+ ---
2
+ layout: default
3
+ title: scarpe shoes incompatibilities
4
+ ---
5
+
6
+ # Scarpe/Shoes Incompatibilities
7
+
8
+ This document outlines the known incompatibilities between Scarpe and the original Shoes implementation.
9
+
10
+ ## API Differences
11
+
12
+ 1. **Method Names**
13
+ - Some methods have been renamed for clarity
14
+ - Deprecated Shoes methods are not supported
15
+ - New methods added for modern features
16
+
17
+ 2. **Parameters**
18
+ - Some parameter orders have changed
19
+ - Additional options are available
20
+ - Some legacy options are not supported
21
+
22
+ ## Behavioral Changes
23
+
24
+ Key behavioral differences include:
25
+
26
+ 1. **Event Handling**
27
+ - More consistent event model
28
+ - Better async support
29
+ - Different timing guarantees
30
+
31
+ 2. **Layout System**
32
+ - More predictable layout behavior
33
+ - Enhanced flexibility
34
+ - Some legacy layouts may render differently
35
+
36
+ ## Unsupported Features
37
+
38
+ Some Shoes features are not supported in Scarpe:
39
+
40
+ 1. **Legacy Components**
41
+ - Certain deprecated widgets
42
+ - Old animation system
43
+ - Legacy drawing methods
44
+
45
+ 2. **Platform-Specific Features**
46
+ - Some OS-specific capabilities
47
+ - Direct hardware access
48
+ - Legacy system integration
49
+
50
+ ## Modernization Changes
51
+
52
+ Intentional changes for modern development:
53
+
54
+ 1. **Architecture**
55
+ - Separate display service
56
+ - Modern component model
57
+ - Enhanced state management
58
+
59
+ 2. **Development Experience**
60
+ - Better debugging tools
61
+ - Modern testing support
62
+ - Improved error messages
63
+
64
+ ## Migration Guide
65
+
66
+ When moving from Shoes to Scarpe:
67
+
68
+ 1. Review API changes
69
+ 2. Update event handlers
70
+ 3. Test layouts thoroughly
71
+ 4. Use modern alternatives for legacy features
@@ -0,0 +1,55 @@
1
+ ---
2
+ layout: default
3
+ title: shoes and display events
4
+ ---
5
+
6
+ # Shoes and Display Events
7
+
8
+ This document covers how Scarpe handles events and display updates in relation to the original Shoes implementation.
9
+
10
+ ## Event Handling
11
+
12
+ Scarpe implements event handling in a way that maintains compatibility with Shoes while providing modern features:
13
+
14
+ 1. **Event Types**
15
+ - Mouse events (click, hover, etc.)
16
+ - Keyboard events
17
+ - Window events
18
+ - Custom events
19
+
20
+ 2. **Event Flow**
21
+ - Events are captured in the display service
22
+ - Processed through the event loop
23
+ - Dispatched to appropriate handlers
24
+
25
+ ## Synchronous vs Asynchronous
26
+
27
+ Scarpe supports both synchronous and asynchronous event handling:
28
+
29
+ ### Synchronous Events
30
+ - Direct user interactions
31
+ - Immediate UI updates
32
+ - Traditional Shoes-style callbacks
33
+
34
+ ### Asynchronous Events
35
+ - Background operations
36
+ - Network requests
37
+ - Long-running computations
38
+
39
+ ## Display Updates
40
+
41
+ Display updates in Scarpe follow a specific pattern:
42
+
43
+ 1. State changes trigger update events
44
+ 2. Updates are batched when possible
45
+ 3. Changes are applied atomically
46
+ 4. The display service reflects changes efficiently
47
+
48
+ ## Compatibility Notes
49
+
50
+ While maintaining compatibility with Shoes, Scarpe introduces some modern improvements:
51
+
52
+ - Better event queueing
53
+ - More efficient update batching
54
+ - Enhanced error handling
55
+ - Improved async support
@@ -0,0 +1,79 @@
1
+ ---
2
+ layout: default
3
+ title: shoes implementations
4
+ ---
5
+
6
+ # Shoes Implementations
7
+
8
+ This document covers various Shoes implementations and how Scarpe relates to them.
9
+
10
+ ## Historical Implementations
11
+
12
+ 1. **Original Shoes**
13
+ - Written in C/Ruby
14
+ - Created by _why the lucky stiff
15
+ - Native GUI implementation
16
+
17
+ 2. **Green Shoes**
18
+ - Pure Ruby implementation
19
+ - GTK+ based
20
+ - Simplified architecture
21
+
22
+ 3. **Purple Shoes**
23
+ - Windows-specific version
24
+ - WinForms based
25
+ - Limited platform support
26
+
27
+ ## Modern Implementations
28
+
29
+ 1. **Scarpe**
30
+ - Web-based implementation
31
+ - Modern architecture
32
+ - Enhanced features
33
+
34
+ 2. **Other Current Projects**
35
+ - Various community efforts
36
+ - Different approach focuses
37
+ - Platform-specific versions
38
+
39
+ ## Implementation Comparisons
40
+
41
+ Key differences between implementations:
42
+
43
+ 1. **Architecture**
44
+ - Display handling
45
+ - Event systems
46
+ - State management
47
+
48
+ 2. **Features**
49
+ - UI components
50
+ - Drawing capabilities
51
+ - Platform integration
52
+
53
+ ## Learning from History
54
+
55
+ Lessons from previous implementations:
56
+
57
+ 1. **What Worked**
58
+ - Simple API design
59
+ - Flexible layouts
60
+ - Ruby-like syntax
61
+
62
+ 2. **What Needed Improvement**
63
+ - Event handling
64
+ - State management
65
+ - Cross-platform support
66
+
67
+ ## Future Directions
68
+
69
+ Areas for continued development:
70
+
71
+ 1. **Modern Features**
72
+ - Better async support
73
+ - Enhanced components
74
+ - Improved tooling
75
+
76
+ 2. **Community Focus**
77
+ - Documentation
78
+ - Examples
79
+ - Learning resources
@@ -1,3 +1,8 @@
1
+ ---
2
+ layout: default
3
+ title: The Shoes Manual
4
+ ---
5
+
1
6
  # Hello!
2
7
 
3
8
  Shoes is a tiny graphics toolkit. It's simple and straightforward. Shoes was
Binary file
@@ -0,0 +1,66 @@
1
+ ---
2
+ layout: default
3
+ title: timeouts and handlers
4
+ ---
5
+
6
+ # Timeouts and Handlers
7
+
8
+ This document explains how Scarpe manages timeouts and event handlers within its cooperative evented approach.
9
+
10
+ ## Timeout Management
11
+
12
+ Scarpe implements timeouts with these key considerations:
13
+
14
+ 1. **Cooperative Nature**
15
+ - Timeouts don't interrupt execution
16
+ - They're processed when the event loop is ready
17
+ - Timing is approximate, not exact
18
+
19
+ 2. **Implementation**
20
+ ```ruby
21
+ def after(milliseconds, &block)
22
+ register_timeout(Time.now + (milliseconds / 1000.0), block)
23
+ end
24
+ ```
25
+
26
+ ## Event Handlers
27
+
28
+ Event handlers in Scarpe follow these principles:
29
+
30
+ 1. **Registration**
31
+ - Handlers are registered with specific events
32
+ - Multiple handlers can exist per event
33
+ - Order of execution is preserved
34
+
35
+ 2. **Execution**
36
+ - Handlers run in the main event loop
37
+ - They should be non-blocking when possible
38
+ - Long operations should be broken up
39
+
40
+ ## Restrictions
41
+
42
+ The cooperative approach has some important restrictions:
43
+
44
+ 1. **No Preemption**
45
+ - Long-running handlers block other events
46
+ - Timeouts may be delayed
47
+ - UI updates wait for handlers to complete
48
+
49
+ 2. **Best Practices**
50
+ - Keep handlers short
51
+ - Use async for long operations
52
+ - Break up complex tasks
53
+
54
+ ## Error Handling
55
+
56
+ Handlers include error management:
57
+
58
+ 1. **Exception Catching**
59
+ - Errors don't crash the event loop
60
+ - Exceptions are logged appropriately
61
+ - Error handlers can be registered
62
+
63
+ 2. **Recovery**
64
+ - System can recover from handler errors
65
+ - State remains consistent
66
+ - Other handlers continue to work
@@ -0,0 +1,76 @@
1
+ ---
2
+ layout: default
3
+ title: web archaeology
4
+ ---
5
+
6
+ # Web Archaeology
7
+
8
+ This document catalogs various online sources of Shoes-related information, preserving important historical context.
9
+
10
+ ## Historical Sources
11
+
12
+ 1. **_why's Work**
13
+ - Original Shoes documentation
14
+ - Blog posts and tutorials
15
+ - Code examples and demos
16
+
17
+ 2. **Community Resources**
18
+ - Early forum discussions
19
+ - Mailing list archives
20
+ - Wiki pages
21
+
22
+ ## Code Archives
23
+
24
+ Important code repositories:
25
+
26
+ 1. **Original Shoes**
27
+ - GitHub mirrors
28
+ - Historical versions
29
+ - Community forks
30
+
31
+ 2. **Related Projects**
32
+ - Green Shoes
33
+ - Purple Shoes
34
+ - Other implementations
35
+
36
+ ## Documentation Archives
37
+
38
+ Preserved documentation:
39
+
40
+ 1. **Official Docs**
41
+ - Original manuals
42
+ - Tutorial content
43
+ - API references
44
+
45
+ 2. **Community Guides**
46
+ - Blog posts
47
+ - Tutorials
48
+ - Example collections
49
+
50
+ ## Learning Resources
51
+
52
+ Educational materials:
53
+
54
+ 1. **Tutorials**
55
+ - Getting started guides
56
+ - Advanced topics
57
+ - Example applications
58
+
59
+ 2. **Reference Materials**
60
+ - API documentation
61
+ - Design principles
62
+ - Best practices
63
+
64
+ ## Historical Context
65
+
66
+ Understanding Shoes' evolution:
67
+
68
+ 1. **Timeline**
69
+ - Key developments
70
+ - Major releases
71
+ - Community milestones
72
+
73
+ 2. **Impact**
74
+ - Influence on Ruby
75
+ - GUI development
76
+ - Community growth
@@ -0,0 +1,8 @@
1
+ Shoes.app do
2
+ para "Anything:",size:"30px"
3
+ lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim."
4
+ @manuscript = edit_box(lorem, width: "100%", font:"italic normal bold 25px 'Times New Roman', serif;", tooltip:"This is a tooltip") do |box|
5
+ @char_count.replace("#{box.text.length} characters")
6
+ end
7
+ @char_count = para "#{@manuscript.text.length} characters" ,size:"20px"
8
+ end
@@ -0,0 +1,7 @@
1
+ Shoes.app do
2
+
3
+ para "This text have kerning applied to it", kerning:10, size:18
4
+
5
+ para "This is normal text for reference", size:18
6
+
7
+ end
@@ -1,16 +1,25 @@
1
1
  Shoes.app do
2
2
 
3
- stack width:100, height:100 do
4
- background "docs/static/avatar.png"
5
- border blue ,strokewidth: 4
3
+ # Local file (path relative to this script)
4
+ stack width: 100, height: 100 do
5
+ background "../docs/static/avatar.png"
6
+ border blue, strokewidth: 4
6
7
  end
7
8
 
8
- stack width:100, height:100 do
9
+ # Solid color
10
+ stack width: 100, height: 100 do
9
11
  background red
10
12
  end
11
13
 
12
- stack width:100, height:100 do
14
+ # RGBA string
15
+ stack width: 100, height: 100 do
13
16
  background "rgba(255,200,0,255)"
14
17
  end
15
18
 
19
+ # Remote URL
20
+ stack width: 100, height: 100 do
21
+ background "http://shoesrb.com/manual/static/shoes-icon.png"
22
+ border green, strokewidth: 4
23
+ end
24
+
16
25
  end
@@ -58,7 +58,7 @@ class Feepogram
58
58
  @tracks.each do |sound_name, notes|
59
59
  bloops.tune @sounds[sound_name], notes
60
60
 
61
- #puts "#{sound_name}: #{notes.gsub(/\s+/, ' ')}"
61
+ puts "#{sound_name}: #{notes.gsub(/\s+/, ' ')}"
62
62
  end
63
63
 
64
64
  bloops.play
@@ -0,0 +1,135 @@
1
+ require_relative 'feepogram'
2
+
3
+ bloops = Bloops.new
4
+ bloops.tempo = 280
5
+
6
+ song = Feepogram.new(bloops) do
7
+ # Define our instruments
8
+ sound :kick, Bloops::SINE do |s|
9
+ s.volume = 0.9
10
+ s.punch = 0.4
11
+ s.sustain = 0.1
12
+ s.decay = 0.2
13
+ end
14
+
15
+ sound :snare, Bloops::NOISE do |s|
16
+ s.volume = 0.8
17
+ s.punch = 0.2
18
+ s.sustain = 0.05
19
+ s.decay = 0.25
20
+ end
21
+
22
+ sound :hat, Bloops::NOISE do |s|
23
+ s.volume = 0.4
24
+ s.punch = 0.1
25
+ s.sustain = 0.02
26
+ s.decay = 0.1
27
+ end
28
+
29
+ sound :synth_bass, Bloops::SAWTOOTH do |s|
30
+ s.volume = 0.7
31
+ s.sustain = 0.3
32
+ s.decay = 0.1
33
+ s.slide = 0.2
34
+ end
35
+
36
+ sound :lead, Bloops::SQUARE do |s|
37
+ s.volume = 0.6
38
+ s.punch = 0.3
39
+ s.sustain = 0.4
40
+ s.decay = 0.2
41
+ end
42
+
43
+ sound :pad, Bloops::SINE do |s|
44
+ s.volume = 0.5
45
+ s.sustain = 1.0
46
+ s.decay = 0.5
47
+ end
48
+
49
+ # Helper methods for our patterns
50
+ def basic_beat
51
+ kick " c 4 4 c 4 4 c 4 " * 4
52
+ snare " 4 4 c 4 4 4 c 4 " * 4
53
+ hat " c5 " * 32
54
+ end
55
+
56
+ def bass_line_a
57
+ synth_bass %{
58
+ c2 4 e2 4 f2 4 g2 4
59
+ c2 4 e2 4 f2 4 g2 4
60
+ a1 4 c2 4 d2 4 e2 4
61
+ f2 4 e2 4 d2 4 c2 4
62
+ }
63
+ end
64
+
65
+ def lead_melody_a
66
+ lead %{
67
+ 4 c4 e4 g4 4 c5 g4 e4
68
+ 4 c4 f4 a4 4 c5 a4 f4
69
+ 4 e4 g4 c5 4 e5 c5 g4
70
+ 4 d4 f4 a4 4 d5 a4 f4
71
+ }
72
+ end
73
+
74
+ def ambient_pad
75
+ pad %{
76
+ 1:c4 1:c4
77
+ 1:f4 1:f4
78
+ 1:g4 1:g4
79
+ 1:e4 1:e4
80
+ }
81
+ end
82
+
83
+ # Structure our song
84
+ def intro
85
+ 2.times do
86
+ phrase do
87
+ basic_beat
88
+ bass_line_a
89
+ end
90
+ end
91
+ end
92
+
93
+ def verse
94
+ 2.times do
95
+ phrase do
96
+ basic_beat
97
+ bass_line_a
98
+ lead_melody_a
99
+ end
100
+ end
101
+ end
102
+
103
+ def bridge
104
+ phrase do
105
+ kick " c 4 4 4 " * 8
106
+ snare " 4 4 c 4 " * 8
107
+ hat " c5 " * 16
108
+ ambient_pad
109
+ end
110
+ end
111
+
112
+ def outro
113
+ phrase do
114
+ basic_beat
115
+ bass_line_a
116
+ lead_melody_a
117
+ ambient_pad
118
+ end
119
+
120
+ phrase do
121
+ kick "c"
122
+ synth_bass "c2"
123
+ pad "1:c4"
124
+ end
125
+ end
126
+
127
+ # Play the composition
128
+ intro
129
+ verse
130
+ bridge
131
+ verse
132
+ outro
133
+ end
134
+
135
+ song.play