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_disable(DisplayChangeListener
*dcl
);
107 void gd_egl_scanout_texture(DisplayChangeListener
*dcl
,
109 bool backing_y_0_top
,
110 uint32_t backing_width
,
111 uint32_t backing_height
,
112 uint32_t x
, uint32_t y
,
113 uint32_t w
, uint32_t h
);
114 void gd_egl_scanout_flush(DisplayChangeListener
*dcl
,
115 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
116 void gtk_egl_init(void);
117 int gd_egl_make_current(DisplayChangeListener
*dcl
,
120 /* ui/gtk-gl-area.c */
121 void gd_gl_area_init(VirtualConsole
*vc
);
122 void gd_gl_area_draw(VirtualConsole
*vc
);
123 void gd_gl_area_update(DisplayChangeListener
*dcl
,
124 int x
, int y
, int w
, int h
);
125 void gd_gl_area_refresh(DisplayChangeListener
*dcl
);
126 void gd_gl_area_switch(DisplayChangeListener
*dcl
,
127 DisplaySurface
*surface
);
128 QEMUGLContext
gd_gl_area_create_context(DisplayChangeListener
*dcl
,
129 QEMUGLParams
*params
);
130 void gd_gl_area_destroy_context(DisplayChangeListener
*dcl
,
132 void gd_gl_area_scanout_texture(DisplayChangeListener
*dcl
,
134 bool backing_y_0_top
,
135 uint32_t backing_width
,
136 uint32_t backing_height
,
137 uint32_t x
, uint32_t y
,
138 uint32_t w
, uint32_t h
);
139 void gd_gl_area_scanout_flush(DisplayChangeListener
*dcl
,
140 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
141 void gtk_gl_area_init(void);
142 QEMUGLContext
gd_gl_area_get_current_context(DisplayChangeListener
*dcl
);
143 int gd_gl_area_make_current(DisplayChangeListener
*dcl
,
146 #endif /* UI_GTK_H */