- better support for ExecuteBuffers
[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
13 #include "config.h"
14
15 /* Can we compile with curses/ncurses? */
16 #if (   (defined(HAVE_LIBNCURSES) || defined(HAVE_LIBCURSES)) &&        \
17         (defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H))             \
18 )
19 # define WINE_NCURSES
20 #else
21 # undef WINE_NCURSES
22 #endif
23
24 #define CONSOLE_DEFAULT_DRIVER "tty"
25 /* If you have problems, try setting the next line to xterm */
26 #define CONSOLE_XTERM_PROG "xterm" /* We should check for this first... */
27
28 typedef struct CONSOLE_DRIVER
29 {
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)();
37
38    /* Keyboard Functions */
39    int (*checkForKeystroke)(char *, char *);
40    void (*getKeystroke)(char *, char *);
41
42    /* Windowing Functions */
43    void (*resizeScreen)(int, int);
44    void (*notifyResizeScreen)(int, int); /* May be rethought later... */
45
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);
50
51    /* Accellerator Functions (Keyboard) */
52    char (*getCharacter)();
53
54    /* Other functions */
55    void (*refresh)();
56    
57    /* Other data */
58    int norefresh;
59    FILE *console_out;
60    FILE *console_in;
61
62 } CONSOLE_device;
63
64 CONSOLE_device driver; /* Global driver struct */
65
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 *);
86
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();
93
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 *);
98
99 #ifdef WINE_NCURSES
100
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);
114
115 #endif /* WINE_NCURSES */
116
117 /* Xterm specific defines */
118 void XTERM_Start();
119 void XTERM_Close();
120 void XTERM_Init();
121 void XTERM_ResizeScreen(int x, int y);
122
123 #endif /* CONSOLE_H */