[*]Un-Rollback to 'Merge [elm_multibuttonentry]Changed edc TEXT part to TEXTBLOCK...
[framework/uifw/elementary.git] / src / lib / elm_conform.c
index be7d2d7..d5faa27 100644 (file)
@@ -1,26 +1,37 @@
 #include <Elementary.h>
 #include "elm_priv.h"
 
+#ifndef MIN
+# define MIN(a,b) ((a) < (b)) ? (a) : (b)
+#endif
+
+#ifndef MAX
+# define MAX(a,b) ((a) < (b)) ? (b) : (a)
+#endif
+
 /**
  * @defgroup Conformant Conformant
- * 
- * The aim is to provide a widget that can be used in elementary apps to 
- * account for space taken up by the indicator, virtual keypad & softkey windows when running 
+ * @ingroup Elementary
+ *
+ * The aim is to provide a widget that can be used in elementary apps to
+ * account for space taken up by the indicator, virtual keypad & softkey windows when running
  * the illume2 module of E17.
  */
 
 typedef struct _Widget_Data Widget_Data;
-struct _Widget_Data 
+struct _Widget_Data
 {
    Evas_Object *base;
    Evas_Object *shelf, *panel, *virtualkeypad;
    Evas_Object *content;
    Evas_Object *scroller;
-   Ecore_Event_Handler *prop_hdl;
+   Evas_Object *layout;
 #ifdef HAVE_ELEMENTARY_X
+   Ecore_Event_Handler *prop_hdl;
    Ecore_X_Virtual_Keyboard_State vkb_state;
 #endif
-   struct {
+   struct
+   {
       Ecore_Animator *animator; // animaton timer
       double start; // time started
       Evas_Coord auto_x, auto_y; // desired delta
@@ -33,54 +44,83 @@ typedef enum _Conformant_Part_Type Conformant_Part_Type;
 enum _Conformant_Part_Type
 {
    ELM_CONFORM_INDICATOR_PART      = 1,
-   ELM_CONFORM_VIRTUAL_KEYPAD_PART = 2,
-   ELM_CONFORM_SOFTKEY_PART        = 4
+   ELM_CONFORM_SOFTKEY_PART        = 2,
+   ELM_CONFORM_VIRTUAL_KEYPAD_PART = 4
 };
+
 #define SUB_TYPE_COUNT 2
 static char *sub_type[SUB_TYPE_COUNT] = { "scroller", "genlist" };
 
 /* local function prototypes */
 static const char *widtype = NULL;
+static void _del_pre_hook(Evas_Object *obj);
 static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
 static void _theme_hook(Evas_Object *obj);
+static void _swallow_conformant_parts(Evas_Object *obj);
+#ifdef HAVE_ELEMENTARY_X
+static void _conformant_part_size_set(Evas_Object *obj,
+                                      Evas_Object *sobj,
+                                      Evas_Coord sx,
+                                      Evas_Coord sy,
+                                      Evas_Coord sw,
+                                      Evas_Coord sh);
+static void _conformant_part_sizing_eval(Evas_Object *obj,
+                                         Conformant_Part_Type part_type);
 static void
-_swallow_conformant_parts(Evas_Object *obj);
-static void
-_conformant_part_size_set(Evas_Object *obj, Evas_Object *sobj, Evas_Coord sx,
-                          Evas_Coord sy, Evas_Coord sw, Evas_Coord sh);
-static void
-_conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type);
+_conformant_move_resize_event_cb(void *data, Evas *e, Evas_Object *obj,
+                                 void *event_info);
+#endif
 static void _sizing_eval(Evas_Object *obj);
 static Eina_Bool _prop_change(void *data, int type, void *event);
 
 /* local functions */
-static void 
-_del_hook(Evas_Object *obj) 
+static void
+_del_pre_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
-
    if (!wd) return;
+#ifdef HAVE_ELEMENTARY_X
    if (wd->prop_hdl) ecore_event_handler_del(wd->prop_hdl);
+#endif
+}
+
+static void
+_del_hook(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+
+   if (!wd) return;
    free(wd);
 }
 
-static void 
-_theme_hook(Evas_Object *obj) 
+static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
 
    if (!wd) return;
-   _elm_theme_object_set(obj, wd->base, "conformant", "base", elm_widget_style_get(obj));
-   _swallow_conformant_parts(obj);
+   edje_object_mirrored_set(wd->base, rtl);
+}
 
-   if (wd->content)
-     edje_object_part_swallow(wd->base, "elm.swallow.content", wd->content);
-   edje_object_scale_set(wd->base, elm_widget_scale_get(obj) * _elm_config->scale);
+static void
+_theme_hook(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+
+   if (!wd) return;
+   _elm_widget_mirrored_reload(obj);
+   _mirrored_set(obj, elm_widget_mirrored_get(obj));
+   _elm_theme_object_set(obj, wd->base, "conformant", "base",
+                         elm_widget_style_get(obj));
+
+   edje_object_scale_set(wd->base, elm_widget_scale_get(obj)
+                         * _elm_config->scale);
    _sizing_eval(obj);
 }
 
-static void 
-_sizing_eval(Evas_Object *obj) 
+static void
+_sizing_eval(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
    Evas_Coord mw = -1, mh = -1;
@@ -91,6 +131,7 @@ _sizing_eval(Evas_Object *obj)
    evas_object_size_hint_max_set(obj, -1, -1);
 }
 
+#ifdef HAVE_ELEMENTARY_X
 static void
 _conformant_part_size_set(Evas_Object *obj, Evas_Object *sobj, Evas_Coord sx,
                           Evas_Coord sy, Evas_Coord sw, Evas_Coord sh)
@@ -101,10 +142,11 @@ _conformant_part_size_set(Evas_Object *obj, Evas_Object *sobj, Evas_Coord sx,
    evas_object_geometry_get(obj, &cx, &cy, &cw, &ch);
 
    /* Part overlapping with conformant */
-   if ((cx < (sx+sw)) && ((cx+cw) > sx) && (cy < (sy+sh)) && ((cy+ch) > sy))
+   if ((cx < (sx + sw)) && ((cx + cw) > sx)
+            && (cy < (sy + sh)) && ((cy + ch) > sy))
      {
-        part_height = MIN((cy+ch), (sy+sh)) - MAX(cy, sy);
-        part_width = MIN((cx+cw), (sx+sw)) - MAX(cx, sx);
+        part_height = MIN((cy + ch), (sy + sh)) - MAX(cy, sy);
+        part_width = MIN((cx + cw), (sx + sw)) - MAX(cx, sx);
      }
 
    evas_object_size_hint_min_set(sobj, part_width, part_height);
@@ -114,14 +156,16 @@ _conformant_part_size_set(Evas_Object *obj, Evas_Object *sobj, Evas_Coord sx,
 static void
 _conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type)
 {
-#ifdef HAVE_ELEMENTARY_X
    Ecore_X_Window zone, xwin;
+   Evas_Object *top;
    int sx = -1, sy = -1, sw = -1, sh = -1;
    Widget_Data *wd = elm_widget_data_get(obj);
 
    if (!wd) return;
 
-   xwin = elm_win_xwindow_get(obj);
+   top = elm_widget_top_get(obj);
+   xwin = elm_win_xwindow_get(top);
+
    zone = ecore_x_e_illume_zone_get(xwin);
 
    if (part_type & ELM_CONFORM_INDICATOR_PART)
@@ -139,8 +183,8 @@ _conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type)
         ecore_x_e_illume_softkey_geometry_get(zone, &sx, &sy, &sw, &sh);
         _conformant_part_size_set(obj, wd->panel, sx, sy, sw, sh);
      }
-#endif
 }
+#endif
 
 static void
 _swallow_conformant_parts(Evas_Object *obj)
@@ -155,8 +199,10 @@ _swallow_conformant_parts(Evas_Object *obj)
         evas_object_size_hint_min_set(wd->shelf, -1, 0);
         evas_object_size_hint_max_set(wd->shelf, -1, 0);
      }
+#ifdef HAVE_ELEMENTARY_X
    else
      _conformant_part_sizing_eval(obj, ELM_CONFORM_INDICATOR_PART);
+#endif
 
    evas_object_color_set(wd->shelf, 0, 0, 0, 0);
    edje_object_part_swallow(wd->base, "elm.swallow.shelf", wd->shelf);
@@ -168,9 +214,10 @@ _swallow_conformant_parts(Evas_Object *obj)
         evas_object_size_hint_min_set(wd->virtualkeypad, -1, 0);
         evas_object_size_hint_max_set(wd->virtualkeypad, -1, 0);
      }
+#ifdef HAVE_ELEMENTARY_X
    else
      _conformant_part_sizing_eval(obj, ELM_CONFORM_VIRTUAL_KEYPAD_PART);
-
+#endif
    evas_object_color_set(wd->virtualkeypad, 0, 0, 0, 0);
    edje_object_part_swallow(wd->base, "elm.swallow.virtualkeypad",
                             wd->virtualkeypad);
@@ -182,15 +229,19 @@ _swallow_conformant_parts(Evas_Object *obj)
         evas_object_size_hint_min_set(wd->panel, -1, 0);
         evas_object_size_hint_max_set(wd->panel, -1, 0);
      }
+#ifdef HAVE_ELEMENTARY_X
    else
      _conformant_part_sizing_eval(obj, ELM_CONFORM_SOFTKEY_PART);
+#endif
 
    evas_object_color_set(wd->panel, 0, 0, 0, 0);
    edje_object_part_swallow(wd->base, "elm.swallow.panel", wd->panel);
 }
 
 static void
-_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+_changed_size_hints(void *data, Evas *e __UNUSED__,
+                    Evas_Object *obj __UNUSED__,
+                    void *event_info __UNUSED__)
 {
    Widget_Data *wd = elm_widget_data_get(data);
 
@@ -199,21 +250,23 @@ _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
 }
 
 static void
-_sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
+_sub_del(void *data, Evas_Object *obj __UNUSED__, void *event_info)
 {
-   Widget_Data *wd = elm_widget_data_get(obj);
+   Widget_Data *wd = elm_widget_data_get(data);
    Evas_Object *sub = event_info;
 
    if (!wd) return;
    if (sub == wd->content)
      {
-        evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
-                                            _changed_size_hints, obj);
+        evas_object_event_callback_del_full(sub,
+                                            EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                            _changed_size_hints, data);
         wd->content = NULL;
-        _sizing_eval(obj);
+        _sizing_eval(data);
      }
 }
 
+
 /* unused now - but meant to be for making sure the focused widget is always
  * visible when the vkbd comes and goes by moving the conformant obj (and thus
  * its children) to  show the focused widget (and if focus changes follow)
@@ -222,7 +275,7 @@ static Evas_Object *
 _focus_object_get(const Evas_Object *obj)
 {
    Evas_Object *win, *foc;
-   
+
    win = elm_widget_top_get(obj);
    if (!win) return NULL;
    foc = elm_widget_top_get(win);
@@ -249,69 +302,75 @@ _autoscroll_move(Evas_Object *obj)
 static void
 _autoscroll_mode_enable(Evas_Object *obj)
 {
-   // called when autoscroll mode should be on - content area smaller than
-   // its min size
-   // 1. get focused object
-   // 2. if not in visible conformant area calculate delta needed to
-   //    get it in
-   // 3. store delta and call _autoscroll_move() which either asanimates
-   //    or jumps right there
+// called when autoscroll mode should be on - content area smaller than
+// its min size
+// 1. get focused object
+// 2. if not in visible conformant area calculate delta needed to
+//    get it in
+// 3. store delta and call _autoscroll_move() which either asanimates
+//    or jumps right there
 }
 
 static void
 _autoscroll_mode_disable(Evas_Object *obj)
 {
-   // called when autoscroll mode should be off - set delta to 0 and
-   // call _autoscroll_move()
+// called when autoscroll mode should be off - set delta to 0 and
+// call _autoscroll_move()
 }
-*/
+ */
 
+#ifdef HAVE_ELEMENTARY_X
 static void
-_conformant_move_resize_event_cb(void *data, Evas *e, Evas_Object *obj,
-                                 void *event_info)
+_conformant_move_resize_event_cb(void *data __UNUSED__, Evas *e __UNUSED__,
+                                 Evas_Object *obj, void *event_info __UNUSED__)
 {
    Conformant_Part_Type part_type;
    Widget_Data *wd = elm_widget_data_get(obj);
 
    if (!wd) return;
    part_type =  (ELM_CONFORM_INDICATOR_PART |
-                 ELM_CONFORM_VIRTUAL_KEYPAD_PART |
-                 ELM_CONFORM_SOFTKEY_PART);
+                 ELM_CONFORM_SOFTKEY_PART |
+                 ELM_CONFORM_VIRTUAL_KEYPAD_PART);
    _conformant_part_sizing_eval(obj, part_type);
 }
+#endif
 
+// showing the focused/important region.
 static void
-_content_resize_event_cb(void *data, Evas *e, Evas_Object *obj,
-                         void *event_info)
+_content_resize_event_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj
+                         __UNUSED__, void *event_info __UNUSED__)
 {
    Evas_Object *focus_obj;
-   Evas_Object *conformant = (Evas_Object *) data;
+   Evas_Object *conformant = (Evas_Object *)data;
    Widget_Data *wd = elm_widget_data_get(conformant);
+
    if (!wd) return;
+#ifdef HAVE_ELEMENTARY_X
    if (wd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) return;
+#endif
 
    focus_obj = elm_widget_focused_object_get(conformant);
    if (focus_obj)
-   {
-      Evas_Coord x, y, w, h;
+     {
+        Evas_Coord x, y, w, h;
+
+        elm_widget_show_region_get(focus_obj, &x, &y, &w, &h);
 
-      elm_widget_show_region_get(focus_obj, &x, &y, &w, &h);
+        if (h < _elm_config->finger_size)
+          h = _elm_config->finger_size;
 
-      if (h < _elm_config->finger_size)
-         h = _elm_config->finger_size;
-      else
-         h = 1 + h; //elm_widget_show_region_set expects some change, to redo the job.
-      elm_widget_show_region_set(focus_obj, x, y, w, h);
-   }
+        elm_widget_show_region_set(focus_obj, x, y, w, h, EINA_TRUE);
+     }
 }
 
+#ifdef HAVE_ELEMENTARY_X
 static void
 _update_autoscroll_objs(void *data)
 {
    const char *type;
    int i;
    Evas_Object *sub, *top_scroller = NULL;
-   Evas_Object *conformant = (Evas_Object *) data;
+   Evas_Object *conformant = (Evas_Object *)data;
    Widget_Data *wd = elm_widget_data_get(data);
 
    if (!wd) return;
@@ -325,10 +384,10 @@ _update_autoscroll_objs(void *data)
         if (!strcmp(type, "conformant")) break;
         for (i = 0; i < SUB_TYPE_COUNT; i++)
           if (!strcmp(type, sub_type[i]))
-               {
-                  top_scroller = sub;
-                  break;
-               }
+            {
+               top_scroller = sub;
+               break;
+            }
         sub = elm_object_parent_widget_get(sub);
      }
 
@@ -347,37 +406,33 @@ _update_autoscroll_objs(void *data)
 }
 
 static Eina_Bool
-_prop_change(void *data, int type __UNUSED__, void *event) 
+_prop_change(void *data, int type __UNUSED__, void *event)
 {
-#ifdef HAVE_ELEMENTARY_X
    Ecore_X_Event_Window_Property *ev;
    Widget_Data *wd = elm_widget_data_get(data);
 
    if (!wd) return ECORE_CALLBACK_PASS_ON;
    ev = event;
-   if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE) 
+   if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE)
      {
         Conformant_Part_Type part_type;
 
         part_type =  (ELM_CONFORM_INDICATOR_PART |
-                      ELM_CONFORM_VIRTUAL_KEYPAD_PART |
-                      ELM_CONFORM_SOFTKEY_PART);
+                      ELM_CONFORM_SOFTKEY_PART |
+                      ELM_CONFORM_VIRTUAL_KEYPAD_PART);
         _conformant_part_sizing_eval(data, part_type);
-        evas_object_event_callback_add(data, EVAS_CALLBACK_RESIZE,
-                                       _conformant_move_resize_event_cb, data);
-        evas_object_event_callback_add(data, EVAS_CALLBACK_MOVE,
-                                       _conformant_move_resize_event_cb, data);
      }
-   else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY) 
+   else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY)
      _conformant_part_sizing_eval(data, ELM_CONFORM_INDICATOR_PART);
-   else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY) 
+   else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY)
      _conformant_part_sizing_eval(data, ELM_CONFORM_SOFTKEY_PART);
-   else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY) 
+   else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY)
      _conformant_part_sizing_eval(data, ELM_CONFORM_VIRTUAL_KEYPAD_PART);
    else if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE)
      {
         Ecore_X_Window zone;
 
+        printf("Keyboard Geometry Changed\n");
         zone = ecore_x_e_illume_zone_get(ev->win);
         wd->vkb_state = ecore_x_e_virtual_keyboard_state_get(zone);
         if (wd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
@@ -388,55 +443,68 @@ _prop_change(void *data, int type __UNUSED__, void *event)
         else
           _update_autoscroll_objs(data);
      }
-#endif
 
    return ECORE_CALLBACK_PASS_ON;
 }
+#endif
 
 /**
  * Add a new Conformant object
- * 
+ *
  * @param parent The parent object
  * @return The new conformant object or NULL if it cannot be created
- * 
+ *
  * @ingroup Conformant
  */
 EAPI Evas_Object *
-elm_conformant_add(Evas_Object *parent) 
+elm_conformant_add(Evas_Object *parent)
 {
    Evas_Object *obj;
-   Evas *evas;
+   Evas *e;
    Widget_Data *wd;
 
-   EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-
-   wd = ELM_NEW(Widget_Data);
+   ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
 
-   evas = evas_object_evas_get(parent);
-   if (!evas) return NULL;
-
-   obj = elm_widget_add(evas);
    ELM_SET_WIDTYPE(widtype, "conformant");
    elm_widget_type_set(obj, "conformant");
    elm_widget_sub_object_add(parent, obj);
    elm_widget_data_set(obj, wd);
+   elm_widget_del_pre_hook_set(obj, _del_pre_hook);
    elm_widget_del_hook_set(obj, _del_hook);
    elm_widget_theme_hook_set(obj, _theme_hook);
    elm_widget_can_focus_set(obj, EINA_FALSE);
 
-   wd->base = edje_object_add(evas);
+   wd->base = edje_object_add(e);
    _elm_theme_object_set(obj, wd->base, "conformant", "base", "default");
    elm_widget_resize_object_set(obj, wd->base);
+
+   wd->layout = elm_layout_add(obj);
+   edje_object_part_swallow(wd->base, "elm.swallow.content", wd->layout);
+   elm_layout_theme_set(wd->layout, "conformant", "layout", "content");
+
    _swallow_conformant_parts(obj);
 
 #ifdef HAVE_ELEMENTARY_X
-   wd->prop_hdl = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
-                                          _prop_change, obj);
-   wd->vkb_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
-#endif
+   Evas_Object *top = elm_widget_top_get(obj);
+   Ecore_X_Window xwin = elm_win_xwindow_get(top);
+
+   if ((xwin) && (!elm_win_inlined_image_object_get(top)))
+     {
+        _swallow_conformant_parts(obj);
+        wd->prop_hdl = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
+                                               _prop_change, obj);
+        wd->vkb_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
+     }
+   // FIXME: get kbd region prop
 
-   evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
+                                       _conformant_move_resize_event_cb, obj);
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
+                                       _conformant_move_resize_event_cb, obj);
+#endif
+   evas_object_smart_callback_add(wd->layout, "sub-object-del", _sub_del, obj);
 
+   _mirrored_set(obj, elm_widget_mirrored_get(obj));
    _sizing_eval(obj);
    return obj;
 }
@@ -463,12 +531,12 @@ elm_conformant_content_set(Evas_Object *obj, Evas_Object *content)
    if (wd->content == content) return;
    if (wd->content) evas_object_del(wd->content);
    wd->content = content;
-   if (content)
+   if (wd->content)
      {
-        elm_widget_sub_object_add(obj, content);
-        evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
-                                                      _changed_size_hints, obj);
-        edje_object_part_swallow(wd->base, "elm.swallow.content", content);
+        elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content);
+        evas_object_event_callback_add( wd->content,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
      }
    _sizing_eval(obj);
 }
@@ -513,8 +581,7 @@ elm_conformant_content_unset(Evas_Object *obj)
    if (!wd) return NULL;
    if (!wd->content) return NULL;
    content = wd->content;
-   elm_widget_sub_object_del(obj, wd->content);
-   edje_object_part_unswallow(wd->base, wd->content);
+   elm_layout_content_unset(wd->layout, "elm.swallow.content");
    wd->content = NULL;
    return content;
 }
@@ -527,8 +594,9 @@ elm_conformant_content_unset(Evas_Object *obj)
  *
  * @ingroup Conformant
  */
-EAPI Evas_Object*
-elm_conformant_content_area_get(Evas_Object *obj)
+
+EAPI Evas_Object *
+elm_conformant_content_area_get(const Evas_Object *obj)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
    Widget_Data *wd = elm_widget_data_get(obj);
@@ -536,6 +604,7 @@ elm_conformant_content_area_get(Evas_Object *obj)
    if (!wd) return NULL;
    /*Finger waggle warning*/
    _elm_dangerous_call_check(__FUNCTION__);
-   return (Evas_Object*)edje_object_part_object_get(wd->base, "elm.swallow.content");
+
+   return wd->layout;
 }