ecore_wl: add codes to request set_geometry_hint when setting geometry hints accordin... 77/114477/2
authorDuna Oh <duna.oh@samsung.com>
Mon, 13 Feb 2017 11:04:27 +0000 (20:04 +0900)
committerDuna Oh <duna.oh@samsung.com>
Tue, 14 Feb 2017 00:08:47 +0000 (09:08 +0900)
Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: Icba756ac6e0ebec734c686032662f8b3c6958e2a

src/lib/ecore_wayland/ecore_wl.c
src/lib/ecore_wayland/ecore_wl_window.c
src/lib/ecore_wayland/tizen-policy-ext-client-protocol.h
src/lib/ecore_wayland/tizen-policy-ext-protocol.c

index 175c09c..9b12f51 100644 (file)
@@ -1008,10 +1008,10 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
      }
    else if (!strcmp(interface, "tizen_policy_ext"))
      {
-        if (version >= 2)
-          client_version = 2;
+        if (version >= 3)
+          client_version = 3;
         else
-          client_version = 1;
+          client_version = version;
 
         ewd->wl.tz_policy_ext =
           wl_registry_bind(registry, id, &tizen_policy_ext_interface, client_version);
index 0150ec9..3b9db8d 100644 (file)
@@ -1491,6 +1491,8 @@ ecore_wl_window_rotation_geometry_set(Ecore_Wl_Window *win, int rot, int x, int
 {
    int i = 0;
    int rotation = 0;
+   enum tizen_rotation_angle angle = TIZEN_ROTATION_ANGLE_NONE;
+
    if (!win) return;
 
    if ((rot % 90 != 0) || (rot / 90 > 3) || (rot < 0)) return;
@@ -1503,6 +1505,26 @@ ecore_wl_window_rotation_geometry_set(Ecore_Wl_Window *win, int rot, int x, int
    win->rotation_geometry_hints[i].valid = EINA_TRUE;
 
    if (!win->tz_rot.resource) return;
+   switch (rot)
+     {
+        case 0:
+          angle = TIZEN_ROTATION_ANGLE_0;
+          break;
+        case 90:
+          angle = TIZEN_ROTATION_ANGLE_90;
+          break;
+        case 180:
+          angle = TIZEN_ROTATION_ANGLE_180;
+          break;
+        case 270:
+          angle = TIZEN_ROTATION_ANGLE_270;
+          break;
+        default:
+          break;
+     }
+   tizen_rotation_set_geometry_hint(win->tz_rot.resource,
+                                    (uint32_t)angle, x, y, w, h);
+
    rotation = ecore_wl_window_rotation_get(win);
    if ((rotation % 90 != 0) || (rotation / 90 > 3) || (rotation < 0)) return;
    if ((i == (rotation / 90)) &&
index 0a042bb..ee2b86d 100644 (file)
@@ -153,6 +153,7 @@ tizen_rotation_add_listener(struct tizen_rotation *tizen_rotation,
 #define TIZEN_ROTATION_SET_AVAILABLE_ANGLES    1
 #define TIZEN_ROTATION_SET_PREFERRED_ANGLE     2
 #define TIZEN_ROTATION_ACK_ANGLE_CHANGE        3
+#define TIZEN_ROTATION_SET_GEOMETRY_HINT       4
 
 #define TIZEN_ROTATION_DESTROY_SINCE_VERSION   1
 #define TIZEN_ROTATION_SET_AVAILABLE_ANGLES_SINCE_VERSION      1
@@ -207,6 +208,13 @@ tizen_rotation_ack_angle_change(struct tizen_rotation *tizen_rotation, uint32_t
                         TIZEN_ROTATION_ACK_ANGLE_CHANGE, serial);
 }
 
+static inline void
+tizen_rotation_set_geometry_hint(struct tizen_rotation *tizen_rotation, uint32_t angle, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
+{
+       wl_proxy_marshal((struct wl_proxy *) tizen_rotation,
+                        TIZEN_ROTATION_SET_GEOMETRY_HINT, angle, x, y, w, h);
+}
+
 #ifdef  __cplusplus
 }
 #endif
index 4c4506c..a8af24c 100644 (file)
@@ -10,14 +10,15 @@ static const struct wl_interface *types[] = {
        NULL,
        NULL,
        NULL,
+       NULL,
        &tizen_rotation_interface,
        &wl_surface_interface,
        &wl_surface_interface,
 };
 
 static const struct wl_message tizen_policy_ext_requests[] = {
-       { "get_rotation", "no", types + 4 },
-       { "get_active_angle", "?o", types + 6 },
+       { "get_rotation", "no", types + 5 },
+       { "get_active_angle", "?o", types + 7 },
 };
 
 static const struct wl_message tizen_policy_ext_events[] = {
@@ -25,7 +26,7 @@ static const struct wl_message tizen_policy_ext_events[] = {
 };
 
 WL_EXPORT const struct wl_interface tizen_policy_ext_interface = {
-       "tizen_policy_ext", 2,
+       "tizen_policy_ext", 3,
        2, tizen_policy_ext_requests,
        1, tizen_policy_ext_events,
 };
@@ -35,6 +36,7 @@ static const struct wl_message tizen_rotation_requests[] = {
        { "set_available_angles", "u", types + 0 },
        { "set_preferred_angle", "u", types + 0 },
        { "ack_angle_change", "u", types + 0 },
+       { "set_geometry_hint", "3uuuuu", types + 0 },
 };
 
 static const struct wl_message tizen_rotation_events[] = {
@@ -45,8 +47,8 @@ static const struct wl_message tizen_rotation_events[] = {
 };
 
 WL_EXPORT const struct wl_interface tizen_rotation_interface = {
-       "tizen_rotation", 2,
-       4, tizen_rotation_requests,
+       "tizen_rotation", 3,
+       5, tizen_rotation_requests,
        4, tizen_rotation_events,
 };