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 "config.h" |
33 | |
34 | #include <gdk/gdkcursor.h> |
35 | #include <gdk/wayland/gdkwayland.h> |
36 | #include <gdk/wayland/gdkdisplay-wayland.h> |
37 | #include <gdk/wayland/gdkseat-wayland.h> |
38 | |
39 | #include <xkbcommon/xkbcommon.h> |
40 | |
41 | |
42 | #define WL_SURFACE_HAS_BUFFER_SCALE 3 |
43 | #define WL_POINTER_HAS_FRAME 5 |
44 | |
45 | /* the magic mime type we use for local DND operations. |
46 | * We offer it to every dnd operation, but will strip it out on the drop |
47 | * site unless we can prove it's a local DND - then we will use only |
48 | * this type |
49 | */ |
50 | #define GDK_WAYLAND_LOCAL_DND_MIME_TYPE "application/x-gtk-local-dnd" |
51 | |
52 | GdkKeymap *_gdk_wayland_keymap_new (GdkDisplay *display); |
53 | void _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap, |
54 | uint32_t format, |
55 | uint32_t fd, |
56 | uint32_t size); |
57 | struct xkb_state *_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap); |
58 | struct xkb_keymap *_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap); |
59 | gboolean _gdk_wayland_keymap_key_is_modifier (GdkKeymap *keymap, |
60 | guint keycode); |
61 | |
62 | void _gdk_wayland_display_init_cursors (GdkWaylandDisplay *display); |
63 | void _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display); |
64 | |
65 | struct wl_cursor_theme * _gdk_wayland_display_get_cursor_theme (GdkWaylandDisplay *display_wayland); |
66 | |
67 | void _gdk_wayland_display_get_default_cursor_size (GdkDisplay *display, |
68 | guint *width, |
69 | guint *height); |
70 | void _gdk_wayland_display_get_maximal_cursor_size (GdkDisplay *display, |
71 | guint *width, |
72 | guint *height); |
73 | gboolean _gdk_wayland_display_supports_cursor_alpha (GdkDisplay *display); |
74 | gboolean _gdk_wayland_display_supports_cursor_color (GdkDisplay *display); |
75 | |
76 | void gdk_wayland_display_system_bell (GdkDisplay *display, |
77 | GdkSurface *surface); |
78 | |
79 | struct wl_buffer *_gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display, |
80 | GdkCursor *cursor, |
81 | guint desired_scale, |
82 | guint image_index, |
83 | int *hotspot_x, |
84 | int *hotspot_y, |
85 | int *w, |
86 | int *h, |
87 | int *scale); |
88 | guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display, |
89 | GdkCursor *cursor, |
90 | guint scale, |
91 | guint current_image_index, |
92 | guint *next_image_delay); |
93 | |
94 | void gdk_wayland_surface_sync (GdkSurface *surface); |
95 | void gdk_wayland_surface_commit (GdkSurface *surface); |
96 | void gdk_wayland_surface_notify_committed (GdkSurface *surface); |
97 | void gdk_wayland_surface_request_frame (GdkSurface *surface); |
98 | gboolean gdk_wayland_surface_has_surface (GdkSurface *surface); |
99 | void gdk_wayland_surface_attach_image (GdkSurface *surface, |
100 | cairo_surface_t *cairo_surface, |
101 | const cairo_region_t *damage); |
102 | |
103 | GdkDrag *_gdk_wayland_surface_drag_begin (GdkSurface *surface, |
104 | GdkDevice *device, |
105 | GdkContentProvider *content, |
106 | GdkDragAction actions, |
107 | double dx, |
108 | double dy); |
109 | void _gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *surface, |
110 | int x, |
111 | int y); |
112 | GdkDrop * gdk_wayland_drop_new (GdkDevice *device, |
113 | GdkDrag *drag, |
114 | GdkContentFormats *formats, |
115 | GdkSurface *surface, |
116 | struct wl_data_offer *offer, |
117 | uint32_t serial); |
118 | void gdk_wayland_drop_set_source_actions (GdkDrop *drop, |
119 | uint32_t source_actions); |
120 | void gdk_wayland_drop_set_action (GdkDrop *drop, |
121 | uint32_t action); |
122 | |
123 | GdkSurface * _gdk_wayland_display_create_surface (GdkDisplay *display, |
124 | GdkSurfaceType surface_type, |
125 | GdkSurface *parent, |
126 | int x, |
127 | int y, |
128 | int width, |
129 | int height); |
130 | |
131 | void _gdk_wayland_display_create_seat (GdkWaylandDisplay *display, |
132 | guint32 id, |
133 | struct wl_seat *seat); |
134 | void _gdk_wayland_display_remove_seat (GdkWaylandDisplay *display, |
135 | guint32 id); |
136 | |
137 | GdkKeymap *_gdk_wayland_device_get_keymap (GdkDevice *device); |
138 | uint32_t _gdk_wayland_seat_get_implicit_grab_serial(GdkSeat *seat, |
139 | GdkEvent *event); |
140 | uint32_t _gdk_wayland_seat_get_last_implicit_grab_serial (GdkWaylandSeat *seat, |
141 | GdkEventSequence **sequence); |
142 | GdkSurface * gdk_wayland_device_get_focus (GdkDevice *device); |
143 | |
144 | struct wl_data_device * gdk_wayland_device_get_data_device (GdkDevice *gdk_device); |
145 | void gdk_wayland_device_set_selection (GdkDevice *gdk_device, |
146 | struct wl_data_source *source); |
147 | |
148 | GdkDrag* gdk_wayland_device_get_drop_context (GdkDevice *gdk_device); |
149 | |
150 | void gdk_wayland_device_unset_touch_grab (GdkDevice *device, |
151 | GdkEventSequence *sequence); |
152 | |
153 | void _gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event); |
154 | GSource *_gdk_wayland_display_event_source_new (GdkDisplay *display); |
155 | void _gdk_wayland_display_queue_events (GdkDisplay *display); |
156 | |
157 | GdkAppLaunchContext *_gdk_wayland_display_get_app_launch_context (GdkDisplay *display); |
158 | |
159 | GdkDisplay *_gdk_wayland_display_open (const char *display_name); |
160 | |
161 | GList *gdk_wayland_display_get_toplevel_surfaces (GdkDisplay *display); |
162 | |
163 | int gdk_wayland_display_get_output_refresh_rate (GdkWaylandDisplay *display_wayland, |
164 | struct wl_output *output); |
165 | guint32 gdk_wayland_display_get_output_scale (GdkWaylandDisplay *display_wayland, |
166 | struct wl_output *output); |
167 | GdkMonitor *gdk_wayland_display_get_monitor_for_output (GdkDisplay *display, |
168 | struct wl_output *output); |
169 | |
170 | void _gdk_wayland_surface_set_grab_seat (GdkSurface *surface, |
171 | GdkSeat *seat); |
172 | |
173 | guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland); |
174 | void _gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland, |
175 | guint32 serial); |
176 | |
177 | cairo_surface_t * _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *display, |
178 | int width, |
179 | int height, |
180 | guint scale); |
181 | struct wl_buffer *_gdk_wayland_shm_surface_get_wl_buffer (cairo_surface_t *surface); |
182 | gboolean _gdk_wayland_is_shm_surface (cairo_surface_t *surface); |
183 | |
184 | struct gtk_surface1 * gdk_wayland_surface_get_gtk_surface (GdkSurface *surface); |
185 | |
186 | void gdk_wayland_seat_set_global_cursor (GdkSeat *seat, |
187 | GdkCursor *cursor); |
188 | void gdk_wayland_seat_set_drag (GdkSeat *seat, |
189 | GdkDrag *drag); |
190 | |
191 | struct wl_output *gdk_wayland_surface_get_wl_output (GdkSurface *surface); |
192 | |
193 | void gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface, |
194 | GdkSeat *gdk_seat); |
195 | void gdk_wayland_surface_restore_shortcuts (GdkSurface *surface, |
196 | GdkSeat *gdk_seat); |
197 | |
198 | void gdk_wayland_surface_update_scale (GdkSurface *surface); |
199 | |
200 | GdkSurface * create_dnd_surface (GdkDisplay *display); |
201 | |
202 | GdkModifierType gdk_wayland_keymap_get_gdk_modifiers (GdkKeymap *keymap, |
203 | guint32 mods); |
204 | |
205 | #endif /* __GDK_PRIVATE_WAYLAND_H__ */ |
206 | |