edje: Add a --no-save option to edje_cc

Some people don't want to reveal their edc files...

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 63937
This commit is contained in:
Mike McCormack 2011-10-10 02:49:50 +00:00 committed by Mike McCormack
parent 06a765d5a1
commit 74c07498f9
3 changed files with 26 additions and 15 deletions

View File

@ -25,6 +25,7 @@ int verbose = 0;
int no_lossy = 0; int no_lossy = 0;
int no_comp = 0; int no_comp = 0;
int no_raw = 0; int no_raw = 0;
int no_save = 0;
int min_quality = 0; int min_quality = 0;
int max_quality = 100; int max_quality = 100;
@ -44,6 +45,7 @@ main_help(void)
"-no-lossy Do NOT allow images to be lossy\n" "-no-lossy Do NOT allow images to be lossy\n"
"-no-comp Do NOT allow images to be stored with lossless compression\n" "-no-comp Do NOT allow images to be stored with lossless compression\n"
"-no-raw Do NOT allow images to be stored with zero compression (raw)\n" "-no-raw Do NOT allow images to be stored with zero compression (raw)\n"
"-no-save Do NOT store the input EDC file in the EDJ file\n"
"-min-quality VAL Do NOT allow lossy images with quality < VAL (0-100)\n" "-min-quality VAL Do NOT allow lossy images with quality < VAL (0-100)\n"
"-max-quality VAL Do NOT allow lossy images with quality > VAL (0-100)\n" "-max-quality VAL Do NOT allow lossy images with quality > VAL (0-100)\n"
"-Ddefine_val=to CPP style define to define input macro definitions to the .edc source\n" "-Ddefine_val=to CPP style define to define input macro definitions to the .edc source\n"
@ -97,6 +99,10 @@ main(int argc, char **argv)
{ {
no_raw = 1; no_raw = 1;
} }
else if (!strcmp(argv[i], "-no-save"))
{
no_save = 1;
}
else if ((!strcmp(argv[i], "-id") || !strcmp(argv[i], "--image_dir")) && (i < (argc - 1))) else if ((!strcmp(argv[i], "-id") || !strcmp(argv[i], "--image_dir")) && (i < (argc - 1)))
{ {
i++; i++;

View File

@ -205,6 +205,7 @@ extern int verbose;
extern int no_lossy; extern int no_lossy;
extern int no_comp; extern int no_comp;
extern int no_raw; extern int no_raw;
extern int no_save;
extern int min_quality; extern int min_quality;
extern int max_quality; extern int max_quality;
extern int line; extern int line;

View File

@ -847,12 +847,9 @@ data_write_scripts(Eet_File *ef)
{ {
char tmpn[PATH_MAX]; char tmpn[PATH_MAX];
char tmpo[PATH_MAX]; char tmpo[PATH_MAX];
char buf[PATH_MAX];
int fd; int fd;
Code *cd = eina_list_data_get(l); Code *cd = eina_list_data_get(l);
Eina_List *ll;
Code_Program *cp;
if (cd->is_lua) if (cd->is_lua)
continue; continue;
if ((!cd->shared) && (!cd->programs)) if ((!cd->shared) && (!cd->programs))
@ -879,18 +876,25 @@ data_write_scripts(Eet_File *ef)
unlink(tmpn); unlink(tmpn);
unlink(tmpo); unlink(tmpo);
if (cd->original) if (!no_save)
{ {
snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i", i); char buf[PATH_MAX];
eet_write(ef, buf, cd->original, strlen(cd->original) + 1, 1); Eina_List *ll;
} Code_Program *cp;
EINA_LIST_FOREACH(cd->programs, ll, cp)
{ if (cd->original)
if (!cp->original) {
continue; snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i", i);
snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i/%i", i, eet_write(ef, buf, cd->original, strlen(cd->original) + 1, 1);
cp->id); }
eet_write(ef, buf, cp->original, strlen(cp->original) + 1, 1); EINA_LIST_FOREACH(cd->programs, ll, cp)
{
if (!cp->original)
continue;
snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i/%i", i,
cp->id);
eet_write(ef, buf, cp->original, strlen(cp->original) + 1, 1);
}
} }
} }
} }