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,1290 @@
|
|
|
1
|
+
require_relative 'pad_events'
|
|
2
|
+
|
|
3
|
+
module Kredki
|
|
4
|
+
module Pads
|
|
5
|
+
# Base class of visible Pads tree nodes.
|
|
6
|
+
class Pad < Service
|
|
7
|
+
include PadEvents
|
|
8
|
+
|
|
9
|
+
# Set subject.
|
|
10
|
+
def set_subject subject = @subject
|
|
11
|
+
return send_bundle :set_subject, yield(self.subject) if block_given?
|
|
12
|
+
return if @subject == subject
|
|
13
|
+
@subject = subject
|
|
14
|
+
update_subject subject
|
|
15
|
+
true
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# See #set_subject.
|
|
19
|
+
def subject= param
|
|
20
|
+
send_bundle :set_subject, param
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Get subject.
|
|
24
|
+
def subject
|
|
25
|
+
@subject
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Set position along the X axis.
|
|
29
|
+
def set_x x = @x
|
|
30
|
+
return set_x yield @x if block_given?
|
|
31
|
+
return if Util.eqr @x, x
|
|
32
|
+
@x = x
|
|
33
|
+
layer&.break_layout
|
|
34
|
+
true
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# See #set_x.
|
|
38
|
+
def x= param
|
|
39
|
+
send_bundle :set_x, param
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Get position along the X axis.
|
|
43
|
+
def x
|
|
44
|
+
@x
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Set position along the Y axis.
|
|
48
|
+
def set_y y = @y
|
|
49
|
+
return set_y yield @y if block_given?
|
|
50
|
+
return if Util.eqr @y, y
|
|
51
|
+
@y = y
|
|
52
|
+
layer&.break_layout
|
|
53
|
+
true
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# See #set_y.
|
|
57
|
+
def y= param
|
|
58
|
+
send_bundle :set_y, param
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Get position along the X axis.
|
|
62
|
+
def y
|
|
63
|
+
@y
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Set position along X and Y axes.
|
|
67
|
+
def set_xy x = @x, y = x
|
|
68
|
+
return send_bundle :set_xy, yield(self.xy) if block_given?
|
|
69
|
+
return if (Util.eqr @y, y) && (Util.eqr @x, x)
|
|
70
|
+
@x = x
|
|
71
|
+
@y = y
|
|
72
|
+
layer&.break_layout
|
|
73
|
+
true
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# See #set_xy.
|
|
77
|
+
def xy= param
|
|
78
|
+
send_bundle :set_xy, param
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Get position along X and Y axes.
|
|
82
|
+
def xy
|
|
83
|
+
[@x, @y]
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Set size in the X axis.
|
|
87
|
+
def set_size_x size_x = @size_x, **ka
|
|
88
|
+
return set_size_x yield self.size_x if block_given?
|
|
89
|
+
unless Util.eqr @size_x, size_x
|
|
90
|
+
@size_x = size_x
|
|
91
|
+
layer&.break_layout
|
|
92
|
+
true
|
|
93
|
+
end | send_branch(__method__, ka)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# See #set_size_x.
|
|
97
|
+
def size_x= param
|
|
98
|
+
send_bundle :set_size_x, param
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Get size in the X axis.
|
|
102
|
+
def size_x
|
|
103
|
+
@size_x
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Set size in the Y axis.
|
|
107
|
+
def set_size_y size_y = @size_y, **ka
|
|
108
|
+
return set_size_y yield self.size_y if block_given?
|
|
109
|
+
unless Util.eqr @size_y, size_y
|
|
110
|
+
@size_y = size_y
|
|
111
|
+
layer&.break_layout
|
|
112
|
+
true
|
|
113
|
+
end | send_branch(__method__, ka)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# See #set_size_y.
|
|
117
|
+
def size_y= param
|
|
118
|
+
send_bundle :set_size_y, param
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Get size in the Y axis.
|
|
122
|
+
def size_y
|
|
123
|
+
@size_y
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Set size.
|
|
127
|
+
def set_size size_x = @size_x, size_y = size_x, **ka
|
|
128
|
+
return send_bundle :set_size, yield(self.size) if block_given?
|
|
129
|
+
if @size_x != size_x || @size_y != size_y
|
|
130
|
+
@size_x = size_x
|
|
131
|
+
@size_y = size_y
|
|
132
|
+
layer&.break_layout
|
|
133
|
+
true
|
|
134
|
+
end | send_branch(__method__, ka)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# See #set_size.
|
|
138
|
+
def size= param
|
|
139
|
+
send_bundle :set_size, param
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Get size.
|
|
143
|
+
def size
|
|
144
|
+
[@size_x, @size_y]
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Set size limit in the X axis.
|
|
148
|
+
def set_size_x_limit size_x_limit = @size_x_limit
|
|
149
|
+
return set_size_x_limit yield self.size_x_limit if block_given?
|
|
150
|
+
raise_ia size_x_limit, "Rational limit disabled." if Rational === size_x_limit
|
|
151
|
+
return if @size_x_limit = size_x_limit
|
|
152
|
+
@size_x_limit = size_x_limit
|
|
153
|
+
layer&.break_layout
|
|
154
|
+
true
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# See #set_size_x_limit.
|
|
158
|
+
def size_x_limit= param
|
|
159
|
+
set_size_x_limit param
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Get size limit in the X axis.
|
|
163
|
+
def size_x_limit
|
|
164
|
+
@size_x_limit
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Set size limit in the Y axis.
|
|
168
|
+
def set_size_y_limit size_y_limit = @size_y_limit
|
|
169
|
+
return set_size_y_limit yield self.size_y_limit if block_given?
|
|
170
|
+
raise_ia size_y_limit, "Rational limit disabled." if Rational === size_y_limit
|
|
171
|
+
return if @size_y_limit = size_y_limit
|
|
172
|
+
@size_y_limit = size_y_limit
|
|
173
|
+
layer&.break_layout
|
|
174
|
+
true
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# See #set_size_y_limit.
|
|
178
|
+
def size_y_limit= param
|
|
179
|
+
set_size_y_limit param
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Get size limit in the Y axis.
|
|
183
|
+
def size_y_limit
|
|
184
|
+
@size_y_limit
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Set size limit.
|
|
188
|
+
def set_size_limit x_limit = @x_limit, y_limit = x_limit
|
|
189
|
+
return send_bundle :set_size_limit, yield(self.size_limit) if block_given?
|
|
190
|
+
set_size_x_limit(x_limit) | set_size_y_limit(y_limit)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# See #set_size_limit.
|
|
194
|
+
def size_limit= param
|
|
195
|
+
send_bundle :set_size_limit, param
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Get size limit.
|
|
199
|
+
def size_limit
|
|
200
|
+
[@w_limit, @h_limit]
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Set X start margin.
|
|
204
|
+
def set_margin_xs m = @margin_xs
|
|
205
|
+
return set_margin_xs yield @margin_xs if block_given?
|
|
206
|
+
return if Util.eqr @margin_xs, m
|
|
207
|
+
@margin_xs = m
|
|
208
|
+
layer&.break_layout
|
|
209
|
+
true
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# See #set_margin_xs.
|
|
213
|
+
def margin_xs= param
|
|
214
|
+
send_bundle :set_margin_xs, param
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Get X start margin.
|
|
218
|
+
def margin_xs
|
|
219
|
+
@margin_xs
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Set X end margin.
|
|
223
|
+
def set_margin_xe m = @margin_xe
|
|
224
|
+
return set_margin_xe yield @margin_xe if block_given?
|
|
225
|
+
return if Util.eqr @margin_xe, m
|
|
226
|
+
@margin_xe = m
|
|
227
|
+
layer&.break_layout
|
|
228
|
+
true
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# See #set_margin_xe.
|
|
232
|
+
def margin_xe= param
|
|
233
|
+
send_bundle :set_margin_xe, param
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Get X end margin.
|
|
237
|
+
def margin_xe
|
|
238
|
+
@margin_xe
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Set Y start margin.
|
|
242
|
+
def set_margin_ys m = @margin_ys
|
|
243
|
+
return set_margin_ys yield @margin_ys if block_given?
|
|
244
|
+
return if Util.eqr @margin_ys, m
|
|
245
|
+
@margin_ys = m
|
|
246
|
+
layer&.break_layout
|
|
247
|
+
true
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# See #set_margin_ys.
|
|
251
|
+
def margin_ys= param
|
|
252
|
+
send_bundle :set_margin_ys, param
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Get Y start margin.
|
|
256
|
+
def margin_ys
|
|
257
|
+
@margin_ys
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Set Y end margin.
|
|
261
|
+
def set_margin_ye m = @margin_ye
|
|
262
|
+
return set_margin_ye yield @margin_ye if block_given?
|
|
263
|
+
return if Util.eqr @margin_ye, m
|
|
264
|
+
@margin_ye = m
|
|
265
|
+
layer&.break_layout
|
|
266
|
+
true
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# See #set_margin_ye.
|
|
270
|
+
def margin_ye= param
|
|
271
|
+
send_bundle :set_margin_ye, param
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Get Y end margin.
|
|
275
|
+
def margin_ye
|
|
276
|
+
@margin_ye
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Set X start and X end margin.
|
|
280
|
+
def set_margin_x mxs = @margin_xs, mxe = mxs
|
|
281
|
+
return send_bundle :set_margin_x, yield(self.margin_x) if block_given?
|
|
282
|
+
return if (Util.eqr @margin_xs, mxs) && (Util.eqr @margin_xe, mxe)
|
|
283
|
+
@margin_xs = mxs
|
|
284
|
+
@margin_xe = mxe
|
|
285
|
+
layer&.break_layout
|
|
286
|
+
true
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# See #set_margin_x.
|
|
290
|
+
def margin_x= param
|
|
291
|
+
send_bundle :set_margin_x, param
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Get X start and X end margin.
|
|
295
|
+
def margin_x
|
|
296
|
+
[@margin_xs, @margin_xe]
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Set Y start and X end margin.
|
|
300
|
+
def set_margin_y margin_ys = @margin_ys, margin_ye = margin_ys
|
|
301
|
+
return send_bundle :set_margin_y, yield(self.margin_y) if block_given?
|
|
302
|
+
return if (Util.eqr @margin_ys, margin_ys) && (Util.eqr @margin_ye, margin_ye)
|
|
303
|
+
@margin_ys = margin_ys
|
|
304
|
+
@margin_ye = margin_ye
|
|
305
|
+
layer&.break_layout
|
|
306
|
+
true
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# See #set_margin_y.
|
|
310
|
+
def margin_y= param
|
|
311
|
+
send_bundle :set_margin_y, param
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
# Get Y start and Y end margin.
|
|
315
|
+
def margin_y
|
|
316
|
+
[@margin_ys, @margin_ye]
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# Set X and Y start and X and Y end margin.
|
|
320
|
+
def set_margin margin_xs = @margin_xs, margin_ys = margin_xs, margin_xe = margin_xs, margin_ye = margin_ys, **ka
|
|
321
|
+
return send_bundle :set_margin, yield(self.m) if block_given?
|
|
322
|
+
unless (Util.eqr @margin_xs, margin_xs) && (Util.eqr @margin_xe, margin_xe) && (Util.eqr @margin_ys, margin_ys) && (Util.eqr @margin_ye, margin_ye)
|
|
323
|
+
@margin_xs = margin_xs
|
|
324
|
+
@margin_xe = margin_xe
|
|
325
|
+
@margin_ys = margin_ys
|
|
326
|
+
@margin_ye = margin_ye
|
|
327
|
+
layer&.break_layout
|
|
328
|
+
true
|
|
329
|
+
end | send_branch(__method__, ka)
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# See #set_margin.
|
|
333
|
+
def margin= param
|
|
334
|
+
send_bundle :set_margin, param
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# Get X and Y start and X and Y end margin.
|
|
338
|
+
def margin
|
|
339
|
+
[@margin_xs, @margin_ys, @margin_xe, @margin_ye]
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
# Set layout spacer.
|
|
343
|
+
def set_spacer spacer = @spacer
|
|
344
|
+
return set_spacer yield @spacer if block_given?
|
|
345
|
+
return if Util.eqr @spacer, spacer
|
|
346
|
+
@spacer = spacer
|
|
347
|
+
layer&.break_layout
|
|
348
|
+
true
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
# See #set_spacer.
|
|
352
|
+
def spacer= param
|
|
353
|
+
send_bundle :set_spacer, param
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Get layout spacer.
|
|
357
|
+
def spacer
|
|
358
|
+
@spacer
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
# Set turn around the pivot point.
|
|
362
|
+
def set_turn turn = @turn
|
|
363
|
+
return set_turn yield @turn if block_given?
|
|
364
|
+
return if @turn == turn
|
|
365
|
+
@turn = turn
|
|
366
|
+
@scene.set_turn turn
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
# See #set_turn.
|
|
370
|
+
def turn= param
|
|
371
|
+
send_bundle :set_turn, param
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# Get turn around the pivot point.
|
|
375
|
+
def turn
|
|
376
|
+
@turn
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# Set zoom in the X axis.
|
|
380
|
+
def set_zoom_x ...
|
|
381
|
+
@scene.set_zoom_x(...)
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
# See #set_zoom_x.
|
|
385
|
+
def zoom_x= value
|
|
386
|
+
@scene.zoom_x = value
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
# Get zoom in the X axis.
|
|
390
|
+
def zoom_x
|
|
391
|
+
@scene.zoom_x
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
# Set zoom in the Y axis.
|
|
395
|
+
def set_zoom_y ...
|
|
396
|
+
@scene.set_zoom_y(...)
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
# See #set_zoom_y.
|
|
400
|
+
def zoom_y= value
|
|
401
|
+
@scene.zoom_y = value
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
# Get zoom in the Y axis.
|
|
405
|
+
def zoom_y
|
|
406
|
+
@scene.zoom_y
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
# Set zoom in X and Y axes.
|
|
410
|
+
def set_zoom ...
|
|
411
|
+
@scene.set_zoom(...)
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
# See #set_zoom.
|
|
415
|
+
def zoom= value
|
|
416
|
+
@scene.zoom = value
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
# Get zoom in X and Y axes.
|
|
420
|
+
def zoom
|
|
421
|
+
@scene.zoom
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
# Set opacity.
|
|
425
|
+
def set_opacity opacity = @opacity
|
|
426
|
+
return set_opacity yield @opacity if block_given?
|
|
427
|
+
return if @opacity == opacity
|
|
428
|
+
@opacity = opacity
|
|
429
|
+
opacity *= 255 if opacity.is_a? Rational
|
|
430
|
+
@scene.set_opacity opacity
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
# See #set_opacity.
|
|
434
|
+
def opacity= param
|
|
435
|
+
send_bundle :set_opacity, param
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# Get opacity.
|
|
439
|
+
def opacity
|
|
440
|
+
@opacity
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
# Set mouse cursor.
|
|
444
|
+
def set_mouse_cursor mouse_cursor = @mouse_cursor
|
|
445
|
+
return send_bundle :set_mouse_cursor, yield(self.mouse_cursor) if block_given?
|
|
446
|
+
return if @mouse_cursor == mouse_cursor
|
|
447
|
+
@mouse_cursor = mouse_cursor
|
|
448
|
+
pane&.mouse_stale = true
|
|
449
|
+
true
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
# See #set_mouse_cursor.
|
|
453
|
+
def mouse_cursor= param
|
|
454
|
+
send_bundle :set_mouse_cursor, param
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
# Get mouse_cursor.
|
|
458
|
+
def mouse_cursor
|
|
459
|
+
@mouse_cursor
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
# [Create] and attach area and optionally clip area.
|
|
463
|
+
def set_area area = BlockShapeArea, clip: :auto, &block
|
|
464
|
+
a = case area
|
|
465
|
+
when Class
|
|
466
|
+
area.new(&block)
|
|
467
|
+
when Proc
|
|
468
|
+
BlockShapeArea.new(&area)
|
|
469
|
+
else
|
|
470
|
+
area
|
|
471
|
+
end
|
|
472
|
+
unless @area == a
|
|
473
|
+
a.set **@area, filter_keywords: true
|
|
474
|
+
a.attach @scene, true, @area
|
|
475
|
+
@area.detach
|
|
476
|
+
@area = a
|
|
477
|
+
true
|
|
478
|
+
end |
|
|
479
|
+
case clip
|
|
480
|
+
when :auto
|
|
481
|
+
set_clip_area area, &block if Class === area
|
|
482
|
+
when false, nil
|
|
483
|
+
false
|
|
484
|
+
else
|
|
485
|
+
set_clip_area area, &block
|
|
486
|
+
end
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
# See #set_area.
|
|
490
|
+
def area= param
|
|
491
|
+
send_bundle :set_area, param
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
# Get area.
|
|
495
|
+
def area
|
|
496
|
+
@area
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
# [Create] and attach clip area.
|
|
500
|
+
def set_clip_area area = nil, &block
|
|
501
|
+
a = Class === area ? area.new(&block) : area
|
|
502
|
+
return if @clip_area == a
|
|
503
|
+
a.set **@clip_area, filter_keywords: true
|
|
504
|
+
@clip_scene.set_clip a
|
|
505
|
+
@clip_area = a
|
|
506
|
+
true
|
|
507
|
+
end
|
|
508
|
+
|
|
509
|
+
# See #set_clip_area.
|
|
510
|
+
def clip_area= param
|
|
511
|
+
send_bundle :set_clip_area, param
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
# Get clip_area.
|
|
515
|
+
def clip_area
|
|
516
|
+
@clip_area
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
# Set layout.
|
|
520
|
+
def set_layout layout = nil
|
|
521
|
+
return set_layout yield @layout if block_given?
|
|
522
|
+
return if @layout == layout
|
|
523
|
+
@layout = layout
|
|
524
|
+
layout = Pads.layout layout
|
|
525
|
+
return true if @pads_layout == layout
|
|
526
|
+
@pads_layout = layout
|
|
527
|
+
layer&.break_layout
|
|
528
|
+
true
|
|
529
|
+
end
|
|
530
|
+
|
|
531
|
+
# See #set_layout.
|
|
532
|
+
def layout= param
|
|
533
|
+
send_bundle :set_layout, param
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# Get layout.
|
|
537
|
+
def layout
|
|
538
|
+
@layout
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
# Set whether Pad is scenic.
|
|
542
|
+
#
|
|
543
|
+
# All lower pads must also be scenic for the Pad to be displayed.
|
|
544
|
+
def set_scenic value = true
|
|
545
|
+
return if (c = scenic) == (value = block_given? ? yield(c) : value == Not ? !c : value)
|
|
546
|
+
update_scenic value
|
|
547
|
+
true
|
|
548
|
+
end
|
|
549
|
+
|
|
550
|
+
# See #set_scenic.
|
|
551
|
+
def scenic= value
|
|
552
|
+
set_scenic value
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
# Get whether Pad is scenic.
|
|
556
|
+
def scenic
|
|
557
|
+
get_scenic
|
|
558
|
+
end
|
|
559
|
+
|
|
560
|
+
# Get whether Pad is displayed
|
|
561
|
+
def displayed
|
|
562
|
+
@scene.displayed
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
# Set whether Pad is layoutic.
|
|
566
|
+
#
|
|
567
|
+
# Layoutic pad occupy place in layout even if it is not scenic.
|
|
568
|
+
def set_layoutic value = true
|
|
569
|
+
return if (c = layoutic) == (value = block_given? ? yield(c) : value == Not ? !c : value)
|
|
570
|
+
layer&.break_layout
|
|
571
|
+
@layoutic = value
|
|
572
|
+
true
|
|
573
|
+
end
|
|
574
|
+
|
|
575
|
+
# See #set_layoutic.
|
|
576
|
+
def layoutic= value
|
|
577
|
+
set_layoutic value
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
# Get whether Pad is layoutic.
|
|
581
|
+
def layoutic
|
|
582
|
+
@layoutic || @layoutic.nil?
|
|
583
|
+
end
|
|
584
|
+
|
|
585
|
+
# Get whether [+x+, +y+] is inside Pad area.
|
|
586
|
+
def include_point x, y
|
|
587
|
+
@area.include_point x, y
|
|
588
|
+
end
|
|
589
|
+
|
|
590
|
+
# Get whether mouse pointer events are reaching Pad.
|
|
591
|
+
def mouse_in
|
|
592
|
+
layer&.layer_check_mouse_in self or false
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
# Get whether Pad is mouse pointer events target.
|
|
596
|
+
def mouse_top
|
|
597
|
+
layer&.mouse_pad == self
|
|
598
|
+
end
|
|
599
|
+
|
|
600
|
+
# Get whether keyboard events are reaching Pad.
|
|
601
|
+
def keyboard_in
|
|
602
|
+
top = layer&.keyboard_pad
|
|
603
|
+
top == self || top&.lower_pad_iterator&.any?{ _1 == self } || false
|
|
604
|
+
end
|
|
605
|
+
|
|
606
|
+
# Get whether Pad is keyboard events target.
|
|
607
|
+
def keyboard_top
|
|
608
|
+
layer&.keyboard_pad == self
|
|
609
|
+
end
|
|
610
|
+
|
|
611
|
+
# Get whether mouse pointer is pinned to Pad.
|
|
612
|
+
def pin_in button = nil
|
|
613
|
+
layer&.pin_check self, button, false
|
|
614
|
+
end
|
|
615
|
+
|
|
616
|
+
# Get whether mouse pointer is directly pinned to Pad.
|
|
617
|
+
def pin_top button = nil
|
|
618
|
+
layer&.pin_check self, button, true
|
|
619
|
+
end
|
|
620
|
+
|
|
621
|
+
# Set whether Pad can be keyboard events target.
|
|
622
|
+
def set_keyboardy value = true
|
|
623
|
+
return if (c = keyboardy) == (value = block_given? ? yield(c) : value == Not ? !c : value)
|
|
624
|
+
@keyboardy = value
|
|
625
|
+
true
|
|
626
|
+
end
|
|
627
|
+
|
|
628
|
+
# See #set_keyboardy.
|
|
629
|
+
def keyboardy= value
|
|
630
|
+
set_keyboardy value
|
|
631
|
+
end
|
|
632
|
+
|
|
633
|
+
# Get whether Pad can be keyboard events target.
|
|
634
|
+
def keyboardy
|
|
635
|
+
@keyboardy
|
|
636
|
+
end
|
|
637
|
+
|
|
638
|
+
# Set whether Pad can be mouse events target.
|
|
639
|
+
def set_mousy value = true
|
|
640
|
+
return if (c = mousy) == (value = block_given? ? yield(c) : value == Not ? !c : value)
|
|
641
|
+
@mousy = value
|
|
642
|
+
true
|
|
643
|
+
end
|
|
644
|
+
|
|
645
|
+
# See #set_mousy.
|
|
646
|
+
def mousy= value
|
|
647
|
+
set_mousy value
|
|
648
|
+
end
|
|
649
|
+
|
|
650
|
+
# Get whether Pad can be mouse events target.
|
|
651
|
+
def mousy
|
|
652
|
+
@mousy || @mousy.nil?
|
|
653
|
+
end
|
|
654
|
+
|
|
655
|
+
# Set whether is disabled.
|
|
656
|
+
def set_disabled value = true
|
|
657
|
+
return if (c = disabled) == (value = block_given? ? yield(c) : value == Not ? !c : value)
|
|
658
|
+
@disabled = value
|
|
659
|
+
repaint
|
|
660
|
+
true
|
|
661
|
+
end
|
|
662
|
+
|
|
663
|
+
# See #set_disabled.
|
|
664
|
+
def disabled= value
|
|
665
|
+
set_disabled value
|
|
666
|
+
end
|
|
667
|
+
|
|
668
|
+
# Get whether is disabled.
|
|
669
|
+
def disabled
|
|
670
|
+
@disabled
|
|
671
|
+
end
|
|
672
|
+
|
|
673
|
+
# Get whether self or any lower is disabled.
|
|
674
|
+
def in_disabled
|
|
675
|
+
disabled || find_lower(Pad){|it| it.disabled }
|
|
676
|
+
end
|
|
677
|
+
|
|
678
|
+
# Start drag.
|
|
679
|
+
def start_drag start_xy = nil, button = nil
|
|
680
|
+
mouse_xy = window.mouse_xy
|
|
681
|
+
pin_request start_xy || mouse_xy, button, true
|
|
682
|
+
event = MousePointerDragEvent.new(Kredki.mouse, PositionEvent.new(*mouse_xy)).set button: button, start: true
|
|
683
|
+
report event
|
|
684
|
+
end
|
|
685
|
+
|
|
686
|
+
# Detach all contained pads.
|
|
687
|
+
def clear
|
|
688
|
+
pads, @pads = @pads, []
|
|
689
|
+
pads.each do |pad|
|
|
690
|
+
pad.detach true
|
|
691
|
+
end
|
|
692
|
+
layer&.break_layout unless pads.empty?
|
|
693
|
+
end
|
|
694
|
+
|
|
695
|
+
# Put subject.
|
|
696
|
+
def put subject, *a, at: nil, **ka, &b
|
|
697
|
+
case subject
|
|
698
|
+
when String
|
|
699
|
+
pad_mode = subject.start_with? "\xe1"
|
|
700
|
+
subject.split("\x1e").each do |part|
|
|
701
|
+
if pad_mode
|
|
702
|
+
id = part.to_i
|
|
703
|
+
pad = find{|c| c.object_id == id }
|
|
704
|
+
put pad if pad
|
|
705
|
+
pad_mode = false
|
|
706
|
+
else
|
|
707
|
+
default_text part
|
|
708
|
+
pad_mode = true
|
|
709
|
+
end
|
|
710
|
+
end
|
|
711
|
+
when Service
|
|
712
|
+
at = nil if at == self
|
|
713
|
+
subject.attach self, at: at
|
|
714
|
+
subject.set *a, **ka, &b
|
|
715
|
+
else super
|
|
716
|
+
end
|
|
717
|
+
end
|
|
718
|
+
|
|
719
|
+
# Detach from lower.
|
|
720
|
+
def detach transfer = false
|
|
721
|
+
super
|
|
722
|
+
pad_detach transfer
|
|
723
|
+
end
|
|
724
|
+
|
|
725
|
+
# Set a feature recognized by its class.
|
|
726
|
+
def << feature
|
|
727
|
+
case feature
|
|
728
|
+
when Pad, String
|
|
729
|
+
put feature
|
|
730
|
+
else
|
|
731
|
+
super
|
|
732
|
+
end
|
|
733
|
+
end
|
|
734
|
+
|
|
735
|
+
# :section: LEVEL 2
|
|
736
|
+
|
|
737
|
+
def initialize
|
|
738
|
+
super
|
|
739
|
+
@x = @y = Auto
|
|
740
|
+
@size_x = @size_y = Auto
|
|
741
|
+
@size_x_limit = @size_y_limit = nil
|
|
742
|
+
@turn = 0
|
|
743
|
+
@opacity = 255
|
|
744
|
+
@margin_xs = @margin_xe = @margin_ys = @margin_ye = 0
|
|
745
|
+
@mouse_cursor = nil
|
|
746
|
+
@lower_pad = nil
|
|
747
|
+
@scene = Scene.new
|
|
748
|
+
initialize_area
|
|
749
|
+
@clip_scene = @scene.new_scene
|
|
750
|
+
@clip_area = @clip_scene.new_rectangle at: false, fill: false
|
|
751
|
+
@pads = []
|
|
752
|
+
@layout = nil
|
|
753
|
+
@pads_layout = Pads.layout
|
|
754
|
+
end
|
|
755
|
+
|
|
756
|
+
def to_s
|
|
757
|
+
"\x1e#{object_id}\x1e"
|
|
758
|
+
end
|
|
759
|
+
|
|
760
|
+
def initialize_area
|
|
761
|
+
@area = @scene.new_rectangle scenic: false
|
|
762
|
+
end
|
|
763
|
+
|
|
764
|
+
def pad_tree
|
|
765
|
+
@pads.map{|it| [it, it.pad_tree] }.to_h
|
|
766
|
+
end
|
|
767
|
+
|
|
768
|
+
def sketch_service
|
|
769
|
+
sketch
|
|
770
|
+
presence
|
|
771
|
+
behavior
|
|
772
|
+
end
|
|
773
|
+
|
|
774
|
+
def sketch
|
|
775
|
+
end
|
|
776
|
+
|
|
777
|
+
def presence
|
|
778
|
+
@clip_scene.set_clip @clip_area
|
|
779
|
+
end
|
|
780
|
+
|
|
781
|
+
def repaint event = nil
|
|
782
|
+
end
|
|
783
|
+
|
|
784
|
+
def behavior
|
|
785
|
+
on_mouse_press do: method(:mouse_press)
|
|
786
|
+
on_mouse_release do: method(:mouse_release)
|
|
787
|
+
on_mouse_enter do: method(:mouse_enter)
|
|
788
|
+
on_mouse_leave do: method(:mouse_leave)
|
|
789
|
+
on_mouse_move do: method(:mouse_move)
|
|
790
|
+
on_focus_enter do: method(:focus_enter)
|
|
791
|
+
on_focus_leave do: method(:focus_leave)
|
|
792
|
+
on FocusOfferEvent, do: method(:keyboard_offer)
|
|
793
|
+
end
|
|
794
|
+
|
|
795
|
+
def keyboard_offer e
|
|
796
|
+
e.close if keyboardy && keyboard_request
|
|
797
|
+
end
|
|
798
|
+
|
|
799
|
+
def mouse_enter e
|
|
800
|
+
end
|
|
801
|
+
|
|
802
|
+
def mouse_leave e
|
|
803
|
+
end
|
|
804
|
+
|
|
805
|
+
def mouse_move e
|
|
806
|
+
end
|
|
807
|
+
|
|
808
|
+
def mouse_press e
|
|
809
|
+
report FocusOfferEvent.new if e.button.id == :primary
|
|
810
|
+
pin_request e.xy, e.button.id
|
|
811
|
+
e.close
|
|
812
|
+
end
|
|
813
|
+
|
|
814
|
+
def mouse_release e
|
|
815
|
+
pin_dispose e.button.id
|
|
816
|
+
if !e.drag && include_point(*layer.translate(*e.xy, self))
|
|
817
|
+
report MouseButtonClickEvent.new e
|
|
818
|
+
end
|
|
819
|
+
e.close
|
|
820
|
+
end
|
|
821
|
+
|
|
822
|
+
def focus_enter e
|
|
823
|
+
end
|
|
824
|
+
|
|
825
|
+
def focus_leave e
|
|
826
|
+
end
|
|
827
|
+
|
|
828
|
+
def update_subject subject
|
|
829
|
+
end
|
|
830
|
+
|
|
831
|
+
def area_x
|
|
832
|
+
@scene.x
|
|
833
|
+
end
|
|
834
|
+
|
|
835
|
+
def area_y
|
|
836
|
+
@scene.y
|
|
837
|
+
end
|
|
838
|
+
|
|
839
|
+
def area_xy
|
|
840
|
+
[area_x, area_y]
|
|
841
|
+
end
|
|
842
|
+
|
|
843
|
+
def area_size_x
|
|
844
|
+
@area.size_x
|
|
845
|
+
end
|
|
846
|
+
|
|
847
|
+
def area_size_y
|
|
848
|
+
@area.size_y
|
|
849
|
+
end
|
|
850
|
+
|
|
851
|
+
def area_size
|
|
852
|
+
[area_size_x, area_size_y]
|
|
853
|
+
end
|
|
854
|
+
|
|
855
|
+
def clip_x
|
|
856
|
+
@clip_scene.x
|
|
857
|
+
end
|
|
858
|
+
|
|
859
|
+
def clip_y
|
|
860
|
+
@clip_scene.y
|
|
861
|
+
end
|
|
862
|
+
|
|
863
|
+
def clip_xy
|
|
864
|
+
[clip_x, clip_y]
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
def clip_size_x
|
|
868
|
+
@clip_area.size_x
|
|
869
|
+
end
|
|
870
|
+
|
|
871
|
+
def clip_size_y
|
|
872
|
+
@clip_area.size_y
|
|
873
|
+
end
|
|
874
|
+
|
|
875
|
+
def clip_size
|
|
876
|
+
[clip_size_x, clip_size_y]
|
|
877
|
+
end
|
|
878
|
+
|
|
879
|
+
attr :lower_pad, :clip_scene, :pads
|
|
880
|
+
|
|
881
|
+
def scene &block
|
|
882
|
+
@scene.set &block if block
|
|
883
|
+
@scene
|
|
884
|
+
end
|
|
885
|
+
|
|
886
|
+
def lower_pad_iterator include_self = true
|
|
887
|
+
Enumerator.new do |e|
|
|
888
|
+
pad = include_self ? self : lower_pad
|
|
889
|
+
while pad && !pad.is(Pane)
|
|
890
|
+
e << pad
|
|
891
|
+
pad = pad.lower_pad
|
|
892
|
+
end
|
|
893
|
+
end
|
|
894
|
+
end
|
|
895
|
+
|
|
896
|
+
def in_pad pad
|
|
897
|
+
lower_pad_iterator.include? pad
|
|
898
|
+
end
|
|
899
|
+
|
|
900
|
+
def pad_detach transfer = false
|
|
901
|
+
@scene.detach
|
|
902
|
+
if @lower_pad
|
|
903
|
+
@lower_pad.delete_pad self, transfer
|
|
904
|
+
@lower_pad = nil
|
|
905
|
+
lower_pad_detached
|
|
906
|
+
end
|
|
907
|
+
end
|
|
908
|
+
|
|
909
|
+
def pad_index
|
|
910
|
+
lower_pad&.pads.index self
|
|
911
|
+
end
|
|
912
|
+
|
|
913
|
+
def put_pad pad, at = nil
|
|
914
|
+
case at
|
|
915
|
+
when Integer
|
|
916
|
+
paint_state = @clip_scene.put_paint pad.scene, false
|
|
917
|
+
@pads.insert at, pad
|
|
918
|
+
when Pad
|
|
919
|
+
paint_state = @clip_scene.put_paint pad.scene, false, at.scene
|
|
920
|
+
@pads.insert @pads.index(at), pad
|
|
921
|
+
else
|
|
922
|
+
paint_state = @clip_scene.put_paint pad.scene, false
|
|
923
|
+
@pads << pad
|
|
924
|
+
end
|
|
925
|
+
layer&.break_layout
|
|
926
|
+
pad
|
|
927
|
+
end
|
|
928
|
+
|
|
929
|
+
def delete_pad pad, transfer
|
|
930
|
+
deleted = @pads.delete pad
|
|
931
|
+
if deleted
|
|
932
|
+
layer&.break_layout
|
|
933
|
+
end
|
|
934
|
+
deleted
|
|
935
|
+
end
|
|
936
|
+
|
|
937
|
+
def update_xy x, y
|
|
938
|
+
@scene.set_xy x.floor, y.floor
|
|
939
|
+
end
|
|
940
|
+
|
|
941
|
+
def get_x clip_size, size, ax
|
|
942
|
+
case @x
|
|
943
|
+
when Rational
|
|
944
|
+
@x * clip_size - size * 0.5
|
|
945
|
+
when Proc
|
|
946
|
+
@x[clip_size, size]
|
|
947
|
+
when Range
|
|
948
|
+
ax + @x.begin
|
|
949
|
+
when Start
|
|
950
|
+
0
|
|
951
|
+
when Center
|
|
952
|
+
(clip_size - size) * 0.5
|
|
953
|
+
when End
|
|
954
|
+
clip_size - size
|
|
955
|
+
when Auto
|
|
956
|
+
ax
|
|
957
|
+
when Numeric
|
|
958
|
+
@x
|
|
959
|
+
else raise_is @x
|
|
960
|
+
end
|
|
961
|
+
end
|
|
962
|
+
|
|
963
|
+
def get_y clip_size, size, ay
|
|
964
|
+
case @y
|
|
965
|
+
when Rational
|
|
966
|
+
@y * clip_size - size * 0.5
|
|
967
|
+
when Proc
|
|
968
|
+
@y[clip_size, size]
|
|
969
|
+
when Range
|
|
970
|
+
ay + @y.begin
|
|
971
|
+
when Start
|
|
972
|
+
0
|
|
973
|
+
when Center
|
|
974
|
+
(clip_size - size) * 0.5
|
|
975
|
+
when End
|
|
976
|
+
clip_size - size
|
|
977
|
+
when Auto
|
|
978
|
+
ay
|
|
979
|
+
when Numeric
|
|
980
|
+
@y
|
|
981
|
+
else raise_is @y
|
|
982
|
+
end
|
|
983
|
+
end
|
|
984
|
+
|
|
985
|
+
def update_size x, y
|
|
986
|
+
margin_x = @margin_xs + @margin_xe
|
|
987
|
+
margin_y = @margin_ys + @margin_ye
|
|
988
|
+
@area.set_size x.floor, y.floor
|
|
989
|
+
@scene.set_pivot x * 0.5, y * 0.5
|
|
990
|
+
@clip_area.set_size (x - margin_x).floor, (y - margin_y).floor
|
|
991
|
+
end
|
|
992
|
+
|
|
993
|
+
def pads_layoutic
|
|
994
|
+
pads.filter{|it| it.layoutic }
|
|
995
|
+
end
|
|
996
|
+
|
|
997
|
+
def arranged_pads
|
|
998
|
+
pads
|
|
999
|
+
end
|
|
1000
|
+
|
|
1001
|
+
def arrange
|
|
1002
|
+
@pads_layout.arrange self
|
|
1003
|
+
end
|
|
1004
|
+
|
|
1005
|
+
def fit_size_x
|
|
1006
|
+
@margin_xs + @margin_xe + @pads_layout.fit_size_x(self)
|
|
1007
|
+
end
|
|
1008
|
+
|
|
1009
|
+
def min_size_x
|
|
1010
|
+
margin = @margin_xs + @margin_xe
|
|
1011
|
+
value = min_size_x_value margin
|
|
1012
|
+
value = [value, min_size_x_limit(@size_x_limit, margin)].max if @size_x_limit
|
|
1013
|
+
value
|
|
1014
|
+
end
|
|
1015
|
+
|
|
1016
|
+
def min_size_x_value margin
|
|
1017
|
+
size_x = case @size_x
|
|
1018
|
+
when Rational, Proc
|
|
1019
|
+
margin
|
|
1020
|
+
when Fit
|
|
1021
|
+
fit_size_x
|
|
1022
|
+
when Auto
|
|
1023
|
+
@area.size_x
|
|
1024
|
+
when :y
|
|
1025
|
+
get_size_y
|
|
1026
|
+
when Numeric
|
|
1027
|
+
@size_x < 0 ? margin : @size_x
|
|
1028
|
+
else
|
|
1029
|
+
raise_is @size_x
|
|
1030
|
+
end
|
|
1031
|
+
end
|
|
1032
|
+
|
|
1033
|
+
def min_size_x_limit limit, margin
|
|
1034
|
+
case limit
|
|
1035
|
+
when Fit
|
|
1036
|
+
fit_size_x
|
|
1037
|
+
when Auto
|
|
1038
|
+
@area.size_x
|
|
1039
|
+
when Numeric
|
|
1040
|
+
limit < 0 ? margin : limit
|
|
1041
|
+
when Range
|
|
1042
|
+
min_size_x_limit limit.begin, margin
|
|
1043
|
+
else
|
|
1044
|
+
margin
|
|
1045
|
+
end
|
|
1046
|
+
end
|
|
1047
|
+
|
|
1048
|
+
def get_size_x reference_size_x = nil, size_y = nil
|
|
1049
|
+
get_size_x_limited @size_x, @size_x_limit, reference_size_x, size_y
|
|
1050
|
+
end
|
|
1051
|
+
|
|
1052
|
+
def get_size_x_limited size_x, limit, reference_size_x, size_y = nil
|
|
1053
|
+
value = get_size_x_value size_x, reference_size_x, size_y
|
|
1054
|
+
case limit
|
|
1055
|
+
when nil
|
|
1056
|
+
value
|
|
1057
|
+
when Range
|
|
1058
|
+
value = [value, get_size_x_value(limit.begin, reference_size_x, size_y)].max if limit.begin
|
|
1059
|
+
value = [value, get_size_x_value(limit.end, reference_size_x, size_y)].min if limit.end
|
|
1060
|
+
value
|
|
1061
|
+
else
|
|
1062
|
+
[value, get_size_x_value(limit, reference_size_x, size_y)].min
|
|
1063
|
+
end
|
|
1064
|
+
end
|
|
1065
|
+
|
|
1066
|
+
def get_size_x_rational pad, rational, reference_size_x
|
|
1067
|
+
@pads_layout.get_size_x_rational self, reference_size_x, pad, rational
|
|
1068
|
+
end
|
|
1069
|
+
|
|
1070
|
+
def get_size_x_value size_x, reference_size_x, size_y
|
|
1071
|
+
case size_x
|
|
1072
|
+
when Rational
|
|
1073
|
+
@lower_pad.get_size_x_rational self, size_x, reference_size_x || @lower_pad.get_size_x
|
|
1074
|
+
when Proc
|
|
1075
|
+
size_x[reference_size_x || @lower_pad.get_size_x]
|
|
1076
|
+
when Fit
|
|
1077
|
+
fit_size_x
|
|
1078
|
+
when Auto
|
|
1079
|
+
@area.size_x
|
|
1080
|
+
when :y
|
|
1081
|
+
size_y || get_size_y
|
|
1082
|
+
when :y_2
|
|
1083
|
+
(size_y || get_size_y) * 0.5
|
|
1084
|
+
when Numeric
|
|
1085
|
+
size_x < 0 ? (reference_size_x || @lower_pad.get_size_x) + size_x : size_x
|
|
1086
|
+
else
|
|
1087
|
+
raise_ia size_x
|
|
1088
|
+
end
|
|
1089
|
+
end
|
|
1090
|
+
|
|
1091
|
+
def fit_size_y
|
|
1092
|
+
@margin_ys + @margin_ye + @pads_layout.fit_size_y(self)
|
|
1093
|
+
end
|
|
1094
|
+
|
|
1095
|
+
def min_size_y
|
|
1096
|
+
margin = @margin_ys + @margin_ye
|
|
1097
|
+
value = min_size_y_value margin
|
|
1098
|
+
value = [value, min_size_y_limit(@size_y_limit, margin)].max if @size_y_limit
|
|
1099
|
+
value
|
|
1100
|
+
end
|
|
1101
|
+
|
|
1102
|
+
def min_size_y_value margin
|
|
1103
|
+
case @size_y
|
|
1104
|
+
when Rational, Proc
|
|
1105
|
+
margin
|
|
1106
|
+
when Fit
|
|
1107
|
+
fit_size_y
|
|
1108
|
+
when Auto
|
|
1109
|
+
@area.size_y
|
|
1110
|
+
when :x
|
|
1111
|
+
get_size_x
|
|
1112
|
+
when Numeric
|
|
1113
|
+
@size_y < 0 ? margin : @size_y
|
|
1114
|
+
else
|
|
1115
|
+
raise_is @size_y
|
|
1116
|
+
end
|
|
1117
|
+
end
|
|
1118
|
+
|
|
1119
|
+
def min_size_y_limit limit, margin
|
|
1120
|
+
case limit
|
|
1121
|
+
when Fit
|
|
1122
|
+
fit_size_y
|
|
1123
|
+
when Auto
|
|
1124
|
+
@area.size_y
|
|
1125
|
+
when Numeric
|
|
1126
|
+
limit < 0 ? margin : limit
|
|
1127
|
+
when Range
|
|
1128
|
+
min_size_y_limit limit.begin, margin
|
|
1129
|
+
else
|
|
1130
|
+
margin
|
|
1131
|
+
end
|
|
1132
|
+
end
|
|
1133
|
+
|
|
1134
|
+
def get_size_y reference_size_y = nil, size_x = nil
|
|
1135
|
+
get_size_y_limited @size_y, @size_y_limit, reference_size_y, size_x
|
|
1136
|
+
end
|
|
1137
|
+
|
|
1138
|
+
def get_size_y_limited size_y, limit, reference_size_y, size_x = nil
|
|
1139
|
+
value = get_size_y_value size_y, reference_size_y, size_x
|
|
1140
|
+
case limit
|
|
1141
|
+
when nil
|
|
1142
|
+
value
|
|
1143
|
+
when Range
|
|
1144
|
+
value = [value, get_size_y_value(limit.begin, reference_size_y, size_x)].max if limit.begin
|
|
1145
|
+
value = [value, get_size_y_value(limit.end, reference_size_y, size_x)].min if limit.end
|
|
1146
|
+
value
|
|
1147
|
+
else
|
|
1148
|
+
[value, get_size_y_value(limit, reference_size_y, size_x)].min
|
|
1149
|
+
end
|
|
1150
|
+
end
|
|
1151
|
+
|
|
1152
|
+
def get_size_y_rational pad, rational, reference_size_y
|
|
1153
|
+
@pads_layout.get_size_y_rational self, reference_size_y, pad, rational
|
|
1154
|
+
end
|
|
1155
|
+
|
|
1156
|
+
def get_size_y_value size_y, reference_size_y, size_x
|
|
1157
|
+
case size_y
|
|
1158
|
+
when Rational
|
|
1159
|
+
@lower_pad.get_size_y_rational self, size_y, reference_size_y || @lower_pad.get_size_y
|
|
1160
|
+
when Proc
|
|
1161
|
+
size_y[reference_size_y || @lower_pad.get_size_y]
|
|
1162
|
+
when Fit
|
|
1163
|
+
fit_size_y
|
|
1164
|
+
when Auto
|
|
1165
|
+
@area.size_y
|
|
1166
|
+
when :w
|
|
1167
|
+
size_x || get_size_x
|
|
1168
|
+
when Numeric
|
|
1169
|
+
size_y < 0 ? (reference_size_y || @lower_pad.get_size_y) + size_y : size_y
|
|
1170
|
+
else
|
|
1171
|
+
raise_ia size_y
|
|
1172
|
+
end
|
|
1173
|
+
end
|
|
1174
|
+
|
|
1175
|
+
def update_margin
|
|
1176
|
+
x = @margin_xs.floor
|
|
1177
|
+
y = @margin_ys.floor
|
|
1178
|
+
@clip_scene.set_xy x, y
|
|
1179
|
+
@clip_area.set_xy x, y
|
|
1180
|
+
end
|
|
1181
|
+
|
|
1182
|
+
def update_scenic scenic
|
|
1183
|
+
displayed_before = displayed
|
|
1184
|
+
@scene.update_scenic scenic
|
|
1185
|
+
displayed_after = displayed
|
|
1186
|
+
if displayed_before != displayed_after
|
|
1187
|
+
if displayed_after
|
|
1188
|
+
report ShowEvent.new, false
|
|
1189
|
+
@pads.each &:show_propagate
|
|
1190
|
+
else
|
|
1191
|
+
report HideEvent.new, false
|
|
1192
|
+
@pads.each &:hide_propagate
|
|
1193
|
+
end
|
|
1194
|
+
end
|
|
1195
|
+
end
|
|
1196
|
+
|
|
1197
|
+
def get_scenic
|
|
1198
|
+
@scene.scenic
|
|
1199
|
+
end
|
|
1200
|
+
|
|
1201
|
+
def show_propagate
|
|
1202
|
+
if scenic
|
|
1203
|
+
report ShowEvent.new, false
|
|
1204
|
+
@pads.each &:show_propagate
|
|
1205
|
+
end
|
|
1206
|
+
end
|
|
1207
|
+
|
|
1208
|
+
def hide_propagate
|
|
1209
|
+
if scenic
|
|
1210
|
+
report HideEvent.new, false
|
|
1211
|
+
@pads.each &:hide_propagate
|
|
1212
|
+
end
|
|
1213
|
+
end
|
|
1214
|
+
|
|
1215
|
+
def point_pads x, y, pads, force = false
|
|
1216
|
+
if force || (mousy && scenic && include_point(x, y))
|
|
1217
|
+
pads << self
|
|
1218
|
+
x -= @clip_scene.x
|
|
1219
|
+
y -= @clip_scene.y
|
|
1220
|
+
@pads.reverse_each.find{ _1.point_pads x - _1.area_x, y - _1.area_y, pads }
|
|
1221
|
+
return true
|
|
1222
|
+
end
|
|
1223
|
+
return false
|
|
1224
|
+
end
|
|
1225
|
+
|
|
1226
|
+
def keyboard_request
|
|
1227
|
+
layer&.update_keyboard_pad self
|
|
1228
|
+
end
|
|
1229
|
+
|
|
1230
|
+
def keyboard_dispose
|
|
1231
|
+
layer.update_keyboard_pad if keyboard_in
|
|
1232
|
+
end
|
|
1233
|
+
|
|
1234
|
+
def check_mouse_in pad
|
|
1235
|
+
is pad or find_lower pad
|
|
1236
|
+
end
|
|
1237
|
+
|
|
1238
|
+
def pin_request xy = nil, button = nil, drag = false
|
|
1239
|
+
layer&.update_pin_pad self, xy, button, drag
|
|
1240
|
+
end
|
|
1241
|
+
|
|
1242
|
+
def pin_dispose button = nil
|
|
1243
|
+
layer&.update_pin_pad nil if !button || button == layer&.pin_button
|
|
1244
|
+
end
|
|
1245
|
+
|
|
1246
|
+
def drag_check bxy, xy
|
|
1247
|
+
(bxy[0] - xy[0]) ** 2 + (bxy[1] - xy[1]) ** 2 > 100
|
|
1248
|
+
end
|
|
1249
|
+
|
|
1250
|
+
def request_vision x = 0, y = 0
|
|
1251
|
+
report VisionOfferEvent.new *area_size, x, y
|
|
1252
|
+
end
|
|
1253
|
+
|
|
1254
|
+
def translate x = 0, y = 0, target = nil
|
|
1255
|
+
lower = lower_pad
|
|
1256
|
+
case target
|
|
1257
|
+
when self
|
|
1258
|
+
when nil
|
|
1259
|
+
return lower.translate x + area_x, y + area_y, false if lower
|
|
1260
|
+
when false
|
|
1261
|
+
return lower.translate x + area_x + clip_x, y + area_y + clip_y, false if lower
|
|
1262
|
+
else
|
|
1263
|
+
xy = lower.translate x + area_x + clip_x, y + area_y + clip_y
|
|
1264
|
+
xy = target.translate -xy[0], -xy[1]
|
|
1265
|
+
return [-xy[0], -xy[1]]
|
|
1266
|
+
end
|
|
1267
|
+
return [x, y]
|
|
1268
|
+
end
|
|
1269
|
+
|
|
1270
|
+
def report event, path = true, instant = false
|
|
1271
|
+
super(event, path == true ? lower_pad_iterator.to_a.reverse : path, instant)
|
|
1272
|
+
end
|
|
1273
|
+
|
|
1274
|
+
def c_set_lower at
|
|
1275
|
+
return if @lower_pad
|
|
1276
|
+
pad = @lower.is(Pad) || @lower.find_lower(Pad)
|
|
1277
|
+
pad_attach pad, at
|
|
1278
|
+
end
|
|
1279
|
+
|
|
1280
|
+
def pad_attach lower, at
|
|
1281
|
+
@lower_pad = lower
|
|
1282
|
+
@lower_pad&.put_pad self, at
|
|
1283
|
+
end
|
|
1284
|
+
|
|
1285
|
+
def default_text text
|
|
1286
|
+
put TextPad, text
|
|
1287
|
+
end
|
|
1288
|
+
end
|
|
1289
|
+
end
|
|
1290
|
+
end
|