forked from enlightenment/efl
edje: report type of file when listing files used by an edc.
SVN revision: 76095
This commit is contained in:
parent
509a28a47c
commit
8ad4e0c02e
|
@ -581,3 +581,7 @@
|
||||||
2012-08-30 Cedric Bail
|
2012-08-30 Cedric Bail
|
||||||
|
|
||||||
* Check the number of parameter for image in edc.
|
* Check the number of parameter for image in edc.
|
||||||
|
|
||||||
|
2012-09-04 Cedric Bail
|
||||||
|
|
||||||
|
* Report type of file when listing file used by an edc.
|
||||||
|
|
|
@ -4,6 +4,7 @@ Changes since Edje 1.8.0:
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
Additions:
|
Additions:
|
||||||
|
* Report type of file when listing file used by an edc.
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
* Check the number of parameter for image in edc.
|
* Check the number of parameter for image in edc.
|
||||||
|
|
|
@ -31,6 +31,7 @@ int min_quality = 0;
|
||||||
int max_quality = 100;
|
int max_quality = 100;
|
||||||
int compress_mode = EET_COMPRESSION_DEFAULT;
|
int compress_mode = EET_COMPRESSION_DEFAULT;
|
||||||
int threads = 0;
|
int threads = 0;
|
||||||
|
int anotate = 0;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_edje_cc_log_cb(const Eina_Log_Domain *d,
|
_edje_cc_log_cb(const Eina_Log_Domain *d,
|
||||||
|
@ -82,6 +83,7 @@ main_help(void)
|
||||||
"Where OPTIONS is one or more of:\n"
|
"Where OPTIONS is one or more of:\n"
|
||||||
"\n"
|
"\n"
|
||||||
"-w files.txt Dump all sources files path into files.txt\n"
|
"-w files.txt Dump all sources files path into files.txt\n"
|
||||||
|
"-anotate Anotate the dumped files.\n"
|
||||||
"-id image/directory Add a directory to look in for relative path images\n"
|
"-id image/directory Add a directory to look in for relative path images\n"
|
||||||
"-fd font/directory Add a directory to look in for relative path fonts\n"
|
"-fd font/directory Add a directory to look in for relative path fonts\n"
|
||||||
"-sd sound/directory Add a directory to look in for relative path sounds samples\n"
|
"-sd sound/directory Add a directory to look in for relative path sounds samples\n"
|
||||||
|
@ -226,6 +228,10 @@ main(int argc, char **argv)
|
||||||
watchfile = argv[i];
|
watchfile = argv[i];
|
||||||
unlink(watchfile);
|
unlink(watchfile);
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(argv[i], "-anotate"))
|
||||||
|
{
|
||||||
|
anotate = 1;
|
||||||
|
}
|
||||||
else if (!file_in)
|
else if (!file_in)
|
||||||
file_in = argv[i];
|
file_in = argv[i];
|
||||||
else if (!file_out)
|
else if (!file_out)
|
||||||
|
@ -296,7 +302,8 @@ main(int argc, char **argv)
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
using_file(file_in);
|
using_file(file_in, 'E');
|
||||||
|
if (anotate) using_file(file_out, 'O');
|
||||||
|
|
||||||
if (!edje_init())
|
if (!edje_init())
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
|
@ -202,7 +202,7 @@ void *mem_alloc(size_t size);
|
||||||
char *mem_strdup(const char *s);
|
char *mem_strdup(const char *s);
|
||||||
#define SZ sizeof
|
#define SZ sizeof
|
||||||
|
|
||||||
void using_file(const char *filename);
|
void using_file(const char *filename, const char type);
|
||||||
|
|
||||||
void error_and_abort(Eet_File *ef, const char *fmt, ...);
|
void error_and_abort(Eet_File *ef, const char *fmt, ...);
|
||||||
|
|
||||||
|
@ -235,5 +235,6 @@ extern New_Object_Handler object_handlers[];
|
||||||
extern New_Statement_Handler statement_handlers[];
|
extern New_Statement_Handler statement_handlers[];
|
||||||
extern int compress_mode;
|
extern int compress_mode;
|
||||||
extern int threads;
|
extern int threads;
|
||||||
|
extern int anotate;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -425,7 +425,7 @@ data_thread_fonts(void *data, Ecore_Thread *thread __UNUSED__)
|
||||||
f = eina_file_open(fc->fn->file, 0);
|
f = eina_file_open(fc->fn->file, 0);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
using_file(fc->fn->file);
|
using_file(fc->fn->file, 'F');
|
||||||
m = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
|
m = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -438,7 +438,7 @@ data_thread_fonts(void *data, Ecore_Thread *thread __UNUSED__)
|
||||||
f = eina_file_open(buf, 0);
|
f = eina_file_open(buf, 0);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
using_file(buf);
|
using_file(buf, 'F');
|
||||||
m = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
|
m = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
|
||||||
if (m) break;
|
if (m) break;
|
||||||
eina_file_close(f);
|
eina_file_close(f);
|
||||||
|
@ -805,7 +805,7 @@ data_write_images(Eet_File *ef, int *image_num)
|
||||||
pending_threads++;
|
pending_threads++;
|
||||||
if (threads)
|
if (threads)
|
||||||
evas_object_image_preload(im, 0);
|
evas_object_image_preload(im, 0);
|
||||||
using_file(buf);
|
using_file(buf, 'I');
|
||||||
if (!threads)
|
if (!threads)
|
||||||
data_image_preload_done(iw, evas, im, NULL);
|
data_image_preload_done(iw, evas, im, NULL);
|
||||||
break;
|
break;
|
||||||
|
@ -822,7 +822,7 @@ data_write_images(Eet_File *ef, int *image_num)
|
||||||
pending_threads++;
|
pending_threads++;
|
||||||
if (threads)
|
if (threads)
|
||||||
evas_object_image_preload(im, 0);
|
evas_object_image_preload(im, 0);
|
||||||
using_file(img->entry);
|
using_file(img->entry, 'I');
|
||||||
if (!threads)
|
if (!threads)
|
||||||
data_image_preload_done(iw, evas, im, NULL);
|
data_image_preload_done(iw, evas, im, NULL);
|
||||||
}
|
}
|
||||||
|
@ -868,9 +868,9 @@ data_thread_sounds(void *data, Ecore_Thread *thread __UNUSED__)
|
||||||
enc_info = _edje_multisense_encode(snd_path, sw->sample,
|
enc_info = _edje_multisense_encode(snd_path, sw->sample,
|
||||||
sw->sample->quality);
|
sw->sample->quality);
|
||||||
f = eina_file_open(enc_info->file, 0);
|
f = eina_file_open(enc_info->file, 0);
|
||||||
if (f) using_file(enc_info->file);
|
if (f) using_file(enc_info->file, 'S');
|
||||||
#else
|
#else
|
||||||
if (f) using_file(snd_path);
|
if (f) using_file(snd_path, 'S');
|
||||||
#endif
|
#endif
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
|
@ -2569,14 +2569,21 @@ data_process_script_lookups(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
using_file(const char *filename)
|
using_file(const char *filename, const char type)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
if (!watchfile) return;
|
if (!watchfile) return;
|
||||||
f = fopen(watchfile, "ab");
|
f = fopen(watchfile, "ab");
|
||||||
if (!f) return ;
|
if (!f) return ;
|
||||||
fputs(filename, f);
|
if (anotate)
|
||||||
fputc('\n', f);
|
{
|
||||||
|
fprintf(f, "%c: %s\n", type, filename);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fputs(filename, f);
|
||||||
|
fputc('\n', f);
|
||||||
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -738,8 +738,12 @@ compile(void)
|
||||||
eina_prefix_lib_get(pfx));
|
eina_prefix_lib_get(pfx));
|
||||||
if (ecore_file_exists(buf2))
|
if (ecore_file_exists(buf2))
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s -a %s %s -I%s %s -o %s",
|
if (anotate)
|
||||||
buf2, watchfile ? watchfile : "/dev/null", file_in, inc, def, tmpn);
|
snprintf(buf, sizeof(buf), "%s -anotate -a %s %s -I%s %s -o %s",
|
||||||
|
buf2, watchfile ? watchfile : "/dev/null", file_in, inc, def, tmpn);
|
||||||
|
else
|
||||||
|
snprintf(buf, sizeof(buf), "%s -a %s %s -I%s %s -o %s",
|
||||||
|
buf2, watchfile ? watchfile : "/dev/null", file_in, inc, def, tmpn);
|
||||||
ret = system(buf);
|
ret = system(buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -33,8 +33,11 @@ read_watch_file(const char *file)
|
||||||
{
|
{
|
||||||
const char *path;
|
const char *path;
|
||||||
|
|
||||||
path = eina_stringshare_add_length(ln->start, ln->length);
|
if (ln->length < 4) continue ;
|
||||||
r = eina_list_append(r, eio_monitor_add(path));
|
path = eina_stringshare_add_length(ln->start + 3, ln->length);
|
||||||
|
fprintf(stderr, "%c: %s\n", *ln->start, path);
|
||||||
|
if (*ln->start != 'O')
|
||||||
|
r = eina_list_append(r, eio_monitor_add(path));
|
||||||
eina_stringshare_del(path);
|
eina_stringshare_del(path);
|
||||||
}
|
}
|
||||||
eina_iterator_free(it);
|
eina_iterator_free(it);
|
||||||
|
@ -53,11 +56,11 @@ rebuild(void *data __UNUSED__)
|
||||||
double start, end;
|
double start, end;
|
||||||
|
|
||||||
start = ecore_time_get();
|
start = ecore_time_get();
|
||||||
fprintf(stderr, "SYSTEM('%s')\n", edje_cc_command);
|
fprintf(stderr, "* SYSTEM('%s')\n", edje_cc_command);
|
||||||
if (system(edje_cc_command) == 0)
|
if (system(edje_cc_command) == 0)
|
||||||
read_watch_file(watchfile);
|
read_watch_file(watchfile);
|
||||||
end = ecore_time_get();
|
end = ecore_time_get();
|
||||||
fprintf(stderr, "DONE IN %f\n", end - start);
|
fprintf(stderr, "* DONE IN %f\n", end - start);
|
||||||
|
|
||||||
timeout = NULL;
|
timeout = NULL;
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
@ -66,9 +69,6 @@ rebuild(void *data __UNUSED__)
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
some_change(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
some_change(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
||||||
{
|
{
|
||||||
Eio_Monitor_Event *ev = event;
|
|
||||||
|
|
||||||
fprintf(stderr, "EVENT %i on [%s]\n", type, ev->filename);
|
|
||||||
if (timeout) ecore_timer_del(timeout);
|
if (timeout) ecore_timer_del(timeout);
|
||||||
timeout = ecore_timer_add(0.5, rebuild, NULL);
|
timeout = ecore_timer_add(0.5, rebuild, NULL);
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ main(int argc, char **argv)
|
||||||
buf = eina_strbuf_new();
|
buf = eina_strbuf_new();
|
||||||
if (!buf) return -1;
|
if (!buf) return -1;
|
||||||
|
|
||||||
eina_strbuf_append_printf(buf, "%s/edje_cc -threads -fastcomp -w %s ", PACKAGE_BIN_DIR, watchfile);
|
eina_strbuf_append_printf(buf, "%s/edje_cc -anotate -threads -fastcomp -w %s ", PACKAGE_BIN_DIR, watchfile);
|
||||||
for (i = 1; i < argc; ++i)
|
for (i = 1; i < argc; ++i)
|
||||||
eina_strbuf_append_printf(buf, "%s ", argv[i]);
|
eina_strbuf_append_printf(buf, "%s ", argv[i]);
|
||||||
|
|
||||||
|
|
|
@ -513,6 +513,8 @@ unsigned char is_hor_space[256];
|
||||||
/* table to tell if c is horizontal or vertical space. */
|
/* table to tell if c is horizontal or vertical space. */
|
||||||
static unsigned char is_space[256];
|
static unsigned char is_space[256];
|
||||||
|
|
||||||
|
static int anotate = 0;
|
||||||
|
|
||||||
/* Initialize syntactic classifications of characters. */
|
/* Initialize syntactic classifications of characters. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -5489,7 +5491,7 @@ open_include_file(cpp_reader * pfile, char *filename,
|
||||||
&& !strncmp(searchptr->fname, filename, p - filename))
|
&& !strncmp(searchptr->fname, filename, p - filename))
|
||||||
{
|
{
|
||||||
/* FILENAME is in SEARCHPTR, which we've already checked. */
|
/* FILENAME is in SEARCHPTR, which we've already checked. */
|
||||||
using_file(filename);
|
using_file(filename, 'E');
|
||||||
return open(filename, O_RDONLY | O_BINARY, 0666);
|
return open(filename, O_RDONLY | O_BINARY, 0666);
|
||||||
}
|
}
|
||||||
if (p == filename)
|
if (p == filename)
|
||||||
|
@ -5510,11 +5512,11 @@ open_include_file(cpp_reader * pfile, char *filename,
|
||||||
for (map = read_name_map(pfile, dir); map; map = map->map_next)
|
for (map = read_name_map(pfile, dir); map; map = map->map_next)
|
||||||
if (!strcmp(map->map_from, from))
|
if (!strcmp(map->map_from, from))
|
||||||
{
|
{
|
||||||
using_file(map->map_to);
|
using_file(map->map_to, 'E');
|
||||||
return open(map->map_to, O_RDONLY | O_BINARY, 0666);
|
return open(map->map_to, O_RDONLY | O_BINARY, 0666);
|
||||||
}
|
}
|
||||||
|
|
||||||
using_file(filename);
|
using_file(filename, 'E');
|
||||||
return open(filename, O_RDONLY | O_BINARY, 0666);
|
return open(filename, O_RDONLY | O_BINARY, 0666);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5524,7 +5526,7 @@ static int
|
||||||
open_include_file(cpp_reader * pfile __UNUSED__, char *filename,
|
open_include_file(cpp_reader * pfile __UNUSED__, char *filename,
|
||||||
file_name_list * searchptr __UNUSED__)
|
file_name_list * searchptr __UNUSED__)
|
||||||
{
|
{
|
||||||
using_file(filename);
|
using_file(filename, 'E');
|
||||||
return open(filename, O_RDONLY | O_BINARY, 0666);
|
return open(filename, O_RDONLY | O_BINARY, 0666);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6578,6 +6580,10 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
|
||||||
opts->watchfile = argv[i];
|
opts->watchfile = argv[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(argv[i], "-anotate"))
|
||||||
|
{
|
||||||
|
anotate = 1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7449,13 +7455,20 @@ cpp_perror_with_name(cpp_reader * pfile, const char *name)
|
||||||
extern cpp_options options;
|
extern cpp_options options;
|
||||||
|
|
||||||
void
|
void
|
||||||
using_file(const char *filename)
|
using_file(const char *filename, const char type)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
f = fopen(options.watchfile, "a");
|
f = fopen(options.watchfile, "a");
|
||||||
if (!f) return ;
|
if (!f) return ;
|
||||||
fputs(filename, f);
|
if (anotate)
|
||||||
fputc('\n', f);
|
{
|
||||||
|
fprintf(f, "%c: %s\n", type, filename);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fputs(filename, f);
|
||||||
|
fputc('\n', f);
|
||||||
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -639,7 +639,7 @@ void *xmalloc(unsigned size);
|
||||||
void *xrealloc(void *old, unsigned size);
|
void *xrealloc(void *old, unsigned size);
|
||||||
void *xcalloc(unsigned number, unsigned size);
|
void *xcalloc(unsigned number, unsigned size);
|
||||||
|
|
||||||
void using_file(const char *filename);
|
void using_file(const char *filename, const char type);
|
||||||
|
|
||||||
#ifdef __EMX__
|
#ifdef __EMX__
|
||||||
#define PATH_SEPARATOR ';'
|
#define PATH_SEPARATOR ';'
|
||||||
|
|
Loading…
Reference in New Issue