1 #ifndef _ECORE_WL2_H_ 2 # define _ECORE_WL2_H_ 3 4 # include <Eina.h> 5 # include <Ecore.h> 6 # include <wayland-client.h> 7 # include <wayland-cursor.h> 8 # include <xkbcommon/xkbcommon.h> 9 10 # define WL_HIDE_DEPRECATED 11 # include <wayland-server.h> 12 13 # ifdef EAPI 14 # undef EAPI 15 # endif 16 17 # ifdef __GNUC__ 18 # if __GNUC__ >= 4 19 # define EAPI __attribute__ ((visibility("default"))) 20 # else 21 # define EAPI 22 # endif 23 # else 24 # define EAPI 25 # endif 26 27 /* # ifdef __cplusplus */ 28 /* extern "C" { */ 29 /* # endif */ 30 31 # ifdef EFL_BETA_API_SUPPORT 32 33 #define ECORE_WL2_SURFACE_INTERFACE_VERSION 1 34 35 typedef struct _Ecore_Wl2_Subsurface Ecore_Wl2_Subsurface; 36 37 # ifndef _ECORE_WL2_WINDOW_PREDEF 38 typedef struct _Ecore_Wl2_Window Ecore_Wl2_Window; 39 # endif 40 41 typedef struct _Ecore_Wl2_Display Ecore_Wl2_Display; 42 typedef struct _Ecore_Wl2_Output Ecore_Wl2_Output; 43 typedef struct _Ecore_Wl2_Input Ecore_Wl2_Input; 44 typedef struct _Ecore_Wl2_Seat Ecore_Wl2_Seat; 45 typedef struct _Ecore_Wl2_Pointer Ecore_Wl2_Pointer; 46 typedef struct _Ecore_Wl2_Keyboard Ecore_Wl2_Keyboard; 47 typedef struct _Ecore_Wl2_Touch Ecore_Wl2_Touch; 48 typedef struct _Ecore_Wl2_Offer Ecore_Wl2_Offer; 49 typedef struct _Ecore_Wl2_Surface Ecore_Wl2_Surface; 50 51 /* matches protocol values */ 52 typedef enum 53 { 54 ECORE_WL2_DRAG_ACTION_NONE = 0, 55 ECORE_WL2_DRAG_ACTION_COPY = 1, 56 ECORE_WL2_DRAG_ACTION_MOVE = 2, 57 ECORE_WL2_DRAG_ACTION_ASK = 4, 58 ECORE_WL2_DRAG_ACTION_LAST = 5, 59 } Ecore_Wl2_Drag_Action; 60 61 typedef enum 62 { 63 ECORE_WL2_SEAT_CAPABILITIES_NONE = 0, 64 ECORE_WL2_SEAT_CAPABILITIES_POINTER = 1, 65 ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD = 2, 66 ECORE_WL2_SEAT_CAPABILITIES_TOUCH = 4 67 } Ecore_Wl2_Seat_Capabilities; 68 69 struct _Ecore_Wl2_Event_Connection 70 { 71 Ecore_Wl2_Display *display; 72 }; 73 74 typedef struct _Ecore_Wl2_Event_Connection Ecore_Wl2_Event_Connect; 75 typedef struct _Ecore_Wl2_Event_Connection Ecore_Wl2_Event_Disconnect; 76 77 typedef struct _Ecore_Wl2_Global 78 { 79 Eina_Stringshare *interface; 80 unsigned int id, version; 81 Ecore_Wl2_Display *display; 82 } Ecore_Wl2_Global; 83 84 typedef struct _Ecore_Wl2_Event_Global 85 { 86 Ecore_Wl2_Display *display; 87 Eina_Stringshare *interface; 88 unsigned int id, version; 89 } Ecore_Wl2_Event_Global; 90 91 typedef struct _Ecore_Wl2_Event_Focus_In 92 { 93 Ecore_Wl2_Window *window; 94 unsigned int timestamp; 95 Eo *dev; //The seat device 96 Ecore_Wl2_Display *display; 97 } Ecore_Wl2_Event_Focus_In; 98 99 typedef struct _Ecore_Wl2_Event_Focus_Out 100 { 101 Ecore_Wl2_Window *window; 102 unsigned int timestamp; 103 Eo *dev; //The seat device 104 Ecore_Wl2_Display *display; 105 } Ecore_Wl2_Event_Focus_Out; 106 107 typedef struct _Ecore_Wl2_Event_Dnd_Enter 108 { 109 Ecore_Wl2_Window *win, *source; 110 Ecore_Wl2_Offer *offer; 111 int x, y; 112 unsigned int seat; 113 Ecore_Wl2_Display *display; 114 } Ecore_Wl2_Event_Dnd_Enter; 115 116 typedef struct _Ecore_Wl2_Event_Dnd_Leave 117 { 118 Ecore_Wl2_Window *win, *source; 119 Ecore_Wl2_Offer *offer; 120 unsigned int seat; 121 Ecore_Wl2_Display *display; 122 } Ecore_Wl2_Event_Dnd_Leave; 123 124 typedef struct _Ecore_Wl2_Event_Dnd_Motion 125 { 126 Ecore_Wl2_Window *win, *source; 127 Ecore_Wl2_Offer *offer; 128 int x, y; 129 unsigned int seat; 130 Ecore_Wl2_Display *display; 131 } Ecore_Wl2_Event_Dnd_Motion; 132 133 typedef struct _Ecore_Wl2_Event_Dnd_Drop 134 { 135 Ecore_Wl2_Window *win, *source; 136 int x, y; 137 Ecore_Wl2_Offer *offer; 138 unsigned int seat; 139 Ecore_Wl2_Display *display; 140 } Ecore_Wl2_Event_Dnd_Drop; 141 142 typedef struct _Ecore_Wl2_Event_Dnd_End 143 { 144 Ecore_Wl2_Window *win, *source; 145 unsigned int seat; 146 Ecore_Wl2_Display *display; 147 } Ecore_Wl2_Event_Dnd_End; 148 149 struct _Ecore_Wl2_Event_Data_Source_Event 150 { 151 Ecore_Wl2_Window *win, *source; 152 Ecore_Wl2_Drag_Action action; 153 unsigned int seat; 154 uint32_t serial; 155 Ecore_Wl2_Display *display; 156 }; 157 158 typedef struct Ecore_Wl2_Event_Data_Source_End 159 { 160 Ecore_Wl2_Window *win, *source; 161 Ecore_Wl2_Drag_Action action; 162 unsigned int seat; 163 uint32_t serial; 164 Ecore_Wl2_Display *display; 165 Eina_Bool cancelled; 166 } Ecore_Wl2_Event_Data_Source_End; 167 typedef struct _Ecore_Wl2_Event_Data_Source_Event Ecore_Wl2_Event_Data_Source_Drop; 168 typedef struct _Ecore_Wl2_Event_Data_Source_Event Ecore_Wl2_Event_Data_Source_Action; 169 170 typedef struct _Ecore_Wl2_Event_Data_Source_Target 171 { 172 char *type; 173 unsigned int seat; 174 Ecore_Wl2_Display *display; 175 } Ecore_Wl2_Event_Data_Source_Target; 176 177 typedef struct _Ecore_Wl2_Event_Data_Source_Send 178 { 179 char *type; 180 int fd; 181 unsigned int seat; 182 uint32_t serial; 183 Ecore_Wl2_Display *display; 184 } Ecore_Wl2_Event_Data_Source_Send; 185 186 typedef struct Ecore_Wl2_Event_Seat_Selection 187 { 188 unsigned int seat; 189 Ecore_Wl2_Display *display; 190 } Ecore_Wl2_Event_Seat_Selection; 191 192 typedef struct _Ecore_Wl2_Event_Seat_Name 193 { 194 Eina_Stringshare *name; 195 unsigned int id; 196 Ecore_Wl2_Display *display; 197 } Ecore_Wl2_Event_Seat_Name; 198 199 typedef struct _Ecore_Wl2_Event_Seat_Capabilities 200 { 201 unsigned int id; 202 Eina_Bool pointer_enabled : 1; 203 Eina_Bool keyboard_enabled : 1; 204 Eina_Bool touch_enabled : 1; 205 Ecore_Wl2_Display *display; 206 } Ecore_Wl2_Event_Seat_Capabilities; 207 208 typedef enum 209 { 210 ECORE_WL2_DEVICE_TYPE_SEAT, 211 ECORE_WL2_DEVICE_TYPE_POINTER, 212 ECORE_WL2_DEVICE_TYPE_KEYBOARD, 213 ECORE_WL2_DEVICE_TYPE_TOUCH 214 } Ecore_Wl2_Device_Type; 215 216 typedef struct _Ecore_Wl2_Event_Device 217 { 218 Eo *dev; 219 Ecore_Wl2_Window *window; 220 unsigned int seat_id; 221 Ecore_Wl2_Device_Type type; 222 } Ecore_Wl2_Event_Device; 223 224 typedef enum 225 { 226 ECORE_WL2_SELECTION_CNP, 227 ECORE_WL2_SELECTION_DND 228 } Ecore_Wl2_Selection_Type; 229 230 typedef enum 231 { 232 ECORE_WL2_WINDOW_STATE_NONE = 0, 233 ECORE_WL2_WINDOW_STATE_FULLSCREEN = (1 << 0), 234 ECORE_WL2_WINDOW_STATE_MAXIMIZED = (1 << 1), 235 } Ecore_Wl2_Window_States; 236 237 typedef struct _Ecore_Wl2_Event_Window_Configure 238 { 239 Ecore_Wl2_Window *win, *event_win; 240 unsigned int edges; 241 unsigned int w, h; 242 unsigned int states; 243 } Ecore_Wl2_Event_Window_Configure; 244 245 typedef struct _Ecore_Wl2_Event_Window_Configure_Complete 246 { 247 Ecore_Wl2_Window *win; 248 } Ecore_Wl2_Event_Window_Configure_Complete; 249 250 typedef struct _Ecore_Wl2_Event_Input_Keymap_Changed 251 { 252 unsigned int id; 253 Ecore_Wl2_Display *display; 254 } Ecore_Wl2_Event_Seat_Keymap_Changed; 255 256 typedef struct Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed 257 { 258 unsigned int id; 259 Ecore_Wl2_Display *display; 260 } Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed; 261 262 typedef struct _Ecore_Wl2_Event_Sync_Done 263 { 264 Ecore_Wl2_Display *display; 265 } Ecore_Wl2_Event_Sync_Done; 266 267 typedef struct _Ecore_Wl2_Event_Offer_Data_Ready 268 { 269 Ecore_Wl2_Offer *offer; 270 char *data; 271 int len; 272 const char *mimetype; 273 unsigned int seat; 274 Ecore_Wl2_Display *display; 275 } Ecore_Wl2_Event_Offer_Data_Ready; 276 277 typedef struct _Ecore_Wl2_Event_Output_Transform 278 { 279 Ecore_Wl2_Output *output; 280 int transform, old_transform; 281 } Ecore_Wl2_Event_Output_Transform; 282 283 typedef struct _Ecore_Wl2_Event_Window_Rotation 284 { 285 Ecore_Wl2_Window *win; 286 int rotation, w, h, angle; 287 Eina_Bool resize : 1; 288 } Ecore_Wl2_Event_Window_Rotation; 289 290 typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_Change_Prepare; 291 typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_Change_Prepare_Done; 292 typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_Change_Request; 293 typedef struct _Ecore_Wl2_Event_Window_Rotation Ecore_Wl2_Event_Window_Rotation_Change_Done; 294 295 typedef struct _Ecore_Wl2_Event_Window_Show 296 { 297 Ecore_Wl2_Window *win; 298 Ecore_Wl2_Window *parent_win; 299 Ecore_Wl2_Window *event_win; 300 } Ecore_Wl2_Event_Window_Show; 301 302 typedef struct _Ecore_Wl2_Event_Window_Hide 303 { 304 Ecore_Wl2_Window *win; 305 Ecore_Wl2_Window *parent_win; 306 Ecore_Wl2_Window *event_win; 307 } Ecore_Wl2_Event_Window_Hide; 308 309 typedef struct _Ecore_Wl2_Event_Window_Activate 310 { 311 Ecore_Wl2_Window *win; 312 Ecore_Wl2_Window *parent_win; 313 Ecore_Wl2_Window *event_win; 314 } Ecore_Wl2_Event_Window_Activate; 315 316 typedef struct _Ecore_Wl2_Event_Window_Deactivate 317 { 318 Ecore_Wl2_Window *win; 319 Ecore_Wl2_Window *parent_win; 320 Ecore_Wl2_Window *event_win; 321 } Ecore_Wl2_Event_Window_Deactivate; 322 323 typedef struct _Ecore_Wl2_Event_Window_Common 324 { 325 Ecore_Wl2_Window *win; 326 Ecore_Wl2_Window *parent_win; 327 Ecore_Wl2_Window *event_win; 328 } Ecore_Wl2_Event_Window_Common; 329 330 typedef struct _Ecore_Wl2_Event_Window_Iconify_State_Change 331 { 332 Ecore_Wl2_Window *win; 333 unsigned int iconified; 334 unsigned int force; 335 } Ecore_Wl2_Event_Window_Iconify_State_Change; 336 337 typedef enum _Ecore_Wl2_Window_Type 338 { 339 ECORE_WL2_WINDOW_TYPE_NONE, 340 ECORE_WL2_WINDOW_TYPE_TOPLEVEL, 341 ECORE_WL2_WINDOW_TYPE_MENU, 342 ECORE_WL2_WINDOW_TYPE_DND, 343 ECORE_WL2_WINDOW_TYPE_CUSTOM, 344 ECORE_WL2_WINDOW_TYPE_NOTIFICATION, /** @since 1.20 */ 345 ECORE_WL2_WINDOW_TYPE_UTILITY, /** @since 1.20 */ 346 ECORE_WL2_WINDOW_TYPE_DIALOG, /** @since 1.20 */ 347 ECORE_WL2_WINDOW_TYPE_DOCK, /** @since 1.20 */ 348 ECORE_WL2_WINDOW_TYPE_SPLASH, /** @since 1.20 */ 349 ECORE_WL2_WINDOW_TYPE_LAST 350 } Ecore_Wl2_Window_Type; 351 352 typedef struct _Ecore_Wl2_Event_Aux_Hint_Allowed 353 { 354 Ecore_Wl2_Window *win; 355 int id; 356 Ecore_Wl2_Display *display; 357 } Ecore_Wl2_Event_Aux_Hint_Allowed; 358 359 typedef struct _Ecore_Wl2_Event_Aux_Hint_Supported 360 { 361 Ecore_Wl2_Window *win; 362 Ecore_Wl2_Display *display; 363 } Ecore_Wl2_Event_Aux_Hint_Supported; 364 365 typedef struct Ecore_Wl2_Event_Aux_Message 366 { 367 Ecore_Wl2_Window *win; 368 Eina_Stringshare *key; 369 Eina_Stringshare *val; 370 Eina_List *options; 371 Ecore_Wl2_Display *display; 372 } Ecore_Wl2_Event_Aux_Message; 373 374 typedef struct Ecore_Wl2_Event_Window_Offscreen 375 { 376 Ecore_Wl2_Window *win; 377 } Ecore_Wl2_Event_Window_Offscreen; 378 379 typedef struct _Ecore_Wl2_Buffer Ecore_Wl2_Buffer; 380 381 typedef enum _Ecore_Wl2_Buffer_Type Ecore_Wl2_Buffer_Type; 382 enum _Ecore_Wl2_Buffer_Type 383 { 384 ECORE_WL2_BUFFER_NONE = 0, 385 ECORE_WL2_BUFFER_SHM = 1, 386 ECORE_WL2_BUFFER_DMABUF = 2 387 }; 388 389 typedef void (*Ecore_Wl2_Bind_Cb)(struct wl_client *client, void *data, uint32_t version, uint32_t id); 390 typedef void (*Ecore_Wl2_Unbind_Cb)(struct wl_resource *resource); 391 typedef void (*Ecore_Wl2_Frame_Cb)(Ecore_Wl2_Window *win, uint32_t timestamp, void *data); 392 typedef struct _Ecore_Wl2_Frame_Cb_Handle Ecore_Wl2_Frame_Cb_Handle; 393 394 EAPI extern int ECORE_WL2_EVENT_DISCONNECT; /** @since 1.18 */ 395 EAPI extern int ECORE_WL2_EVENT_CONNECT; /** @since 1.18 */ 396 EAPI extern int ECORE_WL2_EVENT_GLOBAL_ADDED; /** @since 1.17 */ 397 EAPI extern int ECORE_WL2_EVENT_GLOBAL_REMOVED; /** @since 1.17 */ 398 EAPI extern int ECORE_WL2_EVENT_FOCUS_IN; /** @since 1.17 */ 399 EAPI extern int ECORE_WL2_EVENT_FOCUS_OUT; /** @since 1.17 */ 400 EAPI extern int ECORE_WL2_EVENT_DND_ENTER; /** @since 1.17 */ 401 EAPI extern int ECORE_WL2_EVENT_DND_LEAVE; /** @since 1.17 */ 402 EAPI extern int ECORE_WL2_EVENT_DND_MOTION; /** @since 1.17 */ 403 EAPI extern int ECORE_WL2_EVENT_DND_DROP; /** @since 1.17 */ 404 EAPI extern int ECORE_WL2_EVENT_DND_END; /** @since 1.17 */ 405 EAPI extern int ECORE_WL2_EVENT_DATA_SOURCE_END; /** @since 1.18 */ 406 EAPI extern int ECORE_WL2_EVENT_DATA_SOURCE_DROP; /** @since 1.18 */ 407 EAPI extern int ECORE_WL2_EVENT_DATA_SOURCE_ACTION; /** @since 1.18 */ 408 EAPI extern int ECORE_WL2_EVENT_DATA_SOURCE_TARGET; /** @since 1.17 */ 409 EAPI extern int ECORE_WL2_EVENT_DATA_SOURCE_SEND; /** @since 1.17 */ 410 EAPI extern int ECORE_WL2_EVENT_WINDOW_CONFIGURE; /** @since 1.17 */ 411 EAPI extern int ECORE_WL2_EVENT_SYNC_DONE; /** @since 1.17 */ 412 EAPI extern int ECORE_WL2_EVENT_OFFER_DATA_READY; /** @since 1.19 */ 413 EAPI extern int ECORE_WL2_EVENT_SEAT_NAME_CHANGED; /** @since 1.19 */ 414 EAPI extern int ECORE_WL2_EVENT_SEAT_CAPABILITIES_CHANGED; /** @since 1.19 */ 415 EAPI extern int ECORE_WL2_EVENT_DEVICE_ADDED; /** @since 1.19 */ 416 EAPI extern int ECORE_WL2_EVENT_DEVICE_REMOVED; /** @since 1.19 */ 417 EAPI extern int ECORE_WL2_EVENT_WINDOW_CONFIGURE_COMPLETE; /** @since 1.19 */ 418 EAPI extern int ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED; /** @since 1.20 */ 419 EAPI extern int ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED; /** @since 1.20 */ 420 EAPI extern int ECORE_WL2_EVENT_SEAT_SELECTION; /** @since 1.20 */ 421 EAPI extern int ECORE_WL2_EVENT_OUTPUT_TRANSFORM; /** @since 1.20 */ 422 EAPI extern int ECORE_WL2_EVENT_WINDOW_ROTATE; /** @since 1.20 */ 423 EAPI extern int ECORE_WL2_EVENT_AUX_HINT_ALLOWED; /** @since 1.20 */ 424 EAPI extern int ECORE_WL2_EVENT_AUX_HINT_SUPPORTED; /** @since 1.20 */ 425 EAPI extern int ECORE_WL2_EVENT_AUX_MESSAGE; /** @since 1.20 */ 426 EAPI extern int ECORE_WL2_EVENT_WINDOW_SHOW; /** @since 1.20 */ 427 EAPI extern int ECORE_WL2_EVENT_WINDOW_HIDE; /** @since 1.20 */ 428 EAPI extern int ECORE_WL2_EVENT_WINDOW_ACTIVATE; /** @since 1.20 */ 429 EAPI extern int ECORE_WL2_EVENT_WINDOW_DEACTIVATE; /** @since 1.20 */ 430 EAPI extern int ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE; /** @since 1.21 */ 431 EAPI extern int ECORE_WL2_EVENT_WINDOW_OFFSCREEN; /** @since 1.21 */ 432 EAPI extern int ECORE_WL2_EVENT_WINDOW_CREATE; /** @since 1.25 */ 433 EAPI extern int ECORE_WL2_EVENT_WINDOW_DESTROY; /** @since 1.25 */ 434 435 typedef struct _Ecore_Wl2_Surface_Interface 436 { 437 int id; 438 int version; 439 440 void *(*setup)(Ecore_Wl2_Window *win); 441 void (*destroy)(Ecore_Wl2_Surface *surface, void *priv_data); 442 void (*reconfigure)(Ecore_Wl2_Surface *surface, void *priv_data, int w, int h, uint32_t flags, Eina_Bool alpha); 443 void *(*data_get)(Ecore_Wl2_Surface *surface, void *priv_data, int *w, int *h); 444 int (*assign)(Ecore_Wl2_Surface *surface, void *priv_data); 445 void (*post)(Ecore_Wl2_Surface *surface, void *priv_data, Eina_Rectangle *rects, unsigned int count); 446 void (*flush)(Ecore_Wl2_Surface *surface, void *priv_data, Eina_Bool purge); 447 } Ecore_Wl2_Surface_Interface; 448 449 /** 450 * @file 451 * @brief Ecore functions for dealing with the Wayland display protocol 452 * 453 * @defgroup Ecore_Wl2_Group Ecore_Wl2 - Wayland integration 454 * @ingroup Ecore 455 * 456 * Ecore_Wl2 provides a wrapper and convenience functions for using the 457 * Wayland protocol in implementing a window system. Function groups for 458 * this part of the library include the following: 459 * 460 * @li @ref Ecore_Wl2_Init_Group 461 * @li @ref Ecore_Wl2_Display_Group 462 * @li @ref Ecore_Wl2_Window_Group 463 * @li @ref Ecore_Wl2_Output_Group 464 * @li @ref Ecore_Wl2_Input_Group 465 */ 466 467 /** 468 * @defgroup Ecore_Wl2_Init_Group Wayland Library Init and Shutdown Functions 469 * @ingroup Ecore_Wl2_Group 470 * 471 * Functions that start and shutdown the Ecore Wl2 Library. 472 */ 473 474 /** 475 * Initialize the Ecore_Wl2 library 476 * 477 * @return The number of times the library has been initialized without being 478 * shutdown. 0 is returned if an error occurs. 479 * 480 * @ingroup Ecore_Wl2_Init_Group 481 * @since 1.17 482 */ 483 EAPI int ecore_wl2_init(void); 484 485 /** 486 * Shutdown the Ecore_Wl2 Library 487 * 488 * @return The number of times the library has been initialized without 489 * being shutdown. 490 * 491 * @ingroup Ecore_Wl2_Init_Group 492 * @since 1.17 493 */ 494 EAPI int ecore_wl2_shutdown(void); 495 496 /** 497 * @defgroup Ecore_Wl2_Display_Group Wayland Library Display Functions 498 * @ingroup Ecore_Wl2_Group 499 * 500 * Functions that deal with creating, connecting, or interacting with 501 * Wayland displays 502 */ 503 504 /** 505 * Create a new Wayland display 506 * 507 * @brief This function is typically used to create a new display for 508 * use with compositors, or to create a new display for use in nested 509 * compositors. 510 * 511 * @param name The display target name to create. If @c NULL, a default 512 * display name will be assigned. 513 * @return The newly created Ecore_Wl2_Display 514 * 515 * @ingroup Ecore_Wl2_Display_Group 516 * @since 1.17 517 */ 518 EAPI Ecore_Wl2_Display *ecore_wl2_display_create(const char *name); 519 520 /** 521 * Destroy an existing Wayland display 522 * 523 * @brief This function is typically used by servers to terminate an 524 * existing Wayland display. 525 * 526 * @param display The display to terminate 527 * 528 * @ingroup Ecore_Wl2_Display_Group 529 * @since 1.17 530 */ 531 EAPI void ecore_wl2_display_destroy(Ecore_Wl2_Display *display); 532 533 /** 534 * Connect to an existing Wayland display 535 * 536 * @brief This function is typically used by clients to connect to an 537 * existing Wayland display. 538 * 539 * @param name The display target name to connect to. If @c NULL, the default 540 * display is assumed. 541 * 542 * @return The Ecore_Wl2_Display which was connected to 543 * 544 * @ingroup Ecore_Wl2_Display_Group 545 * @since 1.17 546 */ 547 EAPI Ecore_Wl2_Display *ecore_wl2_display_connect(const char *name); 548 549 /** 550 * Disconnect an existing Wayland display 551 * 552 * @brief This function is typically used by clients to disconnect from an 553 * existing Wayland display. 554 * 555 * @param display The display to disconnect from 556 * 557 * @ingroup Ecore_Wl2_Display_Group 558 * @since 1.17 559 */ 560 EAPI void ecore_wl2_display_disconnect(Ecore_Wl2_Display *display); 561 562 /** 563 * Retrieve the existing Wayland display 564 * 565 * @param display The Ecore_Wl2_Display for which to retrieve the existing 566 * Wayland display from 567 * 568 * @return The wl_display which this Ecore_Wl2_Display is using 569 * 570 * @ingroup Ecore_Wl2_Display_Group 571 * @since 1.17 572 */ 573 EAPI struct wl_display *ecore_wl2_display_get(Ecore_Wl2_Display *display); 574 575 /** 576 * Retrieve the wl_shm from a given Ecore_Wl2_Display 577 * 578 * @param display The Ecore_Wl2_Display for which to retrieve the existing 579 * Wayland shm interface from 580 * 581 * @return The wl_shm which this Ecore_Wl2_Display is using 582 * 583 * @ingroup Ecore_Wl2_Display_Group 584 * @since 1.17 585 */ 586 EAPI struct wl_shm *ecore_wl2_display_shm_get(Ecore_Wl2_Display *display); 587 588 /** 589 * Retrieve the wl_dmabuf from a given Ecore_Wl2_Display 590 * 591 * 592 * @param display The Ecore_Wl2_Display for which to retrieve the existing 593 * Wayland dmabuf interface from 594 * 595 * @return The wl_dmabuf which this Ecore_Wl2_Display is using 596 * 597 * @ingroup Ecore_Wl2_Display_Group 598 * 599 * @note This is intended for client use only and should be used only 600 * after ecore_wl2_display_connect(). Also, the return type is 601 * void * instead of zpw_linux_dmabuf_v1 * since we don't want 602 * to change our public API every time the version changes in 603 * wayland-protocols. 604 * 605 * @since 1.18 606 */ 607 EAPI void *ecore_wl2_display_dmabuf_get(Ecore_Wl2_Display *display); 608 609 /** 610 * Return an Eina_Iterator that can be used to iterate through globals 611 * 612 * @param display The Ecore_Wl2_Display for which to return a global iterator 613 * 614 * @note The caller of this function should free the returned Eina_Iterator 615 * when finished with it. 616 * 617 * @ingroup Ecore_Wl2_Display_Group 618 * @since 1.17 619 */ 620 EAPI Eina_Iterator *ecore_wl2_display_globals_get(Ecore_Wl2_Display *display); 621 622 /** 623 * Retrieves the size of the current screen. 624 * 625 * @param display The display to get the screen size of 626 * @param w where to return the width. May be NULL. Returns 0 on error. 627 * @param h where to return the height. May be NULL. Returns 0 on error. 628 * 629 * @ingroup Ecore_Wl2_Display_Group 630 * @since 1.17 631 */ 632 EAPI void ecore_wl2_display_screen_size_get(Ecore_Wl2_Display *display, int *w, int *h); 633 634 /** 635 * Get all the Ecore_Wl2_Input from the display. 636 * 637 * @param display The display 638 * 639 * @return A Eina_Iterator of Ecore_Wl2_Input or @c NULL on error 640 * 641 * @ingroup Ecore_Wl2_Display_Group 642 * @since 1.19 643 */ 644 EAPI Eina_Iterator *ecore_wl2_display_inputs_get(Ecore_Wl2_Display *display); 645 646 /** 647 * Find a seat for a given display object using the seat id 648 * 649 * @param display The display 650 * @param id The seat id 651 * 652 * @return The corresponding Ecore_Wl2_Input object or @c NULL if no match is found 653 * 654 * @ingroup Ecore_Wl2_Display_Group 655 * @since 1.20 656 */ 657 EAPI Ecore_Wl2_Input *ecore_wl2_display_input_find(const Ecore_Wl2_Display *display, unsigned int id); 658 659 /** 660 * Find a seat for a given display object using the seat id 661 * 662 * @param display The display 663 * @param name The seat name 664 * 665 * @return The corresponding Ecore_Wl2_Input object or @c NULL if no match is found 666 * 667 * @ingroup Ecore_Wl2_Display_Group 668 * @since 1.20 669 */ 670 EAPI Ecore_Wl2_Input *ecore_wl2_display_input_find_by_name(const Ecore_Wl2_Display *display, const char *name); 671 672 /** 673 * Retrieves the Wayland Registry used for the current Wayland display. 674 * 675 * @param display The display to get the registry of 676 * 677 * @return The current wayland registry, or NULL on error 678 * 679 * @ingroup Ecore_Wl2_Display_Group 680 * @since 1.17 681 */ 682 EAPI struct wl_registry *ecore_wl2_display_registry_get(Ecore_Wl2_Display *display); 683 684 /** 685 * Check if the display has performed a sync 686 * 687 * @param display The display 688 * 689 * @return True if the display sync has occurred 690 * @see ECORE_WL2_EVENT_SYNC_DONE 691 * 692 * @ingroup Ecore_Wl2_Display_Group 693 * @since 1.20 694 */ 695 EAPI Eina_Bool ecore_wl2_display_sync_is_done(const Ecore_Wl2_Display *display); 696 697 /** 698 * Get the name of the display object 699 * 700 * @param display The display 701 * 702 * @return The name of the display object 703 * 704 * @ingroup Ecore_Wl2_Display_Group 705 * @since 1.20 706 */ 707 EAPI const char *ecore_wl2_display_name_get(const Ecore_Wl2_Display *display); 708 709 /** 710 * Finds an Ecore_Wl2_Window based on wl_surface 711 * 712 * @param display The display to search for the window 713 * @param surface The wl_surface of the window to find 714 * 715 * @return The Ecore_Wl2_Window if found, or NULL if no such window exists 716 * 717 * @ingroup Ecore_Wl2_Display_Group 718 * @since 1.24 719 */ 720 EAPI Ecore_Wl2_Window *ecore_wl2_display_window_find_by_surface(Ecore_Wl2_Display *display, struct wl_surface *surface); 721 722 /** 723 * Gets the connected display object 724 * 725 * @brief This function is typically used by clients to get an 726 * existing Wayland display. 727 * 728 * @param name The display target name. If @c NULL, the default 729 * display is assumed. 730 * 731 * @return The Ecore_Wl2_Display which was connected to 732 * 733 * @ingroup Ecore_Wl2_Display_Group 734 * @since 1.24 735 */ 736 EAPI Ecore_Wl2_Display *ecore_wl2_connected_display_get(const char *name); 737 738 /** 739 * Gets the wl_compositor which belongs to this display 740 * 741 * @param display The Ecore_Wl2_Display to get the compositor of 742 * 743 * @return The wl_compositor associated with this display 744 * 745 * @ingroup Ecore_Wl2_Display_Group 746 * @since 1.24 747 */ 748 EAPI struct wl_compositor *ecore_wl2_display_compositor_get(Ecore_Wl2_Display *display); 749 750 /** 751 * @defgroup Ecore_Wl2_Window_Group Wayland Library Window Functions 752 * @ingroup Ecore_Wl2_Group 753 * 754 * Functions that deal with creating, destroying, or interacting with 755 * Wayland windows 756 */ 757 758 /** 759 * Create a new Ecore_Wl2_Window 760 * 761 * @param display The Ecore_Wl2_Display on which to create this new window 762 * @param parent The Ecore_Wl2_Window which is the parent of this window 763 * @param x Initial x position of window 764 * @param y Initial y position of window 765 * @param w Initial width of window 766 * @param h Initial height of window 767 * 768 * @ingroup Ecore_Wl2_Window_Group 769 * @since 1.17 770 */ 771 EAPI Ecore_Wl2_Window *ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x, int y, int w, int h); 772 773 /** 774 * Set a callback to be caleld just before the window is closed and freed 775 * 776 * @param window The window to listen to for a xdg toplevel close callback 777 * @param cb The callback function to call being passed data and window 778 * @param data The Data pointer to pass as data to the callback 779 * 780 * @ingroup Ecore_Wl2_Window_Group 781 * @since 1.24 782 */ 783 EAPI void ecore_wl2_window_close_callback_set(Ecore_Wl2_Window *window, void (*cb) (void *data, Ecore_Wl2_Window *win), void *data); 784 785 /** 786 * Get the wl_surface which belongs to this window 787 * 788 * @param window The Ecore_Wl2_Window to get the surface of 789 * 790 * @return The wl_surface associated with this window. 791 * 792 * @ingroup Ecore_Wl2_Window_Group 793 * @since 1.17 794 */ 795 EAPI struct wl_surface *ecore_wl2_window_surface_get(Ecore_Wl2_Window *window); 796 797 /** 798 * Get the id of a given Ecore_Wl2_Window 799 * 800 * @param window The window to return the id of 801 * 802 * @return The id of the given window, or -1 on failure 803 * 804 * @ingroup Ecore_Wl2_Window_Group 805 * @since 1.17 806 */ 807 EAPI int ecore_wl2_window_surface_id_get(Ecore_Wl2_Window *window); 808 809 /** 810 * @see evas_object_size_hint_aspect_set 811 * @ingroup Ecore_Wl2_Window_Group 812 * @since 1.21 813 */ 814 EAPI void ecore_wl2_window_aspect_set(Ecore_Wl2_Window *window, int w, int h, unsigned int aspect); 815 816 /** 817 * @see evas_object_size_hint_aspect_get 818 * @ingroup Ecore_Wl2_Window_Group 819 * @since 1.24 820 */ 821 EAPI void ecore_wl2_window_aspect_get(Ecore_Wl2_Window *window, int *w, int *h, unsigned int *aspect); 822 823 /** 824 * Show a given Ecore_Wl2_Window 825 * 826 * @param window The Ecore_Wl2_Window to show 827 * 828 * @ingroup Ecore_Wl2_Window_Group 829 * @since 1.17 830 */ 831 EAPI void ecore_wl2_window_show(Ecore_Wl2_Window *window); 832 833 /** 834 * Hide a given Ecore_Wl2_Window 835 * 836 * @param window The Ecore_Wl2_Window to hide 837 * 838 * @ingroup Ecore_Wl2_Window_Group 839 * @since 1.17 840 */ 841 EAPI void ecore_wl2_window_hide(Ecore_Wl2_Window *window); 842 843 /** 844 * Free a given Ecore_Wl2_Window 845 * 846 * @param window The Ecore_Wl2_Window to free 847 * 848 * @ingroup Ecore_Wl2_Window_Group 849 * @since 1.17 850 */ 851 EAPI void ecore_wl2_window_free(Ecore_Wl2_Window *window); 852 853 /** 854 * @brief Begin moving a given Ecore_Wl2_Window 855 * 856 * @param window The Ecore_Wl2_Window which to move 857 * @param input The seat on which the move is active on 858 * 859 * @ingroup Ecore_Wl2_Window_Group 860 * @since 1.20 861 */ 862 EAPI void ecore_wl2_window_move(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input); 863 864 /** 865 * @brief Begin resizing a given window 866 * 867 * @param window The Ecore_Wl2_Window which to resize 868 * @param input The seat on which the resize is active 869 * @param location The edge of the window from which the resize should start 870 * 871 * @ingroup Ecore_Wl2_Window_Group 872 * @since 1.20 873 */ 874 EAPI void ecore_wl2_window_resize(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input, int location); 875 876 /** 877 * Get if a given window is alpha 878 * 879 * @param window The window to get if is alpha 880 * 881 * @return EINA_TRUE if window is alpha, EINA_FALSE otherwise 882 * 883 * @ingroup Ecore_Wl2_Window_Group 884 * @since 1.17 885 */ 886 EAPI Eina_Bool ecore_wl2_window_alpha_get(Ecore_Wl2_Window *window); 887 888 /** 889 * Set a given window's alpha property 890 * 891 * @param window The window on which to set the alpha property 892 * @param alpha EINA_TRUE to set window as alpha, EINA_FALSE otherwise 893 * 894 * @ingroup Ecore_Wl2_Window_Group 895 * @since 1.17 896 */ 897 EAPI void ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha); 898 899 /** 900 * Set the opaque region of the Ecore_Wl2_Window 901 * 902 * @param window The window 903 * @param x The left point of the region. 904 * @param y The top point of the region. 905 * @param w The width of the region. 906 * @param h The height of the region. 907 * 908 * @ingroup Ecore_Wl2_Window_Group 909 * @since 1.17 910 */ 911 EAPI void ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h); 912 913 /** 914 * Get the opaque region of the Ecore_Wl2_Window 915 * 916 * @param window The window 917 * @param x The left point of the region. 918 * @param y The top point of the region. 919 * @param w The width of the region. 920 * @param h The height of the region. 921 * 922 * @ingroup Ecore_Wl2_Window_Group 923 * @since 1.24 924 */ 925 EAPI void ecore_wl2_window_opaque_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h); 926 927 /** 928 * Set the input region of the Ecore_Wl2_Window. 929 * 930 * To set an empty region, pass width and height as 0. 931 * 932 * An empty input region means the entire window surface will accept input. 933 * 934 * @param window The window to set the input region of 935 * @param x The left point of the region. 936 * @param y The top point of the region. 937 * @param w The width of the region. 938 * @param h The height of the region. 939 * 940 * @ingroup Ecore_Wl2_Window_Group 941 * @since 1.17 942 */ 943 EAPI void ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h); 944 945 /** 946 * Get the input region of the Ecore_Wl2_Window. 947 * 948 * @param window The window to set the input region of 949 * @param x The left point of the region. 950 * @param y The top point of the region. 951 * @param w The width of the region. 952 * @param h The height of the region. 953 * 954 * @ingroup Ecore_Wl2_Window_Group 955 * @since 1.24 956 */ 957 EAPI void ecore_wl2_window_input_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h); 958 959 /** 960 * Get if a given window is maximized 961 * 962 * @param window The window to get the maximized state of 963 * 964 * @return EINA_TRUE if window is maximized, EINA_FALSE otherwise 965 * 966 * @ingroup Ecore_Wl2_Window_Group 967 * @since 1.17 968 */ 969 EAPI Eina_Bool ecore_wl2_window_maximized_get(Ecore_Wl2_Window *window); 970 971 /** 972 * Set the maximized state of a given window 973 * 974 * @param window The window to set the maximized state of 975 * @param maximized EINA_TRUE to set maximized, EINA_FALSE to unset 976 * 977 * @ingroup Ecore_Wl2_Window_Group 978 * @since 1.17 979 */ 980 EAPI void ecore_wl2_window_maximized_set(Ecore_Wl2_Window *window, Eina_Bool maximized); 981 982 /** 983 * Get if a given window is fullscreen 984 * 985 * @param window The window to get the fullscreen state of 986 * 987 * @return EINA_TRUE if window is fullscreen, EINA_FALSE otherwise 988 * 989 * @ingroup Ecore_Wl2_Window_Group 990 * @since 1.17 991 */ 992 EAPI Eina_Bool ecore_wl2_window_fullscreen_get(Ecore_Wl2_Window *window); 993 994 /** 995 * Set the fullscreen state of a given window 996 * 997 * @param window The window to set the fullscreen state of 998 * @param fullscreen EINA_TRUE to set fullscreen, EINA_FALSE to unset 999 * 1000 * @ingroup Ecore_Wl2_Window_Group 1001 * @since 1.17 1002 */ 1003 EAPI void ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen); 1004 1005 /** 1006 * Get if a given window is rotated 1007 * 1008 * @param window The window to get the rotation of 1009 * 1010 * @return The amount of rotation for this window, or -1 on failure 1011 * 1012 * @ingroup Ecore_Wl2_Window_Group 1013 * @since 1.17 1014 */ 1015 EAPI int ecore_wl2_window_rotation_get(Ecore_Wl2_Window *window); 1016 1017 /** 1018 * Set the rotation of a given window 1019 * 1020 * @param window The window to set the rotation of 1021 * @param rotation The amount of rotation 1022 * 1023 * @ingroup Ecore_Wl2_Window_Group 1024 * @since 1.17 1025 */ 1026 EAPI void ecore_wl2_window_rotation_set(Ecore_Wl2_Window *window, int rotation); 1027 1028 /** 1029 * Set the title of a given window 1030 * 1031 * @param window The window to set the title of 1032 * @param title The title of the window 1033 * 1034 * @ingroup Ecore_Wl2_Window_Group 1035 * @since 1.17 1036 */ 1037 EAPI void ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char *title); 1038 1039 /** 1040 * Get the title of a given window 1041 * 1042 * @param window The window to set the title of 1043 * 1044 * @return A string if found, or NULL otherwise 1045 * 1046 * @ingroup Ecore_Wl2_Window_Group 1047 * @since 1.24 1048 */ 1049 EAPI const char *ecore_wl2_window_title_get(Ecore_Wl2_Window *window); 1050 1051 /** 1052 * Set the class of a given window 1053 * 1054 * @param window The window to set the class of 1055 * @param clas The class of the window 1056 * 1057 * @ingroup Ecore_Wl2_Window_Group 1058 * @since 1.17 1059 */ 1060 EAPI void ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char *clas); 1061 1062 1063 /** 1064 * Get the class of a given window 1065 * 1066 * @param window The window to set the class of 1067 * 1068 * @return A string if found, or NULL otherwise 1069 * 1070 * @ingroup Ecore_Wl2_Window_Group 1071 * @since 1.24 1072 */ 1073 EAPI const char *ecore_wl2_window_class_get(Ecore_Wl2_Window *window); 1074 1075 /** 1076 * Get the geometry of a given window 1077 * 1078 * @brief The window geometry returned here is the window geometry as 1079 * recognized by xdg_surface_set_window_geometry. As such, it represents the 1080 * "visible bounds" of a window from the user's perspective. 1081 * 1082 * @param window The window to get the geometry of 1083 * @param x The left point of the window geometry 1084 * @param y The top point of the window geometry 1085 * @param w The width of the window geometry 1086 * @param h The height of the window geometry 1087 * 1088 * @ingroup Ecore_Wl2_Window_Group 1089 * @since 1.17 1090 */ 1091 EAPI void ecore_wl2_window_geometry_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h); 1092 1093 /** 1094 * Set the geometry of a given window 1095 * 1096 * @brief The window geometry referenced here is the window geometry as 1097 * recognized by xdg_surface_set_window_geometry. As such, it represents the 1098 * "visible bounds" of a window from the user's perspective. 1099 * 1100 * @param window The window to set the geometry of 1101 * @param x The left point of the window geometry 1102 * @param y The top point of the window geometry 1103 * @param w The width of the window geometry 1104 * @param h The height of the window geometry 1105 * 1106 * @ingroup Ecore_Wl2_Window_Group 1107 * @since 1.17 1108 */ 1109 EAPI void ecore_wl2_window_geometry_set(Ecore_Wl2_Window *window, int x, int y, int w, int h); 1110 1111 /** 1112 * Set the type of a given window 1113 * 1114 * @param window The window to set the type of 1115 * @param type The Ecore_Wl2_Window_Type to set on the window 1116 * 1117 * @ingroup Ecore_Wl2_Window_Group 1118 * @since 1.17 1119 */ 1120 EAPI void ecore_wl2_window_type_set(Ecore_Wl2_Window *window, Ecore_Wl2_Window_Type type); 1121 1122 /** 1123 * Get the type of a given window 1124 * 1125 * @see Ecore_Wl2_Window_Type 1126 * 1127 * @ingroup Ecore_Wl2_Window_Group 1128 * @since 1.24 1129 */ 1130 EAPI Ecore_Wl2_Window_Type ecore_wl2_window_type_get(Ecore_Wl2_Window *window); 1131 1132 /** 1133 * Find the output that a given window is on 1134 * 1135 * @param window The window to find the output for 1136 * 1137 * @return An Ecore_Wl2_Output if found, or NULL otherwise 1138 * 1139 * @ingroup Ecore_Wl2_Window_Group 1140 * @since 1.20 1141 */ 1142 EAPI Ecore_Wl2_Output *ecore_wl2_window_output_find(Ecore_Wl2_Window *window); 1143 1144 /** 1145 * Set if window rotation is supported by the window manager 1146 * 1147 * @param window 1148 * @param enabled 1149 * 1150 * @ingroup Ecore_Wl2_Window_Group 1151 * @since 1.20 1152 */ 1153 EAPI void ecore_wl2_window_wm_rotation_supported_set(Ecore_Wl2_Window *window, Eina_Bool enabled); 1154 1155 /** 1156 * Get if window rotation is supported by the window manager 1157 * 1158 * @param window 1159 * 1160 * @return EINA_TRUE if supported, EINA_FALSE otherwise 1161 * 1162 * @ingroup Ecore_Wl2_Window_Group 1163 * @since 1.20 1164 */ 1165 EAPI Eina_Bool ecore_wl2_window_wm_rotation_supported_get(Ecore_Wl2_Window *window); 1166 1167 /** 1168 * Set if an application has set window rotation 1169 * 1170 * @param window 1171 * @param set 1172 * 1173 * @ingroup Ecore_Wl2_Window_Group 1174 * @since 1.20 1175 */ 1176 EAPI void ecore_wl2_window_rotation_app_set(Ecore_Wl2_Window *window, Eina_Bool set); 1177 1178 /** 1179 * Get if an application has set window rotation 1180 * 1181 * @param window 1182 * 1183 * @return EINA_TRUE if set, EINA_FALSE otherwise 1184 * 1185 * @ingroup Ecore_Wl2_Window_Group 1186 * @since 1.20 1187 */ 1188 EAPI Eina_Bool ecore_wl2_window_rotation_app_get(Ecore_Wl2_Window *window); 1189 1190 /** 1191 * Set preferred rotation on a given window 1192 * 1193 * @param window The window to set preferred rotation on 1194 * @param rot The value of the preferred rotation to set 1195 * 1196 * @ingroup Ecore_Wl2_Window_Group 1197 * @since 1.20 1198 */ 1199 EAPI void ecore_wl2_window_preferred_rotation_set(Ecore_Wl2_Window *window, int rot); 1200 1201 /** 1202 * Get preferred rotation for a given window 1203 * 1204 * @param window The window to get preferred rotation from 1205 * 1206 * @return Given windows preferred rotation 1207 * 1208 * @ingroup Ecore_Wl2_Window 1209 * @since 1.20 1210 */ 1211 EAPI int ecore_wl2_window_preferred_rotation_get(Ecore_Wl2_Window *window); 1212 1213 /** 1214 * Set a windows available rotations 1215 * 1216 * @param window 1217 * @param rots 1218 * @param count 1219 * 1220 * @ingroup Ecore_Wl2_Window_Group 1221 * @since 1.20 1222 */ 1223 EAPI void ecore_wl2_window_available_rotations_set(Ecore_Wl2_Window *window, const int *rots, unsigned int count); 1224 1225 /** 1226 * Get a windows available rotations 1227 * 1228 * @param window 1229 * @param rots 1230 * @param count 1231 * 1232 * @return EINA_TRUE on success, EINA_FALSE otherwise 1233 * 1234 * @ingroup Ecore_Wl2_Window_Group 1235 * @since 1.20 1236 */ 1237 EAPI Eina_Bool ecore_wl2_window_available_rotations_get(Ecore_Wl2_Window *window, int **rots, unsigned int *count); 1238 1239 /** 1240 * @brief Get the activated state of a window 1241 * 1242 * @param window The window to get activated state from 1243 * 1244 * @return @c EINA_TRUE if activated 1245 * 1246 * @ingroup Ecore_Wl2_Window_Group 1247 * @since 1.20 1248 */ 1249 EAPI Eina_Bool ecore_wl2_window_activated_get(const Ecore_Wl2_Window *window); 1250 1251 /** 1252 * @brief Set the seat for a popup window to be used with grab 1253 * 1254 * @param window The window 1255 * @param input The seat 1256 * 1257 * Use this function for desktop shell requests involving popup grabs which require 1258 * a seat for the grab. 1259 * 1260 * @ingroup Ecore_Wl2_Window_Group 1261 * @since 1.20 1262 */ 1263 EAPI void ecore_wl2_window_popup_input_set(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input); 1264 1265 /** 1266 * @brief Get the seat for a popup window to be used with grab 1267 * 1268 * @param window The window 1269 * 1270 * @return Returns Ecore_Wl2_Input if the window has an input. 1271 * 1272 * @ingroup Ecore_Wl2_Window_Group 1273 * @since 1.24 1274 */ 1275 EAPI Ecore_Wl2_Input *ecore_wl2_window_popup_input_get(Ecore_Wl2_Window *window); 1276 1277 /** 1278 * Check if a window has a shell surface - without one it can't be visible. 1279 * 1280 * @param win The window to check 1281 * 1282 * @return Returns true if the window has an associated shell surface. 1283 * 1284 * @ingroup Ecore_Wl2_Window_Group 1285 * @since 1.19 1286 */ 1287 EAPI Eina_Bool ecore_wl2_window_shell_surface_exists(Ecore_Wl2_Window *win); 1288 1289 /** 1290 * Get which display a given window is using 1291 * 1292 * @param window The window to get the display of 1293 * 1294 * @return The Ecore_Wl2_Display that this window is using, or NULL otherwise 1295 * 1296 * @ingroup Ecore_Wl2_Window_Group 1297 * @since 1.17 1298 */ 1299 EAPI Ecore_Wl2_Display *ecore_wl2_window_display_get(const Ecore_Wl2_Window *window); 1300 1301 /** 1302 * Set if this window should ignore focus requests 1303 * 1304 * @param window The window to set ignore focus requests on 1305 * @param focus_skip EINA_TRUE if this window should skip focus requests, EINA_FALSE otherwise 1306 * 1307 * @ingroup Ecore_Wl2_Window_Group 1308 * @since 1.20 1309 */ 1310 EAPI void ecore_wl2_window_focus_skip_set(Ecore_Wl2_Window *window, Eina_Bool focus_skip); 1311 1312 /** 1313 * Get if this window ignores focus requests 1314 * 1315 * @param window The window to get the focus skip value from 1316 * 1317 * @return EINA_TRUE if a window should skip focus requests, EINA_FALSE otherwise 1318 * 1319 * @ingroup Ecore_Wl2_Window_Group 1320 * @since 1.20 1321 */ 1322 EAPI Eina_Bool ecore_wl2_window_focus_skip_get(Ecore_Wl2_Window *window); 1323 1324 /** 1325 * Set the role of a given window 1326 * 1327 * @param window 1328 * @param role 1329 * 1330 * @ingroup Ecore_Wl2_Window_Group 1331 * @since 1.20 1332 */ 1333 EAPI void ecore_wl2_window_role_set(Ecore_Wl2_Window *window, const char *role); 1334 1335 /** 1336 * Get the role of a given window 1337 * 1338 * @param window The window to set the class role 1339 * 1340 * @return A string if found, or NULL otherwise 1341 * 1342 * @ingroup Ecore_Wl2_Window_Group 1343 * @since 1.24 1344 */ 1345 EAPI const char *ecore_wl2_window_role_get(Ecore_Wl2_Window *window); 1346 1347 /** 1348 * Set if a given window is in floating mode 1349 * 1350 * @param window The window to set floating mode on 1351 * @param floating EINA_TRUE if this window should be in floating mode, EINA_FALSE otherwise 1352 * 1353 * @ingroup Ecore_Wl2_Window_Group 1354 * @since 1.20 1355 */ 1356 EAPI void ecore_wl2_window_floating_mode_set(Ecore_Wl2_Window *window, Eina_Bool floating); 1357 1358 /** 1359 * Get if a given window is in floating mode 1360 * 1361 * @param window The window to get floating mode 1362 * 1363 * @return EINA_TRUE if floating, EINA_FALSE otherwise 1364 * 1365 * @ingroup Ecore_Wl2_Window_Group 1366 * @since 1.20 1367 */ 1368 EAPI Eina_Bool ecore_wl2_window_floating_mode_get(Ecore_Wl2_Window *window); 1369 1370 /** 1371 * Finds a window by surface 1372 * 1373 * @param surface The surface to find the window of 1374 * 1375 * @ingroup Ecore_Wl2_Window_Group 1376 * @since 1.24 1377 */ 1378 EAPI Ecore_Wl2_Window *ecore_wl2_window_surface_find(struct wl_surface *surface); 1379 1380 /** 1381 * @defgroup Ecore_Wl2_Input_Group Wayland Library Input Functions 1382 * @ingroup Ecore_Wl2_Group 1383 * 1384 * Functions that deal with creating, destroying, or interacting with 1385 * Wayland Input 1386 */ 1387 1388 /** 1389 * Get the wl_seat that an input is using 1390 * 1391 * @param input The Ecore_Wl2_Input to get the seat of 1392 * 1393 * @return The wl_seat of this input, or NULL otherwise 1394 * 1395 * @ingroup Ecore_Wl2_Input_Group 1396 * @since 1.17 1397 */ 1398 EAPI struct wl_seat *ecore_wl2_input_seat_get(Ecore_Wl2_Input *input); 1399 1400 /** 1401 * Get the seat capabilities for a given input. 1402 * 1403 * @param input The input 1404 * 1405 * @ingroup Ecore_Wl2_Input_Group 1406 * @since 1.19 1407 */ 1408 EAPI Ecore_Wl2_Seat_Capabilities ecore_wl2_input_seat_capabilities_get(Ecore_Wl2_Input *input); 1409 1410 /** 1411 * Get the wayland's seat id from an input. 1412 * 1413 * @param input The input 1414 * 1415 * @return The seat id 1416 * 1417 * @ingroup Ecore_Wl2_Input_Group 1418 * @since 1.19 1419 */ 1420 EAPI unsigned int ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input) EINA_WARN_UNUSED_RESULT; 1421 1422 /** 1423 * Get the display object of an input 1424 * 1425 * @param input The input 1426 * 1427 * @return The display 1428 * 1429 * @ingroup Ecore_Wl2_Input_Group 1430 * @since 1.20 1431 */ 1432 EAPI Ecore_Wl2_Display *ecore_wl2_input_display_get(const Ecore_Wl2_Input *input); 1433 1434 /** 1435 * Get the xkb_keymap object of an input 1436 * 1437 * @param input The input 1438 * 1439 * @return The xkb_keymap object 1440 * 1441 * @ingroup Ecore_Wl2_Input_Group 1442 * @since 1.20 1443 */ 1444 EAPI struct xkb_keymap *ecore_wl2_input_keymap_get(const Ecore_Wl2_Input *input); 1445 1446 /** 1447 * Get the name of an input 1448 * 1449 * @param input The input 1450 * 1451 * @return The name 1452 * 1453 * @ingroup Ecore_Wl2_Input_Group 1454 * @since 1.20 1455 */ 1456 EAPI Eina_Stringshare *ecore_wl2_input_name_get(Ecore_Wl2_Input *input); 1457 1458 /** 1459 * Get the keyboard repeat rate and delay of an input 1460 * 1461 * @param input The input 1462 * @param rate Pointer to store the repeat rate (in seconds) 1463 * @param rate Pointer to store the repeat delay (in seconds) 1464 * 1465 * @return True if repeat is enabled 1466 * 1467 * @ingroup Ecore_Wl2_Input_Group 1468 * @since 1.20 1469 */ 1470 EAPI Eina_Bool ecore_wl2_input_keyboard_repeat_get(const Ecore_Wl2_Input *input, double *rate, double *delay); 1471 1472 /** 1473 * Set the keyboard repeat rate and delay of an input 1474 * @param input The input 1475 * @param rate Pointer to store the repeat rate (in seconds) 1476 * @param rate Pointer to store the repeat delay (in seconds) 1477 * @return True if repeat is enabled 1478 * @ingroup Ecore_Wl2_Input_Group 1479 * @since 1.24 1480 */ 1481 EAPI Eina_Bool ecore_wl2_input_keyboard_repeat_set(Ecore_Wl2_Input *input, double rate, double delay); 1482 1483 /** 1484 * Retrieves the mouse position of the seat 1485 * 1486 * @param input The seat 1487 * @param x where to return the horizontal position. May be NULL. Returns 0 on error. 1488 * @param y where to return the vertical position. May be NULL. Returns 0 on error. 1489 * @return @c EINA_TRUE if coords were successfully retrieved 1490 * 1491 * @ingroup Ecore_Wl2_Input_Group 1492 * @since 1.20 1493 */ 1494 EAPI Eina_Bool ecore_wl2_input_pointer_xy_get(const Ecore_Wl2_Input *input, int *x, int *y); 1495 1496 /** 1497 * Set a given wl_surface to use as the pointer on a seat 1498 * 1499 * @param input The seat to set this surface as the pointer on 1500 * @param surface The surface to use as the pointer 1501 * @param hot_x The x coordinate to use as the cursor hot spot 1502 * @param hot_y The y coordinate to use as the cursor hot spot 1503 * 1504 * @ingroup Ecore_Wl2_Input_Group 1505 * @since 1.20 1506 */ 1507 EAPI void ecore_wl2_input_pointer_set(Ecore_Wl2_Input *input, struct wl_surface *surface, int hot_x, int hot_y); 1508 1509 /** 1510 * Set a specific cursor on a given seat 1511 * 1512 * @brief This function will try to find a matching cursor inside the existing 1513 * cursor theme and set the pointer for the specified seat to be 1514 * the specified cursor 1515 * 1516 * @param input The seat to set the cursor on 1517 * @param cursor The name of the cursor to try and set 1518 * 1519 * @ingroup Ecore_Wl2_Input_Group 1520 * @since 1.20 1521 */ 1522 EAPI void ecore_wl2_input_cursor_from_name_set(Ecore_Wl2_Input *input, const char *cursor); 1523 1524 /** 1525 * Gets default input of a given display 1526 * 1527 * @param ewd The display 1528 * 1529 * @ingroup Ecore_Wl2_Input_Group 1530 * @since 1.24 1531 */ 1532 EAPI Ecore_Wl2_Input *ecore_wl2_input_default_input_get(const Ecore_Wl2_Display *ewd); 1533 1534 /** 1535 * @defgroup Ecore_Wl2_Output_Group Wayland Library Output Functions 1536 * @ingroup Ecore_Wl2_Group 1537 * 1538 * Functions that deal with creating, destroying, or interacting with 1539 * Wayland Outputs 1540 */ 1541 1542 /** 1543 * Return the DPI of a given output 1544 * 1545 * This is a simplistic call to get DPI. It does not account for differing 1546 * DPI in the x and y axes nor does it account for multihead or xinerama and 1547 * xrandr where different parts of the screen may have different DPI etc. 1548 * 1549 * @param output The output to get the DPI of 1550 * 1551 * @return the general screen DPI (dots/pixels per inch). 1552 * 1553 * @ingroup Ecore_Wl2_Output_Group 1554 * @since 1.17 1555 */ 1556 EAPI int ecore_wl2_output_dpi_get(Ecore_Wl2_Output *output); 1557 1558 /** 1559 * Get the current transform of a given output 1560 * 1561 * @param output The output to get the transform of 1562 * 1563 * @return The output's current transform value 1564 * 1565 * @ingroup Ecore_Wl2_Output_Group 1566 * @since 1.20 1567 */ 1568 EAPI int ecore_wl2_output_transform_get(Ecore_Wl2_Output *output); 1569 1570 /** 1571 * Return the version of the display's compositor object 1572 * 1573 * @param disp the display to get the compositor object version from 1574 * 1575 * @return the version of the display's compositor object 1576 * 1577 * @ingroup Ecore_Wl2_Display_Group 1578 * @since 1.17 1579 */ 1580 EAPI int ecore_wl2_display_compositor_version_get(Ecore_Wl2_Display *disp); 1581 1582 /** 1583 * Disable session recovery for any further connections. Must be called 1584 * before connecting. This is irreversible and not intended for general 1585 * use. 1586 * 1587 * @since 1.19 1588 */ 1589 EAPI void ecore_wl2_session_recovery_disable(void); 1590 1591 /** 1592 * Commit the surface of a wayland window. 1593 * 1594 * If flush is set this generates a wl_surface_commit(), otherwise it is 1595 * expected that some other call in the very near future (such as 1596 * eglSwapBuffers) will cause an implicit flush. 1597 * 1598 * A surface that has been commit will be in the "pending" state until 1599 * the compositor tells us it's time to draw again via a frame callback. 1600 * 1601 * @param window The window whose surface we want to commit 1602 * @param flush EINA_TRUE if we need to flush immediately. 1603 * 1604 * @since 1.21 1605 */ 1606 EAPI void ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush); 1607 1608 /** 1609 * Add a callback that fires when the window's surface_frame callback fires 1610 * 1611 * @param window The window to add a callback on 1612 * @param cb The callback 1613 * @param data User data to provide to the callback handler 1614 * 1615 * @since 1.21 1616 */ 1617 EAPI Ecore_Wl2_Frame_Cb_Handle *ecore_wl2_window_frame_callback_add(Ecore_Wl2_Window *window, Ecore_Wl2_Frame_Cb cb, void *data); 1618 1619 /** 1620 * Delete a callback that fires when the window's surface_frame callback fires 1621 * 1622 * @param handle The callback handle obtained through ecore_wl2_window_frame_callback_add(). 1623 * 1624 * @since 1.21 1625 */ 1626 EAPI void ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle); 1627 1628 /** 1629 * Push buffered wayland protocol to compositor 1630 * 1631 * Wayland protocol is only actually sent when a flush occurs, 1632 * so the display should be flushed at appropriate times, such 1633 * as after a commit. 1634 * 1635 * @param display The display to flush 1636 * 1637 * @since 1.21 1638 */ 1639 EAPI void ecore_wl2_display_flush(Ecore_Wl2_Display *display); 1640 1641 /** 1642 * Get if a given window is resizing 1643 * 1644 * @param window The window to check for resizing 1645 * 1646 * @return EINA_TRUE if resizing, EINA_FALSE otherwise 1647 * 1648 * @ingroup Ecore_Wl2_Window_Group 1649 * @since 1.21 1650 */ 1651 EAPI Eina_Bool ecore_wl2_window_resizing_get(Ecore_Wl2_Window *window); 1652 1653 /** 1654 * Latch window state at the start of an update 1655 * 1656 * When async render takes place we continue to dispatch wayland 1657 * events from the main loop. We need to defer any changes to 1658 * window state from those events until the update is complete. 1659 * 1660 * Events deferred during an update will automatically fire 1661 * immediately after the caller calls ecore_wl2_window_commit. 1662 * 1663 * @param window The window whose state we want to latch 1664 * 1665 * @since 1.21 1666 */ 1667 EAPI void ecore_wl2_window_update_begin(Ecore_Wl2_Window *window); 1668 1669 # endif 1670 1671 # undef EAPI 1672 # define EAPI 1673 1674 /* # ifdef __cplusplus */ 1675 /* } */ 1676 /* # endif */ 1677 1678 #endif 1679