summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-05-10 14:12:48 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-05-10 14:12:48 +0000
commit68b808b8d8aaab2a71ae4bc5b9cce1ceedab740a (patch)
tree70723eb61929599659d33e552636979b8c2eb686 /usr.bin/tmux/tmux.h
parent3c461c0857c11535382c040fd2bc5173f09404c6 (diff)
Add a function to draw a simple menu onto a screen.
Diffstat (limited to 'usr.bin/tmux/tmux.h')
-rw-r--r--usr.bin/tmux/tmux.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 05b75f6ecff..74bf710149b 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.893 2019/05/09 14:09:32 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.894 2019/05/10 14:12:47 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -748,6 +748,21 @@ struct screen_redraw_ctx {
#define screen_hsize(s) ((s)->grid->hsize)
#define screen_hlimit(s) ((s)->grid->hlimit)
+/* Menu item. */
+struct menu_item {
+ char *name;
+ char *command;
+ key_code key;
+};
+
+/* Menu. */
+struct menu {
+ char *title;
+ struct menu_item *items;
+ u_int count;
+ u_int width;
+};
+
/*
* Window mode. Windows can be in several modes and this is used to call the
* right function to handle input and output.
@@ -1687,7 +1702,7 @@ char *paste_make_sample(struct paste_buffer *);
#define FORMAT_PANE 0x80000000U
#define FORMAT_WINDOW 0x40000000U
struct format_tree;
-const char *format_skip(const char *s, const char *end);
+const char *format_skip(const char *, const char *);
int format_true(const char *);
struct format_tree *format_create(struct client *, struct cmdq_item *, int,
int);
@@ -2200,6 +2215,7 @@ void screen_write_fast_copy(struct screen_write_ctx *, struct screen *,
u_int, u_int, u_int, u_int);
void screen_write_hline(struct screen_write_ctx *, u_int, int, int);
void screen_write_vline(struct screen_write_ctx *, u_int, int, int);
+void screen_write_menu(struct screen_write_ctx *, struct menu *, int);
void screen_write_box(struct screen_write_ctx *, u_int, u_int);
void screen_write_preview(struct screen_write_ctx *, struct screen *, u_int,
u_int);