lacci 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +79 -0
- data/Rakefile +1 -4
- data/lib/lacci/scarpe_cli.rb +71 -0
- data/lib/lacci/scarpe_core.rb +22 -0
- data/lib/lacci/version.rb +13 -0
- data/lib/scarpe/niente/app.rb +23 -0
- data/lib/scarpe/niente/display_service.rb +62 -0
- data/lib/scarpe/niente/drawable.rb +57 -0
- data/lib/scarpe/niente/logger.rb +29 -0
- data/lib/scarpe/niente/shoes_spec.rb +87 -0
- data/lib/scarpe/niente.rb +20 -0
- data/lib/shoes/app.rb +165 -43
- data/lib/{scarpe → shoes}/background.rb +2 -2
- data/lib/{scarpe → shoes}/border.rb +2 -2
- data/lib/shoes/builtins.rb +63 -0
- data/lib/shoes/changelog.rb +52 -0
- data/lib/{scarpe → shoes}/colors.rb +3 -1
- data/lib/shoes/constants.rb +24 -3
- data/lib/{scarpe → shoes}/display_service.rb +45 -23
- data/lib/{scarpe → shoes}/download.rb +7 -7
- data/lib/shoes/drawable.rb +380 -0
- data/lib/shoes/drawables/arc.rb +49 -0
- data/lib/shoes/drawables/arrow.rb +41 -0
- data/lib/shoes/drawables/button.rb +73 -0
- data/lib/shoes/drawables/check.rb +29 -0
- data/lib/{scarpe → shoes/drawables}/document_root.rb +5 -5
- data/lib/{scarpe → shoes/drawables}/edit_box.rb +6 -6
- data/lib/{scarpe → shoes/drawables}/edit_line.rb +6 -6
- data/lib/shoes/drawables/flow.rb +22 -0
- data/lib/{scarpe → shoes/drawables}/image.rb +7 -13
- data/lib/shoes/drawables/line.rb +20 -0
- data/lib/shoes/drawables/link.rb +34 -0
- data/lib/shoes/drawables/list_box.rb +56 -0
- data/lib/shoes/drawables/para.rb +118 -0
- data/lib/shoes/drawables/progress.rb +14 -0
- data/lib/shoes/drawables/radio.rb +33 -0
- data/lib/shoes/drawables/rect.rb +17 -0
- data/lib/shoes/drawables/shape.rb +36 -0
- data/lib/shoes/drawables/slot.rb +87 -0
- data/lib/{scarpe → shoes/drawables}/span.rb +8 -7
- data/lib/{scarpe → shoes/drawables}/stack.rb +10 -4
- data/lib/shoes/drawables/star.rb +50 -0
- data/lib/shoes/drawables/subscription_item.rb +93 -0
- data/lib/shoes/drawables/text_drawable.rb +63 -0
- data/lib/shoes/drawables/video.rb +16 -0
- data/lib/shoes/drawables/widget.rb +69 -0
- data/lib/shoes/drawables.rb +31 -0
- data/lib/shoes/errors.rb +28 -0
- data/lib/shoes/log.rb +71 -0
- data/lib/shoes/ruby_extensions.rb +15 -0
- data/lib/shoes/spacing.rb +9 -0
- data/lib/shoes-spec.rb +93 -0
- data/lib/shoes.rb +93 -11
- metadata +67 -557
- data/.rubocop.yml +0 -85
- data/.ruby-version +0 -1
- data/.vscode/extensions.json +0 -5
- data/.yardopts +0 -12
- data/CHANGELOG.md +0 -19
- data/CODE_OF_CONDUCT.md +0 -84
- data/CONTRIBUTING.md +0 -20
- data/LICENSE.txt +0 -21
- data/README.md +0 -178
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/dev.yml +0 -7
- data/docs/static/PKGBUILD +0 -47
- data/docs/static/Shoes.icns +0 -0
- data/docs/static/avatar.png +0 -0
- data/docs/static/code_highlighter.js +0 -188
- data/docs/static/code_highlighter_ruby.js +0 -26
- data/docs/static/icon-debug.png +0 -0
- data/docs/static/icon-error.png +0 -0
- data/docs/static/icon-info.png +0 -0
- data/docs/static/icon-warn.png +0 -0
- data/docs/static/listbox_button1.png +0 -0
- data/docs/static/listbox_button2.png +0 -0
- data/docs/static/man-app.png +0 -0
- data/docs/static/man-builds.png +0 -0
- data/docs/static/man-builds1.png +0 -0
- data/docs/static/man-editor-notepad.png +0 -0
- data/docs/static/man-editor-osx.png +0 -0
- data/docs/static/man-ele-background.png +0 -0
- data/docs/static/man-ele-border.png +0 -0
- data/docs/static/man-ele-button.png +0 -0
- data/docs/static/man-ele-check.png +0 -0
- data/docs/static/man-ele-editbox.png +0 -0
- data/docs/static/man-ele-editline.png +0 -0
- data/docs/static/man-ele-image.png +0 -0
- data/docs/static/man-ele-listbox.png +0 -0
- data/docs/static/man-ele-progress.png +0 -0
- data/docs/static/man-ele-radio.png +0 -0
- data/docs/static/man-ele-shape.png +0 -0
- data/docs/static/man-ele-textblock.png +0 -0
- data/docs/static/man-ele-video.png +0 -0
- data/docs/static/man-intro-dmg.png +0 -0
- data/docs/static/man-intro-exe.png +0 -0
- data/docs/static/man-look-tiger.png +0 -0
- data/docs/static/man-look-ubuntu.png +0 -0
- data/docs/static/man-look-vista.png +0 -0
- data/docs/static/man-run-osx.png +0 -0
- data/docs/static/man-run-vista.png +0 -0
- data/docs/static/man-run-xp.png +0 -0
- data/docs/static/man-shot1.png +0 -0
- data/docs/static/manual-en.txt +0 -3529
- data/docs/static/manual-ja.txt +0 -2829
- data/docs/static/manual.css +0 -171
- data/docs/static/manual.md +0 -3528
- data/docs/static/menu-corner1.png +0 -0
- data/docs/static/menu-corner2.png +0 -0
- data/docs/static/menu-gray.png +0 -0
- data/docs/static/menu-left.png +0 -0
- data/docs/static/menu-right.png +0 -0
- data/docs/static/menu-top.png +0 -0
- data/docs/static/shoes-dmg.jpg +0 -0
- data/docs/static/shoes-icon-blue.png +0 -0
- data/docs/static/shoes-icon.png +0 -0
- data/docs/static/shoes-manual-apps.gif +0 -0
- data/docs/static/shoes_main_window.png +0 -0
- data/docs/static/stripe.png +0 -0
- data/docs/static/stubs/blank.exe +0 -0
- data/docs/static/stubs/blank.hfz +0 -0
- data/docs/static/stubs/blank.run +0 -375
- data/docs/static/stubs/cocoa-install +0 -0
- data/docs/static/stubs/sh-install +0 -49
- data/docs/static/stubs/shoes-stub-inject.exe +0 -0
- data/docs/static/stubs/shoes-stub.exe +0 -0
- data/docs/static/tutor-back.png +0 -0
- data/docs/yard/catscradle.md +0 -44
- data/docs/yard/template/default/fulldoc/html/setup.rb +0 -13
- data/docs/yard/template/default/layout/html/setup.rb +0 -9
- data/examples/backdround_with_image.rb +0 -16
- data/examples/bloopsaphone/working/1901_by_Aanand_Prasad.rb +0 -478
- data/examples/bloopsaphone/working/b1.rb +0 -64
- data/examples/bloopsaphone/working/b2.rb +0 -36
- data/examples/bloopsaphone/working/bloops_test.rb +0 -41
- data/examples/bloopsaphone/working/bloopsaphone_theme_song_by_why.rb +0 -31
- data/examples/bloopsaphone/working/feepogram.rb +0 -67
- data/examples/bloopsaphone/working/simpsons_theme_song_by_why.rb +0 -14
- data/examples/bloopsaphone/working/tune_cheeky_drat.rb +0 -210
- data/examples/button.rb +0 -10
- data/examples/button_alert.rb +0 -6
- data/examples/button_go_away.rb +0 -6
- data/examples/button_with_position_and_size.rb +0 -7
- data/examples/coffee.rb +0 -14
- data/examples/download.rb +0 -5
- data/examples/download_and_show_image.rb +0 -28
- data/examples/edit_box.rb +0 -8
- data/examples/edit_line.rb +0 -8
- data/examples/fill.rb +0 -25
- data/examples/flow.rb +0 -11
- data/examples/fonts.rb +0 -6
- data/examples/gen.rb +0 -140
- data/examples/get_headers.rb +0 -10
- data/examples/hello_world.rb +0 -3
- data/examples/highlander.rb +0 -87
- data/examples/image/clickable_image.rb +0 -5
- data/examples/image/image.rb +0 -3
- data/examples/image/image_size.rb +0 -7
- data/examples/image/image_with_position_and_size.rb +0 -3
- data/examples/info.rb +0 -9
- data/examples/legacy/not_checked/expert/colours.rb +0 -105
- data/examples/legacy/not_checked/expert/curve-animation.rb +0 -31
- data/examples/legacy/not_checked/expert/curve-control-point.rb +0 -51
- data/examples/legacy/not_checked/expert/custom-list-box.rb +0 -53
- data/examples/legacy/not_checked/expert/definr.rb +0 -23
- data/examples/legacy/not_checked/expert/funnies.rb +0 -56
- data/examples/legacy/not_checked/expert/minesweeper.rb +0 -267
- data/examples/legacy/not_checked/expert/othello.rb +0 -318
- data/examples/legacy/not_checked/expert/pong.rb +0 -62
- data/examples/legacy/not_checked/expert/tankspank.rb +0 -385
- data/examples/legacy/not_checked/expert/tooltips.rb +0 -45
- data/examples/legacy/not_checked/expert/url.rb +0 -37
- data/examples/legacy/not_checked/expert/video-player.rb +0 -256
- data/examples/legacy/not_checked/good/_why-stories.rb +0 -44
- data/examples/legacy/not_checked/good/_why-stories.yaml +0 -387
- data/examples/legacy/not_checked/good/arc.rb +0 -37
- data/examples/legacy/not_checked/good/cardflip.rb +0 -141
- data/examples/legacy/not_checked/good/clock.rb +0 -51
- data/examples/legacy/not_checked/good/console.rb +0 -21
- data/examples/legacy/not_checked/good/follow.rb +0 -26
- data/examples/legacy/not_checked/good/image-rotate.rb +0 -14
- data/examples/legacy/not_checked/good/paris.svg +0 -7236
- data/examples/legacy/not_checked/good/path-animation.rb +0 -46
- data/examples/legacy/not_checked/good/plots.rb +0 -100
- data/examples/legacy/not_checked/good/reminder.rb +0 -174
- data/examples/legacy/not_checked/good/svgview.rb +0 -113
- data/examples/legacy/not_checked/good/vjot.rb +0 -56
- data/examples/legacy/not_checked/shoes-contrib/.gitignore +0 -2
- data/examples/legacy/not_checked/shoes-contrib/README.md +0 -34
- data/examples/legacy/not_checked/shoes-contrib/animation/animate-ovals.rb +0 -21
- data/examples/legacy/not_checked/shoes-contrib/animation/flowers.rb +0 -59
- data/examples/legacy/not_checked/shoes-contrib/animation/happy-trails.rb +0 -31
- data/examples/legacy/not_checked/shoes-contrib/animation/mice-satellites.rb +0 -27
- data/examples/legacy/not_checked/shoes-contrib/animation/oval-motion.rb +0 -12
- data/examples/legacy/not_checked/shoes-contrib/animation/pink-bubbles.rb +0 -34
- data/examples/legacy/not_checked/shoes-contrib/animation/pulsate.rb +0 -18
- data/examples/legacy/not_checked/shoes-contrib/animation/rotating-star.rb +0 -18
- data/examples/legacy/not_checked/shoes-contrib/app/download-and-save.rb +0 -11
- data/examples/legacy/not_checked/shoes-contrib/app/download.rb +0 -10
- data/examples/legacy/not_checked/shoes-contrib/app/get-google.rb +0 -11
- data/examples/legacy/not_checked/shoes-contrib/app/mouse-detection.rb +0 -7
- data/examples/legacy/not_checked/shoes-contrib/app/resizeable-false.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/art/bubble-bullseye.rb +0 -23
- data/examples/legacy/not_checked/shoes-contrib/art/faded.rb +0 -17
- data/examples/legacy/not_checked/shoes-contrib/art/fill-oval.rb +0 -5
- data/examples/legacy/not_checked/shoes-contrib/art/mask.rb +0 -15
- data/examples/legacy/not_checked/shoes-contrib/art/oval-gradient.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/art/star-gradient.rb +0 -4
- data/examples/legacy/not_checked/shoes-contrib/basic/basic-edit-box.rb +0 -8
- data/examples/legacy/not_checked/shoes-contrib/basic/basic-new-window.rb +0 -8
- data/examples/legacy/not_checked/shoes-contrib/basic/basic-oval-image.rb +0 -8
- data/examples/legacy/not_checked/shoes-contrib/basic/basic-oval-shape.rb +0 -8
- data/examples/legacy/not_checked/shoes-contrib/basic/basic-oval.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/basic/class-book.rb +0 -43
- data/examples/legacy/not_checked/shoes-contrib/basic/class-book.yaml +0 -387
- data/examples/legacy/not_checked/shoes-contrib/basic/clock.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/basic/edit-stack +0 -14
- data/examples/legacy/not_checked/shoes-contrib/basic/gradient-shoes.rb +0 -7
- data/examples/legacy/not_checked/shoes-contrib/basic/list_box-shape-report.rb +0 -19
- data/examples/legacy/not_checked/shoes-contrib/basic/rect-arrow.rb +0 -7
- data/examples/legacy/not_checked/shoes-contrib/basic/scribble.rb +0 -8
- data/examples/legacy/not_checked/shoes-contrib/basic/search.rb +0 -32
- data/examples/legacy/not_checked/shoes-contrib/basic/shoes-notes.rb +0 -16
- data/examples/legacy/not_checked/shoes-contrib/basic/url-shoes-subclassing.rb +0 -24
- data/examples/legacy/not_checked/shoes-contrib/browser.rb +0 -21
- data/examples/legacy/not_checked/shoes-contrib/elements/background-column.rb +0 -3
- data/examples/legacy/not_checked/shoes-contrib/elements/background.rb +0 -4
- data/examples/legacy/not_checked/shoes-contrib/elements/basic-fps.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/elements/border-cat.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/elements/button-block.rb +0 -8
- data/examples/legacy/not_checked/shoes-contrib/elements/check-mate.rb +0 -15
- data/examples/legacy/not_checked/shoes-contrib/elements/common-styles.rb +0 -13
- data/examples/legacy/not_checked/shoes-contrib/elements/displace-animation.rb +0 -13
- data/examples/legacy/not_checked/shoes-contrib/elements/edit_box-character-count.rb +0 -7
- data/examples/legacy/not_checked/shoes-contrib/elements/edit_line-character-count.rb +0 -7
- data/examples/legacy/not_checked/shoes-contrib/elements/image-icon.rb +0 -3
- data/examples/legacy/not_checked/shoes-contrib/elements/list_box-select-class.rb +0 -13
- data/examples/legacy/not_checked/shoes-contrib/elements/list_box.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/elements/move-flow-animate.rb +0 -13
- data/examples/legacy/not_checked/shoes-contrib/elements/phat-button.rb +0 -7
- data/examples/legacy/not_checked/shoes-contrib/elements/popup.rb +0 -7
- data/examples/legacy/not_checked/shoes-contrib/elements/progress-bar.rb +0 -10
- data/examples/legacy/not_checked/shoes-contrib/elements/radio-dreamcast-favs.rb +0 -17
- data/examples/legacy/not_checked/shoes-contrib/elements/timer.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/elements/width-introspec.rb +0 -8
- data/examples/legacy/not_checked/shoes-contrib/events/background-hover.rb +0 -11
- data/examples/legacy/not_checked/shoes-contrib/events/motion-detect.rb +0 -9
- data/examples/legacy/not_checked/shoes-contrib/events/pressed-key.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/expert/expert-funnies.rb +0 -51
- data/examples/legacy/not_checked/shoes-contrib/expert/expert-irb.rb +0 -112
- data/examples/legacy/not_checked/shoes-contrib/expert/expert-othello.rb +0 -319
- data/examples/legacy/not_checked/shoes-contrib/good/good-arc.rb +0 -37
- data/examples/legacy/not_checked/shoes-contrib/good/good-clock.rb +0 -51
- data/examples/legacy/not_checked/shoes-contrib/good/good-follow.rb +0 -26
- data/examples/legacy/not_checked/shoes-contrib/good/good-reminder.rb +0 -174
- data/examples/legacy/not_checked/shoes-contrib/good/good-vjot.rb +0 -56
- data/examples/legacy/not_checked/shoes-contrib/kernel/ask.rb +0 -4
- data/examples/legacy/not_checked/shoes-contrib/kernel/ask_color.rb +0 -4
- data/examples/legacy/not_checked/shoes-contrib/kernel/ask_open_file.rb +0 -4
- data/examples/legacy/not_checked/shoes-contrib/kernel/ask_save_file.rb +0 -7
- data/examples/legacy/not_checked/shoes-contrib/kernel/confirm.rb +0 -3
- data/examples/legacy/not_checked/shoes-contrib/kernel/debug.rb +0 -4
- data/examples/legacy/not_checked/shoes-contrib/kernel/exit.rb +0 -5
- data/examples/legacy/not_checked/shoes-contrib/kernel/font.rb +0 -5
- data/examples/legacy/not_checked/shoes-contrib/kernel/fonts.rb +0 -3
- data/examples/legacy/not_checked/shoes-contrib/manipulation/append-slot.rb +0 -9
- data/examples/legacy/not_checked/shoes-contrib/manipulation/clear-slot.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/manipulation/prepend-slot.rb +0 -6
- data/examples/legacy/not_checked/shoes-contrib/manipulation/roll.rb +0 -17
- data/examples/legacy/not_checked/shoes-contrib/position/gutter-margin.rb +0 -5
- data/examples/legacy/not_checked/shoes-contrib/position/stack-width.rb +0 -3
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-accordion.rb +0 -75
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-anim-shapes.rb +0 -17
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-anim-text.rb +0 -13
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-arc.rb +0 -23
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-bounce.rb +0 -24
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-calc.rb +0 -70
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-chipmunk.rb +0 -26
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-control-sizes.rb +0 -24
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-curve.rb +0 -26
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-dialogs.rb +0 -29
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-downloader.rb +0 -27
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-draw.rb +0 -13
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-editor.rb +0 -28
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-form.rb +0 -28
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-form.shy +0 -0
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-mask.rb +0 -21
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-menu.rb +0 -31
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-menu1.rb +0 -35
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-rubygems.rb +0 -29
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-slide.rb +0 -45
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-sphere.rb +0 -28
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-sqlite3.rb +0 -13
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-timer.rb +0 -13
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-video.rb +0 -13
- data/examples/legacy/not_checked/shoes-contrib/styles/alignment.rb +0 -4
- data/examples/legacy/not_checked/shoes-contrib/styles/attachment.rb +0 -5
- data/examples/legacy/not_checked/shoes-contrib/styles/emphasis.rb +0 -3
- data/examples/legacy/not_checked/shoes-contrib/styles/gradient-angle.rb +0 -3
- data/examples/legacy/not_checked/shoes-contrib/styles/para-methods.rb +0 -5
- data/examples/legacy/not_checked/shoes-contrib/styles/para-red-underlined.rb +0 -3
- data/examples/legacy/not_checked/shoes-contrib/styles/para-style-method.rb +0 -4
- data/examples/legacy/not_checked/shoes-dep-samples/expert-game-of-life.rb +0 -243
- data/examples/legacy/not_checked/shoes-dep-samples/expert-othello.rb +0 -319
- data/examples/legacy/not_checked/shoes-dep-samples/good-clock.rb +0 -51
- data/examples/legacy/not_checked/shoes-dep-samples/good-follow.rb +0 -26
- data/examples/legacy/not_checked/shoes-dep-samples/good-reminder.rb +0 -174
- data/examples/legacy/not_checked/shoes-dep-samples/good-vjot.rb +0 -56
- data/examples/legacy/not_checked/shoes-dep-samples/simple-accordion.rb +0 -75
- data/examples/legacy/not_checked/shoes-dep-samples/simple-anim-shapes.rb +0 -17
- data/examples/legacy/not_checked/shoes-dep-samples/simple-anim-text.rb +0 -13
- data/examples/legacy/not_checked/shoes-dep-samples/simple-arc.rb +0 -23
- data/examples/legacy/not_checked/shoes-dep-samples/simple-bounce.rb +0 -24
- data/examples/legacy/not_checked/shoes-dep-samples/simple-calc.rb +0 -70
- data/examples/legacy/not_checked/shoes-dep-samples/simple-chipmunk.rb +0 -26
- data/examples/legacy/not_checked/shoes-dep-samples/simple-control-sizes.rb +0 -24
- data/examples/legacy/not_checked/shoes-dep-samples/simple-curve.rb +0 -26
- data/examples/legacy/not_checked/shoes-dep-samples/simple-dialogs.rb +0 -29
- data/examples/legacy/not_checked/shoes-dep-samples/simple-draw.rb +0 -13
- data/examples/legacy/not_checked/shoes-dep-samples/simple-editor.rb +0 -28
- data/examples/legacy/not_checked/shoes-dep-samples/simple-form.rb +0 -28
- data/examples/legacy/not_checked/shoes-dep-samples/simple-form.shy +0 -0
- data/examples/legacy/not_checked/shoes-dep-samples/simple-mask.rb +0 -21
- data/examples/legacy/not_checked/shoes-dep-samples/simple-menu.rb +0 -31
- data/examples/legacy/not_checked/shoes-dep-samples/simple-menu1.rb +0 -35
- data/examples/legacy/not_checked/shoes-dep-samples/simple-rubygems.rb +0 -29
- data/examples/legacy/not_checked/shoes-dep-samples/simple-slide.rb +0 -45
- data/examples/legacy/not_checked/shoes-dep-samples/simple-sphere.rb +0 -28
- data/examples/legacy/not_checked/shoes-dep-samples/simple-sqlite3.rb +0 -13
- data/examples/legacy/not_checked/shoes-dep-samples/simple-timer.rb +0 -13
- data/examples/legacy/not_checked/shoes-dep-samples/simple-video.rb +0 -13
- data/examples/legacy/not_checked/shoes3-tests/AnemicCinema1926marcelDuchampCut.mp4 +0 -0
- data/examples/legacy/not_checked/shoes3-tests/button/button.rb +0 -53
- data/examples/legacy/not_checked/shoes3-tests/cache/cache.rb +0 -41
- data/examples/legacy/not_checked/shoes3-tests/combo/combo.rb +0 -24
- data/examples/legacy/not_checked/shoes3-tests/curl/bare.rb +0 -34
- data/examples/legacy/not_checked/shoes3-tests/curl/downloader.rb +0 -40
- data/examples/legacy/not_checked/shoes3-tests/curl/m1.rb +0 -11
- data/examples/legacy/not_checked/shoes3-tests/curl/m2.rb +0 -12
- data/examples/legacy/not_checked/shoes3-tests/curl/m3.rb +0 -11
- data/examples/legacy/not_checked/shoes3-tests/curl/m4.rb +0 -5
- data/examples/legacy/not_checked/shoes3-tests/curl/typ.rb +0 -30
- data/examples/legacy/not_checked/shoes3-tests/cursor/c1.rb +0 -21
- data/examples/legacy/not_checked/shoes3-tests/decoration.rb +0 -14
- data/examples/legacy/not_checked/shoes3-tests/dialogs/ask.rb +0 -6
- data/examples/legacy/not_checked/shoes3-tests/dialogs/confirm.rb +0 -6
- data/examples/legacy/not_checked/shoes3-tests/editbox/editbox.rb +0 -36
- data/examples/legacy/not_checked/shoes3-tests/editline/editline.rb +0 -27
- data/examples/legacy/not_checked/shoes3-tests/events/button.rb +0 -32
- data/examples/legacy/not_checked/shoes3-tests/events/button.yaml +0 -40
- data/examples/legacy/not_checked/shoes3-tests/events/capture.rb +0 -57
- data/examples/legacy/not_checked/shoes3-tests/events/chipmunk.yaml +0 -47
- data/examples/legacy/not_checked/shoes3-tests/events/event0.rb +0 -8
- data/examples/legacy/not_checked/shoes3-tests/events/event1.rb +0 -51
- data/examples/legacy/not_checked/shoes3-tests/events/event1.yaml +0 -26
- data/examples/legacy/not_checked/shoes3-tests/events/event2.rb +0 -46
- data/examples/legacy/not_checked/shoes3-tests/events/event3.rb +0 -44
- data/examples/legacy/not_checked/shoes3-tests/events/event4.rb +0 -65
- data/examples/legacy/not_checked/shoes3-tests/events/event5.rb +0 -17
- data/examples/legacy/not_checked/shoes3-tests/events/event6.rb +0 -51
- data/examples/legacy/not_checked/shoes3-tests/events/replay.rb +0 -60
- data/examples/legacy/not_checked/shoes3-tests/gapp/fullscreen.rb +0 -38
- data/examples/legacy/not_checked/shoes3-tests/gapp/icon.rb +0 -56
- data/examples/legacy/not_checked/shoes3-tests/gapp/mon1.rb +0 -46
- data/examples/legacy/not_checked/shoes3-tests/gapp/settings1.rb +0 -22
- data/examples/legacy/not_checked/shoes3-tests/gapp/title1.rb +0 -34
- data/examples/legacy/not_checked/shoes3-tests/indian.m4a +0 -0
- data/examples/legacy/not_checked/shoes3-tests/menus/event.rb +0 -33
- data/examples/legacy/not_checked/shoes3-tests/menus/menu1.rb +0 -8
- data/examples/legacy/not_checked/shoes3-tests/menus/menu2.rb +0 -25
- data/examples/legacy/not_checked/shoes3-tests/menus/menu3.rb +0 -103
- data/examples/legacy/not_checked/shoes3-tests/menus/menu4.rb +0 -41
- data/examples/legacy/not_checked/shoes3-tests/menus/tests.txt +0 -42
- data/examples/legacy/not_checked/shoes3-tests/opacity.rb +0 -13
- data/examples/legacy/not_checked/shoes3-tests/plot/^IRX.R +0 -5219
- data/examples/legacy/not_checked/shoes3-tests/plot/^SPX +0 -5219
- data/examples/legacy/not_checked/shoes3-tests/plot/cstest.rb +0 -51
- data/examples/legacy/not_checked/shoes3-tests/plot/gr1.rb +0 -73
- data/examples/legacy/not_checked/shoes3-tests/plot/gr2.rb +0 -40
- data/examples/legacy/not_checked/shoes3-tests/plot/gr3.rb +0 -47
- data/examples/legacy/not_checked/shoes3-tests/plot/gr4.rb +0 -35
- data/examples/legacy/not_checked/shoes3-tests/plot/gr5.rb +0 -31
- data/examples/legacy/not_checked/shoes3-tests/plot/gr6.rb +0 -35
- data/examples/legacy/not_checked/shoes3-tests/plot/gr7.rb +0 -37
- data/examples/legacy/not_checked/shoes3-tests/plot/grcsv.rb +0 -219
- data/examples/legacy/not_checked/shoes3-tests/plot/manual.rb +0 -40
- data/examples/legacy/not_checked/shoes3-tests/progress/progress.rb +0 -29
- data/examples/legacy/not_checked/shoes3-tests/radio/clear.rb +0 -20
- data/examples/legacy/not_checked/shoes3-tests/radio/group.rb +0 -18
- data/examples/legacy/not_checked/shoes3-tests/radio/multiple.rb +0 -32
- data/examples/legacy/not_checked/shoes3-tests/radio/nogroup.rb +0 -9
- data/examples/legacy/not_checked/shoes3-tests/simpletest.svg +0 -14
- data/examples/legacy/not_checked/shoes3-tests/spinner.rb +0 -15
- data/examples/legacy/not_checked/shoes3-tests/svg.rb +0 -208
- data/examples/legacy/not_checked/shoes3-tests/switch/switch.rb +0 -28
- data/examples/legacy/not_checked/shoes3-tests/systray/back.rb +0 -20
- data/examples/legacy/not_checked/shoes3-tests/systray/note.rb +0 -17
- data/examples/legacy/not_checked/shoes3-tests/terminal/cursor.rb +0 -27
- data/examples/legacy/not_checked/shoes3-tests/terminal/ed.rb +0 -65
- data/examples/legacy/not_checked/shoes3-tests/terminal/el.rb +0 -50
- data/examples/legacy/not_checked/shoes3-tests/terminal/logattr.rb +0 -31
- data/examples/legacy/not_checked/shoes3-tests/tests_color.rb +0 -138
- data/examples/legacy/not_checked/shoes3-tests/tests_svg.rb +0 -228
- data/examples/legacy/not_checked/shoes3-tests/tests_video_vlc.rb +0 -186
- data/examples/legacy/not_checked/shoes3-tests/tooltips.rb +0 -20
- data/examples/legacy/not_checked/shoes3-tests/video_vlc.rb +0 -242
- data/examples/legacy/not_checked/shoes3-tests/wheel/wheel1.rb +0 -21
- data/examples/legacy/not_checked/simple/accordion.rb +0 -81
- data/examples/legacy/not_checked/simple/anim-shapes.rb +0 -17
- data/examples/legacy/not_checked/simple/anim-text.rb +0 -13
- data/examples/legacy/not_checked/simple/arc.rb +0 -23
- data/examples/legacy/not_checked/simple/bounce.rb +0 -24
- data/examples/legacy/not_checked/simple/chipmunk.rb +0 -26
- data/examples/legacy/not_checked/simple/control-sizes.rb +0 -24
- data/examples/legacy/not_checked/simple/curve-control-points.rb +0 -24
- data/examples/legacy/not_checked/simple/curve.rb +0 -26
- data/examples/legacy/not_checked/simple/dialogs.rb +0 -29
- data/examples/legacy/not_checked/simple/downloader.rb +0 -40
- data/examples/legacy/not_checked/simple/downloader1.rb +0 -31
- data/examples/legacy/not_checked/simple/draw.rb +0 -13
- data/examples/legacy/not_checked/simple/editor.rb +0 -28
- data/examples/legacy/not_checked/simple/form.rb +0 -30
- data/examples/legacy/not_checked/simple/image.rb +0 -21
- data/examples/legacy/not_checked/simple/info.rb +0 -78
- data/examples/legacy/not_checked/simple/mask.rb +0 -21
- data/examples/legacy/not_checked/simple/mask2.rb +0 -27
- data/examples/legacy/not_checked/simple/menu.rb +0 -31
- data/examples/legacy/not_checked/simple/menu1.rb +0 -35
- data/examples/legacy/not_checked/simple/slide.rb +0 -45
- data/examples/legacy/not_checked/simple/sphere.rb +0 -28
- data/examples/legacy/not_checked/superleg.rb +0 -244
- data/examples/legacy/working/shoes-contrib/basic/a-poem.rb +0 -24
- data/examples/legacy/working/shoes-contrib/basic/basic-blocks-instances.rb +0 -7
- data/examples/legacy/working/shoes-contrib/basic/basic-blocks.rb +0 -7
- data/examples/legacy/working/shoes-contrib/basic/basic-slot.rb +0 -8
- data/examples/legacy/working/shoes-contrib/basic/intro.rb +0 -20
- data/examples/legacy/working/shoes-contrib/basic/two-column.rb +0 -12
- data/examples/legacy/working/shoes-contrib/elements/edit_box.rb +0 -6
- data/examples/legacy/working/shoes-contrib/kernel/alert.rb +0 -3
- data/examples/legacy/working/simple/calc.rb +0 -71
- data/examples/legacy/working/simple/sqlite3.rb +0 -27
- data/examples/legacy/working/simple/timer.rb +0 -13
- data/examples/line.rb +0 -5
- data/examples/link.rb +0 -20
- data/examples/list_box.rb +0 -8
- data/examples/local_fonts.rb +0 -4
- data/examples/local_images.rb +0 -4
- data/examples/motion_events.rb +0 -20
- data/examples/para/collection_of_arguments.rb +0 -9
- data/examples/para/hello_world.rb +0 -5
- data/examples/para/hide_and_show.rb +0 -9
- data/examples/para/rainbow.rb +0 -11
- data/examples/para/rainbow_2.rb +0 -11
- data/examples/para/sizes.rb +0 -11
- data/examples/para/sizes_2.rb +0 -12
- data/examples/para/strong.rb +0 -3
- data/examples/para_text_widgets.rb +0 -4
- data/examples/parse_xl_funnies.rb +0 -58
- data/examples/pirate.png +0 -0
- data/examples/raw_flow.rb +0 -11
- data/examples/ruby_racer.rb +0 -50
- data/examples/selfitude.rb +0 -18
- data/examples/shapes/arc.rb +0 -8
- data/examples/shapes/shapes.rb +0 -8
- data/examples/shapes/shapes_fill.rb +0 -10
- data/examples/shapes/star.rb +0 -5
- data/examples/shoes_school.rb +0 -66
- data/examples/shoes_splorer.rb +0 -150
- data/examples/simple_slides.rb +0 -73
- data/examples/skip_ci/parrot.rb +0 -22
- data/examples/skip_ci/say.rb +0 -20
- data/examples/sleepless.rb +0 -26
- data/examples/slots.rb +0 -10
- data/examples/spacing.rb +0 -18
- data/examples/span.rb +0 -6
- data/examples/stack/background.rb +0 -35
- data/examples/stack/border.rb +0 -11
- data/examples/stack/gradients.rb +0 -6
- data/examples/stack/raw_stack.rb +0 -8
- data/examples/stack/stack.rb +0 -27
- data/examples/text_change.rb +0 -4
- data/examples/text_sizes.rb +0 -10
- data/examples/timmy.rb +0 -109
- data/examples/title_and_resize.rb +0 -3
- data/examples/video.rb +0 -10
- data/exe/scarpe +0 -107
- data/fonts/Pacifico.ttf +0 -0
- data/lib/scarpe/alert.rb +0 -19
- data/lib/scarpe/arc.rb +0 -49
- data/lib/scarpe/base64.rb +0 -27
- data/lib/scarpe/button.rb +0 -35
- data/lib/scarpe/cats_cradle.rb +0 -255
- data/lib/scarpe/fill.rb +0 -23
- data/lib/scarpe/flow.rb +0 -18
- data/lib/scarpe/font.rb +0 -14
- data/lib/scarpe/glibui/README.md +0 -34
- data/lib/scarpe/glibui/alert.rb +0 -65
- data/lib/scarpe/glibui/app.rb +0 -27
- data/lib/scarpe/glibui/background.rb +0 -18
- data/lib/scarpe/glibui/border.rb +0 -22
- data/lib/scarpe/glibui/button.rb +0 -38
- data/lib/scarpe/glibui/dimensions.rb +0 -22
- data/lib/scarpe/glibui/document_root.rb +0 -33
- data/lib/scarpe/glibui/edit_box.rb +0 -44
- data/lib/scarpe/glibui/edit_line.rb +0 -43
- data/lib/scarpe/glibui/flow.rb +0 -33
- data/lib/scarpe/glibui/html.rb +0 -77
- data/lib/scarpe/glibui/image.rb +0 -36
- data/lib/scarpe/glibui/link.rb +0 -29
- data/lib/scarpe/glibui/local_display.rb +0 -62
- data/lib/scarpe/glibui/para.rb +0 -84
- data/lib/scarpe/glibui/spacing.rb +0 -41
- data/lib/scarpe/glibui/stack.rb +0 -33
- data/lib/scarpe/glibui/text_widget.rb +0 -30
- data/lib/scarpe/glibui/widget.rb +0 -81
- data/lib/scarpe/glibui.rb +0 -29
- data/lib/scarpe/libui/alert.rb +0 -9
- data/lib/scarpe/libui/button.rb +0 -18
- data/lib/scarpe/libui/colors.rb +0 -157
- data/lib/scarpe/libui/core.rb +0 -66
- data/lib/scarpe/libui/flow.rb +0 -16
- data/lib/scarpe/libui/libui.rb +0 -45
- data/lib/scarpe/libui/notepad.md +0 -26
- data/lib/scarpe/libui/para.rb +0 -154
- data/lib/scarpe/libui/stack.rb +0 -34
- data/lib/scarpe/line.rb +0 -25
- data/lib/scarpe/link.rb +0 -25
- data/lib/scarpe/list_box.rb +0 -25
- data/lib/scarpe/logger.rb +0 -159
- data/lib/scarpe/para.rb +0 -92
- data/lib/scarpe/promises.rb +0 -405
- data/lib/scarpe/shape.rb +0 -20
- data/lib/scarpe/slot.rb +0 -7
- data/lib/scarpe/spacing.rb +0 -9
- data/lib/scarpe/star.rb +0 -47
- data/lib/scarpe/subscription_item.rb +0 -60
- data/lib/scarpe/unit_test_helpers.rb +0 -236
- data/lib/scarpe/version.rb +0 -5
- data/lib/scarpe/video.rb +0 -15
- data/lib/scarpe/widgets.rb +0 -35
- data/lib/scarpe/wv/alert.rb +0 -65
- data/lib/scarpe/wv/app.rb +0 -104
- data/lib/scarpe/wv/arc.rb +0 -57
- data/lib/scarpe/wv/background.rb +0 -27
- data/lib/scarpe/wv/border.rb +0 -24
- data/lib/scarpe/wv/button.rb +0 -50
- data/lib/scarpe/wv/control_interface.rb +0 -147
- data/lib/scarpe/wv/control_interface_test.rb +0 -234
- data/lib/scarpe/wv/dimensions.rb +0 -22
- data/lib/scarpe/wv/document_root.rb +0 -8
- data/lib/scarpe/wv/edit_box.rb +0 -44
- data/lib/scarpe/wv/edit_line.rb +0 -43
- data/lib/scarpe/wv/fill.rb +0 -30
- data/lib/scarpe/wv/flow.rb +0 -24
- data/lib/scarpe/wv/font.rb +0 -36
- data/lib/scarpe/wv/html.rb +0 -108
- data/lib/scarpe/wv/image.rb +0 -41
- data/lib/scarpe/wv/line.rb +0 -38
- data/lib/scarpe/wv/link.rb +0 -29
- data/lib/scarpe/wv/list_box.rb +0 -50
- data/lib/scarpe/wv/para.rb +0 -90
- data/lib/scarpe/wv/shape.rb +0 -35
- data/lib/scarpe/wv/shape_helper.rb +0 -44
- data/lib/scarpe/wv/slot.rb +0 -81
- data/lib/scarpe/wv/spacing.rb +0 -41
- data/lib/scarpe/wv/span.rb +0 -66
- data/lib/scarpe/wv/stack.rb +0 -24
- data/lib/scarpe/wv/star.rb +0 -64
- data/lib/scarpe/wv/subscription_item.rb +0 -50
- data/lib/scarpe/wv/text_widget.rb +0 -30
- data/lib/scarpe/wv/video.rb +0 -42
- data/lib/scarpe/wv/web_wrangler.rb +0 -683
- data/lib/scarpe/wv/webview_local_display.rb +0 -73
- data/lib/scarpe/wv/webview_relay_display.rb +0 -185
- data/lib/scarpe/wv/widget.rb +0 -185
- data/lib/scarpe/wv/wv_display_worker.rb +0 -65
- data/lib/scarpe/wv.rb +0 -43
- data/lib/scarpe/wv_local.rb +0 -6
- data/lib/scarpe/wv_relay.rb +0 -6
- data/lib/scarpe.rb +0 -29
- data/lib/shoes/text_widget.rb +0 -52
- data/lib/shoes/widget.rb +0 -209
- data/logger/debug_web_wrangler.json +0 -4
- data/logger/scarpe_wv_test.json +0 -4
- data/scarpe-0.2.0.gem +0 -0
- data/scarpe.gemspec +0 -44
- data/scarpegen.rb +0 -193
- data/sig/scarpe.rbs +0 -4
- data/templates/basic_class_template.erb +0 -38
- data/templates/class_template_with_event_bind.erb +0 -27
- data/templates/class_template_with_shapes.erb +0 -43
- data/templates/example_template.erb +0 -3
- data/templates/module_template.erb +0 -12
- data/templates/webview_template.erb +0 -27
data/lib/scarpe/libui/para.rb
DELETED
@@ -1,154 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Scarpe
|
4
|
-
SIZES = {
|
5
|
-
inscription: 10,
|
6
|
-
ins: 10,
|
7
|
-
para: 12,
|
8
|
-
caption: 14,
|
9
|
-
tagline: 18,
|
10
|
-
subtitle: 26,
|
11
|
-
title: 34,
|
12
|
-
banner: 48,
|
13
|
-
}.freeze
|
14
|
-
class << self
|
15
|
-
# Sure we can showcase the defaults here so folks can avoid the insanity.
|
16
|
-
def para(text, size: 12.0, stroke: black, weight: nil, fill: nil, underline: nil, italic: nil)
|
17
|
-
Para.new(
|
18
|
-
text,
|
19
|
-
size: size,
|
20
|
-
stroke: stroke,
|
21
|
-
weight: weight,
|
22
|
-
fill: fill,
|
23
|
-
underline: underline,
|
24
|
-
italic: italic,
|
25
|
-
)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
class Para
|
30
|
-
def initialize(text, size:, stroke:, weight:, fill:, underline:, italic:)
|
31
|
-
# old flow for label
|
32
|
-
# UI.box_append($vbox, UI.new_label(text), 0)
|
33
|
-
@handler = UI::FFI::AreaHandler.malloc
|
34
|
-
@handler.to_ptr.free = Fiddle::RUBY_FREE
|
35
|
-
@area = UI.new_area(@handler)
|
36
|
-
|
37
|
-
str = ""
|
38
|
-
@attr_str = UI.new_attributed_string(str)
|
39
|
-
|
40
|
-
font_weight = case weight
|
41
|
-
when "ultralight"
|
42
|
-
UI::TextWeightUltraLight
|
43
|
-
when "light"
|
44
|
-
UI::TextWeightLight
|
45
|
-
when "book"
|
46
|
-
UI::TextWeightBook
|
47
|
-
when "strong"
|
48
|
-
UI::TextWeightBold
|
49
|
-
when "bold"
|
50
|
-
UI::TextWeightBold
|
51
|
-
when "ultrabold"
|
52
|
-
UI::TextWeightUltraBold
|
53
|
-
else
|
54
|
-
nil
|
55
|
-
end
|
56
|
-
stroke2 = stroke.dup
|
57
|
-
attr_builder = []
|
58
|
-
attr_builder << UI.new_weight_attribute(font_weight) if font_weight
|
59
|
-
attr_builder << UI.new_size_attribute(size) if size
|
60
|
-
attr_builder << UI.new_color_attribute(
|
61
|
-
stroke[0].to_f / 255.0, stroke[1].to_f / 255.0, stroke[2].to_f / 255.0, stroke[3].to_f || 1.0
|
62
|
-
) if stroke
|
63
|
-
attr_builder << UI.new_background_attribute(
|
64
|
-
fill[0].to_f / 255.0, fill[1].to_f / 255.0, fill[2].to_f / 255.0, fill[3].to_f || 1.0
|
65
|
-
) if fill
|
66
|
-
attr_builder << UI.new_underline_attribute(UI::UnderlineSingle) if underline == "single"
|
67
|
-
attr_builder << UI.new_underline_attribute(UI::UnderlineDouble) if underline == "double"
|
68
|
-
# NOTE- this is a boolean, not a string. and not part of core scarpe api. we set this internally.
|
69
|
-
attr_builder << UI.new_italic_attribute(UI::TextItalicNormal) if italic == true
|
70
|
-
attr_builder << UI.new_italic_attribute(UI::TextItalicItalic) if italic == "double"
|
71
|
-
attr_builder << UI.new_underline_color_attribute(
|
72
|
-
UI::UnderlineColorCustom,
|
73
|
-
stroke2[0].to_f / 255.0,
|
74
|
-
stroke2[1].to_f / 255.0,
|
75
|
-
stroke2[2].to_f / 255.0,
|
76
|
-
stroke2[3].to_f || 1.0,
|
77
|
-
) if underline == "single" && stroke
|
78
|
-
# # UI.new_stretch_attribute(UI::TextStretchCondensed),stretch not implemented
|
79
|
-
append_with_attribute(
|
80
|
-
text,
|
81
|
-
*attr_builder,
|
82
|
-
)
|
83
|
-
attach_text
|
84
|
-
end
|
85
|
-
|
86
|
-
private
|
87
|
-
|
88
|
-
def draw_text
|
89
|
-
Fiddle::Closure::BlockCaller.new(0, [1, 1, 1]) do |_, _, adp|
|
90
|
-
area_draw_params = UI::FFI::AreaDrawParams.new(adp)
|
91
|
-
default_font = UI::FFI::FontDescriptor.malloc
|
92
|
-
default_font.to_ptr.free = Fiddle::RUBY_FREE
|
93
|
-
default_font.Family = "Georgia"
|
94
|
-
default_font.Size = 13
|
95
|
-
# default_font.Weight = 500
|
96
|
-
default_font.Italic = 0
|
97
|
-
default_font.Stretch = 4
|
98
|
-
params = UI::FFI::DrawTextLayoutParams.malloc
|
99
|
-
params.to_ptr.free = Fiddle::RUBY_FREE
|
100
|
-
|
101
|
-
# UI.font_button_font(font_button, default_font)
|
102
|
-
params.String = @attr_str
|
103
|
-
params.DefaultFont = default_font
|
104
|
-
params.Width = area_draw_params.AreaWidth
|
105
|
-
params.Align = 0
|
106
|
-
text_layout = UI.draw_new_text_layout(params)
|
107
|
-
UI.draw_text(area_draw_params.Context, text_layout, 0, 0)
|
108
|
-
UI.draw_free_text_layout(text_layout)
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
def attach_text
|
113
|
-
@handler.Draw = draw_text
|
114
|
-
|
115
|
-
# Assigning to local variables
|
116
|
-
# This is intended to protect Fiddle::Closure from garbage collection.
|
117
|
-
do_nothing = Fiddle::Closure::BlockCaller.new(0, [0]) {}
|
118
|
-
key_event = Fiddle::Closure::BlockCaller.new(1, [0]) { 0 }
|
119
|
-
@handler.MouseEvent = do_nothing
|
120
|
-
@handler.MouseCrossed = do_nothing
|
121
|
-
@handler.DragBroken = do_nothing
|
122
|
-
@handler.KeyEvent = key_event
|
123
|
-
|
124
|
-
# do i shove it in vbox or para_box?
|
125
|
-
# @para_box = UI.new_vertical_box
|
126
|
-
# UI.box_set_padded(@para_box, 1)
|
127
|
-
# debugger
|
128
|
-
hbox = $parent_box ? $parent_box : $vbox
|
129
|
-
UI.box_append(hbox, @area, 1)
|
130
|
-
|
131
|
-
# I have absolutely no idea what is going on with boxes so need to look into this next
|
132
|
-
# probably with stacks and flows
|
133
|
-
# UI.window_set_margined($main_window, 1)
|
134
|
-
# if $parent_box
|
135
|
-
# UI.window_set_child($main_window, hbox)
|
136
|
-
# else
|
137
|
-
# UI.window_set_child($main_window, $vbox)
|
138
|
-
# end
|
139
|
-
end
|
140
|
-
|
141
|
-
def append_with_attribute(what, *args)
|
142
|
-
start_pos = UI.attributed_string_len(@attr_str)
|
143
|
-
end_pos = start_pos + what.length
|
144
|
-
UI.attributed_string_append_unattributed(@attr_str, what)
|
145
|
-
args.each do |attr|
|
146
|
-
# puts "*" * 80
|
147
|
-
# puts "attr: #{attr}"
|
148
|
-
# puts "*" * 80
|
149
|
-
# sleep 1
|
150
|
-
UI.attributed_string_set_attribute(@attr_str, attr, start_pos, end_pos)
|
151
|
-
end
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|
data/lib/scarpe/libui/stack.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Object
|
4
|
-
def parent_caller
|
5
|
-
caller[0].match(/`(.*)'/)[1]
|
6
|
-
end
|
7
|
-
|
8
|
-
def all_callers
|
9
|
-
caller.map { |x| x.match(/`(.*)'/)[1] if self.respond_to? x.match(/`(.*)'/)[1].to_sym }.compact
|
10
|
-
end
|
11
|
-
|
12
|
-
def caller_key
|
13
|
-
caller[0].hash
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def global_stack
|
18
|
-
@global_stack ||= {}
|
19
|
-
end
|
20
|
-
|
21
|
-
class Scarpe
|
22
|
-
# STARTING SINGLY, APPENDING TO TOP LEVEL BOX. later will do nested
|
23
|
-
class << self
|
24
|
-
# Width means nothing right now, but we'll get there
|
25
|
-
def stack(width: 1.0)
|
26
|
-
hbox = UI.new_horizontal_box
|
27
|
-
old_parent = $parent_box ? $parent_box : $vbox
|
28
|
-
$parent_box = hbox
|
29
|
-
yield
|
30
|
-
UI.box_append(old_parent, hbox, 1)
|
31
|
-
$parent_box = nil
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
data/lib/scarpe/line.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "wv/shape_helper"
|
4
|
-
|
5
|
-
class Scarpe
|
6
|
-
class Line < Shoes::Widget
|
7
|
-
include ShapeHelper
|
8
|
-
|
9
|
-
display_properties :left, :top, :x2, :y2, :color
|
10
|
-
|
11
|
-
def initialize(left, top, x2, y2)
|
12
|
-
validate_coordinates(x2, y2)
|
13
|
-
@left = left
|
14
|
-
@top = top
|
15
|
-
@x2 = x2
|
16
|
-
@y2 = y2
|
17
|
-
@color = color_for_fill
|
18
|
-
|
19
|
-
# validate_coordinates(x2, y2)
|
20
|
-
|
21
|
-
super()
|
22
|
-
create_display_widget
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/lib/scarpe/link.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Scarpe
|
4
|
-
class Link < Shoes::TextWidget
|
5
|
-
display_properties :text, :click, :has_block
|
6
|
-
|
7
|
-
def initialize(text, click: nil, &block)
|
8
|
-
@text = text
|
9
|
-
@block = block
|
10
|
-
# We can't send a block to the display widget, but we can send a boolean
|
11
|
-
@has_block = !block.nil?
|
12
|
-
|
13
|
-
super
|
14
|
-
|
15
|
-
# The click property should be changed before it gets sent to the display widget
|
16
|
-
@click ||= "#"
|
17
|
-
|
18
|
-
bind_self_event("click") do
|
19
|
-
@block&.call
|
20
|
-
end
|
21
|
-
|
22
|
-
create_display_widget
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/lib/scarpe/list_box.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Scarpe
|
4
|
-
class ListBox < Shoes::Widget
|
5
|
-
display_properties :selected_item, :items, :height, :width
|
6
|
-
|
7
|
-
def initialize(args = {}, &block)
|
8
|
-
@items = args[:items] || []
|
9
|
-
@selected_item = args[:selected_item]
|
10
|
-
super()
|
11
|
-
|
12
|
-
bind_self_event("change") do |new_item|
|
13
|
-
self.selected_item = new_item
|
14
|
-
@callback&.call(new_item)
|
15
|
-
end
|
16
|
-
|
17
|
-
create_display_widget
|
18
|
-
end
|
19
|
-
|
20
|
-
def change(&block)
|
21
|
-
@callback = block
|
22
|
-
self # Allow chaining calls
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/lib/scarpe/logger.rb
DELETED
@@ -1,159 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "logging"
|
4
|
-
require "json"
|
5
|
-
|
6
|
-
class Scarpe
|
7
|
-
LOG_LEVELS = [:debug, :info, :warning, :error, :fatal].freeze
|
8
|
-
|
9
|
-
# Include this module to get a @log instance variable to log as your
|
10
|
-
# configured component.
|
11
|
-
module Log
|
12
|
-
DEFAULT_LOG_CONFIG = {
|
13
|
-
"default" => "info",
|
14
|
-
}
|
15
|
-
DEFAULT_DEBUG_LOG_CONFIG = {
|
16
|
-
"default" => "debug",
|
17
|
-
}
|
18
|
-
|
19
|
-
def log_init(component = self)
|
20
|
-
@log = Logging.logger[component]
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
class Logger
|
25
|
-
DEFAULT_COMPONENT = "default"
|
26
|
-
|
27
|
-
class << self
|
28
|
-
attr_reader :current_log_config
|
29
|
-
|
30
|
-
def logger(component = self)
|
31
|
-
Logging.logger[component]
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
def name_to_severity(data)
|
37
|
-
case data
|
38
|
-
when "debug"
|
39
|
-
:debug
|
40
|
-
when "info"
|
41
|
-
:info
|
42
|
-
when "warn", "warning"
|
43
|
-
:warn
|
44
|
-
when "err", "error"
|
45
|
-
:error
|
46
|
-
when "fatal"
|
47
|
-
:fatal
|
48
|
-
else
|
49
|
-
raise "Don't know how to treat #{data.inspect} as a logger severity!"
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def json_to_appender(data)
|
54
|
-
case data.downcase
|
55
|
-
when "stdout"
|
56
|
-
Logging.appenders.stdout layout: @custom_log_layout
|
57
|
-
when "stderr"
|
58
|
-
Logging.appenders.stderr layout: @custom_log_layout
|
59
|
-
when String
|
60
|
-
Logging.appenders.file data, layout: @custom_log_layout
|
61
|
-
else
|
62
|
-
raise "Don't know how to convert #{data.inspect} to an appender!"
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def json_configure_logger(logger, data)
|
67
|
-
case data
|
68
|
-
in String
|
69
|
-
sev = name_to_severity(data)
|
70
|
-
logger.level = sev
|
71
|
-
in [level, *locations]
|
72
|
-
if logger.name != "root"
|
73
|
-
# The Logging gem doesn't have an additive property on the root logger
|
74
|
-
logger.additive = false # Don't also log to parent/root loggers
|
75
|
-
end
|
76
|
-
|
77
|
-
logger.appenders = locations.map { |where| json_to_appender(where) }
|
78
|
-
|
79
|
-
logger.level = name_to_severity(level)
|
80
|
-
else
|
81
|
-
raise "Don't know how to use #{data.inspect} to specify a logger!"
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def freeze_log_config(log_config)
|
86
|
-
log_config.each do |k, v|
|
87
|
-
k.freeze
|
88
|
-
v.freeze
|
89
|
-
v.each(&:freeze) if v.is_a?(Array)
|
90
|
-
end
|
91
|
-
log_config.freeze
|
92
|
-
end
|
93
|
-
|
94
|
-
public
|
95
|
-
|
96
|
-
def configure_logger(log_config)
|
97
|
-
# TODO: custom coloring? https://github.com/TwP/logging/blob/master/examples/colorization.rb
|
98
|
-
@custom_log_layout = Logging.layouts.pattern pattern: '[%r] %-5l %c: %m\n'
|
99
|
-
|
100
|
-
if log_config.is_a?(String) && File.exist?(log_config)
|
101
|
-
log_config = JSON.load_file(log_config)
|
102
|
-
end
|
103
|
-
|
104
|
-
log_config = freeze_log_config(log_config) unless log_config.nil?
|
105
|
-
@current_log_config = log_config # Save a copy for later
|
106
|
-
|
107
|
-
Logging.reset # Reset all Logging settings to defaults
|
108
|
-
Logging.reopen # For log-reconfig (e.g. test failures), often important to *not* store an open handle to a moved file
|
109
|
-
return if log_config.nil?
|
110
|
-
|
111
|
-
Logging.logger.root.appenders = [Logging.appenders.stdout]
|
112
|
-
|
113
|
-
default_logger = log_config[DEFAULT_COMPONENT] || "info"
|
114
|
-
json_configure_logger(Logging.logger.root, default_logger)
|
115
|
-
|
116
|
-
log_config.each do |component, logger_data|
|
117
|
-
next if component == DEFAULT_COMPONENT
|
118
|
-
|
119
|
-
sublogger = Logging.logger[component]
|
120
|
-
json_configure_logger(sublogger, logger_data)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
class LoggedWrapper
|
127
|
-
include ::Scarpe::Log
|
128
|
-
def initialize(instance, component = instance)
|
129
|
-
log_init(component)
|
130
|
-
|
131
|
-
@instance = instance
|
132
|
-
end
|
133
|
-
|
134
|
-
def method_missing(method, ...)
|
135
|
-
self.singleton_class.define_method(method) do |*args, **kwargs, &block|
|
136
|
-
ret = @instance.send(method, *args, **kwargs, &block)
|
137
|
-
@log.info("Method: #{method} Args: #{args.inspect} KWargs: #{kwargs.inspect} Block: #{block ? "y" : "n"} Return: #{ret.inspect}")
|
138
|
-
ret
|
139
|
-
end
|
140
|
-
send(method, ...)
|
141
|
-
end
|
142
|
-
|
143
|
-
def respond_to_missing?(method_name, include_private = false)
|
144
|
-
@instance.respond_to_missing?(method_name, include_private)
|
145
|
-
end
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
class Logging::Logger
|
150
|
-
alias_method :warning, :warn
|
151
|
-
end
|
152
|
-
|
153
|
-
log_config = if ENV["SCARPE_LOG_CONFIG"]
|
154
|
-
JSON.load_file(ENV["SCARPE_LOG_CONFIG"])
|
155
|
-
else
|
156
|
-
ENV["SCARPE_DEBUG"] ? Scarpe::Log::DEFAULT_DEBUG_LOG_CONFIG : Scarpe::Log::DEFAULT_LOG_CONFIG
|
157
|
-
end
|
158
|
-
|
159
|
-
Scarpe::Logger.configure_logger(log_config)
|
data/lib/scarpe/para.rb
DELETED
@@ -1,92 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Scarpe
|
4
|
-
class Para < Shoes::Widget
|
5
|
-
class << self
|
6
|
-
def inherited(subclass)
|
7
|
-
Scarpe::Widget.widget_classes ||= []
|
8
|
-
Scarpe::Widget.widget_classes << subclass
|
9
|
-
super
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
display_properties :text_items, :stroke, :size, :font, :html_attributes, :hidden
|
14
|
-
|
15
|
-
def initialize(*args, stroke: nil, size: :para, font: nil, hidden: false, **html_attributes)
|
16
|
-
@text_children = args || []
|
17
|
-
if hidden
|
18
|
-
@hidden_text_items = text_children_to_items(@text_children)
|
19
|
-
@text_items = []
|
20
|
-
else
|
21
|
-
# Text_children alternates strings and TextWidgets, so we can't just pass
|
22
|
-
# it as a display property. It won't serialize.
|
23
|
-
@text_items = text_children_to_items(@text_children)
|
24
|
-
@hidden_text_items = []
|
25
|
-
end
|
26
|
-
stroke = to_rgb(stroke)
|
27
|
-
|
28
|
-
@html_attributes = html_attributes || {}
|
29
|
-
|
30
|
-
super
|
31
|
-
|
32
|
-
create_display_widget
|
33
|
-
end
|
34
|
-
|
35
|
-
def text_children_to_items(text_children)
|
36
|
-
text_children.map { |arg| arg.is_a?(String) ? arg : arg.linkable_id }
|
37
|
-
end
|
38
|
-
|
39
|
-
def replace(*children)
|
40
|
-
@text_children = children
|
41
|
-
|
42
|
-
# This should signal the display widget to change
|
43
|
-
self.text_items = text_children_to_items(@text_children)
|
44
|
-
end
|
45
|
-
|
46
|
-
def hide
|
47
|
-
# idempotent
|
48
|
-
return unless @hidden_text_items.empty?
|
49
|
-
|
50
|
-
@hidden_text_items = self.text_items
|
51
|
-
self.text_items = []
|
52
|
-
end
|
53
|
-
|
54
|
-
def show
|
55
|
-
# idempotent
|
56
|
-
return unless self.text_items.empty?
|
57
|
-
|
58
|
-
self.text_items = @hidden_text_items
|
59
|
-
@hidden_text_items = []
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
module Shoes
|
65
|
-
class Widget
|
66
|
-
def banner(*args, **kwargs)
|
67
|
-
para(*args, **{ size: :banner }.merge(kwargs))
|
68
|
-
end
|
69
|
-
|
70
|
-
def title(*args, **kwargs)
|
71
|
-
para(*args, **{ size: :title }.merge(kwargs))
|
72
|
-
end
|
73
|
-
|
74
|
-
def subtitle(*args, **kwargs)
|
75
|
-
para(*args, **{ size: :subtitle }.merge(kwargs))
|
76
|
-
end
|
77
|
-
|
78
|
-
def tagline(*args, **kwargs)
|
79
|
-
para(*args, **{ size: :tagline }.merge(kwargs))
|
80
|
-
end
|
81
|
-
|
82
|
-
def caption(*args, **kwargs)
|
83
|
-
para(*args, **{ size: :caption }.merge(kwargs))
|
84
|
-
end
|
85
|
-
|
86
|
-
def inscription(*args, **kwargs)
|
87
|
-
para(*args, **{ size: :inscription }.merge(kwargs))
|
88
|
-
end
|
89
|
-
|
90
|
-
alias_method :ins, :inscription
|
91
|
-
end
|
92
|
-
end
|