Skip to content

Commit b5769e0

Browse files
committed
Integrate HarmonyOS APIs, bindings and acceptance evidence
Update core to 534ee4c39a28de1870f4a6565fea6a024c1d562b. Sync the six language bindings, API reference and design specifications, and retain the phone/computer SDK acceptance reports and remaining coverage ledger. The clipboard checkpoint passes 474 boundary assertions and 34 independent cross-app regression assertions on each emulator, including real environment cleanup and permission refusal/restoration.
1 parent 5d8c634 commit b5769e0

109 files changed

Lines changed: 7372 additions & 172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎bindings/csharp/src/CNativeAPI/generated/DragSource.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ public static partial class Interop
3838
[return: MarshalAs(UnmanagedType.I1)]
3939
public static extern bool native_drag_source_is_dragging(ulong self);
4040

41+
[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
42+
[return: MarshalAs(UnmanagedType.I1)]
43+
public static extern bool native_drag_source_is_operation_selection_supported();
44+
45+
[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
46+
[return: MarshalAs(UnmanagedType.I1)]
47+
public static extern bool native_drag_source_is_position_supported();
48+
4149
[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
4250
[return: MarshalAs(UnmanagedType.I1)]
4351
public static extern bool native_drag_source_is_supported();

‎bindings/csharp/src/CNativeAPI/generated/PositioningStrategy.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public static partial class Interop
2828
[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
2929
public static extern ulong native_positioning_strategy_cursor_position();
3030

31+
[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
32+
public static extern ulong native_positioning_strategy_get_relative_window(ulong self);
33+
3134
[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
3235
public static extern ulong native_positioning_strategy_relative_with_rect_and_offset(native_rectangle_t rect, native_point_t offset);
3336

‎bindings/csharp/src/NativeAPI/DragSource.cs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ public static bool IsSupported()
7676
return rawResult;
7777
}
7878

79+
public static bool IsPositionSupported()
80+
{
81+
var rawResult = Interop.native_drag_source_is_position_supported();
82+
return rawResult;
83+
}
84+
85+
public static bool IsOperationSelectionSupported()
86+
{
87+
var rawResult = Interop.native_drag_source_is_operation_selection_supported();
88+
return rawResult;
89+
}
90+
7991
public void SetFilePaths(IReadOnlyList<string> filePaths)
8092
{
8193
var itemsFilePaths = Interop.AllocUtf8Array(filePaths);

‎bindings/csharp/src/NativeAPI/PositioningStrategy.cs‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ private void ReleaseHandle()
6666
return rawResult == 0 ? null : new PositioningStrategy(rawResult);
6767
}
6868

69-
public static PositioningStrategy? RelativeWithWindowAndOffset(Window window, Point offset)
69+
public static PositioningStrategy? RelativeWithWindowAndOffset(Window? window, Point offset)
7070
{
7171
var rawOffset = offset.ToRaw();
72-
var rawResult = Interop.native_positioning_strategy_relative_with_window_and_offset(window.NativeHandle, rawOffset);
72+
var rawResult = Interop.native_positioning_strategy_relative_with_window_and_offset(window?.NativeHandle ?? 0, rawOffset);
7373
return rawResult == 0 ? null : new PositioningStrategy(rawResult);
7474
}
7575

@@ -109,5 +109,14 @@ public Point RelativeOffset
109109
}
110110
}
111111

112+
public Window? RelativeWindow
113+
{
114+
get
115+
{
116+
var rawResult = Interop.native_positioning_strategy_get_relative_window(NativeHandle);
117+
return rawResult == 0 ? null : new Window(rawResult);
118+
}
119+
}
120+
112121
}
113122

‎bindings/dart/cnativeapi/CHANGELOG.md‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
## Unreleased
2+
3+
- Confirm HarmonyOS immersive-layout requests against the real SDK result and live layout flag on workers, reject overlapping alias requests, and cancel pending work on native destruction. Keep computer floating-main no-op and native-caption inset limits explicit.
4+
5+
- Implement HarmonyOS fullscreen-mode policy with preserved floating/split bits, an explicit host override baseline and primary Stage fallback. Serialize UI/worker requests, keep policies on SDK refusal, and cancel pending requests on native destruction. The SDK couples fullscreen and maximize; unknown child policy queries return false.
6+
7+
- Use native HarmonyOS fullscreen modes for eligible freeform child windows, restore their previous maximized/floating state and report confirmed SDK state through C++/C queries and fullscreen events. Preserve phone SDK layout restrictions.
8+
9+
- Implement HarmonyOS custom title-bar double-click actions through public SDK maximize/recover, including eligible SDK children. Check live free-window support to reject phone SDK no-op success, respect applied maximize policies and invalid modes, reject overlapping requests and cancel pending work on native destruction; UI submissions are asynchronous and workers wait for SDK completion.
10+
11+
- Implement independent HarmonyOS minimize/maximize/close caption-button policies, composed with collective visibility and title-bar styles, with C++/C property events. These affect caption buttons only: native title-bar double-click can still maximize, and primary programmatic Close retains its existing restriction.
12+
13+
- Recover HarmonyOS custom shadows after native helper destruction; verify primary-window rendering and decoration/default restoration on computers, and SDK refusal on phones.
14+
15+
- Implement HarmonyOS custom window shadows through an optional Stage companion: core-rendered colors, blur and offset, copied C++/C configuration, click-through helpers, live geometry and visibility, clipped shapes and native closure cleanup.
16+
17+
- Return transparent colors for malformed hexadecimal input without throwing; preserve combined keyboard modifiers across the C ABI. Retain shared windows in relative positioning strategies and expose the owning relative-window getter in all bindings. C++ callers must pass `Relative(window)` instead of `Relative(*window)`.
18+
19+
- Display HarmonyOS native-view tooltips from real hover events through the optional NativeTooltipHost companion. Public SDK popups preserve focus and underlying clicks; updates, clearing, hidden/disabled ancestors, removal, node replacement and ContentSlot lifecycle cancel stale presentations.
20+
21+
- Implement HarmonyOS child-window reparenting through the public SDK. Read actual parent relationships, including embedding-host changes; reject cycles, invalid handles and overlapping requests, and wait for SDK completion on workers. Verify native/C behavior and real parent destruction on phone/computer simulators.
22+
23+
- Query the actual HarmonyOS visible-window stack for window hit testing on workers, with nonblocking completed snapshots on UI and per-display caches. Verify focus-independent child layers, SDK raises, exclusions and destruction through C++/C on phone/computer; restore the device-information test export and rerun storage/metadata acceptance.
24+
25+
- Preserve HarmonyOS Preferences removal semantics for missing keys. Share each scope's native store and serialize compound operations, closing the SDK handle only after the final owner; verify C++/C, SDK interoperability, concurrency, limits and real process persistence on phone/computer simulators.
26+
27+
- Read live HarmonyOS user device names through the public Settings SDK with the documented market-name fallback. Preserve unavailable distribution names as empty, and report the process build ABI independently of the kernel machine. Verify all seven getters through ordinary C++/C UI and worker reads, real restored name changes and process restarts on phone/computer simulators.
28+
29+
- Implement HarmonyOS public-NDK key press/release monitoring with shared native registration, UI delivery, stopped-epoch invalidation and guarded destruction. Both phone/computer system-app debug fixtures pass real input and C++/C lifecycle checks; normal apps remain denied even with the tested ACL. Modifier-state events and remaining permission/teardown audits stay open.
30+
31+
- Read actual HarmonyOS self startup status through the public SDK on workers, with nonblocking last-completed UI snapshots. Resolve default metadata after host attachment; keep programmatic startup controls unavailable and record display names as metadata only.
32+
33+
- Implement HarmonyOS application-local shortcuts through the explicit NativeShortcutHost component adapter, without probing or reserving global chords. Verify phone/computer real input, disabled states, C callback lifetime, worker registration and callback/event self-removal. Additional windows/native-only hosts and repeat/teardown audits remain open.
34+
35+
- Implement HarmonyOS application metadata, native image codecs, ASSET encrypted storage and clipboard image/local-file formats. ArkTS hosts initialize nativeapi and attach UIAbilityContext explicitly.
36+
37+
- Add HarmonyOS window management for initialized ArkTS hosts: main/child window lookup, asynchronous child creation, geometry, focus, visibility, full screen, native events and cancellable child closing. Host integration is explicit; Flutter does not attach WindowStage automatically.
38+
139
## 0.5.3
240

341
- macOS: add `ShortcutReleasedEvent` for system key-up delivery and accept Fn / CapsLock accelerators (hotkey_manager migration).

‎bindings/dart/cnativeapi/lib/src/bindings_generated.dart‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,12 @@ external ffi.Pointer<ffi.Char> native_drag_source_get_text(int drag_source);
543543
@ffi.Native<ffi.Bool Function(native_drag_source_t)>()
544544
external bool native_drag_source_is_dragging(int drag_source);
545545

546+
@ffi.Native<ffi.Bool Function()>()
547+
external bool native_drag_source_is_operation_selection_supported();
548+
549+
@ffi.Native<ffi.Bool Function()>()
550+
external bool native_drag_source_is_position_supported();
551+
546552
@ffi.Native<ffi.Bool Function()>()
547553
external bool native_drag_source_is_supported();
548554

@@ -1688,6 +1694,12 @@ external native_rectangle_t native_positioning_strategy_get_relative_rectangle(
16881694
int positioning_strategy,
16891695
);
16901696

1697+
/// Caller owns the returned handle; release it with native_window_free().
1698+
@ffi.Native<native_window_t Function(native_positioning_strategy_t)>()
1699+
external int native_positioning_strategy_get_relative_window(
1700+
int positioning_strategy,
1701+
);
1702+
16911703
@ffi.Native<ffi.UnsignedInt Function(native_positioning_strategy_t)>(
16921704
symbol: 'native_positioning_strategy_get_type',
16931705
)

‎bindings/dart/nativeapi/CHANGELOG.md‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
1+
## Unreleased
2+
3+
- Confirm HarmonyOS immersive-layout requests against the real SDK result and live layout flag on workers, reject overlapping alias requests, and cancel pending work on native destruction. Keep computer floating-main no-op and native-caption inset limits explicit.
4+
5+
- Implement HarmonyOS fullscreen-mode policy with preserved floating/split bits, an explicit host override baseline and primary Stage fallback. Serialize UI/worker requests, keep policies on SDK refusal, and cancel pending requests on native destruction. The SDK couples fullscreen and maximize; unknown child policy queries return false.
6+
7+
- Use native HarmonyOS fullscreen modes for eligible freeform child windows, restore their previous maximized/floating state and report confirmed SDK state through C++/C queries and fullscreen events. Preserve phone SDK layout restrictions.
8+
9+
- Implement HarmonyOS custom title-bar double-click actions through public SDK maximize/recover, including eligible SDK children. Check live free-window support to reject phone SDK no-op success, respect applied maximize policies and invalid modes, reject overlapping requests and cancel pending work on native destruction; UI submissions are asynchronous and workers wait for SDK completion.
10+
11+
- Implement independent HarmonyOS minimize/maximize/close caption-button policies, composed with collective visibility and title-bar styles, with C++/C property events. These affect caption buttons only: native title-bar double-click can still maximize, and primary programmatic Close retains its existing restriction.
12+
13+
- Recover HarmonyOS custom shadows after native helper destruction; verify primary-window rendering and decoration/default restoration on computers, and SDK refusal on phones.
14+
15+
- Implement HarmonyOS custom window shadows through an optional Stage companion: core-rendered colors, blur and offset, copied C++/C configuration, click-through helpers, live geometry and visibility, clipped shapes and native closure cleanup.
16+
17+
- Return transparent colors for malformed hexadecimal input without throwing; preserve combined keyboard modifiers across the C ABI. Retain shared windows in relative positioning strategies and expose the owning relative-window getter in all bindings. C++ callers must pass `Relative(window)` instead of `Relative(*window)`.
18+
19+
- Display HarmonyOS native-view tooltips from real hover events through the optional NativeTooltipHost companion. Public SDK popups preserve focus and underlying clicks; updates, clearing, hidden/disabled ancestors, removal, node replacement and ContentSlot lifecycle cancel stale presentations.
20+
21+
- Implement HarmonyOS child-window reparenting through the public SDK. Read actual parent relationships, including embedding-host changes; reject cycles, invalid handles and overlapping requests, and wait for SDK completion on workers. Verify native/C behavior and real parent destruction on phone/computer simulators.
22+
23+
- Query the actual HarmonyOS visible-window stack for window hit testing on workers, with nonblocking completed snapshots on UI and per-display caches. Verify focus-independent child layers, SDK raises, exclusions and destruction through C++/C on phone/computer; restore the device-information test export and rerun storage/metadata acceptance.
24+
25+
- Preserve HarmonyOS Preferences removal semantics for missing keys. Share each scope's native store and serialize compound operations, closing the SDK handle only after the final owner; verify C++/C, SDK interoperability, concurrency, limits and real process persistence on phone/computer simulators.
26+
27+
- Read live HarmonyOS user device names through the public Settings SDK with the documented market-name fallback. Preserve unavailable distribution names as empty, and report the process build ABI independently of the kernel machine. Verify all seven getters through ordinary C++/C UI and worker reads, real restored name changes and process restarts on phone/computer simulators.
28+
29+
- Implement HarmonyOS public-NDK key press/release monitoring with shared native registration, UI delivery, stopped-epoch invalidation and guarded destruction. Both phone/computer system-app debug fixtures pass real input and C++/C lifecycle checks; normal apps remain denied even with the tested ACL. Modifier-state events and remaining permission/teardown audits stay open.
30+
31+
- Read actual HarmonyOS self startup status through the public SDK on workers, with nonblocking last-completed UI snapshots. Resolve default metadata after host attachment; keep programmatic startup controls unavailable and record display names as metadata only.
32+
33+
- Implement HarmonyOS application-local shortcuts through the explicit NativeShortcutHost component adapter, without probing or reserving global chords. Verify phone/computer real input, disabled states, C callback lifetime, worker registration and callback/event self-removal. Additional windows/native-only hosts and repeat/teardown audits remain open.
34+
35+
- Route HarmonyOS system title-bar closes through shared cancellable/deferred C++ and C window requests. Approval continues the original SDK close; repeated clicks coalesce, and removing observers or destroying a pending window cannot revive stale votes.
36+
37+
- Implement HarmonyOS programmatic drag sources for initialized ArkTS hosts, including text/files, custom/default previews, guarded UI completion and safe release during an ongoing drag. Add `DragSource.isPositionSupported()` and `isOperationSelectionSupported()` across native platforms and bindings. HarmonyOS reports false for both missing SDK capabilities; completion preserves actual Copy/Move/None results.
38+
39+
- Implement HarmonyOS native ArkUI drop destinations on mounted NativeAPI content roots. Copy drops deliver text and readable file paths; Move/Link remain refused. Isolate native view and drag event receivers, and allow target removal/destruction during delivery.
40+
41+
- Implement HarmonyOS public-NDK global shortcut registration with Ctrl/Alt/Shift side variants, alias/system conflict checks and guarded UI delivery. Failed removal retains the registration for retry; failed registration notifications can re-enter the manager without a dispatcher. Release events and complete keyboard monitoring remain open.
42+
43+
- Validate HarmonyOS clipboard file URI reads against actual file type and app readability, and normalize foreign sandbox paths before accepting them. Verify bidirectional text, HTML, pixels and real file bytes with a separate SDK-only application.
44+
45+
- Implement HarmonyOS display change, addition, removal and available-area observers through the public NDK, with main-thread delivery and invalidation after the last unsubscription. Preserve display identities when native enumeration fails.
46+
47+
- Query HarmonyOS cursor positions through the public Input Kit API, convert physical display coordinates to logical coordinates, and return the documented origin on SDK refusal or missing pointer/display geometry. Focus authorization and an actual pointer device are required.
48+
49+
- Implement HarmonyOS main-window content aspect constraints through the API 21+ nonpersistent SDK operation. Only user edge resizing is constrained; worker calls wait for completion, queued requests preserve order and rejected operations preserve the last successful value.
50+
51+
- Implement HarmonyOS native window-control visibility and live C++/C property events on supported freeform main windows. Hidden title bars hide the buttons; explicitly showing them afterwards overrides that default. Unsupported phone/child windows remain safely hidden.
52+
53+
- Implement HarmonyOS native window dragging for initialized ArkTS hosts through the public startMoving API. Invoke from the active touch-down/move callback; main windows require freeform mode.
54+
55+
- Implement HarmonyOS child-window polygon masks and rectangle restoration through the public SDK, with shared C++/C state, copied builders and real SDK completion on worker threads. Requires API 24+; main windows and independent input polygons remain unsupported.
56+
57+
- Implement HarmonyOS owning-Ability lifecycle events/state, cancellable C++/C ABI quit confirmation followed by real Ability termination, primary-window selection, application multi-instance metadata and application light/dark/system appearance. Hosts forward the actual Ability lifecycle callbacks; the Ability owns its loop, so Application.run returns -1.
58+
59+
- Fix HarmonyOS accessibility queries to read actual system extension state through the public SDK on UI and worker threads. Enable no longer sets a local success flag; activating an extension requires a system-only API.
60+
61+
- Implement HarmonyOS system notifications through public authorization, publish/cancel and WantAgent APIs, including tag replacement and native/C ABI activation events. Worker operations require the ArkTS UI loop; hosts forward onCreate/onNewWant through the OHOS bridge.
62+
63+
- Implement HarmonyOS HTTP/HTTPS handler queries and URL dispatch through the public SDK. Declare querySchemes for capability queries; Open waits on a worker for the actual launch result and reports SDK failures.
64+
65+
- Implement HarmonyOS system document pickers using the public SDK. Computer open, multiple-file, folder and save paths are verified; phone save, single-open and user cancellation are verified, with multi-file and folder acceptance still under investigation. Open waits on a worker and returns authorized document URIs for the system file APIs; programmatic Close is unavailable.
66+
67+
- Implement HarmonyOS native message dialogs with buttons, input, checkbox, progress, live updates and lifecycle cleanup. Modal Open requires a worker while the ArkTS UI thread keeps handling events.
68+
69+
- Implement HarmonyOS application metadata, native image codecs, ASSET encrypted storage and clipboard image/local-file formats. ArkTS hosts initialize nativeapi and attach UIAbilityContext explicitly.
70+
71+
- Add HarmonyOS window management for initialized ArkTS hosts: main/child window lookup, asynchronous child creation, geometry, focus, visibility, full screen, native events and cancellable child closing. Host integration is explicit; Flutter does not attach WindowStage automatically.
72+
173
## 0.5.3
274

375
- `TrayIcon.isIconTemplate` now follows system tray colours on Windows and Linux as well as macOS, without changing the source image.

0 commit comments

Comments
 (0)