core: use ClipboardRequestType instead of ClipboardPromptReason

Instead of making a separate enum that must be translated from the
ClipboardRequest type, simply re-use ClipboardRequest to determine the
clipboard confirmation reason.
This commit is contained in:
Gregory Anders
2023-11-10 18:06:53 -06:00
parent 2a64180ebd
commit 98b43007a0
9 changed files with 94 additions and 136 deletions

View File

@@ -32,9 +32,15 @@ pub const Clipboard = enum(u1) {
selection = 1, // also known as the "primary" clipboard
};
pub const ClipboardRequestType = enum(u8) {
paste,
osc_52_read,
osc_52_write,
};
/// Clipboard request. This is used to request clipboard contents and must
/// be sent as a response to a ClipboardRequest event.
pub const ClipboardRequest = union(enum) {
pub const ClipboardRequest = union(ClipboardRequestType) {
/// A direct paste of clipboard contents.
paste: void,
@@ -44,18 +50,3 @@ pub const ClipboardRequest = union(enum) {
/// A request to write clipboard contents via OSC 52.
osc_52_write: Clipboard,
};
/// The reason for displaying a clipboard prompt to the user
pub const ClipboardPromptReason = enum(i32) {
/// For pasting data only. Pasted data contains potentially unsafe
/// characters
unsafe = 1,
/// The user must authorize the application to read from the clipboard
read = 2,
/// The user must authorize the application to write to the clipboard
write = 3,
_,
};