Skip to content

feat: c module - #71

Open
richerfu wants to merge 4 commits into
mainfrom
feat/c-module
Open

feat: c module#71
richerfu wants to merge 4 commits into
mainfrom
feat/c-module

Conversation

@richerfu

@richerfu richerfu commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

richerfu and others added 4 commits August 6, 2026 14:24
Implements the @ohos-rs/ability native module contract in C99 with an
SDL-style application model (AppInit/AppEvent/AppIterate/AppQuit on a
dedicated application thread), the three bridge call modes (async /
main-thread sync / worker sync over TSFN), C plugin registration for
ArkTS-originated sync events, the full event surface (lifecycle, surface,
input, IME, frame, avoid areas), and the built-in ohos.node plugin facade.
Capabilities are gated by compile-time macros (OH_ABILITY_PLUGIN_NODE,
OH_ABILITY_ENABLE_IME/DISPLAY) mirroring cargo features / SDL subsystems.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The C demo reuses the demo_native module name and the Rust demo's export
surface (Index.d.ts), so the demo app is unchanged when its libdemo_native.so
is swapped. Plugins live in src/plugins/<name>/ directories (Rust
crates/plugin-* layout), each gated by its own OH_ABILITY_PLUGIN_* macro with
explicit-error stubs when disabled: permission, files, url, resource (inbound
plugin), webview (inbound plugin + demoweb scheme handler + window.test JS
proxy), window and app-control (reserved). Build via scripts/build-c-demo.sh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Compiles c_module (framework + demo) for arm64-v8a with the OHOS SDK on every
PR, using the SDK-bundled cmake/ninja when present.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Repository layout, plugin switches table, and build instructions for
c_module; AGENTS.md gets the C framework rules (napi value discipline,
identifier validation, fail-closed dispatch, TSFN release duty).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant