Added GetBackgroundColor call to the console struct. Will be used

later.
This commit is contained in:
Joseph Pranevich 1999-02-24 11:08:29 +00:00 committed by Alexandre Julliard
parent a82b91cd49
commit 93a2ce6e69
3 changed files with 28 additions and 3 deletions

View File

@ -274,6 +274,15 @@ void CONSOLE_SetBackgroundColor(int fg, int bg)
driver.setBackgroundColor(fg, bg);
}
void CONSOLE_GetBackgroundColor(int *fg, int *bg)
{
if (!console_initialized)
console_initialized = CONSOLE_Init(driver.driver_list);
if (driver.getBackgroundColor)
driver.getBackgroundColor(fg, bg);
}
void CONSOLE_WriteRawString(char *str)
{
if (!console_initialized)

View File

@ -210,7 +210,22 @@ void NCURSES_SetBackgroundColor(int fg, int bg)
pair = get_color_pair(fg, bg);
bkgdset(COLOR_PAIR(pair));
wbkgd(stdscr, COLOR_PAIR(pair));
}
void NCURSES_GetBackgroundColor(int *fg, int *bg)
{
chtype background;
short pair, sfg, sbg;
background = getbkgd(stdscr);
pair = (!A_CHARTEXT & background);
pair_content(pair, &sfg, &sbg);
*fg = sfg;
*bg = sbg;
}
#ifdef HAVE_RESIZETERM

View File

@ -21,8 +21,6 @@
#endif
#define CONSOLE_DEFAULT_DRIVER "tty"
/* If you have problems, try setting the next line to xterm */
#define CONSOLE_XTERM_PROG "xterm" /* We should check for this first... */
typedef struct CONSOLE_DRIVER
{
@ -37,6 +35,7 @@ typedef struct CONSOLE_DRIVER
/* Color-control functions */
int (*allocColor)(int color);
void (*setBackgroundColor)(int fg, int bg);
void (*getBackgroundColor)(int *fg, int *bg);
/* Keyboard Functions */
int (*checkForKeystroke)(char *, char *);
@ -91,6 +90,7 @@ void CONSOLE_NotifyResizeScreen(int, int);
void CONSOLE_WriteRawString(char *);
int CONSOLE_AllocColor(int);
void CONSOLE_SetBackgroundColor(int fg, int bg);
void CONSOLE_GetBackgroundColor(int *fg, int *bg);
/* Generic Defines */
void GENERIC_Start(void);
@ -121,6 +121,7 @@ void NCURSES_ClearScreen(void);
void NCURSES_NotifyResizeScreen(int x, int y);
int NCURSES_AllocColor(int);
void NCURSES_SetBackgroundColor(int fg, int bg);
void NCURSES_GetBackgroundColor(int *fg, int *bg);
#endif /* WINE_NCURSES */