4 /* Work around an -Wstrict-prototypes warning in GTK headers */
5 #pragma GCC diagnostic push
6 #pragma GCC diagnostic ignored "-Wstrict-prototypes"
8 #pragma GCC diagnostic pop
10 #include <gdk/gdkkeysyms.h>
12 #ifdef GDK_WINDOWING_X11
14 #include <X11/XKBlib.h>
17 #ifdef GDK_WINDOWING_WAYLAND
18 #include <gdk/gdkwayland.h>
21 #include "ui/kbd-state.h"
22 #if defined(CONFIG_OPENGL)
23 #include "ui/egl-helpers.h"
24 #include "ui/egl-context.h"
27 typedef struct GtkDisplayState GtkDisplayState
;
29 typedef struct VirtualGfxConsole
{
30 GtkWidget
*drawing_area
;
31 DisplayChangeListener dcl
;
34 pixman_image_t
*convert
;
35 cairo_surface_t
*surface
;
38 #if defined(CONFIG_OPENGL)
55 #if defined(CONFIG_VTE)
56 typedef struct VirtualVteConsole
{
65 typedef enum VirtualConsoleType
{
70 typedef struct VirtualConsole
{
77 VirtualConsoleType type
;
79 VirtualGfxConsole gfx
;
80 #if defined(CONFIG_VTE)
81 VirtualVteConsole vte
;
86 extern bool gtk_use_gl_area
;
89 void gd_update_windowsize(VirtualConsole
*vc
);
90 int gd_monitor_update_interval(GtkWidget
*widget
);
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_disable(DisplayChangeListener
*dcl
);
103 void gd_egl_scanout_texture(DisplayChangeListener
*dcl
,
105 bool backing_y_0_top
,
106 uint32_t backing_width
,
107 uint32_t backing_height
,
108 uint32_t x
, uint32_t y
,
109 uint32_t w
, uint32_t h
);
110 void gd_egl_scanout_dmabuf(DisplayChangeListener
*dcl
,
112 void gd_egl_cursor_dmabuf(DisplayChangeListener
*dcl
,
113 QemuDmaBuf
*dmabuf
, bool have_hot
,
114 uint32_t hot_x
, uint32_t hot_y
);
115 void gd_egl_cursor_position(DisplayChangeListener
*dcl
,
116 uint32_t pos_x
, uint32_t pos_y
);
117 void gd_egl_release_dmabuf(DisplayChangeListener
*dcl
,
119 void gd_egl_scanout_flush(DisplayChangeListener
*dcl
,
120 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
121 void gtk_egl_init(DisplayGLMode mode
);
122 int gd_egl_make_current(DisplayChangeListener
*dcl
,
125 /* ui/gtk-gl-area.c */
126 void gd_gl_area_init(VirtualConsole
*vc
);
127 void gd_gl_area_draw(VirtualConsole
*vc
);
128 void gd_gl_area_update(DisplayChangeListener
*dcl
,
129 int x
, int y
, int w
, int h
);
130 void gd_gl_area_refresh(DisplayChangeListener
*dcl
);
131 void gd_gl_area_switch(DisplayChangeListener
*dcl
,
132 DisplaySurface
*surface
);
133 QEMUGLContext
gd_gl_area_create_context(DisplayChangeListener
*dcl
,
134 QEMUGLParams
*params
);
135 void gd_gl_area_destroy_context(DisplayChangeListener
*dcl
,
137 void gd_gl_area_scanout_dmabuf(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_disable(DisplayChangeListener
*dcl
);
147 void gd_gl_area_scanout_flush(DisplayChangeListener
*dcl
,
148 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
149 void gtk_gl_area_init(void);
150 QEMUGLContext
gd_gl_area_get_current_context(DisplayChangeListener
*dcl
);
151 int gd_gl_area_make_current(DisplayChangeListener
*dcl
,
154 #endif /* UI_GTK_H */