console: add qemu display registry, add gtk
Add a registry for user interfaces. Add qemu_display_init and
qemu_display_early_init helper functions for display initialization.
Hook up gtk ui as first user.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180301100547.18962-2-kraxel@redhat.com
diff --git a/include/ui/console.h b/include/ui/console.h
index f29bacd..817f9b9 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -432,6 +432,18 @@
int ww, int wh);
#endif
+typedef struct QemuDisplay QemuDisplay;
+
+struct QemuDisplay {
+ DisplayType type;
+ void (*early_init)(DisplayOptions *opts);
+ void (*init)(DisplayState *ds, DisplayOptions *opts);
+};
+
+void qemu_display_register(QemuDisplay *ui);
+void qemu_display_early_init(DisplayOptions *opts);
+void qemu_display_init(DisplayState *ds, DisplayOptions *opts);
+
/* sdl.c */
#ifdef CONFIG_SDL
void sdl_display_early_init(DisplayOptions *opts);
@@ -487,26 +499,6 @@
/* input.c */
int index_from_key(const char *key, size_t key_length);
-/* gtk.c */
-#ifdef CONFIG_GTK
-void early_gtk_display_init(DisplayOptions *opts);
-void gtk_display_init(DisplayState *ds, DisplayOptions *opts);
-#else
-static inline void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
-{
- /* This must never be called if CONFIG_GTK is disabled */
- error_report("GTK support is disabled");
- abort();
-}
-
-static inline void early_gtk_display_init(DisplayOptions *opts)
-{
- /* This must never be called if CONFIG_GTK is disabled */
- error_report("GTK support is disabled");
- abort();
-}
-#endif
-
/* egl-headless.c */
void egl_headless_init(DisplayOptions *opts);