summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-05-06 17:33:22 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:32 +0300
commitde6b1373b0e7d5dade7b7d04306373f3440de51e (patch)
treea328e98a9a764b0ed839e01202edd06118470932
parent1959634ac3b61f41ad321ca10a64d1e9460a4c7c (diff)
elc_multibuttonentry: porting evas smart callbacks to eo
-rw-r--r--src/lib/elc_multibuttonentry.c91
-rw-r--r--src/lib/elm_multibuttonentry.eo1
2 files changed, 53 insertions, 39 deletions
diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c
index 4bf2e5b36..fb5eafbd2 100644
--- a/src/lib/elc_multibuttonentry.c
+++ b/src/lib/elc_multibuttonentry.c
@@ -240,8 +240,8 @@ _shrink_mode_set(Evas_Object *obj,
240 evas_object_show(sd->end); 240 evas_object_show(sd->end);
241 241
242 sd->view_state = MULTIBUTTONENTRY_VIEW_SHRINK; 242 sd->view_state = MULTIBUTTONENTRY_VIEW_SHRINK;
243 evas_object_smart_callback_call 243 eo_do(obj, eo_event_callback_call
244 (obj, SIG_EXPAND_STATE_CHANGED, (void *)1); 244 (ELM_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED, (void *)1));
245 break; 245 break;
246 } 246 }
247 } 247 }
@@ -273,8 +273,9 @@ _shrink_mode_set(Evas_Object *obj,
273 } 273 }
274 274
275 sd->view_state = MULTIBUTTONENTRY_VIEW_NONE; 275 sd->view_state = MULTIBUTTONENTRY_VIEW_NONE;
276 evas_object_smart_callback_call 276 eo_do(obj, eo_event_callback_call
277 (obj, SIG_EXPAND_STATE_CHANGED, (void *)(uintptr_t)sd->shrink); 277 (ELM_MULTIBUTTONENTRY_EVENT_EXPAND_STATE_CHANGED,
278 (void *)(uintptr_t)sd->shrink));
278 } 279 }
279 280
280 if (sd->view_state != MULTIBUTTONENTRY_VIEW_SHRINK) 281 if (sd->view_state != MULTIBUTTONENTRY_VIEW_SHRINK)
@@ -329,14 +330,16 @@ _elm_multibuttonentry_elm_widget_on_focus(Eo *obj, Elm_Multibuttonentry_Data *sd
329 elm_entry_input_panel_show(sd->entry); 330 elm_entry_input_panel_show(sd->entry);
330 } 331 }
331 } 332 }
332 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL); 333 eo_do(obj, eo_event_callback_call
334 (ELM_MULTIBUTTONENTRY_EVENT_FOCUSED, NULL));
333 } 335 }
334 else 336 else
335 { 337 {
336 _view_update(sd); 338 _view_update(sd);
337 339
338 elm_entry_input_panel_hide(sd->entry); 340 elm_entry_input_panel_hide(sd->entry);
339 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL); 341 eo_do(obj, eo_event_callback_call
342 (ELM_MULTIBUTTONENTRY_EVENT_UNFOCUSED, NULL));
340 } 343 }
341 344
342end: 345end:
@@ -360,7 +363,8 @@ _item_del(Elm_Multibuttonentry_Item_Data *item)
360 sd->items = eina_list_remove(sd->items, eo_it); 363 sd->items = eina_list_remove(sd->items, eo_it);
361 elm_box_unpack(sd->box, VIEW(it)); 364 elm_box_unpack(sd->box, VIEW(it));
362 365
363 evas_object_smart_callback_call(obj, SIG_ITEM_DELETED, eo_it); 366 eo_do(obj, eo_event_callback_call
367 (ELM_MULTIBUTTONENTRY_EVENT_ITEM_DELETED, eo_it));
364 368
365 evas_object_del(VIEW(it)); 369 evas_object_del(VIEW(it));
366 370
@@ -393,7 +397,8 @@ _current_item_state_change(Evas_Object *obj,
393 { 397 {
394 case MULTIBUTTONENTRY_BUTTON_STATE_SELECTED: 398 case MULTIBUTTONENTRY_BUTTON_STATE_SELECTED:
395 elm_layout_signal_emit(VIEW(item), "elm,state,focused", "elm"); 399 elm_layout_signal_emit(VIEW(item), "elm,state,focused", "elm");
396 evas_object_smart_callback_call(obj, SIG_ITEM_SELECTED, EO_OBJ(item)); 400 eo_do(obj, eo_event_callback_call
401 (ELM_MULTIBUTTONENTRY_EVENT_ITEM_SELECTED, EO_OBJ(item)));
397 break; 402 break;
398 case MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT: 403 case MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT:
399 default: 404 default:
@@ -492,7 +497,8 @@ _on_item_clicked(void *data,
492 _item_select(WIDGET(it), it); 497 _item_select(WIDGET(it), it);
493 498
494 if (sd->selected_it) 499 if (sd->selected_it)
495 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_CLICKED, eo_it); 500 eo_do(WIDGET(it), eo_event_callback_call
501 (ELM_MULTIBUTTONENTRY_EVENT_ITEM_CLICKED, eo_it));
496} 502}
497 503
498static void 504static void
@@ -528,7 +534,8 @@ _long_press_cb(void *data)
528 534
529 sd->longpress_timer = NULL; 535 sd->longpress_timer = NULL;
530 536
531 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_LONGPRESSED, EO_OBJ(it)); 537 eo_do(WIDGET(it), eo_event_callback_call
538 (ELM_MULTIBUTTONENTRY_EVENT_ITEM_LONGPRESSED, EO_OBJ(it)));
532 539
533 return ECORE_CALLBACK_CANCEL; 540 return ECORE_CALLBACK_CANCEL;
534} 541}
@@ -863,7 +870,8 @@ _item_new(Elm_Multibuttonentry_Data *sd,
863 default: 870 default:
864 break; 871 break;
865 } 872 }
866 evas_object_smart_callback_call(obj, SIG_ITEM_ADDED, eo_item); 873 eo_do(obj, eo_event_callback_call
874 (ELM_MULTIBUTTONENTRY_EVENT_ITEM_ADDED, eo_item));
867 875
868 return eo_item; 876 return eo_item;
869} 877}
@@ -904,7 +912,7 @@ _mouse_clicked_signal_cb(void *data EINA_UNUSED,
904 const char *emission EINA_UNUSED, 912 const char *emission EINA_UNUSED,
905 const char *source EINA_UNUSED) 913 const char *source EINA_UNUSED)
906{ 914{
907 evas_object_smart_callback_call(obj, SIG_CLICKED, NULL); 915 eo_do(obj, eo_event_callback_call(ELM_MULTIBUTTONENTRY_EVENT_CLICKED, NULL));
908} 916}
909 917
910static void 918static void
@@ -922,9 +930,11 @@ _box_resize_cb(void *data,
922 evas_object_geometry_get(sd->box, NULL, NULL, &w, &h); 930 evas_object_geometry_get(sd->box, NULL, NULL, &w, &h);
923 931
924 if (sd->h_box < h) 932 if (sd->h_box < h)
925 evas_object_smart_callback_call(sd->parent, SIG_EXPANDED, NULL); 933 eo_do(sd->parent, eo_event_callback_call
934 (ELM_MULTIBUTTONENTRY_EVENT_EXPANDED, NULL));
926 else if (sd->h_box > h) 935 else if (sd->h_box > h)
927 evas_object_smart_callback_call(sd->parent, SIG_CONTRACTED, NULL); 936 eo_do(sd->parent, eo_event_callback_call
937 (ELM_MULTIBUTTONENTRY_EVENT_CONTRACTED, NULL));
928 938
929 if (sd->w_box && sd->w_box != w) 939 if (sd->w_box && sd->w_box != w)
930 { 940 {
@@ -957,7 +967,6 @@ _box_resize_cb(void *data,
957 sd->w_box = w; 967 sd->w_box = w;
958 sd->h_box = h; 968 sd->h_box = h;
959} 969}
960
961static void 970static void
962_entry_resize_cb(void *data, 971_entry_resize_cb(void *data,
963 Evas *e EINA_UNUSED, 972 Evas *e EINA_UNUSED,
@@ -973,25 +982,25 @@ _entry_resize_cb(void *data,
973 elm_widget_show_region_set(sd->entry, en_x, en_y, en_w, en_h, EINA_TRUE); 982 elm_widget_show_region_set(sd->entry, en_x, en_y, en_w, en_h, EINA_TRUE);
974} 983}
975 984
976static void 985static Eina_Bool
977_entry_changed_cb(void *data, 986_entry_changed_cb(void *data,
978 Evas_Object *obj EINA_UNUSED, 987 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
979 void *event_info EINA_UNUSED)
980{ 988{
981 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 989 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(data, sd, EINA_TRUE);
982 const char *str; 990 const char *str;
983 991
984 str = elm_object_text_get(sd->entry); 992 str = elm_object_text_get(sd->entry);
985 sd->n_str = str ? strlen(str) : 0; 993 sd->n_str = str ? strlen(str) : 0;
994
995 return EINA_TRUE;
986} 996}
987 997
988static void 998static Eina_Bool
989_entry_focus_in_cb(void *data, 999_entry_focus_in_cb(void *data,
990 Evas_Object *obj EINA_UNUSED, 1000 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
991 void *event_info EINA_UNUSED)
992{ 1001{
993 Elm_Multibuttonentry_Item_Data *item = NULL; 1002 Elm_Multibuttonentry_Item_Data *item = NULL;
994 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 1003 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(data, sd, EINA_TRUE);
995 1004
996 if (sd->selected_it) 1005 if (sd->selected_it)
997 { 1006 {
@@ -999,30 +1008,34 @@ _entry_focus_in_cb(void *data,
999 elm_object_focus_set(sd->entry, EINA_FALSE); 1008 elm_object_focus_set(sd->entry, EINA_FALSE);
1000 evas_object_focus_set(VIEW(item), EINA_TRUE); 1009 evas_object_focus_set(VIEW(item), EINA_TRUE);
1001 } 1010 }
1011
1012 return EINA_TRUE;
1002} 1013}
1003 1014
1004static void 1015static Eina_Bool
1005_entry_focus_out_cb(void *data, 1016_entry_focus_out_cb(void *data,
1006 Evas_Object *obj EINA_UNUSED, 1017 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1007 void *event_info EINA_UNUSED)
1008{ 1018{
1009 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 1019 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(data, sd, EINA_TRUE);
1010 const char *str; 1020 const char *str;
1011 1021
1012 str = elm_object_text_get(sd->entry); 1022 str = elm_object_text_get(sd->entry);
1013 if (str && str[0]) 1023 if (str && str[0])
1014 _item_new(sd, str, MULTIBUTTONENTRY_POS_END, NULL, NULL, NULL); 1024 _item_new(sd, str, MULTIBUTTONENTRY_POS_END, NULL, NULL, NULL);
1025
1026 return EINA_TRUE;
1015} 1027}
1016 1028
1017static void 1029static Eina_Bool
1018_entry_clicked_cb(void *data, 1030_entry_clicked_cb(void *data,
1019 Evas_Object *obj EINA_UNUSED, 1031 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1020 void *event_info EINA_UNUSED)
1021{ 1032{
1022 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); 1033 ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(data, sd, EINA_TRUE);
1023 1034
1024 _current_item_state_change(sd->parent, MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT); 1035 _current_item_state_change(sd->parent, MULTIBUTTONENTRY_BUTTON_STATE_DEFAULT);
1025 elm_object_focus_set(sd->entry, EINA_TRUE); 1036 elm_object_focus_set(sd->entry, EINA_TRUE);
1037
1038 return EINA_TRUE;
1026} 1039}
1027 1040
1028static void 1041static void
@@ -1123,14 +1136,14 @@ _callbacks_register(Evas_Object *obj)
1123 (sd->entry, EVAS_CALLBACK_KEY_DOWN, _entry_key_down_cb, obj); 1136 (sd->entry, EVAS_CALLBACK_KEY_DOWN, _entry_key_down_cb, obj);
1124 evas_object_event_callback_add 1137 evas_object_event_callback_add
1125 (sd->entry, EVAS_CALLBACK_RESIZE, _entry_resize_cb, obj); 1138 (sd->entry, EVAS_CALLBACK_RESIZE, _entry_resize_cb, obj);
1126 evas_object_smart_callback_add 1139 eo_do(sd->entry, eo_event_callback_add
1127 (sd->entry, "changed", _entry_changed_cb, obj); 1140 (ELM_MULTIBUTTONENTRY_EVENT_CHANGED, _entry_changed_cb, obj));
1128 evas_object_smart_callback_add 1141 eo_do(sd->entry, eo_event_callback_add
1129 (sd->entry, "focused", _entry_focus_in_cb, obj); 1142 (ELM_MULTIBUTTONENTRY_EVENT_FOCUSED, _entry_focus_in_cb, obj));
1130 evas_object_smart_callback_add 1143 eo_do(sd->entry, eo_event_callback_add
1131 (sd->entry, "unfocused", _entry_focus_out_cb, obj); 1144 (ELM_MULTIBUTTONENTRY_EVENT_UNFOCUSED, _entry_focus_out_cb, obj));
1132 evas_object_smart_callback_add 1145 eo_do(sd->entry, eo_event_callback_add
1133 (sd->entry, "clicked", _entry_clicked_cb, obj); 1146 (ELM_MULTIBUTTONENTRY_EVENT_CLICKED, _entry_clicked_cb, obj));
1134} 1147}
1135 1148
1136static void 1149static void
diff --git a/src/lib/elm_multibuttonentry.eo b/src/lib/elm_multibuttonentry.eo
index 8f4dc7ca3..d7c885c80 100644
--- a/src/lib/elm_multibuttonentry.eo
+++ b/src/lib/elm_multibuttonentry.eo
@@ -279,6 +279,7 @@ class Elm.Multibuttonentry (Elm.Layout)
279 expanded; 279 expanded;
280 contracted; 280 contracted;
281 expand,state,changed; 281 expand,state,changed;
282 changed;
282 } 283 }
283 284
284} 285}