From aa46564ca172300d61f60bb6d13f5185e3aadeed Mon Sep 17 00:00:00 2001 From: seoz Date: Wed, 4 Jan 2012 01:28:33 +0000 Subject: [PATCH] elm list: Applied recent list changes. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66823 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/config.c | 32 ++++++++++++++++---------------- src/bin/test_index.c | 12 ++++++------ src/bin/test_list.c | 8 ++++---- src/examples/index_example_01.c | 4 ++-- src/examples/list_example_03.c | 6 +++--- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/bin/config.c b/src/bin/config.c index cf13260..9e1f971 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -763,7 +763,7 @@ _font_overlay_set_all(void *data, fclasses = evas_object_data_get(win, "font_classes_list"); it = elm_list_selected_item_get(fclasses); if (!it) return; - tc_data = elm_list_item_data_get(it); + tc_data = elm_object_item_data_get(it); fnames = evas_object_data_get(win, "font_names_list"); fstyles = evas_object_data_get(win, "font_styles_list"); @@ -793,7 +793,7 @@ _font_overlay_reset(void *data, fclasses = evas_object_data_get(win, "font_classes_list"); it = elm_list_selected_item_get(fclasses); if (!it) return; - tc_data = elm_list_item_data_get(it); + tc_data = elm_object_item_data_get(it); fnames = evas_object_data_get(win, "font_names_list"); fstyles = evas_object_data_get(win, "font_styles_list"); @@ -993,7 +993,7 @@ _config_display_update(Evas_Object *win) l_items = elm_list_items_get(evas_object_data_get(win, "engines_list")); EINA_LIST_FOREACH(l_items, l, it) { - if (!strcmp(elm_list_item_data_get(it), curr_engine)) + if (!strcmp(elm_object_item_data_get(it), curr_engine)) { elm_list_item_selected_set(it, EINA_TRUE); break; @@ -1028,7 +1028,7 @@ _engine_use(void *data, const char *selection; li = data; - selection = elm_list_item_data_get(elm_list_selected_item_get(li)); + selection = elm_object_item_data_get(elm_list_selected_item_get(li)); if (!strcmp(elm_engine_current_get(), selection)) return; @@ -1047,7 +1047,7 @@ _profile_use(void *data, const char *profile; li = data; - selection = elm_list_item_data_get(elm_list_selected_item_get(li)); + selection = elm_object_item_data_get(elm_list_selected_item_get(li)); profile = elm_profile_current_get(); if (!profile) @@ -1083,7 +1083,7 @@ _profile_reset(void *data, Evas_Object *li; li = data; - selection = elm_list_item_data_get(elm_list_selected_item_get(li)); + selection = elm_object_item_data_get(elm_list_selected_item_get(li)); curr = elm_profile_current_get(); elm_config_save(); /* dump config into old profile's data dir */ @@ -1144,7 +1144,7 @@ _theme_sel(void *data __UNUSED__, } EINA_LIST_REVERSE_FOREACH((Eina_List*)tsel, l, it) { - Theme *t = elm_list_item_data_get(it); + Theme *t = elm_object_item_data_get(it); eina_strbuf_append_printf(newth, "%s:", t->name); if ((!l->prev) && strcmp(t->name, "default")) /* ensure default theme is always there for fallback */ @@ -1517,7 +1517,7 @@ _font_classes_list_sel(void *data __UNUSED__, Evas_Object *f_names_list; Elm_List_Item *it; - tc_data = elm_list_item_data_get(event_info); + tc_data = elm_object_item_data_get(event_info); f_names_list = evas_object_data_get(elm_object_top_widget_get(obj), "font_names_list"); @@ -1529,7 +1529,7 @@ _font_classes_list_sel(void *data __UNUSED__, { const char *l; - l = elm_list_item_label_get(it); + l = elm_object_item_text_get(it); if (tc_data->font && !strcmp(l, tc_data->font)) { @@ -1553,7 +1553,7 @@ _font_names_list_sel(void *data __UNUSED__, const Eina_List *l; it = event_info; - sel_font = elm_list_item_label_get(it); + sel_font = elm_object_item_text_get(it); win = elm_object_top_widget_get(obj); style_list = evas_object_data_get(win, "font_styles_list"); @@ -1566,7 +1566,7 @@ _font_names_list_sel(void *data __UNUSED__, eina_stringshare_replace(&fdata.cur_font, sel_font); - tc_data = elm_list_item_data_get(fc_it); + tc_data = elm_object_item_data_get(fc_it); if (tc_data->font) eina_stringshare_del(tc_data->font); if (fdata.cur_font) tc_data->font = eina_stringshare_ref(fdata.cur_font); @@ -1621,10 +1621,10 @@ _font_styles_list_sel(void *data __UNUSED__, if (!it) return; /* should not happen */ eina_stringshare_replace(&fdata.cur_style, - elm_list_item_label_get(event_info)); + elm_object_item_text_get(event_info)); ELM_LIST_ENABLE(fs_list); - tc_data = elm_list_item_data_get(it); + tc_data = elm_object_item_data_get(it); eina_stringshare_del(tc_data->style); tc_data->style = eina_stringshare_ref(fdata.cur_style); @@ -1635,7 +1635,7 @@ _font_styles_list_sel(void *data __UNUSED__, { Elm_Font_Size_Data *sdata; - sdata = elm_list_item_data_get(it); + sdata = elm_object_item_data_get(it); elm_list_item_selected_set(l->data, EINA_FALSE); if (tc_data->size == sdata->size) @@ -1668,10 +1668,10 @@ _font_sizes_list_sel(void *data __UNUSED__, it = elm_list_selected_item_get(fc_list); if (!it) return; /* should not happen */ - sd = elm_list_item_data_get(event_info); + sd = elm_object_item_data_get(event_info); fdata.cur_size = sd->size; - tc_data = elm_list_item_data_get(it); + tc_data = elm_object_item_data_get(it); tc_data->size = fdata.cur_size; _font_preview_update(win); diff --git a/src/bin/test_index.c b/src/bin/test_index.c index 1b5bbee..8ffdebe 100644 --- a/src/bin/test_index.c +++ b/src/bin/test_index.c @@ -113,11 +113,11 @@ int test_index2_cmp(const void *data1, const void *data2) { const char *label1, *label2; - const Elm_List_Item *it1 = data1; - const Elm_List_Item *it2 = data2; + const Elm_Object_Item *li_it1 = data1; + const Elm_Object_Item *li_it2 = data2; - label1 = elm_list_item_label_get(it1); - label2 = elm_list_item_label_get(it2); + label1 = elm_object_item_text_get(li_it1); + label2 = elm_object_item_text_get(li_it2); return strcasecmp(label1, label2); } @@ -173,8 +173,8 @@ test_index2_it_del(void *data, Evas_Object *obj, void *event_info __UNUSED__) return; } - label = elm_list_item_label_get(it); - label_next = elm_list_item_label_get(it_next); + label = elm_object_item_text_get(it); + label_next = elm_object_item_text_get(it_next); iit = elm_index_item_find(gui->id, it); if (label[0] == label_next[0]) diff --git a/src/bin/test_list.c b/src/bin/test_list.c index 2399df3..a12ad9a 100644 --- a/src/bin/test_list.c +++ b/src/bin/test_list.c @@ -601,7 +601,7 @@ test_list4_swipe(void *data, char *item_data; if ((!event_info) || (!data)) return; - item_data = elm_list_item_data_get(event_info); + item_data = elm_object_item_data_get(event_info); box = elm_box_add(info->win); elm_box_horizontal_set(box, EINA_FALSE); @@ -750,16 +750,16 @@ test_list5_swipe(void *data __UNUSED__, void *event_info) { Evas_Object *button; - struct list5_data_cb *info = elm_list_item_data_get(event_info); + struct list5_data_cb *info = elm_object_item_data_get(event_info); - if (elm_list_item_end_get(event_info)) return; + if (elm_object_item_part_content_get(event_info, "end")) return; button = elm_button_add(info->win); elm_object_text_set(button, "delete"); evas_object_propagate_events_set(button, 0); evas_object_smart_callback_add(button, "clicked", test_list5_item_del, event_info); - elm_list_item_end_set(event_info, button); + elm_object_item_part_content_set(event_info, "end", button); } void diff --git a/src/examples/index_example_01.c b/src/examples/index_example_01.c index f6f5d0a..13f6a38 100644 --- a/src/examples/index_example_01.c +++ b/src/examples/index_example_01.c @@ -36,7 +36,7 @@ _index_item_del(void *data, fprintf(stdout, "Deleting associated list node (%s). Comparing index " "item data reported via callback with the one returned by " "index's API on items: %s.\n", - elm_list_item_label_get(data), + elm_object_item_text_get(data), data == elm_index_item_data_get(event_info) ? "OK" : "FAIL, something went wrong"); @@ -58,7 +58,7 @@ _item_del(void *data __UNUSED__, fprintf(stdout, "Deleting last selected index item, which had letter" " %s (pointing to %s)\n", elm_index_item_letter_get(iit), - elm_list_item_label_get(lit)); + elm_object_item_text_get(lit)); elm_index_item_del(d.index, lit); } diff --git a/src/examples/list_example_03.c b/src/examples/list_example_03.c index f4bfce7..a284ad1 100644 --- a/src/examples/list_example_03.c +++ b/src/examples/list_example_03.c @@ -73,7 +73,7 @@ static void _sel_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Elm_List_Item *it = event_info; - printf("Selected label: %s\n", elm_list_item_label_get(it)); + printf("Selected label: %s\n", elm_object_item_text_get(it)); } static void @@ -95,7 +95,7 @@ _sel_data_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info) char *content = data; Elm_List_Item *it = event_info; printf("Selected label: %s with data: %s\n", - elm_list_item_label_get(it), content); + elm_object_item_text_get(it), content); } static void @@ -151,7 +151,7 @@ _print_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) items = elm_list_items_get(li); EINA_LIST_FOREACH(items, l, it) - printf("%s\n", elm_list_item_label_get(it)); + printf("%s\n", elm_object_item_text_get(it)); } static void -- 2.7.4