kredki 0.1.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 (386) hide show
  1. checksums.yaml +7 -0
  2. data/lib/kredki/core/application.rb +314 -0
  3. data/lib/kredki/core/color.rb +100 -0
  4. data/lib/kredki/core/event/block_event_reaction.rb +44 -0
  5. data/lib/kredki/core/event/composite_event_manager.rb +37 -0
  6. data/lib/kredki/core/event/event.rb +91 -0
  7. data/lib/kredki/core/event/event_manager.rb +60 -0
  8. data/lib/kredki/core/event/event_manager_jobs.rb +53 -0
  9. data/lib/kredki/core/event/event_reaction.rb +36 -0
  10. data/lib/kredki/core/event/family/drop_event.rb +40 -0
  11. data/lib/kredki/core/event/family/exit_event.rb +5 -0
  12. data/lib/kredki/core/event/family/focus_enter_event.rb +5 -0
  13. data/lib/kredki/core/event/family/focus_leave_event.rb +5 -0
  14. data/lib/kredki/core/event/family/hide_event.rb +5 -0
  15. data/lib/kredki/core/event/family/joystick_event.rb +102 -0
  16. data/lib/kredki/core/event/family/key_event.rb +40 -0
  17. data/lib/kredki/core/event/family/mouse_event.rb +190 -0
  18. data/lib/kredki/core/event/family/pastele_event.rb +11 -0
  19. data/lib/kredki/core/event/family/show_event.rb +5 -0
  20. data/lib/kredki/core/event/family/text_event.rb +23 -0
  21. data/lib/kredki/core/event/family/tick_event.rb +5 -0
  22. data/lib/kredki/core/event/family/update_complete_event.rb +5 -0
  23. data/lib/kredki/core/event/family/window_event.rb +108 -0
  24. data/lib/kredki/core/event/job_event_reaction.rb +44 -0
  25. data/lib/kredki/core/event/joystick_event_manager.rb +30 -0
  26. data/lib/kredki/core/event/keyboard_event_manager.rb +29 -0
  27. data/lib/kredki/core/event/method_event_reaction.rb +46 -0
  28. data/lib/kredki/core/event/mouse_event_manager.rb +27 -0
  29. data/lib/kredki/core/font.rb +53 -0
  30. data/lib/kredki/core/job/after_job.rb +59 -0
  31. data/lib/kredki/core/job/job.rb +108 -0
  32. data/lib/kredki/core/job/loop_job.rb +87 -0
  33. data/lib/kredki/core/job/play_animation_job.rb +44 -0
  34. data/lib/kredki/core/job/play_job.rb +41 -0
  35. data/lib/kredki/core/job/play_loop_animation_job.rb +98 -0
  36. data/lib/kredki/core/job/play_loop_job.rb +104 -0
  37. data/lib/kredki/core/job/side_job.rb +62 -0
  38. data/lib/kredki/core/kernel-path.rb +71 -0
  39. data/lib/kredki/core/kredki.rb +89 -0
  40. data/lib/kredki/core/linear_gradient.rb +43 -0
  41. data/lib/kredki/core/media/clipboard.rb +35 -0
  42. data/lib/kredki/core/media/joystick.rb +199 -0
  43. data/lib/kredki/core/media/keyboard.rb +84 -0
  44. data/lib/kredki/core/media/keyboard_modifiers_decoder.rb +154 -0
  45. data/lib/kredki/core/media/mouse.rb +197 -0
  46. data/lib/kredki/core/paint/animation.rb +247 -0
  47. data/lib/kredki/core/paint/area.rb +67 -0
  48. data/lib/kredki/core/paint/block_shape_area.rb +102 -0
  49. data/lib/kredki/core/paint/ellipse.rb +22 -0
  50. data/lib/kredki/core/paint/paint.rb +392 -0
  51. data/lib/kredki/core/paint/picture.rb +126 -0
  52. data/lib/kredki/core/paint/rectangle.rb +202 -0
  53. data/lib/kredki/core/paint/scene.rb +277 -0
  54. data/lib/kredki/core/paint/shape.rb +394 -0
  55. data/lib/kredki/core/paint/shape_area.rb +57 -0
  56. data/lib/kredki/core/paint/text.rb +222 -0
  57. data/lib/kredki/core/pastele/pastele-extern.rb +139 -0
  58. data/lib/kredki/core/pastele/pastele.rb +205 -0
  59. data/lib/kredki/core/radial_gradient.rb +45 -0
  60. data/lib/kredki/core/setup.rb +214 -0
  61. data/lib/kredki/core/window/pane.rb +178 -0
  62. data/lib/kredki/core/window/pane_event_manager.rb +44 -0
  63. data/lib/kredki/core/window/pane_events.rb +366 -0
  64. data/lib/kredki/core/window/window.rb +584 -0
  65. data/lib/kredki/core.rb +2 -0
  66. data/lib/kredki/hide.rb +9 -0
  67. data/lib/kredki/irb.rb +90 -0
  68. data/lib/kredki/module.rb +3 -0
  69. data/lib/kredki/pads/application.rb +13 -0
  70. data/lib/kredki/pads/button.rb +151 -0
  71. data/lib/kredki/pads/checkbox/checkbox.rb +68 -0
  72. data/lib/kredki/pads/checkbox/checkbox_button.rb +65 -0
  73. data/lib/kredki/pads/context/item.rb +65 -0
  74. data/lib/kredki/pads/context/item_group.rb +10 -0
  75. data/lib/kredki/pads/context/layer.rb +59 -0
  76. data/lib/kredki/pads/context/menu.rb +77 -0
  77. data/lib/kredki/pads/context/pad.rb +26 -0
  78. data/lib/kredki/pads/context/primary_layer.rb +51 -0
  79. data/lib/kredki/pads/context/secondary_layer.rb +60 -0
  80. data/lib/kredki/pads/item/item.rb +140 -0
  81. data/lib/kredki/pads/item/item_group.rb +44 -0
  82. data/lib/kredki/pads/item/item_x.rb +22 -0
  83. data/lib/kredki/pads/item/item_y.rb +31 -0
  84. data/lib/kredki/pads/label.rb +71 -0
  85. data/lib/kredki/pads/layer.rb +326 -0
  86. data/lib/kredki/pads/layout/align.rb +10 -0
  87. data/lib/kredki/pads/layout/layout.rb +88 -0
  88. data/lib/kredki/pads/layout/way.rb +99 -0
  89. data/lib/kredki/pads/layout/x_way.rb +119 -0
  90. data/lib/kredki/pads/layout/y_way.rb +120 -0
  91. data/lib/kredki/pads/list/item.rb +117 -0
  92. data/lib/kredki/pads/list/item_group.rb +36 -0
  93. data/lib/kredki/pads/list/pad.rb +74 -0
  94. data/lib/kredki/pads/list/tree/item.rb +138 -0
  95. data/lib/kredki/pads/list/tree/item_group.rb +86 -0
  96. data/lib/kredki/pads/list/tree/pad.rb +94 -0
  97. data/lib/kredki/pads/module.rb +11 -0
  98. data/lib/kredki/pads/note.rb +212 -0
  99. data/lib/kredki/pads/notes.rb +32 -0
  100. data/lib/kredki/pads/option/option.rb +121 -0
  101. data/lib/kredki/pads/option/option_item.rb +15 -0
  102. data/lib/kredki/pads/option/option_item_group.rb +16 -0
  103. data/lib/kredki/pads/option/option_layer.rb +81 -0
  104. data/lib/kredki/pads/pad/animation_pad.rb +106 -0
  105. data/lib/kredki/pads/pad/glyph_pad.rb +71 -0
  106. data/lib/kredki/pads/pad/pad.rb +1290 -0
  107. data/lib/kredki/pads/pad/pad_events.rb +358 -0
  108. data/lib/kredki/pads/pad/picture_pad.rb +89 -0
  109. data/lib/kredki/pads/pad/rectangle_pad.rb +181 -0
  110. data/lib/kredki/pads/pad/scroll_pad.rb +176 -0
  111. data/lib/kredki/pads/pad/shape_pad.rb +148 -0
  112. data/lib/kredki/pads/pad/space_pad.rb +33 -0
  113. data/lib/kredki/pads/pad/text_pad.rb +310 -0
  114. data/lib/kredki/pads/pane.rb +267 -0
  115. data/lib/kredki/pads/portal_layer.rb +94 -0
  116. data/lib/kredki/pads/radio/group.rb +45 -0
  117. data/lib/kredki/pads/radio/item.rb +69 -0
  118. data/lib/kredki/pads/radio/item_button.rb +143 -0
  119. data/lib/kredki/pads/service/event_queue.rb +79 -0
  120. data/lib/kredki/pads/service/service.rb +248 -0
  121. data/lib/kredki/pads/service/service_event_manager.rb +43 -0
  122. data/lib/kredki/pads/service/service_filter.rb +98 -0
  123. data/lib/kredki/pads/service/service_inherited.rb +48 -0
  124. data/lib/kredki/pads/setup.rb +36 -0
  125. data/lib/kredki/pads/slider/slider.rb +145 -0
  126. data/lib/kredki/pads/slider/slider_x.rb +41 -0
  127. data/lib/kredki/pads/slider/slider_y.rb +41 -0
  128. data/lib/kredki/pads/table/cell.rb +22 -0
  129. data/lib/kredki/pads/table/column.rb +63 -0
  130. data/lib/kredki/pads/table/column_layout.rb +88 -0
  131. data/lib/kredki/pads/table/pad.rb +116 -0
  132. data/lib/kredki/pads/table/row.rb +24 -0
  133. data/lib/kredki/pads/table/scroll_rows.rb +50 -0
  134. data/lib/kredki/pads/text/editable_text_verse.rb +77 -0
  135. data/lib/kredki/pads/text/editable_text_verses.rb +59 -0
  136. data/lib/kredki/pads/text/navigable_text_pad.rb +413 -0
  137. data/lib/kredki/pads/text/text_edition.rb +97 -0
  138. data/lib/kredki/pads/text/text_navigation.rb +109 -0
  139. data/lib/kredki/pads/toolbar/item.rb +62 -0
  140. data/lib/kredki/pads/toolbar/item_group.rb +22 -0
  141. data/lib/kredki/pads/toolbar/layer.rb +41 -0
  142. data/lib/kredki/pads/toolbar/pad.rb +51 -0
  143. data/lib/kredki/pads/toolbar/primary_layer.rb +64 -0
  144. data/lib/kredki/pads/window.rb +11 -0
  145. data/lib/kredki/script.rb +29 -0
  146. data/lib/kredki/setup.rb +2 -0
  147. data/lib/kredki/test.rb +35 -0
  148. data/lib/kredki.rb +10 -0
  149. data/lib/readme.md +31 -0
  150. data/stuff/config/config.rb +431 -0
  151. data/stuff/config/pads_config.rb +111 -0
  152. data/stuff/dll/SDL3.dll +0 -0
  153. data/stuff/dll/pastele.dll +0 -0
  154. data/stuff/dll/thorvg-1.dll +0 -0
  155. data/stuff/font/MartianMono-StdRg.ttf +0 -0
  156. data/stuff/font/MavenPro-Medium.ttf +0 -0
  157. data/stuff/font/MavenPro-Regular.ttf +0 -0
  158. data/stuff/glyph/alert-circle-svgrepo-com.svg +4 -0
  159. data/stuff/glyph/alert-triangle-svgrepo-com.svg +12 -0
  160. data/stuff/glyph/archivebox-svgrepo-com.svg +5 -0
  161. data/stuff/glyph/arrow-2-ccw-svgrepo-com.svg +5 -0
  162. data/stuff/glyph/arrow-2-cw-svgrepo-com.svg +5 -0
  163. data/stuff/glyph/arrow-2-rectangle-path-svgrepo-com.svg +5 -0
  164. data/stuff/glyph/arrow-4-way-svgrepo-com.svg +4 -0
  165. data/stuff/glyph/arrow-ccw-svgrepo-com.svg +4 -0
  166. data/stuff/glyph/arrow-circle-down-svgrepo-com.svg +4 -0
  167. data/stuff/glyph/arrow-circle-left-svgrepo-com.svg +4 -0
  168. data/stuff/glyph/arrow-circle-right-svgrepo-com.svg +4 -0
  169. data/stuff/glyph/arrow-circle-up-svgrepo-com.svg +4 -0
  170. data/stuff/glyph/arrow-cw-svgrepo-com.svg +4 -0
  171. data/stuff/glyph/arrow-down-svgrepo-com.svg +4 -0
  172. data/stuff/glyph/arrow-from-line-down-svgrepo-com.svg +5 -0
  173. data/stuff/glyph/arrow-from-line-left-svgrepo-com.svg +5 -0
  174. data/stuff/glyph/arrow-from-line-right-svgrepo-com.svg +5 -0
  175. data/stuff/glyph/arrow-from-line-up-svgrepo-com.svg +5 -0
  176. data/stuff/glyph/arrow-from-shape-right-svgrepo-com.svg +5 -0
  177. data/stuff/glyph/arrow-from-shape-up-svgrepo-com.svg +5 -0
  178. data/stuff/glyph/arrow-left-svgrepo-com.svg +4 -0
  179. data/stuff/glyph/arrow-right-arrow-left-svgrepo-com.svg +5 -0
  180. data/stuff/glyph/arrow-right-svgrepo-com.svg +4 -0
  181. data/stuff/glyph/arrow-shape-turn-left-svgrepo-com.svg +4 -0
  182. data/stuff/glyph/arrow-shape-turn-right-svgrepo-com.svg +4 -0
  183. data/stuff/glyph/arrow-small-down-svgrepo-com.svg +4 -0
  184. data/stuff/glyph/arrow-small-left-svgrepo-com.svg +4 -0
  185. data/stuff/glyph/arrow-small-right-svgrepo-com.svg +4 -0
  186. data/stuff/glyph/arrow-small-up-svgrepo-com.svg +4 -0
  187. data/stuff/glyph/arrow-thin-down-svgrepo-com.svg +4 -0
  188. data/stuff/glyph/arrow-thin-left-svgrepo-com.svg +4 -0
  189. data/stuff/glyph/arrow-thin-right-svgrepo-com.svg +4 -0
  190. data/stuff/glyph/arrow-thin-up-svgrepo-com.svg +4 -0
  191. data/stuff/glyph/arrow-to-line-down-svgrepo-com.svg +5 -0
  192. data/stuff/glyph/arrow-to-line-left-svgrepo-com.svg +5 -0
  193. data/stuff/glyph/arrow-to-line-right-svgrepo-com.svg +5 -0
  194. data/stuff/glyph/arrow-to-line-up-svgrepo-com.svg +5 -0
  195. data/stuff/glyph/arrow-to-shape-down-svgrepo-com.svg +5 -0
  196. data/stuff/glyph/arrow-to-shape-right-svgrepo-com.svg +5 -0
  197. data/stuff/glyph/arrow-trend-down-svgrepo-com.svg +12 -0
  198. data/stuff/glyph/arrow-trend-up-svgrepo-com.svg +12 -0
  199. data/stuff/glyph/arrow-turn-down-left-svgrepo-com.svg +4 -0
  200. data/stuff/glyph/arrow-turn-down-right-svgrepo-com.svg +4 -0
  201. data/stuff/glyph/arrow-turn-left-down-svgrepo-com.svg +4 -0
  202. data/stuff/glyph/arrow-turn-left-up-svgrepo-com.svg +4 -0
  203. data/stuff/glyph/arrow-turn-right-down-svgrepo-com.svg +4 -0
  204. data/stuff/glyph/arrow-turn-right-up-svgrepo-com.svg +4 -0
  205. data/stuff/glyph/arrow-turn-up-left-svgrepo-com.svg +4 -0
  206. data/stuff/glyph/arrow-turn-up-right-svgrepo-com.svg +4 -0
  207. data/stuff/glyph/arrow-up-arrow-down-svgrepo-com.svg +5 -0
  208. data/stuff/glyph/arrow-up-svgrepo-com.svg +4 -0
  209. data/stuff/glyph/at-sign-svgrepo-com.svg +4 -0
  210. data/stuff/glyph/bag-svgrepo-com.svg +4 -0
  211. data/stuff/glyph/bell-slash-svgrepo-com.svg +6 -0
  212. data/stuff/glyph/bell-svgrepo-com.svg +5 -0
  213. data/stuff/glyph/book-open-svgrepo-com.svg +5 -0
  214. data/stuff/glyph/bookmark-svgrepo-com.svg +4 -0
  215. data/stuff/glyph/box-svgrepo-com.svg +6 -0
  216. data/stuff/glyph/calendar-svgrepo-com.svg +5 -0
  217. data/stuff/glyph/camera-svgrepo-com.svg +4 -0
  218. data/stuff/glyph/caret-down-svgrepo-com.svg +4 -0
  219. data/stuff/glyph/caret-left-svgrepo-com.svg +4 -0
  220. data/stuff/glyph/caret-right-svgrepo-com.svg +4 -0
  221. data/stuff/glyph/caret-up-svgrepo-com.svg +4 -0
  222. data/stuff/glyph/cart-svgrepo-com.svg +6 -0
  223. data/stuff/glyph/chart-pie-svgrepo-com.svg +5 -0
  224. data/stuff/glyph/chartbar-2-svgrepo-com.svg +7 -0
  225. data/stuff/glyph/chartbar-svgrepo-com.svg +7 -0
  226. data/stuff/glyph/checkmark-circle-svgrepo-com.svg +4 -0
  227. data/stuff/glyph/checkmark-double-svgrepo-com.svg +5 -0
  228. data/stuff/glyph/checkmark-square-svgrepo-com.svg +4 -0
  229. data/stuff/glyph/checkmark-svgrepo-com.svg +4 -0
  230. data/stuff/glyph/chevron-down-svgrepo-com.svg +4 -0
  231. data/stuff/glyph/chevron-left-chevron-right-svgrepo-com.svg +5 -0
  232. data/stuff/glyph/chevron-left-svgrepo-com.svg +4 -0
  233. data/stuff/glyph/chevron-right-svgrepo-com.svg +4 -0
  234. data/stuff/glyph/chevron-small-down-svgrepo-com.svg +4 -0
  235. data/stuff/glyph/chevron-small-left-svgrepo-com.svg +4 -0
  236. data/stuff/glyph/chevron-small-right-svgrepo-com.svg +4 -0
  237. data/stuff/glyph/chevron-small-up-svgrepo-com.svg +4 -0
  238. data/stuff/glyph/chevron-up-chevron-down-svgrepo-com.svg +5 -0
  239. data/stuff/glyph/chevron-up-svgrepo-com.svg +4 -0
  240. data/stuff/glyph/clock-svgrepo-com.svg +4 -0
  241. data/stuff/glyph/cloud-arrow-up-svgrepo-com.svg +4 -0
  242. data/stuff/glyph/cloud-download-svgrepo-com.svg +4 -0
  243. data/stuff/glyph/cloud-slash-svgrepo-com.svg +5 -0
  244. data/stuff/glyph/cloud-svgrepo-com.svg +4 -0
  245. data/stuff/glyph/columns-svgrepo-com.svg +5 -0
  246. data/stuff/glyph/command-svgrepo-com.svg +4 -0
  247. data/stuff/glyph/compass-svgrepo-com.svg +5 -0
  248. data/stuff/glyph/credit-card-svgrepo-com.svg +5 -0
  249. data/stuff/glyph/crop-svgrepo-com.svg +5 -0
  250. data/stuff/glyph/crown-svgrepo-com.svg +4 -0
  251. data/stuff/glyph/delete-left-svgrepo-com.svg +4 -0
  252. data/stuff/glyph/device-desktop-svgrepo-com.svg +4 -0
  253. data/stuff/glyph/device-mobile-svgrepo-com.svg +4 -0
  254. data/stuff/glyph/device-tablet-svgrepo-com.svg +4 -0
  255. data/stuff/glyph/doc-svgrepo-com.svg +5 -0
  256. data/stuff/glyph/dot-small-svgrepo-com.svg +4 -0
  257. data/stuff/glyph/dots-3-horizontal-svgrepo-com.svg +6 -0
  258. data/stuff/glyph/dots-3-vertical-svgrepo-com.svg +6 -0
  259. data/stuff/glyph/dots-6-horizontal-svgrepo-com.svg +9 -0
  260. data/stuff/glyph/dots-6-vertical-svgrepo-com.svg +9 -0
  261. data/stuff/glyph/dots-9-svgrepo-com.svg +12 -0
  262. data/stuff/glyph/emoji-frown-svgrepo-com.svg +4 -0
  263. data/stuff/glyph/emoji-meh-svgrepo-com.svg +4 -0
  264. data/stuff/glyph/emoji-smile-svgrepo-com.svg +4 -0
  265. data/stuff/glyph/envelope-svgrepo-com.svg +5 -0
  266. data/stuff/glyph/external-link-svgrepo-com.svg +5 -0
  267. data/stuff/glyph/eye-slash-svgrepo-com.svg +15 -0
  268. data/stuff/glyph/eye-svgrepo-com.svg +4 -0
  269. data/stuff/glyph/filter-svgrepo-com.svg +4 -0
  270. data/stuff/glyph/flame-svgrepo-com.svg +4 -0
  271. data/stuff/glyph/floppy-disk-svgrepo-com.svg +4 -0
  272. data/stuff/glyph/folder-svgrepo-com.svg +4 -0
  273. data/stuff/glyph/fullscreen-alt-svgrepo-com.svg +7 -0
  274. data/stuff/glyph/fullscreen-exit-alt-svgrepo-com.svg +7 -0
  275. data/stuff/glyph/fullscreen-exit-svgrepo-com.svg +5 -0
  276. data/stuff/glyph/fullscreen-svgrepo-com.svg +5 -0
  277. data/stuff/glyph/gear-svgrepo-com.svg +4 -0
  278. data/stuff/glyph/giftbox-svgrepo-com.svg +6 -0
  279. data/stuff/glyph/half-star-svgrepo-com.svg +4 -0
  280. data/stuff/glyph/hashtag-svgrepo-com.svg +4 -0
  281. data/stuff/glyph/headphones-svgrepo-com.svg +4 -0
  282. data/stuff/glyph/heart-half-svgrepo-com.svg +4 -0
  283. data/stuff/glyph/heart-svgrepo-com.svg +4 -0
  284. data/stuff/glyph/house-svgrepo-com.svg +4 -0
  285. data/stuff/glyph/image-svgrepo-com.svg +4 -0
  286. data/stuff/glyph/info-circle-svgrepo-com.svg +4 -0
  287. data/stuff/glyph/key-svgrepo-com.svg +4 -0
  288. data/stuff/glyph/layers-3-svgrepo-com.svg +6 -0
  289. data/stuff/glyph/layout-svgrepo-com.svg +6 -0
  290. data/stuff/glyph/line-3-svgrepo-com.svg +6 -0
  291. data/stuff/glyph/link-alt-svgrepo-com.svg +5 -0
  292. data/stuff/glyph/link-svgrepo-com.svg +6 -0
  293. data/stuff/glyph/list-bullet-svgrepo-com.svg +9 -0
  294. data/stuff/glyph/location-svgrepo-com.svg +4 -0
  295. data/stuff/glyph/lock-open-svgrepo-com.svg +4 -0
  296. data/stuff/glyph/lock-svgrepo-com.svg +4 -0
  297. data/stuff/glyph/map-pin-svgrepo-com.svg +4 -0
  298. data/stuff/glyph/medal-svgrepo-com.svg +13 -0
  299. data/stuff/glyph/media-backward-end-svgrepo-com.svg +5 -0
  300. data/stuff/glyph/media-backward-svgrepo-com.svg +5 -0
  301. data/stuff/glyph/media-forward-end-svgrepo-com.svg +5 -0
  302. data/stuff/glyph/media-forward-svgrepo-com.svg +4 -0
  303. data/stuff/glyph/media-pause-circle-svgrepo-com.svg +4 -0
  304. data/stuff/glyph/media-pause-svgrepo-com.svg +5 -0
  305. data/stuff/glyph/media-play-circle-svgrepo-com.svg +4 -0
  306. data/stuff/glyph/media-play-svgrepo-com.svg +4 -0
  307. data/stuff/glyph/media-stop-circle-svgrepo-com.svg +4 -0
  308. data/stuff/glyph/media-stop-svgrepo-com.svg +4 -0
  309. data/stuff/glyph/message-bubble-2-svgrepo-com.svg +4 -0
  310. data/stuff/glyph/message-bubble-svgrepo-com.svg +4 -0
  311. data/stuff/glyph/mic-slash-svgrepo-com.svg +6 -0
  312. data/stuff/glyph/mic-svgrepo-com.svg +5 -0
  313. data/stuff/glyph/minus-circle-svgrepo-com.svg +4 -0
  314. data/stuff/glyph/minus-square-svgrepo-com.svg +4 -0
  315. data/stuff/glyph/minus-svgrepo-com.svg +4 -0
  316. data/stuff/glyph/moon-svgrepo-com.svg +4 -0
  317. data/stuff/glyph/music-note-svgrepo-com.svg +4 -0
  318. data/stuff/glyph/nosign-svgrepo-com.svg +4 -0
  319. data/stuff/glyph/paper-clip-svgrepo-com.svg +4 -0
  320. data/stuff/glyph/paper-plane-svgrepo-com.svg +4 -0
  321. data/stuff/glyph/pen-tool-svgrepo-com.svg +4 -0
  322. data/stuff/glyph/pencil-svgrepo-com.svg +5 -0
  323. data/stuff/glyph/percent-svgrepo-com.svg +6 -0
  324. data/stuff/glyph/phone-incoming-svgrepo-com.svg +5 -0
  325. data/stuff/glyph/phone-missed-svgrepo-com.svg +4 -0
  326. data/stuff/glyph/phone-outgoing-svgrepo-com.svg +5 -0
  327. data/stuff/glyph/phone-slash-svgrepo-com.svg +4 -0
  328. data/stuff/glyph/phone-svgrepo-com.svg +4 -0
  329. data/stuff/glyph/plus-circle-svgrepo-com.svg +4 -0
  330. data/stuff/glyph/plus-square-svgrepo-com.svg +4 -0
  331. data/stuff/glyph/plus-svgrepo-com.svg +4 -0
  332. data/stuff/glyph/power-svgrepo-com.svg +5 -0
  333. data/stuff/glyph/printer-svgrepo-com.svg +5 -0
  334. data/stuff/glyph/question-circle-svgrepo-com.svg +4 -0
  335. data/stuff/glyph/scissors-svgrepo-com.svg +5 -0
  336. data/stuff/glyph/search-svgrepo-com.svg +4 -0
  337. data/stuff/glyph/server-svgrepo-com.svg +5 -0
  338. data/stuff/glyph/shape-circle-svgrepo-com.svg +4 -0
  339. data/stuff/glyph/shape-rhombus-svgrepo-com.svg +4 -0
  340. data/stuff/glyph/shape-square-svgrepo-com.svg +4 -0
  341. data/stuff/glyph/shape-triangle-svgrepo-com.svg +12 -0
  342. data/stuff/glyph/share-svgrepo-com.svg +4 -0
  343. data/stuff/glyph/shield-slash-svgrepo-com.svg +13 -0
  344. data/stuff/glyph/shield-svgrepo-com.svg +4 -0
  345. data/stuff/glyph/shippingbox-svgrepo-com.svg +7 -0
  346. data/stuff/glyph/slider-3-horizontal-svgrepo-com.svg +9 -0
  347. data/stuff/glyph/slider-3-vertical-svgrepo-com.svg +9 -0
  348. data/stuff/glyph/speaker-svgrepo-com.svg +4 -0
  349. data/stuff/glyph/speaker-wave-1-svgrepo-com.svg +5 -0
  350. data/stuff/glyph/speaker-wave-2-svgrepo-com.svg +6 -0
  351. data/stuff/glyph/speaker-xmark-svgrepo-com.svg +5 -0
  352. data/stuff/glyph/square-4-grid-svgrepo-com.svg +7 -0
  353. data/stuff/glyph/square-on-square-svgrepo-com.svg +5 -0
  354. data/stuff/glyph/star-svgrepo-com.svg +4 -0
  355. data/stuff/glyph/sun-svgrepo-com.svg +12 -0
  356. data/stuff/glyph/tag-svgrepo-com.svg +4 -0
  357. data/stuff/glyph/text-align-center-svgrepo-com.svg +7 -0
  358. data/stuff/glyph/text-align-justify-svgrepo-com.svg +7 -0
  359. data/stuff/glyph/text-align-left-svgrepo-com.svg +7 -0
  360. data/stuff/glyph/text-align-right-svgrepo-com.svg +7 -0
  361. data/stuff/glyph/text-bold-svgrepo-com.svg +4 -0
  362. data/stuff/glyph/text-heading-svgrepo-com.svg +4 -0
  363. data/stuff/glyph/text-italic-svgrepo-com.svg +4 -0
  364. data/stuff/glyph/text-svgrepo-com.svg +4 -0
  365. data/stuff/glyph/text-underline-svgrepo-com.svg +5 -0
  366. data/stuff/glyph/thumbs-down-svgrepo-com.svg +5 -0
  367. data/stuff/glyph/thumbs-up-svgrepo-com.svg +5 -0
  368. data/stuff/glyph/trash-svgrepo-com.svg +5 -0
  369. data/stuff/glyph/tray-svgrepo-com.svg +4 -0
  370. data/stuff/glyph/umbrela-svgrepo-com.svg +4 -0
  371. data/stuff/glyph/user-svgrepo-com.svg +5 -0
  372. data/stuff/glyph/users-svgrepo-com.svg +7 -0
  373. data/stuff/glyph/video-svgrepo-com.svg +12 -0
  374. data/stuff/glyph/waveform-ecg-svgrepo-com.svg +4 -0
  375. data/stuff/glyph/wi-fi-svgrepo-com.svg +7 -0
  376. data/stuff/glyph/xmark-circle-svgrepo-com.svg +4 -0
  377. data/stuff/glyph/xmark-small-svgrepo-com.svg +4 -0
  378. data/stuff/glyph/xmark-svgrepo-com.svg +4 -0
  379. data/stuff/glyph/zap-svgrepo-com.svg +4 -0
  380. data/stuff/glyph/zoom-in-svgrepo-com.svg +5 -0
  381. data/stuff/glyph/zoom-out-svgrepo-com.svg +5 -0
  382. data/stuff/readme.md +266 -0
  383. data/stuff/so/libSDL3.so +0 -0
  384. data/stuff/so/libpastele.so +0 -0
  385. data/stuff/so/libthorvg-1.so +0 -0
  386. metadata +427 -0
@@ -0,0 +1,88 @@
1
+ module Kredki
2
+ module Pads
3
+ # Module to include in layout class.
4
+ module Layout
5
+
6
+ # :section: LEVEL 2
7
+
8
+ def initialize x, y
9
+ @x = x
10
+ @y = y
11
+ end
12
+
13
+ def get_p cr, pc, sc
14
+ case cr
15
+ when Start
16
+ 0
17
+ when Center
18
+ (pc - sc) * 0.5
19
+ when End
20
+ pc - sc
21
+ when Rational
22
+ cr * pc - sc * 0.5
23
+ when Proc
24
+ cr[pc, sc]
25
+ when Numeric
26
+ cr
27
+ else raise_ia cr
28
+ end
29
+ end
30
+
31
+ def get_x cr, pc, sc
32
+ get_p cr, pc, sc
33
+ end
34
+
35
+ def get_y cr, pc, sc
36
+ get_p cr, pc, sc
37
+ end
38
+
39
+ def arrange pad
40
+ csx = pad.clip_size_x
41
+ csy = pad.clip_size_y
42
+
43
+ lsx = lsy = 0
44
+ lx = csx
45
+ ly = csy
46
+
47
+ pad.arranged_pads.each do |p1|
48
+ psy = p1.get_size_y csy
49
+ psx = p1.get_size_x csx, psy
50
+ p1.update_size psx, psy
51
+ px = p1.get_x csx, psx, (get_x @x, csx, psx)
52
+ py = p1.get_y csy, psy, (get_y @y, csy, psy)
53
+ p1.update_xy px, py
54
+ p1.update_margin
55
+ p1.arrange
56
+ if p1.layoutic
57
+ lx = [lx, px].min
58
+ ly = [ly, py].min
59
+ lsx = [lsx, psx].max
60
+ lsy = [lsy, psy].max
61
+ end
62
+ end
63
+
64
+ [lx, ly, lsx, lsy]
65
+ end
66
+
67
+ def fit_size_x pad
68
+ pad.pads_layoutic.map{|p1| p1.min_size_x }.max || 0
69
+ end
70
+
71
+ def fit_size_y pad
72
+ pad.pads_layoutic.map{|p1| p1.min_size_y }.max || 0
73
+ end
74
+
75
+ def get_size_x_rational p0, p0w, p1, r
76
+ r * p0w
77
+ end
78
+
79
+ def get_size_y_rational p0, p0h, p1, r
80
+ r * p0h
81
+ end
82
+ end#Layout
83
+ end#Pads
84
+ end#Kredki
85
+
86
+ require_relative "align"
87
+ require_relative "x_way"
88
+ require_relative "y_way"
@@ -0,0 +1,99 @@
1
+ module Kredki
2
+ module Pads
3
+ module Layout
4
+ # A layout in which elements are positioned one next to another.
5
+ class Way
6
+ include Layout
7
+
8
+ # :section: LEVEL 2
9
+
10
+ def spans sp, pd, space
11
+ ad = 0
12
+ sd = 0
13
+ total_span = 0
14
+ sp.each do |span|
15
+ sd += span[1] if span[0] == 0
16
+ ad += span[1]
17
+ total_span += span[0]
18
+ end
19
+ return [[], 0] if sp.empty?
20
+ total_space = space * (sp.size - 1)
21
+ sd += total_space
22
+
23
+ rd = pd - sd
24
+ if total_span > 0 && rd > 0
25
+ nd = rd / total_span
26
+ rd = 0
27
+ sp.each do |span|
28
+ if span[0] > 0
29
+ od = nd * span[0]
30
+ if od > span[2]
31
+ span[3] = span[2]
32
+ rd += od - span[2]
33
+ elsif od < span[1]
34
+ span[3] = span[1]
35
+ rd += od - span[1]
36
+ else
37
+ span[3] = od
38
+ end
39
+ end
40
+ end
41
+
42
+ loop do
43
+ if rd > 0
44
+ total_span = sp.map{|it| it[3] < it[2] ? it[0] : 0 }.sum
45
+ break if total_span == 0
46
+ nd = rd / total_span
47
+ rd = 0
48
+ sp.each do |span|
49
+ if span[3] < span[2]
50
+ od = nd * span[0] + span[3]
51
+ if od > span[2]
52
+ span[3] = span[2]
53
+ rd += od - span[2]
54
+ else
55
+ span[3] = od
56
+ end
57
+ end
58
+ end
59
+ elsif rd < 0
60
+ total_span = sp.map{|it| it[3] > it[1] ? it[0] : 0 }.sum
61
+ break if total_span == 0
62
+ nd = rd / total_span
63
+ rd = 0
64
+ sp.each do |span|
65
+ if span[3] > span[1]
66
+ od = nd * span[0] + span[3]
67
+ if od < span[1]
68
+ span[3] = span[1]
69
+ rd += od - span[1]
70
+ else
71
+ span[3] = od
72
+ end
73
+ end
74
+ end
75
+ else
76
+ break
77
+ end
78
+ end
79
+
80
+ return [m = sp.map{|it| it[3] }, m.sum + total_space]
81
+ end
82
+ [sp.map{|it| it[3] }, ad + total_space]
83
+ end
84
+
85
+ def arrange_non_layoutic pad, csx, csy
86
+ psx = pad.get_size_x csx
87
+ psy = pad.get_size_y csy
88
+ pad.update_size psx, psy
89
+ px = pad.get_x csx, psx, (get_x @x, csx, psx)
90
+ py = pad.get_y csy, psy, (get_y @y, csy, psy)
91
+ pad.update_xy px, py
92
+ pad.update_margin
93
+ pad.arrange
94
+ end
95
+
96
+ end#Way
97
+ end#Layout
98
+ end#Pads
99
+ end#Kredki
@@ -0,0 +1,119 @@
1
+ require_relative 'way'
2
+
3
+ module Kredki
4
+ module Pads
5
+ module Layout
6
+ # A layout in which elements are positioned one next to another, along the X axis.
7
+ class XWay < Way
8
+
9
+ # :section: LEVEL 2
10
+
11
+ def get_span pad, size_x, limit, lower_clip_size_x
12
+ case size_x
13
+ when Rational
14
+ case limit
15
+ when nil
16
+ [size_x, 0, Float::INFINITY, 0]
17
+ when Range
18
+ sxv = limit.begin&.then{|it| pad.get_size_x_value it, lower_clip_size_x, nil } || 0
19
+ limit_sxv = limit.end&.then{|it| pad.get_size_x_value it, lower_clip_size_x, nil } || Float::INFINITY
20
+ [size_x, sxv, limit_sxv, sxv]
21
+ else
22
+ limit_sxv = pad.get_size_x_value limit, lower_clip_size_x, nil
23
+ [size_x, 0, limit_sxv, 0]
24
+ end
25
+ when Auto
26
+ case limit
27
+ when nil
28
+ [1r, 0, Float::INFINITY, 0]
29
+ when Range
30
+ sxv = limit.begin&.then{|it| pad.get_size_x_value it, lower_clip_size_x, nil } || 0
31
+ limit_sxv = limit.end&.then{|it| pad.get_size_x_value it, lower_clip_size_x, nil } || Float::INFINITY
32
+ [1r, sxv, limit_sxv, sxv]
33
+ else
34
+ limit_sxv = pad.get_size_x_value limit, lower_clip_size_x, nil
35
+ [1r, 0, limit_sxv, 0]
36
+ end
37
+ else
38
+ sxv = pad.get_size_x_limited size_x, limit, lower_clip_size_x
39
+ [0, sxv, sxv, sxv]
40
+ end
41
+ end
42
+
43
+ def arrange pad
44
+ csx, csy = pad.clip_size
45
+ sp = pad.pads_layoutic.map{|it| get_span it, it.size_x, it.size_x_limit, csx }
46
+ measurement, sx = spans sp, csx, pad.spacer || 0
47
+
48
+ pad.pads_layoutic.zip measurement do |p1, m|
49
+ psy = p1.get_size_y csy, m
50
+ p1.update_size m, psy
51
+ end
52
+
53
+ arrange_pads pad.arranged_pads, sx, csx, csy, pad.spacer || 0
54
+ end
55
+
56
+ def arrange_pads pads, sx, csx, csy, spacer
57
+ cx = case @x
58
+ when Start
59
+ 0
60
+ when Center
61
+ (csx - sx) * 0.5
62
+ when End
63
+ csx - sx
64
+ when Rational
65
+ csx * @x
66
+ when Proc
67
+ @x[csx, sx]
68
+ when Numeric
69
+ @x
70
+ else raise_ia @x
71
+ end
72
+ lx = lxm = ly = lym = 0
73
+
74
+ pads.each do |p1|
75
+ if p1.layoutic
76
+ psx, psy, px, py = arrange_layoutic p1, csx, csy, cx
77
+ cx += psx + spacer
78
+ lx = [lx, px].min
79
+ ly = [ly, py].min
80
+ lxm = [lxm, px + psx].max
81
+ lym = [lym, py + psy].max
82
+ else
83
+ arrange_non_layoutic p1, csx, csy
84
+ end
85
+ end
86
+
87
+ [lx, ly, lxm - lx, lym - ly]
88
+ end
89
+
90
+ def arrange_layoutic pad, csx, csy, cx
91
+ psx, psy = pad.area_size
92
+ px = pad.get_x csx, psx, cx
93
+ py = pad.get_y csy, psy, (get_y @y, csy, psy)
94
+ pad.update_xy px, py
95
+ pad.update_margin
96
+ pad.arrange
97
+ [psx, psy, px, py]
98
+ end
99
+
100
+ def fit_size_x pad
101
+ spacer = pad.spacer || 0
102
+ pad.pads_layoutic.map{|p1| p1.min_size_x }.reduce{ _1 + spacer + _2 } || 0
103
+ end
104
+
105
+ def get_size_x_rational p0, psx, p1, r
106
+ index = p0.pads_layoutic.find_index{|it| it == p1 }
107
+ if index
108
+ sp = p0.pads_layoutic.map{|it| get_span it, it.size_x, it.size_x_limit, psx }
109
+ measurement, sx = spans sp, psx, p0.spacer || 0
110
+ measurement[index]
111
+ else
112
+ r * psx
113
+ end
114
+ end
115
+
116
+ end#XWay
117
+ end#Layout
118
+ end#Pads
119
+ end#Kredki
@@ -0,0 +1,120 @@
1
+ require_relative 'way'
2
+
3
+ module Kredki
4
+ module Pads
5
+ module Layout
6
+ # A layout in which elements are positioned one next to another, along the Y axis.
7
+ class YWay < Way
8
+
9
+ # :section: LEVEL 2
10
+
11
+ def get_span pad, size_y, limit, lower_clip_size_y
12
+ case size_y
13
+ when Rational
14
+ case limit
15
+ when nil
16
+ [size_y, 0, Float::INFINITY, 0]
17
+ when Range
18
+ syv = limit.begin&.then{|it| pad.get_size_y_value it, lower_clip_size_y, nil } || 0
19
+ limit_syv = limit.end&.then{|it| pad.get_size_y_value it, lower_clip_size_y, nil } || Float::INFINITY
20
+ [size_y, syv, limit_syv, syv]
21
+ else
22
+ limit_syv = pad.get_size_y_value limit, lower_clip_size_y, nil
23
+ [size_y, 0, limit_syv, 0]
24
+ end
25
+ when Auto
26
+ case limit
27
+ when nil
28
+ [1r, 0, Float::INFINITY, 0]
29
+ when Range
30
+ syv = limit.begin&.then{|it| pad.get_size_y_value it, lower_clip_size_y, nil } || 0
31
+ limit_syv = limit.end&.then{|it| pad.get_size_y_value it, lower_clip_size_y, nil } || Float::INFINITY
32
+ [1r, syv, limit_syv, syv]
33
+ else
34
+ limit_syv = pad.get_size_y_value limit, lower_clip_size_y, nil
35
+ [1r, 0, limit_syv, 0]
36
+ end
37
+ else
38
+ syv = pad.get_size_y_limited size_y, limit, lower_clip_size_y
39
+ [0, syv, syv, syv]
40
+ end
41
+ end
42
+
43
+ def arrange pad
44
+ csx, csy = pad.clip_size
45
+ sp = pad.pads_layoutic.map{|it| get_span it, it.size_y, it.size_y_limit, csy }
46
+ measurement, sy = spans sp, csy, pad.spacer || 0
47
+
48
+ pad.pads_layoutic.zip measurement do |p1, measured|
49
+ psx = p1.get_size_x csx, measured
50
+ p1.update_size psx, measured
51
+ end
52
+
53
+ arrange_pads pad.arranged_pads, sy, csx, csy, pad.spacer || 0
54
+ end
55
+
56
+ def arrange_pads pads, sy, csx, csy, spacer
57
+ cy = case @y
58
+ when Start
59
+ 0
60
+ when Center
61
+ (csy - sy) * 0.5
62
+ when End
63
+ csy - sy
64
+ when Rational
65
+ csy * @y
66
+ when Proc
67
+ @y[csy, sy]
68
+ when Numeric
69
+ @y
70
+ else raise_is @y
71
+ end
72
+
73
+ lx = lxm = ly = lym = 0
74
+
75
+ pads.each do |p1|
76
+ if p1.layoutic
77
+ psx, psy, px, py = arrange_layoutic p1, csx, csy, cy
78
+ cy += psy + spacer
79
+ lx = [lx, px].min
80
+ ly = [ly, py].min
81
+ lxm = [lxm, px + psx].max
82
+ lym = [lym, py + psy].max
83
+ else
84
+ arrange_non_layoutic p1, csx, csy
85
+ end
86
+ end
87
+
88
+ [lx, ly, lxm - lx, lym - ly]
89
+ end
90
+
91
+ def arrange_layoutic pad, csx, csy, cy
92
+ asx, asy = pad.area_size
93
+ px = pad.get_x csx, asx, (get_x @x, csx, asx)
94
+ py = pad.get_y csy, asy, cy
95
+ pad.update_xy px, py
96
+ pad.update_margin
97
+ pad.arrange
98
+ [asx, asy, px, py]
99
+ end
100
+
101
+ def fit_size_y pad
102
+ spacer = pad.spacer || 0
103
+ pad.pads_layoutic.map{|p1| p1.min_size_y }.reduce{ _1 + spacer + _2 } || 0
104
+ end
105
+
106
+ def get_size_y_rational p0, psy, p1, r
107
+ index = p0.pads_layoutic.find_index{|it| it == p1 }
108
+ if index
109
+ sp = p0.pads_layoutic.map{|it| get_span it, it.size_y, it.size_y_limit, psy }
110
+ measurement, sy = spans sp, psy, p0.spacer || 0
111
+ measurement[index]
112
+ else
113
+ r * psy
114
+ end
115
+ end
116
+
117
+ end#YWay
118
+ end#Layout
119
+ end#Pads
120
+ end#Kredki
@@ -0,0 +1,117 @@
1
+ module Kredki
2
+ module Pads
3
+ module List
4
+ # List item model.
5
+ class Item < ItemY
6
+
7
+ # Set whether is selected.
8
+ def set_selected value = true, &block
9
+ return if (c = selected) == (value = block ? block[c] : value == Not ? !c : value)
10
+ @selected = value
11
+ repaint
12
+ true
13
+ end
14
+
15
+ # See #set_selected.
16
+ def selected= param
17
+ send_bundle :set_selected, param
18
+ end
19
+
20
+ # Get whether is selected.
21
+ def selected
22
+ @selected
23
+ end
24
+
25
+ # Set suit.
26
+ def set_suit *suit
27
+ return send_bundle :set_suit, yield(self.suit) if block_given?
28
+ suit = Util.uncover suit
29
+ return if @suit == suit && suit != :random
30
+ @suit = suit
31
+ repaint
32
+ true
33
+ end
34
+
35
+ # See #set_suit.
36
+ def suit= param
37
+ send_bundle :set_suit, param
38
+ end
39
+
40
+ # Get suit.
41
+ def suit
42
+ @suit
43
+ end
44
+
45
+ # :section: LEVEL 2
46
+
47
+ def presence
48
+ super
49
+
50
+ Event.each(
51
+ on_focus_enter,
52
+ on_focus_leave,
53
+ on_mouse_press,
54
+ on_mouse_release,
55
+ on_mouse_enter,
56
+ on_mouse_leave,
57
+ do: method(:repaint)
58
+ )
59
+ end
60
+
61
+ def repaint event = nil
62
+ color = Kredki.color @suit
63
+
64
+ if in_disabled
65
+ set_opacity 3/4r
66
+ area.set_fill color
67
+ area.set_stroke_width 0
68
+ area.set_stroke_fill color
69
+ else
70
+ set_opacity 1r
71
+ area.set_fill selected ? mouse_in ? Kredki.color(:text_selection).lighten : :text_selection : mouse_in ? color.lighten : color
72
+ if keyboard_in
73
+ area.set_stroke_width 1
74
+ area.set_stroke_fill :stroke_focus
75
+ else
76
+ area.set_stroke_width 0
77
+ area.set_stroke_fill color
78
+ end
79
+ end
80
+ end
81
+
82
+ def behavior
83
+ super
84
+
85
+ on_key_press :up do |e|
86
+ set_selected if e.shift?
87
+ item = lower.focus_previous
88
+ if item
89
+ item.set_selected if e.shift?
90
+ item.request_vision
91
+ end
92
+ e.close
93
+ end
94
+
95
+ on_key_press :down do |e|
96
+ set_selected if e.shift?
97
+ item = lower.focus_next
98
+ if item
99
+ item.set_selected if e.shift?
100
+ item.request_vision
101
+ end
102
+ e.close
103
+ end
104
+ end
105
+
106
+ def mouse_enter e
107
+ end
108
+
109
+ def mouse_press e
110
+ lower.select_up_to self if Kredki.keyboard.match shift: true
111
+ super
112
+ end
113
+
114
+ end#Item
115
+ end#List
116
+ end#Pads
117
+ end#Kredki
@@ -0,0 +1,36 @@
1
+ module Kredki
2
+ module Pads
3
+ module List
4
+ # Group of list items.
5
+ class ItemGroup < Pads::ItemGroup
6
+
7
+ # Add new item.
8
+ def item!(...)
9
+ put(Item, __method__, ...)
10
+ end
11
+
12
+ # Get all items.
13
+ def items
14
+ each_upper(Item).to_a
15
+ end
16
+
17
+ # Get selected items.
18
+ def selected_items
19
+ each_upper(Item, selected: true).to_a
20
+ end
21
+
22
+ # :section: LEVEL 2
23
+
24
+ def select_up_to pad
25
+ bound = 0
26
+ each_upper(Item).each do |it|
27
+ bound += 1 if it == pad
28
+ bound += 1 if it.keyboard_in
29
+ it.set_selected if bound > 0
30
+ break if bound > 1
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,74 @@
1
+ require_relative 'item_group'
2
+ require_relative 'item'
3
+
4
+ module Kredki
5
+ module Pads
6
+ module List
7
+ class Pad < RectanglePad
8
+
9
+ # Add new item.
10
+ def item! *a, **ka, &b
11
+ @item_group.item! *a, size_x: 1r, **ka, &b
12
+ end
13
+
14
+ # Create and attach select event reaction.
15
+ def on_select ...
16
+ on(Item::SelectEvent, ...)
17
+ end
18
+
19
+ # See #on_select.
20
+ def on_select= param
21
+ on_select do: param
22
+ end
23
+
24
+ # Get all items.
25
+ def items
26
+ @item_group.items
27
+ end
28
+
29
+ # Get selected items.
30
+ def selected_items
31
+ @item_group.selected_items
32
+ end
33
+
34
+ # :section: LEVEL 2
35
+
36
+ def initialize
37
+ super
38
+
39
+ @item_group = put ItemGroup
40
+ end
41
+
42
+ def sketch
43
+ super
44
+
45
+ set_keyboardy true
46
+ set_fill :gray
47
+ set_layout :yss
48
+ set_size_y Fit
49
+ end
50
+
51
+ def behavior
52
+ super
53
+
54
+ on Item::SelectEvent do |e|
55
+ item = e.target
56
+ kb = Kredki.keyboard
57
+ if kb.shift?
58
+ item.set_selected
59
+ elsif kb.ctrl?
60
+ item.set_selected Not
61
+ else
62
+ each_upper(Item).each{|it| it.set_selected it == item }
63
+ end
64
+ end
65
+
66
+ on_focus_leave do
67
+ each_upper(Item).each_set selected: false
68
+ end
69
+ end
70
+
71
+ end#Pad
72
+ end#List
73
+ end#Pads
74
+ end#Kredki