diff options
Diffstat (limited to 'include/ui/console.h')
-rw-r--r-- | include/ui/console.h | 55 |
1 files changed, 22 insertions, 33 deletions
diff --git a/include/ui/console.h b/include/ui/console.h index a234c72d2e..e591d742d4 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -21,7 +21,8 @@ #define QEMU_CAPS_LOCK_LED (1 << 2) /* in ms */ -#define GUI_REFRESH_INTERVAL 30 +#define GUI_REFRESH_INTERVAL_DEFAULT 30 +#define GUI_REFRESH_INTERVAL_IDLE 3000 typedef void QEMUPutKBDEvent(void *opaque, int keycode); typedef void QEMUPutLEDEvent(void *opaque, int ledstate); @@ -174,27 +175,15 @@ typedef struct DisplayChangeListenerOps { } DisplayChangeListenerOps; struct DisplayChangeListener { - int idle; - uint64_t gui_timer_interval; + uint64_t update_interval; const DisplayChangeListenerOps *ops; DisplayState *ds; + QemuConsole *con; QLIST_ENTRY(DisplayChangeListener) next; }; -struct DisplayState { - struct DisplaySurface *surface; - struct QEMUTimer *gui_timer; - bool have_gfx; - bool have_text; - - QLIST_HEAD(, DisplayChangeListener) listeners; - - struct DisplayState *next; -}; - -void register_displaystate(DisplayState *ds); -DisplayState *get_displaystate(void); +DisplayState *init_displaystate(void); DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp, int linesize, uint8_t *data, bool byteswap); @@ -217,16 +206,15 @@ static inline int is_buffer_shared(DisplaySurface *surface) return !(surface->flags & QEMU_ALLOCATED_FLAG); } -void gui_setup_refresh(DisplayState *ds); - void register_displaychangelistener(DisplayState *ds, DisplayChangeListener *dcl); +void update_displaychangelistener(DisplayChangeListener *dcl, + uint64_t interval); void unregister_displaychangelistener(DisplayChangeListener *dcl); void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h); void dpy_gfx_replace_surface(QemuConsole *con, DisplaySurface *surface); -void dpy_refresh(DisplayState *s); void dpy_gfx_copy(QemuConsole *con, int src_x, int src_y, int dst_x, int dst_y, int w, int h); void dpy_text_cursor(QemuConsole *con, int x, int y); @@ -281,24 +269,25 @@ static inline void console_write_ch(console_ch_t *dest, uint32_t ch) *dest = ch; } -typedef void (*vga_hw_update_ptr)(void *); -typedef void (*vga_hw_invalidate_ptr)(void *); -typedef void (*vga_hw_screen_dump_ptr)(void *, const char *, bool cswitch, - Error **errp); -typedef void (*vga_hw_text_update_ptr)(void *, console_ch_t *); +typedef struct GraphicHwOps { + void (*invalidate)(void *opaque); + void (*gfx_update)(void *opaque); + void (*text_update)(void *opaque, console_ch_t *text); + void (*update_interval)(void *opaque, uint64_t interval); +} GraphicHwOps; -QemuConsole *graphic_console_init(vga_hw_update_ptr update, - vga_hw_invalidate_ptr invalidate, - vga_hw_screen_dump_ptr screen_dump, - vga_hw_text_update_ptr text_update, +QemuConsole *graphic_console_init(const GraphicHwOps *ops, void *opaque); -void vga_hw_update(void); -void vga_hw_invalidate(void); -void vga_hw_text_update(console_ch_t *chardata); +void graphic_hw_update(QemuConsole *con); +void graphic_hw_invalidate(QemuConsole *con); +void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata); + +QemuConsole *qemu_console_lookup_by_index(unsigned int index); +bool qemu_console_is_visible(QemuConsole *con); +bool qemu_console_is_graphic(QemuConsole *con); +bool qemu_console_is_fixedsize(QemuConsole *con); -int is_graphic_console(void); -int is_fixedsize_console(void); void text_consoles_set_display(DisplayState *ds); void console_select(unsigned int index); void console_color_init(DisplayState *ds); |