ranger-compiler 3.5.1 → 3.5.2
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.
- package/CHANGELOG.md +1064 -20
- package/LICENSE +3 -1
- package/README.md +123 -28
- package/dist/Lang.rgr +1188 -290
- package/dist/api.d.ts +2343 -879
- package/dist/api.js +79923 -56921
- package/dist/lib/JSON.rgr +102 -91
- package/dist/lib/Shell.rgr +4 -4
- package/dist/lib/apple/AppleToolchain.rgr +4 -4
- package/dist/lib/apple/README.md +5 -4
- package/dist/lib/apple/apple_test.rgr +1 -1
- package/dist/lib/core/README.md +1 -1
- package/dist/lib/evg/EVG.rgr +12 -0
- package/dist/lib/evg/EVGA11yFromTree.rgr +302 -0
- package/dist/lib/evg/EVGA11yTree.rgr +894 -0
- package/dist/lib/evg/EVGBox.rgr +267 -0
- package/dist/lib/evg/EVGBoxShorthandTest.rgr +220 -0
- package/dist/lib/evg/EVGCodepoint.rgr +316 -0
- package/dist/lib/evg/EVGColor.rgr +700 -0
- package/dist/lib/evg/EVGCommands.rgr +177 -0
- package/dist/lib/evg/EVGComponent.rgr +331 -0
- package/dist/lib/evg/EVGComponentTest.rgr +387 -0
- package/dist/lib/evg/EVGConnector.rgr +541 -0
- package/dist/lib/evg/EVGConnectorTest.rgr +306 -0
- package/dist/lib/evg/EVGDisplayList.rgr +4186 -0
- package/dist/lib/evg/EVGEasing.rgr +370 -0
- package/dist/lib/evg/EVGEffectTest.rgr +253 -0
- package/dist/lib/evg/EVGElement.rgr +4914 -0
- package/dist/lib/evg/EVGFixedTest.rgr +289 -0
- package/dist/lib/evg/EVGFlexRulesTest.rgr +317 -0
- package/dist/lib/evg/EVGFlexWrapTest.rgr +246 -0
- package/dist/lib/evg/EVGFling.rgr +244 -0
- package/dist/lib/evg/EVGFocus.rgr +400 -0
- package/dist/lib/evg/EVGFocusTest.rgr +399 -0
- package/dist/lib/evg/EVGGradient.rgr +322 -0
- package/dist/lib/evg/EVGGrapheme.rgr +190 -0
- package/dist/lib/evg/EVGGrid.rgr +975 -0
- package/dist/lib/evg/EVGHitTest.rgr +208 -0
- package/dist/lib/evg/EVGHoles.rgr +294 -0
- package/dist/lib/evg/EVGHostMeasurerTest.rgr +281 -0
- package/dist/lib/evg/EVGHostTextMeasurer.rgr +331 -0
- package/dist/lib/evg/EVGHostTree.rgr +834 -0
- package/dist/lib/evg/EVGHostTreeTest.rgr +447 -0
- package/dist/lib/evg/EVGImageDecode.rgr +117 -0
- package/dist/lib/evg/EVGImageMeasurer.rgr +86 -0
- package/dist/lib/evg/EVGInspect.rgr +883 -0
- package/dist/lib/evg/EVGInvalidateTest.rgr +432 -0
- package/dist/lib/evg/EVGJsonTest.rgr +535 -0
- package/dist/lib/evg/EVGLayout.rgr +4220 -0
- package/dist/lib/evg/EVGMeasure.rgr +1267 -0
- package/dist/lib/evg/EVGOverlayTest.rgr +626 -0
- package/dist/lib/evg/EVGPatch.rgr +1721 -0
- package/dist/lib/evg/EVGPatchTest.rgr +692 -0
- package/dist/lib/evg/EVGPopoverTest.rgr +395 -0
- package/dist/lib/evg/EVGReconcile.rgr +226 -0
- package/dist/lib/evg/EVGReconcileTest.rgr +421 -0
- package/dist/lib/evg/EVGReject.rgr +126 -0
- package/dist/lib/evg/EVGRelayoutTest.rgr +375 -0
- package/dist/lib/evg/EVGRtlLayoutTest.rgr +319 -0
- package/dist/lib/evg/EVGRuler.rgr +232 -0
- package/dist/lib/evg/EVGRulerTest.rgr +172 -0
- package/dist/lib/evg/EVGSelectChrome.rgr +178 -0
- package/dist/lib/evg/EVGStyleCacheTest.rgr +419 -0
- package/dist/lib/evg/EVGStyleSheet.rgr +2148 -0
- package/dist/lib/evg/EVGStyleStateTest.rgr +407 -0
- package/dist/lib/evg/EVGStyleVarTest.rgr +471 -0
- package/dist/lib/evg/EVGText.rgr +105 -0
- package/dist/lib/evg/EVGTextEngine.rgr +536 -0
- package/dist/lib/evg/EVGTextMeasurer.rgr +720 -0
- package/dist/lib/evg/EVGTimingTest.rgr +1417 -0
- package/dist/lib/evg/EVGToolbar.rgr +1369 -0
- package/dist/lib/evg/EVGTransition.rgr +728 -0
- package/dist/lib/evg/EVGTreeJson.rgr +721 -0
- package/dist/lib/evg/EVGUnit.rgr +554 -0
- package/dist/lib/evg/EVGViewportUnitTest.rgr +236 -0
- package/dist/lib/evg/EvgApp.rgr +189 -0
- package/dist/lib/evg/EvgBitmapTracer.rgr +4277 -0
- package/dist/lib/evg/EvgBitmapTracerTest.rgr +2119 -0
- package/dist/lib/evg/EvgHost.rgr +451 -0
- package/dist/lib/evg/EvgTest.rgr +91 -0
- package/dist/lib/evg/EvgTraceColor.rgr +236 -0
- package/dist/lib/evg/EvgTraceCurve.rgr +648 -0
- package/dist/lib/evg/EvgTraceFit.rgr +767 -0
- package/dist/lib/evg/EvgTracePath.rgr +435 -0
- package/dist/lib/evg/EvgTraceTypes.rgr +559 -0
- package/dist/lib/evg/EvgViewport.rgr +313 -0
- package/dist/lib/evg/FxDemoDoc.rgr +185 -0
- package/dist/lib/evg/HOSTS.md +227 -0
- package/dist/lib/evg/ISSUES.md +835 -0
- package/dist/lib/evg/PLAN_ACCESSIBILITY.md +650 -0
- package/dist/lib/evg/PLAN_CSS_LAYOUT_AND_FONTS.md +1124 -0
- package/dist/lib/evg/PLAN_EFFECTS.md +431 -0
- package/dist/lib/evg/PLAN_EVG.md +518 -0
- package/dist/lib/evg/PLAN_EVG_RENDERER.md +1674 -0
- package/dist/lib/evg/PLAN_INSPECTOR.md +788 -0
- package/dist/lib/evg/PLAN_LINKS_AND_FORMS.md +157 -0
- package/dist/lib/evg/PLAN_NATIVE_HOSTS.md +671 -0
- package/dist/lib/evg/PLAN_VECTOR_IR.md +664 -0
- package/dist/lib/evg/PLAN_VIEW_TRANSFORM.md +322 -0
- package/dist/lib/evg/PathBuilder.rgr +333 -0
- package/dist/lib/evg/README.md +1236 -0
- package/dist/lib/evg/SPEC.md +1252 -0
- package/dist/lib/evg/SVGPathParser.rgr +1199 -0
- package/dist/lib/evg/SvgParser.rgr +1736 -0
- package/dist/lib/evg/TODO_EVG_RENDERER.md +595 -0
- package/dist/lib/evg/VectorShapes.rgr +331 -0
- package/dist/lib/evg/VectorStroke.rgr +107 -0
- package/dist/lib/evg/VectorViewBox.rgr +380 -0
- package/dist/lib/evg/agent/README.md +290 -0
- package/dist/lib/evg/agent/evg_agent.rgr +899 -0
- package/dist/lib/evg/agent/fixtures/broken.evg.json +7 -0
- package/dist/lib/evg/agent/fixtures/card.evg.json +9 -0
- package/dist/lib/evg/agent/fixtures/connector.css +63 -0
- package/dist/lib/evg/agent/fixtures/connector.evg.json +14 -0
- package/dist/lib/evg/agent/fixtures/drawn.evg.json +129 -0
- package/dist/lib/evg/agent/fixtures/gradient.evg.json +4 -0
- package/dist/lib/evg/agent/fixtures/popover.css +99 -0
- package/dist/lib/evg/agent/fixtures/popover.evg.json +30 -0
- package/dist/lib/evg/agent/roundtrip.sh +74 -0
- package/dist/lib/evg/agent/smoke.sh +230 -0
- package/dist/lib/evg/android/README.md +97 -0
- package/dist/lib/evg/android/androidstubs/AndroidStubs.kt +175 -0
- package/dist/lib/evg/android/androidstubs/Annotation.kt +10 -0
- package/dist/lib/evg/android/androidstubs/App.kt +30 -0
- package/dist/lib/evg/android/androidstubs/Content.kt +41 -0
- package/dist/lib/evg/android/androidstubs/ContentRes.kt +12 -0
- package/dist/lib/evg/android/androidstubs/InputMethod.kt +46 -0
- package/dist/lib/evg/android/androidstubs/Net.kt +6 -0
- package/dist/lib/evg/android/androidstubs/Os.kt +30 -0
- package/dist/lib/evg/android/androidstubs/Util.kt +15 -0
- package/dist/lib/evg/android/androidstubs/View.kt +113 -0
- package/dist/lib/evg/android/androidstubs/Widget.kt +16 -0
- package/dist/lib/evg/android/src/android/kotlin/fi/ranger/evg/AndroidEvgSurface.kt +323 -0
- package/dist/lib/evg/android/src/android/kotlin/fi/ranger/evg/AndroidTextMeasurer.kt +56 -0
- package/dist/lib/evg/android/src/android/kotlin/fi/ranger/evg/RippleEffect.kt +262 -0
- package/dist/lib/evg/android/src/awt/kotlin/fi/ranger/evg/AwtEvgSurface.kt +238 -0
- package/dist/lib/evg/android/src/awt/kotlin/fi/ranger/evg/AwtTextMeasurer.kt +85 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/EvgEngineThread.kt +115 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/EvgPainter.kt +231 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/EvgSurface.kt +117 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/RecordingSurface.kt +94 -0
- package/dist/lib/evg/apple/README.md +128 -0
- package/dist/lib/evg/apple/Sources/CoreGraphicsEvgSurface.swift +329 -0
- package/dist/lib/evg/apple/Sources/CoreTextMeasurer.swift +70 -0
- package/dist/lib/evg/apple/Sources/EvgEngineQueue.swift +105 -0
- package/dist/lib/evg/apple/Sources/EvgPainter.swift +225 -0
- package/dist/lib/evg/apple/Sources/EvgSurface.swift +163 -0
- package/dist/lib/evg/apple/Sources/RecordingSurface.swift +110 -0
- package/dist/lib/evg/bench/EvgLayoutBench.rgr +34 -0
- package/dist/lib/evg/bench/README.md +64 -0
- package/dist/lib/evg/bench/layout-bench.mjs +316 -0
- package/dist/lib/evg/bench/layout-cases.mjs +510 -0
- package/dist/lib/evg/bench/layout-conformance.mjs +254 -0
- package/dist/lib/evg/bin/.gitignore +17 -0
- package/dist/lib/evg/evg_test.rgr +313 -0
- package/dist/lib/evg/gl/README.md +198 -0
- package/dist/lib/evg/gl/a11y-paint-check.mjs +73 -0
- package/dist/lib/evg/gl/blur-check.mjs +399 -0
- package/dist/lib/evg/gl/boxmodel.json +1 -0
- package/dist/lib/evg/gl/demo.html +46 -0
- package/dist/lib/evg/gl/effect-presets.css +285 -0
- package/dist/lib/evg/gl/effect-presets.js +63 -0
- package/dist/lib/evg/gl/effect-shots.mjs +135 -0
- package/dist/lib/evg/gl/evg-a11y.js +566 -0
- package/dist/lib/evg/gl/evg-binary.js +160 -0
- package/dist/lib/evg/gl/evg-engine.js +296 -0
- package/dist/lib/evg/gl/evg-fx.js +237 -0
- package/dist/lib/evg/gl/evg-gestures.js +209 -0
- package/dist/lib/evg/gl/evg-list.js +167 -0
- package/dist/lib/evg/gl/evg-measure.js +186 -0
- package/dist/lib/evg/gl/evg-textinput.js +303 -0
- package/dist/lib/evg/gl/evg-view.js +144 -0
- package/dist/lib/evg/gl/evg-webgl.js +3942 -0
- package/dist/lib/evg/gl/fx-check.mjs +998 -0
- package/dist/lib/evg/gl/fx-demo.html +166 -0
- package/dist/lib/evg/gl/fx-demo.js +2 -0
- package/dist/lib/evg/gl/fx-serve.mjs +47 -0
- package/dist/lib/evg/gl/gestures-check.mjs +189 -0
- package/dist/lib/evg/gl/list-binary-check.mjs +152 -0
- package/dist/lib/evg/gl/measure-check.mjs +135 -0
- package/dist/lib/evg/gl/rotation-check.mjs +207 -0
- package/dist/lib/evg/gl/shift-check.mjs +113 -0
- package/dist/lib/evg/gl/stroke-check.mjs +168 -0
- package/dist/lib/evg/gl/text-snap-check.mjs +139 -0
- package/dist/lib/evg/gl/view-check.mjs +343 -0
- package/dist/lib/evg/gl/view-policy-check.mjs +184 -0
- package/dist/lib/evg/html/evg-dom.js +318 -0
- package/dist/lib/evg/html/evg-html.js +600 -0
- package/dist/lib/evg/inspect/README.md +415 -0
- package/dist/lib/evg/inspect/browser-smoke.mjs +115 -0
- package/dist/lib/evg/inspect/evg-inspect.js +947 -0
- package/dist/lib/evg/inspect/shots/css.png +0 -0
- package/dist/lib/evg/inspect/shots/dashboard.png +0 -0
- package/dist/lib/evg/inspect/shots/pptx-slide.png +0 -0
- package/dist/lib/evg/inspect/shots/state.png +0 -0
- package/dist/lib/evg/inspect/shots.mjs +226 -0
- package/dist/lib/evg/oracle/css-blur.json +576 -0
- package/dist/lib/evg/oracle/css-box.json +157 -0
- package/dist/lib/evg/oracle/css-timing.json +709 -0
- package/dist/lib/evg/oracle/css_blur_oracle.mjs +529 -0
- package/dist/lib/evg/oracle/css_box_oracle.mjs +106 -0
- package/dist/lib/evg/oracle/css_timing_oracle.mjs +389 -0
- package/dist/lib/evg/original/EVGColor.clj +310 -0
- package/dist/lib/evg/original/EVGColorContext.rgr +178 -0
- package/dist/lib/evg/original/SVGPath.rgr +627 -0
- package/dist/lib/evg/original/Vec2.crgr +103 -0
- package/dist/lib/evg/ranger.json +9 -0
- package/dist/lib/evg/showcase/README.md +246 -0
- package/dist/lib/evg/showcase/assets/emblem.svg +30 -0
- package/dist/lib/evg/showcase/assets/rosette.svg +22 -0
- package/dist/lib/evg/showcase/build.mjs +651 -0
- package/dist/lib/evg/showcase/pages/album.tsx +30 -0
- package/dist/lib/evg/showcase/pages/boxmodel.tsx +37 -0
- package/dist/lib/evg/showcase/pages/cards.tsx +41 -0
- package/dist/lib/evg/showcase/pages/chart_api.tsx +170 -0
- package/dist/lib/evg/showcase/pages/charts.tsx +219 -0
- package/dist/lib/evg/showcase/pages/drawing.tsx +160 -0
- package/dist/lib/evg/showcase/pages/emoji.tsx +91 -0
- package/dist/lib/evg/showcase/pages/flex.tsx +46 -0
- package/dist/lib/evg/showcase/pages/more.tsx +332 -0
- package/dist/lib/evg/showcase/pages/plots.tsx +262 -0
- package/dist/lib/evg/showcase/pages/svg.tsx +63 -0
- package/dist/lib/evg/showcase/pages/tables.tsx +209 -0
- package/dist/lib/evg/showcase/pages/typography.tsx +43 -0
- package/dist/lib/evg/showcase/pages/units.tsx +35 -0
- package/dist/lib/evg/showcase/pages/variants.tsx +233 -0
- package/dist/lib/evg/showcase/pages/vector.tsx +75 -0
- package/dist/lib/evg/showcase/pages/views.tsx +223 -0
- package/dist/lib/evg/showcase/tests/chart_api_smoke.mjs +339 -0
- package/dist/lib/evg/showcase/tests/gl_smoke.mjs +125 -0
- package/dist/lib/evg/showcase/themes/chart_api-default.css +15 -0
- package/dist/lib/evg/showcase/themes/charts-default.css +29 -0
- package/dist/lib/evg/showcase/themes/drawing-default.css +35 -0
- package/dist/lib/evg/showcase/themes/more-default.css +128 -0
- package/dist/lib/evg/showcase/themes/plots-default.css +18 -0
- package/dist/lib/evg/showcase/themes/showcase.css +508 -0
- package/dist/lib/evg/showcase/themes/tables-default.css +123 -0
- package/dist/lib/evg/showcase/themes/variants-default.css +15 -0
- package/dist/lib/evg/showcase/themes/views-default.css +15 -0
- package/dist/lib/evg/tools/bench_vs_potrace.mjs +290 -0
- package/dist/lib/evg/tools/evg_image_tool.rgr +488 -0
- package/dist/lib/evg/tools/evg_trace_bench.rgr +114 -0
- package/dist/lib/evg/tools/evg_trace_cli.rgr +662 -0
- package/dist/lib/evg/tools/evg_trace_cpp_bench.rgr +83 -0
- package/dist/lib/evg/tools/run_trace_bench.sh +74 -0
- package/dist/lib/evg/tools/run_trace_cli_smoke.sh +128 -0
- package/dist/lib/evg/web/responsive/EvgResponsiveCheck.rgr +271 -0
- package/dist/lib/evg/web/responsive/EvgResponsiveDemo.rgr +531 -0
- package/dist/lib/evg/web/responsive/README.md +97 -0
- package/dist/lib/evg/web/responsive/build.mjs +90 -0
- package/dist/lib/evg/web/responsive/dom-check.mjs +169 -0
- package/dist/lib/evg/web/responsive/index.html +177 -0
- package/dist/lib/evg/web/responsive/smoke.mjs +221 -0
- package/dist/lib/evg/web/tools/assets-client.mjs +95 -0
- package/dist/lib/evg/web/tools/boot-bench.mjs +189 -0
- package/dist/lib/evg/web/tools/inline-assets.mjs +119 -0
- package/dist/lib/evg/web/tools/minify.mjs +60 -0
- package/dist/lib/evg/web/tracer/build.mjs +87 -0
- package/dist/lib/evg/web/tracer/index.html +2805 -0
- package/dist/lib/evg/web/tracer/sample.png +0 -0
- package/dist/lib/evg/web/tracer/smoke.mjs +1162 -0
- package/dist/lib/evgr/Cargo.lock +21 -0
- package/dist/lib/evgr/Cargo.toml +19 -0
- package/dist/lib/evgr/README.md +140 -0
- package/dist/lib/evgr/bench/NativeBench.rgr +246 -0
- package/dist/lib/evgr/bench/compare.mjs +252 -0
- package/dist/lib/evgr/bench/speed.mjs +277 -0
- package/dist/lib/evgr/bin/.gitignore +3 -0
- package/dist/lib/evgr/src/bin/bench.rs +106 -0
- package/dist/lib/evgr/src/bin/smoke.rs +13 -0
- package/dist/lib/evgr/src/grid.rs +730 -0
- package/dist/lib/evgr/src/lib.rs +1003 -0
- package/dist/lib/evgr/src/style.rs +468 -0
- package/dist/lib/evgr/src/text.rs +83 -0
- package/dist/lib/image/BitReader.rgr +171 -0
- package/dist/lib/image/Buffer.rgr +173 -0
- package/dist/lib/image/DCT.rgr +283 -0
- package/dist/lib/image/Deflate.rgr +339 -0
- package/dist/lib/image/HuffmanDecoder.rgr +181 -0
- package/dist/lib/image/ImageBuffer.rgr +706 -0
- package/dist/lib/image/JPEGDecoder.rgr +808 -0
- package/dist/lib/image/PNGDecoder.rgr +544 -0
- package/dist/lib/image/PNGEncoder.rgr +388 -0
- package/dist/lib/image/PPMImage.rgr +224 -0
- package/dist/lib/image/ProgressiveJPEGDecoder.rgr +1154 -0
- package/dist/lib/image/README.md +33 -0
- package/dist/lib/image/RasterBuffer.rgr +294 -0
- package/dist/lib/image/VP8BoolDecoder.rgr +163 -0
- package/dist/lib/image/WebPDecoder.rgr +433 -0
- package/dist/lib/image/WebPLossless.rgr +1035 -0
- package/dist/lib/image/WebPLossy.rgr +1929 -0
- package/dist/lib/image/ranger.json +9 -0
- package/dist/lib/image/testdata/webp/anim_2f_24x16.webp +0 -0
- package/dist/lib/image/testdata/webp/fixtures.txt +33 -0
- package/dist/lib/image/testdata/webp/gen_fixtures.py +261 -0
- package/dist/lib/image/testdata/webp/ll_1x1.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_alpha_29x21.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_gradient_64x64.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_meta_32x32.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_noise_17x9.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal11_23x11.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal2_19x7.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal40_16x16.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal4_13x5.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_photo_40x30.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_predictors_64x32.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_1x1.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f0_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f1_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f2_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f3_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f0_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f1_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f2_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f3_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alpha_33x17.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_exif_15x11.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_i16_96x80.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_nofilter_24x20.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_odd_17x9.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_photo_48x40.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_q100_20x18.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_sharp_40x36.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_simple_filter_33x31.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_vpx_parts8_37x45.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_vpx_skip_96x80.webp +0 -0
- package/dist/lib/image/tests/WebPDecodeTool.rgr +81 -0
- package/dist/lib/image/tests/WebPDecoderTest.rgr +1162 -0
- package/dist/lib/image/tests/run_webp_tests.sh +39 -0
- package/dist/lib/rust/RsJson.rgr +468 -0
- package/dist/lib/rust/RsPrelude.rgr +1663 -0
- package/dist/lib/shell_test.rgr +7 -7
- package/dist/lib/stdlib.rgr +21 -5
- package/dist/lib/zip/ranger.json +6 -0
- package/dist/rgrc.js +87318 -67610
- package/package.json +1010 -1040
- package/dist/README.md +0 -117
- package/dist/package.json +0 -47
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
; SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
; =============================================================================
|
|
4
|
+
; EVGFocus — the keyboard, for a renderer that has none
|
|
5
|
+
; =============================================================================
|
|
6
|
+
; A drawn UI has no tab stops. The browser gives them to a page of elements for
|
|
7
|
+
; free; a canvas is one element, and everything inside it is a rectangle the
|
|
8
|
+
; GPU painted. So every EVG app so far has either had no keyboard at all or
|
|
9
|
+
; hand-written one for the single widget that needed it — which is why the
|
|
10
|
+
; arrows do nothing on a screen full of buttons.
|
|
11
|
+
;
|
|
12
|
+
; This is that, once, for every renderer: the elements that say they are
|
|
13
|
+
; focusable, in an order, with a rule for what an arrow key means.
|
|
14
|
+
;
|
|
15
|
+
; Tab / Shift+Tab the next and previous in TREE ORDER, wrapping. That is
|
|
16
|
+
; the order the page was written in, which is the order
|
|
17
|
+
; the a11y mirror publishes and the order a browser
|
|
18
|
+
; would use.
|
|
19
|
+
;
|
|
20
|
+
; the four arrows SPATIAL. Tree order is wrong for a grid: the thing
|
|
21
|
+
; under a button is not the thing after it. So an arrow
|
|
22
|
+
; looks at the boxes — where the focus is now, and which
|
|
23
|
+
; focusable box lies in that direction — and takes the
|
|
24
|
+
; nearest one, measured along the direction moved and
|
|
25
|
+
; penalised for drifting sideways.
|
|
26
|
+
;
|
|
27
|
+
; Home / End the first and the last.
|
|
28
|
+
;
|
|
29
|
+
; AND A MODAL TRAPS IT. A dialog that has to be closed must not be a dialog
|
|
30
|
+
; the keyboard can walk out of — Tab past its last button and the ring is on
|
|
31
|
+
; the page behind it, over controls the person cannot see the point of and
|
|
32
|
+
; cannot get back from except by walking all the way round.
|
|
33
|
+
;
|
|
34
|
+
; The trap is not something a host remembers to switch on. It is already in
|
|
35
|
+
; the tree: a dialog says `a11yModal`, which is `aria-modal` and what the
|
|
36
|
+
; accessibility mirror reads to hide the page behind it, so the keyboard reads
|
|
37
|
+
; the same declaration. While one is up, the walk starts at that dialog and
|
|
38
|
+
; the page under it does not exist as far as the keys are concerned — and when
|
|
39
|
+
; it closes, the tree stops saying so and the whole page comes back.
|
|
40
|
+
;
|
|
41
|
+
; The INNERMOST one, which here means the last in tree order: overlays are
|
|
42
|
+
; appended, so a review sheet opened over an add sheet is the one after it,
|
|
43
|
+
; and it is the one that traps.
|
|
44
|
+
;
|
|
45
|
+
; A focusable element is one that says `a11yFocusable` and is not
|
|
46
|
+
; `a11yDisabled` or `a11yHidden`, and has a box with area. A control with no
|
|
47
|
+
; id cannot be focused, because an id is what the host presses.
|
|
48
|
+
;
|
|
49
|
+
; NOTHING HERE DRAWS. `EVGDisplayList.setFocus` puts a ring around whatever id
|
|
50
|
+
; this settles on, so a renderer gets the ring for the same reason it gets a
|
|
51
|
+
; border: it is in the list.
|
|
52
|
+
;
|
|
53
|
+
; The spatial rule, stated once because it is the whole design:
|
|
54
|
+
;
|
|
55
|
+
; A candidate counts only if its CENTRE is past the current box's edge in
|
|
56
|
+
; the direction moved. Its cost is the distance along that direction plus
|
|
57
|
+
; twice the overlap-free gap across it. So a button directly below wins
|
|
58
|
+
; over one further down, and one directly below wins over one beside it —
|
|
59
|
+
; which is what "down" means to a person looking at the screen.
|
|
60
|
+
; =============================================================================
|
|
61
|
+
|
|
62
|
+
Import "EVGElement.rgr"
|
|
63
|
+
|
|
64
|
+
class EVGFocus {
|
|
65
|
+
; The focusable ids, in tree order, and their boxes.
|
|
66
|
+
def ids:[string]
|
|
67
|
+
def xs:[double]
|
|
68
|
+
def ys:[double]
|
|
69
|
+
def ws:[double]
|
|
70
|
+
def hs:[double]
|
|
71
|
+
; What has the focus, or "" for nothing.
|
|
72
|
+
def focusId@(mutable):string ""
|
|
73
|
+
; WHETHER TO DRAW IT. The focus moves on a click as well as on a key —
|
|
74
|
+
; otherwise Tab after a click carries on from somewhere else on the screen
|
|
75
|
+
; — but a ring round every button somebody points at is not what a focus
|
|
76
|
+
; ring is for. The rule is the browsers': shown when a key put it there,
|
|
77
|
+
; not when the pointer did. `ringId` is what a renderer asks.
|
|
78
|
+
def ringVisible@(mutable):boolean false
|
|
79
|
+
; The dialog the walk is confined to, when the tree declares one.
|
|
80
|
+
def trapEl@(mutable+optional):EVGElement
|
|
81
|
+
def trapped@(mutable):boolean false
|
|
82
|
+
|
|
83
|
+
Constructor () {
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
; --- what can be focused ---------------------------------------------------
|
|
87
|
+
|
|
88
|
+
fn scan:void (root:EVGElement) {
|
|
89
|
+
clear ids
|
|
90
|
+
clear xs
|
|
91
|
+
clear ys
|
|
92
|
+
clear ws
|
|
93
|
+
clear hs
|
|
94
|
+
trapped = false
|
|
95
|
+
def none@(optional):EVGElement
|
|
96
|
+
trapEl = none
|
|
97
|
+
this.findModal(root)
|
|
98
|
+
if trapped {
|
|
99
|
+
this.walk((unwrap trapEl))
|
|
100
|
+
return
|
|
101
|
+
}
|
|
102
|
+
this.walk(root)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
; The last modal in tree order that is on the screen — see the note at the
|
|
106
|
+
; top. Pre-order and overwriting, so a dialog nested inside another wins
|
|
107
|
+
; over the one holding it, and a later sibling wins over an earlier one.
|
|
108
|
+
fn findModal:void (el:EVGElement) {
|
|
109
|
+
if el.a11yHidden {
|
|
110
|
+
return
|
|
111
|
+
}
|
|
112
|
+
if (el.display == "none") {
|
|
113
|
+
return
|
|
114
|
+
}
|
|
115
|
+
if el.a11yModal {
|
|
116
|
+
trapEl = el
|
|
117
|
+
trapped = true
|
|
118
|
+
}
|
|
119
|
+
def i:int 0
|
|
120
|
+
def n:int (el.getChildCount())
|
|
121
|
+
while (i < n) {
|
|
122
|
+
this.findModal((el.getChild(i)))
|
|
123
|
+
i = (i + 1)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
; The id of the dialog the keys are trapped in, or "" when they are not.
|
|
128
|
+
; A dialog with no id still traps — the walk is confined to the element,
|
|
129
|
+
; not to its name — so this answers "" for one, which is why a caller that
|
|
130
|
+
; wants to know IF there is a trap asks `isTrapped`.
|
|
131
|
+
fn trapId:string () {
|
|
132
|
+
if (trapped == false) {
|
|
133
|
+
return ""
|
|
134
|
+
}
|
|
135
|
+
def el:EVGElement (unwrap trapEl)
|
|
136
|
+
return el.id
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
fn isTrapped:boolean () {
|
|
140
|
+
return trapped
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
fn walk:void (el:EVGElement) {
|
|
144
|
+
if el.a11yHidden {
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
if (el.display == "none") {
|
|
148
|
+
return
|
|
149
|
+
}
|
|
150
|
+
if (EVGFocus.takes(el)) {
|
|
151
|
+
push ids el.id
|
|
152
|
+
push xs el.calculatedX
|
|
153
|
+
push ys el.calculatedY
|
|
154
|
+
push ws el.calculatedWidth
|
|
155
|
+
push hs el.calculatedHeight
|
|
156
|
+
}
|
|
157
|
+
def i:int 0
|
|
158
|
+
def n:int (el.getChildCount())
|
|
159
|
+
while (i < n) {
|
|
160
|
+
this.walk((el.getChild(i)))
|
|
161
|
+
i = (i + 1)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
; An element with no id cannot be focused: the host acts on ids, and a
|
|
166
|
+
; focus nobody can press is a focus that goes nowhere.
|
|
167
|
+
sfn takes:boolean (el:EVGElement) {
|
|
168
|
+
if (el.a11yFocusable == false) {
|
|
169
|
+
return false
|
|
170
|
+
}
|
|
171
|
+
if el.a11yDisabled {
|
|
172
|
+
return false
|
|
173
|
+
}
|
|
174
|
+
if ((strlen el.id) == 0) {
|
|
175
|
+
return false
|
|
176
|
+
}
|
|
177
|
+
if (el.calculatedWidth <= 0.0) {
|
|
178
|
+
return false
|
|
179
|
+
}
|
|
180
|
+
return (el.calculatedHeight > 0.0)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
fn count:int () {
|
|
184
|
+
return (array_length ids)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
fn idAt:string (i:int) {
|
|
188
|
+
if (i < 0) {
|
|
189
|
+
return ""
|
|
190
|
+
}
|
|
191
|
+
if (i >= (array_length ids)) {
|
|
192
|
+
return ""
|
|
193
|
+
}
|
|
194
|
+
return (itemAt ids i)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
fn indexOfId:int (id:string) {
|
|
198
|
+
def i:int 0
|
|
199
|
+
def n:int (array_length ids)
|
|
200
|
+
while (i < n) {
|
|
201
|
+
if ((itemAt ids i) == id) {
|
|
202
|
+
return i
|
|
203
|
+
}
|
|
204
|
+
i = (i + 1)
|
|
205
|
+
}
|
|
206
|
+
return (0 - 1)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
; --- moving ----------------------------------------------------------------
|
|
210
|
+
|
|
211
|
+
; Tree order, wrapping. With nothing focused, Tab starts at the first and
|
|
212
|
+
; Shift+Tab at the last — the same as a browser entering a page from
|
|
213
|
+
; either end.
|
|
214
|
+
fn step:string (back:boolean) {
|
|
215
|
+
def n:int (array_length ids)
|
|
216
|
+
if (n == 0) {
|
|
217
|
+
return ""
|
|
218
|
+
}
|
|
219
|
+
def at:int (this.indexOfId(focusId))
|
|
220
|
+
if (at < 0) {
|
|
221
|
+
if back {
|
|
222
|
+
return (this.idAt((n - 1)))
|
|
223
|
+
}
|
|
224
|
+
return (this.idAt(0))
|
|
225
|
+
}
|
|
226
|
+
def next@(mutable):int (at + 1)
|
|
227
|
+
if back {
|
|
228
|
+
next = (at - 1)
|
|
229
|
+
}
|
|
230
|
+
if (next >= n) {
|
|
231
|
+
next = 0
|
|
232
|
+
}
|
|
233
|
+
if (next < 0) {
|
|
234
|
+
next = (n - 1)
|
|
235
|
+
}
|
|
236
|
+
return (this.idAt(next))
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
; The spatial rule stated at the top. `dx`/`dy` is the direction: one of
|
|
240
|
+
; (0,-1) (0,1) (-1,0) (1,0).
|
|
241
|
+
fn towards:string (dx:double dy:double) {
|
|
242
|
+
def n:int (array_length ids)
|
|
243
|
+
if (n == 0) {
|
|
244
|
+
return ""
|
|
245
|
+
}
|
|
246
|
+
def at:int (this.indexOfId(focusId))
|
|
247
|
+
if (at < 0) {
|
|
248
|
+
; Nowhere yet: an arrow enters at the first, like Tab.
|
|
249
|
+
return (this.idAt(0))
|
|
250
|
+
}
|
|
251
|
+
def cx:double ((itemAt xs at) + ((itemAt ws at) / 2.0))
|
|
252
|
+
def cy:double ((itemAt ys at) + ((itemAt hs at) / 2.0))
|
|
253
|
+
def best@(mutable):string ""
|
|
254
|
+
def bestCost@(mutable):double 0.0
|
|
255
|
+
def i:int 0
|
|
256
|
+
while (i < n) {
|
|
257
|
+
if (i != at) {
|
|
258
|
+
def ox:double ((itemAt xs i) + ((itemAt ws i) / 2.0))
|
|
259
|
+
def oy:double ((itemAt ys i) + ((itemAt hs i) / 2.0))
|
|
260
|
+
def along:double (((ox - cx) * dx) + ((oy - cy) * dy))
|
|
261
|
+
; Strictly past the centre in the direction moved. Half a
|
|
262
|
+
; pixel, so a row of buttons whose centres are one rounding
|
|
263
|
+
; apart does not count as "below" itself.
|
|
264
|
+
if (along > 0.5) {
|
|
265
|
+
; Across is the other axis, which for (0,±1) is x and for
|
|
266
|
+
; (±1,0) is y.
|
|
267
|
+
def across@(mutable):double ((ox - cx) * dy)
|
|
268
|
+
if (dy == 0.0) {
|
|
269
|
+
across = (oy - cy)
|
|
270
|
+
} {
|
|
271
|
+
across = (ox - cx)
|
|
272
|
+
}
|
|
273
|
+
if (across < 0.0) {
|
|
274
|
+
across = (0.0 - across)
|
|
275
|
+
}
|
|
276
|
+
def cost:double (along + (across * 2.0))
|
|
277
|
+
if ((strlen best) == 0) {
|
|
278
|
+
best = (itemAt ids i)
|
|
279
|
+
bestCost = cost
|
|
280
|
+
} {
|
|
281
|
+
if (cost < bestCost) {
|
|
282
|
+
best = (itemAt ids i)
|
|
283
|
+
bestCost = cost
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
i = (i + 1)
|
|
289
|
+
}
|
|
290
|
+
return best
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
; --- the key ---------------------------------------------------------------
|
|
294
|
+
|
|
295
|
+
; One key against a tree. Answers the id the focus moved to, or "" when
|
|
296
|
+
; the key is not one of these or there is nowhere to go — a host that gets
|
|
297
|
+
; "" must let the key through, because refusing a key you did nothing with
|
|
298
|
+
; is how a page stops scrolling.
|
|
299
|
+
;
|
|
300
|
+
; `scan` runs here so a caller never has to remember to: the tree it is
|
|
301
|
+
; given is the tree as it is now, and a focus that survived a rebuild is
|
|
302
|
+
; found by id rather than by position.
|
|
303
|
+
fn key:string (root:EVGElement k:string shift:boolean) {
|
|
304
|
+
this.scan(root)
|
|
305
|
+
def to@(mutable):string ""
|
|
306
|
+
if (k == "Tab") {
|
|
307
|
+
to = (this.step(shift))
|
|
308
|
+
}
|
|
309
|
+
if (k == "ArrowDown") {
|
|
310
|
+
to = (this.towards(0.0 1.0))
|
|
311
|
+
}
|
|
312
|
+
if (k == "ArrowUp") {
|
|
313
|
+
to = (this.towards(0.0 (0.0 - 1.0)))
|
|
314
|
+
}
|
|
315
|
+
if (k == "ArrowRight") {
|
|
316
|
+
to = (this.towards(1.0 0.0))
|
|
317
|
+
}
|
|
318
|
+
if (k == "ArrowLeft") {
|
|
319
|
+
to = (this.towards((0.0 - 1.0) 0.0))
|
|
320
|
+
}
|
|
321
|
+
if (k == "Home") {
|
|
322
|
+
to = (this.idAt(0))
|
|
323
|
+
}
|
|
324
|
+
if (k == "End") {
|
|
325
|
+
to = (this.idAt(((array_length ids) - 1)))
|
|
326
|
+
}
|
|
327
|
+
if ((strlen to) == 0) {
|
|
328
|
+
return ""
|
|
329
|
+
}
|
|
330
|
+
focusId = to
|
|
331
|
+
ringVisible = true
|
|
332
|
+
return to
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
; Put the focus somewhere by hand — a press, or a screen that opens with
|
|
336
|
+
; something already chosen. An id nothing focusable carries is refused
|
|
337
|
+
; rather than remembered, so the ring cannot point at nothing.
|
|
338
|
+
fn place:boolean (root:EVGElement id:string) {
|
|
339
|
+
if ((strlen id) == 0) {
|
|
340
|
+
focusId = ""
|
|
341
|
+
ringVisible = false
|
|
342
|
+
return true
|
|
343
|
+
}
|
|
344
|
+
this.scan(root)
|
|
345
|
+
if ((this.indexOfId(id)) < 0) {
|
|
346
|
+
return false
|
|
347
|
+
}
|
|
348
|
+
focusId = id
|
|
349
|
+
ringVisible = true
|
|
350
|
+
return true
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
; The same, from a POINTER: the focus moves so the keys carry on from what
|
|
354
|
+
; was just clicked, and nothing is drawn, because the person can see where
|
|
355
|
+
; they clicked.
|
|
356
|
+
fn pointAt:boolean (root:EVGElement id:string) {
|
|
357
|
+
if ((this.place(root id)) == false) {
|
|
358
|
+
return false
|
|
359
|
+
}
|
|
360
|
+
ringVisible = false
|
|
361
|
+
return true
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
; SHOW IT AGAIN. A press is the pointer's by default — `pointAt` puts the
|
|
365
|
+
; ring away — and a press the KEYBOARD made is not: Enter on a focused
|
|
366
|
+
; button activates it and leaves the ring where it was, in every browser
|
|
367
|
+
; there is. The caller that knows a key did it says so with this.
|
|
368
|
+
fn show:void () {
|
|
369
|
+
if ((strlen focusId) > 0) {
|
|
370
|
+
ringVisible = true
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
; Where to draw the ring, or "" for nowhere.
|
|
375
|
+
fn ringId:string () {
|
|
376
|
+
if (ringVisible == false) {
|
|
377
|
+
return ""
|
|
378
|
+
}
|
|
379
|
+
return focusId
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
fn clear:void () {
|
|
383
|
+
focusId = ""
|
|
384
|
+
ringVisible = false
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
; The focus after a rebuild: it is kept if the id is still focusable, and
|
|
388
|
+
; dropped if it is not — a ring around an element that has gone is worse
|
|
389
|
+
; than no ring.
|
|
390
|
+
fn settle:void (root:EVGElement) {
|
|
391
|
+
if ((strlen focusId) == 0) {
|
|
392
|
+
return
|
|
393
|
+
}
|
|
394
|
+
this.scan(root)
|
|
395
|
+
if ((this.indexOfId(focusId)) < 0) {
|
|
396
|
+
focusId = ""
|
|
397
|
+
ringVisible = false
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|