discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=db91d16f780989e580f2a0edfe94fce65bb2f5c4
commit db91d16f780989e580f2a0edfe94fce65bb2f5c4 Author: Bryce Harrington <br...@osg.samsung.com> Date: Fri Mar 13 21:40:59 2015 -0400 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 --- src/lib/ecore_wayland/Ecore_Wayland.h | 94 +++--- src/lib/ecore_wayland/ecore_wl.c | 18 +- src/lib/ecore_wayland/ecore_wl_dnd.c | 96 +++--- src/lib/ecore_wayland/ecore_wl_input.c | 160 +++++----- src/lib/ecore_wayland/ecore_wl_output.c | 20 +- src/lib/ecore_wayland/ecore_wl_window.c | 116 ++++---- .../ivi-application-client-protocol.h | 122 ++++---- src/lib/ecore_wayland/ivi-application-protocol.c | 39 ++- src/lib/ecore_wayland/subsurface-client-protocol.h | 82 ++--- src/lib/ecore_wayland/subsurface-protocol.c | 49 ++- src/lib/ecore_wayland/xdg-shell-client-protocol.h | 330 ++++++++++----------- src/lib/ecore_wayland/xdg-shell-protocol.c | 121 ++++---- 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 { int modifiers; int x, y; - struct + struct { int x, y; } root; @@ -114,7 +114,7 @@ struct _Ecore_Wl_Event_Mouse_Out { int modifiers; int x, y; - struct + struct { int x, y; } root; @@ -151,7 +151,7 @@ struct _Ecore_Wl_Event_Dnd_Enter int num_types; unsigned int serial; struct wl_data_offer *offer; - struct + struct { int x, y; } position; @@ -160,7 +160,7 @@ struct _Ecore_Wl_Event_Dnd_Enter struct _Ecore_Wl_Event_Dnd_Position { unsigned int win, source; - struct + struct { int x, y; } position; @@ -174,7 +174,7 @@ struct _Ecore_Wl_Event_Dnd_Leave struct _Ecore_Wl_Event_Dnd_Drop { unsigned int win, source; - struct + struct { int x, y; } position; @@ -230,10 +230,10 @@ struct _Ecore_Wl_Event_Interfaces_Bound * @defgroup Ecore_Wl_Group Ecore_Wayland - Wayland integration * @ingroup Ecore - * Ecore_Wl provides a wrapper and convenience functions for using the - * Wayland window system. Function groups for this part of the library + * Ecore_Wl provides a wrapper and convenience functions for using the + * Wayland window system. Function groups for this part of the library * include the following: - * + * * @li @ref Ecore_Wl_Init_Group * @li @ref Ecore_Wl_Display_Group * @li @ref Ecore_Wl_Flush_Group @@ -462,17 +462,17 @@ EAPI struct wl_registry *ecore_wl_registry_get(void); /** * Creates a new window - * - * @param parent The parent window to use. If @p parent is @c 0, the root window + * + * @param parent The parent window to use. If @p parent is @c 0, the root window * of the default display is used. * @param x X Position * @param y Y position * @param w Width * @param h Height * @param buffer_type The type of the buffer to be used to create a new Ecore_Wl_Window. - * + * * @return The new window - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.2 */ @@ -480,9 +480,9 @@ EAPI Ecore_Wl_Window *ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, /** * Deletes the given window - * + * * @param win The given window - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.2 */ @@ -490,14 +490,14 @@ EAPI void ecore_wl_window_free(Ecore_Wl_Window *win); /** * Signals for Wayland to initiate a window move. - * - * The position requested (@p x, @p y) is not honored by Wayland because + * + * The position requested (@p x, @p y) is not honored by Wayland because * Wayland does not allow specific window placement to be set. - * + * * @param win The window to move. * @param x X Position * @param y Y Position - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.2 */ @@ -505,15 +505,15 @@ EAPI void ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y); /** * Signals for Wayland to initiate a window resize. - * - * The size requested (@p w, @p h) is not honored by Wayland because + * + * The size requested (@p w, @p h) is not honored by Wayland because * Wayland does not allow specific window sizes to be set. - * + * * @param win The window to resize. * @param w Width * @param h Height * @param location The edge of the window from where the resize should start. - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.2 */ @@ -526,11 +526,11 @@ EAPI void ecore_wl_window_commit(Ecore_Wl_Window *win); /** * Shows a window - * + * * Synonymous to "mapping" a window in Wayland System terminology. - * + * * @param win The window to show. - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.2 */ @@ -538,11 +538,11 @@ EAPI void ecore_wl_window_show(Ecore_Wl_Window *win); /** * Hides a window - * + * * Synonymous to "unmapping" a window in Wayland System terminology. - * + * * @param win The window to hide. - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.2 */ @@ -550,9 +550,9 @@ EAPI void ecore_wl_window_hide(Ecore_Wl_Window *win); /** * Raises a window - * + * * @param win The window to raise. - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.2 */ @@ -577,9 +577,9 @@ EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *pare /** * Iconify a window - * + * * @param win The window to iconifiy - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.12 */ @@ -591,7 +591,7 @@ EAPI int ecore_wl_window_id_get(Ecore_Wl_Window *win); EAPI void ecore_wl_window_title_set(Ecore_Wl_Window *win, const char *title); EAPI void ecore_wl_window_class_name_set(Ecore_Wl_Window *win, const char *class_name); EAPI int ecore_wl_window_surface_id_get(Ecore_Wl_Window *win); - + EAPI Ecore_Wl_Input *ecore_wl_window_keyboard_get(Ecore_Wl_Window *win); /** @@ -609,10 +609,10 @@ EAPI Eina_Bool ecore_wl_window_alpha_get(Ecore_Wl_Window *win); /** * Returns the Ecore_Wl_Window from a wl_surface - * + * * @param surface The surface for which to find the Ecore_Wl_Window from * @return the Ecore_Wl_Window associated with this surface - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.8 */ @@ -620,17 +620,17 @@ EAPI Ecore_Wl_Window *ecore_wl_window_surface_find(struct wl_surface *surface); /** * Set the input region of the Ecore_Wl_Window. - * + * * To set an empty region, pass width and height as 0. - * + * * An empty input region means the entire window surface will accept input. - * + * * @param win The window * @param x The left point of the region. * @param y The top point of the region. * @param w The width of the region. * @param h The height of the region. - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.8 */ @@ -638,13 +638,13 @@ EAPI void ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, i /** * Set the opaque region of the Ecore_Wl_Window - * + * * @param win The window * @param x The left point of the region. * @param y The top point of the region. * @param w The width of the region. * @param h The height of the region. - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.8 */ @@ -652,10 +652,10 @@ EAPI void ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, /** * Set the rotation of the Ecore_Wl_Window - * + * * @param win The window * @param rotation The degree of rotation for this window - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.8 */ @@ -663,10 +663,10 @@ EAPI void ecore_wl_window_rotation_set(Ecore_Wl_Window *win, int rotation); /** * Get the rotation of the Ecore_Wl_Window - * + * * @param win The window * @return The degree of rotation for this window - * + * * @ingroup Ecore_Wl_Window_Group * @since 1.8 */ @@ -681,13 +681,13 @@ EAPI int ecore_wl_window_rotation_get(Ecore_Wl_Window *win); /** * @deprecated use ecore_wl_dnd_selection_set - * @since 1.7 + * @since 1.7 */ EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_set_selection(Ecore_Wl_Dnd *dnd, const char **types_offered); /** * @deprecated use ecore_wl_dnd_selection_get - * @since 1.7 + * @since 1.7 */ EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_get_selection(Ecore_Wl_Dnd *dnd, const char *type); 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 = _ecore_wl_animator_callback }; -static void +static void xdg_shell_ping(void *data EINA_UNUSED, struct xdg_shell *shell, uint32_t serial) { xdg_shell_pong(shell, serial); @@ -179,7 +179,7 @@ ecore_wl_init(const char *name) _ecore_wl_disp->fd = wl_display_get_fd(_ecore_wl_disp->wl.display); _ecore_wl_disp->fd_hdl = - ecore_main_fd_handler_add(_ecore_wl_disp->fd, + ecore_main_fd_handler_add(_ecore_wl_disp->fd, ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR, _ecore_wl_cb_handle_data, _ecore_wl_disp, NULL, NULL); @@ -480,8 +480,8 @@ _ecore_wl_shutdown(Eina_Bool close) EINA_INLIST_FOREACH_SAFE(_ecore_wl_disp->globals, tmp, global) { - _ecore_wl_disp->globals = - eina_inlist_remove(_ecore_wl_disp->globals, + _ecore_wl_disp->globals = + eina_inlist_remove(_ecore_wl_disp->globals, EINA_INLIST_GET(global)); free(global->interface); free(global); @@ -646,7 +646,7 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in #endif else if (!strcmp(interface, "xdg_shell") && !getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL")) { - ewd->wl.xdg_shell = + ewd->wl.xdg_shell = wl_registry_bind(registry, id, &xdg_shell_interface, 1); xdg_shell_use_unstable_version(ewd->wl.xdg_shell, XDG_VERSION); 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 _ecore_wl_input_setup(ewd->input); else { - ewd->cursor_theme = - wl_cursor_theme_load(NULL, ECORE_WL_DEFAULT_CURSOR_SIZE, + ewd->cursor_theme = + wl_cursor_theme_load(NULL, ECORE_WL_DEFAULT_CURSOR_SIZE, ewd->wl.shm); } } @@ -676,7 +676,7 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1); } - if ((ewd->wl.compositor) && (ewd->wl.shm) && + if ((ewd->wl.compositor) && (ewd->wl.shm) && ((ewd->wl.shell) || (ewd->wl.xdg_shell))) { Ecore_Wl_Event_Interfaces_Bound *ev; @@ -710,7 +710,7 @@ _ecore_wl_cb_handle_global_remove(void *data, struct wl_registry *registry EINA_ EINA_INLIST_FOREACH_SAFE(ewd->globals, tmp, global) { if (global->id != id) continue; - ewd->globals = + ewd->globals = eina_inlist_remove(ewd->globals, EINA_INLIST_GET(global)); free(global->interface); 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_ static void _ecore_wl_dnd_offer_cb_offer(void *data, struct wl_data_offer *data_offer EINA_UNUSED, const char *type); /* local wayland interfaces */ -static const struct wl_data_source_listener -_ecore_wl_dnd_source_listener = +static const struct wl_data_source_listener +_ecore_wl_dnd_source_listener = { _ecore_wl_dnd_source_cb_target, _ecore_wl_dnd_source_cb_send, _ecore_wl_dnd_source_cb_cancelled }; -static const struct wl_data_offer_listener -_ecore_wl_dnd_offer_listener = +static const struct wl_data_offer_listener +_ecore_wl_dnd_offer_listener = { _ecore_wl_dnd_offer_cb_offer }; /** * @deprecated use ecore_wl_dnd_selection_set - * @since 1.7 + * @since 1.7 */ -EINA_DEPRECATED EAPI Eina_Bool +EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_set_selection(Ecore_Wl_Dnd *dnd, const char **types_offered) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -62,9 +62,9 @@ ecore_wl_dnd_set_selection(Ecore_Wl_Dnd *dnd, const char **types_offered) /** * @deprecated use ecore_wl_dnd_selection_get - * @since 1.7 + * @since 1.7 */ -EINA_DEPRECATED EAPI Eina_Bool +EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_get_selection(Ecore_Wl_Dnd *dnd, const char *type) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -86,7 +86,7 @@ ecore_wl_dnd_get(void) * @deprecated use ecore_wl_dnd_drag_start * @since 1.7 */ -EINA_DEPRECATED EAPI Eina_Bool +EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_start_drag(Ecore_Wl_Dnd *dnd EINA_UNUSED) { return EINA_FALSE; @@ -96,7 +96,7 @@ ecore_wl_dnd_start_drag(Ecore_Wl_Dnd *dnd EINA_UNUSED) * @deprecated use ecore_wl_dnd_selection_owner_has * @since 1.7 */ -EINA_DEPRECATED EAPI Eina_Bool +EINA_DEPRECATED EAPI Eina_Bool ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd) { return ecore_wl_dnd_selection_owner_has(dnd->input); @@ -106,7 +106,7 @@ ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd) * @ingroup Ecore_Wl_Dnd_Group * @since 1.8 */ -EAPI Eina_Bool +EAPI Eina_Bool ecore_wl_dnd_selection_set(Ecore_Wl_Input *input, const char **types_offered) { struct wl_data_device_manager *man; @@ -145,11 +145,11 @@ ecore_wl_dnd_selection_set(Ecore_Wl_Input *input, const char **types_offered) } /* add a listener for data source events */ - wl_data_source_add_listener(input->data_source, + wl_data_source_add_listener(input->data_source, &_ecore_wl_dnd_source_listener, input); /* set the selection */ - wl_data_device_set_selection(input->data_device, input->data_source, + wl_data_device_set_selection(input->data_device, input->data_source, input->display->serial); return EINA_TRUE; @@ -159,7 +159,7 @@ ecore_wl_dnd_selection_set(Ecore_Wl_Input *input, const char **types_offered) * @ingroup Ecore_Wl_Dnd_Group * @since 1.8 */ -EAPI Eina_Bool +EAPI Eina_Bool ecore_wl_dnd_selection_get(Ecore_Wl_Input *input, const char *type) { char **t; @@ -185,7 +185,7 @@ ecore_wl_dnd_selection_get(Ecore_Wl_Input *input, const char *type) * @ingroup Ecore_Wl_Dnd_Group * @since 1.8 */ -EAPI Eina_Bool +EAPI Eina_Bool ecore_wl_dnd_selection_owner_has(Ecore_Wl_Input *input) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -198,7 +198,7 @@ ecore_wl_dnd_selection_owner_has(Ecore_Wl_Input *input) * @ingroup Ecore_Wl_Dnd_Group * @since 1.8 */ -EAPI Eina_Bool +EAPI Eina_Bool ecore_wl_dnd_selection_clear(Ecore_Wl_Input *input) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -207,7 +207,7 @@ ecore_wl_dnd_selection_clear(Ecore_Wl_Input *input) if (!input) return EINA_FALSE; /* set the selection to NULL */ - wl_data_device_set_selection(input->data_device, NULL, + wl_data_device_set_selection(input->data_device, NULL, input->display->serial); return EINA_TRUE; @@ -217,7 +217,7 @@ ecore_wl_dnd_selection_clear(Ecore_Wl_Input *input) * @ingroup Ecore_Wl_Dnd_Group * @since 1.8 */ -EAPI void +EAPI void ecore_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) { 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 ecore_wl_input_ungrab(input); /* add a listener for data source events */ - wl_data_source_add_listener(input->data_source, + wl_data_source_add_listener(input->data_source, &_ecore_wl_dnd_source_listener, input); /* start the drag */ if ((origin_surface = ecore_wl_window_surface_get(win))) { - wl_data_device_start_drag(input->data_device, input->data_source, - origin_surface, drag_surface, + wl_data_device_start_drag(input->data_device, input->data_source, + origin_surface, drag_surface, input->display->serial); /* set pointer image */ @@ -253,8 +253,8 @@ ecore_wl_dnd_drag_start(Ecore_Wl_Input *input, Ecore_Wl_Window *win, Ecore_Wl_Wi } /* NB: Below code disabled for now - * - * This Was for adjusting the "drag icon" to be centered on the mouse + * + * This Was for adjusting the "drag icon" to be centered on the mouse * based on the hotspot, but it crashes for some reason :( */ @@ -274,7 +274,7 @@ ecore_wl_dnd_drag_start(Ecore_Wl_Input *input, Ecore_Wl_Window *win, Ecore_Wl_Wi * @ingroup Ecore_Wl_Dnd_Group * @since 1.8 */ -EAPI void +EAPI void ecore_wl_dnd_drag_end(Ecore_Wl_Input *input) { Ecore_Wl_Event_Dnd_End *ev; @@ -316,7 +316,7 @@ ecore_wl_dnd_drag_end(Ecore_Wl_Input *input) * @ingroup Ecore_Wl_Dnd_Group * @since 1.8 */ -EAPI Eina_Bool +EAPI Eina_Bool ecore_wl_dnd_drag_get(Ecore_Wl_Input *input, const char *type) { char **t; @@ -340,7 +340,7 @@ ecore_wl_dnd_drag_get(Ecore_Wl_Input *input, const char *type) * @ingroup Ecore_Wl_Dnd_Group * @since 1.8 */ -EAPI void +EAPI void ecore_wl_dnd_drag_types_set(Ecore_Wl_Input *input, const char **types_offered) { struct wl_data_device_manager *man; @@ -379,7 +379,7 @@ ecore_wl_dnd_drag_types_set(Ecore_Wl_Input *input, const char **types_offered) { if (!*type) continue; t = wl_array_add(&input->data_types, sizeof(*t)); - if (t) + if (t) { *t = strdup(*type); wl_data_source_offer(input->data_source, *t); @@ -403,7 +403,7 @@ ecore_wl_dnd_drag_types_get(Ecore_Wl_Input *input) } /* private functions */ -void +void _ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device EINA_UNUSED, struct wl_data_offer *offer) { Ecore_Wl_Dnd_Source *source; @@ -418,11 +418,11 @@ _ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device EINA source->input = input; source->data_offer = offer; - wl_data_offer_add_listener(source->data_offer, + wl_data_offer_add_listener(source->data_offer, &_ecore_wl_dnd_offer_listener, source); } -void +void _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) { Ecore_Wl_Event_Dnd_Enter *ev; @@ -455,7 +455,7 @@ _ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device EINA_UNUSED, if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Dnd_Enter)))) return; - if (win) + if (win) ev->win = win->id; if (input->keyboard_focus) @@ -471,7 +471,7 @@ _ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device EINA_UNUSED, ecore_event_add(ECORE_WL_EVENT_DND_ENTER, ev, NULL, NULL); } -void +void _ecore_wl_dnd_leave(void *data, struct wl_data_device *data_device EINA_UNUSED) { Ecore_Wl_Event_Dnd_Leave *ev; @@ -492,7 +492,7 @@ _ecore_wl_dnd_leave(void *data, struct wl_data_device *data_device EINA_UNUSED) ecore_event_add(ECORE_WL_EVENT_DND_LEAVE, ev, NULL, NULL); } -void +void _ecore_wl_dnd_motion(void *data, struct wl_data_device *data_device EINA_UNUSED, unsigned int timestamp EINA_UNUSED, int x, int y) { Ecore_Wl_Event_Dnd_Position *ev; @@ -519,7 +519,7 @@ _ecore_wl_dnd_motion(void *data, struct wl_data_device *data_device EINA_UNUSED, ecore_event_add(ECORE_WL_EVENT_DND_POSITION, ev, NULL, NULL); } -void +void _ecore_wl_dnd_drop(void *data, struct wl_data_device *data_device EINA_UNUSED) { Ecore_Wl_Event_Dnd_Drop *ev; @@ -545,7 +545,7 @@ _ecore_wl_dnd_drop(void *data, struct wl_data_device *data_device EINA_UNUSED) ecore_event_add(ECORE_WL_EVENT_DND_DROP, ev, NULL, NULL); } -void +void _ecore_wl_dnd_selection(void *data, struct wl_data_device *data_device EINA_UNUSED, struct wl_data_offer *offer) { Ecore_Wl_Input *input; @@ -567,7 +567,7 @@ _ecore_wl_dnd_selection(void *data, struct wl_data_device *data_device EINA_UNUS } } -void +void _ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -583,7 +583,7 @@ _ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source) } /* local functions */ -static void +static void _ecore_wl_dnd_selection_data_receive(Ecore_Wl_Dnd_Source *source, const char *type) { int epoll_fd; @@ -640,7 +640,7 @@ err: return; } -static Eina_Bool +static Eina_Bool _ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_UNUSED) { int len; @@ -655,7 +655,7 @@ _ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_ len = read(source->fd, buffer, sizeof buffer); - if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Selection_Data_Ready)))) + if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Selection_Data_Ready)))) return ECORE_CALLBACK_CANCEL; if (len <= 0) @@ -682,13 +682,13 @@ _ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_ ret = ECORE_CALLBACK_RENEW; } - ecore_event_add(ECORE_WL_EVENT_SELECTION_DATA_READY, event, + ecore_event_add(ECORE_WL_EVENT_SELECTION_DATA_READY, event, _ecore_wl_dnd_selection_data_ready_cb_free, NULL); return ret; } -static void +static void _ecore_wl_dnd_selection_data_ready_cb_free(void *data EINA_UNUSED, void *event) { Ecore_Wl_Event_Selection_Data_Ready *ev; @@ -722,11 +722,11 @@ _ecore_wl_dnd_selection_cb_idle(void *data) free(ctx); return ECORE_CALLBACK_CANCEL; } - } + } return ECORE_CALLBACK_RENEW; } -static void +static void _ecore_wl_dnd_source_cb_target(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type EINA_UNUSED) { Ecore_Wl_Event_Data_Source_Target *event; @@ -757,7 +757,7 @@ _ecore_wl_dnd_source_cb_target_free(void *data EINA_UNUSED, void *event) free(ev); } -static void +static void _ecore_wl_dnd_source_cb_send(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type, int32_t fd) { 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 event->type = strdup(mime_type); event->fd = fd; - ecore_event_add(ECORE_WL_EVENT_DATA_SOURCE_SEND, event, + ecore_event_add(ECORE_WL_EVENT_DATA_SOURCE_SEND, event, _ecore_wl_dnd_source_cb_send_free, NULL); } -static void +static void _ecore_wl_dnd_source_cb_send_free(void *data EINA_UNUSED, void *event) { Ecore_Wl_Event_Data_Source_Send *ev; @@ -789,7 +789,7 @@ _ecore_wl_dnd_source_cb_send_free(void *data EINA_UNUSED, void *event) free(ev); } -static void +static void _ecore_wl_dnd_source_cb_cancelled(void *data, struct wl_data_source *source) { Ecore_Wl_Input *input; @@ -813,7 +813,7 @@ _ecore_wl_dnd_source_cb_cancelled(void *data, struct wl_data_source *source) ecore_event_add(ECORE_WL_EVENT_DATA_SOURCE_CANCELLED, ev, NULL, NULL); } -static void +static void _ecore_wl_dnd_offer_cb_offer(void *data, struct wl_data_offer *data_offer EINA_UNUSED, const char *type) { 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 @@ /* * NB: Events that receive a 'serial' instead of timestamp - * + * * input_device_attach (for pointer image) * input_device_button_event (button press/release) * input_device_key_press @@ -14,14 +14,14 @@ * input_device_keyboard_leave * input_device_touch_down * input_device_touch_up - * + * **/ #include "ecore_wl_private.h" #include <sys/mman.h> #include <ctype.h> -/* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ... +/* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ... * What about other OSs ?? */ #ifdef __linux__ # include <linux/input.h> @@ -94,7 +94,7 @@ static Ecore_Wl_Mouse_Down_Info *_ecore_wl_mouse_down_info_get(int dev); /* static int _ecore_wl_input_keysym_to_string(unsigned int symbol, char *buffer, int len); */ /* wayland interfaces */ -static const struct wl_pointer_listener pointer_listener = +static const struct wl_pointer_listener pointer_listener = { _ecore_wl_input_cb_pointer_enter, _ecore_wl_input_cb_pointer_leave, @@ -103,7 +103,7 @@ static const struct wl_pointer_listener pointer_listener = _ecore_wl_input_cb_pointer_axis, }; -static const struct wl_keyboard_listener keyboard_listener = +static const struct wl_keyboard_listener keyboard_listener = { _ecore_wl_input_cb_keyboard_keymap, _ecore_wl_input_cb_keyboard_enter, @@ -112,7 +112,7 @@ static const struct wl_keyboard_listener keyboard_listener = _ecore_wl_input_cb_keyboard_modifiers, }; -static const struct wl_touch_listener touch_listener = +static const struct wl_touch_listener touch_listener = { _ecore_wl_input_cb_touch_down, _ecore_wl_input_cb_touch_up, @@ -121,13 +121,13 @@ static const struct wl_touch_listener touch_listener = _ecore_wl_input_cb_touch_cancel }; -static const struct wl_seat_listener _ecore_wl_seat_listener = +static const struct wl_seat_listener _ecore_wl_seat_listener = { _ecore_wl_input_seat_handle_capabilities, NULL // _ecore_wl_input_seat_handle_name }; -static const struct wl_data_device_listener _ecore_wl_data_listener = +static const struct wl_data_device_listener _ecore_wl_data_listener = { _ecore_wl_input_cb_data_offer, _ecore_wl_input_cb_data_enter, @@ -137,7 +137,7 @@ static const struct wl_data_device_listener _ecore_wl_data_listener = _ecore_wl_input_cb_data_selection }; -static const struct wl_callback_listener _ecore_wl_pointer_surface_listener = +static const struct wl_callback_listener _ecore_wl_pointer_surface_listener = { _ecore_wl_input_cb_pointer_frame }; @@ -145,7 +145,7 @@ static const struct wl_callback_listener _ecore_wl_pointer_surface_listener = /* local variables */ static int _pointer_x, _pointer_y; -EAPI void +EAPI void ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -155,7 +155,7 @@ ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int bu input->grab_button = button; } -EAPI void +EAPI void ecore_wl_input_ungrab(Ecore_Wl_Input *input) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -163,7 +163,7 @@ ecore_wl_input_ungrab(Ecore_Wl_Input *input) if (!input) return; if ((input->grab) && (input->grab_button)) - _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button, + _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button, input->grab_timestamp); input->grab = NULL; @@ -222,7 +222,7 @@ ecore_wl_input_cursor_size_set(Ecore_Wl_Input *input, const int size) EINA_SAFETY_ON_NULL_RETURN(input->display->wl.shm); - input->display->cursor_theme = + input->display->cursor_theme = wl_cursor_theme_load(NULL, input->cursor_size, input->display->wl.shm); } @@ -298,7 +298,7 @@ ecore_wl_input_cursor_from_name_set(Ecore_Wl_Input *input, const char *cursor_na eina_stringshare_replace(&input->cursor_name, cursor_name); /* No cursor. Set to default Left Pointer */ - if (!cursor_name) + if (!cursor_name) eina_stringshare_replace(&input->cursor_name, "left_ptr"); /* try to get this cursor from the theme */ @@ -390,11 +390,11 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id) if (ewd->wl.shm) _ecore_wl_input_setup(input); - input->seat = + input->seat = wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1); ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input)); - wl_seat_add_listener(input->seat, + wl_seat_add_listener(input->seat, &_ecore_wl_seat_listener, input); wl_seat_set_user_data(input->seat, input); @@ -402,17 +402,17 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id) if (ewd->wl.data_device_manager) { - input->data_device = - wl_data_device_manager_get_data_device(ewd->wl.data_device_manager, + input->data_device = + wl_data_device_manager_get_data_device(ewd->wl.data_device_manager, input->seat); - wl_data_device_add_listener(input->data_device, + wl_data_device_add_listener(input->data_device, &_ecore_wl_data_listener, input); } ewd->input = input; } -void +void _ecore_wl_input_del(Ecore_Wl_Input *input) { if (!input) return; @@ -486,14 +486,14 @@ _ecore_wl_input_del(Ecore_Wl_Input *input) free(input); } -void +void _ecore_wl_input_pointer_xy_get(int *x, int *y) { if (x) *x = _pointer_x; if (y) *y = _pointer_y; } -static void +static void _ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { Ecore_Wl_Input *input; @@ -510,7 +510,7 @@ _ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum if (!input->cursor_surface) { - input->cursor_surface = + input->cursor_surface = wl_compositor_create_surface(_ecore_wl_disp->wl.compositor); } } @@ -547,7 +547,7 @@ _ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum } } -static void +static void _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) { Ecore_Wl_Input *input; @@ -565,7 +565,7 @@ _ecore_wl_input_cb_pointer_motion(void *data, struct wl_pointer *pointer EINA_UN _ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp, 0); } -static void +static void _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) { Ecore_Wl_Input *input; @@ -604,7 +604,7 @@ _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UN // _ecore_wl_input_mouse_move_send(input, timestamp); } -static void +static void _ecore_wl_input_cb_pointer_axis(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, unsigned int axis, wl_fixed_t value) { Ecore_Wl_Input *input; @@ -612,11 +612,11 @@ _ecore_wl_input_cb_pointer_axis(void *data, struct wl_pointer *pointer EINA_UNUS LOGFN(__FILE__, __LINE__, __FUNCTION__); if (!(input = data)) return; - _ecore_wl_input_mouse_wheel_send(input, axis, wl_fixed_to_int(value), + _ecore_wl_input_mouse_wheel_send(input, axis, wl_fixed_to_int(value), timestamp); } -static void +static void _ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED) { Ecore_Wl_Input *input; @@ -641,12 +641,12 @@ _ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsig if ((input->cursor->image_count > 1) && (!input->cursor_frame_cb)) { input->cursor_frame_cb = wl_surface_frame(input->cursor_surface); - wl_callback_add_listener(input->cursor_frame_cb, + wl_callback_add_listener(input->cursor_frame_cb, &_ecore_wl_pointer_surface_listener, input); } } -static void +static void _ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size) { Ecore_Wl_Input *input; @@ -673,8 +673,8 @@ _ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA return; } - input->xkb.keymap = - xkb_map_new_from_string(input->display->xkb.context, map, + input->xkb.keymap = + xkb_map_new_from_string(input->display->xkb.context, map, XKB_KEYMAP_FORMAT_TEXT_V1, 0); munmap(map, size); @@ -688,21 +688,21 @@ _ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA return; } - input->xkb.control_mask = + input->xkb.control_mask = 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CTRL); - input->xkb.alt_mask = + input->xkb.alt_mask = 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_ALT); - input->xkb.shift_mask = + input->xkb.shift_mask = 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_SHIFT); - input->xkb.win_mask = + input->xkb.win_mask = 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_LOGO); - input->xkb.scroll_mask = + input->xkb.scroll_mask = 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_SCROLL); - input->xkb.num_mask = + input->xkb.num_mask = 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_NUM); - input->xkb.caps_mask = + input->xkb.caps_mask = 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CAPS); - input->xkb.altgr_mask = + input->xkb.altgr_mask = 1 << xkb_map_mod_get_index(input->xkb.keymap, "ISO_Level3_Shift"); } @@ -750,7 +750,7 @@ _ecore_wl_input_keymap_translate_keysym(xkb_keysym_t keysym, unsigned int modifi return 1; } -static void +static void _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) { Ecore_Wl_Input *input; @@ -766,7 +766,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN if (!(input = data)) return; win = input->keyboard_focus; - if ((!win) || (win->keyboard_device != input) || (!input->xkb.state)) + if ((!win) || (win->keyboard_device != input) || (!input->xkb.state)) return; input->display->serial = serial; @@ -789,8 +789,8 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN snprintf(keyname, sizeof(keyname), "Keycode-%u", code); /* if shift is active, we need to transform the key to lower */ - if (xkb_state_mod_index_is_active(input->xkb.state, - xkb_map_mod_get_index(input->xkb.keymap, + if (xkb_state_mod_index_is_active(input->xkb.state, + xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_SHIFT), XKB_STATE_MODS_EFFECTIVE)) { @@ -799,7 +799,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN } memset(compose, 0, sizeof(compose)); - _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, + _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, compose, sizeof(compose)); 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 if (!input->repeat.tmr) { - input->repeat.tmr = + input->repeat.tmr = ecore_timer_add(0.025, _ecore_wl_input_cb_keyboard_repeat, input); } ecore_timer_delay(input->repeat.tmr, 0.4); } } -static void +static void _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) { Ecore_Wl_Input *input; @@ -863,10 +863,10 @@ _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard E if (!input->xkb.keymap) return; - xkb_state_update_mask(input->xkb.state, + xkb_state_update_mask(input->xkb.state, depressed, latched, locked, 0, 0, group); - mask = xkb_state_serialize_mods(input->xkb.state, + mask = xkb_state_serialize_mods(input->xkb.state, (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED)); input->modifiers = 0; @@ -888,7 +888,7 @@ _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard E input->modifiers |= ECORE_EVENT_MODIFIER_ALTGR; } -static Eina_Bool +static Eina_Bool _ecore_wl_input_cb_keyboard_repeat(void *data) { Ecore_Wl_Input *input; @@ -899,14 +899,14 @@ _ecore_wl_input_cb_keyboard_repeat(void *data) if (!(input = data)) return ECORE_CALLBACK_RENEW; if ((win = input->keyboard_focus)) - _ecore_wl_input_cb_keyboard_key(input, NULL, input->display->serial, - input->repeat.time, + _ecore_wl_input_cb_keyboard_key(input, NULL, input->display->serial, + input->repeat.time, input->repeat.key, EINA_TRUE); return ECORE_CALLBACK_RENEW; } -static void +static void _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) { Ecore_Wl_Input *input; @@ -941,10 +941,10 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNU if (win->pointer.set) { - ecore_wl_input_pointer_set(input, win->pointer.surface, + ecore_wl_input_pointer_set(input, win->pointer.surface, win->pointer.hot_x, win->pointer.hot_y); } - /* NB: Commented out for now. Not needed in most circumstances, + /* NB: Commented out for now. Not needed in most circumstances, * but left here for any corner-cases */ /* else */ /* { */ @@ -955,7 +955,7 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNU } } -static void +static void _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface) { Ecore_Wl_Input *input; @@ -968,7 +968,7 @@ _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNU input->display->serial = serial; - /* NB: Commented out for now. Not needed in most circumstances, but left + /* NB: Commented out for now. Not needed in most circumstances, but left * here for any corner-cases */ /* _ecore_wl_input_cursor_update(input); */ @@ -989,7 +989,7 @@ _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNU } } -static void +static void _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) { Ecore_Wl_Input *input; @@ -1018,7 +1018,7 @@ _ecore_wl_input_cb_keyboard_enter(void *data, struct wl_keyboard *keyboard EINA_ _ecore_wl_input_focus_in_send(input, win, input->timestamp); } -static void +static void _ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface) { Ecore_Wl_Input *input; @@ -1051,7 +1051,7 @@ _ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_ input->keyboard_focus = NULL; } -static void +static void _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) { Ecore_Wl_Input *input; @@ -1082,7 +1082,7 @@ _ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, un id, BTN_LEFT, timestamp); } -static void +static void _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, int id) { Ecore_Wl_Input *input; @@ -1100,7 +1100,7 @@ _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsi ecore_wl_input_ungrab(input); } -static void +static void _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) { Ecore_Wl_Input *input; @@ -1117,19 +1117,19 @@ _ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED, _ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id); } -static void +static void _ecore_wl_input_cb_touch_frame(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED) { LOGFN(__FILE__, __LINE__, __FUNCTION__); } -static void +static void _ecore_wl_input_cb_touch_cancel(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED) { LOGFN(__FILE__, __LINE__, __FUNCTION__); } -static void +static void _ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -1137,7 +1137,7 @@ _ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, st _ecore_wl_dnd_add(data, data_device, offer); } -static void +static void _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) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -1147,7 +1147,7 @@ _ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, un _ecore_wl_dnd_enter(data, data_device, timestamp, surface, x, y, offer); } -static void +static void _ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -1155,7 +1155,7 @@ _ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device) _ecore_wl_dnd_leave(data, data_device); } -static void +static void _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) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -1163,7 +1163,7 @@ _ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *data_device, u _ecore_wl_dnd_motion(data, data_device, timestamp, x, y); } -static void +static void _ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -1171,7 +1171,7 @@ _ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device) _ecore_wl_dnd_drop(data, data_device); } -static void +static void _ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -1179,7 +1179,7 @@ _ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device _ecore_wl_dnd_selection(data, data_device, offer); } -static void +static void _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp, int device) { Ecore_Event_Mouse_Move *ev; @@ -1221,7 +1221,7 @@ _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL); } -static void +static void _ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp) { 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 ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL); } -static void +static void _ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp) { 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 ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL); } -static void +static void _ecore_wl_input_focus_in_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp) { 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 ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL); } -static void +static void _ecore_wl_input_focus_out_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp) { 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 ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL); } -static void +static void _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp) { Ecore_Event_Mouse_Button *ev; @@ -1344,7 +1344,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int //Check Double Clicked if (((int)(timestamp - down_info->last_time) <= (int)(1000 * _ecore_wl_double_click_time)) && - ((win) && + ((win) && (win->id == down_info->last_win) && (win->id == down_info->last_event_win))) { @@ -1360,7 +1360,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int //Check Triple Clicked if (((int)(timestamp - down_info->last_last_time) <= (int)(2 * 1000 * _ecore_wl_double_click_time)) && - ((win) && + ((win) && (win->id == down_info->last_win) && (win->id == down_info->last_last_win) && (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 } } -static void +static void _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp) { 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 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL); } -static void +static void _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp) { 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 @@ #include "ecore_wl_private.h" -static void +static void _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) { Ecore_Wl_Output *output; @@ -19,7 +19,7 @@ _ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output EINA_UNUSED output->transform = transform; } -static void +static void _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) { Ecore_Wl_Output *output; @@ -38,20 +38,20 @@ _ecore_wl_output_cb_mode(void *data, struct wl_output *wl_output EINA_UNUSED, un } } -static void +static void _ecore_wl_output_cb_done(void *data EINA_UNUSED, struct wl_output *output EINA_UNUSED) { } -static void +static void _ecore_wl_output_cb_scale(void *data EINA_UNUSED, struct wl_output *output EINA_UNUSED, int scale EINA_UNUSED) { } /* wayland listeners */ -static const struct wl_output_listener _ecore_wl_output_listener = +static const struct wl_output_listener _ecore_wl_output_listener = { _ecore_wl_output_cb_geometry, _ecore_wl_output_cb_mode, @@ -66,7 +66,7 @@ ecore_wl_outputs_get(void) return _ecore_wl_disp->outputs; } -void +void _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id) { Ecore_Wl_Output *output; @@ -79,20 +79,20 @@ _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id) output->display = ewd; - output->output = + output->output = wl_registry_bind(ewd->wl.registry, id, &wl_output_interface, 2); ewd->outputs = eina_inlist_append(ewd->outputs, EINA_INLIST_GET(output)); wl_output_add_listener(output->output, &_ecore_wl_output_listener, output); } -void -_ecore_wl_output_del(Ecore_Wl_Output *output) +void +_ecore_wl_output_del(Ecore_Wl_Output *output) { if (!output) return; if (output->destroy) (*output->destroy)(output, output->data); if (output->output) wl_output_destroy(output->output); - _ecore_wl_disp->outputs = + _ecore_wl_disp->outputs = eina_inlist_remove(_ecore_wl_disp->outputs, EINA_INLIST_GET(output)); free(output); } 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 static Eina_Hash *_windows = NULL; /* wayland listeners */ -static const struct wl_surface_listener _ecore_wl_surface_listener = +static const struct wl_surface_listener _ecore_wl_surface_listener = { _ecore_wl_window_cb_surface_enter, _ecore_wl_window_cb_surface_leave }; -static const struct wl_shell_surface_listener _ecore_wl_shell_surface_listener = +static const struct wl_shell_surface_listener _ecore_wl_shell_surface_listener = { _ecore_wl_window_cb_ping, _ecore_wl_window_cb_configure, _ecore_wl_window_cb_popup_done }; -static const struct xdg_surface_listener _ecore_xdg_surface_listener = +static const struct xdg_surface_listener _ecore_xdg_surface_listener = { _ecore_xdg_handle_surface_configure, _ecore_xdg_handle_surface_delete, }; -static const struct xdg_popup_listener _ecore_xdg_popup_listener = +static const struct xdg_popup_listener _ecore_xdg_popup_listener = { _ecore_xdg_handle_popup_done, }; /* internal functions */ -void +void _ecore_wl_window_init(void) { - if (!_windows) + if (!_windows) _windows = eina_hash_string_superfast_new(NULL); } -void +void _ecore_wl_window_shutdown(void) { 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 win->opaque.w = w; win->opaque.h = h; - win->opaque_region = + win->opaque_region = wl_compositor_create_region(_ecore_wl_compositor_get()); - win->input_region = + win->input_region = wl_compositor_create_region(_ecore_wl_compositor_get()); 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 return win; } -EAPI void +EAPI void ecore_wl_window_free(Ecore_Wl_Window *win) { Ecore_Wl_Input *input; @@ -166,7 +166,7 @@ ecore_wl_window_free(Ecore_Wl_Window *win) free(win); } -EAPI void +EAPI void ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y) { Ecore_Wl_Input *input; @@ -195,7 +195,7 @@ ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y) input->display->serial); } -EAPI void +EAPI void ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location) { Ecore_Wl_Input *input; @@ -226,7 +226,7 @@ ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location) input->display->serial, location); } -EAPI void +EAPI void ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -235,7 +235,7 @@ ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h) if (win->surface) wl_surface_damage(win->surface, x, y, w, h); } -EAPI void +EAPI void ecore_wl_window_commit(Ecore_Wl_Window *win) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -254,11 +254,11 @@ ecore_wl_window_commit(Ecore_Wl_Window *win) wl_surface_set_input_region(win->surface, win->input_region); } - if ((win->surface) && (win->has_buffer)) + if ((win->surface) && (win->has_buffer)) wl_surface_commit(win->surface); } -EAPI void +EAPI void ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, int x, int y) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -277,7 +277,7 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in /* if (buffer) */ wl_surface_attach(win->surface, buffer, x, y); - wl_surface_damage(win->surface, 0, 0, + wl_surface_damage(win->surface, 0, 0, win->allocation.w, win->allocation.h); ecore_wl_window_commit(win); } @@ -300,7 +300,7 @@ ecore_wl_window_surface_create(Ecore_Wl_Window *win) return win->surface; } -EAPI void +EAPI void ecore_wl_window_show(Ecore_Wl_Window *win) { #ifdef USE_IVI_SHELL @@ -331,7 +331,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win) win->ivi_surface_id, win->surface); } - if (!win->ivi_surface) + if (!win->ivi_surface) { #endif if ((!win->xdg_surface) && (_ecore_wl_disp->wl.xdg_shell)) @@ -350,7 +350,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win) } else if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell)) { - win->shell_surface = + win->shell_surface = wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell, win->surface); if (!win->shell_surface) return; @@ -363,7 +363,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win) } if (win->shell_surface) - wl_shell_surface_add_listener(win->shell_surface, + wl_shell_surface_add_listener(win->shell_surface, &_ecore_wl_shell_surface_listener, win); #ifdef USE_IVI_SHELL } @@ -401,9 +401,9 @@ ecore_wl_window_show(Ecore_Wl_Window *win) case ECORE_WL_WINDOW_TYPE_MENU: if (win->xdg_surface) { - win->xdg_popup = + win->xdg_popup = xdg_shell_get_xdg_popup(_ecore_wl_disp->wl.xdg_shell, - win->surface, + win->surface, win->parent->surface, _ecore_wl_disp->input->seat, _ecore_wl_disp->serial, @@ -411,7 +411,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win) win->allocation.y, 0); if (!win->xdg_popup) return; xdg_popup_set_user_data(win->xdg_popup, win); - xdg_popup_add_listener(win->xdg_popup, + xdg_popup_add_listener(win->xdg_popup, &_ecore_xdg_popup_listener, win); } else if (win->shell_surface) @@ -432,7 +432,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win) } } -EAPI void +EAPI void ecore_wl_window_hide(Ecore_Wl_Window *win) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -452,18 +452,18 @@ ecore_wl_window_hide(Ecore_Wl_Window *win) win->surface = NULL; } -EAPI void +EAPI void ecore_wl_window_raise(Ecore_Wl_Window *win) { LOGFN(__FILE__, __LINE__, __FUNCTION__); if (!win) return; /* FIXME: This should raise the xdg surface also */ - if (win->shell_surface) + if (win->shell_surface) wl_shell_surface_set_toplevel(win->shell_surface); } -EAPI void +EAPI void ecore_wl_window_maximized_set(Ecore_Wl_Window *win, Eina_Bool maximized) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -515,7 +515,7 @@ ecore_wl_window_maximized_get(Ecore_Wl_Window *win) return EINA_FALSE; } -EAPI void +EAPI void ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -526,17 +526,17 @@ ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen) { win->type = ECORE_WL_WINDOW_TYPE_FULLSCREEN; - if (win->xdg_surface) + if (win->xdg_surface) xdg_surface_set_fullscreen(win->xdg_surface, NULL); if (win->shell_surface) - wl_shell_surface_set_fullscreen(win->shell_surface, + wl_shell_surface_set_fullscreen(win->shell_surface, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, NULL); } - else + else { - if (win->xdg_surface) + if (win->xdg_surface) xdg_surface_unset_fullscreen(win->xdg_surface); else if (win->shell_surface) wl_shell_surface_set_toplevel(win->shell_surface); @@ -556,7 +556,7 @@ ecore_wl_window_fullscreen_get(Ecore_Wl_Window *win) return win->fullscreen || (win->type == ECORE_WL_WINDOW_TYPE_FULLSCREEN); } -EAPI void +EAPI void ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -564,7 +564,7 @@ ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent) if (!win) return; win->transparent = transparent; if (!win->transparent) - ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, + ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, win->opaque.w, win->opaque.h); else 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) if (!win) return; win->alpha = alpha; if (!win->alpha) - ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, + ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y, win->opaque.w, win->opaque.h); else 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) return win->transparent; } -EAPI void +EAPI void ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -618,12 +618,12 @@ ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h) win->saved.h = h; } if (win->xdg_surface) - xdg_surface_set_window_geometry(win->xdg_surface, - win->allocation.x, win->allocation.y, + xdg_surface_set_window_geometry(win->xdg_surface, + win->allocation.x, win->allocation.y, win->allocation.w, win->allocation.h); } -EAPI void +EAPI void ecore_wl_window_update_location(Ecore_Wl_Window *win, int x, int y) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -632,8 +632,8 @@ ecore_wl_window_update_location(Ecore_Wl_Window *win, int x, int y) win->allocation.x = x; win->allocation.y = y; if (win->xdg_surface) - xdg_surface_set_window_geometry(win->xdg_surface, - win->allocation.x, win->allocation.y, + xdg_surface_set_window_geometry(win->xdg_surface, + win->allocation.x, win->allocation.y, win->allocation.w, win->allocation.h); } @@ -676,7 +676,7 @@ ecore_wl_window_find(unsigned int id) return win; } -EAPI void +EAPI void ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -685,7 +685,7 @@ ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type) win->type = type; } -EAPI void +EAPI void ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_surface *surface, int hot_x, int hot_y) { Ecore_Wl_Input *input; @@ -739,7 +739,7 @@ ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win) } /* @since 1.2 */ -EAPI void +EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -748,7 +748,7 @@ ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent) } /* @since 1.12 */ -EAPI void +EAPI void ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified) { struct wl_array states; @@ -790,7 +790,7 @@ ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified) } } -EAPI Eina_Bool +EAPI Eina_Bool ecore_wl_window_iconified_get(Ecore_Wl_Window *win) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -822,7 +822,7 @@ ecore_wl_window_surface_find(struct wl_surface *surface) } /* @since 1.8 */ -EAPI void +EAPI void ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w, int h) { 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 } /* @since 1.8 */ -EAPI void +EAPI void ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w, int h) { 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 } /* @since 1.8 */ -EAPI void +EAPI void ecore_wl_window_rotation_set(Ecore_Wl_Window *win, int rotation) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -906,7 +906,7 @@ ecore_wl_window_rotation_set(Ecore_Wl_Window *win, int rotation) } /* @since 1.8 */ -EAPI int +EAPI int ecore_wl_window_rotation_get(Ecore_Wl_Window *win) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -978,14 +978,14 @@ ecore_wl_window_keyboard_get(Ecore_Wl_Window *win) /* local functions */ -static void +static void _ecore_wl_window_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface, unsigned int serial) { if (!shell_surface) return; wl_shell_surface_pong(shell_surface, serial); } -static void +static void _ecore_wl_window_cb_configure(void *data, struct wl_shell_surface *shell_surface EINA_UNUSED, unsigned int edges, int w, int h) { Ecore_Wl_Window *win; @@ -1044,7 +1044,7 @@ _ecore_xdg_handle_surface_configure(void *data, struct xdg_surface *xdg_surface xdg_surface_ack_configure(win->xdg_surface, serial); } -static void +static void _ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface EINA_UNUSED) { Ecore_Wl_Window *win; @@ -1055,7 +1055,7 @@ _ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface EIN ecore_wl_window_free(win); } -static void +static void _ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface *shell_surface) { Ecore_Wl_Window *win; @@ -1079,7 +1079,7 @@ _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup, unsigned i ecore_wl_input_ungrab(win->pointer_device); } -static void +static void _ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED) { Ecore_Wl_Window *win; @@ -1090,7 +1090,7 @@ _ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct if (!(win = data)) return; } -static void +static void _ecore_wl_window_cb_surface_leave(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED) { Ecore_Wl_Window *win; @@ -1101,7 +1101,7 @@ _ecore_wl_window_cb_surface_leave(void *data, struct wl_surface *surface, struct if (!(win = data)) return; } -static void +static void _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, int edges) { 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 @@ -/* +/* * Copyright (C) 2013 DENSO CORPORATION * Copyright (c) 2013 BMW Car IT GmbH - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -45,10 +45,10 @@ extern const struct wl_interface ivi_application_interface; #define IVI_SURFACE_WARNING_CODE_ENUM /** * ivi_surface_warning_code - possible warning codes returned by ivi - * compositor + * compositor * @IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE: wl_surface is invalid * @IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE: ivi_id is in use and can not - * be shared + * be shared * * These define all possible warning codes returned by ivi compositor on * server-side warnings. invalid_wl_surface: - wl_surface already has a @@ -57,8 +57,8 @@ extern const struct wl_interface ivi_application_interface; * application. */ enum ivi_surface_warning_code { - IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE = 1, - IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE = 2, + IVI_SURFACE_WARNING_CODE_INVALID_WL_SURFACE = 1, + IVI_SURFACE_WARNING_CODE_IVI_ID_IN_USE = 2, }; #endif /* IVI_SURFACE_WARNING_CODE_ENUM */ @@ -67,106 +67,106 @@ enum ivi_surface_warning_code { * @visibility: visibility of surface in ivi compositor has changed * @warning: server-side warning detected * - * + * */ struct ivi_surface_listener { - /** - * visibility - visibility of surface in ivi compositor has - * changed - * @visibility: (none) - * - * The new visibility state is provided in argument visibility. - * If visibility is 0, the surface has become invisible. If - * visibility is not 0, the surface has become visible. - */ - void (*visibility)(void *data, - struct ivi_surface *ivi_surface, - int32_t visibility); - /** - * warning - server-side warning detected - * @warning_code: (none) - * @warning_text: (none) - * - * The ivi compositor encountered warning while processing a - * request by this application. The warning is defined by argument - * warning_code and optional warning_text. If the warning is - * detected, client shall destroy the ivi_surface object. - * - * When a warning event is sent, the compositor turns the - * ivi_surface object inert. The ivi_surface will not deliver - * further events, all requests on it are ignored except 'destroy', - * and the association to the ivi_id is removed. The client should - * destroy the ivi_surface object. If an inert ivi_surface object - * is used as an argument to any other object's request, that - * request will [produce a fatal error / produce a warning / be - * ignored]. - */ - void (*warning)(void *data, - struct ivi_surface *ivi_surface, - int32_t warning_code, - const char *warning_text); + /** + * visibility - visibility of surface in ivi compositor has + * changed + * @visibility: (none) + * + * The new visibility state is provided in argument visibility. + * If visibility is 0, the surface has become invisible. If + * visibility is not 0, the surface has become visible. + */ + void (*visibility)(void *data, + struct ivi_surface *ivi_surface, + int32_t visibility); + /** + * warning - server-side warning detected + * @warning_code: (none) + * @warning_text: (none) + * + * The ivi compositor encountered warning while processing a + * request by this application. The warning is defined by argument + * warning_code and optional warning_text. If the warning is + * detected, client shall destroy the ivi_surface object. + * + * When a warning event is sent, the compositor turns the + * ivi_surface object inert. The ivi_surface will not deliver + * further events, all requests on it are ignored except 'destroy', + * and the association to the ivi_id is removed. The client should + * destroy the ivi_surface object. If an inert ivi_surface object + * is used as an argument to any other object's request, that + * request will [produce a fatal error / produce a warning / be + * ignored]. + */ + void (*warning)(void *data, + struct ivi_surface *ivi_surface, + int32_t warning_code, + const char *warning_text); }; static inline int ivi_surface_add_listener(struct ivi_surface *ivi_surface, - const struct ivi_surface_listener *listener, void *data) + const struct ivi_surface_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) ivi_surface, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *) ivi_surface, + (void (**)(void)) listener, data); } -#define IVI_SURFACE_DESTROY 0 +#define IVI_SURFACE_DESTROY 0 static inline void ivi_surface_set_user_data(struct ivi_surface *ivi_surface, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) ivi_surface, user_data); + wl_proxy_set_user_data((struct wl_proxy *) ivi_surface, user_data); } static inline void * ivi_surface_get_user_data(struct ivi_surface *ivi_surface) { - return wl_proxy_get_user_data((struct wl_proxy *) ivi_surface); + return wl_proxy_get_user_data((struct wl_proxy *) ivi_surface); } static inline void ivi_surface_destroy(struct ivi_surface *ivi_surface) { - wl_proxy_marshal((struct wl_proxy *) ivi_surface, - IVI_SURFACE_DESTROY); + wl_proxy_marshal((struct wl_proxy *) ivi_surface, + IVI_SURFACE_DESTROY); - wl_proxy_destroy((struct wl_proxy *) ivi_surface); + wl_proxy_destroy((struct wl_proxy *) ivi_surface); } -#define IVI_APPLICATION_SURFACE_CREATE 0 +#define IVI_APPLICATION_SURFACE_CREATE 0 static inline void ivi_application_set_user_data(struct ivi_application *ivi_application, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) ivi_application, user_data); + wl_proxy_set_user_data((struct wl_proxy *) ivi_application, user_data); } static inline void * ivi_application_get_user_data(struct ivi_application *ivi_application) { - return wl_proxy_get_user_data((struct wl_proxy *) ivi_application); + return wl_proxy_get_user_data((struct wl_proxy *) ivi_application); } static inline void ivi_application_destroy(struct ivi_application *ivi_application) { - wl_proxy_destroy((struct wl_proxy *) ivi_application); + wl_proxy_destroy((struct wl_proxy *) ivi_application); } static inline struct ivi_surface * ivi_application_surface_create(struct ivi_application *ivi_application, uint32_t ivi_id, struct wl_surface *surface) { - struct wl_proxy *id; + struct wl_proxy *id; - id = wl_proxy_marshal_constructor((struct wl_proxy *) ivi_application, - IVI_APPLICATION_SURFACE_CREATE, &ivi_surface_interface, ivi_id, surface, NULL); + id = wl_proxy_marshal_constructor((struct wl_proxy *) ivi_application, + IVI_APPLICATION_SURFACE_CREATE, &ivi_surface_interface, ivi_id, surface, NULL); - return (struct ivi_surface *) id; + return (struct ivi_surface *) id; } #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 @@ -/* +/* * Copyright (C) 2013 DENSO CORPORATION * Copyright (c) 2013 BMW Car IT GmbH - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -29,35 +29,34 @@ extern const struct wl_interface ivi_surface_interface; extern const struct wl_interface wl_surface_interface; static const struct wl_interface *types[] = { - NULL, - NULL, - NULL, - &wl_surface_interface, - &ivi_surface_interface, + NULL, + NULL, + NULL, + &wl_surface_interface, + &ivi_surface_interface, }; static const struct wl_message ivi_surface_requests[] = { - { "destroy", "", types + 0 }, + { "destroy", "", types + 0 }, }; static const struct wl_message ivi_surface_events[] = { - { "visibility", "i", types + 0 }, - { "warning", "i?s", types + 0 }, + { "visibility", "i", types + 0 }, + { "warning", "i?s", types + 0 }, }; WL_EXPORT const struct wl_interface ivi_surface_interface = { - "ivi_surface", 1, - 1, ivi_surface_requests, - 2, ivi_surface_events, + "ivi_surface", 1, + 1, ivi_surface_requests, + 2, ivi_surface_events, }; static const struct wl_message ivi_application_requests[] = { - { "surface_create", "uon", types + 2 }, + { "surface_create", "uon", types + 2 }, }; WL_EXPORT const struct wl_interface ivi_application_interface = { - "ivi_application", 1, - 1, ivi_application_requests, - 0, NULL, + "ivi_application", 1, + 1, ivi_application_requests, + 0, NULL, }; - 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 @@ -/* +/* * Copyright © 2012-2013 Collabora, Ltd. - * + * * Permission to use, copy, modify, distribute, and sell this * software and its documentation for any purpose is hereby granted * without fee, provided that the above copyright notice appear in @@ -12,7 +12,7 @@ * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY @@ -46,118 +46,118 @@ extern const struct wl_interface wl_subsurface_interface; #ifndef WL_SUBCOMPOSITOR_ERROR_ENUM #define WL_SUBCOMPOSITOR_ERROR_ENUM enum wl_subcompositor_error { - WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0, + WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0, }; #endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */ -#define WL_SUBCOMPOSITOR_DESTROY 0 -#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1 +#define WL_SUBCOMPOSITOR_DESTROY 0 +#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1 static inline void wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data); + wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data); } static inline void * wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor) { - return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor); + return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor); } static inline void wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor) { - wl_proxy_marshal((struct wl_proxy *) wl_subcompositor, - WL_SUBCOMPOSITOR_DESTROY); + wl_proxy_marshal((struct wl_proxy *) wl_subcompositor, + WL_SUBCOMPOSITOR_DESTROY); - wl_proxy_destroy((struct wl_proxy *) wl_subcompositor); + wl_proxy_destroy((struct wl_proxy *) wl_subcompositor); } static inline struct wl_subsurface * wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent) { - struct wl_proxy *id; + struct wl_proxy *id; - id = wl_proxy_create((struct wl_proxy *) wl_subcompositor, - &wl_subsurface_interface); - if (!id) - return NULL; + id = wl_proxy_create((struct wl_proxy *) wl_subcompositor, + &wl_subsurface_interface); + if (!id) + return NULL; - wl_proxy_marshal((struct wl_proxy *) wl_subcompositor, - WL_SUBCOMPOSITOR_GET_SUBSURFACE, id, surface, parent); + wl_proxy_marshal((struct wl_proxy *) wl_subcompositor, + WL_SUBCOMPOSITOR_GET_SUBSURFACE, id, surface, parent); - return (struct wl_subsurface *) id; + return (struct wl_subsurface *) id; } #ifndef WL_SUBSURFACE_ERROR_ENUM #define WL_SUBSURFACE_ERROR_ENUM enum wl_subsurface_error { - WL_SUBSURFACE_ERROR_BAD_SURFACE = 0, + WL_SUBSURFACE_ERROR_BAD_SURFACE = 0, }; #endif /* WL_SUBSURFACE_ERROR_ENUM */ -#define WL_SUBSURFACE_DESTROY 0 -#define WL_SUBSURFACE_SET_POSITION 1 -#define WL_SUBSURFACE_PLACE_ABOVE 2 -#define WL_SUBSURFACE_PLACE_BELOW 3 -#define WL_SUBSURFACE_SET_SYNC 4 -#define WL_SUBSURFACE_SET_DESYNC 5 +#define WL_SUBSURFACE_DESTROY 0 +#define WL_SUBSURFACE_SET_POSITION 1 +#define WL_SUBSURFACE_PLACE_ABOVE 2 +#define WL_SUBSURFACE_PLACE_BELOW 3 +#define WL_SUBSURFACE_SET_SYNC 4 +#define WL_SUBSURFACE_SET_DESYNC 5 static inline void wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data); + wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data); } static inline void * wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface) { - return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface); + return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface); } static inline void wl_subsurface_destroy(struct wl_subsurface *wl_subsurface) { - wl_proxy_marshal((struct wl_proxy *) wl_subsurface, - WL_SUBSURFACE_DESTROY); + wl_proxy_marshal((struct wl_proxy *) wl_subsurface, + WL_SUBSURFACE_DESTROY); - wl_proxy_destroy((struct wl_proxy *) wl_subsurface); + wl_proxy_destroy((struct wl_proxy *) wl_subsurface); } static inline void wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y) { - wl_proxy_marshal((struct wl_proxy *) wl_subsurface, - WL_SUBSURFACE_SET_POSITION, x, y); + wl_proxy_marshal((struct wl_proxy *) wl_subsurface, + WL_SUBSURFACE_SET_POSITION, x, y); } static inline void wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling) { - wl_proxy_marshal((struct wl_proxy *) wl_subsurface, - WL_SUBSURFACE_PLACE_ABOVE, sibling); + wl_proxy_marshal((struct wl_proxy *) wl_subsurface, + WL_SUBSURFACE_PLACE_ABOVE, sibling); } static inline void wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling) { - wl_proxy_marshal((struct wl_proxy *) wl_subsurface, - WL_SUBSURFACE_PLACE_BELOW, sibling); + wl_proxy_marshal((struct wl_proxy *) wl_subsurface, + WL_SUBSURFACE_PLACE_BELOW, sibling); } static inline void wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface) { - wl_proxy_marshal((struct wl_proxy *) wl_subsurface, - WL_SUBSURFACE_SET_SYNC); + wl_proxy_marshal((struct wl_proxy *) wl_subsurface, + WL_SUBSURFACE_SET_SYNC); } static inline void wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface) { - wl_proxy_marshal((struct wl_proxy *) wl_subsurface, - WL_SUBSURFACE_SET_DESYNC); + wl_proxy_marshal((struct wl_proxy *) wl_subsurface, + WL_SUBSURFACE_SET_DESYNC); } #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 @@ -/* +/* * Copyright © 2012-2013 Collabora, Ltd. - * + * * Permission to use, copy, modify, distribute, and sell this * software and its documentation for any purpose is hereby granted * without fee, provided that the above copyright notice appear in @@ -12,7 +12,7 @@ * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY @@ -34,38 +34,37 @@ extern const struct wl_interface wl_surface_interface; extern const struct wl_interface wl_surface_interface; static const struct wl_interface *types[] = { - NULL, - NULL, - &wl_subsurface_interface, - &wl_surface_interface, - &wl_surface_interface, - &wl_surface_interface, - &wl_surface_interface, + NULL, + NULL, + &wl_subsurface_interface, + &wl_surface_interface, + &wl_surface_interface, + &wl_surface_interface, + &wl_surface_interface, }; static const struct wl_message wl_subcompositor_requests[] = { - { "destroy", "", types + 0 }, - { "get_subsurface", "noo", types + 2 }, + { "destroy", "", types + 0 }, + { "get_subsurface", "noo", types + 2 }, }; WL_EXPORT const struct wl_interface wl_subcompositor_interface = { - "wl_subcompositor", 1, - 2, wl_subcompositor_requests, - 0, NULL, + "wl_subcompositor", 1, + 2, wl_subcompositor_requests, + 0, NULL, }; static const struct wl_message wl_subsurface_requests[] = { - { "destroy", "", types + 0 }, - { "set_position", "ii", types + 0 }, - { "place_above", "o", types + 5 }, - { "place_below", "o", types + 6 }, - { "set_sync", "", types + 0 }, - { "set_desync", "", types + 0 }, + { "destroy", "", types + 0 }, + { "set_position", "ii", types + 0 }, + { "place_above", "o", types + 5 }, + { "place_below", "o", types + 6 }, + { "set_sync", "", types + 0 }, + { "set_desync", "", types + 0 }, }; WL_EXPORT const struct wl_interface wl_subsurface_interface = { - "wl_subsurface", 1, - 6, wl_subsurface_requests, - 0, NULL, + "wl_subsurface", 1, + 6, wl_subsurface_requests, + 0, NULL, }; - 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 @@ -/* +/* * Copyright © 2008-2013 Kristian Høgsberg * Copyright © 2013 Rafael Antognolli * Copyright © 2013 Jasper St. Pierre * Copyright © 2010-2013 Intel Corporation - * + * * Permission to use, copy, modify, distribute, and sell this * software and its documentation for any purpose is hereby granted * without fee, provided that the above copyright notice appear in @@ -15,7 +15,7 @@ * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY @@ -59,7 +59,7 @@ extern const struct wl_interface xdg_popup_interface; * static_assert to ensure the protocol and implementation versions match. */ enum xdg_shell_version { - XDG_SHELL_VERSION_CURRENT = 4, + XDG_SHELL_VERSION_CURRENT = 4, }; #endif /* XDG_SHELL_VERSION_ENUM */ @@ -73,89 +73,89 @@ enum xdg_shell_version { * It allows clients to associate a xdg_surface with a basic surface. */ struct xdg_shell_listener { - /** - * ping - check if the client is alive - * @serial: pass this to the callback - * - * The ping event asks the client if it's still alive. Pass the - * serial specified in the event back to the compositor by sending - * a "pong" request back with the specified serial. - * - * Compositors can use this to determine if the client is still - * alive. It's unspecified what will happen if the client doesn't - * respond to the ping request, or in what timeframe. Clients - * should try to respond in a reasonable amount of time. - */ - void (*ping)(void *data, - struct xdg_shell *xdg_shell, - uint32_t serial); + /** + * ping - check if the client is alive + * @serial: pass this to the callback + * + * The ping event asks the client if it's still alive. Pass the + * serial specified in the event back to the compositor by sending + * a "pong" request back with the specified serial. + * + * Compositors can use this to determine if the client is still + * alive. It's unspecified what will happen if the client doesn't + * respond to the ping request, or in what timeframe. Clients + * should try to respond in a reasonable amount of time. + */ + void (*ping)(void *data, + struct xdg_shell *xdg_shell, + uint32_t serial); }; static inline int xdg_shell_add_listener(struct xdg_shell *xdg_shell, - const struct xdg_shell_listener *listener, void *data) + const struct xdg_shell_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) xdg_shell, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *) xdg_shell, + (void (**)(void)) listener, data); } -#define XDG_SHELL_USE_UNSTABLE_VERSION 0 -#define XDG_SHELL_GET_XDG_SURFACE 1 -#define XDG_SHELL_GET_XDG_POPUP 2 -#define XDG_SHELL_PONG 3 +#define XDG_SHELL_USE_UNSTABLE_VERSION 0 +#define XDG_SHELL_GET_XDG_SURFACE 1 +#define XDG_SHELL_GET_XDG_POPUP 2 +#define XDG_SHELL_PONG 3 static inline void xdg_shell_set_user_data(struct xdg_shell *xdg_shell, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) xdg_shell, user_data); + wl_proxy_set_user_data((struct wl_proxy *) xdg_shell, user_data); } static inline void * xdg_shell_get_user_data(struct xdg_shell *xdg_shell) { - return wl_proxy_get_user_data((struct wl_proxy *) xdg_shell); + return wl_proxy_get_user_data((struct wl_proxy *) xdg_shell); } static inline void xdg_shell_destroy(struct xdg_shell *xdg_shell) { - wl_proxy_destroy((struct wl_proxy *) xdg_shell); + wl_proxy_destroy((struct wl_proxy *) xdg_shell); } static inline void xdg_shell_use_unstable_version(struct xdg_shell *xdg_shell, int32_t version) { - wl_proxy_marshal((struct wl_proxy *) xdg_shell, - XDG_SHELL_USE_UNSTABLE_VERSION, version); + wl_proxy_marshal((struct wl_proxy *) xdg_shell, + XDG_SHELL_USE_UNSTABLE_VERSION, version); } static inline struct xdg_surface * xdg_shell_get_xdg_surface(struct xdg_shell *xdg_shell, struct wl_surface *surface) { - struct wl_proxy *id; + struct wl_proxy *id; - id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell, - XDG_SHELL_GET_XDG_SURFACE, &xdg_surface_interface, NULL, surface); + id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell, + XDG_SHELL_GET_XDG_SURFACE, &xdg_surface_interface, NULL, surface); - return (struct xdg_surface *) id; + return (struct xdg_surface *) id; } static inline struct xdg_popup * xdg_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) { - struct wl_proxy *id; + struct wl_proxy *id; - id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell, - XDG_SHELL_GET_XDG_POPUP, &xdg_popup_interface, NULL, surface, parent, seat, serial, x, y, flags); + id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell, + XDG_SHELL_GET_XDG_POPUP, &xdg_popup_interface, NULL, surface, parent, seat, serial, x, y, flags); - return (struct xdg_popup *) id; + return (struct xdg_popup *) id; } static inline void xdg_shell_pong(struct xdg_shell *xdg_shell, uint32_t serial) { - wl_proxy_marshal((struct wl_proxy *) xdg_shell, - XDG_SHELL_PONG, serial); + wl_proxy_marshal((struct wl_proxy *) xdg_shell, + XDG_SHELL_PONG, serial); } #ifndef XDG_SURFACE_RESIZE_EDGE_ENUM @@ -177,15 +177,15 @@ xdg_shell_pong(struct xdg_shell *xdg_shell, uint32_t serial) * adapt its behavior, e.g. choose an appropriate cursor image. */ enum xdg_surface_resize_edge { - XDG_SURFACE_RESIZE_EDGE_NONE = 0, - XDG_SURFACE_RESIZE_EDGE_TOP = 1, - XDG_SURFACE_RESIZE_EDGE_BOTTOM = 2, - XDG_SURFACE_RESIZE_EDGE_LEFT = 4, - XDG_SURFACE_RESIZE_EDGE_TOP_LEFT = 5, - XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT = 6, - XDG_SURFACE_RESIZE_EDGE_RIGHT = 8, - XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT = 9, - XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT = 10, + XDG_SURFACE_RESIZE_EDGE_NONE = 0, + XDG_SURFACE_RESIZE_EDGE_TOP = 1, + XDG_SURFACE_RESIZE_EDGE_BOTTOM = 2, + XDG_SURFACE_RESIZE_EDGE_LEFT = 4, + XDG_SURFACE_RESIZE_EDGE_TOP_LEFT = 5, + XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT = 6, + XDG_SURFACE_RESIZE_EDGE_RIGHT = 8, + XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT = 9, + XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT = 10, }; #endif /* XDG_SURFACE_RESIZE_EDGE_ENUM */ @@ -218,10 +218,10 @@ enum xdg_surface_resize_edge { * 0x1FFF: GNOME */ enum xdg_surface_state { - XDG_SURFACE_STATE_MAXIMIZED = 1, - XDG_SURFACE_STATE_FULLSCREEN = 2, - XDG_SURFACE_STATE_RESIZING = 3, - XDG_SURFACE_STATE_ACTIVATED = 4, + XDG_SURFACE_STATE_MAXIMIZED = 1, + XDG_SURFACE_STATE_FULLSCREEN = 2, + XDG_SURFACE_STATE_RESIZING = 3, + XDG_SURFACE_STATE_ACTIVATED = 4, }; #endif /* XDG_SURFACE_STATE_ENUM */ @@ -242,183 +242,183 @@ enum xdg_surface_state { * must be called before destroying the wl_surface object. */ struct xdg_surface_listener { - /** - * configure - suggest a surface change - * @width: (none) - * @height: (none) - * @states: (none) - * @serial: (none) - * - * The configure event asks the client to resize its surface. - * - * The width and height arguments specify a hint to the window - * about how its surface should be resized in window geometry - * coordinates. The states listed in the event specify how the - * width/height arguments should be interpreted. - * - * A client should arrange a new surface, and then send a - * ack_configure request with the serial sent in this configure - * event before attaching a new surface. - * - * If the client receives multiple configure events before it can - * respond to one, it is free to discard all but the last event it - * received. - */ - void (*configure)(void *data, - struct xdg_surface *xdg_surface, - int32_t width, - int32_t height, - struct wl_array *states, - uint32_t serial); - /** - * close - surface wants to be closed - * - * The close event is sent by the compositor when the user wants - * the surface to be closed. This should be equivalent to the user - * clicking the close button in client-side decorations, if your - * application has any... - * - * This is only a request that the user intends to close your - * window. The client may choose to ignore this request, or show a - * dialog to ask the user to save their data... - */ - void (*close)(void *data, - struct xdg_surface *xdg_surface); + /** + * configure - suggest a surface change + * @width: (none) + * @height: (none) + * @states: (none) + * @serial: (none) + * + * The configure event asks the client to resize its surface. + * + * The width and height arguments specify a hint to the window + * about how its surface should be resized in window geometry + * coordinates. The states listed in the event specify how the + * width/height arguments should be interpreted. + * + * A client should arrange a new surface, and then send a + * ack_configure request with the serial sent in this configure + * event before attaching a new surface. + * + * If the client receives multiple configure events before it can + * respond to one, it is free to discard all but the last event it + * received. + */ + void (*configure)(void *data, + struct xdg_surface *xdg_surface, + int32_t width, + int32_t height, + struct wl_array *states, + uint32_t serial); + /** + * close - surface wants to be closed + * + * The close event is sent by the compositor when the user wants + * the surface to be closed. This should be equivalent to the user + * clicking the close button in client-side decorations, if your + * application has any... + * + * This is only a request that the user intends to close your + * window. The client may choose to ignore this request, or show a + * dialog to ask the user to save their data... + */ + void (*close)(void *data, + struct xdg_surface *xdg_surface); }; static inline int xdg_surface_add_listener(struct xdg_surface *xdg_surface, - const struct xdg_surface_listener *listener, void *data) + const struct xdg_surface_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) xdg_surface, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *) xdg_surface, + (void (**)(void)) listener, data); } -#define XDG_SURFACE_DESTROY 0 -#define XDG_SURFACE_SET_PARENT 1 -#define XDG_SURFACE_SET_TITLE 2 -#define XDG_SURFACE_SET_APP_ID 3 -#define XDG_SURFACE_SHOW_WINDOW_MENU 4 -#define XDG_SURFACE_MOVE 5 -#define XDG_SURFACE_RESIZE 6 -#define XDG_SURFACE_ACK_CONFIGURE 7 -#define XDG_SURFACE_SET_WINDOW_GEOMETRY 8 -#define XDG_SURFACE_SET_MAXIMIZED 9 -#define XDG_SURFACE_UNSET_MAXIMIZED 10 -#define XDG_SURFACE_SET_FULLSCREEN 11 -#define XDG_SURFACE_UNSET_FULLSCREEN 12 -#define XDG_SURFACE_SET_MINIMIZED 13 +#define XDG_SURFACE_DESTROY 0 +#define XDG_SURFACE_SET_PARENT 1 +#define XDG_SURFACE_SET_TITLE 2 +#define XDG_SURFACE_SET_APP_ID 3 +#define XDG_SURFACE_SHOW_WINDOW_MENU 4 +#define XDG_SURFACE_MOVE 5 +#define XDG_SURFACE_RESIZE 6 +#define XDG_SURFACE_ACK_CONFIGURE 7 +#define XDG_SURFACE_SET_WINDOW_GEOMETRY 8 +#define XDG_SURFACE_SET_MAXIMIZED 9 +#define XDG_SURFACE_UNSET_MAXIMIZED 10 +#define XDG_SURFACE_SET_FULLSCREEN 11 +#define XDG_SURFACE_UNSET_FULLSCREEN 12 +#define XDG_SURFACE_SET_MINIMIZED 13 static inline void xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data); + wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data); } static inline void * xdg_surface_get_user_data(struct xdg_surface *xdg_surface) { - return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface); + return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface); } static inline void xdg_surface_destroy(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_DESTROY); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_DESTROY); - wl_proxy_destroy((struct wl_proxy *) xdg_surface); + wl_proxy_destroy((struct wl_proxy *) xdg_surface); } static inline void xdg_surface_set_parent(struct xdg_surface *xdg_surface, struct wl_surface *parent) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_SET_PARENT, parent); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_SET_PARENT, parent); } static inline void xdg_surface_set_title(struct xdg_surface *xdg_surface, const char *title) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_SET_TITLE, title); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_SET_TITLE, title); } static inline void xdg_surface_set_app_id(struct xdg_surface *xdg_surface, const char *app_id) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_SET_APP_ID, app_id); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_SET_APP_ID, app_id); } static inline void xdg_surface_show_window_menu(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_SHOW_WINDOW_MENU, seat, serial, x, y); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_SHOW_WINDOW_MENU, seat, serial, x, y); } static inline void xdg_surface_move(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_MOVE, seat, serial); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_MOVE, seat, serial); } static inline void xdg_surface_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_RESIZE, seat, serial, edges); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_RESIZE, seat, serial, edges); } static inline void xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_ACK_CONFIGURE, serial); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_ACK_CONFIGURE, serial); } static inline void xdg_surface_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_SET_WINDOW_GEOMETRY, x, y, width, height); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_SET_WINDOW_GEOMETRY, x, y, width, height); } static inline void xdg_surface_set_maximized(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_SET_MAXIMIZED); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_SET_MAXIMIZED); } static inline void xdg_surface_unset_maximized(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_UNSET_MAXIMIZED); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_UNSET_MAXIMIZED); } static inline void xdg_surface_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_SET_FULLSCREEN, output); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_SET_FULLSCREEN, output); } static inline void xdg_surface_unset_fullscreen(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_UNSET_FULLSCREEN); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_UNSET_FULLSCREEN); } static inline void xdg_surface_set_minimized(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - XDG_SURFACE_SET_MINIMIZED); + wl_proxy_marshal((struct wl_proxy *) xdg_surface, + XDG_SURFACE_SET_MINIMIZED); } /** @@ -445,48 +445,48 @@ xdg_surface_set_minimized(struct xdg_surface *xdg_surface) * xdg_popup surfaces are always transient for another surface. */ struct xdg_popup_listener { - /** - * popup_done - popup interaction is done - * @serial: serial of the implicit grab on the pointer - * - * The popup_done event is sent out when a popup grab is broken, - * that is, when the users clicks a surface that doesn't belong to - * the client owning the popup surface. - */ - void (*popup_done)(void *data, - struct xdg_popup *xdg_popup, - uint32_t serial); + /** + * popup_done - popup interaction is done + * @serial: serial of the implicit grab on the pointer + * + * The popup_done event is sent out when a popup grab is broken, + * that is, when the users clicks a surface that doesn't belong to + * the client owning the popup surface. + */ + void (*popup_done)(void *data, + struct xdg_popup *xdg_popup, + uint32_t serial); }; static inline int xdg_popup_add_listener(struct xdg_popup *xdg_popup, - const struct xdg_popup_listener *listener, void *data) + const struct xdg_popup_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) xdg_popup, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *) xdg_popup, + (void (**)(void)) listener, data); } -#define XDG_POPUP_DESTROY 0 +#define XDG_POPUP_DESTROY 0 static inline void xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data); + wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data); } static inline void * xdg_popup_get_user_data(struct xdg_popup *xdg_popup) { - return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup); + return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup); } static inline void xdg_popup_destroy(struct xdg_popup *xdg_popup) { - wl_proxy_marshal((struct wl_proxy *) xdg_popup, - XDG_POPUP_DESTROY); + wl_proxy_marshal((struct wl_proxy *) xdg_popup, + XDG_POPUP_DESTROY); - wl_proxy_destroy((struct wl_proxy *) xdg_popup); + wl_proxy_destroy((struct wl_proxy *) xdg_popup); } #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 @@ -/* +/* * Copyright © 2008-2013 Kristian Høgsberg * Copyright © 2013 Rafael Antognolli * Copyright © 2013 Jasper St. Pierre * Copyright © 2010-2013 Intel Corporation - * + * * Permission to use, copy, modify, distribute, and sell this * software and its documentation for any purpose is hereby granted * without fee, provided that the above copyright notice appear in @@ -15,7 +15,7 @@ * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY @@ -37,89 +37,88 @@ extern const struct wl_interface xdg_popup_interface; extern const struct wl_interface xdg_surface_interface; static const struct wl_interface *types[] = { - NULL, - NULL, - NULL, - NULL, - &xdg_surface_interface, - &wl_surface_interface, - &xdg_popup_interface, - &wl_surface_interface, - &wl_surface_interface, - &wl_seat_interface, - NULL, - NULL, - NULL, - NULL, - &wl_surface_interface, - &wl_seat_interface, - NULL, - NULL, - NULL, - &wl_seat_interface, - NULL, - &wl_seat_interface, - NULL, - NULL, - &wl_output_interface, + NULL, + NULL, + NULL, + NULL, + &xdg_surface_interface, + &wl_surface_interface, + &xdg_popup_interface, + &wl_surface_interface, + &wl_surface_interface, + &wl_seat_interface, + NULL, + NULL, + NULL, + NULL, + &wl_surface_interface, + &wl_seat_interface, + NULL, + NULL, + NULL, + &wl_seat_interface, + NULL, + &wl_seat_interface, + NULL, + NULL, + &wl_output_interface, }; static const struct wl_message xdg_shell_requests[] = { - { "use_unstable_version", "i", types + 0 }, - { "get_xdg_surface", "no", types + 4 }, - { "get_xdg_popup", "nooouiiu", types + 6 }, - { "pong", "u", types + 0 }, + { "use_unstable_version", "i", types + 0 }, + { "get_xdg_surface", "no", types + 4 }, + { "get_xdg_popup", "nooouiiu", types + 6 }, + { "pong", "u", types + 0 }, }; static const struct wl_message xdg_shell_events[] = { - { "ping", "u", types + 0 }, + { "ping", "u", types + 0 }, }; WL_EXPORT const struct wl_interface xdg_shell_interface = { - "xdg_shell", 1, - 4, xdg_shell_requests, - 1, xdg_shell_events, + "xdg_shell", 1, + 4, xdg_shell_requests, + 1, xdg_shell_events, }; static const struct wl_message xdg_surface_requests[] = { - { "destroy", "", types + 0 }, - { "set_parent", "?o", types + 14 }, - { "set_title", "s", types + 0 }, - { "set_app_id", "s", types + 0 }, - { "show_window_menu", "ouii", types + 15 }, - { "move", "ou", types + 19 }, - { "resize", "ouu", types + 21 }, - { "ack_configure", "u", types + 0 }, - { "set_window_geometry", "iiii", types + 0 }, - { "set_maximized", "", types + 0 }, - { "unset_maximized", "", types + 0 }, - { "set_fullscreen", "?o", types + 24 }, - { "unset_fullscreen", "", types + 0 }, - { "set_minimized", "", types + 0 }, + { "destroy", "", types + 0 }, + { "set_parent", "?o", types + 14 }, + { "set_title", "s", types + 0 }, + { "set_app_id", "s", types + 0 }, + { "show_window_menu", "ouii", types + 15 }, + { "move", "ou", types + 19 }, + { "resize", "ouu", types + 21 }, + { "ack_configure", "u", types + 0 }, + { "set_window_geometry", "iiii", types + 0 }, + { "set_maximized", "", types + 0 }, + { "unset_maximized", "", types + 0 }, + { "set_fullscreen", "?o", types + 24 }, + { "unset_fullscreen", "", types + 0 }, + { "set_minimized", "", types + 0 }, }; static const struct wl_message xdg_surface_events[] = { - { "configure", "iiau", types + 0 }, - { "close", "", types + 0 }, + { "configure", "iiau", types + 0 }, + { "close", "", types + 0 }, }; WL_EXPORT const struct wl_interface xdg_surface_interface = { - "xdg_surface", 1, - 14, xdg_surface_requests, - 2, xdg_surface_events, + "xdg_surface", 1, + 14, xdg_surface_requests, + 2, xdg_surface_events, }; static const struct wl_message xdg_popup_requests[] = { - { "destroy", "", types + 0 }, + { "destroy", "", types + 0 }, }; static const struct wl_message xdg_popup_events[] = { - { "popup_done", "u", types + 0 }, + { "popup_done", "u", types + 0 }, }; WL_EXPORT const struct wl_interface xdg_popup_interface = { - "xdg_popup", 1, - 1, xdg_popup_requests, - 1, xdg_popup_events, + "xdg_popup", 1, + 1, xdg_popup_requests, + 1, xdg_popup_events, }; - --