ui/console-vc: make show_cursor() take vt100
Decouples glyph rendering from the console object, continuing the QemuVT100 abstraction introduced in the previous commits. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Marc-André Lureau committed
Feb 19, 2026 at 11:59 UTC
130f8fbd558173d114d8cdd251e1514d5ef1b5bf
1 file changed
+7
-8
ui/console-vc.c
+7
-8
@@ -192,9 +192,8 @@ static void vt100_invalidate_xy(QemuVT100 *vt, int x, int y)
192
}
193
}
194
195
-static void console_show_cursor(QemuTextConsole *s, int show)
195
+static void vt100_show_cursor(QemuVT100 *vt, int show)
196
{
197
- QemuVT100 *vt = &s->vt;
197
TextCell *c;
198
int y, y1;
199
int x = vt->x;
@@ -214,11 +213,11 @@ static void console_show_cursor(QemuTextConsole *s, int show)
213
if (show && cursor_visible_phase) {
214
TextAttributes t_attrib = TEXT_ATTRIBUTES_DEFAULT;
215
t_attrib.invers = !(t_attrib.invers); /* invert fg and bg */
217
- vt100_putcharxy(&s->vt, x, y, c->ch, &t_attrib);
216
+ vt100_putcharxy(vt, x, y, c->ch, &t_attrib);
217
} else {
219
- vt100_putcharxy(&s->vt, x, y, c->ch, &(c->t_attrib));
218
+ vt100_putcharxy(vt, x, y, c->ch, &(c->t_attrib));
219
}
221
- vt100_invalidate_xy(&s->vt, x, y);
220
+ vt100_invalidate_xy(vt, x, y);
221
}
222
}
223
@@ -250,7 +249,7 @@ static void console_refresh(QemuTextConsole *s)
249
y1 = 0;
250
}
251
}
253
- console_show_cursor(s, 1);
252
+ vt100_show_cursor(&s->vt, 1);
253
dpy_gfx_update(QEMU_CONSOLE(s), 0, 0, w, h);
254
}
255
@@ -1023,11 +1022,11 @@ static int vc_chr_write(Chardev *chr, const uint8_t *buf, int len)
1022
vt->update_y0 = vt->height * FONT_HEIGHT;
1023
vt->update_x1 = 0;
1024
vt->update_y1 = 0;
1026
- console_show_cursor(s, 0);
1025
+ vt100_show_cursor(vt, 0);
1026
for(i = 0; i < len; i++) {
1027
vc_putchar(drv, buf[i]);
1028
}
1030
- console_show_cursor(s, 1);
1029
+ vt100_show_cursor(vt, 1);
1030
if (vt->update_x0 < vt->update_x1) {
1031
dpy_gfx_update(QEMU_CONSOLE(s), vt->update_x0, vt->update_y0,
1032
vt->update_x1 - vt->update_x0,