Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbejy@wpi.edu>
[wine/multimedia.git] / include / console.h
blobc84f411f3dc1f463920ad04f0a3fe394138c9b56
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>
12 #include "config.h"
14 /* Can we compile with curses/ncurses? */
15 #if ( (defined(HAVE_LIBNCURSES) || defined(HAVE_LIBCURSES)) && \
16 (defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)) \
18 # define WINE_NCURSES
19 #else
20 # undef WINE_NCURSES
21 #endif
23 #define CONSOLE_DEFAULT_DRIVER "tty"
25 typedef struct CONSOLE_DRIVER
27 void (*init)(void);
28 void (*close)(void);
29 void (*write)(char, int, int, int);
30 void (*moveCursor)(char, char);
31 void (*getCursorPosition)(char *, char *);
32 void (*getCharacterAtCursor)(char *, int *, int *, int *);
33 void (*clearScreen)(void);
35 /* Color-control functions */
36 int (*allocColor)(int color);
37 void (*setBackgroundColor)(int fg, int bg);
38 void (*getBackgroundColor)(int *fg, int *bg);
40 /* Keyboard Functions */
41 int (*checkForKeystroke)(char *, char *);
42 void (*getKeystroke)(char *, char *);
44 /* Windowing Functions */
45 void (*resizeScreen)(int, int);
46 void (*notifyResizeScreen)(int, int); /* May be rethought later... */
48 /* Accellerator Functions (Screen) */
49 void (*clearWindow)(char, char, char, char, int, int);
50 void (*scrollUpWindow)(char, char, char, char, char, int, int);
51 void (*scrollDownWindow)(char, char, char, char, char, int, int);
53 /* Accellerator Functions (Keyboard) */
54 char (*getCharacter)(void);
56 /* Other functions */
57 void (*refresh)(void);
59 /* Other data */
60 int norefresh;
61 char *driver_list;
62 FILE *console_out;
63 FILE *console_in;
64 int x_res;
65 int y_res;
67 } CONSOLE_device;
69 extern CONSOLE_device driver; /* Global driver struct */
71 /* Generic defines */
72 int CONSOLE_Init(char *drivers);
73 void CONSOLE_Close();
74 void CONSOLE_Write(char out, int fg_color, int bg_color, int attribute);
75 void CONSOLE_MoveCursor(char row, char col);
76 void CONSOLE_ClearWindow(char, char, char, char, int, int);
77 void CONSOLE_ScrollUpWindow(char, char, char, char, char, int, int);
78 void CONSOLE_ScrollDownWindow(char, char, char, char, char, int, int);
79 int CONSOLE_CheckForKeystroke(char *, char*);
80 void CONSOLE_GetKeystroke(char *, char *);
81 void CONSOLE_GetCursorPosition(char *, char *);
82 void CONSOLE_GetCharacterAtCursor(char *, int *, int *, int *);
83 void CONSOLE_Refresh(void);
84 void CONSOLE_SetRefresh(int);
85 int CONSOLE_GetRefresh(void);
86 void CONSOLE_ClearScreen(void);
87 char CONSOLE_GetCharacter(void);
88 void CONSOLE_ResizeScreen(int, int);
89 void CONSOLE_NotifyResizeScreen(int, int);
90 void CONSOLE_WriteRawString(char *);
91 int CONSOLE_AllocColor(int);
92 void CONSOLE_SetBackgroundColor(int fg, int bg);
93 void CONSOLE_GetBackgroundColor(int *fg, int *bg);
95 /* Generic Defines */
96 void GENERIC_Start(void);
97 void GENERIC_ClearWindow(char, char, char, char, int, int);
98 void GENERIC_ScrollUpWindow(char, char, char, char, char, int, int);
99 void GENERIC_ScrollDownWindow(char, char, char, char, char, int, int);
100 char GENERIC_GetCharacter(void);
102 /* TTY specific defines */
103 void TTY_Write(char out, int fg_color, int bg_color, int attribute);
104 void TTY_Start(void);
105 void TTY_GetKeystroke(char *, char *);
107 #ifdef WINE_NCURSES
109 /* ncurses defines */
110 void NCURSES_Write(char out, int fg_color, int bg_color, int attribute);
111 void NCURSES_Start(void);
112 void NCURSES_Init(void);
113 void NCURSES_Close(void);
114 int NCURSES_CheckForKeystroke(char *, char *);
115 void NCURSES_GetKeystroke(char *, char *);
116 void NCURSES_MoveCursor(char ,char);
117 void NCURSES_GetCursorPosition(char *, char *);
118 void NCURSES_GetCharacterAtCursor(char *, int *, int *, int *);
119 void NCURSES_Refresh(void);
120 void NCURSES_ClearScreen(void);
121 void NCURSES_NotifyResizeScreen(int x, int y);
122 int NCURSES_AllocColor(int);
123 void NCURSES_SetBackgroundColor(int fg, int bg);
124 void NCURSES_GetBackgroundColor(int *fg, int *bg);
126 #endif /* WINE_NCURSES */
128 /* Xterm specific defines */
129 void XTERM_Start(void);
130 void XTERM_Close(void);
131 void XTERM_Init(void);
132 void XTERM_ResizeScreen(int x, int y);
134 /* Color defines */
135 /* These will eventually be hex triples for dynamic allocation */
136 #define WINE_BLACK 1
137 #define WINE_BLUE 2
138 #define WINE_GREEN 3
139 #define WINE_CYAN 4
140 #define WINE_MAGENTA 5
141 #define WINE_BROWN 6
142 #define WINE_RED 7
143 #define WINE_LIGHT_GRAY 8
144 #define WINE_DARK_GRAY 9
145 #define WINE_LIGHT_BLUE 10
146 #define WINE_LIGHT_GREEN 11
147 #define WINE_LIGHT_RED 12
148 #define WINE_LIGHT_MAGENTA 13
149 #define WINE_LIGHT_CYAN 14
150 #define WINE_YELLOW 15
151 #define WINE_WHITE 16
153 #endif /* CONSOLE_H */