diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2012-02-23 17:42:04 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2012-02-23 17:42:04 +0000 |
commit | 33e25e97e1a36b66c8150da4afa8985a9ab8018d (patch) | |
tree | 38cb6b9459718ca54e87f63123b6fe3c0df6f1e7 /legacy/emotion/src/lib/emotion_smart.c | |
parent | 6b51a11d0dcf941a5b7f483790f4204ad139616e (diff) |
emotion: call some callback when load and save are done.
SVN revision: 68355
Diffstat (limited to '')
-rw-r--r-- | legacy/emotion/src/lib/emotion_smart.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c index de31af8c17..4b37879b58 100644 --- a/legacy/emotion/src/lib/emotion_smart.c +++ b/legacy/emotion/src/lib/emotion_smart.c | |||
@@ -163,6 +163,11 @@ static const char SIG_REF_CHANGE[] = "ref_change"; | |||
163 | static const char SIG_BUTTON_NUM_CHANGE[] = "button_num_change"; | 163 | static const char SIG_BUTTON_NUM_CHANGE[] = "button_num_change"; |
164 | static const char SIG_BUTTON_CHANGE[] = "button_change"; | 164 | static const char SIG_BUTTON_CHANGE[] = "button_change"; |
165 | static const char SIG_OPEN_DONE[] = "open_done"; | 165 | static const char SIG_OPEN_DONE[] = "open_done"; |
166 | static const char SIG_POSITION_SAVE_SUCCEED[] = "position_save,succeed"; | ||
167 | static const char SIG_POSITION_SAVE_FAILED[] = "position_save,failed"; | ||
168 | static const char SIG_POSITION_LOAD_SUCCEED[] = "position_load,succeed"; | ||
169 | static const char SIG_POSITION_LOAD_FAILED[] = "position_load,failed"; | ||
170 | |||
166 | static const Evas_Smart_Cb_Description _smart_callbacks[] = { | 171 | static const Evas_Smart_Cb_Description _smart_callbacks[] = { |
167 | {SIG_FRAME_DECODE, ""}, | 172 | {SIG_FRAME_DECODE, ""}, |
168 | {SIG_POSITION_UPDATE, ""}, | 173 | {SIG_POSITION_UPDATE, ""}, |
@@ -1332,6 +1337,7 @@ _eio_load_xattr_done(void *data, Eio_File *handler, double xattr_double) | |||
1332 | Smart_Data *sd = data; | 1337 | Smart_Data *sd = data; |
1333 | 1338 | ||
1334 | emotion_object_position_set(evas_object_smart_parent_get(sd->obj), xattr_double); | 1339 | emotion_object_position_set(evas_object_smart_parent_get(sd->obj), xattr_double); |
1340 | evas_object_smart_callback_call(sd->obj, SIG_POSITION_LOAD_SUCCEED, NULL); | ||
1335 | _eio_load_xattr_cleanup(sd, handler); | 1341 | _eio_load_xattr_cleanup(sd, handler); |
1336 | } | 1342 | } |
1337 | 1343 | ||
@@ -1340,6 +1346,7 @@ _eio_load_xattr_error(void *data, Eio_File *handler, int err __UNUSED__) | |||
1340 | { | 1346 | { |
1341 | Smart_Data *sd = data; | 1347 | Smart_Data *sd = data; |
1342 | 1348 | ||
1349 | evas_object_smart_callback_call(sd->obj, SIG_POSITION_LOAD_FAILED, NULL); | ||
1343 | _eio_load_xattr_cleanup(sd, handler); | 1350 | _eio_load_xattr_cleanup(sd, handler); |
1344 | } | 1351 | } |
1345 | #endif | 1352 | #endif |
@@ -1377,19 +1384,30 @@ emotion_object_last_position_load(Evas_Object *obj) | |||
1377 | if (eina_xattr_double_get(tmp, "user.e.time_seek", &xattr)) | 1384 | if (eina_xattr_double_get(tmp, "user.e.time_seek", &xattr)) |
1378 | { | 1385 | { |
1379 | emotion_object_position_set(obj, xattr); | 1386 | emotion_object_position_set(obj, xattr); |
1387 | evas_object_smart_callback_call(obj, SIG_POSITION_LOAD_SUCCEED, NULL); | ||
1388 | } | ||
1389 | else | ||
1390 | { | ||
1391 | evas_object_smart_callback_call(obj, SIG_POSITION_LOAD_FAILED, NULL); | ||
1380 | } | 1392 | } |
1381 | #endif | 1393 | #endif |
1382 | } | 1394 | } |
1383 | 1395 | ||
1384 | #ifdef HAVE_EIO | 1396 | #ifdef HAVE_EIO |
1385 | static void | 1397 | static void |
1386 | _eio_save_xattr_done(void *data __UNUSED__, Eio_File *handler __UNUSED__) | 1398 | _eio_save_xattr_done(void *data, Eio_File *handler __UNUSED__) |
1387 | { | 1399 | { |
1400 | Smart_Data *sd = data; | ||
1401 | |||
1402 | evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_SUCCEED, NULL); | ||
1388 | } | 1403 | } |
1389 | 1404 | ||
1390 | static void | 1405 | static void |
1391 | _eio_save_xattr_error(void *data __UNUSED__, Eio_File *handler __UNUSED__, int err __UNUSED__) | 1406 | _eio_save_xattr_error(void *data, Eio_File *handler __UNUSED__, int err __UNUSED__) |
1392 | { | 1407 | { |
1408 | Smart_Data *sd = data; | ||
1409 | |||
1410 | evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_FAILED, NULL); | ||
1393 | } | 1411 | } |
1394 | #endif | 1412 | #endif |
1395 | 1413 | ||
@@ -1413,7 +1431,10 @@ emotion_object_last_position_save(Evas_Object *obj) | |||
1413 | eio_file_xattr_double_set(tmp, "user.e.time_seek", emotion_object_position_get(obj), 0, | 1431 | eio_file_xattr_double_set(tmp, "user.e.time_seek", emotion_object_position_get(obj), 0, |
1414 | _eio_save_xattr_done, _eio_save_xattr_error, sd); | 1432 | _eio_save_xattr_done, _eio_save_xattr_error, sd); |
1415 | #else | 1433 | #else |
1416 | eina_xattr_double_set(tmp, "user.e.time_seek", emotion_object_position_get(obj), 0); | 1434 | if (eina_xattr_double_set(tmp, "user.e.time_seek", emotion_object_position_get(obj), 0)) |
1435 | evas_object_smart_callback_call(obj, SIG_POSITION_SAVE_SUCCEED, NULL); | ||
1436 | else | ||
1437 | evas_object_smart_callback_call(obj, SIG_POSITION_SAVE_FAILED, NULL); | ||
1417 | #endif | 1438 | #endif |
1418 | } | 1439 | } |
1419 | 1440 | ||