Commit b61badcc authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

server: Add console font information.

parent 90963730
......@@ -1896,7 +1896,9 @@ struct set_console_output_info_request
short int win_bottom;
short int max_width;
short int max_height;
char __pad_46[2];
short int font_width;
short int font_height;
char __pad_50[6];
};
struct set_console_output_info_reply
{
......@@ -1908,6 +1910,7 @@ struct set_console_output_info_reply
#define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
#define SET_CONSOLE_OUTPUT_INFO_FONT 0x40
......@@ -1932,7 +1935,9 @@ struct get_console_output_info_reply
short int win_bottom;
short int max_width;
short int max_height;
char __pad_34[6];
short int font_width;
short int font_height;
char __pad_38[2];
};
......@@ -6147,6 +6152,6 @@ union generic_reply
struct terminate_job_reply terminate_job_reply;
};
#define SERVER_PROTOCOL_VERSION 488
#define SERVER_PROTOCOL_VERSION 489
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
......@@ -121,6 +121,12 @@ static const struct object_ops console_input_events_ops =
console_input_events_destroy /* destroy */
};
struct font_info
{
short int width;
short int height;
};
struct screen_buffer
{
struct object obj; /* object header */
......@@ -139,6 +145,7 @@ struct screen_buffer
unsigned short attr; /* default attribute for screen buffer */
rectangle_t win; /* current visible window on the screen buffer *
* as seen in wineconsole */
struct font_info font; /* console font information */
struct fd *fd; /* for bare console, attached output fd */
};
......@@ -411,6 +418,8 @@ static struct screen_buffer *create_console_output( struct console_input *consol
screen_buffer->win.top = 0;
screen_buffer->win.bottom = screen_buffer->max_height - 1;
screen_buffer->data = NULL;
screen_buffer->font.width = 0;
screen_buffer->font.height = 0;
list_add_head( &screen_buffer_list, &screen_buffer->entry );
if (fd == -1)
......@@ -1019,6 +1028,11 @@ static int set_console_output_info( struct screen_buffer *screen_buffer,
screen_buffer->max_width = req->max_width;
screen_buffer->max_height = req->max_height;
}
if (req->mask & SET_CONSOLE_OUTPUT_INFO_FONT)
{
screen_buffer->font.width = req->font_width;
screen_buffer->font.height = req->font_height;
}
return 1;
}
......@@ -1676,6 +1690,8 @@ DECL_HANDLER(get_console_output_info)
reply->win_bottom = screen_buffer->win.bottom;
reply->max_width = screen_buffer->max_width;
reply->max_height = screen_buffer->max_height;
reply->font_width = screen_buffer->font.width;
reply->font_height = screen_buffer->font.height;
release_object( screen_buffer );
}
}
......
......@@ -1495,6 +1495,8 @@ struct console_renderer_event
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;
@END
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02
......@@ -1502,6 +1504,7 @@ struct console_renderer_event
#define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20
#define SET_CONSOLE_OUTPUT_INFO_FONT 0x40
/* Get info about a console (output only) */
......@@ -1521,6 +1524,8 @@ struct console_renderer_event
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;
@END
/* Add input records to a console input queue */
......
......@@ -1112,7 +1112,9 @@ C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_right) == 38
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_bottom) == 40 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_width) == 42 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_height) == 44 );
C_ASSERT( sizeof(struct set_console_output_info_request) == 48 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_width) == 46 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_height) == 48 );
C_ASSERT( sizeof(struct set_console_output_info_request) == 56 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_request, handle) == 12 );
C_ASSERT( sizeof(struct get_console_output_info_request) == 16 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, cursor_size) == 8 );
......@@ -1128,6 +1130,8 @@ C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_right) == 26 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_bottom) == 28 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_width) == 30 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_height) == 32 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_width) == 34 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_height) == 36 );
C_ASSERT( sizeof(struct get_console_output_info_reply) == 40 );
C_ASSERT( FIELD_OFFSET(struct write_console_input_request, handle) == 12 );
C_ASSERT( sizeof(struct write_console_input_request) == 16 );
......
......@@ -1959,6 +1959,8 @@ static void dump_set_console_output_info_request( const struct set_console_outpu
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 );
}
static void dump_get_console_output_info_request( const struct get_console_output_info_request *req )
......@@ -1981,6 +1983,8 @@ static void dump_get_console_output_info_reply( const struct get_console_output_
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 );
}
static void dump_write_console_input_request( const struct write_console_input_request *req )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment