Debian Codegraph @

gdk/wayland/gdkprivate-wayland.h

raw
1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 /*
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 */
24
25 /*
26 * Private uninstalled header defining things local to the Wayland backend
27 */
28
29 #ifndef __GDK_PRIVATE_WAYLAND_H__
30 #define __GDK_PRIVATE_WAYLAND_H__
31
32 #include <gdk/gdkcursor.h>
33 #include <gdk/gdkprivate.h>
34 #include <gdk/wayland/gdkwayland.h>
35 #include <gdk/wayland/gdkdisplay-wayland.h>
36
37 #include <xkbcommon/xkbcommon.h>
38
39 #include "gdkinternals.h"
40 #include "wayland/gtk-primary-selection-client-protocol.h"
41
42 #include "config.h"
43
44 #define WL_SURFACE_HAS_BUFFER_SCALE 3
45 #define WL_POINTER_HAS_FRAME 5
46
47 #define GDK_WINDOW_IS_WAYLAND(win) (GDK_IS_WINDOW_IMPL_WAYLAND (((GdkWindow *)win)->impl))
48
49 GdkKeymap *_gdk_wayland_keymap_new (void);
50 void _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
51 uint32_t format,
52 uint32_t fd,
53 uint32_t size);
54 struct xkb_state *_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap);
55 struct xkb_keymap *_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap);
56 gboolean _gdk_wayland_keymap_key_is_modifier (GdkKeymap *keymap,
57 guint keycode);
58
59 void _gdk_wayland_display_init_cursors (GdkWaylandDisplay *display);
60 void _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display);
61 void _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display);
62
63 struct wl_cursor_theme * _gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *display_wayland,
64 guint scale);
65
66 GdkCursor *_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
67 GdkCursorType cursor_type);
68 GdkCursor *_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
69 GdkCursorType cursor_type,
70 guint scale);
71 GdkCursor *_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
72 const gchar *name);
73 GdkCursor *_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
74 const gchar *name,
75 guint scale);
76 GdkCursor *_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
77 cairo_surface_t *surface,
78 gdouble x,
79 gdouble y);
80 void _gdk_wayland_display_get_default_cursor_size (GdkDisplay *display,
81 guint *width,
82 guint *height);
83 void _gdk_wayland_display_get_maximal_cursor_size (GdkDisplay *display,
84 guint *width,
85 guint *height);
86 gboolean _gdk_wayland_display_supports_cursor_alpha (GdkDisplay *display);
87 gboolean _gdk_wayland_display_supports_cursor_color (GdkDisplay *display);
88
89 void gdk_wayland_display_system_bell (GdkDisplay *display,
90 GdkWindow *window);
91
92 const char *_gdk_wayland_cursor_get_name (GdkCursor *cursor);
93
94 struct wl_buffer *_gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
95 guint image_index,
96 int *hotspot_x,
97 int *hotspot_y,
98 int *w,
99 int *h,
100 int *scale);
101 guint _gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
102 guint current_image_index,
103 guint *next_image_delay);
104
105 void _gdk_wayland_cursor_set_scale (GdkCursor *cursor,
106 guint scale);
107
108 GdkDragProtocol _gdk_wayland_window_get_drag_protocol (GdkWindow *window,
109 GdkWindow **target);
110
111 void _gdk_wayland_window_register_dnd (GdkWindow *window);
112 GdkDragContext *_gdk_wayland_window_drag_begin (GdkWindow *window,
113 GdkDevice *device,
114 GList *targets,
115 gint x_root,
116 gint y_root);
117 void _gdk_wayland_window_offset_next_wl_buffer (GdkWindow *window,
118 int x,
119 int y);
120 GdkDragContext * _gdk_wayland_drop_context_new (GdkDisplay *display,
121 struct wl_data_device *data_device);
122 void _gdk_wayland_drag_context_set_source_window (GdkDragContext *context,
123 GdkWindow *window);
124 void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
125 GdkWindow *dest_window,
126 uint32_t serial);
127 void _gdk_wayland_drag_context_emit_event (GdkDragContext *context,
128 GdkEventType type,
129 guint32 time_);
130 void _gdk_wayland_drag_context_set_coords (GdkDragContext *context,
131 gdouble x,
132 gdouble y);
133
134 void gdk_wayland_drag_context_set_action (GdkDragContext *context,
135 GdkDragAction action);
136
137 GdkDragContext * gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source);
138 GdkDragContext * gdk_wayland_drag_context_lookup_by_source_window (GdkWindow *window);
139 struct wl_data_source * gdk_wayland_drag_context_get_data_source (GdkDragContext *context);
140
141 void gdk_wayland_drop_context_update_targets (GdkDragContext *context);
142
143 void _gdk_wayland_display_create_window_impl (GdkDisplay *display,
144 GdkWindow *window,
145 GdkWindow *real_parent,
146 GdkScreen *screen,
147 GdkEventMask event_mask,
148 GdkWindowAttr *attributes,
149 gint attributes_mask);
150
151 GdkWindow *_gdk_wayland_display_get_selection_owner (GdkDisplay *display,
152 GdkAtom selection);
153 gboolean _gdk_wayland_display_set_selection_owner (GdkDisplay *display,
154 GdkWindow *owner,
155 GdkAtom selection,
156 guint32 time,
157 gboolean send_event);
158 void _gdk_wayland_display_send_selection_notify (GdkDisplay *dispay,
159 GdkWindow *requestor,
160 GdkAtom selection,
161 GdkAtom target,
162 GdkAtom property,
163 guint32 time);
164 gint _gdk_wayland_display_get_selection_property (GdkDisplay *display,
165 GdkWindow *requestor,
166 guchar **data,
167 GdkAtom *ret_type,
168 gint *ret_format);
169 void _gdk_wayland_display_convert_selection (GdkDisplay *display,
170 GdkWindow *requestor,
171 GdkAtom selection,
172 GdkAtom target,
173 guint32 time);
174 gint _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
175 GdkAtom encoding,
176 gint format,
177 const guchar *text,
178 gint length,
179 gchar ***list);
180 gchar * _gdk_wayland_display_utf8_to_string_target (GdkDisplay *display,
181 const gchar *str);
182
183 GdkDeviceManager *_gdk_wayland_device_manager_new (GdkDisplay *display);
184 void _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
185 guint32 id,
186 struct wl_seat *seat);
187 void _gdk_wayland_device_manager_remove_seat (GdkDeviceManager *device_manager,
188 guint32 id);
189
190 GdkKeymap *_gdk_wayland_device_get_keymap (GdkDevice *device);
191 uint32_t _gdk_wayland_device_get_implicit_grab_serial(GdkWaylandDevice *device,
192 const GdkEvent *event);
193 uint32_t _gdk_wayland_seat_get_last_implicit_grab_serial (GdkSeat *seat,
194 GdkEventSequence **seqence);
195 GdkWindow * gdk_wayland_device_get_focus (GdkDevice *device);
196 struct wl_data_device * gdk_wayland_device_get_data_device (GdkDevice *gdk_device);
197 void gdk_wayland_seat_set_selection (GdkSeat *seat,
198 struct wl_data_source *source);
199
200 void gdk_wayland_seat_set_primary (GdkSeat *seat,
201 gpointer source);
202
203 GdkDragContext * gdk_wayland_device_get_drop_context (GdkDevice *gdk_device);
204
205 void gdk_wayland_device_unset_touch_grab (GdkDevice *device,
206 GdkEventSequence *sequence);
207
208 void _gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event);
209 GSource *_gdk_wayland_display_event_source_new (GdkDisplay *display);
210 void _gdk_wayland_display_queue_events (GdkDisplay *display);
211
212 GdkAppLaunchContext *_gdk_wayland_display_get_app_launch_context (GdkDisplay *display);
213
214 GdkDisplay *_gdk_wayland_display_open (const gchar *display_name);
215
216 GdkWindow *_gdk_wayland_screen_create_root_window (GdkScreen *screen,
217 int width,
218 int height);
219
220 GdkScreen *_gdk_wayland_screen_new (GdkDisplay *display);
221 void _gdk_wayland_screen_add_output (GdkScreen *screen,
222 guint32 id,
223 struct wl_output *output,
224 guint32 version);
225 void _gdk_wayland_screen_remove_output (GdkScreen *screen,
226 guint32 id);
227 int _gdk_wayland_screen_get_output_refresh_rate (GdkScreen *screen,
228 struct wl_output *output);
229 guint32 _gdk_wayland_screen_get_output_scale (GdkScreen *screen,
230 struct wl_output *output);
231 struct wl_output *_gdk_wayland_screen_get_wl_output (GdkScreen *screen,
232 gint monitor_num);
233
234 void _gdk_wayland_screen_set_has_gtk_shell (GdkScreen *screen);
235
236 void _gdk_wayland_screen_init_xdg_output (GdkScreen *screen);
237
238 void _gdk_wayland_window_set_grab_seat (GdkWindow *window,
239 GdkSeat *seat);
240
241 guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland);
242 void _gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland,
243 guint32 serial);
244
245 cairo_surface_t * _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *display,
246 int width,
247 int height,
248 guint scale);
249 struct wl_buffer *_gdk_wayland_shm_surface_get_wl_buffer (cairo_surface_t *surface);
250 gboolean _gdk_wayland_is_shm_surface (cairo_surface_t *surface);
251
252 GdkWaylandSelection * gdk_wayland_display_get_selection (GdkDisplay *display);
253 GdkWaylandSelection * gdk_wayland_selection_new (void);
254 void gdk_wayland_selection_free (GdkWaylandSelection *selection);
255
256 void gdk_wayland_selection_ensure_offer (GdkDisplay *display,
257 struct wl_data_offer *wl_offer);
258 void gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
259 gpointer wp_offer);
260
261 void gdk_wayland_selection_set_offer (GdkDisplay *display,
262 GdkAtom selection,
263 gpointer offer);
264 gpointer gdk_wayland_selection_get_offer (GdkDisplay *display,
265 GdkAtom selection);
266 GList * gdk_wayland_selection_get_targets (GdkDisplay *display,
267 GdkAtom selection);
268
269 void gdk_wayland_selection_store (GdkWindow *window,
270 GdkAtom type,
271 GdkPropMode mode,
272 const guchar *data,
273 gint len);
274 struct wl_data_source * gdk_wayland_selection_get_data_source (GdkWindow *owner,
275 GdkAtom selection);
276 void gdk_wayland_selection_unset_data_source (GdkDisplay *display, GdkAtom selection);
277 gboolean gdk_wayland_selection_set_current_offer_actions (GdkDisplay *display,
278 uint32_t actions);
279
280 EGLSurface gdk_wayland_window_get_egl_surface (GdkWindow *window,
281 EGLConfig config);
282 EGLSurface gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
283 EGLConfig config);
284
285 struct gtk_surface1 * gdk_wayland_window_get_gtk_surface (GdkWindow *window);
286
287 void gdk_wayland_seat_set_global_cursor (GdkSeat *seat,
288 GdkCursor *cursor);
289
290 struct wl_output *gdk_wayland_window_get_wl_output (GdkWindow *window);
291
292 void gdk_wayland_window_inhibit_shortcuts (GdkWindow *window,
293 GdkSeat *gdk_seat);
294 void gdk_wayland_window_restore_shortcuts (GdkWindow *window,
295 GdkSeat *gdk_seat);
296
297 #endif /* __GDK_PRIVATE_WAYLAND_H__ */