@native-sdk/cli 0.10.1 → 0.11.1
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/README.md +8 -6
- package/bin/native.js +2 -1
- package/build/app.zig +393 -97
- package/build/corewire.zig +53 -0
- package/build/test_shards.zig +49 -0
- package/build/ts_run.mjs +3 -3
- package/build.zig +2030 -83
- package/native-sdk.d.ts +5 -1
- package/package.json +20 -14
- package/packages/core/compile-surface/core.ts +164 -72
- package/packages/core/package-lock.json +75 -357
- package/packages/core/package.json +25 -4
- package/packages/core/scripts/compiler_command.mjs +17 -12
- package/packages/core/scripts/compiler_typecheck.mjs +1 -0
- package/packages/core/scripts/gen_declarations.mjs +3 -2
- package/packages/core/scripts/gen_service_surface.mjs +22 -10
- package/packages/core/scripts/install_scriptc.mjs +182 -0
- package/packages/core/scripts/invoke_scriptc.mjs +18 -0
- package/packages/core/scripts/merge_static_archives.mjs +6 -1
- package/packages/core/scripts/npm_static_spike.mjs +2 -2
- package/packages/core/scripts/run_external_core_compiler.mjs +22 -10
- package/packages/core/scripts/run_external_service_compiler.mjs +15 -15
- package/packages/core/scripts/run_library_compiler.mjs +51 -0
- package/packages/core/scripts/run_native_tests.mjs +22 -0
- package/packages/core/scripts/scriptc-toolchain.json +101 -0
- package/packages/core/scripts/scriptc_toolchain.mjs +121 -0
- package/packages/core/scripts/stage_external_core.mjs +68 -1
- package/packages/core/scripts/surface_manifest_diff.mjs +19 -12
- package/packages/core/sdk/bytes.d.ts +2 -0
- package/packages/core/sdk/bytes.ts +86 -0
- package/packages/core/sdk/core.d.ts +332 -5
- package/packages/core/sdk/core.ts +371 -85
- package/packages/core/sdk/events.d.ts +252 -0
- package/packages/core/sdk/events.ts +240 -2
- package/packages/core/sdk/internal/image_identity.d.ts +7 -0
- package/packages/core/sdk/internal/image_identity.ts +71 -0
- package/packages/core/sdk/internal/markdown_policy.d.ts +5 -0
- package/packages/core/sdk/internal/markdown_policy.ts +878 -0
- package/packages/core/sdk/text.d.ts +27 -0
- package/packages/core/sdk/text.ts +206 -15
- package/packages/core/sdk/theme.d.ts +251 -0
- package/packages/core/sdk/theme.ts +267 -0
- package/packages/core/src/authorization.ts +137 -0
- package/packages/core/src/automation_commands.ts +201 -0
- package/packages/core/src/automation_interactions.ts +92 -0
- package/packages/core/src/bridge_descriptors.ts +104 -0
- package/packages/core/src/builtin_coordination.ts +172 -0
- package/packages/core/src/canvas_frame_coordination.ts +81 -0
- package/packages/core/src/canvas_presentation_lifecycle.ts +84 -0
- package/packages/core/src/canvas_scene_observation.ts +145 -0
- package/packages/core/src/chart_content.ts +161 -0
- package/packages/core/src/chart_plans.ts +432 -0
- package/packages/core/src/checker.ts +186 -19
- package/packages/core/src/cli.ts +2 -11
- package/packages/core/src/code_content.ts +580 -0
- package/packages/core/src/command_coordination.ts +140 -0
- package/packages/core/src/component_composition.ts +94 -0
- package/packages/core/src/component_construction.ts +149 -0
- package/packages/core/src/context_menus.ts +76 -0
- package/packages/core/src/contract.ts +25 -7
- package/packages/core/src/control_appearance.ts +232 -0
- package/packages/core/src/control_commands.ts +115 -0
- package/packages/core/src/control_content.ts +105 -0
- package/packages/core/src/control_geometry.ts +107 -0
- package/packages/core/src/control_payloads.ts +119 -0
- package/packages/core/src/control_primitives.ts +134 -0
- package/packages/core/src/devhost.ts +82 -7
- package/packages/core/src/devhost_journal.mjs +30 -7
- package/packages/core/src/diagnostics.ts +7 -0
- package/packages/core/src/effect_plans.ts +71 -0
- package/packages/core/src/extent_program.ts +53 -0
- package/packages/core/src/flow_measurement.ts +121 -0
- package/packages/core/src/font_registry.ts +37 -0
- package/packages/core/src/frontend.ts +12 -10
- package/packages/core/src/glyph_atlas.ts +86 -0
- package/packages/core/src/gpu_packet_preparation.ts +130 -0
- package/packages/core/src/gpu_planning.ts +123 -0
- package/packages/core/src/gpu_presentation.ts +55 -0
- package/packages/core/src/host_flow.ts +89 -0
- package/packages/core/src/host_input_regions.ts +165 -0
- package/packages/core/src/image_registry.ts +66 -0
- package/packages/core/src/indicator_plans.ts +132 -0
- package/packages/core/src/infer.ts +150 -8
- package/packages/core/src/input_composition.ts +116 -0
- package/packages/core/src/intrinsic_measure.ts +100 -0
- package/packages/core/src/layout_coordination.ts +207 -0
- package/packages/core/src/leaf_plans.ts +134 -0
- package/packages/core/src/markup_canonical.ts +140 -0
- package/packages/core/src/markup_construction.ts +189 -0
- package/packages/core/src/markup_development.ts +160 -0
- package/packages/core/src/markup_display.ts +43 -0
- package/packages/core/src/markup_document.ts +226 -0
- package/packages/core/src/markup_elements.ts +225 -0
- package/packages/core/src/markup_expressions.ts +79 -0
- package/packages/core/src/markup_imports.ts +146 -0
- package/packages/core/src/markup_parser.ts +228 -0
- package/packages/core/src/markup_runtime.ts +93 -0
- package/packages/core/src/markup_scalars.ts +143 -0
- package/packages/core/src/markup_shapes.ts +243 -0
- package/packages/core/src/markup_specialized.ts +242 -0
- package/packages/core/src/markup_text.ts +86 -0
- package/packages/core/src/markup_values.ts +336 -0
- package/packages/core/src/measurement_coordination.ts +185 -0
- package/packages/core/src/modules.ts +1 -1
- package/packages/core/src/motion_sampling.ts +100 -0
- package/packages/core/src/paragraph_layout.ts +192 -0
- package/packages/core/src/portable_sources.json +98 -0
- package/packages/core/src/portable_sources.ts +17 -0
- package/packages/core/src/registered_font.ts +92 -0
- package/packages/core/src/render_animation_lifecycle.ts +128 -0
- package/packages/core/src/render_coordination.ts +170 -0
- package/packages/core/src/render_resources.ts +234 -0
- package/packages/core/src/runtime_policy.ts +3954 -0
- package/packages/core/src/scalar_text.ts +82 -0
- package/packages/core/src/scroll_mutation.ts +86 -0
- package/packages/core/src/scroll_tree.ts +86 -0
- package/packages/core/src/service_contract.ts +55 -3
- package/packages/core/src/session_codecs.ts +309 -0
- package/packages/core/src/shell_admission.ts +126 -0
- package/packages/core/src/shell_coordination.ts +93 -0
- package/packages/core/src/sqlite_cli.ts +14 -46
- package/packages/core/src/sqlite_codegen.ts +84 -0
- package/packages/core/src/staged_rebuild.ts +60 -0
- package/packages/core/src/status_validation.ts +232 -0
- package/packages/core/src/stream_policy.ts +63 -0
- package/packages/core/src/surface_recipes.ts +136 -0
- package/packages/core/src/system_admission.ts +60 -0
- package/packages/core/src/terminal_paint.ts +436 -0
- package/packages/core/src/text_document_width.ts +81 -0
- package/packages/core/src/text_measurement_cache.ts +69 -0
- package/packages/core/src/text_query_layout.ts +179 -0
- package/packages/core/src/text_run_layout.ts +410 -0
- package/packages/core/src/text_span_queries.ts +355 -0
- package/packages/core/src/typed_ast.ts +18 -1
- package/packages/core/src/types.ts +7 -5
- package/packages/core/src/vector_effects.ts +98 -0
- package/packages/core/src/vector_raster.ts +243 -0
- package/packages/core/src/view_bridge.ts +161 -0
- package/packages/core/src/view_check.ts +145 -0
- package/packages/core/src/view_components.ts +2415 -0
- package/packages/core/src/view_coordination.ts +198 -0
- package/packages/core/src/view_evaluator.ts +823 -0
- package/packages/core/src/view_frontend.ts +1102 -0
- package/packages/core/src/view_program.ts +221 -0
- package/packages/core/src/view_reload.ts +166 -0
- package/packages/core/src/view_reload_watch.ts +98 -0
- package/packages/core/src/view_sources.ts +34 -0
- package/packages/core/src/virtual_windows.ts +88 -0
- package/packages/core/src/web_panes.ts +67 -0
- package/packages/core/src/widget_audits.ts +202 -0
- package/packages/core/src/widget_changes.ts +258 -0
- package/packages/core/src/widget_continuity.ts +37 -0
- package/packages/core/src/widget_metrics.ts +139 -0
- package/packages/core/src/widget_motion.ts +171 -0
- package/packages/core/src/widget_paint.ts +272 -0
- package/packages/core/src/widget_paint_walk.ts +203 -0
- package/packages/core/src/widget_presentation.ts +141 -0
- package/packages/core/src/widget_reconcile.ts +63 -0
- package/packages/core/src/widget_retention.ts +62 -0
- package/packages/core/src/widget_routing.ts +262 -0
- package/packages/core/src/window_lifecycle.ts +92 -0
- package/packages/core/testing/index.ts +430 -0
- package/schemas/app.schema.json +13 -0
- package/skill-data/core/SKILL.md +2 -2
- package/skill-data/native-ui/SKILL.md +77 -18
- package/skill-data/ts-core/SKILL.md +117 -11
- package/skill-data/ts-services/SKILL.md +1 -1
- package/skill-data/ts-services/references/service-surface.md +288 -144
- package/src/app_runner/root.zig +39 -12
- package/src/app_runner/ts_compiled_view.zig +1702 -0
- package/src/app_runner/ts_core_main.zig +185 -14
- package/src/app_runner/ts_core_mobile.zig +25 -13
- package/src/automation/server.zig +57 -6
- package/src/automation/snapshot.zig +9 -637
- package/src/automation/snapshot_reference.zig +656 -0
- package/src/automation/snapshot_serialization.zig +566 -0
- package/src/embed/host.zig +2 -0
- package/src/embed/tests.zig +2 -0
- package/src/embed/ui_host.zig +2 -0
- package/src/platform/keyboard_input.zig +32 -0
- package/src/platform/linux/gtk_host.c +36 -24
- package/src/platform/linux/gtk_pixels.h +118 -0
- package/src/platform/linux/gtk_pixels_test.c +241 -0
- package/src/platform/linux/root.zig +4 -0
- package/src/platform/macos/appkit_host.h +7 -2
- package/src/platform/macos/appkit_host.m +219 -39
- package/src/platform/macos/cef_host.mm +15 -1
- package/src/platform/macos/global_shortcuts.zig +138 -0
- package/src/platform/macos/key_codes.zig +102 -0
- package/src/platform/macos/keyboard_input.zig +81 -0
- package/src/platform/macos/pointer_motion_test.m +96 -0
- package/src/platform/macos/root.zig +25 -3
- package/src/platform/macos/scroll_driver_test.m +105 -0
- package/src/platform/macos/spectrum_bins.h +34 -0
- package/src/platform/macos/spectrum_bins_test.c +56 -0
- package/src/platform/macos/text_keyboard_test.m +80 -0
- package/src/platform/macos/webview_inspection_test.m +106 -0
- package/src/platform/macos/widget_focus_test.m +66 -0
- package/src/platform/null_platform.zig +130 -2
- package/src/platform/null_platform_tests.zig +13 -0
- package/src/platform/root.zig +15 -0
- package/src/platform/types.zig +115 -0
- package/src/platform/windows/global_shortcuts.zig +157 -0
- package/src/platform/windows/key_codes.zig +63 -0
- package/src/platform/windows/keyboard_input.zig +136 -0
- package/src/platform/windows/root.zig +17 -0
- package/src/platform/windows/webview2_host.cpp +7 -2
- package/src/primitives/app_manifest/comptime_scene.zig +1 -1
- package/src/primitives/app_manifest/root.zig +2 -0
- package/src/primitives/app_manifest/tests.zig +4 -1
- package/src/primitives/app_manifest/validation.zig +2 -0
- package/src/primitives/canvas/a11y_audit.zig +3 -1
- package/src/primitives/canvas/canvas_frame_coordination_policy.zig +134 -0
- package/src/primitives/canvas/chart_content_policy.zig +75 -0
- package/src/primitives/canvas/chart_plan_policy.zig +196 -0
- package/src/primitives/canvas/code_content_policy.zig +162 -0
- package/src/primitives/canvas/commands.zig +29 -1
- package/src/primitives/canvas/component_composition.zig +125 -0
- package/src/primitives/canvas/component_composition_policy.zig +44 -0
- package/src/primitives/canvas/component_construction_policy.zig +187 -0
- package/src/primitives/canvas/container_layout_policy.zig +87 -0
- package/src/primitives/canvas/control_appearance_policy.zig +142 -0
- package/src/primitives/canvas/control_command_policy.zig +75 -0
- package/src/primitives/canvas/control_content_policy.zig +90 -0
- package/src/primitives/canvas/control_geometry_policy.zig +165 -0
- package/src/primitives/canvas/control_payload_policy.zig +48 -0
- package/src/primitives/canvas/control_primitive_policy.zig +129 -0
- package/src/primitives/canvas/decision_reuse.zig +133 -0
- package/src/primitives/canvas/effect_plan_policy.zig +96 -0
- package/src/primitives/canvas/events.zig +1027 -1
- package/src/primitives/canvas/flow_measurement_policy.zig +237 -0
- package/src/primitives/canvas/font_ttf.zig +27 -3
- package/src/primitives/canvas/fonts/Geist-Bold.ttf +0 -0
- package/src/primitives/canvas/fonts/Geist-Medium.ttf +0 -0
- package/src/primitives/canvas/fonts/OFL.txt +93 -0
- package/src/primitives/canvas/fonts/README.md +15 -0
- package/src/primitives/canvas/frame.zig +92 -23
- package/src/primitives/canvas/glyph_atlas_policy.zig +40 -0
- package/src/primitives/canvas/gpu.zig +10 -0
- package/src/primitives/canvas/gpu_packet_preparation_policy.zig +325 -0
- package/src/primitives/canvas/gpu_planning_policy.zig +364 -0
- package/src/primitives/canvas/gpu_presentation_policy.zig +74 -0
- package/src/primitives/canvas/grid_layout_policy.zig +51 -0
- package/src/primitives/canvas/indicator_plan_policy.zig +128 -0
- package/src/primitives/canvas/intrinsic_layout_policy.zig +87 -0
- package/src/primitives/canvas/intrinsic_measure_policy.zig +131 -0
- package/src/primitives/canvas/layout_audit.zig +5 -2
- package/src/primitives/canvas/layout_coordination_policy.zig +262 -0
- package/src/primitives/canvas/leaf_plan_policy.zig +117 -0
- package/src/primitives/canvas/markdown.zig +13 -3
- package/src/primitives/canvas/markdown_content_policy.zig +227 -0
- package/src/primitives/canvas/markdown_image_binding.zig +81 -0
- package/src/primitives/canvas/markdown_tests.zig +3 -3
- package/src/primitives/canvas/measurement_coordination_policy.zig +288 -0
- package/src/primitives/canvas/numeric_capabilities.zig +14 -0
- package/src/primitives/canvas/reference.zig +15 -11
- package/src/primitives/canvas/reference_tests.zig +58 -0
- package/src/primitives/canvas/registered_font_policy.zig +152 -0
- package/src/primitives/canvas/render.zig +48 -0
- package/src/primitives/canvas/render_cache_policy.zig +184 -0
- package/src/primitives/canvas/render_coordination_policy.zig +163 -0
- package/src/primitives/canvas/render_damage_policy.zig +160 -0
- package/src/primitives/canvas/render_effects.zig +14 -0
- package/src/primitives/canvas/render_generic_resources.zig +14 -0
- package/src/primitives/canvas/render_images.zig +14 -0
- package/src/primitives/canvas/render_layers.zig +14 -0
- package/src/primitives/canvas/render_override_policy.zig +119 -0
- package/src/primitives/canvas/render_paths.zig +14 -0
- package/src/primitives/canvas/render_plan_policy.zig +199 -0
- package/src/primitives/canvas/render_resource_policy.zig +476 -0
- package/src/primitives/canvas/root.zig +107 -4
- package/src/primitives/canvas/semantic_tree_policy.zig +158 -0
- package/src/primitives/canvas/serialization.zig +8 -1
- package/src/primitives/canvas/surface_layout_policy.zig +36 -0
- package/src/primitives/canvas/surface_recipe_policy.zig +231 -0
- package/src/primitives/canvas/terminal_grid.zig +10 -696
- package/src/primitives/canvas/terminal_grid_reference.zig +709 -0
- package/src/primitives/canvas/terminal_paint_policy.zig +191 -0
- package/src/primitives/canvas/text.zig +1 -0
- package/src/primitives/canvas/text_atlas.zig +113 -0
- package/src/primitives/canvas/text_cache_policy.zig +94 -0
- package/src/primitives/canvas/text_document_policy.zig +120 -0
- package/src/primitives/canvas/text_layout.zig +51 -2
- package/src/primitives/canvas/text_layout_cache.zig +29 -0
- package/src/primitives/canvas/text_layout_hash.zig +1 -0
- package/src/primitives/canvas/text_layout_types.zig +3 -0
- package/src/primitives/canvas/text_measure_cache.zig +46 -0
- package/src/primitives/canvas/text_measurement_policy.zig +124 -0
- package/src/primitives/canvas/text_metrics.zig +53 -37
- package/src/primitives/canvas/text_metrics_tests.zig +52 -7
- package/src/primitives/canvas/text_query_policy.zig +295 -0
- package/src/primitives/canvas/text_run_policy.zig +252 -0
- package/src/primitives/canvas/text_scalar_policy.zig +234 -0
- package/src/primitives/canvas/text_span_query_policy.zig +232 -0
- package/src/primitives/canvas/text_spans.zig +280 -8
- package/src/primitives/canvas/text_tests.zig +10 -0
- package/src/primitives/canvas/tokens.zig +47 -0
- package/src/primitives/canvas/ui.zig +251 -83
- package/src/primitives/canvas/ui_markup.zig +207 -46
- package/src/primitives/canvas/ui_markup_canonical.zig +237 -0
- package/src/primitives/canvas/ui_markup_compiled.zig +1724 -80
- package/src/primitives/canvas/ui_markup_compiled_tests.zig +225 -0
- package/src/primitives/canvas/ui_markup_compiled_values.zig +76 -0
- package/src/primitives/canvas/ui_markup_construction.zig +146 -0
- package/src/primitives/canvas/ui_markup_contract.zig +146 -14
- package/src/primitives/canvas/ui_markup_contract_tests.zig +77 -0
- package/src/primitives/canvas/ui_markup_display.zig +82 -0
- package/src/primitives/canvas/ui_markup_document.zig +196 -0
- package/src/primitives/canvas/ui_markup_elements.zig +163 -0
- package/src/primitives/canvas/ui_markup_expr.zig +192 -2
- package/src/primitives/canvas/ui_markup_imports.zig +262 -0
- package/src/primitives/canvas/ui_markup_parser.zig +117 -0
- package/src/primitives/canvas/ui_markup_reflect.zig +56 -0
- package/src/primitives/canvas/ui_markup_runtime.zig +76 -0
- package/src/primitives/canvas/ui_markup_scalars.zig +115 -0
- package/src/primitives/canvas/ui_markup_shapes.zig +224 -0
- package/src/primitives/canvas/ui_markup_specialized.zig +106 -0
- package/src/primitives/canvas/ui_markup_tests.zig +116 -0
- package/src/primitives/canvas/ui_markup_text.zig +128 -0
- package/src/primitives/canvas/ui_markup_values.zig +368 -0
- package/src/primitives/canvas/ui_markup_view.zig +3026 -57
- package/src/primitives/canvas/ui_markup_view_tests.zig +142 -10
- package/src/primitives/canvas/ui_schema.zig +13 -1
- package/src/primitives/canvas/ui_schema_tests.zig +11 -7
- package/src/primitives/canvas/ui_tests.zig +1 -0
- package/src/primitives/canvas/vector.zig +36 -2
- package/src/primitives/canvas/vector_effect_policy.zig +236 -0
- package/src/primitives/canvas/vector_raster_policy.zig +190 -0
- package/src/primitives/canvas/virtual_extent_policy.zig +350 -0
- package/src/primitives/canvas/virtual_extents.zig +113 -3
- package/src/primitives/canvas/virtual_flow_policy.zig +108 -0
- package/src/primitives/canvas/widget_audit_policy.zig +293 -0
- package/src/primitives/canvas/widget_change_policy.zig +298 -0
- package/src/primitives/canvas/widget_invalidation.zig +113 -2
- package/src/primitives/canvas/widget_layout.zig +673 -128
- package/src/primitives/canvas/widget_layout_tests.zig +4 -0
- package/src/primitives/canvas/widget_metric_policy.zig +129 -0
- package/src/primitives/canvas/widget_metrics.zig +45 -6
- package/src/primitives/canvas/widget_paint_policy.zig +166 -0
- package/src/primitives/canvas/widget_paint_walk_policy.zig +252 -0
- package/src/primitives/canvas/widget_presentation_policy.zig +168 -0
- package/src/primitives/canvas/widget_render.zig +744 -74
- package/src/primitives/canvas/widget_render_controls.zig +1217 -133
- package/src/primitives/canvas/widget_render_scroll.zig +11 -3
- package/src/primitives/canvas/widget_render_style.zig +94 -0
- package/src/primitives/canvas/widget_render_surfaces.zig +61 -50
- package/src/primitives/canvas/widget_routing.zig +75 -0
- package/src/primitives/canvas/widget_routing_policy.zig +135 -0
- package/src/primitives/canvas/widget_runtime.zig +21 -1
- package/src/primitives/canvas/widget_semantics.zig +25 -0
- package/src/primitives/canvas/widget_text_input.zig +86 -23
- package/src/primitives/canvas/widget_text_select.zig +1 -0
- package/src/primitives/canvas/widget_tree.zig +8 -1
- package/src/primitives/canvas/widgets.zig +42 -12
- package/src/primitives/canvas/wrapped_layout_policy.zig +104 -0
- package/src/root.zig +26 -0
- package/src/runtime/accessibility_policy.zig +122 -0
- package/src/runtime/api.zig +29 -0
- package/src/runtime/app_dispatch_policy.zig +68 -0
- package/src/runtime/authorization_policy.zig +150 -0
- package/src/runtime/automation_command_policy.zig +241 -0
- package/src/runtime/automation_interaction_policy.zig +107 -0
- package/src/runtime/automation_snapshot.zig +52 -22
- package/src/runtime/automation_snapshot_reference.zig +290 -0
- package/src/runtime/automation_widget_dispatch.zig +267 -355
- package/src/runtime/automation_widget_dispatch_reference.zig +900 -0
- package/src/runtime/blob_policy.zig +58 -0
- package/src/runtime/blob_reference.zig +64 -0
- package/src/runtime/bridge_descriptor_policy.zig +206 -0
- package/src/runtime/bridge_payload.zig +2 -0
- package/src/runtime/builtin_bridge.zig +180 -44
- package/src/runtime/builtin_coordination_policy.zig +121 -0
- package/src/runtime/callback_policy_test_reference.zig +97 -0
- package/src/runtime/canvas_drag_policy.zig +94 -0
- package/src/runtime/canvas_fonts.zig +38 -10
- package/src/runtime/canvas_frame.zig +590 -134
- package/src/runtime/canvas_frame_helpers.zig +1 -0
- package/src/runtime/canvas_hover_policy.zig +131 -0
- package/src/runtime/canvas_images.zig +59 -30
- package/src/runtime/canvas_keyboard_focus_policy.zig +154 -0
- package/src/runtime/canvas_limits.zig +1 -1
- package/src/runtime/canvas_presentation_lifecycle_policy.zig +86 -0
- package/src/runtime/canvas_scene_observation_policy.zig +181 -0
- package/src/runtime/canvas_widget_context_menu.zig +183 -4
- package/src/runtime/canvas_widget_context_menu_test_cases.zig +1147 -0
- package/src/runtime/canvas_widget_context_menu_tests.zig +23 -1098
- package/src/runtime/canvas_widget_display.zig +110 -9
- package/src/runtime/canvas_widget_events.zig +718 -328
- package/src/runtime/canvas_widget_runtime.zig +720 -150
- package/src/runtime/canvas_widget_scroll_drivers.zig +39 -1
- package/src/runtime/canvas_widget_scroll_tests.zig +31 -0
- package/src/runtime/canvas_widget_state.zig +93 -56
- package/src/runtime/channel_sources.zig +80 -0
- package/src/runtime/command_policy.zig +161 -0
- package/src/runtime/component_policy.zig +83 -0
- package/src/runtime/context_menu_policy.zig +112 -0
- package/src/runtime/core.zig +170 -6
- package/src/runtime/desktop_files.zig +189 -0
- package/src/runtime/effects.zig +638 -33
- package/src/runtime/effects_host_tests.zig +25 -0
- package/src/runtime/effects_tests.zig +28 -0
- package/src/runtime/file_policy_test_reference.zig +113 -0
- package/src/runtime/flow.zig +419 -341
- package/src/runtime/flow_reference.zig +1427 -0
- package/src/runtime/font_registry_policy.zig +72 -0
- package/src/runtime/frame_profile.zig +24 -33
- package/src/runtime/global_shortcuts.zig +75 -0
- package/src/runtime/gpu_surface_events.zig +97 -35
- package/src/runtime/host_event_pump.zig +303 -0
- package/src/runtime/host_event_pump_reference.zig +268 -0
- package/src/runtime/host_flow_policy.zig +155 -0
- package/src/runtime/host_input_regions_policy.zig +156 -0
- package/src/runtime/image_registry_policy.zig +94 -0
- package/src/runtime/input_composition_policy.zig +138 -0
- package/src/runtime/journal_policy.zig +66 -0
- package/src/runtime/journal_reference.zig +53 -0
- package/src/runtime/keyboard_input.zig +86 -0
- package/src/runtime/lifecycle_policy_test_reference.zig +97 -0
- package/src/runtime/markup_development_policy.zig +91 -0
- package/src/runtime/media_surface.zig +40 -1
- package/src/runtime/motion_sampling_policy.zig +159 -0
- package/src/runtime/recording_policy.zig +42 -0
- package/src/runtime/render_animation_policy.zig +206 -0
- package/src/runtime/replay_policy.zig +66 -0
- package/src/runtime/replay_policy_reference.zig +326 -0
- package/src/runtime/replay_progress_policy.zig +64 -0
- package/src/runtime/replay_progress_reference.zig +34 -0
- package/src/runtime/request_policy_test_reference.zig +188 -0
- package/src/runtime/root.zig +16 -0
- package/src/runtime/scroll_mutation_policy.zig +130 -0
- package/src/runtime/scroll_mutation_runtime.zig +158 -0
- package/src/runtime/scroll_tree_policy.zig +99 -0
- package/src/runtime/session_blobs.zig +157 -58
- package/src/runtime/session_blobs_reference.zig +692 -0
- package/src/runtime/session_codec.zig +361 -0
- package/src/runtime/session_codec_reference.zig +1027 -0
- package/src/runtime/session_journal.zig +246 -983
- package/src/runtime/session_record.zig +231 -45
- package/src/runtime/session_replay.zig +157 -415
- package/src/runtime/session_tests.zig +552 -0
- package/src/runtime/shell_admission_policy.zig +225 -0
- package/src/runtime/shell_coordination_policy.zig +138 -0
- package/src/runtime/shell_layout.zig +126 -1
- package/src/runtime/snapshot_policy.zig +60 -0
- package/src/runtime/snapshot_reference.zig +64 -0
- package/src/runtime/staged_rebuild_policy.zig +83 -0
- package/src/runtime/state.zig +16 -0
- package/src/runtime/status_validation.zig +190 -0
- package/src/runtime/system_admission_policy.zig +140 -0
- package/src/runtime/system_services.zig +65 -36
- package/src/runtime/tests.zig +2 -0
- package/src/runtime/ts_canvas_hooks.zig +261 -0
- package/src/runtime/ts_canvas_hooks_tests.zig +279 -0
- package/src/runtime/ts_canvas_icons.zig +234 -0
- package/src/runtime/ts_core_host.zig +2451 -411
- package/src/runtime/ts_core_host_tests.zig +1982 -0
- package/src/runtime/ts_test_host.zig +699 -0
- package/src/runtime/ts_ui_app.zig +1111 -45
- package/src/runtime/ui_app.zig +1381 -650
- package/src/runtime/ui_app_provenance.zig +147 -5
- package/src/runtime/ui_app_provenance_reference.zig +370 -0
- package/src/runtime/ui_app_tests.zig +667 -188
- package/src/runtime/ui_app_window_tests.zig +222 -0
- package/src/runtime/view.zig +25 -0
- package/src/runtime/view_canvas.zig +30 -6
- package/src/runtime/view_coordination_policy.zig +147 -0
- package/src/runtime/view_reload.zig +226 -0
- package/src/runtime/view_widget_control.zig +51 -14
- package/src/runtime/view_widget_scroll.zig +46 -26
- package/src/runtime/view_widget_text.zig +153 -68
- package/src/runtime/view_widget_tree.zig +503 -69
- package/src/runtime/virtual_window_policy.zig +128 -0
- package/src/runtime/web_pane_policy.zig +111 -0
- package/src/runtime/web_pane_test_cases.zig +204 -0
- package/src/runtime/webview_view_bridge_tests.zig +2 -0
- package/src/runtime/widget_continuity_policy.zig +73 -0
- package/src/runtime/widget_motion_policy.zig +238 -0
- package/src/runtime/widget_reconcile_policy.zig +81 -0
- package/src/runtime/widget_retention_policy.zig +75 -0
- package/src/runtime/window_command_bridge_tests.zig +63 -0
- package/src/runtime/window_lifecycle_policy.zig +127 -0
- package/src/runtime/window_storage.zig +74 -8
- package/src/runtime/window_view_runtime.zig +148 -33
- package/src/runtime/window_views.zig +179 -11
- package/src/security/root.zig +1 -0
- package/src/tooling/components/identity_tests.zig +62 -36
- package/src/tooling/components/stepper.native +24 -0
- package/src/tooling/components/stepper.zig +0 -19
- package/src/tooling/components/timeline-item.native +22 -0
- package/src/tooling/components/timeline.native +5 -3
- package/src/tooling/components/timeline_item.zig +0 -32
- package/src/tooling/eject_components.zig +76 -8
- package/src/tooling/ios.zig +66 -12
- package/src/tooling/manifest.zig +35 -0
- package/src/tooling/raw_manifest.zig +6 -0
- package/src/tooling/templates.zig +23 -3
- package/src/tooling/ts_core.zig +97 -4
- package/src/tooling/verbs.zig +87 -1
- package/tools/corewire/build_profile.mjs +54 -0
- package/tools/corewire/contract_intake.ts +303 -0
- package/tools/corewire/contract_intake.zig +82 -0
- package/tools/corewire/core.test.ts +188 -0
- package/tools/corewire/core_abi.zig +55 -0
- package/tools/corewire/core_cases.ts +233 -0
- package/tools/corewire/core_contract.ts +407 -0
- package/tools/corewire/core_emission.ts +136 -0
- package/tools/corewire/core_emission.zig +69 -0
- package/tools/corewire/core_goldens.json +3110 -0
- package/tools/corewire/core_policy.ts +14 -0
- package/tools/corewire/core_policy.zig +48 -0
- package/tools/corewire/core_projection.ts +361 -0
- package/tools/corewire/core_vocabulary.ts +6 -0
- package/tools/corewire/emit.zig +19 -1590
- package/tools/corewire/emit_facade.ts +714 -0
- package/tools/corewire/emit_facade.zig +10 -3752
- package/tools/corewire/emit_mirror.ts +300 -0
- package/tools/corewire/emit_profile.ts +50 -0
- package/tools/corewire/emit_service.ts +331 -0
- package/tools/corewire/emit_service.zig +23 -842
- package/tools/corewire/entry.test.ts +95 -0
- package/tools/corewire/entry_coordination.ts +127 -0
- package/tools/corewire/entry_coordination.zig +190 -0
- package/tools/corewire/facade_templates.ts +85 -0
- package/tools/corewire/filesystem.test.ts +166 -0
- package/tools/corewire/filesystem_coordination.ts +213 -0
- package/tools/corewire/filesystem_coordination.zig +245 -0
- package/tools/corewire/intake.test.ts +39 -0
- package/tools/corewire/intake_cases.ts +55 -0
- package/tools/corewire/intake_goldens.json +12237 -0
- package/tools/corewire/invocation.test.ts +28 -0
- package/tools/corewire/invocation.ts +175 -0
- package/tools/corewire/invocation.zig +136 -0
- package/tools/corewire/invocation_cases.ts +60 -0
- package/tools/corewire/invocation_fixture.ts +33 -0
- package/tools/corewire/invocation_goldens.json +1143 -0
- package/tools/corewire/invocation_tests.zig +111 -0
- package/tools/corewire/invocation_usage.ts +2 -0
- package/tools/corewire/lossless_projection.ts +96 -0
- package/tools/corewire/main.zig +7 -680
- package/tools/corewire/main_reference.zig +415 -0
- package/tools/corewire/mirror_templates.ts +59 -0
- package/tools/corewire/profile.test.ts +248 -0
- package/tools/corewire/profile.zig +56 -0
- package/tools/corewire/profile_emission.ts +204 -0
- package/tools/corewire/profile_library.json +29 -0
- package/tools/corewire/profile_tests.zig +136 -0
- package/tools/corewire/service.test.ts +75 -0
- package/tools/corewire/service_cases.ts +61 -0
- package/tools/corewire/service_contract.zig +40 -146
- package/tools/corewire/service_goldens.json +650 -0
- package/tools/corewire/service_projection.zig +52 -0
- package/tools/corewire/service_templates.ts +14 -0
- package/tools/corewire/shim_rt.zig +9 -0
- package/tools/corewire/sidecar.zig +269 -1438
- package/tools/corewire/emit_profile.zig +0 -521
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
//! Copied grid and scrolling continuations; native executes measurement queries.
|
|
2
|
+
const std = @import("std");
|
|
3
|
+
const builtin = @import("builtin");
|
|
4
|
+
const geometry = @import("geometry");
|
|
5
|
+
const widgets = @import("widgets.zig");
|
|
6
|
+
const surface = @import("surface_layout_policy.zig");
|
|
7
|
+
const virtual = @import("virtual_flow_policy.zig");
|
|
8
|
+
pub const Policy = surface.Policy;
|
|
9
|
+
|
|
10
|
+
fn word(bytes: []u8, at: usize, value: u32) void {
|
|
11
|
+
std.mem.writeInt(u32, bytes[at..][0..4], value, .little);
|
|
12
|
+
}
|
|
13
|
+
fn read(bytes: []const u8, at: usize) u32 {
|
|
14
|
+
return std.mem.readInt(u32, bytes[at..][0..4], .little);
|
|
15
|
+
}
|
|
16
|
+
fn put(bytes: []u8, at: usize, value: f32) void {
|
|
17
|
+
word(bytes, at, @bitCast(value));
|
|
18
|
+
}
|
|
19
|
+
fn float(bytes: []const u8, at: usize) f32 {
|
|
20
|
+
return @bitCast(read(bytes, at));
|
|
21
|
+
}
|
|
22
|
+
fn length(base: usize, count: usize, stride: usize) !usize {
|
|
23
|
+
return std.math.add(usize, base, try std.math.mul(usize, count, stride));
|
|
24
|
+
}
|
|
25
|
+
fn absent(bytes: []const u8, first: usize, end: usize) void {
|
|
26
|
+
if (!std.mem.allEqual(u8, bytes[first..end], 0)) @panic("invalid absent flow measurement fields");
|
|
27
|
+
}
|
|
28
|
+
fn rect(bytes: []const u8, at: usize) geometry.RectF {
|
|
29
|
+
return .init(float(bytes, at), float(bytes, at + 4), float(bytes, at + 8), float(bytes, at + 12));
|
|
30
|
+
}
|
|
31
|
+
pub const GridResult = struct {
|
|
32
|
+
bytes: [32]u8,
|
|
33
|
+
pub fn pending(self: GridResult) bool {
|
|
34
|
+
return read(&self.bytes, 4) == 1;
|
|
35
|
+
}
|
|
36
|
+
pub fn index(self: GridResult) usize {
|
|
37
|
+
return read(&self.bytes, 8);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
pub const GridPlan = struct {
|
|
41
|
+
allocator: std.mem.Allocator,
|
|
42
|
+
policy: Policy,
|
|
43
|
+
request: []u8,
|
|
44
|
+
result: []u8,
|
|
45
|
+
count: usize,
|
|
46
|
+
pub fn init(allocator: std.mem.Allocator, policy: Policy, count: usize, flows: usize, content: geometry.RectF, columns: usize, overscan: usize, gap: f32, item_extent: f32, scroll: f32, windowed: bool) !GridPlan {
|
|
47
|
+
const request = try allocator.alloc(u8, try length(128, count, 64));
|
|
48
|
+
errdefer allocator.free(request);
|
|
49
|
+
const result = try allocator.alloc(u8, try length(32, count, 32));
|
|
50
|
+
@memset(request, 0);
|
|
51
|
+
request[0..4].* = .{ 38, 1, @import("render_plan_policy.zig").numericFlags(), @intFromBool(windowed) };
|
|
52
|
+
word(request, 4, std.math.cast(u32, count) orelse @panic("grid measurement count exceeds wire range"));
|
|
53
|
+
const packet = request[16..92];
|
|
54
|
+
packet[0..4].* = .{ 4, 0, @as(u8, @intFromBool(windowed)) | (surface.anchorFlags(0, false) >> 2) | @as(u8, if (builtin.mode == .Debug or builtin.mode == .ReleaseSafe) 4 else 0), 0 };
|
|
55
|
+
for ([_]usize{ flows, columns, overscan }, 0..) |value, i| std.mem.writeInt(u64, packet[4 + i * 8 ..][0..8], value, .little);
|
|
56
|
+
const values = [_]f32{ content.x, content.y, content.width, content.height, gap, item_extent, 0, scroll, @floatFromInt(flows), @floatFromInt(columns), @floatFromInt(flows -| 1), @floatFromInt(columns -| 1) };
|
|
57
|
+
for (values, 0..) |value, i| put(packet, 28 + i * 4, value);
|
|
58
|
+
return .{ .allocator = allocator, .policy = policy, .request = request, .result = result, .count = count };
|
|
59
|
+
}
|
|
60
|
+
pub fn deinit(self: GridPlan) void {
|
|
61
|
+
self.allocator.free(self.request);
|
|
62
|
+
self.allocator.free(self.result);
|
|
63
|
+
}
|
|
64
|
+
pub fn setChild(self: GridPlan, index: usize, child: widgets.Widget, flow: bool, fills_width: bool) void {
|
|
65
|
+
const at = 128 + index * 64;
|
|
66
|
+
word(self.request, at, @as(u32, @intFromBool(flow)) | (@as(u32, @intFromBool(fills_width)) << 1));
|
|
67
|
+
const values = [_]f32{ child.frame.x, child.frame.y, child.frame.width, child.frame.height, child.layout.min_size.width, child.layout.min_size.height, child.layout.max_size.width, child.layout.max_size.height };
|
|
68
|
+
for (values, 0..) |value, i| put(self.request, at + 8 + i * 4, value);
|
|
69
|
+
}
|
|
70
|
+
pub fn run(self: GridPlan) GridResult {
|
|
71
|
+
@memset(self.result, 0xa5);
|
|
72
|
+
const written = self.policy(self.request, self.result);
|
|
73
|
+
if (written < 32 or read(self.result, 0) != 1 or read(self.result, 4) > 1) @panic("invalid grid measurement result");
|
|
74
|
+
const result: GridResult = .{ .bytes = self.result[0..32].* };
|
|
75
|
+
if (result.pending()) {
|
|
76
|
+
const index = result.index();
|
|
77
|
+
if (written != 32 or index >= self.count or read(self.request, 128 + index * 64) & 1 == 0 or read(self.request, 132 + index * 64) != 0) @panic("invalid grid measurement continuation");
|
|
78
|
+
absent(&result.bytes, 12, 32);
|
|
79
|
+
} else {
|
|
80
|
+
if (written != self.result.len or read(self.result, 24) > 1) @panic("invalid grid frame length or admission");
|
|
81
|
+
absent(&result.bytes, 8, 12);
|
|
82
|
+
absent(&result.bytes, 20, 24);
|
|
83
|
+
absent(&result.bytes, 28, 32);
|
|
84
|
+
if (!self.active()) absent(&result.bytes, 12, 20);
|
|
85
|
+
for (0..self.count) |i| {
|
|
86
|
+
const at = 32 + i * 32;
|
|
87
|
+
if (read(self.result, at) > 1) @panic("invalid grid frame flags");
|
|
88
|
+
if (self.enabled(i)) {
|
|
89
|
+
if (read(self.request, 128 + i * 64) & 1 == 0 or read(self.result, at + 4) >= read(self.result, at + 8) or read(self.result, at + 8) > self.count) @panic("invalid grid frame identity");
|
|
90
|
+
absent(self.result, at + 12, at + 16);
|
|
91
|
+
} else absent(self.result, at, at + 32);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
pub fn reply(self: GridPlan, result: GridResult, height: f32) void {
|
|
97
|
+
std.debug.assert(result.pending());
|
|
98
|
+
const at = 128 + result.index() * 64;
|
|
99
|
+
word(self.request, at + 4, 1);
|
|
100
|
+
put(self.request, at + 40, height);
|
|
101
|
+
}
|
|
102
|
+
pub fn active(self: GridPlan) bool {
|
|
103
|
+
return read(self.result, 24) != 0;
|
|
104
|
+
}
|
|
105
|
+
pub fn rows(self: GridPlan) u32 {
|
|
106
|
+
return read(self.result, 12);
|
|
107
|
+
}
|
|
108
|
+
pub fn extent(self: GridPlan) f32 {
|
|
109
|
+
return float(self.result, 16);
|
|
110
|
+
}
|
|
111
|
+
pub fn enabled(self: GridPlan, index: usize) bool {
|
|
112
|
+
return read(self.result, 32 + index * 32) != 0;
|
|
113
|
+
}
|
|
114
|
+
pub fn itemIndex(self: GridPlan, index: usize) u32 {
|
|
115
|
+
return read(self.result, 36 + index * 32);
|
|
116
|
+
}
|
|
117
|
+
pub fn itemCount(self: GridPlan, index: usize) u32 {
|
|
118
|
+
return read(self.result, 40 + index * 32);
|
|
119
|
+
}
|
|
120
|
+
pub fn frame(self: GridPlan, index: usize) geometry.RectF {
|
|
121
|
+
return rect(self.result, 48 + index * 32);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
pub const FlowAction = enum(u32) { done, extent, height, width };
|
|
126
|
+
pub const FlowResult = struct {
|
|
127
|
+
bytes: [32]u8,
|
|
128
|
+
pub fn action(self: FlowResult) FlowAction {
|
|
129
|
+
return @enumFromInt(read(&self.bytes, 4));
|
|
130
|
+
}
|
|
131
|
+
pub fn index(self: FlowResult) usize {
|
|
132
|
+
return read(&self.bytes, 8);
|
|
133
|
+
}
|
|
134
|
+
pub fn width(self: FlowResult) f32 {
|
|
135
|
+
return float(&self.bytes, 16);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
pub const FlowPlan = struct {
|
|
139
|
+
allocator: std.mem.Allocator,
|
|
140
|
+
policy: Policy,
|
|
141
|
+
request: []u8,
|
|
142
|
+
result: []u8,
|
|
143
|
+
count: usize,
|
|
144
|
+
pub fn init(allocator: std.mem.Allocator, policy: Policy, count: usize, operation: u8, options: virtual.Options) !FlowPlan {
|
|
145
|
+
// Reuse the established host conversion facts without borrowing any
|
|
146
|
+
// compiler result or retaining the temporary allocation's storage.
|
|
147
|
+
_ = try length(128, count, 64);
|
|
148
|
+
_ = try length(48, count, 32);
|
|
149
|
+
const base = try virtual.Plan.init(allocator, policy, count, options);
|
|
150
|
+
defer base.deinit();
|
|
151
|
+
const request = try allocator.alloc(u8, try length(144, count, 72));
|
|
152
|
+
errdefer allocator.free(request);
|
|
153
|
+
const result = try allocator.alloc(u8, try length(80, count, 32));
|
|
154
|
+
@memset(request, 0);
|
|
155
|
+
request[0..4].* = .{ 39, 1, operation, @import("render_plan_policy.zig").numericFlags() };
|
|
156
|
+
word(request, 4, std.math.cast(u32, count) orelse @panic("flow measurement count exceeds wire range"));
|
|
157
|
+
@memcpy(request[16..][0..base.request.len], base.request);
|
|
158
|
+
request[17] = operation;
|
|
159
|
+
return .{ .allocator = allocator, .policy = policy, .request = request, .result = result, .count = count };
|
|
160
|
+
}
|
|
161
|
+
pub fn deinit(self: FlowPlan) void {
|
|
162
|
+
self.allocator.free(self.request);
|
|
163
|
+
self.allocator.free(self.result);
|
|
164
|
+
}
|
|
165
|
+
fn state(self: FlowPlan, index: usize) usize {
|
|
166
|
+
return 144 + self.count * 64 + index * 8;
|
|
167
|
+
}
|
|
168
|
+
pub fn setChild(self: FlowPlan, index: usize, child: widgets.Widget, absolute: usize, flow: bool, fills_width: bool) void {
|
|
169
|
+
const at = 144 + index * 64;
|
|
170
|
+
word(self.request, at, @intFromBool(flow));
|
|
171
|
+
const values = [_]f32{ @floatFromInt(absolute), child.frame.width, child.frame.height, child.layout.min_size.width, child.layout.max_size.width, child.layout.min_size.height, child.layout.max_size.height, child.frame.x, child.frame.y };
|
|
172
|
+
for (values, 0..) |value, i| put(self.request, at + 4 + i * 4, value);
|
|
173
|
+
word(self.request, self.state(index) + 4, @intFromBool(fills_width));
|
|
174
|
+
}
|
|
175
|
+
pub fn run(self: FlowPlan) FlowResult {
|
|
176
|
+
@memset(self.result, 0xa5);
|
|
177
|
+
const written = self.policy(self.request, self.result);
|
|
178
|
+
if (written < 32 or read(self.result, 0) != 1 or read(self.result, 4) > 3) @panic("invalid flow measurement result");
|
|
179
|
+
const result: FlowResult = .{ .bytes = self.result[0..32].* };
|
|
180
|
+
absent(&result.bytes, 12, 16);
|
|
181
|
+
absent(&result.bytes, 20, 24);
|
|
182
|
+
absent(&result.bytes, 28, 32);
|
|
183
|
+
if (result.action() == .done) {
|
|
184
|
+
if (written != self.result.len or read(self.result, 24) > 1 or read(self.result, 32) != self.count or (if (self.request[2] == 2) read(self.result, 36) != 4 else read(self.result, 36) > 1)) @panic("invalid flow allocation length or mode");
|
|
185
|
+
absent(&result.bytes, 8, 12);
|
|
186
|
+
absent(&result.bytes, 16, 20);
|
|
187
|
+
for (0..self.count) |i| {
|
|
188
|
+
const at = 80 + i * 32;
|
|
189
|
+
if (read(self.result, at) != 0 and read(self.result, at) != 1 and read(self.result, at) != 3) @panic("invalid flow frame flags");
|
|
190
|
+
if (self.enabled(i) and read(self.request, 144 + i * 64) == 0) @panic("invalid flow frame admission");
|
|
191
|
+
if (!self.enabled(i)) absent(self.result, at, at + 32);
|
|
192
|
+
}
|
|
193
|
+
} else {
|
|
194
|
+
const index = result.index();
|
|
195
|
+
if (written != 32 or index >= self.count or read(self.request, 144 + index * 64) != 1 or read(self.result, 24) != 0) @panic("invalid flow child continuation");
|
|
196
|
+
if (result.action() == .extent) {
|
|
197
|
+
if (read(self.request, 8) != 0 or self.request[2] != 0) @panic("invalid repeated flow extent query");
|
|
198
|
+
} else if (read(self.request, self.state(index)) != 0 or (result.action() == .width) != (self.request[2] == 2)) @panic("invalid repeated flow measurement");
|
|
199
|
+
if (result.action() != .height) absent(&result.bytes, 16, 20);
|
|
200
|
+
}
|
|
201
|
+
return result;
|
|
202
|
+
}
|
|
203
|
+
pub fn reply(self: FlowPlan, result: FlowResult, value: f32) void {
|
|
204
|
+
switch (result.action()) {
|
|
205
|
+
.done => unreachable,
|
|
206
|
+
.extent => {
|
|
207
|
+
word(self.request, 8, 1);
|
|
208
|
+
put(self.request, 116, value);
|
|
209
|
+
},
|
|
210
|
+
.height, .width => {
|
|
211
|
+
word(self.request, self.state(result.index()), 1);
|
|
212
|
+
put(self.request, 144 + result.index() * 64 + @as(usize, if (result.action() == .height) 40 else 44), value);
|
|
213
|
+
},
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
pub fn active(self: FlowPlan) bool {
|
|
217
|
+
return read(self.result, 24) != 0;
|
|
218
|
+
}
|
|
219
|
+
pub fn itemCount(self: FlowPlan) u32 {
|
|
220
|
+
return read(self.result, 40);
|
|
221
|
+
}
|
|
222
|
+
pub fn extent(self: FlowPlan) f32 {
|
|
223
|
+
return float(self.result, 44);
|
|
224
|
+
}
|
|
225
|
+
pub fn mode(self: FlowPlan) u32 {
|
|
226
|
+
return read(self.result, 36);
|
|
227
|
+
}
|
|
228
|
+
pub fn enabled(self: FlowPlan, index: usize) bool {
|
|
229
|
+
return read(self.result, 80 + index * 32) & 1 != 0;
|
|
230
|
+
}
|
|
231
|
+
pub fn itemIndex(self: FlowPlan, index: usize) u32 {
|
|
232
|
+
return read(self.result, 84 + index * 32);
|
|
233
|
+
}
|
|
234
|
+
pub fn frame(self: FlowPlan, index: usize) geometry.RectF {
|
|
235
|
+
return rect(self.result, 88 + index * 32);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
@@ -84,15 +84,39 @@ pub const max_composite_components: usize = 8;
|
|
|
84
84
|
|
|
85
85
|
/// The bundled Geist Regular face (OFL), embedded so the reference
|
|
86
86
|
/// renderer paints real text without any platform font machinery. It
|
|
87
|
-
/// serves
|
|
88
|
-
///
|
|
89
|
-
/// changing callers.
|
|
87
|
+
/// serves regular sans text; the matching medium and bold faces below
|
|
88
|
+
/// preserve the weight chosen by widgets and inline spans.
|
|
90
89
|
pub const geist_regular_bytes: []const u8 = @embedFile("fonts/Geist-Regular.ttf");
|
|
91
90
|
|
|
92
91
|
/// Comptime-validated view over the bundled face. Using a comptime
|
|
93
92
|
/// constant means table presence and offsets are proven at build time.
|
|
94
93
|
pub const geist_regular = Face.parse(geist_regular_bytes) catch @compileError("bundled Geist-Regular.ttf failed to parse");
|
|
95
94
|
|
|
95
|
+
pub const geist_medium_bytes: []const u8 = @embedFile("fonts/Geist-Medium.ttf");
|
|
96
|
+
pub const geist_medium = Face.parse(geist_medium_bytes) catch @compileError("bundled Geist-Medium.ttf failed to parse");
|
|
97
|
+
|
|
98
|
+
pub const geist_bold_bytes: []const u8 = @embedFile("fonts/Geist-Bold.ttf");
|
|
99
|
+
pub const geist_bold = Face.parse(geist_bold_bytes) catch @compileError("bundled Geist-Bold.ttf failed to parse");
|
|
100
|
+
|
|
101
|
+
pub const bundled_sans_faces = [_]*const Face{ &geist_regular, &geist_medium, &geist_bold };
|
|
102
|
+
|
|
103
|
+
/// The reserved sans ids share one face selection for layout and drawing.
|
|
104
|
+
/// Italic ids retain their weight using upright outlines until an italic
|
|
105
|
+
/// face is bundled. Unknown ids keep the regular fallback.
|
|
106
|
+
pub fn bundledSansFaceIndex(font_id: u64) usize {
|
|
107
|
+
const canvas = @import("root.zig");
|
|
108
|
+
return switch (font_id) {
|
|
109
|
+
canvas.default_sans_medium_font_id => 1,
|
|
110
|
+
canvas.default_sans_bold_font_id, canvas.default_sans_bold_italic_font_id => 2,
|
|
111
|
+
else => 0,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
pub fn bundledFaceForFontId(font_id: u64) *const Face {
|
|
116
|
+
if (font_id == @import("root.zig").default_mono_font_id) return &geist_mono;
|
|
117
|
+
return bundled_sans_faces[bundledSansFaceIndex(font_id)];
|
|
118
|
+
}
|
|
119
|
+
|
|
96
120
|
/// The bundled Geist Mono Regular face (OFL, same family): mono runs
|
|
97
121
|
/// ink real fixed-pitch outlines. Before this face landed, mono font
|
|
98
122
|
/// ids borrowed the proportional sans outlines centered inside the
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font.git)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://openfontlicense.org
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Bundled fonts
|
|
2
|
+
|
|
3
|
+
Geist Regular, Medium and Bold are unmodified static TrueType files from
|
|
4
|
+
[Geist 1.4.2](https://github.com/vercel/geist-font/tree/4d655731f83507f0258ce5541c297b6553d5d081/packages/next/dist/fonts/geist-sans),
|
|
5
|
+
distributed under the [SIL Open Font License](./OFL.txt).
|
|
6
|
+
|
|
7
|
+
The software renderer and deterministic text measurement use the same face
|
|
8
|
+
for each built-in weight. Italic styles use upright outlines at the requested
|
|
9
|
+
weight; platform text providers can supply italic faces.
|
|
10
|
+
|
|
11
|
+
| File | SHA-256 |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| Geist-Regular.ttf | `5e7c3b25da393b1619253c655f95c5d123184759a4961562add5b0f5386e63c9` |
|
|
14
|
+
| Geist-Medium.ttf | `0987db2030200a6b4a45d03398057c27733977b09bde67b8d0afc26b8b8d0768` |
|
|
15
|
+
| Geist-Bold.ttf | `dbe7fbf58111609860bf1b3bebdf4d39efc7e64ed65ef3b393a090680038d920` |
|