summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorVivek Ellur <vivek.ellur@samsung.com>2015-08-28 15:58:54 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-08-28 15:58:54 +0900
commit74981a3dbe01702181331c19fb880274faa2a0a7 (patch)
treea91ed369233660c0c1bf76e099d9e65d5dfc592b /src/modules
parent710a927441834128d7c3fbec0bf24e0c0075e26e (diff)
elementary: Port evas smart callbacks to Eo callbacks
Summary: Changed evas_object_smart_callback_add to eo_event_callback_add functions Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com> Reviewers: cedric, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2997
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c47
1 files changed, 31 insertions, 16 deletions
diff --git a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c
index 05d59dc17..8e2d39789 100644
--- a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c
+++ b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c
@@ -33,13 +33,16 @@ _diskselector_item_free_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event
33 free(data); 33 free(data);
34} 34}
35 35
36static void 36static Eina_Bool
37_ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) 37_ctxpopup_dismissed_cb(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED,
38 void *event_info EINA_UNUSED)
38{ 39{
39 Ctxpopup_Module_Data *ctx_mod; 40 Ctxpopup_Module_Data *ctx_mod;
40 ctx_mod = (Ctxpopup_Module_Data *)data; 41 ctx_mod = (Ctxpopup_Module_Data *)data;
41 evas_object_del(obj); 42 evas_object_del(obj);
42 ctx_mod->ctxpopup = NULL; 43 ctx_mod->ctxpopup = NULL;
44
45 return EINA_TRUE;
43} 46}
44 47
45static void 48static void
@@ -84,15 +87,16 @@ _field_value_get(struct tm *tim, Elm_Datetime_Field_Type field_type)
84 return (*timearr[field_type]); 87 return (*timearr[field_type]);
85} 88}
86 89
87static void 90static Eina_Bool
88_diskselector_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 91_diskselector_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED,
92 const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
89{ 93{
90 DiskItem_Data *disk_data; 94 DiskItem_Data *disk_data;
91 struct tm curr_time; 95 struct tm curr_time;
92 const char *fmt; 96 const char *fmt;
93 97
94 disk_data = (DiskItem_Data *)elm_object_item_data_get(event_info); 98 disk_data = (DiskItem_Data *)elm_object_item_data_get(event_info);
95 if (!disk_data || !(disk_data->ctx_mod)) return; 99 if (!disk_data || !(disk_data->ctx_mod)) return EINA_FALSE;
96 100
97 elm_datetime_value_get(disk_data->ctx_mod->mod_data.base, &curr_time); 101 elm_datetime_value_get(disk_data->ctx_mod->mod_data.base, &curr_time);
98 fmt = disk_data->ctx_mod->mod_data.field_format_get(disk_data->ctx_mod->mod_data.base, disk_data->sel_field_type); 102 fmt = disk_data->ctx_mod->mod_data.field_format_get(disk_data->ctx_mod->mod_data.base, disk_data->sel_field_type);
@@ -102,25 +106,32 @@ _diskselector_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
102 _field_value_set(&curr_time, disk_data->sel_field_type, disk_data->sel_field_value); 106 _field_value_set(&curr_time, disk_data->sel_field_type, disk_data->sel_field_value);
103 elm_datetime_value_set(disk_data->ctx_mod->mod_data.base, &curr_time); 107 elm_datetime_value_set(disk_data->ctx_mod->mod_data.base, &curr_time);
104 evas_object_hide(disk_data->ctx_mod->ctxpopup); 108 evas_object_hide(disk_data->ctx_mod->ctxpopup);
109
110 return EINA_TRUE;
105} 111}
106 112
107static void 113static Eina_Bool
108_ampm_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 114_ampm_clicked_cb(void *data, Eo *obj EINA_UNUSED,
115 const Eo_Event_Description *desc EINA_UNUSED,
116 void *event_info EINA_UNUSED)
109{ 117{
110 Ctxpopup_Module_Data *ctx_mod; 118 Ctxpopup_Module_Data *ctx_mod;
111 struct tm curr_time; 119 struct tm curr_time;
112 120
113 ctx_mod = (Ctxpopup_Module_Data *)data; 121 ctx_mod = (Ctxpopup_Module_Data *)data;
114 if (!ctx_mod) return; 122 if (!ctx_mod) return EINA_FALSE;
115 123
116 elm_datetime_value_get(ctx_mod->mod_data.base, &curr_time); 124 elm_datetime_value_get(ctx_mod->mod_data.base, &curr_time);
117 if (curr_time.tm_hour >= 12) curr_time.tm_hour -= 12; 125 if (curr_time.tm_hour >= 12) curr_time.tm_hour -= 12;
118 else curr_time.tm_hour += 12; 126 else curr_time.tm_hour += 12;
119 elm_datetime_value_set(ctx_mod->mod_data.base, &curr_time); 127 elm_datetime_value_set(ctx_mod->mod_data.base, &curr_time);
128 return EINA_TRUE;
120} 129}
121 130
122static void 131static Eina_Bool
123_field_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) 132_field_clicked_cb(void *data, Eo *obj,
133 const Eo_Event_Description *desc EINA_UNUSED,
134 void *event_info EINA_UNUSED)
124{ 135{
125 Ctxpopup_Module_Data *ctx_mod; 136 Ctxpopup_Module_Data *ctx_mod;
126 Evas_Object *diskselector; 137 Evas_Object *diskselector;
@@ -136,7 +147,7 @@ _field_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
136 Evas_Coord x = 0, y = 0, w = 0, h = 0, width; 147 Evas_Coord x = 0, y = 0, w = 0, h = 0, width;
137 148
138 ctx_mod = (Ctxpopup_Module_Data *)data; 149 ctx_mod = (Ctxpopup_Module_Data *)data;
139 if (!ctx_mod) return; 150 if (!ctx_mod) return EINA_FALSE;
140 151
141 snprintf(buf, sizeof(buf), "datetime/%s", elm_object_style_get(obj)); 152 snprintf(buf, sizeof(buf), "datetime/%s", elm_object_style_get(obj));
142 153
@@ -146,12 +157,13 @@ _field_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
146 evas_object_size_hint_weight_set(ctx_mod->ctxpopup, EVAS_HINT_EXPAND, 157 evas_object_size_hint_weight_set(ctx_mod->ctxpopup, EVAS_HINT_EXPAND,
147 EVAS_HINT_EXPAND); 158 EVAS_HINT_EXPAND);
148 evas_object_size_hint_align_set(ctx_mod->ctxpopup, EVAS_HINT_FILL, 0.5); 159 evas_object_size_hint_align_set(ctx_mod->ctxpopup, EVAS_HINT_FILL, 0.5);
149 evas_object_smart_callback_add(ctx_mod->ctxpopup, "dismissed", 160 eo_do(ctx_mod->ctxpopup, eo_event_callback_add
150 _ctxpopup_dismissed_cb, ctx_mod); 161 (ELM_CTXPOPUP_EVENT_DISMISSED, _ctxpopup_dismissed_cb, ctx_mod));
151 elm_ctxpopup_hover_parent_set(ctx_mod->ctxpopup, elm_widget_top_get(obj)); 162 elm_ctxpopup_hover_parent_set(ctx_mod->ctxpopup, elm_widget_top_get(obj));
152 163
153 diskselector = elm_diskselector_add(elm_widget_top_get(ctx_mod->mod_data.base)); 164 diskselector = elm_diskselector_add(elm_widget_top_get(ctx_mod->mod_data.base));
154 evas_object_smart_callback_add(diskselector, "clicked", _diskselector_cb, NULL); 165 eo_do(diskselector, eo_event_callback_add
166 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _diskselector_cb, NULL));
155 elm_object_style_set(diskselector, buf); 167 elm_object_style_set(diskselector, buf);
156 elm_object_content_set(ctx_mod->ctxpopup, diskselector); 168 elm_object_content_set(ctx_mod->ctxpopup, diskselector);
157 169
@@ -218,6 +230,7 @@ _field_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
218 evas_object_move(ctx_mod->ctxpopup, (x + w / 2), y); 230 evas_object_move(ctx_mod->ctxpopup, (x + w / 2), y);
219 } 231 }
220 evas_object_show(ctx_mod->ctxpopup); 232 evas_object_show(ctx_mod->ctxpopup);
233 return EINA_TRUE;
221} 234}
222 235
223static void 236static void
@@ -300,7 +313,8 @@ field_create(Elm_Datetime_Module_Data *module_data, Elm_Datetime_Field_Type fie
300 if (field_type == ELM_DATETIME_AMPM) 313 if (field_type == ELM_DATETIME_AMPM)
301 { 314 {
302 field_obj = elm_button_add(ctx_mod->mod_data.base); 315 field_obj = elm_button_add(ctx_mod->mod_data.base);
303 evas_object_smart_callback_add(field_obj, "clicked", _ampm_clicked_cb, ctx_mod); 316 eo_do(field_obj, eo_event_callback_add
317 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _ampm_clicked_cb, ctx_mod));
304 } 318 }
305 else 319 else
306 { 320 {
@@ -309,7 +323,8 @@ field_create(Elm_Datetime_Module_Data *module_data, Elm_Datetime_Field_Type fie
309 elm_entry_editable_set(field_obj, EINA_FALSE); 323 elm_entry_editable_set(field_obj, EINA_FALSE);
310 elm_entry_input_panel_enabled_set(field_obj, EINA_FALSE); 324 elm_entry_input_panel_enabled_set(field_obj, EINA_FALSE);
311 elm_entry_context_menu_disabled_set(field_obj, EINA_TRUE); 325 elm_entry_context_menu_disabled_set(field_obj, EINA_TRUE);
312 evas_object_smart_callback_add(field_obj, "clicked", _field_clicked_cb, ctx_mod); 326 eo_do(field_obj, eo_event_callback_add
327 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _field_clicked_cb, ctx_mod));
313 } 328 }
314 evas_object_data_set(field_obj, "_field_type", (void *)field_type); 329 evas_object_data_set(field_obj, "_field_type", (void *)field_type);
315 330