server: Remove no longer used set_console_output_info request.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-07-10 17:08:23 +02:00 committed by Alexandre Julliard
parent 9c6d0f6eea
commit 4d57e8f937
6 changed files with 11 additions and 325 deletions

View File

@ -76,6 +76,16 @@ struct condrv_output_info_params
struct condrv_output_info info; /* output info */
};
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002
#define SET_CONSOLE_OUTPUT_INFO_SIZE 0x0004
#define SET_CONSOLE_OUTPUT_INFO_ATTR 0x0008
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x0010
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x0020
#define SET_CONSOLE_OUTPUT_INFO_FONT 0x0040
#define SET_CONSOLE_OUTPUT_INFO_COLORTABLE 0x0080
#define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR 0x0100
/* IOCTL_CONDRV_GET_RENDERER_EVENTS result */
struct condrv_renderer_event
{

View File

@ -2017,48 +2017,6 @@ struct create_console_output_reply
struct set_console_output_info_request
{
struct request_header __header;
obj_handle_t handle;
int mask;
short int cursor_size;
short int cursor_visible;
short int cursor_x;
short int cursor_y;
short int width;
short int height;
short int attr;
short int popup_attr;
short int win_left;
short int win_top;
short int win_right;
short int win_bottom;
short int max_width;
short int max_height;
short int font_width;
short int font_height;
short int font_weight;
short int font_pitch_family;
/* VARARG(colors,uints,64); */
/* VARARG(face_name,unicode_str); */
};
struct set_console_output_info_reply
{
struct reply_header __header;
};
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002
#define SET_CONSOLE_OUTPUT_INFO_SIZE 0x0004
#define SET_CONSOLE_OUTPUT_INFO_ATTR 0x0008
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x0010
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x0020
#define SET_CONSOLE_OUTPUT_INFO_FONT 0x0040
#define SET_CONSOLE_OUTPUT_INFO_COLORTABLE 0x0080
#define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR 0x0100
struct write_console_output_request
{
struct request_header __header;
@ -5743,7 +5701,6 @@ enum request
REQ_append_console_input_history,
REQ_get_console_input_history,
REQ_create_console_output,
REQ_set_console_output_info,
REQ_write_console_output,
REQ_fill_console_output,
REQ_read_console_output,
@ -6041,7 +5998,6 @@ union generic_request
struct append_console_input_history_request append_console_input_history_request;
struct get_console_input_history_request get_console_input_history_request;
struct create_console_output_request create_console_output_request;
struct set_console_output_info_request set_console_output_info_request;
struct write_console_output_request write_console_output_request;
struct fill_console_output_request fill_console_output_request;
struct read_console_output_request read_console_output_request;
@ -6337,7 +6293,6 @@ union generic_reply
struct append_console_input_history_reply append_console_input_history_reply;
struct get_console_input_history_reply get_console_input_history_reply;
struct create_console_output_reply create_console_output_reply;
struct set_console_output_info_reply set_console_output_info_reply;
struct write_console_output_reply write_console_output_reply;
struct fill_console_output_reply fill_console_output_reply;
struct read_console_output_reply read_console_output_reply;
@ -6559,7 +6514,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 622
#define SERVER_PROTOCOL_VERSION 623
/* ### protocol_version end ### */

View File

@ -1018,184 +1018,6 @@ static int change_screen_buffer_size( struct screen_buffer *screen_buffer,
return 1;
}
/* set misc screen buffer information */
static int set_console_output_info( struct screen_buffer *screen_buffer,
const struct set_console_output_info_request *req )
{
struct condrv_renderer_event evt;
data_size_t font_name_len, offset;
WCHAR *font_name;
memset(&evt.u, 0, sizeof(evt.u));
if (req->mask & SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM)
{
if (req->cursor_size < 1 || req->cursor_size > 100)
{
set_error( STATUS_INVALID_PARAMETER );
return 0;
}
if (screen_buffer->cursor_size != req->cursor_size ||
screen_buffer->cursor_visible != req->cursor_visible)
{
screen_buffer->cursor_size = req->cursor_size;
screen_buffer->cursor_visible = req->cursor_visible;
evt.event = CONSOLE_RENDERER_CURSOR_GEOM_EVENT;
evt.u.cursor_geom.size = req->cursor_size;
evt.u.cursor_geom.visible = req->cursor_visible;
console_input_events_append( screen_buffer->input, &evt );
}
}
if (req->mask & SET_CONSOLE_OUTPUT_INFO_CURSOR_POS)
{
if (req->cursor_x < 0 || req->cursor_x >= screen_buffer->width ||
req->cursor_y < 0 || req->cursor_y >= screen_buffer->height)
{
set_error( STATUS_INVALID_PARAMETER );
return 0;
}
if (screen_buffer->cursor_x != req->cursor_x || screen_buffer->cursor_y != req->cursor_y)
{
screen_buffer->cursor_x = req->cursor_x;
screen_buffer->cursor_y = req->cursor_y;
evt.event = CONSOLE_RENDERER_CURSOR_POS_EVENT;
evt.u.cursor_pos.x = req->cursor_x;
evt.u.cursor_pos.y = req->cursor_y;
console_input_events_append( screen_buffer->input, &evt );
}
}
if (req->mask & SET_CONSOLE_OUTPUT_INFO_SIZE)
{
unsigned cc;
/* new screen-buffer cannot be smaller than actual window */
if (req->width < screen_buffer->win.right - screen_buffer->win.left + 1 ||
req->height < screen_buffer->win.bottom - screen_buffer->win.top + 1)
{
set_error( STATUS_INVALID_PARAMETER );
return 0;
}
/* FIXME: there are also some basic minimum and max size to deal with */
if (!change_screen_buffer_size( screen_buffer, req->width, req->height )) return 0;
evt.event = CONSOLE_RENDERER_SB_RESIZE_EVENT;
evt.u.resize.width = req->width;
evt.u.resize.height = req->height;
console_input_events_append( screen_buffer->input, &evt );
evt.event = CONSOLE_RENDERER_UPDATE_EVENT;
evt.u.update.top = 0;
evt.u.update.bottom = screen_buffer->height - 1;
console_input_events_append( screen_buffer->input, &evt );
/* scroll window to display sb */
if (screen_buffer->win.right >= req->width)
{
screen_buffer->win.right -= screen_buffer->win.left;
screen_buffer->win.left = 0;
}
if (screen_buffer->win.bottom >= req->height)
{
screen_buffer->win.bottom -= screen_buffer->win.top;
screen_buffer->win.top = 0;
}
/* reset cursor if needed (normally, if cursor was outside of new sb, the
* window has been shifted so that the new position of the cursor will be
* visible */
cc = 0;
if (screen_buffer->cursor_x >= req->width)
{
screen_buffer->cursor_x = req->width - 1;
cc++;
}
if (screen_buffer->cursor_y >= req->height)
{
screen_buffer->cursor_y = req->height - 1;
cc++;
}
if (cc)
{
evt.event = CONSOLE_RENDERER_CURSOR_POS_EVENT;
evt.u.cursor_pos.x = req->cursor_x;
evt.u.cursor_pos.y = req->cursor_y;
console_input_events_append( screen_buffer->input, &evt );
}
if (screen_buffer == screen_buffer->input->active &&
screen_buffer->input->mode & ENABLE_WINDOW_INPUT)
{
INPUT_RECORD ir;
ir.EventType = WINDOW_BUFFER_SIZE_EVENT;
ir.Event.WindowBufferSizeEvent.dwSize.X = req->width;
ir.Event.WindowBufferSizeEvent.dwSize.Y = req->height;
write_console_input( screen_buffer->input, 1, &ir );
}
}
if (req->mask & SET_CONSOLE_OUTPUT_INFO_ATTR)
{
screen_buffer->attr = req->attr;
}
if (req->mask & SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR)
{
screen_buffer->popup_attr = req->popup_attr;
}
if (req->mask & SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW)
{
if (req->win_left < 0 || req->win_left > req->win_right ||
req->win_right >= screen_buffer->width ||
req->win_top < 0 || req->win_top > req->win_bottom ||
req->win_bottom >= screen_buffer->height)
{
set_error( STATUS_INVALID_PARAMETER );
return 0;
}
if (screen_buffer->win.left != req->win_left || screen_buffer->win.top != req->win_top ||
screen_buffer->win.right != req->win_right || screen_buffer->win.bottom != req->win_bottom)
{
screen_buffer->win.left = req->win_left;
screen_buffer->win.top = req->win_top;
screen_buffer->win.right = req->win_right;
screen_buffer->win.bottom = req->win_bottom;
evt.event = CONSOLE_RENDERER_DISPLAY_EVENT;
evt.u.display.left = req->win_left;
evt.u.display.top = req->win_top;
evt.u.display.width = req->win_right - req->win_left + 1;
evt.u.display.height = req->win_bottom - req->win_top + 1;
console_input_events_append( screen_buffer->input, &evt );
}
}
if (req->mask & SET_CONSOLE_OUTPUT_INFO_MAX_SIZE)
{
screen_buffer->max_width = req->max_width;
screen_buffer->max_height = req->max_height;
}
if (req->mask & SET_CONSOLE_OUTPUT_INFO_COLORTABLE)
{
memcpy( screen_buffer->color_map, get_req_data(), min( get_req_data_size(), sizeof(screen_buffer->color_map) ));
}
if (req->mask & SET_CONSOLE_OUTPUT_INFO_FONT)
{
screen_buffer->font.width = req->font_width;
screen_buffer->font.height = req->font_height;
screen_buffer->font.weight = req->font_weight;
screen_buffer->font.pitch_family = req->font_pitch_family;
offset = req->mask & SET_CONSOLE_OUTPUT_INFO_COLORTABLE ? sizeof(screen_buffer->color_map) : 0;
if (get_req_data_size() > offset)
{
font_name_len = (get_req_data_size() - offset) / sizeof(WCHAR) * sizeof(WCHAR);
font_name = mem_alloc( font_name_len );
if (font_name)
{
memcpy( font_name, (char *)get_req_data() + offset, font_name_len );
free( screen_buffer->font.face_name );
screen_buffer->font.face_name = font_name;
screen_buffer->font.face_len = font_name_len;
}
}
}
return 1;
}
static int set_output_info( struct screen_buffer *screen_buffer,
const struct condrv_output_info_params *params, data_size_t extra_size )
{
@ -2219,19 +2041,6 @@ DECL_HANDLER(create_console_output)
release_object( console );
}
/* set info about a console screen buffer */
DECL_HANDLER(set_console_output_info)
{
struct screen_buffer *screen_buffer;
if ((screen_buffer = (struct screen_buffer*)get_handle_obj( current->process, req->handle,
FILE_WRITE_PROPERTIES, &screen_buffer_ops)))
{
set_console_output_info( screen_buffer, req );
release_object( screen_buffer );
}
}
/* read data (chars & attrs) from a screen buffer */
DECL_HANDLER(read_console_output)
{

View File

@ -1583,42 +1583,6 @@ enum server_fd_type
@END
/* Set info about a console (output only) */
@REQ(set_console_output_info)
obj_handle_t handle; /* handle to the console */
int mask; /* setting mask (see below) */
short int cursor_size; /* size of cursor (percentage filled) */
short int cursor_visible;/* cursor visibility flag */
short int cursor_x; /* position of cursor (x, y) */
short int cursor_y;
short int width; /* width of the screen buffer */
short int height; /* height of the screen buffer */
short int attr; /* default fill attributes (screen colors) */
short int popup_attr; /* pop-up color attributes */
short int win_left; /* window actually displayed by renderer */
short int win_top; /* the rect area is expressed within the */
short int win_right; /* boundaries of the screen buffer */
short int win_bottom;
short int max_width; /* maximum size (width x height) for the window */
short int max_height;
short int font_width; /* font size (width x height) */
short int font_height;
short int font_weight; /* font weight */
short int font_pitch_family; /* font pitch & family */
VARARG(colors,uints,64); /* color table */
VARARG(face_name,unicode_str); /* font face name */
@END
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002
#define SET_CONSOLE_OUTPUT_INFO_SIZE 0x0004
#define SET_CONSOLE_OUTPUT_INFO_ATTR 0x0008
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x0010
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x0020
#define SET_CONSOLE_OUTPUT_INFO_FONT 0x0040
#define SET_CONSOLE_OUTPUT_INFO_COLORTABLE 0x0080
#define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR 0x0100
/* write data (chars and/or attributes) in a screen buffer */
@REQ(write_console_output)
obj_handle_t handle; /* handle to the console output */

View File

@ -192,7 +192,6 @@ DECL_HANDLER(get_console_input_info);
DECL_HANDLER(append_console_input_history);
DECL_HANDLER(get_console_input_history);
DECL_HANDLER(create_console_output);
DECL_HANDLER(set_console_output_info);
DECL_HANDLER(write_console_output);
DECL_HANDLER(fill_console_output);
DECL_HANDLER(read_console_output);
@ -489,7 +488,6 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(req_handler)req_append_console_input_history,
(req_handler)req_get_console_input_history,
(req_handler)req_create_console_output,
(req_handler)req_set_console_output_info,
(req_handler)req_write_console_output,
(req_handler)req_fill_console_output,
(req_handler)req_read_console_output,
@ -1185,27 +1183,6 @@ C_ASSERT( FIELD_OFFSET(struct create_console_output_request, fd) == 28 );
C_ASSERT( sizeof(struct create_console_output_request) == 32 );
C_ASSERT( FIELD_OFFSET(struct create_console_output_reply, handle_out) == 8 );
C_ASSERT( sizeof(struct create_console_output_reply) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, mask) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, cursor_size) == 20 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, cursor_visible) == 22 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, cursor_x) == 24 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, cursor_y) == 26 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, width) == 28 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, height) == 30 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, attr) == 32 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, popup_attr) == 34 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_left) == 36 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_top) == 38 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_right) == 40 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_bottom) == 42 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_width) == 44 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_height) == 46 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_width) == 48 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_height) == 50 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_weight) == 52 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_pitch_family) == 54 );
C_ASSERT( sizeof(struct set_console_output_info_request) == 56 );
C_ASSERT( FIELD_OFFSET(struct write_console_output_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct write_console_output_request, x) == 16 );
C_ASSERT( FIELD_OFFSET(struct write_console_output_request, y) == 20 );

View File

@ -2142,32 +2142,6 @@ static void dump_create_console_output_reply( const struct create_console_output
fprintf( stderr, " handle_out=%04x", req->handle_out );
}
static void dump_set_console_output_info_request( const struct set_console_output_info_request *req )
{
fprintf( stderr, " handle=%04x", req->handle );
fprintf( stderr, ", mask=%d", req->mask );
fprintf( stderr, ", cursor_size=%d", req->cursor_size );
fprintf( stderr, ", cursor_visible=%d", req->cursor_visible );
fprintf( stderr, ", cursor_x=%d", req->cursor_x );
fprintf( stderr, ", cursor_y=%d", req->cursor_y );
fprintf( stderr, ", width=%d", req->width );
fprintf( stderr, ", height=%d", req->height );
fprintf( stderr, ", attr=%d", req->attr );
fprintf( stderr, ", popup_attr=%d", req->popup_attr );
fprintf( stderr, ", win_left=%d", req->win_left );
fprintf( stderr, ", win_top=%d", req->win_top );
fprintf( stderr, ", win_right=%d", req->win_right );
fprintf( stderr, ", win_bottom=%d", req->win_bottom );
fprintf( stderr, ", max_width=%d", req->max_width );
fprintf( stderr, ", max_height=%d", req->max_height );
fprintf( stderr, ", font_width=%d", req->font_width );
fprintf( stderr, ", font_height=%d", req->font_height );
fprintf( stderr, ", font_weight=%d", req->font_weight );
fprintf( stderr, ", font_pitch_family=%d", req->font_pitch_family );
dump_varargs_uints( ", colors=", min(cur_size,64) );
dump_varargs_unicode_str( ", face_name=", cur_size );
}
static void dump_write_console_output_request( const struct write_console_output_request *req )
{
fprintf( stderr, " handle=%04x", req->handle );
@ -4623,7 +4597,6 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_append_console_input_history_request,
(dump_func)dump_get_console_input_history_request,
(dump_func)dump_create_console_output_request,
(dump_func)dump_set_console_output_info_request,
(dump_func)dump_write_console_output_request,
(dump_func)dump_fill_console_output_request,
(dump_func)dump_read_console_output_request,
@ -4917,7 +4890,6 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
NULL,
(dump_func)dump_get_console_input_history_reply,
(dump_func)dump_create_console_output_reply,
NULL,
(dump_func)dump_write_console_output_reply,
(dump_func)dump_fill_console_output_reply,
(dump_func)dump_read_console_output_reply,
@ -5211,7 +5183,6 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"append_console_input_history",
"get_console_input_history",
"create_console_output",
"set_console_output_info",
"write_console_output",
"fill_console_output",
"read_console_output",