[PATCH] wineconsole: Add InsertMode to the registry
Hugh McMaster
hugh.mcmaster at outlook.com
Wed Apr 8 07:31:28 CDT 2015
---
programs/wineconsole/registry.c | 9 +++++++++
programs/wineconsole/winecon_private.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/programs/wineconsole/registry.c b/programs/wineconsole/registry.c
index 2805f2a..de8a6bc 100644
--- a/programs/wineconsole/registry.c
+++ b/programs/wineconsole/registry.c
@@ -42,6 +42,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 wszMenuMask[] = {'M','e','n','u','M','a','s','k',0};
static const WCHAR wszQuickEdit[] = {'Q','u','i','c','k','E','d','i','t',0};
+static const WCHAR wszInsertMode[] = {'I','n','s','e','r','t','M','o','d','e',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};
static const WCHAR wszWindowSize[] = {'W','i','n','d','o','w','S','i','z','e',0};
@@ -134,6 +135,10 @@ static void WINECON_RegLoadHelper(HKEY hConKey, struct config_data* cfg)
cfg->quick_edit = val;
count = sizeof(val);
+ if (!RegQueryValueExW(hConKey, wszInsertMode, 0, &type, (LPBYTE)&val, &count))
+ cfg->insert_mode = val;
+
+ count = sizeof(val);
if (!RegQueryValueExW(hConKey, wszScreenBufferSize, 0, &type, (LPBYTE)&val, &count))
{
cfg->sb_height = HIWORD(val);
@@ -177,6 +182,7 @@ void WINECON_RegLoad(const WCHAR* appname, struct config_data* cfg)
cfg->history_nodup = 0;
cfg->menu_mask = 0;
cfg->quick_edit = 0;
+ cfg->insert_mode = 1;
cfg->sb_height = 25;
cfg->sb_width = 80;
cfg->def_attr = 0x000F;
@@ -251,6 +257,9 @@ static void WINECON_RegSaveHelper(HKEY hConKey, const struct config_data* cfg)
val = cfg->quick_edit;
RegSetValueExW(hConKey, wszQuickEdit, 0, REG_DWORD, (LPBYTE)&val, sizeof(val));
+ val = cfg->insert_mode;
+ RegSetValueExW(hConKey, wszInsertMode, 0, REG_DWORD, (LPBYTE)&val, sizeof(val));
+
val = MAKELONG(cfg->sb_width, cfg->sb_height);
RegSetValueExW(hConKey, wszScreenBufferSize, 0, REG_DWORD, (LPBYTE)&val, sizeof(val));
diff --git a/programs/wineconsole/winecon_private.h b/programs/wineconsole/winecon_private.h
index eec4171..8bb7575 100644
--- a/programs/wineconsole/winecon_private.h
+++ b/programs/wineconsole/winecon_private.h
@@ -38,6 +38,7 @@ struct config_data {
DWORD history_nodup; /* TRUE if commands are not stored twice in buffer */
DWORD menu_mask; /* MK_CONTROL MK_SHIFT mask to drive submenu opening */
DWORD quick_edit; /* whether mouse ops are sent to app (false) or used for content selection (true) */
+ DWORD insert_mode; /* TRUE when text is inserted at the cursor position */
unsigned sb_width; /* active screen buffer width */
unsigned sb_height; /* active screen buffer height */
unsigned win_width; /* size (in cells) of visible part of window (width & height) */
--
1.9.1
More information about the wine-patches
mailing list