diff options
author | JunsuChoi <jsuya.choi@samsung.com> | 2020-03-10 15:42:12 +0900 |
---|---|---|
committer | Hermet Park <chuneon.park@samsung.com> | 2020-03-10 15:42:13 +0900 |
commit | 107e425ef62ebb5cd9b2d6e7feff0d26bd35f6e5 (patch) | |
tree | 4d7ec15c140c7217217b3fd7a557da84a5eb94bf /src/lib/edje/edje_calc.c | |
parent | 794792aacbbf0f693ef9178cb71db16547214ff8 (diff) |
edje: Rename Json to Lottie in edj supporting
Summary:
The json file used by edje is for lottie output.
json can be used in many ways. So the purpose is clear.
Test Plan: N/A
Reviewers: Hermet, kimcinoo, herb
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11478
Diffstat (limited to '')
-rw-r--r-- | src/lib/edje/edje_calc.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 7de6c66db6..f3dd13be85 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c | |||
@@ -3319,13 +3319,13 @@ _edje_vector_animation_running_cb(void *data, const Efl_Event *event) | |||
3319 | } | 3319 | } |
3320 | 3320 | ||
3321 | static void | 3321 | static void |
3322 | _edje_vector_load_json(Edje *ed, Edje_Real_Part *ep, const char *key) | 3322 | _edje_vector_load_lottie(Edje *ed, Edje_Real_Part *ep, const char *key) |
3323 | { | 3323 | { |
3324 | Edje_Part_Description_Vector *desc = (Edje_Part_Description_Vector *)ep->chosen_description; | 3324 | Edje_Part_Description_Vector *desc = (Edje_Part_Description_Vector *)ep->chosen_description; |
3325 | Eina_File *file; | 3325 | Eina_File *file; |
3326 | char *json_data; | 3326 | char *lottie_data; |
3327 | double frame_duration; | 3327 | double frame_duration; |
3328 | int json_data_len = 0; | 3328 | int lottie_data_len = 0; |
3329 | int frame_count; | 3329 | int frame_count; |
3330 | 3330 | ||
3331 | if (ep->typedata.vector->anim == NULL) | 3331 | if (ep->typedata.vector->anim == NULL) |
@@ -3339,18 +3339,18 @@ _edje_vector_load_json(Edje *ed, Edje_Real_Part *ep, const char *key) | |||
3339 | 3339 | ||
3340 | if (ep->typedata.vector->current_id != desc->vg.id) | 3340 | if (ep->typedata.vector->current_id != desc->vg.id) |
3341 | { | 3341 | { |
3342 | json_data = (char *)eet_read(ed->file->ef, key, &json_data_len); | 3342 | lottie_data = (char *)eet_read(ed->file->ef, key, &lottie_data_len); |
3343 | json_data[json_data_len] = '\0'; | 3343 | lottie_data[lottie_data_len] = '\0'; |
3344 | file = eina_file_virtualize(NULL, json_data, json_data_len + 1, EINA_FALSE); | 3344 | file = eina_file_virtualize(NULL, lottie_data, lottie_data_len + 1, EINA_FALSE); |
3345 | efl_file_simple_mmap_load(ep->object, file, NULL); | 3345 | efl_file_simple_mmap_load(ep->object, file, NULL); |
3346 | 3346 | ||
3347 | if (ep->typedata.vector->json_virtual_file) | 3347 | if (ep->typedata.vector->lottie_virtual_file) |
3348 | eina_file_close(ep->typedata.vector->json_virtual_file); | 3348 | eina_file_close(ep->typedata.vector->lottie_virtual_file); |
3349 | ep->typedata.vector->json_virtual_file = file; | 3349 | ep->typedata.vector->lottie_virtual_file = file; |
3350 | 3350 | ||
3351 | if (ep->typedata.vector->json_data) | 3351 | if (ep->typedata.vector->lottie_data) |
3352 | free(ep->typedata.vector->json_data); | 3352 | free(ep->typedata.vector->lottie_data); |
3353 | ep->typedata.vector->json_data = json_data; | 3353 | ep->typedata.vector->lottie_data = lottie_data; |
3354 | 3354 | ||
3355 | ep->typedata.vector->current_id = desc->vg.id; | 3355 | ep->typedata.vector->current_id = desc->vg.id; |
3356 | } | 3356 | } |
@@ -3381,12 +3381,12 @@ _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EIN | |||
3381 | 3381 | ||
3382 | snprintf(src_key, sizeof(src_key), "edje/vectors/%i", chosen_desc->vg.id); | 3382 | snprintf(src_key, sizeof(src_key), "edje/vectors/%i", chosen_desc->vg.id); |
3383 | 3383 | ||
3384 | if (type == EDJE_VECTOR_FILE_TYPE_JSON) | 3384 | if (type == EDJE_VECTOR_FILE_TYPE_LOTTIE) |
3385 | { | 3385 | { |
3386 | #ifdef BUILD_VG_LOADER_JSON | 3386 | #ifdef BUILD_VG_LOADER_JSON |
3387 | _edje_vector_load_json(ed, ep, src_key); | 3387 | _edje_vector_load_lottie(ed, ep, src_key); |
3388 | #else | 3388 | #else |
3389 | ERR("Evas Vg Json (Lottie) Loader is not supported, Only Static Vector Image(SVG) is available!"); | 3389 | ERR("Evas Vg Lottie (Lottie) Loader is not supported, Only Static Vector Image(SVG) is available!"); |
3390 | #endif | 3390 | #endif |
3391 | return; | 3391 | return; |
3392 | } | 3392 | } |
@@ -3405,11 +3405,11 @@ _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EIN | |||
3405 | } | 3405 | } |
3406 | } | 3406 | } |
3407 | 3407 | ||
3408 | if ((new_id < 0) || (new_type == EDJE_VECTOR_FILE_TYPE_JSON)) | 3408 | if ((new_id < 0) || (new_type == EDJE_VECTOR_FILE_TYPE_LOTTIE)) |
3409 | { | 3409 | { |
3410 | #ifndef BUILD_VG_LOADER_JSON | 3410 | #ifndef BUILD_VG_LOADER_JSON |
3411 | if (new_type == EDJE_VECTOR_FILE_TYPE_JSON) | 3411 | if (new_type == EDJE_VECTOR_FILE_TYPE_LOTTIE) |
3412 | ERR("Evas Vg Json (Lottie) Loader is not supported, Only Static Vector Image(SVG) is available!"); | 3412 | ERR("Evas Vg Lottie (Lottie) Loader is not supported, Only Static Vector Image(SVG) is available!"); |
3413 | else | 3413 | else |
3414 | #endif | 3414 | #endif |
3415 | efl_file_simple_load(ep->object, ed->file->path, src_key); | 3415 | efl_file_simple_load(ep->object, ed->file->path, src_key); |