summaryrefslogtreecommitdiff
path: root/src/bin/edje/edje_decc.c
diff options
context:
space:
mode:
authorTae-Hwan Kim <the81.kim@samsung.com>2014-03-20 13:00:20 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-20 13:00:21 +0900
commit3061a706c4ca02eb876799da07dae72c24cf4507 (patch)
treecb81f578acd9779b974994477fbd8477d0d61b91 /src/bin/edje/edje_decc.c
parent079e5d3692241e32cb1bcd7ac47d5ace71f5d37f (diff)
Add new PLUGIN_RUN action type and new plugins.plugin handlers 1. If external library is commerical source and not opensource, we cannot include/build the library within edje. 2. If external library does not use general encodable sources, we...
Summary: ...cannot encode those things into edje. In our case, we need vibration when longpressed. But those files are not audio or image and cannot be encoded into edje. Also, this library is not opensource so should not be linked directly with edje. So we should call vibration API by using this plug-in. Reviewers: raster, cedric, seoz, Hermet CC: cedric Differential Revision: https://phab.enlightenment.org/D588
Diffstat (limited to 'src/bin/edje/edje_decc.c')
-rw-r--r--src/bin/edje/edje_decc.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/bin/edje/edje_decc.c b/src/bin/edje/edje_decc.c
index fca3d332b0..747c7d5118 100644
--- a/src/bin/edje/edje_decc.c
+++ b/src/bin/edje/edje_decc.c
@@ -521,6 +521,49 @@ output(void)
521 } 521 }
522 522
523 } 523 }
524 if (edje_file->vibration_dir)
525 {
526 Edje_Vibration_Sample *sample;
527 void *data;
528 char out[PATH_MAX];
529 char out1[PATH_MAX];
530 char *pp;
531 int data_size;
532 FILE *f;
533 int i;
534
535 for (i = 0; i < (int)edje_file->vibration_dir->samples_count; i++)
536 {
537 sample = &edje_file->vibration_dir->samples[i];
538 if ((!sample) || (!sample->name)) continue;
539 snprintf(out, sizeof(out), "edje/vibrations/%i", sample->id);
540 data = (void *)eet_read_direct(tef, out, &data_size);
541 if (data)
542 {
543 snprintf(out1, sizeof(out1), "%s/%s", outdir, sample->src);
544 pp = strdup(out1);
545 p = strrchr(pp, '/');
546 *p = 0;
547 if (strstr(pp, "../"))
548 {
549 ERR("Potential security violation. attempt to write in parent dir.");
550 exit(-1);
551 }
552 ecore_file_mkpath(pp);
553 free(pp);
554 if (strstr(out, "../"))
555 {
556 ERR("Potential security violation. attempt to write in parent dir.");
557 exit(-1);
558 }
559 f = fopen(out1, "wb");
560 if (fwrite(data, data_size, 1, f) != 1)
561 ERR("Could not write sound: %s", strerror(errno));
562 fclose(f);
563 }
564 }
565 }
566
524 eet_close(tef); 567 eet_close(tef);
525 if (outdir) free(outdir); 568 if (outdir) free(outdir);
526} 569}