00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __HTCURSES_H__
00022 #define __HTCURSES_H__
00023
00024 #include "htio.h"
00025 #include "common.h"
00026
00027 #define CHAR_LINEV (unsigned char)'\xb3'
00028 #define CHAR_LINEH (unsigned char)'\xc4'
00029 #define CHAR_LINEV_DBL (unsigned char)'\xba'
00030 #define CHAR_LINEH_DBL (unsigned char)'\xcd'
00031 #define CHAR_LINEH_BU (unsigned char)'\xdf'
00032 #define CHAR_LINEH_BL (unsigned char)'\xdc'
00033 #define CHAR_BORDERTL (unsigned char)'\xc3'
00034 #define CHAR_BORDERTR (unsigned char)'\xb4'
00035 #define CHAR_BORDERTU (unsigned char)'\xc2'
00036 #define CHAR_BORDERTD (unsigned char)'\xc1'
00037 #define CHAR_CORNERUL (unsigned char)'\xda'
00038 #define CHAR_CORNERLL (unsigned char)'\xc0'
00039 #define CHAR_CORNERUR (unsigned char)'\xbf'
00040 #define CHAR_CORNERLR (unsigned char)'\xd9'
00041 #define CHAR_CORNERUL_DBL (unsigned char)'\xc9'
00042 #define CHAR_CORNERLL_DBL (unsigned char)'\xc8'
00043 #define CHAR_CORNERUR_DBL (unsigned char)'\xbb'
00044 #define CHAR_CORNERLR_DBL (unsigned char)'\xbc'
00045 #define CHAR_FILLED_L (unsigned char)'\xb0'
00046 #define CHAR_FILLED_M (unsigned char)'\xb1'
00047 #define CHAR_FILLED_H (unsigned char)'\xb2'
00048 #define CHAR_FILLED_F (unsigned char)'\xdb'
00049 #define CHAR_FILLED_HU (unsigned char)'\xdf'
00050 #define CHAR_FILLED_HL (unsigned char)'\xdc'
00051 #define CHAR_QUAD_SMALL (unsigned char)'\xfe'
00052 #define CHAR_ARROW_UP (unsigned char)'\x18'
00053 #define CHAR_ARROW_DOWN (unsigned char)'\x19'
00054 #define CHAR_ARROWBIG_UP (unsigned char)'\x1e'
00055 #define CHAR_ARROWBIG_DOWN (unsigned char)'\x1f'
00056 #define CHAR_ARROWBIG_LEFT (unsigned char)'\x11'
00057 #define CHAR_ARROWBIG_RIGHT (unsigned char)'\x10'
00058 #define CHAR_RADIO (unsigned char)'\x7'
00059
00060 class screendrawbuf: public genericdrawbuf {
00061 protected:
00062 unsigned short *buf;
00063 int screensel;
00064 int cursorx, cursory;
00065 bool cursorhidden;
00066 bool cursoroverwrite;
00067 public:
00068 screendrawbuf(char *title);
00069 ~screendrawbuf();
00070 virtual void b_fill(int x, int y, int w, int h, int c, int ch);
00071 virtual void b_printchar(int x, int y, int c, int ch);
00072 virtual int b_lprint(int x, int y, int c, int l, char *text);
00073 virtual int b_lprintw(int x, int y, int c, int l, int *text);
00074 virtual void b_resize(int rw, int rh);
00075 virtual void b_rmove(int rx, int ry);
00076 virtual void b_setbounds(bounds *b);
00077
00078 void drawbuffer(drawbuf *buf, int x, int y, bounds *clipping);
00079 void show();
00080 void getcursor(int *x, int *y);
00081 void hidecursor();
00082 void showcursor();
00083 void setcursor(int x, int y);
00084 void setcursormode(bool override);
00085 };
00086
00087 #endif