summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-05-07 15:44:02 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:32 +0300
commitdb79ddba5ae41432a24c670f1dd410cecf831f9b (patch)
tree55c150a78274e3f4f5ffd8dda3e57080c50f3377
parent48b494964b84853c27f9348d8152095d8742e19c (diff)
elm_photocam: porting evas smart callbacks to eo
-rw-r--r--src/lib/elm_photocam.c81
-rw-r--r--src/lib/elm_photocam.eo11
2 files changed, 49 insertions, 43 deletions
diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c
index 7d2723049..a384ca8c7 100644
--- a/src/lib/elm_photocam.c
+++ b/src/lib/elm_photocam.c
@@ -137,7 +137,7 @@ _calc_job_cb(void *data)
137 sd->minw = minw; 137 sd->minw = minw;
138 sd->minh = minh; 138 sd->minh = minh;
139 139
140 evas_object_smart_callback_call(sd->pan_obj, "changed", NULL); 140 eo_do(sd->pan_obj, eo_event_callback_call(ELM_PAN_EVENT_CHANGED, NULL));
141 _sizing_eval(obj); 141 _sizing_eval(obj);
142 } 142 }
143 sd->calc_job = NULL; 143 sd->calc_job = NULL;
@@ -258,8 +258,8 @@ _grid_load(Evas_Object *obj,
258 edje_object_signal_emit 258 edje_object_signal_emit
259 (wd->resize_obj, 259 (wd->resize_obj,
260 "elm,state,busy,start", "elm"); 260 "elm,state,busy,start", "elm");
261 evas_object_smart_callback_call 261 eo_do(obj, eo_event_callback_call
262 (obj, SIG_LOAD_DETAIL, NULL); 262 (ELM_PHOTOCAM_EVENT_LOAD_DETAIL, NULL));
263 } 263 }
264 } 264 }
265 else if ((g->grid[tn].want) && (!visible)) 265 else if ((g->grid[tn].want) && (!visible))
@@ -270,8 +270,8 @@ _grid_load(Evas_Object *obj,
270 edje_object_signal_emit 270 edje_object_signal_emit
271 (wd->resize_obj, 271 (wd->resize_obj,
272 "elm,state,busy,stop", "elm"); 272 "elm,state,busy,stop", "elm");
273 evas_object_smart_callback_call 273 eo_do(obj, eo_event_callback_call
274 (obj, SIG_LOADED_DETAIL, NULL); 274 (ELM_PHOTOCAM_EVENT_LOADED_DETAIL, NULL));
275 } 275 }
276 g->grid[tn].want = 0; 276 g->grid[tn].want = 0;
277 evas_object_hide(g->grid[tn].img); 277 evas_object_hide(g->grid[tn].img);
@@ -468,8 +468,8 @@ _grid_clear(Evas_Object *obj,
468 edje_object_signal_emit 468 edje_object_signal_emit
469 (wd->resize_obj, 469 (wd->resize_obj,
470 "elm,state,busy,stop", "elm"); 470 "elm,state,busy,stop", "elm");
471 evas_object_smart_callback_call 471 eo_do(obj, eo_event_callback_call
472 (obj, SIG_LOAD_DETAIL, NULL); 472 (ELM_PHOTOCAM_EVENT_LOAD_DETAIL, NULL));
473 } 473 }
474 } 474 }
475 } 475 }
@@ -501,8 +501,8 @@ _tile_preloaded_cb(void *data,
501 edje_object_signal_emit 501 edje_object_signal_emit
502 (wd->resize_obj, "elm,state,busy,stop", 502 (wd->resize_obj, "elm,state,busy,stop",
503 "elm"); 503 "elm");
504 evas_object_smart_callback_call 504 eo_do(wd->obj, eo_event_callback_call
505 (wd->obj, SIG_LOADED_DETAIL, NULL); 505 (ELM_PHOTOCAM_EVENT_LOADED_DETAIL, NULL));
506 } 506 }
507 } 507 }
508} 508}
@@ -698,13 +698,14 @@ _main_img_preloaded_cb(void *data,
698 } 698 }
699 ecore_job_del(sd->calc_job); 699 ecore_job_del(sd->calc_job);
700 sd->calc_job = ecore_job_add(_calc_job_cb, data); 700 sd->calc_job = ecore_job_add(_calc_job_cb, data);
701 evas_object_smart_callback_call(data, SIG_LOADED, NULL); 701 eo_do(data, eo_event_callback_call(ELM_PHOTOCAM_EVENT_LOADED, NULL));
702 sd->preload_num--; 702 sd->preload_num--;
703 if (!sd->preload_num) 703 if (!sd->preload_num)
704 { 704 {
705 edje_object_signal_emit 705 edje_object_signal_emit
706 (wd->resize_obj, "elm,state,busy,stop", "elm"); 706 (wd->resize_obj, "elm,state,busy,stop", "elm");
707 evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL, NULL); 707 eo_do(obj, eo_event_callback_call
708 (ELM_PHOTOCAM_EVENT_LOADED_DETAIL, NULL));
708 } 709 }
709} 710}
710 711
@@ -788,7 +789,7 @@ _zoom_anim_cb(void *data)
788 sd->no_smooth--; 789 sd->no_smooth--;
789 if (!sd->no_smooth) _smooth_update(data); 790 if (!sd->no_smooth) _smooth_update(data);
790 sd->zoom_animator = NULL; 791 sd->zoom_animator = NULL;
791 evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); 792 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_ZOOM_STOP, NULL));
792 } 793 }
793 794
794 return go; 795 return go;
@@ -801,7 +802,8 @@ _long_press_cb(void *data)
801 802
802 sd->long_timer = NULL; 803 sd->long_timer = NULL;
803 sd->longpressed = EINA_TRUE; 804 sd->longpressed = EINA_TRUE;
804 evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL); 805 eo_do(data, eo_event_callback_call
806 (EVAS_CLICKABLE_INTERFACE_EVENT_LONGPRESSED, NULL));
805 807
806 return ECORE_CALLBACK_CANCEL; 808 return ECORE_CALLBACK_CANCEL;
807} 809}
@@ -820,9 +822,10 @@ _mouse_down_cb(void *data,
820 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold = EINA_TRUE; 822 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold = EINA_TRUE;
821 else sd->on_hold = EINA_FALSE; 823 else sd->on_hold = EINA_FALSE;
822 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) 824 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
823 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL); 825 eo_do(data, eo_event_callback_call
826 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED_DOUBLE, NULL));
824 else 827 else
825 evas_object_smart_callback_call(data, SIG_PRESS, NULL); 828 eo_do(data, eo_event_callback_call(ELM_PHOTOCAM_EVENT_PRESS, NULL));
826 sd->longpressed = EINA_FALSE; 829 sd->longpressed = EINA_FALSE;
827 ecore_timer_del(sd->long_timer); 830 ecore_timer_del(sd->long_timer);
828 sd->long_timer = ecore_timer_add 831 sd->long_timer = ecore_timer_add
@@ -844,7 +847,8 @@ _mouse_up_cb(void *data,
844 else sd->on_hold = EINA_FALSE; 847 else sd->on_hold = EINA_FALSE;
845 ELM_SAFE_FREE(sd->long_timer, ecore_timer_del); 848 ELM_SAFE_FREE(sd->long_timer, ecore_timer_del);
846 if (!sd->on_hold) 849 if (!sd->on_hold)
847 evas_object_smart_callback_call(data, SIG_CLICKED, NULL); 850 eo_do(data, eo_event_callback_call
851 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, NULL));
848 sd->on_hold = EINA_FALSE; 852 sd->on_hold = EINA_FALSE;
849} 853}
850 854
@@ -889,28 +893,32 @@ static void
889_scroll_animate_start_cb(Evas_Object *obj, 893_scroll_animate_start_cb(Evas_Object *obj,
890 void *data EINA_UNUSED) 894 void *data EINA_UNUSED)
891{ 895{
892 evas_object_smart_callback_call(obj, SIG_SCROLL_ANIM_START, NULL); 896 eo_do(obj, eo_event_callback_call
897 (EVAS_SCROLLABLE_INTERFACE_EVENT_SCROLL_ANIM_START, NULL));
893} 898}
894 899
895static void 900static void
896_scroll_animate_stop_cb(Evas_Object *obj, 901_scroll_animate_stop_cb(Evas_Object *obj,
897 void *data EINA_UNUSED) 902 void *data EINA_UNUSED)
898{ 903{
899 evas_object_smart_callback_call(obj, SIG_SCROLL_ANIM_STOP, NULL); 904 eo_do(obj, eo_event_callback_call
905 (EVAS_SCROLLABLE_INTERFACE_EVENT_SCROLL_ANIM_STOP, NULL));
900} 906}
901 907
902static void 908static void
903_scroll_drag_start_cb(Evas_Object *obj, 909_scroll_drag_start_cb(Evas_Object *obj,
904 void *data EINA_UNUSED) 910 void *data EINA_UNUSED)
905{ 911{
906 evas_object_smart_callback_call(obj, SIG_SCROLL_DRAG_START, NULL); 912 eo_do(obj, eo_event_callback_call
913 (EVAS_SCROLLABLE_INTERFACE_EVENT_SCROLL_DRAG_START, NULL));
907} 914}
908 915
909static void 916static void
910_scroll_drag_stop_cb(Evas_Object *obj, 917_scroll_drag_stop_cb(Evas_Object *obj,
911 void *data EINA_UNUSED) 918 void *data EINA_UNUSED)
912{ 919{
913 evas_object_smart_callback_call(obj, SIG_SCROLL_DRAG_STOP, NULL); 920 eo_do(obj, eo_event_callback_call
921 (EVAS_SCROLLABLE_INTERFACE_EVENT_SCROLL_DRAG_STOP, NULL));
914} 922}
915 923
916static void 924static void
@@ -928,7 +936,8 @@ _scroll_cb(Evas_Object *obj,
928 ecore_timer_del(sd->scr_timer); 936 ecore_timer_del(sd->scr_timer);
929 sd->scr_timer = ecore_timer_add(0.5, _scroll_timeout_cb, obj); 937 sd->scr_timer = ecore_timer_add(0.5, _scroll_timeout_cb, obj);
930 938
931 evas_object_smart_callback_call(obj, SIG_SCROLL, NULL); 939 eo_do(obj, eo_event_callback_call
940 (EVAS_SCROLLABLE_INTERFACE_EVENT_SCROLL, NULL));
932} 941}
933 942
934static Eina_Bool 943static Eina_Bool
@@ -1547,13 +1556,13 @@ _internal_file_set(Eo *obj, Elm_Photocam_Data *sd, const char *file, Eina_File *
1547 sd->main_load_pending = EINA_TRUE; 1556 sd->main_load_pending = EINA_TRUE;
1548 1557
1549 sd->calc_job = ecore_job_add(_calc_job_cb, obj); 1558 sd->calc_job = ecore_job_add(_calc_job_cb, obj);
1550 evas_object_smart_callback_call(obj, SIG_LOAD, NULL); 1559 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_LOAD, NULL));
1551 sd->preload_num++; 1560 sd->preload_num++;
1552 if (sd->preload_num == 1) 1561 if (sd->preload_num == 1)
1553 { 1562 {
1554 edje_object_signal_emit 1563 edje_object_signal_emit
1555 (wd->resize_obj, "elm,state,busy,start", "elm"); 1564 (wd->resize_obj, "elm,state,busy,start", "elm");
1556 evas_object_smart_callback_call(obj, SIG_LOAD_DETAIL, NULL); 1565 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_LOAD_DETAIL, NULL));
1557 } 1566 }
1558 1567
1559 tz = sd->zoom; 1568 tz = sd->zoom;
@@ -1589,11 +1598,13 @@ _elm_photocam_download_done(void *data, Elm_Url *url EINA_UNUSED, Eina_Binbuf *d
1589 1598
1590 free(sd->remote_data); 1599 free(sd->remote_data);
1591 sd->remote_data = NULL; 1600 sd->remote_data = NULL;
1592 evas_object_smart_callback_call(obj, SIG_DOWNLOAD_ERROR, &err); 1601 eo_do(obj, eo_event_callback_call
1602 (ELM_PHOTOCAM_EVENT_DOWNLOAD_ERROR, &err));
1593 } 1603 }
1594 else 1604 else
1595 { 1605 {
1596 evas_object_smart_callback_call(obj, SIG_DOWNLOAD_DONE, NULL); 1606 eo_do(obj, eo_event_callback_call
1607 (ELM_PHOTOCAM_EVENT_DOWNLOAD_DONE, NULL));
1597 } 1608 }
1598 1609
1599 sd->remote = NULL; 1610 sd->remote = NULL;
@@ -1606,7 +1617,7 @@ _elm_photocam_download_cancel(void *data, Elm_Url *url EINA_UNUSED, int error)
1606 Elm_Photocam_Data *sd = eo_data_scope_get(obj, MY_CLASS); 1617 Elm_Photocam_Data *sd = eo_data_scope_get(obj, MY_CLASS);
1607 Elm_Photocam_Error err = { error, EINA_FALSE }; 1618 Elm_Photocam_Error err = { error, EINA_FALSE };
1608 1619
1609 evas_object_smart_callback_call(obj, SIG_DOWNLOAD_ERROR, &err); 1620 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_DOWNLOAD_ERROR, &err));
1610 1621
1611 sd->remote = NULL; 1622 sd->remote = NULL;
1612} 1623}
@@ -1619,7 +1630,8 @@ _elm_photocam_download_progress(void *data, Elm_Url *url EINA_UNUSED, double now
1619 1630
1620 progress.now = now; 1631 progress.now = now;
1621 progress.total = total; 1632 progress.total = total;
1622 evas_object_smart_callback_call(obj, SIG_DOWNLOAD_PROGRESS, &progress); 1633 eo_do(obj, eo_event_callback_call
1634 (ELM_PHOTOCAM_EVENT_DOWNLOAD_PROGRESS, &progress));
1623} 1635}
1624 1636
1625static const char *remote_uri[] = { 1637static const char *remote_uri[] = {
@@ -1662,7 +1674,8 @@ _elm_photocam_file_set_internal(Eo *obj, Elm_Photocam_Data *sd, const char *file
1662 obj); 1674 obj);
1663 if (sd->remote) 1675 if (sd->remote)
1664 { 1676 {
1665 evas_object_smart_callback_call(obj, SIG_DOWNLOAD_START, NULL); 1677 eo_do(obj, eo_event_callback_call
1678 (ELM_PHOTOCAM_EVENT_DOWNLOAD_START, NULL));
1666 return ret; 1679 return ret;
1667 } 1680 }
1668 break; 1681 break;
@@ -1940,12 +1953,12 @@ done:
1940 if (!sd->paused) 1953 if (!sd->paused)
1941 { 1954 {
1942 if (started) 1955 if (started)
1943 evas_object_smart_callback_call(obj, SIG_ZOOM_START, NULL); 1956 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_ZOOM_START, NULL));
1944 if (!an) 1957 if (!an)
1945 evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); 1958 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_ZOOM_STOP, NULL));
1946 } 1959 }
1947 if (zoom_changed) 1960 if (zoom_changed)
1948 evas_object_smart_callback_call(obj, SIG_ZOOM_CHANGE, NULL); 1961 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_ZOOM_CHANGE, NULL));
1949} 1962}
1950 1963
1951EOLIAN static double 1964EOLIAN static double
@@ -2056,7 +2069,7 @@ _elm_photocam_image_region_show(Eo *obj, Elm_Photocam_Data *sd, int x, int y, in
2056 ecore_animator_del(sd->zoom_animator); 2069 ecore_animator_del(sd->zoom_animator);
2057 sd->zoom_animator = NULL; 2070 sd->zoom_animator = NULL;
2058 _zoom_do(obj, 1.0); 2071 _zoom_do(obj, 1.0);
2059 evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); 2072 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_ZOOM_STOP, NULL));
2060 } 2073 }
2061 eo_do(obj, elm_interface_scrollable_content_region_show(rx, ry, rw, rh)); 2074 eo_do(obj, elm_interface_scrollable_content_region_show(rx, ry, rw, rh));
2062} 2075}
@@ -2099,7 +2112,7 @@ _elm_photocam_elm_interface_scrollable_region_bring_in(Eo *obj, Elm_Photocam_Dat
2099 ecore_animator_del(sd->zoom_animator); 2112 ecore_animator_del(sd->zoom_animator);
2100 sd->zoom_animator = NULL; 2113 sd->zoom_animator = NULL;
2101 _zoom_do(obj, 1.0); 2114 _zoom_do(obj, 1.0);
2102 evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); 2115 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_ZOOM_STOP, NULL));
2103 } 2116 }
2104 eo_do_super(obj, MY_CLASS, elm_interface_scrollable_region_bring_in(rx, ry, rw, rh)); 2117 eo_do_super(obj, MY_CLASS, elm_interface_scrollable_region_bring_in(rx, ry, rw, rh));
2105} 2118}
@@ -2124,7 +2137,7 @@ _elm_photocam_paused_set(Eo *obj, Elm_Photocam_Data *sd, Eina_Bool paused)
2124 ecore_animator_del(sd->zoom_animator); 2137 ecore_animator_del(sd->zoom_animator);
2125 sd->zoom_animator = NULL; 2138 sd->zoom_animator = NULL;
2126 _zoom_do(obj, 1.0); 2139 _zoom_do(obj, 1.0);
2127 evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); 2140 eo_do(obj, eo_event_callback_call(ELM_PHOTOCAM_EVENT_ZOOM_STOP, NULL));
2128 } 2141 }
2129} 2142}
2130 2143
diff --git a/src/lib/elm_photocam.eo b/src/lib/elm_photocam.eo
index 2303bf052..1475225bb 100644
--- a/src/lib/elm_photocam.eo
+++ b/src/lib/elm_photocam.eo
@@ -1,5 +1,6 @@
1class Elm.Photocam (Elm.Widget, Elm_Interface_Scrollable, 1class Elm.Photocam (Elm.Widget, Elm_Interface_Scrollable,
2 Elm_Interface_Atspi_Widget_Action, Efl.File) 2 Elm_Interface_Atspi_Widget_Action, Efl.File,
3 Evas.Clickable_Interface)
3{ 4{
4 eo_prefix: elm_obj_photocam; 5 eo_prefix: elm_obj_photocam;
5 methods { 6 methods {
@@ -237,10 +238,7 @@ class Elm.Photocam (Elm.Widget, Elm_Interface_Scrollable,
237 Efl.File.file.get; 238 Efl.File.file.get;
238 } 239 }
239 events { 240 events {
240 clicked;
241 press; 241 press;
242 longpressed;
243 clicked,double;
244 load; 242 load;
245 loaded; 243 loaded;
246 load,detail; 244 load,detail;
@@ -248,11 +246,6 @@ class Elm.Photocam (Elm.Widget, Elm_Interface_Scrollable,
248 zoom,start; 246 zoom,start;
249 zoom,stop; 247 zoom,stop;
250 zoom,change; 248 zoom,change;
251 scroll;
252 scroll,anim,start;
253 scroll,anim,stop;
254 scroll,drag,start;
255 scroll,drag,stop;
256 download,start; 249 download,start;
257 download,progress; 250 download,progress;
258 download,done; 251 download,done;