ecore-wayland: support 'conformant' for wayland 65/42865/1 submit/tizen/20150703.125223
authorDuna Oh <duna.oh@samsung.com>
Fri, 3 Jul 2015 07:55:28 +0000 (16:55 +0900)
committerDuna Oh <duna.oh@samsung.com>
Fri, 3 Jul 2015 08:29:44 +0000 (17:29 +0900)
- added 'conformant_set/unset/get' requests to tizen-policy
- The ecore_wl_window listens 'conformant_area' event and sends 'Ecore_Wl_Event_Conformant_Change' event,
then ecore_evas calls 'fn_state_change' function

Change-Id: I7f9c965b4a859a5abece69d26ca30ebffba12199
Signed-off-by: Duna Oh <duna.oh@samsung.com>
src/lib/ecore_evas/ecore_evas_private.h
src/lib/ecore_wayland/Ecore_Wayland.h
src/lib/ecore_wayland/ecore_wl.c
src/lib/ecore_wayland/ecore_wl_private.h
src/lib/ecore_wayland/ecore_wl_window.c
src/lib/ecore_wayland/tizen-policy-client-protocol.h
src/lib/ecore_wayland/tizen-policy-protocol.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c

index dc11228..6840fa8 100644 (file)
@@ -308,6 +308,10 @@ struct _Ecore_Evas
    unsigned char profile_supported : 1;
    unsigned char in_async_render : 1;
    unsigned char can_async_render : 1;
+
+   Eina_Bool indicator_state : 1;
+   Eina_Bool keyboard_state : 1;
+   Eina_Bool clipboard_state : 1;
 };
 
 struct _Ecore_Evas_Aux_Hint
index a047ab0..16c5e27 100644 (file)
@@ -69,6 +69,7 @@ typedef struct _Ecore_Wl_Event_Data_Source_Send Ecore_Wl_Event_Data_Source_Send;
 typedef struct _Ecore_Wl_Event_Data_Source_Target  Ecore_Wl_Event_Data_Source_Target; /** @since 1.12 */
 typedef struct _Ecore_Wl_Event_Selection_Data_Ready Ecore_Wl_Event_Selection_Data_Ready; /** @since 1.7 */
 typedef struct _Ecore_Wl_Event_Interfaces_Bound Ecore_Wl_Event_Interfaces_Bound;
+typedef struct _Ecore_Wl_Event_Conformant_Change Ecore_Wl_Event_Conformant_Change;
 
 enum _Ecore_Wl_Window_Type
 {
@@ -100,9 +101,41 @@ enum _Ecore_Wl_Window_Keygrab_Mode
    ECORE_WL_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE = 4 /**< Getting the grabbed-key exclusively regardless of window's position. Being overrided the grab by the other client window  */
 };
 
+enum _Ecore_Wl_Conformant_Part_Type
+{
+   ECORE_WL_INDICATOR_PART = 0,
+   ECORE_WL_KEYBOARD_PART = 1,
+   ECORE_WL_CLIPBOARD_PART = 2
+};
+
+enum _Ecore_Wl_Virtual_Keyboard_State
+{
+   ECORE_WL_VIRTUAL_KEYBOARD_STATE_UNKNOWN = 0,
+   ECORE_WL_VIRTUAL_KEYBOARD_STATE_OFF,
+   ECORE_WL_VIRTUAL_KEYBOARD_STATE_ON,
+};
+
+enum _Ecore_Wl_Indicator_State
+{
+   ECORE_WL_INDICATOR_STATE_UNKNOWN = 0,
+   ECORE_WL_INDICATOR_STATE_OFF,
+   ECORE_WL_INDICATOR_STATE_ON
+};
+
+enum _Ecore_Wl_Clipboard_State
+{
+   ECORE_WL_CLIPBOARD_STATE_UNKNOWN = 0,
+   ECORE_WL_CLIPBOARD_STATE_OFF,
+   ECORE_WL_CLIPBOARD_STATE_ON
+};
+
 typedef enum _Ecore_Wl_Window_Type Ecore_Wl_Window_Type;
 typedef enum _Ecore_Wl_Window_Buffer_Type Ecore_Wl_Window_Buffer_Type;
 typedef enum _Ecore_Wl_Window_Keygrab_Mode Ecore_Wl_Window_Keygrab_Mode;
+typedef enum _Ecore_Wl_Conformant_Part_Type Ecore_Wl_Conformant_Part_Type;
+typedef enum _Ecore_Wl_Virtual_Keyboard_State Ecore_Wl_Virtual_Keyboard_State;
+typedef enum _Ecore_Wl_Indicator_State Ecore_Wl_Indicator_State;
+typedef enum _Ecore_Wl_Clipboard_State Ecore_Wl_Clipboard_State;
 
 /** @since 1.7.6 */
 struct _Ecore_Wl_Global
@@ -278,6 +311,13 @@ struct _Ecore_Wl_Event_Interfaces_Bound
    Eina_Bool policy : 1;
 };
 
+struct _Ecore_Wl_Event_Conformant_Change
+{
+   unsigned int win;
+   Ecore_Wl_Conformant_Part_Type part_type;
+   Eina_Bool state;
+};
+
 /**
  * @file
  * @brief Ecore functions for dealing with the Wayland window system
@@ -319,6 +359,7 @@ EAPI extern int ECORE_WL_EVENT_DATA_SOURCE_SEND; /** @since 1.7 */
 EAPI extern int ECORE_WL_EVENT_DATA_SOURCE_CANCELLED; /** @since 1.7 */
 EAPI extern int ECORE_WL_EVENT_SELECTION_DATA_READY; /** @since 1.7 */
 EAPI extern int ECORE_WL_EVENT_INTERFACES_BOUND;
+EAPI extern int ECORE_WL_EVENT_CONFORMANT_CHANGE;
 
 /**
  * @defgroup Ecore_Wl_Init_Group Wayland Library Init and Shutdown Functions
@@ -938,6 +979,24 @@ EAPI Eina_Bool ecore_wl_window_keygrab_set(Ecore_Wl_Window *win, const char *key
  * @ingroup Ecore_Wl_Window
  */
 EAPI Eina_Bool ecore_wl_window_keygrab_unset(Ecore_Wl_Window *win, const char *key, int mod, int any_mod);
+EAPI void ecore_wl_window_conformant_set(Ecore_Wl_Window *win, unsigned int is_conformant);
+EAPI Eina_Bool ecore_wl_window_conformant_get(Ecore_Wl_Window *win);
+
+EAPI void ecore_wl_window_indicator_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h);
+EAPI Eina_Bool ecore_wl_window_indicator_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h);
+EAPI void ecore_wl_window_indicator_state_set(Ecore_Wl_Window *win, Eina_Bool on);
+EAPI Ecore_Wl_Indicator_State ecore_wl_window_indicator_state_get(Ecore_Wl_Window *win);
+
+EAPI void ecore_wl_window_clipboard_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h);
+EAPI Eina_Bool ecore_wl_window_clipboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h);
+EAPI void ecore_wl_window_clipboard_state_set(Ecore_Wl_Window *win, Eina_Bool on);
+EAPI Ecore_Wl_Clipboard_State ecore_wl_window_clipboard_state_get(Ecore_Wl_Window *win);
+
+EAPI void ecore_wl_window_keyboard_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h);
+EAPI Eina_Bool ecore_wl_window_keyboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h);
+EAPI void ecore_wl_window_keyboard_state_set(Ecore_Wl_Window *win, Eina_Bool on);
+EAPI Ecore_Wl_Virtual_Keyboard_State ecore_wl_window_keyboard_state_get(Ecore_Wl_Window *win);
+
 #ifdef __cplusplus
 }
 #endif
index 15a5d87..85d75e2 100644 (file)
@@ -38,6 +38,9 @@ static void _ecore_wl_signal_exit(void);
 static void _ecore_wl_signal_exit_free(void *data EINA_UNUSED, void *event);
 static void _ecore_wl_init_callback(void *data, struct wl_callback *callback, uint32_t serial EINA_UNUSED);
 static void _ecore_wl_cb_keygrab_notify(void *data, struct wl_keyrouter *wl_keyrouter, struct wl_surface *surface, uint32_t key, uint32_t mode, uint32_t error);
+static void _ecore_wl_cb_conformant(void *data EINA_UNUSED, struct tizen_policy *tizen_policy EINA_UNUSED, struct wl_surface *surface_resource, uint32_t is_conformant);
+static void _ecore_wl_cb_conformant_area(void *data EINA_UNUSED, struct tizen_policy *tizen_policy EINA_UNUSED, struct wl_surface *surface_resource, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h);
+static void _ecore_wl_window_conformant_area_send(Ecore_Wl_Window *win, uint32_t conformant_part, uint32_t state);
 
 /* local variables */
 static int _ecore_wl_init_count = 0;
@@ -72,6 +75,11 @@ static const struct wl_keyrouter_listener _ecore_wl_keyrouter_listener =
    _ecore_wl_cb_keygrab_notify
 };
 
+static const struct tizen_policy_listener _ecore_tizen_policy_listener =
+{
+   _ecore_wl_cb_conformant,
+   _ecore_wl_cb_conformant_area,
+};
 static void 
 xdg_shell_ping(void *data EINA_UNUSED, struct xdg_shell *shell, uint32_t serial)
 {
@@ -108,6 +116,7 @@ EAPI int ECORE_WL_EVENT_DATA_SOURCE_SEND = 0;
 EAPI int ECORE_WL_EVENT_SELECTION_DATA_READY = 0;
 EAPI int ECORE_WL_EVENT_DATA_SOURCE_CANCELLED = 0;
 EAPI int ECORE_WL_EVENT_INTERFACES_BOUND = 0;
+EAPI int ECORE_WL_EVENT_CONFORMANT_CHANGE = 0;
 
 static void
 _ecore_wl_init_callback(void *data, struct wl_callback *callback, uint32_t serial EINA_UNUSED)
@@ -178,6 +187,7 @@ ecore_wl_init(const char *name)
         ECORE_WL_EVENT_SELECTION_DATA_READY = ecore_event_type_new();
         ECORE_WL_EVENT_DATA_SOURCE_CANCELLED = ecore_event_type_new();
         ECORE_WL_EVENT_INTERFACES_BOUND = ecore_event_type_new();
+        ECORE_WL_EVENT_CONFORMANT_CHANGE = ecore_event_type_new();
      }
 
    if (!(_ecore_wl_disp = malloc(sizeof(Ecore_Wl_Display))))
@@ -712,6 +722,8 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
      {
         ewd->wl.tz_policy =
           wl_registry_bind(registry, id, &tizen_policy_interface, 1);
+        if (ewd->wl.tz_policy)
+          tizen_policy_add_listener(_ecore_wl_disp->wl.tz_policy, &_ecore_tizen_policy_listener, ewd->wl.display);
      }
    else if (!strcmp(interface, "tizen_surface_extension"))
      {
@@ -1009,3 +1021,87 @@ ecore_wl_window_keygrab_unset(Ecore_Wl_Window *win, const char *key, int mod EIN
    return ret;
 }
 
+static void
+_ecore_wl_window_conformant_area_send(Ecore_Wl_Window *win, uint32_t conformant_part, uint32_t state)
+{
+   Ecore_Wl_Event_Conformant_Change *ev;
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+   if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Conformant_Change)))) return;
+   ev->win = win->id;
+   ev->part_type = conformant_part;
+   ev->state = state;
+   ecore_event_add(ECORE_WL_EVENT_CONFORMANT_CHANGE, ev, NULL, NULL);
+}
+
+static void
+_ecore_wl_cb_conformant(void *data EINA_UNUSED, struct tizen_policy *tizen_policy EINA_UNUSED, struct wl_surface *surface_resource, uint32_t is_conformant)
+{
+   struct wl_surface *surface = surface_resource;
+   Ecore_Wl_Window *win = NULL;
+
+   if (!surface) return;
+   win = ecore_wl_window_surface_find(surface);
+   if (win)
+     win->conformant = is_conformant;
+}
+
+static void
+_ecore_wl_cb_conformant_area(void *data EINA_UNUSED, struct tizen_policy *tizen_policy EINA_UNUSED, struct wl_surface *surface_resource, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h)
+{
+   struct wl_surface *surface = surface_resource;
+   Ecore_Wl_Window *win = NULL;
+   int org_x, org_y, org_w, org_h;
+   Eina_Bool changed;
+
+   if (!surface) return;
+   win = ecore_wl_window_surface_find(surface);
+   if (!win) return;
+
+   if (conformant_part == TIZEN_POLICY_CONFORMANT_PART_INDICATOR)
+     {
+        ecore_wl_window_indicator_geometry_get(win, &org_x, &org_y, &org_w, &org_h);
+        if ((org_x != x) || (org_y != y) || (org_w != w) || (org_h != h))
+          {
+             ecore_wl_window_indicator_geometry_set(win, x, y, w, h);
+             changed = EINA_TRUE;
+          }
+        if (state != ecore_wl_window_indicator_state_get(win))
+          {
+             ecore_wl_window_indicator_state_set(win, state);
+             changed = EINA_TRUE;
+          }
+     }
+   else if (conformant_part == TIZEN_POLICY_CONFORMANT_PART_KEYBOARD)
+     {
+        ecore_wl_window_keyboard_geometry_get(win, &org_x, &org_y, &org_w, &org_h);
+        if ((org_x != x) || (org_y != y) || (org_w != w) || (org_h != h))
+          {
+             ecore_wl_window_keyboard_geometry_set(win, x, y, w, h);
+             changed = EINA_TRUE;
+          }
+        if (state != ecore_wl_window_keyboard_state_get(win))
+          {
+             ecore_wl_window_keyboard_state_set(win, state);
+             changed = EINA_TRUE;
+          }
+     }
+   else if (conformant_part == TIZEN_POLICY_CONFORMANT_PART_CLIPBOARD)
+     {
+        ecore_wl_window_clipboard_geometry_get(win, &org_x, &org_y, &org_w, &org_h);
+        if ((org_x != x) || (org_y != y) || (org_w != w) || (org_h != h))
+          {
+             ecore_wl_window_clipboard_geometry_set(win, x, y, w, h);
+             changed = EINA_TRUE;
+          }
+        if (state != ecore_wl_window_clipboard_state_get(win))
+          {
+             ecore_wl_window_clipboard_state_set(win, state);
+             changed = EINA_TRUE;
+          }
+     }
+
+   if (changed)
+     _ecore_wl_window_conformant_area_send(win, conformant_part, state);
+}
index 9290d78..7dc0899 100644 (file)
@@ -160,6 +160,22 @@ struct _Ecore_Wl_Window
 
    struct
      {
+        int x, y, w, h;
+        Ecore_Wl_Indicator_State state;
+     } indicator;
+   struct
+     {
+        int x, y, w, h;
+        Ecore_Wl_Clipboard_State state;
+     } clipboard;
+   struct
+     {
+        int x, y, w, h;
+        Ecore_Wl_Virtual_Keyboard_State state;
+     } keyboard;
+
+   struct
+     {
         int w, h;
      } saved;
 
@@ -173,6 +189,7 @@ struct _Ecore_Wl_Window
    Eina_Bool alpha : 1;
    Eina_Bool transparent : 1;
    Eina_Bool has_buffer : 1;
+   Eina_Bool conformant : 1;
 
    Ecore_Wl_Window_Type type;
    Ecore_Wl_Window_Buffer_Type buffer_type;
index ef38290..a09a9c3 100644 (file)
@@ -1470,3 +1470,180 @@ _ecore_wl_window_id_str_get(unsigned int win_id)
 
    return id;
 }
+
+void
+ecore_wl_window_indicator_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if(!win) return;
+
+   win->indicator.x = x;
+   win->indicator.y = y;
+   win->indicator.w = w;
+   win->indicator.h = h;
+}
+
+Eina_Bool
+ecore_wl_window_indicator_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if(!win) return EINA_FALSE;
+
+   if (x)
+     *x = win->indicator.x;
+   if (y)
+     *y = win->indicator.y;
+   if (w)
+     *w = win->indicator.w;
+   if (h)
+     *h = win->indicator.h;
+
+   return EINA_TRUE;
+}
+
+EAPI void
+ecore_wl_window_indicator_state_set(Ecore_Wl_Window *win, Eina_Bool on)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return;
+
+   if (on) win->indicator.state = ECORE_WL_INDICATOR_STATE_ON;
+   else if (!on) win->indicator.state = ECORE_WL_INDICATOR_STATE_OFF;
+}
+
+EAPI Ecore_Wl_Indicator_State
+ecore_wl_window_indicator_state_get(Ecore_Wl_Window *win)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return EINA_FALSE;
+
+   return win->indicator.state;
+}
+
+void
+ecore_wl_window_clipboard_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if(!win) return;
+
+   win->clipboard.x = x;
+   win->clipboard.y = y;
+   win->clipboard.w = w;
+   win->clipboard.h = h;
+}
+
+Eina_Bool
+ecore_wl_window_clipboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return EINA_FALSE;
+
+   if (x)
+     *x = win->clipboard.x;
+   if (y)
+     *y = win->clipboard.y;
+   if (w)
+     *w = win->clipboard.w;
+   if (h)
+     *h = win->clipboard.h;
+
+   return EINA_TRUE;
+}
+
+EAPI void
+ecore_wl_window_clipboard_state_set(Ecore_Wl_Window *win, Eina_Bool on)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return;
+
+   if (on) win->clipboard.state = ECORE_WL_CLIPBOARD_STATE_ON;
+   else if(!on) win->clipboard.state = ECORE_WL_CLIPBOARD_STATE_OFF;
+
+}
+
+EAPI Ecore_Wl_Clipboard_State
+ecore_wl_window_clipboard_state_get(Ecore_Wl_Window *win)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return EINA_FALSE;
+
+   return win->clipboard.state;
+}
+
+void
+ecore_wl_window_keyboard_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if(!win) return;
+
+   win->keyboard.x= x;
+   win->keyboard.y = y;
+   win->keyboard.w = w;
+   win->keyboard.h = h;
+}
+
+Eina_Bool
+ecore_wl_window_keyboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return EINA_FALSE;
+
+   if (x)
+     *x = win->keyboard.x;
+   if (y)
+     *y = win->keyboard.y;
+   if (w)
+     *w = win->keyboard.w;
+   if (h)
+     *h = win->keyboard.h;
+
+   return EINA_TRUE;
+}
+
+EAPI void
+ecore_wl_window_keyboard_state_set(Ecore_Wl_Window *win, Eina_Bool on)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return;
+
+   if (on) win->keyboard.state = ECORE_WL_VIRTUAL_KEYBOARD_STATE_ON;
+   else if (!on) win->keyboard.state = ECORE_WL_VIRTUAL_KEYBOARD_STATE_OFF;
+}
+
+EAPI Ecore_Wl_Virtual_Keyboard_State
+ecore_wl_window_keyboard_state_get(Ecore_Wl_Window *win)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return EINA_FALSE;
+
+   return win->keyboard.state;
+}
+
+EAPI void
+ecore_wl_window_conformant_set(Ecore_Wl_Window *win, unsigned int is_conformant)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return;
+   if (!win->surface) return;
+   if (!_ecore_wl_disp->wl.tz_policy) return;
+
+   if (is_conformant)
+     tizen_policy_conformant_set(_ecore_wl_disp->wl.tz_policy, win->surface);
+   else
+     tizen_policy_conformant_unset(_ecore_wl_disp->wl.tz_policy, win->surface);
+}
+
+EAPI Eina_Bool
+ecore_wl_window_conformant_get(Ecore_Wl_Window *win)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!win) return 0;
+   if (!win->surface) return 0;
+   if (!_ecore_wl_disp->wl.tz_policy) return 0;
+
+   tizen_policy_conformant_get(_ecore_wl_disp->wl.tz_policy, win->surface);
+
+   ecore_wl_sync();
+
+   return win->conformant;
+}
index 3fa26bb..ff944ce 100644 (file)
@@ -18,8 +18,57 @@ 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 tizen_position_interface;
+extern const struct wl_interface tizen_visibility_interface;
+extern const struct wl_interface wl_surface_interface;
+
+#ifndef TIZEN_POLICY_CONFORMANT_PART_ENUM
+#define TIZEN_POLICY_CONFORMANT_PART_ENUM
+enum tizen_policy_conformant_part {
+       TIZEN_POLICY_CONFORMANT_PART_INDICATOR = 0,
+       TIZEN_POLICY_CONFORMANT_PART_KEYBOARD = 1,
+       TIZEN_POLICY_CONFORMANT_PART_CLIPBOARD = 2,
+};
+#endif /* TIZEN_POLICY_CONFORMANT_PART_ENUM */
+
+struct tizen_policy_listener {
+       /**
+        * conformant - (none)
+        * @surface: surface object
+        * @is_conformant: (none)
+        */
+       void (*conformant)(void *data,
+                          struct tizen_policy *tizen_policy,
+                          struct wl_surface *surface,
+                          uint32_t is_conformant);
+       /**
+        * conformant_area - (none)
+        * @surface: surface object
+        * @conformant_part: (none)
+        * @state: (none)
+        * @x: (none)
+        * @y: (none)
+        * @w: (none)
+        * @h: (none)
+        */
+       void (*conformant_area)(void *data,
+                               struct tizen_policy *tizen_policy,
+                               struct wl_surface *surface,
+                               uint32_t conformant_part,
+                               uint32_t state,
+                               int32_t x,
+                               int32_t y,
+                               int32_t w,
+                               int32_t h);
+};
+
+static inline int
+tizen_policy_add_listener(struct tizen_policy *tizen_policy,
+                         const struct tizen_policy_listener *listener, void *data)
+{
+       return wl_proxy_add_listener((struct wl_proxy *) tizen_policy,
+                                    (void (**)(void)) listener, data);
+}
 
 #define TIZEN_POLICY_GET_VISIBILITY    0
 #define TIZEN_POLICY_GET_POSITION      1
@@ -28,6 +77,9 @@ extern const struct wl_interface tizen_position_interface;
 #define TIZEN_POLICY_FOCUS_SKIP_SET    4
 #define TIZEN_POLICY_FOCUS_SKIP_UNSET  5
 #define TIZEN_POLICY_ROLE_SET  6
+#define TIZEN_POLICY_CONFORMANT_SET    7
+#define TIZEN_POLICY_CONFORMANT_UNSET  8
+#define TIZEN_POLICY_CONFORMANT_GET    9
 
 static inline void
 tizen_policy_set_user_data(struct tizen_policy *tizen_policy, void *user_data)
@@ -104,6 +156,27 @@ tizen_policy_role_set(struct tizen_policy *tizen_policy, struct wl_surface *surf
                         TIZEN_POLICY_ROLE_SET, surface, role);
 }
 
+static inline void
+tizen_policy_conformant_set(struct tizen_policy *tizen_policy, struct wl_surface *surface)
+{
+       wl_proxy_marshal((struct wl_proxy *) tizen_policy,
+                        TIZEN_POLICY_CONFORMANT_SET, surface);
+}
+
+static inline void
+tizen_policy_conformant_unset(struct tizen_policy *tizen_policy, struct wl_surface *surface)
+{
+       wl_proxy_marshal((struct wl_proxy *) tizen_policy,
+                        TIZEN_POLICY_CONFORMANT_UNSET, surface);
+}
+
+static inline void
+tizen_policy_conformant_get(struct tizen_policy *tizen_policy, struct wl_surface *surface)
+{
+       wl_proxy_marshal((struct wl_proxy *) tizen_policy,
+                        TIZEN_POLICY_CONFORMANT_GET, surface);
+}
+
 #ifndef TIZEN_VISIBILITY_VISIBILITY_ENUM
 #define TIZEN_VISIBILITY_VISIBILITY_ENUM
 enum tizen_visibility_visibility {
index 33bb698..6538a55 100644 (file)
@@ -19,6 +19,18 @@ static const struct wl_interface *types[] = {
        &wl_surface_interface,
        &wl_surface_interface,
        NULL,
+       &wl_surface_interface,
+       &wl_surface_interface,
+       &wl_surface_interface,
+       &wl_surface_interface,
+       NULL,
+       &wl_surface_interface,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
 };
 
 static const struct wl_message tizen_policy_requests[] = {
@@ -29,12 +41,20 @@ static const struct wl_message tizen_policy_requests[] = {
        { "focus_skip_set", "o", types + 8 },
        { "focus_skip_unset", "o", types + 9 },
        { "role_set", "os", types + 10 },
+       { "conformant_set", "o", types + 12 },
+       { "conformant_unset", "o", types + 13 },
+       { "conformant_get", "o", types + 14 },
+};
+
+static const struct wl_message tizen_policy_events[] = {
+       { "conformant", "ou", types + 15 },
+       { "conformant_area", "ouuiiii", types + 17 },
 };
 
 WL_EXPORT const struct wl_interface tizen_policy_interface = {
        "tizen_policy", 1,
-       7, tizen_policy_requests,
-       0, NULL,
+       10, tizen_policy_requests,
+       2, tizen_policy_events,
 };
 
 static const struct wl_message tizen_visibility_requests[] = {
index c8c2c1c..fcafcce 100644 (file)
@@ -34,7 +34,7 @@ EVAS_SMART_SUBCLASS_NEW(_smart_frame_type, _ecore_evas_wl_frame,
 
 /* local variables */
 static int _ecore_evas_wl_init_count = 0;
-static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
+static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[6];
 
 static void _ecore_evas_wayland_resize(Ecore_Evas *ee, int location);
 
@@ -353,6 +353,29 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
    return ECORE_CALLBACK_PASS_ON;
 }
 
+static Eina_Bool
+_ecore_evas_wl_common_cb_conformant_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
+{
+   Ecore_Evas *ee;
+   Ecore_Wl_Event_Conformant_Change *ev;
+
+   ev = event;
+   ee = ecore_event_window_match(ev->win);
+   if (!ee) return ECORE_CALLBACK_PASS_ON;
+   if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+
+   if ((ev->part_type == ECORE_WL_INDICATOR_PART) && (ee->indicator_state != ev->state))
+        ee->indicator_state = ev->state;
+   else if ((ev->part_type == ECORE_WL_KEYBOARD_PART) && (ee->keyboard_state != ev->state))
+     ee->keyboard_state = ev->state;
+   else if ((ev->part_type == ECORE_WL_CLIPBOARD_PART) && (ee->clipboard_state != ev->state))
+     ee->clipboard_state = ev->state;
+
+   _ecore_evas_wl_common_state_update(ee);
+
+   return ECORE_CALLBACK_PASS_ON;
+}
+
 static void
 _rotation_do(Ecore_Evas *ee, int rotation, int resize)
 {
@@ -539,6 +562,9 @@ _ecore_evas_wl_common_init(void)
    _ecore_evas_wl_event_hdls[4] =
      ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE,
                              _ecore_evas_wl_common_cb_window_configure, NULL);
+   _ecore_evas_wl_event_hdls[5] =
+     ecore_event_handler_add(ECORE_WL_EVENT_CONFORMANT_CHANGE,
+                             _ecore_evas_wl_common_cb_conformant_change, NULL);
 
    ecore_event_evas_init();