[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 35/52] ui/console: declare console types in console.h
From: |
marcandre . lureau |
Subject: |
[PULL 35/52] ui/console: declare console types in console.h |
Date: |
Mon, 4 Sep 2023 15:52:32 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
We are going to split the console.c unit next, and implement
separately. But we need to check the underlying type in various places.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-36-marcandre.lureau@redhat.com>
---
include/ui/console.h | 25 +++++++++++++++++++++----
ui/console.c | 15 ---------------
2 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/include/ui/console.h b/include/ui/console.h
index 465f0f93a0..0f7f50deaf 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -12,6 +12,27 @@
# include "ui/shader.h"
#endif
+#define TYPE_QEMU_CONSOLE "qemu-console"
+OBJECT_DECLARE_TYPE(QemuConsole, QemuConsoleClass, QEMU_CONSOLE)
+
+#define TYPE_QEMU_GRAPHIC_CONSOLE "qemu-graphic-console"
+OBJECT_DECLARE_SIMPLE_TYPE(QemuGraphicConsole, QEMU_GRAPHIC_CONSOLE)
+
+#define TYPE_QEMU_TEXT_CONSOLE "qemu-text-console"
+OBJECT_DECLARE_SIMPLE_TYPE(QemuTextConsole, QEMU_TEXT_CONSOLE)
+
+#define TYPE_QEMU_FIXED_TEXT_CONSOLE "qemu-fixed-text-console"
+OBJECT_DECLARE_SIMPLE_TYPE(QemuFixedTextConsole, QEMU_FIXED_TEXT_CONSOLE)
+
+#define QEMU_IS_GRAPHIC_CONSOLE(c) \
+ object_dynamic_cast(OBJECT(c), TYPE_QEMU_GRAPHIC_CONSOLE)
+
+#define QEMU_IS_TEXT_CONSOLE(c) \
+ object_dynamic_cast(OBJECT(c), TYPE_QEMU_TEXT_CONSOLE)
+
+#define QEMU_IS_FIXED_TEXT_CONSOLE(c) \
+ object_dynamic_cast(OBJECT(c), TYPE_QEMU_FIXED_TEXT_CONSOLE)
+
/* keyboard/mouse support */
#define MOUSE_EVENT_LBUTTON 0x01
@@ -112,10 +133,6 @@ void console_handle_touch_event(QemuConsole *con,
Error **errp);
/* consoles */
-#define TYPE_QEMU_CONSOLE "qemu-console"
-OBJECT_DECLARE_TYPE(QemuConsole, QemuConsoleClass, QEMU_CONSOLE)
-
-
struct QemuConsoleClass {
ObjectClass parent_class;
};
diff --git a/ui/console.c b/ui/console.c
index 3d884956b7..ed9e7137b8 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -106,13 +106,8 @@ typedef struct 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;
@@ -139,26 +134,16 @@ typedef struct 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;
QemuTextConsole *console;
--
2.41.0
- [PULL 26/52] ui/vc: move cursor_timer initialization to QemuTextConsole class, (continued)
- [PULL 26/52] ui/vc: move cursor_timer initialization to QemuTextConsole class, marcandre . lureau, 2023/09/04
- [PULL 27/52] ui/console: free more QemuConsole resources, marcandre . lureau, 2023/09/04
- [PULL 24/52] ui/console: update the head from unused QemuConsole, marcandre . lureau, 2023/09/04
- [PULL 22/52] ui/console: remove new_console(), marcandre . lureau, 2023/09/04
- [PULL 28/52] ui/vc: move text fields to QemuTextConsole, marcandre . lureau, 2023/09/04
- [PULL 25/52] ui/console: allocate ui_timer in QemuConsole, marcandre . lureau, 2023/09/04
- [PULL 29/52] ui/console: move graphic fields to QemuGraphicConsole, marcandre . lureau, 2023/09/04
- [PULL 30/52] ui/vc: fold text_console_do_init() in vc_chr_open(), marcandre . lureau, 2023/09/04
- [PULL 31/52] ui/vc: move some text console initialization to qom handlers, marcandre . lureau, 2023/09/04
- [PULL 32/52] ui/console: simplify getting active_console size, marcandre . lureau, 2023/09/04
- [PULL 35/52] ui/console: declare console types in console.h,
marcandre . lureau <=
- [PULL 37/52] ui/console: rename vga_ functions with qemu_console_, marcandre . lureau, 2023/09/04
- [PULL 33/52] ui/console: remove need for g_width/g_height, marcandre . lureau, 2023/09/04
- [PULL 34/52] ui/vc: use common text console surface creation, marcandre . lureau, 2023/09/04
- [PULL 36/52] ui/console: use QEMU_PIXMAN_COLOR helpers, marcandre . lureau, 2023/09/04
- [PULL 38/52] ui/console: assert(surface) where appropriate, marcandre . lureau, 2023/09/04
- [PULL 39/52] ui/console: fold text_console_update_cursor_timer, marcandre . lureau, 2023/09/04
- [PULL 40/52] ui/vc: skip text console resize when possible, marcandre . lureau, 2023/09/04
- [PULL 41/52] ui/console: minor stylistic changes, marcandre . lureau, 2023/09/04
- [PULL 43/52] ui/vc: do not parse VC-specific options in Spice and GTK, marcandre . lureau, 2023/09/04
- [PULL 42/52] ui/vc: move text console invalidate in helper, marcandre . lureau, 2023/09/04