Give the context menu its proper behaviour and modify TrackPopupMenu
[wine/testsucceed.git] / include / console.h
blob6746a18f5f0ed68c6ec10a6d3af04cb38ce7038e
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 /* Can we compile with curses/ncurses? */
16 #if ( (defined(HAVE_LIBNCURSES) || defined(HAVE_LIBCURSES)) && \
17 (defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)) \
19 # define WINE_NCURSES
20 #else
21 # undef WINE_NCURSES
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 "xterm" /* We should check for this first... */
28 typedef struct CONSOLE_DRIVER
30 void (*init)(void);
31 void (*close)(void);
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)(void);
38 /* Color-control functions */
39 int (*allocColor)(int color);
40 void (*setBackgroundColor)(int fg, int bg);
42 /* Keyboard Functions */
43 int (*checkForKeystroke)(char *, char *);
44 void (*getKeystroke)(char *, char *);
46 /* Windowing Functions */
47 void (*resizeScreen)(int, int);
48 void (*notifyResizeScreen)(int, int); /* May be rethought later... */
50 /* Accellerator Functions (Screen) */
51 void (*clearWindow)(char, char, char, char, int, int);
52 void (*scrollUpWindow)(char, char, char, char, char, int, int);
53 void (*scrollDownWindow)(char, char, char, char, char, int, int);
55 /* Accellerator Functions (Keyboard) */
56 char (*getCharacter)(void);
58 /* Other functions */
59 void (*refresh)(void);
61 /* Other data */
62 int norefresh;
63 char *driver_list;
64 FILE *console_out;
65 FILE *console_in;
67 } CONSOLE_device;
69 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);
94 /* Generic Defines */
95 void GENERIC_Start(void);
96 void GENERIC_ClearWindow(char, char, char, char, int, int);
97 void GENERIC_ScrollUpWindow(char, char, char, char, char, int, int);
98 void GENERIC_ScrollDownWindow(char, char, char, char, char, int, int);
99 char GENERIC_GetCharacter(void);
101 /* TTY specific defines */
102 void TTY_Write(char out, int fg_color, int bg_color, int attribute);
103 void TTY_Start(void);
104 void TTY_GetKeystroke(char *, char *);
106 #ifdef WINE_NCURSES
108 /* ncurses defines */
109 void NCURSES_Write(char out, int fg_color, int bg_color, int attribute);
110 void NCURSES_Start(void);
111 void NCURSES_Init(void);
112 void NCURSES_Close(void);
113 int NCURSES_CheckForKeystroke(char *, char *);
114 void NCURSES_GetKeystroke(char *, char *);
115 void NCURSES_MoveCursor(char ,char);
116 void NCURSES_GetCursorPosition(char *, char *);
117 void NCURSES_GetCharacterAtCursor(char *, int *, int *, int *);
118 void NCURSES_Refresh(void);
119 void NCURSES_ClearScreen(void);
120 void NCURSES_NotifyResizeScreen(int x, int y);
121 int NCURSES_AllocColor(int);
122 void NCURSES_SetBackgroundColor(int fg, int bg);
124 #endif /* WINE_NCURSES */
126 /* Xterm specific defines */
127 void XTERM_Start(void);
128 void XTERM_Close(void);
129 void XTERM_Init(void);
130 void XTERM_ResizeScreen(int x, int y);
132 /* Color defines */
133 /* These will eventually be hex triples for dynamic allocation */
134 #define WINE_BLACK 1
135 #define WINE_BLUE 2
136 #define WINE_GREEN 3
137 #define WINE_CYAN 4
138 #define WINE_MAGENTA 5
139 #define WINE_BROWN 6
140 #define WINE_RED 7
141 #define WINE_LIGHT_GRAY 8
142 #define WINE_DARK_GRAY 9
143 #define WINE_LIGHT_BLUE 10
144 #define WINE_LIGHT_GREEN 11
145 #define WINE_LIGHT_RED 12
146 #define WINE_LIGHT_MAGENTA 13
147 #define WINE_LIGHT_CYAN 14
148 #define WINE_YELLOW 15
149 #define WINE_WHITE 16
151 #endif /* CONSOLE_H */