Added GetBackgroundColor call to the console struct. Will be used
later.
This commit is contained in:
parent
a82b91cd49
commit
93a2ce6e69
|
@ -274,6 +274,15 @@ void CONSOLE_SetBackgroundColor(int fg, int bg)
|
||||||
driver.setBackgroundColor(fg, 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)
|
void CONSOLE_WriteRawString(char *str)
|
||||||
{
|
{
|
||||||
if (!console_initialized)
|
if (!console_initialized)
|
||||||
|
|
|
@ -210,7 +210,22 @@ void NCURSES_SetBackgroundColor(int fg, int bg)
|
||||||
|
|
||||||
pair = get_color_pair(fg, 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
|
#ifdef HAVE_RESIZETERM
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CONSOLE_DEFAULT_DRIVER "tty"
|
#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
|
typedef struct CONSOLE_DRIVER
|
||||||
{
|
{
|
||||||
|
@ -37,6 +35,7 @@ typedef struct CONSOLE_DRIVER
|
||||||
/* Color-control functions */
|
/* Color-control functions */
|
||||||
int (*allocColor)(int color);
|
int (*allocColor)(int color);
|
||||||
void (*setBackgroundColor)(int fg, int bg);
|
void (*setBackgroundColor)(int fg, int bg);
|
||||||
|
void (*getBackgroundColor)(int *fg, int *bg);
|
||||||
|
|
||||||
/* Keyboard Functions */
|
/* Keyboard Functions */
|
||||||
int (*checkForKeystroke)(char *, char *);
|
int (*checkForKeystroke)(char *, char *);
|
||||||
|
@ -91,6 +90,7 @@ void CONSOLE_NotifyResizeScreen(int, int);
|
||||||
void CONSOLE_WriteRawString(char *);
|
void CONSOLE_WriteRawString(char *);
|
||||||
int CONSOLE_AllocColor(int);
|
int CONSOLE_AllocColor(int);
|
||||||
void CONSOLE_SetBackgroundColor(int fg, int bg);
|
void CONSOLE_SetBackgroundColor(int fg, int bg);
|
||||||
|
void CONSOLE_GetBackgroundColor(int *fg, int *bg);
|
||||||
|
|
||||||
/* Generic Defines */
|
/* Generic Defines */
|
||||||
void GENERIC_Start(void);
|
void GENERIC_Start(void);
|
||||||
|
@ -121,6 +121,7 @@ void NCURSES_ClearScreen(void);
|
||||||
void NCURSES_NotifyResizeScreen(int x, int y);
|
void NCURSES_NotifyResizeScreen(int x, int y);
|
||||||
int NCURSES_AllocColor(int);
|
int NCURSES_AllocColor(int);
|
||||||
void NCURSES_SetBackgroundColor(int fg, int bg);
|
void NCURSES_SetBackgroundColor(int fg, int bg);
|
||||||
|
void NCURSES_GetBackgroundColor(int *fg, int *bg);
|
||||||
|
|
||||||
#endif /* WINE_NCURSES */
|
#endif /* WINE_NCURSES */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue