wineconsole: Add 'PopupColors' support to the registry.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2016-08-10 10:01:45 +00:00 committed by Alexandre Julliard
parent 2d7c73d802
commit b9a79c095e
3 changed files with 19 additions and 7 deletions

View file

@ -44,6 +44,7 @@ static const WCHAR wszHistoryBufferSize[] = {'H','i','s','t','o','r','y','B','u'
static const WCHAR wszHistoryNoDup[] = {'H','i','s','t','o','r','y','N','o','D','u','p',0};
static const WCHAR wszInsertMode[] = {'I','n','s','e','r','t','M','o','d','e',0};
static const WCHAR wszMenuMask[] = {'M','e','n','u','M','a','s','k',0};
static const WCHAR wszPopupColors[] = {'P','o','p','u','p','C','o','l','o','r','s',0};
static const WCHAR wszQuickEdit[] = {'Q','u','i','c','k','E','d','i','t',0};
static const WCHAR wszScreenBufferSize[] = {'S','c','r','e','e','n','B','u','f','f','e','r','S','i','z','e',0};
static const WCHAR wszScreenColors[] = {'S','c','r','e','e','n','C','o','l','o','r','s',0};
@ -55,12 +56,13 @@ static const WCHAR color_name_fmt[] = {'%','s','%','0','2','d',0};
void WINECON_DumpConfig(const char* pfx, const struct config_data* cfg)
{
WINE_TRACE("%s cell=(%u,%u) cursor=(%d,%d) attr=%02x font=%s/%u hist=%u/%d flags=%c%c%c msk=%08x sb=(%u,%u) win=(%u,%u)x(%u,%u) edit=%u registry=%s\n",
WINE_TRACE("%s cell=(%u,%u) cursor=(%d,%d) attr=%02x pop-up=%02x font=%s/%u hist=%u/%d flags=%c%c%c "
"msk=%08x sb=(%u,%u) win=(%u,%u)x(%u,%u) edit=%u registry=%s\n",
pfx, cfg->cell_width, cfg->cell_height, cfg->cursor_size, cfg->cursor_visible, cfg->def_attr,
wine_dbgstr_w(cfg->face_name), cfg->font_weight, cfg->history_size, cfg->history_nodup ? 1 : 2,
cfg->insert_mode ? 'I' : 'i', cfg->quick_edit ? 'Q' : 'q', cfg->exit_on_die ? 'X' : 'x',
cfg->menu_mask, cfg->sb_width, cfg->sb_height, cfg->win_pos.X, cfg->win_pos.Y, cfg->win_width, cfg->win_height,
cfg->edition_mode,
cfg->popup_attr, wine_dbgstr_w(cfg->face_name), cfg->font_weight, cfg->history_size,
cfg->history_nodup ? 1 : 2, cfg->insert_mode ? 'I' : 'i', cfg->quick_edit ? 'Q' : 'q',
cfg->exit_on_die ? 'X' : 'x', cfg->menu_mask, cfg->sb_width, cfg->sb_height,
cfg->win_pos.X, cfg->win_pos.Y, cfg->win_width, cfg->win_height, cfg->edition_mode,
wine_dbgstr_w(cfg->registry));
}
@ -148,6 +150,10 @@ static void WINECON_RegLoadHelper(HKEY hConKey, struct config_data* cfg)
if (!RegQueryValueExW(hConKey, wszMenuMask, 0, &type, (LPBYTE)&val, &count))
cfg->menu_mask = val;
count = sizeof(val);
if (!RegQueryValueExW(hConKey, wszPopupColors, 0, &type, (LPBYTE)&val, &count))
cfg->popup_attr = val;
count = sizeof(val);
if (!RegQueryValueExW(hConKey, wszQuickEdit, 0, &type, (LPBYTE)&val, &count))
cfg->quick_edit = val;
@ -209,6 +215,7 @@ void WINECON_RegLoad(const WCHAR* appname, struct config_data* cfg)
cfg->history_nodup = 0;
cfg->insert_mode = 1;
cfg->menu_mask = 0;
cfg->popup_attr = 0xF5;
cfg->quick_edit = 0;
cfg->sb_height = 25;
cfg->sb_width = 80;
@ -293,6 +300,9 @@ static void WINECON_RegSaveHelper(HKEY hConKey, const struct config_data* cfg)
val = cfg->menu_mask;
RegSetValueExW(hConKey, wszMenuMask, 0, REG_DWORD, (LPBYTE)&val, sizeof(val));
val = cfg->popup_attr;
RegSetValueExW(hConKey, wszPopupColors, 0, REG_DWORD, (LPBYTE)&val, sizeof(val));
val = cfg->quick_edit;
RegSetValueExW(hConKey, wszQuickEdit, 0, REG_DWORD, (LPBYTE)&val, sizeof(val));

View file

@ -32,7 +32,8 @@ struct config_data {
unsigned cell_height; /* height in pixels of a character */
int cursor_size; /* in % of cell height */
int cursor_visible;
DWORD def_attr;
DWORD def_attr; /* default fill attributes (screen colors) */
DWORD popup_attr; /* pop-up color attributes */
WCHAR face_name[32]; /* name of font (size is LF_FACESIZE) */
DWORD font_weight;
DWORD history_size; /* number of commands in history buffer */

View file

@ -214,13 +214,14 @@ static BOOL WINECON_SetEditionMode(HANDLE hConIn, int edition_mode)
/******************************************************************
* WINECON_SetColors
*
*
* Sets ColorTable and Pop-up menu colors
*/
static void WINECON_SetColors(struct inner_data *data, const struct config_data* cfg)
{
size_t color_map_size = sizeof(data->curcfg.color_map);
memcpy(data->curcfg.color_map, cfg->color_map, color_map_size);
data->curcfg.popup_attr = cfg->popup_attr;
SERVER_START_REQ( set_console_output_info )
{