@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,161 @@
|
|
|
1
|
+
//! Copied command facts and checked selections. Native retains borrowed names,
|
|
2
|
+
//! registry storage, exact OS identities, capability results and event lifetime.
|
|
3
|
+
const std = @import("std");
|
|
4
|
+
const platform = @import("../platform/root.zig");
|
|
5
|
+
const validation = @import("validation.zig");
|
|
6
|
+
const app_manifest = @import("app_manifest");
|
|
7
|
+
pub const Policy = *const fn ([]const u8, []u8) usize;
|
|
8
|
+
pub const Dispatch = enum(u8) { app, invalid, updater };
|
|
9
|
+
pub const Menu = struct { exists: bool, actionable: bool, row: ?usize, option: ?usize };
|
|
10
|
+
pub const Slot = struct { kind: enum(u8) { absent, retained, available, full }, index: ?usize };
|
|
11
|
+
|
|
12
|
+
comptime {
|
|
13
|
+
if (platform.max_views != 32 or platform.max_view_label_bytes != 64 or platform.max_tray_items != 32 or platform.max_tray_segment_options != 8 or platform.max_status_items != 8 or validation.max_command_id_bytes != 128 or !std.mem.eql(u8, platform.update_check_command, "app.check-for-updates")) @compileError("update command coordination packet limits");
|
|
14
|
+
if (app_manifest.max_commands != 256 or app_manifest.max_command_id_bytes != 128 or app_manifest.max_command_title_bytes != 128) @compileError("update command catalog packet limits");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Packet = struct {
|
|
18
|
+
bytes: []u8,
|
|
19
|
+
len: usize = 0,
|
|
20
|
+
fn append(self: *Packet, bytes: []const u8) void {
|
|
21
|
+
if (bytes.len > self.bytes.len - self.len) @panic("command packet capacity");
|
|
22
|
+
@memcpy(self.bytes[self.len..][0..bytes.len], bytes);
|
|
23
|
+
self.len += bytes.len;
|
|
24
|
+
}
|
|
25
|
+
fn word(self: *Packet, value: u32) void {
|
|
26
|
+
var bytes: [4]u8 = undefined;
|
|
27
|
+
std.mem.writeInt(u32, &bytes, value, .little);
|
|
28
|
+
self.append(&bytes);
|
|
29
|
+
}
|
|
30
|
+
fn identity(self: *Packet, value: u64) void {
|
|
31
|
+
var bytes: [8]u8 = undefined;
|
|
32
|
+
std.mem.writeInt(u64, &bytes, value, .little);
|
|
33
|
+
self.append(&bytes);
|
|
34
|
+
}
|
|
35
|
+
fn written(self: *const Packet) []const u8 {
|
|
36
|
+
return self.bytes[0..self.len];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
fn read(bytes: []const u8, at: usize) u32 {
|
|
40
|
+
return std.mem.readInt(u32, bytes[at..][0..4], .little);
|
|
41
|
+
}
|
|
42
|
+
fn run(policy: Policy, request: []const u8, result: []u8) void {
|
|
43
|
+
if (policy(request, result) != result.len) @panic("invalid compiled command result size");
|
|
44
|
+
}
|
|
45
|
+
fn text(policy: Policy, operation: u8, value: []const u8, limit: usize) u8 {
|
|
46
|
+
var bytes: [136]u8 = undefined;
|
|
47
|
+
var packet = Packet{ .bytes = &bytes };
|
|
48
|
+
packet.append(&.{ 69, operation, 0, 0 });
|
|
49
|
+
packet.word(std.math.cast(u32, value.len) orelse std.math.maxInt(u32));
|
|
50
|
+
packet.append(value[0..@min(value.len, limit)]);
|
|
51
|
+
var result: [4]u8 = undefined;
|
|
52
|
+
run(policy, packet.written(), &result);
|
|
53
|
+
if (!std.mem.eql(u8, result[1..], &.{ 0, 0, 0 })) @panic("invalid compiled command reserved bytes");
|
|
54
|
+
return result[0];
|
|
55
|
+
}
|
|
56
|
+
pub fn dispatch(policy: Policy, name: []const u8) Dispatch {
|
|
57
|
+
return std.enums.fromInt(Dispatch, text(policy, 0, name, 128)) orelse @panic("invalid compiled command dispatch");
|
|
58
|
+
}
|
|
59
|
+
pub fn bridgeLabel(policy: Policy, label: []const u8) []const u8 {
|
|
60
|
+
return switch (text(policy, 4, label, 64)) {
|
|
61
|
+
0 => label,
|
|
62
|
+
1 => "",
|
|
63
|
+
else => @panic("invalid compiled command label"),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
pub fn catalog(policy: Policy, commands: []const app_manifest.Command) !void {
|
|
68
|
+
var bytes: [8 + 256 * (8 + 128 + 128)]u8 = undefined;
|
|
69
|
+
var packet = Packet{ .bytes = &bytes };
|
|
70
|
+
packet.append(&.{ 69, 5, 0, 0 });
|
|
71
|
+
packet.word(std.math.cast(u32, commands.len) orelse std.math.maxInt(u32));
|
|
72
|
+
if (commands.len <= 256) for (commands) |*command| {
|
|
73
|
+
packet.word(std.math.cast(u32, command.id.len) orelse std.math.maxInt(u32));
|
|
74
|
+
packet.word(std.math.cast(u32, command.title.len) orelse std.math.maxInt(u32));
|
|
75
|
+
packet.append(command.id[0..@min(command.id.len, 128)]);
|
|
76
|
+
packet.append(command.title[0..@min(command.title.len, 128)]);
|
|
77
|
+
};
|
|
78
|
+
var result: [4]u8 = undefined;
|
|
79
|
+
run(policy, packet.written(), &result);
|
|
80
|
+
if (!std.mem.eql(u8, result[1..], &.{ 0, 0, 0 })) @panic("invalid compiled command catalog reserved bytes");
|
|
81
|
+
return switch (result[0]) {
|
|
82
|
+
0 => {},
|
|
83
|
+
1 => error.InvalidCommand,
|
|
84
|
+
2 => error.InvalidName,
|
|
85
|
+
3 => error.DuplicateCommand,
|
|
86
|
+
else => @panic("invalid compiled command catalog admission"),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
pub fn nativeViewSource(policy: Policy, views: anytype, window_id: platform.WindowId, label: []const u8) bool {
|
|
91
|
+
if (views.len > platform.max_views) @panic("command view capacity");
|
|
92
|
+
var bytes: [20 + 64 + platform.max_views * (16 + 128)]u8 = undefined;
|
|
93
|
+
var packet = Packet{ .bytes = &bytes };
|
|
94
|
+
packet.append(&.{ 69, 1, 0, 0 });
|
|
95
|
+
packet.word(@intCast(views.len));
|
|
96
|
+
packet.identity(window_id);
|
|
97
|
+
packet.word(std.math.cast(u32, label.len) orelse std.math.maxInt(u32));
|
|
98
|
+
packet.append(label[0..@min(label.len, 64)]);
|
|
99
|
+
// Iterate pointers: retained views contain large native widget buffers.
|
|
100
|
+
for (views) |*view| {
|
|
101
|
+
const parent = view.parent orelse "";
|
|
102
|
+
if (view.label.len > 64 or parent.len > 64) @panic("command view label capacity");
|
|
103
|
+
packet.append(&.{ @as(u8, @intFromBool(view.open)) | (@as(u8, @intFromBool(view.kind == .toolbar)) << 1) | (@as(u8, @intFromBool(view.parent != null)) << 2), @intCast(view.label.len), @intCast(parent.len), 0 });
|
|
104
|
+
packet.identity(view.window_id);
|
|
105
|
+
packet.word(0);
|
|
106
|
+
packet.append(view.label);
|
|
107
|
+
packet.append(parent);
|
|
108
|
+
}
|
|
109
|
+
var result: [4]u8 = undefined;
|
|
110
|
+
run(policy, packet.written(), &result);
|
|
111
|
+
if (!std.mem.eql(u8, result[1..], &.{ 0, 0, 0 }) or (result[0] != 3 and result[0] != 6)) @panic("invalid compiled command source");
|
|
112
|
+
return result[0] == 3;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
pub fn menu(policy: Policy, items: anytype, item_id: platform.TrayItemId) Menu {
|
|
116
|
+
if (items.len > platform.max_tray_items) @panic("command menu capacity");
|
|
117
|
+
var bytes: [12 + platform.max_tray_items * (8 + platform.max_tray_segment_options * 8)]u8 = undefined;
|
|
118
|
+
var packet = Packet{ .bytes = &bytes };
|
|
119
|
+
packet.append(&.{ 69, 2, 0, 0 });
|
|
120
|
+
packet.word(@intCast(items.len));
|
|
121
|
+
packet.word(item_id);
|
|
122
|
+
for (items) |*item| {
|
|
123
|
+
const options: []const platform.TraySegmentOption = if (item.segmented) |segment| segment.options else &.{};
|
|
124
|
+
if (options.len > platform.max_tray_segment_options) @panic("command segment capacity");
|
|
125
|
+
packet.word(item.id);
|
|
126
|
+
packet.append(&.{ @as(u8, @intFromBool(item.separator)) | (@as(u8, @intFromBool(item.enabled)) << 1) | (@as(u8, @intFromBool(item.role == .command or item.role == .agent)) << 2) | (@as(u8, @intFromBool(item.command.len > 0)) << 3), @intCast(options.len), 0, 0 });
|
|
127
|
+
for (options) |option| {
|
|
128
|
+
packet.word(option.id);
|
|
129
|
+
packet.append(&.{ @intFromBool(option.enabled), 0, 0, 0 });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
var result: [16]u8 = undefined;
|
|
133
|
+
run(policy, packet.written(), &result);
|
|
134
|
+
const row = read(&result, 4);
|
|
135
|
+
const option = read(&result, 8);
|
|
136
|
+
if (result[0] > 1 or result[1] > 1 or result[2] != 0 or result[3] != 0 or read(&result, 12) != 0) @panic("invalid compiled command menu flags");
|
|
137
|
+
if (row != std.math.maxInt(u32)) {
|
|
138
|
+
if (row >= items.len) @panic("invalid compiled command menu row");
|
|
139
|
+
if (option != std.math.maxInt(u32) and (items[row].segmented == null or option >= items[row].segmented.?.options.len)) @panic("invalid compiled command menu option");
|
|
140
|
+
} else if (option != std.math.maxInt(u32)) @panic("invalid compiled command menu fallback");
|
|
141
|
+
return .{ .exists = result[0] == 1, .actionable = result[1] == 1, .row = if (row == std.math.maxInt(u32)) null else row, .option = if (option == std.math.maxInt(u32)) null else option };
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
pub fn slot(policy: Policy, slots: anytype, id: platform.StatusItemId, admit: bool, count: usize) Slot {
|
|
145
|
+
if (slots.len != 8 or count > 8) @panic("command status capacity");
|
|
146
|
+
var bytes: [80]u8 = undefined;
|
|
147
|
+
var packet = Packet{ .bytes = &bytes };
|
|
148
|
+
packet.append(&.{ 69, 3, 0, 0 });
|
|
149
|
+
packet.word(@intFromBool(admit));
|
|
150
|
+
packet.word(id);
|
|
151
|
+
packet.word(@intCast(count));
|
|
152
|
+
for (slots) |*entry| {
|
|
153
|
+
packet.append(&.{ @intFromBool(entry.active), 0, 0, 0 });
|
|
154
|
+
packet.word(entry.id);
|
|
155
|
+
}
|
|
156
|
+
var result: [8]u8 = undefined;
|
|
157
|
+
run(policy, packet.written(), &result);
|
|
158
|
+
const index = read(&result, 4);
|
|
159
|
+
if (result[0] > 3 or !std.mem.eql(u8, result[1..4], &.{ 0, 0, 0 }) or ((result[0] == 1 or result[0] == 2) != (index < slots.len)) or (index >= slots.len and index != std.math.maxInt(u32))) @panic("invalid compiled command status selection");
|
|
160
|
+
return .{ .kind = @enumFromInt(result[0]), .index = if (index == std.math.maxInt(u32)) null else index };
|
|
161
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//! Portable menu and scroll plans; native owns payloads, pins and latch storage.
|
|
2
|
+
const std = @import("std");
|
|
3
|
+
const canvas = @import("canvas");
|
|
4
|
+
pub const Policy = ?*const fn ([]const u8, []u8) usize;
|
|
5
|
+
pub const Stage = enum(u8) { shown_count, pin_owner, rebuild_arena, release_window, dismiss_token, restore_tree, selection_begin, selection_item, missing_tree, fallback_label, fallback_dismiss, fallback_item, fallback_dispatch, fallback_vanished, rebuild_views, scroll_rebuild };
|
|
6
|
+
pub const Plan = [16]u8;
|
|
7
|
+
pub fn request(stage: Stage, a: bool, b: bool, c: bool, x: u64, y: u64) [32]u8 {
|
|
8
|
+
var bytes: [32]u8 = @splat(0);
|
|
9
|
+
bytes[0..5].* = .{ 22, @intFromEnum(stage), @intFromBool(a), @intFromBool(b), @intFromBool(c) };
|
|
10
|
+
std.mem.writeInt(u64, bytes[8..16], x, .little);
|
|
11
|
+
std.mem.writeInt(u64, bytes[16..24], y, .little);
|
|
12
|
+
return bytes;
|
|
13
|
+
}
|
|
14
|
+
pub fn plan(policy: Policy, stage: Stage, a: bool, b: bool, c: bool, x: u64, y: u64) Plan {
|
|
15
|
+
const bytes = request(stage, a, b, c, x, y);
|
|
16
|
+
if (policy) |callback| {
|
|
17
|
+
var result: Plan = undefined;
|
|
18
|
+
if (callback(&bytes, &result) != result.len) @panic("invalid compiled component plan size");
|
|
19
|
+
const ceiling: u8 = switch (stage) {
|
|
20
|
+
.pin_owner, .selection_item, .fallback_dispatch => 2,
|
|
21
|
+
.selection_begin => 3,
|
|
22
|
+
else => 1,
|
|
23
|
+
};
|
|
24
|
+
if (result[0] > ceiling or !std.mem.allEqual(u8, result[1..8], 0)) @panic("invalid compiled component action");
|
|
25
|
+
if (stage != .shown_count and !std.mem.allEqual(u8, result[8..], 0)) @panic("invalid compiled component count");
|
|
26
|
+
if (stage == .shown_count and (result[0] != 0 or std.mem.readInt(u64, result[8..16], .little) > @min(x, y))) @panic("invalid compiled menu count");
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
return reference(stage, a, b, c, x, y);
|
|
30
|
+
}
|
|
31
|
+
pub fn reference(stage: Stage, a: bool, b: bool, c: bool, x: u64, y: u64) Plan {
|
|
32
|
+
var result: Plan = @splat(0);
|
|
33
|
+
result[0] = switch (stage) {
|
|
34
|
+
.shown_count => 0,
|
|
35
|
+
.pin_owner => if (a) 1 else if (b) 2 else 0,
|
|
36
|
+
.rebuild_arena => @intFromBool(a and b and c),
|
|
37
|
+
.release_window => @intFromBool(a and b and c),
|
|
38
|
+
.dismiss_token => @intFromBool(a and b),
|
|
39
|
+
.restore_tree => @intFromBool(a and (b or c)),
|
|
40
|
+
.selection_begin => @as(u8, @intFromBool(a)) | (@as(u8, @intFromBool(b and c)) << 1),
|
|
41
|
+
.selection_item => if (a and b) 1 else 2,
|
|
42
|
+
.missing_tree => @intFromBool(a),
|
|
43
|
+
.fallback_label => @intFromBool(a and b),
|
|
44
|
+
.fallback_dismiss => @intFromBool(a and b and c),
|
|
45
|
+
.fallback_item => @intFromBool(a and b and c),
|
|
46
|
+
.fallback_dispatch => if (a) 1 else 2,
|
|
47
|
+
.fallback_vanished => @intFromBool(a and !b),
|
|
48
|
+
.rebuild_views => @intFromBool(a),
|
|
49
|
+
.scroll_rebuild => @intFromBool(!a and b and c and x != 0),
|
|
50
|
+
};
|
|
51
|
+
if (stage == .shown_count) std.mem.writeInt(u64, result[8..16], @min(x, y), .little);
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
pub const Reach = struct { horizontal: bool, action: enum(u8) { none, clear, store } };
|
|
55
|
+
pub fn reachRequest(start: bool, id_present: bool, scroll: canvas.ScrollState, vertical_fired: bool, horizontal_fired: bool) [32]u8 {
|
|
56
|
+
var bytes: [32]u8 = @splat(0);
|
|
57
|
+
bytes[0..6].* = .{ 23, @intFromBool(start), @intFromBool(id_present), @intFromBool(vertical_fired), @intFromBool(horizontal_fired), 0 };
|
|
58
|
+
const v = scroll.axis(.vertical);
|
|
59
|
+
const h = scroll.axis(.horizontal);
|
|
60
|
+
const values = [_]f32{ v.offset, v.viewport_extent, v.content_extent, h.offset, h.viewport_extent, h.content_extent };
|
|
61
|
+
for (values, 0..) |value, i| std.mem.writeInt(u32, bytes[8 + i * 4 ..][0..4], @bitCast(value), .little);
|
|
62
|
+
return bytes;
|
|
63
|
+
}
|
|
64
|
+
pub fn reach(policy: Policy, start: bool, id_present: bool, scroll: canvas.ScrollState, vertical_fired: bool, horizontal_fired: bool) Reach {
|
|
65
|
+
if (policy) |callback| {
|
|
66
|
+
const bytes = reachRequest(start, id_present, scroll, vertical_fired, horizontal_fired);
|
|
67
|
+
var result: [8]u8 = undefined;
|
|
68
|
+
if (callback(&bytes, &result) != result.len or result[0] > 1 or result[1] > 2 or !std.mem.allEqual(u8, result[2..], 0)) @panic("invalid compiled reach plan");
|
|
69
|
+
return .{ .horizontal = result[0] != 0, .action = @enumFromInt(result[1]) };
|
|
70
|
+
}
|
|
71
|
+
return reachReference(start, id_present, scroll, vertical_fired, horizontal_fired);
|
|
72
|
+
}
|
|
73
|
+
pub fn reachReference(start: bool, id_present: bool, scroll: canvas.ScrollState, vertical_fired: bool, horizontal_fired: bool) Reach {
|
|
74
|
+
const vertical = scroll.axis(.vertical);
|
|
75
|
+
const horizontal = scroll.axis(.horizontal);
|
|
76
|
+
const use_horizontal = !(vertical.maxOffset() > 0) and horizontal.maxOffset() > 0;
|
|
77
|
+
const axis = if (use_horizontal) horizontal else vertical;
|
|
78
|
+
var result: Reach = .{ .horizontal = use_horizontal, .action = .none };
|
|
79
|
+
if (!id_present or axis.viewport_extent <= 0) return result;
|
|
80
|
+
const remaining = if (start) axis.offset else axis.content_extent - axis.viewport_extent - axis.offset;
|
|
81
|
+
if (remaining > axis.viewport_extent * @as(f32, 1.5)) result.action = .clear else if (!(remaining > axis.viewport_extent * @as(f32, 1.0)) and !(if (use_horizontal) horizontal_fired else vertical_fired)) result.action = .store;
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
//! Owned context-menu plans. All identities/tokens remain complete integer
|
|
2
|
+
//! words. Native owns labels, widgets, callbacks, buffers and OS services.
|
|
3
|
+
const std = @import("std");
|
|
4
|
+
const canvas = @import("canvas");
|
|
5
|
+
const platform = @import("../platform/root.zig");
|
|
6
|
+
const limits = @import("canvas_limits.zig");
|
|
7
|
+
pub const Policy = *const fn ([]const u8, []u8) usize;
|
|
8
|
+
pub const Kind = enum(u32) { app = 1, edit_text, terminal, static_copy };
|
|
9
|
+
pub const Action = enum(u32) { none, app, cut, copy, paste, select_all, terminal_copy, terminal_paste, static_copy };
|
|
10
|
+
fn header(comptime n: usize, mode: u8) [n]u8 {
|
|
11
|
+
var bytes: [n]u8 = @splat(0);
|
|
12
|
+
bytes[0..2].* = .{ 98, mode };
|
|
13
|
+
return bytes;
|
|
14
|
+
}
|
|
15
|
+
fn put(bytes: []u8, at: usize, value: u32) void {
|
|
16
|
+
std.mem.writeInt(u32, bytes[at..][0..4], value, .little);
|
|
17
|
+
}
|
|
18
|
+
fn wide(bytes: []u8, at: usize, value: u64) void {
|
|
19
|
+
std.mem.writeInt(u64, bytes[at..][0..8], value, .little);
|
|
20
|
+
}
|
|
21
|
+
fn scalar(policy: Policy, request: []const u8, maximum: u32) u32 {
|
|
22
|
+
var out: [4]u8 = undefined;
|
|
23
|
+
if (policy(request, &out) != out.len) @panic("invalid context menu scalar length");
|
|
24
|
+
const value = std.mem.readInt(u32, &out, .little);
|
|
25
|
+
if (value > maximum) @panic("invalid context menu scalar");
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
pub fn route(policy: Policy, nodes: []const canvas.WidgetLayoutNode, entries: []const canvas.WidgetEventRouteEntry) ?usize {
|
|
29
|
+
if (nodes.len > limits.max_canvas_widget_nodes_per_view or entries.len > limits.max_canvas_widget_nodes_per_view) @panic("context menu route capacity");
|
|
30
|
+
var request = header(16 + limits.max_canvas_widget_nodes_per_view * 24, 0);
|
|
31
|
+
put(&request, 4, @intCast(nodes.len));
|
|
32
|
+
put(&request, 8, @intCast(entries.len));
|
|
33
|
+
for (nodes, 0..) |node, i| {
|
|
34
|
+
const at = 16 + i * 16;
|
|
35
|
+
wide(&request, at, node.depth);
|
|
36
|
+
put(&request, at + 8, @intCast(node.widget.context_menu.len));
|
|
37
|
+
put(&request, at + 12, @intFromBool(node.widget.state.disabled));
|
|
38
|
+
}
|
|
39
|
+
for (entries, 0..) |entry, i| wide(&request, 16 + nodes.len * 16 + i * 8, entry.node_index);
|
|
40
|
+
const slot = scalar(policy, request[0 .. 16 + nodes.len * 16 + entries.len * 8], std.math.maxInt(u32));
|
|
41
|
+
if (slot == std.math.maxInt(u32)) return null;
|
|
42
|
+
if (slot >= nodes.len or nodes[slot].widget.context_menu.len == 0 or nodes[slot].widget.state.disabled) @panic("invalid context menu route capability");
|
|
43
|
+
return slot;
|
|
44
|
+
}
|
|
45
|
+
pub const Presentation = struct {
|
|
46
|
+
kind: enum(u8) { none, hold, edit_text, terminal, static_copy },
|
|
47
|
+
count: usize,
|
|
48
|
+
items: [5]platform.ContextMenuItem = undefined,
|
|
49
|
+
};
|
|
50
|
+
pub const Facts = struct {
|
|
51
|
+
flags: u32,
|
|
52
|
+
target: u64 = 0,
|
|
53
|
+
selected: u64 = 0,
|
|
54
|
+
selected_group: u64 = 0,
|
|
55
|
+
target_group: u64 = 0,
|
|
56
|
+
};
|
|
57
|
+
pub fn presentation(policy: Policy, facts: Facts) Presentation {
|
|
58
|
+
var request = header(56, 1);
|
|
59
|
+
put(&request, 4, facts.flags);
|
|
60
|
+
for ([_]u64{ facts.target, facts.selected, facts.selected_group, facts.target_group }, 0..) |v, i| wide(&request, 16 + i * 8, v);
|
|
61
|
+
var out: [28]u8 = undefined;
|
|
62
|
+
const length = policy(&request, &out);
|
|
63
|
+
if (length < 8 or length > out.len or out[0] > 4 or out[1] > 5 or length != 8 + @as(usize, out[1]) * 4 or
|
|
64
|
+
!std.mem.allEqual(u8, out[2..8], 0)) @panic("invalid context menu presentation");
|
|
65
|
+
const labels = [_][]const u8{ "", "Cut", "Copy", "Paste", "Select All" };
|
|
66
|
+
var result = Presentation{ .kind = @enumFromInt(out[0]), .count = out[1] };
|
|
67
|
+
for (0..result.count) |i| {
|
|
68
|
+
const at = 8 + i * 4;
|
|
69
|
+
if (out[at] > 4 or out[at + 1] > 4 or out[at + 2] > 1 or out[at + 3] > 1) @panic("invalid context menu item capability");
|
|
70
|
+
result.items[i] = .{ .id = out[at], .label = labels[out[at + 1]], .enabled = out[at + 2] != 0, .separator = out[at + 3] != 0 };
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
pub fn nextToken(policy: Policy, token: u64) u64 {
|
|
75
|
+
var request = header(16, 2);
|
|
76
|
+
wide(&request, 8, token);
|
|
77
|
+
var out: [8]u8 = undefined;
|
|
78
|
+
if (policy(&request, &out) != out.len) @panic("invalid context menu token length");
|
|
79
|
+
const value = std.mem.readInt(u64, &out, .little);
|
|
80
|
+
if (value == 0) @panic("invalid context menu token");
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
pub fn notice(policy: Policy, kind: ?Kind) bool {
|
|
84
|
+
var request = header(16, 3);
|
|
85
|
+
put(&request, 4, if (kind) |k| @intFromEnum(k) else 0);
|
|
86
|
+
return scalar(policy, &request, 1) != 0;
|
|
87
|
+
}
|
|
88
|
+
pub const Continuation = enum(u32) { superseded, view_closed, shown };
|
|
89
|
+
pub fn continuation(policy: Policy, token: u64, current: ?u64, view_open: bool) Continuation {
|
|
90
|
+
var request = header(32, 4);
|
|
91
|
+
put(&request, 4, @as(u32, @intFromBool(current != null)) | (@as(u32, @intFromBool(view_open)) << 1));
|
|
92
|
+
wide(&request, 8, token);
|
|
93
|
+
wide(&request, 16, current orelse 0);
|
|
94
|
+
return @enumFromInt(scalar(policy, &request, 2));
|
|
95
|
+
}
|
|
96
|
+
pub const Admission = enum(u32) { ignore, dismiss, clear, lookup };
|
|
97
|
+
pub fn admission(policy: Policy, kind: ?Kind, window: u64, token: u64, event: platform.ContextMenuActionEvent) Admission {
|
|
98
|
+
var request = header(48, 5);
|
|
99
|
+
put(&request, 4, if (kind) |k| @intFromEnum(k) else 0);
|
|
100
|
+
wide(&request, 8, window);
|
|
101
|
+
wide(&request, 16, event.window_id);
|
|
102
|
+
wide(&request, 24, token);
|
|
103
|
+
wide(&request, 32, event.token);
|
|
104
|
+
put(&request, 40, event.item_id);
|
|
105
|
+
return @enumFromInt(scalar(policy, &request, 3));
|
|
106
|
+
}
|
|
107
|
+
pub fn action(policy: Policy, kind: Kind, item: u32) Action {
|
|
108
|
+
var request = header(16, 6);
|
|
109
|
+
put(&request, 4, @intFromEnum(kind));
|
|
110
|
+
put(&request, 8, item);
|
|
111
|
+
return @enumFromInt(scalar(policy, &request, 8));
|
|
112
|
+
}
|
package/src/runtime/core.zig
CHANGED
|
@@ -27,6 +27,7 @@ const runtime_frame_profile = @import("frame_profile.zig");
|
|
|
27
27
|
const runtime_gpu_surface_events = @import("gpu_surface_events.zig");
|
|
28
28
|
const runtime_flow = @import("flow.zig");
|
|
29
29
|
const runtime_session_state = @import("session_state.zig");
|
|
30
|
+
const session_journal = @import("session_journal.zig");
|
|
30
31
|
const runtime_state = @import("state.zig");
|
|
31
32
|
const runtime_system_services = @import("system_services.zig");
|
|
32
33
|
const runtime_builtin_bridge = @import("builtin_bridge.zig");
|
|
@@ -205,6 +206,14 @@ pub const Runtime = struct {
|
|
|
205
206
|
max_image_pixel_bytes: usize = canvas_limits.max_registered_canvas_image_pixel_bytes,
|
|
206
207
|
surface: platform.Surface,
|
|
207
208
|
appearance: platform.Appearance = .{},
|
|
209
|
+
/// Synchronous OS facts queued only while replaying. One event must
|
|
210
|
+
/// consume the complete sequence before the next event can begin.
|
|
211
|
+
replay_window_chrome_active: bool = false,
|
|
212
|
+
replay_window_chrome_source: session_journal.WindowChromeSource = .native_queries,
|
|
213
|
+
replay_window_chrome_failed: bool = false,
|
|
214
|
+
replay_window_chrome: [session_journal.max_session_window_chrome_queries]session_journal.WindowChromeRecord = undefined,
|
|
215
|
+
replay_window_chrome_count: usize = 0,
|
|
216
|
+
replay_window_chrome_index: usize = 0,
|
|
208
217
|
windows: [platform.max_windows]RuntimeWindow = undefined,
|
|
209
218
|
window_count: usize = 0,
|
|
210
219
|
views: [platform.max_views]RuntimeView = undefined,
|
|
@@ -258,6 +267,28 @@ pub const Runtime = struct {
|
|
|
258
267
|
video_height: u64 = 0,
|
|
259
268
|
shell_layouts: [platform.max_windows]RuntimeShellLayout = undefined,
|
|
260
269
|
shell_layout_count: usize = 0,
|
|
270
|
+
shell_layout_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
271
|
+
view_coordination_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
272
|
+
window_lifecycle_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
273
|
+
image_registry_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
274
|
+
font_registry_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
275
|
+
shell_coordination_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
276
|
+
shell_admission_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
277
|
+
system_admission_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
278
|
+
bridge_descriptor_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
279
|
+
authorization_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
280
|
+
builtin_coordination_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
281
|
+
automation_command_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
282
|
+
automation_interaction_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
283
|
+
snapshot_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
284
|
+
host_flow_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
285
|
+
command_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
286
|
+
context_menu_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
287
|
+
text_cache_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
288
|
+
render_cache_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
289
|
+
render_plan_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
290
|
+
render_override_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
291
|
+
render_damage_policy: ?*const fn ([]const u8, []u8) usize = null,
|
|
261
292
|
/// Reused by runtime-created window restoration. `Store.loadWindow`
|
|
262
293
|
/// needs the whole bounded state file plus decoded-string scratch; keep
|
|
263
294
|
/// that 64-KiB workspace on the already heap-owned Runtime instead of
|
|
@@ -523,6 +554,15 @@ pub const Runtime = struct {
|
|
|
523
554
|
// The profile rings exceed the small-default copy bound above;
|
|
524
555
|
// assign explicitly so the disabled state is never undefined.
|
|
525
556
|
self.frame_profile = .{};
|
|
557
|
+
// Status rows exceed the small-default copy bound. Initialize their
|
|
558
|
+
// ownership metadata without touching unused menu payload buffers.
|
|
559
|
+
for (&self.status_items) |*item| {
|
|
560
|
+
item.id = 0;
|
|
561
|
+
item.active = false;
|
|
562
|
+
item.visible = true;
|
|
563
|
+
item.title = "";
|
|
564
|
+
item.item_count = 0;
|
|
565
|
+
}
|
|
526
566
|
self.started_timestamp_ns = timestampToU64(nowNanoseconds());
|
|
527
567
|
self.text_measure_provider = if (options.platform.services.measure_text_fn) |measure_fn|
|
|
528
568
|
.{
|
|
@@ -691,6 +731,8 @@ pub const Runtime = struct {
|
|
|
691
731
|
pub const listWindows = WindowViewMethods.listWindows;
|
|
692
732
|
pub const focusWindow = WindowViewMethods.focusWindow;
|
|
693
733
|
pub const closeWindow = WindowViewMethods.closeWindow;
|
|
734
|
+
pub const restoreWindowCapabilityResult = WindowViewMethods.restoreWindowCapabilityResult;
|
|
735
|
+
pub const restoreWindowShow = WindowViewMethods.restoreWindowShow;
|
|
694
736
|
pub const minimizeWindow = WindowViewMethods.minimizeWindow;
|
|
695
737
|
pub const hideWindow = WindowViewMethods.hideWindow;
|
|
696
738
|
pub const showWindow = WindowViewMethods.showWindow;
|
|
@@ -792,6 +834,8 @@ pub const Runtime = struct {
|
|
|
792
834
|
pub const getCredential = SystemServiceMethods.getCredential;
|
|
793
835
|
pub const deleteCredential = SystemServiceMethods.deleteCredential;
|
|
794
836
|
pub const formatLocalTime = SystemServiceMethods.formatLocalTime;
|
|
837
|
+
pub const sendKeyChord = SystemServiceMethods.sendKeyChord;
|
|
838
|
+
pub const keyboardInputAccess = SystemServiceMethods.keyboardInputAccess;
|
|
795
839
|
pub const createTray = SystemServiceMethods.createTray;
|
|
796
840
|
pub const createStatusItem = SystemServiceMethods.createStatusItem;
|
|
797
841
|
pub const updateStatusItemShell = SystemServiceMethods.updateStatusItemShell;
|
|
@@ -846,6 +890,14 @@ pub const Runtime = struct {
|
|
|
846
890
|
/// pointers are stable for the runtime's lifetime and tokens stamped
|
|
847
891
|
/// with them compare equal frame to frame.
|
|
848
892
|
pub fn textMeasureProvider(self: *const Runtime) ?*const canvas.TextMeasureProvider {
|
|
893
|
+
if (self.font_registry_policy) |policy| {
|
|
894
|
+
const choice = @import("font_registry_policy.zig").plan(policy, .provider, &.{}, self.canvas_font_count, .{ .facts = @intFromBool(self.text_measure_provider != null) }).action;
|
|
895
|
+
return switch (choice) {
|
|
896
|
+
1 => if (self.text_measure_provider) |*provider| provider else unreachable,
|
|
897
|
+
2 => &self.canvas_font_measure_provider,
|
|
898
|
+
else => null,
|
|
899
|
+
};
|
|
900
|
+
}
|
|
849
901
|
if (self.text_measure_provider) |*provider| return provider;
|
|
850
902
|
if (self.canvas_font_count > 0) return &self.canvas_font_measure_provider;
|
|
851
903
|
return null;
|
|
@@ -884,6 +936,29 @@ pub const Runtime = struct {
|
|
|
884
936
|
return self.surface.safe_area_insets;
|
|
885
937
|
}
|
|
886
938
|
|
|
939
|
+
/// Query native chrome live, or consume the recorded OS result on
|
|
940
|
+
/// replay. Missing, extra and differently targeted queries diverge
|
|
941
|
+
/// loudly; replay never consults the current host for this fact.
|
|
942
|
+
pub fn windowChrome(self: *Runtime, window_id: platform.WindowId) !platform.WindowChrome {
|
|
943
|
+
if (self.replay_window_chrome_active) {
|
|
944
|
+
if (self.replay_window_chrome_source == .unavailable) return .{};
|
|
945
|
+
if (self.replay_window_chrome_index == self.replay_window_chrome_count) {
|
|
946
|
+
self.replay_window_chrome_failed = true;
|
|
947
|
+
return error.ReplayChromeDivergence;
|
|
948
|
+
}
|
|
949
|
+
const record = self.replay_window_chrome[self.replay_window_chrome_index];
|
|
950
|
+
if (record.window_id != window_id) {
|
|
951
|
+
self.replay_window_chrome_failed = true;
|
|
952
|
+
return error.ReplayChromeDivergence;
|
|
953
|
+
}
|
|
954
|
+
self.replay_window_chrome_index += 1;
|
|
955
|
+
return record.chrome;
|
|
956
|
+
}
|
|
957
|
+
const chrome = self.options.platform.services.windowChrome(window_id);
|
|
958
|
+
if (self.options.session_recorder) |recorder| recorder.recordWindowChrome(.{ .window_id = window_id, .chrome = chrome });
|
|
959
|
+
return chrome;
|
|
960
|
+
}
|
|
961
|
+
|
|
887
962
|
/// The OS window-control cluster's frame in a canvas view's LOCAL
|
|
888
963
|
/// coordinates (Windows: the DWM min/max/close buttons; macOS: the
|
|
889
964
|
/// traffic lights), from the platform's live chrome report. Zero-sized
|
|
@@ -892,9 +967,9 @@ pub const Runtime = struct {
|
|
|
892
967
|
/// view's window-content frame so a docked canvas judges the overlap
|
|
893
968
|
/// in its own space. This is the geometry `UiApp` consults to keep a
|
|
894
969
|
/// drag header's content out from under the cluster.
|
|
895
|
-
pub fn windowControlsForView(self: *
|
|
970
|
+
pub fn windowControlsForView(self: *Runtime, window_id: platform.WindowId, label: []const u8) !geometry.RectF {
|
|
896
971
|
const zero = geometry.RectF.init(0, 0, 0, 0);
|
|
897
|
-
const buttons = self.
|
|
972
|
+
const buttons = (try self.windowChrome(window_id)).buttons.normalized();
|
|
898
973
|
if (buttons.width <= 0 or buttons.height <= 0) return zero;
|
|
899
974
|
const view_frame = (self.absoluteViewFrame(window_id, label, 0) catch return buttons).normalized();
|
|
900
975
|
return geometry.RectF.init(buttons.x - view_frame.x, buttons.y - view_frame.y, buttons.width, buttons.height);
|
|
@@ -995,7 +1070,11 @@ pub const Runtime = struct {
|
|
|
995
1070
|
|
|
996
1071
|
const CanvasWidgetEventMethods = runtime_canvas_widget_events.RuntimeCanvasWidgetEvents(Runtime);
|
|
997
1072
|
pub const advanceCanvasTooltipIntentForFrame = CanvasWidgetEventMethods.advanceCanvasTooltipIntentForFrame;
|
|
1073
|
+
pub const reconcileCanvasTooltipIntent = CanvasWidgetEventMethods.reconcileCanvasTooltipIntent;
|
|
1074
|
+
pub const captureCanvasTooltipAdoptionBindings = CanvasWidgetEventMethods.captureCanvasTooltipAdoptionBindings;
|
|
1075
|
+
pub const canvasWidgetPressTargetForRoute = CanvasWidgetEventMethods.canvasWidgetPressTargetForRoute;
|
|
998
1076
|
pub const routeCanvasWidgetPointerInput = CanvasWidgetEventMethods.routeCanvasWidgetPointerInput;
|
|
1077
|
+
pub const canvasWidgetKeyboardFocusParticipation = CanvasWidgetEventMethods.canvasWidgetKeyboardFocusParticipation;
|
|
999
1078
|
pub const routeCanvasWidgetKeyboardInput = CanvasWidgetEventMethods.routeCanvasWidgetKeyboardInput;
|
|
1000
1079
|
pub const routeCanvasWidgetTextInput = CanvasWidgetEventMethods.routeCanvasWidgetTextInput;
|
|
1001
1080
|
pub const routeCanvasWidgetFileDrop = CanvasWidgetEventMethods.routeCanvasWidgetFileDrop;
|
|
@@ -1015,9 +1094,10 @@ pub const Runtime = struct {
|
|
|
1015
1094
|
const updateCanvasWidgetControlFromKeyboard = CanvasWidgetEventMethods.updateCanvasWidgetControlFromKeyboard;
|
|
1016
1095
|
const dismissCanvasWidgetSurfaceFromPointerInput = CanvasWidgetEventMethods.dismissCanvasWidgetSurfaceFromPointerInput;
|
|
1017
1096
|
const dismissCanvasWidgetSurfaceFromKeyboardInput = CanvasWidgetEventMethods.dismissCanvasWidgetSurfaceFromKeyboardInput;
|
|
1018
|
-
const
|
|
1019
|
-
const
|
|
1020
|
-
const
|
|
1097
|
+
pub const updateCanvasWidgetClickCountFromPointer = CanvasWidgetEventMethods.updateCanvasWidgetClickCountFromPointer;
|
|
1098
|
+
pub const dispatchCanvasWidgetCommandForId = CanvasWidgetEventMethods.dispatchCanvasWidgetCommandForId;
|
|
1099
|
+
pub const dispatchCanvasWidgetCommandFromPointer = CanvasWidgetEventMethods.dispatchCanvasWidgetCommandFromPointer;
|
|
1100
|
+
pub const dispatchCanvasWidgetCommandFromKeyboard = CanvasWidgetEventMethods.dispatchCanvasWidgetCommandFromKeyboard;
|
|
1021
1101
|
const updateCanvasWidgetFocusFromKeyboardInput = CanvasWidgetEventMethods.updateCanvasWidgetFocusFromKeyboardInput;
|
|
1022
1102
|
const setCanvasWidgetFocusFromKeyboard = CanvasWidgetEventMethods.setCanvasWidgetFocusFromKeyboard;
|
|
1023
1103
|
const invalidateForWidgetInvalidations = CanvasWidgetEventMethods.invalidateForWidgetInvalidations;
|
|
@@ -1029,7 +1109,7 @@ pub const Runtime = struct {
|
|
|
1029
1109
|
const dispatchGpuSurfaceInput = GpuSurfaceEventMethods.dispatchGpuSurfaceInput;
|
|
1030
1110
|
|
|
1031
1111
|
const AutomationWidgetMethods = runtime_automation_widget_dispatch.RuntimeAutomationWidgetDispatch(Runtime);
|
|
1032
|
-
const dispatchAutomationWidgetAction = AutomationWidgetMethods.dispatchAutomationWidgetAction;
|
|
1112
|
+
pub const dispatchAutomationWidgetAction = AutomationWidgetMethods.dispatchAutomationWidgetAction;
|
|
1033
1113
|
const dispatchAutomationWidgetClick = AutomationWidgetMethods.dispatchAutomationWidgetClick;
|
|
1034
1114
|
const dispatchAutomationWidgetHold = AutomationWidgetMethods.dispatchAutomationWidgetHold;
|
|
1035
1115
|
const dispatchAutomationWidgetContextPress = AutomationWidgetMethods.dispatchAutomationWidgetContextPress;
|
|
@@ -1258,6 +1338,90 @@ const testingBuiltinBridgeErrorCode = builtinBridgeErrorCode;
|
|
|
1258
1338
|
const testingBuiltinBridgeErrorMessage = builtinBridgeErrorMessage;
|
|
1259
1339
|
|
|
1260
1340
|
pub const testing = struct {
|
|
1341
|
+
pub const scroll_mutation_methods = @import("view_widget_scroll.zig");
|
|
1342
|
+
pub const scroll_mutation_policy = @import("scroll_mutation_policy.zig");
|
|
1343
|
+
pub const virtual_window_policy = @import("virtual_window_policy.zig");
|
|
1344
|
+
pub const context_menu_policy = @import("context_menu_policy.zig");
|
|
1345
|
+
pub const web_pane_test_cases = @import("web_pane_test_cases.zig");
|
|
1346
|
+
pub const web_pane_policy = @import("web_pane_policy.zig");
|
|
1347
|
+
pub const context_menu_test_cases = @import("canvas_widget_context_menu_test_cases.zig");
|
|
1348
|
+
pub const widget_retention_policy = @import("widget_retention_policy.zig");
|
|
1349
|
+
pub const widget_retention_runtime = runtime_canvas_widget_runtime;
|
|
1350
|
+
pub const widget_retention_view = runtime_view.RuntimeView;
|
|
1351
|
+
pub const markup_development_policy = @import("markup_development_policy.zig");
|
|
1352
|
+
pub const markup_provenance = @import("ui_app_provenance.zig");
|
|
1353
|
+
pub const markup_provenance_reference = @import("ui_app_provenance_reference.zig");
|
|
1354
|
+
pub const host_flow_reference = @import("flow_reference.zig");
|
|
1355
|
+
pub const host_event_pump = @import("host_event_pump.zig");
|
|
1356
|
+
pub const host_event_pump_reference = @import("host_event_pump_reference.zig");
|
|
1357
|
+
pub const journal_policy = @import("journal_policy.zig");
|
|
1358
|
+
pub const blob_policy = @import("blob_policy.zig");
|
|
1359
|
+
pub const blob_reference_store = @import("session_blobs_reference.zig");
|
|
1360
|
+
pub const snapshot_policy = @import("snapshot_policy.zig");
|
|
1361
|
+
pub const frame_profile = runtime_frame_profile;
|
|
1362
|
+
pub const replay_progress_policy = @import("replay_progress_policy.zig");
|
|
1363
|
+
pub const recording_policy = @import("recording_policy.zig");
|
|
1364
|
+
pub const syncHostInputDrivers = runtime_canvas_widget_scroll_drivers.RuntimeCanvasWidgetScrollDrivers(Runtime).syncCanvasWidgetScrollDriversForView;
|
|
1365
|
+
pub const stampHostInputRegions = runtime_canvas_widget_scroll_drivers.RuntimeCanvasWidgetScrollDrivers(Runtime).stampCanvasWidgetNativeScroll;
|
|
1366
|
+
pub const syncHostInputDragRegions = runtime_canvas_widget_events.RuntimeCanvasWidgetEvents(Runtime).syncCanvasWidgetWindowDragRegionsForView;
|
|
1367
|
+
pub const host_input_regions_policy = @import("host_input_regions_policy.zig");
|
|
1368
|
+
pub const view_coordination_policy = @import("view_coordination_policy.zig");
|
|
1369
|
+
pub const view_coordination_methods = @import("window_view_runtime.zig").RuntimeWindowViewRuntime(Runtime);
|
|
1370
|
+
pub const window_lifecycle_policy = @import("window_lifecycle_policy.zig");
|
|
1371
|
+
pub const image_registry_policy = @import("image_registry_policy.zig");
|
|
1372
|
+
pub const font_registry_policy = @import("font_registry_policy.zig");
|
|
1373
|
+
pub const shell_coordination_policy = @import("shell_coordination_policy.zig");
|
|
1374
|
+
pub const shell_admission_policy = @import("shell_admission_policy.zig");
|
|
1375
|
+
pub const system_admission_policy = @import("system_admission_policy.zig");
|
|
1376
|
+
pub const bridge_descriptor_policy = @import("bridge_descriptor_policy.zig");
|
|
1377
|
+
pub const authorization_policy = @import("authorization_policy.zig");
|
|
1378
|
+
pub const automation_commands = @import("automation_commands.zig");
|
|
1379
|
+
pub const automation_command_policy = @import("automation_command_policy.zig");
|
|
1380
|
+
pub const automation_interaction_policy = @import("automation_interaction_policy.zig");
|
|
1381
|
+
pub const builtin_coordination_policy = @import("builtin_coordination_policy.zig");
|
|
1382
|
+
pub const reference_bridge_payload = @import("bridge_payload.zig");
|
|
1383
|
+
pub const reference_descriptor_validation = @import("validation.zig");
|
|
1384
|
+
pub const shell_view_methods = @import("window_views.zig").RuntimeWindowViews(Runtime);
|
|
1385
|
+
pub const window_storage_methods = @import("window_storage.zig").RuntimeWindowStorage(Runtime);
|
|
1386
|
+
pub const referenceWindowDragRegions = @import("canvas_widget_events.zig").collectCanvasWidgetWindowDragRegions;
|
|
1387
|
+
pub const input_composition_policy = @import("input_composition_policy.zig");
|
|
1388
|
+
pub const clearInputCompositionOnBlur = runtime_view.clearImeGraceOnViewBlur;
|
|
1389
|
+
pub const referenceInputPointer = canvas_frame_helpers.canvasWidgetPointerEventFromGpuInput;
|
|
1390
|
+
pub const referenceInputKeyboard = canvas_frame_helpers.canvasWidgetKeyboardEventFromGpuInput;
|
|
1391
|
+
pub const referenceInputText = canvas_frame_helpers.canvasWidgetTextInputEventFromGpuInput;
|
|
1392
|
+
pub const referenceInputEscape = canvas_frame_helpers.canvasWidgetEscapeKey;
|
|
1393
|
+
pub const referenceInputCommandModifier = canvas_frame_helpers.gpuInputHasTextCommandModifier;
|
|
1394
|
+
pub const scene_observation_policy = @import("canvas_scene_observation_policy.zig");
|
|
1395
|
+
pub const presentation_lifecycle_policy = @import("canvas_presentation_lifecycle_policy.zig");
|
|
1396
|
+
pub const referencePresentationFallback = @import("canvas_frame.zig").referencePresentationFallback;
|
|
1397
|
+
pub const compiledPresentationFallback = @import("canvas_frame.zig").compiledPresentationFallback;
|
|
1398
|
+
pub const referenceSceneDirtyProjection = @import("canvas_frame.zig").canvasDirtyRegionForView;
|
|
1399
|
+
pub const referenceSceneBlurExtent = @import("canvas_frame.zig").backdropBlurSampleExtentMultiplier;
|
|
1400
|
+
pub const referenceSceneColor = canvas_frame_helpers.canvasColorToRgba8;
|
|
1401
|
+
pub const referenceFrameBounds = canvas_frame_helpers.canvasFullRepaintBounds;
|
|
1402
|
+
pub const referenceFrameScale = canvas_frame_helpers.normalizedCanvasPresentationScale;
|
|
1403
|
+
pub const referenceFrameBudgetUnset = canvas_frame_helpers.canvasFrameBudgetIsUnset;
|
|
1404
|
+
pub const render_animation_policy = @import("render_animation_policy.zig");
|
|
1405
|
+
pub const motion_sampling_policy = @import("motion_sampling_policy.zig");
|
|
1406
|
+
pub const referenceAnimationScheduleDirtyBounds = @import("canvas_frame.zig").referenceAnimationScheduleDirtyBounds;
|
|
1407
|
+
pub const command_policy = @import("command_policy.zig");
|
|
1408
|
+
pub const status_validation = @import("status_validation.zig");
|
|
1409
|
+
pub const native_validation = @import("validation.zig");
|
|
1410
|
+
pub const command_services = runtime_system_services.RuntimeSystemServices(Runtime);
|
|
1411
|
+
pub const builtin_bridge_methods = @import("builtin_bridge.zig").RuntimeBuiltinBridge(Runtime);
|
|
1412
|
+
pub const accessibility_policy = @import("accessibility_policy.zig");
|
|
1413
|
+
pub const accessibility_publication = runtime_canvas_widget_display.RuntimeCanvasWidgetDisplay(Runtime);
|
|
1414
|
+
pub const DamageCurrentCommand = @import("canvas_frame.zig").DamageCurrentCommand;
|
|
1415
|
+
pub const referenceDamageSnap = @import("canvas_frame.zig").referenceDamageSnap;
|
|
1416
|
+
pub const referenceDamageWiden = @import("canvas_frame.zig").referenceDamageWiden;
|
|
1417
|
+
pub const referenceDamagePatch = @import("canvas_frame.zig").referenceDamagePatch;
|
|
1418
|
+
pub fn mergeCanvasRenderOverrides(scheduled: []const canvas.CanvasRenderOverride, explicit: []const canvas.CanvasRenderOverride, output: []canvas.CanvasRenderOverride) ![]const canvas.CanvasRenderOverride {
|
|
1419
|
+
return canvas_frame_helpers.mergeCanvasRenderOverrides(scheduled, explicit, output);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
pub const nativeShellPlan = shell_layout.referenceShellPlan;
|
|
1423
|
+
pub const compiledShellPlan = shell_layout.compiledShellPlan;
|
|
1424
|
+
pub const encodeShellPlanRequest = shell_layout.encodeShellPlanRequest;
|
|
1261
1425
|
pub fn copyInto(buffer: []u8, value: []const u8) ![]const u8 {
|
|
1262
1426
|
return testingCopyInto(buffer, value);
|
|
1263
1427
|
}
|