Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-server-protocol.h

Issue 2360533002: exo: Implement minimal support for version 6 of XDG shell. (Closed)
Patch Set: fix bad rebase and unit tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* Generated by wayland-scanner 1.11.0 */
2
3 #ifndef XDG_SHELL_UNSTABLE_V6_SERVER_PROTOCOL_H
4 #define XDG_SHELL_UNSTABLE_V6_SERVER_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-server.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 struct wl_client;
15 struct wl_resource;
16
17 /**
18 * @page page_xdg_shell_unstable_v6 The xdg_shell_unstable_v6 protocol
19 * @section page_ifaces_xdg_shell_unstable_v6 Interfaces
20 * - @subpage page_iface_zxdg_shell_v6 - create desktop-style surfaces
21 * - @subpage page_iface_zxdg_positioner_v6 - child surface positioner
22 * - @subpage page_iface_zxdg_surface_v6 - desktop user interface surface base i nterface
23 * - @subpage page_iface_zxdg_toplevel_v6 - toplevel surface
24 * - @subpage page_iface_zxdg_popup_v6 - short-lived, popup surfaces for menus
25 * @section page_copyright_xdg_shell_unstable_v6 Copyright
26 * <pre>
27 *
28 * Copyright © 2008-2013 Kristian Høgsberg
29 * Copyright © 2013 Rafael Antognolli
30 * Copyright © 2013 Jasper St. Pierre
31 * Copyright © 2010-2013 Intel Corporation
32 *
33 * Permission is hereby granted, free of charge, to any person obtaining a
34 * copy of this software and associated documentation files (the "Software"),
35 * to deal in the Software without restriction, including without limitation
36 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
37 * and/or sell copies of the Software, and to permit persons to whom the
38 * Software is furnished to do so, subject to the following conditions:
39 *
40 * The above copyright notice and this permission notice (including the next
41 * paragraph) shall be included in all copies or substantial portions of the
42 * Software.
43 *
44 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
47 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
48 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
49 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
50 * DEALINGS IN THE SOFTWARE.
51 * </pre>
52 */
53 struct wl_output;
54 struct wl_seat;
55 struct wl_surface;
56 struct zxdg_popup_v6;
57 struct zxdg_positioner_v6;
58 struct zxdg_shell_v6;
59 struct zxdg_surface_v6;
60 struct zxdg_toplevel_v6;
61
62 /**
63 * @page page_iface_zxdg_shell_v6 zxdg_shell_v6
64 * @section page_iface_zxdg_shell_v6_desc Description
65 *
66 * xdg_shell allows clients to turn a wl_surface into a "real window"
67 * which can be dragged, resized, stacked, and moved around by the
68 * user. Everything about this interface is suited towards traditional
69 * desktop environments.
70 * @section page_iface_zxdg_shell_v6_api API
71 * See @ref iface_zxdg_shell_v6.
72 */
73 /**
74 * @defgroup iface_zxdg_shell_v6 The zxdg_shell_v6 interface
75 *
76 * xdg_shell allows clients to turn a wl_surface into a "real window"
77 * which can be dragged, resized, stacked, and moved around by the
78 * user. Everything about this interface is suited towards traditional
79 * desktop environments.
80 */
81 extern const struct wl_interface zxdg_shell_v6_interface;
82 /**
83 * @page page_iface_zxdg_positioner_v6 zxdg_positioner_v6
84 * @section page_iface_zxdg_positioner_v6_desc Description
85 *
86 * The xdg_positioner provides a collection of rules for the placement of a
87 * child surface relative to a parent surface. Rules can be defined to ensure
88 * the child surface remains within the visible area's borders, and to
89 * specify how the child surface changes its position, such as sliding along
90 * an axis, or flipping around a rectangle.
91 *
92 * See the various requests for details about possible rules.
93 *
94 * At the time of the request, the compositor makes a copy of the rules
95 * specified by the xdg_positioner. Thus, after the request is complete the
96 * xdg_positioner object can be destroyed or reused; further changes to the
97 * object will have no effect on previous usages.
98 *
99 * For an xdg_positioner object to be considered complete, it must have a
100 * non-zero size set by set_size, and a non-zero anchor rectangle set by
101 * set_anchor_rect. Passing an incomplete xdg_positioner object when
102 * positioning a surface raises an error.
103 * @section page_iface_zxdg_positioner_v6_api API
104 * See @ref iface_zxdg_positioner_v6.
105 */
106 /**
107 * @defgroup iface_zxdg_positioner_v6 The zxdg_positioner_v6 interface
108 *
109 * The xdg_positioner provides a collection of rules for the placement of a
110 * child surface relative to a parent surface. Rules can be defined to ensure
111 * the child surface remains within the visible area's borders, and to
112 * specify how the child surface changes its position, such as sliding along
113 * an axis, or flipping around a rectangle.
114 *
115 * See the various requests for details about possible rules.
116 *
117 * At the time of the request, the compositor makes a copy of the rules
118 * specified by the xdg_positioner. Thus, after the request is complete the
119 * xdg_positioner object can be destroyed or reused; further changes to the
120 * object will have no effect on previous usages.
121 *
122 * For an xdg_positioner object to be considered complete, it must have a
123 * non-zero size set by set_size, and a non-zero anchor rectangle set by
124 * set_anchor_rect. Passing an incomplete xdg_positioner object when
125 * positioning a surface raises an error.
126 */
127 extern const struct wl_interface zxdg_positioner_v6_interface;
128 /**
129 * @page page_iface_zxdg_surface_v6 zxdg_surface_v6
130 * @section page_iface_zxdg_surface_v6_desc Description
131 *
132 * An interface that may be implemented by a wl_surface, for
133 * implementations that provide a desktop-style user interface.
134 *
135 * It provides a base set of functionality required to construct user
136 * interface elements requiring management by the compositor, such as
137 * toplevel windows, menus, etc. The types of functionality are split into
138 * xdg_surface roles.
139 *
140 * Creating an xdg_surface does not set the role for a wl_surface. In order
141 * to map an xdg_surface, the client must create a role-specific object
142 * using, e.g., get_toplevel, get_popup. The wl_surface for any given
143 * xdg_surface can have at most one role, and may not be assigned any role
144 * not based on xdg_surface.
145 *
146 * A role must be assigned before any other requests are made to the
147 * xdg_surface object.
148 *
149 * The client must call wl_surface.commit on the corresponding wl_surface
150 * for the xdg_surface state to take effect.
151 *
152 * Creating an xdg_surface from a wl_surface which has a buffer attached or
153 * committed is a client error, and any attempts by a client to attach or
154 * manipulate a buffer prior to the first xdg_surface.configure call must
155 * also be treated as errors.
156 *
157 * For a surface to be mapped by the compositor, the following conditions
158 * must be met: (1) the client has assigned a xdg_surface based role to the
159 * surface, (2) the client has set and committed the xdg_surface state and
160 * the role dependent state to the surface and (3) the client has committed a
161 * buffer to the surface.
162 * @section page_iface_zxdg_surface_v6_api API
163 * See @ref iface_zxdg_surface_v6.
164 */
165 /**
166 * @defgroup iface_zxdg_surface_v6 The zxdg_surface_v6 interface
167 *
168 * An interface that may be implemented by a wl_surface, for
169 * implementations that provide a desktop-style user interface.
170 *
171 * It provides a base set of functionality required to construct user
172 * interface elements requiring management by the compositor, such as
173 * toplevel windows, menus, etc. The types of functionality are split into
174 * xdg_surface roles.
175 *
176 * Creating an xdg_surface does not set the role for a wl_surface. In order
177 * to map an xdg_surface, the client must create a role-specific object
178 * using, e.g., get_toplevel, get_popup. The wl_surface for any given
179 * xdg_surface can have at most one role, and may not be assigned any role
180 * not based on xdg_surface.
181 *
182 * A role must be assigned before any other requests are made to the
183 * xdg_surface object.
184 *
185 * The client must call wl_surface.commit on the corresponding wl_surface
186 * for the xdg_surface state to take effect.
187 *
188 * Creating an xdg_surface from a wl_surface which has a buffer attached or
189 * committed is a client error, and any attempts by a client to attach or
190 * manipulate a buffer prior to the first xdg_surface.configure call must
191 * also be treated as errors.
192 *
193 * For a surface to be mapped by the compositor, the following conditions
194 * must be met: (1) the client has assigned a xdg_surface based role to the
195 * surface, (2) the client has set and committed the xdg_surface state and
196 * the role dependent state to the surface and (3) the client has committed a
197 * buffer to the surface.
198 */
199 extern const struct wl_interface zxdg_surface_v6_interface;
200 /**
201 * @page page_iface_zxdg_toplevel_v6 zxdg_toplevel_v6
202 * @section page_iface_zxdg_toplevel_v6_desc Description
203 *
204 * This interface defines an xdg_surface role which allows a surface to,
205 * among other things, set window-like properties such as maximize,
206 * fullscreen, and minimize, set application-specific metadata like title and
207 * id, and well as trigger user interactive operations such as interactive
208 * resize and move.
209 * @section page_iface_zxdg_toplevel_v6_api API
210 * See @ref iface_zxdg_toplevel_v6.
211 */
212 /**
213 * @defgroup iface_zxdg_toplevel_v6 The zxdg_toplevel_v6 interface
214 *
215 * This interface defines an xdg_surface role which allows a surface to,
216 * among other things, set window-like properties such as maximize,
217 * fullscreen, and minimize, set application-specific metadata like title and
218 * id, and well as trigger user interactive operations such as interactive
219 * resize and move.
220 */
221 extern const struct wl_interface zxdg_toplevel_v6_interface;
222 /**
223 * @page page_iface_zxdg_popup_v6 zxdg_popup_v6
224 * @section page_iface_zxdg_popup_v6_desc Description
225 *
226 * A popup surface is a short-lived, temporary surface. It can be used to
227 * implement for example menus, popovers, tooltips and other similar user
228 * interface concepts.
229 *
230 * A popup can be made to take an explicit grab. See xdg_popup.grab for
231 * details.
232 *
233 * When the popup is dismissed, a popup_done event will be sent out, and at
234 * the same time the surface will be unmapped. See the xdg_popup.popup_done
235 * event for details.
236 *
237 * Explicitly destroying the xdg_popup object will also dismiss the popup and
238 * unmap the surface. Clients that want to dismiss the popup when another
239 * surface of their own is clicked should dismiss the popup using the destroy
240 * request.
241 *
242 * The parent surface must have either the xdg_toplevel or xdg_popup surface
243 * role.
244 *
245 * A newly created xdg_popup will be stacked on top of all previously created
246 * xdg_popup surfaces associated with the same xdg_toplevel.
247 *
248 * The parent of an xdg_popup must be mapped (see the xdg_surface
249 * description) before the xdg_popup itself.
250 *
251 * The x and y arguments passed when creating the popup object specify
252 * where the top left of the popup should be placed, relative to the
253 * local surface coordinates of the parent surface. See
254 * xdg_surface.get_popup.
255 *
256 * The client must call wl_surface.commit on the corresponding wl_surface
257 * for the xdg_popup state to take effect.
258 * @section page_iface_zxdg_popup_v6_api API
259 * See @ref iface_zxdg_popup_v6.
260 */
261 /**
262 * @defgroup iface_zxdg_popup_v6 The zxdg_popup_v6 interface
263 *
264 * A popup surface is a short-lived, temporary surface. It can be used to
265 * implement for example menus, popovers, tooltips and other similar user
266 * interface concepts.
267 *
268 * A popup can be made to take an explicit grab. See xdg_popup.grab for
269 * details.
270 *
271 * When the popup is dismissed, a popup_done event will be sent out, and at
272 * the same time the surface will be unmapped. See the xdg_popup.popup_done
273 * event for details.
274 *
275 * Explicitly destroying the xdg_popup object will also dismiss the popup and
276 * unmap the surface. Clients that want to dismiss the popup when another
277 * surface of their own is clicked should dismiss the popup using the destroy
278 * request.
279 *
280 * The parent surface must have either the xdg_toplevel or xdg_popup surface
281 * role.
282 *
283 * A newly created xdg_popup will be stacked on top of all previously created
284 * xdg_popup surfaces associated with the same xdg_toplevel.
285 *
286 * The parent of an xdg_popup must be mapped (see the xdg_surface
287 * description) before the xdg_popup itself.
288 *
289 * The x and y arguments passed when creating the popup object specify
290 * where the top left of the popup should be placed, relative to the
291 * local surface coordinates of the parent surface. See
292 * xdg_surface.get_popup.
293 *
294 * The client must call wl_surface.commit on the corresponding wl_surface
295 * for the xdg_popup state to take effect.
296 */
297 extern const struct wl_interface zxdg_popup_v6_interface;
298
299 #ifndef ZXDG_SHELL_V6_ERROR_ENUM
300 #define ZXDG_SHELL_V6_ERROR_ENUM
301 enum zxdg_shell_v6_error {
302 /**
303 * given wl_surface has another role
304 */
305 ZXDG_SHELL_V6_ERROR_ROLE = 0,
306 /**
307 * xdg_shell was destroyed before children
308 */
309 ZXDG_SHELL_V6_ERROR_DEFUNCT_SURFACES = 1,
310 /**
311 * the client tried to map or destroy a non-topmost popup
312 */
313 ZXDG_SHELL_V6_ERROR_NOT_THE_TOPMOST_POPUP = 2,
314 /**
315 * the client specified an invalid popup parent surface
316 */
317 ZXDG_SHELL_V6_ERROR_INVALID_POPUP_PARENT = 3,
318 /**
319 * the client provided an invalid surface state
320 */
321 ZXDG_SHELL_V6_ERROR_INVALID_SURFACE_STATE = 4,
322 /**
323 * the client provided an invalid positioner
324 */
325 ZXDG_SHELL_V6_ERROR_INVALID_POSITIONER = 5,
326 };
327 #endif /* ZXDG_SHELL_V6_ERROR_ENUM */
328
329 /**
330 * @ingroup iface_zxdg_shell_v6
331 * @struct zxdg_shell_v6_interface
332 */
333 struct zxdg_shell_v6_interface {
334 /**
335 * destroy xdg_shell
336 *
337 * Destroy this xdg_shell object.
338 *
339 * Destroying a bound xdg_shell object while there are surfaces
340 * still alive created by this xdg_shell object instance is illegal
341 * and will result in a protocol error.
342 */
343 void (*destroy)(struct wl_client *client,
344 struct wl_resource *resource);
345 /**
346 * create a positioner object
347 *
348 * Create a positioner object. A positioner object is used to
349 * position surfaces relative to some parent surface. See the
350 * interface description and xdg_surface.get_popup for details.
351 */
352 void (*create_positioner)(struct wl_client *client,
353 struct wl_resource *resource,
354 uint32_t id);
355 /**
356 * create a shell surface from a surface
357 *
358 * This creates an xdg_surface for the given surface. While
359 * xdg_surface itself is not a role, the corresponding surface may
360 * only be assigned a role extending xdg_surface, such as
361 * xdg_toplevel or xdg_popup.
362 *
363 * This creates an xdg_surface for the given surface. An
364 * xdg_surface is used as basis to define a role to a given
365 * surface, such as xdg_toplevel or xdg_popup. It also manages
366 * functionality shared between xdg_surface based surface roles.
367 *
368 * See the documentation of xdg_surface for more details about what
369 * an xdg_surface is and how it is used.
370 */
371 void (*get_xdg_surface)(struct wl_client *client,
372 struct wl_resource *resource,
373 uint32_t id,
374 struct wl_resource *surface);
375 /**
376 * respond to a ping event
377 *
378 * A client must respond to a ping event with a pong request or
379 * the client may be deemed unresponsive. See xdg_shell.ping.
380 * @param serial serial of the ping event
381 */
382 void (*pong)(struct wl_client *client,
383 struct wl_resource *resource,
384 uint32_t serial);
385 };
386
387 #define ZXDG_SHELL_V6_PING 0
388
389 /**
390 * @ingroup iface_zxdg_shell_v6
391 */
392 #define ZXDG_SHELL_V6_PING_SINCE_VERSION 1
393
394 /**
395 * @ingroup iface_zxdg_shell_v6
396 * Sends an ping event to the client owning the resource.
397 * @param resource_ The client's resource
398 * @param serial pass this to the pong request
399 */
400 static inline void
401 zxdg_shell_v6_send_ping(struct wl_resource *resource_, uint32_t serial)
402 {
403 wl_resource_post_event(resource_, ZXDG_SHELL_V6_PING, serial);
404 }
405
406 #ifndef ZXDG_POSITIONER_V6_ERROR_ENUM
407 #define ZXDG_POSITIONER_V6_ERROR_ENUM
408 enum zxdg_positioner_v6_error {
409 /**
410 * invalid input provided
411 */
412 ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT = 0,
413 };
414 #endif /* ZXDG_POSITIONER_V6_ERROR_ENUM */
415
416 #ifndef ZXDG_POSITIONER_V6_ANCHOR_ENUM
417 #define ZXDG_POSITIONER_V6_ANCHOR_ENUM
418 enum zxdg_positioner_v6_anchor {
419 /**
420 * the center of the anchor rectangle
421 */
422 ZXDG_POSITIONER_V6_ANCHOR_NONE = 0,
423 /**
424 * the top edge of the anchor rectangle
425 */
426 ZXDG_POSITIONER_V6_ANCHOR_TOP = 1,
427 /**
428 * the bottom edge of the anchor rectangle
429 */
430 ZXDG_POSITIONER_V6_ANCHOR_BOTTOM = 2,
431 /**
432 * the left edge of the anchor rectangle
433 */
434 ZXDG_POSITIONER_V6_ANCHOR_LEFT = 4,
435 /**
436 * the right edge of the anchor rectangle
437 */
438 ZXDG_POSITIONER_V6_ANCHOR_RIGHT = 8,
439 };
440 #endif /* ZXDG_POSITIONER_V6_ANCHOR_ENUM */
441
442 #ifndef ZXDG_POSITIONER_V6_GRAVITY_ENUM
443 #define ZXDG_POSITIONER_V6_GRAVITY_ENUM
444 enum zxdg_positioner_v6_gravity {
445 /**
446 * center over the anchor edge
447 */
448 ZXDG_POSITIONER_V6_GRAVITY_NONE = 0,
449 /**
450 * position above the anchor edge
451 */
452 ZXDG_POSITIONER_V6_GRAVITY_TOP = 1,
453 /**
454 * position below the anchor edge
455 */
456 ZXDG_POSITIONER_V6_GRAVITY_BOTTOM = 2,
457 /**
458 * position to the left of the anchor edge
459 */
460 ZXDG_POSITIONER_V6_GRAVITY_LEFT = 4,
461 /**
462 * position to the right of the anchor edge
463 */
464 ZXDG_POSITIONER_V6_GRAVITY_RIGHT = 8,
465 };
466 #endif /* ZXDG_POSITIONER_V6_GRAVITY_ENUM */
467
468 #ifndef ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM
469 #define ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM
470 /**
471 * @ingroup iface_zxdg_positioner_v6
472 * vertically resize the surface
473 *
474 * Resize the surface vertically so that it is completely unconstrained.
475 */
476 enum zxdg_positioner_v6_constraint_adjustment {
477 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE = 0,
478 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X = 1,
479 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y = 2,
480 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X = 4,
481 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y = 8,
482 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X = 16,
483 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 32,
484 };
485 #endif /* ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM */
486
487 /**
488 * @ingroup iface_zxdg_positioner_v6
489 * @struct zxdg_positioner_v6_interface
490 */
491 struct zxdg_positioner_v6_interface {
492 /**
493 * destroy the xdg_positioner object
494 *
495 * Notify the compositor that the xdg_positioner will no longer
496 * be used.
497 */
498 void (*destroy)(struct wl_client *client,
499 struct wl_resource *resource);
500 /**
501 * set the size of the to-be positioned rectangle
502 *
503 * Set the size of the surface that is to be positioned with the
504 * positioner object. The size is in surface-local coordinates and
505 * corresponds to the window geometry. See
506 * xdg_surface.set_window_geometry.
507 *
508 * If a zero or negative size is set the invalid_input error is
509 * raised.
510 * @param width width of positioned rectangle
511 * @param height height of positioned rectangle
512 */
513 void (*set_size)(struct wl_client *client,
514 struct wl_resource *resource,
515 int32_t width,
516 int32_t height);
517 /**
518 * set the anchor rectangle within the parent surface
519 *
520 * Specify the anchor rectangle within the parent surface that
521 * the child surface will be placed relative to. The rectangle is
522 * relative to the window geometry as defined by
523 * xdg_surface.set_window_geometry of the parent surface. The
524 * rectangle must be at least 1x1 large.
525 *
526 * When the xdg_positioner object is used to position a child
527 * surface, the anchor rectangle may not extend outside the window
528 * geometry of the positioned child's parent surface.
529 *
530 * If a zero or negative size is set the invalid_input error is
531 * raised.
532 * @param x x position of anchor rectangle
533 * @param y y position of anchor rectangle
534 * @param width width of anchor rectangle
535 * @param height height of anchor rectangle
536 */
537 void (*set_anchor_rect)(struct wl_client *client,
538 struct wl_resource *resource,
539 int32_t x,
540 int32_t y,
541 int32_t width,
542 int32_t height);
543 /**
544 * set anchor rectangle anchor edges
545 *
546 * Defines a set of edges for the anchor rectangle. These are
547 * used to derive an anchor point that the child surface will be
548 * positioned relative to. If two orthogonal edges are specified
549 * (e.g. 'top' and 'left'), then the anchor point will be the
550 * intersection of the edges (e.g. the top left position of the
551 * rectangle); otherwise, the derived anchor point will be centered
552 * on the specified edge, or in the center of the anchor rectangle
553 * if no edge is specified.
554 *
555 * If two parallel anchor edges are specified (e.g. 'left' and
556 * 'right'), the invalid_input error is raised.
557 * @param anchor bit mask of anchor edges
558 */
559 void (*set_anchor)(struct wl_client *client,
560 struct wl_resource *resource,
561 uint32_t anchor);
562 /**
563 * set child surface gravity
564 *
565 * Defines in what direction a surface should be positioned,
566 * relative to the anchor point of the parent surface. If two
567 * orthogonal gravities are specified (e.g. 'bottom' and 'right'),
568 * then the child surface will be placed in the specified
569 * direction; otherwise, the child surface will be centered over
570 * the anchor point on any axis that had no gravity specified.
571 *
572 * If two parallel gravities are specified (e.g. 'left' and
573 * 'right'), the invalid_input error is raised.
574 * @param gravity bit mask of gravity directions
575 */
576 void (*set_gravity)(struct wl_client *client,
577 struct wl_resource *resource,
578 uint32_t gravity);
579 /**
580 * set the adjustment to be done when constrained
581 *
582 * Specify how the window should be positioned if the originally
583 * intended position caused the surface to be constrained, meaning
584 * at least partially outside positioning boundaries set by the
585 * compositor. The adjustment is set by constructing a bitmask
586 * describing the adjustment to be made when the surface is
587 * constrained on that axis.
588 *
589 * If no bit for one axis is set, the compositor will assume that
590 * the child surface should not change its position on that axis
591 * when constrained.
592 *
593 * If more than one bit for one axis is set, the order of how
594 * adjustments are applied is specified in the corresponding
595 * adjustment descriptions.
596 *
597 * The default adjustment is none.
598 * @param constraint_adjustment bit mask of constraint adjustments
599 */
600 void (*set_constraint_adjustment)(struct wl_client *client,
601 struct wl_resource *resource,
602 uint32_t constraint_adjustment);
603 /**
604 * set surface position offset
605 *
606 * Specify the surface position offset relative to the position
607 * of the anchor on the anchor rectangle and the anchor on the
608 * surface. For example if the anchor of the anchor rectangle is at
609 * (x, y), the surface has the gravity bottom|right, and the offset
610 * is (ox, oy), the calculated surface position will be (x + ox, y
611 * + oy). The offset position of the surface is the one used for
612 * constraint testing. See set_constraint_adjustment.
613 *
614 * An example use case is placing a popup menu on top of a user
615 * interface element, while aligning the user interface element of
616 * the parent surface with some user interface element placed
617 * somewhere in the popup surface.
618 * @param x surface position x offset
619 * @param y surface position y offset
620 */
621 void (*set_offset)(struct wl_client *client,
622 struct wl_resource *resource,
623 int32_t x,
624 int32_t y);
625 };
626
627
628 #ifndef ZXDG_SURFACE_V6_ERROR_ENUM
629 #define ZXDG_SURFACE_V6_ERROR_ENUM
630 enum zxdg_surface_v6_error {
631 ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED = 1,
632 ZXDG_SURFACE_V6_ERROR_ALREADY_CONSTRUCTED = 2,
633 ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER = 3,
634 };
635 #endif /* ZXDG_SURFACE_V6_ERROR_ENUM */
636
637 /**
638 * @ingroup iface_zxdg_surface_v6
639 * @struct zxdg_surface_v6_interface
640 */
641 struct zxdg_surface_v6_interface {
642 /**
643 * destroy the xdg_surface
644 *
645 * Destroy the xdg_surface object. An xdg_surface must only be
646 * destroyed after its role object has been destroyed.
647 */
648 void (*destroy)(struct wl_client *client,
649 struct wl_resource *resource);
650 /**
651 * assign the xdg_toplevel surface role
652 *
653 * This creates an xdg_toplevel object for the given xdg_surface
654 * and gives the associated wl_surface the xdg_toplevel role.
655 *
656 * See the documentation of xdg_toplevel for more details about
657 * what an xdg_toplevel is and how it is used.
658 */
659 void (*get_toplevel)(struct wl_client *client,
660 struct wl_resource *resource,
661 uint32_t id);
662 /**
663 * assign the xdg_popup surface role
664 *
665 * This creates an xdg_popup object for the given xdg_surface and
666 * gives the associated wl_surface the xdg_popup role.
667 *
668 * See the documentation of xdg_popup for more details about what
669 * an xdg_popup is and how it is used.
670 */
671 void (*get_popup)(struct wl_client *client,
672 struct wl_resource *resource,
673 uint32_t id,
674 struct wl_resource *parent,
675 struct wl_resource *positioner);
676 /**
677 * set the new window geometry
678 *
679 * The window geometry of a surface is its "visible bounds" from
680 * the user's perspective. Client-side decorations often have
681 * invisible portions like drop-shadows which should be ignored for
682 * the purposes of aligning, placing and constraining windows.
683 *
684 * The window geometry is double buffered, and will be applied at
685 * the time wl_surface.commit of the corresponding wl_surface is
686 * called.
687 *
688 * Once the window geometry of the surface is set, it is not
689 * possible to unset it, and it will remain the same until
690 * set_window_geometry is called again, even if a new subsurface or
691 * buffer is attached.
692 *
693 * If never set, the value is the full bounds of the surface,
694 * including any subsurfaces. This updates dynamically on every
695 * commit. This unset is meant for extremely simple clients.
696 *
697 * The arguments are given in the surface-local coordinate space of
698 * the wl_surface associated with this xdg_surface.
699 *
700 * The width and height must be greater than zero. Setting an
701 * invalid size will raise an error. When applied, the effective
702 * window geometry will be the set window geometry clamped to the
703 * bounding rectangle of the combined geometry of the surface of
704 * the xdg_surface and the associated subsurfaces.
705 */
706 void (*set_window_geometry)(struct wl_client *client,
707 struct wl_resource *resource,
708 int32_t x,
709 int32_t y,
710 int32_t width,
711 int32_t height);
712 /**
713 * ack a configure event
714 *
715 * When a configure event is received, if a client commits the
716 * surface in response to the configure event, then the client must
717 * make an ack_configure request sometime before the commit
718 * request, passing along the serial of the configure event.
719 *
720 * For instance, for toplevel surfaces the compositor might use
721 * this information to move a surface to the top left only when the
722 * client has drawn itself for the maximized or fullscreen state.
723 *
724 * If the client receives multiple configure events before it can
725 * respond to one, it only has to ack the last configure event.
726 *
727 * A client is not required to commit immediately after sending an
728 * ack_configure request - it may even ack_configure several times
729 * before its next surface commit.
730 *
731 * A client may send multiple ack_configure requests before
732 * committing, but only the last request sent before a commit
733 * indicates which configure event the client really is responding
734 * to.
735 * @param serial the serial from the configure event
736 */
737 void (*ack_configure)(struct wl_client *client,
738 struct wl_resource *resource,
739 uint32_t serial);
740 };
741
742 #define ZXDG_SURFACE_V6_CONFIGURE 0
743
744 /**
745 * @ingroup iface_zxdg_surface_v6
746 */
747 #define ZXDG_SURFACE_V6_CONFIGURE_SINCE_VERSION 1
748
749 /**
750 * @ingroup iface_zxdg_surface_v6
751 * Sends an configure event to the client owning the resource.
752 * @param resource_ The client's resource
753 * @param serial serial of the configure event
754 */
755 static inline void
756 zxdg_surface_v6_send_configure(struct wl_resource *resource_, uint32_t serial)
757 {
758 wl_resource_post_event(resource_, ZXDG_SURFACE_V6_CONFIGURE, serial);
759 }
760
761 #ifndef ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM
762 #define ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM
763 /**
764 * @ingroup iface_zxdg_toplevel_v6
765 * edge values for resizing
766 *
767 * These values are used to indicate which edge of a surface
768 * is being dragged in a resize operation.
769 */
770 enum zxdg_toplevel_v6_resize_edge {
771 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_NONE = 0,
772 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP = 1,
773 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM = 2,
774 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_LEFT = 4,
775 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_LEFT = 5,
776 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_LEFT = 6,
777 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_RIGHT = 8,
778 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_RIGHT = 9,
779 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_RIGHT = 10,
780 };
781 #endif /* ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM */
782
783 #ifndef ZXDG_TOPLEVEL_V6_STATE_ENUM
784 #define ZXDG_TOPLEVEL_V6_STATE_ENUM
785 /**
786 * @ingroup iface_zxdg_toplevel_v6
787 * the surface is now activated
788 *
789 * Client window decorations should be painted as if the window is
790 * active. Do not assume this means that the window actually has
791 * keyboard or pointer focus.
792 */
793 enum zxdg_toplevel_v6_state {
794 /**
795 * the surface is maximized
796 */
797 ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED = 1,
798 /**
799 * the surface is fullscreen
800 */
801 ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN = 2,
802 /**
803 * the surface is being resized
804 */
805 ZXDG_TOPLEVEL_V6_STATE_RESIZING = 3,
806 /**
807 * the surface is now activated
808 */
809 ZXDG_TOPLEVEL_V6_STATE_ACTIVATED = 4,
810 };
811 #endif /* ZXDG_TOPLEVEL_V6_STATE_ENUM */
812
813 /**
814 * @ingroup iface_zxdg_toplevel_v6
815 * @struct zxdg_toplevel_v6_interface
816 */
817 struct zxdg_toplevel_v6_interface {
818 /**
819 * destroy the xdg_toplevel
820 *
821 * Unmap and destroy the window. The window will be effectively
822 * hidden from the user's point of view, and all state like
823 * maximization, fullscreen, and so on, will be lost.
824 */
825 void (*destroy)(struct wl_client *client,
826 struct wl_resource *resource);
827 /**
828 * set the parent of this surface
829 *
830 * Set the "parent" of this surface. This window should be
831 * stacked above a parent. The parent surface must be mapped as
832 * long as this surface is mapped.
833 *
834 * Parent windows should be set on dialogs, toolboxes, or other
835 * "auxiliary" surfaces, so that the parent is raised when the
836 * dialog is raised.
837 */
838 void (*set_parent)(struct wl_client *client,
839 struct wl_resource *resource,
840 struct wl_resource *parent);
841 /**
842 * set surface title
843 *
844 * Set a short title for the surface.
845 *
846 * This string may be used to identify the surface in a task bar,
847 * window list, or other user interface elements provided by the
848 * compositor.
849 *
850 * The string must be encoded in UTF-8.
851 */
852 void (*set_title)(struct wl_client *client,
853 struct wl_resource *resource,
854 const char *title);
855 /**
856 * set application ID
857 *
858 * Set an application identifier for the surface.
859 *
860 * The app ID identifies the general class of applications to which
861 * the surface belongs. The compositor can use this to group
862 * multiple surfaces together, or to determine how to launch a new
863 * application.
864 *
865 * For D-Bus activatable applications, the app ID is used as the
866 * D-Bus service name.
867 *
868 * The compositor shell will try to group application surfaces
869 * together by their app ID. As a best practice, it is suggested to
870 * select app ID's that match the basename of the application's
871 * .desktop file. For example, "org.freedesktop.FooViewer" where
872 * the .desktop file is "org.freedesktop.FooViewer.desktop".
873 *
874 * See the desktop-entry specification [0] for more details on
875 * application identifiers and how they relate to well-known D-Bus
876 * names and .desktop files.
877 *
878 * [0] http://standards.freedesktop.org/desktop-entry-spec/
879 */
880 void (*set_app_id)(struct wl_client *client,
881 struct wl_resource *resource,
882 const char *app_id);
883 /**
884 * show the window menu
885 *
886 * Clients implementing client-side decorations might want to
887 * show a context menu when right-clicking on the decorations,
888 * giving the user a menu that they can use to maximize or minimize
889 * the window.
890 *
891 * This request asks the compositor to pop up such a window menu at
892 * the given position, relative to the local surface coordinates of
893 * the parent surface. There are no guarantees as to what menu
894 * items the window menu contains.
895 *
896 * This request must be used in response to some sort of user
897 * action like a button press, key press, or touch down event.
898 * @param seat the wl_seat of the user event
899 * @param serial the serial of the user event
900 * @param x the x position to pop up the window menu at
901 * @param y the y position to pop up the window menu at
902 */
903 void (*show_window_menu)(struct wl_client *client,
904 struct wl_resource *resource,
905 struct wl_resource *seat,
906 uint32_t serial,
907 int32_t x,
908 int32_t y);
909 /**
910 * start an interactive move
911 *
912 * Start an interactive, user-driven move of the surface.
913 *
914 * This request must be used in response to some sort of user
915 * action like a button press, key press, or touch down event. The
916 * passed serial is used to determine the type of interactive move
917 * (touch, pointer, etc).
918 *
919 * The server may ignore move requests depending on the state of
920 * the surface (e.g. fullscreen or maximized), or if the passed
921 * serial is no longer valid.
922 *
923 * If triggered, the surface will lose the focus of the device
924 * (wl_pointer, wl_touch, etc) used for the move. It is up to the
925 * compositor to visually indicate that the move is taking place,
926 * such as updating a pointer cursor, during the move. There is no
927 * guarantee that the device focus will return when the move is
928 * completed.
929 * @param seat the wl_seat of the user event
930 * @param serial the serial of the user event
931 */
932 void (*move)(struct wl_client *client,
933 struct wl_resource *resource,
934 struct wl_resource *seat,
935 uint32_t serial);
936 /**
937 * start an interactive resize
938 *
939 * Start a user-driven, interactive resize of the surface.
940 *
941 * This request must be used in response to some sort of user
942 * action like a button press, key press, or touch down event. The
943 * passed serial is used to determine the type of interactive
944 * resize (touch, pointer, etc).
945 *
946 * The server may ignore resize requests depending on the state of
947 * the surface (e.g. fullscreen or maximized).
948 *
949 * If triggered, the client will receive configure events with the
950 * "resize" state enum value and the expected sizes. See the
951 * "resize" enum value for more details about what is required. The
952 * client must also acknowledge configure events using
953 * "ack_configure". After the resize is completed, the client will
954 * receive another "configure" event without the resize state.
955 *
956 * If triggered, the surface also will lose the focus of the device
957 * (wl_pointer, wl_touch, etc) used for the resize. It is up to the
958 * compositor to visually indicate that the resize is taking place,
959 * such as updating a pointer cursor, during the resize. There is
960 * no guarantee that the device focus will return when the resize
961 * is completed.
962 *
963 * The edges parameter specifies how the surface should be resized,
964 * and is one of the values of the resize_edge enum. The compositor
965 * may use this information to update the surface position for
966 * example when dragging the top left corner. The compositor may
967 * also use this information to adapt its behavior, e.g. choose an
968 * appropriate cursor image.
969 * @param seat the wl_seat of the user event
970 * @param serial the serial of the user event
971 * @param edges which edge or corner is being dragged
972 */
973 void (*resize)(struct wl_client *client,
974 struct wl_resource *resource,
975 struct wl_resource *seat,
976 uint32_t serial,
977 uint32_t edges);
978 /**
979 * set the maximum size
980 *
981 * Set a maximum size for the window.
982 *
983 * The client can specify a maximum size so that the compositor
984 * does not try to configure the window beyond this size.
985 *
986 * The width and height arguments are in window geometry
987 * coordinates. See xdg_surface.set_window_geometry.
988 *
989 * Values set in this way are double-buffered. They will get
990 * applied on the next commit.
991 *
992 * The compositor can use this information to allow or disallow
993 * different states like maximize or fullscreen and draw accurate
994 * animations.
995 *
996 * Similarly, a tiling window manager may use this information to
997 * place and resize client windows in a more effective way.
998 *
999 * The client should not rely on the compositor to obey the maximum
1000 * size. The compositor may decide to ignore the values set by the
1001 * client and request a larger size.
1002 *
1003 * If never set, or a value of zero in the request, means that the
1004 * client has no expected maximum size in the given dimension. As a
1005 * result, a client wishing to reset the maximum size to an
1006 * unspecified state can use zero for width and height in the
1007 * request.
1008 *
1009 * Requesting a maximum size to be smaller than the minimum size of
1010 * a surface is illegal and will result in a protocol error.
1011 *
1012 * The width and height must be greater than or equal to zero.
1013 * Using strictly negative values for width and height will result
1014 * in a protocol error.
1015 */
1016 void (*set_max_size)(struct wl_client *client,
1017 struct wl_resource *resource,
1018 int32_t width,
1019 int32_t height);
1020 /**
1021 * set the minimum size
1022 *
1023 * Set a minimum size for the window.
1024 *
1025 * The client can specify a minimum size so that the compositor
1026 * does not try to configure the window below this size.
1027 *
1028 * The width and height arguments are in window geometry
1029 * coordinates. See xdg_surface.set_window_geometry.
1030 *
1031 * Values set in this way are double-buffered. They will get
1032 * applied on the next commit.
1033 *
1034 * The compositor can use this information to allow or disallow
1035 * different states like maximize or fullscreen and draw accurate
1036 * animations.
1037 *
1038 * Similarly, a tiling window manager may use this information to
1039 * place and resize client windows in a more effective way.
1040 *
1041 * The client should not rely on the compositor to obey the minimum
1042 * size. The compositor may decide to ignore the values set by the
1043 * client and request a smaller size.
1044 *
1045 * If never set, or a value of zero in the request, means that the
1046 * client has no expected minimum size in the given dimension. As a
1047 * result, a client wishing to reset the minimum size to an
1048 * unspecified state can use zero for width and height in the
1049 * request.
1050 *
1051 * Requesting a minimum size to be larger than the maximum size of
1052 * a surface is illegal and will result in a protocol error.
1053 *
1054 * The width and height must be greater than or equal to zero.
1055 * Using strictly negative values for width and height will result
1056 * in a protocol error.
1057 */
1058 void (*set_min_size)(struct wl_client *client,
1059 struct wl_resource *resource,
1060 int32_t width,
1061 int32_t height);
1062 /**
1063 * maximize the window
1064 *
1065 * Maximize the surface.
1066 *
1067 * After requesting that the surface should be maximized, the
1068 * compositor will respond by emitting a configure event with the
1069 * "maximized" state and the required window geometry. The client
1070 * should then update its content, drawing it in a maximized state,
1071 * i.e. without shadow or other decoration outside of the window
1072 * geometry. The client must also acknowledge the configure when
1073 * committing the new content (see ack_configure).
1074 *
1075 * It is up to the compositor to decide how and where to maximize
1076 * the surface, for example which output and what region of the
1077 * screen should be used.
1078 *
1079 * If the surface was already maximized, the compositor will still
1080 * emit a configure event with the "maximized" state.
1081 */
1082 void (*set_maximized)(struct wl_client *client,
1083 struct wl_resource *resource);
1084 /**
1085 * unmaximize the window
1086 *
1087 * Unmaximize the surface.
1088 *
1089 * After requesting that the surface should be unmaximized, the
1090 * compositor will respond by emitting a configure event without
1091 * the "maximized" state. If available, the compositor will include
1092 * the window geometry dimensions the window had prior to being
1093 * maximized in the configure request. The client must then update
1094 * its content, drawing it in a regular state, i.e. potentially
1095 * with shadow, etc. The client must also acknowledge the configure
1096 * when committing the new content (see ack_configure).
1097 *
1098 * It is up to the compositor to position the surface after it was
1099 * unmaximized; usually the position the surface had before
1100 * maximizing, if applicable.
1101 *
1102 * If the surface was already not maximized, the compositor will
1103 * still emit a configure event without the "maximized" state.
1104 */
1105 void (*unset_maximized)(struct wl_client *client,
1106 struct wl_resource *resource);
1107 /**
1108 * set the window as fullscreen on a monitor
1109 *
1110 * Make the surface fullscreen.
1111 *
1112 * You can specify an output that you would prefer to be
1113 * fullscreen. If this value is NULL, it's up to the compositor to
1114 * choose which display will be used to map this surface.
1115 *
1116 * If the surface doesn't cover the whole output, the compositor
1117 * will position the surface in the center of the output and
1118 * compensate with black borders filling the rest of the output.
1119 */
1120 void (*set_fullscreen)(struct wl_client *client,
1121 struct wl_resource *resource,
1122 struct wl_resource *output);
1123 /**
1124 */
1125 void (*unset_fullscreen)(struct wl_client *client,
1126 struct wl_resource *resource);
1127 /**
1128 * set the window as minimized
1129 *
1130 * Request that the compositor minimize your surface. There is no
1131 * way to know if the surface is currently minimized, nor is there
1132 * any way to unset minimization on this surface.
1133 *
1134 * If you are looking to throttle redrawing when minimized, please
1135 * instead use the wl_surface.frame event for this, as this will
1136 * also work with live previews on windows in Alt-Tab, Expose or
1137 * similar compositor features.
1138 */
1139 void (*set_minimized)(struct wl_client *client,
1140 struct wl_resource *resource);
1141 };
1142
1143 #define ZXDG_TOPLEVEL_V6_CONFIGURE 0
1144 #define ZXDG_TOPLEVEL_V6_CLOSE 1
1145
1146 /**
1147 * @ingroup iface_zxdg_toplevel_v6
1148 */
1149 #define ZXDG_TOPLEVEL_V6_CONFIGURE_SINCE_VERSION 1
1150 /**
1151 * @ingroup iface_zxdg_toplevel_v6
1152 */
1153 #define ZXDG_TOPLEVEL_V6_CLOSE_SINCE_VERSION 1
1154
1155 /**
1156 * @ingroup iface_zxdg_toplevel_v6
1157 * Sends an configure event to the client owning the resource.
1158 * @param resource_ The client's resource
1159 */
1160 static inline void
1161 zxdg_toplevel_v6_send_configure(struct wl_resource *resource_, int32_t width, in t32_t height, struct wl_array *states)
1162 {
1163 wl_resource_post_event(resource_, ZXDG_TOPLEVEL_V6_CONFIGURE, width, hei ght, states);
1164 }
1165
1166 /**
1167 * @ingroup iface_zxdg_toplevel_v6
1168 * Sends an close event to the client owning the resource.
1169 * @param resource_ The client's resource
1170 */
1171 static inline void
1172 zxdg_toplevel_v6_send_close(struct wl_resource *resource_)
1173 {
1174 wl_resource_post_event(resource_, ZXDG_TOPLEVEL_V6_CLOSE);
1175 }
1176
1177 #ifndef ZXDG_POPUP_V6_ERROR_ENUM
1178 #define ZXDG_POPUP_V6_ERROR_ENUM
1179 enum zxdg_popup_v6_error {
1180 /**
1181 * tried to grab after being mapped
1182 */
1183 ZXDG_POPUP_V6_ERROR_INVALID_GRAB = 0,
1184 };
1185 #endif /* ZXDG_POPUP_V6_ERROR_ENUM */
1186
1187 /**
1188 * @ingroup iface_zxdg_popup_v6
1189 * @struct zxdg_popup_v6_interface
1190 */
1191 struct zxdg_popup_v6_interface {
1192 /**
1193 * remove xdg_popup interface
1194 *
1195 * This destroys the popup. Explicitly destroying the xdg_popup
1196 * object will also dismiss the popup, and unmap the surface.
1197 *
1198 * If this xdg_popup is not the "topmost" popup, a protocol error
1199 * will be sent.
1200 */
1201 void (*destroy)(struct wl_client *client,
1202 struct wl_resource *resource);
1203 /**
1204 * make the popup take an explicit grab
1205 *
1206 * This request makes the created popup take an explicit grab. An
1207 * explicit grab will be dismissed when the user dismisses the
1208 * popup, or when the client destroys the xdg_popup. This can be
1209 * done by the user clicking outside the surface, using the
1210 * keyboard, or even locking the screen through closing the lid or
1211 * a timeout.
1212 *
1213 * If the compositor denies the grab, the popup will be immediately
1214 * dismissed.
1215 *
1216 * This request must be used in response to some sort of user
1217 * action like a button press, key press, or touch down event. The
1218 * serial number of the event should be passed as 'serial'.
1219 *
1220 * The parent of a grabbing popup must either be an xdg_toplevel
1221 * surface or another xdg_popup with an explicit grab. If the
1222 * parent is another xdg_popup it means that the popups are nested,
1223 * with this popup now being the topmost popup.
1224 *
1225 * Nested popups must be destroyed in the reverse order they were
1226 * created in, e.g. the only popup you are allowed to destroy at
1227 * all times is the topmost one.
1228 *
1229 * When compositors choose to dismiss a popup, they may dismiss
1230 * every nested grabbing popup as well. When a compositor dismisses
1231 * popups, it will follow the same dismissing order as required
1232 * from the client.
1233 *
1234 * The parent of a grabbing popup must either be another xdg_popup
1235 * with an active explicit grab, or an xdg_popup or xdg_toplevel,
1236 * if there are no explicit grabs already taken.
1237 *
1238 * If the topmost grabbing popup is destroyed, the grab will be
1239 * returned to the parent of the popup, if that parent previously
1240 * had an explicit grab.
1241 *
1242 * If the parent is a grabbing popup which has already been
1243 * dismissed, this popup will be immediately dismissed. If the
1244 * parent is a popup that did not take an explicit grab, an error
1245 * will be raised.
1246 *
1247 * During a popup grab, the client owning the grab will receive
1248 * pointer and touch events for all their surfaces as normal
1249 * (similar to an "owner-events" grab in X11 parlance), while the
1250 * top most grabbing popup will always have keyboard focus.
1251 * @param seat the wl_seat of the user event
1252 * @param serial the serial of the user event
1253 */
1254 void (*grab)(struct wl_client *client,
1255 struct wl_resource *resource,
1256 struct wl_resource *seat,
1257 uint32_t serial);
1258 };
1259
1260 #define ZXDG_POPUP_V6_CONFIGURE 0
1261 #define ZXDG_POPUP_V6_POPUP_DONE 1
1262
1263 /**
1264 * @ingroup iface_zxdg_popup_v6
1265 */
1266 #define ZXDG_POPUP_V6_CONFIGURE_SINCE_VERSION 1
1267 /**
1268 * @ingroup iface_zxdg_popup_v6
1269 */
1270 #define ZXDG_POPUP_V6_POPUP_DONE_SINCE_VERSION 1
1271
1272 /**
1273 * @ingroup iface_zxdg_popup_v6
1274 * Sends an configure event to the client owning the resource.
1275 * @param resource_ The client's resource
1276 * @param x x position relative to parent surface window geometry
1277 * @param y y position relative to parent surface window geometry
1278 * @param width window geometry width
1279 * @param height window geometry height
1280 */
1281 static inline void
1282 zxdg_popup_v6_send_configure(struct wl_resource *resource_, int32_t x, int32_t y , int32_t width, int32_t height)
1283 {
1284 wl_resource_post_event(resource_, ZXDG_POPUP_V6_CONFIGURE, x, y, width, height);
1285 }
1286
1287 /**
1288 * @ingroup iface_zxdg_popup_v6
1289 * Sends an popup_done event to the client owning the resource.
1290 * @param resource_ The client's resource
1291 */
1292 static inline void
1293 zxdg_popup_v6_send_popup_done(struct wl_resource *resource_)
1294 {
1295 wl_resource_post_event(resource_, ZXDG_POPUP_V6_POPUP_DONE);
1296 }
1297
1298 #ifdef __cplusplus
1299 }
1300 #endif
1301
1302 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698