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,313 @@
|
|
|
1
|
+
; SPDX-License-Identifier: MIT
|
|
2
|
+
; ==============================================================================
|
|
3
|
+
; EvgViewport.rgr — a window, a safe area, and where the page sits inside them.
|
|
4
|
+
; ==============================================================================
|
|
5
|
+
;
|
|
6
|
+
; PLAN_WEB_LOADING.md S8. Every port of an EVG app does this arithmetic, and
|
|
7
|
+
; every port had written it out: take the system's insets off the window, work
|
|
8
|
+
; out what the page is scaled by, convert a window point to a page point, keep
|
|
9
|
+
; a pan inside the page's own edges. It was in `EvgHost` once and in
|
|
10
|
+
; `UiWindowHost` again, and the second one was right about more of it.
|
|
11
|
+
;
|
|
12
|
+
; So it is here, with no app in it at all. A host owns one, tells it the
|
|
13
|
+
; window and the page's width, and asks it where things are; two hosts with
|
|
14
|
+
; entirely different ideas of what an app IS still agree about where a finger
|
|
15
|
+
; landed.
|
|
16
|
+
;
|
|
17
|
+
; THE TWO MODELS ARE A MODE, and they are not a compromise between each other:
|
|
18
|
+
;
|
|
19
|
+
; 0 the page IS the window. It is laid out at the usable size and laid out
|
|
20
|
+
; again when that changes, so the scale is one, the pan is zero and a
|
|
21
|
+
; pinch has nothing to do. RealTrainer, and the browser at `?page=fit`.
|
|
22
|
+
; 1 the page has a width of its own and is shown at the scale that fits it.
|
|
23
|
+
; What does not fit is panned to, and a pinch zooms in. The dashboard on
|
|
24
|
+
; a phone or a tablet.
|
|
25
|
+
; 2 the same, with a floor: below `readableScale` the text stops being text
|
|
26
|
+
; and starts being texture, so the page is shown bigger than the window
|
|
27
|
+
; and the reader moves around it. The dashboard on a watch.
|
|
28
|
+
;
|
|
29
|
+
; Mode 0 is not a special case bolted on: it is mode 1 with the page's width
|
|
30
|
+
; equal to the usable width, which makes the fit exactly one. It is a mode of
|
|
31
|
+
; its own because a host that means it should not be able to zoom out of it by
|
|
32
|
+
; arithmetic.
|
|
33
|
+
|
|
34
|
+
class EvgViewport {
|
|
35
|
+
|
|
36
|
+
; The window, in the host's own units — points on iOS, density-independent
|
|
37
|
+
; pixels on Android, CSS pixels in a browser. Which of those it is, is the
|
|
38
|
+
; host's business; the arithmetic is the same in all of them.
|
|
39
|
+
def screenW:double 0.0
|
|
40
|
+
def screenH:double 0.0
|
|
41
|
+
|
|
42
|
+
; The part of the window the system will cover: a status bar, a notch, a
|
|
43
|
+
; home indicator, a keyboard. Zero everywhere until a host says otherwise,
|
|
44
|
+
; which is why an Android host that never calls `setSafeArea` gets the
|
|
45
|
+
; identity conversions it used to write out by hand.
|
|
46
|
+
def insetTop:double 0.0
|
|
47
|
+
def insetBottom:double 0.0
|
|
48
|
+
def insetLeft:double 0.0
|
|
49
|
+
def insetRight:double 0.0
|
|
50
|
+
|
|
51
|
+
def fitMode:int 0
|
|
52
|
+
; The smallest scale the readable mode will go to. 1336 page pixels at 0.5
|
|
53
|
+
; is 668 of them across a 45mm watch — a column of the page, at a size the
|
|
54
|
+
; text on it is text rather than texture.
|
|
55
|
+
def readableScale:double 0.5
|
|
56
|
+
|
|
57
|
+
; The page's own width, when it has a fixed one. A host in mode 1 or 2
|
|
58
|
+
; hands this over whenever the app's layout changes it.
|
|
59
|
+
def pageW:double 0.0
|
|
60
|
+
|
|
61
|
+
; What the page is scaled by to fit, and what the reader zoomed in by on
|
|
62
|
+
; top of that.
|
|
63
|
+
def fitScale:double 1.0
|
|
64
|
+
def zoomValue:double 1.0
|
|
65
|
+
; How far right the page is panned, in PAGE pixels. Only ever non-zero when
|
|
66
|
+
; the whole width does not fit, and clamped so the page cannot be dragged
|
|
67
|
+
; off its own edge.
|
|
68
|
+
def panXValue:double 0.0
|
|
69
|
+
|
|
70
|
+
Constructor () {
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
; --- what the host tells it -----------------------------------------------
|
|
74
|
+
|
|
75
|
+
fn resize:void (w:double h:double) {
|
|
76
|
+
screenW = w
|
|
77
|
+
screenH = h
|
|
78
|
+
this.refit()
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
fn setSafeArea:void (top:double bottom:double left:double right:double) {
|
|
82
|
+
insetTop = top
|
|
83
|
+
insetBottom = bottom
|
|
84
|
+
insetLeft = left
|
|
85
|
+
insetRight = right
|
|
86
|
+
this.refit()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
; The page's own width. Mode 0 ignores it — there the page is whatever the
|
|
90
|
+
; window leaves — and modes 1 and 2 fit to it.
|
|
91
|
+
fn setPageWidth:void (w:double) {
|
|
92
|
+
pageW = w
|
|
93
|
+
this.refit()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
; The watch's floor. `minScale` of zero leaves the default alone.
|
|
97
|
+
fn useReadableFit:void (minScale:double) {
|
|
98
|
+
fitMode = 2
|
|
99
|
+
if (minScale > 0.0) {
|
|
100
|
+
readableScale = minScale
|
|
101
|
+
}
|
|
102
|
+
this.refit()
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
fn useWidthFit:void () {
|
|
106
|
+
fitMode = 1
|
|
107
|
+
this.refit()
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
; --- the window -----------------------------------------------------------
|
|
111
|
+
|
|
112
|
+
fn usableWidth:double () {
|
|
113
|
+
def w:double (screenW - insetLeft - insetRight)
|
|
114
|
+
if (w < 1.0) {
|
|
115
|
+
return 1.0
|
|
116
|
+
}
|
|
117
|
+
return w
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
fn usableHeight:double () {
|
|
121
|
+
def h:double (screenH - insetTop - insetBottom)
|
|
122
|
+
if (h < 1.0) {
|
|
123
|
+
return 1.0
|
|
124
|
+
}
|
|
125
|
+
return h
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
; --- the fit --------------------------------------------------------------
|
|
129
|
+
|
|
130
|
+
; The one piece of arithmetic this file exists for.
|
|
131
|
+
;
|
|
132
|
+
; In mode 1 the page is a fixed-width document, so the scale is a ratio of
|
|
133
|
+
; widths. In mode 2 that ratio is a FLOOR rather than an answer. In mode 0
|
|
134
|
+
; there is nothing to fit: the page will be laid out at the window's size,
|
|
135
|
+
; so the scale is one and stays one.
|
|
136
|
+
fn refit:void () {
|
|
137
|
+
if (fitMode == 0) {
|
|
138
|
+
fitScale = 1.0
|
|
139
|
+
zoomValue = 1.0
|
|
140
|
+
panXValue = 0.0
|
|
141
|
+
return
|
|
142
|
+
}
|
|
143
|
+
def usable:double (this.usableWidth())
|
|
144
|
+
if (pageW > 0.0) {
|
|
145
|
+
fitScale = (usable / pageW)
|
|
146
|
+
}
|
|
147
|
+
if (fitMode == 2) {
|
|
148
|
+
if (fitScale < readableScale) {
|
|
149
|
+
fitScale = readableScale
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
this.clampPan()
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
; What the page's HEIGHT should be at the current scale. Getting this wrong
|
|
156
|
+
; is what makes a ported page scroll to a stop halfway down the screen: an
|
|
157
|
+
; app clamps its scroll to its own page height, and a page height that is
|
|
158
|
+
; not the viewport is a clamp against a viewport nobody has.
|
|
159
|
+
fn pageHeightAt:double () {
|
|
160
|
+
def s:double (this.scale())
|
|
161
|
+
if (s <= 0.0) {
|
|
162
|
+
return (this.usableHeight())
|
|
163
|
+
}
|
|
164
|
+
return ((this.usableHeight()) / s)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
; Page pixels to screen points. A host scales its context by this and
|
|
168
|
+
; leaves the display list alone — text then rasterises at the panel's real
|
|
169
|
+
; resolution instead of being blown up from a bitmap made at some other
|
|
170
|
+
; size, which is the same trick the WebGL host plays with `dpr` and the
|
|
171
|
+
; Android port plays with `density`.
|
|
172
|
+
fn scale:double () {
|
|
173
|
+
return (fitScale * zoomValue)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
fn zoom:double () {
|
|
177
|
+
return zoomValue
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
; Where the page's top left corner sits in the window.
|
|
181
|
+
fn offsetX:double () {
|
|
182
|
+
return insetLeft
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
fn offsetY:double () {
|
|
186
|
+
return insetTop
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
fn panX:double () {
|
|
190
|
+
return panXValue
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
; How much of the page is off the left edge at the current scale. Zero when
|
|
194
|
+
; the whole width fits, which is the resting state on a phone and a tablet
|
|
195
|
+
; and never the resting state on a watch.
|
|
196
|
+
fn maxPanX:double () {
|
|
197
|
+
if (fitMode == 0) {
|
|
198
|
+
return 0.0
|
|
199
|
+
}
|
|
200
|
+
def s:double (this.scale())
|
|
201
|
+
if (s <= 0.0) {
|
|
202
|
+
return 0.0
|
|
203
|
+
}
|
|
204
|
+
def visible:double ((this.usableWidth()) / s)
|
|
205
|
+
def over:double (pageW - visible)
|
|
206
|
+
if (over < 0.0) {
|
|
207
|
+
return 0.0
|
|
208
|
+
}
|
|
209
|
+
return over
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
fn clampPan:void () {
|
|
213
|
+
def limit:double (this.maxPanX())
|
|
214
|
+
if (panXValue > limit) {
|
|
215
|
+
panXValue = limit
|
|
216
|
+
}
|
|
217
|
+
if (panXValue < 0.0) {
|
|
218
|
+
panXValue = 0.0
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
fn canPan:boolean () {
|
|
223
|
+
return ((this.maxPanX()) > 0.5)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
; --- gestures over the viewport itself -------------------------------------
|
|
227
|
+
;
|
|
228
|
+
; True means something moved and the host should paint. Mode 0 answers
|
|
229
|
+
; false to all of them, which is not a refusal to implement: a page that IS
|
|
230
|
+
; the window has nothing to zoom out of and nowhere to pan to.
|
|
231
|
+
|
|
232
|
+
; A pinch. The factor is relative — what the fingers did since the last
|
|
233
|
+
; report — and the point under them is held still, which is the whole of
|
|
234
|
+
; what a reader expects a pinch to do and the part a naive implementation
|
|
235
|
+
; gets wrong by scaling about the origin instead.
|
|
236
|
+
fn pinch:boolean (factor:double focusX:double focusY:double) {
|
|
237
|
+
if (fitMode == 0) {
|
|
238
|
+
return false
|
|
239
|
+
}
|
|
240
|
+
def before:double zoomValue
|
|
241
|
+
def next@(mutable):double (zoomValue * factor)
|
|
242
|
+
if (next < 1.0) {
|
|
243
|
+
next = 1.0
|
|
244
|
+
}
|
|
245
|
+
if (next > 4.0) {
|
|
246
|
+
next = 4.0
|
|
247
|
+
}
|
|
248
|
+
if (next == before) {
|
|
249
|
+
return false
|
|
250
|
+
}
|
|
251
|
+
def pageX:double (this.toPageX(focusX))
|
|
252
|
+
zoomValue = next
|
|
253
|
+
this.refit()
|
|
254
|
+
def s:double (this.scale())
|
|
255
|
+
panXValue = (pageX - ((focusX - insetLeft) / s))
|
|
256
|
+
this.clampPan()
|
|
257
|
+
return true
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
; Back to the whole width. What a double tap means.
|
|
261
|
+
fn resetZoom:boolean () {
|
|
262
|
+
if (fitMode == 0) {
|
|
263
|
+
return false
|
|
264
|
+
}
|
|
265
|
+
if ((zoomValue == 1.0) && (panXValue == 0.0)) {
|
|
266
|
+
return false
|
|
267
|
+
}
|
|
268
|
+
zoomValue = 1.0
|
|
269
|
+
panXValue = 0.0
|
|
270
|
+
this.refit()
|
|
271
|
+
return true
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
; Sideways, and only ever inside the page. `dx` is in SCREEN points because
|
|
275
|
+
; it comes from a finger; everything below it is page pixels.
|
|
276
|
+
fn panBy:boolean (dx:double) {
|
|
277
|
+
if (fitMode == 0) {
|
|
278
|
+
return false
|
|
279
|
+
}
|
|
280
|
+
def s:double (this.scale())
|
|
281
|
+
if (s <= 0.0) {
|
|
282
|
+
return false
|
|
283
|
+
}
|
|
284
|
+
def before:double panXValue
|
|
285
|
+
panXValue = (panXValue - (dx / s))
|
|
286
|
+
this.clampPan()
|
|
287
|
+
return (panXValue != before)
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
; --- screen to page -------------------------------------------------------
|
|
291
|
+
;
|
|
292
|
+
; A touch arrives in WINDOW coordinates, which start at the window's corner
|
|
293
|
+
; and not at the page's. The safe area is taken off first, then the scale,
|
|
294
|
+
; then the pan. A host that skipped the first of those would be wrong by the
|
|
295
|
+
; height of the status bar everywhere on the page, and by the notch on a
|
|
296
|
+
; phone held sideways.
|
|
297
|
+
|
|
298
|
+
fn toPageX:double (x:double) {
|
|
299
|
+
def s:double (this.scale())
|
|
300
|
+
if (s <= 0.0) {
|
|
301
|
+
return x
|
|
302
|
+
}
|
|
303
|
+
return (((x - insetLeft) / s) + panXValue)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
fn toPageY:double (y:double) {
|
|
307
|
+
def s:double (this.scale())
|
|
308
|
+
if (s <= 0.0) {
|
|
309
|
+
return y
|
|
310
|
+
}
|
|
311
|
+
return ((y - insetTop) / s)
|
|
312
|
+
}
|
|
313
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
; SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
; ==============================================================================
|
|
4
|
+
; FxDemo — the demo page's document, written as a stylesheet
|
|
5
|
+
; ==============================================================================
|
|
6
|
+
;
|
|
7
|
+
; This program exists to prove the half of `fx-demo.html` that a browser cannot:
|
|
8
|
+
; that the effects on that page are DECLARED, in CSS, on named elements, and
|
|
9
|
+
; that everything the painter needs comes out of the engine rather than out of
|
|
10
|
+
; the page's own JavaScript.
|
|
11
|
+
;
|
|
12
|
+
; npm run evg:fx:doc writes lib/evg/gl/fx-demo.js
|
|
13
|
+
;
|
|
14
|
+
; What it writes is one assignment — `window.EVG_FX_DEMO = {…}` — holding the
|
|
15
|
+
; display list this document lays out to, effects and all. The page paints it
|
|
16
|
+
; and drives it and adds nothing to it: no box, no parameter, no trigger.
|
|
17
|
+
; Change `SHEET` below, run the script, reload, and the sky is somewhere else.
|
|
18
|
+
;
|
|
19
|
+
; A `.js` and not a `.json` because the page has to work from `file://`, where
|
|
20
|
+
; `fetch` is refused and a script tag is not.
|
|
21
|
+
; ==============================================================================
|
|
22
|
+
|
|
23
|
+
Import "EVGElement.rgr"
|
|
24
|
+
Import "EVGStyleSheet.rgr"
|
|
25
|
+
Import "EVGLayout.rgr"
|
|
26
|
+
Import "EVGDisplayList.rgr"
|
|
27
|
+
|
|
28
|
+
class FxDemoDoc {
|
|
29
|
+
|
|
30
|
+
sfn pageWidth:double () { return 900.0 }
|
|
31
|
+
sfn pageHeight:double () { return 560.0 }
|
|
32
|
+
|
|
33
|
+
; THE WHOLE OF THE EFFECT WIRING IS IN HERE.
|
|
34
|
+
;
|
|
35
|
+
; `#sky` is a starfield that runs on its own clock. `#pool` and `#pool2`
|
|
36
|
+
; are ripples that only exist when somebody touches them — two of them, to
|
|
37
|
+
; show that the effect belongs to the box and not to the page: press one
|
|
38
|
+
; and the other is not disturbed.
|
|
39
|
+
sfn sheet:string () {
|
|
40
|
+
return (""
|
|
41
|
+
; CLASS SELECTORS, because that is what this stylesheet matches.
|
|
42
|
+
; The class says WHAT a box is; the `id` beside it says WHICH ONE,
|
|
43
|
+
; and the id is the name the effect instance goes out under — so
|
|
44
|
+
; a host drives "pool2" while the sheet styles every `.pool` at
|
|
45
|
+
; once.
|
|
46
|
+
+ ".page { background-color: rgb(8,9,20); }"
|
|
47
|
+
+ ".sky {"
|
|
48
|
+
+ " background-color: rgb(6,7,20);"
|
|
49
|
+
+ " evg-surface-effect: starfield;"
|
|
50
|
+
+ " evg-effect-on: always press;"
|
|
51
|
+
+ " evg-fx-density: 1.6;"
|
|
52
|
+
+ " evg-fx-nebula: 0.8;"
|
|
53
|
+
+ " evg-fx-speed: 7;"
|
|
54
|
+
+ " evg-fx-angle: 200;"
|
|
55
|
+
+ " evg-fx-hue: 228;"
|
|
56
|
+
+ " evg-fx-hue2: 305;"
|
|
57
|
+
+ " evg-fx-seed: 5;"
|
|
58
|
+
+ "}"
|
|
59
|
+
+ ".title { color: rgb(240,242,255); font-size: 34px; }"
|
|
60
|
+
+ ".sub { color: rgb(168,176,214); font-size: 15px; }"
|
|
61
|
+
+ ".pool {"
|
|
62
|
+
+ " background-color: rgb(22,26,52);"
|
|
63
|
+
+ " border-radius: 18px;"
|
|
64
|
+
+ " evg-surface-effect: ripple;"
|
|
65
|
+
+ " evg-effect-on: press drag;"
|
|
66
|
+
+ " evg-ripple-speed: 240;"
|
|
67
|
+
+ " evg-ripple-strength: 9;"
|
|
68
|
+
+ " evg-ripple-decay: 1.5;"
|
|
69
|
+
+ "}"
|
|
70
|
+
; A PANE OF GLASS OVER THE SKY. Four declarations and three of
|
|
71
|
+
; them are ordinary CSS: the shape, the frosting and the tint are
|
|
72
|
+
; `border-radius`, `backdrop-filter` and `background-color`, and
|
|
73
|
+
; only the refraction is the effect. It is a BACKDROP effect, so
|
|
74
|
+
; it runs where this element paints and the label inside it is
|
|
75
|
+
; drawn afterwards — sharp, over a bent sky.
|
|
76
|
+
+ ".glass {"
|
|
77
|
+
+ " background-color: rgba(255,255,255,0.07);"
|
|
78
|
+
+ " border-radius: 30px;"
|
|
79
|
+
+ " backdrop-filter: blur(9px);"
|
|
80
|
+
+ " evg-surface-effect: liquid-glass;"
|
|
81
|
+
+ " evg-fx-thickness: 26;"
|
|
82
|
+
+ " evg-fx-strength: 36;"
|
|
83
|
+
+ " evg-fx-disperse: 0.08;"
|
|
84
|
+
+ " evg-fx-shine: 0.55;"
|
|
85
|
+
; A LIGHT PASSING OVER THE PANE, kept to the rim where a real
|
|
86
|
+
; bevel would catch it, and off the pane entirely for two thirds
|
|
87
|
+
; of its cycle — a glint rather than a stripe. `always` is what
|
|
88
|
+
; keeps the frames coming for it. Every number is in this sheet;
|
|
89
|
+
; the shader has never heard of this page.
|
|
90
|
+
+ " evg-effect-on: always;"
|
|
91
|
+
+ " evg-fx-sweep: 0.7;"
|
|
92
|
+
+ " evg-fx-sweep-width: 0.05;"
|
|
93
|
+
+ " evg-fx-sweep-speed: 0.42;"
|
|
94
|
+
+ " evg-fx-sweep-duty: 0.3;"
|
|
95
|
+
+ " evg-fx-sweep-rim: 0.6;"
|
|
96
|
+
+ " evg-fx-sweep-edge: 2.6;"
|
|
97
|
+
+ "}"
|
|
98
|
+
+ ".glass-title { color: rgb(255,255,255); font-size: 19px; }"
|
|
99
|
+
+ ".glass-note { color: rgb(214,220,248); font-size: 13px; }"
|
|
100
|
+
+ ".label { color: rgb(226,230,248); font-size: 15px; }"
|
|
101
|
+
+ ".note { color: rgb(150,158,196); font-size: 13px; }"
|
|
102
|
+
+ ".plain { background-color: rgb(22,26,52); border-radius: 18px; }"
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
sfn text:EVGElement (id:string cls:string words:string x:double y:double) {
|
|
107
|
+
def el (EVGElement.createDiv())
|
|
108
|
+
el.id = id
|
|
109
|
+
el.className = cls
|
|
110
|
+
el.textContent = words
|
|
111
|
+
el.setAttribute("position" "absolute")
|
|
112
|
+
el.setAttribute("left" ((to_string x) + "px"))
|
|
113
|
+
el.setAttribute("top" ((to_string y) + "px"))
|
|
114
|
+
return el
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
sfn box:EVGElement (id:string cls:string x:double y:double w:double h:double) {
|
|
118
|
+
def el (EVGElement.createDiv())
|
|
119
|
+
el.id = id
|
|
120
|
+
el.className = cls
|
|
121
|
+
el.setAttribute("position" "absolute")
|
|
122
|
+
el.setAttribute("left" ((to_string x) + "px"))
|
|
123
|
+
el.setAttribute("top" ((to_string y) + "px"))
|
|
124
|
+
el.setAttribute("width" ((to_string w) + "px"))
|
|
125
|
+
el.setAttribute("height" ((to_string h) + "px"))
|
|
126
|
+
return el
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
sfn document:EVGElement () {
|
|
130
|
+
def root (new EVGElement())
|
|
131
|
+
root.id = "page"
|
|
132
|
+
root.className = "page"
|
|
133
|
+
root.setAttribute("width" ((to_string (FxDemoDoc.pageWidth())) + "px"))
|
|
134
|
+
root.setAttribute("height" ((to_string (FxDemoDoc.pageHeight())) + "px"))
|
|
135
|
+
|
|
136
|
+
; The sky, and its own words ON TOP of it — the reason a source effect
|
|
137
|
+
; is drawn at the element's background rather than over the element.
|
|
138
|
+
def sky:EVGElement (FxDemoDoc.box("sky" "sky" 0.0 0.0 (FxDemoDoc.pageWidth()) 320.0))
|
|
139
|
+
sky.addChild((FxDemoDoc.text("title" "title" "A sky, declared in the stylesheet" 48.0 42.0)))
|
|
140
|
+
sky.addChild((FxDemoDoc.text("sub" "sub" "evg-surface-effect: starfield, and this line is painted over it" 48.0 92.0)))
|
|
141
|
+
; The pane is a CHILD OF THE SKY, so it is painted after the stars
|
|
142
|
+
; and refracts them, and its own two lines are painted after it.
|
|
143
|
+
def glass:EVGElement (FxDemoDoc.box("glass" "glass" 520.0 48.0 320.0 210.0))
|
|
144
|
+
glass.addChild((FxDemoDoc.text("gt" "glass-title" "Liquid glass" 32.0 34.0)))
|
|
145
|
+
glass.addChild((FxDemoDoc.text("gn" "glass-note" "evg-surface-effect: liquid-glass" 32.0 70.0)))
|
|
146
|
+
glass.addChild((FxDemoDoc.text("gn2" "glass-note" "the sky bends at the rim; this line does not" 32.0 94.0)))
|
|
147
|
+
sky.addChild(glass)
|
|
148
|
+
root.addChild(sky)
|
|
149
|
+
|
|
150
|
+
; Two pools and a plain card. The pools ripple where they are pressed;
|
|
151
|
+
; the card does not, and nothing about the card had to say so.
|
|
152
|
+
def a:EVGElement (FxDemoDoc.box("pool" "pool" 48.0 368.0 250.0 150.0))
|
|
153
|
+
def b:EVGElement (FxDemoDoc.box("pool2" "pool" 325.0 368.0 250.0 150.0))
|
|
154
|
+
def c:EVGElement (FxDemoDoc.box("plain" "plain" 602.0 368.0 250.0 150.0))
|
|
155
|
+
root.addChild(a)
|
|
156
|
+
root.addChild(b)
|
|
157
|
+
root.addChild(c)
|
|
158
|
+
root.addChild((FxDemoDoc.text("t1" "label" "Press me" 72.0 400.0)))
|
|
159
|
+
root.addChild((FxDemoDoc.text("n1" "note" "evg-effect-on: press drag" 72.0 428.0)))
|
|
160
|
+
root.addChild((FxDemoDoc.text("t2" "label" "And me, separately" 349.0 400.0)))
|
|
161
|
+
root.addChild((FxDemoDoc.text("n2" "note" "one effect per box, not per page" 349.0 428.0)))
|
|
162
|
+
root.addChild((FxDemoDoc.text("t3" "label" "Not me" 626.0 400.0)))
|
|
163
|
+
root.addChild((FxDemoDoc.text("n3" "note" "no effect declared" 626.0 428.0)))
|
|
164
|
+
|
|
165
|
+
def sheet (new EVGStyleSheet())
|
|
166
|
+
sheet.parse((FxDemoDoc.sheet()))
|
|
167
|
+
sheet.setViewport((FxDemoDoc.pageWidth()) (FxDemoDoc.pageHeight()) false)
|
|
168
|
+
sheet.applyTree(root "")
|
|
169
|
+
return root
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
sfn main:void () {
|
|
173
|
+
def root:EVGElement (FxDemoDoc.document())
|
|
174
|
+
def lay (new EVGLayout())
|
|
175
|
+
lay.setPageSize((FxDemoDoc.pageWidth()) (FxDemoDoc.pageHeight()))
|
|
176
|
+
lay.layout(root)
|
|
177
|
+
def dl (new EVGDisplayList())
|
|
178
|
+
dl.setTextEngine((lay.getTextEngine()))
|
|
179
|
+
dl.build(root)
|
|
180
|
+
print ("// Written by `npm run evg:fx:doc` from lib/evg/gl/FxDemoDoc.rgr — do not edit.")
|
|
181
|
+
print ("window.EVG_FX_DEMO = { width: " + (to_string (FxDemoDoc.pageWidth()))
|
|
182
|
+
+ ", height: " + (to_string (FxDemoDoc.pageHeight()))
|
|
183
|
+
+ ", list: " + (dl.toJson()) + " };")
|
|
184
|
+
}
|
|
185
|
+
}
|