From 4fd903907612da2de3fbe59105bfcc28c4ad17c2 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Tue, 21 May 2013 14:16:53 +1000 Subject: server: protocol.def console.c --- server/console.c | 24 ++++++++++++++++-------- server/protocol.def | 8 ++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/server/console.c b/server/console.c index 3f90937..b902e7d 100644 --- a/server/console.c +++ b/server/console.c @@ -135,6 +135,8 @@ struct screen_buffer int height; int max_width; /* size (w-h) of the window given font size */ int max_height; + short int font_width; /* size (w-h) of active console font in pixels */ + short int font_height; char_info_t *data; /* the data for each cell - a width x height matrix */ unsigned short attr; /* default attribute for screen buffer */ rectangle_t win; /* current visible window on the screen buffer * @@ -377,7 +379,8 @@ static void generate_sb_initial_events( struct console_input *console_input ) console_input_events_append( console_input, &evt ); } -static struct screen_buffer *create_console_output( struct console_input *console_input, int fd ) +static struct screen_buffer *create_console_output( struct console_input *console_input, int fd, + const struct create_console_output_request *req ) { struct screen_buffer *screen_buffer; int i; @@ -391,17 +394,20 @@ static struct screen_buffer *create_console_output( struct console_input *consol screen_buffer->input = console_input; screen_buffer->cursor_size = 100; screen_buffer->cursor_visible = 1; - screen_buffer->width = 80; - screen_buffer->height = 150; - screen_buffer->max_width = 80; - screen_buffer->max_height = 25; screen_buffer->cursor_x = 0; screen_buffer->cursor_y = 0; + screen_buffer->width = req->width; + screen_buffer->height = req->height; + screen_buffer->max_width = req->max_width; + screen_buffer->max_height = req->max_height; screen_buffer->attr = 0x0F; screen_buffer->win.left = 0; - screen_buffer->win.right = screen_buffer->max_width - 1; screen_buffer->win.top = 0; - screen_buffer->win.bottom = screen_buffer->max_height - 1; + screen_buffer->win.right = screen_buffer->width - 1; + screen_buffer->win.bottom = screen_buffer->height - 1; + screen_buffer->font_width = req->font_width; + screen_buffer->font_height = req->font_height; + if (fd == -1) screen_buffer->fd = NULL; else @@ -1615,7 +1621,7 @@ DECL_HANDLER(create_console_output) return; } - screen_buffer = create_console_output( console, fd ); + screen_buffer = create_console_output( console, fd, req ); if (screen_buffer) { /* FIXME: should store sharing and test it when opening the CONOUT$ device @@ -1660,6 +1666,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 ); } } diff --git a/server/protocol.def b/server/protocol.def index 234c41e..31269d5 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1357,6 +1357,12 @@ struct console_renderer_event unsigned int attributes; /* object attributes */ unsigned int share; /* sharing credentials */ int fd; /* for bare consoles, fd the screen-buffer is attached to */ + short int width; /* screen buffer width */ + short int height; /* screen buffer height */ + short int max_width; /* maximum console width */ + short int max_height; /* maximum console height */ + short int font_width; /* console font width */ + short int font_height; /* console font height */ @REPLY obj_handle_t handle_out; /* handle to the screen buffer */ @END @@ -1405,6 +1411,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; /* width of active console font */ + short int font_height; /* height of active console font */ @END /* Add input records to a console input queue */ -- 1.7.10.4