diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-03-01 11:05:35 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-03-05 08:44:11 +0100 |
commit | db71589fd9428156a5b366e348d895d445f77449 (patch) | |
tree | f6d17989d37f04ea75ce868ca610ecf4e6722230 /include/ui | |
parent | 136c67e07869227b21b3f627316e03679ce7b738 (diff) |
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
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/console.h | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/include/ui/console.h b/include/ui/console.h index f29bacd625..817f9b9bcc 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -432,6 +432,18 @@ void surface_gl_setup_viewport(QemuGLShader *gls, 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 @@ static inline void curses_display_init(DisplayState *ds, DisplayOptions *opts) /* 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); |