00001
00002
00003
00004
00005 #ifndef LIBUNIX_H
00006 #define LIBUNIX_H
00007
00008 #ifndef O_BINARY
00009 #define O_BINARY 0
00010 #endif
00011
00012 #ifndef USE_TILE
00013
00014
00015
00016 #ifdef UNICODE_GLYPHS
00017 typedef unsigned int screen_buffer_t;
00018 #else
00019 typedef unsigned short screen_buffer_t;
00020 #endif
00021
00022 #include <stdio.h>
00023
00024 class crawl_view_buffer;
00025
00026 int get_number_of_lines();
00027 int get_number_of_cols();
00028
00029 int getch_ck(void);
00030 int clrscr(void);
00031 int cprintf(const char *format,...);
00032 int gotoxy_sys(int x, int y);
00033 void fakecursorxy(int x, int y);
00034 extern "C" char *itoa(int value, char *strptr, int radix);
00035 int kbhit(void);
00036 int putch(unsigned char chr);
00037 int putwch(unsigned chr);
00038 void put_colour_ch(int colour, unsigned ch);
00039 int translate_keypad(int keyin);
00040 int wherex(void);
00041 int wherey(void);
00042 int window(int x1, int y1, int x2, int y2);
00043 void puttext(int x, int y, const crawl_view_buffer &vbuf);
00044 void update_screen(void);
00045 void clear_to_end_of_line(void);
00046 void clear_to_end_of_screen(void);
00047
00048 void delay(unsigned long time);
00049 void unixcurses_shutdown(void);
00050 void unixcurses_startup(void);
00051 void textbackground(int bg);
00052 void textcolor(int col);
00053 void textattr(int col);
00054
00055 void set_cursor_enabled(bool enabled);
00056 bool is_cursor_enabled();
00057 inline void enable_smart_cursor(bool) { }
00058 inline bool is_smart_cursor_enabled() { return (false); }
00059
00060 void set_mouse_enabled(bool enabled);
00061
00062 #if defined(SIGHUP_SAVE) && defined(USE_UNIX_SIGNALS)
00063 void sighup_save_and_exit();
00064 #endif
00065
00066 #ifndef _LIBUNIX_IMPLEMENTATION
00067
00068 extern "C"
00069 {
00070 int getstr(char *);
00071 int getch(void);
00072 int noecho(void);
00073 int echo(void);
00074 char *strlwr(char *str);
00075 }
00076 #endif
00077
00078
00079 #endif
00080 #endif