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)
54 #if defined(CONFIG_VTE)
55 typedef struct VirtualVteConsole
{
64 typedef enum VirtualConsoleType
{
69 typedef struct VirtualConsole
{
76 VirtualConsoleType type
;
78 VirtualGfxConsole gfx
;
79 #if defined(CONFIG_VTE)
80 VirtualVteConsole vte
;
85 extern bool gtk_use_gl_area
;
88 void gd_update_windowsize(VirtualConsole
*vc
);
89 int gd_monitor_update_interval(GtkWidget
*widget
);
92 void gd_egl_init(VirtualConsole
*vc
);
93 void gd_egl_draw(VirtualConsole
*vc
);
94 void gd_egl_update(DisplayChangeListener
*dcl
,
95 int x
, int y
, int w
, int h
);
96 void gd_egl_refresh(DisplayChangeListener
*dcl
);
97 void gd_egl_switch(DisplayChangeListener
*dcl
,
98 DisplaySurface
*surface
);
99 QEMUGLContext
gd_egl_create_context(DisplayChangeListener
*dcl
,
100 QEMUGLParams
*params
);
101 void gd_egl_scanout_disable(DisplayChangeListener
*dcl
);
102 void gd_egl_scanout_texture(DisplayChangeListener
*dcl
,
104 bool backing_y_0_top
,
105 uint32_t backing_width
,
106 uint32_t backing_height
,
107 uint32_t x
, uint32_t y
,
108 uint32_t w
, uint32_t h
);
109 void gd_egl_scanout_dmabuf(DisplayChangeListener
*dcl
,
111 void gd_egl_cursor_dmabuf(DisplayChangeListener
*dcl
,
112 QemuDmaBuf
*dmabuf
, bool have_hot
,
113 uint32_t hot_x
, uint32_t hot_y
);
114 void gd_egl_cursor_position(DisplayChangeListener
*dcl
,
115 uint32_t pos_x
, uint32_t pos_y
);
116 void gd_egl_release_dmabuf(DisplayChangeListener
*dcl
,
118 void gd_egl_scanout_flush(DisplayChangeListener
*dcl
,
119 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
120 void gtk_egl_init(DisplayGLMode mode
);
121 int gd_egl_make_current(DisplayChangeListener
*dcl
,
124 /* ui/gtk-gl-area.c */
125 void gd_gl_area_init(VirtualConsole
*vc
);
126 void gd_gl_area_draw(VirtualConsole
*vc
);
127 void gd_gl_area_update(DisplayChangeListener
*dcl
,
128 int x
, int y
, int w
, int h
);
129 void gd_gl_area_refresh(DisplayChangeListener
*dcl
);
130 void gd_gl_area_switch(DisplayChangeListener
*dcl
,
131 DisplaySurface
*surface
);
132 QEMUGLContext
gd_gl_area_create_context(DisplayChangeListener
*dcl
,
133 QEMUGLParams
*params
);
134 void gd_gl_area_destroy_context(DisplayChangeListener
*dcl
,
136 void gd_gl_area_scanout_texture(DisplayChangeListener
*dcl
,
138 bool backing_y_0_top
,
139 uint32_t backing_width
,
140 uint32_t backing_height
,
141 uint32_t x
, uint32_t y
,
142 uint32_t w
, uint32_t h
);
143 void gd_gl_area_scanout_flush(DisplayChangeListener
*dcl
,
144 uint32_t x
, uint32_t y
, uint32_t w
, uint32_t h
);
145 void gtk_gl_area_init(void);
146 QEMUGLContext
gd_gl_area_get_current_context(DisplayChangeListener
*dcl
);
147 int gd_gl_area_make_current(DisplayChangeListener
*dcl
,
150 #endif /* UI_GTK_H */