summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-08 03:35:26 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-08 03:35:26 +0900
commitb205061bbcff3cfd2bdcffc5d376d0a72f7c5cab (patch)
treea3a069e33f80d3a0534b291d48933bf70e8b54b0
parenta4dd04e1051080c7b0cdd017bc01f90672e45b88 (diff)
-rw-r--r--src/lib/elm_config.c1
-rw-r--r--src/lib/elm_list.c158
2 files changed, 98 insertions, 61 deletions
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 7b6296646..23cd69020 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -3026,6 +3026,7 @@ _elm_config_init(void)
3026 _elm_recache(); 3026 _elm_recache();
3027 _elm_clouseau_reload(); 3027 _elm_clouseau_reload();
3028 _elm_config_key_binding_hash(); 3028 _elm_config_key_binding_hash();
3029 printf("config %d\n", _elm_config->item_select_mode_on_dir_key);
3029} 3030}
3030 3031
3031void 3032void
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 8df8f4844..4cb74151a 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -58,6 +58,7 @@ static void _mouse_up_cb(void *, Evas *, Evas_Object *, void *);
58static void _mouse_down_cb(void *, Evas *, Evas_Object *, void *); 58static void _mouse_down_cb(void *, Evas *, Evas_Object *, void *);
59static void _mouse_move_cb(void *, Evas *, Evas_Object *, void *); 59static void _mouse_move_cb(void *, Evas *, Evas_Object *, void *);
60static void _items_fix(Evas_Object *); 60static void _items_fix(Evas_Object *);
61static void _elm_list_item_selected_set(Elm_Object_Item *it, Eina_Bool selected, Eina_Bool dir_key);
61 62
62static inline void 63static inline void
63_elm_list_item_free(Elm_List_Item *it) 64_elm_list_item_free(Elm_List_Item *it)
@@ -133,13 +134,13 @@ _item_multi_select_down(Elm_List_Smart_Data *sd)
133} 134}
134 135
135static Eina_Bool 136static Eina_Bool
136_all_items_unselect(Elm_List_Smart_Data *sd) 137_all_items_unselect(Elm_List_Smart_Data *sd, Eina_Bool dir_key)
137{ 138{
138 if (!sd->selected) return EINA_FALSE; 139 if (!sd->selected) return EINA_FALSE;
139 140
140 while (sd->selected) 141 while (sd->selected)
141 elm_list_item_selected_set 142 _elm_list_item_selected_set
142 ((Elm_Object_Item *)sd->selected->data, EINA_FALSE); 143 ((Elm_Object_Item *)sd->selected->data, EINA_FALSE, dir_key);
143 144
144 return EINA_TRUE; 145 return EINA_TRUE;
145} 146}
@@ -149,6 +150,7 @@ _item_single_select_up(Elm_List_Smart_Data *sd)
149{ 150{
150 Elm_Object_Item *prev; 151 Elm_Object_Item *prev;
151 152
153 printf("%s %d\n", __func__, __LINE__);
152 if (!sd->selected) prev = eina_list_data_get(eina_list_last(sd->items)); 154 if (!sd->selected) prev = eina_list_data_get(eina_list_last(sd->items));
153 else 155 else
154 { 156 {
@@ -159,11 +161,13 @@ _item_single_select_up(Elm_List_Smart_Data *sd)
159 prev = elm_list_item_prev(prev); 161 prev = elm_list_item_prev(prev);
160 } 162 }
161 } 163 }
164 printf("%s %d\n", __func__, __LINE__);
162 if (!prev) return EINA_FALSE; 165 if (!prev) return EINA_FALSE;
163 166
164 _all_items_unselect(sd); 167 printf("%s %d\n", __func__, __LINE__);
168 _all_items_unselect(sd, EINA_TRUE);
165 169
166 elm_list_item_selected_set(prev, EINA_TRUE); 170 _elm_list_item_selected_set(prev, EINA_TRUE, EINA_TRUE);
167 171
168 return EINA_TRUE; 172 return EINA_TRUE;
169} 173}
@@ -185,9 +189,9 @@ _item_single_select_down(Elm_List_Smart_Data *sd)
185 } 189 }
186 if (!next) return EINA_FALSE; 190 if (!next) return EINA_FALSE;
187 191
188 _all_items_unselect(sd); 192 _all_items_unselect(sd, EINA_TRUE);
189 193
190 elm_list_item_selected_set(next, EINA_TRUE); 194 _elm_list_item_selected_set(next, EINA_TRUE, EINA_TRUE);
191 195
192 return EINA_TRUE; 196 return EINA_TRUE;
193} 197}
@@ -335,7 +339,7 @@ _elm_list_smart_event(Eo *obj, void *_pd, va_list *list)
335 if ((!strcmp(ev->key, "Left")) || 339 if ((!strcmp(ev->key, "Left")) ||
336 ((!strcmp(ev->key, "KP_Left")) && !ev->string)) 340 ((!strcmp(ev->key, "KP_Left")) && !ev->string))
337 { 341 {
338 it = (Elm_List_Item *)elm_list_selected_item_get(obj); 342 it = (Elm_List_Item *)elm_object_focused_item_get(obj);
339 Eina_Bool focused = _elm_list_item_content_focus_set( 343 Eina_Bool focused = _elm_list_item_content_focus_set(
340 it, ELM_FOCUS_LEFT, sd->h_mode); 344 it, ELM_FOCUS_LEFT, sd->h_mode);
341 345
@@ -360,7 +364,7 @@ _elm_list_smart_event(Eo *obj, void *_pd, va_list *list)
360 else if ((!strcmp(ev->key, "Right")) || 364 else if ((!strcmp(ev->key, "Right")) ||
361 ((!strcmp(ev->key, "KP_Right")) && !ev->string)) 365 ((!strcmp(ev->key, "KP_Right")) && !ev->string))
362 { 366 {
363 it = (Elm_List_Item *)elm_list_selected_item_get(obj); 367 it = (Elm_List_Item *)elm_object_focused_item_get(obj);
364 Eina_Bool focused = _elm_list_item_content_focus_set( 368 Eina_Bool focused = _elm_list_item_content_focus_set(
365 it, ELM_FOCUS_RIGHT, sd->h_mode); 369 it, ELM_FOCUS_RIGHT, sd->h_mode);
366 370
@@ -385,7 +389,7 @@ _elm_list_smart_event(Eo *obj, void *_pd, va_list *list)
385 else if ((!strcmp(ev->key, "Up")) || 389 else if ((!strcmp(ev->key, "Up")) ||
386 ((!strcmp(ev->key, "KP_Up")) && !ev->string)) 390 ((!strcmp(ev->key, "KP_Up")) && !ev->string))
387 { 391 {
388 it = (Elm_List_Item *)elm_list_selected_item_get(obj); 392 it = (Elm_List_Item *)elm_object_focused_item_get(obj);
389 Eina_Bool focused = _elm_list_item_content_focus_set( 393 Eina_Bool focused = _elm_list_item_content_focus_set(
390 it, ELM_FOCUS_UP, sd->h_mode); 394 it, ELM_FOCUS_UP, sd->h_mode);
391 395
@@ -410,6 +414,7 @@ _elm_list_smart_event(Eo *obj, void *_pd, va_list *list)
410 else if ((!strcmp(ev->key, "Down")) || 414 else if ((!strcmp(ev->key, "Down")) ||
411 ((!strcmp(ev->key, "KP_Down")) && !ev->string)) 415 ((!strcmp(ev->key, "KP_Down")) && !ev->string))
412 { 416 {
417 it = (Elm_List_Item *)elm_object_focused_item_get(obj);
413 it = (Elm_List_Item *)elm_list_selected_item_get(obj); 418 it = (Elm_List_Item *)elm_list_selected_item_get(obj);
414 Eina_Bool focused = _elm_list_item_content_focus_set( 419 Eina_Bool focused = _elm_list_item_content_focus_set(
415 it, ELM_FOCUS_DOWN, sd->h_mode); 420 it, ELM_FOCUS_DOWN, sd->h_mode);
@@ -491,12 +496,12 @@ _elm_list_smart_event(Eo *obj, void *_pd, va_list *list)
491 (!strcmp(ev->key, "space"))) 496 (!strcmp(ev->key, "space")))
492 && (!sd->multi) && (sd->selected)) 497 && (!sd->multi) && (sd->selected))
493 { 498 {
494 it = (Elm_List_Item *)elm_list_selected_item_get(obj); 499 it = (Elm_List_Item *)elm_object_focused_item_get(obj);
495 if (it) evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it); 500 if (it) evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
496 } 501 }
497 else if (!strcmp(ev->key, "Escape")) 502 else if (!strcmp(ev->key, "Escape"))
498 { 503 {
499 if (!_all_items_unselect(sd)) return; 504 if (!_all_items_unselect(sd, EINA_FALSE)) return;
500 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 505 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
501 if (ret) *ret = EINA_TRUE; 506 if (ret) *ret = EINA_TRUE;
502 return; 507 return;
@@ -935,7 +940,7 @@ _elm_list_smart_disable(Eo *obj, void *_pd, va_list *list)
935 elm_widget_scroll_hold_push(obj); 940 elm_widget_scroll_hold_push(obj);
936 /* FIXME: if we get to have a way to only un-highlight items 941 /* FIXME: if we get to have a way to only un-highlight items
937 * in the future, keeping them selected... */ 942 * in the future, keeping them selected... */
938 _all_items_unselect(sd); 943 _all_items_unselect(sd, EINA_FALSE);
939 } 944 }
940 else 945 else
941 { 946 {
@@ -1123,7 +1128,7 @@ end:
1123} 1128}
1124 1129
1125static void 1130static void
1126_item_highlight(Elm_List_Item *it) 1131_item_highlight(Elm_List_Item *it, Eina_Bool dir_key)
1127{ 1132{
1128 Evas_Object *obj; 1133 Evas_Object *obj;
1129 const char *select_raise; 1134 const char *select_raise;
@@ -1132,9 +1137,16 @@ _item_highlight(Elm_List_Item *it)
1132 obj = WIDGET(it); 1137 obj = WIDGET(it);
1133 ELM_LIST_DATA_GET(obj, sd); 1138 ELM_LIST_DATA_GET(obj, sd);
1134 1139
1140 printf("%s %d\n", __func__, __LINE__);
1135 if ((it->highlighted) || (it->base.disabled) || 1141 if ((it->highlighted) || (it->base.disabled) ||
1136 (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) return; 1142 (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) return;
1143 printf("%s %d\n", __func__, __LINE__);
1144 if (dir_key &&
1145 (_elm_config->item_select_mode_on_dir_key ==
1146 ELM_ITEM_SELECT_MODE_ON_DIR_KEY_NONE))
1147 return;
1137 1148
1149 printf("%s %d\n", __func__, __LINE__);
1138 evas_object_ref(obj); 1150 evas_object_ref(obj);
1139 _elm_list_walk(sd); 1151 _elm_list_walk(sd);
1140 1152
@@ -1150,7 +1162,7 @@ _item_highlight(Elm_List_Item *it)
1150} 1162}
1151 1163
1152static void 1164static void
1153_item_select(Elm_List_Item *it) 1165_item_select(Elm_List_Item *it, Eina_Bool dir_key)
1154{ 1166{
1155 Evas_Object *obj; 1167 Evas_Object *obj;
1156 1168
@@ -1160,6 +1172,7 @@ _item_select(Elm_List_Item *it)
1160 1172
1161 if (it->base.disabled || (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) 1173 if (it->base.disabled || (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE))
1162 return; 1174 return;
1175
1163 if (it->selected) 1176 if (it->selected)
1164 { 1177 {
1165 if (sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS) goto call; 1178 if (sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS) goto call;
@@ -1168,6 +1181,11 @@ _item_select(Elm_List_Item *it)
1168 1181
1169 _elm_list_item_content_focus_set(it, ELM_FOCUS_PREVIOUS, sd->h_mode); 1182 _elm_list_item_content_focus_set(it, ELM_FOCUS_PREVIOUS, sd->h_mode);
1170 1183
1184 if (dir_key &&
1185 (_elm_config->item_select_mode_on_dir_key !=
1186 ELM_ITEM_SELECT_MODE_ON_DIR_KEY_SELECT))
1187 return;
1188
1171 it->selected = EINA_TRUE; 1189 it->selected = EINA_TRUE;
1172 sd->selected = eina_list_append(sd->selected, it); 1190 sd->selected = eina_list_append(sd->selected, it);
1173 1191
@@ -1184,7 +1202,7 @@ call:
1184} 1202}
1185 1203
1186static void 1204static void
1187_item_unhighlight(Elm_List_Item *it) 1205_item_unhighlight(Elm_List_Item *it, Eina_Bool dir_key)
1188{ 1206{
1189 Evas_Object *obj; 1207 Evas_Object *obj;
1190 const char *stacking, *select_raise; 1208 const char *stacking, *select_raise;
@@ -1196,6 +1214,10 @@ _item_unhighlight(Elm_List_Item *it)
1196// if ((!it->highlighted) || (it->base.disabled) || 1214// if ((!it->highlighted) || (it->base.disabled) ||
1197// (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) return; 1215// (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) return;
1198 if (!it->highlighted) return; 1216 if (!it->highlighted) return;
1217 if (dir_key &&
1218 (_elm_config->item_select_mode_on_dir_key ==
1219 ELM_ITEM_SELECT_MODE_ON_DIR_KEY_NONE))
1220 return;
1199 1221
1200 evas_object_ref(obj); 1222 evas_object_ref(obj);
1201 _elm_list_walk(sd); 1223 _elm_list_walk(sd);
@@ -1216,7 +1238,7 @@ _item_unhighlight(Elm_List_Item *it)
1216} 1238}
1217 1239
1218static void 1240static void
1219_item_unselect(Elm_List_Item *it) 1241_item_unselect(Elm_List_Item *it, Eina_Bool dir_key)
1220{ 1242{
1221 Evas_Object *obj; 1243 Evas_Object *obj;
1222 1244
@@ -1236,6 +1258,11 @@ _item_unselect(Elm_List_Item *it)
1236 if (it->end) elm_object_focus_set(it->end, EINA_FALSE); 1258 if (it->end) elm_object_focus_set(it->end, EINA_FALSE);
1237 } 1259 }
1238 1260
1261 if (dir_key &&
1262 (_elm_config->item_select_mode_on_dir_key ==
1263 ELM_ITEM_SELECT_MODE_ON_DIR_KEY_SELECT))
1264 goto end;
1265
1239 if (it->selected) 1266 if (it->selected)
1240 { 1267 {
1241 it->selected = EINA_FALSE; 1268 it->selected = EINA_FALSE;
@@ -1245,6 +1272,7 @@ _item_unselect(Elm_List_Item *it)
1245 evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it); 1272 evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
1246 } 1273 }
1247 1274
1275end:
1248 _elm_list_unwalk(obj, sd); 1276 _elm_list_unwalk(obj, sd);
1249 evas_object_unref(obj); 1277 evas_object_unref(obj);
1250} 1278}
@@ -1357,8 +1385,8 @@ _mouse_move_cb(void *data,
1357 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 1385 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
1358 if (!sd->was_selected) 1386 if (!sd->was_selected)
1359 { 1387 {
1360 _item_unhighlight(it); 1388 _item_unhighlight(it, EINA_FALSE);
1361 _item_unselect(it); 1389 _item_unselect(it, EINA_FALSE);
1362 } 1390 }
1363 } 1391 }
1364 if (sd->movements == ELM_LIST_SWIPE_MOVES) sd->swipe = EINA_TRUE; 1392 if (sd->movements == ELM_LIST_SWIPE_MOVES) sd->swipe = EINA_TRUE;
@@ -1401,7 +1429,7 @@ _mouse_down_cb(void *data,
1401 evas_object_ref(obj); 1429 evas_object_ref(obj);
1402 _elm_list_walk(sd); 1430 _elm_list_walk(sd);
1403 1431
1404 _item_highlight(it); 1432 _item_highlight(it, EINA_FALSE);
1405 sd->longpressed = EINA_FALSE; 1433 sd->longpressed = EINA_FALSE;
1406 ecore_timer_del(it->long_timer); 1434 ecore_timer_del(it->long_timer);
1407 it->long_timer = ecore_timer_add 1435 it->long_timer = ecore_timer_add
@@ -1452,8 +1480,8 @@ _mouse_up_cb(void *data,
1452 { 1480 {
1453 if (!sd->was_selected) 1481 if (!sd->was_selected)
1454 { 1482 {
1455 _item_unhighlight(it); 1483 _item_unhighlight(it, EINA_FALSE);
1456 _item_unselect(it); 1484 _item_unselect(it, EINA_FALSE);
1457 } 1485 }
1458 sd->was_selected = 0; 1486 sd->was_selected = 0;
1459 return; 1487 return;
@@ -1473,13 +1501,13 @@ _mouse_up_cb(void *data,
1473 { 1501 {
1474 if (!it->selected) 1502 if (!it->selected)
1475 { 1503 {
1476 _item_highlight(it); 1504 _item_highlight(it, EINA_FALSE);
1477 _item_select(it); 1505 _item_select(it, EINA_FALSE);
1478 } 1506 }
1479 else 1507 else
1480 { 1508 {
1481 _item_unhighlight(it); 1509 _item_unhighlight(it, EINA_FALSE);
1482 _item_unselect(it); 1510 _item_unselect(it, EINA_FALSE);
1483 } 1511 }
1484 } 1512 }
1485 else 1513 else
@@ -1491,11 +1519,11 @@ _mouse_up_cb(void *data,
1491 Elm_List_Item *it2 = sd->selected->data; 1519 Elm_List_Item *it2 = sd->selected->data;
1492 sd->selected = eina_list_remove_list 1520 sd->selected = eina_list_remove_list
1493 (sd->selected, sd->selected); 1521 (sd->selected, sd->selected);
1494 _item_unhighlight(it2); 1522 _item_unhighlight(it2, EINA_FALSE);
1495 _item_unselect(it2); 1523 _item_unselect(it2, EINA_FALSE);
1496 } 1524 }
1497 _item_highlight(it); 1525 _item_highlight(it, EINA_FALSE);
1498 _item_select(it); 1526 _item_select(it, EINA_FALSE);
1499 } 1527 }
1500 else 1528 else
1501 { 1529 {
@@ -1505,11 +1533,11 @@ _mouse_up_cb(void *data,
1505 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, it2) 1533 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, it2)
1506 if (it2 != it) 1534 if (it2 != it)
1507 { 1535 {
1508 _item_unhighlight(it2); 1536 _item_unhighlight(it2, EINA_FALSE);
1509 _item_unselect(it2); 1537 _item_unselect(it2, EINA_FALSE);
1510 } 1538 }
1511 _item_highlight(it); 1539 _item_highlight(it, EINA_FALSE);
1512 _item_select(it); 1540 _item_select(it, EINA_FALSE);
1513 } 1541 }
1514 } 1542 }
1515 1543
@@ -1522,8 +1550,8 @@ _item_disable_hook(Elm_Object_Item *it)
1522{ 1550{
1523 Elm_List_Item *item = (Elm_List_Item *)it; 1551 Elm_List_Item *item = (Elm_List_Item *)it;
1524 1552
1525 _item_unhighlight(item); 1553 _item_unhighlight(item, EINA_FALSE);
1526 _item_unselect(item); 1554 _item_unselect(item, EINA_FALSE);
1527 if (item->base.disabled) 1555 if (item->base.disabled)
1528 edje_object_signal_emit(VIEW(item), "elm,state,disabled", "elm"); 1556 edje_object_signal_emit(VIEW(item), "elm,state,disabled", "elm");
1529 else 1557 else
@@ -1656,8 +1684,8 @@ _item_del_pre_hook(Elm_Object_Item *it)
1656 1684
1657 if (item->selected) 1685 if (item->selected)
1658 { 1686 {
1659 _item_unhighlight(item); 1687 _item_unhighlight(item, EINA_FALSE);
1660 _item_unselect(item); 1688 _item_unselect(item, EINA_FALSE);
1661 } 1689 }
1662 1690
1663 if (sd->walking > 0) 1691 if (sd->walking > 0)
@@ -1783,13 +1811,13 @@ _access_activate_cb(void *data EINA_UNUSED,
1783 { 1811 {
1784 if (!it->selected) 1812 if (!it->selected)
1785 { 1813 {
1786 _item_highlight(it); 1814 _item_highlight(it, EINA_FALSE);
1787 _item_select(it); 1815 _item_select(it, EINA_FALSE);
1788 } 1816 }
1789 else 1817 else
1790 { 1818 {
1791 _item_unhighlight(it); 1819 _item_unhighlight(it, EINA_FALSE);
1792 _item_unselect(it); 1820 _item_unselect(it, EINA_FALSE);
1793 } 1821 }
1794 } 1822 }
1795 else 1823 else
@@ -1798,11 +1826,11 @@ _access_activate_cb(void *data EINA_UNUSED,
1798 { 1826 {
1799 while (sd->selected) 1827 while (sd->selected)
1800 { 1828 {
1801 _item_unhighlight(sd->selected->data); 1829 _item_unhighlight(sd->selected->data, EINA_FALSE);
1802 _item_unselect(sd->selected->data); 1830 _item_unselect(sd->selected->data, EINA_FALSE);
1803 } 1831 }
1804 _item_highlight(it); 1832 _item_highlight(it, EINA_FALSE);
1805 _item_select(it); 1833 _item_select(it, EINA_FALSE);
1806 } 1834 }
1807 else 1835 else
1808 { 1836 {
@@ -1812,11 +1840,11 @@ _access_activate_cb(void *data EINA_UNUSED,
1812 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, it2) 1840 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, it2)
1813 if (it2 != it) 1841 if (it2 != it)
1814 { 1842 {
1815 _item_unhighlight(it2); 1843 _item_unhighlight(it2, EINA_FALSE);
1816 _item_unselect(it2); 1844 _item_unselect(it2, EINA_FALSE);
1817 } 1845 }
1818 _item_highlight(it); 1846 _item_highlight(it, EINA_FALSE);
1819 _item_select(it); 1847 _item_select(it, EINA_FALSE);
1820 } 1848 }
1821 } 1849 }
1822 1850
@@ -2748,19 +2776,20 @@ elm_list_item_separator_get(const Elm_Object_Item *it)
2748 return ((Elm_List_Item *)it)->is_separator; 2776 return ((Elm_List_Item *)it)->is_separator;
2749} 2777}
2750 2778
2751EAPI void 2779static void
2752elm_list_item_selected_set(Elm_Object_Item *it, 2780_elm_list_item_selected_set(Elm_Object_Item *item,
2753 Eina_Bool selected) 2781 Eina_Bool selected,
2782 Eina_Bool dir_key)
2754{ 2783{
2755 Elm_List_Item *item = (Elm_List_Item *)it;
2756 Evas_Object *obj; 2784 Evas_Object *obj;
2785 Elm_List_Item *it = (Elm_List_Item *)item;
2757 2786
2758 ELM_LIST_ITEM_CHECK_OR_RETURN(it); 2787 ELM_LIST_ITEM_CHECK_OR_RETURN(it);
2759 obj = WIDGET(it); 2788 obj = WIDGET(it);
2760 ELM_LIST_DATA_GET(obj, sd); 2789 ELM_LIST_DATA_GET(obj, sd);
2761 2790
2762 selected = !!selected; 2791 selected = !!selected;
2763 if (item->selected == selected) return; 2792 if (it->selected == selected) return;
2764 2793
2765 evas_object_ref(obj); 2794 evas_object_ref(obj);
2766 _elm_list_walk(sd); 2795 _elm_list_walk(sd);
@@ -2771,23 +2800,30 @@ elm_list_item_selected_set(Elm_Object_Item *it,
2771 { 2800 {
2772 while (sd->selected) 2801 while (sd->selected)
2773 { 2802 {
2774 _item_unhighlight(sd->selected->data); 2803 _item_unhighlight(sd->selected->data, dir_key);
2775 _item_unselect(sd->selected->data); 2804 _item_unselect(sd->selected->data, dir_key);
2776 } 2805 }
2777 } 2806 }
2778 _item_highlight(item); 2807 _item_highlight(it, dir_key);
2779 _item_select(item); 2808 _item_select(it, dir_key);
2780 } 2809 }
2781 else 2810 else
2782 { 2811 {
2783 _item_unhighlight(item); 2812 _item_unhighlight(it, dir_key);
2784 _item_unselect(item); 2813 _item_unselect(it, dir_key);
2785 } 2814 }
2786 2815
2787 _elm_list_unwalk(obj, sd); 2816 _elm_list_unwalk(obj, sd);
2788 evas_object_unref(obj); 2817 evas_object_unref(obj);
2789} 2818}
2790 2819
2820EAPI void
2821elm_list_item_selected_set(Elm_Object_Item *it,
2822 Eina_Bool selected)
2823{
2824 _elm_list_item_selected_set(it, selected, EINA_FALSE);
2825}
2826
2791EAPI Eina_Bool 2827EAPI Eina_Bool
2792elm_list_item_selected_get(const Elm_Object_Item *it) 2828elm_list_item_selected_get(const Elm_Object_Item *it)
2793{ 2829{