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 #ifdef GDK_WINDOWING_WAYLAND
22 #include <gdk/gdkwayland.h>
25 #if defined(CONFIG_OPENGL)
26 #include "ui/egl-helpers.h"
27 #include "ui/egl-context.h"
30 /* Compatibility define to let us build on both Gtk2 and Gtk3 */
31 #if GTK_CHECK_VERSION(3, 0, 0)
32 static inline void gdk_drawable_get_size(GdkWindow
*w
, gint
*ww
, gint
*wh
)
34 *ww
= gdk_window_get_width(w
);
35 *wh
= gdk_window_get_height(w
);
39 typedef struct GtkDisplayState GtkDisplayState
;
41 typedef struct VirtualGfxConsole
{
42 GtkWidget
*drawing_area
;
43 DisplayChangeListener dcl
;
45 pixman_image_t
*convert
;
46 cairo_surface_t
*surface
;
49 #if defined(CONFIG_OPENGL)
62 #if defined(CONFIG_VTE)
63 typedef struct VirtualVteConsole
{
72 typedef enum VirtualConsoleType
{
77 typedef struct VirtualConsole
{
84 VirtualConsoleType type
;
86 VirtualGfxConsole gfx
;
87 #if defined(CONFIG_VTE)
88 VirtualVteConsole vte
;
94 void gd_update_windowsize(VirtualConsole
*vc
);
97 void gd_egl_init(VirtualConsole
*vc
);
98 void gd_egl_draw(VirtualConsole
*vc
);
99 void gd_egl_update(DisplayChangeListener
*dcl
,
100 int x
, int y
, int w
, int h
);
101 void gd_egl_refresh(DisplayChangeListener
*dcl
);
102 void gd_egl_switch(DisplayChangeListener
*dcl
,
103 DisplaySurface
*surface
);
104 QEMUGLContext
gd_egl_create_context(DisplayChangeListener
*dcl
,
105 QEMUGLParams
*params
);
106 void gd_egl_scanout(DisplayChangeListener
*dcl
,
107 uint32_t backing_id
, bool backing_y_0_top
,
108 uint32_t backing_width
, uint32_t backing_height
,
109 uint32_t x
, uint32_t y
,
110 uint32_t w
, uint32_t h
);
111 void gd_egl_scanout_flush(DisplayChangeListener
*dcl
,
112 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
113 void gtk_egl_init(void);
114 int gd_egl_make_current(DisplayChangeListener
*dcl
,
117 /* ui/gtk-gl-area.c */
118 void gd_gl_area_init(VirtualConsole
*vc
);
119 void gd_gl_area_draw(VirtualConsole
*vc
);
120 void gd_gl_area_update(DisplayChangeListener
*dcl
,
121 int x
, int y
, int w
, int h
);
122 void gd_gl_area_refresh(DisplayChangeListener
*dcl
);
123 void gd_gl_area_switch(DisplayChangeListener
*dcl
,
124 DisplaySurface
*surface
);
125 QEMUGLContext
gd_gl_area_create_context(DisplayChangeListener
*dcl
,
126 QEMUGLParams
*params
);
127 void gd_gl_area_destroy_context(DisplayChangeListener
*dcl
,
129 void gd_gl_area_scanout(DisplayChangeListener
*dcl
,
130 uint32_t backing_id
, bool backing_y_0_top
,
131 uint32_t backing_width
, uint32_t backing_height
,
132 uint32_t x
, uint32_t y
,
133 uint32_t w
, uint32_t h
);
134 void gd_gl_area_scanout_flush(DisplayChangeListener
*dcl
,
135 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
136 void gtk_gl_area_init(void);
137 QEMUGLContext
gd_gl_area_get_current_context(DisplayChangeListener
*dcl
);
138 int gd_gl_area_make_current(DisplayChangeListener
*dcl
,
141 #endif /* UI_GTK_H */