cli/gtk: replace @hasDecl for performAction-style API

Instead of using @hasDecl, use a performAction-stype API. The C
interface for interfacing with macOS (or any other apprt where Ghostty
is embedded) is unfinished.
This commit is contained in:
Jeffrey C. Ollie
2025-07-13 21:59:13 -05:00
parent 72e47cf8bc
commit 81358c8dca
9 changed files with 291 additions and 48 deletions

View File

@@ -1154,7 +1154,20 @@ pub const Inspector = struct {
};
/// Functions for inter-process communication.
pub const IPC = struct {};
pub const IPC = struct {
/// Send the given IPC to a running Ghostty. Returns `true` if the action was
/// able to be performed, `false` otherwise.
pub fn sendIPC(
_: Allocator,
_: apprt.ipc.Target,
comptime action: apprt.ipc.Action.Key,
_: apprt.ipc.Action.Value(action),
) (Allocator.Error || std.posix.WriteError || apprt.ipc.Errors)!bool {
switch (action) {
.new_window => return false,
}
}
};
// C API
pub const CAPI = struct {