Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1602eff3
Commit
1602eff3
authored
Aug 08, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Aug 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineconsole: Add 'ColorTable' support to the registry.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
84b3218e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
5 deletions
+43
-5
registry.c
programs/wineconsole/registry.c
+41
-5
winecon_private.h
programs/wineconsole/winecon_private.h
+1
-0
wineconsole.c
programs/wineconsole/wineconsole.c
+1
-0
No files found.
programs/wineconsole/registry.c
View file @
1602eff3
...
...
@@ -26,10 +26,12 @@
#include "winreg.h"
#include "winecon_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wineconsole
);
static
const
WCHAR
wszColorTable
[]
=
{
'C'
,
'o'
,
'l'
,
'o'
,
'r'
,
'T'
,
'a'
,
'b'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
wszConsole
[]
=
{
'C'
,
'o'
,
'n'
,
's'
,
'o'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
wszCursorSize
[]
=
{
'C'
,
'u'
,
'r'
,
's'
,
'o'
,
'r'
,
'S'
,
'i'
,
'z'
,
'e'
,
0
};
static
const
WCHAR
wszCursorVisible
[]
=
{
'C'
,
'u'
,
'r'
,
's'
,
'o'
,
'r'
,
'V'
,
'i'
,
's'
,
'i'
,
'b'
,
'l'
,
'e'
,
0
};
...
...
@@ -47,6 +49,10 @@ static const WCHAR wszScreenBufferSize[] = {'S','c','r','e','e','n','B','u','f'
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
};
static
const
WCHAR
color_name_fmt
[]
=
{
'%'
,
's'
,
'%'
,
'0'
,
'2'
,
'd'
,
0
};
#define NUM_COLORS 16
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
"
,
...
...
@@ -84,9 +90,17 @@ static LPWSTR WINECON_CreateKeyName(LPCWSTR kn)
*/
static
void
WINECON_RegLoadHelper
(
HKEY
hConKey
,
struct
config_data
*
cfg
)
{
DWORD
type
;
DWORD
count
;
DWORD
val
;
int
i
;
DWORD
type
,
count
,
val
;
WCHAR
color_name
[
13
];
for
(
i
=
0
;
i
<
NUM_COLORS
;
i
++
)
{
sprintfW
(
color_name
,
color_name_fmt
,
wszColorTable
,
i
);
count
=
sizeof
(
val
);
if
(
!
RegQueryValueExW
(
hConKey
,
color_name
,
0
,
&
type
,
(
LPBYTE
)
&
val
,
&
count
))
cfg
->
color_map
[
i
]
=
val
;
}
count
=
sizeof
(
val
);
if
(
!
RegQueryValueExW
(
hConKey
,
wszCursorSize
,
0
,
&
type
,
(
LPBYTE
)
&
val
,
&
count
))
...
...
@@ -166,11 +180,24 @@ static void WINECON_RegLoadHelper(HKEY hConKey, struct config_data* cfg)
*/
void
WINECON_RegLoad
(
const
WCHAR
*
appname
,
struct
config_data
*
cfg
)
{
HKEY
hConKey
;
static
const
COLORREF
color_map
[
NUM_COLORS
]
=
{
RGB
(
0x00
,
0x00
,
0x00
),
RGB
(
0x00
,
0x00
,
0x80
),
RGB
(
0x00
,
0x80
,
0x00
),
RGB
(
0x00
,
0x80
,
0x80
),
RGB
(
0x80
,
0x00
,
0x00
),
RGB
(
0x80
,
0x00
,
0x80
),
RGB
(
0x80
,
0x80
,
0x00
),
RGB
(
0xC0
,
0xC0
,
0xC0
),
RGB
(
0x80
,
0x80
,
0x80
),
RGB
(
0x00
,
0x00
,
0xFF
),
RGB
(
0x00
,
0xFF
,
0x00
),
RGB
(
0x00
,
0xFF
,
0xFF
),
RGB
(
0xFF
,
0x00
,
0x00
),
RGB
(
0xFF
,
0x00
,
0xFF
),
RGB
(
0xFF
,
0xFF
,
0x00
),
RGB
(
0xFF
,
0xFF
,
0xFF
),
};
int
i
;
HKEY
hConKey
;
WINE_TRACE
(
"loading %s registry settings.
\n
"
,
appname
?
wine_dbgstr_w
(
appname
)
:
"default"
);
/* first set default values */
for
(
i
=
0
;
i
<
NUM_COLORS
;
i
++
)
{
cfg
->
color_map
[
i
]
=
color_map
[
i
];
}
cfg
->
cursor_size
=
25
;
cfg
->
cursor_visible
=
1
;
cfg
->
exit_on_die
=
1
;
...
...
@@ -221,10 +248,19 @@ void WINECON_RegLoad(const WCHAR* appname, struct config_data* cfg)
*/
static
void
WINECON_RegSaveHelper
(
HKEY
hConKey
,
const
struct
config_data
*
cfg
)
{
DWORD
val
;
int
i
;
DWORD
val
;
WCHAR
color_name
[
13
];
WINECON_DumpConfig
(
"save"
,
cfg
);
for
(
i
=
0
;
i
<
NUM_COLORS
;
i
++
)
{
sprintfW
(
color_name
,
color_name_fmt
,
wszColorTable
,
i
);
val
=
cfg
->
color_map
[
i
];
RegSetValueExW
(
hConKey
,
color_name
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
val
,
sizeof
(
val
));
}
val
=
cfg
->
cursor_size
;
RegSetValueExW
(
hConKey
,
wszCursorSize
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
val
,
sizeof
(
val
));
...
...
programs/wineconsole/winecon_private.h
View file @
1602eff3
...
...
@@ -27,6 +27,7 @@
/* this is the configuration stored & loaded into the registry */
struct
config_data
{
DWORD
color_map
[
16
];
/* console color table */
unsigned
cell_width
;
/* width in pixels of a character */
unsigned
cell_height
;
/* height in pixels of a character */
int
cursor_size
;
/* in % of cell height */
...
...
programs/wineconsole/wineconsole.c
View file @
1602eff3
...
...
@@ -703,6 +703,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
/* fall through */
case
init_success
:
WINECON_GetServerConfig
(
data
);
memcpy
(
data
->
curcfg
.
color_map
,
cfg
.
color_map
,
sizeof
(
data
->
curcfg
.
color_map
));
data
->
cells
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
data
->
curcfg
.
sb_width
*
data
->
curcfg
.
sb_height
*
sizeof
(
CHAR_INFO
));
if
(
!
data
->
cells
)
WINECON_Fatal
(
"OOM
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment