From: hermet Date: Thu, 12 Jan 2012 03:03:56 +0000 (+0000) Subject: Elementary/list - Elm_List_Item -> Elm_Object_Item X-Git-Tag: REL_F_I9500_20120323_1~17^2~882 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0cb9f5757e78f17660917968355ac794b3e3ea9b;p=framework%2Fuifw%2Felementary.git Elementary/list - Elm_List_Item -> Elm_Object_Item git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@67110 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/doc/examples.dox b/doc/examples.dox index 94f2e59..753ace9 100644 --- a/doc/examples.dox +++ b/doc/examples.dox @@ -2372,7 +2372,7 @@ * * This code places a Elementary list widgets on a window, * along with some buttons trigerring actions on it (though its API). - * It covers most of Elm_List_Item functions. + * It covers most of elm_list_item functions. * * On our @c main function, we are adding a default list with * 3 items. We are only setting their labels (second parameter of function diff --git a/doc/widgets/widget_preview_index.c b/doc/widgets/widget_preview_index.c index 77e97c0..bf910ed 100644 --- a/doc/widgets/widget_preview_index.c +++ b/doc/widgets/widget_preview_index.c @@ -29,11 +29,11 @@ unsigned int i; for (i = 0; i < (sizeof(dict) / sizeof(dict[0])); i++) { char buf[32]; - Elm_List_Item *it; + Elm_Object_Item *list_it; - it = elm_list_item_append(o, dict[i], NULL, NULL, NULL, NULL); + list_it = elm_list_item_append(o, dict[i], NULL, NULL, NULL, NULL); snprintf(buf, sizeof(buf), "%c", dict[i][0]); - elm_index_item_append(id, buf, it); + elm_index_item_append(id, buf, list_it); } elm_index_active_set(id, EINA_TRUE); diff --git a/src/bin/config.c b/src/bin/config.c index 9e1f971..8c16ee3 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -755,15 +755,15 @@ _font_overlay_set_all(void *data, { Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes; Elm_Text_Class_Data *tc_data, *tc; - Elm_List_Item *it; + Elm_Object_Item *list_it; Eina_List *l; win = data; fclasses = evas_object_data_get(win, "font_classes_list"); - it = elm_list_selected_item_get(fclasses); - if (!it) return; - tc_data = elm_object_item_data_get(it); + list_it = elm_list_selected_item_get(fclasses); + if (!list_it) return; + tc_data = elm_object_item_data_get(list_it); fnames = evas_object_data_get(win, "font_names_list"); fstyles = evas_object_data_get(win, "font_styles_list"); @@ -786,14 +786,14 @@ _font_overlay_reset(void *data, { Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes; Elm_Text_Class_Data *tc_data; - Elm_List_Item *it; + Elm_Object_Item *list_it; win = data; fclasses = evas_object_data_get(win, "font_classes_list"); - it = elm_list_selected_item_get(fclasses); - if (!it) return; - tc_data = elm_object_item_data_get(it); + list_it = elm_list_selected_item_get(fclasses); + if (!list_it) return; + tc_data = elm_object_item_data_get(list_it); fnames = evas_object_data_get(win, "font_names_list"); fstyles = evas_object_data_get(win, "font_styles_list"); @@ -822,7 +822,7 @@ _font_overlay_reset_all(void *data, { Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes; Elm_Text_Class_Data *tc_data; - Elm_List_Item *it; + Elm_Object_Item *list_it; Eina_List *l; win = data; @@ -844,8 +844,8 @@ _font_overlay_reset_all(void *data, fstyles = evas_object_data_get(win, "font_styles_list"); fsizes = evas_object_data_get(win, "font_sizes_list"); - it = elm_list_selected_item_get(fclasses); - if (it) elm_list_item_selected_set(it, EINA_FALSE); + list_it = elm_list_selected_item_get(fclasses); + if (list_it) elm_list_item_selected_set(list_it, EINA_FALSE); ELM_LIST_DISABLE(fnames); ELM_LIST_DISABLE(fstyles); @@ -893,7 +893,7 @@ _config_display_update(Evas_Object *win) const char *curr_theme, *curr_engine; const Eina_List *l_items, *l; Eina_Bool s_bounce, ts; - Elm_List_Item *it; + Elm_Object_Item *list_it; Elm_Theme *th; int fs; @@ -991,11 +991,11 @@ _config_display_update(Evas_Object *win) curr_engine = elm_engine_current_get(); l_items = elm_list_items_get(evas_object_data_get(win, "engines_list")); - EINA_LIST_FOREACH(l_items, l, it) + EINA_LIST_FOREACH(l_items, l, list_it) { - if (!strcmp(elm_object_item_data_get(it), curr_engine)) + if (!strcmp(elm_object_item_data_get(list_it), curr_engine)) { - elm_list_item_selected_set(it, EINA_TRUE); + elm_list_item_selected_set(list_it, EINA_TRUE); break; } } @@ -1125,7 +1125,7 @@ _theme_sel(void *data __UNUSED__, Evas_Object *win = elm_object_top_widget_get(obj); Evas_Object *sample = evas_object_data_get(win, "theme_preview"); Elm_Theme *th, *sth; - Elm_List_Item *it; + Elm_Object_Item *list_it; const char *defth; Eina_Strbuf *newth; Eina_List *l; @@ -1142,9 +1142,9 @@ _theme_sel(void *data __UNUSED__, eina_strbuf_free(newth); return; } - EINA_LIST_REVERSE_FOREACH((Eina_List*)tsel, l, it) + EINA_LIST_REVERSE_FOREACH((Eina_List*)tsel, l, list_it) { - Theme *t = elm_object_item_data_get(it); + Theme *t = elm_object_item_data_get(list_it); eina_strbuf_append_printf(newth, "%s:", t->name); if ((!l->prev) && strcmp(t->name, "default")) /* ensure default theme is always there for fallback */ @@ -1312,7 +1312,7 @@ _status_config_themes(Evas_Object *win, Eina_List *list, *l; char *th, *s, *ext; Elm_Theme *d; - Elm_List_Item *it, *def_it = NULL; + Elm_Object_Item *list_it, *def_it = NULL; const char *theme_name, *sep[20]; unsigned int x; @@ -1394,16 +1394,16 @@ _status_config_themes(Evas_Object *win, t->label = eina_stringshare_add(s); } themes = eina_list_append(themes, t); - it = elm_list_item_append(li, t->label, NULL, NULL, NULL, t); - if (!strcmp(t->name, "default")) def_it = it; + list_it = elm_list_item_append(li, t->label, NULL, NULL, NULL, t); + if (!strcmp(t->name, "default")) def_it = list_it; for (y = x - 1 /* ignore default e theme */; y > 0; y--) { const char *start = (sep[y - 1][0] == ':') ? sep[y - 1] + 1 : sep[y - 1]; unsigned int len = (unsigned int)(sep[y] - start); if (strncmp(start , t->name, len) || (strlen(t->name) != len)) continue; - if (!elm_list_item_selected_get(it)) - elm_list_item_selected_set(it, EINA_TRUE); + if (!elm_list_item_selected_get(list_it)) + elm_list_item_selected_set(list_it, EINA_TRUE); break; } } @@ -1515,7 +1515,7 @@ _font_classes_list_sel(void *data __UNUSED__, const Eina_List *f_names_items, *l; Elm_Text_Class_Data *tc_data; Evas_Object *f_names_list; - Elm_List_Item *it; + Elm_Object_Item *list_it; tc_data = elm_object_item_data_get(event_info); @@ -1525,16 +1525,16 @@ _font_classes_list_sel(void *data __UNUSED__, f_names_items = elm_list_items_get(f_names_list); - EINA_LIST_FOREACH(f_names_items, l, it) + EINA_LIST_FOREACH(f_names_items, l, list_it) { const char *l; - l = elm_object_item_text_get(it); + l = elm_object_item_text_get(list_it); if (tc_data->font && !strcmp(l, tc_data->font)) { - elm_list_item_selected_set(it, EINA_TRUE); - elm_list_item_show(it); + elm_list_item_selected_set(list_it, EINA_TRUE); + elm_list_item_show(list_it); break; } } @@ -1548,25 +1548,25 @@ _font_names_list_sel(void *data __UNUSED__, Evas_Object *style_list, *cls_list, *sizes_list, *win; const char *style, *sel_font; Elm_Text_Class_Data *tc_data; - Elm_List_Item *it, *fc_it; + Elm_Object_Item *list_it, *fc_list_it; Elm_Font_Properties *efp; const Eina_List *l; - it = event_info; - sel_font = elm_object_item_text_get(it); + list_it = event_info; + sel_font = elm_object_item_text_get(list_it); win = elm_object_top_widget_get(obj); style_list = evas_object_data_get(win, "font_styles_list"); cls_list = evas_object_data_get(win, "font_classes_list"); sizes_list = evas_object_data_get(win, "font_sizes_list"); - fc_it = elm_list_selected_item_get(cls_list); - if (!fc_it) return; /* should not happen, fonts list disabled in + fc_list_it = elm_list_selected_item_get(cls_list); + if (!fc_list_it) return; /* should not happen, fonts list disabled in * this case */ eina_stringshare_replace(&fdata.cur_font, sel_font); - tc_data = elm_object_item_data_get(fc_it); + tc_data = elm_object_item_data_get(fc_list_it); if (tc_data->font) eina_stringshare_del(tc_data->font); if (fdata.cur_font) tc_data->font = eina_stringshare_ref(fdata.cur_font); @@ -1579,17 +1579,17 @@ _font_names_list_sel(void *data __UNUSED__, evas_event_freeze(evas_object_evas_get(style_list)); edje_freeze(); - it = NULL; + list_it = NULL; EINA_LIST_FOREACH(efp->styles, l, style) { - Elm_List_Item *i; + Elm_Object_Item *i; i = elm_list_item_append(style_list, style, NULL, NULL, _font_styles_list_sel, NULL); if (tc_data->style && (!strcmp(style, tc_data->style))) - it = i; + list_it = i; } elm_list_go(style_list); @@ -1597,8 +1597,8 @@ _font_names_list_sel(void *data __UNUSED__, edje_thaw(); evas_event_thaw(evas_object_evas_get(style_list)); - if (it) - elm_list_item_selected_set(it, EINA_TRUE); + if (list_it) + elm_list_item_selected_set(list_it, EINA_TRUE); _font_preview_update(win); } @@ -1611,37 +1611,37 @@ _font_styles_list_sel(void *data __UNUSED__, Evas_Object *fc_list, *fs_list, *win; Elm_Text_Class_Data *tc_data; const Eina_List *l; - Elm_List_Item *it; + Elm_Object_Item *list_it; win = elm_object_top_widget_get(obj); fc_list = evas_object_data_get(win, "font_classes_list"); fs_list = evas_object_data_get(win, "font_sizes_list"); - it = elm_list_selected_item_get(fc_list); - if (!it) return; /* should not happen */ + list_it = elm_list_selected_item_get(fc_list); + if (!list_it) return; /* should not happen */ eina_stringshare_replace(&fdata.cur_style, elm_object_item_text_get(event_info)); ELM_LIST_ENABLE(fs_list); - tc_data = elm_object_item_data_get(it); + tc_data = elm_object_item_data_get(list_it); eina_stringshare_del(tc_data->style); tc_data->style = eina_stringshare_ref(fdata.cur_style); evas_event_freeze(evas_object_evas_get(fs_list)); edje_freeze(); - EINA_LIST_FOREACH(elm_list_items_get(fs_list), l, it) + EINA_LIST_FOREACH(elm_list_items_get(fs_list), l, list_it) { Elm_Font_Size_Data *sdata; - sdata = elm_object_item_data_get(it); + sdata = elm_object_item_data_get(list_it); elm_list_item_selected_set(l->data, EINA_FALSE); if (tc_data->size == sdata->size) { - elm_list_item_selected_set(it, EINA_TRUE); - elm_list_item_show(it); + elm_list_item_selected_set(list_it, EINA_TRUE); + elm_list_item_show(list_it); break; } } @@ -1660,18 +1660,18 @@ _font_sizes_list_sel(void *data __UNUSED__, Elm_Text_Class_Data *tc_data; Evas_Object *fc_list, *win; Elm_Font_Size_Data *sd; - Elm_List_Item *it; + Elm_Object_Item *list_it; win = elm_object_top_widget_get(obj); fc_list = evas_object_data_get(win, "font_classes_list"); - it = elm_list_selected_item_get(fc_list); - if (!it) return; /* should not happen */ + list_it = elm_list_selected_item_get(fc_list); + if (!list_it) return; /* should not happen */ sd = elm_object_item_data_get(event_info); fdata.cur_size = sd->size; - tc_data = elm_object_item_data_get(it); + tc_data = elm_object_item_data_get(list_it); tc_data->size = fdata.cur_size; _font_preview_update(win); @@ -2215,7 +2215,7 @@ _profiles_list_fill(Evas_Object *l_widget, #endif const char *label, *ext, *pdir; char buf[PATH_MAX]; - Elm_List_Item *it; + Elm_Object_Item *list_it; Evas_Object *ic; pdir = elm_profile_dir_get(profile, EINA_TRUE); @@ -2255,11 +2255,12 @@ _profiles_list_fill(Evas_Object *l_widget, 1, 1); evas_object_show(ic); - it = elm_list_item_append(l_widget, label, ic, NULL, - _profiles_list_selected_cb, strdup(profile)); - elm_list_item_del_cb_set(it, _profiles_list_item_del_cb); + list_it = elm_list_item_append(l_widget, label, ic, NULL, + _profiles_list_selected_cb, + strdup(profile)); + elm_object_item_del_cb_set(list_it, _profiles_list_item_del_cb); if (cur_profile && !strcmp(profile, cur_profile)) - sel_it = it; + sel_it = list_it; elm_profile_dir_free(pdir); @@ -2745,20 +2746,20 @@ _engines_list_fill(Evas_Object *l_widget, EINA_LIST_FOREACH(e_names, l, engine) { const char *label; - Elm_List_Item *it; + Elm_Object_Item *list_it; if (!_elm_engine_supported(engine)) continue; label = _engine_name_prettify(engine); - it = elm_list_item_append(l_widget, label, NULL, NULL, NULL, + list_it = elm_list_item_append(l_widget, label, NULL, NULL, NULL, strdup(engine)); - elm_list_item_del_cb_set(it, _engines_list_item_del_cb); + elm_object_item_del_cb_set(list_it, _engines_list_item_del_cb); free((void *)label); if (!strcmp(cur_engine, engine)) - sel_it = it; + sel_it = list_it; } if (sel_it) elm_list_item_selected_set(sel_it, EINA_TRUE); diff --git a/src/bin/test_cursor.c b/src/bin/test_cursor.c index b3b9102..3b3768d 100644 --- a/src/bin/test_cursor.c +++ b/src/bin/test_cursor.c @@ -97,7 +97,7 @@ void test_cursor(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *win, *bg, *bx, *bt, *list, *entry, *ck; - Elm_List_Item *lit; + Elm_Object_Item *lit; win = elm_win_add(NULL, "cursor", ELM_WIN_BASIC); elm_win_title_set(win, "Cursor"); @@ -166,7 +166,7 @@ test_cursor2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf Evas_Object *win, *bg, *bx, *o, *grid, *gl; Elm_Genlist_Item *it1, *it2, *it3; Elm_Object_Item *tb_it; - Elm_List_Item *lit; + Elm_Object_Item *lit; char buf[PATH_MAX]; static Testitem ti[144]; int i, n; @@ -288,7 +288,7 @@ void test_cursor3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *win, *bg, *bx, *o; - Elm_List_Item *lit; + Elm_Object_Item *lit; char buf[PATH_MAX]; win = elm_win_add(NULL, "cursor3", ELM_WIN_BASIC); diff --git a/src/bin/test_index.c b/src/bin/test_index.c index 118c7af..882ea4c 100644 --- a/src/bin/test_index.c +++ b/src/bin/test_index.c @@ -139,19 +139,19 @@ void test_index2_it_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Test_Index2_Elements *gui = data; - Elm_List_Item *it; + Elm_Object_Item *list_it; const char *label; char letter[2]; label = elm_object_text_get(gui->entry); snprintf(letter, sizeof(letter), "%c", label[0]); - it = elm_list_item_sorted_insert(gui->lst, label, NULL, NULL, NULL, NULL, - test_index2_cmp); - elm_index_item_sorted_insert(gui->id, letter, it, test_index2_icmp, + list_it = elm_list_item_sorted_insert(gui->lst, label, NULL, NULL, NULL, + NULL, test_index2_cmp); + elm_index_item_sorted_insert(gui->id, letter, list_it, test_index2_icmp, test_index2_cmp); elm_list_go(gui->lst); /* FIXME it's not showing the recently added item */ - elm_list_item_show(it); + elm_list_item_show(list_it); } void @@ -159,30 +159,30 @@ test_index2_it_del(void *data, Evas_Object *obj, void *event_info __UNUSED__) { Test_Index2_Elements *gui = data; const char *label, *label_next; - Elm_List_Item *it, *it_next; + Elm_Object_Item *list_it, *list_it_next; Elm_Object_Item *iit; - it = elm_list_selected_item_get(obj); - it_next = elm_list_item_next(it); + list_it = elm_list_selected_item_get(obj); + list_it_next = elm_list_item_next(list_it); - if (!it_next) + if (!list_it_next) { - iit = elm_index_item_find(gui->id, it); + iit = elm_index_item_find(gui->id, list_it); if (iit) elm_object_item_del(iit); - elm_list_item_del(it); + elm_list_item_del(list_it); return; } - label = elm_object_item_text_get((Elm_Object_Item *)it); - label_next = elm_object_item_text_get((Elm_Object_Item *)it_next); + label = elm_object_item_text_get(list_it); + label_next = elm_object_item_text_get(list_it_next); - iit = elm_index_item_find(gui->id, it); + iit = elm_index_item_find(gui->id, list_it); if (label[0] == label_next[0]) - elm_object_item_data_set(iit, it_next); + elm_object_item_data_set(iit, list_it_next); else elm_object_item_del(iit); - elm_list_item_del(it); + elm_list_item_del(list_it); } void diff --git a/src/bin/test_list.c b/src/bin/test_list.c index a12ad9a..5a7b757 100644 --- a/src/bin/test_list.c +++ b/src/bin/test_list.c @@ -50,7 +50,7 @@ test_list(void *data __UNUSED__, { Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *tb2, *bt; char buf[PATH_MAX]; - Elm_List_Item *it1, *it2, *it3, *it4, *it5; + Elm_Object_Item *list_it1, *list_it2, *list_it3, *list_it4, *list_it5; win = elm_win_add(NULL, "list", ELM_WIN_BASIC); elm_win_title_set(win, "List"); @@ -70,7 +70,7 @@ test_list(void *data __UNUSED__, snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); elm_icon_file_set(ic, buf, NULL); elm_icon_scale_set(ic, 1, 1); - it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL); + list_it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL); ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); elm_icon_scale_set(ic, 0, 0); @@ -87,7 +87,7 @@ test_list(void *data __UNUSED__, ic2 = elm_icon_add(win); elm_icon_standard_set(ic2, "clock"); elm_icon_scale_set(ic2, 0, 0); - it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL); + list_it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL); bx = elm_box_add(win); elm_box_horizontal_set(bx, EINA_TRUE); @@ -118,18 +118,18 @@ test_list(void *data __UNUSED__, elm_list_item_append(li, "are", bx, NULL, NULL, NULL); elm_list_item_append(li, "you", NULL, NULL, NULL, NULL); - it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL); + list_it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL); elm_list_item_append(li, "out", NULL, NULL, NULL, NULL); elm_list_item_append(li, "there", NULL, NULL, NULL, NULL); elm_list_item_append(li, "today", NULL, NULL, NULL, NULL); elm_list_item_append(li, "?", NULL, NULL, NULL, NULL); - it4 = elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL); + list_it4 = elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL); elm_list_item_append(li, "are", NULL, NULL, NULL, NULL); elm_list_item_append(li, "some", NULL, NULL, NULL, NULL); elm_list_item_append(li, "more", NULL, NULL, NULL, NULL); elm_list_item_append(li, "items", NULL, NULL, NULL, NULL); elm_list_item_append(li, "Is this label long enough?", NULL, NULL, NULL, NULL); - it5 = elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL); + list_it5 = elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL); elm_list_go(li); @@ -141,7 +141,7 @@ test_list(void *data __UNUSED__, bt = elm_button_add(win); elm_object_text_set(bt, "Hello"); - evas_object_smart_callback_add(bt, "clicked", my_show_it, it1); + evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it1); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, 0.9, 0.5); elm_table_pack(tb2, bt, 0, 0, 1, 1); @@ -149,7 +149,7 @@ test_list(void *data __UNUSED__, bt = elm_button_add(win); elm_object_text_set(bt, "How"); - evas_object_smart_callback_add(bt, "clicked", my_show_it, it2); + evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it2); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, 0.9, 0.5); elm_table_pack(tb2, bt, 0, 1, 1, 1); @@ -157,7 +157,7 @@ test_list(void *data __UNUSED__, bt = elm_button_add(win); elm_object_text_set(bt, "doing"); - evas_object_smart_callback_add(bt, "clicked", my_show_it, it3); + evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it3); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, 0.9, 0.5); elm_table_pack(tb2, bt, 0, 2, 1, 1); @@ -165,7 +165,7 @@ test_list(void *data __UNUSED__, bt = elm_button_add(win); elm_object_text_set(bt, "Here"); - evas_object_smart_callback_add(bt, "clicked", my_show_it, it4); + evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it4); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, 0.9, 0.5); elm_table_pack(tb2, bt, 0, 3, 1, 1); @@ -173,7 +173,7 @@ test_list(void *data __UNUSED__, bt = elm_button_add(win); elm_object_text_set(bt, "Maybe this..."); - evas_object_smart_callback_add(bt, "clicked", my_show_it, it5); + evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it5); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, 0.9, 0.5); elm_table_pack(tb2, bt, 0, 4, 1, 1); @@ -197,7 +197,7 @@ test_list_horizontal(void *data __UNUSED__, { Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *tb2, *bt; char buf[PATH_MAX]; - Elm_List_Item *it1, *it2, *it3, *it4; + Elm_Object_Item *list_it1, *list_it2, *list_it3, *list_it4; win = elm_win_add(NULL, "list-horizontal", ELM_WIN_BASIC); elm_win_title_set(win, "List Horizontal"); @@ -218,7 +218,7 @@ test_list_horizontal(void *data __UNUSED__, snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); elm_icon_file_set(ic, buf, NULL); elm_icon_scale_set(ic, 1, 1); - it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL); + list_it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL); ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); elm_icon_scale_set(ic, 0, 0); @@ -235,7 +235,7 @@ test_list_horizontal(void *data __UNUSED__, ic2 = elm_icon_add(win); elm_icon_standard_set(ic2, "clock"); elm_icon_scale_set(ic2, 0, 0); - it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL); + list_it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL); bx = elm_box_add(win); @@ -258,13 +258,13 @@ test_list_horizontal(void *data __UNUSED__, elm_list_item_append(li, "are", bx, NULL, NULL, NULL); elm_list_item_append(li, "you", NULL, NULL, NULL, NULL); - it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL); + list_it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL); elm_list_item_append(li, "out", NULL, NULL, NULL, NULL); elm_list_item_append(li, "there", NULL, NULL, NULL, NULL); elm_list_item_append(li, "today", NULL, NULL, NULL, NULL); elm_list_item_append(li, "?", NULL, NULL, NULL, NULL); - it4 = elm_list_item_append(li, "And", NULL, NULL, NULL, NULL); + list_it4 = elm_list_item_append(li, "And", NULL, NULL, NULL, NULL); elm_list_item_append(li, "here", NULL, NULL, NULL, NULL); elm_list_item_append(li, "we", NULL, NULL, NULL, NULL); elm_list_item_append(li, "are", NULL, NULL, NULL, NULL); @@ -282,7 +282,7 @@ test_list_horizontal(void *data __UNUSED__, bt = elm_button_add(win); elm_object_text_set(bt, "Hello"); - evas_object_smart_callback_add(bt, "clicked", my_show_it, it1); + evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it1); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, 0.5, 0.9); elm_table_pack(tb2, bt, 0, 0, 1, 1); @@ -290,7 +290,7 @@ test_list_horizontal(void *data __UNUSED__, bt = elm_button_add(win); elm_object_text_set(bt, "How"); - evas_object_smart_callback_add(bt, "clicked", my_show_it, it2); + evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it2); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, 0.5, 0.9); elm_table_pack(tb2, bt, 1, 0, 1, 1); @@ -298,7 +298,7 @@ test_list_horizontal(void *data __UNUSED__, bt = elm_button_add(win); elm_object_text_set(bt, "doing"); - evas_object_smart_callback_add(bt, "clicked", my_show_it, it3); + evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it3); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, 0.5, 0.9); elm_table_pack(tb2, bt, 2, 0, 1, 1); @@ -306,7 +306,7 @@ test_list_horizontal(void *data __UNUSED__, bt = elm_button_add(win); elm_object_text_set(bt, "And"); - evas_object_smart_callback_add(bt, "clicked", my_show_it, it4); + evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it4); evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bt, 0.5, 0.9); elm_table_pack(tb2, bt, 3, 0, 1, 1); @@ -333,9 +333,8 @@ my_li2_sel(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { - Elm_List_Item *it = elm_list_selected_item_get(obj); - elm_list_item_selected_set(it, 0); -// elm_list_item_selected_set(event_info, 0); + Elm_Object_Item *list_it = elm_list_selected_item_get(obj); + elm_list_item_selected_set(list_it, 0); } void @@ -345,7 +344,7 @@ test_list2(void *data __UNUSED__, { Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *bx2, *bt; char buf[PATH_MAX]; - Elm_List_Item *it; + Elm_Object_Item *list_it; win = elm_win_add(NULL, "list2", ELM_WIN_BASIC); elm_win_title_set(win, "List 2"); @@ -372,8 +371,8 @@ test_list2(void *data __UNUSED__, ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); elm_icon_file_set(ic, buf, NULL); - it = elm_list_item_append(li, "Hello", ic, NULL, my_li2_sel, NULL); - elm_list_item_selected_set(it, 1); + list_it = elm_list_item_append(li, "Hello", ic, NULL, my_li2_sel, NULL); + elm_list_item_selected_set(list_it, EINA_TRUE); ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); elm_icon_scale_set(ic, 0, 0); diff --git a/src/bin/test_tooltip.c b/src/bin/test_tooltip.c index be1d2f4..9464ecc 100644 --- a/src/bin/test_tooltip.c +++ b/src/bin/test_tooltip.c @@ -372,7 +372,7 @@ test_tooltip(void *data __UNUSED__, { Evas_Object *win, *bg, *bx, *tb, *bt, *se, *lst; Elm_Object_Item *tb_it; - Elm_List_Item *li; + Elm_Object_Item *lit; win = elm_win_add(NULL, "tooltip", ELM_WIN_BASIC); elm_win_title_set(win, "Tooltip"); @@ -486,19 +486,19 @@ test_tooltip(void *data __UNUSED__, evas_object_show(se); lst = elm_list_add(win); - li = elm_list_item_append(lst, "Hello", NULL, NULL, NULL, NULL); - elm_list_item_tooltip_content_cb_set(li, _tt_item_label, NULL, NULL); - elm_list_item_tooltip_window_mode_set(li, EINA_TRUE); - li = elm_list_item_append(lst, "Icon Tooltip", NULL, NULL, NULL, NULL); - elm_list_item_tooltip_content_cb_set(li, _tt_item_icon, NULL, NULL); - li = elm_list_item_append(lst, "Big Icon Tooltip", NULL, NULL, NULL, NULL); - elm_list_item_tooltip_content_cb_set(li, _tt_item_icon2, NULL, NULL); - elm_list_item_tooltip_style_set(li, "transparent"); - elm_list_item_tooltip_window_mode_set(li, EINA_TRUE); - li = elm_list_item_append(lst, "Insanely Big Icon Tooltip", NULL, NULL, NULL, NULL); - elm_list_item_tooltip_content_cb_set(li, _tt_item_icon3, NULL, NULL); - elm_list_item_tooltip_style_set(li, "transparent"); - elm_list_item_tooltip_window_mode_set(li, EINA_TRUE); + lit = elm_list_item_append(lst, "Hello", NULL, NULL, NULL, NULL); + elm_list_item_tooltip_content_cb_set(lit, _tt_item_label, NULL, NULL); + elm_list_item_tooltip_window_mode_set(lit, EINA_TRUE); + lit = elm_list_item_append(lst, "Icon Tooltip", NULL, NULL, NULL, NULL); + elm_list_item_tooltip_content_cb_set(lit, _tt_item_icon, NULL, NULL); + lit = elm_list_item_append(lst, "Big Icon Tooltip", NULL, NULL, NULL, NULL); + elm_list_item_tooltip_content_cb_set(lit, _tt_item_icon2, NULL, NULL); + elm_list_item_tooltip_style_set(lit, "transparent"); + elm_list_item_tooltip_window_mode_set(lit, EINA_TRUE); + lit = elm_list_item_append(lst, "Insanely Big Icon Tooltip", NULL, NULL, NULL, NULL); + elm_list_item_tooltip_content_cb_set(lit, _tt_item_icon3, NULL, NULL); + elm_list_item_tooltip_style_set(lit, "transparent"); + elm_list_item_tooltip_window_mode_set(lit, EINA_TRUE); evas_object_size_hint_weight_set(lst, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(lst, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/examples/index_example_01.c b/src/examples/index_example_01.c index 284717c..a4dffa4 100644 --- a/src/examples/index_example_01.c +++ b/src/examples/index_example_01.c @@ -50,7 +50,7 @@ _item_del(void *data __UNUSED__, void *event_info __UNUSED__) { Elm_Object_Item *iit; - Elm_List_Item *lit = elm_index_item_selected_get(d.index, 0); + Elm_Object_Item *lit = elm_index_item_selected_get(d.index, 0); iit = elm_index_item_find(d.index, lit); @@ -95,11 +95,11 @@ _index_selected(void *data __UNUSED__, Evas_Object *obj, void *event_info) { - Elm_List_Item *it = event_info; + Elm_Object_Item *lit = event_info; fprintf(stdout, "New index item selected. Comparing item reported" " via callback with the selection returned by the API: " - "%s.\n", it == elm_index_item_selected_get(obj, 0) ? "OK" : + "%s.\n", lit == elm_index_item_selected_get(obj, 0) ? "OK" : "FAIL, something went wrong"); } @@ -116,7 +116,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__) { Evas_Object *win, *bg, *hbox, *vbox, *bt, *sep; - Elm_List_Item *it; + Elm_Object_Item *lit; unsigned int i; char curr = 0; @@ -150,7 +150,7 @@ elm_main(int argc __UNUSED__, for (i = 0; i < (sizeof(dict) / sizeof(dict[0])); i++) { - it = elm_list_item_append(d.list, dict[i], NULL, NULL, NULL, NULL); + lit = elm_list_item_append(d.list, dict[i], NULL, NULL, NULL, NULL); if (curr != dict[i][0]) { @@ -161,8 +161,8 @@ elm_main(int argc __UNUSED__, /* indexing by first letters */ snprintf(buf, sizeof(buf), "%c", curr); - elm_index_item_append(d.index, buf, it); - index_it = elm_index_item_find(d.index, it); + elm_index_item_append(d.index, buf, lit); + index_it = elm_index_item_find(d.index, lit); elm_object_item_del_cb_set(index_it, _index_item_del); } diff --git a/src/examples/list_example_03.c b/src/examples/list_example_03.c index a284ad1..1814a48 100644 --- a/src/examples/list_example_03.c +++ b/src/examples/list_example_03.c @@ -29,33 +29,33 @@ _on_done(void *data __UNUSED__, static void _prepend_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *it; + Elm_Object_Item *list_it; Evas_Object *li = data; char label[32]; snprintf(label, sizeof(label), "Item %i", counter++); - it = elm_list_item_prepend(li, label, NULL, NULL, NULL, NULL); - if (!it) + list_it = elm_list_item_prepend(li, label, NULL, NULL, NULL, NULL); + if (!list_it) printf("Error adding item\n"); } static void _add_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *it; + Elm_Object_Item *list_it; Evas_Object *li = data; char label[32]; snprintf(label, sizeof(label), "Item %i", counter++); - it = elm_list_item_append(li, label, NULL, NULL, NULL, NULL); - if (!it) + list_it = elm_list_item_append(li, label, NULL, NULL, NULL, NULL); + if (!list_it) printf("Error adding item\n"); } static void _add_ic_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *it; + Elm_Object_Item *list_it; Evas_Object *ic, *li = data; char label[32]; @@ -64,28 +64,28 @@ _add_ic_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) elm_icon_standard_set(ic, "home"); elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE); - it = elm_list_item_append(li, label, ic, NULL, NULL, NULL); - if (!it) + list_it = elm_list_item_append(li, label, ic, NULL, NULL, NULL); + if (!list_it) printf("Error adding item with icon\n"); } 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_object_item_text_get(it)); + Elm_Object_Item *list_it = event_info; + printf("Selected label: %s\n", elm_object_item_text_get(list_it)); } static void _add_func_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *it; + Elm_Object_Item *list_it; Evas_Object *li = data; char label[32]; snprintf(label, sizeof(label), "Item %i", counter++); - it = elm_list_item_append(li, label, NULL, NULL, _sel_cb, NULL); - if (!it) + list_it = elm_list_item_append(li, label, NULL, NULL, _sel_cb, NULL); + if (!list_it) printf("Error adding item\n"); } @@ -93,9 +93,9 @@ static void _sel_data_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info) { char *content = data; - Elm_List_Item *it = event_info; + Elm_Object_Item *list_it = event_info; printf("Selected label: %s with data: %s\n", - elm_object_item_text_get(it), content); + elm_object_item_text_get(list_it), content); } static void @@ -107,25 +107,25 @@ _free_data(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) static void _add_data_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *it; + Elm_Object_Item *list_it; Evas_Object *li = data; char label[32]; char *content = malloc(sizeof(char) * 32); snprintf(content, 32, "Item content %i", counter); snprintf(label, sizeof(label), "Item %i", counter++); - it = elm_list_item_append(li, label, NULL, NULL, _sel_data_cb, content); - if (!it) { + list_it = elm_list_item_append(li, label, NULL, NULL, _sel_data_cb, content); + if (!list_it) { printf("Error adding item\n"); return; } - elm_list_item_del_cb_set(it, _free_data); + elm_list_item_del_cb_set(list_it, _free_data); } static void _del_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *selected_item; + Elm_Object_Item *selected_item; Evas_Object *li = data; selected_item = elm_list_selected_item_get(li); @@ -135,7 +135,7 @@ _del_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) static void _unselect_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *selected_item; + Elm_Object_Item *selected_item; Evas_Object *li = data; selected_item = elm_list_selected_item_get(li); @@ -146,12 +146,12 @@ static void _print_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { const Eina_List *l, *items; - Elm_List_Item *it; + Elm_Object_Item *list_it; Evas_Object *li = data; items = elm_list_items_get(li); - EINA_LIST_FOREACH(items, l, it) - printf("%s\n", elm_object_item_text_get(it)); + EINA_LIST_FOREACH(items, l, list_it) + printf("%s\n", elm_object_item_text_get(list_it)); } static void @@ -164,7 +164,7 @@ _clear_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) static void _select_next_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *selected_item, *next_item; + Elm_Object_Item *selected_item, *next_item; Evas_Object *li = data; selected_item = elm_list_selected_item_get(li); @@ -178,7 +178,7 @@ _select_next_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUS static void _insert_after_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *selected_item, *it; + Elm_Object_Item *selected_item, *list_it; Evas_Object *li = data; char label[32]; @@ -186,16 +186,16 @@ _insert_after_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNU if (!selected_item) return; snprintf(label, sizeof(label), "Item %i", counter++); - it = elm_list_item_insert_after(li, selected_item, label, NULL, NULL, NULL, - NULL); - if (!it) + list_it = elm_list_item_insert_after(li, selected_item, label, NULL, NULL, + NULL, NULL); + if (!list_it) printf("Error adding item\n"); } static void _select_prev_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *selected_item, *prev_item; + Elm_Object_Item *selected_item, *prev_item; Evas_Object *li = data; selected_item = elm_list_selected_item_get(li); @@ -209,7 +209,7 @@ _select_prev_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUS static void _insert_before_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *selected_item, *it; + Elm_Object_Item *selected_item, *list_it; Evas_Object *li = data; char label[32]; @@ -217,16 +217,16 @@ _insert_before_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UN if (!selected_item) return; snprintf(label, sizeof(label), "Item %i", counter++); - it = elm_list_item_insert_before(li, selected_item, label, NULL, NULL, + list_it = elm_list_item_insert_before(li, selected_item, label, NULL, NULL, NULL, NULL); - if (!it) + if (!list_it) printf("Error adding item\n"); } static void _set_separator_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *selected_item; + Elm_Object_Item *selected_item; Evas_Object *li = data; selected_item = elm_list_selected_item_get(li); @@ -237,7 +237,7 @@ _set_separator_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UN static void _disable_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_List_Item *selected_item; + Elm_Object_Item *selected_item; Evas_Object *li = data; selected_item = elm_list_selected_item_get(li); diff --git a/src/lib/elm_deprecated.h b/src/lib/elm_deprecated.h index 7629d37..8b995e8 100644 --- a/src/lib/elm_deprecated.h +++ b/src/lib/elm_deprecated.h @@ -1787,7 +1787,7 @@ EINA_DEPRECATED EAPI const char *elm_layout_text_get(const Evas_Object *obj, co #define elm_layout_label_get(_ly) \ elm_layout_text_get((_ly), "elm.text") -EINA_DEPRECATED EAPI Evas_Object *elm_list_item_base_get(const Elm_List_Item *item); +EINA_DEPRECATED EAPI Evas_Object *elm_list_item_base_get(const Elm_Object_Item *it); /** @@ -2948,7 +2948,7 @@ EINA_DEPRECATED EAPI void elm_naviframe_item_del(Elm_Object_Item *it * * @ingroup List */ -EINA_DEPRECATED EAPI void elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled); +EINA_DEPRECATED EAPI void elm_list_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled); /** * Get a value whether list item is disabled or not. @@ -2962,12 +2962,12 @@ EINA_DEPRECATED EAPI void elm_list_item_disabled_set(Elm * * @ingroup List */ -EINA_DEPRECATED EAPI Eina_Bool elm_list_item_disabled_get(const Elm_List_Item *it); +EINA_DEPRECATED EAPI Eina_Bool elm_list_item_disabled_get(const Elm_Object_Item *it); /** * Set the function called when a list item is freed. * - * @param item The item to set the callback on + * @param it The item to set the callback on * @param func The function called * * If there is a @p func, then it will be called prior item's memory release. @@ -2982,12 +2982,12 @@ EINA_DEPRECATED EAPI Eina_Bool elm_list_item_disabled_get(con * * @ingroup List */ -EINA_DEPRECATED EAPI void elm_list_item_del_cb_set(Elm_List_Item *item, Evas_Smart_Cb func); +EINA_DEPRECATED EAPI void elm_list_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb func); /** * Get the data associated to the item. * - * @param item The list item + * @param it The list item * @return The data associated to @p item * * The return value is a pointer to data associated to @p item when it was @@ -3000,12 +3000,12 @@ EINA_DEPRECATED EAPI void elm_list_item_del_cb_set(Elm_L * * @ingroup List */ -EINA_DEPRECATED EAPI void *elm_list_item_data_get(const Elm_List_Item *item); +EINA_DEPRECATED EAPI void *elm_list_item_data_get(const Elm_Object_Item *it); /** * Get the left side icon associated to the item. * - * @param item The list item + * @param it The list item * @return The left side icon associated to @p item * * The return value is a pointer to the icon associated to @p item when @@ -3020,12 +3020,12 @@ EINA_DEPRECATED EAPI void *elm_list_item_data_get(const E * @deprecated Please use elm_object_item_part_content_get(item, NULL); * @ingroup List */ -EINA_DEPRECATED EAPI Evas_Object *elm_list_item_icon_get(const Elm_List_Item *item); +EINA_DEPRECATED EAPI Evas_Object *elm_list_item_icon_get(const Elm_Object_Item *it); /** * Set the left side icon associated to the item. * - * @param item The list item + * @param it The list item * @param icon The left side icon object to associate with @p item * * The icon object to use at left side of the item. An @@ -3046,12 +3046,12 @@ EINA_DEPRECATED EAPI Evas_Object *elm_list_item_icon_get(const E * @deprecated Please use elm_object_item_part_content_set(item, NULL, icon); * @ingroup List */ -EINA_DEPRECATED EAPI void elm_list_item_icon_set(Elm_List_Item *item, Evas_Object *icon); +EINA_DEPRECATED EAPI void elm_list_item_icon_set(Elm_Object_Item *it, Evas_Object *icon); /** * Get the right side icon associated to the item. * - * @param item The list item + * @param it The list item * @return The right side icon associated to @p item * * The return value is a pointer to the icon associated to @p item when @@ -3066,12 +3066,12 @@ EINA_DEPRECATED EAPI void elm_list_item_icon_set(Elm_Lis * @deprecated Please use elm_object_item_part_content_get(item, "end"); * @ingroup List */ -EINA_DEPRECATED EAPI Evas_Object *elm_list_item_end_get(const Elm_List_Item *item); +EINA_DEPRECATED EAPI Evas_Object *elm_list_item_end_get(const Elm_Object_Item *it); /** * Set the right side icon associated to the item. * - * @param item The list item + * @param it The list item * @param end The right side icon object to associate with @p item * * The icon object to use at right side of the item. An @@ -3092,12 +3092,12 @@ EINA_DEPRECATED EAPI Evas_Object *elm_list_item_end_get(const El * @deprecated Please use elm_object_item_part_content_set(item, "end", end); * @ingroup List */ -EINA_DEPRECATED EAPI void elm_list_item_end_set(Elm_List_Item *item, Evas_Object *end); +EINA_DEPRECATED EAPI void elm_list_item_end_set(Elm_Object_Item *it, Evas_Object *end); /** * Get the label of item. * - * @param item The item of list. + * @param it The item of list. * @return The label of item. * * The return value is a pointer to the label associated to @p item when @@ -3111,12 +3111,12 @@ EINA_DEPRECATED EAPI void elm_list_item_end_set(Elm_List * @deprecated Please use elm_object_item_text_get(item); * @ingroup List */ -EINA_DEPRECATED EAPI const char *elm_list_item_label_get(const Elm_List_Item *item); +EINA_DEPRECATED EAPI const char *elm_list_item_label_get(const Elm_Object_Item *it); /** * Set the label of item. * - * @param item The item of list. + * @param it The item of list. * @param text The label of item. * * The label to be displayed by the item. @@ -3132,7 +3132,7 @@ EINA_DEPRECATED EAPI const char *elm_list_item_label_get(const * @deprecated Please use elm_object_item_text_set(item, text); * @ingroup List */ -EINA_DEPRECATED EAPI void elm_list_item_label_set(Elm_List_Item *item, const char *text); +EINA_DEPRECATED EAPI void elm_list_item_label_set(Elm_Object_Item *it, const char *text); /** * Set the shrink state of toolbar @p obj. diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index 3750c87..e782135 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -5,6 +5,7 @@ #define SWIPE_MOVES 12 typedef struct _Widget_Data Widget_Data; +typedef struct _Elm_List_Item Elm_List_Item; struct _Widget_Data { @@ -101,8 +102,8 @@ static const Evas_Smart_Cb_Description _signals[] = { }; #define ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ...) \ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, __VA_ARGS__); \ -if (it->deleted) \ + ELM_OBJ_ITEM_CHECK_OR_RETURN(it, __VA_ARGS__); \ +if (((Elm_List_Item *) it)->deleted) \ { \ ERR("ERROR: "#it" has been DELETED.\n"); \ return __VA_ARGS__; \ @@ -225,7 +226,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty (!strcmp(ev->keyname, "KP_Home"))) { it = eina_list_data_get(wd->items); - elm_list_item_bring_in(it); + elm_list_item_bring_in((Elm_Object_Item *) it); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; } @@ -233,7 +234,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty (!strcmp(ev->keyname, "KP_End"))) { it = eina_list_data_get(eina_list_last(wd->items)); - elm_list_item_bring_in(it); + elm_list_item_bring_in((Elm_Object_Item *) it); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; } @@ -278,7 +279,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty (!strcmp(ev->keyname, "space"))) && (!wd->multi) && (wd->selected)) { - it = elm_list_selected_item_get(obj); + it = (Elm_List_Item *) elm_list_selected_item_get(obj); evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it); } else if (!strcmp(ev->keyname, "Escape")) @@ -305,7 +306,8 @@ _deselect_all_items(Widget_Data *wd) { if (!wd->selected) return EINA_FALSE; while (wd->selected) - elm_list_item_selected_set(wd->selected->data, EINA_FALSE); + elm_list_item_selected_set((Elm_Object_Item *) wd->selected->data, + EINA_FALSE); return EINA_TRUE; } @@ -316,14 +318,15 @@ _item_multi_select_up(Widget_Data *wd) if (!wd->selected) return EINA_FALSE; if (!wd->multi) return EINA_FALSE; - Elm_List_Item *prev = elm_list_item_prev(wd->last_selected_item); + Elm_Object_Item *prev = elm_list_item_prev((Elm_Object_Item *) wd->last_selected_item); if (!prev) return EINA_TRUE; if (elm_list_item_selected_get(prev)) { - elm_list_item_selected_set(wd->last_selected_item, EINA_FALSE); - wd->last_selected_item = prev; - elm_list_item_show(wd->last_selected_item); + elm_list_item_selected_set((Elm_Object_Item *) wd->last_selected_item, + EINA_FALSE); + wd->last_selected_item = (Elm_List_Item *) prev; + elm_list_item_show((Elm_Object_Item *) wd->last_selected_item); } else { @@ -339,14 +342,15 @@ _item_multi_select_down(Widget_Data *wd) if (!wd->selected) return EINA_FALSE; if (!wd->multi) return EINA_FALSE; - Elm_List_Item *next = elm_list_item_next(wd->last_selected_item); + Elm_Object_Item *next = elm_list_item_next((Elm_Object_Item *) wd->last_selected_item); if (!next) return EINA_TRUE; if (elm_list_item_selected_get(next)) { - elm_list_item_selected_set(wd->last_selected_item, EINA_FALSE); - wd->last_selected_item = next; - elm_list_item_show(wd->last_selected_item); + elm_list_item_selected_set((Elm_Object_Item *) wd->last_selected_item, + EINA_FALSE); + wd->last_selected_item = (Elm_List_Item *) next; + elm_list_item_show((Elm_Object_Item *) wd->last_selected_item); } else { @@ -359,11 +363,10 @@ _item_multi_select_down(Widget_Data *wd) static Eina_Bool _item_single_select_up(Widget_Data *wd) { - Elm_List_Item *prev; + Elm_Object_Item *prev; if (!wd->selected) prev = eina_list_data_get(eina_list_last(wd->items)); - else prev = elm_list_item_prev(wd->last_selected_item); - + else prev = elm_list_item_prev((Elm_Object_Item *) wd->last_selected_item); if (!prev) return EINA_FALSE; _deselect_all_items(wd); @@ -376,11 +379,10 @@ _item_single_select_up(Widget_Data *wd) static Eina_Bool _item_single_select_down(Widget_Data *wd) { - Elm_List_Item *next; + Elm_Object_Item *next; if (!wd->selected) next = eina_list_data_get(wd->items); - else next = elm_list_item_next(wd->last_selected_item); - + else next = elm_list_item_next((Elm_Object_Item *) wd->last_selected_item); if (!next) return EINA_FALSE; _deselect_all_items(wd); @@ -1701,13 +1703,13 @@ elm_list_items_get(const Evas_Object *obj) return wd->items; } -EAPI Elm_List_Item * +EAPI Elm_Object_Item * elm_list_selected_item_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - if (wd->selected) return wd->selected->data; + if (wd->selected) return (Elm_Object_Item *) wd->selected->data; return NULL; } @@ -1720,7 +1722,7 @@ elm_list_selected_items_get(const Evas_Object *obj) return wd->selected; } -EAPI Elm_List_Item * +EAPI Elm_Object_Item * elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -1730,10 +1732,10 @@ elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Eva wd->items = eina_list_append(wd->items, it); it->node = eina_list_last(wd->items); elm_box_pack_end(wd->box, VIEW(it)); - return it; + return (Elm_Object_Item *) it; } -EAPI Elm_List_Item * +EAPI Elm_Object_Item * elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -1743,50 +1745,54 @@ elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Ev wd->items = eina_list_prepend(wd->items, it); it->node = wd->items; elm_box_pack_start(wd->box, VIEW(it)); - return it; + return (Elm_Object_Item *) it; } -EAPI Elm_List_Item * -elm_list_item_insert_before(Evas_Object *obj, Elm_List_Item *before, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) +EAPI Elm_Object_Item * +elm_list_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) { - Widget_Data *wd; - Elm_List_Item *it; - - EINA_SAFETY_ON_NULL_RETURN_VAL(before, NULL); - if (!before->node) return NULL; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; ELM_LIST_ITEM_CHECK_DELETED_RETURN(before, NULL); - ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd; + Elm_List_Item *it, *before_it; + wd = elm_widget_data_get(obj); if (!wd) return NULL; + + before_it = (Elm_List_Item *) before; + if (!before_it->node) return NULL; + it = _item_new(obj, label, icon, end, func, data); - wd->items = eina_list_prepend_relative_list(wd->items, it, before->node); - it->node = before->node->prev; - elm_box_pack_before(wd->box, VIEW(it), VIEW(before)); - return it; + wd->items = eina_list_prepend_relative_list(wd->items, it, before_it->node); + it->node = before_it->node->prev; + elm_box_pack_before(wd->box, VIEW(it), VIEW(before_it)); + return (Elm_Object_Item *) it; } -EAPI Elm_List_Item * -elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) +EAPI Elm_Object_Item * +elm_list_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) { - Widget_Data *wd; - Elm_List_Item *it; - - EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL); - if (!after->node) return NULL; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; ELM_LIST_ITEM_CHECK_DELETED_RETURN(after, NULL); - ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd; + Elm_List_Item *it, *after_it; + wd = elm_widget_data_get(obj); if (!wd) return NULL; + + after_it = (Elm_List_Item *) after; + if (!after_it->node) return NULL; + it = _item_new(obj, label, icon, end, func, data); - wd->items = eina_list_append_relative_list(wd->items, it, after->node); - it->node = after->node->next; - elm_box_pack_after(wd->box, VIEW(it), VIEW(after)); - return it; + wd->items = eina_list_append_relative_list(wd->items, it, after_it->node); + it->node = after_it->node->next; + elm_box_pack_after(wd->box, VIEW(it), VIEW(after_it)); + return (Elm_Object_Item *) it; } -EAPI Elm_List_Item * +EAPI Elm_Object_Item * elm_list_item_sorted_insert(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -1808,33 +1814,34 @@ elm_list_item_sorted_insert(Evas_Object *obj, const char *label, Evas_Object *ic it->node = before->node->prev; elm_box_pack_before(wd->box, VIEW(it), VIEW(before)); } - return it; + return (Elm_Object_Item *) it; } EAPI void -elm_list_item_separator_set(Elm_List_Item *it, Eina_Bool setting) +elm_list_item_separator_set(Elm_Object_Item *it, Eina_Bool setting) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); - it->is_separator = !!setting; + ((Elm_List_Item *) it)->is_separator = !!setting; } EAPI Eina_Bool -elm_list_item_separator_get(const Elm_List_Item *it) +elm_list_item_separator_get(const Elm_Object_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE); - return it->is_separator; + return ((Elm_List_Item *) it)->is_separator; } EAPI void -elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected) +elm_list_item_selected_set(Elm_Object_Item *it, Eina_Bool selected) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); Evas_Object *obj = WIDGET(it); Widget_Data *wd = elm_widget_data_get(obj); + Elm_List_Item *item = (Elm_List_Item *) it; if (!wd) return; selected = !!selected; - if (it->selected == selected) return; + if (item->selected == selected) return; evas_object_ref(obj); _elm_list_walk(wd); @@ -1846,28 +1853,29 @@ elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected) while (wd->selected) _item_unselect(wd->selected->data); } - _item_highlight(it); - _item_select(it); + _item_highlight(item); + _item_select(item); } else - _item_unselect(it); + _item_unselect(item); _elm_list_unwalk(wd); evas_object_unref(obj); } EAPI Eina_Bool -elm_list_item_selected_get(const Elm_List_Item *it) +elm_list_item_selected_get(const Elm_Object_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE); - return it->selected; + return ((Elm_List_Item *) it)->selected; } EAPI void -elm_list_item_show(Elm_List_Item *it) +elm_list_item_show(Elm_Object_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); Widget_Data *wd = elm_widget_data_get(WIDGET(it)); + if (!wd) return; Evas_Coord bx, by, bw, bh; Evas_Coord x, y, w, h; @@ -1875,15 +1883,15 @@ elm_list_item_show(Elm_List_Item *it) evas_object_geometry_get(VIEW(it), &x, &y, &w, &h); x -= bx; y -= by; - if (wd->scr) - elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); + if (wd->scr) elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); } EAPI void -elm_list_item_bring_in(Elm_List_Item *it) +elm_list_item_bring_in(Elm_Object_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); Widget_Data *wd = elm_widget_data_get(WIDGET(it)); + if (!wd) return; Evas_Coord bx, by, bw, bh; Evas_Coord x, y, w, h; @@ -1891,224 +1899,226 @@ elm_list_item_bring_in(Elm_List_Item *it) evas_object_geometry_get(VIEW(it), &x, &y, &w, &h); x -= bx; y -= by; - if (wd->scr) - elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); + if (wd->scr) elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); } EAPI void -elm_list_item_del(Elm_List_Item *it) +elm_list_item_del(Elm_Object_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); Evas_Object *obj = WIDGET(it); + Elm_List_Item *item = (Elm_List_Item *) it; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (it->selected) _item_unselect(it); + if (item->selected) _item_unselect(item); if (wd->walking > 0) { - if (it->deleted) return; - it->deleted = EINA_TRUE; - wd->to_delete = eina_list_append(wd->to_delete, it); + if (item->deleted) return; + item->deleted = EINA_TRUE; + wd->to_delete = eina_list_append(wd->to_delete, item); return; } - wd->items = eina_list_remove_list(wd->items, it->node); + wd->items = eina_list_remove_list(wd->items, item->node); evas_object_ref(obj); _elm_list_walk(wd); - elm_widget_item_pre_notify_del(it); - _elm_list_item_free(it); + elm_widget_item_pre_notify_del(item); + _elm_list_item_free(item); _elm_list_unwalk(wd); evas_object_unref(obj); } EAPI Evas_Object * -elm_list_item_object_get(const Elm_List_Item *it) +elm_list_item_object_get(const Elm_Object_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL); return VIEW(it); } -EAPI Elm_List_Item * -elm_list_item_prev(const Elm_List_Item *it) +EAPI Elm_Object_Item * +elm_list_item_prev(const Elm_Object_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL); - if (it->node->prev) return it->node->prev->data; + Elm_List_Item *item = (Elm_List_Item *) it; + if (item->node->prev) return item->node->prev->data; else return NULL; } -EAPI Elm_List_Item * -elm_list_item_next(const Elm_List_Item *it) +EAPI Elm_Object_Item * +elm_list_item_next(const Elm_Object_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL); - if (it->node->next) return it->node->next->data; + Elm_List_Item *item = (Elm_List_Item *) it; + if (item->node->next) return item->node->next->data; else return NULL; } EINA_DEPRECATED EAPI Evas_Object * -elm_list_item_base_get(const Elm_List_Item *it) +elm_list_item_base_get(const Elm_Object_Item *it) { return elm_list_item_object_get(it); } EINA_DEPRECATED EAPI void -elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled) +elm_list_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled) { - elm_object_item_disabled_set((Elm_Object_Item *)it, disabled); + elm_object_item_disabled_set(it, disabled); } EINA_DEPRECATED EAPI Eina_Bool -elm_list_item_disabled_get(const Elm_List_Item *it) +elm_list_item_disabled_get(const Elm_Object_Item *it) { - return elm_object_item_disabled_get((Elm_Object_Item *)it); + return elm_object_item_disabled_get(it); } EINA_DEPRECATED EAPI void -elm_list_item_del_cb_set(Elm_List_Item *it, Evas_Smart_Cb func) +elm_list_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb func) { - elm_widget_item_del_cb_set(it, func); + elm_object_item_del_cb_set(it, func); } EINA_DEPRECATED EAPI void * -elm_list_item_data_get(const Elm_List_Item *it) +elm_list_item_data_get(const Elm_Object_Item *it) { - return elm_widget_item_data_get(it); + return elm_object_item_data_get(it); } EINA_DEPRECATED EAPI Evas_Object * -elm_list_item_icon_get(const Elm_List_Item *it) +elm_list_item_icon_get(const Elm_Object_Item *it) { - return _elm_widget_item_content_part_get((Elm_Widget_Item *)it, NULL); + return _item_content_get(it, NULL); } EINA_DEPRECATED EAPI void -elm_list_item_icon_set(Elm_List_Item *it, Evas_Object *icon) +elm_list_item_icon_set(Elm_Object_Item *it, Evas_Object *icon) { - _elm_widget_item_content_part_set((Elm_Widget_Item *)it, NULL, icon); + _item_content_set(it, NULL, icon); } EINA_DEPRECATED EAPI Evas_Object * -elm_list_item_end_get(const Elm_List_Item *it) +elm_list_item_end_get(const Elm_Object_Item *it) { - return _elm_widget_item_content_part_get((Elm_Widget_Item *)it, "end"); + return _item_content_get(it, "end"); } EINA_DEPRECATED EAPI void -elm_list_item_end_set(Elm_List_Item *it, Evas_Object *end) +elm_list_item_end_set(Elm_Object_Item *it, Evas_Object *end) { - _elm_widget_item_content_part_set((Elm_Widget_Item *)it, "end", end); + _item_content_set(it, "end", end); } EINA_DEPRECATED EAPI const char * -elm_list_item_label_get(const Elm_List_Item *it) +elm_list_item_label_get(const Elm_Object_Item *it) { - return _elm_widget_item_text_part_get((Elm_Widget_Item *)it, NULL); + return _item_text_get(it, NULL); } EINA_DEPRECATED EAPI void -elm_list_item_label_set(Elm_List_Item *it, const char *text) +elm_list_item_label_set(Elm_Object_Item *it, const char *text) { - _elm_widget_item_text_part_set((Elm_Widget_Item *)it, NULL, text); + _item_text_set(it, NULL, text); } // XXX: all the below - make elm_object_item*() calls to do these -EINA_DEPRECATED EAPI void -elm_list_item_tooltip_text_set(Elm_List_Item *item, const char *text) +EAPI void +elm_list_item_tooltip_text_set(Elm_Object_Item *it, const char *text) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_tooltip_text_set(item, text); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + elm_widget_item_tooltip_text_set(it, text); } -EINA_DEPRECATED EAPI void -elm_list_item_tooltip_content_cb_set(Elm_List_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) +EAPI void +elm_list_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + elm_widget_item_tooltip_content_cb_set(it, func, data, del_cb); } -EINA_DEPRECATED EAPI void -elm_list_item_tooltip_unset(Elm_List_Item *item) +EAPI void +elm_list_item_tooltip_unset(Elm_Object_Item *it) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_tooltip_unset(item); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + elm_widget_item_tooltip_unset(it); } -EINA_DEPRECATED EAPI Eina_Bool -elm_list_item_tooltip_window_mode_set(Elm_List_Item *item, Eina_Bool disable) +EAPI Eina_Bool +elm_list_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, EINA_FALSE); - return elm_widget_item_tooltip_window_mode_set(item, disable); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE); + return elm_widget_item_tooltip_window_mode_set(it, disable); } -EINA_DEPRECATED EAPI Eina_Bool -elm_list_item_tooltip_window_mode_get(const Elm_List_Item *item) +EAPI Eina_Bool +elm_list_item_tooltip_window_mode_get(const Elm_Object_Item *it) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, EINA_FALSE); - return elm_widget_item_tooltip_window_mode_get(item); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE); + return elm_widget_item_tooltip_window_mode_get(it); } -EINA_DEPRECATED EAPI void -elm_list_item_tooltip_style_set(Elm_List_Item *item, const char *style) +EAPI void +elm_list_item_tooltip_style_set(Elm_Object_Item *it, const char *style) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_tooltip_style_set(item, style); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + elm_widget_item_tooltip_style_set(it, style); } -EINA_DEPRECATED EAPI const char * -elm_list_item_tooltip_style_get(const Elm_List_Item *item) +EAPI const char * +elm_list_item_tooltip_style_get(const Elm_Object_Item *it) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, NULL); - return elm_widget_item_tooltip_style_get(item); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL); + return elm_widget_item_tooltip_style_get(it); } -EINA_DEPRECATED EAPI void -elm_list_item_cursor_set(Elm_List_Item *item, const char *cursor) +EAPI void +elm_list_item_cursor_set(Elm_Object_Item *it, const char *cursor) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_cursor_set(item, cursor); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + elm_widget_item_cursor_set(it, cursor); } -EINA_DEPRECATED EAPI const char * -elm_list_item_cursor_get(const Elm_List_Item *item) +EAPI const char * +elm_list_item_cursor_get(const Elm_Object_Item *it) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, NULL); - return elm_widget_item_cursor_get(item); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL); + return elm_widget_item_cursor_get(it); } -EINA_DEPRECATED EAPI void -elm_list_item_cursor_unset(Elm_List_Item *item) +EAPI void +elm_list_item_cursor_unset(Elm_Object_Item *it) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_cursor_unset(item); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + elm_widget_item_cursor_unset(it); } -EINA_DEPRECATED EAPI void -elm_list_item_cursor_style_set(Elm_List_Item *item, const char *style) +EAPI void +elm_list_item_cursor_style_set(Elm_Object_Item *it, const char *style) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_cursor_style_set(item, style); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + elm_widget_item_cursor_style_set(it, style); } -EINA_DEPRECATED EAPI const char * -elm_list_item_cursor_style_get(const Elm_List_Item *item) +EAPI const char * +elm_list_item_cursor_style_get(const Elm_Object_Item *it) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, NULL); - return elm_widget_item_cursor_style_get(item); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL); + return elm_widget_item_cursor_style_get(it); } -EINA_DEPRECATED EAPI void -elm_list_item_cursor_engine_only_set(Elm_List_Item *item, Eina_Bool engine_only) +EAPI void +elm_list_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_cursor_engine_only_set(item, engine_only); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + elm_widget_item_cursor_engine_only_set(it, engine_only); } -EINA_DEPRECATED EAPI Eina_Bool -elm_list_item_cursor_engine_only_get(const Elm_List_Item *item) +EAPI Eina_Bool +elm_list_item_cursor_engine_only_get(const Elm_Object_Item *it) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, EINA_FALSE); - return elm_widget_item_cursor_engine_only_get(item); + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE); + return elm_widget_item_cursor_engine_only_get(it); } diff --git a/src/lib/elm_list.h b/src/lib/elm_list.h index 920c7f0..3e265ee 100644 --- a/src/lib/elm_list.h +++ b/src/lib/elm_list.h @@ -70,8 +70,6 @@ typedef enum ELM_LIST_LAST /**< Indicates error if returned by elm_list_mode_get() */ } Elm_List_Mode; -typedef struct _Elm_List_Item Elm_List_Item; /**< Item of Elm_List. Sub-type of Elm_Widget_Item. Can be created with elm_list_item_append(), elm_list_item_prepend() and functions to add items in relative positions, like elm_list_item_insert_before(), and deleted with elm_list_item_del(). */ - /** * Add a new list widget to the given parent Elementary * (container) object. @@ -364,7 +362,7 @@ EAPI void elm_list_scroller_policy_get(const Evas_Object * * @ingroup List */ -EAPI Elm_List_Item *elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); +EAPI Elm_Object_Item *elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); /** * Prepend a new item to the list object. @@ -406,7 +404,7 @@ EAPI Elm_List_Item *elm_list_item_append(Evas_Object *obj, const c * * @ingroup List */ -EAPI Elm_List_Item *elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); +EAPI Elm_Object_Item *elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); /** * Insert a new item into the list object before item @p before. @@ -449,7 +447,7 @@ EAPI Elm_List_Item *elm_list_item_prepend(Evas_Object *obj, const * * @ingroup List */ -EAPI Elm_List_Item *elm_list_item_insert_before(Evas_Object *obj, Elm_List_Item *before, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); +EAPI Elm_Object_Item *elm_list_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); /** * Insert a new item into the list object after item @p after. @@ -492,7 +490,7 @@ EAPI Elm_List_Item *elm_list_item_insert_before(Evas_Object *obj, * * @ingroup List */ -EAPI Elm_List_Item *elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); +EAPI Elm_Object_Item *elm_list_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); /** * Insert a new item into the sorted list object. @@ -507,7 +505,7 @@ EAPI Elm_List_Item *elm_list_item_insert_after(Evas_Object *obj, E * @param func The function to call when the item is clicked. * @param data The data to associate with the item for related callbacks. * @param cmp_func The comparing function to be used to sort list - * items by #Elm_List_Item item handles. This function will + * items by #Elm_Object_Item item handles. This function will * receive two items and compare them, returning a non-negative integer * if the second item should be place after the first, or negative value * if should be placed before. @@ -543,7 +541,7 @@ EAPI Elm_List_Item *elm_list_item_insert_after(Evas_Object *obj, E * * @ingroup List */ -EAPI Elm_List_Item *elm_list_item_sorted_insert(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func); +EAPI Elm_Object_Item *elm_list_item_sorted_insert(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func); /** * Remove all list's items. @@ -561,7 +559,7 @@ EAPI void elm_list_clear(Evas_Object *obj); * Get a list of all the list items. * * @param obj The list object - * @return An @c Eina_List of list items, #Elm_List_Item, + * @return An @c Eina_List of list items, #Elm_Object_Item, * or @c NULL on failure. * * @see elm_list_item_append() @@ -587,13 +585,13 @@ EAPI const Eina_List *elm_list_items_get(const Evas_Object *obj); * * @ingroup List */ -EAPI Elm_List_Item *elm_list_selected_item_get(const Evas_Object *obj); +EAPI Elm_Object_Item *elm_list_selected_item_get(const Evas_Object *obj); /** * Return a list of the currently selected list items. * * @param obj The list object. - * @return An @c Eina_List of list items, #Elm_List_Item, + * @return An @c Eina_List of list items, #Elm_Object_Item, * or @c NULL on failure. * * Multiple items can be selected if multi select is enabled. It can be @@ -609,7 +607,7 @@ EAPI const Eina_List *elm_list_selected_items_get(const Evas_Object /** * Set the selected state of an item. * - * @param item The list item + * @param it The list item * @param selected The selected state * * This sets the selected state of the given item @p it. @@ -628,12 +626,12 @@ EAPI const Eina_List *elm_list_selected_items_get(const Evas_Object * * @ingroup List */ -EAPI void elm_list_item_selected_set(Elm_List_Item *item, Eina_Bool selected); +EAPI void elm_list_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); /* * Get whether the @p item is selected or not. * - * @param item The list item. + * @param it The list item. * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned. * @@ -642,7 +640,7 @@ EAPI void elm_list_item_selected_set(Elm_List_Item *item * * @ingroup List */ -EAPI Eina_Bool elm_list_item_selected_get(const Elm_List_Item *item); +EAPI Eina_Bool elm_list_item_selected_get(const Elm_Object_Item *it); /** * Set or unset item as a separator. @@ -660,7 +658,7 @@ EAPI Eina_Bool elm_list_item_selected_get(const Elm_List_Item * * @ingroup List */ -EAPI void elm_list_item_separator_set(Elm_List_Item *it, Eina_Bool setting); +EAPI void elm_list_item_separator_set(Elm_Object_Item *it, Eina_Bool setting); /** * Get a value whether item is a separator or not. @@ -673,24 +671,24 @@ EAPI void elm_list_item_separator_set(Elm_List_Item *it, * * @ingroup List */ -EAPI Eina_Bool elm_list_item_separator_get(const Elm_List_Item *it); +EAPI Eina_Bool elm_list_item_separator_get(const Elm_Object_Item *it); /** * Show @p item in the list view. * - * @param item The list item to be shown. + * @param it The list item to be shown. * * It won't animate list until item is visible. If such behavior is wanted, * use elm_list_bring_in() intead. * * @ingroup List */ -EAPI void elm_list_item_show(Elm_List_Item *item); +EAPI void elm_list_item_show(Elm_Object_Item *it); /** * Bring in the given item to list view. * - * @param item The item. + * @param it The item. * * This causes list to jump to the given item @p item and show it * (by scrolling), if it is not fully visible. @@ -701,12 +699,12 @@ EAPI void elm_list_item_show(Elm_List_Item *item); * * @ingroup List */ -EAPI void elm_list_item_bring_in(Elm_List_Item *item); +EAPI void elm_list_item_bring_in(Elm_Object_Item *it); /** * Delete the item from the list. * - * @param item The item of list to be deleted. + * @param it The item of list to be deleted. * * If deleting all list items is required, elm_list_clear() * should be used instead of getting items list and deleting each one. @@ -717,19 +715,19 @@ EAPI void elm_list_item_bring_in(Elm_List_Item *item); * * @ingroup List */ -EAPI void elm_list_item_del(Elm_List_Item *item); +EAPI void elm_list_item_del(Elm_Object_Item *it); /** * Gets the base object of the item. * - * @param item The list item + * @param it The list item * @return The base object associated with @p item * * Base object is the @c Evas_Object that represents that item. * * @ingroup List */ -EAPI Evas_Object *elm_list_item_object_get(const Elm_List_Item *item); +EAPI Evas_Object *elm_list_item_object_get(const Elm_Object_Item *it); /** * Get the item before @p it in list. @@ -744,7 +742,7 @@ EAPI Evas_Object *elm_list_item_object_get(const Elm_List_Item * * * @ingroup List */ -EAPI Elm_List_Item *elm_list_item_prev(const Elm_List_Item *it); +EAPI Elm_Object_Item *elm_list_item_prev(const Elm_Object_Item *it); /** * Get the item after @p it in list. @@ -759,12 +757,12 @@ EAPI Elm_List_Item *elm_list_item_prev(const Elm_List_Item *it); * * @ingroup List */ -EAPI Elm_List_Item *elm_list_item_next(const Elm_List_Item *it); +EAPI Elm_Object_Item *elm_list_item_next(const Elm_Object_Item *it); /** * Set the text to be shown in a given list item's tooltips. * - * @param item Target item. + * @param it Target item. * @param text The text to set in the content. * * Setup the text as tooltip to object. The item can have only one tooltip, @@ -775,18 +773,18 @@ EAPI Elm_List_Item *elm_list_item_next(const Elm_List_Item *it); * * @ingroup List */ -EAPI void elm_list_item_tooltip_text_set(Elm_List_Item *item, const char *text); +EAPI void elm_list_item_tooltip_text_set(Elm_Object_Item *it, const char *text); /** * @brief Disable size restrictions on an object's tooltip - * @param item The tooltip's anchor object + * @param it The tooltip's anchor object * @param disable If EINA_TRUE, size restrictions are disabled * @return EINA_FALSE on failure, EINA_TRUE on success * * This function allows a tooltip to expand beyond its parant window's canvas. * It will instead be limited only by the size of the display. */ -EAPI Eina_Bool elm_list_item_tooltip_window_mode_set(Elm_List_Item *item, Eina_Bool disable); +EAPI Eina_Bool elm_list_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable); /** * @brief Retrieve size restriction state of an object's tooltip @@ -797,7 +795,7 @@ EAPI Eina_Bool elm_list_item_tooltip_window_mode_set(Elm_List * its parant window's canvas. * It will instead be limited only by the size of the display. */ -EAPI Eina_Bool elm_list_item_tooltip_window_mode_get(const Elm_List_Item *item); +EAPI Eina_Bool elm_list_item_tooltip_window_mode_get(const Elm_Object_Item *it); /** * Set the content to be shown in the tooltip item. @@ -808,7 +806,7 @@ EAPI Eina_Bool elm_list_item_tooltip_window_mode_get(const El * return a valid Evas_Object. This object is then managed fully by * tooltip system and is deleted when the tooltip is gone. * - * @param item the list item being attached a tooltip. + * @param it the list item being attached a tooltip. * @param func the function used to create the tooltip contents. * @param data what to provide to @a func as callback data/context. * @param del_cb called when data is not needed anymore, either when @@ -821,12 +819,12 @@ EAPI Eina_Bool elm_list_item_tooltip_window_mode_get(const El * * @ingroup List */ -EAPI void elm_list_item_tooltip_content_cb_set(Elm_List_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); +EAPI void elm_list_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); /** * Unset tooltip from item. * - * @param item list item to remove previously set tooltip. + * @param it list item to remove previously set tooltip. * * Remove tooltip from item. The callback provided as del_cb to * elm_list_item_tooltip_content_cb_set() will be called to notify @@ -837,7 +835,7 @@ EAPI void elm_list_item_tooltip_content_cb_set(Elm_List_ * * @ingroup List */ -EAPI void elm_list_item_tooltip_unset(Elm_List_Item *item); +EAPI void elm_list_item_tooltip_unset(Elm_Object_Item *it); /** * Sets a different style for this item tooltip. @@ -846,14 +844,14 @@ EAPI void elm_list_item_tooltip_unset(Elm_List_Item *ite * elm_list_item_tooltip_content_cb_set() or * elm_list_item_tooltip_text_set() * - * @param item list item with tooltip already set. + * @param it list item with tooltip already set. * @param style the theme style to use (default, transparent, ...) * * @see elm_object_tooltip_style_set() for more details. * * @ingroup List */ -EAPI void elm_list_item_tooltip_style_set(Elm_List_Item *item, const char *style); +EAPI void elm_list_item_tooltip_style_set(Elm_Object_Item *it, const char *style); /** * Get the style for this item tooltip. @@ -867,13 +865,13 @@ EAPI void elm_list_item_tooltip_style_set(Elm_List_Item * * @ingroup List */ -EAPI const char *elm_list_item_tooltip_style_get(const Elm_List_Item *item); +EAPI const char *elm_list_item_tooltip_style_get(const Elm_Object_Item *it); /** * Set the type of mouse pointer/cursor decoration to be shown, * when the mouse pointer is over the given list widget item * - * @param item list item to customize cursor on + * @param it list item to customize cursor on * @param cursor the cursor type's name * * This function works analogously as elm_object_cursor_set(), but @@ -891,13 +889,13 @@ EAPI const char *elm_list_item_tooltip_style_get(const Elm_List * * @ingroup List */ -EAPI void elm_list_item_cursor_set(Elm_List_Item *item, const char *cursor); +EAPI void elm_list_item_cursor_set(Elm_Object_Item *it, const char *cursor); /* * Get the type of mouse pointer/cursor decoration set to be shown, * when the mouse pointer is over the given list widget item * - * @param item list item with custom cursor set + * @param it list item with custom cursor set * @return the cursor type's name or @c NULL, if no custom cursors * were set to @p item (and on errors) * @@ -907,14 +905,14 @@ EAPI void elm_list_item_cursor_set(Elm_List_Item *item, * * @ingroup List */ -EAPI const char *elm_list_item_cursor_get(const Elm_List_Item *item); +EAPI const char *elm_list_item_cursor_get(const Elm_Object_Item *it); /** * Unset any custom mouse pointer/cursor decoration set to be * shown, when the mouse pointer is over the given list widget * item, thus making it show the @b default cursor again. * - * @param item a list item + * @param it a list item * * Use this call to undo any custom settings on this item's cursor * decoration, bringing it back to defaults (no custom style set). @@ -924,13 +922,13 @@ EAPI const char *elm_list_item_cursor_get(const Elm_List_Item * * * @ingroup List */ -EAPI void elm_list_item_cursor_unset(Elm_List_Item *item); +EAPI void elm_list_item_cursor_unset(Elm_Object_Item *it); /** * Set a different @b style for a given custom cursor set for a * list item. * - * @param item list item with custom cursor set + * @param it list item with custom cursor set * @param style the theme style to use (e.g. @c "default", * @c "transparent", etc) * @@ -949,13 +947,13 @@ EAPI void elm_list_item_cursor_unset(Elm_List_Item *item * * @ingroup List */ -EAPI void elm_list_item_cursor_style_set(Elm_List_Item *item, const char *style); +EAPI void elm_list_item_cursor_style_set(Elm_Object_Item *it, const char *style); /** * Get the current @b style set for a given list item's custom * cursor * - * @param item list item with custom cursor set. + * @param it list item with custom cursor set. * @return style the cursor style in use. If the object does not * have a cursor set, then @c NULL is returned. * @@ -963,14 +961,14 @@ EAPI void elm_list_item_cursor_style_set(Elm_List_Item * * * @ingroup List */ -EAPI const char *elm_list_item_cursor_style_get(const Elm_List_Item *item); +EAPI const char *elm_list_item_cursor_style_get(const Elm_Object_Item *it); /** * Set if the (custom)cursor for a given list item should be * searched in its theme, also, or should only rely on the * rendering engine. * - * @param item item with custom (custom) cursor already set on + * @param it item with custom (custom) cursor already set on * @param engine_only Use @c EINA_TRUE to have cursors looked for * only on those provided by the rendering engine, @c EINA_FALSE to * have them searched on the widget's theme, as well. @@ -983,14 +981,14 @@ EAPI const char *elm_list_item_cursor_style_get(const Elm_List_ * * @ingroup List */ -EAPI void elm_list_item_cursor_engine_only_set(Elm_List_Item *item, Eina_Bool engine_only); +EAPI void elm_list_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only); /** * Get if the (custom) cursor for a given list item is being * searched in its theme, also, or is only relying on the rendering * engine. * - * @param item a list item + * @param it a list item * @return @c EINA_TRUE, if cursors are being looked for only on * those provided by the rendering engine, @c EINA_FALSE if they * are being searched on the widget's theme, as well. @@ -999,7 +997,7 @@ EAPI void elm_list_item_cursor_engine_only_set(Elm_List_ * * @ingroup List */ -EAPI Eina_Bool elm_list_item_cursor_engine_only_get(const Elm_List_Item *item); +EAPI Eina_Bool elm_list_item_cursor_engine_only_get(const Elm_Object_Item *it); /** * @} diff --git a/src/lib/elm_tooltip.h b/src/lib/elm_tooltip.h index 12de1e5..c39d5f6 100644 --- a/src/lib/elm_tooltip.h +++ b/src/lib/elm_tooltip.h @@ -22,7 +22,7 @@ typedef Evas_Object *(*Elm_Tooltip_Content_Cb)(void *data, Evas_Object *obj, Eva * @param obj owner widget. * @param tooltip The tooltip object (affix content to this!) * @param item context dependent item. As an example, if tooltip was - * set on Elm_List_Item, then it is of this type. + * set on elm_list item, then it is of this type. */ typedef Evas_Object *(*Elm_Tooltip_Item_Content_Cb)(void *data, Evas_Object *obj, Evas_Object *tooltip, void *item); diff --git a/src/lib/elm_web.c b/src/lib/elm_web.c index f38801c..8e33608 100644 --- a/src/lib/elm_web.c +++ b/src/lib/elm_web.c @@ -856,14 +856,14 @@ static void _popup_item_selected(void *data, Evas_Object *obj, void *event_info __UNUSED__) { Evas_Object *view = data; - Elm_List_Item *it = elm_list_selected_item_get(obj); + Elm_Object_Item *list_it = elm_list_selected_item_get(obj); const Eina_List *itr, *list = elm_list_items_get(obj); void *d; int i = 0; EINA_LIST_FOREACH(list, itr, d) { - if (d == it) + if (d == list_it) break; i++;