Use elm_object_content_set/get
authorMike McCormack <mj.mccormack@samsung.com>
Wed, 9 Nov 2011 01:03:29 +0000 (10:03 +0900)
committerMike McCormack <mj.mccormack@samsung.com>
Wed, 9 Nov 2011 01:03:29 +0000 (10:03 +0900)
src/bin/test_ctxpopup.c
src/lib/elc_navigationbar_ex.c
src/lib/elm_controlbar.c
src/lib/elm_datefield.c
src/lib/elm_dialoguegroup.c
src/lib/elm_imageslider.c
src/lib/elm_popup.c

index 3596119..c40b231 100644 (file)
@@ -139,7 +139,7 @@ _list_item_cb5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
    elm_box_pack_end(bx, sc);
 
    ctxpopup = elm_ctxpopup_add(obj);
-   elm_ctxpopup_content_set(ctxpopup, bx);
+   elm_object_content_set(ctxpopup, bx);
 
    evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
    evas_object_move(ctxpopup, x, y);
index 3c23b7d..69b2b60 100644 (file)
@@ -737,7 +737,7 @@ elm_navigationbar_ex_item_title_button_set(Elm_Navigationbar_ex_Item* item, char
    if (btn_label)
      elm_object_text_set(btn, btn_label);
    if (icon)
-     elm_button_icon_set(btn, icon);
+     elm_object_content_set(btn, icon);
    elm_object_focus_allow_set(btn, EINA_FALSE);
    evas_object_smart_callback_add(btn, "clicked", func, data);
    edje_object_part_swallow(item->base, buf, btn);
index 4d041ec..4962b2a 100644 (file)
@@ -125,7 +125,7 @@ _controlbar_move(void *data, Evas_Object * obj __UNUSED__)
    wd->x = x;
    wd->y = y;
    evas_object_move(wd->edje, x, y);
-   evas_object_geometry_get(elm_layout_content_get(wd->edje, "bg_image"), NULL, NULL, &width, NULL);
+   evas_object_geometry_get(elm_object_content_part_get(wd->edje, "bg_image"), NULL, NULL, &width, NULL);
    evas_object_geometry_get(wd->edje, &x_, &y_, NULL, NULL);
 }
 
@@ -141,7 +141,7 @@ _controlbar_resize(void *data, Evas_Object * obj __UNUSED__)
    wd->w = w;
    wd->h = h;
    evas_object_resize(wd->edje, w, h);
-   evas_object_geometry_get(elm_layout_content_get(wd->edje, "bg_image"), NULL, NULL, &width, &height);
+   evas_object_geometry_get(elm_object_content_part_get(wd->edje, "bg_image"), NULL, NULL, &width, &height);
    evas_object_geometry_get(wd->edje, &x_, &y_, NULL, NULL);
 }
 
@@ -728,7 +728,7 @@ _select_box(Elm_Controlbar_Item * it)
 
    if (it->style == TABBAR)
      {
-        content = elm_layout_content_unset(wd->edje, "elm.swallow.view");
+        content = elm_object_content_part_unset(wd->edje, "elm.swallow.view");
         if (content) evas_object_hide(content);
 
         EINA_LIST_FOREACH(wd->items, l, item){
@@ -755,7 +755,7 @@ _select_box(Elm_Controlbar_Item * it)
                evas_object_smart_callback_call(it->obj, "view,change,before", it);
           }
 
-        elm_layout_content_set(wd->edje, "elm.swallow.view", it->view);
+        elm_object_content_part_set(wd->edje, "elm.swallow.view", it->view);
      }
    else if (it->style == TOOLBAR)
      {
@@ -866,7 +866,7 @@ _create_item_icon(Evas_Object *obj, Elm_Controlbar_Item * it, char *part)
    evas_object_size_hint_max_set(icon, 100, 100);
    evas_object_show(icon);
    if (obj && part)
-     elm_button_icon_set(obj, icon);
+     elm_object_content_set(obj, icon);
 
    return icon;
 }
@@ -890,7 +890,7 @@ _create_item_layout(Evas_Object * parent, Elm_Controlbar_Item * it, Evas_Object
    *item = elm_button_add(parent);
    if (*item == NULL) return NULL;
    elm_object_style_set(*item, "controlbar/vertical");
-   elm_layout_content_set(obj, "item", *item);
+   elm_object_content_part_set(obj, "item", *item);
 
    if (it->text)
      elm_object_text_set(*item, it->text);
@@ -1019,7 +1019,7 @@ _create_object_item(Evas_Object * obj, Evas_Object * obj_item, const int sel)
    evas_object_size_hint_weight_set(it->base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(it->base, EVAS_HINT_FILL, EVAS_HINT_FILL);
    it->base_item = obj_item;
-   elm_layout_content_set(it->base, "item", it->base_item);
+   elm_object_content_part_set(it->base, "item", it->base_item);
    evas_object_show(it->base);
    return it;
 }
@@ -1131,11 +1131,11 @@ _list_clicked(void *data, Evas_Object *obj, void *event_info __UNUSED__)
 
    if (item->style == TABBAR)
      {
-        content = elm_layout_content_unset(wd->edje, "elm.swallow.view");
+        content = elm_object_content_part_unset(wd->edje, "elm.swallow.view");
         evas_object_hide(content);
         item->selected = EINA_TRUE;
         evas_object_smart_callback_call(item->obj, "view,change,before", item);
-        elm_layout_content_set(wd->edje, "elm.swallow.view", item->view);
+        elm_object_content_part_set(wd->edje, "elm.swallow.view", item->view);
      }
 
    if ((item->style == TOOLBAR) && (item->func))
@@ -1332,7 +1332,7 @@ EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
         printf("Cannot load bg edj\n");
         return NULL;
      }
-   elm_layout_content_set(wd->edje, "bg_image", wd->bg);
+   elm_object_content_part_set(wd->edje, "bg_image", wd->bg);
 
    // initialization
    evas_object_event_callback_add(wd->edje, EVAS_CALLBACK_RESIZE,
@@ -1344,7 +1344,7 @@ EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
    evas_object_event_callback_add(wd->edje, EVAS_CALLBACK_HIDE,
                                   _controlbar_object_hide, obj);
 
-   bg = elm_layout_content_get(wd->edje, "bg_image");
+   bg = elm_object_content_part_get(wd->edje, "bg_image");
    evas_object_event_callback_add(bg, EVAS_CALLBACK_MOVE, _controlbar_object_move, obj);
    evas_object_event_callback_add(bg, EVAS_CALLBACK_RESIZE, _controlbar_object_resize, obj);
 
@@ -1354,7 +1354,7 @@ EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent)
    evas_object_size_hint_weight_set(wd->box, EVAS_HINT_EXPAND,
                                     EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(wd->box, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   elm_layout_content_set(wd->edje, "elm.swallow.items", wd->box);
+   elm_object_content_part_set(wd->edje, "elm.swallow.items", wd->box);
    evas_object_show(wd->box);
 
    evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
@@ -2390,9 +2390,9 @@ elm_controlbar_item_view_unset(Elm_Controlbar_Item *it)
    if (!wd) return NULL;
    Evas_Object *content;
 
-   if (it->view == elm_layout_content_get(wd->edje, "elm.swallow.view"))
+   if (it->view == elm_object_content_part_get(wd->edje, "elm.swallow.view"))
      {
-        content = elm_layout_content_unset(wd->edje, "elm.swallow.view");
+        content = elm_object_content_part_unset(wd->edje, "elm.swallow.view");
         if (content) evas_object_hide(content);
      }
    else
@@ -2443,7 +2443,7 @@ elm_controlbar_mode_set(Evas_Object *obj, int mode)
          edje_object_signal_emit(_EDJ(wd->edje), "elm,state,small", "elm");
          break;
       case ELM_CONTROLBAR_MODE_LEFT:
-         selected_box = elm_layout_content_get(wd->edje, "elm.dragable.box");
+         selected_box = elm_object_content_part_get(wd->edje, "elm.dragable.box");
          if (selected_box) edje_object_signal_emit(_EDJ(selected_box), "elm,state,left", "elm");
          wd->selected_signal = eina_stringshare_add("elm,state,selected_left");
          wd->pressed_signal = eina_stringshare_add("elm,state,pressed_left");
@@ -2452,7 +2452,7 @@ elm_controlbar_mode_set(Evas_Object *obj, int mode)
          _sizing_eval(obj);
          return;
       case ELM_CONTROLBAR_MODE_RIGHT:
-         selected_box = elm_layout_content_get(wd->edje, "elm.dragable.box");
+         selected_box = elm_object_content_part_get(wd->edje, "elm.dragable.box");
          if (selected_box) edje_object_signal_emit(_EDJ(selected_box), "elm,state,right", "elm");
          wd->selected_signal = eina_stringshare_add("elm,state,selected_right");
          wd->pressed_signal = eina_stringshare_add("elm,state,pressed_right");
@@ -2463,7 +2463,7 @@ elm_controlbar_mode_set(Evas_Object *obj, int mode)
       default:
          break;
      }
-   selected_box = elm_layout_content_get(wd->edje, "elm.dragable.box");
+   selected_box = elm_object_content_part_get(wd->edje, "elm.dragable.box");
    if (selected_box) edje_object_signal_emit(_EDJ(selected_box), "elm,state,default", "elm");
    wd->selected_signal = eina_stringshare_add("elm,state,selected");
    wd->pressed_signal = eina_stringshare_add("elm,state,pressed");
index 536d279..13013ab 100644 (file)
@@ -635,7 +635,7 @@ _datefield_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
 
    elm_ctxpopup_direction_priority_set(wd->ctxpopup, ELM_CTXPOPUP_DIRECTION_DOWN,
                                        ELM_CTXPOPUP_DIRECTION_UP, -1, -1);
-   elm_ctxpopup_content_set(wd->ctxpopup, diskselector);
+   elm_object_content_set(wd->ctxpopup, diskselector);
    snprintf(buf,sizeof(buf), EDC_PART_ITEM_STR, wd->selected_it->location);
    edj_part = edje_object_part_object_get(wd->base, buf);
    evas_object_geometry_get(edj_part, &x, &y, &w, &h);
index b96fb93..dd00c7e 100644 (file)
@@ -176,7 +176,7 @@ _change_item_bg(Dialogue_Item *item, const char *location)
 
    eina_stringshare_replace(&item->location, location);
    _set_item_theme(item, location);
-   elm_layout_content_set(item->bg_layout, "swallow", item->content);
+   elm_object_content_part_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
@@ -217,7 +217,7 @@ _create_item(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegroup_Item_Style
    evas_object_size_hint_align_set(item->bg_layout, EVAS_HINT_FILL, 0.0);
    evas_object_show(item->bg_layout);
 
-   elm_layout_content_set(item->bg_layout, "swallow", item->content);
+   elm_object_content_part_set(item->bg_layout, "swallow", item->content);
 
    return item;
 }
index 07d8b5b..4104bb5 100644 (file)
@@ -285,7 +285,7 @@ _imageslider_obj_shift(Widget_Data * wd, Eina_Bool left)
         wd->ly[BLOCK_LEFT] = wd->ly[BLOCK_CENTER];
         wd->ly[BLOCK_CENTER] = wd->ly[BLOCK_RIGHT];
         wd->ly[BLOCK_RIGHT] = ly_temp;
-        elm_layout_content_set(wd->ly[BLOCK_RIGHT], "swl.photo", NULL);
+        elm_object_content_part_set(wd->ly[BLOCK_RIGHT], "swl.photo", NULL);
      }
    else
      {
@@ -294,7 +294,7 @@ _imageslider_obj_shift(Widget_Data * wd, Eina_Bool left)
         wd->ly[BLOCK_RIGHT] = wd->ly[BLOCK_CENTER];
         wd->ly[BLOCK_CENTER] = wd->ly[BLOCK_LEFT];
         wd->ly[BLOCK_LEFT] = ly_temp;
-        elm_layout_content_set(wd->ly[BLOCK_LEFT], "swl.photo", NULL);
+        elm_object_content_part_set(wd->ly[BLOCK_LEFT], "swl.photo", NULL);
      }
 }
 
@@ -504,14 +504,14 @@ _check_drag(int state, void *data)
 
    it = eina_list_data_get(l[state]);
 
-   eo = (Evas_Object*)elm_layout_content_get(wd->ly[state], "swl.photo");
+   eo = (Evas_Object*)elm_object_content_part_get(wd->ly[state], "swl.photo");
    if (eo)
      evas_object_geometry_get(eo, &ix, &iy, &iw, &ih);
    edje_object_part_drag_value_get(elm_layout_edje_get(wd->ly[state]), "swl.photo", &dx, &dy);
 
    if ((iw != wd->w) || ((dx != 0) || (dy != 0)))
      {
-        elm_layout_content_set(wd->ly[state], "swl.photo", NULL);
+        elm_object_content_part_set(wd->ly[state], "swl.photo", NULL);
      }
    else
      return 1;
@@ -630,10 +630,10 @@ _imageslider_update(Widget_Data * wd)
 
    for (i = 0; i < BLOCK_MAX; i++)
      {
-        eo = (Evas_Object*)elm_layout_content_get((const Evas_Object*)wd->ly[i], "swl.photo");
+        eo = (Evas_Object*)elm_object_content_part_get((const Evas_Object*)wd->ly[i], "swl.photo");
         if (!l[i])
           {
-             elm_layout_content_set(wd->ly[i], "swl.photo", NULL);
+             elm_object_content_part_set(wd->ly[i], "swl.photo", NULL);
           }
         else
           {
@@ -646,7 +646,7 @@ _imageslider_update(Widget_Data * wd)
                   eo = elm_image_add(wd->obj);
                   //elm_image_prescale_set(eo, wd->w);
                   elm_image_file_set(eo, it->photo_file, NULL);
-                  elm_layout_content_set(wd->ly[i], "swl.photo", eo);
+                  elm_object_content_part_set(wd->ly[i], "swl.photo", eo);
                }
           }
      }
@@ -934,9 +934,9 @@ elm_imageslider_item_selected_set(Elm_Imageslider_Item * it)
 
    for (i = 0; i < BLOCK_MAX; i++)
      {
-       eo = (Evas_Object*)elm_layout_content_get(wd->ly[i], "swl.photo");
+       eo = (Evas_Object*)elm_object_content_part_get(wd->ly[i], "swl.photo");
        if (eo)
-         elm_layout_content_set(wd->ly[i], "swl.photo", NULL);
+         elm_object_content_part_set(wd->ly[i], "swl.photo", NULL);
      }
    _imageslider_update(wd);
 }
@@ -1101,10 +1101,10 @@ elm_imageslider_item_update(Elm_Imageslider_Item *it)
 
    if (wd->ani_lock) return;
    if (it == eina_list_data_get(eina_list_prev(wd->cur)))
-     elm_layout_content_set(wd->ly[BLOCK_LEFT], "swl.photo", NULL);
+     elm_object_content_part_set(wd->ly[BLOCK_LEFT], "swl.photo", NULL);
    else if (it == eina_list_data_get(wd->cur))
-     elm_layout_content_set(wd->ly[BLOCK_CENTER], "swl.photo", NULL);
+     elm_object_content_part_set(wd->ly[BLOCK_CENTER], "swl.photo", NULL);
    else if (it == eina_list_data_get(eina_list_next(wd->cur)))
-     elm_layout_content_set(wd->ly[BLOCK_RIGHT], "swl.photo", NULL);
+     elm_object_content_part_set(wd->ly[BLOCK_RIGHT], "swl.photo", NULL);
    _imageslider_update(wd);
 }
index 972385d..47f5054 100644 (file)
@@ -103,9 +103,9 @@ _theme_hook(Evas_Object *obj)
              elm_object_style_set(action_data->btn, buf);
              ++index;
              snprintf(buf, sizeof(buf), "actionbtn%d", index);
-             elm_layout_content_set(wd->action_area, buf, action_data->btn);
+             elm_object_content_part_set(wd->action_area, buf, action_data->btn);
           }
-        elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
+        elm_object_content_part_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
      }
    if (wd->content_area)
      {
@@ -114,13 +114,13 @@ _theme_hook(Evas_Object *obj)
           {
              snprintf(buf, sizeof(buf), "popup_description/%s", elm_widget_style_get(obj));
              elm_object_style_set(wd->desc_label, buf);
-             elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->desc_label);
+             elm_object_content_part_set(wd->content_area, "elm.swallow.content", wd->desc_label);
           }
         else if (wd->content)
           {
-             elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->content);
+             elm_object_content_part_set(wd->content_area, "elm.swallow.content", wd->content);
           }
-        elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area);
+        elm_object_content_part_set(wd->layout, "elm.swallow.content", wd->content_area);
      }
    if (wd->title_area)
      {
@@ -231,7 +231,7 @@ _elm_popup_buttons_add_valist(Evas_Object *obj, const char *first_button_text, v
         btn = _elm_popup_add_button(obj, text, response);
         ++index;
         snprintf(buf, sizeof(buf), "actionbtn%d", index);
-        elm_layout_content_set(wd->action_area, buf, btn);
+        elm_object_content_part_set(wd->action_area, buf, btn);
         evas_object_event_callback_add(wd->action_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                        _changed_size_hints, obj);
         text = va_arg(args, char*);
@@ -327,7 +327,7 @@ elm_popup_add(Evas_Object *parent)
    evas_object_size_hint_align_set(wd->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
    elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));
-   elm_notify_content_set(wd->notify, wd->layout);
+   elm_object_content_set(wd->notify, wd->layout);
 
    edje_object_signal_callback_add(elm_layout_edje_get(wd->layout), "elm,state,title,visible", "elm", _state_set_cb, obj);
    edje_object_signal_callback_add(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm", _state_set_cb, obj);
@@ -384,7 +384,7 @@ elm_popup_with_buttons_add(Evas_Object *parent, const char *title, const char *d
         va_list args;
         va_start(args, first_button_text);
         wd->action_area = elm_layout_add(popup);
-        elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
+        elm_object_content_part_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
         snprintf(buf,sizeof(buf), "buttons%d", no_of_buttons);
                                 wd->no_of_buttons = no_of_buttons;
         elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(popup));
@@ -433,8 +433,8 @@ elm_popup_desc_set(Evas_Object *obj, const char *text)
    evas_object_size_hint_weight_set(wd->desc_label, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(wd->desc_label, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_show(wd->desc_label);
-   elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->desc_label);
-   elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area);
+   elm_object_content_part_set(wd->content_area, "elm.swallow.content", wd->desc_label);
+   elm_object_content_part_set(wd->layout, "elm.swallow.content", wd->content_area);
    evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                   _changed_size_hints, obj);
    _sizing_eval(obj);
@@ -523,7 +523,7 @@ elm_popup_title_icon_set(Evas_Object *obj, Evas_Object *icon)
         wd->title_icon = NULL;
      }
    wd->title_icon = icon;
-   elm_layout_content_set(wd->layout, "elm.swallow.title.icon", wd->title_icon);
+   elm_object_content_part_set(wd->layout, "elm.swallow.title.icon", wd->title_icon);
    edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm");
    edje_object_message_signal_process(wd->layout);
    _sizing_eval(obj);
@@ -573,8 +573,8 @@ elm_popup_content_set(Evas_Object *obj, Evas_Object *content)
      {
         wd->content_area = elm_layout_add(obj);
         elm_layout_theme_set(wd->content_area, "popup","content", elm_widget_style_get(obj));
-        elm_layout_content_set(wd->content_area, "elm.swallow.content", content);
-        elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area);
+        elm_object_content_part_set(wd->content_area, "elm.swallow.content", content);
+        elm_object_content_part_set(wd->layout, "elm.swallow.content", wd->content_area);
         evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                        _changed_size_hints, obj);
      }
@@ -624,7 +624,7 @@ elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, const char *first_butt
         wd->action_area = NULL;
      }
    wd->action_area = elm_layout_add(obj);
-   elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
+   elm_object_content_part_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
    evas_object_size_hint_weight_set(wd->action_area, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(wd->action_area, EVAS_HINT_FILL, EVAS_HINT_FILL);
    snprintf(buf, sizeof(buf), "buttons%d", no_of_buttons);