wineconsole: Use renderer handle instead of hConOut where possible.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ad1f09d574
commit
1f5a45e63e
|
@ -324,7 +324,7 @@ static void WCCURSES_ComputePositions(struct inner_data* data)
|
||||||
data->curcfg.win_width, data->curcfg.win_height, x, y);
|
data->curcfg.win_width, data->curcfg.win_height, x, y);
|
||||||
pos.Left = pos.Top = 0;
|
pos.Left = pos.Top = 0;
|
||||||
pos.Right = x - 1; pos.Bottom = y - 1;
|
pos.Right = x - 1; pos.Bottom = y - 1;
|
||||||
SetConsoleWindowInfo(data->hConOut, FALSE, &pos);
|
SetConsoleWindowInfo(data->console, FALSE, &pos);
|
||||||
return; /* we'll get called again upon event for new window size */
|
return; /* we'll get called again upon event for new window size */
|
||||||
}
|
}
|
||||||
if (PRIVATE(data)->pad) WCCURSES_PosCursor(data);
|
if (PRIVATE(data)->pad) WCCURSES_PosCursor(data);
|
||||||
|
|
|
@ -687,7 +687,7 @@ static void WCUSER_CopySelectionToClipboard(const struct inner_data* data)
|
||||||
LPWSTR end;
|
LPWSTR end;
|
||||||
DWORD count;
|
DWORD count;
|
||||||
|
|
||||||
ReadConsoleOutputCharacterW(data->hConOut, p, w - 1, c, &count);
|
ReadConsoleOutputCharacterW(data->console, p, w - 1, c, &count);
|
||||||
|
|
||||||
/* strip spaces from the end of the line */
|
/* strip spaces from the end of the line */
|
||||||
end = p + w - 1;
|
end = p + w - 1;
|
||||||
|
|
|
@ -70,7 +70,7 @@ static void WINECON_FetchCells(struct inner_data* data, int upd_tp, int upd_bm)
|
||||||
COORD size = { data->curcfg.sb_width, data->curcfg.sb_height };
|
COORD size = { data->curcfg.sb_width, data->curcfg.sb_height };
|
||||||
COORD coord = { 0, upd_tp };
|
COORD coord = { 0, upd_tp };
|
||||||
|
|
||||||
if (ReadConsoleOutputW(data->hConOut, data->cells, size, coord, ®ion))
|
if (ReadConsoleOutputW(data->console, data->cells, size, coord, ®ion))
|
||||||
data->fnRefresh(data, upd_tp, upd_bm);
|
data->fnRefresh(data, upd_tp, upd_bm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ static void WINECON_SetColors(struct inner_data *data, const struct config_data*
|
||||||
|
|
||||||
params.info.popup_attr = cfg->popup_attr;
|
params.info.popup_attr = cfg->popup_attr;
|
||||||
memcpy(params.info.color_map, cfg->color_map, sizeof(cfg->color_map));
|
memcpy(params.info.color_map, cfg->color_map, sizeof(cfg->color_map));
|
||||||
DeviceIoControl(data->hConOut, IOCTL_CONDRV_SET_OUTPUT_INFO, ¶ms, sizeof(params), NULL, 0, NULL, NULL);
|
DeviceIoControl(data->console, IOCTL_CONDRV_SET_OUTPUT_INFO, ¶ms, sizeof(params), NULL, 0, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
|
@ -383,11 +383,11 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
|
||||||
* (no notification is sent when invariant operation is requested)
|
* (no notification is sent when invariant operation is requested)
|
||||||
*/
|
*/
|
||||||
cinfo.bVisible = !cfg->cursor_visible;
|
cinfo.bVisible = !cfg->cursor_visible;
|
||||||
SetConsoleCursorInfo(data->hConOut, &cinfo);
|
SetConsoleCursorInfo(data->console, &cinfo);
|
||||||
/* </FIXME> */
|
/* </FIXME> */
|
||||||
cinfo.bVisible = cfg->cursor_visible;
|
cinfo.bVisible = cfg->cursor_visible;
|
||||||
/* this shall update (through notif) curcfg */
|
/* this shall update (through notif) curcfg */
|
||||||
SetConsoleCursorInfo(data->hConOut, &cinfo);
|
SetConsoleCursorInfo(data->console, &cinfo);
|
||||||
}
|
}
|
||||||
if (data->curcfg.history_size != cfg->history_size)
|
if (data->curcfg.history_size != cfg->history_size)
|
||||||
{
|
{
|
||||||
|
@ -425,7 +425,7 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
|
||||||
params->info.font_weight = cfg->font_weight;
|
params->info.font_weight = cfg->font_weight;
|
||||||
params->info.font_pitch_family = cfg->font_pitch_family;
|
params->info.font_pitch_family = cfg->font_pitch_family;
|
||||||
memcpy(params + 1, cfg->face_name, len * sizeof(WCHAR));
|
memcpy(params + 1, cfg->face_name, len * sizeof(WCHAR));
|
||||||
DeviceIoControl(data->hConOut, IOCTL_CONDRV_SET_OUTPUT_INFO, params, sizeof(*params) + len * sizeof(WCHAR),
|
DeviceIoControl(data->console, IOCTL_CONDRV_SET_OUTPUT_INFO, params, sizeof(*params) + len * sizeof(WCHAR),
|
||||||
NULL, 0, NULL, NULL);
|
NULL, 0, NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -436,8 +436,8 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
|
||||||
|
|
||||||
data->curcfg.def_attr = cfg->def_attr;
|
data->curcfg.def_attr = cfg->def_attr;
|
||||||
screen_size = cfg->win_width * (cfg->win_height + 1);
|
screen_size = cfg->win_width * (cfg->win_height + 1);
|
||||||
FillConsoleOutputAttribute(data->hConOut, cfg->def_attr, screen_size, top_left, &written);
|
FillConsoleOutputAttribute(data->console, cfg->def_attr, screen_size, top_left, &written);
|
||||||
SetConsoleTextAttribute(data->hConOut, cfg->def_attr);
|
SetConsoleTextAttribute(data->console, cfg->def_attr);
|
||||||
}
|
}
|
||||||
WINECON_SetColors(data, cfg);
|
WINECON_SetColors(data, cfg);
|
||||||
/* now let's look at the window / sb size changes...
|
/* now let's look at the window / sb size changes...
|
||||||
|
@ -454,13 +454,13 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
|
||||||
|
|
||||||
#define ChgSBfWidth() do {c.X = cfg->sb_width; \
|
#define ChgSBfWidth() do {c.X = cfg->sb_width; \
|
||||||
c.Y = data->curcfg.sb_height;\
|
c.Y = data->curcfg.sb_height;\
|
||||||
SetConsoleScreenBufferSize(data->hConOut, c);\
|
SetConsoleScreenBufferSize(data->console, c);\
|
||||||
} while (0)
|
} while (0)
|
||||||
#define ChgWinHPos() do {pos.Left = cfg->win_pos.X - data->curcfg.win_pos.X; \
|
#define ChgWinHPos() do {pos.Left = cfg->win_pos.X - data->curcfg.win_pos.X; \
|
||||||
pos.Top = 0; \
|
pos.Top = 0; \
|
||||||
pos.Right = pos.Left + cfg->win_width - data->curcfg.win_width; \
|
pos.Right = pos.Left + cfg->win_width - data->curcfg.win_width; \
|
||||||
pos.Bottom = 0; \
|
pos.Bottom = 0; \
|
||||||
SetConsoleWindowInfo(data->hConOut, FALSE, &pos);\
|
SetConsoleWindowInfo(data->console, FALSE, &pos);\
|
||||||
} while (0)
|
} while (0)
|
||||||
#define TstSBfHeight() (data->curcfg.sb_height != cfg->sb_height)
|
#define TstSBfHeight() (data->curcfg.sb_height != cfg->sb_height)
|
||||||
#define TstWinVPos() (data->curcfg.win_height != cfg->win_height || data->curcfg.win_pos.Y != cfg->win_pos.Y)
|
#define TstWinVPos() (data->curcfg.win_height != cfg->win_height || data->curcfg.win_pos.Y != cfg->win_pos.Y)
|
||||||
|
@ -468,13 +468,13 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
|
||||||
/* since we're going to apply height after width is done, we use width as defined
|
/* since we're going to apply height after width is done, we use width as defined
|
||||||
* in cfg, and not in data->curcfg because if won't be updated yet */
|
* in cfg, and not in data->curcfg because if won't be updated yet */
|
||||||
#define ChgSBfHeight() do {c.X = cfg->sb_width; c.Y = cfg->sb_height; \
|
#define ChgSBfHeight() do {c.X = cfg->sb_width; c.Y = cfg->sb_height; \
|
||||||
SetConsoleScreenBufferSize(data->hConOut, c); \
|
SetConsoleScreenBufferSize(data->console, c); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define ChgWinVPos() do {pos.Left = 0; \
|
#define ChgWinVPos() do {pos.Left = 0; \
|
||||||
pos.Top = cfg->win_pos.Y - data->curcfg.win_pos.Y; \
|
pos.Top = cfg->win_pos.Y - data->curcfg.win_pos.Y; \
|
||||||
pos.Right = 0; \
|
pos.Right = 0; \
|
||||||
pos.Bottom = pos.Top + cfg->win_height - data->curcfg.win_height; \
|
pos.Bottom = pos.Top + cfg->win_height - data->curcfg.win_height; \
|
||||||
SetConsoleWindowInfo(data->hConOut, FALSE, &pos);\
|
SetConsoleWindowInfo(data->console, FALSE, &pos);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -582,7 +582,7 @@ static BOOL WINECON_GetServerConfig(struct inner_data* data)
|
||||||
data->curcfg.insert_mode = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) ==
|
data->curcfg.insert_mode = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) ==
|
||||||
(ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS);
|
(ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS);
|
||||||
|
|
||||||
if (!DeviceIoControl(data->hConOut, IOCTL_CONDRV_GET_OUTPUT_INFO, NULL, 0,
|
if (!DeviceIoControl(data->console, IOCTL_CONDRV_GET_OUTPUT_INFO, NULL, 0,
|
||||||
&output_info, sizeof(output_info), NULL, NULL))
|
&output_info, sizeof(output_info), NULL, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
data->curcfg.cursor_size = output_info.cursor_size;
|
data->curcfg.cursor_size = output_info.cursor_size;
|
||||||
|
|
Loading…
Reference in New Issue