Skip to content
Snippets Groups Projects
Commit 93a2ce6e authored by Joseph Pranevich's avatar Joseph Pranevich Committed by Alexandre Julliard
Browse files

Added GetBackgroundColor call to the console struct. Will be used

later.
parent a82b91cd
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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
......
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment