summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-05-17 10:37:49 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:33 +0300
commit3091bf3455e97354c77a3f167cc19236a3e16347 (patch)
treecb4c9361330d4bd0be72ac1961d3c4844c51314a
parentba5b14ac3c90221adc0e8519450f763bf3c0fccb (diff)
elc_fileselector_entry, elm_bubble: porting evas smart callbacks to eo
-rw-r--r--src/lib/elc_fileselector_entry.c97
-rw-r--r--src/lib/elm_bubble.c2
-rw-r--r--src/lib/elm_fileselector_entry.eo6
-rw-r--r--src/lib/elm_interface_scrollable.c24
4 files changed, 72 insertions, 57 deletions
diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c
index 32b1f0bba..e41818657 100644
--- a/src/lib/elc_fileselector_entry.c
+++ b/src/lib/elc_fileselector_entry.c
@@ -43,29 +43,32 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
43}; 43};
44#undef ELM_PRIV_FILESELECTOR_ENTRY_SIGNALS 44#undef ELM_PRIV_FILESELECTOR_ENTRY_SIGNALS
45 45
46#define SIG_FWD(name) \ 46#define SIG_FWD(name, event) \
47 static void \ 47 static Eina_Bool \
48 _##name##_fwd(void *data, Evas_Object * obj EINA_UNUSED, void *event_info) \ 48 _##name##_fwd(void *data, \
49 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)\
49 { \ 50 { \
50 evas_object_smart_callback_call(data, SIG_##name, event_info); \ 51 eo_do(data, eo_event_callback_call(event, event_info)); \
52 \
53 return EINA_TRUE; \
51 } 54 }
52SIG_FWD(CHANGED) 55SIG_FWD(CHANGED, ELM_FILESELECTOR_ENTRY_EVENT_CHANGED)
53SIG_FWD(PRESS) 56SIG_FWD(PRESS, ELM_FILESELECTOR_ENTRY_EVENT_PRESS)
54SIG_FWD(LONGPRESSED) 57SIG_FWD(LONGPRESSED, EVAS_CLICKABLE_INTERFACE_EVENT_LONGPRESSED)
55SIG_FWD(CLICKED) 58SIG_FWD(CLICKED, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED)
56SIG_FWD(CLICKED_DOUBLE) 59SIG_FWD(CLICKED_DOUBLE, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED_DOUBLE)
57SIG_FWD(FOCUSED) 60SIG_FWD(FOCUSED, ELM_LAYOUT_EVENT_FOCUSED)
58SIG_FWD(UNFOCUSED) 61SIG_FWD(UNFOCUSED, ELM_LAYOUT_EVENT_UNFOCUSED)
59SIG_FWD(SELECTION_PASTE) 62SIG_FWD(SELECTION_PASTE, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTION_PASTE)
60SIG_FWD(SELECTION_COPY) 63SIG_FWD(SELECTION_COPY, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTION_COPY)
61SIG_FWD(SELECTION_CUT) 64SIG_FWD(SELECTION_CUT, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTION_CUT)
62SIG_FWD(UNPRESSED) 65SIG_FWD(UNPRESSED, EVAS_CLICKABLE_INTERFACE_EVENT_UNPRESSED)
63#undef SIG_FWD 66#undef SIG_FWD
64 67
65static void 68static Eina_Bool
66_FILE_CHOSEN_fwd(void *data, 69_FILE_CHOSEN_fwd(void *data EINA_UNUSED,
67 Evas_Object *obj EINA_UNUSED, 70 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
68 void *event_info) 71 void *event_info EINA_UNUSED)
69{ 72{
70 const char *file = event_info; 73 const char *file = event_info;
71 char *s; 74 char *s;
@@ -73,16 +76,19 @@ _FILE_CHOSEN_fwd(void *data,
73 ELM_FILESELECTOR_ENTRY_DATA_GET(data, sd); 76 ELM_FILESELECTOR_ENTRY_DATA_GET(data, sd);
74 77
75 s = elm_entry_utf8_to_markup(file); 78 s = elm_entry_utf8_to_markup(file);
76 if (!s) return; 79 if (!s) return EINA_TRUE;
77 elm_object_text_set(sd->entry, s); 80 elm_object_text_set(sd->entry, s);
78 free(s); 81 free(s);
79 evas_object_smart_callback_call(data, SIG_FILE_CHOSEN, event_info); 82 eo_do(data, eo_event_callback_call
83 (ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN, event_info));
84
85 return EINA_TRUE;
80} 86}
81 87
82static void 88static Eina_Bool
83_ACTIVATED_fwd(void *data, 89_ACTIVATED_fwd(void *data EINA_UNUSED,
84 Evas_Object *obj EINA_UNUSED, 90 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
85 void *event_info) 91 void *event_info EINA_UNUSED)
86{ 92{
87 const char *file; 93 const char *file;
88 94
@@ -90,7 +96,10 @@ _ACTIVATED_fwd(void *data,
90 96
91 file = elm_object_text_get(sd->entry); 97 file = elm_object_text_get(sd->entry);
92 elm_fileselector_path_set(sd->button, file); 98 elm_fileselector_path_set(sd->button, file);
93 evas_object_smart_callback_call(data, SIG_ACTIVATED, event_info); 99 eo_do(data, eo_event_callback_call
100 (ELM_FILESELECTOR_ENTRY_EVENT_ACTIVATED, event_info));
101
102 return EINA_TRUE;
94} 103}
95 104
96EOLIAN static void 105EOLIAN static void
@@ -284,11 +293,11 @@ _elm_fileselector_entry_evas_object_smart_add(Eo *obj, Elm_Fileselector_Entry_Da
284 elm_fileselector_expandable_set 293 elm_fileselector_expandable_set
285 (priv->button, _elm_config->fileselector_expand_enable); 294 (priv->button, _elm_config->fileselector_expand_enable);
286 295
287#define SIG_FWD(name) \ 296#define SIG_FWD(name, event) \
288 evas_object_smart_callback_add(priv->button, SIG_##name, _##name##_fwd, obj) 297 eo_do(priv->button, eo_event_callback_add(event, _##name##_fwd, obj))
289 SIG_FWD(CLICKED); 298 SIG_FWD(CLICKED, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED);
290 SIG_FWD(UNPRESSED); 299 SIG_FWD(UNPRESSED, EVAS_CLICKABLE_INTERFACE_EVENT_UNPRESSED);
291 SIG_FWD(FILE_CHOSEN); 300 SIG_FWD(FILE_CHOSEN, ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN);
292#undef SIG_FWD 301#undef SIG_FWD
293 302
294 priv->entry = elm_entry_add(obj); 303 priv->entry = elm_entry_add(obj);
@@ -298,19 +307,19 @@ _elm_fileselector_entry_evas_object_smart_add(Eo *obj, Elm_Fileselector_Entry_Da
298 elm_entry_single_line_set(priv->entry, EINA_TRUE); 307 elm_entry_single_line_set(priv->entry, EINA_TRUE);
299 elm_entry_editable_set(priv->entry, EINA_TRUE); 308 elm_entry_editable_set(priv->entry, EINA_TRUE);
300 309
301#define SIG_FWD(name) \ 310#define SIG_FWD(name, event) \
302 evas_object_smart_callback_add(priv->entry, SIG_##name, _##name##_fwd, obj) 311 eo_do(priv->entry, eo_event_callback_add(event, _##name##_fwd, obj))
303 SIG_FWD(CHANGED); 312 SIG_FWD(CHANGED, ELM_FILESELECTOR_ENTRY_EVENT_CHANGED);
304 SIG_FWD(ACTIVATED); 313 SIG_FWD(ACTIVATED, ELM_FILESELECTOR_ENTRY_EVENT_ACTIVATED);
305 SIG_FWD(PRESS); 314 SIG_FWD(PRESS, ELM_FILESELECTOR_ENTRY_EVENT_PRESS);
306 SIG_FWD(LONGPRESSED); 315 SIG_FWD(LONGPRESSED, EVAS_CLICKABLE_INTERFACE_EVENT_LONGPRESSED);
307 SIG_FWD(CLICKED); 316 SIG_FWD(CLICKED, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED);
308 SIG_FWD(CLICKED_DOUBLE); 317 SIG_FWD(CLICKED_DOUBLE, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED_DOUBLE);
309 SIG_FWD(FOCUSED); 318 SIG_FWD(FOCUSED, ELM_LAYOUT_EVENT_FOCUSED);
310 SIG_FWD(UNFOCUSED); 319 SIG_FWD(UNFOCUSED, ELM_LAYOUT_EVENT_UNFOCUSED);
311 SIG_FWD(SELECTION_PASTE); 320 SIG_FWD(SELECTION_PASTE, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTION_PASTE);
312 SIG_FWD(SELECTION_COPY); 321 SIG_FWD(SELECTION_COPY, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTION_COPY);
313 SIG_FWD(SELECTION_CUT); 322 SIG_FWD(SELECTION_CUT, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTION_CUT);
314#undef SIG_FWD 323#undef SIG_FWD
315 324
316 if (!elm_layout_theme_set 325 if (!elm_layout_theme_set
diff --git a/src/lib/elm_bubble.c b/src/lib/elm_bubble.c
index 1c81c7be4..f2bf0a658 100644
--- a/src/lib/elm_bubble.c
+++ b/src/lib/elm_bubble.c
@@ -70,7 +70,7 @@ _on_mouse_up(void *data,
70 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) 70 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
71 return; 71 return;
72 72
73 evas_object_smart_callback_call(data, SIG_CLICKED, NULL); 73 eo_do(data, eo_event_callback_call(ELM_BUBBLE_EVENT_CLICKED, NULL));
74} 74}
75 75
76/* overriding layout's focus_next() in order to just cycle through the 76/* overriding layout's focus_next() in order to just cycle through the
diff --git a/src/lib/elm_fileselector_entry.eo b/src/lib/elm_fileselector_entry.eo
index b6519299c..065cd840a 100644
--- a/src/lib/elm_fileselector_entry.eo
+++ b/src/lib/elm_fileselector_entry.eo
@@ -1,4 +1,5 @@
1class Elm.Fileselector_Entry (Elm.Layout, Elm_Interface_Fileselector) 1class Elm.Fileselector_Entry (Elm.Layout, Elm_Interface_Fileselector,
2 Evas.Clickable_Interface, Evas.Selectable_Interface)
2{ 3{
3 eo_prefix: elm_obj_fileselector_entry; 4 eo_prefix: elm_obj_fileselector_entry;
4 methods { 5 methods {
@@ -122,6 +123,9 @@ class Elm.Fileselector_Entry (Elm.Layout, Elm_Interface_Fileselector)
122 language,changed; 123 language,changed;
123 access,changed; 124 access,changed;
124 changed; 125 changed;
126 activated;
127 file,chosen;
128 press;
125 } 129 }
126 130
127} 131}
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index 0c07bdbd9..13687bfca 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -3731,15 +3731,15 @@ _elm_scroll_pan_resized_cb(void *data,
3731} 3731}
3732 3732
3733/* even external pan objects get this */ 3733/* even external pan objects get this */
3734static void 3734static Eina_Bool
3735_elm_scroll_pan_changed_cb(void *data, 3735_elm_scroll_pan_changed_cb(void *data EINA_UNUSED,
3736 Evas_Object *obj EINA_UNUSED, 3736 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
3737 void *event_info EINA_UNUSED) 3737 void *event_info EINA_UNUSED)
3738{ 3738{
3739 Evas_Coord w = 0, h = 0; 3739 Evas_Coord w = 0, h = 0;
3740 Elm_Scrollable_Smart_Interface_Data *sid = data; 3740 Elm_Scrollable_Smart_Interface_Data *sid = data;
3741 3741
3742 if (!sid->pan_obj) return; 3742 if (!sid->pan_obj) return EINA_TRUE;
3743 3743
3744 eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&w, &h)); 3744 eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&w, &h));
3745 if ((w != sid->content_info.w) || (h != sid->content_info.h)) 3745 if ((w != sid->content_info.w) || (h != sid->content_info.h))
@@ -3753,6 +3753,8 @@ _elm_scroll_pan_changed_cb(void *data,
3753 sid->content_info.resized = EINA_TRUE; 3753 sid->content_info.resized = EINA_TRUE;
3754 _elm_scroll_wanted_region_set(sid->obj); 3754 _elm_scroll_wanted_region_set(sid->obj);
3755 } 3755 }
3756
3757 return EINA_TRUE;
3756} 3758}
3757 3759
3758static void 3760static void
@@ -3794,8 +3796,8 @@ _elm_interface_scrollable_content_set(Eo *obj, Elm_Scrollable_Smart_Interface_Da
3794 { 3796 {
3795 o = _elm_pan_add(evas_object_evas_get(obj)); 3797 o = _elm_pan_add(evas_object_evas_get(obj));
3796 sid->pan_obj = o; 3798 sid->pan_obj = o;
3797 evas_object_smart_callback_add 3799 eo_do(o, eo_event_callback_add
3798 (o, SIG_CHANGED, _elm_scroll_pan_changed_cb, sid); 3800 (ELM_INTERFACE_SCROLLABLE_EVENT_CHANGED, _elm_scroll_pan_changed_cb, sid));
3799 evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE, 3801 evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
3800 _elm_scroll_pan_resized_cb, sid); 3802 _elm_scroll_pan_resized_cb, sid);
3801 edje_object_part_swallow(sid->edje_obj, "elm.swallow.content", o); 3803 edje_object_part_swallow(sid->edje_obj, "elm.swallow.content", o);
@@ -3822,8 +3824,8 @@ _elm_interface_scrollable_extern_pan_set(Eo *obj, Elm_Scrollable_Smart_Interface
3822 3824
3823 if (sid->pan_obj) 3825 if (sid->pan_obj)
3824 { 3826 {
3825 evas_object_smart_callback_del 3827 eo_do(sid->pan_obj, eo_event_callback_del(
3826 (sid->pan_obj, SIG_CHANGED, _elm_scroll_pan_changed_cb); 3828 ELM_INTERFACE_SCROLLABLE_EVENT_CHANGED, _elm_scroll_pan_changed_cb, sid));
3827 evas_object_event_callback_del(sid->pan_obj, EVAS_CALLBACK_RESIZE, 3829 evas_object_event_callback_del(sid->pan_obj, EVAS_CALLBACK_RESIZE,
3828 _elm_scroll_pan_resized_cb); 3830 _elm_scroll_pan_resized_cb);
3829 } 3831 }
@@ -3850,8 +3852,8 @@ _elm_interface_scrollable_extern_pan_set(Eo *obj, Elm_Scrollable_Smart_Interface
3850 sid->pan_obj = pan; 3852 sid->pan_obj = pan;
3851 3853
3852 sid->extern_pan = EINA_TRUE; 3854 sid->extern_pan = EINA_TRUE;
3853 evas_object_smart_callback_add 3855 eo_do(sid->pan_obj, eo_event_callback_add
3854 (sid->pan_obj, SIG_CHANGED, _elm_scroll_pan_changed_cb, sid); 3856 (ELM_INTERFACE_SCROLLABLE_EVENT_CHANGED, _elm_scroll_pan_changed_cb, sid));
3855 evas_object_event_callback_add(sid->pan_obj, EVAS_CALLBACK_RESIZE, 3857 evas_object_event_callback_add(sid->pan_obj, EVAS_CALLBACK_RESIZE,
3856 _elm_scroll_pan_resized_cb, sid); 3858 _elm_scroll_pan_resized_cb, sid);
3857 edje_object_part_swallow 3859 edje_object_part_swallow