summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-01-12 10:15:56 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-01-12 10:15:56 +0000
commitd13169ee237e4e8365bb48a62bbf4e71568eb2ef (patch)
treed5d6f51cfa7dec0833e7810b04e3bcbbb26a349a
parentbe096cda5961961fc25ad04f7ecb626737e95b3a (diff)
Put all palette functions together in the file.
-rw-r--r--usr.bin/tmux/tmux.h4
-rw-r--r--usr.bin/tmux/window.c42
2 files changed, 23 insertions, 23 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index b5f37bffd86..4b9cfd767e1 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.691 2017/01/12 00:19:32 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.692 2017/01/12 10:15:55 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2134,6 +2134,7 @@ void window_pane_alternate_off(struct window_pane *,
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_get_palette(const struct window_pane *, int);
int window_pane_set_mode(struct window_pane *,
const struct window_mode *);
void window_pane_reset_mode(struct window_pane *);
@@ -2152,7 +2153,6 @@ void window_set_name(struct window *, const char *);
void window_remove_ref(struct window *);
void winlink_clear_flags(struct winlink *);
int winlink_shuffle_up(struct session *, struct winlink *);
-int window_pane_get_palette(const struct window_pane *, int);
/* layout.c */
u_int layout_count_cells(struct layout_cell *);
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index 83bca0a8526..a72c95fd4ba 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.179 2017/01/12 00:24:28 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.180 2017/01/12 10:15:55 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1133,6 +1133,26 @@ window_pane_reset_palette(struct window_pane *wp)
wp->flags |= PANE_REDRAW;
}
+int
+window_pane_get_palette(const struct window_pane *wp, int c)
+{
+ int new;
+
+ if (wp == NULL || wp->palette == NULL)
+ return (-1);
+
+ new = -1;
+ if (c < 8)
+ new = wp->palette[c];
+ else if (c >= 90 && c <= 97)
+ new = wp->palette[8 + c - 90];
+ else if (c & COLOUR_FLAG_256)
+ new = wp->palette[c & ~COLOUR_FLAG_256];
+ if (new == 0)
+ return (-1);
+ return (new);
+}
+
static void
window_pane_mode_timer(__unused int fd, __unused short events, void *arg)
{
@@ -1517,23 +1537,3 @@ winlink_shuffle_up(struct session *s, struct winlink *wl)
return (idx);
}
-
-int
-window_pane_get_palette(const struct window_pane *wp, int c)
-{
- int new;
-
- if (wp == NULL || wp->palette == NULL)
- return (-1);
-
- new = -1;
- if (c < 8)
- new = wp->palette[c];
- else if (c >= 90 && c <= 97)
- new = wp->palette[8 + c - 90];
- else if (c & COLOUR_FLAG_256)
- new = wp->palette[c & ~COLOUR_FLAG_256];
- if (new == 0)
- return (-1);
- return (new);
-}