| OLD | NEW |
| (Empty) | |
| 1 /* Generated by wayland-scanner 1.11.0 */ |
| 2 |
| 3 #ifndef XDG_SHELL_UNSTABLE_V6_CLIENT_PROTOCOL_H |
| 4 #define XDG_SHELL_UNSTABLE_V6_CLIENT_PROTOCOL_H |
| 5 |
| 6 #include <stdint.h> |
| 7 #include <stddef.h> |
| 8 #include "wayland-client.h" |
| 9 |
| 10 #ifdef __cplusplus |
| 11 extern "C" { |
| 12 #endif |
| 13 |
| 14 /** |
| 15 * @page page_xdg_shell_unstable_v6 The xdg_shell_unstable_v6 protocol |
| 16 * @section page_ifaces_xdg_shell_unstable_v6 Interfaces |
| 17 * - @subpage page_iface_zxdg_shell_v6 - create desktop-style surfaces |
| 18 * - @subpage page_iface_zxdg_positioner_v6 - child surface positioner |
| 19 * - @subpage page_iface_zxdg_surface_v6 - desktop user interface surface base i
nterface |
| 20 * - @subpage page_iface_zxdg_toplevel_v6 - toplevel surface |
| 21 * - @subpage page_iface_zxdg_popup_v6 - short-lived, popup surfaces for menus |
| 22 * @section page_copyright_xdg_shell_unstable_v6 Copyright |
| 23 * <pre> |
| 24 * |
| 25 * Copyright © 2008-2013 Kristian Høgsberg |
| 26 * Copyright © 2013 Rafael Antognolli |
| 27 * Copyright © 2013 Jasper St. Pierre |
| 28 * Copyright © 2010-2013 Intel Corporation |
| 29 * |
| 30 * Permission is hereby granted, free of charge, to any person obtaining a |
| 31 * copy of this software and associated documentation files (the "Software"), |
| 32 * to deal in the Software without restriction, including without limitation |
| 33 * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 34 * and/or sell copies of the Software, and to permit persons to whom the |
| 35 * Software is furnished to do so, subject to the following conditions: |
| 36 * |
| 37 * The above copyright notice and this permission notice (including the next |
| 38 * paragraph) shall be included in all copies or substantial portions of the |
| 39 * Software. |
| 40 * |
| 41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 42 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 43 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 44 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 45 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 46 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 47 * DEALINGS IN THE SOFTWARE. |
| 48 * </pre> |
| 49 */ |
| 50 struct wl_output; |
| 51 struct wl_seat; |
| 52 struct wl_surface; |
| 53 struct zxdg_popup_v6; |
| 54 struct zxdg_positioner_v6; |
| 55 struct zxdg_shell_v6; |
| 56 struct zxdg_surface_v6; |
| 57 struct zxdg_toplevel_v6; |
| 58 |
| 59 /** |
| 60 * @page page_iface_zxdg_shell_v6 zxdg_shell_v6 |
| 61 * @section page_iface_zxdg_shell_v6_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_zxdg_shell_v6_api API |
| 68 * See @ref iface_zxdg_shell_v6. |
| 69 */ |
| 70 /** |
| 71 * @defgroup iface_zxdg_shell_v6 The zxdg_shell_v6 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 zxdg_shell_v6_interface; |
| 79 /** |
| 80 * @page page_iface_zxdg_positioner_v6 zxdg_positioner_v6 |
| 81 * @section page_iface_zxdg_positioner_v6_desc Description |
| 82 * |
| 83 * The xdg_positioner provides a collection of rules for the placement of a |
| 84 * child surface relative to a parent surface. Rules can be defined to ensure |
| 85 * the child surface remains within the visible area's borders, and to |
| 86 * specify how the child surface changes its position, such as sliding along |
| 87 * an axis, or flipping around a rectangle. |
| 88 * |
| 89 * See the various requests for details about possible rules. |
| 90 * |
| 91 * At the time of the request, the compositor makes a copy of the rules |
| 92 * specified by the xdg_positioner. Thus, after the request is complete the |
| 93 * xdg_positioner object can be destroyed or reused; further changes to the |
| 94 * object will have no effect on previous usages. |
| 95 * |
| 96 * For an xdg_positioner object to be considered complete, it must have a |
| 97 * non-zero size set by set_size, and a non-zero anchor rectangle set by |
| 98 * set_anchor_rect. Passing an incomplete xdg_positioner object when |
| 99 * positioning a surface raises an error. |
| 100 * @section page_iface_zxdg_positioner_v6_api API |
| 101 * See @ref iface_zxdg_positioner_v6. |
| 102 */ |
| 103 /** |
| 104 * @defgroup iface_zxdg_positioner_v6 The zxdg_positioner_v6 interface |
| 105 * |
| 106 * The xdg_positioner provides a collection of rules for the placement of a |
| 107 * child surface relative to a parent surface. Rules can be defined to ensure |
| 108 * the child surface remains within the visible area's borders, and to |
| 109 * specify how the child surface changes its position, such as sliding along |
| 110 * an axis, or flipping around a rectangle. |
| 111 * |
| 112 * See the various requests for details about possible rules. |
| 113 * |
| 114 * At the time of the request, the compositor makes a copy of the rules |
| 115 * specified by the xdg_positioner. Thus, after the request is complete the |
| 116 * xdg_positioner object can be destroyed or reused; further changes to the |
| 117 * object will have no effect on previous usages. |
| 118 * |
| 119 * For an xdg_positioner object to be considered complete, it must have a |
| 120 * non-zero size set by set_size, and a non-zero anchor rectangle set by |
| 121 * set_anchor_rect. Passing an incomplete xdg_positioner object when |
| 122 * positioning a surface raises an error. |
| 123 */ |
| 124 extern const struct wl_interface zxdg_positioner_v6_interface; |
| 125 /** |
| 126 * @page page_iface_zxdg_surface_v6 zxdg_surface_v6 |
| 127 * @section page_iface_zxdg_surface_v6_desc Description |
| 128 * |
| 129 * An interface that may be implemented by a wl_surface, for |
| 130 * implementations that provide a desktop-style user interface. |
| 131 * |
| 132 * It provides a base set of functionality required to construct user |
| 133 * interface elements requiring management by the compositor, such as |
| 134 * toplevel windows, menus, etc. The types of functionality are split into |
| 135 * xdg_surface roles. |
| 136 * |
| 137 * Creating an xdg_surface does not set the role for a wl_surface. In order |
| 138 * to map an xdg_surface, the client must create a role-specific object |
| 139 * using, e.g., get_toplevel, get_popup. The wl_surface for any given |
| 140 * xdg_surface can have at most one role, and may not be assigned any role |
| 141 * not based on xdg_surface. |
| 142 * |
| 143 * A role must be assigned before any other requests are made to the |
| 144 * xdg_surface object. |
| 145 * |
| 146 * The client must call wl_surface.commit on the corresponding wl_surface |
| 147 * for the xdg_surface state to take effect. |
| 148 * |
| 149 * Creating an xdg_surface from a wl_surface which has a buffer attached or |
| 150 * committed is a client error, and any attempts by a client to attach or |
| 151 * manipulate a buffer prior to the first xdg_surface.configure call must |
| 152 * also be treated as errors. |
| 153 * |
| 154 * For a surface to be mapped by the compositor, the following conditions |
| 155 * must be met: (1) the client has assigned a xdg_surface based role to the |
| 156 * surface, (2) the client has set and committed the xdg_surface state and |
| 157 * the role dependent state to the surface and (3) the client has committed a |
| 158 * buffer to the surface. |
| 159 * @section page_iface_zxdg_surface_v6_api API |
| 160 * See @ref iface_zxdg_surface_v6. |
| 161 */ |
| 162 /** |
| 163 * @defgroup iface_zxdg_surface_v6 The zxdg_surface_v6 interface |
| 164 * |
| 165 * An interface that may be implemented by a wl_surface, for |
| 166 * implementations that provide a desktop-style user interface. |
| 167 * |
| 168 * It provides a base set of functionality required to construct user |
| 169 * interface elements requiring management by the compositor, such as |
| 170 * toplevel windows, menus, etc. The types of functionality are split into |
| 171 * xdg_surface roles. |
| 172 * |
| 173 * Creating an xdg_surface does not set the role for a wl_surface. In order |
| 174 * to map an xdg_surface, the client must create a role-specific object |
| 175 * using, e.g., get_toplevel, get_popup. The wl_surface for any given |
| 176 * xdg_surface can have at most one role, and may not be assigned any role |
| 177 * not based on xdg_surface. |
| 178 * |
| 179 * A role must be assigned before any other requests are made to the |
| 180 * xdg_surface object. |
| 181 * |
| 182 * The client must call wl_surface.commit on the corresponding wl_surface |
| 183 * for the xdg_surface state to take effect. |
| 184 * |
| 185 * Creating an xdg_surface from a wl_surface which has a buffer attached or |
| 186 * committed is a client error, and any attempts by a client to attach or |
| 187 * manipulate a buffer prior to the first xdg_surface.configure call must |
| 188 * also be treated as errors. |
| 189 * |
| 190 * For a surface to be mapped by the compositor, the following conditions |
| 191 * must be met: (1) the client has assigned a xdg_surface based role to the |
| 192 * surface, (2) the client has set and committed the xdg_surface state and |
| 193 * the role dependent state to the surface and (3) the client has committed a |
| 194 * buffer to the surface. |
| 195 */ |
| 196 extern const struct wl_interface zxdg_surface_v6_interface; |
| 197 /** |
| 198 * @page page_iface_zxdg_toplevel_v6 zxdg_toplevel_v6 |
| 199 * @section page_iface_zxdg_toplevel_v6_desc Description |
| 200 * |
| 201 * This interface defines an xdg_surface role which allows a surface to, |
| 202 * among other things, set window-like properties such as maximize, |
| 203 * fullscreen, and minimize, set application-specific metadata like title and |
| 204 * id, and well as trigger user interactive operations such as interactive |
| 205 * resize and move. |
| 206 * @section page_iface_zxdg_toplevel_v6_api API |
| 207 * See @ref iface_zxdg_toplevel_v6. |
| 208 */ |
| 209 /** |
| 210 * @defgroup iface_zxdg_toplevel_v6 The zxdg_toplevel_v6 interface |
| 211 * |
| 212 * This interface defines an xdg_surface role which allows a surface to, |
| 213 * among other things, set window-like properties such as maximize, |
| 214 * fullscreen, and minimize, set application-specific metadata like title and |
| 215 * id, and well as trigger user interactive operations such as interactive |
| 216 * resize and move. |
| 217 */ |
| 218 extern const struct wl_interface zxdg_toplevel_v6_interface; |
| 219 /** |
| 220 * @page page_iface_zxdg_popup_v6 zxdg_popup_v6 |
| 221 * @section page_iface_zxdg_popup_v6_desc Description |
| 222 * |
| 223 * A popup surface is a short-lived, temporary surface. It can be used to |
| 224 * implement for example menus, popovers, tooltips and other similar user |
| 225 * interface concepts. |
| 226 * |
| 227 * A popup can be made to take an explicit grab. See xdg_popup.grab for |
| 228 * details. |
| 229 * |
| 230 * When the popup is dismissed, a popup_done event will be sent out, and at |
| 231 * the same time the surface will be unmapped. See the xdg_popup.popup_done |
| 232 * event for details. |
| 233 * |
| 234 * Explicitly destroying the xdg_popup object will also dismiss the popup and |
| 235 * unmap the surface. Clients that want to dismiss the popup when another |
| 236 * surface of their own is clicked should dismiss the popup using the destroy |
| 237 * request. |
| 238 * |
| 239 * The parent surface must have either the xdg_toplevel or xdg_popup surface |
| 240 * role. |
| 241 * |
| 242 * A newly created xdg_popup will be stacked on top of all previously created |
| 243 * xdg_popup surfaces associated with the same xdg_toplevel. |
| 244 * |
| 245 * The parent of an xdg_popup must be mapped (see the xdg_surface |
| 246 * description) before the xdg_popup itself. |
| 247 * |
| 248 * The x and y arguments passed when creating the popup object specify |
| 249 * where the top left of the popup should be placed, relative to the |
| 250 * local surface coordinates of the parent surface. See |
| 251 * xdg_surface.get_popup. |
| 252 * |
| 253 * The client must call wl_surface.commit on the corresponding wl_surface |
| 254 * for the xdg_popup state to take effect. |
| 255 * @section page_iface_zxdg_popup_v6_api API |
| 256 * See @ref iface_zxdg_popup_v6. |
| 257 */ |
| 258 /** |
| 259 * @defgroup iface_zxdg_popup_v6 The zxdg_popup_v6 interface |
| 260 * |
| 261 * A popup surface is a short-lived, temporary surface. It can be used to |
| 262 * implement for example menus, popovers, tooltips and other similar user |
| 263 * interface concepts. |
| 264 * |
| 265 * A popup can be made to take an explicit grab. See xdg_popup.grab for |
| 266 * details. |
| 267 * |
| 268 * When the popup is dismissed, a popup_done event will be sent out, and at |
| 269 * the same time the surface will be unmapped. See the xdg_popup.popup_done |
| 270 * event for details. |
| 271 * |
| 272 * Explicitly destroying the xdg_popup object will also dismiss the popup and |
| 273 * unmap the surface. Clients that want to dismiss the popup when another |
| 274 * surface of their own is clicked should dismiss the popup using the destroy |
| 275 * request. |
| 276 * |
| 277 * The parent surface must have either the xdg_toplevel or xdg_popup surface |
| 278 * role. |
| 279 * |
| 280 * A newly created xdg_popup will be stacked on top of all previously created |
| 281 * xdg_popup surfaces associated with the same xdg_toplevel. |
| 282 * |
| 283 * The parent of an xdg_popup must be mapped (see the xdg_surface |
| 284 * description) before the xdg_popup itself. |
| 285 * |
| 286 * The x and y arguments passed when creating the popup object specify |
| 287 * where the top left of the popup should be placed, relative to the |
| 288 * local surface coordinates of the parent surface. See |
| 289 * xdg_surface.get_popup. |
| 290 * |
| 291 * The client must call wl_surface.commit on the corresponding wl_surface |
| 292 * for the xdg_popup state to take effect. |
| 293 */ |
| 294 extern const struct wl_interface zxdg_popup_v6_interface; |
| 295 |
| 296 #ifndef ZXDG_SHELL_V6_ERROR_ENUM |
| 297 #define ZXDG_SHELL_V6_ERROR_ENUM |
| 298 enum zxdg_shell_v6_error { |
| 299 /** |
| 300 * given wl_surface has another role |
| 301 */ |
| 302 ZXDG_SHELL_V6_ERROR_ROLE = 0, |
| 303 /** |
| 304 * xdg_shell was destroyed before children |
| 305 */ |
| 306 ZXDG_SHELL_V6_ERROR_DEFUNCT_SURFACES = 1, |
| 307 /** |
| 308 * the client tried to map or destroy a non-topmost popup |
| 309 */ |
| 310 ZXDG_SHELL_V6_ERROR_NOT_THE_TOPMOST_POPUP = 2, |
| 311 /** |
| 312 * the client specified an invalid popup parent surface |
| 313 */ |
| 314 ZXDG_SHELL_V6_ERROR_INVALID_POPUP_PARENT = 3, |
| 315 /** |
| 316 * the client provided an invalid surface state |
| 317 */ |
| 318 ZXDG_SHELL_V6_ERROR_INVALID_SURFACE_STATE = 4, |
| 319 /** |
| 320 * the client provided an invalid positioner |
| 321 */ |
| 322 ZXDG_SHELL_V6_ERROR_INVALID_POSITIONER = 5, |
| 323 }; |
| 324 #endif /* ZXDG_SHELL_V6_ERROR_ENUM */ |
| 325 |
| 326 /** |
| 327 * @ingroup iface_zxdg_shell_v6 |
| 328 * @struct zxdg_shell_v6_listener |
| 329 */ |
| 330 struct zxdg_shell_v6_listener { |
| 331 /** |
| 332 * check if the client is alive |
| 333 * |
| 334 * The ping event asks the client if it's still alive. Pass the |
| 335 * serial specified in the event back to the compositor by sending |
| 336 * a "pong" request back with the specified serial. See |
| 337 * xdg_shell.ping. |
| 338 * |
| 339 * Compositors can use this to determine if the client is still |
| 340 * alive. It's unspecified what will happen if the client doesn't |
| 341 * respond to the ping request, or in what timeframe. Clients |
| 342 * should try to respond in a reasonable amount of time. |
| 343 * |
| 344 * A compositor is free to ping in any way it wants, but a client |
| 345 * must always respond to any xdg_shell object it created. |
| 346 * @param serial pass this to the pong request |
| 347 */ |
| 348 void (*ping)(void *data, |
| 349 struct zxdg_shell_v6 *zxdg_shell_v6, |
| 350 uint32_t serial); |
| 351 }; |
| 352 |
| 353 /** |
| 354 * @ingroup zxdg_shell_v6_iface |
| 355 */ |
| 356 static inline int |
| 357 zxdg_shell_v6_add_listener(struct zxdg_shell_v6 *zxdg_shell_v6, |
| 358 const struct zxdg_shell_v6_listener *listener, void *
data) |
| 359 { |
| 360 return wl_proxy_add_listener((struct wl_proxy *) zxdg_shell_v6, |
| 361 (void (**)(void)) listener, data); |
| 362 } |
| 363 |
| 364 #define ZXDG_SHELL_V6_DESTROY 0 |
| 365 #define ZXDG_SHELL_V6_CREATE_POSITIONER 1 |
| 366 #define ZXDG_SHELL_V6_GET_XDG_SURFACE 2 |
| 367 #define ZXDG_SHELL_V6_PONG 3 |
| 368 |
| 369 /** |
| 370 * @ingroup iface_zxdg_shell_v6 |
| 371 */ |
| 372 #define ZXDG_SHELL_V6_DESTROY_SINCE_VERSION 1 |
| 373 /** |
| 374 * @ingroup iface_zxdg_shell_v6 |
| 375 */ |
| 376 #define ZXDG_SHELL_V6_CREATE_POSITIONER_SINCE_VERSION 1 |
| 377 /** |
| 378 * @ingroup iface_zxdg_shell_v6 |
| 379 */ |
| 380 #define ZXDG_SHELL_V6_GET_XDG_SURFACE_SINCE_VERSION 1 |
| 381 /** |
| 382 * @ingroup iface_zxdg_shell_v6 |
| 383 */ |
| 384 #define ZXDG_SHELL_V6_PONG_SINCE_VERSION 1 |
| 385 |
| 386 /** @ingroup iface_zxdg_shell_v6 */ |
| 387 static inline void |
| 388 zxdg_shell_v6_set_user_data(struct zxdg_shell_v6 *zxdg_shell_v6, void *user_data
) |
| 389 { |
| 390 wl_proxy_set_user_data((struct wl_proxy *) zxdg_shell_v6, user_data); |
| 391 } |
| 392 |
| 393 /** @ingroup iface_zxdg_shell_v6 */ |
| 394 static inline void * |
| 395 zxdg_shell_v6_get_user_data(struct zxdg_shell_v6 *zxdg_shell_v6) |
| 396 { |
| 397 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_shell_v6); |
| 398 } |
| 399 |
| 400 static inline uint32_t |
| 401 zxdg_shell_v6_get_version(struct zxdg_shell_v6 *zxdg_shell_v6) |
| 402 { |
| 403 return wl_proxy_get_version((struct wl_proxy *) zxdg_shell_v6); |
| 404 } |
| 405 |
| 406 /** |
| 407 * @ingroup iface_zxdg_shell_v6 |
| 408 * |
| 409 * Destroy this xdg_shell object. |
| 410 * |
| 411 * Destroying a bound xdg_shell object while there are surfaces |
| 412 * still alive created by this xdg_shell object instance is illegal |
| 413 * and will result in a protocol error. |
| 414 */ |
| 415 static inline void |
| 416 zxdg_shell_v6_destroy(struct zxdg_shell_v6 *zxdg_shell_v6) |
| 417 { |
| 418 wl_proxy_marshal((struct wl_proxy *) zxdg_shell_v6, |
| 419 ZXDG_SHELL_V6_DESTROY); |
| 420 |
| 421 wl_proxy_destroy((struct wl_proxy *) zxdg_shell_v6); |
| 422 } |
| 423 |
| 424 /** |
| 425 * @ingroup iface_zxdg_shell_v6 |
| 426 * |
| 427 * Create a positioner object. A positioner object is used to position |
| 428 * surfaces relative to some parent surface. See the interface description |
| 429 * and xdg_surface.get_popup for details. |
| 430 */ |
| 431 static inline struct zxdg_positioner_v6 * |
| 432 zxdg_shell_v6_create_positioner(struct zxdg_shell_v6 *zxdg_shell_v6) |
| 433 { |
| 434 struct wl_proxy *id; |
| 435 |
| 436 id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_shell_v6, |
| 437 ZXDG_SHELL_V6_CREATE_POSITIONER, &zxdg_positioner_v6_in
terface, NULL); |
| 438 |
| 439 return (struct zxdg_positioner_v6 *) id; |
| 440 } |
| 441 |
| 442 /** |
| 443 * @ingroup iface_zxdg_shell_v6 |
| 444 * |
| 445 * This creates an xdg_surface for the given surface. While xdg_surface |
| 446 * itself is not a role, the corresponding surface may only be assigned |
| 447 * a role extending xdg_surface, such as xdg_toplevel or xdg_popup. |
| 448 * |
| 449 * This creates an xdg_surface for the given surface. An xdg_surface is |
| 450 * used as basis to define a role to a given surface, such as xdg_toplevel |
| 451 * or xdg_popup. It also manages functionality shared between xdg_surface |
| 452 * based surface roles. |
| 453 * |
| 454 * See the documentation of xdg_surface for more details about what an |
| 455 * xdg_surface is and how it is used. |
| 456 */ |
| 457 static inline struct zxdg_surface_v6 * |
| 458 zxdg_shell_v6_get_xdg_surface(struct zxdg_shell_v6 *zxdg_shell_v6, struct wl_sur
face *surface) |
| 459 { |
| 460 struct wl_proxy *id; |
| 461 |
| 462 id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_shell_v6, |
| 463 ZXDG_SHELL_V6_GET_XDG_SURFACE, &zxdg_surface_v6_interfa
ce, NULL, surface); |
| 464 |
| 465 return (struct zxdg_surface_v6 *) id; |
| 466 } |
| 467 |
| 468 /** |
| 469 * @ingroup iface_zxdg_shell_v6 |
| 470 * |
| 471 * A client must respond to a ping event with a pong request or |
| 472 * the client may be deemed unresponsive. See xdg_shell.ping. |
| 473 */ |
| 474 static inline void |
| 475 zxdg_shell_v6_pong(struct zxdg_shell_v6 *zxdg_shell_v6, uint32_t serial) |
| 476 { |
| 477 wl_proxy_marshal((struct wl_proxy *) zxdg_shell_v6, |
| 478 ZXDG_SHELL_V6_PONG, serial); |
| 479 } |
| 480 |
| 481 #ifndef ZXDG_POSITIONER_V6_ERROR_ENUM |
| 482 #define ZXDG_POSITIONER_V6_ERROR_ENUM |
| 483 enum zxdg_positioner_v6_error { |
| 484 /** |
| 485 * invalid input provided |
| 486 */ |
| 487 ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT = 0, |
| 488 }; |
| 489 #endif /* ZXDG_POSITIONER_V6_ERROR_ENUM */ |
| 490 |
| 491 #ifndef ZXDG_POSITIONER_V6_ANCHOR_ENUM |
| 492 #define ZXDG_POSITIONER_V6_ANCHOR_ENUM |
| 493 enum zxdg_positioner_v6_anchor { |
| 494 /** |
| 495 * the center of the anchor rectangle |
| 496 */ |
| 497 ZXDG_POSITIONER_V6_ANCHOR_NONE = 0, |
| 498 /** |
| 499 * the top edge of the anchor rectangle |
| 500 */ |
| 501 ZXDG_POSITIONER_V6_ANCHOR_TOP = 1, |
| 502 /** |
| 503 * the bottom edge of the anchor rectangle |
| 504 */ |
| 505 ZXDG_POSITIONER_V6_ANCHOR_BOTTOM = 2, |
| 506 /** |
| 507 * the left edge of the anchor rectangle |
| 508 */ |
| 509 ZXDG_POSITIONER_V6_ANCHOR_LEFT = 4, |
| 510 /** |
| 511 * the right edge of the anchor rectangle |
| 512 */ |
| 513 ZXDG_POSITIONER_V6_ANCHOR_RIGHT = 8, |
| 514 }; |
| 515 #endif /* ZXDG_POSITIONER_V6_ANCHOR_ENUM */ |
| 516 |
| 517 #ifndef ZXDG_POSITIONER_V6_GRAVITY_ENUM |
| 518 #define ZXDG_POSITIONER_V6_GRAVITY_ENUM |
| 519 enum zxdg_positioner_v6_gravity { |
| 520 /** |
| 521 * center over the anchor edge |
| 522 */ |
| 523 ZXDG_POSITIONER_V6_GRAVITY_NONE = 0, |
| 524 /** |
| 525 * position above the anchor edge |
| 526 */ |
| 527 ZXDG_POSITIONER_V6_GRAVITY_TOP = 1, |
| 528 /** |
| 529 * position below the anchor edge |
| 530 */ |
| 531 ZXDG_POSITIONER_V6_GRAVITY_BOTTOM = 2, |
| 532 /** |
| 533 * position to the left of the anchor edge |
| 534 */ |
| 535 ZXDG_POSITIONER_V6_GRAVITY_LEFT = 4, |
| 536 /** |
| 537 * position to the right of the anchor edge |
| 538 */ |
| 539 ZXDG_POSITIONER_V6_GRAVITY_RIGHT = 8, |
| 540 }; |
| 541 #endif /* ZXDG_POSITIONER_V6_GRAVITY_ENUM */ |
| 542 |
| 543 #ifndef ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM |
| 544 #define ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM |
| 545 /** |
| 546 * @ingroup iface_zxdg_positioner_v6 |
| 547 * vertically resize the surface |
| 548 * |
| 549 * Resize the surface vertically so that it is completely unconstrained. |
| 550 */ |
| 551 enum zxdg_positioner_v6_constraint_adjustment { |
| 552 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE = 0, |
| 553 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X = 1, |
| 554 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y = 2, |
| 555 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X = 4, |
| 556 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y = 8, |
| 557 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X = 16, |
| 558 ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 32, |
| 559 }; |
| 560 #endif /* ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM */ |
| 561 |
| 562 #define ZXDG_POSITIONER_V6_DESTROY 0 |
| 563 #define ZXDG_POSITIONER_V6_SET_SIZE 1 |
| 564 #define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT 2 |
| 565 #define ZXDG_POSITIONER_V6_SET_ANCHOR 3 |
| 566 #define ZXDG_POSITIONER_V6_SET_GRAVITY 4 |
| 567 #define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT 5 |
| 568 #define ZXDG_POSITIONER_V6_SET_OFFSET 6 |
| 569 |
| 570 /** |
| 571 * @ingroup iface_zxdg_positioner_v6 |
| 572 */ |
| 573 #define ZXDG_POSITIONER_V6_DESTROY_SINCE_VERSION 1 |
| 574 /** |
| 575 * @ingroup iface_zxdg_positioner_v6 |
| 576 */ |
| 577 #define ZXDG_POSITIONER_V6_SET_SIZE_SINCE_VERSION 1 |
| 578 /** |
| 579 * @ingroup iface_zxdg_positioner_v6 |
| 580 */ |
| 581 #define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT_SINCE_VERSION 1 |
| 582 /** |
| 583 * @ingroup iface_zxdg_positioner_v6 |
| 584 */ |
| 585 #define ZXDG_POSITIONER_V6_SET_ANCHOR_SINCE_VERSION 1 |
| 586 /** |
| 587 * @ingroup iface_zxdg_positioner_v6 |
| 588 */ |
| 589 #define ZXDG_POSITIONER_V6_SET_GRAVITY_SINCE_VERSION 1 |
| 590 /** |
| 591 * @ingroup iface_zxdg_positioner_v6 |
| 592 */ |
| 593 #define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1 |
| 594 /** |
| 595 * @ingroup iface_zxdg_positioner_v6 |
| 596 */ |
| 597 #define ZXDG_POSITIONER_V6_SET_OFFSET_SINCE_VERSION 1 |
| 598 |
| 599 /** @ingroup iface_zxdg_positioner_v6 */ |
| 600 static inline void |
| 601 zxdg_positioner_v6_set_user_data(struct zxdg_positioner_v6 *zxdg_positioner_v6,
void *user_data) |
| 602 { |
| 603 wl_proxy_set_user_data((struct wl_proxy *) zxdg_positioner_v6, user_data
); |
| 604 } |
| 605 |
| 606 /** @ingroup iface_zxdg_positioner_v6 */ |
| 607 static inline void * |
| 608 zxdg_positioner_v6_get_user_data(struct zxdg_positioner_v6 *zxdg_positioner_v6) |
| 609 { |
| 610 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_positioner_v6); |
| 611 } |
| 612 |
| 613 static inline uint32_t |
| 614 zxdg_positioner_v6_get_version(struct zxdg_positioner_v6 *zxdg_positioner_v6) |
| 615 { |
| 616 return wl_proxy_get_version((struct wl_proxy *) zxdg_positioner_v6); |
| 617 } |
| 618 |
| 619 /** |
| 620 * @ingroup iface_zxdg_positioner_v6 |
| 621 * |
| 622 * Notify the compositor that the xdg_positioner will no longer be used. |
| 623 */ |
| 624 static inline void |
| 625 zxdg_positioner_v6_destroy(struct zxdg_positioner_v6 *zxdg_positioner_v6) |
| 626 { |
| 627 wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6, |
| 628 ZXDG_POSITIONER_V6_DESTROY); |
| 629 |
| 630 wl_proxy_destroy((struct wl_proxy *) zxdg_positioner_v6); |
| 631 } |
| 632 |
| 633 /** |
| 634 * @ingroup iface_zxdg_positioner_v6 |
| 635 * |
| 636 * Set the size of the surface that is to be positioned with the positioner |
| 637 * object. The size is in surface-local coordinates and corresponds to the |
| 638 * window geometry. See xdg_surface.set_window_geometry. |
| 639 * |
| 640 * If a zero or negative size is set the invalid_input error is raised. |
| 641 */ |
| 642 static inline void |
| 643 zxdg_positioner_v6_set_size(struct zxdg_positioner_v6 *zxdg_positioner_v6, int32
_t width, int32_t height) |
| 644 { |
| 645 wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6, |
| 646 ZXDG_POSITIONER_V6_SET_SIZE, width, height); |
| 647 } |
| 648 |
| 649 /** |
| 650 * @ingroup iface_zxdg_positioner_v6 |
| 651 * |
| 652 * Specify the anchor rectangle within the parent surface that the child |
| 653 * surface will be placed relative to. The rectangle is relative to the |
| 654 * window geometry as defined by xdg_surface.set_window_geometry of the |
| 655 * parent surface. The rectangle must be at least 1x1 large. |
| 656 * |
| 657 * When the xdg_positioner object is used to position a child surface, the |
| 658 * anchor rectangle may not extend outside the window geometry of the |
| 659 * positioned child's parent surface. |
| 660 * |
| 661 * If a zero or negative size is set the invalid_input error is raised. |
| 662 */ |
| 663 static inline void |
| 664 zxdg_positioner_v6_set_anchor_rect(struct zxdg_positioner_v6 *zxdg_positioner_v6
, int32_t x, int32_t y, int32_t width, int32_t height) |
| 665 { |
| 666 wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6, |
| 667 ZXDG_POSITIONER_V6_SET_ANCHOR_RECT, x, y, width, height
); |
| 668 } |
| 669 |
| 670 /** |
| 671 * @ingroup iface_zxdg_positioner_v6 |
| 672 * |
| 673 * Defines a set of edges for the anchor rectangle. These are used to |
| 674 * derive an anchor point that the child surface will be positioned |
| 675 * relative to. If two orthogonal edges are specified (e.g. 'top' and |
| 676 * 'left'), then the anchor point will be the intersection of the edges |
| 677 * (e.g. the top left position of the rectangle); otherwise, the derived |
| 678 * anchor point will be centered on the specified edge, or in the center of |
| 679 * the anchor rectangle if no edge is specified. |
| 680 * |
| 681 * If two parallel anchor edges are specified (e.g. 'left' and 'right'), |
| 682 * the invalid_input error is raised. |
| 683 */ |
| 684 static inline void |
| 685 zxdg_positioner_v6_set_anchor(struct zxdg_positioner_v6 *zxdg_positioner_v6, uin
t32_t anchor) |
| 686 { |
| 687 wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6, |
| 688 ZXDG_POSITIONER_V6_SET_ANCHOR, anchor); |
| 689 } |
| 690 |
| 691 /** |
| 692 * @ingroup iface_zxdg_positioner_v6 |
| 693 * |
| 694 * Defines in what direction a surface should be positioned, relative to |
| 695 * the anchor point of the parent surface. If two orthogonal gravities are |
| 696 * specified (e.g. 'bottom' and 'right'), then the child surface will be |
| 697 * placed in the specified direction; otherwise, the child surface will be |
| 698 * centered over the anchor point on any axis that had no gravity |
| 699 * specified. |
| 700 * |
| 701 * If two parallel gravities are specified (e.g. 'left' and 'right'), the |
| 702 * invalid_input error is raised. |
| 703 */ |
| 704 static inline void |
| 705 zxdg_positioner_v6_set_gravity(struct zxdg_positioner_v6 *zxdg_positioner_v6, ui
nt32_t gravity) |
| 706 { |
| 707 wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6, |
| 708 ZXDG_POSITIONER_V6_SET_GRAVITY, gravity); |
| 709 } |
| 710 |
| 711 /** |
| 712 * @ingroup iface_zxdg_positioner_v6 |
| 713 * |
| 714 * Specify how the window should be positioned if the originally intended |
| 715 * position caused the surface to be constrained, meaning at least |
| 716 * partially outside positioning boundaries set by the compositor. The |
| 717 * adjustment is set by constructing a bitmask describing the adjustment to |
| 718 * be made when the surface is constrained on that axis. |
| 719 * |
| 720 * If no bit for one axis is set, the compositor will assume that the child |
| 721 * surface should not change its position on that axis when constrained. |
| 722 * |
| 723 * If more than one bit for one axis is set, the order of how adjustments |
| 724 * are applied is specified in the corresponding adjustment descriptions. |
| 725 * |
| 726 * The default adjustment is none. |
| 727 */ |
| 728 static inline void |
| 729 zxdg_positioner_v6_set_constraint_adjustment(struct zxdg_positioner_v6 *zxdg_pos
itioner_v6, uint32_t constraint_adjustment) |
| 730 { |
| 731 wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6, |
| 732 ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT, constrain
t_adjustment); |
| 733 } |
| 734 |
| 735 /** |
| 736 * @ingroup iface_zxdg_positioner_v6 |
| 737 * |
| 738 * Specify the surface position offset relative to the position of the |
| 739 * anchor on the anchor rectangle and the anchor on the surface. For |
| 740 * example if the anchor of the anchor rectangle is at (x, y), the surface |
| 741 * has the gravity bottom|right, and the offset is (ox, oy), the calculated |
| 742 * surface position will be (x + ox, y + oy). The offset position of the |
| 743 * surface is the one used for constraint testing. See |
| 744 * set_constraint_adjustment. |
| 745 * |
| 746 * An example use case is placing a popup menu on top of a user interface |
| 747 * element, while aligning the user interface element of the parent surface |
| 748 * with some user interface element placed somewhere in the popup surface. |
| 749 */ |
| 750 static inline void |
| 751 zxdg_positioner_v6_set_offset(struct zxdg_positioner_v6 *zxdg_positioner_v6, int
32_t x, int32_t y) |
| 752 { |
| 753 wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6, |
| 754 ZXDG_POSITIONER_V6_SET_OFFSET, x, y); |
| 755 } |
| 756 |
| 757 #ifndef ZXDG_SURFACE_V6_ERROR_ENUM |
| 758 #define ZXDG_SURFACE_V6_ERROR_ENUM |
| 759 enum zxdg_surface_v6_error { |
| 760 ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED = 1, |
| 761 ZXDG_SURFACE_V6_ERROR_ALREADY_CONSTRUCTED = 2, |
| 762 ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER = 3, |
| 763 }; |
| 764 #endif /* ZXDG_SURFACE_V6_ERROR_ENUM */ |
| 765 |
| 766 /** |
| 767 * @ingroup iface_zxdg_surface_v6 |
| 768 * @struct zxdg_surface_v6_listener |
| 769 */ |
| 770 struct zxdg_surface_v6_listener { |
| 771 /** |
| 772 * suggest a surface change |
| 773 * |
| 774 * The configure event marks the end of a configure sequence. A |
| 775 * configure sequence is a set of one or more events configuring |
| 776 * the state of the xdg_surface, including the final |
| 777 * xdg_surface.configure event. |
| 778 * |
| 779 * Where applicable, xdg_surface surface roles will during a |
| 780 * configure sequence extend this event as a latched state sent as |
| 781 * events before the xdg_surface.configure event. Such events |
| 782 * should be considered to make up a set of atomically applied |
| 783 * configuration states, where the xdg_surface.configure commits |
| 784 * the accumulated state. |
| 785 * |
| 786 * Clients should arrange their surface for the new states, and |
| 787 * then send an ack_configure request with the serial sent in this |
| 788 * configure event at some point before committing the new surface. |
| 789 * |
| 790 * If the client receives multiple configure events before it can |
| 791 * respond to one, it is free to discard all but the last event it |
| 792 * received. |
| 793 * @param serial serial of the configure event |
| 794 */ |
| 795 void (*configure)(void *data, |
| 796 struct zxdg_surface_v6 *zxdg_surface_v6, |
| 797 uint32_t serial); |
| 798 }; |
| 799 |
| 800 /** |
| 801 * @ingroup zxdg_surface_v6_iface |
| 802 */ |
| 803 static inline int |
| 804 zxdg_surface_v6_add_listener(struct zxdg_surface_v6 *zxdg_surface_v6, |
| 805 const struct zxdg_surface_v6_listener *listener, vo
id *data) |
| 806 { |
| 807 return wl_proxy_add_listener((struct wl_proxy *) zxdg_surface_v6, |
| 808 (void (**)(void)) listener, data); |
| 809 } |
| 810 |
| 811 #define ZXDG_SURFACE_V6_DESTROY 0 |
| 812 #define ZXDG_SURFACE_V6_GET_TOPLEVEL 1 |
| 813 #define ZXDG_SURFACE_V6_GET_POPUP 2 |
| 814 #define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY 3 |
| 815 #define ZXDG_SURFACE_V6_ACK_CONFIGURE 4 |
| 816 |
| 817 /** |
| 818 * @ingroup iface_zxdg_surface_v6 |
| 819 */ |
| 820 #define ZXDG_SURFACE_V6_DESTROY_SINCE_VERSION 1 |
| 821 /** |
| 822 * @ingroup iface_zxdg_surface_v6 |
| 823 */ |
| 824 #define ZXDG_SURFACE_V6_GET_TOPLEVEL_SINCE_VERSION 1 |
| 825 /** |
| 826 * @ingroup iface_zxdg_surface_v6 |
| 827 */ |
| 828 #define ZXDG_SURFACE_V6_GET_POPUP_SINCE_VERSION 1 |
| 829 /** |
| 830 * @ingroup iface_zxdg_surface_v6 |
| 831 */ |
| 832 #define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 |
| 833 /** |
| 834 * @ingroup iface_zxdg_surface_v6 |
| 835 */ |
| 836 #define ZXDG_SURFACE_V6_ACK_CONFIGURE_SINCE_VERSION 1 |
| 837 |
| 838 /** @ingroup iface_zxdg_surface_v6 */ |
| 839 static inline void |
| 840 zxdg_surface_v6_set_user_data(struct zxdg_surface_v6 *zxdg_surface_v6, void *use
r_data) |
| 841 { |
| 842 wl_proxy_set_user_data((struct wl_proxy *) zxdg_surface_v6, user_data); |
| 843 } |
| 844 |
| 845 /** @ingroup iface_zxdg_surface_v6 */ |
| 846 static inline void * |
| 847 zxdg_surface_v6_get_user_data(struct zxdg_surface_v6 *zxdg_surface_v6) |
| 848 { |
| 849 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_surface_v6); |
| 850 } |
| 851 |
| 852 static inline uint32_t |
| 853 zxdg_surface_v6_get_version(struct zxdg_surface_v6 *zxdg_surface_v6) |
| 854 { |
| 855 return wl_proxy_get_version((struct wl_proxy *) zxdg_surface_v6); |
| 856 } |
| 857 |
| 858 /** |
| 859 * @ingroup iface_zxdg_surface_v6 |
| 860 * |
| 861 * Destroy the xdg_surface object. An xdg_surface must only be destroyed |
| 862 * after its role object has been destroyed. |
| 863 */ |
| 864 static inline void |
| 865 zxdg_surface_v6_destroy(struct zxdg_surface_v6 *zxdg_surface_v6) |
| 866 { |
| 867 wl_proxy_marshal((struct wl_proxy *) zxdg_surface_v6, |
| 868 ZXDG_SURFACE_V6_DESTROY); |
| 869 |
| 870 wl_proxy_destroy((struct wl_proxy *) zxdg_surface_v6); |
| 871 } |
| 872 |
| 873 /** |
| 874 * @ingroup iface_zxdg_surface_v6 |
| 875 * |
| 876 * This creates an xdg_toplevel object for the given xdg_surface and gives |
| 877 * the associated wl_surface the xdg_toplevel role. |
| 878 * |
| 879 * See the documentation of xdg_toplevel for more details about what an |
| 880 * xdg_toplevel is and how it is used. |
| 881 */ |
| 882 static inline struct zxdg_toplevel_v6 * |
| 883 zxdg_surface_v6_get_toplevel(struct zxdg_surface_v6 *zxdg_surface_v6) |
| 884 { |
| 885 struct wl_proxy *id; |
| 886 |
| 887 id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_surface_v6, |
| 888 ZXDG_SURFACE_V6_GET_TOPLEVEL, &zxdg_toplevel_v6_interfa
ce, NULL); |
| 889 |
| 890 return (struct zxdg_toplevel_v6 *) id; |
| 891 } |
| 892 |
| 893 /** |
| 894 * @ingroup iface_zxdg_surface_v6 |
| 895 * |
| 896 * This creates an xdg_popup object for the given xdg_surface and gives the |
| 897 * associated wl_surface the xdg_popup role. |
| 898 * |
| 899 * See the documentation of xdg_popup for more details about what an |
| 900 * xdg_popup is and how it is used. |
| 901 */ |
| 902 static inline struct zxdg_popup_v6 * |
| 903 zxdg_surface_v6_get_popup(struct zxdg_surface_v6 *zxdg_surface_v6, struct zxdg_s
urface_v6 *parent, struct zxdg_positioner_v6 *positioner) |
| 904 { |
| 905 struct wl_proxy *id; |
| 906 |
| 907 id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_surface_v6, |
| 908 ZXDG_SURFACE_V6_GET_POPUP, &zxdg_popup_v6_interface, NU
LL, parent, positioner); |
| 909 |
| 910 return (struct zxdg_popup_v6 *) id; |
| 911 } |
| 912 |
| 913 /** |
| 914 * @ingroup iface_zxdg_surface_v6 |
| 915 * |
| 916 * The window geometry of a surface is its "visible bounds" from the |
| 917 * user's perspective. Client-side decorations often have invisible |
| 918 * portions like drop-shadows which should be ignored for the |
| 919 * purposes of aligning, placing and constraining windows. |
| 920 * |
| 921 * The window geometry is double buffered, and will be applied at the |
| 922 * time wl_surface.commit of the corresponding wl_surface is called. |
| 923 * |
| 924 * Once the window geometry of the surface is set, it is not possible to |
| 925 * unset it, and it will remain the same until set_window_geometry is |
| 926 * called again, even if a new subsurface or buffer is attached. |
| 927 * |
| 928 * If never set, the value is the full bounds of the surface, |
| 929 * including any subsurfaces. This updates dynamically on every |
| 930 * commit. This unset is meant for extremely simple clients. |
| 931 * |
| 932 * The arguments are given in the surface-local coordinate space of |
| 933 * the wl_surface associated with this xdg_surface. |
| 934 * |
| 935 * The width and height must be greater than zero. Setting an invalid size |
| 936 * will raise an error. When applied, the effective window geometry will be |
| 937 * the set window geometry clamped to the bounding rectangle of the |
| 938 * combined geometry of the surface of the xdg_surface and the associated |
| 939 * subsurfaces. |
| 940 */ |
| 941 static inline void |
| 942 zxdg_surface_v6_set_window_geometry(struct zxdg_surface_v6 *zxdg_surface_v6, int
32_t x, int32_t y, int32_t width, int32_t height) |
| 943 { |
| 944 wl_proxy_marshal((struct wl_proxy *) zxdg_surface_v6, |
| 945 ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY, x, y, width, heigh
t); |
| 946 } |
| 947 |
| 948 /** |
| 949 * @ingroup iface_zxdg_surface_v6 |
| 950 * |
| 951 * When a configure event is received, if a client commits the |
| 952 * surface in response to the configure event, then the client |
| 953 * must make an ack_configure request sometime before the commit |
| 954 * request, passing along the serial of the configure event. |
| 955 * |
| 956 * For instance, for toplevel surfaces the compositor might use this |
| 957 * information to move a surface to the top left only when the client has |
| 958 * drawn itself for the maximized or fullscreen state. |
| 959 * |
| 960 * If the client receives multiple configure events before it |
| 961 * can respond to one, it only has to ack the last configure event. |
| 962 * |
| 963 * A client is not required to commit immediately after sending |
| 964 * an ack_configure request - it may even ack_configure several times |
| 965 * before its next surface commit. |
| 966 * |
| 967 * A client may send multiple ack_configure requests before committing, but |
| 968 * only the last request sent before a commit indicates which configure |
| 969 * event the client really is responding to. |
| 970 */ |
| 971 static inline void |
| 972 zxdg_surface_v6_ack_configure(struct zxdg_surface_v6 *zxdg_surface_v6, uint32_t
serial) |
| 973 { |
| 974 wl_proxy_marshal((struct wl_proxy *) zxdg_surface_v6, |
| 975 ZXDG_SURFACE_V6_ACK_CONFIGURE, serial); |
| 976 } |
| 977 |
| 978 #ifndef ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM |
| 979 #define ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM |
| 980 /** |
| 981 * @ingroup iface_zxdg_toplevel_v6 |
| 982 * edge values for resizing |
| 983 * |
| 984 * These values are used to indicate which edge of a surface |
| 985 * is being dragged in a resize operation. |
| 986 */ |
| 987 enum zxdg_toplevel_v6_resize_edge { |
| 988 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_NONE = 0, |
| 989 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP = 1, |
| 990 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM = 2, |
| 991 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_LEFT = 4, |
| 992 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_LEFT = 5, |
| 993 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_LEFT = 6, |
| 994 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_RIGHT = 8, |
| 995 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_RIGHT = 9, |
| 996 ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_RIGHT = 10, |
| 997 }; |
| 998 #endif /* ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM */ |
| 999 |
| 1000 #ifndef ZXDG_TOPLEVEL_V6_STATE_ENUM |
| 1001 #define ZXDG_TOPLEVEL_V6_STATE_ENUM |
| 1002 /** |
| 1003 * @ingroup iface_zxdg_toplevel_v6 |
| 1004 * the surface is now activated |
| 1005 * |
| 1006 * Client window decorations should be painted as if the window is |
| 1007 * active. Do not assume this means that the window actually has |
| 1008 * keyboard or pointer focus. |
| 1009 */ |
| 1010 enum zxdg_toplevel_v6_state { |
| 1011 /** |
| 1012 * the surface is maximized |
| 1013 */ |
| 1014 ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED = 1, |
| 1015 /** |
| 1016 * the surface is fullscreen |
| 1017 */ |
| 1018 ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN = 2, |
| 1019 /** |
| 1020 * the surface is being resized |
| 1021 */ |
| 1022 ZXDG_TOPLEVEL_V6_STATE_RESIZING = 3, |
| 1023 /** |
| 1024 * the surface is now activated |
| 1025 */ |
| 1026 ZXDG_TOPLEVEL_V6_STATE_ACTIVATED = 4, |
| 1027 }; |
| 1028 #endif /* ZXDG_TOPLEVEL_V6_STATE_ENUM */ |
| 1029 |
| 1030 /** |
| 1031 * @ingroup iface_zxdg_toplevel_v6 |
| 1032 * @struct zxdg_toplevel_v6_listener |
| 1033 */ |
| 1034 struct zxdg_toplevel_v6_listener { |
| 1035 /** |
| 1036 * suggest a surface change |
| 1037 * |
| 1038 * This configure event asks the client to resize its toplevel |
| 1039 * surface or to change its state. The configured state should not |
| 1040 * be applied immediately. See xdg_surface.configure for details. |
| 1041 * |
| 1042 * The width and height arguments specify a hint to the window |
| 1043 * about how its surface should be resized in window geometry |
| 1044 * coordinates. See set_window_geometry. |
| 1045 * |
| 1046 * If the width or height arguments are zero, it means the client |
| 1047 * should decide its own window dimension. This may happen when the |
| 1048 * compositor need to configure the state of the surface but |
| 1049 * doesn't have any information about any previous or expected |
| 1050 * dimension. |
| 1051 * |
| 1052 * The states listed in the event specify how the width/height |
| 1053 * arguments should be interpreted, and possibly how it should be |
| 1054 * drawn. |
| 1055 * |
| 1056 * Clients must send an ack_configure in response to this event. |
| 1057 * See xdg_surface.configure and xdg_surface.ack_configure for |
| 1058 * details. |
| 1059 */ |
| 1060 void (*configure)(void *data, |
| 1061 struct zxdg_toplevel_v6 *zxdg_toplevel_v6, |
| 1062 int32_t width, |
| 1063 int32_t height, |
| 1064 struct wl_array *states); |
| 1065 /** |
| 1066 * surface wants to be closed |
| 1067 * |
| 1068 * The close event is sent by the compositor when the user wants |
| 1069 * the surface to be closed. This should be equivalent to the user |
| 1070 * clicking the close button in client-side decorations, if your |
| 1071 * application has any... |
| 1072 * |
| 1073 * This is only a request that the user intends to close your |
| 1074 * window. The client may choose to ignore this request, or show a |
| 1075 * dialog to ask the user to save their data... |
| 1076 */ |
| 1077 void (*close)(void *data, |
| 1078 struct zxdg_toplevel_v6 *zxdg_toplevel_v6); |
| 1079 }; |
| 1080 |
| 1081 /** |
| 1082 * @ingroup zxdg_toplevel_v6_iface |
| 1083 */ |
| 1084 static inline int |
| 1085 zxdg_toplevel_v6_add_listener(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, |
| 1086 const struct zxdg_toplevel_v6_listener *listener,
void *data) |
| 1087 { |
| 1088 return wl_proxy_add_listener((struct wl_proxy *) zxdg_toplevel_v6, |
| 1089 (void (**)(void)) listener, data); |
| 1090 } |
| 1091 |
| 1092 #define ZXDG_TOPLEVEL_V6_DESTROY 0 |
| 1093 #define ZXDG_TOPLEVEL_V6_SET_PARENT 1 |
| 1094 #define ZXDG_TOPLEVEL_V6_SET_TITLE 2 |
| 1095 #define ZXDG_TOPLEVEL_V6_SET_APP_ID 3 |
| 1096 #define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU 4 |
| 1097 #define ZXDG_TOPLEVEL_V6_MOVE 5 |
| 1098 #define ZXDG_TOPLEVEL_V6_RESIZE 6 |
| 1099 #define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE 7 |
| 1100 #define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE 8 |
| 1101 #define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED 9 |
| 1102 #define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED 10 |
| 1103 #define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN 11 |
| 1104 #define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN 12 |
| 1105 #define ZXDG_TOPLEVEL_V6_SET_MINIMIZED 13 |
| 1106 |
| 1107 /** |
| 1108 * @ingroup iface_zxdg_toplevel_v6 |
| 1109 */ |
| 1110 #define ZXDG_TOPLEVEL_V6_DESTROY_SINCE_VERSION 1 |
| 1111 /** |
| 1112 * @ingroup iface_zxdg_toplevel_v6 |
| 1113 */ |
| 1114 #define ZXDG_TOPLEVEL_V6_SET_PARENT_SINCE_VERSION 1 |
| 1115 /** |
| 1116 * @ingroup iface_zxdg_toplevel_v6 |
| 1117 */ |
| 1118 #define ZXDG_TOPLEVEL_V6_SET_TITLE_SINCE_VERSION 1 |
| 1119 /** |
| 1120 * @ingroup iface_zxdg_toplevel_v6 |
| 1121 */ |
| 1122 #define ZXDG_TOPLEVEL_V6_SET_APP_ID_SINCE_VERSION 1 |
| 1123 /** |
| 1124 * @ingroup iface_zxdg_toplevel_v6 |
| 1125 */ |
| 1126 #define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU_SINCE_VERSION 1 |
| 1127 /** |
| 1128 * @ingroup iface_zxdg_toplevel_v6 |
| 1129 */ |
| 1130 #define ZXDG_TOPLEVEL_V6_MOVE_SINCE_VERSION 1 |
| 1131 /** |
| 1132 * @ingroup iface_zxdg_toplevel_v6 |
| 1133 */ |
| 1134 #define ZXDG_TOPLEVEL_V6_RESIZE_SINCE_VERSION 1 |
| 1135 /** |
| 1136 * @ingroup iface_zxdg_toplevel_v6 |
| 1137 */ |
| 1138 #define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE_SINCE_VERSION 1 |
| 1139 /** |
| 1140 * @ingroup iface_zxdg_toplevel_v6 |
| 1141 */ |
| 1142 #define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE_SINCE_VERSION 1 |
| 1143 /** |
| 1144 * @ingroup iface_zxdg_toplevel_v6 |
| 1145 */ |
| 1146 #define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED_SINCE_VERSION 1 |
| 1147 /** |
| 1148 * @ingroup iface_zxdg_toplevel_v6 |
| 1149 */ |
| 1150 #define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED_SINCE_VERSION 1 |
| 1151 /** |
| 1152 * @ingroup iface_zxdg_toplevel_v6 |
| 1153 */ |
| 1154 #define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN_SINCE_VERSION 1 |
| 1155 /** |
| 1156 * @ingroup iface_zxdg_toplevel_v6 |
| 1157 */ |
| 1158 #define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN_SINCE_VERSION 1 |
| 1159 /** |
| 1160 * @ingroup iface_zxdg_toplevel_v6 |
| 1161 */ |
| 1162 #define ZXDG_TOPLEVEL_V6_SET_MINIMIZED_SINCE_VERSION 1 |
| 1163 |
| 1164 /** @ingroup iface_zxdg_toplevel_v6 */ |
| 1165 static inline void |
| 1166 zxdg_toplevel_v6_set_user_data(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, void *
user_data) |
| 1167 { |
| 1168 wl_proxy_set_user_data((struct wl_proxy *) zxdg_toplevel_v6, user_data); |
| 1169 } |
| 1170 |
| 1171 /** @ingroup iface_zxdg_toplevel_v6 */ |
| 1172 static inline void * |
| 1173 zxdg_toplevel_v6_get_user_data(struct zxdg_toplevel_v6 *zxdg_toplevel_v6) |
| 1174 { |
| 1175 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_toplevel_v6); |
| 1176 } |
| 1177 |
| 1178 static inline uint32_t |
| 1179 zxdg_toplevel_v6_get_version(struct zxdg_toplevel_v6 *zxdg_toplevel_v6) |
| 1180 { |
| 1181 return wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_v6); |
| 1182 } |
| 1183 |
| 1184 /** |
| 1185 * @ingroup iface_zxdg_toplevel_v6 |
| 1186 * |
| 1187 * Unmap and destroy the window. The window will be effectively |
| 1188 * hidden from the user's point of view, and all state like |
| 1189 * maximization, fullscreen, and so on, will be lost. |
| 1190 */ |
| 1191 static inline void |
| 1192 zxdg_toplevel_v6_destroy(struct zxdg_toplevel_v6 *zxdg_toplevel_v6) |
| 1193 { |
| 1194 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1195 ZXDG_TOPLEVEL_V6_DESTROY); |
| 1196 |
| 1197 wl_proxy_destroy((struct wl_proxy *) zxdg_toplevel_v6); |
| 1198 } |
| 1199 |
| 1200 /** |
| 1201 * @ingroup iface_zxdg_toplevel_v6 |
| 1202 * |
| 1203 * Set the "parent" of this surface. This window should be stacked |
| 1204 * above a parent. The parent surface must be mapped as long as this |
| 1205 * surface is mapped. |
| 1206 * |
| 1207 * Parent windows should be set on dialogs, toolboxes, or other |
| 1208 * "auxiliary" surfaces, so that the parent is raised when the dialog |
| 1209 * is raised. |
| 1210 */ |
| 1211 static inline void |
| 1212 zxdg_toplevel_v6_set_parent(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struct zx
dg_toplevel_v6 *parent) |
| 1213 { |
| 1214 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1215 ZXDG_TOPLEVEL_V6_SET_PARENT, parent); |
| 1216 } |
| 1217 |
| 1218 /** |
| 1219 * @ingroup iface_zxdg_toplevel_v6 |
| 1220 * |
| 1221 * Set a short title for the surface. |
| 1222 * |
| 1223 * This string may be used to identify the surface in a task bar, |
| 1224 * window list, or other user interface elements provided by the |
| 1225 * compositor. |
| 1226 * |
| 1227 * The string must be encoded in UTF-8. |
| 1228 */ |
| 1229 static inline void |
| 1230 zxdg_toplevel_v6_set_title(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, const char
*title) |
| 1231 { |
| 1232 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1233 ZXDG_TOPLEVEL_V6_SET_TITLE, title); |
| 1234 } |
| 1235 |
| 1236 /** |
| 1237 * @ingroup iface_zxdg_toplevel_v6 |
| 1238 * |
| 1239 * Set an application identifier for the surface. |
| 1240 * |
| 1241 * The app ID identifies the general class of applications to which |
| 1242 * the surface belongs. The compositor can use this to group multiple |
| 1243 * surfaces together, or to determine how to launch a new application. |
| 1244 * |
| 1245 * For D-Bus activatable applications, the app ID is used as the D-Bus |
| 1246 * service name. |
| 1247 * |
| 1248 * The compositor shell will try to group application surfaces together |
| 1249 * by their app ID. As a best practice, it is suggested to select app |
| 1250 * ID's that match the basename of the application's .desktop file. |
| 1251 * For example, "org.freedesktop.FooViewer" where the .desktop file is |
| 1252 * "org.freedesktop.FooViewer.desktop". |
| 1253 * |
| 1254 * See the desktop-entry specification [0] for more details on |
| 1255 * application identifiers and how they relate to well-known D-Bus |
| 1256 * names and .desktop files. |
| 1257 * |
| 1258 * [0] http://standards.freedesktop.org/desktop-entry-spec/ |
| 1259 */ |
| 1260 static inline void |
| 1261 zxdg_toplevel_v6_set_app_id(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, const cha
r *app_id) |
| 1262 { |
| 1263 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1264 ZXDG_TOPLEVEL_V6_SET_APP_ID, app_id); |
| 1265 } |
| 1266 |
| 1267 /** |
| 1268 * @ingroup iface_zxdg_toplevel_v6 |
| 1269 * |
| 1270 * Clients implementing client-side decorations might want to show |
| 1271 * a context menu when right-clicking on the decorations, giving the |
| 1272 * user a menu that they can use to maximize or minimize the window. |
| 1273 * |
| 1274 * This request asks the compositor to pop up such a window menu at |
| 1275 * the given position, relative to the local surface coordinates of |
| 1276 * the parent surface. There are no guarantees as to what menu items |
| 1277 * the window menu contains. |
| 1278 * |
| 1279 * This request must be used in response to some sort of user action |
| 1280 * like a button press, key press, or touch down event. |
| 1281 */ |
| 1282 static inline void |
| 1283 zxdg_toplevel_v6_show_window_menu(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, str
uct wl_seat *seat, uint32_t serial, int32_t x, int32_t y) |
| 1284 { |
| 1285 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1286 ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU, seat, serial, x, y); |
| 1287 } |
| 1288 |
| 1289 /** |
| 1290 * @ingroup iface_zxdg_toplevel_v6 |
| 1291 * |
| 1292 * Start an interactive, user-driven move of the surface. |
| 1293 * |
| 1294 * This request must be used in response to some sort of user action |
| 1295 * like a button press, key press, or touch down event. The passed |
| 1296 * serial is used to determine the type of interactive move (touch, |
| 1297 * pointer, etc). |
| 1298 * |
| 1299 * The server may ignore move requests depending on the state of |
| 1300 * the surface (e.g. fullscreen or maximized), or if the passed serial |
| 1301 * is no longer valid. |
| 1302 * |
| 1303 * If triggered, the surface will lose the focus of the device |
| 1304 * (wl_pointer, wl_touch, etc) used for the move. It is up to the |
| 1305 * compositor to visually indicate that the move is taking place, such as |
| 1306 * updating a pointer cursor, during the move. There is no guarantee |
| 1307 * that the device focus will return when the move is completed. |
| 1308 */ |
| 1309 static inline void |
| 1310 zxdg_toplevel_v6_move(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struct wl_seat
*seat, uint32_t serial) |
| 1311 { |
| 1312 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1313 ZXDG_TOPLEVEL_V6_MOVE, seat, serial); |
| 1314 } |
| 1315 |
| 1316 /** |
| 1317 * @ingroup iface_zxdg_toplevel_v6 |
| 1318 * |
| 1319 * Start a user-driven, interactive resize of the surface. |
| 1320 * |
| 1321 * This request must be used in response to some sort of user action |
| 1322 * like a button press, key press, or touch down event. The passed |
| 1323 * serial is used to determine the type of interactive resize (touch, |
| 1324 * pointer, etc). |
| 1325 * |
| 1326 * The server may ignore resize requests depending on the state of |
| 1327 * the surface (e.g. fullscreen or maximized). |
| 1328 * |
| 1329 * If triggered, the client will receive configure events with the |
| 1330 * "resize" state enum value and the expected sizes. See the "resize" |
| 1331 * enum value for more details about what is required. The client |
| 1332 * must also acknowledge configure events using "ack_configure". After |
| 1333 * the resize is completed, the client will receive another "configure" |
| 1334 * event without the resize state. |
| 1335 * |
| 1336 * If triggered, the surface also will lose the focus of the device |
| 1337 * (wl_pointer, wl_touch, etc) used for the resize. It is up to the |
| 1338 * compositor to visually indicate that the resize is taking place, |
| 1339 * such as updating a pointer cursor, during the resize. There is no |
| 1340 * guarantee that the device focus will return when the resize is |
| 1341 * completed. |
| 1342 * |
| 1343 * The edges parameter specifies how the surface should be resized, |
| 1344 * and is one of the values of the resize_edge enum. The compositor |
| 1345 * may use this information to update the surface position for |
| 1346 * example when dragging the top left corner. The compositor may also |
| 1347 * use this information to adapt its behavior, e.g. choose an |
| 1348 * appropriate cursor image. |
| 1349 */ |
| 1350 static inline void |
| 1351 zxdg_toplevel_v6_resize(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struct wl_sea
t *seat, uint32_t serial, uint32_t edges) |
| 1352 { |
| 1353 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1354 ZXDG_TOPLEVEL_V6_RESIZE, seat, serial, edges); |
| 1355 } |
| 1356 |
| 1357 /** |
| 1358 * @ingroup iface_zxdg_toplevel_v6 |
| 1359 * |
| 1360 * Set a maximum size for the window. |
| 1361 * |
| 1362 * The client can specify a maximum size so that the compositor does |
| 1363 * not try to configure the window beyond this size. |
| 1364 * |
| 1365 * The width and height arguments are in window geometry coordinates. |
| 1366 * See xdg_surface.set_window_geometry. |
| 1367 * |
| 1368 * Values set in this way are double-buffered. They will get applied |
| 1369 * on the next commit. |
| 1370 * |
| 1371 * The compositor can use this information to allow or disallow |
| 1372 * different states like maximize or fullscreen and draw accurate |
| 1373 * animations. |
| 1374 * |
| 1375 * Similarly, a tiling window manager may use this information to |
| 1376 * place and resize client windows in a more effective way. |
| 1377 * |
| 1378 * The client should not rely on the compositor to obey the maximum |
| 1379 * size. The compositor may decide to ignore the values set by the |
| 1380 * client and request a larger size. |
| 1381 * |
| 1382 * If never set, or a value of zero in the request, means that the |
| 1383 * client has no expected maximum size in the given dimension. |
| 1384 * As a result, a client wishing to reset the maximum size |
| 1385 * to an unspecified state can use zero for width and height in the |
| 1386 * request. |
| 1387 * |
| 1388 * Requesting a maximum size to be smaller than the minimum size of |
| 1389 * a surface is illegal and will result in a protocol error. |
| 1390 * |
| 1391 * The width and height must be greater than or equal to zero. Using |
| 1392 * strictly negative values for width and height will result in a |
| 1393 * protocol error. |
| 1394 */ |
| 1395 static inline void |
| 1396 zxdg_toplevel_v6_set_max_size(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, int32_t
width, int32_t height) |
| 1397 { |
| 1398 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1399 ZXDG_TOPLEVEL_V6_SET_MAX_SIZE, width, height); |
| 1400 } |
| 1401 |
| 1402 /** |
| 1403 * @ingroup iface_zxdg_toplevel_v6 |
| 1404 * |
| 1405 * Set a minimum size for the window. |
| 1406 * |
| 1407 * The client can specify a minimum size so that the compositor does |
| 1408 * not try to configure the window below this size. |
| 1409 * |
| 1410 * The width and height arguments are in window geometry coordinates. |
| 1411 * See xdg_surface.set_window_geometry. |
| 1412 * |
| 1413 * Values set in this way are double-buffered. They will get applied |
| 1414 * on the next commit. |
| 1415 * |
| 1416 * The compositor can use this information to allow or disallow |
| 1417 * different states like maximize or fullscreen and draw accurate |
| 1418 * animations. |
| 1419 * |
| 1420 * Similarly, a tiling window manager may use this information to |
| 1421 * place and resize client windows in a more effective way. |
| 1422 * |
| 1423 * The client should not rely on the compositor to obey the minimum |
| 1424 * size. The compositor may decide to ignore the values set by the |
| 1425 * client and request a smaller size. |
| 1426 * |
| 1427 * If never set, or a value of zero in the request, means that the |
| 1428 * client has no expected minimum size in the given dimension. |
| 1429 * As a result, a client wishing to reset the minimum size |
| 1430 * to an unspecified state can use zero for width and height in the |
| 1431 * request. |
| 1432 * |
| 1433 * Requesting a minimum size to be larger than the maximum size of |
| 1434 * a surface is illegal and will result in a protocol error. |
| 1435 * |
| 1436 * The width and height must be greater than or equal to zero. Using |
| 1437 * strictly negative values for width and height will result in a |
| 1438 * protocol error. |
| 1439 */ |
| 1440 static inline void |
| 1441 zxdg_toplevel_v6_set_min_size(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, int32_t
width, int32_t height) |
| 1442 { |
| 1443 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1444 ZXDG_TOPLEVEL_V6_SET_MIN_SIZE, width, height); |
| 1445 } |
| 1446 |
| 1447 /** |
| 1448 * @ingroup iface_zxdg_toplevel_v6 |
| 1449 * |
| 1450 * Maximize the surface. |
| 1451 * |
| 1452 * After requesting that the surface should be maximized, the compositor |
| 1453 * will respond by emitting a configure event with the "maximized" state |
| 1454 * and the required window geometry. The client should then update its |
| 1455 * content, drawing it in a maximized state, i.e. without shadow or other |
| 1456 * decoration outside of the window geometry. The client must also |
| 1457 * acknowledge the configure when committing the new content (see |
| 1458 * ack_configure). |
| 1459 * |
| 1460 * It is up to the compositor to decide how and where to maximize the |
| 1461 * surface, for example which output and what region of the screen should |
| 1462 * be used. |
| 1463 * |
| 1464 * If the surface was already maximized, the compositor will still emit |
| 1465 * a configure event with the "maximized" state. |
| 1466 */ |
| 1467 static inline void |
| 1468 zxdg_toplevel_v6_set_maximized(struct zxdg_toplevel_v6 *zxdg_toplevel_v6) |
| 1469 { |
| 1470 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1471 ZXDG_TOPLEVEL_V6_SET_MAXIMIZED); |
| 1472 } |
| 1473 |
| 1474 /** |
| 1475 * @ingroup iface_zxdg_toplevel_v6 |
| 1476 * |
| 1477 * Unmaximize the surface. |
| 1478 * |
| 1479 * After requesting that the surface should be unmaximized, the compositor |
| 1480 * will respond by emitting a configure event without the "maximized" |
| 1481 * state. If available, the compositor will include the window geometry |
| 1482 * dimensions the window had prior to being maximized in the configure |
| 1483 * request. The client must then update its content, drawing it in a |
| 1484 * regular state, i.e. potentially with shadow, etc. The client must also |
| 1485 * acknowledge the configure when committing the new content (see |
| 1486 * ack_configure). |
| 1487 * |
| 1488 * It is up to the compositor to position the surface after it was |
| 1489 * unmaximized; usually the position the surface had before maximizing, if |
| 1490 * applicable. |
| 1491 * |
| 1492 * If the surface was already not maximized, the compositor will still |
| 1493 * emit a configure event without the "maximized" state. |
| 1494 */ |
| 1495 static inline void |
| 1496 zxdg_toplevel_v6_unset_maximized(struct zxdg_toplevel_v6 *zxdg_toplevel_v6) |
| 1497 { |
| 1498 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1499 ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED); |
| 1500 } |
| 1501 |
| 1502 /** |
| 1503 * @ingroup iface_zxdg_toplevel_v6 |
| 1504 * |
| 1505 * Make the surface fullscreen. |
| 1506 * |
| 1507 * You can specify an output that you would prefer to be fullscreen. |
| 1508 * If this value is NULL, it's up to the compositor to choose which |
| 1509 * display will be used to map this surface. |
| 1510 * |
| 1511 * If the surface doesn't cover the whole output, the compositor will |
| 1512 * position the surface in the center of the output and compensate with |
| 1513 * black borders filling the rest of the output. |
| 1514 */ |
| 1515 static inline void |
| 1516 zxdg_toplevel_v6_set_fullscreen(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struc
t wl_output *output) |
| 1517 { |
| 1518 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1519 ZXDG_TOPLEVEL_V6_SET_FULLSCREEN, output); |
| 1520 } |
| 1521 |
| 1522 /** |
| 1523 * @ingroup iface_zxdg_toplevel_v6 |
| 1524 */ |
| 1525 static inline void |
| 1526 zxdg_toplevel_v6_unset_fullscreen(struct zxdg_toplevel_v6 *zxdg_toplevel_v6) |
| 1527 { |
| 1528 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1529 ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN); |
| 1530 } |
| 1531 |
| 1532 /** |
| 1533 * @ingroup iface_zxdg_toplevel_v6 |
| 1534 * |
| 1535 * Request that the compositor minimize your surface. There is no |
| 1536 * way to know if the surface is currently minimized, nor is there |
| 1537 * any way to unset minimization on this surface. |
| 1538 * |
| 1539 * If you are looking to throttle redrawing when minimized, please |
| 1540 * instead use the wl_surface.frame event for this, as this will |
| 1541 * also work with live previews on windows in Alt-Tab, Expose or |
| 1542 * similar compositor features. |
| 1543 */ |
| 1544 static inline void |
| 1545 zxdg_toplevel_v6_set_minimized(struct zxdg_toplevel_v6 *zxdg_toplevel_v6) |
| 1546 { |
| 1547 wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6, |
| 1548 ZXDG_TOPLEVEL_V6_SET_MINIMIZED); |
| 1549 } |
| 1550 |
| 1551 #ifndef ZXDG_POPUP_V6_ERROR_ENUM |
| 1552 #define ZXDG_POPUP_V6_ERROR_ENUM |
| 1553 enum zxdg_popup_v6_error { |
| 1554 /** |
| 1555 * tried to grab after being mapped |
| 1556 */ |
| 1557 ZXDG_POPUP_V6_ERROR_INVALID_GRAB = 0, |
| 1558 }; |
| 1559 #endif /* ZXDG_POPUP_V6_ERROR_ENUM */ |
| 1560 |
| 1561 /** |
| 1562 * @ingroup iface_zxdg_popup_v6 |
| 1563 * @struct zxdg_popup_v6_listener |
| 1564 */ |
| 1565 struct zxdg_popup_v6_listener { |
| 1566 /** |
| 1567 * configure the popup surface |
| 1568 * |
| 1569 * This event asks the popup surface to configure itself given |
| 1570 * the configuration. The configured state should not be applied |
| 1571 * immediately. See xdg_surface.configure for details. |
| 1572 * |
| 1573 * The x and y arguments represent the position the popup was |
| 1574 * placed at given the xdg_positioner rule, relative to the upper |
| 1575 * left corner of the window geometry of the parent surface. |
| 1576 * @param x x position relative to parent surface window geometry |
| 1577 * @param y y position relative to parent surface window geometry |
| 1578 * @param width window geometry width |
| 1579 * @param height window geometry height |
| 1580 */ |
| 1581 void (*configure)(void *data, |
| 1582 struct zxdg_popup_v6 *zxdg_popup_v6, |
| 1583 int32_t x, |
| 1584 int32_t y, |
| 1585 int32_t width, |
| 1586 int32_t height); |
| 1587 /** |
| 1588 * popup interaction is done |
| 1589 * |
| 1590 * The popup_done event is sent out when a popup is dismissed by |
| 1591 * the compositor. The client should destroy the xdg_popup object |
| 1592 * at this point. |
| 1593 */ |
| 1594 void (*popup_done)(void *data, |
| 1595 struct zxdg_popup_v6 *zxdg_popup_v6); |
| 1596 }; |
| 1597 |
| 1598 /** |
| 1599 * @ingroup zxdg_popup_v6_iface |
| 1600 */ |
| 1601 static inline int |
| 1602 zxdg_popup_v6_add_listener(struct zxdg_popup_v6 *zxdg_popup_v6, |
| 1603 const struct zxdg_popup_v6_listener *listener, void *
data) |
| 1604 { |
| 1605 return wl_proxy_add_listener((struct wl_proxy *) zxdg_popup_v6, |
| 1606 (void (**)(void)) listener, data); |
| 1607 } |
| 1608 |
| 1609 #define ZXDG_POPUP_V6_DESTROY 0 |
| 1610 #define ZXDG_POPUP_V6_GRAB 1 |
| 1611 |
| 1612 /** |
| 1613 * @ingroup iface_zxdg_popup_v6 |
| 1614 */ |
| 1615 #define ZXDG_POPUP_V6_DESTROY_SINCE_VERSION 1 |
| 1616 /** |
| 1617 * @ingroup iface_zxdg_popup_v6 |
| 1618 */ |
| 1619 #define ZXDG_POPUP_V6_GRAB_SINCE_VERSION 1 |
| 1620 |
| 1621 /** @ingroup iface_zxdg_popup_v6 */ |
| 1622 static inline void |
| 1623 zxdg_popup_v6_set_user_data(struct zxdg_popup_v6 *zxdg_popup_v6, void *user_data
) |
| 1624 { |
| 1625 wl_proxy_set_user_data((struct wl_proxy *) zxdg_popup_v6, user_data); |
| 1626 } |
| 1627 |
| 1628 /** @ingroup iface_zxdg_popup_v6 */ |
| 1629 static inline void * |
| 1630 zxdg_popup_v6_get_user_data(struct zxdg_popup_v6 *zxdg_popup_v6) |
| 1631 { |
| 1632 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_popup_v6); |
| 1633 } |
| 1634 |
| 1635 static inline uint32_t |
| 1636 zxdg_popup_v6_get_version(struct zxdg_popup_v6 *zxdg_popup_v6) |
| 1637 { |
| 1638 return wl_proxy_get_version((struct wl_proxy *) zxdg_popup_v6); |
| 1639 } |
| 1640 |
| 1641 /** |
| 1642 * @ingroup iface_zxdg_popup_v6 |
| 1643 * |
| 1644 * This destroys the popup. Explicitly destroying the xdg_popup |
| 1645 * object will also dismiss the popup, and unmap the surface. |
| 1646 * |
| 1647 * If this xdg_popup is not the "topmost" popup, a protocol error |
| 1648 * will be sent. |
| 1649 */ |
| 1650 static inline void |
| 1651 zxdg_popup_v6_destroy(struct zxdg_popup_v6 *zxdg_popup_v6) |
| 1652 { |
| 1653 wl_proxy_marshal((struct wl_proxy *) zxdg_popup_v6, |
| 1654 ZXDG_POPUP_V6_DESTROY); |
| 1655 |
| 1656 wl_proxy_destroy((struct wl_proxy *) zxdg_popup_v6); |
| 1657 } |
| 1658 |
| 1659 /** |
| 1660 * @ingroup iface_zxdg_popup_v6 |
| 1661 * |
| 1662 * This request makes the created popup take an explicit grab. An explicit |
| 1663 * grab will be dismissed when the user dismisses the popup, or when the |
| 1664 * client destroys the xdg_popup. This can be done by the user clicking |
| 1665 * outside the surface, using the keyboard, or even locking the screen |
| 1666 * through closing the lid or a timeout. |
| 1667 * |
| 1668 * If the compositor denies the grab, the popup will be immediately |
| 1669 * dismissed. |
| 1670 * |
| 1671 * This request must be used in response to some sort of user action like a |
| 1672 * button press, key press, or touch down event. The serial number of the |
| 1673 * event should be passed as 'serial'. |
| 1674 * |
| 1675 * The parent of a grabbing popup must either be an xdg_toplevel surface or |
| 1676 * another xdg_popup with an explicit grab. If the parent is another |
| 1677 * xdg_popup it means that the popups are nested, with this popup now being |
| 1678 * the topmost popup. |
| 1679 * |
| 1680 * Nested popups must be destroyed in the reverse order they were created |
| 1681 * in, e.g. the only popup you are allowed to destroy at all times is the |
| 1682 * topmost one. |
| 1683 * |
| 1684 * When compositors choose to dismiss a popup, they may dismiss every |
| 1685 * nested grabbing popup as well. When a compositor dismisses popups, it |
| 1686 * will follow the same dismissing order as required from the client. |
| 1687 * |
| 1688 * The parent of a grabbing popup must either be another xdg_popup with an |
| 1689 * active explicit grab, or an xdg_popup or xdg_toplevel, if there are no |
| 1690 * explicit grabs already taken. |
| 1691 * |
| 1692 * If the topmost grabbing popup is destroyed, the grab will be returned to |
| 1693 * the parent of the popup, if that parent previously had an explicit grab. |
| 1694 * |
| 1695 * If the parent is a grabbing popup which has already been dismissed, this |
| 1696 * popup will be immediately dismissed. If the parent is a popup that did |
| 1697 * not take an explicit grab, an error will be raised. |
| 1698 * |
| 1699 * During a popup grab, the client owning the grab will receive pointer |
| 1700 * and touch events for all their surfaces as normal (similar to an |
| 1701 * "owner-events" grab in X11 parlance), while the top most grabbing popup |
| 1702 * will always have keyboard focus. |
| 1703 */ |
| 1704 static inline void |
| 1705 zxdg_popup_v6_grab(struct zxdg_popup_v6 *zxdg_popup_v6, struct wl_seat *seat, ui
nt32_t serial) |
| 1706 { |
| 1707 wl_proxy_marshal((struct wl_proxy *) zxdg_popup_v6, |
| 1708 ZXDG_POPUP_V6_GRAB, seat, serial); |
| 1709 } |
| 1710 |
| 1711 #ifdef __cplusplus |
| 1712 } |
| 1713 #endif |
| 1714 |
| 1715 #endif |
| OLD | NEW |