aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-31 10:12:07 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-07 15:33:31 +0000
commit2cc84db97978388475504592c88911046bcd2eb6 (patch)
tree91efd350b53a6b296c0e78eb5781ef0e59cdddbf /terminal.h
parentconfig: free URL bindings (diff)
urls: initial support for detecting URLs and rendering jump-labels
The jump labels work, but is currently hardcoded to use xdg-open
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/terminal.h b/terminal.h
index 17873c40..24183c7b 100644
--- a/terminal.h
+++ b/terminal.h
@@ -223,6 +223,14 @@ enum term_surface {
typedef tll(struct ptmx_buffer) ptmx_buffer_list_t;
+struct url {
+ wchar_t *url;
+ wchar_t *text;
+ wchar_t key[4];
+ struct coord start;
+ struct coord end;
+};
+
struct terminal {
struct fdm *fdm;
struct reaper *reaper;
@@ -421,6 +429,7 @@ struct terminal {
bool csd;
bool search;
bool title;
+ bool urls;
} refresh;
/* Scheduled for rendering, in the next frame callback */
@@ -429,6 +438,7 @@ struct terminal {
bool csd;
bool search;
bool title;
+ bool urls;
} pending;
bool margins; /* Someone explicitly requested a refresh of the margins */
@@ -499,6 +509,9 @@ struct terminal {
unsigned max_height; /* Maximum image height, in pixels */
} sixel;
+ tll(struct url) urls;
+ wchar_t url_keys[5];
+
#if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED
struct {
bool enabled;
@@ -646,3 +659,6 @@ void term_ime_disable(struct terminal *term);
void term_ime_reset(struct terminal *term);
void term_ime_set_cursor_rect(
struct terminal *term, int x, int y, int width, int height);
+
+void term_urls_reset(struct terminal *term);
+void term_collect_urls(struct terminal *term);