Merge "[entry] fixed bug in getting geometry of wd->scroller"
[framework/uifw/elementary.git] / src / lib / elm_dialoguegroup.c
index 6ec78d8..66960c8 100644 (file)
@@ -3,7 +3,7 @@
 #include <Ecore.h>
 
 /**
- * @defgroup DialogueGroup DialogueGroup 
+ * @defgroup DialogueGroup DialogueGroup
  * @ingroup Elementary
  *
  * Using dialoguegroup, you can make a dialogue group.
 
 struct _Dialogue_Item
 {
-   Evas_Object *parent;
+   Evas_Object *obj;
    Evas_Object *bg_layout;
    Evas_Object *content;
    Elm_Dialoguegroup_Item_Style style;
    const char *location;
    Eina_Bool press;
    Eina_Bool disabled;
-   //  Eina_Bool line_show;
+   //   Eina_Bool line_show;
 };
 
 
 typedef struct _Widget_Data Widget_Data;
 struct _Widget_Data
 {
-   Evas_Object *parent;
    Evas_Object *box;
    Evas_Object *title_layout;
    const char *title;
@@ -56,8 +55,8 @@ _del_hook(Evas_Object *obj)
    _remove_all(obj);
 
    if (wd->box){
-        evas_object_del(wd->box);
-        wd->box = NULL;
+      evas_object_del(wd->box);
+      wd->box = NULL;
    }
 
    free(wd);
@@ -69,15 +68,15 @@ _theme_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
    Eina_List *l;
-   Dialogue_Item *item;        
+   Dialogue_Item *item;
 
-   if (!wd) return;    
+   if (!wd) return;
    if (wd->title) {
-        elm_layout_theme_set(wd->title_layout, "dialoguegroup", "title", elm_widget_style_get(obj));
-        edje_object_part_text_set(elm_layout_edje_get(wd->title_layout), "text", wd->title);
+      elm_layout_theme_set(wd->title_layout, "dialoguegroup", "title", elm_widget_style_get(obj));
+      edje_object_part_text_set(elm_layout_edje_get(wd->title_layout), "text", wd->title);
    }
-   EINA_LIST_FOREACH(wd->items, l, item) 
-      _change_item_bg( item, item->location ); 
+   EINA_LIST_FOREACH(wd->items, l, item)
+     _change_item_bg( item, item->location );
    _sizing_eval(obj);
 }
 
@@ -94,54 +93,60 @@ _sizing_eval(Evas_Object *obj)
    evas_object_size_hint_max_set(obj, maxw, maxh);
 }
 
-static void _remove_all(Evas_Object *obj)
+static void
+_remove_all(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
-   Dialogue_Item *item;        
+   Dialogue_Item *item;
 
    if (!wd) return;
 
    wd->num = 0;
 
    if (wd->items) {
-        EINA_LIST_FREE(wd->items, item) {
-             if (item->content){
-                  evas_object_del(item->content);
-                  item->content = NULL;
-             }
-             if (item->bg_layout){
-                  evas_object_del(item->bg_layout);
-                  item->bg_layout = NULL;
-             }
-             if (item->location)
-                eina_stringshare_del(item->location);
-             free(item);
-        }
+      EINA_LIST_FREE(wd->items, item) {
+         if (item->content){
+            evas_object_del(item->content);
+            item->content = NULL;
+         }
+         if (item->bg_layout){
+            evas_object_del(item->bg_layout);
+            item->bg_layout = NULL;
+         }
+         if (item->location)
+           eina_stringshare_del(item->location);
+         free(item);
+      }
    }
 }
 
-static void _set_item_theme(Dialogue_Item *item, const char *location)
+static void
+_set_item_theme(Dialogue_Item *item, const char *location)
 {
    if (!item) return;
    char buf[30];
 
-   if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DEFAULT) 
-      snprintf(buf, sizeof(buf), "bg_%s", location);
-   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD) 
-      snprintf(buf, sizeof(buf), "editfield_%s", location);
-   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD_WITH_TITLE) 
-      snprintf(buf, sizeof(buf), "editfield_with_title_%s", location);
-   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDIT_TITLE) 
-      snprintf(buf, sizeof(buf), "edit_title_%s", location);
-   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_HIDDEN) 
-      snprintf(buf, sizeof(buf), "hidden_%s", location);
-   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DATAVIEW) 
-      snprintf(buf, sizeof(buf), "dataview_%s", location);
-   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_NO_BG) 
-      snprintf(buf, sizeof(buf), "no_bg_%s", location);
-   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB) 
-      snprintf(buf, sizeof(buf), "sub_%s", location);
-   elm_layout_theme_set(item->bg_layout, "dialoguegroup", buf, elm_widget_style_get(item->parent));
+   if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DEFAULT)
+     snprintf(buf, sizeof(buf), "bg_%s", location);
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD)
+     snprintf(buf, sizeof(buf), "editfield_%s", location);
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD_WITH_TITLE)
+     snprintf(buf, sizeof(buf), "editfield_with_title_%s", location);
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDIT_TITLE)
+     snprintf(buf, sizeof(buf), "edit_title_%s", location);
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_HIDDEN)
+     snprintf(buf, sizeof(buf), "hidden_%s", location);
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DATAVIEW)
+     snprintf(buf, sizeof(buf), "dataview_%s", location);
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_NO_BG)
+     snprintf(buf, sizeof(buf), "no_bg_%s", location);
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB)
+     snprintf(buf, sizeof(buf), "sub_%s", location);
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDIT)
+     snprintf(buf, sizeof(buf), "bg_edit_%s", location);
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDIT_MERGE)
+     snprintf(buf, sizeof(buf), "bg_edit_merge_%s", location);
+   elm_layout_theme_set(item->bg_layout, "dialoguegroup", buf, elm_widget_style_get(item->obj));
 }
 
 /*
@@ -152,40 +157,45 @@ static void _set_item_theme(Dialogue_Item *item, const char *location)
    if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DEFAULT) {
    if (after->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DEFAULT) {
    item->line_show = EINA_TRUE;
-   edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,show", "elm");        
+   edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,show", "elm");
    }
    else if (after->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD) {
    item->line_show = EINA_FALSE;
-   edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm");        
-   }   
+   edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm");
    }
-   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD) 
-   item->line_show = EINA_TRUE;        
+   }
+   else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD)
+   item->line_show = EINA_TRUE;
    }
 */
 
-static void _change_item_bg(Dialogue_Item *item, const char *location)
+static void
+_change_item_bg(Dialogue_Item *item, const char *location)
 {
    if (!item) return;
 
    eina_stringshare_replace(&item->location, location);
    _set_item_theme(item, location);
-   elm_layout_content_set(item->bg_layout, "swallow", item->content);
-   if((item->press == EINA_TRUE) && (item->disabled == EINA_FALSE))
-      edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
+   elm_object_part_content_set(item->bg_layout, "swallow", item->content);
+   if ((item->press == EINA_TRUE) && (item->disabled == EINA_FALSE))
+     edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
    else
-      edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");   
-   if(item->disabled == EINA_TRUE)
-      edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,disabled", "elm");
+     edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");
+   if (item->disabled == EINA_TRUE)
+     edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,disabled", "elm");
    else
-      edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,enabled", "elm");
+     edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,enabled", "elm");
 
-   /*  if(item->line_show == EINA_FALSE)
-        edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm");*/
+   if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB)
+     edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "flip_item", "");
+
+   /*   if(item->line_show == EINA_FALSE)
+    edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm");*/
 
 }
 
-static Dialogue_Item* _create_item(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegroup_Item_Style style, const char *location)
+static Dialogue_Item*
+_create_item(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegroup_Item_Style style, const char *location)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
    Dialogue_Item *item;
@@ -193,26 +203,27 @@ static Dialogue_Item* _create_item(Evas_Object *obj, Evas_Object *subobj, Elm_Di
    if (!wd) return NULL;
 
    item = ELM_NEW(Dialogue_Item);
-   item->parent = obj;
+   item->obj = obj;
    item->content = subobj;
    item->press = EINA_TRUE;
    item->disabled = EINA_FALSE;
    item->style = style;
-   //  item->line_show = EINA_TRUE;
+   //   item->line_show = EINA_TRUE;
    eina_stringshare_replace(&item->location, location);
 
    item->bg_layout = elm_layout_add(wd->box);
    _set_item_theme(item, location);
    evas_object_size_hint_weight_set(item->bg_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(item->bg_layout, EVAS_HINT_FILL, 0.0);
-   evas_object_show(item->bg_layout);  
+   evas_object_show(item->bg_layout);
 
-   elm_layout_content_set(item->bg_layout, "swallow", item->content);
+   elm_object_part_content_set(item->bg_layout, "swallow", item->content);
 
    return item;
 }
 
-static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void
+_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
    _sizing_eval(data);
 }
@@ -225,7 +236,8 @@ static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *eve
  *
  * @ingroup DialogueGroup
  */
-EAPI Evas_Object *elm_dialoguegroup_add(Evas_Object *parent)
+EAPI Evas_Object *
+elm_dialoguegroup_add(Evas_Object *parent)
 {
    Evas_Object *obj = NULL;
    Widget_Data *wd = NULL;
@@ -241,8 +253,8 @@ EAPI Evas_Object *elm_dialoguegroup_add(Evas_Object *parent)
    elm_widget_data_set(obj, wd);
    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->parent = parent;
    wd->num = 0;
 
    wd->box = elm_box_add(obj);
@@ -257,11 +269,11 @@ EAPI Evas_Object *elm_dialoguegroup_add(Evas_Object *parent)
 /**
  * Append an item to the dialogue group.
  *
- * @param obj dialoguegroup object 
+ * @param obj dialoguegroup object
  * @param subobj item
  * @param style sytle of the item
  * @return Dialogue_Item pointer, just made by this function
- * 
+ *
  * @ingroup DialogueGroup
  */
 EAPI Dialogue_Item *
@@ -269,28 +281,28 @@ elm_dialoguegroup_append(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegrou
 {
    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
    Widget_Data *wd = elm_widget_data_get(obj);
-   Dialogue_Item *item = NULL, *new_item = NULL;       
+   Dialogue_Item *item = NULL, *new_item = NULL;
 
    if (!wd || !subobj) return NULL;
 
-   if (!wd->items) 
-      new_item = _create_item(obj, subobj, style, "default");
+   if (!wd->items)
+     new_item = _create_item(obj, subobj, style, "default");
    else {
-        if (wd->num == 1) {    
-             item = eina_list_data_get(wd->items);
-             _change_item_bg(item, "top");             
-        }              
-        else {
-             item = eina_list_data_get( eina_list_last(wd->items) );
-             _change_item_bg(item, "middle");          
-        }
-        new_item = _create_item(obj, subobj, style, "bottom");
-        //             _set_line_show(item, new_item);
+      if (wd->num == 1) {
+         item = eina_list_data_get(wd->items);
+         _change_item_bg(item, "top");
+      }
+      else {
+         item = eina_list_data_get( eina_list_last(wd->items) );
+         _change_item_bg(item, "middle");
+      }
+      new_item = _create_item(obj, subobj, style, "bottom");
+      //                _set_line_show(item, new_item);
    }
    elm_box_pack_end(wd->box, new_item->bg_layout);
-   if(style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB)
-      edje_object_signal_emit(elm_layout_edje_get(new_item->bg_layout), "flip_item", "");
-   wd->items = eina_list_append(wd->items, new_item);                  
+   if (style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB)
+     edje_object_signal_emit(elm_layout_edje_get(new_item->bg_layout), "flip_item", "");
+   wd->items = eina_list_append(wd->items, new_item);
    wd->num++;
    _sizing_eval(obj);
    return new_item;
@@ -300,7 +312,7 @@ elm_dialoguegroup_append(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegrou
 /**
  * Prepend an item to the dialogue group.
  *
- * @param obj dialoguegroup object 
+ * @param obj dialoguegroup object
  * @param subobj item
  * @param style sytle of the item
  * @return Dialogue_Item pointer, just made by this function
@@ -317,26 +329,26 @@ elm_dialoguegroup_prepend(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegro
    if (!wd || !subobj) return NULL;
 
    if (!wd->items)
-      new_item = _create_item(obj, subobj, style, "default");  
+     new_item = _create_item(obj, subobj, style, "default");
    else {
-        if (wd->num == 1) {    
-             item = eina_list_data_get(wd->items);
-             _change_item_bg(item, "bottom");
-        }              
-        else {
-             item = eina_list_data_get(wd->items);
-             _change_item_bg(item, "middle");          
-        }
-        new_item = _create_item(obj, subobj, style, "top");
-        //             _set_line_show(new_item, item);
+      if (wd->num == 1) {
+         item = eina_list_data_get(wd->items);
+         _change_item_bg(item, "bottom");
+      }
+      else {
+         item = eina_list_data_get(wd->items);
+         _change_item_bg(item, "middle");
+      }
+      new_item = _create_item(obj, subobj, style, "top");
+      //                _set_line_show(new_item, item);
    }
-   if(wd->title_layout)
-      elm_box_pack_after(wd->box, new_item->bg_layout, wd->title_layout);      
-   else                        
-      elm_box_pack_start(wd->box, new_item->bg_layout);                
-   if(style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB) 
-                  edje_object_signal_emit(elm_layout_edje_get(new_item->bg_layout), "flip_item", "");
-   wd->items = eina_list_prepend(wd->items, new_item);         
+   if (wd->title_layout)
+     elm_box_pack_after(wd->box, new_item->bg_layout, wd->title_layout);
+   else
+     elm_box_pack_start(wd->box, new_item->bg_layout);
+   if (style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB)
+     edje_object_signal_emit(elm_layout_edje_get(new_item->bg_layout), "flip_item", "");
+   wd->items = eina_list_prepend(wd->items, new_item);
    wd->num++;
    _sizing_eval(obj);
    return new_item;
@@ -345,7 +357,7 @@ elm_dialoguegroup_prepend(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegro
 /**
  * Insert an item to the dialogue group just after the specified item.
  *
- * @param obj dialoguegroup object 
+ * @param obj dialoguegroup object
  * @param subobj item
  * @param after specified item existing in the dialogue group
  * @param style sytle of the item
@@ -353,7 +365,7 @@ elm_dialoguegroup_prepend(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegro
  *
  * @ingroup DialogueGroup
  */
-EAPI Dialogue_Item * 
+EAPI Dialogue_Item *
 elm_dialoguegroup_insert_after(Evas_Object *obj, Evas_Object *subobj, Dialogue_Item *after, Elm_Dialoguegroup_Item_Style style)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
@@ -364,23 +376,25 @@ elm_dialoguegroup_insert_after(Evas_Object *obj, Evas_Object *subobj, Dialogue_I
    if (!wd || !subobj || !after || !wd->items) return NULL;
 
    EINA_LIST_FOREACH(wd->items, l, after_item) {
-        if(after == after_item) {
-             if( !strcmp(after_item->location, "default") ) {
-                  _change_item_bg(after_item, "top");
-                  item = _create_item(obj, subobj, style, "bottom");
-             }                 
-             else if( !strcmp(after_item->location, "top") || !strcmp(after_item->location, "middle") )        
-                item = _create_item(obj, subobj, style, "middle");             
-             else if( !strcmp(after_item->location, "bottom") ) {
-                  _change_item_bg(after_item, "middle");
-                  item = _create_item(obj, subobj, style, "bottom");           
-             }
-             elm_box_pack_after(wd->box, item->bg_layout, after_item->bg_layout);
-             if(style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB) 
-                  edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "flip_item", "");
-             wd->items = eina_list_append_relative(wd->items, item, after_item);
-             //        _set_line_show(after, item);
-        }              
+      if (after == after_item) {
+         if ( !strcmp(after_item->location, "default") ) {
+            _change_item_bg(after_item, "top");
+            item = _create_item(obj, subobj, style, "bottom");
+         }
+         else if ( !strcmp(after_item->location, "top") || !strcmp(after_item->location, "middle") )
+           item = _create_item(obj, subobj, style, "middle");
+         else if ( !strcmp(after_item->location, "bottom") ) {
+            _change_item_bg(after_item, "middle");
+            item = _create_item(obj, subobj, style, "bottom");
+         }
+         if (!item)
+            return NULL;
+         elm_box_pack_after(wd->box, item->bg_layout, after_item->bg_layout);
+         if (style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB)
+           edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "flip_item", "");
+         wd->items = eina_list_append_relative(wd->items, item, after_item);
+         //     _set_line_show(after, item);
+      }
    }
 
    wd->num++;
@@ -391,7 +405,7 @@ elm_dialoguegroup_insert_after(Evas_Object *obj, Evas_Object *subobj, Dialogue_I
 /**
  * Insert an item to the dialogue group just before the specified item.
  *
- * @param obj dialoguegroup object 
+ * @param obj dialoguegroup object
  * @param subobj item
  * @param before specified item existing in the dialogue group
  * @param style sytle of the item
@@ -411,38 +425,40 @@ elm_dialoguegroup_insert_before(Evas_Object *obj, Evas_Object *subobj, Dialogue_
    if (!wd || !subobj || !before || !wd->items) return NULL;
 
    EINA_LIST_FOREACH(wd->items, l, before_item) {
-        if(before == before_item) {
-             if( !strcmp(before_item->location, "default") ) {
-                  _change_item_bg(before_item, "bottom");
-                  item = _create_item(obj, subobj, style, "top");
-             }
-
-             else if( !strcmp(before_item->location, "top") ) {
-                  _change_item_bg(before_item, "middle");
-                  item = _create_item(obj, subobj, style, "top");                      
-             }
-
-             else if( !strcmp(before_item->location, "middle") || !strcmp(before_item->location, "bottom") ) {
-                  item = _create_item(obj, subobj, style, "middle");
-                  prev = eina_list_prev(l);
-                  //   _set_line_show(prev->data, item);
-             }
-             elm_box_pack_before(wd->box, item->bg_layout, before_item->bg_layout);
-             if(style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB) 
-                  edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "flip_item", "");
-             wd->items = eina_list_prepend_relative(wd->items, item, before_item);
-        }              
+      if (before == before_item) {
+         if ( !strcmp(before_item->location, "default") ) {
+            _change_item_bg(before_item, "bottom");
+            item = _create_item(obj, subobj, style, "top");
+         }
+
+         else if ( !strcmp(before_item->location, "top") ) {
+            _change_item_bg(before_item, "middle");
+            item = _create_item(obj, subobj, style, "top");
+         }
+
+         else if ( !strcmp(before_item->location, "middle") || !strcmp(before_item->location, "bottom") ) {
+            item = _create_item(obj, subobj, style, "middle");
+            prev = eina_list_prev(l);
+            //  _set_line_show(prev->data, item);
+         }
+         if (!item)
+            return NULL;
+         elm_box_pack_before(wd->box, item->bg_layout, before_item->bg_layout);
+         if (style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB)
+           edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "flip_item", "");
+         wd->items = eina_list_prepend_relative(wd->items, item, before_item);
+      }
    }
 
    wd->num++;
-   _sizing_eval(obj);  
+   _sizing_eval(obj);
    return item;
 }
 
 /**
  * Remove an item from the dialogue group.
  *
- * @param obj dialoguegroup object 
+ * @param obj dialoguegroup object
  * @param subobj item
  *
  * @ingroup DialogueGroup
@@ -451,26 +467,26 @@ EAPI void
 elm_dialoguegroup_remove(Dialogue_Item *item)
 {
    if (!item) return;
-   ELM_CHECK_WIDTYPE(item->parent, widtype) ;
+   ELM_CHECK_WIDTYPE(item->obj, widtype) ;
    Dialogue_Item *current_item;
-   Widget_Data *wd = elm_widget_data_get(item->parent);
+   Widget_Data *wd = elm_widget_data_get(item->obj);
    Eina_List *l;
 
    if (!wd || !wd->items || !item) return ;
 
    EINA_LIST_FOREACH(wd->items, l, current_item) {
-        if (current_item == item) {
-             if (current_item->content){
-                  evas_object_del(current_item->content);
-                  current_item->content = NULL;
-             }
-             if (current_item->bg_layout){
-                  evas_object_del(current_item->bg_layout);
-                  current_item->bg_layout = NULL;
-             }
-             elm_box_unpack(wd->box, current_item->bg_layout);                 
-             wd->items = eina_list_remove(wd->items, current_item);
-        }
+      if (current_item == item) {
+         if (current_item->content){
+            evas_object_del(current_item->content);
+            current_item->content = NULL;
+         }
+         if (current_item->bg_layout){
+            evas_object_del(current_item->bg_layout);
+            current_item->bg_layout = NULL;
+         }
+         elm_box_unpack(wd->box, current_item->bg_layout);
+         wd->items = eina_list_remove(wd->items, current_item);
+      }
    }
 
    wd->num--;
@@ -478,24 +494,24 @@ elm_dialoguegroup_remove(Dialogue_Item *item)
    if (wd->num == 0) return;
 
    if (wd->num == 1) {
-        current_item = eina_list_data_get(wd->items);
-        _change_item_bg(current_item, "default");
+      current_item = eina_list_data_get(wd->items);
+      _change_item_bg(current_item, "default");
    }
 
-   else {              
-        current_item = eina_list_data_get(wd->items);
-        _change_item_bg(current_item, "top");
-        current_item = eina_list_data_get( eina_list_last(wd->items) );
-        _change_item_bg(current_item, "bottom");               
+   else {
+      current_item = eina_list_data_get(wd->items);
+      _change_item_bg(current_item, "top");
+      current_item = eina_list_data_get( eina_list_last(wd->items) );
+      _change_item_bg(current_item, "bottom");
    }
 
-   _sizing_eval(item->parent); 
+   _sizing_eval(item->obj);
 }
 
 /**
  * Remove all items from the dialogue group.
  *
- * @param obj dialoguegroup object 
+ * @param obj dialoguegroup object
  *
  * @ingroup DialogueGroup
  */
@@ -503,20 +519,20 @@ EAPI void
 elm_dialoguegroup_remove_all(Evas_Object *obj)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
-   _remove_all(obj);   
-   _sizing_eval(obj);  
+   _remove_all(obj);
+   _sizing_eval(obj);
 }
 
 
 /**
  * Set the title text of the  dialogue group.
  *
- * @param obj dialoguegroup object 
- * @param title title text, if NULL title space will be disappeared 
- * 
+ * @param obj dialoguegroup object
+ * @param title title text, if NULL title space will be disappeared
+ *
  * @ingroup DialogueGroup
  */
-EAPI void 
+EAPI void
 elm_dialoguegroup_title_set(Evas_Object *obj, const char *title)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
@@ -525,17 +541,17 @@ elm_dialoguegroup_title_set(Evas_Object *obj, const char *title)
    if (!wd) return ;
    eina_stringshare_replace(&wd->title, title);
    if (!title) {
-        wd->title = NULL;              
-        elm_box_unpack(wd->box, wd->title_layout);             
-   }   
+      wd->title = NULL;
+      elm_box_unpack(wd->box, wd->title_layout);
+   }
    if (!wd->title_layout) {
-        wd->title_layout = elm_layout_add(wd->box);
-        elm_layout_theme_set(wd->title_layout, "dialoguegroup", "title", elm_widget_style_get(obj));
-        evas_object_size_hint_weight_set(wd->title_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-        evas_object_size_hint_align_set(wd->title_layout, EVAS_HINT_FILL, 0.0);
-        evas_object_show(wd->title_layout);    
-        edje_object_part_text_set(elm_layout_edje_get(wd->title_layout), "text", title);
-        elm_box_pack_start(wd->box, wd->title_layout);
+      wd->title_layout = elm_layout_add(wd->box);
+      elm_layout_theme_set(wd->title_layout, "dialoguegroup", "title", elm_widget_style_get(obj));
+      evas_object_size_hint_weight_set(wd->title_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+      evas_object_size_hint_align_set(wd->title_layout, EVAS_HINT_FILL, 0.0);
+      evas_object_show(wd->title_layout);
+      edje_object_part_text_set(elm_layout_edje_get(wd->title_layout), "text", title);
+      elm_box_pack_start(wd->box, wd->title_layout);
    }
    edje_object_part_text_set(elm_layout_edje_get(wd->title_layout), "text", title);
 }
@@ -562,21 +578,21 @@ elm_dialoguegroup_title_get(Evas_Object *obj)
  *
  * @param obj The dialoguegroup object
  * @param item Dialogue_Item pointer
- * @param press If set as 1, press effect will be shown 
+ * @param press If set as 1, press effect will be shown
  *
- * @ingroup DialogueGroup 
+ * @ingroup DialogueGroup
  */
-EAPI void 
+EAPI void
 elm_dialoguegroup_press_effect_set(Dialogue_Item *item, Eina_Bool press)
 {
-   if(!item) return;
-   ELM_CHECK_WIDTYPE(item->parent, widtype) ;
+   if (!item) return;
+   ELM_CHECK_WIDTYPE(item->obj, widtype) ;
 
    item->press = press;
-   if((press == EINA_TRUE) && (item->disabled == EINA_FALSE))
-      edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
+   if ((press == EINA_TRUE) && (item->disabled == EINA_FALSE))
+     edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
    else
-      edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");     
+     edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");
 }
 
 /**
@@ -584,15 +600,15 @@ elm_dialoguegroup_press_effect_set(Dialogue_Item *item, Eina_Bool press)
  *
  * @param obj The dialoguegroup object
  * @param item Dialogue_Item pointer
- * @return 1 if press effect on, 0 if press effect off 
+ * @return 1 if press effect on, 0 if press effect off
  *
- * @ingroup DialogueGroup 
+ * @ingroup DialogueGroup
  */
 EAPI Eina_Bool
 elm_dialoguegroup_press_effect_get(Dialogue_Item *item)
 {
-   if(!item) return EINA_FALSE;
-   ELM_CHECK_WIDTYPE(item->parent, widtype) EINA_FALSE;
+   if (!item) return EINA_FALSE;
+   ELM_CHECK_WIDTYPE(item->obj, widtype) EINA_FALSE;
 
    return item->press;
 }
@@ -602,15 +618,15 @@ elm_dialoguegroup_press_effect_get(Dialogue_Item *item)
  *
  * @param obj The dialoguegroup object
  * @param item Dialogue_Item pointer
- * @return content object 
+ * @return content object
  *
- * @ingroup DialogueGroup 
+ * @ingroup DialogueGroup
  */
 EAPI Evas_Object *
 elm_dialoguegroup_item_content_get(Dialogue_Item *item)
 {
-   if(!item) return NULL;
-   ELM_CHECK_WIDTYPE(item->parent, widtype) EINA_FALSE;
+   if (!item) return NULL;
+   ELM_CHECK_WIDTYPE(item->obj, widtype) EINA_FALSE;
 
    return item->content;
 }
@@ -620,15 +636,15 @@ elm_dialoguegroup_item_content_get(Dialogue_Item *item)
  *
  * @param item dialoguegroup item
  * @param style sytle of the item
- * 
+ *
  * @ingroup DialogueGroup
  */
-EAPI void 
+EAPI void
 elm_dialoguegroup_item_style_set(Dialogue_Item *item, Elm_Dialoguegroup_Item_Style style)
 {
-   if(!item) return;
-   ELM_CHECK_WIDTYPE(item->parent, widtype);
-   Widget_Data *wd = elm_widget_data_get(item->parent);
+   if (!item) return;
+   ELM_CHECK_WIDTYPE(item->obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(item->obj);
 
    item->style = style;
    _change_item_bg(item, item->location);
@@ -641,16 +657,16 @@ elm_dialoguegroup_item_style_set(Dialogue_Item *item, Elm_Dialoguegroup_Item_Sty
  *
  * @param item dialoguegroup item
  * @return dialoguegroup item style
- * 
+ *
  * @ingroup DialogueGroup
  */
 
 EAPI Elm_Dialoguegroup_Item_Style
 elm_dialoguegroup_item_style_get(Dialogue_Item *item)
 {
-   if(!item) return ELM_DIALOGUEGROUP_ITEM_STYLE_LAST;
-   ELM_CHECK_WIDTYPE(item->parent, widtype) ELM_DIALOGUEGROUP_ITEM_STYLE_LAST;
-   Widget_Data *wd = elm_widget_data_get(item->parent);
+   if (!item) return ELM_DIALOGUEGROUP_ITEM_STYLE_LAST;
+   ELM_CHECK_WIDTYPE(item->obj, widtype) ELM_DIALOGUEGROUP_ITEM_STYLE_LAST;
+   Widget_Data *wd = elm_widget_data_get(item->obj);
 
    if (!wd) return ELM_DIALOGUEGROUP_ITEM_STYLE_LAST;
 
@@ -661,28 +677,28 @@ elm_dialoguegroup_item_style_get(Dialogue_Item *item)
  * Set item state as disable or not.
  *
  * @param item dialoguegroup item.
- * @param disabled if EINA_TRUE disabled, else abled. 
- * 
+ * @param disabled if EINA_TRUE disabled, else abled.
+ *
  * @ingroup DialogueGroup
  */
-EAPI void 
+EAPI void
 elm_dialoguegroup_item_disabled_set(Dialogue_Item *item, Eina_Bool disabled)
 {
-   if(!item) return;
-   ELM_CHECK_WIDTYPE(item->parent, widtype);
-   
+   if (!item) return;
+   ELM_CHECK_WIDTYPE(item->obj, widtype);
+
    item->disabled = disabled;
-   
-   if(disabled == EINA_TRUE)
+
+   if (disabled == EINA_TRUE)
      {
-      edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,disabled", "elm");
-      edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");     
+        edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,disabled", "elm");
+        edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");
      }
    else
      {
-      edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,enabled", "elm");
-      if(item->press == EINA_TRUE)
-         edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
+        edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,enabled", "elm");
+        if (item->press == EINA_TRUE)
+          edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
      }
 }
 
@@ -691,15 +707,15 @@ elm_dialoguegroup_item_disabled_set(Dialogue_Item *item, Eina_Bool disabled)
  *
  * @param item dialoguegroup item.
  * @return if EINA_TRUE, then disabled else abled.
- * 
+ *
  * @ingroup DialogueGroup
  */
 
 EAPI Eina_Bool
 elm_dialoguegroup_item_disabled_get(Dialogue_Item *item)
 {
-   if(!item) return EINA_FALSE;
-   ELM_CHECK_WIDTYPE(item->parent, widtype) EINA_FALSE;
+   if (!item) return EINA_FALSE;
+   ELM_CHECK_WIDTYPE(item->obj, widtype) EINA_FALSE;
 
    return item->disabled;
 }