apprt/gtk-ng: wip set clipboard

This commit is contained in:
Mitchell Hashimoto
2025-07-22 07:24:08 -07:00
parent c3acbf1a49
commit a4f494e2ae
2 changed files with 35 additions and 4 deletions

View File

@ -85,10 +85,11 @@ pub fn setClipboardString(
clipboard_type: apprt.Clipboard, clipboard_type: apprt.Clipboard,
confirm: bool, confirm: bool,
) !void { ) !void {
_ = self; self.surface.setClipboardString(
_ = val; val,
_ = clipboard_type; clipboard_type,
_ = confirm; confirm,
);
} }
pub fn defaultTermioEnv(self: *Self) !std.process.EnvMap { pub fn defaultTermioEnv(self: *Self) !std.process.EnvMap {

View File

@ -703,6 +703,20 @@ pub const Surface = extern struct {
); );
} }
pub fn setClipboardString(
self: *Self,
val: [:0]const u8,
clipboard_type: apprt.Clipboard,
confirm: bool,
) void {
Clipboard.set(
self,
val,
clipboard_type,
confirm,
);
}
//--------------------------------------------------------------- //---------------------------------------------------------------
// Virtual Methods // Virtual Methods
@ -1930,6 +1944,22 @@ const Clipboard = struct {
}; };
} }
/// Set the clipboard contents.
pub fn set(
self: *Surface,
val: [:0]const u8,
clipboard_type: apprt.Clipboard,
confirm: bool,
) void {
_ = self;
_ = val;
_ = clipboard_type;
_ = confirm;
}
/// Request data from the clipboard (read the clipboard). This
/// completes asynchronously and will call the `completeClipboardRequest`
/// core surface API when done.
pub fn request( pub fn request(
self: *Surface, self: *Surface,
clipboard_type: apprt.Clipboard, clipboard_type: apprt.Clipboard,