[PATCH 3/7 v2] server: Add console font size information
Hugh McMaster
hugh.mcmaster at outlook.com
Mon Oct 26 01:42:15 CDT 2015
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
server/console.c | 16 ++++++++++++++++
server/protocol.def | 6 +++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/server/console.c b/server/console.c
index 10b1350..054997b 100644
--- a/server/console.c
+++ b/server/console.c
@@ -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)
@@ -1020,6 +1029,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;
}
@@ -1677,6 +1691,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 c313006..8191c9e 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -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,7 +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) */
@REQ(get_console_output_info)
@@ -1521,6 +1523,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 */
--
1.9.1
More information about the wine-patches
mailing list