Rewrite of configuration system to support "regular" curses as well as
[wine/multimedia.git] / include / console.h
blob75587a449fed1feca7150c87ccd066601163d8fe
1 /* console.h */
2 /* Copyright 1998 - Joseph Pranevich */
4 /* Include file for definitions pertaining to Wine's text-console
5 interface.
6 */
8 #ifndef CONSOLE_H
9 #define CONSOLE_H
11 #include <stdio.h>
13 #include "config.h"
15 /* Which libs can be used for wine's curses implementation... */
16 #ifdef HAVE_LIBNCURSES
17 #define WINE_NCURSES
18 #else
19 #ifdef HAVE_LIBCURSES
20 #define WINE_NCURSES
21 #endif
22 #endif
24 #define CONSOLE_DEFAULT_DRIVER "tty"
25 /* If you have problems, try setting the next line to xterm */
26 #define CONSOLE_XTERM_PROG "nxterm" /* We should check for this first... */
28 typedef struct CONSOLE_DRIVER
30 void (*init)();
31 void (*close)();
32 void (*write)(char, int, int, int);
33 void (*moveCursor)(char, char);
34 void (*getCursorPosition)(char *, char *);
35 void (*getCharacterAtCursor)(char *, int *, int *, int *);
36 void (*clearScreen)();
38 /* Keyboard Functions */
39 int (*checkForKeystroke)(char *, char *);
40 void (*getKeystroke)(char *, char *);
42 /* Windowing Functions */
43 void (*resizeScreen)(int, int);
44 void (*notifyResizeScreen)(int, int); /* May be rethought later... */
46 /* Accellerator Functions (Screen) */
47 void (*clearWindow)(char, char, char, char, int, int);
48 void (*scrollUpWindow)(char, char, char, char, char, int, int);
49 void (*scrollDownWindow)(char, char, char, char, char, int, int);
51 /* Accellerator Functions (Keyboard) */
52 char (*getCharacter)();
54 /* Other functions */
55 void (*refresh)();
57 /* Other data */
58 int norefresh;
59 FILE *console_out;
60 FILE *console_in;
62 } CONSOLE_device;
64 CONSOLE_device driver; /* Global driver struct */
66 /* Generic defines */
67 void CONSOLE_Init(char *drivers);
68 void CONSOLE_Close();
69 void CONSOLE_Write(char out, int fg_color, int bg_color, int attribute);
70 void CONSOLE_MoveCursor(char row, char col);
71 void CONSOLE_ClearWindow(char, char, char, char, int, int);
72 void CONSOLE_ScrollUpWindow(char, char, char, char, char, int, int);
73 void CONSOLE_ScrollDownWindow(char, char, char, char, char, int, int);
74 int CONSOLE_CheckForKeystroke(char *, char*);
75 void CONSOLE_GetKeystroke(char *, char *);
76 void CONSOLE_GetCursorPosition(char *, char *);
77 void CONSOLE_GetCharacterAtCursor(char *, int *, int *, int *);
78 void CONSOLE_Refresh();
79 void CONSOLE_SetRefresh(int);
80 int CONSOLE_GetRefresh();
81 void CONSOLE_ClearScreen();
82 char CONSOLE_GetCharacter();
83 void CONSOLE_ResizeScreen();
84 void CONSOLE_NotifyResizeScreen();
85 void CONSOLE_WriteRawString(char *);
87 /* Generic Defines */
88 void GENERIC_Start();
89 void GENERIC_ClearWindow(char, char, char, char, int, int);
90 void GENERIC_ScrollUpWindow(char, char, char, char, char, int, int);
91 void GENERIC_ScrollDownWindow(char, char, char, char, char, int, int);
92 char GENERIC_GetCharacter();
94 /* TTY specific defines */
95 void TTY_Write(char out, int fg_color, int bg_color, int attribute);
96 void TTY_Start();
97 void TTY_GetKeystroke(char *, char *);
99 #ifdef WINE_NCURSES
101 /* ncurses defines */
102 void NCURSES_Write(char out, int fg_color, int bg_color, int attribute);
103 void NCURSES_Start();
104 void NCURSES_Init();
105 void NCURSES_Close();
106 int NCURSES_CheckForKeystroke(char *, char *);
107 void NCURSES_GetKeystroke(char *, char *);
108 void NCURSES_MoveCursor(char ,char);
109 void NCURSES_GetCursorPosition(char *, char *);
110 void NCURSES_GetCharacterAtCursor(char *, int *, int *, int *);
111 void NCURSES_Refresh();
112 void NCURSES_ClearScreen();
113 void NCURSES_NotifyResizeScreen(int x, int y);
115 #endif /* WINE_NCURSES */
117 /* Xterm specific defines */
118 void XTERM_Start();
119 void XTERM_Close();
120 void XTERM_Init();
121 void XTERM_ResizeScreen(int x, int y);
123 #endif /* CONSOLE_H */