1999-01-03 17:14:34 +01:00
|
|
|
/* console.h */
|
|
|
|
/* Copyright 1998 - Joseph Pranevich */
|
1998-12-02 20:58:08 +01:00
|
|
|
|
|
|
|
/* Include file for definitions pertaining to Wine's text-console
|
|
|
|
interface.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONSOLE_H
|
|
|
|
#define CONSOLE_H
|
|
|
|
|
1998-12-09 16:43:03 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
1998-12-02 20:58:08 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
1999-01-03 17:14:34 +01:00
|
|
|
/* Which libs can be used for wine's curses implementation... */
|
|
|
|
#ifdef HAVE_LIBNCURSES
|
|
|
|
#define WINE_NCURSES
|
|
|
|
#else
|
|
|
|
#ifdef HAVE_LIBCURSES
|
|
|
|
#define WINE_NCURSES
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
1998-12-25 09:48:56 +01:00
|
|
|
#define CONSOLE_DEFAULT_DRIVER "tty"
|
1999-01-03 17:14:34 +01:00
|
|
|
/* If you have problems, try setting the next line to xterm */
|
|
|
|
#define CONSOLE_XTERM_PROG "nxterm" /* We should check for this first... */
|
1998-12-25 09:48:56 +01:00
|
|
|
|
1998-12-02 20:58:08 +01:00
|
|
|
typedef struct CONSOLE_DRIVER
|
|
|
|
{
|
|
|
|
void (*init)();
|
|
|
|
void (*close)();
|
|
|
|
void (*write)(char, int, int, int);
|
|
|
|
void (*moveCursor)(char, char);
|
|
|
|
void (*getCursorPosition)(char *, char *);
|
|
|
|
void (*getCharacterAtCursor)(char *, int *, int *, int *);
|
|
|
|
void (*clearScreen)();
|
|
|
|
|
|
|
|
/* Keyboard Functions */
|
|
|
|
int (*checkForKeystroke)(char *, char *);
|
|
|
|
void (*getKeystroke)(char *, char *);
|
|
|
|
|
1998-12-25 09:48:56 +01:00
|
|
|
/* Windowing Functions */
|
|
|
|
void (*resizeScreen)(int, int);
|
|
|
|
void (*notifyResizeScreen)(int, int); /* May be rethought later... */
|
|
|
|
|
1998-12-02 20:58:08 +01:00
|
|
|
/* Accellerator Functions (Screen) */
|
|
|
|
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);
|
|
|
|
|
|
|
|
/* Accellerator Functions (Keyboard) */
|
|
|
|
char (*getCharacter)();
|
|
|
|
|
|
|
|
/* Other functions */
|
|
|
|
void (*refresh)();
|
|
|
|
|
|
|
|
/* Other data */
|
|
|
|
int norefresh;
|
1998-12-09 16:43:03 +01:00
|
|
|
FILE *console_out;
|
|
|
|
FILE *console_in;
|
|
|
|
|
1998-12-02 20:58:08 +01:00
|
|
|
} CONSOLE_device;
|
|
|
|
|
|
|
|
CONSOLE_device driver; /* Global driver struct */
|
|
|
|
|
|
|
|
/* Generic defines */
|
1998-12-25 09:48:56 +01:00
|
|
|
void CONSOLE_Init(char *drivers);
|
1998-12-02 20:58:08 +01:00
|
|
|
void CONSOLE_Close();
|
|
|
|
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 *);
|
|
|
|
void CONSOLE_Refresh();
|
|
|
|
void CONSOLE_SetRefresh(int);
|
|
|
|
int CONSOLE_GetRefresh();
|
|
|
|
void CONSOLE_ClearScreen();
|
|
|
|
char CONSOLE_GetCharacter();
|
1998-12-25 09:48:56 +01:00
|
|
|
void CONSOLE_ResizeScreen();
|
|
|
|
void CONSOLE_NotifyResizeScreen();
|
1999-01-03 17:14:34 +01:00
|
|
|
void CONSOLE_WriteRawString(char *);
|
1998-12-02 20:58:08 +01:00
|
|
|
|
|
|
|
/* Generic Defines */
|
|
|
|
void GENERIC_Start();
|
|
|
|
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);
|
|
|
|
char GENERIC_GetCharacter();
|
|
|
|
|
|
|
|
/* TTY specific defines */
|
|
|
|
void TTY_Write(char out, int fg_color, int bg_color, int attribute);
|
|
|
|
void TTY_Start();
|
|
|
|
void TTY_GetKeystroke(char *, char *);
|
|
|
|
|
|
|
|
#ifdef WINE_NCURSES
|
|
|
|
|
|
|
|
/* ncurses defines */
|
|
|
|
void NCURSES_Write(char out, int fg_color, int bg_color, int attribute);
|
|
|
|
void NCURSES_Start();
|
|
|
|
void NCURSES_Init();
|
|
|
|
void NCURSES_Close();
|
|
|
|
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 *);
|
|
|
|
void NCURSES_Refresh();
|
|
|
|
void NCURSES_ClearScreen();
|
1999-01-03 17:14:34 +01:00
|
|
|
void NCURSES_NotifyResizeScreen(int x, int y);
|
1998-12-02 20:58:08 +01:00
|
|
|
|
|
|
|
#endif /* WINE_NCURSES */
|
|
|
|
|
1998-12-09 16:43:03 +01:00
|
|
|
/* Xterm specific defines */
|
|
|
|
void XTERM_Start();
|
|
|
|
void XTERM_Close();
|
|
|
|
void XTERM_Init();
|
1999-01-03 17:14:34 +01:00
|
|
|
void XTERM_ResizeScreen(int x, int y);
|
1998-12-09 16:43:03 +01:00
|
|
|
|
1998-12-02 20:58:08 +01:00
|
|
|
#endif /* CONSOLE_H */
|