[PATCH 4/5] wineconsole: Add 'PopupColors' support to the registry

Hugh McMaster hugh.mcmaster at outlook.com
Sun Aug 7 22:09:03 CDT 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/wineconsole/registry.c        | 20 +++++++++++++++-----
 programs/wineconsole/winecon_private.h |  3 ++-
 programs/wineconsole/wineconsole.c     |  1 +
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/programs/wineconsole/registry.c b/programs/wineconsole/registry.c
index f898a85..5a45cdd 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};
@@ -51,12 +52,13 @@ static const WCHAR wszWindowSize[]        = {'W','i','n','d','o','w','S','i','z'
 
 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));
 }
 
@@ -150,6 +152,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;
 
@@ -210,6 +216,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 2ecaad0..d486fb2 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 b550403..04e270b 100644
--- a/programs/wineconsole/wineconsole.c
+++ b/programs/wineconsole/wineconsole.c
@@ -469,6 +469,7 @@ void     WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
         FillConsoleOutputAttribute(data->hConOut, cfg->def_attr, screen_size, top_left, &written);
         SetConsoleTextAttribute(data->hConOut, cfg->def_attr);
     }
+    data->curcfg.popup_attr = cfg->popup_attr;
     /* now let's look at the window / sb size changes...
      * since the server checks that sb is always bigger than window, 
      * we have to take care of doing the operations in the right order
-- 
2.7.4




More information about the wine-patches mailing list