4 #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
5 /* Work around an -Wstrict-prototypes warning in GTK headers */
6 #pragma GCC diagnostic push
7 #pragma GCC diagnostic ignored "-Wstrict-prototypes"
10 #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
11 #pragma GCC diagnostic pop
14 #include <gdk/gdkkeysyms.h>
16 #ifdef GDK_WINDOWING_X11
18 #include <X11/XKBlib.h>
21 #if defined(CONFIG_OPENGL)
22 #include "ui/egl-helpers.h"
23 #include "ui/egl-context.h"
26 /* Compatibility define to let us build on both Gtk2 and Gtk3 */
27 #if GTK_CHECK_VERSION(3, 0, 0)
28 static inline void gdk_drawable_get_size(GdkWindow *w, gint *ww, gint *wh)
30 *ww = gdk_window_get_width(w);
31 *wh = gdk_window_get_height(w);
35 typedef struct GtkDisplayState GtkDisplayState;
37 typedef struct VirtualGfxConsole {
38 GtkWidget *drawing_area;
39 DisplayChangeListener dcl;
41 pixman_image_t *convert;
42 cairo_surface_t *surface;
45 #if defined(CONFIG_OPENGL)
58 #if defined(CONFIG_VTE)
59 typedef struct VirtualVteConsole {
68 typedef enum VirtualConsoleType {
73 typedef struct VirtualConsole {
80 VirtualConsoleType type;
82 VirtualGfxConsole gfx;
83 #if defined(CONFIG_VTE)
84 VirtualVteConsole vte;
90 void gd_update_windowsize(VirtualConsole *vc);
93 void gd_egl_init(VirtualConsole *vc);
94 void gd_egl_draw(VirtualConsole *vc);
95 void gd_egl_update(DisplayChangeListener *dcl,
96 int x, int y, int w, int h);
97 void gd_egl_refresh(DisplayChangeListener *dcl);
98 void gd_egl_switch(DisplayChangeListener *dcl,
99 DisplaySurface *surface);
100 QEMUGLContext gd_egl_create_context(DisplayChangeListener *dcl,
101 QEMUGLParams *params);
102 void gd_egl_scanout(DisplayChangeListener *dcl,
103 uint32_t backing_id, bool backing_y_0_top,
104 uint32_t x, uint32_t y,
105 uint32_t w, uint32_t h);
106 void gd_egl_scanout_flush(DisplayChangeListener *dcl,
107 uint32_t x, uint32_t y, uint32_t w, uint32_t h);
108 void gtk_egl_init(void);
109 int gd_egl_make_current(DisplayChangeListener *dcl,
112 /* ui/gtk-gl-area.c */
113 void gd_gl_area_init(VirtualConsole *vc);
114 void gd_gl_area_draw(VirtualConsole *vc);
115 void gd_gl_area_update(DisplayChangeListener *dcl,
116 int x, int y, int w, int h);
117 void gd_gl_area_refresh(DisplayChangeListener *dcl);
118 void gd_gl_area_switch(DisplayChangeListener *dcl,
119 DisplaySurface *surface);
120 QEMUGLContext gd_gl_area_create_context(DisplayChangeListener *dcl,
121 QEMUGLParams *params);
122 void gd_gl_area_destroy_context(DisplayChangeListener *dcl,
124 void gd_gl_area_scanout(DisplayChangeListener *dcl,
125 uint32_t backing_id, bool backing_y_0_top,
126 uint32_t x, uint32_t y,
127 uint32_t w, uint32_t h);
128 void gd_gl_area_scanout_flush(DisplayChangeListener *dcl,
129 uint32_t x, uint32_t y, uint32_t w, uint32_t h);
130 void gtk_gl_area_init(void);
131 QEMUGLContext gd_gl_area_get_current_context(DisplayChangeListener *dcl);
132 int gd_gl_area_make_current(DisplayChangeListener *dcl,
135 #endif /* UI_GTK_H */