diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-07-22 07:24:08 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-07-22 14:36:21 -0700 |
| commit | a4f494e2ae43d07ada3d1d52b9e76150338fa7d7 (patch) | |
| tree | 26755bd0ecfdc71f2830d8c45d0fd5811ccaecf1 | |
| parent | c3acbf1a4956ba7c6409b34036477c9fa957e874 (diff) | |
apprt/gtk-ng: wip set clipboard
| -rw-r--r-- | src/apprt/gtk-ng/Surface.zig | 9 | ||||
| -rw-r--r-- | src/apprt/gtk-ng/class/surface.zig | 30 |
2 files changed, 35 insertions, 4 deletions
diff --git a/src/apprt/gtk-ng/Surface.zig b/src/apprt/gtk-ng/Surface.zig index 1ee21bbc6..7613abd2d 100644 --- a/src/apprt/gtk-ng/Surface.zig +++ b/src/apprt/gtk-ng/Surface.zig @@ -85,10 +85,11 @@ pub fn setClipboardString( clipboard_type: apprt.Clipboard, confirm: bool, ) !void { - _ = self; - _ = val; - _ = clipboard_type; - _ = confirm; + self.surface.setClipboardString( + val, + clipboard_type, + confirm, + ); } pub fn defaultTermioEnv(self: *Self) !std.process.EnvMap { diff --git a/src/apprt/gtk-ng/class/surface.zig b/src/apprt/gtk-ng/class/surface.zig index 70d769dbc..b27fe1da1 100644 --- a/src/apprt/gtk-ng/class/surface.zig +++ b/src/apprt/gtk-ng/class/surface.zig @@ -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 @@ -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( self: *Surface, clipboard_type: apprt.Clipboard, |
