feat(apprt): port the core/runtime contract types

Ports ZIG/src/apprt/{action,structs,surface,ipc,runtime}.zig into
ghostty-apprt: the Action enum performed by the core on the app runtime
(all 65 variants with docs), Target<S> generic over the runtime's
surface handle, clipboard/size/scale/selection structs, the core->surface
Message enum with a Mailbox over an AppMailbox trait, and IPC action
types for +new-window.

Owned Strings and Arc<Config> replace Zig's borrowed slices/pointers.
Scrollbar and RendererHealth are local stand-ins until core integration.
The embedded C API and browser runtime are out of scope.

Test Plan:
- cargo test -p ghostty-apprt (16 tests)
This commit is contained in:
ddidderr committed 2026-10-11 22:25:05 +02:00
1 parent 6f970bfe26
commit ac0e05def1
9 files changed
+1529 -1

No files matched your search

+17 -1
View File
@@ -1 +1,17 @@
//! ghostty-apprt: the contract between the core and app runtimes (ZIG/src/apprt/{action,structs,surface,ipc}.zig).
//! ghostty-apprt: the contract between the core and app runtimes
//! (ZIG/src/apprt/{action,structs,surface,ipc,runtime,none}.zig).
//!
//! The C-ABI parts of the Zig sources (`C` structs, `cval`, `CValue`,
//! `ghostty.h` sync tests) belong to the embedded runtime and are not ported.
pub mod action;
pub mod ipc;
pub mod runtime;
pub mod structs;
pub mod surface;
pub use action::{Action, Target};
pub use structs::{
Clipboard, ClipboardContent, ClipboardRequest, ClipboardRequestType, ColorScheme, ContentScale,
CursorPos, ImePos, Selection, SurfaceSize,
};