7 /* This is the console driver for systems that support the ncurses
11 /* Actually, this should work for curses, as well. But there may be
12 individual functions that are unsupported in plain curses or other
13 variants. Those should be detected and special-cased by autoconf.
16 /* When creating new drivers, you need to assign all the functions that
17 that driver supports into the driver struct. If it is a supplementary
18 driver, it should make sure to perserve the old values.
23 #undef ERR /* Use ncurses's err() */
28 /* This should be the root driver so we can ignore anything
29 already in the struct. */
31 driver
.norefresh
= FALSE
;
33 driver
.init
= NCURSES_Init
;
34 driver
.write
= NCURSES_Write
;
35 driver
.close
= NCURSES_Close
;
36 driver
.moveCursor
= NCURSES_MoveCursor
;
37 driver
.getCursorPosition
= NCURSES_GetCursorPosition
;
38 driver
.getCharacterAtCursor
= NCURSES_GetCharacterAtCursor
;
39 driver
.clearScreen
= NCURSES_ClearScreen
;
41 driver
.checkForKeystroke
= NCURSES_CheckForKeystroke
;
42 driver
.getKeystroke
= NCURSES_GetKeystroke
;
44 driver
.refresh
= NCURSES_Refresh
;
53 intrflush(stdscr
, FALSE
);
55 nodelay(stdscr
, TRUE
);
58 void NCURSES_Write(char output
, int fg
, int bg
, int attribute
)
60 /* We can discard all extended information. */
69 void NCURSES_GetKeystroke(char *scan
, char *ascii
)
71 while (!NCURSES_CheckForKeystroke(scan
, ascii
))
72 {} /* Wait until keystroke is detected */
74 /* When it is detected, we will already have the right value
75 in scan and ascii, but we need to take this keystroke
80 int NCURSES_CheckForKeystroke(char *scan
, char *ascii
)
82 /* We don't currently support scan codes here */
92 ungetch(temp
); /* Keystroke not removed from buffer */
98 void NCURSES_MoveCursor(char row
, char col
)
103 void NCURSES_GetCursorPosition(char *row
, char *col
)
107 getyx(stdscr
, trow
, tcol
); /* MACRO, no need to pass pointer */
113 void NCURSES_GetCharacterAtCursor(char *ch
, int *fg_color
, int
114 *bg_color
, int *attribute
)
116 /* We will eventually have to convert the color data */
123 void NCURSES_Refresh()
128 void NCURSES_ClearScreen()
133 #endif /* WINE_NCURSES */