summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-01-07 15:28:14 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-01-07 15:28:14 +0000
commit73518b1640ec808c1cb586ebc1a3be51a0856fd5 (patch)
treea57979fb68f5aba780ec2dc34ac6fa82bdbe612d /usr.bin/tmux/tmux.h
parentc800158f37bd780643e37fdd3ba025cec53a5cb6 (diff)
Add support for the OSC 4 and OSC 104 palette setting escape sequences,
from S Gilles.
Diffstat (limited to 'usr.bin/tmux/tmux.h')
-rw-r--r--usr.bin/tmux/tmux.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index e0d6f860db6..722520a8743 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.684 2017/01/06 11:57:03 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.685 2017/01/07 15:28:13 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -576,6 +576,7 @@ enum utf8_state {
#define GRID_FLAG_PADDING 0x4
#define GRID_FLAG_EXTENDED 0x8
#define GRID_FLAG_SELECTED 0x10
+#define GRID_FLAG_NOPALETTE 0x20
/* Grid line flags. */
#define GRID_LINE_WRAPPED 0x1
@@ -829,6 +830,8 @@ struct window_pane {
struct grid_cell colgc;
+ int *palette;
+
int pipe_fd;
struct bufferevent *pipe_event;
size_t pipe_off;
@@ -857,6 +860,11 @@ struct window_pane {
TAILQ_HEAD(window_panes, window_pane);
RB_HEAD(window_pane_tree, window_pane);
+#define WINDOW_PANE_PALETTE_HAS(wp, c) \
+ ((wp) != NULL && (wp)->palette != NULL && \
+ ((c) < 0x100 || (c) & COLOUR_FLAG_256) && \
+ (wp)->palette[(c) & 0xff] != 0)
+
/* Window structure. */
struct window {
u_int id;
@@ -2126,6 +2134,9 @@ void window_pane_alternate_on(struct window_pane *,
struct grid_cell *, int);
void window_pane_alternate_off(struct window_pane *,
struct grid_cell *, int);
+void window_pane_set_palette(struct window_pane *, u_int, int);
+void window_pane_unset_palette(struct window_pane *, u_int);
+void window_pane_reset_palette(struct window_pane *);
int window_pane_set_mode(struct window_pane *,
const struct window_mode *);
void window_pane_reset_mode(struct window_pane *);