summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-05-07 14:51:46 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:32 +0300
commit48b494964b84853c27f9348d8152095d8742e19c (patch)
tree7e0129e6df529d69dbdf1de891f882fe66fe8153
parent2b3e6991a264d61195e9b18e82f5f71bcf91e086 (diff)
elm_web2: porting evas smart callbacks to eo
-rw-r--r--src/lib/elm_web.eo1
-rw-r--r--src/lib/elm_web2.c65
2 files changed, 40 insertions, 26 deletions
diff --git a/src/lib/elm_web.eo b/src/lib/elm_web.eo
index e0b8863ad..a9ff918a0 100644
--- a/src/lib/elm_web.eo
+++ b/src/lib/elm_web.eo
@@ -675,6 +675,7 @@ class Elm.Web (Elm.Widget)
675 url,changed; [[s]] 675 url,changed; [[s]]
676 focused; 676 focused;
677 unfocused; 677 unfocused;
678 windows,close,request;
678 } 679 }
679 680
680} 681}
diff --git a/src/lib/elm_web2.c b/src/lib/elm_web2.c
index 94e94ebea..a642e5477 100644
--- a/src/lib/elm_web2.c
+++ b/src/lib/elm_web2.c
@@ -78,7 +78,7 @@ _view_smart_window_close(Ewk_View_Smart_Data *sd)
78 78
79 ELM_WEB_CHECK(obj); 79 ELM_WEB_CHECK(obj);
80 80
81 evas_object_smart_callback_call(obj, "windows,close,request", NULL); 81 eo_do(obj, eo_event_callback_call(ELM_WEB_EVENT_WINDOWS_CLOSE_REQUEST, NULL);
82} 82}
83 83
84static void 84static void
@@ -194,8 +194,8 @@ _view_smart_popup_menu_show(Ewk_View_Smart_Data *sd,
194 194
195 evas_object_data_set(sd->self, "_select_popup", notify); 195 evas_object_data_set(sd->self, "_select_popup", notify);
196 196
197 evas_object_smart_callback_add 197 eo_do(notify, eo_event_callback_add
198 (notify, "block,clicked", _popup_dismiss_cb, menu); 198 (ELM_NOTIFY_EVENT_BLOCK_CLICKED, _popup_dismiss_cb, menu));
199 199
200 return EINA_TRUE; 200 return EINA_TRUE;
201} 201}
@@ -212,19 +212,25 @@ _view_smart_popup_menu_hide(Ewk_View_Smart_Data *sd)
212 return EINA_TRUE; 212 return EINA_TRUE;
213} 213}
214 214
215static void 215static Eina_Bool
216_fullscreen_accept(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED) 216_fullscreen_accept(void *data EINA_UNUSED,
217 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
217{ 218{
218 Evas_Object *ewk = data; 219 Evas_Object *ewk = data;
219 evas_object_del(evas_object_data_get(ewk, "_fullscreen_permission_popup")); 220 evas_object_del(evas_object_data_get(ewk, "_fullscreen_permission_popup"));
221
222 return EINA_TRUE;
220} 223}
221 224
222static void 225static Eina_Bool
223_fullscreen_deny(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED) 226_fullscreen_deny(void *data EINA_UNUSED,
227 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
224{ 228{
225 Evas_Object *ewk = data; 229 Evas_Object *ewk = data;
226 ewk_view_fullscreen_exit(ewk); 230 ewk_view_fullscreen_exit(ewk);
227 evas_object_del(evas_object_data_get(ewk, "_fullscreen_permission_popup")); 231 evas_object_del(evas_object_data_get(ewk, "_fullscreen_permission_popup"));
232
233 return EINA_TRUE;
228} 234}
229 235
230static Eina_Bool 236static Eina_Bool
@@ -252,12 +258,14 @@ _view_smart_fullscreen_enter(Ewk_View_Smart_Data *sd, Ewk_Security_Origin *origi
252 btn = elm_button_add(popup); 258 btn = elm_button_add(popup);
253 elm_object_text_set(btn, "Accept"); 259 elm_object_text_set(btn, "Accept");
254 elm_object_part_content_set(popup, "button1", btn); 260 elm_object_part_content_set(popup, "button1", btn);
255 evas_object_smart_callback_add(btn, "clicked", _fullscreen_accept, sd->self); 261 eo_do(btn, eo_event_callback_add
262 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _fullscreen_accept, sd->self));
256 263
257 btn = elm_button_add(popup); 264 btn = elm_button_add(popup);
258 elm_object_text_set(btn, "Deny"); 265 elm_object_text_set(btn, "Deny");
259 elm_object_part_content_set(popup, "button2", btn); 266 elm_object_part_content_set(popup, "button2", btn);
260 evas_object_smart_callback_add(btn, "clicked", _fullscreen_deny, sd->self); 267 eo_do(btn, eo_event_callback_add
268 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _fullscreen_deny, sd->self));
261 269
262 evas_object_data_set(sd->self, "_fullscreen_permission_popup", popup); 270 evas_object_data_set(sd->self, "_fullscreen_permission_popup", popup);
263 evas_object_show(popup); 271 evas_object_show(popup);
@@ -278,10 +286,9 @@ _view_smart_fullscreen_exit(Ewk_View_Smart_Data *sd)
278 return EINA_TRUE; 286 return EINA_TRUE;
279} 287}
280 288
281static void 289static Eina_Bool
282_bt_close(void *data, 290_bt_close(void *data EINA_UNUSED,
283 Evas_Object *obj, 291 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
284 void *event_info EINA_UNUSED)
285{ 292{
286 Dialog_Data *d = data; 293 Dialog_Data *d = data;
287 294
@@ -296,6 +303,8 @@ _bt_close(void *data,
296end: 303end:
297 evas_object_del(d->dialog); 304 evas_object_del(d->dialog);
298 free(d); 305 free(d);
306
307 return EINA_TRUE;
299} 308}
300 309
301static Dialog_Data * 310static Dialog_Data *
@@ -311,8 +320,8 @@ _dialog_new(Evas_Object *web, Eina_Bool inwin_mode)
311 Evas_Object *bg; 320 Evas_Object *bg;
312 321
313 d->dialog = elm_win_add(NULL, "elm-web-popup", ELM_WIN_DIALOG_BASIC); 322 d->dialog = elm_win_add(NULL, "elm-web-popup", ELM_WIN_DIALOG_BASIC);
314 evas_object_smart_callback_add 323 eo_do(d->dialog, eo_event_callback_add
315 (d->dialog, "delete,request", _bt_close, d); 324 (ELM_WIN_EVENT_DELETE_REQUEST, _bt_close, d));
316 325
317 bg = elm_bg_add(d->dialog); 326 bg = elm_bg_add(d->dialog);
318 evas_object_size_hint_weight_set 327 evas_object_size_hint_weight_set
@@ -361,7 +370,8 @@ _dialog_ok_cancel_buttons_add(Dialog_Data *dialog_data)
361 elm_box_pack_end(bx, bt); 370 elm_box_pack_end(bx, bt);
362 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 371 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
363 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 372 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
364 evas_object_smart_callback_add(bt, "clicked", _bt_close, dialog_data); 373 eo_do(bt, eo_event_callback_add
374 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _bt_close, dialog_data));
365 evas_object_show(bt); 375 evas_object_show(bt);
366 376
367 dialog_data->bt_ok = bt = elm_button_add(bx); 377 dialog_data->bt_ok = bt = elm_button_add(bx);
@@ -369,7 +379,8 @@ _dialog_ok_cancel_buttons_add(Dialog_Data *dialog_data)
369 elm_box_pack_end(bx, bt); 379 elm_box_pack_end(bx, bt);
370 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 380 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
371 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 381 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
372 evas_object_smart_callback_add(bt, "clicked", _bt_close, dialog_data); 382 eo_do(bt, eo_event_callback_add
383 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _bt_close, dialog_data));
373 evas_object_show(bt); 384 evas_object_show(bt);
374} 385}
375 386
@@ -417,8 +428,8 @@ _view_smart_run_javascript_alert(Ewk_View_Smart_Data *vsd, const char *message)
417 elm_box_pack_end(dialog_data->box, dialog_data->bt_ok); 428 elm_box_pack_end(dialog_data->box, dialog_data->bt_ok);
418 evas_object_size_hint_align_set 429 evas_object_size_hint_align_set
419 (dialog_data->bt_ok, EVAS_HINT_FILL, EVAS_HINT_FILL); 430 (dialog_data->bt_ok, EVAS_HINT_FILL, EVAS_HINT_FILL);
420 evas_object_smart_callback_add 431 eo_do(dialog_data->bt_ok, eo_event_callback_add
421 (dialog_data->bt_ok, "clicked", _bt_close, dialog_data); 432 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _bt_close, dialog_data));
422 evas_object_show(dialog_data->bt_ok); 433 evas_object_show(dialog_data->bt_ok);
423 434
424 evas_object_show(dialog); 435 evas_object_show(dialog);
@@ -569,19 +580,21 @@ _view_add(Evas_Object *parent)
569 return view; 580 return view;
570} 581}
571 582
572static void 583static Eina_Bool
573_view_smart_url_changed_cb(void *data, 584_view_smart_url_changed_cb(void *data EINA_UNUSED,
574 Evas_Object *obj EINA_UNUSED, 585 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
575 void *event_info)
576{ 586{
577 evas_object_smart_callback_call(data, SIG_URI_CHANGED, event_info); 587 eo_do(data, eo_event_callback_call(ELM_WEB_EVENT_URI_CHANGED, event_info));
578 evas_object_smart_callback_call(data, SIG_URL_CHANGED, event_info); 588 eo_do(data, eo_event_callback_call(ELM_WEB_EVENT_URL_CHANGED, event_info));
589
590 return EINA_TRUE;
579} 591}
580 592
581static void 593static void
582_view_smart_callback_proxy(Evas_Object *view, Evas_Object *parent) 594_view_smart_callback_proxy(Evas_Object *view, Evas_Object *parent)
583{ 595{
584 evas_object_smart_callback_add(view, SIG_URL_CHANGED, _view_smart_url_changed_cb, parent); 596 eo_do(view, eo_event_callback_add
597 (ELM_WEB_EVENT_URL_CHANGED, _view_smart_url_changed_cb, parent));
585} 598}
586 599
587static Eina_Bool _elm_need_web = EINA_FALSE; 600static Eina_Bool _elm_need_web = EINA_FALSE;