1 | /* Generated by wayland-scanner 1.15.92 */ |
2 | // Hand edited to resolve conflicts with xdg-shell stable |
3 | |
4 | #ifndef XDG_SHELL_UNSTABLE_V5_SERVER_PROTOCOL_H |
5 | #define XDG_SHELL_UNSTABLE_V5_SERVER_PROTOCOL_H |
6 | |
7 | #include <stdint.h> |
8 | #include <stddef.h> |
9 | #include "wayland-server-core.h" |
10 | |
11 | #ifdef __cplusplus |
12 | extern "C" { |
13 | #endif |
14 | |
15 | struct wl_client; |
16 | struct wl_resource; |
17 | |
18 | /** |
19 | * @page page_xdg_shell_unstable_v5 The xdg_shell_unstable_v5 protocol |
20 | * @section page_ifaces_xdg_shell_unstable_v5 Interfaces |
21 | * - @subpage page_iface_xdg_shell - create desktop-style surfaces |
22 | * - @subpage page_iface_xdg_surface - A desktop window |
23 | * - @subpage page_iface_xdg_popup - short-lived, popup surfaces for menus |
24 | * @section page_copyright_xdg_shell_unstable_v5 Copyright |
25 | * <pre> |
26 | * |
27 | * Copyright © 2008-2013 Kristian Høgsberg |
28 | * Copyright © 2013 Rafael Antognolli |
29 | * Copyright © 2013 Jasper St. Pierre |
30 | * Copyright © 2010-2013 Intel Corporation |
31 | * |
32 | * Permission is hereby granted, free of charge, to any person obtaining a |
33 | * copy of this software and associated documentation files (the "Software"), |
34 | * to deal in the Software without restriction, including without limitation |
35 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
36 | * and/or sell copies of the Software, and to permit persons to whom the |
37 | * Software is furnished to do so, subject to the following conditions: |
38 | * |
39 | * The above copyright notice and this permission notice (including the next |
40 | * paragraph) shall be included in all copies or substantial portions of the |
41 | * Software. |
42 | * |
43 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
44 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
45 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
46 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
47 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
48 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
49 | * DEALINGS IN THE SOFTWARE. |
50 | * </pre> |
51 | */ |
52 | struct wl_output; |
53 | struct wl_seat; |
54 | struct wl_surface; |
55 | struct ; |
56 | struct xdg_shell; |
57 | struct xdg_surface; |
58 | |
59 | /** |
60 | * @page page_iface_xdg_shell xdg_shell |
61 | * @section page_iface_xdg_shell_desc Description |
62 | * |
63 | * xdg_shell allows clients to turn a wl_surface into a "real window" |
64 | * which can be dragged, resized, stacked, and moved around by the |
65 | * user. Everything about this interface is suited towards traditional |
66 | * desktop environments. |
67 | * @section page_iface_xdg_shell_api API |
68 | * See @ref iface_xdg_shell. |
69 | */ |
70 | /** |
71 | * @defgroup iface_xdg_shell The xdg_shell interface |
72 | * |
73 | * xdg_shell allows clients to turn a wl_surface into a "real window" |
74 | * which can be dragged, resized, stacked, and moved around by the |
75 | * user. Everything about this interface is suited towards traditional |
76 | * desktop environments. |
77 | */ |
78 | extern const struct wl_interface xdg_shell_v5_interface; |
79 | /** |
80 | * @page page_iface_xdg_surface xdg_surface |
81 | * @section page_iface_xdg_surface_desc Description |
82 | * |
83 | * An interface that may be implemented by a wl_surface, for |
84 | * implementations that provide a desktop-style user interface. |
85 | * |
86 | * It provides requests to treat surfaces like windows, allowing to set |
87 | * properties like maximized, fullscreen, minimized, and to move and resize |
88 | * them, and associate metadata like title and app id. |
89 | * |
90 | * The client must call wl_surface.commit on the corresponding wl_surface |
91 | * for the xdg_surface state to take effect. Prior to committing the new |
92 | * state, it can set up initial configuration, such as maximizing or setting |
93 | * a window geometry. |
94 | * |
95 | * Even without attaching a buffer the compositor must respond to initial |
96 | * committed configuration, for instance sending a configure event with |
97 | * expected window geometry if the client maximized its surface during |
98 | * initialization. |
99 | * |
100 | * For a surface to be mapped by the compositor the client must have |
101 | * committed both an xdg_surface state and a buffer. |
102 | * @section page_iface_xdg_surface_api API |
103 | * See @ref iface_xdg_surface. |
104 | */ |
105 | /** |
106 | * @defgroup iface_xdg_surface The xdg_surface interface |
107 | * |
108 | * An interface that may be implemented by a wl_surface, for |
109 | * implementations that provide a desktop-style user interface. |
110 | * |
111 | * It provides requests to treat surfaces like windows, allowing to set |
112 | * properties like maximized, fullscreen, minimized, and to move and resize |
113 | * them, and associate metadata like title and app id. |
114 | * |
115 | * The client must call wl_surface.commit on the corresponding wl_surface |
116 | * for the xdg_surface state to take effect. Prior to committing the new |
117 | * state, it can set up initial configuration, such as maximizing or setting |
118 | * a window geometry. |
119 | * |
120 | * Even without attaching a buffer the compositor must respond to initial |
121 | * committed configuration, for instance sending a configure event with |
122 | * expected window geometry if the client maximized its surface during |
123 | * initialization. |
124 | * |
125 | * For a surface to be mapped by the compositor the client must have |
126 | * committed both an xdg_surface state and a buffer. |
127 | */ |
128 | extern const struct wl_interface xdg_surface_v5_interface; |
129 | /** |
130 | * @page page_iface_xdg_popup xdg_popup |
131 | * @section page_iface_xdg_popup_desc Description |
132 | * |
133 | * A popup surface is a short-lived, temporary surface that can be |
134 | * used to implement menus. It takes an explicit grab on the surface |
135 | * that will be dismissed when the user dismisses the popup. This can |
136 | * be done by the user clicking outside the surface, using the keyboard, |
137 | * or even locking the screen through closing the lid or a timeout. |
138 | * |
139 | * When the popup is dismissed, a popup_done event will be sent out, |
140 | * and at the same time the surface will be unmapped. The xdg_popup |
141 | * object is now inert and cannot be reactivated, so clients should |
142 | * destroy it. Explicitly destroying the xdg_popup object will also |
143 | * dismiss the popup and unmap the surface. |
144 | * |
145 | * Clients will receive events for all their surfaces during this |
146 | * grab (which is an "owner-events" grab in X11 parlance). This is |
147 | * done so that users can navigate through submenus and other |
148 | * "nested" popup windows without having to dismiss the topmost |
149 | * popup. |
150 | * |
151 | * Clients that want to dismiss the popup when another surface of |
152 | * their own is clicked should dismiss the popup using the destroy |
153 | * request. |
154 | * |
155 | * The parent surface must have either an xdg_surface or xdg_popup |
156 | * role. |
157 | * |
158 | * Specifying an xdg_popup for the parent means that the popups are |
159 | * nested, with this popup now being the topmost popup. Nested |
160 | * popups must be destroyed in the reverse order they were created |
161 | * in, e.g. the only popup you are allowed to destroy at all times |
162 | * is the topmost one. |
163 | * |
164 | * If there is an existing popup when creating a new popup, the |
165 | * parent must be the current topmost popup. |
166 | * |
167 | * A parent surface must be mapped before the new popup is mapped. |
168 | * |
169 | * When compositors choose to dismiss a popup, they will likely |
170 | * dismiss every nested popup as well. When a compositor dismisses |
171 | * popups, it will follow the same dismissing order as required |
172 | * from the client. |
173 | * |
174 | * The x and y arguments passed when creating the popup object specify |
175 | * where the top left of the popup should be placed, relative to the |
176 | * local surface coordinates of the parent surface. See |
177 | * xdg_shell.get_xdg_popup. |
178 | * |
179 | * The client must call wl_surface.commit on the corresponding wl_surface |
180 | * for the xdg_popup state to take effect. |
181 | * |
182 | * For a surface to be mapped by the compositor the client must have |
183 | * committed both the xdg_popup state and a buffer. |
184 | * @section page_iface_xdg_popup_api API |
185 | * See @ref iface_xdg_popup. |
186 | */ |
187 | /** |
188 | * @defgroup iface_xdg_popup The xdg_popup interface |
189 | * |
190 | * A popup surface is a short-lived, temporary surface that can be |
191 | * used to implement menus. It takes an explicit grab on the surface |
192 | * that will be dismissed when the user dismisses the popup. This can |
193 | * be done by the user clicking outside the surface, using the keyboard, |
194 | * or even locking the screen through closing the lid or a timeout. |
195 | * |
196 | * When the popup is dismissed, a popup_done event will be sent out, |
197 | * and at the same time the surface will be unmapped. The xdg_popup |
198 | * object is now inert and cannot be reactivated, so clients should |
199 | * destroy it. Explicitly destroying the xdg_popup object will also |
200 | * dismiss the popup and unmap the surface. |
201 | * |
202 | * Clients will receive events for all their surfaces during this |
203 | * grab (which is an "owner-events" grab in X11 parlance). This is |
204 | * done so that users can navigate through submenus and other |
205 | * "nested" popup windows without having to dismiss the topmost |
206 | * popup. |
207 | * |
208 | * Clients that want to dismiss the popup when another surface of |
209 | * their own is clicked should dismiss the popup using the destroy |
210 | * request. |
211 | * |
212 | * The parent surface must have either an xdg_surface or xdg_popup |
213 | * role. |
214 | * |
215 | * Specifying an xdg_popup for the parent means that the popups are |
216 | * nested, with this popup now being the topmost popup. Nested |
217 | * popups must be destroyed in the reverse order they were created |
218 | * in, e.g. the only popup you are allowed to destroy at all times |
219 | * is the topmost one. |
220 | * |
221 | * If there is an existing popup when creating a new popup, the |
222 | * parent must be the current topmost popup. |
223 | * |
224 | * A parent surface must be mapped before the new popup is mapped. |
225 | * |
226 | * When compositors choose to dismiss a popup, they will likely |
227 | * dismiss every nested popup as well. When a compositor dismisses |
228 | * popups, it will follow the same dismissing order as required |
229 | * from the client. |
230 | * |
231 | * The x and y arguments passed when creating the popup object specify |
232 | * where the top left of the popup should be placed, relative to the |
233 | * local surface coordinates of the parent surface. See |
234 | * xdg_shell.get_xdg_popup. |
235 | * |
236 | * The client must call wl_surface.commit on the corresponding wl_surface |
237 | * for the xdg_popup state to take effect. |
238 | * |
239 | * For a surface to be mapped by the compositor the client must have |
240 | * committed both the xdg_popup state and a buffer. |
241 | */ |
242 | extern const struct wl_interface ; |
243 | |
244 | #ifndef XDG_SHELL_VERSION_ENUM |
245 | #define XDG_SHELL_VERSION_ENUM |
246 | /** |
247 | * @ingroup iface_xdg_shell |
248 | * latest protocol version |
249 | * |
250 | * The 'current' member of this enum gives the version of the |
251 | * protocol. Implementations can compare this to the version |
252 | * they implement using static_assert to ensure the protocol and |
253 | * implementation versions match. |
254 | */ |
255 | enum xdg_shell_version { |
256 | /** |
257 | * Always the latest version |
258 | */ |
259 | XDG_SHELL_VERSION_CURRENT = 5, |
260 | }; |
261 | #endif /* XDG_SHELL_VERSION_ENUM */ |
262 | |
263 | #ifndef XDG_SHELL_ERROR_ENUM |
264 | #define XDG_SHELL_ERROR_ENUM |
265 | enum xdg_shell_error { |
266 | /** |
267 | * given wl_surface has another role |
268 | */ |
269 | XDG_SHELL_ERROR_ROLE = 0, |
270 | /** |
271 | * xdg_shell was destroyed before children |
272 | */ |
273 | XDG_SHELL_ERROR_DEFUNCT_SURFACES = 1, |
274 | /** |
275 | * the client tried to map or destroy a non-topmost popup |
276 | */ |
277 | = 2, |
278 | /** |
279 | * the client specified an invalid popup parent surface |
280 | */ |
281 | = 3, |
282 | }; |
283 | #endif /* XDG_SHELL_ERROR_ENUM */ |
284 | |
285 | /** |
286 | * @ingroup iface_xdg_shell |
287 | * @struct xdg_shell_v5_interface |
288 | */ |
289 | struct xdg_shell_v5_interface { |
290 | /** |
291 | * destroy xdg_shell |
292 | * |
293 | * Destroy this xdg_shell object. |
294 | * |
295 | * Destroying a bound xdg_shell object while there are surfaces |
296 | * still alive created by this xdg_shell object instance is illegal |
297 | * and will result in a protocol error. |
298 | */ |
299 | void (*destroy)(struct wl_client *client, |
300 | struct wl_resource *resource); |
301 | /** |
302 | * enable use of this unstable version |
303 | * |
304 | * Negotiate the unstable version of the interface. This |
305 | * mechanism is in place to ensure client and server agree on the |
306 | * unstable versions of the protocol that they speak or exit |
307 | * cleanly if they don't agree. This request will go away once the |
308 | * xdg-shell protocol is stable. |
309 | */ |
310 | void (*use_unstable_version)(struct wl_client *client, |
311 | struct wl_resource *resource, |
312 | int32_t version); |
313 | /** |
314 | * create a shell surface from a surface |
315 | * |
316 | * This creates an xdg_surface for the given surface and gives it |
317 | * the xdg_surface role. A wl_surface can only be given an |
318 | * xdg_surface role once. If get_xdg_surface is called with a |
319 | * wl_surface that already has an active xdg_surface associated |
320 | * with it, or if it had any other role, an error is raised. |
321 | * |
322 | * See the documentation of xdg_surface for more details about what |
323 | * an xdg_surface is and how it is used. |
324 | */ |
325 | void (*get_xdg_surface)(struct wl_client *client, |
326 | struct wl_resource *resource, |
327 | uint32_t id, |
328 | struct wl_resource *surface); |
329 | /** |
330 | * create a popup for a surface |
331 | * |
332 | * This creates an xdg_popup for the given surface and gives it |
333 | * the xdg_popup role. A wl_surface can only be given an xdg_popup |
334 | * role once. If get_xdg_popup is called with a wl_surface that |
335 | * already has an active xdg_popup associated with it, or if it had |
336 | * any other role, an error is raised. |
337 | * |
338 | * This request must be used in response to some sort of user |
339 | * action like a button press, key press, or touch down event. |
340 | * |
341 | * See the documentation of xdg_popup for more details about what |
342 | * an xdg_popup is and how it is used. |
343 | * @param seat the wl_seat of the user event |
344 | * @param serial the serial of the user event |
345 | */ |
346 | void (*)(struct wl_client *client, |
347 | struct wl_resource *resource, |
348 | uint32_t id, |
349 | struct wl_resource *surface, |
350 | struct wl_resource *parent, |
351 | struct wl_resource *seat, |
352 | uint32_t serial, |
353 | int32_t x, |
354 | int32_t y); |
355 | /** |
356 | * respond to a ping event |
357 | * |
358 | * A client must respond to a ping event with a pong request or |
359 | * the client may be deemed unresponsive. |
360 | * @param serial serial of the ping event |
361 | */ |
362 | void (*pong)(struct wl_client *client, |
363 | struct wl_resource *resource, |
364 | uint32_t serial); |
365 | }; |
366 | |
367 | #define XDG_SHELL_PING 0 |
368 | |
369 | /** |
370 | * @ingroup iface_xdg_shell |
371 | */ |
372 | #define XDG_SHELL_PING_SINCE_VERSION 1 |
373 | |
374 | /** |
375 | * @ingroup iface_xdg_shell |
376 | */ |
377 | #define XDG_SHELL_DESTROY_SINCE_VERSION 1 |
378 | /** |
379 | * @ingroup iface_xdg_shell |
380 | */ |
381 | #define XDG_SHELL_USE_UNSTABLE_VERSION_SINCE_VERSION 1 |
382 | /** |
383 | * @ingroup iface_xdg_shell |
384 | */ |
385 | #define XDG_SHELL_GET_XDG_SURFACE_SINCE_VERSION 1 |
386 | /** |
387 | * @ingroup iface_xdg_shell |
388 | */ |
389 | #define 1 |
390 | /** |
391 | * @ingroup iface_xdg_shell |
392 | */ |
393 | #define XDG_SHELL_PONG_SINCE_VERSION 1 |
394 | |
395 | /** |
396 | * @ingroup iface_xdg_shell |
397 | * Sends an ping event to the client owning the resource. |
398 | * @param resource_ The client's resource |
399 | * @param serial pass this to the pong request |
400 | */ |
401 | static inline void |
402 | xdg_shell_send_ping(struct wl_resource *resource_, uint32_t serial) |
403 | { |
404 | wl_resource_post_event(resource: resource_, XDG_SHELL_PING, serial); |
405 | } |
406 | |
407 | #ifndef XDG_SURFACE_RESIZE_EDGE_ENUM |
408 | #define XDG_SURFACE_RESIZE_EDGE_ENUM |
409 | /** |
410 | * @ingroup iface_xdg_surface |
411 | * edge values for resizing |
412 | * |
413 | * These values are used to indicate which edge of a surface |
414 | * is being dragged in a resize operation. |
415 | */ |
416 | enum xdg_surface_resize_edge { |
417 | XDG_SURFACE_RESIZE_EDGE_NONE = 0, |
418 | XDG_SURFACE_RESIZE_EDGE_TOP = 1, |
419 | XDG_SURFACE_RESIZE_EDGE_BOTTOM = 2, |
420 | XDG_SURFACE_RESIZE_EDGE_LEFT = 4, |
421 | XDG_SURFACE_RESIZE_EDGE_TOP_LEFT = 5, |
422 | XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT = 6, |
423 | XDG_SURFACE_RESIZE_EDGE_RIGHT = 8, |
424 | XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT = 9, |
425 | XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT = 10, |
426 | }; |
427 | #endif /* XDG_SURFACE_RESIZE_EDGE_ENUM */ |
428 | |
429 | #ifndef XDG_SURFACE_STATE_ENUM |
430 | #define XDG_SURFACE_STATE_ENUM |
431 | /** |
432 | * @ingroup iface_xdg_surface |
433 | * types of state on the surface |
434 | * |
435 | * The different state values used on the surface. This is designed for |
436 | * state values like maximized, fullscreen. It is paired with the |
437 | * configure event to ensure that both the client and the compositor |
438 | * setting the state can be synchronized. |
439 | * |
440 | * States set in this way are double-buffered. They will get applied on |
441 | * the next commit. |
442 | * |
443 | * Desktop environments may extend this enum by taking up a range of |
444 | * values and documenting the range they chose in this description. |
445 | * They are not required to document the values for the range that they |
446 | * chose. Ideally, any good extensions from a desktop environment should |
447 | * make its way into standardization into this enum. |
448 | * |
449 | * The current reserved ranges are: |
450 | * |
451 | * 0x0000 - 0x0FFF: xdg-shell core values, documented below. |
452 | * 0x1000 - 0x1FFF: GNOME |
453 | */ |
454 | enum xdg_surface_state { |
455 | /** |
456 | * the surface is maximized |
457 | */ |
458 | XDG_SURFACE_STATE_MAXIMIZED = 1, |
459 | /** |
460 | * the surface is fullscreen |
461 | */ |
462 | XDG_SURFACE_STATE_FULLSCREEN = 2, |
463 | XDG_SURFACE_STATE_RESIZING = 3, |
464 | XDG_SURFACE_STATE_ACTIVATED = 4, |
465 | }; |
466 | #endif /* XDG_SURFACE_STATE_ENUM */ |
467 | |
468 | /** |
469 | * @ingroup iface_xdg_surface |
470 | * @struct xdg_surface_v5_interface |
471 | */ |
472 | struct xdg_surface_v5_interface { |
473 | /** |
474 | * Destroy the xdg_surface |
475 | * |
476 | * Unmap and destroy the window. The window will be effectively |
477 | * hidden from the user's point of view, and all state like |
478 | * maximization, fullscreen, and so on, will be lost. |
479 | */ |
480 | void (*destroy)(struct wl_client *client, |
481 | struct wl_resource *resource); |
482 | /** |
483 | * set the parent of this surface |
484 | * |
485 | * Set the "parent" of this surface. This window should be |
486 | * stacked above a parent. The parent surface must be mapped as |
487 | * long as this surface is mapped. |
488 | * |
489 | * Parent windows should be set on dialogs, toolboxes, or other |
490 | * "auxiliary" surfaces, so that the parent is raised when the |
491 | * dialog is raised. |
492 | */ |
493 | void (*set_parent)(struct wl_client *client, |
494 | struct wl_resource *resource, |
495 | struct wl_resource *parent); |
496 | /** |
497 | * set surface title |
498 | * |
499 | * Set a short title for the surface. |
500 | * |
501 | * This string may be used to identify the surface in a task bar, |
502 | * window list, or other user interface elements provided by the |
503 | * compositor. |
504 | * |
505 | * The string must be encoded in UTF-8. |
506 | */ |
507 | void (*set_title)(struct wl_client *client, |
508 | struct wl_resource *resource, |
509 | const char *title); |
510 | /** |
511 | * set application ID |
512 | * |
513 | * Set an application identifier for the surface. |
514 | * |
515 | * The app ID identifies the general class of applications to which |
516 | * the surface belongs. The compositor can use this to group |
517 | * multiple surfaces together, or to determine how to launch a new |
518 | * application. |
519 | * |
520 | * For D-Bus activatable applications, the app ID is used as the |
521 | * D-Bus service name. |
522 | * |
523 | * The compositor shell will try to group application surfaces |
524 | * together by their app ID. As a best practice, it is suggested to |
525 | * select app ID's that match the basename of the application's |
526 | * .desktop file. For example, "org.freedesktop.FooViewer" where |
527 | * the .desktop file is "org.freedesktop.FooViewer.desktop". |
528 | * |
529 | * See the desktop-entry specification [0] for more details on |
530 | * application identifiers and how they relate to well-known D-Bus |
531 | * names and .desktop files. |
532 | * |
533 | * [0] http://standards.freedesktop.org/desktop-entry-spec/ |
534 | */ |
535 | void (*set_app_id)(struct wl_client *client, |
536 | struct wl_resource *resource, |
537 | const char *app_id); |
538 | /** |
539 | * show the window menu |
540 | * |
541 | * Clients implementing client-side decorations might want to |
542 | * show a context menu when right-clicking on the decorations, |
543 | * giving the user a menu that they can use to maximize or minimize |
544 | * the window. |
545 | * |
546 | * This request asks the compositor to pop up such a window menu at |
547 | * the given position, relative to the local surface coordinates of |
548 | * the parent surface. There are no guarantees as to what menu |
549 | * items the window menu contains. |
550 | * |
551 | * This request must be used in response to some sort of user |
552 | * action like a button press, key press, or touch down event. |
553 | * @param seat the wl_seat of the user event |
554 | * @param serial the serial of the user event |
555 | * @param x the x position to pop up the window menu at |
556 | * @param y the y position to pop up the window menu at |
557 | */ |
558 | void (*)(struct wl_client *client, |
559 | struct wl_resource *resource, |
560 | struct wl_resource *seat, |
561 | uint32_t serial, |
562 | int32_t x, |
563 | int32_t y); |
564 | /** |
565 | * start an interactive move |
566 | * |
567 | * Start an interactive, user-driven move of the surface. |
568 | * |
569 | * This request must be used in response to some sort of user |
570 | * action like a button press, key press, or touch down event. The |
571 | * passed serial is used to determine the type of interactive move |
572 | * (touch, pointer, etc). |
573 | * |
574 | * The server may ignore move requests depending on the state of |
575 | * the surface (e.g. fullscreen or maximized), or if the passed |
576 | * serial is no longer valid. |
577 | * |
578 | * If triggered, the surface will lose the focus of the device |
579 | * (wl_pointer, wl_touch, etc) used for the move. It is up to the |
580 | * compositor to visually indicate that the move is taking place, |
581 | * such as updating a pointer cursor, during the move. There is no |
582 | * guarantee that the device focus will return when the move is |
583 | * completed. |
584 | * @param seat the wl_seat of the user event |
585 | * @param serial the serial of the user event |
586 | */ |
587 | void (*move)(struct wl_client *client, |
588 | struct wl_resource *resource, |
589 | struct wl_resource *seat, |
590 | uint32_t serial); |
591 | /** |
592 | * start an interactive resize |
593 | * |
594 | * Start a user-driven, interactive resize of the surface. |
595 | * |
596 | * This request must be used in response to some sort of user |
597 | * action like a button press, key press, or touch down event. The |
598 | * passed serial is used to determine the type of interactive |
599 | * resize (touch, pointer, etc). |
600 | * |
601 | * The server may ignore resize requests depending on the state of |
602 | * the surface (e.g. fullscreen or maximized). |
603 | * |
604 | * If triggered, the client will receive configure events with the |
605 | * "resize" state enum value and the expected sizes. See the |
606 | * "resize" enum value for more details about what is required. The |
607 | * client must also acknowledge configure events using |
608 | * "ack_configure". After the resize is completed, the client will |
609 | * receive another "configure" event without the resize state. |
610 | * |
611 | * If triggered, the surface also will lose the focus of the device |
612 | * (wl_pointer, wl_touch, etc) used for the resize. It is up to the |
613 | * compositor to visually indicate that the resize is taking place, |
614 | * such as updating a pointer cursor, during the resize. There is |
615 | * no guarantee that the device focus will return when the resize |
616 | * is completed. |
617 | * |
618 | * The edges parameter specifies how the surface should be resized, |
619 | * and is one of the values of the resize_edge enum. The compositor |
620 | * may use this information to update the surface position for |
621 | * example when dragging the top left corner. The compositor may |
622 | * also use this information to adapt its behavior, e.g. choose an |
623 | * appropriate cursor image. |
624 | * @param seat the wl_seat of the user event |
625 | * @param serial the serial of the user event |
626 | * @param edges which edge or corner is being dragged |
627 | */ |
628 | void (*resize)(struct wl_client *client, |
629 | struct wl_resource *resource, |
630 | struct wl_resource *seat, |
631 | uint32_t serial, |
632 | uint32_t edges); |
633 | /** |
634 | * ack a configure event |
635 | * |
636 | * When a configure event is received, if a client commits the |
637 | * surface in response to the configure event, then the client must |
638 | * make a ack_configure request before the commit request, passing |
639 | * along the serial of the configure event. |
640 | * |
641 | * For instance, the compositor might use this information to move |
642 | * a surface to the top left only when the client has drawn itself |
643 | * for the maximized or fullscreen state. |
644 | * |
645 | * If the client receives multiple configure events before it can |
646 | * respond to one, it only has to ack the last configure event. |
647 | * @param serial the serial from the configure event |
648 | */ |
649 | void (*ack_configure)(struct wl_client *client, |
650 | struct wl_resource *resource, |
651 | uint32_t serial); |
652 | /** |
653 | * set the new window geometry |
654 | * |
655 | * The window geometry of a window is its "visible bounds" from |
656 | * the user's perspective. Client-side decorations often have |
657 | * invisible portions like drop-shadows which should be ignored for |
658 | * the purposes of aligning, placing and constraining windows. |
659 | * |
660 | * The window geometry is double buffered, and will be applied at |
661 | * the time wl_surface.commit of the corresponding wl_surface is |
662 | * called. |
663 | * |
664 | * Once the window geometry of the surface is set once, it is not |
665 | * possible to unset it, and it will remain the same until |
666 | * set_window_geometry is called again, even if a new subsurface or |
667 | * buffer is attached. |
668 | * |
669 | * If never set, the value is the full bounds of the surface, |
670 | * including any subsurfaces. This updates dynamically on every |
671 | * commit. This unset mode is meant for extremely simple clients. |
672 | * |
673 | * If responding to a configure event, the window geometry in here |
674 | * must respect the sizing negotiations specified by the states in |
675 | * the configure event. |
676 | * |
677 | * The arguments are given in the surface local coordinate space of |
678 | * the wl_surface associated with this xdg_surface. |
679 | * |
680 | * The width and height must be greater than zero. |
681 | */ |
682 | void (*set_window_geometry)(struct wl_client *client, |
683 | struct wl_resource *resource, |
684 | int32_t x, |
685 | int32_t y, |
686 | int32_t width, |
687 | int32_t height); |
688 | /** |
689 | * maximize the window |
690 | * |
691 | * Maximize the surface. |
692 | * |
693 | * After requesting that the surface should be maximized, the |
694 | * compositor will respond by emitting a configure event with the |
695 | * "maximized" state and the required window geometry. The client |
696 | * should then update its content, drawing it in a maximized state, |
697 | * i.e. without shadow or other decoration outside of the window |
698 | * geometry. The client must also acknowledge the configure when |
699 | * committing the new content (see ack_configure). |
700 | * |
701 | * It is up to the compositor to decide how and where to maximize |
702 | * the surface, for example which output and what region of the |
703 | * screen should be used. |
704 | * |
705 | * If the surface was already maximized, the compositor will still |
706 | * emit a configure event with the "maximized" state. |
707 | */ |
708 | void (*set_maximized)(struct wl_client *client, |
709 | struct wl_resource *resource); |
710 | /** |
711 | * unmaximize the window |
712 | * |
713 | * Unmaximize the surface. |
714 | * |
715 | * After requesting that the surface should be unmaximized, the |
716 | * compositor will respond by emitting a configure event without |
717 | * the "maximized" state. If available, the compositor will include |
718 | * the window geometry dimensions the window had prior to being |
719 | * maximized in the configure request. The client must then update |
720 | * its content, drawing it in a regular state, i.e. potentially |
721 | * with shadow, etc. The client must also acknowledge the configure |
722 | * when committing the new content (see ack_configure). |
723 | * |
724 | * It is up to the compositor to position the surface after it was |
725 | * unmaximized; usually the position the surface had before |
726 | * maximizing, if applicable. |
727 | * |
728 | * If the surface was already not maximized, the compositor will |
729 | * still emit a configure event without the "maximized" state. |
730 | */ |
731 | void (*unset_maximized)(struct wl_client *client, |
732 | struct wl_resource *resource); |
733 | /** |
734 | * set the window as fullscreen on a monitor |
735 | * |
736 | * Make the surface fullscreen. |
737 | * |
738 | * You can specify an output that you would prefer to be |
739 | * fullscreen. If this value is NULL, it's up to the compositor to |
740 | * choose which display will be used to map this surface. |
741 | * |
742 | * If the surface doesn't cover the whole output, the compositor |
743 | * will position the surface in the center of the output and |
744 | * compensate with black borders filling the rest of the output. |
745 | */ |
746 | void (*set_fullscreen)(struct wl_client *client, |
747 | struct wl_resource *resource, |
748 | struct wl_resource *output); |
749 | /** |
750 | */ |
751 | void (*unset_fullscreen)(struct wl_client *client, |
752 | struct wl_resource *resource); |
753 | /** |
754 | * set the window as minimized |
755 | * |
756 | * Request that the compositor minimize your surface. There is no |
757 | * way to know if the surface is currently minimized, nor is there |
758 | * any way to unset minimization on this surface. |
759 | * |
760 | * If you are looking to throttle redrawing when minimized, please |
761 | * instead use the wl_surface.frame event for this, as this will |
762 | * also work with live previews on windows in Alt-Tab, Expose or |
763 | * similar compositor features. |
764 | */ |
765 | void (*set_minimized)(struct wl_client *client, |
766 | struct wl_resource *resource); |
767 | }; |
768 | |
769 | #define XDG_SURFACE_CONFIGURE 0 |
770 | #define XDG_SURFACE_CLOSE 1 |
771 | |
772 | /** |
773 | * @ingroup iface_xdg_surface |
774 | */ |
775 | #define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1 |
776 | /** |
777 | * @ingroup iface_xdg_surface |
778 | */ |
779 | #define XDG_SURFACE_CLOSE_SINCE_VERSION 1 |
780 | |
781 | /** |
782 | * @ingroup iface_xdg_surface |
783 | */ |
784 | #define XDG_SURFACE_DESTROY_SINCE_VERSION 1 |
785 | /** |
786 | * @ingroup iface_xdg_surface |
787 | */ |
788 | #define XDG_SURFACE_SET_PARENT_SINCE_VERSION 1 |
789 | /** |
790 | * @ingroup iface_xdg_surface |
791 | */ |
792 | #define XDG_SURFACE_SET_TITLE_SINCE_VERSION 1 |
793 | /** |
794 | * @ingroup iface_xdg_surface |
795 | */ |
796 | #define XDG_SURFACE_SET_APP_ID_SINCE_VERSION 1 |
797 | /** |
798 | * @ingroup iface_xdg_surface |
799 | */ |
800 | #define 1 |
801 | /** |
802 | * @ingroup iface_xdg_surface |
803 | */ |
804 | #define XDG_SURFACE_MOVE_SINCE_VERSION 1 |
805 | /** |
806 | * @ingroup iface_xdg_surface |
807 | */ |
808 | #define XDG_SURFACE_RESIZE_SINCE_VERSION 1 |
809 | /** |
810 | * @ingroup iface_xdg_surface |
811 | */ |
812 | #define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1 |
813 | /** |
814 | * @ingroup iface_xdg_surface |
815 | */ |
816 | #define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 |
817 | /** |
818 | * @ingroup iface_xdg_surface |
819 | */ |
820 | #define XDG_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1 |
821 | /** |
822 | * @ingroup iface_xdg_surface |
823 | */ |
824 | #define XDG_SURFACE_UNSET_MAXIMIZED_SINCE_VERSION 1 |
825 | /** |
826 | * @ingroup iface_xdg_surface |
827 | */ |
828 | #define XDG_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1 |
829 | /** |
830 | * @ingroup iface_xdg_surface |
831 | */ |
832 | #define XDG_SURFACE_UNSET_FULLSCREEN_SINCE_VERSION 1 |
833 | /** |
834 | * @ingroup iface_xdg_surface |
835 | */ |
836 | #define XDG_SURFACE_SET_MINIMIZED_SINCE_VERSION 1 |
837 | |
838 | /** |
839 | * @ingroup iface_xdg_surface |
840 | * Sends an configure event to the client owning the resource. |
841 | * @param resource_ The client's resource |
842 | */ |
843 | static inline void |
844 | xdg_surface_send_configure(struct wl_resource *resource_, int32_t width, int32_t height, struct wl_array *states, uint32_t serial) |
845 | { |
846 | wl_resource_post_event(resource: resource_, XDG_SURFACE_CONFIGURE, width, height, states, serial); |
847 | } |
848 | |
849 | /** |
850 | * @ingroup iface_xdg_surface |
851 | * Sends an close event to the client owning the resource. |
852 | * @param resource_ The client's resource |
853 | */ |
854 | static inline void |
855 | xdg_surface_send_close(struct wl_resource *resource_) |
856 | { |
857 | wl_resource_post_event(resource: resource_, XDG_SURFACE_CLOSE); |
858 | } |
859 | |
860 | /** |
861 | * @ingroup iface_xdg_popup |
862 | * @struct xdg_popup_v5_interface |
863 | */ |
864 | struct { |
865 | /** |
866 | * remove xdg_popup interface |
867 | * |
868 | * This destroys the popup. Explicitly destroying the xdg_popup |
869 | * object will also dismiss the popup, and unmap the surface. |
870 | * |
871 | * If this xdg_popup is not the "topmost" popup, a protocol error |
872 | * will be sent. |
873 | */ |
874 | void (*)(struct wl_client *client, |
875 | struct wl_resource *resource); |
876 | }; |
877 | |
878 | #define 0 |
879 | |
880 | /** |
881 | * @ingroup iface_xdg_popup |
882 | */ |
883 | #define 1 |
884 | |
885 | /** |
886 | * @ingroup iface_xdg_popup |
887 | */ |
888 | #define 1 |
889 | |
890 | /** |
891 | * @ingroup iface_xdg_popup |
892 | * Sends an popup_done event to the client owning the resource. |
893 | * @param resource_ The client's resource |
894 | */ |
895 | static inline void |
896 | (struct wl_resource *resource_) |
897 | { |
898 | wl_resource_post_event(resource: resource_, XDG_POPUP_POPUP_DONE); |
899 | } |
900 | |
901 | #ifdef __cplusplus |
902 | } |
903 | #endif |
904 | |
905 | #endif |
906 | |