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,154 @@
|
|
|
1
|
+
|
|
2
|
+
module Kredki
|
|
3
|
+
class Keyboard
|
|
4
|
+
# Decodes key modifiers.
|
|
5
|
+
module ModifiersDecoder
|
|
6
|
+
|
|
7
|
+
# Get whether key modifiers match given criteria.
|
|
8
|
+
def match shift: false, alt: false, ctrl: false, windows: false, num_lock: :any, caps_lock: :any, scroll_lock: :any
|
|
9
|
+
mod = modifiers
|
|
10
|
+
|
|
11
|
+
case shift
|
|
12
|
+
when :left
|
|
13
|
+
return false if mod & 0b0000_0000_0000_0001 == 0
|
|
14
|
+
when :right
|
|
15
|
+
return false if mod & 0b0000_0000_0000_0010 == 0
|
|
16
|
+
when true
|
|
17
|
+
return false if mod & 0b0000_0000_0000_0011 == 0
|
|
18
|
+
when false
|
|
19
|
+
return false if mod & 0b0000_0000_0000_0011 != 0
|
|
20
|
+
when :any
|
|
21
|
+
else raise_ia shift
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
case alt
|
|
25
|
+
when :left
|
|
26
|
+
return false if mod & 0b0000_0001_0000_0000 == 0
|
|
27
|
+
when :right
|
|
28
|
+
return false if mod & 0b0000_0010_0000_0000 == 0
|
|
29
|
+
when true
|
|
30
|
+
return false if mod & 0b0000_0011_0000_0000 == 0
|
|
31
|
+
when false
|
|
32
|
+
return false if mod & 0b0000_0011_0000_0000 != 0
|
|
33
|
+
when :any
|
|
34
|
+
else raise_ia shift
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
case ctrl
|
|
38
|
+
when :left
|
|
39
|
+
return false if mod & 0b0000_0000_0100_0000 == 0
|
|
40
|
+
when :right
|
|
41
|
+
return false if mod & 0b0000_0000_1000_0000 == 0
|
|
42
|
+
when true
|
|
43
|
+
return false if mod & 0b0000_0000_1100_0000 == 0
|
|
44
|
+
when false
|
|
45
|
+
return false if mod & 0b0000_0000_1100_0000 != 0
|
|
46
|
+
when :any
|
|
47
|
+
else raise_ia shift
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
case windows
|
|
51
|
+
when true
|
|
52
|
+
return false if mod & 0b0000_0100_0000_0000 == 0
|
|
53
|
+
when false
|
|
54
|
+
return false if mod & 0b0000_0100_0000_0000 != 0
|
|
55
|
+
when :any
|
|
56
|
+
else raise_ia shift
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
case num_lock
|
|
60
|
+
when true
|
|
61
|
+
return false if mod & 0b0001_0000_0000_0000 == 0
|
|
62
|
+
when false
|
|
63
|
+
return false if mod & 0b0001_0000_0000_0000 != 0
|
|
64
|
+
when :any
|
|
65
|
+
else raise_ia shift
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
case caps_lock
|
|
69
|
+
when true
|
|
70
|
+
return false if mod & 0b0010_0000_0000_0000 == 0
|
|
71
|
+
when false
|
|
72
|
+
return false if mod & 0b0010_0000_0000_0000 != 0
|
|
73
|
+
when :any
|
|
74
|
+
else raise_ia shift
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
case scroll_lock
|
|
78
|
+
when true
|
|
79
|
+
return false if mod & 0b1000_0000_0000_0000 == 0
|
|
80
|
+
when false
|
|
81
|
+
return false if mod & 0b1000_0000_0000_0000 != 0
|
|
82
|
+
when :any
|
|
83
|
+
else raise_ia shift
|
|
84
|
+
end
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Get whether left shift is pressed.
|
|
89
|
+
def left_shift?
|
|
90
|
+
modifiers & 0b0000_0000_0000_0001 != 0
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Get whether right shift is pressed.
|
|
94
|
+
def right_shift?
|
|
95
|
+
modifiers & 0b0000_0000_0000_0010 != 0
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Get whether left alt is pressed.
|
|
99
|
+
def left_alt?
|
|
100
|
+
modifiers & 0b0000_0001_0000_0000 != 0
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Get whether right alt is pressed.
|
|
104
|
+
def right_alt?
|
|
105
|
+
modifiers & 0b0000_0010_0000_0000 != 0
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Get whether left ctrl is pressed (or right alt).
|
|
109
|
+
def left_ctrl?
|
|
110
|
+
modifiers & 0b0000_0000_0100_0000 != 0
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Get whether right ctrl is pressed.
|
|
114
|
+
def right_ctrl?
|
|
115
|
+
modifiers & 0b0000_0000_1000_0000 != 0
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Get whether ctrl is pressed.
|
|
119
|
+
def ctrl?
|
|
120
|
+
left_ctrl? || right_ctrl?
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Get whether alt is pressed.
|
|
124
|
+
def alt?
|
|
125
|
+
left_alt? || right_alt?
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Get whether shift is pressed.
|
|
129
|
+
def shift?
|
|
130
|
+
left_shift? || right_shift?
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Get whether windows key is pressed.
|
|
134
|
+
def windows?
|
|
135
|
+
modifiers & 0b0000_0100_0000_0000 != 0
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Get whether num lock is on.
|
|
139
|
+
def num_lock?
|
|
140
|
+
modifiers & 0b0001_0000_0000_0000 != 0
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Get whether caps lock is on.
|
|
144
|
+
def caps_lock?
|
|
145
|
+
modifiers & 0b0010_0000_0000_0000 != 0
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Get whether scroll lock is on.
|
|
149
|
+
def scroll_lock?
|
|
150
|
+
modifiers & 0b1000_0000_0000_0000 != 0
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
# Mouse device model.
|
|
3
|
+
class Mouse
|
|
4
|
+
# Mouse button model.
|
|
5
|
+
class Button
|
|
6
|
+
|
|
7
|
+
# Get button id.
|
|
8
|
+
def id
|
|
9
|
+
@id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Get button code.
|
|
13
|
+
def code
|
|
14
|
+
@code
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# :section: LEVEL 2
|
|
18
|
+
|
|
19
|
+
def initialize id, code
|
|
20
|
+
@id = id
|
|
21
|
+
@code = code
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def ==(other)
|
|
25
|
+
Button === other &&
|
|
26
|
+
@code == other.code &&
|
|
27
|
+
@id == other.id
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Get button codes.
|
|
32
|
+
def indexes input
|
|
33
|
+
input.map{ button(_1).code }.uniq
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Set wheel speed.
|
|
37
|
+
def set_scroll_speed speed = @scroll_speed
|
|
38
|
+
return set_scroll_speed yield @scroll_speed if block_given?
|
|
39
|
+
@scroll_speed = speed
|
|
40
|
+
true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# See #set_scroll_speed.
|
|
44
|
+
def scroll_speed= param
|
|
45
|
+
set_scroll_speed param
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Get wheel speed.
|
|
49
|
+
def scroll_speed
|
|
50
|
+
@scroll_speed
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Set alternative wheel speed.
|
|
54
|
+
def set_scroll_speed_alt speed = @scroll_speed_alt
|
|
55
|
+
return set_scroll_speed_alt yield @scroll_speed_alt if block_given?
|
|
56
|
+
@scroll_speed_alt = speed
|
|
57
|
+
true
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# See #set_scroll_speed_alt.
|
|
61
|
+
def scroll_speed_alt= param
|
|
62
|
+
set_scroll_speed_alt param
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Get alternative wheel speed.
|
|
66
|
+
def scroll_speed_alt
|
|
67
|
+
@scroll_speed_alt
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Set button.
|
|
71
|
+
def button! id, code
|
|
72
|
+
button = @button_map[id] = Button.new id, code
|
|
73
|
+
@buttoncode_map[code] ||= button
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Get button.
|
|
77
|
+
def button param
|
|
78
|
+
case param
|
|
79
|
+
when Button
|
|
80
|
+
param
|
|
81
|
+
else
|
|
82
|
+
@buttoncode_map[param] or @button_map[param] or raise "Unknown button #{param.inspect}"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Get whether button is pressed.
|
|
87
|
+
def pressed? id = :primary
|
|
88
|
+
b = button id
|
|
89
|
+
Pastele.mouse_get_button_state(b.code) != 0 if b
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Get pointer position along X axis.
|
|
93
|
+
def x
|
|
94
|
+
xy[0]
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Get pointer position along Y axis.
|
|
98
|
+
def y
|
|
99
|
+
xy[1]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Get pointer position along X and Y axes.
|
|
103
|
+
def xy
|
|
104
|
+
point = Pastele::Point.malloc(Fiddle::RUBY_FREE)
|
|
105
|
+
Pastele.mouse_get_cursor_position point
|
|
106
|
+
[point.x, point.y]
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Set whether capture mode is on.
|
|
110
|
+
def set_capture value = true
|
|
111
|
+
return if (c = capture) == (value = block_given? ? yield(c) : value == Not ? !c : value)
|
|
112
|
+
Pastele.mouse_set_capture capture ? 1 : 0
|
|
113
|
+
true
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# See #set_capture.
|
|
117
|
+
def capture= param
|
|
118
|
+
set_caupture param
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Set cursor.
|
|
122
|
+
def set_cursor cursor = @cursor
|
|
123
|
+
return send_bundle :set_cursor, yield(self.cursor) if block_given?
|
|
124
|
+
return if @cursor == cursor
|
|
125
|
+
@cursor = cursor
|
|
126
|
+
update_cursor cursor
|
|
127
|
+
true
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# See #set_cursor.
|
|
131
|
+
def cursor= param
|
|
132
|
+
send_bundle :set_cursor, param
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Get cursor.
|
|
136
|
+
def cursor
|
|
137
|
+
@cursor
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# :section: LEVEL 2
|
|
141
|
+
|
|
142
|
+
def initialize
|
|
143
|
+
@button_map = {}
|
|
144
|
+
@buttoncode_map = {}
|
|
145
|
+
@scroll_speed = 1.0
|
|
146
|
+
@scroll_speed_alt = 0.5
|
|
147
|
+
@cursor = nil
|
|
148
|
+
@system_cursors = {}
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def wheel_scroll_event pastele_event
|
|
152
|
+
MouseWheelScrollEvent.new self, pastele_event
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def pointer_move_event pastele_event
|
|
156
|
+
MousePointerMoveEvent.new self, pastele_event
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def button_press_event pastele_event
|
|
160
|
+
MouseButtonPressEvent.new self, pastele_event
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def button_release_event pastele_event
|
|
164
|
+
MouseButtonReleaseEvent.new self, pastele_event
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def update_cursor cursor
|
|
168
|
+
Pastele.mouse_set_cursor case cursor
|
|
169
|
+
when nil, :default then system_cursor 0
|
|
170
|
+
when :text then system_cursor 1
|
|
171
|
+
when :wait then system_cursor 2
|
|
172
|
+
when :crosshair then system_cursor 3
|
|
173
|
+
when :progress then system_cursor 4
|
|
174
|
+
when :resize_ssee, :resize_eess then system_cursor 5
|
|
175
|
+
when :resize_sees, :resize_esse then system_cursor 6
|
|
176
|
+
when :resize_x then system_cursor 7
|
|
177
|
+
when :resize_y then system_cursor 8
|
|
178
|
+
when :move then system_cursor 9
|
|
179
|
+
when :not_allowed then system_cursor 10
|
|
180
|
+
when :pointer then system_cursor 11
|
|
181
|
+
when :resize_ss then system_cursor 12
|
|
182
|
+
when :resize_ys then system_cursor 13
|
|
183
|
+
when :resize_es then system_cursor 14
|
|
184
|
+
when :resize_xe then system_cursor 15
|
|
185
|
+
when :resize_ee then system_cursor 16
|
|
186
|
+
when :resize_ye then system_cursor 17
|
|
187
|
+
when :resize_se then system_cursor 18
|
|
188
|
+
when :resize_xs then system_cursor 19
|
|
189
|
+
when :count then system_cursor 20
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def system_cursor cursor
|
|
194
|
+
@system_cursors[cursor] ||= Pastele.mouse_create_system_cursor cursor
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
end
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
# Picture that may change over time.
|
|
3
|
+
class Animation
|
|
4
|
+
|
|
5
|
+
# Set animation content.
|
|
6
|
+
def set_content ...
|
|
7
|
+
if @picture.set_content(...)
|
|
8
|
+
@duration = (Pastele.animation_get_duration(@pointer) * 1000).to_i
|
|
9
|
+
@total_frames = Pastele.animation_get_total_frames @pointer
|
|
10
|
+
@frame = 0
|
|
11
|
+
true
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# See #set_content.
|
|
16
|
+
def content= param
|
|
17
|
+
send_bundle :set_content, param
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Get content.
|
|
21
|
+
def content
|
|
22
|
+
@content
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Set size in X axis.
|
|
26
|
+
def set_size_x ...
|
|
27
|
+
@picture.set_size_x(...)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# See: #set_size_x
|
|
31
|
+
def size_= param
|
|
32
|
+
@picture.size_x = param
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Get size in X axis.
|
|
36
|
+
def size_x
|
|
37
|
+
@picture.size_x
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Set size in Y axis.
|
|
41
|
+
def set_size_y ...
|
|
42
|
+
@picture.set_size_y(...)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# See: #set_size_y
|
|
46
|
+
def size_y= param
|
|
47
|
+
@picture.size_y = param
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Get size in Y axis.
|
|
51
|
+
def size_y
|
|
52
|
+
@picture.size_y
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Set size.
|
|
56
|
+
def set_size ...
|
|
57
|
+
@picture.set_size(...)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# See: #set_size
|
|
61
|
+
def size= param
|
|
62
|
+
@picture.size = param
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Get size.
|
|
66
|
+
def size
|
|
67
|
+
@picture.size
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Set turn value.
|
|
71
|
+
def set_turn ...
|
|
72
|
+
@picture.set_turn(...)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# See: #set_turn
|
|
76
|
+
def turn= param
|
|
77
|
+
@picture.turn = param
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Get turn value.
|
|
81
|
+
def turn
|
|
82
|
+
@picture.turn
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Set zoom in the X axis.
|
|
86
|
+
def set_zoom_x ...
|
|
87
|
+
@picture.set_zoom_x(...)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# See: #set_zoom_x
|
|
91
|
+
def zoom_x= param
|
|
92
|
+
@picture.zoom_x = param
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Get zoom in the X axis.
|
|
96
|
+
def zoom_x
|
|
97
|
+
@picture.zoom_x
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Set zoom in the Y axis.
|
|
101
|
+
def set_zoom_y ...
|
|
102
|
+
@picture.set_zoom_y(...)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# See: #set_zoom_y
|
|
106
|
+
def zoom_y= param
|
|
107
|
+
@picture.zoom_y = param
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Get zoom in the Y axis.
|
|
111
|
+
def zoom_y
|
|
112
|
+
@picture.zoom_y
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Set zoom.
|
|
116
|
+
def set_zoom ...
|
|
117
|
+
@picture.set_zoom(...)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# See: #set_zoom
|
|
121
|
+
def zoom= param
|
|
122
|
+
@picture.zoom = param
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Get zoom.
|
|
126
|
+
def zoom
|
|
127
|
+
@picture.zoom
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Check wheather [+x+, +y+] is inside.
|
|
131
|
+
def include_point ...
|
|
132
|
+
@picture.include_point(...)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Set current animation frame ms.
|
|
136
|
+
def set_frame frame = @frame
|
|
137
|
+
return set_frame yield @frame if block_given?
|
|
138
|
+
return if @frame == frame
|
|
139
|
+
update_frame frame * @total_frames
|
|
140
|
+
@frame = frame
|
|
141
|
+
true
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# See #set_frame.
|
|
145
|
+
def frame= param
|
|
146
|
+
send_bundle :set_frame, param
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Get current animation frame ms.
|
|
150
|
+
def frame
|
|
151
|
+
@frame
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Get duration.
|
|
155
|
+
def duration
|
|
156
|
+
@duration
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Set animated segment.
|
|
160
|
+
def set_segment *segment
|
|
161
|
+
Pastele.animation_set_segment @pointer, *segment
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Attach related Kredki::Picture to the Kredki::Scene.
|
|
165
|
+
def attach scene, scenic = true, at = nil
|
|
166
|
+
@picture.attach scene, scenic, at
|
|
167
|
+
self
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Detach related Kredki::Picture from the Kredki::Scene.
|
|
171
|
+
def detach
|
|
172
|
+
@picture.detach
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Set whether Animation is scenic.
|
|
176
|
+
#
|
|
177
|
+
# All lower level Scenes must be scenic for the Animation to be displayed.
|
|
178
|
+
def set_scenic value = true
|
|
179
|
+
return if (c = scenic) == (value = block_given? ? yield(c) : value == Not ? !c : value)
|
|
180
|
+
update_scenic value
|
|
181
|
+
true
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# See #set_scenic.
|
|
185
|
+
def scenic= value
|
|
186
|
+
set_scenic value
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Get whether Animation is scenic.
|
|
190
|
+
def scenic
|
|
191
|
+
get_scenic
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Set a feature recognized by its class.
|
|
195
|
+
def << feature
|
|
196
|
+
case feature
|
|
197
|
+
in [x, y]
|
|
198
|
+
set_size x, y
|
|
199
|
+
in Numeric
|
|
200
|
+
set_size feature
|
|
201
|
+
in String
|
|
202
|
+
set_content feature
|
|
203
|
+
else
|
|
204
|
+
super
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# :section: LEVEL 2
|
|
209
|
+
|
|
210
|
+
def initialize
|
|
211
|
+
@pointer = Pastele.animation_new
|
|
212
|
+
ObjectSpace.define_finalizer(self, Animation.finalizer(@pointer))
|
|
213
|
+
|
|
214
|
+
@picture = Picture.new Pastele.animation_get_picture @pointer
|
|
215
|
+
@total_frames = nil
|
|
216
|
+
@duration = nil
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
def self.finalizer pointer
|
|
220
|
+
proc{ Pastele.animation_delete pointer }
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
attr :pointer
|
|
224
|
+
attr :picture
|
|
225
|
+
|
|
226
|
+
def scene
|
|
227
|
+
@picture.scene
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
def scene= scene
|
|
231
|
+
@picture.scene = scene
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
def update_scenic scenic
|
|
235
|
+
@picture.update_scenic scenic
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
def get_scenic
|
|
239
|
+
@picture.get_scenic
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
def update_frame frame_index
|
|
243
|
+
Pastele.animation_set_frame @pointer, frame_index
|
|
244
|
+
@picture.update
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
module Kredki
|
|
2
|
+
module Area
|
|
3
|
+
|
|
4
|
+
# Set size in X axis.
|
|
5
|
+
def set_size_x size_x = @size_x
|
|
6
|
+
return set_size_x yield @size_x if block_given?
|
|
7
|
+
return if @size_x == size_x
|
|
8
|
+
@size_x = size_x
|
|
9
|
+
@redraw_flag = true
|
|
10
|
+
update
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# See #set_size_x.
|
|
14
|
+
def size_x= param
|
|
15
|
+
send_bundle :set_size_x, param
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Get size in X axis.
|
|
19
|
+
def size_x
|
|
20
|
+
@size_x
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Set size in Y axis.
|
|
24
|
+
def set_size_y size_y = @size_y
|
|
25
|
+
return set_size_y yield @size_y if block_given?
|
|
26
|
+
return if @size_y == size_y
|
|
27
|
+
@size_y = size_y
|
|
28
|
+
@redraw_flag = true
|
|
29
|
+
update
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# See #set_size_y.
|
|
33
|
+
def size_y= param
|
|
34
|
+
send_bundle :set_size_y, param
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Get size in Y axis.
|
|
38
|
+
def size_y
|
|
39
|
+
@size_y
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Set size.
|
|
43
|
+
def set_size size_x = @size_x, size_y = size_x
|
|
44
|
+
return send_bundle :set_size, yield(self.size) if block_given?
|
|
45
|
+
return if @size_x == size_x && @size_y == size_y
|
|
46
|
+
@size_x = size_x
|
|
47
|
+
@size_y = size_y
|
|
48
|
+
@redraw_flag = true
|
|
49
|
+
update
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# See #set_size.
|
|
53
|
+
def size= param
|
|
54
|
+
send_bundle :set_size, param
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Get size.
|
|
58
|
+
def size
|
|
59
|
+
[@size_x, @size_y]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Check wheather [+x+, +y+] is inside the Area.
|
|
63
|
+
def include_point x, y
|
|
64
|
+
x <= @size_x && y <= @size_y && x >= 0 && y >= 0
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|