@native-sdk/cli 0.5.4 → 0.6.0
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/build/app.zig +50 -1
- package/build.zig +534 -3
- package/build.zig.zon +7 -0
- package/native-sdk.d.ts +3 -1
- package/package.json +9 -9
- package/packages/core/package-lock.json +2 -2
- package/packages/core/package.json +1 -1
- package/packages/core/rt/rt.zig +280 -8
- package/packages/core/sdk/core.ts +481 -2
- package/packages/core/sdk/events.ts +17 -8
- package/packages/core/src/checker.ts +305 -2
- package/packages/core/src/diagnostics.ts +12 -0
- package/packages/core/src/emitter.ts +599 -3
- package/packages/core/src/typed_ast.ts +51 -4
- package/packages/core/src/types.ts +34 -1
- package/skill-data/native-ui/SKILL.md +39 -2
- package/skill-data/ts-core/SKILL.md +4 -2
- package/src/app_runner/root.zig +32 -10
- package/src/automation/layout_fingerprint.zig +160 -0
- package/src/automation/protocol.zig +82 -33
- package/src/automation/root.zig +1 -0
- package/src/automation/server.zig +1 -1
- package/src/automation/snapshot.zig +68 -9
- package/src/automation/watcher.zig +1 -1
- package/src/embed/host.zig +5 -0
- package/src/embed/ui_host.zig +13 -0
- package/src/platform/linux/gtk_host.c +527 -13
- package/src/platform/linux/gtk_host.h +25 -0
- package/src/platform/linux/root.zig +280 -7
- package/src/platform/macos/appkit_host.h +104 -6
- package/src/platform/macos/appkit_host.m +1283 -66
- package/src/platform/macos/cef_host.mm +110 -1
- package/src/platform/macos/root.zig +287 -7
- package/src/platform/null_platform.zig +398 -4
- package/src/platform/null_platform_tests.zig +35 -0
- package/src/platform/root.zig +9 -0
- package/src/platform/types.zig +386 -14
- package/src/platform/windows/root.zig +298 -9
- package/src/platform/windows/webview2_host.cpp +330 -5
- package/src/primitives/app_manifest/validation.zig +18 -0
- package/src/primitives/canvas/a11y_audit.zig +33 -11
- package/src/primitives/canvas/a11y_audit_tests.zig +20 -0
- package/src/primitives/canvas/drawing.zig +25 -0
- package/src/primitives/canvas/equality.zig +8 -0
- package/src/primitives/canvas/events.zig +103 -16
- package/src/primitives/canvas/frame.zig +125 -1
- package/src/primitives/canvas/layout_audit.zig +22 -5
- package/src/primitives/canvas/markdown_hostile_tests.zig +8 -4
- package/src/primitives/canvas/render_tests.zig +13 -10
- package/src/primitives/canvas/root.zig +48 -0
- package/src/primitives/canvas/terminal_box.zig +471 -0
- package/src/primitives/canvas/terminal_grid.zig +978 -0
- package/src/primitives/canvas/terminal_grid_tests.zig +1093 -0
- package/src/primitives/canvas/test_support.zig +1 -0
- package/src/primitives/canvas/tests.zig +1 -0
- package/src/primitives/canvas/text_tests.zig +39 -4
- package/src/primitives/canvas/tokens.zig +115 -12
- package/src/primitives/canvas/ui.zig +524 -5
- package/src/primitives/canvas/ui_markup.zig +195 -2
- package/src/primitives/canvas/ui_markup_compiled.zig +172 -1
- package/src/primitives/canvas/ui_markup_compiled_tests.zig +133 -8
- package/src/primitives/canvas/ui_markup_contract.zig +88 -5
- package/src/primitives/canvas/ui_markup_contract_tests.zig +39 -1
- package/src/primitives/canvas/ui_markup_huge_model_tests.zig +1 -0
- package/src/primitives/canvas/ui_markup_reflect.zig +75 -24
- package/src/primitives/canvas/ui_markup_tests.zig +149 -0
- package/src/primitives/canvas/ui_markup_view.zig +191 -0
- package/src/primitives/canvas/ui_markup_view_tests.zig +403 -19
- package/src/primitives/canvas/ui_schema.zig +97 -17
- package/src/primitives/canvas/ui_schema_tests.zig +18 -11
- package/src/primitives/canvas/ui_tests.zig +141 -9
- package/src/primitives/canvas/widget_access.zig +28 -2
- package/src/primitives/canvas/widget_anchored_tests.zig +48 -0
- package/src/primitives/canvas/widget_invalidation.zig +81 -1
- package/src/primitives/canvas/widget_layout.zig +59 -11
- package/src/primitives/canvas/widget_layout_tests.zig +125 -4
- package/src/primitives/canvas/widget_render.zig +272 -18
- package/src/primitives/canvas/widget_render_scroll.zig +108 -27
- package/src/primitives/canvas/widget_routing.zig +59 -7
- package/src/primitives/canvas/widget_runtime.zig +23 -0
- package/src/primitives/canvas/widget_runtime_tests.zig +149 -0
- package/src/primitives/canvas/widget_semantics.zig +119 -11
- package/src/primitives/canvas/widget_semantics_tests.zig +409 -0
- package/src/primitives/canvas/widget_tree.zig +17 -0
- package/src/primitives/canvas/widgets.zig +132 -0
- package/src/root.zig +16 -0
- package/src/runtime/api.zig +70 -1
- package/src/runtime/automation_commands.zig +20 -1
- package/src/runtime/automation_snapshot.zig +25 -1
- package/src/runtime/automation_widget_dispatch.zig +73 -8
- package/src/runtime/bridge_payload.zig +1 -0
- package/src/runtime/canvas_frame.zig +62 -7
- package/src/runtime/canvas_frame_animation_tests.zig +5 -4
- package/src/runtime/canvas_frame_helpers.zig +190 -1
- package/src/runtime/canvas_frame_invalidation_tests.zig +531 -0
- package/src/runtime/canvas_frame_patch_tests.zig +161 -10
- package/src/runtime/canvas_frame_retained_tests.zig +5 -2
- package/src/runtime/canvas_widget_accessibility_tests.zig +1 -1
- package/src/runtime/canvas_widget_clipboard_tests.zig +40 -0
- package/src/runtime/canvas_widget_context_menu.zig +269 -32
- package/src/runtime/canvas_widget_context_menu_tests.zig +640 -14
- package/src/runtime/canvas_widget_display.zig +1 -1
- package/src/runtime/canvas_widget_event_tests.zig +1823 -0
- package/src/runtime/canvas_widget_events.zig +240 -24
- package/src/runtime/canvas_widget_runtime.zig +213 -29
- package/src/runtime/canvas_widget_scroll_driver_tests.zig +170 -7
- package/src/runtime/canvas_widget_scroll_drivers.zig +151 -17
- package/src/runtime/canvas_widget_scroll_tests.zig +435 -23
- package/src/runtime/canvas_widget_state.zig +6 -0
- package/src/runtime/canvas_widget_text_tests.zig +1 -1
- package/src/runtime/core.zig +73 -2
- package/src/runtime/effects.zig +6389 -54
- package/src/runtime/effects_channel_tests.zig +3519 -0
- package/src/runtime/effects_pty_tests.zig +1362 -0
- package/src/runtime/effects_tests.zig +14 -9
- package/src/runtime/effects_video_tests.zig +3609 -0
- package/src/runtime/flow.zig +25 -4
- package/src/runtime/gpu_surface_events.zig +473 -13
- package/src/runtime/media_surface.zig +116 -11
- package/src/runtime/media_surface_tests.zig +61 -0
- package/src/runtime/pty.zig +1252 -0
- package/src/runtime/pty_windows.zig +1780 -0
- package/src/runtime/root.zig +25 -0
- package/src/runtime/runtime_event_tests.zig +20 -1
- package/src/runtime/session_journal.zig +367 -61
- package/src/runtime/session_record.zig +16 -0
- package/src/runtime/session_replay.zig +395 -11
- package/src/runtime/session_tests.zig +109 -15
- package/src/runtime/terminal_session.zig +1569 -0
- package/src/runtime/terminal_session_tests.zig +450 -0
- package/src/runtime/terminal_vt_ghostty.zig +15 -0
- package/src/runtime/terminal_vt_stub.zig +13 -0
- package/src/runtime/tests.zig +6 -0
- package/src/runtime/ts_core_host.zig +980 -140
- package/src/runtime/ts_core_host_tests.zig +1059 -1
- package/src/runtime/ts_ui_app.zig +16 -5
- package/src/runtime/ui_app.zig +2333 -63
- package/src/runtime/ui_app_tests.zig +3171 -744
- package/src/runtime/ui_app_virtual_variable_tests.zig +4 -2
- package/src/runtime/ui_app_window_tests.zig +268 -0
- package/src/runtime/view.zig +190 -2
- package/src/runtime/view_widget_scroll.zig +218 -68
- package/src/runtime/view_widget_text.zig +11 -2
- package/src/runtime/view_widget_tree.zig +111 -3
- package/src/runtime/window_storage.zig +45 -2
- package/src/runtime/window_view_runtime.zig +34 -2
- package/src/runtime/window_views.zig +1 -0
- package/src/terminal_session_tests_root.zig +15 -0
- package/src/tooling/templates.zig +25 -7
|
@@ -244,6 +244,14 @@ pub fn sizesEqual(a: geometry.SizeF, b: geometry.SizeF) bool {
|
|
|
244
244
|
return a.width == b.width and a.height == b.height;
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
+
pub fn optionalSizesEqual(a: ?geometry.SizeF, b: ?geometry.SizeF) bool {
|
|
248
|
+
if (a) |left| {
|
|
249
|
+
if (b) |right| return sizesEqual(left, right);
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
return b == null;
|
|
253
|
+
}
|
|
254
|
+
|
|
247
255
|
pub fn insetsEqual(a: geometry.InsetsF, b: geometry.InsetsF) bool {
|
|
248
256
|
return a.top == b.top and
|
|
249
257
|
a.right == b.right and
|
|
@@ -56,6 +56,17 @@ pub const WidgetPointerEvent = struct {
|
|
|
56
56
|
/// press that started the gesture, which is how a double-click
|
|
57
57
|
/// drag knows to extend by words.
|
|
58
58
|
click_count: u8 = 1,
|
|
59
|
+
/// The host's pointer identity (`GpuSurfaceInputEvent.pointer_id`),
|
|
60
|
+
/// forwarded so per-pointer state can tell devices apart on hosts
|
|
61
|
+
/// that distinguish them: the hover-Msg containment gate scopes its
|
|
62
|
+
/// hover-capable-pointer proof to this id, so a touch contact can
|
|
63
|
+
/// never ride a mouse's proof. Desktop hosts with one pointer leave
|
|
64
|
+
/// it 0.
|
|
65
|
+
pointer_id: u64 = 0,
|
|
66
|
+
/// Platform button number for down/up events (0 = primary). Motion
|
|
67
|
+
/// may leave this at 0; gesture owners use the initiating down to
|
|
68
|
+
/// decide whether to capture.
|
|
69
|
+
button: i32 = 0,
|
|
59
70
|
};
|
|
60
71
|
|
|
61
72
|
pub const WidgetKeyboardPhase = enum {
|
|
@@ -254,7 +265,12 @@ pub const WidgetControlIntent = struct {
|
|
|
254
265
|
kind: WidgetControlIntentKind,
|
|
255
266
|
actions: WidgetActions = .{},
|
|
256
267
|
value: ?f32 = null,
|
|
257
|
-
|
|
268
|
+
/// Scroll step for `scroll_by` intents, in canvas points on each
|
|
269
|
+
/// axis. Keyboard and semantic scroll steps set exactly one axis;
|
|
270
|
+
/// which one follows the widget's scroll-axes grant (vertical
|
|
271
|
+
/// keymap on vertical-capable regions, horizontal on
|
|
272
|
+
/// horizontal-only ones).
|
|
273
|
+
delta: geometry.OffsetF = .{},
|
|
258
274
|
};
|
|
259
275
|
|
|
260
276
|
pub const WidgetSemanticAction = enum {
|
|
@@ -657,29 +673,68 @@ pub fn widgetScrollKeyboardIntent(widget: Widget, keyboard: WidgetKeyboardEvent)
|
|
|
657
673
|
if (std.ascii.eqlIgnoreCase(keyboard.key, "home")) return .{ .kind = .scroll_to_start, .actions = .{ .decrement = true } };
|
|
658
674
|
if (std.ascii.eqlIgnoreCase(keyboard.key, "end")) return .{ .kind = .scroll_to_end, .actions = .{ .increment = true } };
|
|
659
675
|
const delta = widgetScrollKeyboardDelta(widget, keyboard) orelse return null;
|
|
676
|
+
const step = if (delta.dy != 0) delta.dy else delta.dx;
|
|
660
677
|
return .{
|
|
661
678
|
.kind = .scroll_by,
|
|
662
679
|
.actions = .{
|
|
663
|
-
.increment =
|
|
664
|
-
.decrement =
|
|
680
|
+
.increment = step > 0,
|
|
681
|
+
.decrement = step < 0,
|
|
665
682
|
},
|
|
666
683
|
.delta = delta,
|
|
667
684
|
};
|
|
668
685
|
}
|
|
669
686
|
|
|
670
|
-
|
|
687
|
+
/// True when a scroll-intent widget takes the HORIZONTAL keymap: a
|
|
688
|
+
/// horizontal-only `.scroll_view`. Vertical-capable regions (including
|
|
689
|
+
/// `both`, whose left/right arrows step sideways below) and every other
|
|
690
|
+
/// scrollable kind keep the vertical keymap they always had.
|
|
691
|
+
fn widgetScrollKeymapHorizontalOnly(widget: Widget) bool {
|
|
692
|
+
return widget.kind == .scroll_view and !widget.layout.virtualized and widget.scroll_axes == .horizontal;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/// The keyboard scroll step, axis-aware:
|
|
696
|
+
/// - vertical regions keep the exact legacy map (both arrow pairs step
|
|
697
|
+
/// the vertical axis — Left/Up a line up, Right/Down a line down —
|
|
698
|
+
/// and PageUp/PageDown page it);
|
|
699
|
+
/// - a horizontal-only region mirrors that whole map onto its one axis,
|
|
700
|
+
/// with line/page steps measured from the viewport WIDTH;
|
|
701
|
+
/// - a `both` region keeps the vertical map and gives Left/Right to the
|
|
702
|
+
/// horizontal axis — the two-axis convention native scroll views use.
|
|
703
|
+
pub fn widgetScrollKeyboardDelta(widget: Widget, keyboard: WidgetKeyboardEvent) ?geometry.OffsetF {
|
|
671
704
|
if (keyboard.phase != .key_down or keyboard.modifiers.hasNavigationModifier()) return null;
|
|
672
705
|
const viewport = widget.frame.inset(widget.layout.padding).normalized();
|
|
706
|
+
if (widgetScrollKeymapHorizontalOnly(widget)) {
|
|
707
|
+
const line_step = @max(24, viewport.width * 0.35);
|
|
708
|
+
const page_step = @max(line_step, viewport.width * 0.85);
|
|
709
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "arrowleft") or std.ascii.eqlIgnoreCase(keyboard.key, "arrowup")) {
|
|
710
|
+
return geometry.OffsetF.init(-line_step, 0);
|
|
711
|
+
}
|
|
712
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "arrowright") or std.ascii.eqlIgnoreCase(keyboard.key, "arrowdown")) {
|
|
713
|
+
return geometry.OffsetF.init(line_step, 0);
|
|
714
|
+
}
|
|
715
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "pageup")) return geometry.OffsetF.init(-page_step, 0);
|
|
716
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "pagedown")) return geometry.OffsetF.init(page_step, 0);
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
719
|
+
const dual = widget.kind == .scroll_view and !widget.layout.virtualized and widget.scroll_axes == .both;
|
|
673
720
|
const line_step = @max(24, viewport.height * 0.35);
|
|
674
721
|
const page_step = @max(line_step, viewport.height * 0.85);
|
|
675
|
-
if (
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
return line_step;
|
|
722
|
+
if (dual) {
|
|
723
|
+
const line_step_x = @max(24, viewport.width * 0.35);
|
|
724
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "arrowleft")) return geometry.OffsetF.init(-line_step_x, 0);
|
|
725
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "arrowright")) return geometry.OffsetF.init(line_step_x, 0);
|
|
726
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "arrowup")) return geometry.OffsetF.init(0, -line_step);
|
|
727
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "arrowdown")) return geometry.OffsetF.init(0, line_step);
|
|
728
|
+
} else {
|
|
729
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "arrowleft") or std.ascii.eqlIgnoreCase(keyboard.key, "arrowup")) {
|
|
730
|
+
return geometry.OffsetF.init(0, -line_step);
|
|
731
|
+
}
|
|
732
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "arrowright") or std.ascii.eqlIgnoreCase(keyboard.key, "arrowdown")) {
|
|
733
|
+
return geometry.OffsetF.init(0, line_step);
|
|
734
|
+
}
|
|
680
735
|
}
|
|
681
|
-
if (std.ascii.eqlIgnoreCase(keyboard.key, "pageup")) return -page_step;
|
|
682
|
-
if (std.ascii.eqlIgnoreCase(keyboard.key, "pagedown")) return page_step;
|
|
736
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "pageup")) return geometry.OffsetF.init(0, -page_step);
|
|
737
|
+
if (std.ascii.eqlIgnoreCase(keyboard.key, "pagedown")) return geometry.OffsetF.init(0, page_step);
|
|
683
738
|
return null;
|
|
684
739
|
}
|
|
685
740
|
|
|
@@ -712,11 +767,43 @@ fn widgetSemanticStepControlIntent(widget: Widget, direction: WidgetSemanticStep
|
|
|
712
767
|
};
|
|
713
768
|
}
|
|
714
769
|
|
|
715
|
-
|
|
770
|
+
/// Assistive scroll steps page ONE axis — the region's primary, by the
|
|
771
|
+
/// same range-aware rule its scroll semantics report through: vertical
|
|
772
|
+
/// wherever the vertical axis is granted and can move, the horizontal
|
|
773
|
+
/// axis on horizontal-only regions and on `both` regions whose content
|
|
774
|
+
/// only overflows sideways. A diagonal step would move the viewport on
|
|
775
|
+
/// an axis the assistive node never exposed. Range for the `both` case
|
|
776
|
+
/// reads the widget's own children (widget-walk trees carry them);
|
|
777
|
+
/// retained layout nodes drop children, and their caller — the
|
|
778
|
+
/// runtime's accessibility-action path — resolves the axis with live
|
|
779
|
+
/// extents instead (`canvasWidgetStepKey`).
|
|
780
|
+
fn widgetSemanticScrollDelta(widget: Widget, direction: WidgetSemanticStepDirection) geometry.OffsetF {
|
|
716
781
|
const viewport = widget.frame.inset(widget.layout.padding).normalized();
|
|
717
|
-
const
|
|
718
|
-
const
|
|
719
|
-
|
|
782
|
+
const sign: f32 = if (direction == .increment) 1 else -1;
|
|
783
|
+
const horizontal_primary = widgetScrollKeymapHorizontalOnly(widget) or
|
|
784
|
+
(widget.kind == .scroll_view and !widget.layout.virtualized and widget.scroll_axes == .both and
|
|
785
|
+
widgetChildrenScrollHorizontalOnly(widget, viewport));
|
|
786
|
+
if (horizontal_primary) {
|
|
787
|
+
const page_step_x = @max(@max(24, viewport.width * 0.35), viewport.width * 0.85);
|
|
788
|
+
return geometry.OffsetF.init(sign * page_step_x, 0);
|
|
789
|
+
}
|
|
790
|
+
const page_step_y = @max(@max(24, viewport.height * 0.35), viewport.height * 0.85);
|
|
791
|
+
return geometry.OffsetF.init(0, sign * page_step_y);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/// Whether a `both` region's mounted children overflow ONLY sideways:
|
|
795
|
+
/// no vertical range (nothing reaches past the fold) while something
|
|
796
|
+
/// reaches past the right edge. False on childless nodes — retained
|
|
797
|
+
/// trees drop children, and their callers resolve range elsewhere.
|
|
798
|
+
fn widgetChildrenScrollHorizontalOnly(widget: Widget, viewport: geometry.RectF) bool {
|
|
799
|
+
if (widget.children.len == 0) return false;
|
|
800
|
+
var right = viewport.maxX();
|
|
801
|
+
var bottom = viewport.maxY();
|
|
802
|
+
for (widget.children) |child| {
|
|
803
|
+
right = @max(right, child.frame.maxX() + widget.value_x);
|
|
804
|
+
bottom = @max(bottom, child.frame.maxY() + widget.value);
|
|
805
|
+
}
|
|
806
|
+
return bottom <= viewport.maxY() and right > viewport.maxX();
|
|
720
807
|
}
|
|
721
808
|
|
|
722
809
|
pub fn semanticActions(widget: Widget) WidgetActions {
|
|
@@ -792,7 +879,7 @@ pub fn defaultFocusable(widget: Widget) bool {
|
|
|
792
879
|
// part of the tree's roving keyboard focus set.
|
|
793
880
|
if (widget.semantics.role == .treeitem) return !widget.state.disabled;
|
|
794
881
|
return switch (widget.kind) {
|
|
795
|
-
.scroll_view, .accordion, .button, .toggle_button, .icon_button, .select, .input, .text_field, .search_field, .combobox, .textarea, .menu_item, .list_item, .data_cell, .segmented_control, .checkbox, .radio, .switch_control, .toggle, .slider, .split_divider => !widget.state.disabled,
|
|
882
|
+
.scroll_view, .accordion, .button, .toggle_button, .icon_button, .select, .input, .text_field, .search_field, .combobox, .textarea, .menu_item, .list_item, .data_cell, .segmented_control, .checkbox, .radio, .switch_control, .toggle, .slider, .split_divider, .terminal => !widget.state.disabled,
|
|
796
883
|
else => false,
|
|
797
884
|
};
|
|
798
885
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const std = @import("std");
|
|
1
2
|
const geometry = @import("geometry");
|
|
2
3
|
const canvas = @import("root.zig");
|
|
3
4
|
const render_model = @import("render.zig");
|
|
@@ -606,7 +607,14 @@ pub fn buildCanvasFrame(previous: ?DisplayList, next: DisplayList, options: Canv
|
|
|
606
607
|
dirty_bounds = fullRepaintBounds(options.surface_size, render_plan.bounds);
|
|
607
608
|
} else {
|
|
608
609
|
changes = try DisplayList.diff(previous.?, next, storage.changes);
|
|
609
|
-
|
|
610
|
+
// Incremental damage carries a one-device-pixel AA bleed
|
|
611
|
+
// allowance and lands snapped outward on the device-pixel grid
|
|
612
|
+
// (see the runtime planner's dirty finalization): the bleed
|
|
613
|
+
// covers the up-to-a-device-pixel ink past a command's bounds,
|
|
614
|
+
// and the snap keeps the cull region identical to the cleared
|
|
615
|
+
// pixels so a fractional dirty edge cannot erase an unchanged
|
|
616
|
+
// neighbor's boundary-pixel coverage without redrawing it.
|
|
617
|
+
dirty_bounds = bleedAlignedDirtyBounds(unionOptionalBounds(dirtyBoundsFromChanges(changes), render_override_dirty_bounds), options.scale, 1, options.surface_size);
|
|
610
618
|
}
|
|
611
619
|
|
|
612
620
|
return .{
|
|
@@ -649,6 +657,122 @@ fn dirtyBoundsFromChanges(changes: []const DiffChange) ?geometry.RectF {
|
|
|
649
657
|
return result;
|
|
650
658
|
}
|
|
651
659
|
|
|
660
|
+
/// Bleed-and-snap for incremental damage, the twin of the runtime's
|
|
661
|
+
/// `bleedAlignedCanvasDirtyBounds` (see that doc comment): whole device
|
|
662
|
+
/// pixels of AA bleed folded in on integer device boundaries, edges
|
|
663
|
+
/// chosen so the STORED rect's f32 round trip lands exactly on them.
|
|
664
|
+
fn bleedAlignedDirtyBounds(bounds: ?geometry.RectF, scale: f32, bleed_pixels: f32, surface_size: geometry.SizeF) ?geometry.RectF {
|
|
665
|
+
const dirty = bounds orelse return null;
|
|
666
|
+
const normalized = dirty.normalized();
|
|
667
|
+
const device = if (std.math.isFinite(scale) and scale > 0) scale else 1;
|
|
668
|
+
// Surface clipping happens on the integer device boundaries, never
|
|
669
|
+
// on the finished rect (see the runtime twin's doc comment).
|
|
670
|
+
const x_boundaries = surfaceClampedDirtyBoundaries(
|
|
671
|
+
@floor(normalized.minX() * device) - bleed_pixels,
|
|
672
|
+
@ceil(normalized.maxX() * device) + bleed_pixels,
|
|
673
|
+
surface_size.width,
|
|
674
|
+
device,
|
|
675
|
+
) orelse return null;
|
|
676
|
+
const y_boundaries = surfaceClampedDirtyBoundaries(
|
|
677
|
+
@floor(normalized.minY() * device) - bleed_pixels,
|
|
678
|
+
@ceil(normalized.maxY() * device) + bleed_pixels,
|
|
679
|
+
surface_size.height,
|
|
680
|
+
device,
|
|
681
|
+
) orelse return null;
|
|
682
|
+
const x_edges = dirtyAxisEdges(x_boundaries.min, x_boundaries.max, device);
|
|
683
|
+
const y_edges = dirtyAxisEdges(y_boundaries.min, y_boundaries.max, device);
|
|
684
|
+
if (x_edges.span <= 0 or y_edges.span <= 0) return null;
|
|
685
|
+
return geometry.RectF.init(x_edges.min, y_edges.min, x_edges.span, y_edges.span);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const DirtyBoundaries = struct { min: f32, max: f32 };
|
|
689
|
+
|
|
690
|
+
/// Clamp one axis' device boundaries to the surface's device
|
|
691
|
+
/// boundaries (see the runtime twin's doc comment).
|
|
692
|
+
fn surfaceClampedDirtyBoundaries(min_boundary: f32, max_boundary: f32, surface_extent: f32, device: f32) ?DirtyBoundaries {
|
|
693
|
+
var min_b = min_boundary;
|
|
694
|
+
var max_b = max_boundary;
|
|
695
|
+
if (std.math.isFinite(surface_extent) and surface_extent > 0) {
|
|
696
|
+
const surface_boundary = @ceil(surface_extent * device);
|
|
697
|
+
if (std.math.isFinite(surface_boundary)) {
|
|
698
|
+
min_b = std.math.clamp(min_b, 0, surface_boundary);
|
|
699
|
+
max_b = std.math.clamp(max_b, 0, surface_boundary);
|
|
700
|
+
if (!(max_b > min_b)) return null;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
return .{ .min = min_b, .max = max_b };
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
const DirtyAxisEdges = struct { min: f32, span: f32 };
|
|
707
|
+
|
|
708
|
+
/// One axis of the bleed-aligned damage (see the runtime twin's doc
|
|
709
|
+
/// comment): exact edge walks inside f32's exact-integer range, a
|
|
710
|
+
/// finite non-collapsed superset beyond it.
|
|
711
|
+
fn dirtyAxisEdges(min_boundary: f32, max_boundary: f32, device: f32) DirtyAxisEdges {
|
|
712
|
+
const walk_limit: f32 = 16_777_216;
|
|
713
|
+
const walkable = min_boundary >= -walk_limit and min_boundary <= walk_limit and
|
|
714
|
+
max_boundary >= -walk_limit and max_boundary <= walk_limit;
|
|
715
|
+
if (!walkable) {
|
|
716
|
+
const min_edge = nudgedFiniteDirtyEdge(min_boundary / device, -2);
|
|
717
|
+
const max_edge = nudgedFiniteDirtyEdge(max_boundary / device, 2);
|
|
718
|
+
var span = @max(0, nudgedFiniteDirtyEdge(max_edge - min_edge, 2));
|
|
719
|
+
// The reconstructed max edge must stay finite at the f32 range
|
|
720
|
+
// edge; shave the span until the sum stops overflowing.
|
|
721
|
+
while (span > 0 and !std.math.isFinite(min_edge + span)) span = std.math.nextAfter(f32, span, -std.math.inf(f32));
|
|
722
|
+
return .{ .min = min_edge, .span = span };
|
|
723
|
+
}
|
|
724
|
+
const min_edge = dirtyEdgeForFloorBoundary(min_boundary, device);
|
|
725
|
+
return .{ .min = min_edge, .span = dirtySpanForCeilBoundary(min_edge, max_boundary, device) };
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/// Finite superset value (see the runtime twin's doc comment): only
|
|
729
|
+
/// NaN and the infinities are replaced, so far-but-representable
|
|
730
|
+
/// content keeps its damage in place.
|
|
731
|
+
fn nudgedFiniteDirtyEdge(value: f32, ulps: i8) f32 {
|
|
732
|
+
if (std.math.isNan(value)) return 0;
|
|
733
|
+
const limit = std.math.floatMax(f32);
|
|
734
|
+
var result = std.math.clamp(value, -limit, limit);
|
|
735
|
+
var remaining: i8 = if (ulps < 0) -ulps else ulps;
|
|
736
|
+
const toward: f32 = if (ulps < 0) -std.math.inf(f32) else std.math.inf(f32);
|
|
737
|
+
while (remaining > 0) : (remaining -= 1) result = std.math.nextAfter(f32, result, toward);
|
|
738
|
+
return std.math.clamp(result, -limit, limit);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
/// Smallest representable coordinate whose product with `device`
|
|
742
|
+
/// reaches `boundary`, judged in f64 — exact for f32 operands and what
|
|
743
|
+
/// retained hosts compute (see the runtime twin's doc comment).
|
|
744
|
+
fn dirtyEdgeForFloorBoundary(boundary: f32, device: f32) f32 {
|
|
745
|
+
const b: f64 = boundary;
|
|
746
|
+
const d: f64 = device;
|
|
747
|
+
var edge = boundary / device;
|
|
748
|
+
while (@as(f64, edge) * d >= b) edge = std.math.nextAfter(f32, edge, -std.math.inf(f32));
|
|
749
|
+
while (@as(f64, edge) * d < b) edge = std.math.nextAfter(f32, edge, std.math.inf(f32));
|
|
750
|
+
// The walk can settle on negative zero (a boundary of zero steps
|
|
751
|
+
// below and back); canonicalize so serialized rects never carry a
|
|
752
|
+
// signed zero.
|
|
753
|
+
return if (edge == 0) 0 else edge;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/// Largest span whose reconstructed max edge (`min_edge + span`) keeps
|
|
757
|
+
/// its product with `device` at or under `boundary`, judged in f64 (see
|
|
758
|
+
/// the runtime twin's doc comment); the walk steps the edge value,
|
|
759
|
+
/// never the span.
|
|
760
|
+
fn dirtySpanForCeilBoundary(min_edge: f32, boundary: f32, device: f32) f32 {
|
|
761
|
+
const b: f64 = boundary;
|
|
762
|
+
const d: f64 = device;
|
|
763
|
+
var target = boundary / device;
|
|
764
|
+
while (@as(f64, target) * d <= b) target = std.math.nextAfter(f32, target, std.math.inf(f32));
|
|
765
|
+
while (@as(f64, target) * d > b) target = std.math.nextAfter(f32, target, -std.math.inf(f32));
|
|
766
|
+
if (target <= min_edge) return 0;
|
|
767
|
+
var span = target - min_edge;
|
|
768
|
+
while (span > 0 and @as(f64, min_edge) + @as(f64, span) > @as(f64, target)) {
|
|
769
|
+
const next = std.math.nextAfter(f32, span, -std.math.inf(f32));
|
|
770
|
+
if (next == span) return 0;
|
|
771
|
+
span = next;
|
|
772
|
+
}
|
|
773
|
+
return if (span <= 0) 0 else span;
|
|
774
|
+
}
|
|
775
|
+
|
|
652
776
|
fn fullRepaintBounds(surface_size: geometry.SizeF, render_bounds: ?geometry.RectF) ?geometry.RectF {
|
|
653
777
|
if (surfaceRect(surface_size)) |surface| return surface;
|
|
654
778
|
return render_bounds;
|
|
@@ -395,9 +395,17 @@ fn widgetClipsForAudit(widget: Widget) bool {
|
|
|
395
395
|
}
|
|
396
396
|
|
|
397
397
|
/// Whether the clip scope scrolls vertically by design, making vertical
|
|
398
|
-
/// overhang the normal operating mode rather than damage.
|
|
398
|
+
/// overhang the normal operating mode rather than damage. A
|
|
399
|
+
/// horizontal-only scroll view does NOT scroll vertically: content
|
|
400
|
+
/// escaping it downward is damage nothing can reveal.
|
|
399
401
|
fn scopeScrollsVertically(widget: Widget) bool {
|
|
400
|
-
return widget.kind == .scroll_view or widget.layout.virtualized;
|
|
402
|
+
return (widget.kind == .scroll_view and widget.scroll_axes.scrollsVertically()) or widget.layout.virtualized;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/// The horizontal twin: a scroll viewport granting the horizontal axis
|
|
406
|
+
/// makes horizontal overhang the operating mode, not damage.
|
|
407
|
+
fn scopeScrollsHorizontally(widget: Widget) bool {
|
|
408
|
+
return widget.kind == .scroll_view and widget.scroll_axes.scrollsHorizontally() and !widget.layout.virtualized;
|
|
401
409
|
}
|
|
402
410
|
|
|
403
411
|
/// Nearest ancestor whose clip bounds this node: the first clipping
|
|
@@ -428,6 +436,7 @@ fn auditNodeContainerEscape(
|
|
|
428
436
|
const scope_index = clipScopeIndex(layout, node_index);
|
|
429
437
|
const scope = if (scope_index) |index| layout.nodes[index].frame.normalized() else window.normalized();
|
|
430
438
|
const vertical_checked = if (scope_index) |index| !scopeScrollsVertically(layout.nodes[index].widget) else true;
|
|
439
|
+
const horizontal_checked = if (scope_index) |index| !scopeScrollsHorizontally(layout.nodes[index].widget) else true;
|
|
431
440
|
|
|
432
441
|
// Attribute the escape to the outermost offender: if any ancestor
|
|
433
442
|
// inside the same scope is already reported, this node's overhang is
|
|
@@ -441,8 +450,16 @@ fn auditNodeContainerEscape(
|
|
|
441
450
|
|
|
442
451
|
const frame = node.frame.normalized();
|
|
443
452
|
var overrun_x: f32 = 0;
|
|
444
|
-
|
|
445
|
-
|
|
453
|
+
if (horizontal_checked) {
|
|
454
|
+
overrun_x = @max(overrun_x, overrunPast(frame.maxX(), scope.maxX()));
|
|
455
|
+
overrun_x = @max(overrun_x, overrunPast(scope.x, frame.x));
|
|
456
|
+
} else if (scope_index) |index| {
|
|
457
|
+
// A horizontal scroll scope forgives trailing overhang (the
|
|
458
|
+
// scroll reveals it) but not content stranded BEFORE the
|
|
459
|
+
// origin: offsets clamp at zero, so anything the region's own
|
|
460
|
+
// offset cannot explain on the leading side is damage.
|
|
461
|
+
overrun_x = @max(overrun_x, overrunPast(scope.x, frame.x + layout.nodes[index].widget.value_x));
|
|
462
|
+
}
|
|
446
463
|
var overrun_y: f32 = 0;
|
|
447
464
|
if (vertical_checked) {
|
|
448
465
|
overrun_y = @max(overrun_y, overrunPast(frame.maxY(), scope.maxY()));
|
|
@@ -469,7 +486,7 @@ fn auditNodeContainerEscape(
|
|
|
469
486
|
/// inline link hotspots follow text metrics by convention; both exempt.
|
|
470
487
|
fn widgetKindIsPointerTarget(kind: WidgetKind) bool {
|
|
471
488
|
return switch (kind) {
|
|
472
|
-
.button, .toggle_button, .icon_button, .select, .combobox, .input, .text_field, .search_field, .textarea, .checkbox, .radio, .switch_control, .toggle, .slider, .menu_item, .segmented_control, .list_item => true,
|
|
489
|
+
.button, .toggle_button, .icon_button, .select, .combobox, .input, .text_field, .search_field, .textarea, .checkbox, .radio, .switch_control, .toggle, .slider, .menu_item, .segmented_control, .list_item, .terminal => true,
|
|
473
490
|
else => false,
|
|
474
491
|
};
|
|
475
492
|
}
|
|
@@ -41,11 +41,15 @@ const Ui = Md.Ui;
|
|
|
41
41
|
/// node buffer (64 nodes x a multi-KiB `Ui.Node`), and one table costs a
|
|
42
42
|
/// 64-row buffer (~315 KiB measured), so container-dense documents run
|
|
43
43
|
/// ~180x their source bytes (measured: 100-deep nesting 15 KiB -> 2.7 MiB).
|
|
44
|
-
///
|
|
45
|
-
///
|
|
46
|
-
///
|
|
44
|
+
/// The factor scales with `Ui.Node` itself — every handler field added to
|
|
45
|
+
/// `ElementOptions` (the hover pair moved the densest corpus doc from
|
|
46
|
+
/// ~1.45 MiB to ~1.54 MiB at 3.9 KiB source) grows those eager buffers
|
|
47
|
+
/// linearly, so the factor carries headroom over the measured densest
|
|
48
|
+
/// shape. 320x + a one-table floor keeps the assert green for every
|
|
49
|
+
/// legitimate shape while a quadratic join (megabytes-per-source-KiB)
|
|
50
|
+
/// still blows through it by orders of magnitude.
|
|
47
51
|
fn arenaBound(source_len: usize) usize {
|
|
48
|
-
return source_len *
|
|
52
|
+
return source_len * 320 + 512 * 1024;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
const BuildResult = struct {
|
|
@@ -2847,14 +2847,16 @@ test "canvas frame plan clips incremental dirty bounds to surface" {
|
|
|
2847
2847
|
try std.testing.expectEqual(@as(usize, 1), frame.changes.len);
|
|
2848
2848
|
try std.testing.expectEqual(DiffKind.changed, frame.changes[0].kind);
|
|
2849
2849
|
try std.testing.expectEqual(@as(?ObjectId, 1), frame.changes[0].id);
|
|
2850
|
-
|
|
2850
|
+
// Changed extents' union, inflated by the one-device-pixel AA
|
|
2851
|
+
// bleed and clipped to the 50x50 surface.
|
|
2852
|
+
try expectRect(geometry.RectF.init(0, 0, 50, 41), frame.dirty_bounds);
|
|
2851
2853
|
|
|
2852
2854
|
const render_pass = frame.renderPass();
|
|
2853
2855
|
try std.testing.expect(render_pass.requiresRender());
|
|
2854
2856
|
try std.testing.expectEqual(CanvasRenderPassLoadAction.load, render_pass.loadAction());
|
|
2855
2857
|
try std.testing.expectEqual(@as(usize, 2), render_pass.commandCount());
|
|
2856
2858
|
try std.testing.expectEqual(@as(usize, 1), render_pass.batchCount());
|
|
2857
|
-
try expectRect(geometry.RectF.init(0, 0, 50,
|
|
2859
|
+
try expectRect(geometry.RectF.init(0, 0, 50, 41), render_pass.scissorBounds());
|
|
2858
2860
|
|
|
2859
2861
|
var gpu_commands: [2]CanvasGpuCommand = undefined;
|
|
2860
2862
|
const packet = try frame.gpuPacket(&gpu_commands);
|
|
@@ -2867,27 +2869,27 @@ test "canvas frame plan clips incremental dirty bounds to surface" {
|
|
|
2867
2869
|
try std.testing.expectEqual(packet.commandCount(), packet_summary.command_count);
|
|
2868
2870
|
try std.testing.expectEqual(packet.cachedResourceCommandCount(), packet_summary.cached_resource_command_count);
|
|
2869
2871
|
try std.testing.expectEqual(packet.unsupported_command_count, packet_summary.unsupported_command_count);
|
|
2870
|
-
try expectRect(geometry.RectF.init(0, 0, 50,
|
|
2872
|
+
try expectRect(geometry.RectF.init(0, 0, 50, 41), packet.scissor.?);
|
|
2871
2873
|
var packet_json_buffer: [2048]u8 = undefined;
|
|
2872
2874
|
var packet_json_writer = std.Io.Writer.fixed(&packet_json_buffer);
|
|
2873
2875
|
try packet.writeJson(&packet_json_writer);
|
|
2874
2876
|
const packet_json = packet_json_writer.buffered();
|
|
2875
2877
|
try std.testing.expect(std.mem.indexOf(u8, packet_json, "\"loadAction\":\"load\"") != null);
|
|
2876
|
-
try std.testing.expect(std.mem.indexOf(u8, packet_json, "\"scissorBounds\":[0,0,50,
|
|
2878
|
+
try std.testing.expect(std.mem.indexOf(u8, packet_json, "\"scissorBounds\":[0,0,50,41]") != null);
|
|
2877
2879
|
|
|
2878
2880
|
const profile = frame.profile();
|
|
2879
2881
|
try std.testing.expect(profile.requires_render);
|
|
2880
2882
|
try std.testing.expect(!profile.full_repaint);
|
|
2881
2883
|
try std.testing.expectEqual(@as(f32, 2500), profile.surface_area);
|
|
2882
|
-
try std.testing.expectEqual(@as(f32,
|
|
2883
|
-
try std.testing.expectEqual(@as(f32, 0.
|
|
2884
|
+
try std.testing.expectEqual(@as(f32, 2050), profile.dirty_area);
|
|
2885
|
+
try std.testing.expectEqual(@as(f32, 2050.0 / 2500.0), profile.dirty_ratio);
|
|
2884
2886
|
try std.testing.expectEqual(CanvasFrameProfileRisk.high, profile.risk);
|
|
2885
2887
|
|
|
2886
2888
|
var profile_json_buffer: [1024]u8 = undefined;
|
|
2887
2889
|
var profile_json_writer = std.Io.Writer.fixed(&profile_json_buffer);
|
|
2888
2890
|
try frame.writeProfileJson(&profile_json_writer);
|
|
2889
2891
|
const profile_json = profile_json_writer.buffered();
|
|
2890
|
-
try std.testing.expect(std.mem.indexOf(u8, profile_json, "\"dirtyArea\":
|
|
2892
|
+
try std.testing.expect(std.mem.indexOf(u8, profile_json, "\"dirtyArea\":2050") != null);
|
|
2891
2893
|
try std.testing.expect(std.mem.indexOf(u8, profile_json, "\"risk\":\"high\"") != null);
|
|
2892
2894
|
}
|
|
2893
2895
|
|
|
@@ -2969,7 +2971,8 @@ test "canvas frame plan applies render overrides without display list changes" {
|
|
|
2969
2971
|
try std.testing.expect(!frame.full_repaint);
|
|
2970
2972
|
try std.testing.expect(frame.requiresRender());
|
|
2971
2973
|
try std.testing.expectEqual(@as(usize, 0), frame.changes.len);
|
|
2972
|
-
|
|
2974
|
+
// Override extents' union, inflated by the AA bleed and clipped.
|
|
2975
|
+
try expectRect(geometry.RectF.init(0, 0, 21, 11), frame.dirty_bounds);
|
|
2973
2976
|
try std.testing.expectEqual(@as(usize, 1), frame.render_plan.commandCount());
|
|
2974
2977
|
try std.testing.expectEqual(@as(f32, 0.5), frame.render_plan.commands[0].opacity);
|
|
2975
2978
|
try std.testing.expectEqualDeep(Affine.translate(10, 0), frame.render_plan.commands[0].transform);
|
|
@@ -2977,7 +2980,7 @@ test "canvas frame plan applies render overrides without display list changes" {
|
|
|
2977
2980
|
|
|
2978
2981
|
const render_pass = frame.renderPass();
|
|
2979
2982
|
try std.testing.expectEqual(CanvasRenderPassLoadAction.load, render_pass.loadAction());
|
|
2980
|
-
try expectRect(geometry.RectF.init(0, 0,
|
|
2983
|
+
try expectRect(geometry.RectF.init(0, 0, 21, 11), render_pass.scissorBounds());
|
|
2981
2984
|
|
|
2982
2985
|
var pixels: [40 * 20 * 4]u8 = undefined;
|
|
2983
2986
|
const surface = try ReferenceRenderSurface.init(40, 20, &pixels);
|
|
@@ -3053,7 +3056,7 @@ test "canvas render animations sample overrides for frame planning" {
|
|
|
3053
3056
|
});
|
|
3054
3057
|
|
|
3055
3058
|
try std.testing.expectEqual(@as(usize, 0), frame.changes.len);
|
|
3056
|
-
try expectRect(geometry.RectF.init(0, 0,
|
|
3059
|
+
try expectRect(geometry.RectF.init(0, 0, 21, 11), frame.dirty_bounds);
|
|
3057
3060
|
try std.testing.expectEqual(@as(f32, 0.5), frame.render_plan.commands[0].opacity);
|
|
3058
3061
|
try std.testing.expectEqualDeep(Affine.translate(10, 0), frame.render_plan.commands[0].transform);
|
|
3059
3062
|
|
|
@@ -74,6 +74,21 @@ pub fn mediaSurfaceTextureImageId(surface_id: u64) ImageId {
|
|
|
74
74
|
return surface_id | media_surface_image_id_bit;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/// The framework-owned media-surface id the SINGLE video playback
|
|
78
|
+
/// channel feeds (`fx.loadVideo` — one player is the whole surface) and
|
|
79
|
+
/// every `<video>` element composites. The `<video>` element always
|
|
80
|
+
/// binds this reserved id; apps composing custom video UI from the fx
|
|
81
|
+
/// vocabulary target it via `<media-surface surface={id}>` only when
|
|
82
|
+
/// they manage their own surface. A valid producer id: bit 63
|
|
83
|
+
/// (`media_surface_image_id_bit`) stays clear, so the id claims and
|
|
84
|
+
/// composites like any app surface — it is merely reserved by
|
|
85
|
+
/// convention for the declarative playback. BELOW 2^53 deliberately:
|
|
86
|
+
/// surface ids ride the TS wire as f64, and a source-less `<video>`
|
|
87
|
+
/// with custom controls is fed by the app's own `Cmd.videoLoad`
|
|
88
|
+
/// naming exactly this id — an id outside the exact-integer window
|
|
89
|
+
/// could never arrive intact.
|
|
90
|
+
pub const video_playback_surface_id: u64 = 0x0001_7669_6465_6f5f;
|
|
91
|
+
|
|
77
92
|
/// The media surface's deterministic id-derived placeholder color
|
|
78
93
|
/// (widget_render.zig): what the reference renderer — goldens,
|
|
79
94
|
/// screenshots, replay pixel marks — shows for a bound surface, live
|
|
@@ -124,6 +139,7 @@ pub const PathElement = drawing_model.PathElement;
|
|
|
124
139
|
pub const FillPath = drawing_model.FillPath;
|
|
125
140
|
pub const StrokePath = drawing_model.StrokePath;
|
|
126
141
|
pub const ImageFit = drawing_model.ImageFit;
|
|
142
|
+
pub const containDestinationRect = drawing_model.containDestinationRect;
|
|
127
143
|
pub const ImageSampling = drawing_model.ImageSampling;
|
|
128
144
|
pub const DrawImage = drawing_model.DrawImage;
|
|
129
145
|
pub const Shadow = drawing_model.Shadow;
|
|
@@ -355,6 +371,9 @@ pub const BlurTokenRef = token_model.BlurTokenRef;
|
|
|
355
371
|
pub const ScrollPhysics = token_model.ScrollPhysics;
|
|
356
372
|
pub const ScrollOverscroll = token_model.ScrollOverscroll;
|
|
357
373
|
pub const ScrollState = token_model.ScrollState;
|
|
374
|
+
pub const ScrollAxisState = token_model.ScrollAxisState;
|
|
375
|
+
pub const ScrollAxis = token_model.ScrollAxis;
|
|
376
|
+
pub const ScrollAxes = token_model.ScrollAxes;
|
|
358
377
|
pub const VirtualListOptions = token_model.VirtualListOptions;
|
|
359
378
|
pub const VirtualListRange = token_model.VirtualListRange;
|
|
360
379
|
pub const virtualListRange = token_model.virtualListRange;
|
|
@@ -411,6 +430,7 @@ pub const WidgetAnchorAlignment = widget_model.WidgetAnchorAlignment;
|
|
|
411
430
|
pub const WidgetStyle = widget_model.WidgetStyle;
|
|
412
431
|
pub const WidgetVariant = widget_model.WidgetVariant;
|
|
413
432
|
pub const WidgetOverscroll = widget_model.WidgetOverscroll;
|
|
433
|
+
pub const VideoControlVerb = widget_model.VideoControlVerb;
|
|
414
434
|
pub const WidgetIconPlacement = widget_model.WidgetIconPlacement;
|
|
415
435
|
pub const WidgetSize = widget_model.WidgetSize;
|
|
416
436
|
pub const WidgetRole = widget_model.WidgetRole;
|
|
@@ -462,6 +482,28 @@ pub const max_text_spans_per_paragraph = text_spans.max_text_spans_per_paragraph
|
|
|
462
482
|
pub const max_text_span_runs_per_paragraph = text_spans.max_text_span_runs_per_paragraph;
|
|
463
483
|
pub const max_text_span_lines_per_paragraph = text_spans.max_text_span_lines_per_paragraph;
|
|
464
484
|
|
|
485
|
+
// The terminal grid — the `.terminal` widget's resolved cell model and
|
|
486
|
+
// painter (real text runs, geometric box drawing, selection, cursor,
|
|
487
|
+
// scrollback indicator) — lives in `terminal_grid.zig`; the box-drawing
|
|
488
|
+
// geometry in `terminal_box.zig`.
|
|
489
|
+
pub const terminal_grid = @import("terminal_grid.zig");
|
|
490
|
+
pub const terminal_box = @import("terminal_box.zig");
|
|
491
|
+
pub const TerminalGrid = terminal_grid.TerminalGrid;
|
|
492
|
+
pub const TerminalRow = terminal_grid.TerminalRow;
|
|
493
|
+
pub const TerminalCell = terminal_grid.TerminalCell;
|
|
494
|
+
pub const TerminalWide = terminal_grid.TerminalWide;
|
|
495
|
+
pub const TerminalCursor = terminal_grid.TerminalCursor;
|
|
496
|
+
pub const TerminalCursorShape = terminal_grid.TerminalCursorShape;
|
|
497
|
+
pub const TerminalCellPos = terminal_grid.TerminalCellPos;
|
|
498
|
+
pub const TerminalScrollbar = terminal_grid.TerminalScrollbar;
|
|
499
|
+
pub const TerminalState = terminal_grid.TerminalState;
|
|
500
|
+
pub const TerminalCellMetrics = terminal_grid.TerminalCellMetrics;
|
|
501
|
+
pub const terminalCellMetrics = terminal_grid.cellMetrics;
|
|
502
|
+
pub const clampTerminalGrid = terminal_grid.clampGrid;
|
|
503
|
+
pub const max_terminal_cols = terminal_grid.max_cols;
|
|
504
|
+
pub const max_terminal_rows = terminal_grid.max_rows;
|
|
505
|
+
pub const max_terminal_cells = terminal_grid.max_cells;
|
|
506
|
+
|
|
465
507
|
// Chart plot data for the `.chart` widget kind (series, downsampling,
|
|
466
508
|
// domain) lives in `chart.zig`.
|
|
467
509
|
pub const chart = @import("chart.zig");
|
|
@@ -523,6 +565,7 @@ pub const MarkupFragment = ui_markup.MarkupFragment;
|
|
|
523
565
|
pub const markup_contract_specials = ui_markup.contract.Specials{
|
|
524
566
|
.TextInputEvent = TextInputEvent,
|
|
525
567
|
.ScrollState = ScrollState,
|
|
568
|
+
.TerminalState = TerminalState,
|
|
526
569
|
};
|
|
527
570
|
|
|
528
571
|
/// Reflect an app's Model/Msg into a markup contract (see
|
|
@@ -560,6 +603,7 @@ pub const StyleTokenRefs = ui_builder.StyleTokenRefs;
|
|
|
560
603
|
/// The fragment hot-reload seam between the app loop and compiled
|
|
561
604
|
/// markup fragments (Debug dev runs only; see `ui_builder`).
|
|
562
605
|
pub const MarkupFragmentHost = ui_builder.MarkupFragmentHost;
|
|
606
|
+
pub const TerminalGridLookup = ui_builder.TerminalGridLookup;
|
|
563
607
|
pub const MarkupFragmentDiagnostic = ui_builder.MarkupFragmentDiagnostic;
|
|
564
608
|
|
|
565
609
|
// Canvas widget event and semantics data lives in `events.zig`; root keeps the public API stable.
|
|
@@ -679,6 +723,8 @@ pub const widgetKindHitTarget = @import("widget_access.zig").widgetKindHitTarget
|
|
|
679
723
|
/// any widget with a bound press/toggle handler (stamped into
|
|
680
724
|
/// `semantics.actions` by the builder and both markup engines).
|
|
681
725
|
pub const widgetIsHitTarget = @import("widget_access.zig").isHitTarget;
|
|
726
|
+
pub const widgetIsHoverMsgHitTarget = @import("widget_access.zig").isHoverMsgHitTarget;
|
|
727
|
+
pub const widgetListensForHoverMsgs = @import("widget_access.zig").widgetListensForHoverMsgs;
|
|
682
728
|
/// Press-claiming predicates (widget_access.zig): where a press gesture
|
|
683
729
|
/// stops instead of falling through to the nearest pressable ancestor.
|
|
684
730
|
pub const widgetKindClaimsPress = @import("widget_access.zig").widgetKindClaimsPress;
|
|
@@ -711,6 +757,8 @@ pub const widgetIsAnchored = @import("widget_tree.zig").widgetIsAnchored;
|
|
|
711
757
|
/// and whose children are the built window, not the full item set.
|
|
712
758
|
pub const widgetVirtualRuntimeScrolled = @import("widget_tree.zig").widgetVirtualRuntimeScrolled;
|
|
713
759
|
pub const widgetScrollPhysics = @import("widget_tree.zig").widgetScrollPhysics;
|
|
760
|
+
pub const widgetScrollsAxis = @import("widget_tree.zig").widgetScrollsAxis;
|
|
761
|
+
pub const widgetScrollAxisMetrics = @import("widget_semantics.zig").widgetScrollAxisMetrics;
|
|
714
762
|
pub const isWidgetHiddenInAncestors = @import("widget_tree.zig").isWidgetHiddenInAncestors;
|
|
715
763
|
/// The disclosure family (widget_tree.zig): collapsible widgets whose
|
|
716
764
|
/// content lays out at full size and REVEALS, plus the settled/concealed
|