109 |
109 |
|
110 |
110 |
typedef enum {
|
111 |
111 |
GRAPHIC_CONSOLE,
|
112 |
|
TEXT_CONSOLE
|
|
112 |
TEXT_CONSOLE,
|
|
113 |
TEXT_CONSOLE_FIXED_SIZE
|
113 |
114 |
} console_type_t;
|
114 |
115 |
|
115 |
116 |
/* ??? This is mis-named.
|
... | ... | |
1046 |
1047 |
s = consoles[index];
|
1047 |
1048 |
if (s) {
|
1048 |
1049 |
active_console = s;
|
1049 |
|
if (s->g_width && s->g_height
|
|
1050 |
if (s->console_type != TEXT_CONSOLE && s->g_width && s->g_height
|
1050 |
1051 |
&& (s->g_width != s->ds->width || s->g_height != s->ds->height))
|
1051 |
1052 |
dpy_resize(s->ds, s->g_width, s->g_height);
|
1052 |
1053 |
vga_hw_invalidate();
|
... | ... | |
1157 |
1158 |
{
|
1158 |
1159 |
TextConsole *s = (TextConsole *) opaque;
|
1159 |
1160 |
|
|
1161 |
if (s->g_width != s->ds->width || s->g_height != s->ds->height) {
|
|
1162 |
if (s->console_type == TEXT_CONSOLE_FIXED_SIZE)
|
|
1163 |
dpy_resize(s->ds, s->g_width, s->g_height);
|
|
1164 |
else {
|
|
1165 |
s->g_width = s->ds->width;
|
|
1166 |
s->g_height = s->ds->height;
|
|
1167 |
text_console_resize(s);
|
|
1168 |
}
|
|
1169 |
}
|
1160 |
1170 |
console_refresh(s);
|
1161 |
1171 |
}
|
1162 |
1172 |
|
... | ... | |
1242 |
1252 |
return active_console && active_console->console_type == GRAPHIC_CONSOLE;
|
1243 |
1253 |
}
|
1244 |
1254 |
|
|
1255 |
int is_fixedsize_console(void)
|
|
1256 |
{
|
|
1257 |
return active_console && active_console->console_type != TEXT_CONSOLE;
|
|
1258 |
}
|
|
1259 |
|
1245 |
1260 |
void console_color_init(DisplayState *ds)
|
1246 |
1261 |
{
|
1247 |
1262 |
int i, j;
|
... | ... | |
1264 |
1279 |
chr = qemu_mallocz(sizeof(CharDriverState));
|
1265 |
1280 |
if (!chr)
|
1266 |
1281 |
return NULL;
|
1267 |
|
s = new_console(ds, TEXT_CONSOLE);
|
|
1282 |
s = new_console(ds, (p == 0) ? TEXT_CONSOLE : TEXT_CONSOLE_FIXED_SIZE);
|
1268 |
1283 |
if (!s) {
|
1269 |
1284 |
free(chr);
|
1270 |
1285 |
return NULL;
|
1271 |
1286 |
}
|
1272 |
|
if (!p)
|
1273 |
|
p = DEFAULT_MONITOR_SIZE;
|
1274 |
|
|
1275 |
1287 |
chr->opaque = s;
|
1276 |
1288 |
chr->chr_write = console_puts;
|
1277 |
1289 |
chr->chr_send_event = console_send_event;
|
... | ... | |
1345 |
1357 |
}
|
1346 |
1358 |
|
1347 |
1359 |
void qemu_console_copy(QEMUConsole *console, int src_x, int src_y,
|
1348 |
|
int dst_x, int dst_y, int w, int h) {
|
|
1360 |
int dst_x, int dst_y, int w, int h)
|
|
1361 |
{
|
1349 |
1362 |
if (active_console == console) {
|
1350 |
1363 |
if (console->ds->dpy_copy)
|
1351 |
1364 |
console->ds->dpy_copy(console->ds,
|