mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-27 02:56:28 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user