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
2d7c73d8
Commit
2d7c73d8
authored
Aug 10, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Aug 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Get and set the console color table.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
adb43b91
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
8 deletions
+52
-8
server_protocol.h
include/wine/server_protocol.h
+4
-1
wineconsole.c
programs/wineconsole/wineconsole.c
+22
-1
console.c
server/console.c
+9
-0
protocol.def
server/protocol.def
+3
-0
trace.c
server/trace.c
+14
-6
No files found.
include/wine/server_protocol.h
View file @
2d7c73d8
...
...
@@ -1947,6 +1947,7 @@ struct set_console_output_info_request
short
int
max_height
;
short
int
font_width
;
short
int
font_height
;
/* VARARG(colors,uints); */
char
__pad_50
[
6
];
};
struct
set_console_output_info_reply
...
...
@@ -1960,6 +1961,7 @@ struct set_console_output_info_reply
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
#define SET_CONSOLE_OUTPUT_INFO_FONT 0x40
#define SET_CONSOLE_OUTPUT_INFO_COLORTABLE 0x80
...
...
@@ -1986,6 +1988,7 @@ struct get_console_output_info_reply
short
int
max_height
;
short
int
font_width
;
short
int
font_height
;
/* VARARG(colors,uints); */
char
__pad_38
[
2
];
};
...
...
@@ -6245,6 +6248,6 @@ union generic_reply
struct
terminate_job_reply
terminate_job_reply
;
};
#define SERVER_PROTOCOL_VERSION 50
7
#define SERVER_PROTOCOL_VERSION 50
8
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
programs/wineconsole/wineconsole.c
View file @
2d7c73d8
...
...
@@ -212,6 +212,27 @@ static BOOL WINECON_SetEditionMode(HANDLE hConIn, int edition_mode)
}
/******************************************************************
* WINECON_SetColors
*
*
*/
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
);
SERVER_START_REQ
(
set_console_output_info
)
{
req
->
handle
=
wine_server_obj_handle
(
data
->
hConOut
);
req
->
mask
=
SET_CONSOLE_OUTPUT_INFO_COLORTABLE
;
wine_server_add_data
(
req
,
cfg
->
color_map
,
color_map_size
);
wine_server_call
(
req
);
}
SERVER_END_REQ
;
}
/******************************************************************
* WINECON_GrabChanges
*
* A change occurs, try to figure out which
...
...
@@ -449,6 +470,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
);
}
WINECON_SetColors
(
data
,
cfg
);
/* 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
...
...
@@ -703,7 +725,6 @@ 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
"
);
...
...
server/console.c
View file @
2d7c73d8
...
...
@@ -147,6 +147,7 @@ struct screen_buffer
int
max_height
;
char_info_t
*
data
;
/* the data for each cell - a width x height matrix */
unsigned
short
attr
;
/* default attribute for screen buffer */
unsigned
int
color_map
[
16
];
/* color table */
rectangle_t
win
;
/* current visible window on the screen buffer *
* as seen in wineconsole */
struct
font_info
font
;
/* console font information */
...
...
@@ -426,6 +427,7 @@ static struct screen_buffer *create_console_output( struct console_input *consol
screen_buffer
->
data
=
NULL
;
screen_buffer
->
font
.
width
=
0
;
screen_buffer
->
font
.
height
=
0
;
memset
(
screen_buffer
->
color_map
,
0
,
sizeof
(
screen_buffer
->
color_map
)
);
list_add_head
(
&
screen_buffer_list
,
&
screen_buffer
->
entry
);
if
(
fd
==
-
1
)
...
...
@@ -1032,6 +1034,11 @@ static int set_console_output_info( struct screen_buffer *screen_buffer,
screen_buffer
->
font
.
width
=
req
->
font_width
;
screen_buffer
->
font
.
height
=
req
->
font_height
;
}
if
(
req
->
mask
&
SET_CONSOLE_OUTPUT_INFO_COLORTABLE
)
{
memcpy
(
screen_buffer
->
color_map
,
get_req_data
(),
min
(
sizeof
(
screen_buffer
->
color_map
),
get_req_data_size
()
));
}
return
1
;
}
...
...
@@ -1690,6 +1697,8 @@ DECL_HANDLER(get_console_output_info)
reply
->
max_height
=
screen_buffer
->
max_height
;
reply
->
font_width
=
screen_buffer
->
font
.
width
;
reply
->
font_height
=
screen_buffer
->
font
.
height
;
set_reply_data
(
screen_buffer
->
color_map
,
min
(
sizeof
(
screen_buffer
->
color_map
),
get_reply_max_size
()
));
release_object
(
screen_buffer
);
}
}
...
...
server/protocol.def
View file @
2d7c73d8
...
...
@@ -1537,6 +1537,7 @@ struct console_renderer_event
short int max_height;
short int font_width; /* font size (width x height) */
short int font_height;
VARARG(colors,uints); /* color table */
@END
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
...
...
@@ -1545,6 +1546,7 @@ struct console_renderer_event
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
#define SET_CONSOLE_OUTPUT_INFO_FONT 0x40
#define SET_CONSOLE_OUTPUT_INFO_COLORTABLE 0x80
/* Get info about a console (output only) */
...
...
@@ -1566,6 +1568,7 @@ struct console_renderer_event
short int max_height;
short int font_width; /* font size (width x height) */
short int font_height;
VARARG(colors,uints); /* color table */
@END
/* Add input records to a console input queue */
...
...
server/trace.c
View file @
2d7c73d8
...
...
@@ -58,9 +58,9 @@ static inline void remove_data( data_size_t size )
cur_size
-=
size
;
}
static
void
dump_uints
(
const
int
*
ptr
,
int
len
)
static
void
dump_uints
(
const
char
*
prefix
,
const
unsigned
int
*
ptr
,
int
len
)
{
fp
utc
(
'{'
,
stderr
);
fp
rintf
(
stderr
,
"%s{"
,
prefix
);
while
(
len
>
0
)
{
fprintf
(
stderr
,
"%08x"
,
*
ptr
++
);
...
...
@@ -407,6 +407,14 @@ static void dump_varargs_ints( const char *prefix, data_size_t size )
remove_data
(
size
);
}
static
void
dump_varargs_uints
(
const
char
*
prefix
,
data_size_t
size
)
{
const
unsigned
int
*
data
=
cur_data
;
dump_uints
(
prefix
,
data
,
size
/
sizeof
(
*
data
)
);
remove_data
(
size
);
}
static
void
dump_varargs_uints64
(
const
char
*
prefix
,
data_size_t
size
)
{
const
unsigned
__int64
*
data
=
cur_data
;
...
...
@@ -574,10 +582,8 @@ static void dump_varargs_context( const char *prefix, data_size_t size )
}
}
if
(
ctx
.
flags
&
SERVER_CTX_EXTENDED_REGISTERS
)
{
fprintf
(
stderr
,
",extended="
);
dump_uints
(
(
const
int
*
)
ctx
.
ext
.
i386_regs
,
sizeof
(
ctx
.
ext
.
i386_regs
)
/
sizeof
(
int
)
);
}
dump_uints
(
",extended="
,
(
const
unsigned
int
*
)
ctx
.
ext
.
i386_regs
,
sizeof
(
ctx
.
ext
.
i386_regs
)
/
sizeof
(
int
)
);
break
;
case
CPU_x86_64
:
if
(
ctx
.
flags
&
SERVER_CTX_CONTROL
)
...
...
@@ -2035,6 +2041,7 @@ static void dump_set_console_output_info_request( const struct set_console_outpu
fprintf
(
stderr
,
", max_height=%d"
,
req
->
max_height
);
fprintf
(
stderr
,
", font_width=%d"
,
req
->
font_width
);
fprintf
(
stderr
,
", font_height=%d"
,
req
->
font_height
);
dump_varargs_uints
(
", colors="
,
cur_size
);
}
static
void
dump_get_console_output_info_request
(
const
struct
get_console_output_info_request
*
req
)
...
...
@@ -2059,6 +2066,7 @@ static void dump_get_console_output_info_reply( const struct get_console_output_
fprintf
(
stderr
,
", max_height=%d"
,
req
->
max_height
);
fprintf
(
stderr
,
", font_width=%d"
,
req
->
font_width
);
fprintf
(
stderr
,
", font_height=%d"
,
req
->
font_height
);
dump_varargs_uints
(
", colors="
,
cur_size
);
}
static
void
dump_write_console_input_request
(
const
struct
write_console_input_request
*
req
)
...
...
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