diff options
author | Avi Levin <avi.levin@samsung.com> | 2015-04-26 14:49:26 +0300 |
---|---|---|
committer | Daniel Zaoui <daniel.zaoui@samsung.com> | 2015-06-07 11:00:52 +0300 |
commit | f9c116a48749c642eb31154a4cfb5f60a110dcba (patch) | |
tree | 2cbf4d8891d6aa65c5f8867cb95549947208b864 /src/lib/emotion/emotion_smart.c | |
parent | b563efc52ffbc02ae33d4901326a583102975cbb (diff) |
emotion: porting evas smart callbacks to eo
Diffstat (limited to '')
-rw-r--r-- | src/lib/emotion/emotion_smart.c | 76 |
1 files changed, 30 insertions, 46 deletions
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c index fbbbb49170..ea1130e3fd 100644 --- a/src/lib/emotion/emotion_smart.c +++ b/src/lib/emotion/emotion_smart.c | |||
@@ -123,29 +123,6 @@ static void _mouse_down(void *data, Evas *ev, Evas_Object *obj, void *event_info | |||
123 | static void _pos_set_job(void *data); | 123 | static void _pos_set_job(void *data); |
124 | static void _pixels_get(void *data, Evas_Object *obj); | 124 | static void _pixels_get(void *data, Evas_Object *obj); |
125 | 125 | ||
126 | /**********************************/ | ||
127 | /* Globals for the E Video Object */ | ||
128 | /**********************************/ | ||
129 | static const char SIG_FRAME_DECODE[] = "frame_decode"; | ||
130 | static const char SIG_POSITION_UPDATE[] = "position_update"; | ||
131 | static const char SIG_LENGTH_CHANGE[] = "length_change"; | ||
132 | static const char SIG_FRAME_RESIZE[] = "frame_resize"; | ||
133 | static const char SIG_DECODE_STOP[] = "decode_stop"; | ||
134 | static const char SIG_PLAYBACK_STARTED[] = "playback_started"; | ||
135 | static const char SIG_PLAYBACK_FINISHED[] = "playback_finished"; | ||
136 | static const char SIG_AUDIO_LEVEL_CHANGE[] = "audio_level_change"; | ||
137 | static const char SIG_CHANNELS_CHANGE[] = "channels_change"; | ||
138 | static const char SIG_TITLE_CHANGE[] = "title_change"; | ||
139 | static const char SIG_PROGRESS_CHANGE[] = "progress_change"; | ||
140 | static const char SIG_REF_CHANGE[] = "ref_change"; | ||
141 | static const char SIG_BUTTON_NUM_CHANGE[] = "button_num_change"; | ||
142 | static const char SIG_BUTTON_CHANGE[] = "button_change"; | ||
143 | static const char SIG_OPEN_DONE[] = "open_done"; | ||
144 | static const char SIG_POSITION_SAVE_SUCCEED[] = "position_save,succeed"; | ||
145 | static const char SIG_POSITION_SAVE_FAILED[] = "position_save,failed"; | ||
146 | static const char SIG_POSITION_LOAD_SUCCEED[] = "position_load,succeed"; | ||
147 | static const char SIG_POSITION_LOAD_FAILED[] = "position_load,failed"; | ||
148 | |||
149 | static void | 126 | static void |
150 | _engine_init(Eo *obj, Emotion_Object_Data *sd) | 127 | _engine_init(Eo *obj, Emotion_Object_Data *sd) |
151 | { | 128 | { |
@@ -1341,7 +1318,8 @@ _eio_load_xattr_done(void *data, Eio_File *handler, double xattr_double) | |||
1341 | Emotion_Object_Data *sd = data; | 1318 | Emotion_Object_Data *sd = data; |
1342 | 1319 | ||
1343 | emotion_object_position_set(evas_object_smart_parent_get(sd->obj), xattr_double); | 1320 | emotion_object_position_set(evas_object_smart_parent_get(sd->obj), xattr_double); |
1344 | evas_object_smart_callback_call(evas_object_smart_parent_get(sd->obj), SIG_POSITION_LOAD_SUCCEED, NULL); | 1321 | eo_do(evas_object_smart_parent_get(sd->obj), |
1322 | eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_LOAD_SUCCEED, NULL)); | ||
1345 | _eio_load_xattr_cleanup(sd, handler); | 1323 | _eio_load_xattr_cleanup(sd, handler); |
1346 | } | 1324 | } |
1347 | 1325 | ||
@@ -1350,7 +1328,8 @@ _eio_load_xattr_error(void *data, Eio_File *handler, int err EINA_UNUSED) | |||
1350 | { | 1328 | { |
1351 | Emotion_Object_Data *sd = data; | 1329 | Emotion_Object_Data *sd = data; |
1352 | 1330 | ||
1353 | evas_object_smart_callback_call(evas_object_smart_parent_get(sd->obj), SIG_POSITION_LOAD_FAILED, NULL); | 1331 | eo_do(evas_object_smart_parent_get(sd->obj), |
1332 | eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_LOAD_FAILED, NULL)); | ||
1354 | _eio_load_xattr_cleanup(sd, handler); | 1333 | _eio_load_xattr_cleanup(sd, handler); |
1355 | } | 1334 | } |
1356 | #endif | 1335 | #endif |
@@ -1385,10 +1364,10 @@ emotion_object_last_position_load(Evas_Object *obj) | |||
1385 | if (eina_xattr_double_get(tmp, "user.e.time_seek", &xattr)) | 1364 | if (eina_xattr_double_get(tmp, "user.e.time_seek", &xattr)) |
1386 | { | 1365 | { |
1387 | emotion_object_position_set(obj, xattr); | 1366 | emotion_object_position_set(obj, xattr); |
1388 | evas_object_smart_callback_call(obj, SIG_POSITION_LOAD_SUCCEED, NULL); | 1367 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_LOAD_SUCCEED, NULL)); |
1389 | } | 1368 | } |
1390 | else | 1369 | else |
1391 | evas_object_smart_callback_call(obj, SIG_POSITION_LOAD_FAILED, NULL); | 1370 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_LOAD_FAILED, NULL)); |
1392 | #endif | 1371 | #endif |
1393 | } | 1372 | } |
1394 | 1373 | ||
@@ -1411,7 +1390,7 @@ _eio_save_xattr_done(void *data, Eio_File *handler) | |||
1411 | { | 1390 | { |
1412 | Emotion_Object_Data *sd = data; | 1391 | Emotion_Object_Data *sd = data; |
1413 | 1392 | ||
1414 | evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_SUCCEED, NULL); | 1393 | eo_do(sd->obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_SAVE_SUCCEED, NULL)); |
1415 | _eio_save_xattr_cleanup(sd, handler); | 1394 | _eio_save_xattr_cleanup(sd, handler); |
1416 | } | 1395 | } |
1417 | 1396 | ||
@@ -1420,7 +1399,7 @@ _eio_save_xattr_error(void *data, Eio_File *handler, int err EINA_UNUSED) | |||
1420 | { | 1399 | { |
1421 | Emotion_Object_Data *sd = data; | 1400 | Emotion_Object_Data *sd = data; |
1422 | 1401 | ||
1423 | evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_FAILED, NULL); | 1402 | eo_do(sd->obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_SAVE_FAILED, NULL)); |
1424 | _eio_save_xattr_cleanup(sd, handler); | 1403 | _eio_save_xattr_cleanup(sd, handler); |
1425 | } | 1404 | } |
1426 | #endif | 1405 | #endif |
@@ -1450,9 +1429,10 @@ emotion_object_last_position_save(Evas_Object *obj) | |||
1450 | sd); | 1429 | sd); |
1451 | #else | 1430 | #else |
1452 | if (eina_xattr_double_set(tmp, "user.e.time_seek", emotion_object_position_get(obj), 0)) | 1431 | if (eina_xattr_double_set(tmp, "user.e.time_seek", emotion_object_position_get(obj), 0)) |
1453 | evas_object_smart_callback_call(obj, SIG_POSITION_SAVE_SUCCEED, NULL); | 1432 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_SAVE_SUCCEED, NULL)); |
1454 | else | 1433 | else |
1455 | evas_object_smart_callback_call(obj, SIG_POSITION_SAVE_FAILED, NULL); | 1434 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_SAVE_FAILED, NULL)); |
1435 | |||
1456 | #endif | 1436 | #endif |
1457 | } | 1437 | } |
1458 | 1438 | ||
@@ -1513,7 +1493,7 @@ _emotion_frame_anim(void *data) | |||
1513 | _emotion_video_pos_update(obj, | 1493 | _emotion_video_pos_update(obj, |
1514 | emotion_engine_instance_pos_get(sd->engine_instance), | 1494 | emotion_engine_instance_pos_get(sd->engine_instance), |
1515 | emotion_engine_instance_len_get(sd->engine_instance)); | 1495 | emotion_engine_instance_len_get(sd->engine_instance)); |
1516 | evas_object_smart_callback_call(obj, SIG_FRAME_DECODE, NULL); | 1496 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_FRAME_DECODE, NULL)); |
1517 | return EINA_FALSE; | 1497 | return EINA_FALSE; |
1518 | } | 1498 | } |
1519 | 1499 | ||
@@ -1537,8 +1517,10 @@ _emotion_video_pos_update(Evas_Object *obj, double pos, double len) | |||
1537 | if (len != sd->len) nlen = 1; | 1517 | if (len != sd->len) nlen = 1; |
1538 | sd->pos = pos; | 1518 | sd->pos = pos; |
1539 | sd->len = len; | 1519 | sd->len = len; |
1540 | if (npos) evas_object_smart_callback_call(obj, SIG_POSITION_UPDATE, NULL); | 1520 | if (npos) eo_do(obj, |
1541 | if (nlen) evas_object_smart_callback_call(obj, SIG_LENGTH_CHANGE, NULL); | 1521 | eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_UPDATE, NULL)); |
1522 | if (nlen) eo_do(obj, | ||
1523 | eo_event_callback_call(EMOTION_OBJECT_EVENT_LENGTH_CHANGE, NULL)); | ||
1542 | } | 1524 | } |
1543 | 1525 | ||
1544 | EAPI void | 1526 | EAPI void |
@@ -1567,7 +1549,7 @@ _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio) | |||
1567 | if (changed) | 1549 | if (changed) |
1568 | { | 1550 | { |
1569 | evas_object_size_hint_request_set(obj, w, h); | 1551 | evas_object_size_hint_request_set(obj, w, h); |
1570 | evas_object_smart_callback_call(obj, SIG_FRAME_RESIZE, NULL); | 1552 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_FRAME_RESIZE, NULL)); |
1571 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); | 1553 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); |
1572 | _emotion_object_aspect_border_apply(obj, sd, w, h); | 1554 | _emotion_object_aspect_border_apply(obj, sd, w, h); |
1573 | } | 1555 | } |
@@ -1591,7 +1573,7 @@ _emotion_decode_stop(Evas_Object *obj) | |||
1591 | if (sd->play) | 1573 | if (sd->play) |
1592 | { | 1574 | { |
1593 | sd->play = 0; | 1575 | sd->play = 0; |
1594 | evas_object_smart_callback_call(obj, SIG_DECODE_STOP, NULL); | 1576 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_DECODE_STOP, NULL)); |
1595 | } | 1577 | } |
1596 | } | 1578 | } |
1597 | 1579 | ||
@@ -1607,25 +1589,26 @@ _emotion_open_done(Evas_Object *obj) | |||
1607 | emotion_object_position_set(obj, sd->remember_jump); | 1589 | emotion_object_position_set(obj, sd->remember_jump); |
1608 | if (sd->remember_play != sd->play) | 1590 | if (sd->remember_play != sd->play) |
1609 | emotion_object_play_set(obj, sd->remember_play); | 1591 | emotion_object_play_set(obj, sd->remember_play); |
1610 | evas_object_smart_callback_call(obj, SIG_OPEN_DONE, NULL); | 1592 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_OPEN_DONE, NULL)); |
1593 | |||
1611 | } | 1594 | } |
1612 | 1595 | ||
1613 | EAPI void | 1596 | EAPI void |
1614 | _emotion_playback_started(Evas_Object *obj) | 1597 | _emotion_playback_started(Evas_Object *obj) |
1615 | { | 1598 | { |
1616 | evas_object_smart_callback_call(obj, SIG_PLAYBACK_STARTED, NULL); | 1599 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, NULL)); |
1617 | } | 1600 | } |
1618 | 1601 | ||
1619 | EAPI void | 1602 | EAPI void |
1620 | _emotion_playback_finished(Evas_Object *obj) | 1603 | _emotion_playback_finished(Evas_Object *obj) |
1621 | { | 1604 | { |
1622 | evas_object_smart_callback_call(obj, SIG_PLAYBACK_FINISHED, NULL); | 1605 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, NULL)); |
1623 | } | 1606 | } |
1624 | 1607 | ||
1625 | EAPI void | 1608 | EAPI void |
1626 | _emotion_audio_level_change(Evas_Object *obj) | 1609 | _emotion_audio_level_change(Evas_Object *obj) |
1627 | { | 1610 | { |
1628 | evas_object_smart_callback_call(obj, SIG_AUDIO_LEVEL_CHANGE, NULL); | 1611 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_AUDIO_LEVEL_CHANGE, NULL)); |
1629 | } | 1612 | } |
1630 | 1613 | ||
1631 | EAPI void | 1614 | EAPI void |
@@ -1634,7 +1617,7 @@ _emotion_channels_change(Evas_Object *obj) | |||
1634 | Emotion_Object_Data *sd; | 1617 | Emotion_Object_Data *sd; |
1635 | 1618 | ||
1636 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 1619 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
1637 | evas_object_smart_callback_call(obj, SIG_CHANNELS_CHANGE, NULL); | 1620 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_CHANNELS_CHANGE, NULL)); |
1638 | } | 1621 | } |
1639 | 1622 | ||
1640 | EAPI void | 1623 | EAPI void |
@@ -1644,7 +1627,8 @@ _emotion_title_set(Evas_Object *obj, char *title) | |||
1644 | 1627 | ||
1645 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 1628 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
1646 | eina_stringshare_replace(&sd->title, title); | 1629 | eina_stringshare_replace(&sd->title, title); |
1647 | evas_object_smart_callback_call(obj, SIG_TITLE_CHANGE, NULL); | 1630 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_TITLE_CHANGE, NULL)); |
1631 | |||
1648 | } | 1632 | } |
1649 | 1633 | ||
1650 | EAPI void | 1634 | EAPI void |
@@ -1655,7 +1639,7 @@ _emotion_progress_set(Evas_Object *obj, char *info, double st) | |||
1655 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 1639 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
1656 | eina_stringshare_replace(&sd->progress.info, info); | 1640 | eina_stringshare_replace(&sd->progress.info, info); |
1657 | sd->progress.stat = st; | 1641 | sd->progress.stat = st; |
1658 | evas_object_smart_callback_call(obj, SIG_PROGRESS_CHANGE, NULL); | 1642 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, NULL)); |
1659 | } | 1643 | } |
1660 | 1644 | ||
1661 | EAPI void | 1645 | EAPI void |
@@ -1666,7 +1650,7 @@ _emotion_file_ref_set(Evas_Object *obj, const char *file, int num) | |||
1666 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 1650 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
1667 | eina_stringshare_replace(&sd->ref.file, file); | 1651 | eina_stringshare_replace(&sd->ref.file, file); |
1668 | sd->ref.num = num; | 1652 | sd->ref.num = num; |
1669 | evas_object_smart_callback_call(obj, SIG_REF_CHANGE, NULL); | 1653 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_REF_CHANGE, NULL)); |
1670 | } | 1654 | } |
1671 | 1655 | ||
1672 | EAPI void | 1656 | EAPI void |
@@ -1676,7 +1660,7 @@ _emotion_spu_button_num_set(Evas_Object *obj, int num) | |||
1676 | 1660 | ||
1677 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 1661 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
1678 | sd->spu.button_num = num; | 1662 | sd->spu.button_num = num; |
1679 | evas_object_smart_callback_call(obj, SIG_BUTTON_NUM_CHANGE, NULL); | 1663 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_BUTTON_NUM_CHANGE, NULL)); |
1680 | } | 1664 | } |
1681 | 1665 | ||
1682 | EAPI void | 1666 | EAPI void |
@@ -1686,7 +1670,7 @@ _emotion_spu_button_set(Evas_Object *obj, int button) | |||
1686 | 1670 | ||
1687 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 1671 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
1688 | sd->spu.button = button; | 1672 | sd->spu.button = button; |
1689 | evas_object_smart_callback_call(obj, SIG_BUTTON_CHANGE, NULL); | 1673 | eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_BUTTON_CHANGE, NULL)); |
1690 | } | 1674 | } |
1691 | 1675 | ||
1692 | EAPI void | 1676 | EAPI void |