summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2015-03-13 21:40:59 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-03-13 21:43:08 -0400
commitdb91d16f780989e580f2a0edfe94fce65bb2f5c4 (patch)
tree0f0204eae5e0e246ca35d4998566c1fab57cf218 /src/lib/ecore_wayland
parent426382bc8bf94f322a8cf89bf371666ba268cd40 (diff)
ecore-wayland: Whitespace cleanup
Summary: Remove trailing whitespace, convert tabs to spaces as per style guide. Reviewers: zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2157
Diffstat (limited to 'src/lib/ecore_wayland')
-rw-r--r--src/lib/ecore_wayland/Ecore_Wayland.h94
-rw-r--r--src/lib/ecore_wayland/ecore_wl.c18
-rw-r--r--src/lib/ecore_wayland/ecore_wl_dnd.c96
-rw-r--r--src/lib/ecore_wayland/ecore_wl_input.c160
-rw-r--r--src/lib/ecore_wayland/ecore_wl_output.c20
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c116
-rw-r--r--src/lib/ecore_wayland/ivi-application-client-protocol.h122
-rw-r--r--src/lib/ecore_wayland/ivi-application-protocol.c39
-rw-r--r--src/lib/ecore_wayland/subsurface-client-protocol.h82
-rw-r--r--src/lib/ecore_wayland/subsurface-protocol.c49
-rw-r--r--src/lib/ecore_wayland/xdg-shell-client-protocol.h330
-rw-r--r--src/lib/ecore_wayland/xdg-shell-protocol.c121
12 files changed, 622 insertions, 625 deletions
diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h
index 78308b9..ea59967 100644
--- a/src/lib/ecore_wayland/Ecore_Wayland.h
+++ b/src/lib/ecore_wayland/Ecore_Wayland.h
@@ -100,7 +100,7 @@ struct _Ecore_Wl_Event_Mouse_In
100{ 100{
101 int modifiers; 101 int modifiers;
102 int x, y; 102 int x, y;
103 struct 103 struct
104 { 104 {
105 int x, y; 105 int x, y;
106 } root; 106 } root;
@@ -114,7 +114,7 @@ struct _Ecore_Wl_Event_Mouse_Out
114{ 114{
115 int modifiers; 115 int modifiers;
116 int x, y; 116 int x, y;
117 struct 117 struct
118 { 118 {
119 int x, y; 119 int x, y;
120 } root; 120 } root;
@@ -151,7 +151,7 @@ struct _Ecore_Wl_Event_Dnd_Enter
151 int num_types; 151 int num_types;
152 unsigned int serial; 152 unsigned int serial;
153 struct wl_data_offer *offer; 153 struct wl_data_offer *offer;
154 struct 154 struct
155 { 155 {
156 int x, y; 156 int x, y;
157 } position; 157 } position;
@@ -160,7 +160,7 @@ struct _Ecore_Wl_Event_Dnd_Enter
160struct _Ecore_Wl_Event_Dnd_Position 160struct _Ecore_Wl_Event_Dnd_Position
161{ 161{
162 unsigned int win, source; 162 unsigned int win, source;
163 struct 163 struct
164 { 164 {
165 int x, y; 165 int x, y;
166 } position; 166 } position;
@@ -174,7 +174,7 @@ struct _Ecore_Wl_Event_Dnd_Leave
174struct _Ecore_Wl_Event_Dnd_Drop 174struct _Ecore_Wl_Event_Dnd_Drop
175{ 175{
176 unsigned int win, source; 176 unsigned int win, source;
177 struct 177 struct
178 { 178 {
179 int x, y; 179 int x, y;
180 } position; 180 } position;
@@ -230,10 +230,10 @@ struct _Ecore_Wl_Event_Interfaces_Bound
230 * @defgroup Ecore_Wl_Group Ecore_Wayland - Wayland integration 230 * @defgroup Ecore_Wl_Group Ecore_Wayland - Wayland integration
231 * @ingroup Ecore 231 * @ingroup Ecore
232 232
233 * Ecore_Wl provides a wrapper and convenience functions for using the 233 * Ecore_Wl provides a wrapper and convenience functions for using the
234 * Wayland window system. Function groups for this part of the library 234 * Wayland window system. Function groups for this part of the library
235 * include the following: 235 * include the following:
236 * 236 *
237 * @li @ref Ecore_Wl_Init_Group 237 * @li @ref Ecore_Wl_Init_Group
238 * @li @ref Ecore_Wl_Display_Group 238 * @li @ref Ecore_Wl_Display_Group
239 * @li @ref Ecore_Wl_Flush_Group 239 * @li @ref Ecore_Wl_Flush_Group
@@ -462,17 +462,17 @@ EAPI struct wl_registry *ecore_wl_registry_get(void);
462 462
463/** 463/**
464 * Creates a new window 464 * Creates a new window
465 * 465 *
466 * @param parent The parent window to use. If @p parent is @c 0, the root window 466 * @param parent The parent window to use. If @p parent is @c 0, the root window
467 * of the default display is used. 467 * of the default display is used.
468 * @param x X Position 468 * @param x X Position
469 * @param y Y position 469 * @param y Y position
470 * @param w Width 470 * @param w Width
471 * @param h Height 471 * @param h Height
472 * @param buffer_type The type of the buffer to be used to create a new Ecore_Wl_Window. 472 * @param buffer_type The type of the buffer to be used to create a new Ecore_Wl_Window.
473 * 473 *
474 * @return The new window 474 * @return The new window
475 * 475 *
476 * @ingroup Ecore_Wl_Window_Group 476 * @ingroup Ecore_Wl_Window_Group
477 * @since 1.2 477 * @since 1.2
478 */ 478 */
@@ -480,9 +480,9 @@ EAPI Ecore_Wl_Window *ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y,
480 480
481/** 481/**
482 * Deletes the given window 482 * Deletes the given window
483 * 483 *
484 * @param win The given window 484 * @param win The given window
485 * 485 *
486 * @ingroup Ecore_Wl_Window_Group 486 * @ingroup Ecore_Wl_Window_Group
487 * @since 1.2 487 * @since 1.2
488 */ 488 */
@@ -490,14 +490,14 @@ EAPI void ecore_wl_window_free(Ecore_Wl_Window *win);
490 490
491/** 491/**
492 * Signals for Wayland to initiate a window move. 492 * Signals for Wayland to initiate a window move.
493 * 493 *
494 * The position requested (@p x, @p y) is not honored by Wayland because 494 * The position requested (@p x, @p y) is not honored by Wayland because
495 * Wayland does not allow specific window placement to be set. 495 * Wayland does not allow specific window placement to be set.
496 * 496 *
497 * @param win The window to move. 497 * @param win The window to move.
498 * @param x X Position 498 * @param x X Position
499 * @param y Y Position 499 * @param y Y Position
500 * 500 *
501 * @ingroup Ecore_Wl_Window_Group 501 * @ingroup Ecore_Wl_Window_Group
502 * @since 1.2 502 * @since 1.2
503 */ 503 */
@@ -505,15 +505,15 @@ EAPI void ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y);
505 505
506/** 506/**
507 * Signals for Wayland to initiate a window resize. 507 * Signals for Wayland to initiate a window resize.
508 * 508 *
509 * The size requested (@p w, @p h) is not honored by Wayland because 509 * The size requested (@p w, @p h) is not honored by Wayland because
510 * Wayland does not allow specific window sizes to be set. 510 * Wayland does not allow specific window sizes to be set.
511 * 511 *
512 * @param win The window to resize. 512 * @param win The window to resize.
513 * @param w Width 513 * @param w Width
514 * @param h Height 514 * @param h Height
515 * @param location The edge of the window from where the resize should start. 515 * @param location The edge of the window from where the resize should start.
516 * 516 *
517 * @ingroup Ecore_Wl_Window_Group 517 * @ingroup Ecore_Wl_Window_Group
518 * @since 1.2 518 * @since 1.2
519 */ 519 */
@@ -526,11 +526,11 @@ EAPI void ecore_wl_window_commit(Ecore_Wl_Window *win);
526 526
527/** 527/**
528 * Shows a window 528 * Shows a window
529 * 529 *
530 * Synonymous to "mapping" a window in Wayland System terminology. 530 * Synonymous to "mapping" a window in Wayland System terminology.
531 * 531 *
532 * @param win The window to show. 532 * @param win The window to show.
533 * 533 *
534 * @ingroup Ecore_Wl_Window_Group 534 * @ingroup Ecore_Wl_Window_Group
535 * @since 1.2 535 * @since 1.2
536 */ 536 */
@@ -538,11 +538,11 @@ EAPI void ecore_wl_window_show(Ecore_Wl_Window *win);
538 538
539/** 539/**
540 * Hides a window 540 * Hides a window
541 * 541 *
542 * Synonymous to "unmapping" a window in Wayland System terminology. 542 * Synonymous to "unmapping" a window in Wayland System terminology.
543 * 543 *
544 * @param win The window to hide. 544 * @param win The window to hide.
545 * 545 *
546 * @ingroup Ecore_Wl_Window_Group 546 * @ingroup Ecore_Wl_Window_Group
547 * @since 1.2 547 * @since 1.2
548 */ 548 */
@@ -550,9 +550,9 @@ EAPI void ecore_wl_window_hide(Ecore_Wl_Window *win);
550 550
551/** 551/**
552 * Raises a window 552 * Raises a window
553 * 553 *
554 * @param win The window to raise. 554 * @param win The window to raise.
555 * 555 *
556 * @ingroup Ecore_Wl_Window_Group 556 * @ingroup Ecore_Wl_Window_Group
557 * @since 1.2 557 * @since 1.2
558 */ 558 */
@@ -577,9 +577,9 @@ EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *pare
577 577
578/** 578/**
579 * Iconify a window 579 * Iconify a window
580 * 580 *
581 * @param win The window to iconifiy 581 * @param win The window to iconifiy
582 * 582 *
583 * @ingroup Ecore_Wl_Window_Group 583 * @ingroup Ecore_Wl_Window_Group
584 * @since 1.12 584 * @since 1.12
585 */ 585 */
@@ -591,7 +591,7 @@ EAPI int ecore_wl_window_id_get(Ecore_Wl_Window *win);
591EAPI void ecore_wl_window_title_set(Ecore_Wl_Window *win, const char *title); 591EAPI void ecore_wl_window_title_set(Ecore_Wl_Window *win, const char *title);
592EAPI void ecore_wl_window_class_name_set(Ecore_Wl_Window *win, const char *class_name); 592EAPI void ecore_wl_window_class_name_set(Ecore_Wl_Window *win, const char *class_name);
593EAPI int ecore_wl_window_surface_id_get(Ecore_Wl_Window *win); 593EAPI int ecore_wl_window_surface_id_get(Ecore_Wl_Window *win);
594 594
595EAPI Ecore_Wl_Input *ecore_wl_window_keyboard_get(Ecore_Wl_Window *win); 595EAPI Ecore_Wl_Input *ecore_wl_window_keyboard_get(Ecore_Wl_Window *win);
596 596
597/** 597/**
@@ -609,10 +609,10 @@ EAPI Eina_Bool ecore_wl_window_alpha_get(Ecore_Wl_Window *win);
609 609
610/** 610/**
611 * Returns the Ecore_Wl_Window from a wl_surface 611 * Returns the Ecore_Wl_Window from a wl_surface
612 * 612 *
613 * @param surface The surface for which to find the Ecore_Wl_Window from 613 * @param surface The surface for which to find the Ecore_Wl_Window from
614 * @return the Ecore_Wl_Window associated with this surface 614 * @return the Ecore_Wl_Window associated with this surface
615 * 615 *
616 * @ingroup Ecore_Wl_Window_Group 616 * @ingroup Ecore_Wl_Window_Group
617 * @since 1.8 617 * @since 1.8
618 */ 618 */
@@ -620,17 +620,17 @@ EAPI Ecore_Wl_Window *ecore_wl_window_surface_find(struct wl_surface *surface);
620 620
621/** 621/**
622 * Set the input region of the Ecore_Wl_Window. 622 * Set the input region of the Ecore_Wl_Window.
623 * 623 *
624 * To set an empty region, pass width and height as 0. 624 * To set an empty region, pass width and height as 0.
625 * 625 *
626 * An empty input region means the entire window surface will accept input. 626 * An empty input region means the entire window surface will accept input.
627 * 627 *
628 * @param win The window 628 * @param win The window
629 * @param x The left point of the region. 629 * @param x The left point of the region.
630 * @param y The top point of the region. 630 * @param y The top point of the region.
631 * @param w The width of the region. 631 * @param w The width of the region.
632 * @param h The height of the region. 632 * @param h The height of the region.
633 * 633 *
634 * @ingroup Ecore_Wl_Window_Group 634 * @ingroup Ecore_Wl_Window_Group
635 * @since 1.8 635 * @since 1.8
636 */ 636 */
@@ -638,13 +638,13 @@ EAPI void ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, i
638 638
639/** 639/**
640 * Set the opaque region of the Ecore_Wl_Window 640 * Set the opaque region of the Ecore_Wl_Window
641 * 641 *
642 * @param win The window 642 * @param win The window
643 * @param x The left point of the region. 643 * @param x The left point of the region.
644 * @param y The top point of the region. 644 * @param y The top point of the region.
645 * @param w The width of the region. 645 * @param w The width of the region.
646 * @param h The height of the region. 646 * @param h The height of the region.
647 * 647 *
648 * @ingroup Ecore_Wl_Window_Group 648 * @ingroup Ecore_Wl_Window_Group
649 * @since 1.8 649 * @since 1.8
650 */ 650 */
@@ -652,10 +652,10 @@ EAPI void ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y,
652 652
653/** 653/**
654 * Set the rotation of the Ecore_Wl_Window 654 * Set the rotation of the Ecore_Wl_Window
655 * 655 *
656 * @param win The window 656 * @param win The window
657 * @param rotation The degree of rotation for this window 657 * @param rotation The degree of rotation for this window
658 * 658 *
659 * @ingroup Ecore_Wl_Window_Group 659 * @ingroup Ecore_Wl_Window_Group
660 * @since 1.8 660 * @since 1.8
661 */ 661 */
@@ -663,10 +663,10 @@ EAPI void ecore_wl_window_rotation_set(Ecore_Wl_Window *win, int rotation);
663 663
664/** 664/**
665 * Get the rotation of the Ecore_Wl_Window 665 * Get the rotation of the Ecore_Wl_Window
666 * 666 *
667 * @param win The window 667 * @param win The window
668 * @return The degree of rotation for this window 668 * @return The degree of rotation for this window
669 * 669 *
670 * @ingroup Ecore_Wl_Window_Group 670 * @ingroup Ecore_Wl_Window_Group
671 * @since 1.8 671 * @since 1.8
672 */ 672 */
@@ -681,13 +681,13 @@ EAPI int ecore_wl_window_rotation_get(Ecore_Wl_Window *win);
681 681
682/** 682/**
683 * @deprecated use ecore_wl_dnd_selection_set 683 * @deprecated use ecore_wl_dnd_selection_set
684 * @since 1.7 684 * @since 1.7
685*/ 685*/
686EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_set_selection(Ecore_Wl_Dnd *dnd, const char **types_offered); 686EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_set_selection(Ecore_Wl_Dnd *dnd, const char **types_offered);
687 687
688/** 688/**
689 * @deprecated use ecore_wl_dnd_selection_get 689 * @deprecated use ecore_wl_dnd_selection_get
690 * @since 1.7 690 * @since 1.7
691*/ 691*/
692EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_get_selection(Ecore_Wl_Dnd *dnd, const char *type); 692EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_get_selection(Ecore_Wl_Dnd *dnd, const char *type);
693 693
diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index 0446964..b6e95ce 100644
--- a/src/lib/ecore_wayland/ecore_wl.c
+++ b/src/lib/ecore_wayland/ecore_wl.c
@@ -64,7 +64,7 @@ static const struct wl_callback_listener _ecore_wl_anim_listener =
64 _ecore_wl_animator_callback 64 _ecore_wl_animator_callback
65}; 65};
66 66
67static void 67static void
68xdg_shell_ping(void *data EINA_UNUSED, struct xdg_shell *shell, uint32_t serial) 68xdg_shell_ping(void *data EINA_UNUSED, struct xdg_shell *shell, uint32_t serial)
69{ 69{
70 xdg_shell_pong(shell, serial); 70 xdg_shell_pong(shell, serial);
@@ -179,7 +179,7 @@ ecore_wl_init(const char *name)
179 _ecore_wl_disp->fd = wl_display_get_fd(_ecore_wl_disp->wl.display); 179 _ecore_wl_disp->fd = wl_display_get_fd(_ecore_wl_disp->wl.display);
180 180
181 _ecore_wl_disp->fd_hdl = 181 _ecore_wl_disp->fd_hdl =
182 ecore_main_fd_handler_add(_ecore_wl_disp->fd, 182 ecore_main_fd_handler_add(_ecore_wl_disp->fd,
183 ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR, 183 ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
184 _ecore_wl_cb_handle_data, _ecore_wl_disp, 184 _ecore_wl_cb_handle_data, _ecore_wl_disp,
185 NULL, NULL); 185 NULL, NULL);
@@ -480,8 +480,8 @@ _ecore_wl_shutdown(Eina_Bool close)
480 480
481 EINA_INLIST_FOREACH_SAFE(_ecore_wl_disp->globals, tmp, global) 481 EINA_INLIST_FOREACH_SAFE(_ecore_wl_disp->globals, tmp, global)
482 { 482 {
483 _ecore_wl_disp->globals = 483 _ecore_wl_disp->globals =
484 eina_inlist_remove(_ecore_wl_disp->globals, 484 eina_inlist_remove(_ecore_wl_disp->globals,
485 EINA_INLIST_GET(global)); 485 EINA_INLIST_GET(global));
486 free(global->interface); 486 free(global->interface);
487 free(global); 487 free(global);
@@ -646,7 +646,7 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
646#endif 646#endif
647 else if (!strcmp(interface, "xdg_shell") && !getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL")) 647 else if (!strcmp(interface, "xdg_shell") && !getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL"))
648 { 648 {
649 ewd->wl.xdg_shell = 649 ewd->wl.xdg_shell =
650 wl_registry_bind(registry, id, &xdg_shell_interface, 1); 650 wl_registry_bind(registry, id, &xdg_shell_interface, 1);
651 xdg_shell_use_unstable_version(ewd->wl.xdg_shell, XDG_VERSION); 651 xdg_shell_use_unstable_version(ewd->wl.xdg_shell, XDG_VERSION);
652 xdg_shell_add_listener(ewd->wl.xdg_shell, &xdg_shell_listener, 652 xdg_shell_add_listener(ewd->wl.xdg_shell, &xdg_shell_listener,
@@ -665,8 +665,8 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
665 _ecore_wl_input_setup(ewd->input); 665 _ecore_wl_input_setup(ewd->input);
666 else 666 else
667 { 667 {
668 ewd->cursor_theme = 668 ewd->cursor_theme =
669 wl_cursor_theme_load(NULL, ECORE_WL_DEFAULT_CURSOR_SIZE, 669 wl_cursor_theme_load(NULL, ECORE_WL_DEFAULT_CURSOR_SIZE,
670 ewd->wl.shm); 670 ewd->wl.shm);
671 } 671 }
672 } 672 }
@@ -676,7 +676,7 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
676 wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1); 676 wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1);
677 } 677 }
678 678
679 if ((ewd->wl.compositor) && (ewd->wl.shm) && 679 if ((ewd->wl.compositor) && (ewd->wl.shm) &&
680 ((ewd->wl.shell) || (ewd->wl.xdg_shell))) 680 ((ewd->wl.shell) || (ewd->wl.xdg_shell)))
681 { 681 {
682 Ecore_Wl_Event_Interfaces_Bound *ev; 682 Ecore_Wl_Event_Interfaces_Bound *ev;
@@ -710,7 +710,7 @@ _ecore_wl_cb_handle_global_remove(void *data, struct wl_registry *registry EINA_
710 EINA_INLIST_FOREACH_SAFE(ewd->globals, tmp, global) 710 EINA_INLIST_FOREACH_SAFE(ewd->globals, tmp, global)
711 { 711 {
712 if (global->id != id) continue; 712 if (global->id != id) continue;
713 ewd->globals = 713 ewd->globals =
714 eina_inlist_remove(ewd->globals, EINA_INLIST_GET(global)); 714 eina_inlist_remove(ewd->globals, EINA_INLIST_GET(global));
715 free(global->interface); 715 free(global->interface);
716 free(global); 716 free(global);
diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c b/src/lib/ecore_wayland/ecore_wl_dnd.c
index b48cc13..4fd7b05 100644
--- a/src/lib/ecore_wayland/ecore_wl_dnd.c
+++ b/src/lib/ecore_wayland/ecore_wl_dnd.c
@@ -34,25 +34,25 @@ static void _ecore_wl_dnd_source_cb_cancelled(void *data EINA_UNUSED, struct wl_
34static void _ecore_wl_dnd_offer_cb_offer(void *data, struct wl_data_offer *data_offer EINA_UNUSED, const char *type); 34static void _ecore_wl_dnd_offer_cb_offer(void *data, struct wl_data_offer *data_offer EINA_UNUSED, const char *type);
35 35
36/* local wayland interfaces */ 36/* local wayland interfaces */
37static const struct wl_data_source_listener 37static const struct wl_data_source_listener
38_ecore_wl_dnd_source_listener = 38_ecore_wl_dnd_source_listener =
39{ 39{
40 _ecore_wl_dnd_source_cb_target, 40 _ecore_wl_dnd_source_cb_target,
41 _ecore_wl_dnd_source_cb_send, 41 _ecore_wl_dnd_source_cb_send,
42 _ecore_wl_dnd_source_cb_cancelled 42 _ecore_wl_dnd_source_cb_cancelled
43}; 43};
44 44
45static const struct wl_data_offer_listener 45static const struct wl_data_offer_listener
46_ecore_wl_dnd_offer_listener = 46_ecore_wl_dnd_offer_listener =
47{ 47{
48 _ecore_wl_dnd_offer_cb_offer 48 _ecore_wl_dnd_offer_cb_offer
49}; 49};
50 50
51/** 51/**
52 * @deprecated use ecore_wl_dnd_selection_set 52 * @deprecated use ecore_wl_dnd_selection_set
53 * @since 1.7 53 * @since 1.7
54*/ 54*/
55EINA_DEPRECATED EAPI Eina_Bool 55EINA_DEPRECATED EAPI Eina_Bool
56ecore_wl_dnd_set_selection(Ecore_Wl_Dnd *dnd, const char **types_offered) 56ecore_wl_dnd_set_selection(Ecore_Wl_Dnd *dnd, const char **types_offered)
57{ 57{
58 LOGFN(__FILE__, __LINE__, __FUNCTION__); 58 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -62,9 +62,9 @@ ecore_wl_dnd_set_selection(Ecore_Wl_Dnd *dnd, const char **types_offered)
62 62
63/** 63/**
64 * @deprecated use ecore_wl_dnd_selection_get 64 * @deprecated use ecore_wl_dnd_selection_get
65 * @since 1.7 65 * @since 1.7
66*/ 66*/
67EINA_DEPRECATED EAPI Eina_Bool 67EINA_DEPRECATED EAPI Eina_Bool
68ecore_wl_dnd_get_selection(Ecore_Wl_Dnd *dnd, const char *type) 68ecore_wl_dnd_get_selection(Ecore_Wl_Dnd *dnd, const char *type)
69{ 69{
70 LOGFN(__FILE__, __LINE__, __FUNCTION__); 70 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -86,7 +86,7 @@ ecore_wl_dnd_get(void)
86 * @deprecated use ecore_wl_dnd_drag_start 86 * @deprecated use ecore_wl_dnd_drag_start
87 * @since 1.7 87 * @since 1.7
88 */ 88 */
89EINA_DEPRECATED EAPI Eina_Bool 89EINA_DEPRECATED EAPI Eina_Bool
90ecore_wl_dnd_start_drag(Ecore_Wl_Dnd *dnd EINA_UNUSED) 90ecore_wl_dnd_start_drag(Ecore_Wl_Dnd *dnd EINA_UNUSED)
91{ 91{
92 return EINA_FALSE; 92 return EINA_FALSE;
@@ -96,7 +96,7 @@ ecore_wl_dnd_start_drag(Ecore_Wl_Dnd *dnd EINA_UNUSED)
96 * @deprecated use ecore_wl_dnd_selection_owner_has 96 * @deprecated use ecore_wl_dnd_selection_owner_has
97 * @since 1.7 97 * @since 1.7
98 */ 98 */
99EINA_DEPRECATED EAPI Eina_Bool 99EINA_DEPRECATED EAPI Eina_Bool
100ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd) 100ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd)
101{ 101{
102 return ecore_wl_dnd_selection_owner_has(dnd->input); 102 return ecore_wl_dnd_selection_owner_has(dnd->input);
@@ -106,7 +106,7 @@ ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd)
106 * @ingroup Ecore_Wl_Dnd_Group 106 * @ingroup Ecore_Wl_Dnd_Group
107 * @since 1.8 107 * @since 1.8
108 */ 108 */
109EAPI Eina_Bool 109EAPI Eina_Bool
110ecore_wl_dnd_selection_set(Ecore_Wl_Input *input, const char **types_offered) 110ecore_wl_dnd_selection_set(Ecore_Wl_Input *input, const char **types_offered)
111{ 111{
112 struct wl_data_device_manager *man; 112 struct wl_data_device_manager *man;
@@ -145,11 +145,11 @@ ecore_wl_dnd_selection_set(Ecore_Wl_Input *input, const char **types_offered)
145 } 145 }
146 146
147 /* add a listener for data source events */ 147 /* add a listener for data source events */
148 wl_data_source_add_listener(input->data_source, 148 wl_data_source_add_listener(input->data_source,
149 &_ecore_wl_dnd_source_listener, input); 149 &_ecore_wl_dnd_source_listener, input);
150 150
151 /* set the selection */ 151 /* set the selection */
152 wl_data_device_set_selection(input->data_device, input->data_source, 152 wl_data_device_set_selection(input->data_device, input->data_source,
153 input->display->serial); 153 input->display->serial);
154 154
155 return EINA_TRUE; 155 return EINA_TRUE;
@@ -159,7 +159,7 @@ ecore_wl_dnd_selection_set(Ecore_Wl_Input *input, const char **types_offered)
159 * @ingroup Ecore_Wl_Dnd_Group 159 * @ingroup Ecore_Wl_Dnd_Group
160 * @since 1.8 160 * @since 1.8
161 */ 161 */
162EAPI Eina_Bool 162EAPI Eina_Bool
163ecore_wl_dnd_selection_get(Ecore_Wl_Input *input, const char *type) 163ecore_wl_dnd_selection_get(Ecore_Wl_Input *input, const char *type)
164{ 164{
165 char **t; 165 char **t;
@@ -185,7 +185,7 @@ ecore_wl_dnd_selection_get(Ecore_Wl_Input *input, const char *type)
185 * @ingroup Ecore_Wl_Dnd_Group 185 * @ingroup Ecore_Wl_Dnd_Group
186 * @since 1.8 186 * @since 1.8
187 */ 187 */
188EAPI Eina_Bool 188EAPI Eina_Bool
189ecore_wl_dnd_selection_owner_has(Ecore_Wl_Input *input) 189ecore_wl_dnd_selection_owner_has(Ecore_Wl_Input *input)
190{ 190{
191 LOGFN(__FILE__, __LINE__, __FUNCTION__); 191 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -198,7 +198,7 @@ ecore_wl_dnd_selection_owner_has(Ecore_Wl_Input *input)
198 * @ingroup Ecore_Wl_Dnd_Group 198 * @ingroup Ecore_Wl_Dnd_Group
199 * @since 1.8 199 * @since 1.8
200 */ 200 */
201EAPI Eina_Bool 201EAPI Eina_Bool
202ecore_wl_dnd_selection_clear(Ecore_Wl_Input *input) 202ecore_wl_dnd_selection_clear(Ecore_Wl_Input *input)
203{ 203{
204 LOGFN(__FILE__, __LINE__, __FUNCTION__); 204 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -207,7 +207,7 @@ ecore_wl_dnd_selection_clear(Ecore_Wl_Input *input)
207 if (!input) return EINA_FALSE; 207 if (!input) return EINA_FALSE;
208 208
209 /* set the selection to NULL */ 209 /* set the selection to NULL */
210 wl_data_device_set_selection(input->data_device, NULL, 210 wl_data_device_set_selection(input->data_device, NULL,
211 input->display->serial); 211 input->display->serial);
212 212
213 return EINA_TRUE; 213 return EINA_TRUE;
@@ -217,7 +217,7 @@ ecore_wl_dnd_selection_clear(Ecore_Wl_Input *input)
217 * @ingroup Ecore_Wl_Dnd_Group 217 * @ingroup Ecore_Wl_Dnd_Group
218 * @since 1.8 218 * @since 1.8
219 */ 219 */
220EAPI void 220EAPI void
221ecore_wl_dnd_drag_start(Ecore_Wl_Input *input, Ecore_Wl_Window *win, Ecore_Wl_Window *dragwin, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED) 221ecore_wl_dnd_drag_start(Ecore_Wl_Input *input, Ecore_Wl_Window *win, Ecore_Wl_Window *dragwin, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
222{ 222{
223 struct wl_surface *drag_surface; 223 struct wl_surface *drag_surface;
@@ -238,14 +238,14 @@ ecore_wl_dnd_drag_start(Ecore_Wl_Input *input, Ecore_Wl_Window *win, Ecore_Wl_Wi
238 ecore_wl_input_ungrab(input); 238 ecore_wl_input_ungrab(input);
239 239
240 /* add a listener for data source events */ 240 /* add a listener for data source events */
241 wl_data_source_add_listener(input->data_source, 241 wl_data_source_add_listener(input->data_source,
242 &_ecore_wl_dnd_source_listener, input); 242 &_ecore_wl_dnd_source_listener, input);
243 243
244 /* start the drag */ 244 /* start the drag */
245 if ((origin_surface = ecore_wl_window_surface_get(win))) 245 if ((origin_surface = ecore_wl_window_surface_get(win)))
246 { 246 {
247 wl_data_device_start_drag(input->data_device, input->data_source, 247 wl_data_device_start_drag(input->data_device, input->data_source,
248 origin_surface, drag_surface, 248 origin_surface, drag_surface,
249 input->display->serial); 249 input->display->serial);
250 250
251 /* set pointer image */ 251 /* set pointer image */
@@ -253,8 +253,8 @@ ecore_wl_dnd_drag_start(Ecore_Wl_Input *input, Ecore_Wl_Window *win, Ecore_Wl_Wi
253 } 253 }
254 254
255 /* NB: Below code disabled for now 255 /* NB: Below code disabled for now
256 * 256 *
257 * This Was for adjusting the "drag icon" to be centered on the mouse 257 * This Was for adjusting the "drag icon" to be centered on the mouse
258 * based on the hotspot, but it crashes for some reason :( 258 * based on the hotspot, but it crashes for some reason :(
259 */ 259 */
260 260
@@ -274,7 +274,7 @@ ecore_wl_dnd_drag_start(Ecore_Wl_Input *input, Ecore_Wl_Window *win, Ecore_Wl_Wi
274 * @ingroup Ecore_Wl_Dnd_Group 274 * @ingroup Ecore_Wl_Dnd_Group
275 * @since 1.8 275 * @since 1.8
276 */ 276 */
277EAPI void 277EAPI void
278ecore_wl_dnd_drag_end(Ecore_Wl_Input *input) 278ecore_wl_dnd_drag_end(Ecore_Wl_Input *input)
279{ 279{
280 Ecore_Wl_Event_Dnd_End *ev; 280 Ecore_Wl_Event_Dnd_End *ev;
@@ -316,7 +316,7 @@ ecore_wl_dnd_drag_end(Ecore_Wl_Input *input)
316 * @ingroup Ecore_Wl_Dnd_Group 316 * @ingroup Ecore_Wl_Dnd_Group
317 * @since 1.8 317 * @since 1.8
318 */ 318 */
319EAPI Eina_Bool 319EAPI Eina_Bool
320ecore_wl_dnd_drag_get(Ecore_Wl_Input *input, const char *type) 320ecore_wl_dnd_drag_get(Ecore_Wl_Input *input, const char *type)
321{ 321{
322 char **t; 322 char **t;
@@ -340,7 +340,7 @@ ecore_wl_dnd_drag_get(Ecore_Wl_Input *input, const char *type)
340 * @ingroup Ecore_Wl_Dnd_Group 340 * @ingroup Ecore_Wl_Dnd_Group
341 * @since 1.8 341 * @since 1.8
342 */ 342 */
343EAPI void 343EAPI void
344ecore_wl_dnd_drag_types_set(Ecore_Wl_Input *input, const char **types_offered) 344ecore_wl_dnd_drag_types_set(Ecore_Wl_Input *input, const char **types_offered)
345{ 345{
346 struct wl_data_device_manager *man; 346 struct wl_data_device_manager *man;
@@ -379,7 +379,7 @@ ecore_wl_dnd_drag_types_set(Ecore_Wl_Input *input, const char **types_offered)
379 { 379 {
380 if (!*type) continue; 380 if (!*type) continue;
381 t = wl_array_add(&input->data_types, sizeof(*t)); 381 t = wl_array_add(&input->data_types, sizeof(*t));
382 if (t) 382 if (t)
383 { 383 {
384 *t = strdup(*type); 384 *t = strdup(*type);
385 wl_data_source_offer(input->data_source, *t); 385 wl_data_source_offer(input->data_source, *t);
@@ -403,7 +403,7 @@ ecore_wl_dnd_drag_types_get(Ecore_Wl_Input *input)
403} 403}
404 404
405/* private functions */ 405/* private functions */
406void 406void
407_ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device EINA_UNUSED, struct wl_data_offer *offer) 407_ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device EINA_UNUSED, struct wl_data_offer *offer)
408{ 408{
409 Ecore_Wl_Dnd_Source *source; 409 Ecore_Wl_Dnd_Source *source;
@@ -418,11 +418,11 @@ _ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device EINA
418 source->input = input; 418 source->input = input;
419 source->data_offer = offer; 419 source->data_offer = offer;
420 420
421 wl_data_offer_add_listener(source->data_offer, 421 wl_data_offer_add_listener(source->data_offer,
422 &_ecore_wl_dnd_offer_listener, source); 422 &_ecore_wl_dnd_offer_listener, source);
423} 423}
424 424
425void 425void
426_ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device EINA_UNUSED, unsigned int timestamp, struct wl_surface *surface, int x, int y, struct wl_data_offer *offer) 426_ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device EINA_UNUSED, unsigned int timestamp, struct wl_surface *surface, int x, int y, struct wl_data_offer *offer)
427{ 427{
428 Ecore_Wl_Event_Dnd_Enter *ev; 428 Ecore_Wl_Event_Dnd_Enter *ev;
@@ -455,7 +455,7 @@ _ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device EINA_UNUSED,
455 455
456 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Dnd_Enter)))) return; 456 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Dnd_Enter)))) return;
457 457
458 if (win) 458 if (win)
459 ev->win = win->id; 459 ev->win = win->id;
460 460
461 if (input->keyboard_focus) 461 if (input->keyboard_focus)
@@ -471,7 +471,7 @@ _ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device EINA_UNUSED,
471 ecore_event_add(ECORE_WL_EVENT_DND_ENTER, ev, NULL, NULL); 471 ecore_event_add(ECORE_WL_EVENT_DND_ENTER, ev, NULL, NULL);
472} 472}
473 473
474void 474void
475_ecore_wl_dnd_leave(void *data, struct wl_data_device *data_device EINA_UNUSED) 475_ecore_wl_dnd_leave(void *data, struct wl_data_device *data_device EINA_UNUSED)
476{ 476{
477 Ecore_Wl_Event_Dnd_Leave *ev; 477 Ecore_Wl_Event_Dnd_Leave *ev;
@@ -492,7 +492,7 @@ _ecore_wl_dnd_leave(void *data, struct wl_data_device *data_device EINA_UNUSED)
492 ecore_event_add(ECORE_WL_EVENT_DND_LEAVE, ev, NULL, NULL); 492 ecore_event_add(ECORE_WL_EVENT_DND_LEAVE, ev, NULL, NULL);
493} 493}
494 494
495void 495void
496_ecore_wl_dnd_motion(void *data, struct wl_data_device *data_device EINA_UNUSED, unsigned int timestamp EINA_UNUSED, int x, int y) 496_ecore_wl_dnd_motion(void *data, struct wl_data_device *data_device EINA_UNUSED, unsigned int timestamp EINA_UNUSED, int x, int y)
497{ 497{
498 Ecore_Wl_Event_Dnd_Position *ev; 498 Ecore_Wl_Event_Dnd_Position *ev;
@@ -519,7 +519,7 @@ _ecore_wl_dnd_motion(void *data, struct wl_data_device *data_device EINA_UNUSED,
519 ecore_event_add(ECORE_WL_EVENT_DND_POSITION, ev, NULL, NULL); 519 ecore_event_add(ECORE_WL_EVENT_DND_POSITION, ev, NULL, NULL);
520} 520}
521 521
522void 522void
523_ecore_wl_dnd_drop(void *data, struct wl_data_device *data_device EINA_UNUSED) 523_ecore_wl_dnd_drop(void *data, struct wl_data_device *data_device EINA_UNUSED)
524{ 524{
525 Ecore_Wl_Event_Dnd_Drop *ev; 525 Ecore_Wl_Event_Dnd_Drop *ev;
@@ -545,7 +545,7 @@ _ecore_wl_dnd_drop(void *data, struct wl_data_device *data_device EINA_UNUSED)
545 ecore_event_add(ECORE_WL_EVENT_DND_DROP, ev, NULL, NULL); 545 ecore_event_add(ECORE_WL_EVENT_DND_DROP, ev, NULL, NULL);
546} 546}
547 547
548void 548void
549_ecore_wl_dnd_selection(void *data, struct wl_data_device *data_device EINA_UNUSED, struct wl_data_offer *offer) 549_ecore_wl_dnd_selection(void *data, struct wl_data_device *data_device EINA_UNUSED, struct wl_data_offer *offer)
550{ 550{
551 Ecore_Wl_Input *input; 551 Ecore_Wl_Input *input;
@@ -567,7 +567,7 @@ _ecore_wl_dnd_selection(void *data, struct wl_data_device *data_device EINA_UNUS
567 } 567 }
568} 568}
569 569
570void 570void
571_ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source) 571_ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source)
572{ 572{
573 LOGFN(__FILE__, __LINE__, __FUNCTION__); 573 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -583,7 +583,7 @@ _ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source)
583} 583}
584 584
585/* local functions */ 585/* local functions */
586static void 586static void
587_ecore_wl_dnd_selection_data_receive(Ecore_Wl_Dnd_Source *source, const char *type) 587_ecore_wl_dnd_selection_data_receive(Ecore_Wl_Dnd_Source *source, const char *type)
588{ 588{
589 int epoll_fd; 589 int epoll_fd;
@@ -640,7 +640,7 @@ err:
640 return; 640 return;
641} 641}
642 642
643static Eina_Bool 643static Eina_Bool
644_ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_UNUSED) 644_ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_UNUSED)
645{ 645{
646 int len; 646 int len;
@@ -655,7 +655,7 @@ _ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_
655 655
656 len = read(source->fd, buffer, sizeof buffer); 656 len = read(source->fd, buffer, sizeof buffer);
657 657
658 if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Selection_Data_Ready)))) 658 if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Selection_Data_Ready))))
659 return ECORE_CALLBACK_CANCEL; 659 return ECORE_CALLBACK_CANCEL;
660 660
661 if (len <= 0) 661 if (len <= 0)
@@ -682,13 +682,13 @@ _ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_
682 ret = ECORE_CALLBACK_RENEW; 682 ret = ECORE_CALLBACK_RENEW;
683 } 683 }
684 684
685 ecore_event_add(ECORE_WL_EVENT_SELECTION_DATA_READY, event, 685 ecore_event_add(ECORE_WL_EVENT_SELECTION_DATA_READY, event,
686 _ecore_wl_dnd_selection_data_ready_cb_free, NULL); 686 _ecore_wl_dnd_selection_data_ready_cb_free, NULL);
687 687
688 return ret; 688 return ret;
689} 689}
690 690
691static void 691static void
692_ecore_wl_dnd_selection_data_ready_cb_free(void *data EINA_UNUSED, void *event) 692_ecore_wl_dnd_selection_data_ready_cb_free(void *data EINA_UNUSED, void *event)
693{ 693{
694 Ecore_Wl_Event_Selection_Data_Ready *ev; 694 Ecore_Wl_Event_Selection_Data_Ready *ev;
@@ -722,11 +722,11 @@ _ecore_wl_dnd_selection_cb_idle(void *data)
722 free(ctx); 722 free(ctx);
723 return ECORE_CALLBACK_CANCEL; 723 return ECORE_CALLBACK_CANCEL;
724 } 724 }
725 } 725 }
726 return ECORE_CALLBACK_RENEW; 726 return ECORE_CALLBACK_RENEW;
727} 727}
728 728
729static void 729static void
730_ecore_wl_dnd_source_cb_target(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type EINA_UNUSED) 730_ecore_wl_dnd_source_cb_target(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type EINA_UNUSED)
731{ 731{
732 Ecore_Wl_Event_Data_Source_Target *event; 732 Ecore_Wl_Event_Data_Source_Target *event;
@@ -757,7 +757,7 @@ _ecore_wl_dnd_source_cb_target_free(void *data EINA_UNUSED, void *event)
757 free(ev); 757 free(ev);
758} 758}
759 759
760static void 760static void
761_ecore_wl_dnd_source_cb_send(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type, int32_t fd) 761_ecore_wl_dnd_source_cb_send(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type, int32_t fd)
762{ 762{
763 Ecore_Wl_Event_Data_Source_Send *event; 763 Ecore_Wl_Event_Data_Source_Send *event;
@@ -772,11 +772,11 @@ _ecore_wl_dnd_source_cb_send(void *data, struct wl_data_source *source EINA_UNUS
772 event->type = strdup(mime_type); 772 event->type = strdup(mime_type);
773 event->fd = fd; 773 event->fd = fd;
774 774
775 ecore_event_add(ECORE_WL_EVENT_DATA_SOURCE_SEND, event, 775 ecore_event_add(ECORE_WL_EVENT_DATA_SOURCE_SEND, event,
776 _ecore_wl_dnd_source_cb_send_free, NULL); 776 _ecore_wl_dnd_source_cb_send_free, NULL);
777} 777}
778 778
779static void 779static void
780_ecore_wl_dnd_source_cb_send_free(void *data EINA_UNUSED, void *event) 780_ecore_wl_dnd_source_cb_send_free(void *data EINA_UNUSED, void *event)
781{ 781{
782 Ecore_Wl_Event_Data_Source_Send *ev; 782 Ecore_Wl_Event_Data_Source_Send *ev;
@@ -789,7 +789,7 @@ _ecore_wl_dnd_source_cb_send_free(void *data EINA_UNUSED, void *event)
789 free(ev); 789 free(ev);
790} 790}
791 791
792static void 792static void
793_ecore_wl_dnd_source_cb_cancelled(void *data, struct wl_data_source *source) 793_ecore_wl_dnd_source_cb_cancelled(void *data, struct wl_data_source *source)
794{ 794{
795 Ecore_Wl_Input *input; 795 Ecore_Wl_Input *input;
@@ -813,7 +813,7 @@ _ecore_wl_dnd_source_cb_cancelled(void *data, struct wl_data_source *source)
813 ecore_event_add(ECORE_WL_EVENT_DATA_SOURCE_CANCELLED, ev, NULL, NULL); 813 ecore_event_add(ECORE_WL_EVENT_DATA_SOURCE_CANCELLED, ev, NULL, NULL);
814} 814}
815 815
816static void 816static void
817_ecore_wl_dnd_offer_cb_offer(void *data, struct wl_data_offer *data_offer EINA_UNUSED, const char *type) 817_ecore_wl_dnd_offer_cb_offer(void *data, struct wl_data_offer *data_offer EINA_UNUSED, const char *type)
818{ 818{
819 Ecore_Wl_Dnd_Source *source; 819 Ecore_Wl_Dnd_Source *source;
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c
index e935d7c..2d1197d 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -4,7 +4,7 @@
4 4
5/* 5/*
6 * NB: Events that receive a 'serial' instead of timestamp 6 * NB: Events that receive a 'serial' instead of timestamp
7 * 7 *
8 * input_device_attach (for pointer image) 8 * input_device_attach (for pointer image)
9 * input_device_button_event (button press/release) 9 * input_device_button_event (button press/release)
10 * input_device_key_press 10 * input_device_key_press
@@ -14,14 +14,14 @@
14 * input_device_keyboard_leave 14 * input_device_keyboard_leave
15 * input_device_touch_down 15 * input_device_touch_down
16 * input_device_touch_up 16 * input_device_touch_up
17 * 17 *
18 **/ 18 **/
19 19
20#include "ecore_wl_private.h" 20#include "ecore_wl_private.h"
21#include <sys/mman.h> 21#include <sys/mman.h>
22#include <ctype.h> 22#include <ctype.h>
23 23
24/* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ... 24/* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ...
25 * What about other OSs ?? */ 25 * What about other OSs ?? */
26#ifdef __linux__ 26#ifdef __linux__
27# include <linux/input.h> 27# include <linux/input.h>
@@ -94,7 +94,7 @@ static Ecore_Wl_Mouse_Down_Info *_ecore_wl_mouse_down_info_get(int dev);
94/* static int _ecore_wl_input_keysym_to_string(unsigned int symbol, char *buffer, int len); */ 94/* static int _ecore_wl_input_keysym_to_string(unsigned int symbol, char *buffer, int len); */
95 95
96/* wayland interfaces */ 96/* wayland interfaces */
97static const struct wl_pointer_listener pointer_listener = 97static const struct wl_pointer_listener pointer_listener =
98{ 98{
99 _ecore_wl_input_cb_pointer_enter, 99 _ecore_wl_input_cb_pointer_enter,
100 _ecore_wl_input_cb_pointer_leave, 100 _ecore_wl_input_cb_pointer_leave,
@@ -103,7 +103,7 @@ static const struct wl_pointer_listener pointer_listener =
103 _ecore_wl_input_cb_pointer_axis, 103 _ecore_wl_input_cb_pointer_axis,
104}; 104};
105 105
106static const struct wl_keyboard_listener keyboard_listener = 106static const struct wl_keyboard_listener keyboard_listener =
107{ 107{
108 _ecore_wl_input_cb_keyboard_keymap, 108 _ecore_wl_input_cb_keyboard_keymap,
109 _ecore_wl_input_cb_keyboard_enter, 109 _ecore_wl_input_cb_keyboard_enter,
@@ -112,7 +112,7 @@ static const struct wl_keyboard_listener keyboard_listener =
112 _ecore_wl_input_cb_keyboard_modifiers, 112 _ecore_wl_input_cb_keyboard_modifiers,
113}; 113};
114 114
115static const struct wl_touch_listener touch_listener = 115static const struct wl_touch_listener touch_listener =
116{ 116{
117 _ecore_wl_input_cb_touch_down, 117 _ecore_wl_input_cb_touch_down,
118 _ecore_wl_input_cb_touch_up, 118 _ecore_wl_input_cb_touch_up,
@@ -121,13 +121,13 @@ static const struct wl_touch_listener touch_listener =
121 _ecore_wl_input_cb_touch_cancel 121 _ecore_wl_input_cb_touch_cancel
122}; 122};
123 123
124static const struct wl_seat_listener _ecore_wl_seat_listener = 124static const struct wl_seat_listener _ecore_wl_seat_listener =
125{ 125{
126 _ecore_wl_input_seat_handle_capabilities, 126 _ecore_wl_input_seat_handle_capabilities,
127 NULL // _ecore_wl_input_seat_handle_name 127 NULL // _ecore_wl_input_seat_handle_name
128}; 128};
129 129
130static const struct wl_data_device_listener _ecore_wl_data_listener = 130static const struct wl_data_device_listener _ecore_wl_data_listener =
131{ 131{
132 _ecore_wl_input_cb_data_offer, 132 _ecore_wl_input_cb_data_offer,
133 _ecore_wl_input_cb_data_enter, 133 _ecore_wl_input_cb_data_enter,
@@ -137,7 +137,7 @@ static const struct wl_data_device_listener _ecore_wl_data_listener =
137 _ecore_wl_input_cb_data_selection 137 _ecore_wl_input_cb_data_selection
138}; 138};
139 139
140static const struct wl_callback_listener _ecore_wl_pointer_surface_listener = 140static const struct wl_callback_listener _ecore_wl_pointer_surface_listener =
141{ 141{
142 _ecore_wl_input_cb_pointer_frame 142 _ecore_wl_input_cb_pointer_frame
143}; 143};
@@ -145,7 +145,7 @@ static const struct wl_callback_listener _ecore_wl_pointer_surface_listener =
145/* local variables */ 145/* local variables */
146static int _pointer_x, _pointer_y; 146static int _pointer_x, _pointer_y;
147 147
148EAPI void 148EAPI void
149ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button) 149ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button)
150{ 150{
151 LOGFN(__FILE__, __LINE__, __FUNCTION__); 151 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -155,7 +155,7 @@ ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int bu
155 input->grab_button = button; 155 input->grab_button = button;
156} 156}
157 157
158EAPI void 158EAPI void
159ecore_wl_input_ungrab(Ecore_Wl_Input *input) 159ecore_wl_input_ungrab(Ecore_Wl_Input *input)
160{ 160{
161 LOGFN(__FILE__, __LINE__, __FUNCTION__); 161 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -163,7 +163,7 @@ ecore_wl_input_ungrab(Ecore_Wl_Input *input)
163 if (!input) return; 163 if (!input) return;
164 164
165 if ((input->grab) && (input->grab_button)) 165 if ((input->grab) && (input->grab_button))
166 _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button, 166 _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button,
167 input->grab_timestamp); 167 input->grab_timestamp);
168 168
169 input->grab = NULL; 169 input->grab = NULL;
@@ -222,7 +222,7 @@ ecore_wl_input_cursor_size_set(Ecore_Wl_Input *input, const int size)
222 222
223 EINA_SAFETY_ON_NULL_RETURN(input->display->wl.shm); 223 EINA_SAFETY_ON_NULL_RETURN(input->display->wl.shm);
224 224
225 input->display->cursor_theme = 225 input->display->cursor_theme =
226 wl_cursor_theme_load(NULL, input->cursor_size, input->display->wl.shm); 226 wl_cursor_theme_load(NULL, input->cursor_size, input->display->wl.shm);
227} 227}
228 228
@@ -298,7 +298,7 @@ ecore_wl_input_cursor_from_name_set(Ecore_Wl_Input *input, const char *cursor_na
298 eina_stringshare_replace(&input->cursor_name, cursor_name); 298 eina_stringshare_replace(&input->cursor_name, cursor_name);
299 299
300 /* No cursor. Set to default Left Pointer */ 300 /* No cursor. Set to default Left Pointer */
301 if (!cursor_name) 301 if (!cursor_name)
302 eina_stringshare_replace(&input->cursor_name, "left_ptr"); 302 eina_stringshare_replace(&input->cursor_name, "left_ptr");
303 303
304 /* try to get this cursor from the theme */ 304 /* try to get this cursor from the theme */
@@ -390,11 +390,11 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
390 390
391 if (ewd->wl.shm) 391 if (ewd->wl.shm)
392 _ecore_wl_input_setup(input); 392 _ecore_wl_input_setup(input);
393 input->seat = 393 input->seat =
394 wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1); 394 wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1);
395 ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input)); 395 ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input));
396 396
397 wl_seat_add_listener(input->seat, 397 wl_seat_add_listener(input->seat,
398 &_ecore_wl_seat_listener, input); 398 &_ecore_wl_seat_listener, input);
399 wl_seat_set_user_data(input->seat, input); 399 wl_seat_set_user_data(input->seat, input);
400 400
@@ -402,17 +402,17 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
402 402
403 if (ewd->wl.data_device_manager) 403 if (ewd->wl.data_device_manager)
404 { 404 {
405 input->data_device = 405 input->data_device =
406 wl_data_device_manager_get_data_device(ewd->wl.data_device_manager, 406 wl_data_device_manager_get_data_device(ewd->wl.data_device_manager,
407 input->seat); 407 input->seat);
408 wl_data_device_add_listener(input->data_device, 408 wl_data_device_add_listener(input->data_device,
409 &_ecore_wl_data_listener, input); 409 &_ecore_wl_data_listener, input);
410 } 410 }
411 411
412 ewd->input = input; 412 ewd->input = input;
413} 413}
414 414
415void 415void
416_ecore_wl_input_del(Ecore_Wl_Input *input) 416_ecore_wl_input_del(Ecore_Wl_Input *input)
417{ 417{
418 if (!input) return; 418 if (!input) return;
@@ -486,14 +486,14 @@ _ecore_wl_input_del(Ecore_Wl_Input *input)
486 free(input); 486 free(input);
487} 487}
488 488
489void 489void
490_ecore_wl_input_pointer_xy_get(int *x, int *y) 490_ecore_wl_input_pointer_xy_get(int *x, int *y)
491{ 491{
492 if (x) *x = _pointer_x; 492 if (x) *x = _pointer_x;
493 if (y) *y = _pointer_y; 493 if (y) *y = _pointer_y;
494} 494}
495 495
496static void 496static void
497_ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) 497_ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps)
498{ 498{
499 Ecore_Wl_Input *input; 499 Ecore_Wl_Input *input;
@@ -510,7 +510,7 @@ _ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum
510 510
511 if (!input->cursor_surface) 511 if (!input->cursor_surface)
512 { 512 {
513 input->cursor_surface = 513 input->cursor_surface =
514 wl_compositor_create_surface(_ecore_wl_disp->wl.compositor); 514 wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
515 } 515 }
516 } 516 }
@@ -547,7 +547,7 @@ _ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum
547 } 547 }
548} 548}
549 549
550static void 550static void
551_ecore_wl_input_cb_pointer_motion(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, wl_fixed_t sx, wl_fixed_t sy) 551_ecore_wl_input_cb_pointer_motion(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, wl_fixed_t sx, wl_fixed_t sy)
552{ 552{
553 Ecore_Wl_Input *input; 553 Ecore_Wl_Input *input;
@@ -565,7 +565,7 @@ _ecore_wl_input_cb_pointer_motion(void *data, struct wl_pointer *pointer EINA_UN
565 _ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp, 0); 565 _ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp, 0);
566} 566}
567 567
568static void 568static void
569_ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int button, unsigned int state) 569_ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int button, unsigned int state)
570{ 570{
571 Ecore_Wl_Input *input; 571 Ecore_Wl_Input *input;
@@ -604,7 +604,7 @@ _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UN
604// _ecore_wl_input_mouse_move_send(input, timestamp); 604// _ecore_wl_input_mouse_move_send(input, timestamp);
605} 605}
606 606
607static void 607static void
608_ecore_wl_input_cb_pointer_axis(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, unsigned int axis, wl_fixed_t value) 608_ecore_wl_input_cb_pointer_axis(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, unsigned int axis, wl_fixed_t value)
609{ 609{
610 Ecore_Wl_Input *input; 610 Ecore_Wl_Input *input;
@@ -612,11 +612,11 @@ _ecore_wl_input_cb_pointer_axis(void *data, struct wl_pointer *pointer EINA_UNUS
612 LOGFN(__FILE__, __LINE__, __FUNCTION__); 612 LOGFN(__FILE__, __LINE__, __FUNCTION__);
613 613
614 if (!(input = data)) return; 614 if (!(input = data)) return;
615 _ecore_wl_input_mouse_wheel_send(input, axis, wl_fixed_to_int(value), 615 _ecore_wl_input_mouse_wheel_send(input, axis, wl_fixed_to_int(value),
616 timestamp); 616 timestamp);
617} 617}
618 618
619static void 619static void
620_ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED) 620_ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED)
621{ 621{
622 Ecore_Wl_Input *input; 622 Ecore_Wl_Input *input;
@@ -641,12 +641,12 @@ _ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsig
641 if ((input->cursor->image_count > 1) && (!input->cursor_frame_cb)) 641 if ((input->cursor->image_count > 1) && (!input->cursor_frame_cb))
642 { 642 {
643 input->cursor_frame_cb = wl_surface_frame(input->cursor_surface); 643 input->cursor_frame_cb = wl_surface_frame(input->cursor_surface);
644 wl_callback_add_listener(input->cursor_frame_cb, 644 wl_callback_add_listener(input->cursor_frame_cb,
645 &_ecore_wl_pointer_surface_listener, input); 645 &_ecore_wl_pointer_surface_listener, input);
646 } 646 }
647} 647}
648 648
649static void 649static void
650_ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size) 650_ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size)
651{ 651{
652 Ecore_Wl_Input *input; 652 Ecore_Wl_Input *input;
@@ -673,8 +673,8 @@ _ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA
673 return; 673 return;
674 } 674 }
675 675
676 input->xkb.keymap = 676 input->xkb.keymap =
677 xkb_map_new_from_string(input->display->xkb.context, map, 677 xkb_map_new_from_string(input->display->xkb.context, map,
678 XKB_KEYMAP_FORMAT_TEXT_V1, 0); 678 XKB_KEYMAP_FORMAT_TEXT_V1, 0);
679 679
680 munmap(map, size); 680 munmap(map, size);
@@ -688,21 +688,21 @@ _ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA
688 return; 688 return;
689 } 689 }
690 690
691 input->xkb.control_mask = 691 input->xkb.control_mask =
692 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CTRL); 692 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CTRL);
693 input->xkb.alt_mask = 693 input->xkb.alt_mask =
694 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_ALT); 694 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_ALT);
695 input->xkb.shift_mask = 695 input->xkb.shift_mask =
696 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_SHIFT); 696 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_SHIFT);
697 input->xkb.win_mask = 697 input->xkb.win_mask =
698 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_LOGO); 698 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_LOGO);
699 input->xkb.scroll_mask = 699 input->xkb.scroll_mask =
700 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_SCROLL); 700 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_SCROLL);
701 input->xkb.num_mask = 701 input->xkb.num_mask =
702 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_NUM); 702 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_NUM);
703 input->xkb.caps_mask = 703 input->xkb.caps_mask =
704 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CAPS); 704 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CAPS);
705 input->xkb.altgr_mask = 705 input->xkb.altgr_mask =
706 1 << xkb_map_mod_get_index(input->xkb.keymap, "ISO_Level3_Shift"); 706 1 << xkb_map_mod_get_index(input->xkb.keymap, "ISO_Level3_Shift");
707} 707}
708 708
@@ -750,7 +750,7 @@ _ecore_wl_input_keymap_translate_keysym(xkb_keysym_t keysym, unsigned int modifi
750 return 1; 750 return 1;
751} 751}
752 752
753static void 753static void
754_ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int keycode, unsigned int state) 754_ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int keycode, unsigned int state)
755{ 755{
756 Ecore_Wl_Input *input; 756 Ecore_Wl_Input *input;
@@ -766,7 +766,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
766 if (!(input = data)) return; 766 if (!(input = data)) return;
767 767
768 win = input->keyboard_focus; 768 win = input->keyboard_focus;
769 if ((!win) || (win->keyboard_device != input) || (!input->xkb.state)) 769 if ((!win) || (win->keyboard_device != input) || (!input->xkb.state))
770 return; 770 return;
771 771
772 input->display->serial = serial; 772 input->display->serial = serial;
@@ -789,8 +789,8 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
789 snprintf(keyname, sizeof(keyname), "Keycode-%u", code); 789 snprintf(keyname, sizeof(keyname), "Keycode-%u", code);
790 790
791 /* if shift is active, we need to transform the key to lower */ 791 /* if shift is active, we need to transform the key to lower */
792 if (xkb_state_mod_index_is_active(input->xkb.state, 792 if (xkb_state_mod_index_is_active(input->xkb.state,
793 xkb_map_mod_get_index(input->xkb.keymap, 793 xkb_map_mod_get_index(input->xkb.keymap,
794 XKB_MOD_NAME_SHIFT), 794 XKB_MOD_NAME_SHIFT),
795 XKB_STATE_MODS_EFFECTIVE)) 795 XKB_STATE_MODS_EFFECTIVE))
796 { 796 {
@@ -799,7 +799,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
799 } 799 }
800 800
801 memset(compose, 0, sizeof(compose)); 801 memset(compose, 0, sizeof(compose));
802 _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, 802 _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers,
803 compose, sizeof(compose)); 803 compose, sizeof(compose));
804 804
805 e = malloc(sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) + 805 e = malloc(sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
@@ -844,14 +844,14 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
844 844
845 if (!input->repeat.tmr) 845 if (!input->repeat.tmr)
846 { 846 {
847 input->repeat.tmr = 847 input->repeat.tmr =
848 ecore_timer_add(0.025, _ecore_wl_input_cb_keyboard_repeat, input); 848 ecore_timer_add(0.025, _ecore_wl_input_cb_keyboard_repeat, input);
849 } 849 }
850 ecore_timer_delay(input->repeat.tmr, 0.4); 850 ecore_timer_delay(input->repeat.tmr, 0.4);
851 } 851 }
852} 852}
853 853
854static void 854static void
855_ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial EINA_UNUSED, unsigned int depressed, unsigned int latched, unsigned int locked, unsigned int group) 855_ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial EINA_UNUSED, unsigned int depressed, unsigned int latched, unsigned int locked, unsigned int group)
856{ 856{
857 Ecore_Wl_Input *input; 857 Ecore_Wl_Input *input;
@@ -863,10 +863,10 @@ _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard E
863 863
864 if (!input->xkb.keymap) return; 864 if (!input->xkb.keymap) return;
865 865
866 xkb_state_update_mask(input->xkb.state, 866 xkb_state_update_mask(input->xkb.state,
867 depressed, latched, locked, 0, 0, group); 867 depressed, latched, locked, 0, 0, group);
868 868
869 mask = xkb_state_serialize_mods(input->xkb.state, 869 mask = xkb_state_serialize_mods(input->xkb.state,
870 (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED)); 870 (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED));
871 871
872 input->modifiers = 0; 872 input->modifiers = 0;
@@ -888,7 +888,7 @@ _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard E
888 input->modifiers |= ECORE_EVENT_MODIFIER_ALTGR; 888 input->modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
889} 889}
890 890
891static Eina_Bool 891static Eina_Bool
892_ecore_wl_input_cb_keyboard_repeat(void *data) 892_ecore_wl_input_cb_keyboard_repeat(void *data)
893{ 893{
894 Ecore_Wl_Input *input; 894 Ecore_Wl_Input *input;
@@ -899,14 +899,14 @@ _ecore_wl_input_cb_keyboard_repeat(void *data)
899 if (!(input = data)) return ECORE_CALLBACK_RENEW; 899 if (!(input = data)) return ECORE_CALLBACK_RENEW;
900 900
901 if ((win = input->keyboard_focus)) 901 if ((win = input->keyboard_focus))
902 _ecore_wl_input_cb_keyboard_key(input, NULL, input->display->serial, 902 _ecore_wl_input_cb_keyboard_key(input, NULL, input->display->serial,
903 input->repeat.time, 903 input->repeat.time,
904 input->repeat.key, EINA_TRUE); 904 input->repeat.key, EINA_TRUE);
905 905
906 return ECORE_CALLBACK_RENEW; 906 return ECORE_CALLBACK_RENEW;
907} 907}
908 908
909static void 909static void
910_ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy) 910_ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy)
911{ 911{
912 Ecore_Wl_Input *input; 912 Ecore_Wl_Input *input;
@@ -941,10 +941,10 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNU
941 941
942 if (win->pointer.set) 942 if (win->pointer.set)
943 { 943 {
944 ecore_wl_input_pointer_set(input, win->pointer.surface, 944 ecore_wl_input_pointer_set(input, win->pointer.surface,
945 win->pointer.hot_x, win->pointer.hot_y); 945 win->pointer.hot_x, win->pointer.hot_y);
946 } 946 }
947 /* NB: Commented out for now. Not needed in most circumstances, 947 /* NB: Commented out for now. Not needed in most circumstances,
948 * but left here for any corner-cases */ 948 * but left here for any corner-cases */
949 /* else */ 949 /* else */
950 /* { */ 950 /* { */
@@ -955,7 +955,7 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNU
955 } 955 }
956} 956}
957 957
958static void 958static void
959_ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface) 959_ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface)
960{ 960{
961 Ecore_Wl_Input *input; 961 Ecore_Wl_Input *input;
@@ -968,7 +968,7 @@ _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNU
968 968
969 input->display->serial = serial; 969 input->display->serial = serial;
970 970
971 /* NB: Commented out for now. Not needed in most circumstances, but left 971 /* NB: Commented out for now. Not needed in most circumstances, but left
972 * here for any corner-cases */ 972 * here for any corner-cases */
973 /* _ecore_wl_input_cursor_update(input); */ 973 /* _ecore_wl_input_cursor_update(input); */
974 974
@@ -989,7 +989,7 @@ _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNU
989 } 989 }
990} 990}
991 991
992static void 992static void
993_ecore_wl_input_cb_keyboard_enter(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface, struct wl_array *keys EINA_UNUSED) 993_ecore_wl_input_cb_keyboard_enter(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface, struct wl_array *keys EINA_UNUSED)
994{ 994{
995 Ecore_Wl_Input *input; 995 Ecore_Wl_Input *input;
@@ -1018,7 +1018,7 @@ _ecore_wl_input_cb_keyboard_enter(void *data, struct wl_keyboard *keyboard EINA_
1018 _ecore_wl_input_focus_in_send(input, win, input->timestamp); 1018 _ecore_wl_input_focus_in_send(input, win, input->timestamp);
1019} 1019}
1020 1020
1021static void 1021static void
1022_ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface) 1022_ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface)
1023{ 1023{
1024 Ecore_Wl_Input *input; 1024 Ecore_Wl_Input *input;
@@ -1051,7 +1051,7 @@ _ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_
1051 input->keyboard_focus = NULL; 1051 input->keyboard_focus = NULL;
1052} 1052}
1053 1053
1054static void 1054static void
1055_ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, struct wl_surface *surface, int id, wl_fixed_t x, wl_fixed_t y) 1055_ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, struct wl_surface *surface, int id, wl_fixed_t x, wl_fixed_t y)
1056{ 1056{
1057 Ecore_Wl_Input *input; 1057 Ecore_Wl_Input *input;
@@ -1082,7 +1082,7 @@ _ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, un
1082 id, BTN_LEFT, timestamp); 1082 id, BTN_LEFT, timestamp);
1083} 1083}
1084 1084
1085static void 1085static void
1086_ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, int id) 1086_ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, int id)
1087{ 1087{
1088 Ecore_Wl_Input *input; 1088 Ecore_Wl_Input *input;
@@ -1100,7 +1100,7 @@ _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsi
1100 ecore_wl_input_ungrab(input); 1100 ecore_wl_input_ungrab(input);
1101} 1101}
1102 1102
1103static void 1103static void
1104_ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int timestamp, int id, wl_fixed_t x, wl_fixed_t y) 1104_ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int timestamp, int id, wl_fixed_t x, wl_fixed_t y)
1105{ 1105{
1106 Ecore_Wl_Input *input; 1106 Ecore_Wl_Input *input;
@@ -1117,19 +1117,19 @@ _ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED,
1117 _ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id); 1117 _ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id);
1118} 1118}
1119 1119
1120static void 1120static void
1121_ecore_wl_input_cb_touch_frame(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED) 1121_ecore_wl_input_cb_touch_frame(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED)
1122{ 1122{
1123 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1123 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1124} 1124}
1125 1125
1126static void 1126static void
1127_ecore_wl_input_cb_touch_cancel(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED) 1127_ecore_wl_input_cb_touch_cancel(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED)
1128{ 1128{
1129 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1129 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1130} 1130}
1131 1131
1132static void 1132static void
1133_ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer) 1133_ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer)
1134{ 1134{
1135 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1135 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1137,7 +1137,7 @@ _ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, st
1137 _ecore_wl_dnd_add(data, data_device, offer); 1137 _ecore_wl_dnd_add(data, data_device, offer);
1138} 1138}
1139 1139
1140static void 1140static void
1141_ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, unsigned int timestamp, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *offer) 1141_ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, unsigned int timestamp, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *offer)
1142{ 1142{
1143 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1143 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1147,7 +1147,7 @@ _ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, un
1147 _ecore_wl_dnd_enter(data, data_device, timestamp, surface, x, y, offer); 1147 _ecore_wl_dnd_enter(data, data_device, timestamp, surface, x, y, offer);
1148} 1148}
1149 1149
1150static void 1150static void
1151_ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device) 1151_ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device)
1152{ 1152{
1153 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1153 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1155,7 +1155,7 @@ _ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device)
1155 _ecore_wl_dnd_leave(data, data_device); 1155 _ecore_wl_dnd_leave(data, data_device);
1156} 1156}
1157 1157
1158static void 1158static void
1159_ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *data_device, unsigned int timestamp, wl_fixed_t x, wl_fixed_t y) 1159_ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *data_device, unsigned int timestamp, wl_fixed_t x, wl_fixed_t y)
1160{ 1160{
1161 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1161 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1163,7 +1163,7 @@ _ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *data_device, u
1163 _ecore_wl_dnd_motion(data, data_device, timestamp, x, y); 1163 _ecore_wl_dnd_motion(data, data_device, timestamp, x, y);
1164} 1164}
1165 1165
1166static void 1166static void
1167_ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device) 1167_ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device)
1168{ 1168{
1169 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1169 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1171,7 +1171,7 @@ _ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device)
1171 _ecore_wl_dnd_drop(data, data_device); 1171 _ecore_wl_dnd_drop(data, data_device);
1172} 1172}
1173 1173
1174static void 1174static void
1175_ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer) 1175_ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer)
1176{ 1176{
1177 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1177 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1179,7 +1179,7 @@ _ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device
1179 _ecore_wl_dnd_selection(data, data_device, offer); 1179 _ecore_wl_dnd_selection(data, data_device, offer);
1180} 1180}
1181 1181
1182static void 1182static void
1183_ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp, int device) 1183_ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp, int device)
1184{ 1184{
1185 Ecore_Event_Mouse_Move *ev; 1185 Ecore_Event_Mouse_Move *ev;
@@ -1221,7 +1221,7 @@ _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
1221 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL); 1221 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
1222} 1222}
1223 1223
1224static void 1224static void
1225_ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp) 1225_ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp)
1226{ 1226{
1227 Ecore_Wl_Event_Mouse_In *ev; 1227 Ecore_Wl_Event_Mouse_In *ev;
@@ -1246,7 +1246,7 @@ _ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsig
1246 ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL); 1246 ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL);
1247} 1247}
1248 1248
1249static void 1249static void
1250_ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp) 1250_ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp)
1251{ 1251{
1252 Ecore_Wl_Event_Mouse_Out *ev; 1252 Ecore_Wl_Event_Mouse_Out *ev;
@@ -1271,7 +1271,7 @@ _ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsi
1271 ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL); 1271 ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL);
1272} 1272}
1273 1273
1274static void 1274static void
1275_ecore_wl_input_focus_in_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp) 1275_ecore_wl_input_focus_in_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp)
1276{ 1276{
1277 Ecore_Wl_Event_Focus_In *ev; 1277 Ecore_Wl_Event_Focus_In *ev;
@@ -1284,7 +1284,7 @@ _ecore_wl_input_focus_in_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window
1284 ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL); 1284 ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL);
1285} 1285}
1286 1286
1287static void 1287static void
1288_ecore_wl_input_focus_out_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp) 1288_ecore_wl_input_focus_out_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp)
1289{ 1289{
1290 Ecore_Wl_Event_Focus_Out *ev; 1290 Ecore_Wl_Event_Focus_Out *ev;
@@ -1297,7 +1297,7 @@ _ecore_wl_input_focus_out_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Windo
1297 ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL); 1297 ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL);
1298} 1298}
1299 1299
1300static void 1300static void
1301_ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp) 1301_ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp)
1302{ 1302{
1303 Ecore_Event_Mouse_Button *ev; 1303 Ecore_Event_Mouse_Button *ev;
@@ -1344,7 +1344,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int
1344 //Check Double Clicked 1344 //Check Double Clicked
1345 if (((int)(timestamp - down_info->last_time) <= 1345 if (((int)(timestamp - down_info->last_time) <=
1346 (int)(1000 * _ecore_wl_double_click_time)) && 1346 (int)(1000 * _ecore_wl_double_click_time)) &&
1347 ((win) && 1347 ((win) &&
1348 (win->id == down_info->last_win) && 1348 (win->id == down_info->last_win) &&
1349 (win->id == down_info->last_event_win))) 1349 (win->id == down_info->last_event_win)))
1350 { 1350 {
@@ -1360,7 +1360,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int
1360 //Check Triple Clicked 1360 //Check Triple Clicked
1361 if (((int)(timestamp - down_info->last_last_time) <= 1361 if (((int)(timestamp - down_info->last_last_time) <=
1362 (int)(2 * 1000 * _ecore_wl_double_click_time)) && 1362 (int)(2 * 1000 * _ecore_wl_double_click_time)) &&
1363 ((win) && 1363 ((win) &&
1364 (win->id == down_info->last_win) && 1364 (win->id == down_info->last_win) &&
1365 (win->id == down_info->last_last_win) && 1365 (win->id == down_info->last_last_win) &&
1366 (win->id == down_info->last_event_win) && 1366 (win->id == down_info->last_event_win) &&
@@ -1406,7 +1406,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int
1406 } 1406 }
1407} 1407}
1408 1408
1409static void 1409static void
1410_ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp) 1410_ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp)
1411{ 1411{
1412 Ecore_Event_Mouse_Button *ev; 1412 Ecore_Event_Mouse_Button *ev;
@@ -1470,7 +1470,7 @@ _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int d
1470 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL); 1470 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
1471} 1471}
1472 1472
1473static void 1473static void
1474_ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp) 1474_ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp)
1475{ 1475{
1476 Ecore_Event_Mouse_Wheel *ev; 1476 Ecore_Event_Mouse_Wheel *ev;
diff --git a/src/lib/ecore_wayland/ecore_wl_output.c b/src/lib/ecore_wayland/ecore_wl_output.c
index 4a422ff..28c430f 100644
--- a/src/lib/ecore_wayland/ecore_wl_output.c
+++ b/src/lib/ecore_wayland/ecore_wl_output.c
@@ -4,7 +4,7 @@
4 4
5#include "ecore_wl_private.h" 5#include "ecore_wl_private.h"
6 6
7static void 7static void
8_ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output EINA_UNUSED, int x, int y, int w, int h, int subpixel EINA_UNUSED, const char *make EINA_UNUSED, const char *model EINA_UNUSED, int transform) 8_ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output EINA_UNUSED, int x, int y, int w, int h, int subpixel EINA_UNUSED, const char *make EINA_UNUSED, const char *model EINA_UNUSED, int transform)
9{ 9{
10 Ecore_Wl_Output *output; 10 Ecore_Wl_Output *output;
@@ -19,7 +19,7 @@ _ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output EINA_UNUSED
19 output->transform = transform; 19 output->transform = transform;
20} 20}
21 21
22static void 22static void
23_ecore_wl_output_cb_mode(void *data, struct wl_output *wl_output EINA_UNUSED, unsigned int flags, int w, int h, int refresh EINA_UNUSED) 23_ecore_wl_output_cb_mode(void *data, struct wl_output *wl_output EINA_UNUSED, unsigned int flags, int w, int h, int refresh EINA_UNUSED)
24{ 24{
25 Ecore_Wl_Output *output; 25 Ecore_Wl_Output *output;
@@ -38,20 +38,20 @@ _ecore_wl_output_cb_mode(void *data, struct wl_output *wl_output EINA_UNUSED, un
38 } 38 }
39} 39}
40 40
41static void 41static void
42_ecore_wl_output_cb_done(void *data EINA_UNUSED, struct wl_output *output EINA_UNUSED) 42_ecore_wl_output_cb_done(void *data EINA_UNUSED, struct wl_output *output EINA_UNUSED)
43{ 43{
44 44
45} 45}
46 46
47static void 47static void
48_ecore_wl_output_cb_scale(void *data EINA_UNUSED, struct wl_output *output EINA_UNUSED, int scale EINA_UNUSED) 48_ecore_wl_output_cb_scale(void *data EINA_UNUSED, struct wl_output *output EINA_UNUSED, int scale EINA_UNUSED)
49{ 49{
50 50
51} 51}
52 52
53/* wayland listeners */ 53/* wayland listeners */
54static const struct wl_output_listener _ecore_wl_output_listener = 54static const struct wl_output_listener _ecore_wl_output_listener =
55{ 55{
56 _ecore_wl_output_cb_geometry, 56 _ecore_wl_output_cb_geometry,
57 _ecore_wl_output_cb_mode, 57 _ecore_wl_output_cb_mode,
@@ -66,7 +66,7 @@ ecore_wl_outputs_get(void)
66 return _ecore_wl_disp->outputs; 66 return _ecore_wl_disp->outputs;
67} 67}
68 68
69void 69void
70_ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id) 70_ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id)
71{ 71{
72 Ecore_Wl_Output *output; 72 Ecore_Wl_Output *output;
@@ -79,20 +79,20 @@ _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id)
79 79
80 output->display = ewd; 80 output->display = ewd;
81 81
82 output->output = 82 output->output =
83 wl_registry_bind(ewd->wl.registry, id, &wl_output_interface, 2); 83 wl_registry_bind(ewd->wl.registry, id, &wl_output_interface, 2);
84 84
85 ewd->outputs = eina_inlist_append(ewd->outputs, EINA_INLIST_GET(output)); 85 ewd->outputs = eina_inlist_append(ewd->outputs, EINA_INLIST_GET(output));
86 wl_output_add_listener(output->output, &_ecore_wl_output_listener, output); 86 wl_output_add_listener(output->output, &_ecore_wl_output_listener, output);
87} 87}
88 88
89void 89void
90_ecore_wl_output_del(Ecore_Wl_Output *output) 90_ecore_wl_output_del(Ecore_Wl_Output *output)
91{ 91{
92 if (!output) return; 92 if (!output) return;
93 if (output->destroy) (*output->destroy)(output, output->data); 93 if (output->destroy) (*output->destroy)(output, output->data);
94 if (output->output) wl_output_destroy(output->output); 94 if (output->output) wl_output_destroy(output->output);
95 _ecore_wl_disp->outputs = 95 _ecore_wl_disp->outputs =
96 eina_inlist_remove(_ecore_wl_disp->outputs, EINA_INLIST_GET(output)); 96 eina_inlist_remove(_ecore_wl_disp->outputs, EINA_INLIST_GET(output));
97 free(output); 97 free(output);
98} 98}
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index 074549e..05f3832 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -21,39 +21,39 @@ static void _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup
21static Eina_Hash *_windows = NULL; 21static Eina_Hash *_windows = NULL;
22 22
23/* wayland listeners */ 23/* wayland listeners */
24static const struct wl_surface_listener _ecore_wl_surface_listener = 24static const struct wl_surface_listener _ecore_wl_surface_listener =
25{ 25{
26 _ecore_wl_window_cb_surface_enter, 26 _ecore_wl_window_cb_surface_enter,
27 _ecore_wl_window_cb_surface_leave 27 _ecore_wl_window_cb_surface_leave
28}; 28};
29 29
30static const struct wl_shell_surface_listener _ecore_wl_shell_surface_listener = 30static const struct wl_shell_surface_listener _ecore_wl_shell_surface_listener =
31{ 31{
32 _ecore_wl_window_cb_ping, 32 _ecore_wl_window_cb_ping,
33 _ecore_wl_window_cb_configure, 33 _ecore_wl_window_cb_configure,
34 _ecore_wl_window_cb_popup_done 34 _ecore_wl_window_cb_popup_done
35}; 35};
36 36
37static const struct xdg_surface_listener _ecore_xdg_surface_listener = 37static const struct xdg_surface_listener _ecore_xdg_surface_listener =
38{ 38{
39 _ecore_xdg_handle_surface_configure, 39 _ecore_xdg_handle_surface_configure,
40 _ecore_xdg_handle_surface_delete, 40 _ecore_xdg_handle_surface_delete,
41}; 41};
42 42
43static const struct xdg_popup_listener _ecore_xdg_popup_listener = 43static const struct xdg_popup_listener _ecore_xdg_popup_listener =
44{ 44{
45 _ecore_xdg_handle_popup_done, 45 _ecore_xdg_handle_popup_done,
46}; 46};
47 47
48/* internal functions */ 48/* internal functions */
49void 49void
50_ecore_wl_window_init(void) 50_ecore_wl_window_init(void)
51{ 51{
52 if (!_windows) 52 if (!_windows)
53 _windows = eina_hash_string_superfast_new(NULL); 53 _windows = eina_hash_string_superfast_new(NULL);
54} 54}
55 55
56void 56void
57_ecore_wl_window_shutdown(void) 57_ecore_wl_window_shutdown(void)
58{ 58{
59 eina_hash_free(_windows); 59 eina_hash_free(_windows);
@@ -101,10 +101,10 @@ ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buf
101 win->opaque.w = w; 101 win->opaque.w = w;
102 win->opaque.h = h; 102 win->opaque.h = h;
103 103
104 win->opaque_region = 104 win->opaque_region =
105 wl_compositor_create_region(_ecore_wl_compositor_get()); 105 wl_compositor_create_region(_ecore_wl_compositor_get());
106 106
107 win->input_region = 107 win->input_region =
108 wl_compositor_create_region(_ecore_wl_compositor_get()); 108 wl_compositor_create_region(_ecore_wl_compositor_get());
109 109
110 win->title = NULL; 110 win->title = NULL;
@@ -114,7 +114,7 @@ ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buf
114 return win; 114 return win;
115} 115}
116 116
117EAPI void 117EAPI void
118ecore_wl_window_free(Ecore_Wl_Window *win) 118ecore_wl_window_free(Ecore_Wl_Window *win)
119{ 119{
120 Ecore_Wl_Input *input; 120 Ecore_Wl_Input *input;
@@ -166,7 +166,7 @@ ecore_wl_window_free(Ecore_Wl_Window *win)
166 free(win); 166 free(win);
167} 167}
168 168
169EAPI void 169EAPI void
170ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y) 170ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y)
171{ 171{
172 Ecore_Wl_Input *input; 172 Ecore_Wl_Input *input;
@@ -195,7 +195,7 @@ ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y)
195 input->display->serial); 195 input->display->serial);
196} 196}
197 197
198EAPI void 198EAPI void
199ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location) 199ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location)
200{ 200{
201 Ecore_Wl_Input *input; 201 Ecore_Wl_Input *input;
@@ -226,7 +226,7 @@ ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location)
226 input->display->serial, location); 226 input->display->serial, location);
227} 227}
228 228
229EAPI void 229EAPI void
230ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h) 230ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h)
231{ 231{
232 LOGFN(__FILE__, __LINE__, __FUNCTION__); 232 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -235,7 +235,7 @@ ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h)
235 if (win->surface) wl_surface_damage(win->surface, x, y, w, h); 235 if (win->surface) wl_surface_damage(win->surface, x, y, w, h);
236} 236}
237 237
238EAPI void 238EAPI void
239ecore_wl_window_commit(Ecore_Wl_Window *win) 239ecore_wl_window_commit(Ecore_Wl_Window *win)
240{ 240{
241 LOGFN(__FILE__, __LINE__, __FUNCTION__); 241 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -254,11 +254,11 @@ ecore_wl_window_commit(Ecore_Wl_Window *win)
254 wl_surface_set_input_region(win->surface, win->input_region); 254 wl_surface_set_input_region(win->surface, win->input_region);
255 } 255 }
256 256
257 if ((win->surface) && (win->has_buffer)) 257 if ((win->surface) && (win->has_buffer))
258 wl_surface_commit(win->surface); 258 wl_surface_commit(win->surface);
259} 259}
260 260
261EAPI void 261EAPI void
262ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, int x, int y) 262ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, int x, int y)
263{ 263{
264 LOGFN(__FILE__, __LINE__, __FUNCTION__); 264 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -277,7 +277,7 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in
277 277
278 /* if (buffer) */ 278 /* if (buffer) */
279 wl_surface_attach(win->surface, buffer, x, y); 279 wl_surface_attach(win->surface, buffer, x, y);
280 wl_surface_damage(win->surface, 0, 0, 280 wl_surface_damage(win->surface, 0, 0,
281 win->allocation.w, win->allocation.h); 281 win->allocation.w, win->allocation.h);
282 ecore_wl_window_commit(win); 282 ecore_wl_window_commit(win);
283 } 283 }
@@ -300,7 +300,7 @@ ecore_wl_window_surface_create(Ecore_Wl_Window *win)
300 return win->surface; 300 return win->surface;
301} 301}
302 302
303EAPI void 303EAPI void
304ecore_wl_window_show(Ecore_Wl_Window *win) 304ecore_wl_window_show(Ecore_Wl_Window *win)
305{ 305{
306#ifdef USE_IVI_SHELL 306#ifdef USE_IVI_SHELL
@@ -331,7 +331,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
331 win->ivi_surface_id, win->surface); 331 win->ivi_surface_id, win->surface);
332 } 332 }
333 333
334 if (!win->ivi_surface) 334 if (!win->ivi_surface)
335 { 335 {
336#endif 336#endif
337 if ((!win->xdg_surface) && (_ecore_wl_disp->wl.xdg_shell)) 337 if ((!win->xdg_surface) && (_ecore_wl_disp->wl.xdg_shell))
@@ -350,7 +350,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
350 } 350 }
351 else if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell)) 351 else if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell))
352 { 352 {
353 win->shell_surface = 353 win->shell_surface =
354 wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell, 354 wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell,
355 win->surface); 355 win->surface);
356 if (!win->shell_surface) return; 356 if (!win->shell_surface) return;
@@ -363,7 +363,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
363 } 363 }
364 364
365 if (win->shell_surface) 365 if (win->shell_surface)
366 wl_shell_surface_add_listener(win->shell_surface, 366 wl_shell_surface_add_listener(win->shell_surface,
367 &_ecore_wl_shell_surface_listener, win); 367 &_ecore_wl_shell_surface_listener, win);
368#ifdef USE_IVI_SHELL 368#ifdef USE_IVI_SHELL
369 } 369 }
@@ -401,9 +401,9 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
401 case ECORE_WL_WINDOW_TYPE_MENU: 401 case ECORE_WL_WINDOW_TYPE_MENU:
402 if (win->xdg_surface) 402 if (win->xdg_surface)
403 { 403 {
404 win->xdg_popup = 404 win->xdg_popup =
405 xdg_shell_get_xdg_popup(_ecore_wl_disp->wl.xdg_shell, 405 xdg_shell_get_xdg_popup(_ecore_wl_disp->wl.xdg_shell,
406 win->surface, 406 win->surface,
407 win->parent->surface, 407 win->parent->surface,
408 _ecore_wl_disp->input->seat, 408 _ecore_wl_disp->input->seat,
409 _ecore_wl_disp->serial, 409 _ecore_wl_disp->serial,
@@ -411,7 +411,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
411 win->allocation.y, 0); 411 win->allocation.y, 0);
412 if (!win->xdg_popup) return; 412 if (!win->xdg_popup) return;
413 xdg_popup_set_user_data(win->xdg_popup, win); 413 xdg_popup_set_user_data(win->xdg_popup, win);
414 xdg_popup_add_listener(win->xdg_popup, 414 xdg_popup_add_listener(win->xdg_popup,
415 &_ecore_xdg_popup_listener, win); 415 &_ecore_xdg_popup_listener, win);
416 } 416 }
417 else if (win->shell_surface) 417 else if (win->shell_surface)
@@ -432,7 +432,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
432 } 432 }
433} 433}
434 434
435EAPI void 435EAPI void
436ecore_wl_window_hide(Ecore_Wl_Window *win) 436ecore_wl_window_hide(Ecore_Wl_Window *win)
437{ 437{
438 LOGFN(__FILE__, __LINE__, __FUNCTION__); 438 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -452,18 +452,18 @@ ecore_wl_window_hide(Ecore_Wl_Window *win)
452 win->surface = NULL; 452 win->surface = NULL;
453} 453}
454 454
455EAPI void 455EAPI void
456ecore_wl_window_raise(Ecore_Wl_Window *win) 456ecore_wl_window_raise(Ecore_Wl_Window *win)
457{ 457{
458 LOGFN(__FILE__, __LINE__, __FUNCTION__); 458 LOGFN(__FILE__, __LINE__, __FUNCTION__);
459 459
460 if (!win) return; 460 if (!win) return;
461 /* FIXME: This should raise the xdg surface also */ 461 /* FIXME: This should raise the xdg surface also */
462 if (win->shell_surface) 462 if (win->shell_surface)
463 wl_shell_surface_set_toplevel(win->shell_surface); 463 wl_shell_surface_set_toplevel(win->shell_surface);
464} 464}
465 465
466EAPI void 466EAPI void
467ecore_wl_window_maximized_set(Ecore_Wl_Window *win, Eina_Bool maximized) 467ecore_wl_window_maximized_set(Ecore_Wl_Window *win, Eina_Bool maximized)
468{ 468{
469 LOGFN(__FILE__, __LINE__, __FUNCTION__); 469 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -515,7 +515,7 @@ ecore_wl_window_maximized_get(Ecore_Wl_Window *win)
515 return EINA_FALSE; 515 return EINA_FALSE;
516} 516}
517 517
518EAPI void 518EAPI void
519ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen) 519ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen)
520{ 520{
521 LOGFN(__FILE__, __LINE__, __FUNCTION__); 521 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -526,17 +526,17 @@ ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen)
526 { 526 {
527 win->type = ECORE_WL_WINDOW_TYPE_FULLSCREEN; 527 win->type = ECORE_WL_WINDOW_TYPE_FULLSCREEN;
528 528
529 if (win->xdg_surface) 529 if (win->xdg_surface)
530 xdg_surface_set_fullscreen(win->xdg_surface, NULL); 530 xdg_surface_set_fullscreen(win->xdg_surface, NULL);
531 531
532 if (win->shell_surface) 532 if (win->shell_surface)
533 wl_shell_surface_set_fullscreen(win->shell_surface, 533 wl_shell_surface_set_fullscreen(win->shell_surface,
534 WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 534 WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
535 0, NULL); 535 0, NULL);
536 } 536 }
537 else 537 else
538 { 538 {
539 if (win->xdg_surface) 539 if (win->xdg_surface)
540 xdg_surface_unset_fullscreen(win->xdg_surface); 540 xdg_surface_unset_fullscreen(win->xdg_surface);
541 else if (win->shell_surface) 541 else if (win->shell_surface)
542 wl_shell_surface_set_toplevel(win->shell_surface); 542 wl_shell_surface_set_toplevel(win->shell_surface);
@@ -556,7 +556,7 @@ ecore_wl_window_fullscreen_get(Ecore_Wl_Window *win)
556 return win->fullscreen || (win->type == ECORE_WL_WINDOW_TYPE_FULLSCREEN); 556 return win->fullscreen || (win->type == ECORE_WL_WINDOW_TYPE_FULLSCREEN);
557} 557}
558 558
559EAPI void 559EAPI void
560ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent) 560ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent)
561{ 561{
562 LOGFN(__FILE__, __LINE__, __FUNCTION__); 562 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -564,7 +564,7 @@ ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent)
564 if (!win) return; 564 if (!win) return;
565 win->transparent = transparent; 565 win->transparent = transparent;
566 if (!win->transparent) 566 if (!win->transparent)
567 ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, 567 ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y,
568 win->opaque.w, win->opaque.h); 568 win->opaque.w, win->opaque.h);
569 else 569 else
570 ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, 0, 0); 570 ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, 0, 0);
@@ -588,7 +588,7 @@ ecore_wl_window_alpha_set(Ecore_Wl_Window *win, Eina_Bool alpha)
588 if (!win) return; 588 if (!win) return;
589 win->alpha = alpha; 589 win->alpha = alpha;
590 if (!win->alpha) 590 if (!win->alpha)
591 ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, 591 ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y,
592 win->opaque.w, win->opaque.h); 592 win->opaque.w, win->opaque.h);
593 else 593 else
594 ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, 0, 0); 594 ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, 0, 0);
@@ -604,7 +604,7 @@ ecore_wl_window_transparent_get(Ecore_Wl_Window *win)
604 return win->transparent; 604 return win->transparent;
605} 605}
606 606
607EAPI void 607EAPI void
608ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h) 608ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h)
609{ 609{
610 LOGFN(__FILE__, __LINE__, __FUNCTION__); 610 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -618,12 +618,12 @@ ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h)
618 win->saved.h = h; 618 win->saved.h = h;
619 } 619 }
620 if (win->xdg_surface) 620 if (win->xdg_surface)
621 xdg_surface_set_window_geometry(win->xdg_surface, 621 xdg_surface_set_window_geometry(win->xdg_surface,
622 win->allocation.x, win->allocation.y, 622 win->allocation.x, win->allocation.y,
623 win->allocation.w, win->allocation.h); 623 win->allocation.w, win->allocation.h);
624} 624}
625 625
626EAPI void 626EAPI void
627ecore_wl_window_update_location(Ecore_Wl_Window *win, int x, int y) 627ecore_wl_window_update_location(Ecore_Wl_Window *win, int x, int y)
628{ 628{
629 LOGFN(__FILE__, __LINE__, __FUNCTION__); 629 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -632,8 +632,8 @@ ecore_wl_window_update_location(Ecore_Wl_Window *win, int x, int y)
632 win->allocation.x = x; 632 win->allocation.x = x;
633 win->allocation.y = y; 633 win->allocation.y = y;
634 if (win->xdg_surface) 634 if (win->xdg_surface)
635 xdg_surface_set_window_geometry(win->xdg_surface, 635 xdg_surface_set_window_geometry(win->xdg_surface,
636 win->allocation.x, win->allocation.y, 636 win->allocation.x, win->allocation.y,
637 win->allocation.w, win->allocation.h); 637 win->allocation.w, win->allocation.h);
638} 638}
639 639
@@ -676,7 +676,7 @@ ecore_wl_window_find(unsigned int id)
676 return win; 676 return win;
677} 677}
678 678
679EAPI void 679EAPI void
680ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type) 680ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type)
681{ 681{
682 LOGFN(__FILE__, __LINE__, __FUNCTION__); 682 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -685,7 +685,7 @@ ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type)
685 win->type = type; 685 win->type = type;
686} 686}
687 687
688EAPI void 688EAPI void
689ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_surface *surface, int hot_x, int hot_y) 689ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_surface *surface, int hot_x, int hot_y)
690{ 690{
691 Ecore_Wl_Input *input; 691 Ecore_Wl_Input *input;
@@ -739,7 +739,7 @@ ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win)
739} 739}
740 740
741/* @since 1.2 */ 741/* @since 1.2 */
742EAPI void 742EAPI void
743ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent) 743ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent)
744{ 744{
745 LOGFN(__FILE__, __LINE__, __FUNCTION__); 745 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -748,7 +748,7 @@ ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent)
748} 748}
749 749
750/* @since 1.12 */ 750/* @since 1.12 */
751EAPI void 751EAPI void
752ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified) 752ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
753{ 753{
754 struct wl_array states; 754 struct wl_array states;
@@ -790,7 +790,7 @@ ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
790 } 790 }
791} 791}
792 792
793EAPI Eina_Bool 793EAPI Eina_Bool
794ecore_wl_window_iconified_get(Ecore_Wl_Window *win) 794ecore_wl_window_iconified_get(Ecore_Wl_Window *win)
795{ 795{
796 LOGFN(__FILE__, __LINE__, __FUNCTION__); 796 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -822,7 +822,7 @@ ecore_wl_window_surface_find(struct wl_surface *surface)
822} 822}
823 823
824/* @since 1.8 */ 824/* @since 1.8 */
825EAPI void 825EAPI void
826ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w, int h) 826ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w, int h)
827{ 827{
828 LOGFN(__FILE__, __LINE__, __FUNCTION__); 828 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -855,7 +855,7 @@ ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w, int
855} 855}
856 856
857/* @since 1.8 */ 857/* @since 1.8 */
858EAPI void 858EAPI void
859ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w, int h) 859ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w, int h)
860{ 860{
861 LOGFN(__FILE__, __LINE__, __FUNCTION__); 861 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -896,7 +896,7 @@ ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w, int
896} 896}
897 897
898/* @since 1.8 */ 898/* @since 1.8 */
899EAPI void 899EAPI void
900ecore_wl_window_rotation_set(Ecore_Wl_Window *win, int rotation) 900ecore_wl_window_rotation_set(Ecore_Wl_Window *win, int rotation)
901{ 901{
902 LOGFN(__FILE__, __LINE__, __FUNCTION__); 902 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -906,7 +906,7 @@ ecore_wl_window_rotation_set(Ecore_Wl_Window *win, int rotation)
906} 906}
907 907
908/* @since 1.8 */ 908/* @since 1.8 */
909EAPI int 909EAPI int
910ecore_wl_window_rotation_get(Ecore_Wl_Window *win) 910ecore_wl_window_rotation_get(Ecore_Wl_Window *win)
911{ 911{
912 LOGFN(__FILE__, __LINE__, __FUNCTION__); 912 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -978,14 +978,14 @@ ecore_wl_window_keyboard_get(Ecore_Wl_Window *win)
978 978
979 979
980/* local functions */ 980/* local functions */
981static void 981static void
982_ecore_wl_window_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface, unsigned int serial) 982_ecore_wl_window_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface, unsigned int serial)
983{ 983{
984 if (!shell_surface) return; 984 if (!shell_surface) return;
985 wl_shell_surface_pong(shell_surface, serial); 985 wl_shell_surface_pong(shell_surface, serial);
986} 986}
987 987
988static void 988static void
989_ecore_wl_window_cb_configure(void *data, struct wl_shell_surface *shell_surface EINA_UNUSED, unsigned int edges, int w, int h) 989_ecore_wl_window_cb_configure(void *data, struct wl_shell_surface *shell_surface EINA_UNUSED, unsigned int edges, int w, int h)
990{ 990{
991 Ecore_Wl_Window *win; 991 Ecore_Wl_Window *win;
@@ -1044,7 +1044,7 @@ _ecore_xdg_handle_surface_configure(void *data, struct xdg_surface *xdg_surface
1044 xdg_surface_ack_configure(win->xdg_surface, serial); 1044 xdg_surface_ack_configure(win->xdg_surface, serial);
1045} 1045}
1046 1046
1047static void 1047static void
1048_ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface EINA_UNUSED) 1048_ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface EINA_UNUSED)
1049{ 1049{
1050 Ecore_Wl_Window *win; 1050 Ecore_Wl_Window *win;
@@ -1055,7 +1055,7 @@ _ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface EIN
1055 ecore_wl_window_free(win); 1055 ecore_wl_window_free(win);
1056} 1056}
1057 1057
1058static void 1058static void
1059_ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface *shell_surface) 1059_ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface *shell_surface)
1060{ 1060{
1061 Ecore_Wl_Window *win; 1061 Ecore_Wl_Window *win;
@@ -1079,7 +1079,7 @@ _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup, unsigned i
1079 ecore_wl_input_ungrab(win->pointer_device); 1079 ecore_wl_input_ungrab(win->pointer_device);
1080} 1080}
1081 1081
1082static void 1082static void
1083_ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED) 1083_ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED)
1084{ 1084{
1085 Ecore_Wl_Window *win; 1085 Ecore_Wl_Window *win;
@@ -1090,7 +1090,7 @@ _ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct
1090 if (!(win = data)) return; 1090 if (!(win = data)) return;
1091} 1091}
1092 1092
1093static void 1093static void
1094_ecore_wl_window_cb_surface_leave(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED) 1094_ecore_wl_window_cb_surface_leave(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED)
1095{ 1095{
1096 Ecore_Wl_Window *win; 1096 Ecore_Wl_Window *win;
@@ -1101,7 +1101,7 @@ _ecore_wl_window_cb_surface_leave(void *data, struct wl_surface *surface, struct
1101 if (!(win = data)) return; 1101 if (!(win = data)) return;
1102} 1102}
1103 1103
1104static void 1104static void
1105_ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, int edges) 1105_ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, int edges)
1106{ 1106{
1107 Ecore_Wl_Event_Window_Configure *ev; 1107 Ecore_Wl_Event_Window_Configure *ev;
diff --git a/src/lib/ecore_wayland/ivi-application-client-protocol.h b/src/lib/ecore_wayland/ivi-application-client-protocol.h
index 20c7d38..84fecd8 100644
--- a/src/lib/ecore_wayland/ivi-application-client-protocol.h
+++ b/src/lib/ecore_wayland/ivi-application-client-protocol.h
@@ -1,17 +1,17 @@
1/* 1/*
2 * Copyright (C) 2013 DENSO CORPORATION 2 * Copyright (C) 2013 DENSO CORPORATION
3 * Copyright (c) 2013 BMW Car IT GmbH 3 * Copyright (c) 2013 BMW Car IT GmbH
4 * 4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal 6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights 7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is 9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions: 10 * furnished to do so, subject to the following conditions:
11 * 11 *
12 * The above copyright notice and this permission notice shall be included in 12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software. 13 * all copies or substantial portions of the Software.
14 * 14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -45,10 +45,10 @@ extern const struct wl_interface ivi_application_interface;
45#define IVI_SURFACE_WARNING_CODE_ENUM 45#define IVI_SURFACE_WARNING_CODE_ENUM
46/** 46/**
47 * ivi_surface_warning_code - possible warning codes returned by ivi 47 * ivi_surface_warning_code - possible warning codes returned by ivi
48 * compositor 48 * compositor
49 * @IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE: wl_surface is invalid 49 * @IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE: wl_surface is invalid
50 * @IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE: ivi_id is in use and can not 50 * @IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE: ivi_id is in use and can not
51 * be shared 51 * be shared
52 * 52 *
53 * These define all possible warning codes returned by ivi compositor on 53 * These define all possible warning codes returned by ivi compositor on
54 * server-side warnings. invalid_wl_surface: - wl_surface already has a 54 * server-side warnings. invalid_wl_surface: - wl_surface already has a
@@ -57,8 +57,8 @@ extern const struct wl_interface ivi_application_interface;
57 * application. 57 * application.
58 */ 58 */
59enum ivi_surface_warning_code { 59enum ivi_surface_warning_code {
60 IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE = 1, 60 IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE = 1,
61 IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE = 2, 61 IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE = 2,
62}; 62};
63#endif /* IVI_SURFACE_WARNING_CODE_ENUM */ 63#endif /* IVI_SURFACE_WARNING_CODE_ENUM */
64 64
@@ -67,106 +67,106 @@ enum ivi_surface_warning_code {
67 * @visibility: visibility of surface in ivi compositor has changed 67 * @visibility: visibility of surface in ivi compositor has changed
68 * @warning: server-side warning detected 68 * @warning: server-side warning detected
69 * 69 *
70 * 70 *
71 */ 71 */
72struct ivi_surface_listener { 72struct ivi_surface_listener {
73 /** 73 /**
74 * visibility - visibility of surface in ivi compositor has 74 * visibility - visibility of surface in ivi compositor has
75 * changed 75 * changed
76 * @visibility: (none) 76 * @visibility: (none)
77 * 77 *
78 * The new visibility state is provided in argument visibility. 78 * The new visibility state is provided in argument visibility.
79 * If visibility is 0, the surface has become invisible. If 79 * If visibility is 0, the surface has become invisible. If
80 * visibility is not 0, the surface has become visible. 80 * visibility is not 0, the surface has become visible.
81 */ 81 */
82 void (*visibility)(void *data, 82 void (*visibility)(void *data,
83 struct ivi_surface *ivi_surface, 83 struct ivi_surface *ivi_surface,
84 int32_t visibility); 84 int32_t visibility);
85 /** 85 /**
86 * warning - server-side warning detected 86 * warning - server-side warning detected
87 * @warning_code: (none) 87 * @warning_code: (none)
88 * @warning_text: (none) 88 * @warning_text: (none)
89 * 89 *
90 * The ivi compositor encountered warning while processing a 90 * The ivi compositor encountered warning while processing a
91 * request by this application. The warning is defined by argument 91 * request by this application. The warning is defined by argument
92 * warning_code and optional warning_text. If the warning is 92 * warning_code and optional warning_text. If the warning is
93 * detected, client shall destroy the ivi_surface object. 93 * detected, client shall destroy the ivi_surface object.
94 * 94 *
95 * When a warning event is sent, the compositor turns the 95 * When a warning event is sent, the compositor turns the
96 * ivi_surface object inert. The ivi_surface will not deliver 96 * ivi_surface object inert. The ivi_surface will not deliver
97 * further events, all requests on it are ignored except 'destroy', 97 * further events, all requests on it are ignored except 'destroy',
98 * and the association to the ivi_id is removed. The client should 98 * and the association to the ivi_id is removed. The client should
99 * destroy the ivi_surface object. If an inert ivi_surface object 99 * destroy the ivi_surface object. If an inert ivi_surface object
100 * is used as an argument to any other object's request, that 100 * is used as an argument to any other object's request, that
101 * request will [produce a fatal error / produce a warning / be 101 * request will [produce a fatal error / produce a warning / be
102 * ignored]. 102 * ignored].
103 */ 103 */
104 void (*warning)(void *data, 104 void (*warning)(void *data,
105 struct ivi_surface *ivi_surface, 105 struct ivi_surface *ivi_surface,
106 int32_t warning_code, 106 int32_t warning_code,
107 const char *warning_text); 107 const char *warning_text);
108}; 108};
109 109
110static inline int 110static inline int
111ivi_surface_add_listener(struct ivi_surface *ivi_surface, 111ivi_surface_add_listener(struct ivi_surface *ivi_surface,
112 const struct ivi_surface_listener *listener, void *data) 112 const struct ivi_surface_listener *listener, void *data)
113{ 113{
114 return wl_proxy_add_listener((struct wl_proxy *) ivi_surface, 114 return wl_proxy_add_listener((struct wl_proxy *) ivi_surface,
115 (void (**)(void)) listener, data); 115 (void (**)(void)) listener, data);
116} 116}
117 117
118#define IVI_SURFACE_DESTROY 0 118#define IVI_SURFACE_DESTROY 0
119 119
120static inline void 120static inline void
121ivi_surface_set_user_data(struct ivi_surface *ivi_surface, void *user_data) 121ivi_surface_set_user_data(struct ivi_surface *ivi_surface, void *user_data)
122{ 122{
123 wl_proxy_set_user_data((struct wl_proxy *) ivi_surface, user_data); 123 wl_proxy_set_user_data((struct wl_proxy *) ivi_surface, user_data);
124} 124}
125 125
126static inline void * 126static inline void *
127ivi_surface_get_user_data(struct ivi_surface *ivi_surface) 127ivi_surface_get_user_data(struct ivi_surface *ivi_surface)
128{ 128{
129 return wl_proxy_get_user_data((struct wl_proxy *) ivi_surface); 129 return wl_proxy_get_user_data((struct wl_proxy *) ivi_surface);
130} 130}
131 131
132static inline void 132static inline void
133ivi_surface_destroy(struct ivi_surface *ivi_surface) 133ivi_surface_destroy(struct ivi_surface *ivi_surface)
134{ 134{
135 wl_proxy_marshal((struct wl_proxy *) ivi_surface, 135 wl_proxy_marshal((struct wl_proxy *) ivi_surface,
136 IVI_SURFACE_DESTROY); 136 IVI_SURFACE_DESTROY);
137 137
138 wl_proxy_destroy((struct wl_proxy *) ivi_surface); 138 wl_proxy_destroy((struct wl_proxy *) ivi_surface);
139} 139}
140 140
141#define IVI_APPLICATION_SURFACE_CREATE 0 141#define IVI_APPLICATION_SURFACE_CREATE 0
142 142
143static inline void 143static inline void
144ivi_application_set_user_data(struct ivi_application *ivi_application, void *user_data) 144ivi_application_set_user_data(struct ivi_application *ivi_application, void *user_data)
145{ 145{
146 wl_proxy_set_user_data((struct wl_proxy *) ivi_application, user_data); 146 wl_proxy_set_user_data((struct wl_proxy *) ivi_application, user_data);
147} 147}
148 148
149static inline void * 149static inline void *
150ivi_application_get_user_data(struct ivi_application *ivi_application) 150ivi_application_get_user_data(struct ivi_application *ivi_application)
151{ 151{
152 return wl_proxy_get_user_data((struct wl_proxy *) ivi_application); 152 return wl_proxy_get_user_data((struct wl_proxy *) ivi_application);
153} 153}
154 154
155static inline void 155static inline void
156ivi_application_destroy(struct ivi_application *ivi_application) 156ivi_application_destroy(struct ivi_application *ivi_application)
157{ 157{
158 wl_proxy_destroy((struct wl_proxy *) ivi_application); 158 wl_proxy_destroy((struct wl_proxy *) ivi_application);
159} 159}
160 160
161static inline struct ivi_surface * 161static inline struct ivi_surface *
162ivi_application_surface_create(struct ivi_application *ivi_application, uint32_t ivi_id, struct wl_surface *surface) 162ivi_application_surface_create(struct ivi_application *ivi_application, uint32_t ivi_id, struct wl_surface *surface)
163{ 163{
164 struct wl_proxy *id; 164 struct wl_proxy *id;
165 165
166 id = wl_proxy_marshal_constructor((struct wl_proxy *) ivi_application, 166 id = wl_proxy_marshal_constructor((struct wl_proxy *) ivi_application,
167 IVI_APPLICATION_SURFACE_CREATE, &ivi_surface_interface, ivi_id, surface, NULL); 167 IVI_APPLICATION_SURFACE_CREATE, &ivi_surface_interface, ivi_id, surface, NULL);
168 168
169 return (struct ivi_surface *) id; 169 return (struct ivi_surface *) id;
170} 170}
171 171
172#ifdef __cplusplus 172#ifdef __cplusplus
diff --git a/src/lib/ecore_wayland/ivi-application-protocol.c b/src/lib/ecore_wayland/ivi-application-protocol.c
index 5ab298c..57a951f 100644
--- a/src/lib/ecore_wayland/ivi-application-protocol.c
+++ b/src/lib/ecore_wayland/ivi-application-protocol.c
@@ -1,17 +1,17 @@
1/* 1/*
2 * Copyright (C) 2013 DENSO CORPORATION 2 * Copyright (C) 2013 DENSO CORPORATION
3 * Copyright (c) 2013 BMW Car IT GmbH 3 * Copyright (c) 2013 BMW Car IT GmbH
4 * 4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal 6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights 7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is 9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions: 10 * furnished to do so, subject to the following conditions:
11 * 11 *
12 * The above copyright notice and this permission notice shall be included in 12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software. 13 * all copies or substantial portions of the Software.
14 * 14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -29,35 +29,34 @@ extern const struct wl_interface ivi_surface_interface;
29extern const struct wl_interface wl_surface_interface; 29extern const struct wl_interface wl_surface_interface;
30 30
31static const struct wl_interface *types[] = { 31static const struct wl_interface *types[] = {
32 NULL, 32 NULL,
33 NULL, 33 NULL,
34 NULL, 34 NULL,
35 &wl_surface_interface, 35 &wl_surface_interface,
36 &ivi_surface_interface, 36 &ivi_surface_interface,
37}; 37};
38 38
39static const struct wl_message ivi_surface_requests[] = { 39static const struct wl_message ivi_surface_requests[] = {
40 { "destroy", "", types + 0 }, 40 { "destroy", "", types + 0 },
41}; 41};
42 42
43static const struct wl_message ivi_surface_events[] = { 43static const struct wl_message ivi_surface_events[] = {
44 { "visibility", "i", types + 0 }, 44 { "visibility", "i", types + 0 },
45 { "warning", "i?s", types + 0 }, 45 { "warning", "i?s", types + 0 },
46}; 46};
47 47
48WL_EXPORT const struct wl_interface ivi_surface_interface = { 48WL_EXPORT const struct wl_interface ivi_surface_interface = {
49 "ivi_surface", 1, 49 "ivi_surface", 1,
50 1, ivi_surface_requests, 50 1, ivi_surface_requests,
51 2, ivi_surface_events, 51 2, ivi_surface_events,
52}; 52};
53 53
54static const struct wl_message ivi_application_requests[] = { 54static const struct wl_message ivi_application_requests[] = {
55 { "surface_create", "uon", types + 2 }, 55 { "surface_create", "uon", types + 2 },
56}; 56};
57 57
58WL_EXPORT const struct wl_interface ivi_application_interface = { 58WL_EXPORT const struct wl_interface ivi_application_interface = {
59 "ivi_application", 1, 59 "ivi_application", 1,
60 1, ivi_application_requests, 60 1, ivi_application_requests,
61 0, NULL, 61 0, NULL,
62}; 62};
63
diff --git a/src/lib/ecore_wayland/subsurface-client-protocol.h b/src/lib/ecore_wayland/subsurface-client-protocol.h
index 5161589..4396ea4 100644
--- a/src/lib/ecore_wayland/subsurface-client-protocol.h
+++ b/src/lib/ecore_wayland/subsurface-client-protocol.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright © 2012-2013 Collabora, Ltd. 2 * Copyright © 2012-2013 Collabora, Ltd.
3 * 3 *
4 * Permission to use, copy, modify, distribute, and sell this 4 * Permission to use, copy, modify, distribute, and sell this
5 * software and its documentation for any purpose is hereby granted 5 * software and its documentation for any purpose is hereby granted
6 * without fee, provided that the above copyright notice appear in 6 * without fee, provided that the above copyright notice appear in
@@ -12,7 +12,7 @@
12 * representations about the suitability of this software for any 12 * representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied 13 * purpose. It is provided "as is" without express or implied
14 * warranty. 14 * warranty.
15 * 15 *
16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS 16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
@@ -46,118 +46,118 @@ extern const struct wl_interface wl_subsurface_interface;
46#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM 46#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
47#define WL_SUBCOMPOSITOR_ERROR_ENUM 47#define WL_SUBCOMPOSITOR_ERROR_ENUM
48enum wl_subcompositor_error { 48enum wl_subcompositor_error {
49 WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0, 49 WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
50}; 50};
51#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */ 51#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
52 52
53#define WL_SUBCOMPOSITOR_DESTROY 0 53#define WL_SUBCOMPOSITOR_DESTROY 0
54#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1 54#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1
55 55
56static inline void 56static inline void
57wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data) 57wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data)
58{ 58{
59 wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data); 59 wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data);
60} 60}
61 61
62static inline void * 62static inline void *
63wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor) 63wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor)
64{ 64{
65 return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor); 65 return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor);
66} 66}
67 67
68static inline void 68static inline void
69wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor) 69wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor)
70{ 70{
71 wl_proxy_marshal((struct wl_proxy *) wl_subcompositor, 71 wl_proxy_marshal((struct wl_proxy *) wl_subcompositor,
72 WL_SUBCOMPOSITOR_DESTROY); 72 WL_SUBCOMPOSITOR_DESTROY);
73 73
74 wl_proxy_destroy((struct wl_proxy *) wl_subcompositor); 74 wl_proxy_destroy((struct wl_proxy *) wl_subcompositor);
75} 75}
76 76
77static inline struct wl_subsurface * 77static inline struct wl_subsurface *
78wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent) 78wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent)
79{ 79{
80 struct wl_proxy *id; 80 struct wl_proxy *id;
81 81
82 id = wl_proxy_create((struct wl_proxy *) wl_subcompositor, 82 id = wl_proxy_create((struct wl_proxy *) wl_subcompositor,
83 &wl_subsurface_interface); 83 &wl_subsurface_interface);
84 if (!id) 84 if (!id)
85 return NULL; 85 return NULL;
86 86
87 wl_proxy_marshal((struct wl_proxy *) wl_subcompositor, 87 wl_proxy_marshal((struct wl_proxy *) wl_subcompositor,
88 WL_SUBCOMPOSITOR_GET_SUBSURFACE, id, surface, parent); 88 WL_SUBCOMPOSITOR_GET_SUBSURFACE, id, surface, parent);
89 89
90 return (struct wl_subsurface *) id; 90 return (struct wl_subsurface *) id;
91} 91}
92 92
93#ifndef WL_SUBSURFACE_ERROR_ENUM 93#ifndef WL_SUBSURFACE_ERROR_ENUM
94#define WL_SUBSURFACE_ERROR_ENUM 94#define WL_SUBSURFACE_ERROR_ENUM
95enum wl_subsurface_error { 95enum wl_subsurface_error {
96 WL_SUBSURFACE_ERROR_BAD_SURFACE = 0, 96 WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,
97}; 97};
98#endif /* WL_SUBSURFACE_ERROR_ENUM */ 98#endif /* WL_SUBSURFACE_ERROR_ENUM */
99 99
100#define WL_SUBSURFACE_DESTROY 0 100#define WL_SUBSURFACE_DESTROY 0
101#define WL_SUBSURFACE_SET_POSITION 1 101#define WL_SUBSURFACE_SET_POSITION 1
102#define WL_SUBSURFACE_PLACE_ABOVE 2 102#define WL_SUBSURFACE_PLACE_ABOVE 2
103#define WL_SUBSURFACE_PLACE_BELOW 3 103#define WL_SUBSURFACE_PLACE_BELOW 3
104#define WL_SUBSURFACE_SET_SYNC 4 104#define WL_SUBSURFACE_SET_SYNC 4
105#define WL_SUBSURFACE_SET_DESYNC 5 105#define WL_SUBSURFACE_SET_DESYNC 5
106 106
107static inline void 107static inline void
108wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data) 108wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data)
109{ 109{
110 wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data); 110 wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data);
111} 111}
112 112
113static inline void * 113static inline void *
114wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface) 114wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface)
115{ 115{
116 return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface); 116 return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface);
117} 117}
118 118
119static inline void 119static inline void
120wl_subsurface_destroy(struct wl_subsurface *wl_subsurface) 120wl_subsurface_destroy(struct wl_subsurface *wl_subsurface)
121{ 121{
122 wl_proxy_marshal((struct wl_proxy *) wl_subsurface, 122 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
123 WL_SUBSURFACE_DESTROY); 123 WL_SUBSURFACE_DESTROY);
124 124
125 wl_proxy_destroy((struct wl_proxy *) wl_subsurface); 125 wl_proxy_destroy((struct wl_proxy *) wl_subsurface);
126} 126}
127 127
128static inline void 128static inline void
129wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y) 129wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y)
130{ 130{
131 wl_proxy_marshal((struct wl_proxy *) wl_subsurface, 131 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
132 WL_SUBSURFACE_SET_POSITION, x, y); 132 WL_SUBSURFACE_SET_POSITION, x, y);
133} 133}
134 134
135static inline void 135static inline void
136wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling) 136wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
137{ 137{
138 wl_proxy_marshal((struct wl_proxy *) wl_subsurface, 138 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
139 WL_SUBSURFACE_PLACE_ABOVE, sibling); 139 WL_SUBSURFACE_PLACE_ABOVE, sibling);
140} 140}
141 141
142static inline void 142static inline void
143wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling) 143wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
144{ 144{
145 wl_proxy_marshal((struct wl_proxy *) wl_subsurface, 145 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
146 WL_SUBSURFACE_PLACE_BELOW, sibling); 146 WL_SUBSURFACE_PLACE_BELOW, sibling);
147} 147}
148 148
149static inline void 149static inline void
150wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface) 150wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface)
151{ 151{
152 wl_proxy_marshal((struct wl_proxy *) wl_subsurface, 152 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
153 WL_SUBSURFACE_SET_SYNC); 153 WL_SUBSURFACE_SET_SYNC);
154} 154}
155 155
156static inline void 156static inline void
157wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface) 157wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface)
158{ 158{
159 wl_proxy_marshal((struct wl_proxy *) wl_subsurface, 159 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
160 WL_SUBSURFACE_SET_DESYNC); 160 WL_SUBSURFACE_SET_DESYNC);
161} 161}
162 162
163#ifdef __cplusplus 163#ifdef __cplusplus
diff --git a/src/lib/ecore_wayland/subsurface-protocol.c b/src/lib/ecore_wayland/subsurface-protocol.c
index 986c72a..3e67801 100644
--- a/src/lib/ecore_wayland/subsurface-protocol.c
+++ b/src/lib/ecore_wayland/subsurface-protocol.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright © 2012-2013 Collabora, Ltd. 2 * Copyright © 2012-2013 Collabora, Ltd.
3 * 3 *
4 * Permission to use, copy, modify, distribute, and sell this 4 * Permission to use, copy, modify, distribute, and sell this
5 * software and its documentation for any purpose is hereby granted 5 * software and its documentation for any purpose is hereby granted
6 * without fee, provided that the above copyright notice appear in 6 * without fee, provided that the above copyright notice appear in
@@ -12,7 +12,7 @@
12 * representations about the suitability of this software for any 12 * representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied 13 * purpose. It is provided "as is" without express or implied
14 * warranty. 14 * warranty.
15 * 15 *
16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS 16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
@@ -34,38 +34,37 @@ extern const struct wl_interface wl_surface_interface;
34extern const struct wl_interface wl_surface_interface; 34extern const struct wl_interface wl_surface_interface;
35 35
36static const struct wl_interface *types[] = { 36static const struct wl_interface *types[] = {
37 NULL, 37 NULL,
38 NULL, 38 NULL,
39 &wl_subsurface_interface, 39 &wl_subsurface_interface,
40 &wl_surface_interface, 40 &wl_surface_interface,
41 &wl_surface_interface, 41 &wl_surface_interface,
42 &wl_surface_interface, 42 &wl_surface_interface,
43 &wl_surface_interface, 43 &wl_surface_interface,
44}; 44};
45 45
46static const struct wl_message wl_subcompositor_requests[] = { 46static const struct wl_message wl_subcompositor_requests[] = {
47 { "destroy", "", types + 0 }, 47 { "destroy", "", types + 0 },
48 { "get_subsurface", "noo", types + 2 }, 48 { "get_subsurface", "noo", types + 2 },
49}; 49};
50 50
51WL_EXPORT const struct wl_interface wl_subcompositor_interface = { 51WL_EXPORT const struct wl_interface wl_subcompositor_interface = {
52 "wl_subcompositor", 1, 52 "wl_subcompositor", 1,
53 2, wl_subcompositor_requests, 53 2, wl_subcompositor_requests,
54 0, NULL, 54 0, NULL,
55}; 55};
56 56
57static const struct wl_message wl_subsurface_requests[] = { 57static const struct wl_message wl_subsurface_requests[] = {
58 { "destroy", "", types + 0 }, 58 { "destroy", "", types + 0 },
59 { "set_position", "ii", types + 0 }, 59 { "set_position", "ii", types + 0 },
60 { "place_above", "o", types + 5 }, 60 { "place_above", "o", types + 5 },
61 { "place_below", "o", types + 6 }, 61 { "place_below", "o", types + 6 },
62 { "set_sync", "", types + 0 }, 62 { "set_sync", "", types + 0 },
63 { "set_desync", "", types + 0 }, 63 { "set_desync", "", types + 0 },
64}; 64};
65 65
66WL_EXPORT const struct wl_interface wl_subsurface_interface = { 66WL_EXPORT const struct wl_interface wl_subsurface_interface = {
67 "wl_subsurface", 1, 67 "wl_subsurface", 1,
68 6, wl_subsurface_requests, 68 6, wl_subsurface_requests,
69 0, NULL, 69 0, NULL,
70}; 70};
71
diff --git a/src/lib/ecore_wayland/xdg-shell-client-protocol.h b/src/lib/ecore_wayland/xdg-shell-client-protocol.h
index 66dc5d8..eabf8ee 100644
--- a/src/lib/ecore_wayland/xdg-shell-client-protocol.h
+++ b/src/lib/ecore_wayland/xdg-shell-client-protocol.h
@@ -1,9 +1,9 @@
1/* 1/*
2 * Copyright © 2008-2013 Kristian Høgsberg 2 * Copyright © 2008-2013 Kristian Høgsberg
3 * Copyright © 2013 Rafael Antognolli 3 * Copyright © 2013 Rafael Antognolli
4 * Copyright © 2013 Jasper St. Pierre 4 * Copyright © 2013 Jasper St. Pierre
5 * Copyright © 2010-2013 Intel Corporation 5 * Copyright © 2010-2013 Intel Corporation
6 * 6 *
7 * Permission to use, copy, modify, distribute, and sell this 7 * Permission to use, copy, modify, distribute, and sell this
8 * software and its documentation for any purpose is hereby granted 8 * software and its documentation for any purpose is hereby granted
9 * without fee, provided that the above copyright notice appear in 9 * without fee, provided that the above copyright notice appear in
@@ -15,7 +15,7 @@
15 * representations about the suitability of this software for any 15 * representations about the suitability of this software for any
16 * purpose. It is provided "as is" without express or implied 16 * purpose. It is provided "as is" without express or implied
17 * warranty. 17 * warranty.
18 * 18 *
19 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS 19 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
20 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
@@ -59,7 +59,7 @@ extern const struct wl_interface xdg_popup_interface;
59 * static_assert to ensure the protocol and implementation versions match. 59 * static_assert to ensure the protocol and implementation versions match.
60 */ 60 */
61enum xdg_shell_version { 61enum xdg_shell_version {
62 XDG_SHELL_VERSION_CURRENT = 4, 62 XDG_SHELL_VERSION_CURRENT = 4,
63}; 63};
64#endif /* XDG_SHELL_VERSION_ENUM */ 64#endif /* XDG_SHELL_VERSION_ENUM */
65 65
@@ -73,89 +73,89 @@ enum xdg_shell_version {
73 * It allows clients to associate a xdg_surface with a basic surface. 73 * It allows clients to associate a xdg_surface with a basic surface.
74 */ 74 */
75struct xdg_shell_listener { 75struct xdg_shell_listener {
76 /** 76 /**
77 * ping - check if the client is alive 77 * ping - check if the client is alive
78 * @serial: pass this to the callback 78 * @serial: pass this to the callback
79 * 79 *
80 * The ping event asks the client if it's still alive. Pass the 80 * The ping event asks the client if it's still alive. Pass the
81 * serial specified in the event back to the compositor by sending 81 * serial specified in the event back to the compositor by sending
82 * a "pong" request back with the specified serial. 82 * a "pong" request back with the specified serial.
83 * 83 *
84 * Compositors can use this to determine if the client is still 84 * Compositors can use this to determine if the client is still
85 * alive. It's unspecified what will happen if the client doesn't 85 * alive. It's unspecified what will happen if the client doesn't
86 * respond to the ping request, or in what timeframe. Clients 86 * respond to the ping request, or in what timeframe. Clients
87 * should try to respond in a reasonable amount of time. 87 * should try to respond in a reasonable amount of time.
88 */ 88 */
89 void (*ping)(void *data, 89 void (*ping)(void *data,
90 struct xdg_shell *xdg_shell, 90 struct xdg_shell *xdg_shell,
91 uint32_t serial); 91 uint32_t serial);
92}; 92};
93 93
94static inline int 94static inline int
95xdg_shell_add_listener(struct xdg_shell *xdg_shell, 95xdg_shell_add_listener(struct xdg_shell *xdg_shell,
96 const struct xdg_shell_listener *listener, void *data) 96 const struct xdg_shell_listener *listener, void *data)
97{ 97{
98 return wl_proxy_add_listener((struct wl_proxy *) xdg_shell, 98 return wl_proxy_add_listener((struct wl_proxy *) xdg_shell,
99 (void (**)(void)) listener, data); 99 (void (**)(void)) listener, data);
100} 100}
101 101
102#define XDG_SHELL_USE_UNSTABLE_VERSION 0 102#define XDG_SHELL_USE_UNSTABLE_VERSION 0
103#define XDG_SHELL_GET_XDG_SURFACE 1 103#define XDG_SHELL_GET_XDG_SURFACE 1
104#define XDG_SHELL_GET_XDG_POPUP 2 104#define XDG_SHELL_GET_XDG_POPUP 2
105#define XDG_SHELL_PONG 3 105#define XDG_SHELL_PONG 3
106 106
107static inline void 107static inline void
108xdg_shell_set_user_data(struct xdg_shell *xdg_shell, void *user_data) 108xdg_shell_set_user_data(struct xdg_shell *xdg_shell, void *user_data)
109{ 109{
110 wl_proxy_set_user_data((struct wl_proxy *) xdg_shell, user_data); 110 wl_proxy_set_user_data((struct wl_proxy *) xdg_shell, user_data);
111} 111}
112 112
113static inline void * 113static inline void *
114xdg_shell_get_user_data(struct xdg_shell *xdg_shell) 114xdg_shell_get_user_data(struct xdg_shell *xdg_shell)
115{ 115{
116 return wl_proxy_get_user_data((struct wl_proxy *) xdg_shell); 116 return wl_proxy_get_user_data((struct wl_proxy *) xdg_shell);
117} 117}
118 118
119static inline void 119static inline void
120xdg_shell_destroy(struct xdg_shell *xdg_shell) 120xdg_shell_destroy(struct xdg_shell *xdg_shell)
121{ 121{
122 wl_proxy_destroy((struct wl_proxy *) xdg_shell); 122 wl_proxy_destroy((struct wl_proxy *) xdg_shell);
123} 123}
124 124
125static inline void 125static inline void
126xdg_shell_use_unstable_version(struct xdg_shell *xdg_shell, int32_t version) 126xdg_shell_use_unstable_version(struct xdg_shell *xdg_shell, int32_t version)
127{ 127{
128 wl_proxy_marshal((struct wl_proxy *) xdg_shell, 128 wl_proxy_marshal((struct wl_proxy *) xdg_shell,
129 XDG_SHELL_USE_UNSTABLE_VERSION, version); 129 XDG_SHELL_USE_UNSTABLE_VERSION, version);
130} 130}
131 131
132static inline struct xdg_surface * 132static inline struct xdg_surface *
133xdg_shell_get_xdg_surface(struct xdg_shell *xdg_shell, struct wl_surface *surface) 133xdg_shell_get_xdg_surface(struct xdg_shell *xdg_shell, struct wl_surface *surface)
134{ 134{
135 struct wl_proxy *id; 135 struct wl_proxy *id;
136 136
137 id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell, 137 id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell,
138 XDG_SHELL_GET_XDG_SURFACE, &xdg_surface_interface, NULL, surface); 138 XDG_SHELL_GET_XDG_SURFACE, &xdg_surface_interface, NULL, surface);
139 139
140 return (struct xdg_surface *) id; 140 return (struct xdg_surface *) id;
141} 141}
142 142
143static inline struct xdg_popup * 143static inline struct xdg_popup *
144xdg_shell_get_xdg_popup(struct xdg_shell *xdg_shell, struct wl_surface *surface, struct wl_surface *parent, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y, uint32_t flags) 144xdg_shell_get_xdg_popup(struct xdg_shell *xdg_shell, struct wl_surface *surface, struct wl_surface *parent, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y, uint32_t flags)
145{ 145{
146 struct wl_proxy *id; 146 struct wl_proxy *id;
147 147
148 id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell, 148 id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell,
149 XDG_SHELL_GET_XDG_POPUP, &xdg_popup_interface, NULL, surface, parent, seat, serial, x, y, flags); 149 XDG_SHELL_GET_XDG_POPUP, &xdg_popup_interface, NULL, surface, parent, seat, serial, x, y, flags);
150 150
151 return (struct xdg_popup *) id; 151 return (struct xdg_popup *) id;
152} 152}
153 153
154static inline void 154static inline void
155xdg_shell_pong(struct xdg_shell *xdg_shell, uint32_t serial) 155xdg_shell_pong(struct xdg_shell *xdg_shell, uint32_t serial)
156{ 156{
157 wl_proxy_marshal((struct wl_proxy *) xdg_shell, 157 wl_proxy_marshal((struct wl_proxy *) xdg_shell,
158 XDG_SHELL_PONG, serial); 158 XDG_SHELL_PONG, serial);
159} 159}
160 160
161#ifndef XDG_SURFACE_RESIZE_EDGE_ENUM 161#ifndef XDG_SURFACE_RESIZE_EDGE_ENUM
@@ -177,15 +177,15 @@ xdg_shell_pong(struct xdg_shell *xdg_shell, uint32_t serial)
177 * adapt its behavior, e.g. choose an appropriate cursor image. 177 * adapt its behavior, e.g. choose an appropriate cursor image.
178 */ 178 */
179enum xdg_surface_resize_edge { 179enum xdg_surface_resize_edge {
180 XDG_SURFACE_RESIZE_EDGE_NONE = 0, 180 XDG_SURFACE_RESIZE_EDGE_NONE = 0,
181 XDG_SURFACE_RESIZE_EDGE_TOP = 1, 181 XDG_SURFACE_RESIZE_EDGE_TOP = 1,
182 XDG_SURFACE_RESIZE_EDGE_BOTTOM = 2, 182 XDG_SURFACE_RESIZE_EDGE_BOTTOM = 2,
183 XDG_SURFACE_RESIZE_EDGE_LEFT = 4, 183 XDG_SURFACE_RESIZE_EDGE_LEFT = 4,
184 XDG_SURFACE_RESIZE_EDGE_TOP_LEFT = 5, 184 XDG_SURFACE_RESIZE_EDGE_TOP_LEFT = 5,
185 XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT = 6, 185 XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT = 6,
186 XDG_SURFACE_RESIZE_EDGE_RIGHT = 8, 186 XDG_SURFACE_RESIZE_EDGE_RIGHT = 8,
187 XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT = 9, 187 XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT = 9,
188 XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT = 10, 188 XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT = 10,
189}; 189};
190#endif /* XDG_SURFACE_RESIZE_EDGE_ENUM */ 190#endif /* XDG_SURFACE_RESIZE_EDGE_ENUM */
191 191
@@ -218,10 +218,10 @@ enum xdg_surface_resize_edge {
218 * 0x1FFF: GNOME 218 * 0x1FFF: GNOME
219 */ 219 */
220enum xdg_surface_state { 220enum xdg_surface_state {
221 XDG_SURFACE_STATE_MAXIMIZED = 1, 221 XDG_SURFACE_STATE_MAXIMIZED = 1,
222 XDG_SURFACE_STATE_FULLSCREEN = 2, 222 XDG_SURFACE_STATE_FULLSCREEN = 2,
223 XDG_SURFACE_STATE_RESIZING = 3, 223 XDG_SURFACE_STATE_RESIZING = 3,
224 XDG_SURFACE_STATE_ACTIVATED = 4, 224 XDG_SURFACE_STATE_ACTIVATED = 4,
225}; 225};
226#endif /* XDG_SURFACE_STATE_ENUM */ 226#endif /* XDG_SURFACE_STATE_ENUM */
227 227
@@ -242,183 +242,183 @@ enum xdg_surface_state {
242 * must be called before destroying the wl_surface object. 242 * must be called before destroying the wl_surface object.
243 */ 243 */
244struct xdg_surface_listener { 244struct xdg_surface_listener {
245 /** 245 /**
246 * configure - suggest a surface change 246 * configure - suggest a surface change
247 * @width: (none) 247 * @width: (none)
248 * @height: (none) 248 * @height: (none)
249 * @states: (none) 249 * @states: (none)
250 * @serial: (none) 250 * @serial: (none)
251 * 251 *
252 * The configure event asks the client to resize its surface. 252 * The configure event asks the client to resize its surface.
253 * 253 *
254 * The width and height arguments specify a hint to the window 254 * The width and height arguments specify a hint to the window
255 * about how its surface should be resized in window geometry 255 * about how its surface should be resized in window geometry
256 * coordinates. The states listed in the event specify how the 256 * coordinates. The states listed in the event specify how the
257 * width/height arguments should be interpreted. 257 * width/height arguments should be interpreted.
258 * 258 *
259 * A client should arrange a new surface, and then send a 259 * A client should arrange a new surface, and then send a
260 * ack_configure request with the serial sent in this configure 260 * ack_configure request with the serial sent in this configure
261 * event before attaching a new surface. 261 * event before attaching a new surface.
262 * 262 *
263 * If the client receives multiple configure events before it can 263 * If the client receives multiple configure events before it can
264 * respond to one, it is free to discard all but the last event it 264 * respond to one, it is free to discard all but the last event it
265 * received. 265 * received.
266 */ 266 */
267 void (*configure)(void *data, 267 void (*configure)(void *data,
268 struct xdg_surface *xdg_surface, 268 struct xdg_surface *xdg_surface,
269 int32_t width, 269 int32_t width,
270 int32_t height, 270 int32_t height,
271 struct wl_array *states, 271 struct wl_array *states,
272 uint32_t serial); 272 uint32_t serial);
273 /** 273 /**
274 * close - surface wants to be closed 274 * close - surface wants to be closed
275 * 275 *
276 * The close event is sent by the compositor when the user wants 276 * The close event is sent by the compositor when the user wants
277 * the surface to be closed. This should be equivalent to the user 277 * the surface to be closed. This should be equivalent to the user
278 * clicking the close button in client-side decorations, if your 278 * clicking the close button in client-side decorations, if your
279 * application has any... 279 * application has any...
280 * 280 *
281 * This is only a request that the user intends to close your 281 * This is only a request that the user intends to close your
282 * window. The client may choose to ignore this request, or show a 282 * window. The client may choose to ignore this request, or show a
283 * dialog to ask the user to save their data... 283 * dialog to ask the user to save their data...
284 */ 284 */
285 void (*close)(void *data, 285 void (*close)(void *data,
286 struct xdg_surface *xdg_surface); 286 struct xdg_surface *xdg_surface);
287}; 287};
288 288
289static inline int 289static inline int
290xdg_surface_add_listener(struct xdg_surface *xdg_surface, 290xdg_surface_add_listener(struct xdg_surface *xdg_surface,
291 const struct xdg_surface_listener *listener, void *data) 291 const struct xdg_surface_listener *listener, void *data)
292{ 292{
293 return wl_proxy_add_listener((struct wl_proxy *) xdg_surface, 293 return wl_proxy_add_listener((struct wl_proxy *) xdg_surface,
294 (void (**)(void)) listener, data); 294 (void (**)(void)) listener, data);
295} 295}
296 296
297#define XDG_SURFACE_DESTROY 0 297#define XDG_SURFACE_DESTROY 0
298#define XDG_SURFACE_SET_PARENT 1 298#define XDG_SURFACE_SET_PARENT 1
299#define XDG_SURFACE_SET_TITLE 2 299#define XDG_SURFACE_SET_TITLE 2
300#define XDG_SURFACE_SET_APP_ID 3 300#define XDG_SURFACE_SET_APP_ID 3
301#define XDG_SURFACE_SHOW_WINDOW_MENU 4 301#define XDG_SURFACE_SHOW_WINDOW_MENU 4
302#define XDG_SURFACE_MOVE 5 302#define XDG_SURFACE_MOVE 5
303#define XDG_SURFACE_RESIZE 6 303#define XDG_SURFACE_RESIZE 6
304#define XDG_SURFACE_ACK_CONFIGURE 7 304#define XDG_SURFACE_ACK_CONFIGURE 7
305#define XDG_SURFACE_SET_WINDOW_GEOMETRY 8 305#define XDG_SURFACE_SET_WINDOW_GEOMETRY 8
306#define XDG_SURFACE_SET_MAXIMIZED 9 306#define XDG_SURFACE_SET_MAXIMIZED 9
307#define XDG_SURFACE_UNSET_MAXIMIZED 10 307#define XDG_SURFACE_UNSET_MAXIMIZED 10
308#define XDG_SURFACE_SET_FULLSCREEN 11 308#define XDG_SURFACE_SET_FULLSCREEN 11
309#define XDG_SURFACE_UNSET_FULLSCREEN 12 309#define XDG_SURFACE_UNSET_FULLSCREEN 12
310#define XDG_SURFACE_SET_MINIMIZED 13 310#define XDG_SURFACE_SET_MINIMIZED 13
311 311
312static inline void 312static inline void
313xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data) 313xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data)
314{ 314{
315 wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data); 315 wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data);
316} 316}
317 317
318static inline void * 318static inline void *
319xdg_surface_get_user_data(struct xdg_surface *xdg_surface) 319xdg_surface_get_user_data(struct xdg_surface *xdg_surface)
320{ 320{
321 return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface); 321 return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface);
322} 322}
323 323
324static inline void 324static inline void
325xdg_surface_destroy(struct xdg_surface *xdg_surface) 325xdg_surface_destroy(struct xdg_surface *xdg_surface)
326{ 326{
327 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 327 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
328 XDG_SURFACE_DESTROY); 328 XDG_SURFACE_DESTROY);
329 329
330 wl_proxy_destroy((struct wl_proxy *) xdg_surface); 330 wl_proxy_destroy((struct wl_proxy *) xdg_surface);
331} 331}
332 332
333static inline void 333static inline void
334xdg_surface_set_parent(struct xdg_surface *xdg_surface, struct wl_surface *parent) 334xdg_surface_set_parent(struct xdg_surface *xdg_surface, struct wl_surface *parent)
335{ 335{
336 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 336 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
337 XDG_SURFACE_SET_PARENT, parent); 337 XDG_SURFACE_SET_PARENT, parent);
338} 338}
339 339
340static inline void 340static inline void
341xdg_surface_set_title(struct xdg_surface *xdg_surface, const char *title) 341xdg_surface_set_title(struct xdg_surface *xdg_surface, const char *title)
342{ 342{
343 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 343 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
344 XDG_SURFACE_SET_TITLE, title); 344 XDG_SURFACE_SET_TITLE, title);
345} 345}
346 346
347static inline void 347static inline void
348xdg_surface_set_app_id(struct xdg_surface *xdg_surface, const char *app_id) 348xdg_surface_set_app_id(struct xdg_surface *xdg_surface, const char *app_id)
349{ 349{
350 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 350 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
351 XDG_SURFACE_SET_APP_ID, app_id); 351 XDG_SURFACE_SET_APP_ID, app_id);
352} 352}
353 353
354static inline void 354static inline void
355xdg_surface_show_window_menu(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y) 355xdg_surface_show_window_menu(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
356{ 356{
357 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 357 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
358 XDG_SURFACE_SHOW_WINDOW_MENU, seat, serial, x, y); 358 XDG_SURFACE_SHOW_WINDOW_MENU, seat, serial, x, y);
359} 359}
360 360
361static inline void 361static inline void
362xdg_surface_move(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial) 362xdg_surface_move(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial)
363{ 363{
364 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 364 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
365 XDG_SURFACE_MOVE, seat, serial); 365 XDG_SURFACE_MOVE, seat, serial);
366} 366}
367 367
368static inline void 368static inline void
369xdg_surface_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges) 369xdg_surface_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)
370{ 370{
371 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 371 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
372 XDG_SURFACE_RESIZE, seat, serial, edges); 372 XDG_SURFACE_RESIZE, seat, serial, edges);
373} 373}
374 374
375static inline void 375static inline void
376xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial) 376xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial)
377{ 377{
378 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 378 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
379 XDG_SURFACE_ACK_CONFIGURE, serial); 379 XDG_SURFACE_ACK_CONFIGURE, serial);
380} 380}
381 381
382static inline void 382static inline void
383xdg_surface_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height) 383xdg_surface_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height)
384{ 384{
385 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 385 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
386 XDG_SURFACE_SET_WINDOW_GEOMETRY, x, y, width, height); 386 XDG_SURFACE_SET_WINDOW_GEOMETRY, x, y, width, height);
387} 387}
388 388
389static inline void 389static inline void
390xdg_surface_set_maximized(struct xdg_surface *xdg_surface) 390xdg_surface_set_maximized(struct xdg_surface *xdg_surface)
391{ 391{
392 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 392 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
393 XDG_SURFACE_SET_MAXIMIZED); 393 XDG_SURFACE_SET_MAXIMIZED);
394} 394}
395 395
396static inline void 396static inline void
397xdg_surface_unset_maximized(struct xdg_surface *xdg_surface) 397xdg_surface_unset_maximized(struct xdg_surface *xdg_surface)
398{ 398{
399 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 399 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
400 XDG_SURFACE_UNSET_MAXIMIZED); 400 XDG_SURFACE_UNSET_MAXIMIZED);
401} 401}
402 402
403static inline void 403static inline void
404xdg_surface_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output) 404xdg_surface_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output)
405{ 405{
406 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 406 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
407 XDG_SURFACE_SET_FULLSCREEN, output); 407 XDG_SURFACE_SET_FULLSCREEN, output);
408} 408}
409 409
410static inline void 410static inline void
411xdg_surface_unset_fullscreen(struct xdg_surface *xdg_surface) 411xdg_surface_unset_fullscreen(struct xdg_surface *xdg_surface)
412{ 412{
413 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 413 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
414 XDG_SURFACE_UNSET_FULLSCREEN); 414 XDG_SURFACE_UNSET_FULLSCREEN);
415} 415}
416 416
417static inline void 417static inline void
418xdg_surface_set_minimized(struct xdg_surface *xdg_surface) 418xdg_surface_set_minimized(struct xdg_surface *xdg_surface)
419{ 419{
420 wl_proxy_marshal((struct wl_proxy *) xdg_surface, 420 wl_proxy_marshal((struct wl_proxy *) xdg_surface,
421 XDG_SURFACE_SET_MINIMIZED); 421 XDG_SURFACE_SET_MINIMIZED);
422} 422}
423 423
424/** 424/**
@@ -445,48 +445,48 @@ xdg_surface_set_minimized(struct xdg_surface *xdg_surface)
445 * xdg_popup surfaces are always transient for another surface. 445 * xdg_popup surfaces are always transient for another surface.
446 */ 446 */
447struct xdg_popup_listener { 447struct xdg_popup_listener {
448 /** 448 /**
449 * popup_done - popup interaction is done 449 * popup_done - popup interaction is done
450 * @serial: serial of the implicit grab on the pointer 450 * @serial: serial of the implicit grab on the pointer
451 * 451 *
452 * The popup_done event is sent out when a popup grab is broken, 452 * The popup_done event is sent out when a popup grab is broken,
453 * that is, when the users clicks a surface that doesn't belong to 453 * that is, when the users clicks a surface that doesn't belong to
454 * the client owning the popup surface. 454 * the client owning the popup surface.
455 */ 455 */
456 void (*popup_done)(void *data, 456 void (*popup_done)(void *data,
457 struct xdg_popup *xdg_popup, 457 struct xdg_popup *xdg_popup,
458 uint32_t serial); 458 uint32_t serial);
459}; 459};
460 460
461static inline int 461static inline int
462xdg_popup_add_listener(struct xdg_popup *xdg_popup, 462xdg_popup_add_listener(struct xdg_popup *xdg_popup,
463 const struct xdg_popup_listener *listener, void *data) 463 const struct xdg_popup_listener *listener, void *data)
464{ 464{
465 return wl_proxy_add_listener((struct wl_proxy *) xdg_popup, 465 return wl_proxy_add_listener((struct wl_proxy *) xdg_popup,
466 (void (**)(void)) listener, data); 466 (void (**)(void)) listener, data);
467} 467}
468 468
469#define XDG_POPUP_DESTROY 0 469#define XDG_POPUP_DESTROY 0
470 470
471static inline void 471static inline void
472xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data) 472xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data)
473{ 473{
474 wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data); 474 wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data);
475} 475}
476 476
477static inline void * 477static inline void *
478xdg_popup_get_user_data(struct xdg_popup *xdg_popup) 478xdg_popup_get_user_data(struct xdg_popup *xdg_popup)
479{ 479{
480 return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup); 480 return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup);
481} 481}
482 482
483static inline void 483static inline void
484xdg_popup_destroy(struct xdg_popup *xdg_popup) 484xdg_popup_destroy(struct xdg_popup *xdg_popup)
485{ 485{
486 wl_proxy_marshal((struct wl_proxy *) xdg_popup, 486 wl_proxy_marshal((struct wl_proxy *) xdg_popup,
487 XDG_POPUP_DESTROY); 487 XDG_POPUP_DESTROY);
488 488
489 wl_proxy_destroy((struct wl_proxy *) xdg_popup); 489 wl_proxy_destroy((struct wl_proxy *) xdg_popup);
490} 490}
491 491
492#ifdef __cplusplus 492#ifdef __cplusplus
diff --git a/src/lib/ecore_wayland/xdg-shell-protocol.c b/src/lib/ecore_wayland/xdg-shell-protocol.c
index 863f74e..81c7519 100644
--- a/src/lib/ecore_wayland/xdg-shell-protocol.c
+++ b/src/lib/ecore_wayland/xdg-shell-protocol.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * Copyright © 2008-2013 Kristian Høgsberg 2 * Copyright © 2008-2013 Kristian Høgsberg
3 * Copyright © 2013 Rafael Antognolli 3 * Copyright © 2013 Rafael Antognolli
4 * Copyright © 2013 Jasper St. Pierre 4 * Copyright © 2013 Jasper St. Pierre
5 * Copyright © 2010-2013 Intel Corporation 5 * Copyright © 2010-2013 Intel Corporation
6 * 6 *
7 * Permission to use, copy, modify, distribute, and sell this 7 * Permission to use, copy, modify, distribute, and sell this
8 * software and its documentation for any purpose is hereby granted 8 * software and its documentation for any purpose is hereby granted
9 * without fee, provided that the above copyright notice appear in 9 * without fee, provided that the above copyright notice appear in
@@ -15,7 +15,7 @@
15 * representations about the suitability of this software for any 15 * representations about the suitability of this software for any
16 * purpose. It is provided "as is" without express or implied 16 * purpose. It is provided "as is" without express or implied
17 * warranty. 17 * warranty.
18 * 18 *
19 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS 19 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
20 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
@@ -37,89 +37,88 @@ extern const struct wl_interface xdg_popup_interface;
37extern const struct wl_interface xdg_surface_interface; 37extern const struct wl_interface xdg_surface_interface;
38 38
39static const struct wl_interface *types[] = { 39static const struct wl_interface *types[] = {
40 NULL, 40 NULL,
41 NULL, 41 NULL,
42 NULL, 42 NULL,
43 NULL, 43 NULL,
44 &xdg_surface_interface, 44 &xdg_surface_interface,
45 &wl_surface_interface, 45 &wl_surface_interface,
46 &xdg_popup_interface, 46 &xdg_popup_interface,
47 &wl_surface_interface, 47 &am