2002-03-09 23:29:33 +00:00
|
|
|
/*
|
|
|
|
* Include file for definitions pertaining to Wine's text-console
|
|
|
|
* interface.
|
|
|
|
*
|
|
|
|
* Copyright 1998 - Joseph Pranevich
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
1998-12-02 19:58:08 +00:00
|
|
|
|
1999-06-12 18:36:54 +00:00
|
|
|
#ifndef __WINE_CONSOLE_H
|
|
|
|
#define __WINE_CONSOLE_H
|
1998-12-02 19:58:08 +00:00
|
|
|
|
2001-11-06 20:57:11 +00:00
|
|
|
#ifndef __WINE_CONFIG_H
|
|
|
|
# error You must include config.h to use this header
|
|
|
|
#endif
|
|
|
|
|
1998-12-09 15:43:03 +00:00
|
|
|
#include <stdio.h>
|
1998-12-02 19:58:08 +00:00
|
|
|
|
1999-01-20 14:18:55 +00:00
|
|
|
/* Can we compile with curses/ncurses? */
|
|
|
|
#if ( (defined(HAVE_LIBNCURSES) || defined(HAVE_LIBCURSES)) && \
|
|
|
|
(defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)) \
|
|
|
|
)
|
|
|
|
# define WINE_NCURSES
|
1999-01-03 16:14:34 +00:00
|
|
|
#else
|
1999-01-20 14:18:55 +00:00
|
|
|
# undef WINE_NCURSES
|
1999-01-03 16:14:34 +00:00
|
|
|
#endif
|
|
|
|
|
1998-12-25 08:48:56 +00:00
|
|
|
#define CONSOLE_DEFAULT_DRIVER "tty"
|
|
|
|
|
1998-12-02 19:58:08 +00:00
|
|
|
typedef struct CONSOLE_DRIVER
|
|
|
|
{
|
1999-02-14 13:38:27 +00:00
|
|
|
void (*init)(void);
|
|
|
|
void (*close)(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
void (*write)(char, int, int, int);
|
|
|
|
void (*moveCursor)(char, char);
|
|
|
|
void (*getCursorPosition)(char *, char *);
|
|
|
|
void (*getCharacterAtCursor)(char *, int *, int *, int *);
|
1999-02-14 13:38:27 +00:00
|
|
|
void (*clearScreen)(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
|
1999-01-30 12:51:09 +00:00
|
|
|
/* Color-control functions */
|
|
|
|
int (*allocColor)(int color);
|
|
|
|
void (*setBackgroundColor)(int fg, int bg);
|
1999-02-24 11:08:29 +00:00
|
|
|
void (*getBackgroundColor)(int *fg, int *bg);
|
1999-01-30 12:51:09 +00:00
|
|
|
|
1998-12-02 19:58:08 +00:00
|
|
|
/* Keyboard Functions */
|
1999-01-30 12:51:09 +00:00
|
|
|
int (*checkForKeystroke)(char *, char *);
|
1998-12-02 19:58:08 +00:00
|
|
|
void (*getKeystroke)(char *, char *);
|
|
|
|
|
1998-12-25 08:48:56 +00:00
|
|
|
/* Windowing Functions */
|
|
|
|
void (*resizeScreen)(int, int);
|
|
|
|
void (*notifyResizeScreen)(int, int); /* May be rethought later... */
|
|
|
|
|
2002-01-15 20:41:59 +00:00
|
|
|
/* Accelerator Functions (Screen) */
|
1998-12-02 19:58:08 +00:00
|
|
|
void (*clearWindow)(char, char, char, char, int, int);
|
|
|
|
void (*scrollUpWindow)(char, char, char, char, char, int, int);
|
|
|
|
void (*scrollDownWindow)(char, char, char, char, char, int, int);
|
|
|
|
|
2002-01-21 17:59:38 +00:00
|
|
|
/* Accelerator Functions (Keyboard) */
|
1999-02-14 13:38:27 +00:00
|
|
|
char (*getCharacter)(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
|
|
|
|
/* Other functions */
|
1999-02-14 13:38:27 +00:00
|
|
|
void (*refresh)(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
|
|
|
|
/* Other data */
|
|
|
|
int norefresh;
|
1998-12-09 15:43:03 +00:00
|
|
|
FILE *console_out;
|
|
|
|
FILE *console_in;
|
1999-02-20 16:42:49 +00:00
|
|
|
int x_res;
|
|
|
|
int y_res;
|
1998-12-09 15:43:03 +00:00
|
|
|
|
1998-12-02 19:58:08 +00:00
|
|
|
} CONSOLE_device;
|
|
|
|
|
1999-04-18 09:25:27 +00:00
|
|
|
extern CONSOLE_device driver; /* Global driver struct */
|
1998-12-02 19:58:08 +00:00
|
|
|
|
|
|
|
/* Generic defines */
|
1999-06-26 14:58:24 +00:00
|
|
|
void CONSOLE_Close(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
void CONSOLE_Write(char out, int fg_color, int bg_color, int attribute);
|
|
|
|
void CONSOLE_MoveCursor(char row, char col);
|
|
|
|
void CONSOLE_ClearWindow(char, char, char, char, int, int);
|
|
|
|
void CONSOLE_ScrollUpWindow(char, char, char, char, char, int, int);
|
|
|
|
void CONSOLE_ScrollDownWindow(char, char, char, char, char, int, int);
|
|
|
|
int CONSOLE_CheckForKeystroke(char *, char*);
|
|
|
|
void CONSOLE_GetKeystroke(char *, char *);
|
|
|
|
void CONSOLE_GetCursorPosition(char *, char *);
|
|
|
|
void CONSOLE_GetCharacterAtCursor(char *, int *, int *, int *);
|
1999-02-14 13:38:27 +00:00
|
|
|
void CONSOLE_Refresh(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
void CONSOLE_SetRefresh(int);
|
1999-02-14 13:38:27 +00:00
|
|
|
int CONSOLE_GetRefresh(void);
|
|
|
|
void CONSOLE_ClearScreen(void);
|
|
|
|
char CONSOLE_GetCharacter(void);
|
|
|
|
void CONSOLE_ResizeScreen(int, int);
|
|
|
|
void CONSOLE_NotifyResizeScreen(int, int);
|
1999-01-03 16:14:34 +00:00
|
|
|
void CONSOLE_WriteRawString(char *);
|
1999-01-30 12:51:09 +00:00
|
|
|
int CONSOLE_AllocColor(int);
|
|
|
|
void CONSOLE_SetBackgroundColor(int fg, int bg);
|
1999-02-24 11:08:29 +00:00
|
|
|
void CONSOLE_GetBackgroundColor(int *fg, int *bg);
|
1998-12-02 19:58:08 +00:00
|
|
|
|
|
|
|
/* Generic Defines */
|
1999-02-14 13:38:27 +00:00
|
|
|
void GENERIC_Start(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
void GENERIC_ClearWindow(char, char, char, char, int, int);
|
|
|
|
void GENERIC_ScrollUpWindow(char, char, char, char, char, int, int);
|
|
|
|
void GENERIC_ScrollDownWindow(char, char, char, char, char, int, int);
|
1999-02-14 13:38:27 +00:00
|
|
|
char GENERIC_GetCharacter(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
|
|
|
|
/* TTY specific defines */
|
|
|
|
void TTY_Write(char out, int fg_color, int bg_color, int attribute);
|
1999-02-14 13:38:27 +00:00
|
|
|
void TTY_Start(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
void TTY_GetKeystroke(char *, char *);
|
|
|
|
|
|
|
|
#ifdef WINE_NCURSES
|
|
|
|
|
|
|
|
/* ncurses defines */
|
|
|
|
void NCURSES_Write(char out, int fg_color, int bg_color, int attribute);
|
1999-02-14 13:38:27 +00:00
|
|
|
void NCURSES_Start(void);
|
|
|
|
void NCURSES_Init(void);
|
|
|
|
void NCURSES_Close(void);
|
1998-12-02 19:58:08 +00:00
|
|
|
int NCURSES_CheckForKeystroke(char *, char *);
|
|
|
|
void NCURSES_GetKeystroke(char *, char *);
|
|
|
|
void NCURSES_MoveCursor(char ,char);
|
|
|
|
void NCURSES_GetCursorPosition(char *, char *);
|
|
|
|
void NCURSES_GetCharacterAtCursor(char *, int *, int *, int *);
|
1999-02-14 13:38:27 +00:00
|
|
|
void NCURSES_Refresh(void);
|
|
|
|
void NCURSES_ClearScreen(void);
|
1999-01-03 16:14:34 +00:00
|
|
|
void NCURSES_NotifyResizeScreen(int x, int y);
|
1999-01-30 12:51:09 +00:00
|
|
|
int NCURSES_AllocColor(int);
|
|
|
|
void NCURSES_SetBackgroundColor(int fg, int bg);
|
1999-02-24 11:08:29 +00:00
|
|
|
void NCURSES_GetBackgroundColor(int *fg, int *bg);
|
1998-12-02 19:58:08 +00:00
|
|
|
|
|
|
|
#endif /* WINE_NCURSES */
|
|
|
|
|
1998-12-09 15:43:03 +00:00
|
|
|
/* Xterm specific defines */
|
1999-02-14 13:38:27 +00:00
|
|
|
void XTERM_Start(void);
|
|
|
|
void XTERM_Close(void);
|
|
|
|
void XTERM_Init(void);
|
1999-01-03 16:14:34 +00:00
|
|
|
void XTERM_ResizeScreen(int x, int y);
|
1998-12-09 15:43:03 +00:00
|
|
|
|
1999-01-30 12:51:09 +00:00
|
|
|
/* Color defines */
|
|
|
|
/* These will eventually be hex triples for dynamic allocation */
|
1999-11-07 22:23:39 +00:00
|
|
|
/* Triplets added by A.C. and commented out until the support */
|
|
|
|
/* code can be written into the console routines. */
|
|
|
|
#define WINE_BLACK 1 /* 0x000000 */
|
|
|
|
#define WINE_BLUE 2 /* 0x0000ff */
|
|
|
|
#define WINE_GREEN 3 /* 0x008000 */
|
|
|
|
#define WINE_CYAN 4 /* 0x00eeee */
|
|
|
|
#define WINE_MAGENTA 5 /* 0xcd00cd */
|
|
|
|
#define WINE_BROWN 6 /* 0xcd3333 */
|
|
|
|
#define WINE_RED 7 /* 0xff0000 */
|
|
|
|
#define WINE_LIGHT_GRAY 8 /* 0xc0c0c0 */
|
|
|
|
#define WINE_DARK_GRAY 9 /* 0x808080 */
|
|
|
|
#define WINE_LIGHT_BLUE 10 /* 0x98f5ff */
|
|
|
|
#define WINE_LIGHT_GREEN 11 /* 0x00ff00 */
|
|
|
|
#define WINE_LIGHT_RED 12 /* 0xee6363 */
|
|
|
|
#define WINE_LIGHT_MAGENTA 13 /* 0xff00ff */
|
|
|
|
#define WINE_LIGHT_CYAN 14 /* 0x00ffff */
|
|
|
|
#define WINE_YELLOW 15 /* 0xffff00 */
|
|
|
|
#define WINE_WHITE 16 /* 0xffffff */
|
1999-01-30 12:51:09 +00:00
|
|
|
|
1998-12-02 19:58:08 +00:00
|
|
|
#endif /* CONSOLE_H */
|