Hugh McMaster : wineconsole: Add 'PopupColors' support to the registry.

Alexandre Julliard julliard at winehq.org
Thu Aug 11 09:37:48 CDT 2016


Module: wine
Branch: master
Commit: b9a79c095e3410ada90d4f04308d97aa9e4e43cb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b9a79c095e3410ada90d4f04308d97aa9e4e43cb

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Wed Aug 10 10:01:45 2016 +0000

wineconsole: Add 'PopupColors' support to the registry.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/wineconsole/registry.c        | 20 +++++++++++++++-----
 programs/wineconsole/winecon_private.h |  3 ++-
 programs/wineconsole/wineconsole.c     |  3 ++-
 3 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/programs/wineconsole/registry.c b/programs/wineconsole/registry.c
index f5fa433..e537a86 100644
--- a/programs/wineconsole/registry.c
+++ b/programs/wineconsole/registry.c
@@ -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));
 }
 
@@ -149,6 +151,10 @@ static void WINECON_RegLoadHelper(HKEY hConKey, struct config_data* cfg)
         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));
 
diff --git a/programs/wineconsole/winecon_private.h b/programs/wineconsole/winecon_private.h
index 7236879..d556299 100644
--- a/programs/wineconsole/winecon_private.h
+++ b/programs/wineconsole/winecon_private.h
@@ -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 */
diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c
index b9da7b6..babc3ef 100644
--- a/programs/wineconsole/wineconsole.c
+++ b/programs/wineconsole/wineconsole.c
@@ -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 )
     {




More information about the wine-cvs mailing list