diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-09-08 02:05:57 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-09-08 02:09:51 +0200 |
commit | 58b7930167ecccbe138bbfc7c6c7f44f9dd09107 (patch) | |
tree | 6fe98a2ad6c7fe17ff48215f0cb32fb9031db5c4 /crawl-ref/source/libconsole.h | |
parent | f15db1b054f390612b74db98a4b15159f038ca56 (diff) | |
download | crawl-ref-58b7930167ecccbe138bbfc7c6c7f44f9dd09107.tar.gz crawl-ref-58b7930167ecccbe138bbfc7c6c7f44f9dd09107.zip |
Combine common parts of lib*.h
Having different prototypes for different ports without a good reason is bad.
After unification, it's easier to have, for example, two ports at once.
Diffstat (limited to 'crawl-ref/source/libconsole.h')
-rw-r--r-- | crawl-ref/source/libconsole.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/crawl-ref/source/libconsole.h b/crawl-ref/source/libconsole.h new file mode 100644 index 0000000000..6cae321515 --- /dev/null +++ b/crawl-ref/source/libconsole.h @@ -0,0 +1,48 @@ +#ifndef LIBCONSOLE_H +#define LIBCONSOLE_H + +#include "defines.h" + +void console_startup(); +void console_shutdown(); + +class crawl_view_buffer; + +int get_number_of_lines(); +int get_number_of_cols(); + +void clrscr(void); +void clear_to_end_of_line(); +void gotoxy_sys(int x, int y); +void textcolor(int c); +void textbackground(int c); +void cprintf(const char *format, ...); +bool set_buffering(bool value); + +int wherex(void); +int wherey(void); +void putwch(ucs_t c); +int getchk(void); +int getch_ck(void); +bool kbhit(void); +void delay(unsigned int ms); +void puttext(int x, int y, const crawl_view_buffer &vbuf); +void update_screen(); + +void set_cursor_enabled(bool enabled); +bool is_cursor_enabled(); +void enable_smart_cursor(bool cursor); +bool is_smart_cursor_enabled(); +void set_mouse_enabled(bool enabled); + +inline void put_colour_ch(int colour, unsigned ch) +{ + textcolor(colour); + putwch(ch); +} + +struct coord_def; +coord_def cgetpos(GotoRegion region = GOTO_CRT); +void cgotoxy(int x, int y, GotoRegion region = GOTO_CRT); +GotoRegion get_cursor_region(); +#endif |