diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-08-30 13:37:53 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-09-04 13:47:39 +0400 |
commit | b208f745a8af27344c7c8401560b312a4f4bd539 (patch) | |
tree | 1c1d8d49d23baa5b43bfc9f05b8c58659a956cdf | |
parent | 098d57e7c0aa347f08f0738e8bd55b9a7faed8d7 (diff) | |
download | qemu-b208f745a8af27344c7c8401560b312a4f4bd539.zip qemu-b208f745a8af27344c7c8401560b312a4f4bd539.tar.gz qemu-b208f745a8af27344c7c8401560b312a4f4bd539.tar.bz2 |
ui/console: introduce different console objects
Boilerplate code to introduce different object types for the different
console types.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-20-marcandre.lureau@redhat.com>
-rw-r--r-- | ui/console.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/ui/console.c b/ui/console.c index bdecfe7..4ca5064 100644 --- a/ui/console.c +++ b/ui/console.c @@ -128,6 +128,45 @@ struct QemuConsole { OBJECT_DEFINE_TYPE(QemuConsole, qemu_console, QEMU_CONSOLE, OBJECT) +typedef struct QemuGraphicConsole { + QemuConsole parent; +} QemuGraphicConsole; + +typedef QemuConsoleClass QemuGraphicConsoleClass; + +#define TYPE_QEMU_GRAPHIC_CONSOLE "qemu-graphic-console" +OBJECT_DECLARE_SIMPLE_TYPE(QemuGraphicConsole, QEMU_GRAPHIC_CONSOLE) +OBJECT_DEFINE_TYPE(QemuGraphicConsole, qemu_graphic_console, QEMU_GRAPHIC_CONSOLE, QEMU_CONSOLE) + +#define QEMU_IS_GRAPHIC_CONSOLE(c) \ + object_dynamic_cast(OBJECT(c), TYPE_QEMU_GRAPHIC_CONSOLE) + +typedef struct QemuTextConsole { + QemuConsole parent; +} QemuTextConsole; + +typedef QemuConsoleClass QemuTextConsoleClass; + +#define TYPE_QEMU_TEXT_CONSOLE "qemu-text-console" +OBJECT_DECLARE_SIMPLE_TYPE(QemuTextConsole, QEMU_TEXT_CONSOLE) +OBJECT_DEFINE_TYPE(QemuTextConsole, qemu_text_console, QEMU_TEXT_CONSOLE, QEMU_CONSOLE) + +#define QEMU_IS_TEXT_CONSOLE(c) \ + object_dynamic_cast(OBJECT(c), TYPE_QEMU_TEXT_CONSOLE) + +typedef struct QemuFixedTextConsole { + QemuTextConsole parent; +} QemuFixedTextConsole; + +typedef QemuTextConsoleClass QemuFixedTextConsoleClass; + +#define TYPE_QEMU_FIXED_TEXT_CONSOLE "qemu-fixed-text-console" +OBJECT_DECLARE_SIMPLE_TYPE(QemuFixedTextConsole, QEMU_FIXED_TEXT_CONSOLE) +OBJECT_DEFINE_TYPE(QemuFixedTextConsole, qemu_fixed_text_console, QEMU_FIXED_TEXT_CONSOLE, QEMU_TEXT_CONSOLE) + +#define QEMU_IS_FIXED_TEXT_CONSOLE(c) \ + object_dynamic_cast(OBJECT(c), TYPE_QEMU_FIXED_TEXT_CONSOLE) + struct VCChardev { Chardev parent; QemuConsole *console; @@ -1338,6 +1377,51 @@ qemu_console_init(Object *obj) c->window_id = -1; } +static void +qemu_graphic_console_finalize(Object *obj) +{ +} + +static void +qemu_graphic_console_class_init(ObjectClass *oc, void *data) +{ +} + +static void +qemu_graphic_console_init(Object *obj) +{ +} + +static void +qemu_text_console_finalize(Object *obj) +{ +} + +static void +qemu_text_console_class_init(ObjectClass *oc, void *data) +{ +} + +static void +qemu_text_console_init(Object *obj) +{ +} + +static void +qemu_fixed_text_console_finalize(Object *obj) +{ +} + +static void +qemu_fixed_text_console_class_init(ObjectClass *oc, void *data) +{ +} + +static void +qemu_fixed_text_console_init(Object *obj) +{ +} + static QemuConsole *new_console(console_type_t console_type, uint32_t head) { |