initial commit
[erebus] / erebus / src / console.h
1 #ifndef CONSOLE_H_
2 #define CONSOLE_H_
3
4 #include <drawtext.h>
5
6 enum {
7         CON_KEY_LEFT = 256,
8         CON_KEY_RIGHT,
9         CON_KEY_UP,
10         CON_KEY_DOWN,
11         CON_KEY_INS,
12         CON_KEY_DEL,
13         CON_KEY_HOME,
14         CON_KEY_END,
15         CON_KEY_PGUP,
16         CON_KEY_PGDOWN
17 };
18
19 void con_set_font(struct dtx_font *font, int sz);
20 int con_set_history_size(int hsz);
21 int con_set_output_buffer_size(int sz);
22 void con_set_command_func(void (*func)(const char*, void*), void *cls);
23
24 void con_set_echo(int echo);
25 int con_get_echo(void);
26
27 void con_show(void);
28 void con_hide(void);
29 void con_set_visible(int v);
30 int con_is_visible(void);
31
32 void con_set_size(int lines, int columns);
33 int con_get_size_lines(void);
34 int con_get_size_columns(void);
35
36 /* update returns true if what it did makes a redraw necessary */
37 int con_update(void);
38 void con_draw(void);
39 void con_debug(void);
40
41 void con_input_key(int key);  /* send a keystroke to the console */
42
43 void con_putchar(char c);
44 void con_puts(const char *str);
45 void con_printf(const char *fmt, ...);
46
47
48
49 #endif  /* CONSOLE_H_ */