summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-05-13 15:49:40 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:33 +0300
commit268b440ff876278b0beaa59d3f5da88a60682e29 (patch)
tree2667f6c8d665c245e3c38ce26eaaff261f1ddecb
parent32eceee93225d7353e54fa5a7e0beb6e364e789a (diff)
elm_spinner, elm_index: porting evas smart callbacks to eo
-rw-r--r--src/lib/elm_index.c30
-rw-r--r--src/lib/elm_spinner.c107
2 files changed, 79 insertions, 58 deletions
diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c
index 6195ff57b..14c9d1d90 100644
--- a/src/lib/elm_index.c
+++ b/src/lib/elm_index.c
@@ -509,7 +509,8 @@ _delay_change_cb(void *data)
509 509
510 sd->delay = NULL; 510 sd->delay = NULL;
511 item = elm_index_selected_item_get(data, sd->level); 511 item = elm_index_selected_item_get(data, sd->level);
512 if (item) evas_object_smart_callback_call(data, SIG_DELAY_CHANGED, item); 512 if (item) eo_do(data, eo_event_callback_call
513 (ELM_INDEX_EVENT_DELAY_CHANGED, item));
513 514
514 return ECORE_CALLBACK_CANCEL; 515 return ECORE_CALLBACK_CANCEL;
515} 516}
@@ -667,12 +668,12 @@ _sel_eval(Evas_Object *obj,
667 _elm_access_say(ret); 668 _elm_access_say(ret);
668 } 669 }
669 670
670 if (om_closest) 671 if (om_closest)
671 evas_object_smart_callback_call 672 eo_do(obj, eo_event_callback_call
672 (obj, SIG_CHANGED, EO_OBJ(om_closest)); 673 (ELM_INDEX_EVENT_CHANGED, EO_OBJ(om_closest)));
673 else 674 else
674 evas_object_smart_callback_call 675 eo_do(obj, eo_event_callback_call
675 (obj, SIG_CHANGED, EO_OBJ(it)); 676 (ELM_INDEX_EVENT_CHANGED, EO_OBJ(it)));
676 ecore_timer_del(sd->delay); 677 ecore_timer_del(sd->delay);
677 sd->delay = ecore_timer_add(sd->delay_change_time, 678 sd->delay = ecore_timer_add(sd->delay_change_time,
678 _delay_change_cb, obj); 679 _delay_change_cb, obj);
@@ -763,7 +764,8 @@ _on_mouse_up(void *data,
763 eo_item = elm_index_selected_item_get(data, sd->level); 764 eo_item = elm_index_selected_item_get(data, sd->level);
764 if (eo_item) 765 if (eo_item)
765 { 766 {
766 evas_object_smart_callback_call(data, SIG_SELECTED, eo_item); 767 eo_do(data, eo_event_callback_call
768 (ELM_INDEX_EVENT_SELECTED, eo_item));
767 eo_id_item = eo_item; 769 eo_id_item = eo_item;
768 ELM_INDEX_ITEM_DATA_GET(eo_id_item, id_item); 770 ELM_INDEX_ITEM_DATA_GET(eo_id_item, id_item);
769 if (id_item->func) 771 if (id_item->func)
@@ -811,7 +813,8 @@ _on_mouse_move(void *data,
811 sd->level = 1; 813 sd->level = 1;
812 snprintf(buf, sizeof(buf), "elm,state,level,%i", sd->level); 814 snprintf(buf, sizeof(buf), "elm,state,level,%i", sd->level);
813 elm_layout_signal_emit(data, buf, "elm"); 815 elm_layout_signal_emit(data, buf, "elm");
814 evas_object_smart_callback_call(data, SIG_LEVEL_UP, NULL); 816 eo_do(data, eo_event_callback_call
817 (ELM_INDEX_EVENT_LEVEL_UP, NULL));
815 } 818 }
816 } 819 }
817 else 820 else
@@ -821,7 +824,8 @@ _on_mouse_move(void *data,
821 sd->level = 0; 824 sd->level = 0;
822 snprintf(buf, sizeof(buf), "elm,state,level,%i", sd->level); 825 snprintf(buf, sizeof(buf), "elm,state,level,%i", sd->level);
823 elm_layout_signal_emit(data, buf, "elm"); 826 elm_layout_signal_emit(data, buf, "elm");
824 evas_object_smart_callback_call(data, SIG_LEVEL_DOWN, NULL); 827 eo_do(data, eo_event_callback_call
828 (ELM_INDEX_EVENT_LEVEL_DOWN, NULL));
825 } 829 }
826 } 830 }
827 } 831 }
@@ -1216,10 +1220,10 @@ _elm_index_item_selected_set(Eo *eo_it,
1216 edje_object_signal_emit(VIEW(it_active), "elm,state,active", "elm"); 1220 edje_object_signal_emit(VIEW(it_active), "elm,state,active", "elm");
1217 edje_object_message_signal_process(VIEW(it_active)); 1221 edje_object_message_signal_process(VIEW(it_active));
1218 1222
1219 evas_object_smart_callback_call 1223 eo_do(obj, eo_event_callback_call
1220 (obj, SIG_CHANGED, eo_it); 1224 (ELM_INDEX_EVENT_CHANGED, eo_it));
1221 evas_object_smart_callback_call 1225 eo_do(obj, eo_event_callback_call
1222 (obj, SIG_SELECTED, eo_it); 1226 (ELM_INDEX_EVENT_SELECTED, eo_it));
1223 ecore_timer_del(sd->delay); 1227 ecore_timer_del(sd->delay);
1224 sd->delay = ecore_timer_add(sd->delay_change_time, 1228 sd->delay = ecore_timer_add(sd->delay_change_time,
1225 _delay_change_cb, obj); 1229 _delay_change_cb, obj);
diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index 654e1a67a..192300017 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -132,7 +132,7 @@ _delay_change_timer_cb(void *data)
132 ELM_SPINNER_DATA_GET(data, sd); 132 ELM_SPINNER_DATA_GET(data, sd);
133 133
134 sd->delay_change_timer = NULL; 134 sd->delay_change_timer = NULL;
135 evas_object_smart_callback_call(data, SIG_DELAY_CHANGED, NULL); 135 eo_do(data, eo_event_callback_call(ELM_SPINNER_EVENT_DELAY_CHANGED, NULL));
136 136
137 return ECORE_CALLBACK_CANCEL; 137 return ECORE_CALLBACK_CANCEL;
138} 138}
@@ -165,7 +165,7 @@ _value_set(Evas_Object *obj,
165 if (new_val == sd->val) return EINA_FALSE; 165 if (new_val == sd->val) return EINA_FALSE;
166 sd->val = new_val; 166 sd->val = new_val;
167 167
168 evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); 168 eo_do(obj, eo_event_callback_call(ELM_SPINNER_EVENT_CHANGED, NULL));
169 elm_interface_atspi_accessible_value_changed_signal_emit(obj); 169 elm_interface_atspi_accessible_value_changed_signal_emit(obj);
170 ecore_timer_del(sd->delay_change_timer); 170 ecore_timer_del(sd->delay_change_timer);
171 sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME, 171 sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME,
@@ -243,7 +243,8 @@ _drag_start_cb(void *data,
243 sd->drag_prev_pos = 0; 243 sd->drag_prev_pos = 0;
244 sd->drag_val_step = 1; 244 sd->drag_val_step = 1;
245 245
246 evas_object_smart_callback_call(obj, SIG_DRAG_START, NULL); 246 eo_do(obj, eo_event_callback_call
247 (ELM_SPINNER_EVENT_SPINNER_DRAG_START, NULL));
247} 248}
248 249
249static void 250static void
@@ -260,7 +261,8 @@ _drag_stop_cb(void *data,
260 edje_object_part_drag_value_set 261 edje_object_part_drag_value_set
261 (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0); 262 (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0);
262 263
263 evas_object_smart_callback_call(obj, SIG_DRAG_STOP, NULL); 264 eo_do(obj, eo_event_callback_call
265 (ELM_SPINNER_EVENT_SPINNER_DRAG_STOP, NULL));
264} 266}
265 267
266static void 268static void
@@ -297,18 +299,19 @@ _entry_value_apply(Evas_Object *obj)
297 elm_spinner_value_set(obj, val); 299 elm_spinner_value_set(obj, val);
298} 300}
299 301
300static void 302static Eina_Bool
301_entry_activated_cb(void *data, 303_entry_activated_cb(void *data,
302 Evas_Object *obj EINA_UNUSED, 304 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
303 void *event_info EINA_UNUSED)
304{ 305{
305 ELM_SPINNER_DATA_GET(data, sd); 306 ELM_SPINNER_DATA_GET(data, sd);
306 307
307 _entry_value_apply(data); 308 _entry_value_apply(data);
308 evas_object_smart_callback_call(data, SIG_CHANGED, NULL); 309 eo_do(data, eo_event_callback_call(ELM_SPINNER_EVENT_CHANGED, NULL));
309 ecore_timer_del(sd->delay_change_timer); 310 ecore_timer_del(sd->delay_change_timer);
310 sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME, 311 sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME,
311 _delay_change_timer_cb, data); 312 _delay_change_timer_cb, data);
313
314 return EINA_TRUE;
312} 315}
313 316
314static void 317static void
@@ -353,8 +356,8 @@ _toggle_entry(Evas_Object *obj)
353 (sd->ent, EVAS_CALLBACK_SHOW, _entry_show_cb, obj); 356 (sd->ent, EVAS_CALLBACK_SHOW, _entry_show_cb, obj);
354 } 357 }
355 elm_entry_single_line_set(sd->ent, EINA_TRUE); 358 elm_entry_single_line_set(sd->ent, EINA_TRUE);
356 evas_object_smart_callback_add 359 eo_do(sd->ent, eo_event_callback_add
357 (sd->ent, "activated", _entry_activated_cb, obj); 360 (ELM_ENTRY_EVENT_ACTIVATED, _entry_activated_cb, obj));
358 elm_layout_content_set(obj, "elm.swallow.entry", sd->ent); 361 elm_layout_content_set(obj, "elm.swallow.entry", sd->ent);
359 } 362 }
360 if (!sd->button_layout) 363 if (!sd->button_layout)
@@ -587,10 +590,9 @@ _button_dec_stop_cb(void *data,
587 _spin_stop(data); 590 _spin_stop(data);
588} 591}
589 592
590static void 593static Eina_Bool
591_inc_button_clicked_cb(void *data, 594_inc_button_clicked_cb(void *data,
592 Evas_Object *obj EINA_UNUSED, 595 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
593 void *event_info EINA_UNUSED)
594{ 596{
595 ELM_SPINNER_DATA_GET(data, sd); 597 ELM_SPINNER_DATA_GET(data, sd);
596 598
@@ -601,12 +603,13 @@ _inc_button_clicked_cb(void *data,
601 if (sd->entry_visible) _entry_value_apply(data); 603 if (sd->entry_visible) _entry_value_apply(data);
602 if (_elm_config->access_mode) 604 if (_elm_config->access_mode)
603 _access_increment_decrement_info_say(data, EINA_TRUE); 605 _access_increment_decrement_info_say(data, EINA_TRUE);
606
607 return EINA_TRUE;
604} 608}
605 609
606static void 610static Eina_Bool
607_inc_button_pressed_cb(void *data, 611_inc_button_pressed_cb(void *data,
608 Evas_Object *obj EINA_UNUSED, 612 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
609 void *event_info EINA_UNUSED)
610{ 613{
611 ELM_SPINNER_DATA_GET(data, sd); 614 ELM_SPINNER_DATA_GET(data, sd);
612 615
@@ -616,12 +619,13 @@ _inc_button_pressed_cb(void *data,
616 _val_inc_start, data); 619 _val_inc_start, data);
617 620
618 if (sd->entry_visible) _entry_value_apply(data); 621 if (sd->entry_visible) _entry_value_apply(data);
622
623 return EINA_TRUE;
619} 624}
620 625
621static void 626static Eina_Bool
622_inc_button_unpressed_cb(void *data, 627_inc_button_unpressed_cb(void *data,
623 Evas_Object *obj EINA_UNUSED, 628 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
624 void *event_info EINA_UNUSED)
625{ 629{
626 ELM_SPINNER_DATA_GET(data, sd); 630 ELM_SPINNER_DATA_GET(data, sd);
627 631
@@ -631,20 +635,22 @@ _inc_button_unpressed_cb(void *data,
631 sd->longpress_timer = NULL; 635 sd->longpress_timer = NULL;
632 } 636 }
633 _spin_stop(data); 637 _spin_stop(data);
638
639 return EINA_TRUE;
634} 640}
635 641
636static void 642static Eina_Bool
637_text_button_clicked_cb(void *data, 643_text_button_clicked_cb(void *data,
638 Evas_Object *obj EINA_UNUSED, 644 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
639 void *event_info EINA_UNUSED)
640{ 645{
641 _toggle_entry(data); 646 _toggle_entry(data);
647
648 return EINA_TRUE;
642} 649}
643 650
644static void 651static Eina_Bool
645_dec_button_clicked_cb(void *data, 652_dec_button_clicked_cb(void *data,
646 Evas_Object *obj EINA_UNUSED, 653 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
647 void *event_info EINA_UNUSED)
648{ 654{
649 ELM_SPINNER_DATA_GET(data, sd); 655 ELM_SPINNER_DATA_GET(data, sd);
650 656
@@ -656,12 +662,13 @@ _dec_button_clicked_cb(void *data,
656 662
657 if (_elm_config->access_mode) 663 if (_elm_config->access_mode)
658 _access_increment_decrement_info_say(data, EINA_FALSE); 664 _access_increment_decrement_info_say(data, EINA_FALSE);
665
666 return EINA_TRUE;
659} 667}
660 668
661static void 669static Eina_Bool
662_dec_button_pressed_cb(void *data, 670_dec_button_pressed_cb(void *data,
663 Evas_Object *obj EINA_UNUSED, 671 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
664 void *event_info EINA_UNUSED)
665{ 672{
666 ELM_SPINNER_DATA_GET(data, sd); 673 ELM_SPINNER_DATA_GET(data, sd);
667 674
@@ -671,12 +678,13 @@ _dec_button_pressed_cb(void *data,
671 _val_dec_start, data); 678 _val_dec_start, data);
672 679
673 if (sd->entry_visible) _entry_value_apply(data); 680 if (sd->entry_visible) _entry_value_apply(data);
681
682 return EINA_TRUE;
674} 683}
675 684
676static void 685static Eina_Bool
677_dec_button_unpressed_cb(void *data, 686_dec_button_unpressed_cb(void *data,
678 Evas_Object *obj EINA_UNUSED, 687 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
679 void *event_info EINA_UNUSED)
680{ 688{
681 ELM_SPINNER_DATA_GET(data, sd); 689 ELM_SPINNER_DATA_GET(data, sd);
682 690
@@ -686,6 +694,8 @@ _dec_button_unpressed_cb(void *data,
686 sd->longpress_timer = NULL; 694 sd->longpress_timer = NULL;
687 } 695 }
688 _spin_stop(data); 696 _spin_stop(data);
697
698 return EINA_TRUE;
689} 699}
690 700
691EOLIAN static void 701EOLIAN static void
@@ -968,12 +978,15 @@ _elm_spinner_evas_object_smart_add(Eo *obj, Elm_Spinner_Data *priv)
968 priv->inc_button = elm_button_add(obj); 978 priv->inc_button = elm_button_add(obj);
969 elm_object_style_set(priv->inc_button, "spinner/increase/default"); 979 elm_object_style_set(priv->inc_button, "spinner/increase/default");
970 980
971 evas_object_smart_callback_add 981 eo_do(priv->inc_button, eo_event_callback_add
972 (priv->inc_button, "clicked", _inc_button_clicked_cb, obj); 982 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _inc_button_clicked_cb,
973 evas_object_smart_callback_add 983 obj));
974 (priv->inc_button, "pressed", _inc_button_pressed_cb, obj); 984 eo_do(priv->inc_button, eo_event_callback_add
975 evas_object_smart_callback_add 985 (EVAS_CLICKABLE_INTERFACE_EVENT_PRESSED, _inc_button_pressed_cb,
976 (priv->inc_button, "unpressed", _inc_button_unpressed_cb, obj); 986 obj));
987 eo_do(priv->inc_button, eo_event_callback_add
988 (EVAS_CLICKABLE_INTERFACE_EVENT_UNPRESSED, _inc_button_unpressed_cb,
989 obj));
977 990
978 elm_layout_content_set(obj, "elm.swallow.inc_button", priv->inc_button); 991 elm_layout_content_set(obj, "elm.swallow.inc_button", priv->inc_button);
979 elm_widget_sub_object_add(obj, priv->inc_button); 992 elm_widget_sub_object_add(obj, priv->inc_button);
@@ -981,8 +994,9 @@ _elm_spinner_evas_object_smart_add(Eo *obj, Elm_Spinner_Data *priv)
981 priv->text_button = elm_button_add(obj); 994 priv->text_button = elm_button_add(obj);
982 elm_object_style_set(priv->text_button, "spinner/default"); 995 elm_object_style_set(priv->text_button, "spinner/default");
983 996
984 evas_object_smart_callback_add 997 eo_do(priv->text_button, eo_event_callback_add
985 (priv->text_button, "clicked", _text_button_clicked_cb, obj); 998 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _text_button_clicked_cb,
999 obj));
986 1000
987 elm_layout_content_set(obj, "elm.swallow.text_button", priv->text_button); 1001 elm_layout_content_set(obj, "elm.swallow.text_button", priv->text_button);
988 elm_widget_sub_object_add(obj, priv->text_button); 1002 elm_widget_sub_object_add(obj, priv->text_button);
@@ -990,12 +1004,15 @@ _elm_spinner_evas_object_smart_add(Eo *obj, Elm_Spinner_Data *priv)
990 priv->dec_button = elm_button_add(obj); 1004 priv->dec_button = elm_button_add(obj);
991 elm_object_style_set(priv->dec_button, "spinner/decrease/default"); 1005 elm_object_style_set(priv->dec_button, "spinner/decrease/default");
992 1006
993 evas_object_smart_callback_add 1007 eo_do(priv->dec_button, eo_event_callback_add
994 (priv->dec_button, "clicked", _dec_button_clicked_cb, obj); 1008 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _dec_button_clicked_cb,
995 evas_object_smart_callback_add 1009 obj));
996 (priv->dec_button, "pressed", _dec_button_pressed_cb, obj); 1010 eo_do(priv->dec_button, eo_event_callback_add
997 evas_object_smart_callback_add 1011 (EVAS_CLICKABLE_INTERFACE_EVENT_PRESSED, _dec_button_pressed_cb,
998 (priv->dec_button, "unpressed", _dec_button_unpressed_cb, obj); 1012 obj));
1013 eo_do(priv->dec_button, eo_event_callback_add
1014 (EVAS_CLICKABLE_INTERFACE_EVENT_UNPRESSED, _dec_button_unpressed_cb,
1015 obj));
999 1016
1000 elm_layout_content_set(obj, "elm.swallow.dec_button", priv->dec_button); 1017 elm_layout_content_set(obj, "elm.swallow.dec_button", priv->dec_button);
1001 elm_widget_sub_object_add(obj, priv->dec_button); 1018 elm_widget_sub_object_add(obj, priv->dec_button);