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

@@ -36,10 +36,10 @@ typedef enum {
} ghostty_clipboard_e;
typedef enum {
GHOSTTY_CLIPBOARD_PROMPT_UNSAFE = 1,
GHOSTTY_CLIPBOARD_PROMPT_READ = 2,
GHOSTTY_CLIPBOARD_PROMPT_WRITE = 3,
} ghostty_clipboard_prompt_reason_e;
GHOSTTY_CLIPBOARD_REQUEST_PASTE,
GHOSTTY_CLIPBOARD_REQUEST_OSC_52_READ,
GHOSTTY_CLIPBOARD_REQUEST_OSC_52_WRITE,
} ghostty_clipboard_request_e;
typedef enum {
GHOSTTY_SPLIT_RIGHT,
@@ -346,7 +346,7 @@ typedef void (*ghostty_runtime_set_title_cb)(void *, const char *);
typedef void (*ghostty_runtime_set_mouse_shape_cb)(void *, ghostty_mouse_shape_e);
typedef void (*ghostty_runtime_set_mouse_visibility_cb)(void *, bool);
typedef void (*ghostty_runtime_read_clipboard_cb)(void *, ghostty_clipboard_e, void *);
typedef void (*ghostty_runtime_confirm_read_clipboard_cb)(void *, const char*, void *, ghostty_clipboard_prompt_reason_e);
typedef void (*ghostty_runtime_confirm_read_clipboard_cb)(void *, const char*, void *, ghostty_clipboard_request_e);
typedef void (*ghostty_runtime_write_clipboard_cb)(void *, const char *, ghostty_clipboard_e, bool);
typedef void (*ghostty_runtime_new_split_cb)(void *, ghostty_split_direction_e, ghostty_surface_config_s);
typedef void (*ghostty_runtime_new_tab_cb)(void *, ghostty_surface_config_s);