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.
- checksums.yaml +7 -0
- data/lib/kredki/core/application.rb +314 -0
- data/lib/kredki/core/color.rb +100 -0
- data/lib/kredki/core/event/block_event_reaction.rb +44 -0
- data/lib/kredki/core/event/composite_event_manager.rb +37 -0
- data/lib/kredki/core/event/event.rb +91 -0
- data/lib/kredki/core/event/event_manager.rb +60 -0
- data/lib/kredki/core/event/event_manager_jobs.rb +53 -0
- data/lib/kredki/core/event/event_reaction.rb +36 -0
- data/lib/kredki/core/event/family/drop_event.rb +40 -0
- data/lib/kredki/core/event/family/exit_event.rb +5 -0
- data/lib/kredki/core/event/family/focus_enter_event.rb +5 -0
- data/lib/kredki/core/event/family/focus_leave_event.rb +5 -0
- data/lib/kredki/core/event/family/hide_event.rb +5 -0
- data/lib/kredki/core/event/family/joystick_event.rb +102 -0
- data/lib/kredki/core/event/family/key_event.rb +40 -0
- data/lib/kredki/core/event/family/mouse_event.rb +190 -0
- data/lib/kredki/core/event/family/pastele_event.rb +11 -0
- data/lib/kredki/core/event/family/show_event.rb +5 -0
- data/lib/kredki/core/event/family/text_event.rb +23 -0
- data/lib/kredki/core/event/family/tick_event.rb +5 -0
- data/lib/kredki/core/event/family/update_complete_event.rb +5 -0
- data/lib/kredki/core/event/family/window_event.rb +108 -0
- data/lib/kredki/core/event/job_event_reaction.rb +44 -0
- data/lib/kredki/core/event/joystick_event_manager.rb +30 -0
- data/lib/kredki/core/event/keyboard_event_manager.rb +29 -0
- data/lib/kredki/core/event/method_event_reaction.rb +46 -0
- data/lib/kredki/core/event/mouse_event_manager.rb +27 -0
- data/lib/kredki/core/font.rb +53 -0
- data/lib/kredki/core/job/after_job.rb +59 -0
- data/lib/kredki/core/job/job.rb +108 -0
- data/lib/kredki/core/job/loop_job.rb +87 -0
- data/lib/kredki/core/job/play_animation_job.rb +44 -0
- data/lib/kredki/core/job/play_job.rb +41 -0
- data/lib/kredki/core/job/play_loop_animation_job.rb +98 -0
- data/lib/kredki/core/job/play_loop_job.rb +104 -0
- data/lib/kredki/core/job/side_job.rb +62 -0
- data/lib/kredki/core/kernel-path.rb +71 -0
- data/lib/kredki/core/kredki.rb +89 -0
- data/lib/kredki/core/linear_gradient.rb +43 -0
- data/lib/kredki/core/media/clipboard.rb +35 -0
- data/lib/kredki/core/media/joystick.rb +199 -0
- data/lib/kredki/core/media/keyboard.rb +84 -0
- data/lib/kredki/core/media/keyboard_modifiers_decoder.rb +154 -0
- data/lib/kredki/core/media/mouse.rb +197 -0
- data/lib/kredki/core/paint/animation.rb +247 -0
- data/lib/kredki/core/paint/area.rb +67 -0
- data/lib/kredki/core/paint/block_shape_area.rb +102 -0
- data/lib/kredki/core/paint/ellipse.rb +22 -0
- data/lib/kredki/core/paint/paint.rb +392 -0
- data/lib/kredki/core/paint/picture.rb +126 -0
- data/lib/kredki/core/paint/rectangle.rb +202 -0
- data/lib/kredki/core/paint/scene.rb +277 -0
- data/lib/kredki/core/paint/shape.rb +394 -0
- data/lib/kredki/core/paint/shape_area.rb +57 -0
- data/lib/kredki/core/paint/text.rb +222 -0
- data/lib/kredki/core/pastele/pastele-extern.rb +139 -0
- data/lib/kredki/core/pastele/pastele.rb +205 -0
- data/lib/kredki/core/radial_gradient.rb +45 -0
- data/lib/kredki/core/setup.rb +214 -0
- data/lib/kredki/core/window/pane.rb +178 -0
- data/lib/kredki/core/window/pane_event_manager.rb +44 -0
- data/lib/kredki/core/window/pane_events.rb +366 -0
- data/lib/kredki/core/window/window.rb +584 -0
- data/lib/kredki/core.rb +2 -0
- data/lib/kredki/hide.rb +9 -0
- data/lib/kredki/irb.rb +90 -0
- data/lib/kredki/module.rb +3 -0
- data/lib/kredki/pads/application.rb +13 -0
- data/lib/kredki/pads/button.rb +151 -0
- data/lib/kredki/pads/checkbox/checkbox.rb +68 -0
- data/lib/kredki/pads/checkbox/checkbox_button.rb +65 -0
- data/lib/kredki/pads/context/item.rb +65 -0
- data/lib/kredki/pads/context/item_group.rb +10 -0
- data/lib/kredki/pads/context/layer.rb +59 -0
- data/lib/kredki/pads/context/menu.rb +77 -0
- data/lib/kredki/pads/context/pad.rb +26 -0
- data/lib/kredki/pads/context/primary_layer.rb +51 -0
- data/lib/kredki/pads/context/secondary_layer.rb +60 -0
- data/lib/kredki/pads/item/item.rb +140 -0
- data/lib/kredki/pads/item/item_group.rb +44 -0
- data/lib/kredki/pads/item/item_x.rb +22 -0
- data/lib/kredki/pads/item/item_y.rb +31 -0
- data/lib/kredki/pads/label.rb +71 -0
- data/lib/kredki/pads/layer.rb +326 -0
- data/lib/kredki/pads/layout/align.rb +10 -0
- data/lib/kredki/pads/layout/layout.rb +88 -0
- data/lib/kredki/pads/layout/way.rb +99 -0
- data/lib/kredki/pads/layout/x_way.rb +119 -0
- data/lib/kredki/pads/layout/y_way.rb +120 -0
- data/lib/kredki/pads/list/item.rb +117 -0
- data/lib/kredki/pads/list/item_group.rb +36 -0
- data/lib/kredki/pads/list/pad.rb +74 -0
- data/lib/kredki/pads/list/tree/item.rb +138 -0
- data/lib/kredki/pads/list/tree/item_group.rb +86 -0
- data/lib/kredki/pads/list/tree/pad.rb +94 -0
- data/lib/kredki/pads/module.rb +11 -0
- data/lib/kredki/pads/note.rb +212 -0
- data/lib/kredki/pads/notes.rb +32 -0
- data/lib/kredki/pads/option/option.rb +121 -0
- data/lib/kredki/pads/option/option_item.rb +15 -0
- data/lib/kredki/pads/option/option_item_group.rb +16 -0
- data/lib/kredki/pads/option/option_layer.rb +81 -0
- data/lib/kredki/pads/pad/animation_pad.rb +106 -0
- data/lib/kredki/pads/pad/glyph_pad.rb +71 -0
- data/lib/kredki/pads/pad/pad.rb +1290 -0
- data/lib/kredki/pads/pad/pad_events.rb +358 -0
- data/lib/kredki/pads/pad/picture_pad.rb +89 -0
- data/lib/kredki/pads/pad/rectangle_pad.rb +181 -0
- data/lib/kredki/pads/pad/scroll_pad.rb +176 -0
- data/lib/kredki/pads/pad/shape_pad.rb +148 -0
- data/lib/kredki/pads/pad/space_pad.rb +33 -0
- data/lib/kredki/pads/pad/text_pad.rb +310 -0
- data/lib/kredki/pads/pane.rb +267 -0
- data/lib/kredki/pads/portal_layer.rb +94 -0
- data/lib/kredki/pads/radio/group.rb +45 -0
- data/lib/kredki/pads/radio/item.rb +69 -0
- data/lib/kredki/pads/radio/item_button.rb +143 -0
- data/lib/kredki/pads/service/event_queue.rb +79 -0
- data/lib/kredki/pads/service/service.rb +248 -0
- data/lib/kredki/pads/service/service_event_manager.rb +43 -0
- data/lib/kredki/pads/service/service_filter.rb +98 -0
- data/lib/kredki/pads/service/service_inherited.rb +48 -0
- data/lib/kredki/pads/setup.rb +36 -0
- data/lib/kredki/pads/slider/slider.rb +145 -0
- data/lib/kredki/pads/slider/slider_x.rb +41 -0
- data/lib/kredki/pads/slider/slider_y.rb +41 -0
- data/lib/kredki/pads/table/cell.rb +22 -0
- data/lib/kredki/pads/table/column.rb +63 -0
- data/lib/kredki/pads/table/column_layout.rb +88 -0
- data/lib/kredki/pads/table/pad.rb +116 -0
- data/lib/kredki/pads/table/row.rb +24 -0
- data/lib/kredki/pads/table/scroll_rows.rb +50 -0
- data/lib/kredki/pads/text/editable_text_verse.rb +77 -0
- data/lib/kredki/pads/text/editable_text_verses.rb +59 -0
- data/lib/kredki/pads/text/navigable_text_pad.rb +413 -0
- data/lib/kredki/pads/text/text_edition.rb +97 -0
- data/lib/kredki/pads/text/text_navigation.rb +109 -0
- data/lib/kredki/pads/toolbar/item.rb +62 -0
- data/lib/kredki/pads/toolbar/item_group.rb +22 -0
- data/lib/kredki/pads/toolbar/layer.rb +41 -0
- data/lib/kredki/pads/toolbar/pad.rb +51 -0
- data/lib/kredki/pads/toolbar/primary_layer.rb +64 -0
- data/lib/kredki/pads/window.rb +11 -0
- data/lib/kredki/script.rb +29 -0
- data/lib/kredki/setup.rb +2 -0
- data/lib/kredki/test.rb +35 -0
- data/lib/kredki.rb +10 -0
- data/lib/readme.md +31 -0
- data/stuff/config/config.rb +431 -0
- data/stuff/config/pads_config.rb +111 -0
- data/stuff/dll/SDL3.dll +0 -0
- data/stuff/dll/pastele.dll +0 -0
- data/stuff/dll/thorvg-1.dll +0 -0
- data/stuff/font/MartianMono-StdRg.ttf +0 -0
- data/stuff/font/MavenPro-Medium.ttf +0 -0
- data/stuff/font/MavenPro-Regular.ttf +0 -0
- data/stuff/glyph/alert-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/alert-triangle-svgrepo-com.svg +12 -0
- data/stuff/glyph/archivebox-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-2-ccw-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-2-cw-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-2-rectangle-path-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-4-way-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-ccw-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-circle-down-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-circle-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-circle-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-circle-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-cw-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-down-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-from-line-down-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-from-line-left-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-from-line-right-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-from-line-up-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-from-shape-right-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-from-shape-up-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-right-arrow-left-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-shape-turn-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-shape-turn-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-small-down-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-small-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-small-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-small-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-thin-down-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-thin-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-thin-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-thin-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-to-line-down-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-to-line-left-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-to-line-right-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-to-line-up-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-to-shape-down-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-to-shape-right-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-trend-down-svgrepo-com.svg +12 -0
- data/stuff/glyph/arrow-trend-up-svgrepo-com.svg +12 -0
- data/stuff/glyph/arrow-turn-down-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-turn-down-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-turn-left-down-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-turn-left-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-turn-right-down-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-turn-right-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-turn-up-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-turn-up-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/arrow-up-arrow-down-svgrepo-com.svg +5 -0
- data/stuff/glyph/arrow-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/at-sign-svgrepo-com.svg +4 -0
- data/stuff/glyph/bag-svgrepo-com.svg +4 -0
- data/stuff/glyph/bell-slash-svgrepo-com.svg +6 -0
- data/stuff/glyph/bell-svgrepo-com.svg +5 -0
- data/stuff/glyph/book-open-svgrepo-com.svg +5 -0
- data/stuff/glyph/bookmark-svgrepo-com.svg +4 -0
- data/stuff/glyph/box-svgrepo-com.svg +6 -0
- data/stuff/glyph/calendar-svgrepo-com.svg +5 -0
- data/stuff/glyph/camera-svgrepo-com.svg +4 -0
- data/stuff/glyph/caret-down-svgrepo-com.svg +4 -0
- data/stuff/glyph/caret-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/caret-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/caret-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/cart-svgrepo-com.svg +6 -0
- data/stuff/glyph/chart-pie-svgrepo-com.svg +5 -0
- data/stuff/glyph/chartbar-2-svgrepo-com.svg +7 -0
- data/stuff/glyph/chartbar-svgrepo-com.svg +7 -0
- data/stuff/glyph/checkmark-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/checkmark-double-svgrepo-com.svg +5 -0
- data/stuff/glyph/checkmark-square-svgrepo-com.svg +4 -0
- data/stuff/glyph/checkmark-svgrepo-com.svg +4 -0
- data/stuff/glyph/chevron-down-svgrepo-com.svg +4 -0
- data/stuff/glyph/chevron-left-chevron-right-svgrepo-com.svg +5 -0
- data/stuff/glyph/chevron-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/chevron-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/chevron-small-down-svgrepo-com.svg +4 -0
- data/stuff/glyph/chevron-small-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/chevron-small-right-svgrepo-com.svg +4 -0
- data/stuff/glyph/chevron-small-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/chevron-up-chevron-down-svgrepo-com.svg +5 -0
- data/stuff/glyph/chevron-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/clock-svgrepo-com.svg +4 -0
- data/stuff/glyph/cloud-arrow-up-svgrepo-com.svg +4 -0
- data/stuff/glyph/cloud-download-svgrepo-com.svg +4 -0
- data/stuff/glyph/cloud-slash-svgrepo-com.svg +5 -0
- data/stuff/glyph/cloud-svgrepo-com.svg +4 -0
- data/stuff/glyph/columns-svgrepo-com.svg +5 -0
- data/stuff/glyph/command-svgrepo-com.svg +4 -0
- data/stuff/glyph/compass-svgrepo-com.svg +5 -0
- data/stuff/glyph/credit-card-svgrepo-com.svg +5 -0
- data/stuff/glyph/crop-svgrepo-com.svg +5 -0
- data/stuff/glyph/crown-svgrepo-com.svg +4 -0
- data/stuff/glyph/delete-left-svgrepo-com.svg +4 -0
- data/stuff/glyph/device-desktop-svgrepo-com.svg +4 -0
- data/stuff/glyph/device-mobile-svgrepo-com.svg +4 -0
- data/stuff/glyph/device-tablet-svgrepo-com.svg +4 -0
- data/stuff/glyph/doc-svgrepo-com.svg +5 -0
- data/stuff/glyph/dot-small-svgrepo-com.svg +4 -0
- data/stuff/glyph/dots-3-horizontal-svgrepo-com.svg +6 -0
- data/stuff/glyph/dots-3-vertical-svgrepo-com.svg +6 -0
- data/stuff/glyph/dots-6-horizontal-svgrepo-com.svg +9 -0
- data/stuff/glyph/dots-6-vertical-svgrepo-com.svg +9 -0
- data/stuff/glyph/dots-9-svgrepo-com.svg +12 -0
- data/stuff/glyph/emoji-frown-svgrepo-com.svg +4 -0
- data/stuff/glyph/emoji-meh-svgrepo-com.svg +4 -0
- data/stuff/glyph/emoji-smile-svgrepo-com.svg +4 -0
- data/stuff/glyph/envelope-svgrepo-com.svg +5 -0
- data/stuff/glyph/external-link-svgrepo-com.svg +5 -0
- data/stuff/glyph/eye-slash-svgrepo-com.svg +15 -0
- data/stuff/glyph/eye-svgrepo-com.svg +4 -0
- data/stuff/glyph/filter-svgrepo-com.svg +4 -0
- data/stuff/glyph/flame-svgrepo-com.svg +4 -0
- data/stuff/glyph/floppy-disk-svgrepo-com.svg +4 -0
- data/stuff/glyph/folder-svgrepo-com.svg +4 -0
- data/stuff/glyph/fullscreen-alt-svgrepo-com.svg +7 -0
- data/stuff/glyph/fullscreen-exit-alt-svgrepo-com.svg +7 -0
- data/stuff/glyph/fullscreen-exit-svgrepo-com.svg +5 -0
- data/stuff/glyph/fullscreen-svgrepo-com.svg +5 -0
- data/stuff/glyph/gear-svgrepo-com.svg +4 -0
- data/stuff/glyph/giftbox-svgrepo-com.svg +6 -0
- data/stuff/glyph/half-star-svgrepo-com.svg +4 -0
- data/stuff/glyph/hashtag-svgrepo-com.svg +4 -0
- data/stuff/glyph/headphones-svgrepo-com.svg +4 -0
- data/stuff/glyph/heart-half-svgrepo-com.svg +4 -0
- data/stuff/glyph/heart-svgrepo-com.svg +4 -0
- data/stuff/glyph/house-svgrepo-com.svg +4 -0
- data/stuff/glyph/image-svgrepo-com.svg +4 -0
- data/stuff/glyph/info-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/key-svgrepo-com.svg +4 -0
- data/stuff/glyph/layers-3-svgrepo-com.svg +6 -0
- data/stuff/glyph/layout-svgrepo-com.svg +6 -0
- data/stuff/glyph/line-3-svgrepo-com.svg +6 -0
- data/stuff/glyph/link-alt-svgrepo-com.svg +5 -0
- data/stuff/glyph/link-svgrepo-com.svg +6 -0
- data/stuff/glyph/list-bullet-svgrepo-com.svg +9 -0
- data/stuff/glyph/location-svgrepo-com.svg +4 -0
- data/stuff/glyph/lock-open-svgrepo-com.svg +4 -0
- data/stuff/glyph/lock-svgrepo-com.svg +4 -0
- data/stuff/glyph/map-pin-svgrepo-com.svg +4 -0
- data/stuff/glyph/medal-svgrepo-com.svg +13 -0
- data/stuff/glyph/media-backward-end-svgrepo-com.svg +5 -0
- data/stuff/glyph/media-backward-svgrepo-com.svg +5 -0
- data/stuff/glyph/media-forward-end-svgrepo-com.svg +5 -0
- data/stuff/glyph/media-forward-svgrepo-com.svg +4 -0
- data/stuff/glyph/media-pause-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/media-pause-svgrepo-com.svg +5 -0
- data/stuff/glyph/media-play-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/media-play-svgrepo-com.svg +4 -0
- data/stuff/glyph/media-stop-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/media-stop-svgrepo-com.svg +4 -0
- data/stuff/glyph/message-bubble-2-svgrepo-com.svg +4 -0
- data/stuff/glyph/message-bubble-svgrepo-com.svg +4 -0
- data/stuff/glyph/mic-slash-svgrepo-com.svg +6 -0
- data/stuff/glyph/mic-svgrepo-com.svg +5 -0
- data/stuff/glyph/minus-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/minus-square-svgrepo-com.svg +4 -0
- data/stuff/glyph/minus-svgrepo-com.svg +4 -0
- data/stuff/glyph/moon-svgrepo-com.svg +4 -0
- data/stuff/glyph/music-note-svgrepo-com.svg +4 -0
- data/stuff/glyph/nosign-svgrepo-com.svg +4 -0
- data/stuff/glyph/paper-clip-svgrepo-com.svg +4 -0
- data/stuff/glyph/paper-plane-svgrepo-com.svg +4 -0
- data/stuff/glyph/pen-tool-svgrepo-com.svg +4 -0
- data/stuff/glyph/pencil-svgrepo-com.svg +5 -0
- data/stuff/glyph/percent-svgrepo-com.svg +6 -0
- data/stuff/glyph/phone-incoming-svgrepo-com.svg +5 -0
- data/stuff/glyph/phone-missed-svgrepo-com.svg +4 -0
- data/stuff/glyph/phone-outgoing-svgrepo-com.svg +5 -0
- data/stuff/glyph/phone-slash-svgrepo-com.svg +4 -0
- data/stuff/glyph/phone-svgrepo-com.svg +4 -0
- data/stuff/glyph/plus-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/plus-square-svgrepo-com.svg +4 -0
- data/stuff/glyph/plus-svgrepo-com.svg +4 -0
- data/stuff/glyph/power-svgrepo-com.svg +5 -0
- data/stuff/glyph/printer-svgrepo-com.svg +5 -0
- data/stuff/glyph/question-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/scissors-svgrepo-com.svg +5 -0
- data/stuff/glyph/search-svgrepo-com.svg +4 -0
- data/stuff/glyph/server-svgrepo-com.svg +5 -0
- data/stuff/glyph/shape-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/shape-rhombus-svgrepo-com.svg +4 -0
- data/stuff/glyph/shape-square-svgrepo-com.svg +4 -0
- data/stuff/glyph/shape-triangle-svgrepo-com.svg +12 -0
- data/stuff/glyph/share-svgrepo-com.svg +4 -0
- data/stuff/glyph/shield-slash-svgrepo-com.svg +13 -0
- data/stuff/glyph/shield-svgrepo-com.svg +4 -0
- data/stuff/glyph/shippingbox-svgrepo-com.svg +7 -0
- data/stuff/glyph/slider-3-horizontal-svgrepo-com.svg +9 -0
- data/stuff/glyph/slider-3-vertical-svgrepo-com.svg +9 -0
- data/stuff/glyph/speaker-svgrepo-com.svg +4 -0
- data/stuff/glyph/speaker-wave-1-svgrepo-com.svg +5 -0
- data/stuff/glyph/speaker-wave-2-svgrepo-com.svg +6 -0
- data/stuff/glyph/speaker-xmark-svgrepo-com.svg +5 -0
- data/stuff/glyph/square-4-grid-svgrepo-com.svg +7 -0
- data/stuff/glyph/square-on-square-svgrepo-com.svg +5 -0
- data/stuff/glyph/star-svgrepo-com.svg +4 -0
- data/stuff/glyph/sun-svgrepo-com.svg +12 -0
- data/stuff/glyph/tag-svgrepo-com.svg +4 -0
- data/stuff/glyph/text-align-center-svgrepo-com.svg +7 -0
- data/stuff/glyph/text-align-justify-svgrepo-com.svg +7 -0
- data/stuff/glyph/text-align-left-svgrepo-com.svg +7 -0
- data/stuff/glyph/text-align-right-svgrepo-com.svg +7 -0
- data/stuff/glyph/text-bold-svgrepo-com.svg +4 -0
- data/stuff/glyph/text-heading-svgrepo-com.svg +4 -0
- data/stuff/glyph/text-italic-svgrepo-com.svg +4 -0
- data/stuff/glyph/text-svgrepo-com.svg +4 -0
- data/stuff/glyph/text-underline-svgrepo-com.svg +5 -0
- data/stuff/glyph/thumbs-down-svgrepo-com.svg +5 -0
- data/stuff/glyph/thumbs-up-svgrepo-com.svg +5 -0
- data/stuff/glyph/trash-svgrepo-com.svg +5 -0
- data/stuff/glyph/tray-svgrepo-com.svg +4 -0
- data/stuff/glyph/umbrela-svgrepo-com.svg +4 -0
- data/stuff/glyph/user-svgrepo-com.svg +5 -0
- data/stuff/glyph/users-svgrepo-com.svg +7 -0
- data/stuff/glyph/video-svgrepo-com.svg +12 -0
- data/stuff/glyph/waveform-ecg-svgrepo-com.svg +4 -0
- data/stuff/glyph/wi-fi-svgrepo-com.svg +7 -0
- data/stuff/glyph/xmark-circle-svgrepo-com.svg +4 -0
- data/stuff/glyph/xmark-small-svgrepo-com.svg +4 -0
- data/stuff/glyph/xmark-svgrepo-com.svg +4 -0
- data/stuff/glyph/zap-svgrepo-com.svg +4 -0
- data/stuff/glyph/zoom-in-svgrepo-com.svg +5 -0
- data/stuff/glyph/zoom-out-svgrepo-com.svg +5 -0
- data/stuff/readme.md +266 -0
- data/stuff/so/libSDL3.so +0 -0
- data/stuff/so/libpastele.so +0 -0
- data/stuff/so/libthorvg-1.so +0 -0
- metadata +427 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
module Pads
|
|
3
|
+
class Button < RectanglePad
|
|
4
|
+
|
|
5
|
+
# Create and attach button click event reaction.
|
|
6
|
+
def on_click ...
|
|
7
|
+
on(ClickEvent, ...)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# See #on_click=.
|
|
11
|
+
def on_click= param
|
|
12
|
+
on_click do: param
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Set whether is pressed.
|
|
16
|
+
def set_pressed value = true, event = nil
|
|
17
|
+
return if (c = pressed) == (value = block_given? ? yield(c) : value == Not ? !c : value)
|
|
18
|
+
@pressed = value
|
|
19
|
+
report (@pressed ? PressEvent.new(event) : ReleaseEvent.new(event)) if event
|
|
20
|
+
true
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# See #set_pressed.
|
|
24
|
+
def pressed= param
|
|
25
|
+
send_bundle :set_pressed, param
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Get whether is pressed.
|
|
29
|
+
def pressed
|
|
30
|
+
@pressed
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Set suit.
|
|
34
|
+
def set_suit *suit
|
|
35
|
+
return send_bundle :set_suit, yield(self.suit) if block_given?
|
|
36
|
+
suit = Util.uncover suit
|
|
37
|
+
return if @suit == suit && suit != :random
|
|
38
|
+
@suit = suit
|
|
39
|
+
repaint
|
|
40
|
+
true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# See #set_suit.
|
|
44
|
+
def suit= param
|
|
45
|
+
send_bundle :set_suit, param
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Get suit.
|
|
49
|
+
def suit
|
|
50
|
+
@suit
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Set a feature recognized by its class.
|
|
54
|
+
def << feature
|
|
55
|
+
case feature
|
|
56
|
+
when String
|
|
57
|
+
text?&.set feature or super
|
|
58
|
+
self.subject ||= feature
|
|
59
|
+
else
|
|
60
|
+
super
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# :section: LEVEL 2
|
|
65
|
+
|
|
66
|
+
class ClickEvent < Event
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
class PressEvent < Event
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
class ReleaseEvent < Event
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def sketch
|
|
76
|
+
super
|
|
77
|
+
|
|
78
|
+
set_keyboardy true
|
|
79
|
+
set_stroke_width 1
|
|
80
|
+
set_layout :xcc
|
|
81
|
+
set_size Fit
|
|
82
|
+
set_suit :gray
|
|
83
|
+
set_margin 2
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def presence
|
|
87
|
+
super
|
|
88
|
+
|
|
89
|
+
Event.each(
|
|
90
|
+
on_focus_enter,
|
|
91
|
+
on_focus_leave,
|
|
92
|
+
on_mouse_enter,
|
|
93
|
+
on_mouse_leave,
|
|
94
|
+
on(PressEvent),
|
|
95
|
+
on(ReleaseEvent),
|
|
96
|
+
do: method(:repaint)
|
|
97
|
+
)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def repaint event = nil
|
|
101
|
+
color = Kredki.color @suit
|
|
102
|
+
if in_disabled
|
|
103
|
+
set_opacity 3/4r
|
|
104
|
+
set_mouse_cursor nil
|
|
105
|
+
area.set_fill color
|
|
106
|
+
area.set_stroke_fill color.darken
|
|
107
|
+
else
|
|
108
|
+
set_opacity 1r
|
|
109
|
+
set_mouse_cursor :pointer
|
|
110
|
+
area.set_fill pressed ? color.darken : mouse_in ? color.lighten : color
|
|
111
|
+
area.set_stroke_fill keyboard_in ? :stroke_focus : color.darken
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def behavior
|
|
116
|
+
super
|
|
117
|
+
|
|
118
|
+
Event.each on_mouse_press(:primary), on_key_press(:enter, :space) do |e|
|
|
119
|
+
set_pressed true, e
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
on_focus_leave do |e|
|
|
123
|
+
set_pressed false, e
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
on_mouse_release :primary do |e|
|
|
127
|
+
pressed = keyboard_in && ( Kredki.keyboard.pressed?(:space) || Kredki.keyboard.pressed?(:enter) )
|
|
128
|
+
report ClickEvent.new e if !pressed && set_pressed(false, e) && !e.drag && include_point(*layer.translate(*e.xy, self))
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
on_key_release :space do |e|
|
|
132
|
+
pressed = pin_top(:primary) || ( keyboard_in && Kredki.keyboard.pressed?(:enter) )
|
|
133
|
+
report ClickEvent.new e if !pressed && set_pressed(false, e)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
on_click early: true do |e|
|
|
137
|
+
e.close if in_disabled
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def default_text text
|
|
142
|
+
put TextPad, :text!, text do
|
|
143
|
+
set_mousy false
|
|
144
|
+
set_size_y Fit
|
|
145
|
+
set_verse_size Kredki.text_size
|
|
146
|
+
set_verse_layout :ycc
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
require_relative 'checkbox_button'
|
|
2
|
+
|
|
3
|
+
module Kredki
|
|
4
|
+
module Pads
|
|
5
|
+
# Checkbox.
|
|
6
|
+
class Checkbox < SpacePad
|
|
7
|
+
|
|
8
|
+
# Set whether is selected.
|
|
9
|
+
def set_selected ...
|
|
10
|
+
@button.set_selected(...)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# See #set_selected.
|
|
14
|
+
def selected= param
|
|
15
|
+
@button.selected = param
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Get whether is selected.
|
|
19
|
+
def selected
|
|
20
|
+
@button.selected
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Set a feature recognized by its class.
|
|
24
|
+
def << feature
|
|
25
|
+
case feature
|
|
26
|
+
when String
|
|
27
|
+
(find Label or default_label) << feature
|
|
28
|
+
self.subject ||= feature
|
|
29
|
+
else
|
|
30
|
+
super
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# :section: LEVEL 2
|
|
35
|
+
|
|
36
|
+
def initialize
|
|
37
|
+
super
|
|
38
|
+
|
|
39
|
+
@button = default_checkbox_button
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def sketch
|
|
43
|
+
super
|
|
44
|
+
|
|
45
|
+
set_size Fit
|
|
46
|
+
set_spacer 5
|
|
47
|
+
set_layout :xsc
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def repaint event = nil
|
|
51
|
+
set_opacity in_disabled ? 3/4r : 1r
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def default_checkbox_button
|
|
55
|
+
put CheckboxButton do
|
|
56
|
+
on_click do
|
|
57
|
+
set_selected Not
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def default_label
|
|
63
|
+
put Label
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
module Pads
|
|
3
|
+
# Control which state can be on or off.
|
|
4
|
+
class CheckboxButton < Button
|
|
5
|
+
|
|
6
|
+
# Set whether is selected.
|
|
7
|
+
def set_selected value = true
|
|
8
|
+
return if (c = selected) == (value = block_given? ? yield(c) : value == Not ? !c : value)
|
|
9
|
+
@check.set_scenic value
|
|
10
|
+
@selected = value
|
|
11
|
+
true
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# See #set_selected.
|
|
15
|
+
def selected= param
|
|
16
|
+
send_bundle :set_selected, param
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Get whether is selected.
|
|
20
|
+
def selected
|
|
21
|
+
@selected
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# :section: LEVEL 2
|
|
25
|
+
|
|
26
|
+
def initialize
|
|
27
|
+
super
|
|
28
|
+
|
|
29
|
+
@check = default_check
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def sketch
|
|
33
|
+
super
|
|
34
|
+
|
|
35
|
+
set_layout :zcc
|
|
36
|
+
set_size 16
|
|
37
|
+
set_margin 3
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def repaint event = nil
|
|
41
|
+
color = Kredki.color @suit
|
|
42
|
+
if in_disabled
|
|
43
|
+
area.set_fill color
|
|
44
|
+
area.set_stroke_fill color.darken
|
|
45
|
+
else
|
|
46
|
+
area.set_fill pressed ? color.darken : mouse_in ? color.lighten : color
|
|
47
|
+
area.set_stroke_fill keyboard_in ? :stroke_focus : color.darken
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def default_check
|
|
52
|
+
put RectanglePad, mousy: false, keyboardy: false, fill: 0, size: 1r do
|
|
53
|
+
set_stroke fill: :text, width: 3
|
|
54
|
+
set_area do
|
|
55
|
+
jump 0, 1/2r
|
|
56
|
+
line 1/2r, 1r
|
|
57
|
+
line 1r, 0
|
|
58
|
+
end
|
|
59
|
+
set_scenic false
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require_relative '../item/item_y'
|
|
2
|
+
|
|
3
|
+
module Kredki
|
|
4
|
+
module Pads
|
|
5
|
+
module Context
|
|
6
|
+
class Item < ItemY
|
|
7
|
+
|
|
8
|
+
# Add new item.
|
|
9
|
+
def item!(...)
|
|
10
|
+
dropdown!.item_group.item!(...)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Create/Update dropdown layer.
|
|
14
|
+
def dropdown! ...
|
|
15
|
+
(find SecondaryLayer or dropdown_enable).set(...)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# :section: LEVEL 2
|
|
19
|
+
|
|
20
|
+
def initialize
|
|
21
|
+
super
|
|
22
|
+
|
|
23
|
+
@start = put SpacePad, size: [:y, 1r]
|
|
24
|
+
@end = put SpacePad, size: [:y, 1r], x: End
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def behavior
|
|
28
|
+
super
|
|
29
|
+
|
|
30
|
+
on_key_press :right do |e|
|
|
31
|
+
layer = find SecondaryLayer
|
|
32
|
+
if layer
|
|
33
|
+
layer.load self
|
|
34
|
+
layer.find_upper(Item)&.keyboard_request and e.close
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def mouse_enter e
|
|
41
|
+
super
|
|
42
|
+
layer = find SecondaryLayer
|
|
43
|
+
layer.update_keyboard_pad nil if layer&.loaded
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def dropdown_enable
|
|
47
|
+
@end.put RectanglePad, mousy: false, keyboardy: false, fill: 0, size: 1r do
|
|
48
|
+
set_stroke fill: :text, width: 2, cap: :round
|
|
49
|
+
set_area do |sx, sy|
|
|
50
|
+
jump sx * 0.5, sy * 0.35
|
|
51
|
+
line sx * 0.65, sy * 0.5
|
|
52
|
+
line sx * 0.5, sy * 0.65
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
put SecondaryLayer
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def default_text text
|
|
59
|
+
put TextPad, text, mousy: false, at: 1
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end#Item
|
|
63
|
+
end#Context
|
|
64
|
+
end#Pads
|
|
65
|
+
end#Kredki
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
module Pads
|
|
3
|
+
module Context
|
|
4
|
+
# Base class for context layers.
|
|
5
|
+
class Layer < Pads::Layer
|
|
6
|
+
|
|
7
|
+
# :section: LEVEL 2
|
|
8
|
+
|
|
9
|
+
def unload
|
|
10
|
+
update_keyboard_pad nil
|
|
11
|
+
pad_detach
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def loaded
|
|
15
|
+
!!@lower_pad
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
attr :items, :item_group
|
|
19
|
+
|
|
20
|
+
def initialize
|
|
21
|
+
super
|
|
22
|
+
|
|
23
|
+
@items = put Pad, fill: :dark_gray, margin: 1 do
|
|
24
|
+
# scene.drop_shadow color: :black # this is too expensive at the moment
|
|
25
|
+
end
|
|
26
|
+
@item_group = @items.put ItemGroup
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def load_common x, y
|
|
30
|
+
@items.set_xy x, y
|
|
31
|
+
lower.pane.put self
|
|
32
|
+
break_layout
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def behavior
|
|
36
|
+
super
|
|
37
|
+
|
|
38
|
+
on_key :up, :down do |e|
|
|
39
|
+
e.close
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
on Item::SelectEvent do |e|
|
|
43
|
+
if e.target.find_upper Item
|
|
44
|
+
e.close
|
|
45
|
+
else
|
|
46
|
+
pad_detach
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def mouse_press e
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def mouse_release e
|
|
55
|
+
end
|
|
56
|
+
end#Layer
|
|
57
|
+
end#Context
|
|
58
|
+
end#Pads
|
|
59
|
+
end#Kredki
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
require_relative 'pad'
|
|
3
|
+
require_relative 'item_group'
|
|
4
|
+
require_relative 'layer'
|
|
5
|
+
require_relative 'primary_layer'
|
|
6
|
+
require_relative 'secondary_layer'
|
|
7
|
+
require_relative 'item'
|
|
8
|
+
|
|
9
|
+
module Kredki
|
|
10
|
+
module Pads
|
|
11
|
+
module Context
|
|
12
|
+
|
|
13
|
+
# Reopen class to avoid circular depedency.
|
|
14
|
+
class ItemGroup
|
|
15
|
+
|
|
16
|
+
# Add new item.
|
|
17
|
+
def item!(...)
|
|
18
|
+
put(Item, :item!, size_x: 1r).set(...)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Context menu service.
|
|
23
|
+
class Menu < Service
|
|
24
|
+
|
|
25
|
+
attr :context_layer
|
|
26
|
+
|
|
27
|
+
def items
|
|
28
|
+
@context_layer.items
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Add new item.
|
|
32
|
+
def item! ...
|
|
33
|
+
@context_layer.item_group.item!(...)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Create and attach select event reaction.
|
|
37
|
+
def on_select ...
|
|
38
|
+
on(Item::SelectEvent, ...)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# See #on_select.
|
|
42
|
+
def on_select= param
|
|
43
|
+
on_select do: param
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# :section: LEVEL 2
|
|
47
|
+
|
|
48
|
+
def initialize
|
|
49
|
+
super
|
|
50
|
+
|
|
51
|
+
@context_layer = put PrimaryLayer
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def update_lower lower, at = nil
|
|
55
|
+
if super
|
|
56
|
+
@lower_events&.each{ _1.cancel }
|
|
57
|
+
|
|
58
|
+
secondary_mouse_click = lower.on_mouse_click :secondary do |e|
|
|
59
|
+
@context_layer.load *e.xy
|
|
60
|
+
@context_layer.find_upper(Item)&.keyboard_request
|
|
61
|
+
e.close
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
context_key = lower.on_key :context do |e|
|
|
65
|
+
@context_layer.load *lower.translate(lower.area_x / 2, lower.area_y / 2)
|
|
66
|
+
@context_layer.find_upper(Item)&.keyboard_request
|
|
67
|
+
e.close
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
@lower_events = [secondary_mouse_click, context_key]
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
end#Menu
|
|
75
|
+
end#Context
|
|
76
|
+
end#Pads
|
|
77
|
+
end#Kredki
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
module Pads
|
|
3
|
+
module Context
|
|
4
|
+
# Context menu items container pad.
|
|
5
|
+
class Pad < RectanglePad
|
|
6
|
+
|
|
7
|
+
# :section: LEVEL 2
|
|
8
|
+
|
|
9
|
+
def mouse_enter e
|
|
10
|
+
e.close
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def mouse_move e
|
|
14
|
+
e.close
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def sketch
|
|
18
|
+
super
|
|
19
|
+
|
|
20
|
+
set_size Fit
|
|
21
|
+
set_layout :yss
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end#Pads
|
|
26
|
+
end#Kredki
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require_relative 'layer'
|
|
2
|
+
|
|
3
|
+
module Kredki
|
|
4
|
+
module Pads
|
|
5
|
+
module Context
|
|
6
|
+
class PrimaryLayer < Layer
|
|
7
|
+
|
|
8
|
+
# :section: LEVEL 2
|
|
9
|
+
|
|
10
|
+
def load x, y
|
|
11
|
+
arrange
|
|
12
|
+
window_sx, window_sy = lower.window.size
|
|
13
|
+
x_max = window_sx - @items.area_size_x
|
|
14
|
+
x = [x_max, 0].max if x > x_max
|
|
15
|
+
sy = @items.area_size_y
|
|
16
|
+
y = [y - sy, 0].max if y + sy > window_sy
|
|
17
|
+
load_common x, y
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def behavior
|
|
21
|
+
super
|
|
22
|
+
|
|
23
|
+
on_key_press :escape do |e|
|
|
24
|
+
pad_detach
|
|
25
|
+
e.close
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
on_mouse_press do |e|
|
|
29
|
+
pad_detach
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def mouse_enter e
|
|
34
|
+
super
|
|
35
|
+
e.close
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def mouse_leave e
|
|
39
|
+
super
|
|
40
|
+
e.close
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def mouse_move e
|
|
44
|
+
super
|
|
45
|
+
e.close
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end#PrimaryLayer
|
|
49
|
+
end#Context
|
|
50
|
+
end#Pads
|
|
51
|
+
end#Kredki
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
require_relative 'layer'
|
|
2
|
+
|
|
3
|
+
module Kredki
|
|
4
|
+
module Pads
|
|
5
|
+
module Context
|
|
6
|
+
# Deeper context layer.
|
|
7
|
+
class SecondaryLayer < Layer
|
|
8
|
+
|
|
9
|
+
# :section: LEVEL 2
|
|
10
|
+
|
|
11
|
+
def load item
|
|
12
|
+
item.layer&.arrange
|
|
13
|
+
arrange
|
|
14
|
+
window_sx, window_sy = lower.window.size
|
|
15
|
+
x, y = *item.translate(item.area_size_x, -1)
|
|
16
|
+
if x + @items.area_size_x > window_sx
|
|
17
|
+
x = [x - item.area_size_x - @items.area_size_x, 0].max
|
|
18
|
+
end
|
|
19
|
+
if y + @items.area_size_y > window_sy
|
|
20
|
+
y = [window_sy - @items.area_size_y, 0].max
|
|
21
|
+
end
|
|
22
|
+
load_common x, y
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def behavior
|
|
26
|
+
super
|
|
27
|
+
|
|
28
|
+
on_key_press :left do |e|
|
|
29
|
+
if loaded
|
|
30
|
+
unload
|
|
31
|
+
e.close
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def update_lower lower, at = nil
|
|
37
|
+
if super
|
|
38
|
+
@lower_events&.each{|it| it.cancel }
|
|
39
|
+
|
|
40
|
+
focus_enter = lower.on_focus_enter do |e|
|
|
41
|
+
load lower
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
focus_leave = lower.on_focus_leave do |e|
|
|
45
|
+
unload if loaded
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
@lower_events = [focus_enter, focus_leave]
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def lower_pad_detached
|
|
53
|
+
super
|
|
54
|
+
unload if loaded
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
end#SecondaryLayer
|
|
58
|
+
end#Context
|
|
59
|
+
end#Pads
|
|
60
|
+
end#Kredki
|