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

server: Get and set the console pop-up color attributes.

parent b9a79c09
...@@ -1939,6 +1939,7 @@ struct set_console_output_info_request ...@@ -1939,6 +1939,7 @@ struct set_console_output_info_request
short int width; short int width;
short int height; short int height;
short int attr; short int attr;
short int popup_attr;
short int win_left; short int win_left;
short int win_top; short int win_top;
short int win_right; short int win_right;
...@@ -1948,20 +1949,21 @@ struct set_console_output_info_request ...@@ -1948,20 +1949,21 @@ struct set_console_output_info_request
short int font_width; short int font_width;
short int font_height; short int font_height;
/* VARARG(colors,uints); */ /* VARARG(colors,uints); */
char __pad_50[6]; char __pad_52[4];
}; };
struct set_console_output_info_reply struct set_console_output_info_reply
{ {
struct reply_header __header; struct reply_header __header;
}; };
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002
#define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x0004
#define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x0008
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x0010
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x0020
#define SET_CONSOLE_OUTPUT_INFO_FONT 0x40 #define SET_CONSOLE_OUTPUT_INFO_FONT 0x0040
#define SET_CONSOLE_OUTPUT_INFO_COLORTABLE 0x80 #define SET_CONSOLE_OUTPUT_INFO_COLORTABLE 0x0080
#define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR 0x0100
...@@ -1980,6 +1982,7 @@ struct get_console_output_info_reply ...@@ -1980,6 +1982,7 @@ struct get_console_output_info_reply
short int width; short int width;
short int height; short int height;
short int attr; short int attr;
short int popup_attr;
short int win_left; short int win_left;
short int win_top; short int win_top;
short int win_right; short int win_right;
...@@ -1989,7 +1992,6 @@ struct get_console_output_info_reply ...@@ -1989,7 +1992,6 @@ struct get_console_output_info_reply
short int font_width; short int font_width;
short int font_height; short int font_height;
/* VARARG(colors,uints); */ /* VARARG(colors,uints); */
char __pad_38[2];
}; };
...@@ -6248,6 +6250,6 @@ union generic_reply ...@@ -6248,6 +6250,6 @@ union generic_reply
struct terminate_job_reply terminate_job_reply; struct terminate_job_reply terminate_job_reply;
}; };
#define SERVER_PROTOCOL_VERSION 508 #define SERVER_PROTOCOL_VERSION 509
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */ #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
...@@ -226,7 +226,8 @@ static void WINECON_SetColors(struct inner_data *data, const struct config_data* ...@@ -226,7 +226,8 @@ static void WINECON_SetColors(struct inner_data *data, const struct config_data*
SERVER_START_REQ( set_console_output_info ) SERVER_START_REQ( set_console_output_info )
{ {
req->handle = wine_server_obj_handle( data->hConOut ); req->handle = wine_server_obj_handle( data->hConOut );
req->mask = SET_CONSOLE_OUTPUT_INFO_COLORTABLE; req->mask = SET_CONSOLE_OUTPUT_INFO_COLORTABLE | SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR;
req->popup_attr = cfg->popup_attr;
wine_server_add_data( req, cfg->color_map, color_map_size ); wine_server_add_data( req, cfg->color_map, color_map_size );
wine_server_call( req ); wine_server_call( req );
} }
......
...@@ -146,7 +146,8 @@ struct screen_buffer ...@@ -146,7 +146,8 @@ struct screen_buffer
int max_width; /* size (w-h) of the window given font size */ int max_width; /* size (w-h) of the window given font size */
int max_height; int max_height;
char_info_t *data; /* the data for each cell - a width x height matrix */ char_info_t *data; /* the data for each cell - a width x height matrix */
unsigned short attr; /* default attribute for screen buffer */ unsigned short attr; /* default fill attributes (screen colors) */
unsigned short popup_attr; /* pop-up color attributes */
unsigned int color_map[16]; /* color table */ unsigned int color_map[16]; /* color table */
rectangle_t win; /* current visible window on the screen buffer * rectangle_t win; /* current visible window on the screen buffer *
* as seen in wineconsole */ * as seen in wineconsole */
...@@ -420,6 +421,7 @@ static struct screen_buffer *create_console_output( struct console_input *consol ...@@ -420,6 +421,7 @@ static struct screen_buffer *create_console_output( struct console_input *consol
screen_buffer->cursor_x = 0; screen_buffer->cursor_x = 0;
screen_buffer->cursor_y = 0; screen_buffer->cursor_y = 0;
screen_buffer->attr = 0x0F; screen_buffer->attr = 0x0F;
screen_buffer->popup_attr = 0xF5;
screen_buffer->win.left = 0; screen_buffer->win.left = 0;
screen_buffer->win.right = screen_buffer->max_width - 1; screen_buffer->win.right = screen_buffer->max_width - 1;
screen_buffer->win.top = 0; screen_buffer->win.top = 0;
...@@ -999,6 +1001,10 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, ...@@ -999,6 +1001,10 @@ static int set_console_output_info( struct screen_buffer *screen_buffer,
{ {
screen_buffer->attr = req->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->mask & SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW)
{ {
if (req->win_left < 0 || req->win_left > req->win_right || if (req->win_left < 0 || req->win_left > req->win_right ||
...@@ -1689,6 +1695,7 @@ DECL_HANDLER(get_console_output_info) ...@@ -1689,6 +1695,7 @@ DECL_HANDLER(get_console_output_info)
reply->width = screen_buffer->width; reply->width = screen_buffer->width;
reply->height = screen_buffer->height; reply->height = screen_buffer->height;
reply->attr = screen_buffer->attr; reply->attr = screen_buffer->attr;
reply->popup_attr = screen_buffer->popup_attr;
reply->win_left = screen_buffer->win.left; reply->win_left = screen_buffer->win.left;
reply->win_top = screen_buffer->win.top; reply->win_top = screen_buffer->win.top;
reply->win_right = screen_buffer->win.right; reply->win_right = screen_buffer->win.right;
......
...@@ -1528,7 +1528,8 @@ struct console_renderer_event ...@@ -1528,7 +1528,8 @@ struct console_renderer_event
short int cursor_y; short int cursor_y;
short int width; /* width of the screen buffer */ short int width; /* width of the screen buffer */
short int height; /* height of the screen buffer */ short int height; /* height of the screen buffer */
short int attr; /* default attribute */ 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_left; /* window actually displayed by renderer */
short int win_top; /* the rect area is expressed within the */ short int win_top; /* the rect area is expressed within the */
short int win_right; /* boundaries of the screen buffer */ short int win_right; /* boundaries of the screen buffer */
...@@ -1539,14 +1540,15 @@ struct console_renderer_event ...@@ -1539,14 +1540,15 @@ struct console_renderer_event
short int font_height; short int font_height;
VARARG(colors,uints); /* color table */ VARARG(colors,uints); /* color table */
@END @END
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002
#define SET_CONSOLE_OUTPUT_INFO_SIZE 0x04 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x0004
#define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08 #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x0008
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x0010
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x0020
#define SET_CONSOLE_OUTPUT_INFO_FONT 0x40 #define SET_CONSOLE_OUTPUT_INFO_FONT 0x0040
#define SET_CONSOLE_OUTPUT_INFO_COLORTABLE 0x80 #define SET_CONSOLE_OUTPUT_INFO_COLORTABLE 0x0080
#define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR 0x0100
/* Get info about a console (output only) */ /* Get info about a console (output only) */
...@@ -1559,7 +1561,8 @@ struct console_renderer_event ...@@ -1559,7 +1561,8 @@ struct console_renderer_event
short int cursor_y; short int cursor_y;
short int width; /* width of the screen buffer */ short int width; /* width of the screen buffer */
short int height; /* height of the screen buffer */ short int height; /* height of the screen buffer */
short int attr; /* default attribute */ 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_left; /* window actually displayed by renderer */
short int win_top; /* the rect area is expressed within the */ short int win_top; /* the rect area is expressed within the */
short int win_right; /* boundaries of the screen buffer */ short int win_right; /* boundaries of the screen buffer */
......
...@@ -1126,14 +1126,15 @@ C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, cursor_y) == 26 ) ...@@ -1126,14 +1126,15 @@ 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, width) == 28 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, height) == 30 ); 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, attr) == 32 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_left) == 34 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, popup_attr) == 34 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_top) == 36 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_left) == 36 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_right) == 38 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_top) == 38 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_bottom) == 40 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_right) == 40 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_width) == 42 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_bottom) == 42 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_height) == 44 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_width) == 44 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_width) == 46 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_height) == 46 );
C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_height) == 48 ); 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( sizeof(struct set_console_output_info_request) == 56 ); C_ASSERT( sizeof(struct set_console_output_info_request) == 56 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_request, handle) == 12 );
C_ASSERT( sizeof(struct get_console_output_info_request) == 16 ); C_ASSERT( sizeof(struct get_console_output_info_request) == 16 );
...@@ -1144,14 +1145,15 @@ C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, cursor_y) == 14 ); ...@@ -1144,14 +1145,15 @@ C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, cursor_y) == 14 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, width) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, width) == 16 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, height) == 18 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, height) == 18 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, attr) == 20 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, attr) == 20 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_left) == 22 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, popup_attr) == 22 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_top) == 24 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_left) == 24 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_right) == 26 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_top) == 26 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_bottom) == 28 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_right) == 28 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_width) == 30 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_bottom) == 30 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_height) == 32 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_width) == 32 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_width) == 34 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_height) == 34 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_height) == 36 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_width) == 36 );
C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_height) == 38 );
C_ASSERT( sizeof(struct get_console_output_info_reply) == 40 ); C_ASSERT( sizeof(struct get_console_output_info_reply) == 40 );
C_ASSERT( FIELD_OFFSET(struct write_console_input_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct write_console_input_request, handle) == 12 );
C_ASSERT( sizeof(struct write_console_input_request) == 16 ); C_ASSERT( sizeof(struct write_console_input_request) == 16 );
......
...@@ -2033,6 +2033,7 @@ static void dump_set_console_output_info_request( const struct set_console_outpu ...@@ -2033,6 +2033,7 @@ static void dump_set_console_output_info_request( const struct set_console_outpu
fprintf( stderr, ", width=%d", req->width ); fprintf( stderr, ", width=%d", req->width );
fprintf( stderr, ", height=%d", req->height ); fprintf( stderr, ", height=%d", req->height );
fprintf( stderr, ", attr=%d", req->attr ); 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_left=%d", req->win_left );
fprintf( stderr, ", win_top=%d", req->win_top ); fprintf( stderr, ", win_top=%d", req->win_top );
fprintf( stderr, ", win_right=%d", req->win_right ); fprintf( stderr, ", win_right=%d", req->win_right );
...@@ -2058,6 +2059,7 @@ static void dump_get_console_output_info_reply( const struct get_console_output_ ...@@ -2058,6 +2059,7 @@ static void dump_get_console_output_info_reply( const struct get_console_output_
fprintf( stderr, ", width=%d", req->width ); fprintf( stderr, ", width=%d", req->width );
fprintf( stderr, ", height=%d", req->height ); fprintf( stderr, ", height=%d", req->height );
fprintf( stderr, ", attr=%d", req->attr ); 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_left=%d", req->win_left );
fprintf( stderr, ", win_top=%d", req->win_top ); fprintf( stderr, ", win_top=%d", req->win_top );
fprintf( stderr, ", win_right=%d", req->win_right ); fprintf( stderr, ", win_right=%d", req->win_right );
......
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