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
b1e6d4c1
Commit
b1e6d4c1
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: Replace hard-coded WCUSER_ColorMap with registry color_map.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1602eff3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
19 deletions
+21
-19
dialog.c
programs/wineconsole/dialog.c
+18
-7
user.c
programs/wineconsole/user.c
+3
-12
No files found.
programs/wineconsole/dialog.c
View file @
b1e6d4c1
...
...
@@ -147,6 +147,14 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
return
TRUE
;
}
static
COLORREF
get_color
(
struct
dialog_info
*
di
,
unsigned
int
idc
)
{
LONG_PTR
index
;
index
=
GetWindowLongPtrW
(
GetDlgItem
(
di
->
hDlg
,
idc
),
0
);
return
di
->
config
.
color_map
[
index
];
}
/******************************************************************
* WCUSER_FontPreviewProc
*
...
...
@@ -196,10 +204,10 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
int
len
;
hOldFont
=
SelectObject
(
ps
.
hdc
,
hFont
);
bkcolor
=
WCUSER_ColorMap
[
GetWindowLongW
(
GetDlgItem
(
di
->
hDlg
,
IDC_FNT_COLOR_BK
),
0
)]
;
bkcolor
=
get_color
(
di
,
IDC_FNT_COLOR_BK
)
;
FillRect
(
ps
.
hdc
,
&
ps
.
rcPaint
,
CreateSolidBrush
(
bkcolor
));
SetBkColor
(
ps
.
hdc
,
bkcolor
);
SetTextColor
(
ps
.
hdc
,
WCUSER_ColorMap
[
GetWindowLongW
(
GetDlgItem
(
di
->
hDlg
,
IDC_FNT_COLOR_FG
),
0
)]
);
SetTextColor
(
ps
.
hdc
,
get_color
(
di
,
IDC_FNT_COLOR_FG
)
);
len
=
LoadStringW
(
GetModuleHandleW
(
NULL
),
IDS_FNT_PREVIEW
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]));
if
(
len
)
...
...
@@ -228,22 +236,25 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam
{
case
WM_PAINT
:
{
PAINTSTRUCT
ps
;
int
i
,
step
;
RECT
client
,
r
;
HBRUSH
hbr
;
PAINTSTRUCT
ps
;
int
i
,
step
;
RECT
client
,
r
;
struct
dialog_info
*
di
;
HBRUSH
hbr
;
BeginPaint
(
hWnd
,
&
ps
);
GetClientRect
(
hWnd
,
&
client
);
step
=
client
.
right
/
8
;
di
=
(
struct
dialog_info
*
)
GetWindowLongPtrW
(
GetParent
(
hWnd
),
DWLP_USER
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
r
.
top
=
(
i
/
8
)
*
(
client
.
bottom
/
2
);
r
.
bottom
=
r
.
top
+
client
.
bottom
/
2
;
r
.
left
=
(
i
&
7
)
*
step
;
r
.
right
=
r
.
left
+
step
;
hbr
=
CreateSolidBrush
(
WCUSER_ColorM
ap
[
i
]);
hbr
=
CreateSolidBrush
(
di
->
config
.
color_m
ap
[
i
]);
FillRect
(
ps
.
hdc
,
&
r
,
hbr
);
DeleteObject
(
hbr
);
if
(
GetWindowLongW
(
hWnd
,
0
)
==
i
)
...
...
programs/wineconsole/user.c
View file @
b1e6d4c1
...
...
@@ -30,15 +30,6 @@ WINE_DECLARE_DEBUG_CHANNEL(wc_font);
UINT
g_uiDefaultCharset
;
/* mapping console colors to RGB values */
const
COLORREF
WCUSER_ColorMap
[
16
]
=
{
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
),
};
static
BOOL
WCUSER_SetFont
(
struct
inner_data
*
data
,
const
LOGFONTW
*
font
);
/******************************************************************
...
...
@@ -76,8 +67,8 @@ static void WCUSER_FillMemDC(const struct inner_data* data, int upd_tp, int upd_
for
(
i
=
0
;
i
<
data
->
curcfg
.
sb_width
;
i
++
)
{
attr
=
cell
[
i
].
Attributes
;
SetBkColor
(
PRIVATE
(
data
)
->
hMemDC
,
WCUSER_ColorMap
[(
attr
>>
4
)
&
0x0F
]);
SetTextColor
(
PRIVATE
(
data
)
->
hMemDC
,
WCUSER_ColorMap
[
attr
&
0x0F
]);
SetBkColor
(
PRIVATE
(
data
)
->
hMemDC
,
data
->
curcfg
.
color_map
[(
attr
>>
4
)
&
0x0F
]);
SetTextColor
(
PRIVATE
(
data
)
->
hMemDC
,
data
->
curcfg
.
color_map
[
attr
&
0x0F
]);
for
(
k
=
i
;
k
<
data
->
curcfg
.
sb_width
&&
cell
[
k
].
Attributes
==
attr
;
k
++
)
{
line
[
k
-
i
]
=
cell
[
k
].
Char
.
UnicodeChar
;
...
...
@@ -86,7 +77,7 @@ static void WCUSER_FillMemDC(const struct inner_data* data, int upd_tp, int upd_
ExtTextOutW
(
PRIVATE
(
data
)
->
hMemDC
,
i
*
data
->
curcfg
.
cell_width
,
j
*
data
->
curcfg
.
cell_height
,
0
,
NULL
,
line
,
k
-
i
,
dx
);
if
(
PRIVATE
(
data
)
->
ext_leading
&&
(
hbr
=
CreateSolidBrush
(
WCUSER_ColorMap
[(
attr
>>
4
)
&
0x0F
])))
(
hbr
=
CreateSolidBrush
(
data
->
curcfg
.
color_map
[(
attr
>>
4
)
&
0x0F
])))
{
r
.
left
=
i
*
data
->
curcfg
.
cell_width
;
r
.
top
=
(
j
+
1
)
*
data
->
curcfg
.
cell_height
-
PRIVATE
(
data
)
->
ext_leading
;
...
...
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