2003-06-11 06:20:48 -07:00
|
|
|
#include "edje_cc.h"
|
2003-06-09 04:31:33 -07:00
|
|
|
|
2003-06-11 06:20:48 -07:00
|
|
|
static void main_help(void);
|
2003-06-09 04:31:33 -07:00
|
|
|
|
|
|
|
Evas_List *img_dirs = NULL;
|
|
|
|
char *file_in = NULL;
|
|
|
|
char *file_out = NULL;
|
|
|
|
char *progname = NULL;
|
2003-06-16 06:55:13 -07:00
|
|
|
int verbose = 0;
|
2003-06-09 04:31:33 -07:00
|
|
|
|
2003-06-11 06:20:48 -07:00
|
|
|
static void
|
2003-06-09 04:31:33 -07:00
|
|
|
main_help(void)
|
|
|
|
{
|
|
|
|
printf
|
|
|
|
("Usage:\n"
|
2003-08-05 18:29:12 -07:00
|
|
|
"\t%s [OPTIONS] input_file.edc [output_file.eet]\n"
|
2003-06-09 04:31:33 -07:00
|
|
|
"\n"
|
|
|
|
"Where OPTIONS is one or more of:\n"
|
|
|
|
"\n"
|
|
|
|
"-id image/directory Add a directory to look in for relative path images\n"
|
2003-06-16 06:55:13 -07:00
|
|
|
"-v Verbose output\n"
|
2003-06-09 04:31:33 -07:00
|
|
|
,progname);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2003-06-16 06:55:13 -07:00
|
|
|
setlocale(LC_NUMERIC, "C");
|
|
|
|
|
2003-06-09 04:31:33 -07:00
|
|
|
progname = argv[0];
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
{
|
|
|
|
if (!strcmp(argv[i], "-h"))
|
|
|
|
{
|
|
|
|
main_help();
|
|
|
|
exit(0);
|
|
|
|
}
|
2003-06-16 06:55:13 -07:00
|
|
|
else if (!strcmp(argv[i], "-v"))
|
|
|
|
{
|
|
|
|
verbose = 1;
|
|
|
|
}
|
2003-06-09 04:31:33 -07:00
|
|
|
else if ((!strcmp(argv[i], "-id")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
img_dirs = evas_list_append(img_dirs, argv[i]);
|
|
|
|
}
|
|
|
|
else if (!file_in)
|
|
|
|
file_in = argv[i];
|
|
|
|
else if (!file_out)
|
|
|
|
file_out = argv[i];
|
|
|
|
}
|
|
|
|
if (!file_in)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "%s: Error: no input file specified.\n", progname);
|
|
|
|
main_help();
|
|
|
|
exit(-1);
|
|
|
|
}
|
2003-08-05 18:29:12 -07:00
|
|
|
if (!file_out)
|
|
|
|
{
|
|
|
|
char *suffix;
|
|
|
|
|
|
|
|
if ((suffix = strstr(file_in,".edc")) && (suffix[4] == 0))
|
|
|
|
{
|
|
|
|
file_out = strdup(file_in);
|
|
|
|
if (file_out)
|
|
|
|
{
|
|
|
|
suffix = strstr(file_out,".edc");
|
|
|
|
strcpy(suffix,".eet");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-06-09 04:31:33 -07:00
|
|
|
if (!file_out)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "%s: Error: no output file specified.\n", progname);
|
|
|
|
main_help();
|
|
|
|
exit(-1);
|
|
|
|
}
|
2003-06-17 01:15:06 -07:00
|
|
|
|
|
|
|
edje_init();
|
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
edje_file = mem_alloc(SZ(Edje_File));
|
2003-06-09 06:51:40 -07:00
|
|
|
|
|
|
|
data_setup();
|
2003-06-09 04:31:33 -07:00
|
|
|
compile();
|
2003-06-13 20:06:36 -07:00
|
|
|
data_process_lookups();
|
2003-06-09 06:51:40 -07:00
|
|
|
data_write();
|
2004-01-17 07:37:48 -08:00
|
|
|
|
|
|
|
edje_shutdown();
|
2003-06-12 15:34:51 -07:00
|
|
|
|
2003-06-09 04:31:33 -07:00
|
|
|
return 0;
|
|
|
|
}
|