diff options
Diffstat (limited to 'dev/gui')
| -rw-r--r-- | dev/gui/gui.zig | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig index 66b7328d..909c83c6 100644 --- a/dev/gui/gui.zig +++ b/dev/gui/gui.zig @@ -1422,6 +1422,23 @@ const Client = struct { return .{ .drew = cl.shell.presented, .moving = frontendMoving(cl.g) }; } + /// What its view asked of this machine (client.zig `asks`): register + /// `+` to the desktop's clipboard, the clipboard's text sent as a paste, + /// a link opened. + pub fn copy(cl: *Client, text: []const u8) void { + putClipboard(cl.gpa, text); + } + + pub fn paste(_: *Client, l: *ClientLoop) void { + const text = takeClipboard() orelse return; + defer c.SDL_free(text.ptr); + l.input(.{ .paste = text }); + } + + pub fn open(_: *Client, url: []const u8) void { + look.openLink(url); + } + /// The reader's: a message of the stream, for the loop, which it wakes. pub fn said(cl: *Client, msg: replica.Said) bool { cl.lock.lockUncancelable(cl.io); |
