summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuna Oh <duna.oh@samsung.com>2015-05-29 12:34:33 +0900
committerDuna Oh <duna.oh@samsung.com>2015-05-29 15:25:03 +0900
commit35bff0942d5fa7121dbc8609c45f3d39985b93c1 (patch)
tree2cc0f44d139e4c9dc25d2bfb72fc9d51e2057e5c
parentf4ab26dc570e6f4b7e8fec965369fba5b67ff488 (diff)
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 <duna.oh@samsung.com>
-rw-r--r--src/lib/ecore_wayland/Ecore_Wayland.h1
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c13
-rw-r--r--src/lib/ecore_wayland/tizen-policy-client-protocol.h10
-rw-r--r--src/lib/ecore_wayland/tizen-policy-protocol.c6
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c1
5 files changed, 30 insertions, 1 deletions
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
624EAPI void ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char *cursor_name); 624EAPI void ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char *cursor_name);
625EAPI void ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win); 625EAPI void ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win);
626EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent); 626EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent);
627EAPI void ecore_wl_window_position_set(Ecore_Wl_Window *win, int x, int y);
627 628
628/** 629/**
629 * Iconify a window 630 * 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)
408 tizen_resource_add_listener(win->tz_resource, 408 tizen_resource_add_listener(win->tz_resource,
409 &_ecore_tizen_resource_listener, win); 409 &_ecore_tizen_resource_listener, win);
410 } 410 }
411 if ((win->surface) && (_ecore_wl_disp->wl.tz_policy))
412 {
413 tizen_policy_position_set(_ecore_wl_disp->wl.tz_policy, win->surface, win->allocation.x, win->allocation.y);
414 }
411 } 415 }
412 416
413 /* trap for valid shell surface */ 417 /* trap for valid shell surface */
@@ -809,6 +813,15 @@ ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent)
809 win->parent = parent; 813 win->parent = parent;
810} 814}
811 815
816EAPI void
817ecore_wl_window_position_set(Ecore_Wl_Window *win, int x, int y)
818{
819 if ((win->surface) && (_ecore_wl_disp->wl.tz_policy))
820 {
821 tizen_policy_position_set(_ecore_wl_disp->wl.tz_policy, win->surface, win->allocation.x, win->allocation.y);
822 }
823}
824
812/* @since 1.12 */ 825/* @since 1.12 */
813EAPI void 826EAPI void
814ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified) 827ecore_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;
14 14
15struct tizen_policy; 15struct tizen_policy;
16struct tizen_visibility; 16struct tizen_visibility;
17struct wl_surface;
17 18
18extern const struct wl_interface tizen_policy_interface; 19extern const struct wl_interface tizen_policy_interface;
19extern const struct wl_interface tizen_visibility_interface; 20extern const struct wl_interface tizen_visibility_interface;
21extern const struct wl_interface wl_surface_interface;
20 22
21#define TIZEN_POLICY_GET_VISIBILITY 0 23#define TIZEN_POLICY_GET_VISIBILITY 0
22#define TIZEN_POLICY_ACTIVATE 1 24#define TIZEN_POLICY_ACTIVATE 1
25#define TIZEN_POLICY_POSITION_SET 2
23 26
24static inline void 27static inline void
25tizen_policy_set_user_data(struct tizen_policy *tizen_policy, void *user_data) 28tizen_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
57 TIZEN_POLICY_ACTIVATE, surface); 60 TIZEN_POLICY_ACTIVATE, surface);
58} 61}
59 62
63static inline void
64tizen_policy_position_set(struct tizen_policy *tizen_policy, struct wl_surface *surface, int32_t x, int32_t y)
65{
66 wl_proxy_marshal((struct wl_proxy *) tizen_policy,
67 TIZEN_POLICY_POSITION_SET, surface, x, y);
68}
69
60#ifndef TIZEN_VISIBILITY_VISIBILITY_ENUM 70#ifndef TIZEN_VISIBILITY_VISIBILITY_ENUM
61#define TIZEN_VISIBILITY_VISIBILITY_ENUM 71#define TIZEN_VISIBILITY_VISIBILITY_ENUM
62enum tizen_visibility_visibility { 72enum 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[] = {
10 &tizen_visibility_interface, 10 &tizen_visibility_interface,
11 &wl_surface_interface, 11 &wl_surface_interface,
12 &wl_surface_interface, 12 &wl_surface_interface,
13 &wl_surface_interface,
14 NULL,
15 NULL,
13}; 16};
14 17
15static const struct wl_message tizen_policy_requests[] = { 18static const struct wl_message tizen_policy_requests[] = {
16 { "get_visibility", "no", types + 1 }, 19 { "get_visibility", "no", types + 1 },
17 { "activate", "o", types + 3 }, 20 { "activate", "o", types + 3 },
21 { "position_set", "oii", types + 4 },
18}; 22};
19 23
20WL_EXPORT const struct wl_interface tizen_policy_interface = { 24WL_EXPORT const struct wl_interface tizen_policy_interface = {
21 "tizen_policy", 1, 25 "tizen_policy", 1,
22 2, tizen_policy_requests, 26 3, tizen_policy_requests,
23 0, NULL, 27 0, NULL,
24}; 28};
25 29
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)
844 ecore_wl_window_update_location(wdata->win, x, y); 844 ecore_wl_window_update_location(wdata->win, x, y);
845 if (ee->func.fn_move) ee->func.fn_move(ee); 845 if (ee->func.fn_move) ee->func.fn_move(ee);
846 } 846 }
847 ecore_wl_window_position_set(wdata->win, x, y);
847} 848}
848 849
849/* Frame border: 850/* Frame border: