2009-10-25 04:19:12 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2008-10-26 10:18:19 -07:00
|
|
|
#include <string.h>
|
|
|
|
#include <locale.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <sys/stat.h>
|
2018-01-26 11:08:29 -08:00
|
|
|
#include <sys/time.h>
|
2018-01-27 08:55:40 -08:00
|
|
|
|
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
|
|
# include <sys/resource.h>
|
|
|
|
#endif
|
2008-10-26 10:18:19 -07:00
|
|
|
|
2019-06-18 05:22:05 -07:00
|
|
|
#ifdef _WIN32
|
|
|
|
# include <evil_private.h> /* realpath */
|
|
|
|
#endif
|
|
|
|
|
2003-06-11 06:20:48 -07:00
|
|
|
#include "edje_cc.h"
|
2009-12-22 05:46:00 -08:00
|
|
|
int _edje_cc_log_dom = -1;
|
2003-06-11 06:20:48 -07:00
|
|
|
static void main_help(void);
|
2003-06-09 04:31:33 -07:00
|
|
|
|
2018-02-26 13:15:30 -08:00
|
|
|
Eina_Prefix *pfx = NULL;
|
2011-11-04 05:18:13 -07:00
|
|
|
Eina_List *snd_dirs = NULL;
|
2015-05-13 09:08:04 -07:00
|
|
|
Eina_List *mo_dirs = NULL;
|
2014-03-19 21:00:20 -07:00
|
|
|
Eina_List *vibration_dirs = NULL;
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *img_dirs = NULL;
|
|
|
|
Eina_List *fnt_dirs = NULL;
|
2013-06-04 09:09:56 -07:00
|
|
|
Eina_List *data_dirs = NULL;
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *defines = NULL;
|
2018-02-26 13:15:30 -08:00
|
|
|
char *file_in = NULL;
|
|
|
|
char *tmp_dir = NULL;
|
|
|
|
char *file_out = NULL;
|
|
|
|
char *watchfile = NULL;
|
|
|
|
char *depfile = NULL;
|
|
|
|
char *authors = NULL;
|
|
|
|
char *license = NULL;
|
2014-03-05 23:33:06 -08:00
|
|
|
Eina_List *licenses = NULL;
|
2018-02-26 15:54:38 -08:00
|
|
|
Eina_Array *requires;
|
2012-07-31 15:42:03 -07:00
|
|
|
|
2012-07-31 15:45:44 -07:00
|
|
|
static const char *progname = NULL;
|
2003-06-09 04:31:33 -07:00
|
|
|
|
2018-02-26 13:15:30 -08:00
|
|
|
int no_lossy = 0;
|
|
|
|
int no_comp = 0;
|
|
|
|
int no_raw = 0;
|
|
|
|
int no_save = 0;
|
|
|
|
int min_quality = 0;
|
|
|
|
int max_quality = 100;
|
|
|
|
int compress_mode = EET_COMPRESSION_HI;
|
|
|
|
int threads = 0;
|
|
|
|
int annotate = 0;
|
|
|
|
int no_etc1 = 0;
|
|
|
|
int no_etc2 = 0;
|
|
|
|
int beta = 0;
|
2018-06-15 10:26:44 -07:00
|
|
|
Eina_Bool namespace_verify;
|
2004-08-31 22:41:26 -07:00
|
|
|
|
2018-01-26 11:08:29 -08:00
|
|
|
unsigned int max_open_files;
|
|
|
|
|
2012-07-31 15:42:03 -07:00
|
|
|
static void
|
|
|
|
_edje_cc_log_cb(const Eina_Log_Domain *d,
|
|
|
|
Eina_Log_Level level,
|
|
|
|
const char *file,
|
|
|
|
const char *fnc,
|
2012-12-11 07:55:13 -08:00
|
|
|
int fline,
|
2012-07-31 15:42:03 -07:00
|
|
|
const char *fmt,
|
2013-01-03 18:08:14 -08:00
|
|
|
EINA_UNUSED void *data,
|
2012-07-31 15:42:03 -07:00
|
|
|
va_list args)
|
|
|
|
{
|
|
|
|
if ((d->name) && (d->namelen == sizeof("edje_cc") - 1) &&
|
|
|
|
(memcmp(d->name, "edje_cc", sizeof("edje_cc") - 1) == 0))
|
|
|
|
{
|
|
|
|
const char *prefix;
|
|
|
|
|
2012-08-01 08:53:10 -07:00
|
|
|
eina_log_console_color_set(stderr, eina_log_level_color_get(level));
|
2012-07-31 15:42:03 -07:00
|
|
|
switch (level)
|
|
|
|
{
|
|
|
|
case EINA_LOG_LEVEL_CRITICAL:
|
2018-02-26 13:15:30 -08:00
|
|
|
prefix = "Critical. ";
|
|
|
|
break;
|
|
|
|
|
2012-07-31 15:42:03 -07:00
|
|
|
case EINA_LOG_LEVEL_ERR:
|
2018-02-26 13:15:30 -08:00
|
|
|
prefix = "Error. ";
|
|
|
|
break;
|
|
|
|
|
2012-07-31 15:42:03 -07:00
|
|
|
case EINA_LOG_LEVEL_WARN:
|
2018-02-26 13:15:30 -08:00
|
|
|
prefix = "Warning. ";
|
|
|
|
break;
|
|
|
|
|
2012-07-31 15:42:03 -07:00
|
|
|
default:
|
2018-02-26 13:15:30 -08:00
|
|
|
prefix = "";
|
2012-07-31 15:42:03 -07:00
|
|
|
}
|
|
|
|
fprintf(stderr, "%s: %s", progname, prefix);
|
2012-08-01 08:53:10 -07:00
|
|
|
eina_log_console_color_set(stderr, EINA_COLOR_RESET);
|
2012-07-31 15:42:03 -07:00
|
|
|
|
|
|
|
vfprintf(stderr, fmt, args);
|
|
|
|
putc('\n', stderr);
|
|
|
|
}
|
|
|
|
else
|
2012-12-11 07:55:13 -08:00
|
|
|
eina_log_print_cb_stderr(d, level, file, fnc, fline, fmt, NULL, args);
|
2012-07-31 15:42:03 -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"
|
2005-03-22 11:29:06 -08:00
|
|
|
"\t%s [OPTIONS] input_file.edc [output_file.edj]\n"
|
2003-06-09 04:31:33 -07:00
|
|
|
"\n"
|
|
|
|
"Where OPTIONS is one or more of:\n"
|
|
|
|
"\n"
|
2012-05-08 03:35:57 -07:00
|
|
|
"-w files.txt Dump all sources files path into files.txt\n"
|
2015-04-16 09:29:10 -07:00
|
|
|
"-annotate Annotate the dumped files.\n"
|
|
|
|
"-deps files.txt Dump gnu style include dependencies path into files.txt (overrides -w/-annotate)\n"
|
2003-06-09 04:31:33 -07:00
|
|
|
"-id image/directory Add a directory to look in for relative path images\n"
|
2004-01-22 18:13:42 -08:00
|
|
|
"-fd font/directory Add a directory to look in for relative path fonts\n"
|
2011-11-04 05:18:13 -07:00
|
|
|
"-sd sound/directory Add a directory to look in for relative path sounds samples\n"
|
2014-04-17 03:04:31 -07:00
|
|
|
"-vd vibration/directory Add a directory to look in for relative path vibration samples\n"
|
2013-06-04 09:09:56 -07:00
|
|
|
"-dd data/directory Add a directory to look in for relative path data.file entries\n"
|
2015-05-13 09:08:04 -07:00
|
|
|
"-md mo/directory Add a directory to look in for relative path mo files\n"
|
2009-08-25 10:25:23 -07:00
|
|
|
"-td temp/directory Directory to store temporary files\n"
|
2014-11-13 09:10:59 -08:00
|
|
|
"-l license Specify the license of a theme (file with license text)\n"
|
|
|
|
"-a authors Specify AUTHORS (file with list of authors)\n"
|
2003-06-16 06:55:13 -07:00
|
|
|
"-v Verbose output\n"
|
2004-08-31 22:41:26 -07:00
|
|
|
"-no-lossy Do NOT allow images to be lossy\n"
|
2004-10-10 04:58:43 -07:00
|
|
|
"-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"
|
2014-06-13 01:37:12 -07:00
|
|
|
"-no-etc1 Do NOT allow images to be stored as ETC1\n"
|
|
|
|
"-no-etc2 Do NOT allow images to be stored as ETC2\n"
|
2011-10-09 19:49:50 -07:00
|
|
|
"-no-save Do NOT store the input EDC file in the EDJ file\n"
|
2004-09-01 18:10:38 -07:00
|
|
|
"-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"
|
2004-10-24 06:47:55 -07:00
|
|
|
"-Ddefine_val=to CPP style define to define input macro definitions to the .edc source\n"
|
2012-05-15 05:29:22 -07:00
|
|
|
"-fastcomp Use a faster compression algorithm (LZ4) (mutually exclusive with -fastdecomp)\n"
|
|
|
|
"-fastdecomp Use a faster decompression algorithm (LZ4HC) (mutually exclusive with -fastcomp)\n"
|
2012-05-30 05:25:53 -07:00
|
|
|
"-threads Compile the edje file using multiple parallel threads (by default)\n"
|
|
|
|
"-nothreads Compile the edje file using only the main loop\n"
|
2018-06-15 10:26:44 -07:00
|
|
|
"-N Use the first segment of each group name as a namespace to verify parts/signals\n"
|
2015-04-02 06:48:58 -07:00
|
|
|
"-V [--version] show program version\n"
|
2018-02-26 13:15:30 -08:00
|
|
|
, progname);
|
2003-06-09 04:31:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
int i;
|
2004-10-16 04:34:09 -07:00
|
|
|
struct stat st;
|
2013-01-11 13:40:52 -08:00
|
|
|
#ifdef HAVE_REALPATH
|
2004-10-16 04:34:09 -07:00
|
|
|
char rpath[PATH_MAX], rpath2[PATH_MAX];
|
2013-01-11 13:40:52 -08:00
|
|
|
#endif
|
2003-06-09 04:31:33 -07:00
|
|
|
|
2003-06-16 06:55:13 -07:00
|
|
|
setlocale(LC_NUMERIC, "C");
|
2007-08-27 02:32:17 -07:00
|
|
|
|
2013-11-14 07:27:19 -08:00
|
|
|
ecore_app_no_system_modules();
|
2018-07-05 14:11:36 -07:00
|
|
|
efreet_cache_disable();
|
2013-11-14 07:27:19 -08:00
|
|
|
|
2010-01-31 11:43:53 -08:00
|
|
|
if (!eina_init())
|
|
|
|
return -1;
|
|
|
|
|
2010-10-07 17:24:22 -07:00
|
|
|
_edje_cc_log_dom = eina_log_domain_register
|
2018-02-26 13:15:30 -08:00
|
|
|
("edje_cc", EDJE_CC_DEFAULT_LOG_COLOR);
|
2010-10-07 17:24:22 -07:00
|
|
|
if (_edje_cc_log_dom < 0)
|
2009-12-22 05:46:00 -08:00
|
|
|
{
|
2018-02-26 13:15:30 -08:00
|
|
|
EINA_LOG_ERR("Enable to create a log domain.");
|
|
|
|
exit(-1);
|
2009-12-22 05:46:00 -08:00
|
|
|
}
|
2012-08-01 08:49:57 -07:00
|
|
|
if (!eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_WARN))
|
|
|
|
eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_WARN);
|
|
|
|
|
2012-07-31 15:45:44 -07:00
|
|
|
progname = ecore_file_file_get(argv[0]);
|
2012-07-31 15:42:03 -07:00
|
|
|
eina_log_print_cb_set(_edje_cc_log_cb, NULL);
|
|
|
|
|
2015-09-28 21:46:11 -07:00
|
|
|
tmp_dir = (char *)eina_environment_tmp_get();
|
2009-08-25 10:25:23 -07:00
|
|
|
|
2009-12-29 07:01:24 -08:00
|
|
|
img_dirs = eina_list_append(img_dirs, ".");
|
2016-01-04 14:03:12 -08:00
|
|
|
|
2012-04-15 22:39:21 -07:00
|
|
|
/* add defines to epp so edc files can detect edje_cc version */
|
|
|
|
defines = eina_list_append(defines, mem_strdup("-DEDJE_VERSION_12=12"));
|
2009-12-29 07:01:24 -08:00
|
|
|
|
2003-06-09 04:31:33 -07:00
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
{
|
2018-02-26 13:15:30 -08:00
|
|
|
if (!strcmp(argv[i], "-h"))
|
|
|
|
{
|
|
|
|
main_help();
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
else if ((!strcmp(argv[i], "-V")) || (!strcmp(argv[i], "--version")))
|
|
|
|
{
|
|
|
|
printf("Version: %s\n", PACKAGE_VERSION);
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-v"))
|
|
|
|
{
|
|
|
|
eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_INFO);
|
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-no-lossy"))
|
|
|
|
{
|
|
|
|
no_lossy = 1;
|
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-no-comp"))
|
|
|
|
{
|
|
|
|
no_comp = 1;
|
2014-06-13 01:37:12 -07:00
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-no-raw"))
|
|
|
|
{
|
|
|
|
no_raw = 1;
|
|
|
|
}
|
2014-04-18 00:39:37 -07:00
|
|
|
else if (!strcmp(argv[i], "-no-etc1"))
|
2014-06-13 01:37:12 -07:00
|
|
|
{
|
2014-04-18 00:39:37 -07:00
|
|
|
no_etc1 = 1;
|
2014-06-13 01:37:12 -07:00
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-no-etc2"))
|
|
|
|
{
|
|
|
|
no_etc2 = 1;
|
|
|
|
}
|
2018-02-26 13:15:30 -08:00
|
|
|
else if (!strcmp(argv[i], "-no-save"))
|
|
|
|
{
|
|
|
|
no_save = 1;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(argv[i], "-id") || !strcmp(argv[i], "--image_dir")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
img_dirs = eina_list_append(img_dirs, argv[i]);
|
|
|
|
}
|
|
|
|
else if ((!strcmp(argv[i], "-fd") || !strcmp(argv[i], "--font_dir")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
fnt_dirs = eina_list_append(fnt_dirs, argv[i]);
|
|
|
|
}
|
2011-11-04 05:18:13 -07:00
|
|
|
else if ((!strcmp(argv[i], "-sd") || !strcmp(argv[i], "--sound_dir")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
snd_dirs = eina_list_append(snd_dirs, argv[i]);
|
|
|
|
}
|
2015-05-13 09:08:04 -07:00
|
|
|
else if ((!strcmp(argv[i], "-md") || !strcmp(argv[i], "--mo_dir")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
mo_dirs = eina_list_append(mo_dirs, argv[i]);
|
|
|
|
}
|
2014-03-19 21:00:20 -07:00
|
|
|
else if ((!strcmp(argv[i], "-vd") || !strcmp(argv[i], "--vibration_dir")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
vibration_dirs = eina_list_append(vibration_dirs, argv[i]);
|
|
|
|
}
|
2013-06-04 09:09:56 -07:00
|
|
|
else if ((!strcmp(argv[i], "-dd") || !strcmp(argv[i], "--data_dir")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
data_dirs = eina_list_append(data_dirs, argv[i]);
|
|
|
|
}
|
2018-02-26 13:15:30 -08:00
|
|
|
else if ((!strcmp(argv[i], "-td") || !strcmp(argv[i], "--tmp_dir")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
2009-08-25 10:25:23 -07:00
|
|
|
if (!tmp_dir)
|
|
|
|
tmp_dir = argv[i];
|
2018-02-26 13:15:30 -08:00
|
|
|
}
|
2014-03-03 03:39:53 -08:00
|
|
|
else if ((!strcmp(argv[i], "-l") || !strcmp(argv[i], "--license")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
if (!license)
|
|
|
|
license = argv[i];
|
2014-03-05 23:33:06 -08:00
|
|
|
else
|
|
|
|
licenses = eina_list_append(licenses, argv[i]);
|
|
|
|
}
|
|
|
|
else if ((!strcmp(argv[i], "-a") || !strcmp(argv[i], "--authors")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
if (!authors)
|
|
|
|
authors = argv[i];
|
2014-03-03 03:39:53 -08:00
|
|
|
}
|
2018-02-26 13:15:30 -08:00
|
|
|
else if ((!strcmp(argv[i], "-min-quality")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
min_quality = atoi(argv[i]);
|
|
|
|
if (min_quality < 0) min_quality = 0;
|
|
|
|
if (min_quality > 100) min_quality = 100;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(argv[i], "-max-quality")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
max_quality = atoi(argv[i]);
|
|
|
|
if (max_quality < 0) max_quality = 0;
|
|
|
|
if (max_quality > 100) max_quality = 100;
|
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-fastcomp"))
|
|
|
|
{
|
2012-05-15 05:29:22 -07:00
|
|
|
compress_mode = EET_COMPRESSION_SUPERFAST;
|
2018-02-26 13:15:30 -08:00
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-fastdecomp"))
|
|
|
|
{
|
2012-05-15 05:29:22 -07:00
|
|
|
compress_mode = EET_COMPRESSION_VERYFAST;
|
2018-02-26 13:15:30 -08:00
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-threads"))
|
|
|
|
{
|
2012-05-23 20:59:02 -07:00
|
|
|
threads = 1;
|
2018-02-26 13:15:30 -08:00
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-nothreads"))
|
|
|
|
{
|
2012-05-30 05:25:53 -07:00
|
|
|
threads = 0;
|
2018-02-26 13:15:30 -08:00
|
|
|
}
|
|
|
|
else if (!strncmp(argv[i], "-D", 2))
|
|
|
|
{
|
|
|
|
defines = eina_list_append(defines, mem_strdup(argv[i]));
|
|
|
|
}
|
|
|
|
else if ((!strcmp(argv[i], "-o")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
file_out = argv[i];
|
|
|
|
}
|
|
|
|
else if ((!strcmp(argv[i], "-w")) && (i < (argc - 1)))
|
|
|
|
{
|
2012-05-08 03:35:57 -07:00
|
|
|
i++;
|
|
|
|
watchfile = argv[i];
|
|
|
|
unlink(watchfile);
|
2018-02-26 13:15:30 -08:00
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-annotate"))
|
|
|
|
{
|
2015-04-16 09:29:10 -07:00
|
|
|
annotate = 1;
|
2012-09-03 19:13:05 -07:00
|
|
|
}
|
2018-02-26 13:15:30 -08:00
|
|
|
else if ((!strcmp(argv[i], "-deps")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
depfile = argv[i];
|
|
|
|
unlink(depfile);
|
|
|
|
}
|
2016-06-13 10:54:18 -07:00
|
|
|
else if (!strcmp(argv[i], "-beta"))
|
|
|
|
{
|
|
|
|
beta = 1;
|
|
|
|
}
|
2018-06-15 10:26:44 -07:00
|
|
|
else if (!strcmp(argv[i], "-N"))
|
|
|
|
{
|
|
|
|
namespace_verify = 1;
|
|
|
|
}
|
2018-02-26 13:15:30 -08:00
|
|
|
else if (!file_in)
|
|
|
|
file_in = argv[i];
|
|
|
|
else if (!file_out)
|
|
|
|
file_out = argv[i];
|
2003-06-09 04:31:33 -07:00
|
|
|
}
|
2012-07-31 15:42:03 -07:00
|
|
|
|
2003-06-09 04:31:33 -07:00
|
|
|
if (!file_in)
|
|
|
|
{
|
2018-02-26 13:15:30 -08:00
|
|
|
ERR("no input file specified.");
|
|
|
|
main_help();
|
|
|
|
exit(-1);
|
2003-06-09 04:31:33 -07:00
|
|
|
}
|
2004-10-16 04:34:09 -07:00
|
|
|
|
2018-02-26 13:15:30 -08:00
|
|
|
pfx = eina_prefix_new(argv[0], /* argv[0] value (optional) */
|
|
|
|
main, /* an optional symbol to check path of */
|
|
|
|
"EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
|
|
|
|
"edje", /* dir to add after "share" (PREFIX/share/DIRNAME) */
|
2011-04-24 00:36:15 -07:00
|
|
|
"include/edje.inc", /* a magic file to check for in PREFIX/share/DIRNAME for success */
|
|
|
|
PACKAGE_BIN_DIR, /* package bin dir @ compile time */
|
|
|
|
PACKAGE_LIB_DIR, /* package lib dir @ compile time */
|
|
|
|
PACKAGE_DATA_DIR, /* package data dir @ compile time */
|
|
|
|
PACKAGE_DATA_DIR /* if locale needed use LOCALE_DIR */
|
2018-02-26 13:15:30 -08:00
|
|
|
);
|
2007-08-27 02:32:17 -07:00
|
|
|
|
2004-10-16 04:34:09 -07:00
|
|
|
/* check whether file_in exists */
|
2004-10-20 09:48:58 -07:00
|
|
|
#ifdef HAVE_REALPATH
|
2004-10-16 04:34:09 -07:00
|
|
|
if (!realpath(file_in, rpath) || stat(rpath, &st) || !S_ISREG(st.st_mode))
|
2004-10-20 09:48:58 -07:00
|
|
|
#else
|
|
|
|
if (stat(file_in, &st) || !S_ISREG(st.st_mode))
|
|
|
|
#endif
|
2004-10-16 04:34:09 -07:00
|
|
|
{
|
2018-02-26 13:15:30 -08:00
|
|
|
ERR("file not found: %s.", file_in);
|
|
|
|
main_help();
|
|
|
|
exit(-1);
|
2004-10-16 04:34:09 -07:00
|
|
|
}
|
|
|
|
|
2003-08-05 18:29:12 -07:00
|
|
|
if (!file_out)
|
2018-02-26 13:15:30 -08:00
|
|
|
{
|
|
|
|
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, ".edj");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-06-09 04:31:33 -07:00
|
|
|
if (!file_out)
|
|
|
|
{
|
2018-02-26 13:15:30 -08:00
|
|
|
ERR("no output file specified.");
|
|
|
|
main_help();
|
|
|
|
exit(-1);
|
2003-06-09 04:31:33 -07:00
|
|
|
}
|
2003-06-17 01:15:06 -07:00
|
|
|
|
2004-10-20 09:48:58 -07:00
|
|
|
#ifdef HAVE_REALPATH
|
2018-02-26 13:15:30 -08:00
|
|
|
if (realpath(file_out, rpath2) && !strcmp(rpath, rpath2))
|
2004-10-20 09:48:58 -07:00
|
|
|
#else
|
2018-02-26 13:15:30 -08:00
|
|
|
if (!strcmp(file_in, file_out))
|
2004-10-20 09:48:58 -07:00
|
|
|
#endif
|
2004-10-16 04:34:09 -07:00
|
|
|
{
|
2018-02-26 13:15:30 -08:00
|
|
|
ERR("input file equals output file.");
|
|
|
|
main_help();
|
|
|
|
exit(-1);
|
2004-10-16 04:34:09 -07:00
|
|
|
}
|
|
|
|
|
2012-09-03 19:13:05 -07:00
|
|
|
using_file(file_in, 'E');
|
2015-04-16 09:29:10 -07:00
|
|
|
if (annotate) using_file(file_out, 'O');
|
2012-05-30 23:50:09 -07:00
|
|
|
|
2010-02-01 09:26:25 -08:00
|
|
|
if (!edje_init())
|
|
|
|
exit(-1);
|
2003-06-17 01:15:06 -07:00
|
|
|
|
2010-08-15 11:14:33 -07:00
|
|
|
edje_file = mem_alloc(SZ(Edje_File));
|
2005-03-16 10:39:39 -08:00
|
|
|
edje_file->compiler = strdup("edje_cc");
|
2004-03-07 18:43:48 -08:00
|
|
|
edje_file->version = EDJE_FILE_VERSION;
|
2010-08-25 02:56:20 -07:00
|
|
|
edje_file->minor = EDJE_FILE_MINOR;
|
2004-10-12 20:43:42 -07:00
|
|
|
edje_file->feature_ver = 1; /* increment this every time we add a field
|
2018-02-26 13:15:30 -08:00
|
|
|
* or feature to the edje file format that
|
|
|
|
* does not load nicely as a NULL or 0 value
|
|
|
|
* and needs a special fallback initialization
|
|
|
|
*/
|
2017-06-14 14:24:04 -07:00
|
|
|
/* efl_version is used for specify efl's version
|
|
|
|
* which was used for developing a edje file.
|
|
|
|
* It is useful if Edje(or other EFL libs) need to keep
|
|
|
|
* backward compatibility.
|
edje: support legacy Textblock calculation logic for 1.18 edje file
Summary:
From EFL 1.19, Edje Textblock calculation logic was fixed according to
Edje documents. But, it broke old edje files which ignored text.min
option for minimum width. Even if the old edje files were wrong,
we need to support them as discussed from T5548.
Also, this patch will change default efl_version to 1.18 from 1.19.
So, without efl_version property, edje file will run on the legacy logic.
Fixes T5548
Test Plan: Turn on/off presentation mode in Enlightenment.
Reviewers: herdsman, cedric, jpeg, zmike, raster
Subscribers: stefan_schmidt
Maniphest Tasks: T5548
Differential Revision: https://phab.enlightenment.org/D4967
Adjusted by @jpeg
2017-07-03 21:53:59 -07:00
|
|
|
* efl_version was added to fix backward compatibility issue caused from EFL 1.19.
|
|
|
|
* Thus, 1.18 will be default.
|
2017-06-14 14:24:04 -07:00
|
|
|
*/
|
|
|
|
edje_file->efl_version.major = 1;
|
edje: support legacy Textblock calculation logic for 1.18 edje file
Summary:
From EFL 1.19, Edje Textblock calculation logic was fixed according to
Edje documents. But, it broke old edje files which ignored text.min
option for minimum width. Even if the old edje files were wrong,
we need to support them as discussed from T5548.
Also, this patch will change default efl_version to 1.18 from 1.19.
So, without efl_version property, edje file will run on the legacy logic.
Fixes T5548
Test Plan: Turn on/off presentation mode in Enlightenment.
Reviewers: herdsman, cedric, jpeg, zmike, raster
Subscribers: stefan_schmidt
Maniphest Tasks: T5548
Differential Revision: https://phab.enlightenment.org/D4967
Adjusted by @jpeg
2017-07-03 21:53:59 -07:00
|
|
|
edje_file->efl_version.minor = 18;
|
edje: Add dpi feature.
Summary:
This dpi is used to get the scale for each collection.
If each collection has a described dpi, it calculates a proper scale
based on the dpi and dpi which is described in the collection.
@feature
Test Plan:
If add dpi to collection of edc, the edje will save the value as the dpi of the collection.
For example, if the dpi of your device is 100, you just set dpi: 100 in the collection of edc.
If the edj is loaded in another device(dpi is 200), it will scaled 2 times.
It is possible that the described dpi of application and theme are different.
In that case, application and theme have a different scale.
It makes the edj that made in different environment works in one device.
Reviewers: seoz, zmike, JackDanielZ, Hermet, woohyun, cedric, raster
Reviewed By: raster
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1190
2014-07-23 22:50:25 -07:00
|
|
|
edje_file->base_scale = FROM_INT(1);
|
2018-02-26 15:54:38 -08:00
|
|
|
requires = eina_array_new(10);
|
2007-08-27 02:32:17 -07:00
|
|
|
|
2018-01-27 08:55:40 -08:00
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
2018-01-26 11:08:29 -08:00
|
|
|
{
|
|
|
|
struct rlimit lim;
|
|
|
|
if (getrlimit(RLIMIT_NOFILE, &lim))
|
|
|
|
fprintf(stderr, "error getting max open file limit: %s\n", strerror(errno));
|
|
|
|
max_open_files = lim.rlim_cur;
|
|
|
|
}
|
2018-01-27 08:55:40 -08:00
|
|
|
#else
|
|
|
|
max_open_files = 1024;
|
|
|
|
#endif
|
2018-01-26 11:08:29 -08:00
|
|
|
ecore_evas_init();
|
|
|
|
|
2004-08-29 04:03:19 -07:00
|
|
|
source_edd();
|
|
|
|
source_fetch();
|
2007-08-27 02:32:17 -07:00
|
|
|
|
|
|
|
data_setup();
|
2003-06-09 04:31:33 -07:00
|
|
|
compile();
|
2011-09-28 18:29:21 -07:00
|
|
|
reorder_parts();
|
2004-04-01 01:30:45 -08:00
|
|
|
data_process_scripts();
|
2003-06-13 20:06:36 -07:00
|
|
|
data_process_lookups();
|
2004-04-01 01:30:45 -08:00
|
|
|
data_process_script_lookups();
|
2003-06-09 06:51:40 -07:00
|
|
|
data_write();
|
2004-01-17 07:37:48 -08:00
|
|
|
|
2011-04-24 00:36:15 -07:00
|
|
|
eina_prefix_free(pfx);
|
|
|
|
pfx = NULL;
|
2018-02-26 13:15:30 -08:00
|
|
|
|
2020-03-24 05:54:37 -07:00
|
|
|
ecore_evas_shutdown();
|
2004-01-17 07:37:48 -08:00
|
|
|
edje_shutdown();
|
2009-12-22 05:46:00 -08:00
|
|
|
eina_log_domain_unregister(_edje_cc_log_dom);
|
2008-10-15 07:11:11 -07:00
|
|
|
eina_shutdown();
|
|
|
|
|
2003-06-09 04:31:33 -07:00
|
|
|
return 0;
|
|
|
|
}
|
2018-02-26 13:15:30 -08:00
|
|
|
|