- New implementation of SendMessage, ReceiveMessage, ReplyMessage functions
[wine] / include / console.h
1 /* console.h */
2 /* Copyright 1998 - Joseph Pranevich */
3
4 /* Include file for definitions pertaining to Wine's text-console
5    interface. 
6 */
7
8 #ifndef CONSOLE_H
9 #define CONSOLE_H
10
11 #include <stdio.h>
12 #include "config.h"
13
14 /* Can we compile with curses/ncurses? */
15 #if (   (defined(HAVE_LIBNCURSES) || defined(HAVE_LIBCURSES)) &&        \
16         (defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H))             \
17 )
18 # define WINE_NCURSES
19 #else
20 # undef WINE_NCURSES
21 #endif
22
23 #define CONSOLE_DEFAULT_DRIVER "tty"
24 /* If you have problems, try setting the next line to xterm */
25 #define CONSOLE_XTERM_PROG "xterm" /* We should check for this first... */
26
27 typedef struct CONSOLE_DRIVER
28 {
29    void (*init)(void);
30    void (*close)(void);
31    void (*write)(char, int, int, int);
32    void (*moveCursor)(char, char);
33    void (*getCursorPosition)(char *, char *);
34    void (*getCharacterAtCursor)(char *, int *, int *, int *);
35    void (*clearScreen)(void);
36
37    /* Color-control functions */
38    int  (*allocColor)(int color);
39    void (*setBackgroundColor)(int fg, int bg);
40
41    /* Keyboard Functions */
42    int  (*checkForKeystroke)(char *, char *);
43    void (*getKeystroke)(char *, char *);
44
45    /* Windowing Functions */
46    void (*resizeScreen)(int, int);
47    void (*notifyResizeScreen)(int, int); /* May be rethought later... */
48
49    /* Accellerator Functions (Screen) */
50    void (*clearWindow)(char, char, char, char, int, int);
51    void (*scrollUpWindow)(char, char, char, char, char, int, int);
52    void (*scrollDownWindow)(char, char, char, char, char, int, int);
53
54    /* Accellerator Functions (Keyboard) */
55    char (*getCharacter)(void);
56
57    /* Other functions */
58    void (*refresh)(void);
59    
60    /* Other data */
61    int norefresh;
62    char *driver_list;
63    FILE *console_out;
64    FILE *console_in;
65
66 } CONSOLE_device;
67
68 CONSOLE_device driver; /* Global driver struct */
69
70 /* Generic defines */
71 int  CONSOLE_Init(char *drivers);
72 void CONSOLE_Close();
73 void CONSOLE_Write(char out, int fg_color, int bg_color, int attribute);
74 void CONSOLE_MoveCursor(char row, char col);
75 void CONSOLE_ClearWindow(char, char, char, char, int, int);
76 void CONSOLE_ScrollUpWindow(char, char, char, char, char, int, int);
77 void CONSOLE_ScrollDownWindow(char, char, char, char, char, int, int);
78 int  CONSOLE_CheckForKeystroke(char *, char*);
79 void CONSOLE_GetKeystroke(char *, char *);
80 void CONSOLE_GetCursorPosition(char *, char *);
81 void CONSOLE_GetCharacterAtCursor(char *, int *, int *, int *);
82 void CONSOLE_Refresh(void);
83 void CONSOLE_SetRefresh(int);
84 int  CONSOLE_GetRefresh(void);
85 void CONSOLE_ClearScreen(void);
86 char CONSOLE_GetCharacter(void);
87 void CONSOLE_ResizeScreen(int, int);
88 void CONSOLE_NotifyResizeScreen(int, int); 
89 void CONSOLE_WriteRawString(char *);
90 int  CONSOLE_AllocColor(int);
91 void CONSOLE_SetBackgroundColor(int fg, int bg);
92
93 /* Generic Defines */
94 void GENERIC_Start(void);
95 void GENERIC_ClearWindow(char, char, char, char, int, int);
96 void GENERIC_ScrollUpWindow(char, char, char, char, char, int, int);
97 void GENERIC_ScrollDownWindow(char, char, char, char, char, int, int);
98 char GENERIC_GetCharacter(void);
99
100 /* TTY specific defines */
101 void TTY_Write(char out, int fg_color, int bg_color, int attribute);
102 void TTY_Start(void);
103 void TTY_GetKeystroke(char *, char *);
104
105 #ifdef WINE_NCURSES
106
107 /* ncurses defines */
108 void NCURSES_Write(char out, int fg_color, int bg_color, int attribute);
109 void NCURSES_Start(void);
110 void NCURSES_Init(void);
111 void NCURSES_Close(void);
112 int  NCURSES_CheckForKeystroke(char *, char *);
113 void NCURSES_GetKeystroke(char *, char *);
114 void NCURSES_MoveCursor(char ,char);
115 void NCURSES_GetCursorPosition(char *, char *);
116 void NCURSES_GetCharacterAtCursor(char *, int *, int *, int *);
117 void NCURSES_Refresh(void);
118 void NCURSES_ClearScreen(void);
119 void NCURSES_NotifyResizeScreen(int x, int y);
120 int  NCURSES_AllocColor(int);
121 void NCURSES_SetBackgroundColor(int fg, int bg);
122
123 #endif /* WINE_NCURSES */
124
125 /* Xterm specific defines */
126 void XTERM_Start(void);
127 void XTERM_Close(void);
128 void XTERM_Init(void);
129 void XTERM_ResizeScreen(int x, int y);
130
131 /* Color defines */
132 /* These will eventually be hex triples for dynamic allocation */
133 #define WINE_BLACK              1
134 #define WINE_BLUE               2
135 #define WINE_GREEN              3
136 #define WINE_CYAN               4
137 #define WINE_MAGENTA            5
138 #define WINE_BROWN              6
139 #define WINE_RED                7
140 #define WINE_LIGHT_GRAY         8
141 #define WINE_DARK_GRAY          9
142 #define WINE_LIGHT_BLUE         10
143 #define WINE_LIGHT_GREEN        11
144 #define WINE_LIGHT_RED          12
145 #define WINE_LIGHT_MAGENTA      13
146 #define WINE_LIGHT_CYAN         14
147 #define WINE_YELLOW             15
148 #define WINE_WHITE              16
149
150 #endif /* CONSOLE_H */