elm_win/elm_conformant: add processing properties of window 33/55033/10 accepted/tizen/common/20160331.051308 accepted/tizen/ivi/20160330.134803 accepted/tizen/mobile/20160330.134659 accepted/tizen/tv/20160330.134719 accepted/tizen/wearable/20160330.134735 submit/tizen/20160330.123237
authorHosang Kim <hosang12.kim@samsung.com>
Mon, 21 Dec 2015 10:26:46 +0000 (19:26 +0900)
committerkim hosang <hosang12.kim@samsung.com>
Wed, 30 Mar 2016 12:18:27 +0000 (05:18 -0700)
Currently conformant widget does not support to processing changes of wayland window
properties. Such as virtual keyboard on/off, clipboard on/off and
indicator show/hide.
So I added new enum for wayland properties and process logic like X
backend.

@tizen_fix

Change-Id: I5fbb8e4740c2e8a95925b907548f9c7a0101363c

src/lib/elm_conform.c
src/lib/elm_priv.h
src/lib/elm_win.c

index 00217d0..1a804dd 100644 (file)
 #define MY_CLASS_NAME "Elm_Conformant"
 #define MY_CLASS_NAME_LEGACY "elm_conformant"
 
+//TIZEN_ONLY(20160330): add processing properties of window
+#define SWAP(x, y, t) ((t) = (x), (x) = (y), (y) = (t))
+//
+
 static char CONFORMANT_KEY[] = "_elm_conform_key";
 
 #define ELM_CONFORM_INDICATOR_TIME 1.0
@@ -197,6 +201,23 @@ _conformant_part_sizing_eval(Evas_Object *obj,
         wlwin = elm_win_wl_window_get(top);
         if (wlwin)
           ecore_wl_window_keyboard_geometry_get(wlwin, &sx, &sy, &sw, &sh);
+        Evas_Coord tmp = 0;
+        Evas_Coord ww = 0, wh = 0;
+        elm_win_screen_size_get(top, NULL, NULL, &ww, &wh);
+        if (sd->rot == 90)
+          {
+             SWAP(sx, sy, tmp);
+             SWAP(sw, sh, tmp);
+          }
+        if (sd->rot == 180)
+          {
+             sy = wh - sh;
+          }
+        if (sd->rot == 270)
+          {
+             sy = ww - sw;
+             SWAP(sw, sh, tmp);
+          }
 #endif
 //
         DBG("[KEYPAD]: size(%d,%d, %dx%d).", sx, sy, sw, sh);
@@ -711,7 +732,6 @@ _show_region_job(void *data)
 }
 
 // showing the focused/important region.
-#ifdef HAVE_ELEMENTARY_X
 static void
 _on_content_resize(void *data,
                    Evas *e EINA_UNUSED,
@@ -720,17 +740,16 @@ _on_content_resize(void *data,
 {
    ELM_CONFORMANT_DATA_GET(data, sd);
 
+#ifdef HAVE_ELEMENTARY_X
    if ((sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) &&
        (sd->clipboard_state == ECORE_X_ILLUME_CLIPBOARD_STATE_OFF))
      return;
+#endif
 
    ecore_job_del(sd->show_region_job);
    sd->show_region_job = ecore_job_add(_show_region_job, data);
 }
 
-#endif
-
-#ifdef HAVE_ELEMENTARY_X
 static void
 _autoscroll_objects_update(void *data)
 {
@@ -766,6 +785,7 @@ _autoscroll_objects_update(void *data)
      }
 }
 
+#ifdef HAVE_ELEMENTARY_X
 static void
 _virtualkeypad_state_change(Evas_Object *obj, Ecore_X_Event_Window_Property *ev)
 {
@@ -910,9 +930,11 @@ _on_prop_change(void *data,
 static void
 _on_conformant_changed(void *data,
                      Evas_Object *obj,
-                     void *event_info EINA_UNUSED)
+                     void *event_info)
 {
    Conformant_Part_Type part_type;
+   Conformant_Property property = (Conformant_Property) event_info;
+   Elm_Win_Keyboard_Mode mode;
 
    part_type = (ELM_CONFORMANT_INDICATOR_PART |
                 ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
@@ -922,7 +944,32 @@ _on_conformant_changed(void *data,
    /* object is already freed */
    if (!sd) return;
 
-   _conformant_part_sizing_eval(data, part_type);
+   if (property & CONFORMANT_KEYBOARD_STATE)
+     {
+        mode = elm_win_keyboard_mode_get(obj);
+
+        if (mode == ELM_WIN_KEYBOARD_ON)
+          {
+             _conformant_part_sizing_eval(data, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
+             elm_widget_display_mode_set(data, EVAS_DISPLAY_MODE_COMPRESS);
+             _autoscroll_objects_update(data);
+             eo_do(data, eo_event_callback_call(
+                   ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_ON, NULL));
+          }
+        else if (mode == ELM_WIN_KEYBOARD_OFF)
+          {
+             evas_object_size_hint_min_set(sd->virtualkeypad, -1, 0);
+             evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
+             _conformant_part_sizing_eval(data, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
+             elm_widget_display_mode_set(data, EVAS_DISPLAY_MODE_NONE);
+             eo_do(data, eo_event_callback_call(
+                   ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_OFF, NULL));
+          }
+     }
+   if (property & CONFORMANT_KEYBOARD_GEOMETRY)
+     {
+        _conformant_part_sizing_eval(data, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
+     }
 }
 //
 
index 7a1a8d5..46fafe7 100644 (file)
@@ -594,6 +594,19 @@ void tizen_vg_slider_set(Elm_Slider *obj, Evas_Object *popup);
 void tizen_vg_check_state_set(Elm_Check *obj);
 #endif
 
-
+//TIZEN_ONLY(20160330): add processing properties of window
+#ifdef HAVE_ELEMENTARY_WAYLAND
+typedef enum _Conformant_Property
+{
+   CONFORMANT_DEFAULT = 0,
+   CONFORMANT_INDICATOR_STATE = 1 << 0,
+   CONFORMANT_INDICATOR_GEOMETRY = 1 << 1,
+   CONFORMANT_KEYBOARD_STATE = 1 << 2,
+   CONFORMANT_KEYBOARD_GEOMETRY = 1 << 3,
+   CONFORMANT_CLIPBOARD_STATE = 1 << 4,
+   CONFORMANT_CLIPBOARD_GEOMETRY = 1 << 5
+} Conformant_Property;
+#endif
+//
 
 #endif
index dc7f050..230dafd 100644 (file)
@@ -1343,6 +1343,7 @@ _elm_win_state_change(Ecore_Evas *ee)
    Eina_Bool ch_aux_hint = EINA_FALSE;
    Eina_List *aux_hints = NULL;
    const char *profile;
+   Conformant_Property property = CONFORMANT_DEFAULT; //TIZEN_ONLY(20160330): add processing properties of window
 
    if (!sd) return;
 
@@ -1407,11 +1408,15 @@ _elm_win_state_change(Ecore_Evas *ee)
      {
         sd->indmode = (Elm_Win_Indicator_Mode)ecore_wl_window_indicator_state_get(sd->wl.win);
         ch_conformant = EINA_TRUE;
+        property |= CONFORMANT_INDICATOR_STATE; //TIZEN_ONLY(20160330): add processing properties of window
+
      }
    if (sd->kbdmode != (Elm_Win_Keyboard_Mode)ecore_wl_window_keyboard_state_get(sd->wl.win))
      {
         sd->kbdmode = (Elm_Win_Keyboard_Mode)ecore_wl_window_keyboard_state_get(sd->wl.win);
         ch_conformant = EINA_TRUE;
+        property |= CONFORMANT_KEYBOARD_STATE; //TIZEN_ONLY(20160330): add processing properties of window
+
      }
    if (ecore_wl_window_indicator_geometry_get(sd->wl.win, &x, &y, &w, &h))
      {
@@ -1422,6 +1427,8 @@ _elm_win_state_change(Ecore_Evas *ee)
              sd->ind.w = w;
              sd->ind.h = h;
              ch_conformant  = EINA_TRUE;
+             property |= CONFORMANT_INDICATOR_GEOMETRY; //TIZEN_ONLY(20160330): add processing properties of window
+
           }
      }
    if (ecore_wl_window_keyboard_geometry_get(sd->wl.win, &x, &y, &w, &h))
@@ -1433,6 +1440,8 @@ _elm_win_state_change(Ecore_Evas *ee)
              sd->kbd.w = w;
              sd->kbd.h = h;
              ch_conformant  = EINA_TRUE;
+             property |= CONFORMANT_KEYBOARD_GEOMETRY; //TIZEN_ONLY(20160330): add processing properties of window
+
           }
      }
 #endif
@@ -1519,7 +1528,8 @@ _elm_win_state_change(Ecore_Evas *ee)
      }
    if (ch_conformant)
      {
-        evas_object_smart_callback_call(obj, SIG_CONFORMANT_CHANGED, NULL);
+        evas_object_smart_callback_call(obj, SIG_CONFORMANT_CHANGED, (void *)property); //TIZEN_ONLY(20160330): add processing properties of window
+
      }
    if (ch_aux_hint)
      {