diff options
| author | Jeffrey C. Ollie <jeff@ocjtech.us> | 2025-02-25 11:59:46 -0600 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-07-06 15:02:48 -0700 |
| commit | 9583ea1b7ae2d2ae40fa03599901fb9378154ab7 (patch) | |
| tree | 8e302ac0ca12e234f4b77619a492e68fbf46fe3d /include | |
| parent | 185a4ea10b50dc2db14c56ff7608e6e0866b8c0b (diff) | |
core/gtk: open urls using an apprt action instead of doing it directly
Partial implementation of #5256
This implements the core changes necessary to open urls using an apprt
action rather than doing it directly from the core.
Implements the open_url action in the GTK and GLFW apprts.
Note that this should not be merged until a macOS-savvy developer can add
an implementation of the open_url action for the macOS apprt.
Diffstat (limited to 'include')
| -rw-r--r-- | include/ghostty.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/ghostty.h b/include/ghostty.h index 73c708c6b..16ca21d89 100644 --- a/include/ghostty.h +++ b/include/ghostty.h @@ -662,6 +662,19 @@ typedef struct { bool soft; } ghostty_action_reload_config_s; +// apprt.action.OpenUrlKind +typedef enum { + GHOSTTY_ACTION_OPEN_URL_KIND_TEXT, + GHOSTTY_ACTION_OPEN_URL_KIND_UNKNOWN, +} ghostty_action_open_url_kind_e; + +// apprt.action.OpenUrl.C +typedef struct { + ghostty_action_open_url_kind_e kind; + const char* url; + uintptr_t len; +} ghostty_action_open_url_s; + // apprt.Action.Key typedef enum { GHOSTTY_ACTION_QUIT, @@ -711,7 +724,8 @@ typedef enum { GHOSTTY_ACTION_RING_BELL, GHOSTTY_ACTION_UNDO, GHOSTTY_ACTION_REDO, - GHOSTTY_ACTION_CHECK_FOR_UPDATES + GHOSTTY_ACTION_CHECK_FOR_UPDATES, + GHOSTTY_ACTION_OPEN_URL, } ghostty_action_tag_e; typedef union { @@ -739,6 +753,7 @@ typedef union { ghostty_action_color_change_s color_change; ghostty_action_reload_config_s reload_config; ghostty_action_config_change_s config_change; + ghostty_action_open_url_s open_url; } ghostty_action_u; typedef struct { |
