apprt/gtk-ng: toasts

This commit is contained in:
Mitchell Hashimoto
2025-07-26 12:29:07 -07:00
parent 18831374ca
commit ccde429bde
4 changed files with 71 additions and 8 deletions

View File

@@ -29,10 +29,27 @@ pub const IMEPos = struct {
/// The clipboard type.
///
/// If this is changed, you must also update ghostty.h
pub const Clipboard = enum(u2) {
pub const Clipboard = enum(Backing) {
standard = 0, // ctrl+c/v
selection = 1,
primary = 2,
// Our backing isn't is as small as we can in Zig, but a full
// C int if we're binding to C APIs.
const Backing = switch (build_config.app_runtime) {
.gtk, .@"gtk-ng" => c_int,
else => u2,
};
/// Make this a valid gobject if we're in a GTK environment.
pub const getGObjectType = switch (build_config.app_runtime) {
.gtk, .@"gtk-ng" => @import("gobject").ext.defineEnum(
Clipboard,
.{ .name = "GhosttyApprtClipboard" },
),
.none => void,
};
};
pub const ClipboardRequestType = enum(u8) {