about summary refs log tree commit diff stats
path: root/termbox
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-10 08:34:12 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-10 08:55:18 -0700
commitdc1323e936fb79823767f85529be15e0456b3169 (patch)
treea3313c1c41ffd67a506f92dabc77c7867a8c8dd9 /termbox
parent3f367cb9466131f95c11c24df3aac7057143587b (diff)
downloadmu-dc1323e936fb79823767f85529be15e0456b3169.tar.gz
1323 - keyboard supports backspace and newline
Lots mixed into this commit:
  some off-by-one errors in display.cc
  a new transform to translate jump labels that I'd somehow never gotten around to supporting
Diffstat (limited to 'termbox')
-rw-r--r--termbox/libtermbox.abin0 -> 51148 bytes
-rw-r--r--termbox/tags173
-rw-r--r--termbox/termbox.c5
-rw-r--r--termbox/termbox.obin0 -> 48352 bytes
-rw-r--r--termbox/utf8.obin0 -> 2320 bytes
5 files changed, 174 insertions, 4 deletions
diff --git a/termbox/libtermbox.a b/termbox/libtermbox.a
new file mode 100644
index 00000000..4b6742c1
--- /dev/null
+++ b/termbox/libtermbox.a
Binary files differdiff --git a/termbox/tags b/termbox/tags
new file mode 100644
index 00000000..0a798f4e
--- /dev/null
+++ b/termbox/tags
@@ -0,0 +1,173 @@
+!_TAG_FILE_FORMAT	2	/extended format; --format=1 will not append ;" to lines/
+!_TAG_FILE_SORTED	1	/0=unsorted, 1=sorted, 2=foldcase/
+!_TAG_PROGRAM_AUTHOR	Darren Hiebert	/dhiebert@users.sourceforge.net/
+!_TAG_PROGRAM_NAME	Exuberant Ctags	//
+!_TAG_PROGRAM_URL	http://ctags.sourceforge.net	/official site/
+!_TAG_PROGRAM_VERSION	5.9~svn20110310	//
+CELL	termbox.c	28;"	d	file:
+ENOUGH_DATA_FOR_PARSING	termbox.c	515;"	d	file:
+IS_CURSOR_HIDDEN	termbox.c	29;"	d	file:
+LAST_ATTR_INIT	termbox.c	400;"	d	file:
+LAST_COORD_INIT	termbox.c	30;"	d	file:
+TB_BLACK	termbox.h	20;"	d
+TB_BLUE	termbox.h	24;"	d
+TB_BOLD	termbox.h	31;"	d
+TB_CYAN	termbox.h	26;"	d
+TB_DEFAULT	termbox.h	19;"	d
+TB_EFAILED_TO_OPEN_TTY	termbox.h	39;"	d
+TB_EOF	termbox.h	203;"	d
+TB_EPIPE_TRAP_ERROR	termbox.h	42;"	d
+TB_EUNSUPPORTED_TERMINAL	termbox.h	38;"	d
+TB_EVENT_KEY	termbox.h	97;"	d
+TB_EVENT_MOUSE	termbox.h	99;"	d
+TB_EVENT_RESIZE	termbox.h	98;"	d
+TB_GREEN	termbox.h	22;"	d
+TB_HIDE_CURSOR	termbox.h	73;"	d
+TB_KEY_ARROW_DOWN	termbox.h	125;"	d
+TB_KEY_ARROW_LEFT	termbox.h	126;"	d
+TB_KEY_ARROW_RIGHT	termbox.h	127;"	d
+TB_KEY_ARROW_UP	termbox.h	124;"	d
+TB_KEY_BACKSPACE	termbox.h	144;"	d
+TB_KEY_BACKSPACE2	termbox.h	178;"	d
+TB_KEY_CTRL_2	termbox.h	136;"	d
+TB_KEY_CTRL_3	termbox.h	168;"	d
+TB_KEY_CTRL_4	termbox.h	169;"	d
+TB_KEY_CTRL_5	termbox.h	171;"	d
+TB_KEY_CTRL_6	termbox.h	173;"	d
+TB_KEY_CTRL_7	termbox.h	174;"	d
+TB_KEY_CTRL_8	termbox.h	179;"	d
+TB_KEY_CTRL_A	termbox.h	137;"	d
+TB_KEY_CTRL_B	termbox.h	138;"	d
+TB_KEY_CTRL_BACKSLASH	termbox.h	170;"	d
+TB_KEY_CTRL_C	termbox.h	139;"	d
+TB_KEY_CTRL_D	termbox.h	140;"	d
+TB_KEY_CTRL_E	termbox.h	141;"	d
+TB_KEY_CTRL_F	termbox.h	142;"	d
+TB_KEY_CTRL_G	termbox.h	143;"	d
+TB_KEY_CTRL_H	termbox.h	145;"	d
+TB_KEY_CTRL_I	termbox.h	147;"	d
+TB_KEY_CTRL_J	termbox.h	148;"	d
+TB_KEY_CTRL_K	termbox.h	149;"	d
+TB_KEY_CTRL_L	termbox.h	150;"	d
+TB_KEY_CTRL_LSQ_BRACKET	termbox.h	167;"	d
+TB_KEY_CTRL_M	termbox.h	152;"	d
+TB_KEY_CTRL_N	termbox.h	153;"	d
+TB_KEY_CTRL_O	termbox.h	154;"	d
+TB_KEY_CTRL_P	termbox.h	155;"	d
+TB_KEY_CTRL_Q	termbox.h	156;"	d
+TB_KEY_CTRL_R	termbox.h	157;"	d
+TB_KEY_CTRL_RSQ_BRACKET	termbox.h	172;"	d
+TB_KEY_CTRL_S	termbox.h	158;"	d
+TB_KEY_CTRL_SLASH	termbox.h	175;"	d
+TB_KEY_CTRL_T	termbox.h	159;"	d
+TB_KEY_CTRL_TILDE	termbox.h	135;"	d
+TB_KEY_CTRL_U	termbox.h	160;"	d
+TB_KEY_CTRL_UNDERSCORE	termbox.h	176;"	d
+TB_KEY_CTRL_V	termbox.h	161;"	d
+TB_KEY_CTRL_W	termbox.h	162;"	d
+TB_KEY_CTRL_X	termbox.h	163;"	d
+TB_KEY_CTRL_Y	termbox.h	164;"	d
+TB_KEY_CTRL_Z	termbox.h	165;"	d
+TB_KEY_DELETE	termbox.h	119;"	d
+TB_KEY_END	termbox.h	121;"	d
+TB_KEY_ENTER	termbox.h	151;"	d
+TB_KEY_ESC	termbox.h	166;"	d
+TB_KEY_F1	termbox.h	106;"	d
+TB_KEY_F10	termbox.h	115;"	d
+TB_KEY_F11	termbox.h	116;"	d
+TB_KEY_F12	termbox.h	117;"	d
+TB_KEY_F2	termbox.h	107;"	d
+TB_KEY_F3	termbox.h	108;"	d
+TB_KEY_F4	termbox.h	109;"	d
+TB_KEY_F5	termbox.h	110;"	d
+TB_KEY_F6	termbox.h	111;"	d
+TB_KEY_F7	termbox.h	112;"	d
+TB_KEY_F8	termbox.h	113;"	d
+TB_KEY_F9	termbox.h	114;"	d
+TB_KEY_HOME	termbox.h	120;"	d
+TB_KEY_INSERT	termbox.h	118;"	d
+TB_KEY_MOUSE_LEFT	termbox.h	128;"	d
+TB_KEY_MOUSE_MIDDLE	termbox.h	130;"	d
+TB_KEY_MOUSE_RELEASE	termbox.h	131;"	d
+TB_KEY_MOUSE_RIGHT	termbox.h	129;"	d
+TB_KEY_MOUSE_WHEEL_DOWN	termbox.h	133;"	d
+TB_KEY_MOUSE_WHEEL_UP	termbox.h	132;"	d
+TB_KEY_PGDN	termbox.h	123;"	d
+TB_KEY_PGUP	termbox.h	122;"	d
+TB_KEY_SPACE	termbox.h	177;"	d
+TB_KEY_TAB	termbox.h	146;"	d
+TB_MAGENTA	termbox.h	25;"	d
+TB_RED	termbox.h	21;"	d
+TB_REVERSE	termbox.h	33;"	d
+TB_UNDERLINE	termbox.h	32;"	d
+TB_WHITE	termbox.h	27;"	d
+TB_YELLOW	termbox.h	23;"	d
+WRITE_INT	termbox.c	292;"	d	file:
+WRITE_LITERAL	termbox.c	291;"	d	file:
+back_buffer	termbox.c	/^static struct cellbuf back_buffer;$/;"	v	typeref:struct:cellbuf	file:
+background	termbox.c	/^static uint16_t background = TB_DEFAULT;$/;"	v	file:
+bg	termbox.h	/^  uint16_t bg;  \/* background color and attributes *\/$/;"	m	struct:tb_cell
+buffer_size_change_request	termbox.c	/^static volatile int buffer_size_change_request;$/;"	v	file:
+cellbuf	termbox.c	/^struct cellbuf {$/;"	s	file:
+cellbuf_clear	termbox.c	/^static void cellbuf_clear(struct cellbuf *buf)$/;"	f	file:
+cellbuf_free	termbox.c	/^static void cellbuf_free(struct cellbuf *buf)$/;"	f	file:
+cellbuf_init	termbox.c	/^static void cellbuf_init(struct cellbuf *buf, int width, int height)$/;"	f	file:
+cellbuf_resize	termbox.c	/^static void cellbuf_resize(struct cellbuf *buf, int width, int height)$/;"	f	file:
+cells	termbox.c	/^  struct tb_cell *cells;$/;"	m	struct:cellbuf	typeref:struct:cellbuf::tb_cell	file:
+ch	termbox.h	/^  uint32_t ch;  \/* unicode character *\/$/;"	m	struct:tb_cell
+ch	termbox.h	/^  uint32_t ch;$/;"	m	struct:tb_event
+convertnum	termbox.c	/^static int convertnum(uint32_t num, char* buf) {$/;"	f	file:
+cursor_x	termbox.c	/^static int cursor_x = -1;$/;"	v	file:
+cursor_y	termbox.c	/^static int cursor_y = -1;$/;"	v	file:
+fg	termbox.h	/^  uint16_t fg;  \/* foreground color and attributes *\/$/;"	m	struct:tb_cell
+foreground	termbox.c	/^static uint16_t foreground = TB_DEFAULT;$/;"	v	file:
+front_buffer	termbox.c	/^static struct cellbuf front_buffer;$/;"	v	typeref:struct:cellbuf	file:
+get_term_size	termbox.c	/^static void get_term_size(int *w, int *h)$/;"	f	file:
+h	termbox.h	/^  int32_t h;$/;"	m	struct:tb_event
+height	termbox.c	/^  int height;$/;"	m	struct:cellbuf	file:
+inout	termbox.c	/^static int inout;$/;"	v	file:
+input_buffer	termbox.c	/^static struct bytebuffer input_buffer;$/;"	v	typeref:struct:bytebuffer	file:
+key	termbox.h	/^  uint16_t key;$/;"	m	struct:tb_event
+lastx	termbox.c	/^static int lastx = LAST_COORD_INIT;$/;"	v	file:
+lasty	termbox.c	/^static int lasty = LAST_COORD_INIT;$/;"	v	file:
+orig_tios	termbox.c	/^static struct termios orig_tios;$/;"	v	typeref:struct:termios	file:
+output_buffer	termbox.c	/^static struct bytebuffer output_buffer;$/;"	v	typeref:struct:bytebuffer	file:
+read_up_to	termbox.c	/^static int read_up_to(int n) {$/;"	f	file:
+send_attr	termbox.c	/^static void send_attr(uint16_t fg, uint16_t bg)$/;"	f	file:
+send_char	termbox.c	/^static void send_char(int x, int y, uint32_t c)$/;"	f	file:
+send_clear	termbox.c	/^static void send_clear(void)$/;"	f	file:
+sigwinch_handler	termbox.c	/^static void sigwinch_handler(int xxx)$/;"	f	file:
+tb_cell	termbox.h	/^struct tb_cell {$/;"	s
+tb_cell_buffer	termbox.c	/^struct tb_cell *tb_cell_buffer()$/;"	f
+tb_change_cell	termbox.c	/^void tb_change_cell(int x, int y, uint32_t ch, uint16_t fg, uint16_t bg)$/;"	f
+tb_clear	termbox.c	/^void tb_clear(void)$/;"	f
+tb_event	termbox.h	/^struct tb_event {$/;"	s
+tb_height	termbox.c	/^int tb_height(void)$/;"	f
+tb_init	termbox.c	/^int tb_init(void)$/;"	f
+tb_peek_event	termbox.c	/^int tb_peek_event(struct tb_event *event, int timeout)$/;"	f
+tb_poll_event	termbox.c	/^int tb_poll_event(struct tb_event *event)$/;"	f
+tb_present	termbox.c	/^void tb_present(void)$/;"	f
+tb_set_clear_attributes	termbox.c	/^void tb_set_clear_attributes(uint16_t fg, uint16_t bg)$/;"	f
+tb_set_cursor	termbox.c	/^void tb_set_cursor(int cx, int cy)$/;"	f
+tb_shutdown	termbox.c	/^void tb_shutdown(void)$/;"	f
+tb_utf8_char_length	utf8.c	/^int tb_utf8_char_length(char c)$/;"	f
+tb_utf8_char_to_unicode	utf8.c	/^int tb_utf8_char_to_unicode(uint32_t *out, const char *c)$/;"	f
+tb_utf8_unicode_to_char	utf8.c	/^int tb_utf8_unicode_to_char(char *out, uint32_t c)$/;"	f
+tb_width	termbox.c	/^int tb_width(void)$/;"	f
+termh	termbox.c	/^static int termh = -1;$/;"	v	file:
+termw	termbox.c	/^static int termw = -1;$/;"	v	file:
+type	termbox.h	/^  uint8_t type;$/;"	m	struct:tb_event
+update_size	termbox.c	/^static void update_size(void)$/;"	f	file:
+update_term_size	termbox.c	/^static void update_term_size(void)$/;"	f	file:
+utf8_length	utf8.c	/^static const unsigned char utf8_length[256] = {$/;"	v	file:
+utf8_mask	utf8.c	/^static const unsigned char utf8_mask[6] = {$/;"	v	file:
+w	termbox.h	/^  int32_t w;$/;"	m	struct:tb_event
+wait_fill_event	termbox.c	/^static int wait_fill_event(struct tb_event *event, struct timeval *timeout)$/;"	f	file:
+width	termbox.c	/^  int width;$/;"	m	struct:cellbuf	file:
+winch_fds	termbox.c	/^static int winch_fds[2];$/;"	v	file:
+write_cursor	termbox.c	/^static void write_cursor(int x, int y) {$/;"	f	file:
+write_sgr	termbox.c	/^static void write_sgr(uint16_t fg, uint16_t bg) {$/;"	f	file:
+write_sgr_bg	termbox.c	/^static void write_sgr_bg(uint16_t bg) {$/;"	f	file:
+write_sgr_fg	termbox.c	/^static void write_sgr_fg(uint16_t fg) {$/;"	f	file:
+x	termbox.h	/^  int32_t x;$/;"	m	struct:tb_event
+y	termbox.h	/^  int32_t y;$/;"	m	struct:tb_event
diff --git a/termbox/termbox.c b/termbox/termbox.c
index 13ef1359..2fbbf5b4 100644
--- a/termbox/termbox.c
+++ b/termbox/termbox.c
@@ -130,10 +130,7 @@ int tb_init(void)
 
 void tb_shutdown(void)
 {
-  if (termw == -1) {
-    fputs("tb_shutdown() should not be called twice.", stderr);
-    abort();
-  }
+  if (termw == -1) return;
 
   bytebuffer_puts(&output_buffer, funcs[T_SHOW_CURSOR]);
   bytebuffer_puts(&output_buffer, funcs[T_SGR0]);
diff --git a/termbox/termbox.o b/termbox/termbox.o
new file mode 100644
index 00000000..074741b5
--- /dev/null
+++ b/termbox/termbox.o
Binary files differdiff --git a/termbox/utf8.o b/termbox/utf8.o
new file mode 100644
index 00000000..2506bab2
--- /dev/null
+++ b/termbox/utf8.o
Binary files differ