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,227 @@
|
|
|
1
|
+
# Putting a Ranger app in a window
|
|
2
|
+
|
|
3
|
+
An EVG application is a pure Ranger program: it lays out a tree, applies a
|
|
4
|
+
stylesheet and emits an `EVGDisplayList`. It has no window, no touch, no
|
|
5
|
+
clock and no files. A **host** is what puts it in a window — and there are four
|
|
6
|
+
of those in this repository, for iOS, Android, the browser and (in
|
|
7
|
+
`gallery/rangerflow/platform/sdl`) a desktop SDL window.
|
|
8
|
+
|
|
9
|
+
They used to be written out per application per platform. Most of what they
|
|
10
|
+
each contained was the same, and this is what is left once that is shared.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## The pieces
|
|
15
|
+
|
|
16
|
+
| | what it is | where |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `EvgApp` | the conversation every host has with every app: a page size, a hit test, presses, hovers, scrolls, keys, a clock, a display list | `EvgApp.rgr` |
|
|
19
|
+
| `EvgViewport` | a window, a safe area and where the page sits inside them: the fit, the scale, the pan, window point → page point | `EvgViewport.rgr` |
|
|
20
|
+
| `EvgHost` | a host for an app that scrolls a document: the press a drag cancels, the fling timed against the host's clock, the keyboard's text. Used by the UIKit view, the Android View, and the browser page in both its arrangements | `EvgHost.rgr` |
|
|
21
|
+
| `UiWindowHost` | a host for a fixed-width page that is fitted, panned and pinched | `../../gallery/ui/src/UiWindowHost.rgr` |
|
|
22
|
+
| the painters | `EVGDisplayList` → CoreGraphics, Android `Canvas`, WebGL 2, DOM | `apple/`, `android/`, `gl/`, `html/` |
|
|
23
|
+
|
|
24
|
+
`EvgApp`'s defaults are what an app that does not do a thing should answer —
|
|
25
|
+
nothing happened, nothing is under the point, the list is empty — so a host may
|
|
26
|
+
ask anything of any app without checking first what kind of app it is.
|
|
27
|
+
|
|
28
|
+
`EvgViewport` has three modes, and they are modes rather than a compromise:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
0 the page IS the window scale 1, pan 0, a pinch does nothing
|
|
32
|
+
1 fit the page's own width panned and pinched
|
|
33
|
+
2 fit, with a readable floor the watch: bigger than the window, moved around
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Mode 0 is mode 1 with the page's width equal to the usable width. It is a mode
|
|
37
|
+
of its own so a host that means it cannot be zoomed out of by arithmetic.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## A new application, on every platform
|
|
42
|
+
|
|
43
|
+
**1. Make the app answer the conversation.** Extend `EvgApp` and override what
|
|
44
|
+
it does. Nothing else changes: the methods have the names the app already used.
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
class MyApp extends EvgApp {
|
|
48
|
+
fn display:EVGDisplayList () { ... }
|
|
49
|
+
fn hitId:string (px:double py:double) { ... }
|
|
50
|
+
...
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**2. Choose a host and say what is yours.** A document that scrolls extends
|
|
55
|
+
`EvgHost`; a fixed-width page that is fitted and pinched extends
|
|
56
|
+
`UiWindowHost`. The subclass holds the app twice — once as itself, for the
|
|
57
|
+
calls that are its own, and once in `app`, which is all the host ever sees —
|
|
58
|
+
and adds only how the app is loaded:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
class MyHost extends EvgHost {
|
|
62
|
+
def mine:MyApp (new MyApp)
|
|
63
|
+
Constructor () { app = mine }
|
|
64
|
+
fn start:void (w:double h:double css:string) {
|
|
65
|
+
mine.init(css)
|
|
66
|
+
this.began(w h)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`RtHost.rgr` is 62 lines and four of them are RealTrainer's own; that is the
|
|
72
|
+
size this step should be.
|
|
73
|
+
|
|
74
|
+
**3. Name it per platform.** One line each, because the Swift and the Kotlin
|
|
75
|
+
import a name:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
; ios/ranger/my_ios.rgr
|
|
79
|
+
class MyIos extends MyHost { }
|
|
80
|
+
|
|
81
|
+
; android/ranger/my_android.rgr
|
|
82
|
+
class MyAndroid extends MyHost { }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**4. Check it on Node.** This is the step that makes the rest cheap: the host
|
|
86
|
+
is Ranger, so the whole viewport — the fit, the conversion, the press, the
|
|
87
|
+
drag, the fling, the keys — is drivable without a device.
|
|
88
|
+
`realtrainer/ios/ranger/check_rt_ios.rgr` is 42 assertions and
|
|
89
|
+
`ui/ios/ranger/check_ios.rgr` is 82; between them they are what lets any of
|
|
90
|
+
this be refactored at all. A Mac and an emulator are then needed only for the
|
|
91
|
+
Swift and the Kotlin on top.
|
|
92
|
+
|
|
93
|
+
They run on every push, as the `shared-hosts` job:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
npm run hosts:verify # the three host checks — 164 assertions, ~45 s
|
|
97
|
+
npm run rt:node # the app driven headlessly — ~50 s
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The browser gates — `rt:shell`, `rt:dom`, `rt:frame`, `rt:split`, `rt:boot` —
|
|
101
|
+
want Chromium and the conformance host's dependencies, and are run by hand.
|
|
102
|
+
|
|
103
|
+
**5. Write the platform glue.** What genuinely cannot be shared: unpacking a
|
|
104
|
+
`UITouch` or a `MotionEvent`, running a display link, handing a `CGContext` or
|
|
105
|
+
a `Canvas` to the painter, owning the keyboard. RealTrainer's is 397 lines of
|
|
106
|
+
Swift and 504 of Kotlin, and it calls the host and nothing else.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## A page in a browser
|
|
111
|
+
|
|
112
|
+
A browser page is a host too, and the parts of one that are not about the
|
|
113
|
+
viewport turned out to be the same in all seven gallery pages: fetch the
|
|
114
|
+
assets, ship a bundle small enough to parse, and be able to say how long any
|
|
115
|
+
of it took.
|
|
116
|
+
|
|
117
|
+
| | what it does | where |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| `inline-assets.mjs` | writes the head that starts every asset before the body is parsed, from the list the build already has | `web/tools/` |
|
|
120
|
+
| `assets-client.mjs` | the module half: picks those responses up by name, and registers the faces with the browser | `web/tools/` |
|
|
121
|
+
| `minify.mjs` | minifies a compiled bundle and checks the global its scope publishes survived | `web/tools/` |
|
|
122
|
+
| `boot-bench.mjs` | first paint and first painted frame, on a throttled, gzipped connection | `web/tools/` |
|
|
123
|
+
|
|
124
|
+
All seven gallery pages are built this way.
|
|
125
|
+
|
|
126
|
+
The order assets were fetched in was the same mistake everywhere: the page
|
|
127
|
+
loaded its engine, ran its module, and only then asked for its fonts, then its
|
|
128
|
+
catalogue, then its document — one await at a time. None of those requests
|
|
129
|
+
needs any code to be running, so they go out in the head, and a visitor waits
|
|
130
|
+
for the longest download rather than for their sum.
|
|
131
|
+
|
|
132
|
+
```sh
|
|
133
|
+
# in the build, after the assets are copied and the stamp is known
|
|
134
|
+
node lib/evg/web/tools/minify.mjs --file "$OUT/app_web.js" --keep AppWeb
|
|
135
|
+
node lib/evg/web/tools/inline-assets.mjs \
|
|
136
|
+
--html "$OUT/index.html" --start "$ASSETS" \
|
|
137
|
+
--preload "standalone.mjs,gl/evg-webgl.js" --stamp "$STAMP"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```js
|
|
141
|
+
// in the page's module
|
|
142
|
+
import { bytesOf, textOf, asRangerBuffer } from "./evg/assets-client.mjs";
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Three rules, each of which was learned the hard way:
|
|
146
|
+
|
|
147
|
+
**Collect `$ASSETS` as the build copies the files**, never as a second list. An
|
|
148
|
+
asset named in one place and not the other is either fetched twice or waited
|
|
149
|
+
for and never started, and neither shows up as an error.
|
|
150
|
+
|
|
151
|
+
**A preload whose URL is not the URL the module imports is a second
|
|
152
|
+
download.** Builds stamp some module URLs with the build id and leave others
|
|
153
|
+
alone, which is why there are two flags: `--preload-stamped` and `--preload`.
|
|
154
|
+
|
|
155
|
+
**Register the faces from the bytes the page already has** (`registerFaces`),
|
|
156
|
+
and declare no `@font-face` for them. A canvas asking for a CSS-declared
|
|
157
|
+
family makes the browser load the CSS copy on top of the bytes you fetched —
|
|
158
|
+
measured, before this was fixed, as nine font requests for eight faces on
|
|
159
|
+
pptx and twelve for eight on book. The other half of that rule matters more: a
|
|
160
|
+
page that registers nothing measures in one face and draws in another, and a
|
|
161
|
+
caret ends up most of a letter past the end of a word.
|
|
162
|
+
|
|
163
|
+
What it was worth, on the 4 Mbps / 60 ms / 4× CPU bench:
|
|
164
|
+
|
|
165
|
+
| | before | now |
|
|
166
|
+
|---|---:|---:|
|
|
167
|
+
| datagrid | 5070 ms | 2890 ms |
|
|
168
|
+
| pptx | 4813 ms | 2778 ms |
|
|
169
|
+
| docx_viewer | 3517 ms | 2535 ms |
|
|
170
|
+
| rangerdbviewer | — | 1920 ms |
|
|
171
|
+
| RealTrainer | 2182 ms | 934 ms |
|
|
172
|
+
|
|
173
|
+
RealTrainer is further along than the rest and its remaining tools are still
|
|
174
|
+
its own: a first picture computed at build time from the app's own display
|
|
175
|
+
list (`realtrainer/web/snapshot.mjs`), the check that holds that picture
|
|
176
|
+
against the live frame, and a byte budget on what the first download may cost.
|
|
177
|
+
Those generalise the same way these did, and have not been.
|
|
178
|
+
|
|
179
|
+
The fonts are what is left, and they are most of what these pages still
|
|
180
|
+
download: datagrid ships twenty faces and 4.5 MB, pptx eight and 2.4 MB, all
|
|
181
|
+
of it uncompressed TrueType because both halves of the page read it — the
|
|
182
|
+
browser to draw with, the app to measure with. RealTrainer ships none: it
|
|
183
|
+
measures with the browser (`installCanvasMeasurer`) and lets CSS load the
|
|
184
|
+
faces. That is the third answer and the best one, and it is an application
|
|
185
|
+
change rather than a build line.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Where each platform stands
|
|
190
|
+
|
|
191
|
+
**iOS and Android** share everything above. `RtIos` and `RtAndroid` are one
|
|
192
|
+
line each; so are `UiIos` and `UiAndroid`. A gesture or a viewport rule fixed
|
|
193
|
+
once is fixed on both.
|
|
194
|
+
|
|
195
|
+
**SDL** is a different shape and composes rather than competes:
|
|
196
|
+
`rangerflow_sdl.rgr` is the outer loop — open a window, pump input, draw a
|
|
197
|
+
frame — where `EvgHost` is the inner viewport. A host that wanted both would
|
|
198
|
+
own an `EvgHost` and call it from `pumpInput`.
|
|
199
|
+
|
|
200
|
+
**The browser uses `EvgHost` too**, on the main-thread path. `main.js` had its
|
|
201
|
+
own copy of the press a drag cancels, the scrollbar grab, the hover and the
|
|
202
|
+
drag's velocity — the same state machine, in JavaScript — and now makes the
|
|
203
|
+
same six calls a UIKit view makes: `pressAt`, `panBy`, `releasePress`,
|
|
204
|
+
`cancelPress`, `hoverAt`, `clearHover`, with `key`, `typeText` and `tick`
|
|
205
|
+
beside them. It is 26 lines shorter and, more to the point, a rule fixed on a
|
|
206
|
+
phone is now fixed here.
|
|
207
|
+
|
|
208
|
+
Two things stayed in the page, and both should:
|
|
209
|
+
|
|
210
|
+
- **The wheel.** A wheel is not a finger and has no native counterpart. It
|
|
211
|
+
goes straight to the app, as it always did.
|
|
212
|
+
- **The keyboard's own element.** `evg-textinput.js` owns a real DOM field so
|
|
213
|
+
a phone keyboard has something to attach to, and the accessibility mirror
|
|
214
|
+
publishes what the frame means. Neither has anything to do with the
|
|
215
|
+
viewport.
|
|
216
|
+
|
|
217
|
+
The Worker arrangement — the page's default, with the engine off the main
|
|
218
|
+
thread — shares it too. The worker holds the host beside the tree, so a
|
|
219
|
+
press, a drag, a lift and a hover are six posts and no round trips; the page
|
|
220
|
+
used to `await` the worker to find out whether the scrollbar's thumb had taken
|
|
221
|
+
the press before it knew what kind of drag it had started.
|
|
222
|
+
|
|
223
|
+
What is left in the page on both arrangements is what the browser knows and a
|
|
224
|
+
host cannot: which pointers are down, and how long a move took. The second of
|
|
225
|
+
those goes over as a number — `panAt` takes an interval where `panBy` reads
|
|
226
|
+
the frame's clock, because a pointer event carries a timestamp and a touch
|
|
227
|
+
callback does not.
|