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,140 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
module Pads
|
|
3
|
+
# Item group member.
|
|
4
|
+
class Item < RectanglePad
|
|
5
|
+
|
|
6
|
+
# Get whether is pressed.
|
|
7
|
+
def pressed keyboard_in = nil
|
|
8
|
+
keyboard_in = self.keyboard_in if keyboard_in.nil?
|
|
9
|
+
pin_top :primary or (
|
|
10
|
+
keyboard_in and (
|
|
11
|
+
Kredki.keyboard.pressed? :space or
|
|
12
|
+
Kredki.keyboard.pressed? :enter
|
|
13
|
+
)
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Set suit.
|
|
18
|
+
def set_suit *suit
|
|
19
|
+
return send_bundle :set_suit, yield(self.suit) if block_given?
|
|
20
|
+
suit = Util.uncover suit
|
|
21
|
+
return if @suit == suit && suit != :random
|
|
22
|
+
@suit = suit
|
|
23
|
+
repaint
|
|
24
|
+
true
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# See #set_suit.
|
|
28
|
+
def suit= param
|
|
29
|
+
send_bundle :set_suit, param
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get suit.
|
|
33
|
+
def suit
|
|
34
|
+
@suit
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Create and attach select event reaction.
|
|
38
|
+
def on_select ...
|
|
39
|
+
on(SelectEvent, ...)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# See #on_select.
|
|
43
|
+
def on_select= param
|
|
44
|
+
on_select do: param
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Set a feature recognized by its class.
|
|
48
|
+
def << feature
|
|
49
|
+
case feature
|
|
50
|
+
when String
|
|
51
|
+
find(TextPad)&.set feature or default_text feature
|
|
52
|
+
self.subject ||= feature
|
|
53
|
+
self
|
|
54
|
+
else
|
|
55
|
+
super
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# :section: LEVEL 2
|
|
60
|
+
|
|
61
|
+
class SelectEvent < Event
|
|
62
|
+
def param
|
|
63
|
+
target.subject
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def sketch
|
|
68
|
+
super
|
|
69
|
+
|
|
70
|
+
set_keyboardy true
|
|
71
|
+
set_layout :xsc
|
|
72
|
+
set_suit :gray
|
|
73
|
+
set_size Fit, 24
|
|
74
|
+
set_margin_x 4
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def presence
|
|
78
|
+
super
|
|
79
|
+
|
|
80
|
+
Event.each(
|
|
81
|
+
on_focus_enter,
|
|
82
|
+
on_focus_leave,
|
|
83
|
+
on_mouse_press,
|
|
84
|
+
on_mouse_release,
|
|
85
|
+
on_mouse_enter,
|
|
86
|
+
on_mouse_leave,
|
|
87
|
+
do: method(:repaint)
|
|
88
|
+
)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def repaint event = nil
|
|
92
|
+
color = Kredki.color @suit
|
|
93
|
+
if in_disabled
|
|
94
|
+
set opacity: 3/4r
|
|
95
|
+
area.set fill: color
|
|
96
|
+
else
|
|
97
|
+
set opacity: 1r
|
|
98
|
+
area.set fill: pin_in ? color.darken : keyboard_in ? color.lighten : color
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def behavior
|
|
103
|
+
super
|
|
104
|
+
|
|
105
|
+
on_mouse_click :primary do |e|
|
|
106
|
+
report_selected e
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
behavior_on_key
|
|
110
|
+
|
|
111
|
+
on_select do |e|
|
|
112
|
+
e.close if in_disabled
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def behavior_on_key
|
|
117
|
+
on_key :space, :enter do |e|
|
|
118
|
+
report_selected e
|
|
119
|
+
e.close
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def report_selected e
|
|
124
|
+
report SelectEvent.new(e), lower_iterator.to_a.reverse
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def mouse_enter e
|
|
128
|
+
lower&.mouse_enter self
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def min_size_x
|
|
132
|
+
fit_size_x
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def default_text text
|
|
136
|
+
put TextPad, text, mousy: false
|
|
137
|
+
end
|
|
138
|
+
end#Item
|
|
139
|
+
end#Pads
|
|
140
|
+
end#Kredki
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require_relative 'item_y'
|
|
2
|
+
|
|
3
|
+
module Kredki
|
|
4
|
+
module Pads
|
|
5
|
+
# Group of items.
|
|
6
|
+
class ItemGroup < Service
|
|
7
|
+
|
|
8
|
+
# Add new item.
|
|
9
|
+
def item!(...)
|
|
10
|
+
put(ItemY, __method__, ...)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# :section: LEVEL 2
|
|
14
|
+
|
|
15
|
+
def mouse_enter pad
|
|
16
|
+
pad.keyboard_request if find_upper(Item){|it| it.keyboard_in } != pad
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def focus_next
|
|
20
|
+
items = each(Item).to_a
|
|
21
|
+
index = items.index{|it| it.keyboard_in } || -1
|
|
22
|
+
return items[index] if index >= items.length - 1
|
|
23
|
+
item = (index + 1..items.length - 1).lazy.map{|i| items[i] }.find{|it| !it.in_disabled }
|
|
24
|
+
return items[index] if !item
|
|
25
|
+
focus item
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def focus_previous
|
|
29
|
+
items = each(Item).to_a
|
|
30
|
+
index = items.index{|it| it.keyboard_in } || 1
|
|
31
|
+
return items[index] if index <= 0
|
|
32
|
+
item = (0..index - 1).lazy.map{|i| items[index - 1 - i]}.find{|it| !it.in_disabled }
|
|
33
|
+
return items[index] if !item
|
|
34
|
+
focus item
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def focus item
|
|
38
|
+
item&.keyboard_request
|
|
39
|
+
item
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end#ItemGroup
|
|
43
|
+
end#Pads
|
|
44
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
module Pads
|
|
3
|
+
# Part of X axis aligned item group.
|
|
4
|
+
class ItemX < Item
|
|
5
|
+
# :section: LEVEL 2
|
|
6
|
+
|
|
7
|
+
def behavior
|
|
8
|
+
super
|
|
9
|
+
|
|
10
|
+
on_key_press :left do |e|
|
|
11
|
+
lower.focus_previous&.request_vision
|
|
12
|
+
e.close
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
on_key_press :right do |e|
|
|
16
|
+
lower.focus_next&.request_vision
|
|
17
|
+
e.close
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end#ItemX
|
|
21
|
+
end#Pads
|
|
22
|
+
end#Kredki
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require_relative 'item'
|
|
2
|
+
|
|
3
|
+
module Kredki
|
|
4
|
+
module Pads
|
|
5
|
+
# Part of Y axis aligned item group.
|
|
6
|
+
class ItemY < Item
|
|
7
|
+
|
|
8
|
+
# :section: LEVEL 2
|
|
9
|
+
|
|
10
|
+
def behavior
|
|
11
|
+
super
|
|
12
|
+
|
|
13
|
+
on_key_press :up do |e|
|
|
14
|
+
item = lower.focus_previous
|
|
15
|
+
if item
|
|
16
|
+
item.request_vision
|
|
17
|
+
e.close
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
on_key_press :down do |e|
|
|
22
|
+
item = lower.focus_next
|
|
23
|
+
if item
|
|
24
|
+
item.request_vision
|
|
25
|
+
e.close
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end#ItemY
|
|
30
|
+
end#Pads
|
|
31
|
+
end#Kredki
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
require_relative 'text/navigable_text_pad'
|
|
2
|
+
require_relative 'portal_layer'
|
|
3
|
+
|
|
4
|
+
module Kredki
|
|
5
|
+
module Pads
|
|
6
|
+
# Control with text transfering mouse events to related pad.
|
|
7
|
+
class Label < Pad
|
|
8
|
+
|
|
9
|
+
# Set selector for mouse events target.
|
|
10
|
+
def set_for new_for = @for
|
|
11
|
+
return send_bundle :set_for, yield(self.for) if block_given?
|
|
12
|
+
return if @for == new_for
|
|
13
|
+
@for = new_for
|
|
14
|
+
true
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# See #set_for.
|
|
18
|
+
def for= param
|
|
19
|
+
send_bundle :set_for, param
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Get selector for mouse events target.
|
|
23
|
+
def for
|
|
24
|
+
@for
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Set a feature recognized by its class.
|
|
28
|
+
def << feature
|
|
29
|
+
case feature
|
|
30
|
+
when String
|
|
31
|
+
text?&.set feature or super
|
|
32
|
+
self.subject ||= feature
|
|
33
|
+
else
|
|
34
|
+
super
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# :section: LEVEL 2
|
|
39
|
+
|
|
40
|
+
def sketch
|
|
41
|
+
super
|
|
42
|
+
|
|
43
|
+
set_size Fit, 24
|
|
44
|
+
set_for proc{|it| it.lower_pad&.find{|it| it.keyboardy } }
|
|
45
|
+
set_keyboardy false
|
|
46
|
+
area.set_fill false
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def for_pad
|
|
50
|
+
@for.call self
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def behavior
|
|
54
|
+
super
|
|
55
|
+
|
|
56
|
+
on_mouse_enter do |event|
|
|
57
|
+
@portal_layer = pane.put PortalLayer
|
|
58
|
+
@portal_layer.entry = self
|
|
59
|
+
@portal_layer.exit = for_pad
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def default_text text
|
|
64
|
+
put NavigableTextPad, :text!, text, size_y: 1r do
|
|
65
|
+
cursor.size_x = 0
|
|
66
|
+
set_mousy false
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
module Pads
|
|
3
|
+
# The Kredki::Pads::Pane child. Layers form a layer stack. Pads from higher layers are processed before pads from lower ones.
|
|
4
|
+
class Layer < RectanglePad
|
|
5
|
+
|
|
6
|
+
# Get repeated click counter value. The counter is reset when the next click occurs after a specified time interval,
|
|
7
|
+
# or the click target is a different pad, or the click location is beyond a specified distance limit from the previous one.
|
|
8
|
+
def mouse_click_combo event = nil
|
|
9
|
+
return 0 if !@click_data
|
|
10
|
+
if !event || (
|
|
11
|
+
@click_data.pad == event.target &&
|
|
12
|
+
!event.target.drag_check(@click_data.xy, event.xy) &&
|
|
13
|
+
event.timestamp - @click_data.timestamp < 200000000
|
|
14
|
+
)
|
|
15
|
+
then
|
|
16
|
+
return @click_data.combo
|
|
17
|
+
end
|
|
18
|
+
return 0
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Detach from pane.
|
|
22
|
+
def detach transfer = false
|
|
23
|
+
unless transfer
|
|
24
|
+
update_keyboard_pad nil
|
|
25
|
+
@pin_data = nil
|
|
26
|
+
@click_data = nil
|
|
27
|
+
end
|
|
28
|
+
super
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Enable carry focus on tab event resolver.
|
|
32
|
+
def carry_focus_on_tab
|
|
33
|
+
on_key_press :tab do |event|
|
|
34
|
+
next_pad = layer.keyboard_pad&.then do |p0|
|
|
35
|
+
upper_pad_iterator(reverse: event.shift?, deep: true)
|
|
36
|
+
.lazy
|
|
37
|
+
.drop_while{|p1| p0 != p1 }
|
|
38
|
+
.drop(1)
|
|
39
|
+
.filter{|it| it.keyboardy && !it.in_disabled && it.displayed }
|
|
40
|
+
.first
|
|
41
|
+
end || upper_pad_iterator(reverse: event.shift?, deep: true)
|
|
42
|
+
.lazy
|
|
43
|
+
.filter{|it| it.keyboardy && !it.in_disabled && it.displayed }
|
|
44
|
+
.first
|
|
45
|
+
next_pad&.keyboard_request
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# :section: LEVEL 2
|
|
50
|
+
|
|
51
|
+
class PinData
|
|
52
|
+
|
|
53
|
+
def initialize pad, xy, button, drag
|
|
54
|
+
@pad = pad
|
|
55
|
+
@xy = xy
|
|
56
|
+
@button = button
|
|
57
|
+
@drag = drag
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
attr_accessor :pad
|
|
61
|
+
attr_accessor :xy
|
|
62
|
+
attr_accessor :button
|
|
63
|
+
attr_accessor :drag
|
|
64
|
+
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
class ClickData
|
|
68
|
+
|
|
69
|
+
def initialize pad, xy, timestamp, combo
|
|
70
|
+
@pad = pad
|
|
71
|
+
@xy = xy
|
|
72
|
+
@timestamp = timestamp
|
|
73
|
+
@combo = combo
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
attr_accessor :pad
|
|
77
|
+
attr_accessor :xy
|
|
78
|
+
attr_accessor :timestamp
|
|
79
|
+
attr_accessor :combo
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def initialize
|
|
83
|
+
super
|
|
84
|
+
|
|
85
|
+
@pin_data = nil
|
|
86
|
+
@keyboard_pads = []
|
|
87
|
+
@mouse_pads = []
|
|
88
|
+
@click_data = nil
|
|
89
|
+
@sketched = false
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def sketch_service
|
|
93
|
+
return if @sketched
|
|
94
|
+
@sketched = true
|
|
95
|
+
super
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def sketch
|
|
99
|
+
super
|
|
100
|
+
|
|
101
|
+
set_keyboardy
|
|
102
|
+
set_fill false
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def behavior
|
|
106
|
+
super
|
|
107
|
+
|
|
108
|
+
on_key_press early: true do |e|
|
|
109
|
+
@pressed_keys[e.param || e.code] = true
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
on_key_release early: true do |e|
|
|
113
|
+
if @pressed_keys[e.param || e.code]
|
|
114
|
+
@pressed_keys[e.param || e.code] = false
|
|
115
|
+
keyboard_event KeyClickEvent.new e
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
on_mouse_click early: true, do: method(:mouse_click)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def break_layout
|
|
123
|
+
@layout_broken = true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def arrange
|
|
127
|
+
return unless @layout_broken
|
|
128
|
+
update_margin
|
|
129
|
+
@pads_layout.arrange self
|
|
130
|
+
@layout_broken = false
|
|
131
|
+
true
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def keyboard_pad
|
|
135
|
+
@keyboard_pads.last
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def keyboard_event event
|
|
139
|
+
if !event.closed? && displayed && (kp = keyboard_pad)
|
|
140
|
+
event.target = kp
|
|
141
|
+
kp.report event
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def update_keyboard_pad keyboard_pad = self
|
|
146
|
+
if !keyboard_pad
|
|
147
|
+
@keyboard_pads.each{|pad| pad.report FocusLeaveEvent.new, false }
|
|
148
|
+
@keyboard_pads = []
|
|
149
|
+
else
|
|
150
|
+
keyboard_pads = keyboard_pad.lower_pad_iterator.to_a.reverse
|
|
151
|
+
enter, no_change, leave = *Util.polarize(keyboard_pads, @keyboard_pads)
|
|
152
|
+
@keyboard_pads = keyboard_pads
|
|
153
|
+
leave.reverse_each{|it| it.report FocusLeaveEvent.new, false }
|
|
154
|
+
enter.reverse_each{|it| it.report FocusEnterEvent.new, false }
|
|
155
|
+
end
|
|
156
|
+
@pressed_keys = {}
|
|
157
|
+
true
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
def check_key_pressed key
|
|
161
|
+
!!@pressed_keys[key]
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def joystick_event event
|
|
165
|
+
if !event.closed?
|
|
166
|
+
report event
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def mouse_pad
|
|
171
|
+
@pin_data&.pad || @mouse_pads.last
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def mouse_event e
|
|
175
|
+
if e.is_a? MouseButtonReleaseEvent
|
|
176
|
+
layer_mouse_release e
|
|
177
|
+
else
|
|
178
|
+
mouse_pad&.report e
|
|
179
|
+
end
|
|
180
|
+
e
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
def update_mouse_location event
|
|
184
|
+
xy = event.xy
|
|
185
|
+
|
|
186
|
+
if @pin_data
|
|
187
|
+
drag = @pin_data.drag || ((@pin_data.drag = layer_drag_check xy) && :start)
|
|
188
|
+
if drag
|
|
189
|
+
event = MousePointerDragEvent.new nil, event
|
|
190
|
+
event.button = @pin_data.button
|
|
191
|
+
event.start = true if drag == :start
|
|
192
|
+
end
|
|
193
|
+
@pin_data.pad.report event
|
|
194
|
+
return event
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
arrange
|
|
198
|
+
@mouse_pads, last_mouse_pads = [], @mouse_pads
|
|
199
|
+
point_pads *xy, @mouse_pads
|
|
200
|
+
enter, stay, leave = *Util.polarize(@mouse_pads, last_mouse_pads)
|
|
201
|
+
leave.reverse_each{|it| it.report MousePointerLeaveEvent.new(event), false }
|
|
202
|
+
enter.reverse_each{|it| it.report MousePointerEnterEvent.new(event), false }
|
|
203
|
+
|
|
204
|
+
@mouse_pads.last&.report event
|
|
205
|
+
event
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
def layer_mouse_release event
|
|
209
|
+
xy = event.xy
|
|
210
|
+
|
|
211
|
+
arrange
|
|
212
|
+
@mouse_pads, last_mouse_pads = [], @mouse_pads
|
|
213
|
+
point_pads *xy, @mouse_pads
|
|
214
|
+
enter, stay, leave = *Util.polarize(@mouse_pads, last_mouse_pads)
|
|
215
|
+
leave.reverse_each{|it| it.report MousePointerLeaveEvent.new(event), false }
|
|
216
|
+
enter.reverse_each{|it| it.report MousePointerEnterEvent.new(event), false }
|
|
217
|
+
|
|
218
|
+
if @pin_data
|
|
219
|
+
event.drag = @pin_data.drag
|
|
220
|
+
@pin_data.pad.report event
|
|
221
|
+
else
|
|
222
|
+
@mouse_pads.last&.report event
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
event
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def point_pads x, y, pads, force = false
|
|
229
|
+
if force || (mousy && displayed && include_point(x, y))
|
|
230
|
+
pads << self
|
|
231
|
+
x -= @clip_scene.x
|
|
232
|
+
y -= @clip_scene.y
|
|
233
|
+
return true if @pads.reverse_each.find{|it| it.point_pads x - it.area_x, y - it.area_y, pads }
|
|
234
|
+
end
|
|
235
|
+
return false
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
def clear_mouse_location xy
|
|
239
|
+
unless @mouse_pads.empty?
|
|
240
|
+
mouse_pads = @mouse_pads
|
|
241
|
+
@mouse_pads = []
|
|
242
|
+
mouse_pads.reverse_each{|it| it.report MousePointerLeaveEvent.new(nil, *xy), false }
|
|
243
|
+
end
|
|
244
|
+
@pin_data&.pad&.pin_dispose
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
def layer_mouse_cursor
|
|
248
|
+
if @pin_data
|
|
249
|
+
@pin_data.pad.mouse_cursor
|
|
250
|
+
else
|
|
251
|
+
@mouse_pads.reverse_each.find{|it| it.mouse_cursor }&.mouse_cursor
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
def mouse_press e
|
|
256
|
+
keyboard_request if keyboardy
|
|
257
|
+
pin_request e.xy, e.button.id
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def mouse_release e
|
|
261
|
+
pin_dispose e.button.id
|
|
262
|
+
if !e.drag && include_point(e.x, e.y)
|
|
263
|
+
report MouseButtonClickEvent.new e
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
def mouse_click event
|
|
268
|
+
combo = mouse_click_combo(event) + 1
|
|
269
|
+
event.combo = combo
|
|
270
|
+
@click_data = ClickData.new event.target, event.xy, event.timestamp, combo
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
def layer_check_mouse_in pad
|
|
274
|
+
mouse_pad&.check_mouse_in pad
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
def pin_pad
|
|
278
|
+
@pin_data&.pad
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
def pin_xy
|
|
282
|
+
@pin_data&.xy
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
def pin_button
|
|
286
|
+
@pin_data&.button
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
def pin_check pad, button, top_only
|
|
290
|
+
return if button != @pin_data&.button
|
|
291
|
+
return @pin_data&.pad == pad if top_only
|
|
292
|
+
@pin_data&.pad&.in_pad pad
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
def update_pin_pad pad, xy = nil, button = nil, drag = false
|
|
296
|
+
if pad
|
|
297
|
+
if !@pin_data || !@pin_data.button || @pin_data.button == button
|
|
298
|
+
@pin_data = PinData.new pad, xy, button, drag
|
|
299
|
+
else
|
|
300
|
+
return false
|
|
301
|
+
end
|
|
302
|
+
else
|
|
303
|
+
@pin_data = nil
|
|
304
|
+
xy ||= window.mouse_xy
|
|
305
|
+
layer.update_mouse_location PositionEvent.new *xy
|
|
306
|
+
end
|
|
307
|
+
true
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
def layer_drag_check xy
|
|
311
|
+
bxy = @pin_data&.xy and @pin_data.pad.drag_check bxy, xy
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
def update_lower lower, at = nil
|
|
315
|
+
return if @lower == lower
|
|
316
|
+
@lower = lower
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
def pad_attach lower, at = nil
|
|
320
|
+
return if @lower_pad == lower
|
|
321
|
+
@lower_pad = lower
|
|
322
|
+
@lower = lower if !@lower
|
|
323
|
+
end
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
end
|