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 #include "ui/kbd-state.h"
26 #if defined(CONFIG_OPENGL)
27 #include "ui/egl-helpers.h"
28 #include "ui/egl-context.h"
31 typedef struct GtkDisplayState GtkDisplayState
;
33 typedef struct VirtualGfxConsole
{
34 GtkWidget
*drawing_area
;
35 DisplayChangeListener dcl
;
38 pixman_image_t
*convert
;
39 cairo_surface_t
*surface
;
42 #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
;
89 extern bool gtk_use_gl_area
;
92 void gd_update_windowsize(VirtualConsole
*vc
);
95 void gd_egl_init(VirtualConsole
*vc
);
96 void gd_egl_draw(VirtualConsole
*vc
);
97 void gd_egl_update(DisplayChangeListener
*dcl
,
98 int x
, int y
, int w
, int h
);
99 void gd_egl_refresh(DisplayChangeListener
*dcl
);
100 void gd_egl_switch(DisplayChangeListener
*dcl
,
101 DisplaySurface
*surface
);
102 QEMUGLContext
gd_egl_create_context(DisplayChangeListener
*dcl
,
103 QEMUGLParams
*params
);
104 void gd_egl_scanout_disable(DisplayChangeListener
*dcl
);
105 void gd_egl_scanout_texture(DisplayChangeListener
*dcl
,
107 bool backing_y_0_top
,
108 uint32_t backing_width
,
109 uint32_t backing_height
,
110 uint32_t x
, uint32_t y
,
111 uint32_t w
, uint32_t h
);
112 void gd_egl_scanout_dmabuf(DisplayChangeListener
*dcl
,
114 void gd_egl_cursor_dmabuf(DisplayChangeListener
*dcl
,
115 QemuDmaBuf
*dmabuf
, bool have_hot
,
116 uint32_t hot_x
, uint32_t hot_y
);
117 void gd_egl_cursor_position(DisplayChangeListener
*dcl
,
118 uint32_t pos_x
, uint32_t pos_y
);
119 void gd_egl_release_dmabuf(DisplayChangeListener
*dcl
,
121 void gd_egl_scanout_flush(DisplayChangeListener
*dcl
,
122 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
123 void gtk_egl_init(DisplayGLMode mode
);
124 int gd_egl_make_current(DisplayChangeListener
*dcl
,
127 /* ui/gtk-gl-area.c */
128 void gd_gl_area_init(VirtualConsole
*vc
);
129 void gd_gl_area_draw(VirtualConsole
*vc
);
130 void gd_gl_area_update(DisplayChangeListener
*dcl
,
131 int x
, int y
, int w
, int h
);
132 void gd_gl_area_refresh(DisplayChangeListener
*dcl
);
133 void gd_gl_area_switch(DisplayChangeListener
*dcl
,
134 DisplaySurface
*surface
);
135 QEMUGLContext
gd_gl_area_create_context(DisplayChangeListener
*dcl
,
136 QEMUGLParams
*params
);
137 void gd_gl_area_destroy_context(DisplayChangeListener
*dcl
,
139 void gd_gl_area_scanout_texture(DisplayChangeListener
*dcl
,
141 bool backing_y_0_top
,
142 uint32_t backing_width
,
143 uint32_t backing_height
,
144 uint32_t x
, uint32_t y
,
145 uint32_t w
, uint32_t h
);
146 void gd_gl_area_scanout_flush(DisplayChangeListener
*dcl
,
147 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
148 void gtk_gl_area_init(void);
149 QEMUGLContext
gd_gl_area_get_current_context(DisplayChangeListener
*dcl
);
150 int gd_gl_area_make_current(DisplayChangeListener
*dcl
,
153 #endif /* UI_GTK_H */