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 #define MILLISEC_PER_SEC 1000000
33 typedef struct GtkDisplayState GtkDisplayState
;
35 typedef struct VirtualGfxConsole
{
36 GtkWidget
*drawing_area
;
37 DisplayChangeListener dcl
;
40 pixman_image_t
*convert
;
41 cairo_surface_t
*surface
;
44 #if defined(CONFIG_OPENGL)
60 #if defined(CONFIG_VTE)
61 typedef struct VirtualVteConsole
{
70 typedef enum VirtualConsoleType
{
75 typedef struct VirtualConsole
{
82 VirtualConsoleType type
;
84 VirtualGfxConsole gfx
;
85 #if defined(CONFIG_VTE)
86 VirtualVteConsole vte
;
91 extern bool gtk_use_gl_area
;
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_dmabuf(DisplayChangeListener
*dcl
,
116 void gd_egl_cursor_dmabuf(DisplayChangeListener
*dcl
,
117 QemuDmaBuf
*dmabuf
, bool have_hot
,
118 uint32_t hot_x
, uint32_t hot_y
);
119 void gd_egl_cursor_position(DisplayChangeListener
*dcl
,
120 uint32_t pos_x
, uint32_t pos_y
);
121 void gd_egl_release_dmabuf(DisplayChangeListener
*dcl
,
123 void gd_egl_scanout_flush(DisplayChangeListener
*dcl
,
124 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
125 void gtk_egl_init(DisplayGLMode mode
);
126 int gd_egl_make_current(DisplayChangeListener
*dcl
,
129 /* ui/gtk-gl-area.c */
130 void gd_gl_area_init(VirtualConsole
*vc
);
131 void gd_gl_area_draw(VirtualConsole
*vc
);
132 void gd_gl_area_update(DisplayChangeListener
*dcl
,
133 int x
, int y
, int w
, int h
);
134 void gd_gl_area_refresh(DisplayChangeListener
*dcl
);
135 void gd_gl_area_switch(DisplayChangeListener
*dcl
,
136 DisplaySurface
*surface
);
137 QEMUGLContext
gd_gl_area_create_context(DisplayChangeListener
*dcl
,
138 QEMUGLParams
*params
);
139 void gd_gl_area_destroy_context(DisplayChangeListener
*dcl
,
141 void gd_gl_area_scanout_texture(DisplayChangeListener
*dcl
,
143 bool backing_y_0_top
,
144 uint32_t backing_width
,
145 uint32_t backing_height
,
146 uint32_t x
, uint32_t y
,
147 uint32_t w
, uint32_t h
);
148 void gd_gl_area_scanout_flush(DisplayChangeListener
*dcl
,
149 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
150 void gtk_gl_area_init(void);
151 QEMUGLContext
gd_gl_area_get_current_context(DisplayChangeListener
*dcl
);
152 int gd_gl_area_make_current(DisplayChangeListener
*dcl
,
155 #endif /* UI_GTK_H */