summaryrefslogtreecommitdiff
path: root/legacy/elementary
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-26 00:07:14 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-26 00:07:14 +0000
commit84edf10d93ab847a72255eb267863b82de783db2 (patch)
treee538e21a3296770a936172da84bda757b819320a /legacy/elementary
parent346aec5ad55ebec0b43ccd8f910f91621b5e04ce (diff)
elm multibuttonentry: Refactoring. Use more descriptive name for variable. current -> selected_it.
SVN revision: 69621
Diffstat (limited to 'legacy/elementary')
-rw-r--r--legacy/elementary/src/lib/elc_multibuttonentry.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/legacy/elementary/src/lib/elc_multibuttonentry.c b/legacy/elementary/src/lib/elc_multibuttonentry.c
index 5969f62c35..a6b6523db9 100644
--- a/legacy/elementary/src/lib/elc_multibuttonentry.c
+++ b/legacy/elementary/src/lib/elc_multibuttonentry.c
@@ -64,8 +64,8 @@ struct _Widget_Data
64 MultiButtonEntry_Closed_Button_Type end_type; 64 MultiButtonEntry_Closed_Button_Type end_type;
65 65
66 Eina_List *items; 66 Eina_List *items;
67 Eina_List *current;
68 Eina_List *filter_list; 67 Eina_List *filter_list;
68 Elm_Object_Item *selected_it; /* selected item */
69 69
70 const char *labeltxt, *guidetexttxt; 70 const char *labeltxt, *guidetexttxt;
71 71
@@ -161,7 +161,7 @@ _del_hook(Evas_Object *obj)
161 } 161 }
162 wd->items = NULL; 162 wd->items = NULL;
163 } 163 }
164 wd->current = NULL; 164 wd->selected_it = NULL;
165 165
166 if (wd->labeltxt) eina_stringshare_del(wd->labeltxt); 166 if (wd->labeltxt) eina_stringshare_del(wd->labeltxt);
167 if (wd->guidetexttxt) eina_stringshare_del(wd->guidetexttxt); 167 if (wd->guidetexttxt) eina_stringshare_del(wd->guidetexttxt);
@@ -204,11 +204,11 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
204 204
205 if (elm_widget_focus_get(obj)) 205 if (elm_widget_focus_get(obj))
206 { 206 {
207 if ((wd->current)) 207 if ((wd->selected_it))
208 { 208 {
209 elm_entry_input_panel_show(wd->entry); 209 elm_entry_input_panel_show(wd->entry);
210 } 210 }
211 else if (((!wd->current) || (!eina_list_count(wd->items)))) 211 else if (((!wd->selected_it) || (!eina_list_count(wd->items))))
212 { 212 {
213 if (wd->entry) elm_entry_cursor_end_set(wd->entry); 213 if (wd->entry) elm_entry_cursor_end_set(wd->entry);
214 _view_update(obj); 214 _view_update(obj);
@@ -360,7 +360,7 @@ _set_vis_guidetext(Evas_Object *obj)
360 elm_box_pack_end(wd->box, wd->entry); 360 elm_box_pack_end(wd->box, wd->entry);
361 evas_object_show(wd->entry); 361 evas_object_show(wd->entry);
362 if (elm_widget_focus_get(obj) || wd->focused) 362 if (elm_widget_focus_get(obj) || wd->focused)
363 if (!wd->current) 363 if (!wd->selected_it)
364 elm_object_focus_set(wd->entry, EINA_TRUE); 364 elm_object_focus_set(wd->entry, EINA_TRUE);
365 wd->view_state = MULTIBUTTONENTRY_VIEW_ENTRY; 365 wd->view_state = MULTIBUTTONENTRY_VIEW_ENTRY;
366 } 366 }
@@ -648,8 +648,7 @@ _change_current_button_state(Evas_Object *obj, Multibuttonentry_Button_State sta
648 Elm_Multibuttonentry_Item *item = NULL; 648 Elm_Multibuttonentry_Item *item = NULL;
649 649
650 if (!wd) return; 650 if (!wd) return;
651 if (wd->current) 651 item = (Elm_Multibuttonentry_Item *)wd->selected_it;
652 item = eina_list_data_get(wd->current);
653 652
654 if (item && item->button) 653 if (item && item->button)
655 { 654 {
@@ -657,7 +656,7 @@ _change_current_button_state(Evas_Object *obj, Multibuttonentry_Button_State sta
657 { 656 {
658 case MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT: 657 case MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT:
659 edje_object_signal_emit(item->button, "default", ""); 658 edje_object_signal_emit(item->button, "default", "");
660 wd->current = NULL; 659 wd->selected_it = NULL;
661 break; 660 break;
662 case MULTIBUTTONENTRY_BUTTON_STATE_SELECTED: 661 case MULTIBUTTONENTRY_BUTTON_STATE_SELECTED:
663 edje_object_signal_emit(item->button, "focused", ""); 662 edje_object_signal_emit(item->button, "focused", "");
@@ -665,7 +664,7 @@ _change_current_button_state(Evas_Object *obj, Multibuttonentry_Button_State sta
665 break; 664 break;
666 default: 665 default:
667 edje_object_signal_emit(item->button, "default", ""); 666 edje_object_signal_emit(item->button, "default", "");
668 wd->current = NULL; 667 wd->selected_it = NULL;
669 break; 668 break;
670 } 669 }
671 } 670 }
@@ -688,7 +687,7 @@ _change_current_button(Evas_Object *obj, Evas_Object *btn)
688 { 687 {
689 if (item->button == btn) 688 if (item->button == btn)
690 { 689 {
691 wd->current = l; 690 wd->selected_it = (Elm_Object_Item *)item;
692 break; 691 break;
693 } 692 }
694 } 693 }
@@ -706,8 +705,8 @@ _button_clicked(void *data, Evas_Object *obj, const char *emission __UNUSED__, c
706 705
707 _change_current_button(data, obj); 706 _change_current_button(data, obj);
708 707
709 if (wd->current) 708 if (wd->selected_it)
710 if ((item = eina_list_data_get(wd->current)) != NULL) 709 if ((item = (Elm_Multibuttonentry_Item *)wd->selected_it) != NULL)
711 { 710 {
712 evas_object_smart_callback_call(data, SIG_ITEM_CLICKED, item); 711 evas_object_smart_callback_call(data, SIG_ITEM_CLICKED, item);
713 _select_button(data, item->button); 712 _select_button(data, item->button);
@@ -746,8 +745,8 @@ _del_button_item(Elm_Multibuttonentry_Item *item)
746 745
747 _del_button_obj(obj, _item->button); 746 _del_button_obj(obj, _item->button);
748 747
749 if (wd->current == l) 748 if (wd->selected_it == (Elm_Object_Item *)_item)
750 wd->current = NULL; 749 wd->selected_it = NULL;
751 break; 750 break;
752 } 751 }
753 } 752 }
@@ -1006,11 +1005,11 @@ _evas_mbe_key_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
1006 1005
1007 if (wd->last_btn_select) 1006 if (wd->last_btn_select)
1008 { 1007 {
1009 if (wd->current && 1008 if (wd->selected_it &&
1010 ((strcmp(ev->keyname, "BackSpace") == 0) || 1009 ((strcmp(ev->keyname, "BackSpace") == 0) ||
1011 (strcmp(ev->keyname, "Delete") == 0))) 1010 (strcmp(ev->keyname, "Delete") == 0)))
1012 { 1011 {
1013 item = eina_list_data_get(wd->current); 1012 item = (Elm_Multibuttonentry_Item *)wd->selected_it;
1014 if (item) 1013 if (item)
1015 { 1014 {
1016 _del_button_item(item); 1015 _del_button_item(item);
@@ -1018,7 +1017,7 @@ _evas_mbe_key_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
1018 elm_object_focus_set(wd->entry, EINA_TRUE); 1017 elm_object_focus_set(wd->entry, EINA_TRUE);
1019 } 1018 }
1020 } 1019 }
1021 else if (((!wd->current && (wd->n_str == 0) && 1020 else if (((!wd->selected_it && (wd->n_str == 0) &&
1022 (strcmp(ev->keyname, "BackSpace") == 0)) || 1021 (strcmp(ev->keyname, "BackSpace") == 0)) ||
1023 (strcmp(ev->keyname, "Delete") == 0))) 1022 (strcmp(ev->keyname, "Delete") == 0)))
1024 { 1023 {
@@ -1079,9 +1078,9 @@ _entry_focus_in_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
1079 1078
1080 if (!wd) return; 1079 if (!wd) return;
1081 1080
1082 if (wd->current) 1081 if (wd->selected_it)
1083 { 1082 {
1084 item = eina_list_data_get(wd->current); 1083 item = (Elm_Multibuttonentry_Item *)wd->selected_it;
1085 elm_object_focus_set(wd->entry, EINA_FALSE); 1084 elm_object_focus_set(wd->entry, EINA_FALSE);
1086 evas_object_focus_set(item->button, EINA_TRUE); 1085 evas_object_focus_set(item->button, EINA_TRUE);
1087 } 1086 }
@@ -1568,7 +1567,7 @@ elm_multibuttonentry_selected_item_get(const Evas_Object *obj)
1568 ELM_CHECK_WIDTYPE(obj, widtype) NULL; 1567 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1569 Widget_Data *wd = elm_widget_data_get(obj); 1568 Widget_Data *wd = elm_widget_data_get(obj);
1570 if (!wd) return NULL; 1569 if (!wd) return NULL;
1571 return eina_list_data_get(wd->current); 1570 return wd->selected_it;
1572} 1571}
1573 1572
1574EAPI void 1573EAPI void
@@ -1606,7 +1605,7 @@ elm_multibuttonentry_clear(Evas_Object *obj)
1606 } 1605 }
1607 wd->items = NULL; 1606 wd->items = NULL;
1608 } 1607 }
1609 wd->current = NULL; 1608 wd->selected_it = NULL;
1610 _view_update(obj); 1609 _view_update(obj);
1611} 1610}
1612 1611