From 35bff0942d5fa7121dbc8609c45f3d39985b93c1 Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Fri, 29 May 2015 12:34:33 +0900 Subject: [PATCH] Implementation 'position_set' request for wl_surface Ecore_wl_window send 'x,y' position to E19-server Change-Id: Ie139e0c3e16994980eec78fcd9d6e4e87d2f70ea Signed-off-by: Duna Oh --- src/lib/ecore_wayland/Ecore_Wayland.h | 1 + src/lib/ecore_wayland/ecore_wl_window.c | 13 +++++++++++++ .../ecore_wayland/tizen-policy-client-protocol.h | 10 ++++++++++ src/lib/ecore_wayland/tizen-policy-protocol.c | 6 +++++- .../engines/wayland/ecore_evas_wayland_common.c | 1 + 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index 168e8776a9..c878d8ff2d 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -624,6 +624,7 @@ EAPI void ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_surface *s EAPI void ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char *cursor_name); EAPI void ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win); EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent); +EAPI void ecore_wl_window_position_set(Ecore_Wl_Window *win, int x, int y); /** * Iconify a window diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index c414223faa..51d80a6a93 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -408,6 +408,10 @@ ecore_wl_window_show(Ecore_Wl_Window *win) tizen_resource_add_listener(win->tz_resource, &_ecore_tizen_resource_listener, win); } + if ((win->surface) && (_ecore_wl_disp->wl.tz_policy)) + { + tizen_policy_position_set(_ecore_wl_disp->wl.tz_policy, win->surface, win->allocation.x, win->allocation.y); + } } /* trap for valid shell surface */ @@ -809,6 +813,15 @@ ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent) win->parent = parent; } +EAPI void +ecore_wl_window_position_set(Ecore_Wl_Window *win, int x, int y) +{ + if ((win->surface) && (_ecore_wl_disp->wl.tz_policy)) + { + tizen_policy_position_set(_ecore_wl_disp->wl.tz_policy, win->surface, win->allocation.x, win->allocation.y); + } +} + /* @since 1.12 */ EAPI void ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified) diff --git a/src/lib/ecore_wayland/tizen-policy-client-protocol.h b/src/lib/ecore_wayland/tizen-policy-client-protocol.h index 4c64911600..bf3f0d9532 100644 --- a/src/lib/ecore_wayland/tizen-policy-client-protocol.h +++ b/src/lib/ecore_wayland/tizen-policy-client-protocol.h @@ -14,12 +14,15 @@ struct wl_resource; struct tizen_policy; struct tizen_visibility; +struct wl_surface; extern const struct wl_interface tizen_policy_interface; extern const struct wl_interface tizen_visibility_interface; +extern const struct wl_interface wl_surface_interface; #define TIZEN_POLICY_GET_VISIBILITY 0 #define TIZEN_POLICY_ACTIVATE 1 +#define TIZEN_POLICY_POSITION_SET 2 static inline void tizen_policy_set_user_data(struct tizen_policy *tizen_policy, void *user_data) @@ -57,6 +60,13 @@ tizen_policy_activate(struct tizen_policy *tizen_policy, struct wl_surface *surf TIZEN_POLICY_ACTIVATE, surface); } +static inline void +tizen_policy_position_set(struct tizen_policy *tizen_policy, struct wl_surface *surface, int32_t x, int32_t y) +{ + wl_proxy_marshal((struct wl_proxy *) tizen_policy, + TIZEN_POLICY_POSITION_SET, surface, x, y); +} + #ifndef TIZEN_VISIBILITY_VISIBILITY_ENUM #define TIZEN_VISIBILITY_VISIBILITY_ENUM enum tizen_visibility_visibility { diff --git a/src/lib/ecore_wayland/tizen-policy-protocol.c b/src/lib/ecore_wayland/tizen-policy-protocol.c index 4fe408316c..884754eba3 100644 --- a/src/lib/ecore_wayland/tizen-policy-protocol.c +++ b/src/lib/ecore_wayland/tizen-policy-protocol.c @@ -10,16 +10,20 @@ static const struct wl_interface *types[] = { &tizen_visibility_interface, &wl_surface_interface, &wl_surface_interface, + &wl_surface_interface, + NULL, + NULL, }; static const struct wl_message tizen_policy_requests[] = { { "get_visibility", "no", types + 1 }, { "activate", "o", types + 3 }, + { "position_set", "oii", types + 4 }, }; WL_EXPORT const struct wl_interface tizen_policy_interface = { "tizen_policy", 1, - 2, tizen_policy_requests, + 3, tizen_policy_requests, 0, NULL, }; diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 00d4e9b1bf..99adb03778 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -844,6 +844,7 @@ _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y) ecore_wl_window_update_location(wdata->win, x, y); if (ee->func.fn_move) ee->func.fn_move(ee); } + ecore_wl_window_position_set(wdata->win, x, y); } /* Frame border: -- 2.34.1