1 #include "../include/curses.h"
9 unsigned int _COLOUR_PAIRS = 4;
10 unsigned int _COLOURS = 8;
11 unsigned short _COLS = 80;
12 unsigned short _LINES = 25;
14 static struct termios original, runtime;
16 void _init_screen( struct _curses_screen *scr __unused ) {
17 tcgetattr(fileno(stdin),&original);
18 tcgetattr(fileno(stdin),&runtime);
19 runtime.c_lflag &= ~(ICANON|ECHO);
20 tcsetattr(fileno(stdin),TCSANOW,&runtime);
21 //printf("%c[=%dh",ESC,MODE);
22 LINES = 25; COLS = 80;
25 void _exit_screen( struct _curses_screen *scr __unused ) {
26 tcsetattr(fileno(stdin),TCSANOW,&original);
31 void _movetoyx( struct _curses_screen *scr __unused, unsigned int y, unsigned int x ) {
32 printf( "%c[%d;%dH", ESC, y+1, x+1 );
35 void _putc( struct _curses_screen *scr __unused, chtype c ) {
36 unsigned short pairno;
37 pairno = (unsigned short)(( c & A_COLOUR ) >> CPAIR_SHIFT);
39 // print rendition (colour and attrs)
40 //printf( "%c[%d;%d",ESC,
41 // cpairs[pairno][0], cpairs[pairno][1] );
42 // print rendition (character)
43 //printf("char is \"%d\"", c );
47 int _getc( struct _curses_screen *scr __unused ) {
51 bool _peek( struct _curses_screen *scr __unused ) {
53 if ( ( c = getchar() ) != EOF ) {
56 } else { return FALSE; }
62 .movetoyx = _movetoyx,