diff options
Diffstat (limited to 'include/ui/console.h')
-rw-r--r-- | include/ui/console.h | 75 |
1 files changed, 11 insertions, 64 deletions
diff --git a/include/ui/console.h b/include/ui/console.h index e0d81f1144..aae9e44cb3 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -433,36 +433,18 @@ void surface_gl_setup_viewport(QemuGLShader *gls, int ww, int wh); #endif -/* sdl.c */ -#ifdef CONFIG_SDL -void sdl_display_early_init(DisplayOptions *opts); -void sdl_display_init(DisplayState *ds, DisplayOptions *opts); -#else -static inline void sdl_display_early_init(DisplayOptions *opts) -{ - /* This must never be called if CONFIG_SDL is disabled */ - error_report("SDL support is disabled"); - abort(); -} -static inline void sdl_display_init(DisplayState *ds, DisplayOptions *opts) -{ - /* This must never be called if CONFIG_SDL is disabled */ - error_report("SDL support is disabled"); - abort(); -} -#endif +typedef struct QemuDisplay QemuDisplay; -/* cocoa.m */ -#ifdef CONFIG_COCOA -void cocoa_display_init(DisplayState *ds, DisplayOptions *opts); -#else -static inline void cocoa_display_init(DisplayState *ds, DisplayOptions *opts) -{ - /* This must never be called if CONFIG_COCOA is disabled */ - error_report("Cocoa support is disabled"); - abort(); -} -#endif +struct QemuDisplay { + DisplayType type; + void (*early_init)(DisplayOptions *opts); + void (*init)(DisplayState *ds, DisplayOptions *opts); +}; + +void qemu_display_register(QemuDisplay *ui); +bool qemu_display_find_default(DisplayOptions *opts); +void qemu_display_early_init(DisplayOptions *opts); +void qemu_display_init(DisplayState *ds, DisplayOptions *opts); /* vnc.c */ void vnc_display_init(const char *id); @@ -473,42 +455,7 @@ int vnc_display_pw_expire(const char *id, time_t expires); QemuOpts *vnc_parse(const char *str, Error **errp); int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp); -/* curses.c */ -#ifdef CONFIG_CURSES -void curses_display_init(DisplayState *ds, DisplayOptions *opts); -#else -static inline void curses_display_init(DisplayState *ds, DisplayOptions *opts) -{ - /* This must never be called if CONFIG_CURSES is disabled */ - error_report("curses support is disabled"); - abort(); -} -#endif - /* 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); - #endif |