forked from enlightenment/efl
edje: reformat bin/ c files
a lot of this was unreadable due to mixed tabs/spaces or just random formatting
This commit is contained in:
parent
645c573efb
commit
30378f26fa
|
@ -72,12 +72,15 @@ _edje_cc_log_cb(const Eina_Log_Domain *d,
|
||||||
case EINA_LOG_LEVEL_CRITICAL:
|
case EINA_LOG_LEVEL_CRITICAL:
|
||||||
prefix = "Critical. ";
|
prefix = "Critical. ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EINA_LOG_LEVEL_ERR:
|
case EINA_LOG_LEVEL_ERR:
|
||||||
prefix = "Error. ";
|
prefix = "Error. ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EINA_LOG_LEVEL_WARN:
|
case EINA_LOG_LEVEL_WARN:
|
||||||
prefix = "Warning. ";
|
prefix = "Warning. ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
prefix = "";
|
prefix = "";
|
||||||
}
|
}
|
||||||
|
@ -127,7 +130,7 @@ main_help(void)
|
||||||
"-threads Compile the edje file using multiple parallel threads (by default)\n"
|
"-threads Compile the edje file using multiple parallel threads (by default)\n"
|
||||||
"-nothreads Compile the edje file using only the main loop\n"
|
"-nothreads Compile the edje file using only the main loop\n"
|
||||||
"-V [--version] show program version\n"
|
"-V [--version] show program version\n"
|
||||||
,progname);
|
, progname);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -362,13 +365,13 @@ main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *suffix;
|
char *suffix;
|
||||||
|
|
||||||
if ((suffix = strstr(file_in,".edc")) && (suffix[4] == 0))
|
if ((suffix = strstr(file_in, ".edc")) && (suffix[4] == 0))
|
||||||
{
|
{
|
||||||
file_out = strdup(file_in);
|
file_out = strdup(file_in);
|
||||||
if (file_out)
|
if (file_out)
|
||||||
{
|
{
|
||||||
suffix = strstr(file_out,".edc");
|
suffix = strstr(file_out, ".edc");
|
||||||
strcpy(suffix,".edj");
|
strcpy(suffix, ".edj");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,9 +383,9 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_REALPATH
|
#ifdef HAVE_REALPATH
|
||||||
if (realpath(file_out, rpath2) && !strcmp (rpath, rpath2))
|
if (realpath(file_out, rpath2) && !strcmp(rpath, rpath2))
|
||||||
#else
|
#else
|
||||||
if (!strcmp (file_in, file_out))
|
if (!strcmp(file_in, file_out))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ERR("input file equals output file.");
|
ERR("input file equals output file.");
|
||||||
|
@ -448,3 +451,4 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -32,3 +32,4 @@ mem_strdup(const char *s)
|
||||||
exit(-1);
|
exit(-1);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ typedef struct _Group_Lookup Group_Lookup;
|
||||||
typedef struct _Image_Lookup Image_Lookup;
|
typedef struct _Image_Lookup Image_Lookup;
|
||||||
typedef struct _Code_Lookup Code_Lookup;
|
typedef struct _Code_Lookup Code_Lookup;
|
||||||
|
|
||||||
|
|
||||||
struct _External_Lookup
|
struct _External_Lookup
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -44,9 +43,11 @@ struct _Part_Lookup_Key
|
||||||
{
|
{
|
||||||
Edje_Part_Collection *pc;
|
Edje_Part_Collection *pc;
|
||||||
|
|
||||||
union {
|
union
|
||||||
|
{
|
||||||
int *dest;
|
int *dest;
|
||||||
struct {
|
struct
|
||||||
|
{
|
||||||
unsigned char **base;
|
unsigned char **base;
|
||||||
int offset;
|
int offset;
|
||||||
} reallocated;
|
} reallocated;
|
||||||
|
@ -210,7 +211,7 @@ typedef struct _Image_Unused_Ids Image_Unused_Ids;
|
||||||
static int pending_threads = 0;
|
static int pending_threads = 0;
|
||||||
static int pending_image_threads = 0;
|
static int pending_image_threads = 0;
|
||||||
|
|
||||||
static void data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char* ptr, int len));
|
static void data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char *ptr, int len));
|
||||||
|
|
||||||
extern Eina_List *po_files;
|
extern Eina_List *po_files;
|
||||||
|
|
||||||
|
@ -304,23 +305,23 @@ _part_lookup_key_pc_hash(const void *key, int key_length EINA_UNUSED)
|
||||||
if (a->stable)
|
if (a->stable)
|
||||||
{
|
{
|
||||||
#ifdef EFL64
|
#ifdef EFL64
|
||||||
return eina_hash_int64((unsigned long long int *) &a->pc, sizeof (void*)) ^
|
return eina_hash_int64((unsigned long long int *)&a->pc, sizeof (void *)) ^
|
||||||
eina_hash_int64((unsigned long long int *) &a->mem.dest, sizeof (void*));
|
eina_hash_int64((unsigned long long int *)&a->mem.dest, sizeof (void *));
|
||||||
#else
|
#else
|
||||||
return eina_hash_int32((uintptr_t *) &a->pc, sizeof (void*)) ^
|
return eina_hash_int32((uintptr_t *)&a->pc, sizeof (void *)) ^
|
||||||
eina_hash_int32((uintptr_t *) &a->mem.dest, sizeof (void*));
|
eina_hash_int32((uintptr_t *)&a->mem.dest, sizeof (void *));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef EFL64
|
#ifdef EFL64
|
||||||
return eina_hash_int64((unsigned long long int *) &a->pc, sizeof (void*)) ^
|
return eina_hash_int64((unsigned long long int *)&a->pc, sizeof (void *)) ^
|
||||||
eina_hash_int64((unsigned long long int *) &a->mem.reallocated.base, sizeof (void*)) ^
|
eina_hash_int64((unsigned long long int *)&a->mem.reallocated.base, sizeof (void *)) ^
|
||||||
eina_hash_int32((unsigned int *) &a->mem.reallocated.offset, sizeof (int));
|
eina_hash_int32((unsigned int *)&a->mem.reallocated.offset, sizeof (int));
|
||||||
#else
|
#else
|
||||||
return eina_hash_int32((uintptr_t *) &a->pc, sizeof (void*)) ^
|
return eina_hash_int32((uintptr_t *)&a->pc, sizeof (void *)) ^
|
||||||
eina_hash_int32((uintptr_t *) &a->mem.reallocated.base, sizeof (void*)) ^
|
eina_hash_int32((uintptr_t *)&a->mem.reallocated.base, sizeof (void *)) ^
|
||||||
eina_hash_int32((unsigned int *) &a->mem.reallocated.offset, sizeof (int));
|
eina_hash_int32((unsigned int *)&a->mem.reallocated.offset, sizeof (int));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -348,19 +349,19 @@ _part_lookup_key_hash(const void *key, int key_length EINA_UNUSED)
|
||||||
if (a->stable)
|
if (a->stable)
|
||||||
{
|
{
|
||||||
#ifdef EFL64
|
#ifdef EFL64
|
||||||
return eina_hash_int64((unsigned long long int *) &a->mem.dest, sizeof (void*));
|
return eina_hash_int64((unsigned long long int *)&a->mem.dest, sizeof (void *));
|
||||||
#else
|
#else
|
||||||
return eina_hash_int32((uintptr_t *) &a->mem.dest, sizeof (void*));
|
return eina_hash_int32((uintptr_t *)&a->mem.dest, sizeof (void *));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef EFL64
|
#ifdef EFL64
|
||||||
return eina_hash_int64((unsigned long long int *) &a->mem.reallocated.base, sizeof (void*)) ^
|
return eina_hash_int64((unsigned long long int *)&a->mem.reallocated.base, sizeof (void *)) ^
|
||||||
eina_hash_int32((unsigned int *) &a->mem.reallocated.offset, sizeof (int));
|
eina_hash_int32((unsigned int *)&a->mem.reallocated.offset, sizeof (int));
|
||||||
#else
|
#else
|
||||||
return eina_hash_int32((uintptr_t *) &a->mem.reallocated.base, sizeof (void*)) ^
|
return eina_hash_int32((uintptr_t *)&a->mem.reallocated.base, sizeof (void *)) ^
|
||||||
eina_hash_int32((unsigned int *) &a->mem.reallocated.offset, sizeof (int));
|
eina_hash_int32((unsigned int *)&a->mem.reallocated.offset, sizeof (int));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -476,7 +477,6 @@ check_text_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
|
||||||
|
|
||||||
if (epd->text.id_text_source != -1)
|
if (epd->text.id_text_source != -1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((pc->parts[epd->text.id_text_source]->type == EDJE_PART_TYPE_TEXT) ||
|
if ((pc->parts[epd->text.id_text_source]->type == EDJE_PART_TYPE_TEXT) ||
|
||||||
(pc->parts[epd->text.id_text_source]->type == EDJE_PART_TYPE_TEXTBLOCK))
|
(pc->parts[epd->text.id_text_source]->type == EDJE_PART_TYPE_TEXTBLOCK))
|
||||||
return;
|
return;
|
||||||
|
@ -491,7 +491,7 @@ check_text_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
|
||||||
|
|
||||||
error_and_abort(ef, "Collection \"%s\" Part \"%s\" Description \"%s\" [%.3f]: "
|
error_and_abort(ef, "Collection \"%s\" Part \"%s\" Description \"%s\" [%.3f]: "
|
||||||
"text.text_source point to a non TEXT part \"%s\"!",
|
"text.text_source point to a non TEXT part \"%s\"!",
|
||||||
pc->part, ep->name,epd->common.state.name,
|
pc->part, ep->name, epd->common.state.name,
|
||||||
epd->common.state.value, pc->parts[epd->text.id_text_source]->name);
|
epd->common.state.value, pc->parts[epd->text.id_text_source]->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -526,7 +526,7 @@ check_source_links(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef, Eina_L
|
||||||
{
|
{
|
||||||
if (data == pc_source->parts[i]->source)
|
if (data == pc_source->parts[i]->source)
|
||||||
{
|
{
|
||||||
error_and_abort(ef,"Recursive loop group '%s' "
|
error_and_abort(ef, "Recursive loop group '%s' "
|
||||||
"already included inside "
|
"already included inside "
|
||||||
"part '%s' of group '%s'",
|
"part '%s' of group '%s'",
|
||||||
data, pc_source->parts[i]->name,
|
data, pc_source->parts[i]->name,
|
||||||
|
@ -603,10 +603,10 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
|
||||||
|
|
||||||
if (ep->type == EDJE_PART_TYPE_IMAGE)
|
if (ep->type == EDJE_PART_TYPE_IMAGE)
|
||||||
{
|
{
|
||||||
check_image_part_desc(pc, ep, (Edje_Part_Description_Image*) ep->default_desc, ef);
|
check_image_part_desc(pc, ep, (Edje_Part_Description_Image *)ep->default_desc, ef);
|
||||||
|
|
||||||
for (i = 0; i < ep->other.desc_count; ++i)
|
for (i = 0; i < ep->other.desc_count; ++i)
|
||||||
check_image_part_desc(pc, ep, (Edje_Part_Description_Image*) ep->other.desc[i], ef);
|
check_image_part_desc(pc, ep, (Edje_Part_Description_Image *)ep->other.desc[i], ef);
|
||||||
}
|
}
|
||||||
else if ((ep->type == EDJE_PART_TYPE_BOX) ||
|
else if ((ep->type == EDJE_PART_TYPE_BOX) ||
|
||||||
(ep->type == EDJE_PART_TYPE_TABLE))
|
(ep->type == EDJE_PART_TYPE_TABLE))
|
||||||
|
@ -615,13 +615,12 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
|
||||||
check_source_links(pc, ep, ef, group_path);
|
check_source_links(pc, ep, ef, group_path);
|
||||||
else if (ep->type == EDJE_PART_TYPE_TEXT)
|
else if (ep->type == EDJE_PART_TYPE_TEXT)
|
||||||
{
|
{
|
||||||
check_text_part_desc(pc, ep, (Edje_Part_Description_Text*) ep->default_desc, ef);
|
check_text_part_desc(pc, ep, (Edje_Part_Description_Text *)ep->default_desc, ef);
|
||||||
|
|
||||||
for (i = 0; i < ep->other.desc_count; ++i)
|
for (i = 0; i < ep->other.desc_count; ++i)
|
||||||
check_text_part_desc(pc, ep, (Edje_Part_Description_Text*) ep->other.desc[i], ef);
|
check_text_part_desc(pc, ep, (Edje_Part_Description_Text *)ep->other.desc[i], ef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: When smart masks are supported, remove this check */
|
/* FIXME: When smart masks are supported, remove this check */
|
||||||
if (ep->clip_to_id != -1 &&
|
if (ep->clip_to_id != -1 &&
|
||||||
(pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE) &&
|
(pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE) &&
|
||||||
|
@ -645,6 +644,7 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
|
||||||
error_and_abort(ef, "Collection %i: target missing in program "
|
error_and_abort(ef, "Collection %i: target missing in program "
|
||||||
"\"%s\"", pc->id, ep->name);
|
"\"%s\"", pc->id, ep->name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -984,7 +984,7 @@ error_and_abort_image_load_error(Eet_File *ef, const char *file, int error)
|
||||||
"and this module was compiled and all its dependencies exist.",
|
"and this module was compiled and all its dependencies exist.",
|
||||||
ext, file);
|
ext, file);
|
||||||
}
|
}
|
||||||
show_err:
|
show_err:
|
||||||
error_and_abort
|
error_and_abort
|
||||||
(ef, "Unable to load image \"%s\" used by file \"%s\": %s.%s",
|
(ef, "Unable to load image \"%s\" used by file \"%s\": %s.%s",
|
||||||
file, file_out, errmsg, hint);
|
file, file_out, errmsg, hint);
|
||||||
|
@ -1044,7 +1044,7 @@ data_thread_image(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||||
}
|
}
|
||||||
if (iw->alpha)
|
if (iw->alpha)
|
||||||
{
|
{
|
||||||
start = (unsigned int *) iw->data;
|
start = (unsigned int *)iw->data;
|
||||||
end = start + (iw->w * iw->h);
|
end = start + (iw->w * iw->h);
|
||||||
while (start < end)
|
while (start < end)
|
||||||
{
|
{
|
||||||
|
@ -1231,7 +1231,7 @@ tgv_file_check_and_add(Eet_File *ef, Edje_Image_Directory_Entry *img)
|
||||||
iw->ef = ef;
|
iw->ef = ef;
|
||||||
iw->img = img;
|
iw->img = img;
|
||||||
iw->emi = emi;
|
iw->emi = emi;
|
||||||
iw->data = (unsigned int *) data;
|
iw->data = (unsigned int *)data;
|
||||||
iw->w = iw->prop.w;
|
iw->w = iw->prop.w;
|
||||||
iw->h = iw->prop.h;
|
iw->h = iw->prop.h;
|
||||||
|
|
||||||
|
@ -1495,7 +1495,6 @@ data_check_models(Eet_File *ef EINA_UNUSED, int *model_num EINA_UNUSED)
|
||||||
snprintf(buf, sizeof(buf), "%s/%s", s, model->entry);
|
snprintf(buf, sizeof(buf), "%s/%s", s, model->entry);
|
||||||
|
|
||||||
file_exist = file_exist || ecore_file_exists(buf);
|
file_exist = file_exist || ecore_file_exists(buf);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!file_exist)
|
if (!file_exist)
|
||||||
{
|
{
|
||||||
|
@ -1684,7 +1683,6 @@ data_thread_mo(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||||
|
|
||||||
INF("Wrote %9i bytes (%4iKb) for \"%s\" %s mo entry \"%s\"",
|
INF("Wrote %9i bytes (%4iKb) for \"%s\" %s mo entry \"%s\"",
|
||||||
bytes, (bytes + 512) / 1024, moid_str, "RAW PCM", mw->mo_entry->locale);
|
bytes, (bytes + 512) / 1024, moid_str, "RAW PCM", mw->mo_entry->locale);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1886,6 +1884,7 @@ data_write_vibrations(Eet_File *ef, int *num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_groups(Eet_File *ef)
|
check_groups(Eet_File *ef)
|
||||||
{
|
{
|
||||||
|
@ -2002,7 +2001,8 @@ create_script_file(Eet_File *ef, const char *filename, const Code *cd, int fd)
|
||||||
newlined = 0;
|
newlined = 0;
|
||||||
if (sp[0] == '\n') newlined = 1;
|
if (sp[0] == '\n') newlined = 1;
|
||||||
if (!hash) fputc(sp[0], f);
|
if (!hash) fputc(sp[0], f);
|
||||||
else if (sp[0] == '\n') hash = 0;
|
else if (sp[0] == '\n')
|
||||||
|
hash = 0;
|
||||||
}
|
}
|
||||||
fputc('\n', f);
|
fputc('\n', f);
|
||||||
}
|
}
|
||||||
|
@ -2034,7 +2034,8 @@ create_script_file(Eet_File *ef, const char *filename, const Code *cd, int fd)
|
||||||
newlined = 0;
|
newlined = 0;
|
||||||
if (sp[0] == '\n') newlined = 1;
|
if (sp[0] == '\n') newlined = 1;
|
||||||
if (!hash) fputc(sp[0], f);
|
if (!hash) fputc(sp[0], f);
|
||||||
else if (sp[0] == '\n') hash = 0;
|
else if (sp[0] == '\n')
|
||||||
|
hash = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(f, "}\n");
|
fprintf(f, "}\n");
|
||||||
|
@ -2311,7 +2312,6 @@ _edje_lua_script_writer(lua_State *L EINA_UNUSED, const void *chunk_buf, size_t
|
||||||
Script_Lua_Writer *data;
|
Script_Lua_Writer *data;
|
||||||
void *old;
|
void *old;
|
||||||
|
|
||||||
|
|
||||||
data = (Script_Lua_Writer *)_data;
|
data = (Script_Lua_Writer *)_data;
|
||||||
old = data->buf;
|
old = data->buf;
|
||||||
data->buf = realloc(data->buf, data->size + chunk_size);
|
data->buf = realloc(data->buf, data->size + chunk_size);
|
||||||
|
@ -2328,6 +2328,7 @@ _edje_lua_script_writer(lua_State *L EINA_UNUSED, const void *chunk_buf, size_t
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2341,15 +2342,19 @@ _edje_lua_error_and_abort(lua_State *L, int err_code, Script_Write *sc)
|
||||||
case LUA_ERRRUN:
|
case LUA_ERRRUN:
|
||||||
err_type = "runtime";
|
err_type = "runtime";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LUA_ERRSYNTAX:
|
case LUA_ERRSYNTAX:
|
||||||
err_type = "syntax";
|
err_type = "syntax";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LUA_ERRMEM:
|
case LUA_ERRMEM:
|
||||||
err_type = "memory allocation";
|
err_type = "memory allocation";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LUA_ERRERR:
|
case LUA_ERRERR:
|
||||||
err_type = "error handler";
|
err_type = "error handler";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
err_type = "unknown";
|
err_type = "unknown";
|
||||||
break;
|
break;
|
||||||
|
@ -2418,7 +2423,7 @@ data_thread_lua_script(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||||
}
|
}
|
||||||
luaL_pushresult(&b);
|
luaL_pushresult(&b);
|
||||||
#ifdef LUA_BINARY
|
#ifdef LUA_BINARY
|
||||||
if (err_code = luaL_loadstring(L, lua_tostring (L, -1)))
|
if (err_code = luaL_loadstring(L, lua_tostring(L, -1)))
|
||||||
{
|
{
|
||||||
_edje_lua_error_and_abort(L, err_code, sc);
|
_edje_lua_error_and_abort(L, err_code, sc);
|
||||||
return;
|
return;
|
||||||
|
@ -2523,7 +2528,7 @@ data_thread_license(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||||
int bytes;
|
int bytes;
|
||||||
|
|
||||||
f = eina_file_open(lw->file, 0);
|
f = eina_file_open(lw->file, 0);
|
||||||
if (!f) return ;
|
if (!f) return;
|
||||||
|
|
||||||
m = eina_file_map_all(f, EINA_FILE_WILLNEED);
|
m = eina_file_map_all(f, EINA_FILE_WILLNEED);
|
||||||
if (!m) goto on_error;
|
if (!m) goto on_error;
|
||||||
|
@ -2558,7 +2563,7 @@ data_thread_license(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||||
|
|
||||||
eina_file_map_free(f, m);
|
eina_file_map_free(f, m);
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
eina_file_close(f);
|
eina_file_close(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2576,10 +2581,10 @@ data_write_license(Eet_File *ef)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
const char *file;
|
const char *file;
|
||||||
|
|
||||||
if (!license) return ;
|
if (!license) return;
|
||||||
|
|
||||||
lw = calloc(1, sizeof (License_Write));
|
lw = calloc(1, sizeof (License_Write));
|
||||||
if (!lw) return ;
|
if (!lw) return;
|
||||||
|
|
||||||
lw->ef = ef;
|
lw->ef = ef;
|
||||||
lw->file = license;
|
lw->file = license;
|
||||||
|
@ -2597,7 +2602,7 @@ data_write_license(Eet_File *ef)
|
||||||
EINA_LIST_FOREACH(licenses, l, file)
|
EINA_LIST_FOREACH(licenses, l, file)
|
||||||
{
|
{
|
||||||
lw = calloc(1, sizeof (License_Write));
|
lw = calloc(1, sizeof (License_Write));
|
||||||
if (!lw) return ;
|
if (!lw) return;
|
||||||
|
|
||||||
lw->ef = ef;
|
lw->ef = ef;
|
||||||
lw->file = file;
|
lw->file = file;
|
||||||
|
@ -2623,7 +2628,7 @@ data_thread_authors(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||||
int bytes;
|
int bytes;
|
||||||
|
|
||||||
f = eina_file_open(authors, 0);
|
f = eina_file_open(authors, 0);
|
||||||
if (!f) return ;
|
if (!f) return;
|
||||||
|
|
||||||
m = eina_file_map_all(f, EINA_FILE_WILLNEED);
|
m = eina_file_map_all(f, EINA_FILE_WILLNEED);
|
||||||
if (!m) goto on_error;
|
if (!m) goto on_error;
|
||||||
|
@ -2645,7 +2650,7 @@ data_thread_authors(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||||
|
|
||||||
eina_file_map_free(f, m);
|
eina_file_map_free(f, m);
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
eina_file_close(f);
|
eina_file_close(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2893,19 +2898,19 @@ reorder_parts(void)
|
||||||
amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1;
|
amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1;
|
||||||
linked = i - ep->reorder.linked_prev;
|
linked = i - ep->reorder.linked_prev;
|
||||||
parts = malloc(amount * sizeof(Edje_Part *));
|
parts = malloc(amount * sizeof(Edje_Part *));
|
||||||
for (j = 0 ; j < amount ; j++)
|
for (j = 0; j < amount; j++)
|
||||||
{
|
{
|
||||||
parts[j] = pc->parts[linked];
|
parts[j] = pc->parts[linked];
|
||||||
linked++;
|
linked++;
|
||||||
}
|
}
|
||||||
if (i > k)
|
if (i > k)
|
||||||
{
|
{
|
||||||
for (j = i - ep->reorder.linked_prev ; j > k; j--)
|
for (j = i - ep->reorder.linked_prev; j > k; j--)
|
||||||
{
|
{
|
||||||
pc->parts[j + amount - 1] = pc->parts[j - 1];
|
pc->parts[j + amount - 1] = pc->parts[j - 1];
|
||||||
pc->parts[j + amount - 1]->id = j + amount - 1;
|
pc->parts[j + amount - 1]->id = j + amount - 1;
|
||||||
}
|
}
|
||||||
for (j = 0 ; j < amount ; j++)
|
for (j = 0; j < amount; j++)
|
||||||
{
|
{
|
||||||
pc->parts[j + k] = parts[j];
|
pc->parts[j + k] = parts[j];
|
||||||
pc->parts[j + k]->id = j + k;
|
pc->parts[j + k]->id = j + k;
|
||||||
|
@ -2913,12 +2918,12 @@ reorder_parts(void)
|
||||||
}
|
}
|
||||||
else if (i < k)
|
else if (i < k)
|
||||||
{
|
{
|
||||||
for (j = i + ep->reorder.linked_next + 1 ; j <= k ; j++)
|
for (j = i + ep->reorder.linked_next + 1; j <= k; j++)
|
||||||
{
|
{
|
||||||
pc->parts[j - amount] = pc->parts[j];
|
pc->parts[j - amount] = pc->parts[j];
|
||||||
pc->parts[j - amount]->id = j - amount;
|
pc->parts[j - amount]->id = j - amount;
|
||||||
}
|
}
|
||||||
for (j = 0 ; j < amount ; j++)
|
for (j = 0; j < amount; j++)
|
||||||
{
|
{
|
||||||
pc->parts[j + k - amount + 1] = parts[j];
|
pc->parts[j + k - amount + 1] = parts[j];
|
||||||
pc->parts[j + k - amount + 1]->id = j + k - amount + 1;
|
pc->parts[j + k - amount + 1]->id = j + k - amount + 1;
|
||||||
|
@ -3080,7 +3085,6 @@ part_lookup_del(Edje_Part_Collection *pc, int *dest)
|
||||||
eina_hash_del(part_pc_dest_lookup, &key, pl);
|
eina_hash_del(part_pc_dest_lookup, &key, pl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
part_lookup_delete(Edje_Part_Collection *pc, const char *name, int *dest, char **dest2)
|
part_lookup_delete(Edje_Part_Collection *pc, const char *name, int *dest, char **dest2)
|
||||||
{
|
{
|
||||||
|
@ -3215,31 +3219,31 @@ data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest
|
||||||
{
|
{
|
||||||
if (pl->dest == src && pl->u.ep->name)
|
if (pl->dest == src && pl->u.ep->name)
|
||||||
{
|
{
|
||||||
for (i = 0 ; i < pc->programs.fnmatch_count ; i++)
|
for (i = 0; i < pc->programs.fnmatch_count; i++)
|
||||||
{
|
{
|
||||||
if (pc->programs.fnmatch[i]->name &&
|
if (pc->programs.fnmatch[i]->name &&
|
||||||
!strcmp(pl->u.ep->name, pc->programs.fnmatch[i]->name))
|
!strcmp(pl->u.ep->name, pc->programs.fnmatch[i]->name))
|
||||||
data_queue_anonymous_lookup(pc, pc->programs.fnmatch[i], dest);
|
data_queue_anonymous_lookup(pc, pc->programs.fnmatch[i], dest);
|
||||||
}
|
}
|
||||||
for (i = 0 ; i < pc->programs.strcmp_count ; i++)
|
for (i = 0; i < pc->programs.strcmp_count; i++)
|
||||||
{
|
{
|
||||||
if (pc->programs.strcmp[i]->name &&
|
if (pc->programs.strcmp[i]->name &&
|
||||||
!strcmp(pl->u.ep->name, pc->programs.strcmp[i]->name))
|
!strcmp(pl->u.ep->name, pc->programs.strcmp[i]->name))
|
||||||
data_queue_anonymous_lookup(pc, pc->programs.strcmp[i], dest);
|
data_queue_anonymous_lookup(pc, pc->programs.strcmp[i], dest);
|
||||||
}
|
}
|
||||||
for (i = 0 ; i < pc->programs.strncmp_count ; i++)
|
for (i = 0; i < pc->programs.strncmp_count; i++)
|
||||||
{
|
{
|
||||||
if (pc->programs.strncmp[i]->name &&
|
if (pc->programs.strncmp[i]->name &&
|
||||||
!strcmp(pl->u.ep->name, pc->programs.strncmp[i]->name))
|
!strcmp(pl->u.ep->name, pc->programs.strncmp[i]->name))
|
||||||
data_queue_anonymous_lookup(pc, pc->programs.strncmp[i], dest);
|
data_queue_anonymous_lookup(pc, pc->programs.strncmp[i], dest);
|
||||||
}
|
}
|
||||||
for (i = 0 ; i < pc->programs.strrncmp_count ; i++)
|
for (i = 0; i < pc->programs.strrncmp_count; i++)
|
||||||
{
|
{
|
||||||
if (pc->programs.strrncmp[i]->name &&
|
if (pc->programs.strrncmp[i]->name &&
|
||||||
!strcmp(pl->u.ep->name, pc->programs.strrncmp[i]->name))
|
!strcmp(pl->u.ep->name, pc->programs.strrncmp[i]->name))
|
||||||
data_queue_anonymous_lookup(pc, pc->programs.strrncmp[i], dest);
|
data_queue_anonymous_lookup(pc, pc->programs.strrncmp[i], dest);
|
||||||
}
|
}
|
||||||
for (i = 0 ; i < pc->programs.nocmp_count ; i++)
|
for (i = 0; i < pc->programs.nocmp_count; i++)
|
||||||
{
|
{
|
||||||
if (pc->programs.nocmp[i]->name &&
|
if (pc->programs.nocmp[i]->name &&
|
||||||
!strcmp(pl->u.ep->name, pc->programs.nocmp[i]->name))
|
!strcmp(pl->u.ep->name, pc->programs.nocmp[i]->name))
|
||||||
|
@ -3337,7 +3341,7 @@ data_queue_image_remove(int *dest, Eina_Bool *set)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
data_queue_model_lookup(char *name, int *dest, Eina_Bool *set)
|
data_queue_model_lookup(char *name, int *dest, Eina_Bool *set)
|
||||||
|
@ -3405,7 +3409,7 @@ data_process_part_set(Part_Lookup *target, int value)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*((int*)(*target->key.mem.reallocated.base +
|
*((int *)(*target->key.mem.reallocated.base +
|
||||||
target->key.mem.reallocated.offset)) = value;
|
target->key.mem.reallocated.offset)) = value;
|
||||||
}
|
}
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
@ -3581,7 +3585,7 @@ _data_image_id_update(Eina_List *images_unused_list)
|
||||||
}
|
}
|
||||||
EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
|
EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
|
||||||
{
|
{
|
||||||
for(i = 0; i < pc->parts_count; i++)
|
for (i = 0; i < pc->parts_count; i++)
|
||||||
{
|
{
|
||||||
part = pc->parts[i];
|
part = pc->parts[i];
|
||||||
if (part->type == EDJE_PART_TYPE_IMAGE)
|
if (part->type == EDJE_PART_TYPE_IMAGE)
|
||||||
|
@ -3624,7 +3628,6 @@ _data_image_id_update(Eina_List *images_unused_list)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3651,7 +3654,7 @@ _data_model_id_update(Eina_List *models_unused_list)
|
||||||
|
|
||||||
EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
|
EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
|
||||||
{
|
{
|
||||||
for(i = 0; i < pc->parts_count; i++)
|
for (i = 0; i < pc->parts_count; i++)
|
||||||
{
|
{
|
||||||
part = pc->parts[i];
|
part = pc->parts[i];
|
||||||
if (part->type == EDJE_PART_TYPE_MESH_NODE)
|
if (part->type == EDJE_PART_TYPE_MESH_NODE)
|
||||||
|
@ -3704,15 +3707,15 @@ data_process_lookups(void)
|
||||||
find = eina_hash_find(edje_file->collection, pc->part);
|
find = eina_hash_find(edje_file->collection, pc->part);
|
||||||
if (find && find->id == pc->id)
|
if (find && find->id == pc->id)
|
||||||
{
|
{
|
||||||
if ( ((Edje_Part_Collection_Parser*)pc)->inherit_only)
|
if (((Edje_Part_Collection_Parser *)pc)->inherit_only)
|
||||||
eina_hash_del_by_data(edje_file->collection, find);
|
eina_hash_del_by_data(edje_file->collection, find);
|
||||||
else
|
else
|
||||||
continue ;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_LIST_FOREACH(aliases, l3, alias)
|
EINA_LIST_FOREACH(aliases, l3, alias)
|
||||||
if (alias->id == pc->id)
|
if (alias->id == pc->id)
|
||||||
continue ;
|
continue;
|
||||||
|
|
||||||
/* This Edje_Part_Collection is not used at all */
|
/* This Edje_Part_Collection is not used at all */
|
||||||
edje_collections = eina_list_remove_list(edje_collections, l);
|
edje_collections = eina_list_remove_list(edje_collections, l);
|
||||||
|
@ -3804,7 +3807,7 @@ data_process_lookups(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((i == part->key.pc->parts_count) && (!((Edje_Part_Collection_Parser*)part->key.pc)->inherit_only))
|
if ((i == part->key.pc->parts_count) && (!((Edje_Part_Collection_Parser *)part->key.pc)->inherit_only))
|
||||||
{
|
{
|
||||||
ERR("Unable to find part name \"%s\" needed in group '%s'.",
|
ERR("Unable to find part name \"%s\" needed in group '%s'.",
|
||||||
alias, part->key.pc->part);
|
alias, part->key.pc->part);
|
||||||
|
@ -4011,7 +4014,7 @@ free_group:
|
||||||
de = edje_file->image_dir->entries + i;
|
de = edje_file->image_dir->entries + i;
|
||||||
|
|
||||||
if (de->entry && eina_hash_find(images_in_use, de->entry))
|
if (de->entry && eina_hash_find(images_in_use, de->entry))
|
||||||
continue ;
|
continue;
|
||||||
|
|
||||||
INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.",
|
INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.",
|
||||||
de->entry, de->id);
|
de->entry, de->id);
|
||||||
|
@ -4039,7 +4042,7 @@ free_group:
|
||||||
set = edje_file->image_dir->sets + i;
|
set = edje_file->image_dir->sets + i;
|
||||||
|
|
||||||
if (set->name && eina_hash_find(images_in_use, set->name))
|
if (set->name && eina_hash_find(images_in_use, set->name))
|
||||||
continue ;
|
continue;
|
||||||
|
|
||||||
INF("Set '%s' will not be included as it is unused.", set->name);
|
INF("Set '%s' will not be included as it is unused.", set->name);
|
||||||
|
|
||||||
|
@ -4123,7 +4126,7 @@ free_group:
|
||||||
de = edje_file->model_dir->entries + i;
|
de = edje_file->model_dir->entries + i;
|
||||||
|
|
||||||
if (de->entry && eina_hash_find(models_in_use, de->entry))
|
if (de->entry && eina_hash_find(models_in_use, de->entry))
|
||||||
continue ;
|
continue;
|
||||||
|
|
||||||
INF("Model '%s' in resource 'edje/model/%i' will not be included as it is unused.",
|
INF("Model '%s' in resource 'edje/model/%i' will not be included as it is unused.",
|
||||||
de->entry, de->id);
|
de->entry, de->id);
|
||||||
|
@ -4156,7 +4159,7 @@ free_group:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char* ptr, int len))
|
data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char *ptr, int len))
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
char *key;
|
char *key;
|
||||||
|
@ -4256,7 +4259,8 @@ data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void
|
||||||
if (!escape)
|
if (!escape)
|
||||||
{
|
{
|
||||||
if (*p == '\"') quote = 0;
|
if (*p == '\"') quote = 0;
|
||||||
else if (*p == '\\') escape = 1;
|
else if (*p == '\\')
|
||||||
|
escape = 1;
|
||||||
}
|
}
|
||||||
else if (escape)
|
else if (escape)
|
||||||
{
|
{
|
||||||
|
@ -4279,6 +4283,7 @@ _data_queue_part_lookup(Edje_Part_Collection *pc, char *name, char *ptr, int len
|
||||||
|
|
||||||
code_lookups = eina_list_append(code_lookups, cl);
|
code_lookups = eina_list_append(code_lookups, cl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_data_queue_program_lookup(Edje_Part_Collection *pc, char *name, char *ptr, int len)
|
_data_queue_program_lookup(Edje_Part_Collection *pc, char *name, char *ptr, int len)
|
||||||
{
|
{
|
||||||
|
@ -4292,11 +4297,13 @@ _data_queue_program_lookup(Edje_Part_Collection *pc, char *name, char *ptr, int
|
||||||
|
|
||||||
code_lookups = eina_list_append(code_lookups, cl);
|
code_lookups = eina_list_append(code_lookups, cl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_data_queue_group_lookup(Edje_Part_Collection *pc EINA_UNUSED, char *name, char *ptr EINA_UNUSED, int len EINA_UNUSED)
|
_data_queue_group_lookup(Edje_Part_Collection *pc EINA_UNUSED, char *name, char *ptr EINA_UNUSED, int len EINA_UNUSED)
|
||||||
{
|
{
|
||||||
data_queue_group_lookup(name, NULL);
|
data_queue_group_lookup(name, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_data_queue_image_pc_lookup(Edje_Part_Collection *pc EINA_UNUSED, char *name, char *ptr, int len)
|
_data_queue_image_pc_lookup(Edje_Part_Collection *pc EINA_UNUSED, char *name, char *ptr, int len)
|
||||||
{
|
{
|
||||||
|
@ -4515,12 +4522,12 @@ process_color_tree(char *s, const char *f_in, int ln)
|
||||||
if (!strcmp(name, token[id]))
|
if (!strcmp(name, token[id]))
|
||||||
{
|
{
|
||||||
error_and_abort(NULL, "parse error %s:%i. The color class \"%s\" already belongs to the root node.",
|
error_and_abort(NULL, "parse error %s:%i. The color class \"%s\" already belongs to the root node.",
|
||||||
f_in, ln -1, token[id]);
|
f_in, ln - 1, token[id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ctn = color_tree_parent_node_get(token[id])))
|
if ((ctn = color_tree_parent_node_get(token[id])))
|
||||||
error_and_abort(NULL, "parse error %s:%i. The color class \"%s\" already belongs to the \"%s\" node.",
|
error_and_abort(NULL, "parse error %s:%i. The color class \"%s\" already belongs to the \"%s\" node.",
|
||||||
f_in, ln -1, token[id], ctn->name);
|
f_in, ln - 1, token[id], ctn->name);
|
||||||
|
|
||||||
ctn = eina_array_data_get(array, eina_array_count(array) - 1);
|
ctn = eina_array_data_get(array, eina_array_count(array) - 1);
|
||||||
ctn->color_classes = eina_list_append(ctn->color_classes, strdup(token[id]));
|
ctn->color_classes = eina_list_append(ctn->color_classes, strdup(token[id]));
|
||||||
|
@ -4529,14 +4536,13 @@ process_color_tree(char *s, const char *f_in, int ln)
|
||||||
{
|
{
|
||||||
if ((ctn = color_tree_parent_node_get(token[id])))
|
if ((ctn = color_tree_parent_node_get(token[id])))
|
||||||
error_and_abort(NULL, "parse error %s:%i. The color class \"%s\" already belongs to the \"%s\" node.",
|
error_and_abort(NULL, "parse error %s:%i. The color class \"%s\" already belongs to the \"%s\" node.",
|
||||||
f_in, ln -1, token[id], ctn->name);
|
f_in, ln - 1, token[id], ctn->name);
|
||||||
|
|
||||||
color_tree_root = eina_list_append(color_tree_root, strdup(token[id]));
|
color_tree_root = eina_list_append(color_tree_root, strdup(token[id]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
id = !id;
|
id = !id;
|
||||||
|
|
||||||
} while (*s);
|
} while (*s);
|
||||||
|
|
||||||
if (eina_array_count(array))
|
if (eina_array_count(array))
|
||||||
|
@ -4644,3 +4650,4 @@ convert_color_code(char *str, int *r, int *g, int *b, int *a)
|
||||||
|
|
||||||
free(str);
|
free(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
@ -36,37 +35,36 @@
|
||||||
|
|
||||||
static void new_object(void);
|
static void new_object(void);
|
||||||
static void new_statement(void);
|
static void new_statement(void);
|
||||||
static char *perform_math (char *input);
|
static char *perform_math(char *input);
|
||||||
static int isdelim(char c);
|
static int isdelim(char c);
|
||||||
static char *next_token(char *p, char *end, char **new_p, int *delim);
|
static char *next_token(char *p, char *end, char **new_p, int *delim);
|
||||||
static const char *stack_id(void);
|
static const char *stack_id(void);
|
||||||
static void parse(char *data, off_t size);
|
static void parse(char *data, off_t size);
|
||||||
|
|
||||||
/* simple expression parsing protos */
|
/* simple expression parsing protos */
|
||||||
static int my_atoi(const char * s);
|
static int my_atoi(const char *s);
|
||||||
static char * _alphai(char *s, int * val);
|
static char *_alphai(char *s, int *val);
|
||||||
static char * _betai(char *s, int * val);
|
static char *_betai(char *s, int *val);
|
||||||
static char * _gammai(char *s, int * val);
|
static char *_gammai(char *s, int *val);
|
||||||
static char * _deltai(char *s, int * val);
|
static char *_deltai(char *s, int *val);
|
||||||
static char * _get_numi(char *s, int * val);
|
static char *_get_numi(char *s, int *val);
|
||||||
static int _is_numi(char c);
|
static int _is_numi(char c);
|
||||||
static int _is_op1i(char c);
|
static int _is_op1i(char c);
|
||||||
static int _is_op2i(char c);
|
static int _is_op2i(char c);
|
||||||
static int _calci(char op, int a, int b);
|
static int _calci(char op, int a, int b);
|
||||||
|
|
||||||
static double my_atof(const char * s);
|
static double my_atof(const char *s);
|
||||||
static char * _alphaf(char *s, double * val);
|
static char *_alphaf(char *s, double *val);
|
||||||
static char * _betaf(char *s, double * val);
|
static char *_betaf(char *s, double *val);
|
||||||
static char * _gammaf(char *s, double * val);
|
static char *_gammaf(char *s, double *val);
|
||||||
static char * _deltaf(char *s, double * val);
|
static char *_deltaf(char *s, double *val);
|
||||||
static char * _get_numf(char *s, double * val);
|
static char *_get_numf(char *s, double *val);
|
||||||
static int _is_numf(char c);
|
static int _is_numf(char c);
|
||||||
static int _is_op1f(char c);
|
static int _is_op1f(char c);
|
||||||
static int _is_op2f(char c);
|
static int _is_op2f(char c);
|
||||||
static double _calcf(char op, double a, double b);
|
static double _calcf(char op, double a, double b);
|
||||||
static int strstrip(const char *in, char *out, size_t size);
|
static int strstrip(const char *in, char *out, size_t size);
|
||||||
|
|
||||||
|
|
||||||
int line = 0;
|
int line = 0;
|
||||||
Eina_List *stack = NULL;
|
Eina_List *stack = NULL;
|
||||||
Eina_Array params;
|
Eina_Array params;
|
||||||
|
@ -117,7 +115,7 @@ err_show(void)
|
||||||
static char *
|
static char *
|
||||||
_parse_param_get(int n)
|
_parse_param_get(int n)
|
||||||
{
|
{
|
||||||
if (n < (int) eina_array_count(¶ms))
|
if (n < (int)eina_array_count(¶ms))
|
||||||
return eina_array_data_get(¶ms, n);
|
return eina_array_data_get(¶ms, n);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -304,7 +302,7 @@ new_statement_single(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
perform_math (char *input)
|
perform_math(char *input)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
double res;
|
double res;
|
||||||
|
@ -473,11 +471,11 @@ next_token(char *p, char *end, char **new_p, int *delim)
|
||||||
(isspace(*p)) ||
|
(isspace(*p)) ||
|
||||||
((*delim) && (!isdelim(*p))) ||
|
((*delim) && (!isdelim(*p))) ||
|
||||||
(isdelim(*p))
|
(isdelim(*p))
|
||||||
)
|
) /*the line below this is never used because it skips to
|
||||||
{/*the line below this is never used because it skips to
|
|
||||||
* the 'done' label which is after the return call for
|
* the 'done' label which is after the return call for
|
||||||
* in_tok being 0. is this intentional?
|
* in_tok being 0. is this intentional?
|
||||||
*/
|
*/
|
||||||
|
{
|
||||||
in_tok = 0;
|
in_tok = 0;
|
||||||
|
|
||||||
tok_end = p - 1;
|
tok_end = p - 1;
|
||||||
|
@ -497,7 +495,7 @@ next_token(char *p, char *end, char **new_p, int *delim)
|
||||||
if (!in_tok) return NULL;
|
if (!in_tok) return NULL;
|
||||||
tok_end = p - 1;
|
tok_end = p - 1;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
*new_p = p;
|
*new_p = p;
|
||||||
|
|
||||||
tok = mem_alloc(tok_end - tok_start + 2);
|
tok = mem_alloc(tok_end - tok_start + 2);
|
||||||
|
@ -785,7 +783,8 @@ parse(char *data, off_t size)
|
||||||
err_show();
|
err_show();
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
else if (*token == ',' || *token == ':') do_params = 1;
|
else if (*token == ',' || *token == ':')
|
||||||
|
do_params = 1;
|
||||||
else if (*token == '}')
|
else if (*token == '}')
|
||||||
{
|
{
|
||||||
if (do_params)
|
if (do_params)
|
||||||
|
@ -922,7 +921,8 @@ parse(char *data, off_t size)
|
||||||
else if ((!inquotes) && (!insquotes))
|
else if ((!inquotes) && (!insquotes))
|
||||||
{
|
{
|
||||||
if (p[0] == '{') squigglie++;
|
if (p[0] == '{') squigglie++;
|
||||||
else if (p[0] == '}') squigglie--;
|
else if (p[0] == '}')
|
||||||
|
squigglie--;
|
||||||
if (squigglie == 0)
|
if (squigglie == 0)
|
||||||
{
|
{
|
||||||
verbatim_2 = p - 1;
|
verbatim_2 = p - 1;
|
||||||
|
@ -1247,7 +1247,7 @@ _parse_enum(char *str, va_list va)
|
||||||
va_list va2;
|
va_list va2;
|
||||||
va_copy(va2, va); /* iterator for the error message */
|
va_copy(va2, va); /* iterator for the error message */
|
||||||
|
|
||||||
for (;;)
|
for (;; )
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
int v;
|
int v;
|
||||||
|
@ -1328,7 +1328,7 @@ parse_flags(int n, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, n);
|
va_start(va, n);
|
||||||
while (n < (int) eina_array_count(¶ms))
|
while (n < (int)eina_array_count(¶ms))
|
||||||
{
|
{
|
||||||
result |= _parse_enum(eina_array_data_get(¶ms, n), va);
|
result |= _parse_enum(eina_array_data_get(¶ms, n), va);
|
||||||
n++;
|
n++;
|
||||||
|
@ -1665,7 +1665,7 @@ _get_numi(char *s, int *val)
|
||||||
}
|
}
|
||||||
buf[pos] = '\0';
|
buf[pos] = '\0';
|
||||||
(*val) = atoi(buf);
|
(*val) = atoi(buf);
|
||||||
return (s + pos);
|
return s + pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1683,8 +1683,11 @@ _is_op1i(char c)
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case '*':;
|
case '*':;
|
||||||
|
|
||||||
case '%':;
|
case '%':;
|
||||||
|
|
||||||
case '/': return 1;
|
case '/': return 1;
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1696,7 +1699,9 @@ _is_op2i(char c)
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case '+':;
|
case '+':;
|
||||||
|
|
||||||
case '-': return 1;
|
case '-': return 1;
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1705,27 +1710,32 @@ _is_op2i(char c)
|
||||||
int
|
int
|
||||||
_calci(char op, int a, int b)
|
_calci(char op, int a, int b)
|
||||||
{
|
{
|
||||||
switch(op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case '+':
|
case '+':
|
||||||
a += b;
|
a += b;
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
a -= b;
|
a -= b;
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
case '/':
|
case '/':
|
||||||
if (0 != b) a /= b;
|
if (0 != b) a /= b;
|
||||||
else
|
else
|
||||||
ERR("%s:%i divide by zero", file_in, line - 1);
|
ERR("%s:%i divide by zero", file_in, line - 1);
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
case '*':
|
case '*':
|
||||||
a *= b;
|
a *= b;
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
case '%':
|
case '%':
|
||||||
if (0 != b) a = a % b;
|
if (0 != b) a = a % b;
|
||||||
else
|
else
|
||||||
ERR("%s:%i modula by zero", file_in, line - 1);
|
ERR("%s:%i modula by zero", file_in, line - 1);
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
|
ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
|
||||||
}
|
}
|
||||||
|
@ -1818,7 +1828,7 @@ _gammaf(char *s, double *val)
|
||||||
static char *
|
static char *
|
||||||
_betaf(char *s, double *val)
|
_betaf(char *s, double *val)
|
||||||
{
|
{
|
||||||
double a1=0, a2=0;
|
double a1 = 0, a2 = 0;
|
||||||
char op;
|
char op;
|
||||||
|
|
||||||
if (!val) return NULL;
|
if (!val) return NULL;
|
||||||
|
@ -1837,7 +1847,7 @@ _betaf(char *s, double *val)
|
||||||
static char *
|
static char *
|
||||||
_alphaf(char *s, double *val)
|
_alphaf(char *s, double *val)
|
||||||
{
|
{
|
||||||
double a1=0, a2=0;
|
double a1 = 0, a2 = 0;
|
||||||
char op;
|
char op;
|
||||||
|
|
||||||
if (!val) return NULL;
|
if (!val) return NULL;
|
||||||
|
@ -1870,7 +1880,7 @@ _get_numf(char *s, double *val)
|
||||||
}
|
}
|
||||||
buf[pos] = '\0';
|
buf[pos] = '\0';
|
||||||
(*val) = atof(buf);
|
(*val) = atof(buf);
|
||||||
return (s+pos);
|
return s + pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1887,11 +1897,14 @@ _is_numf(char c)
|
||||||
static int
|
static int
|
||||||
_is_op1f(char c)
|
_is_op1f(char c)
|
||||||
{
|
{
|
||||||
switch(c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case '*':;
|
case '*':;
|
||||||
|
|
||||||
case '%':;
|
case '%':;
|
||||||
|
|
||||||
case '/': return 1;
|
case '/': return 1;
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1900,10 +1913,12 @@ _is_op1f(char c)
|
||||||
static int
|
static int
|
||||||
_is_op2f(char c)
|
_is_op2f(char c)
|
||||||
{
|
{
|
||||||
switch(c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case '+':;
|
case '+':;
|
||||||
|
|
||||||
case '-': return 1;
|
case '-': return 1;
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1912,27 +1927,32 @@ _is_op2f(char c)
|
||||||
static double
|
static double
|
||||||
_calcf(char op, double a, double b)
|
_calcf(char op, double a, double b)
|
||||||
{
|
{
|
||||||
switch(op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case '+':
|
case '+':
|
||||||
a += b;
|
a += b;
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
a -= b;
|
a -= b;
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
case '/':
|
case '/':
|
||||||
if (b != 0) a /= b;
|
if (b != 0) a /= b;
|
||||||
else
|
else
|
||||||
ERR("%s:%i divide by zero", file_in, line - 1);
|
ERR("%s:%i divide by zero", file_in, line - 1);
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
case '*':
|
case '*':
|
||||||
a *= b;
|
a *= b;
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
case '%':
|
case '%':
|
||||||
if (0 != b) a = (double)((int)a % (int)b);
|
if (0 != b) a = (double)((int)a % (int)b);
|
||||||
else
|
else
|
||||||
ERR("%s:%i modula by zero", file_in, line - 1);
|
ERR("%s:%i modula by zero", file_in, line - 1);
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
|
ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
|
||||||
}
|
}
|
||||||
|
@ -1942,7 +1962,7 @@ _calcf(char op, double a, double b)
|
||||||
static int
|
static int
|
||||||
strstrip(const char *in, char *out, size_t size)
|
strstrip(const char *in, char *out, size_t size)
|
||||||
{
|
{
|
||||||
if ((size -1 ) < strlen(in))
|
if ((size - 1) < strlen(in))
|
||||||
{
|
{
|
||||||
ERR("%s:%i expression is too long", file_in, line - 1);
|
ERR("%s:%i expression is too long", file_in, line - 1);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1967,7 +1987,7 @@ get_param_index(char *str)
|
||||||
int index;
|
int index;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
for(index = 0; index < get_arg_count(); index++)
|
for (index = 0; index < get_arg_count(); index++)
|
||||||
{
|
{
|
||||||
p = _parse_param_get(index);
|
p = _parse_param_get(index);
|
||||||
if (!p) continue;
|
if (!p) continue;
|
||||||
|
@ -1982,5 +2002,6 @@ get_param_index(char *str)
|
||||||
int
|
int
|
||||||
param_had_quote(int n)
|
param_had_quote(int n)
|
||||||
{
|
{
|
||||||
return (params_quote & (1 << n));
|
return params_quote & (1 << n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ code_parse_internal(Code *code)
|
||||||
sym = mem_alloc(SZ(Code_Symbol));
|
sym = mem_alloc(SZ(Code_Symbol));
|
||||||
sym->tag = eina_array_pop(name_stack);
|
sym->tag = eina_array_pop(name_stack);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TOKEN_TYPE_SEMICOLON:
|
case TOKEN_TYPE_SEMICOLON:
|
||||||
if (eina_array_count(name_stack))
|
if (eina_array_count(name_stack))
|
||||||
{
|
{
|
||||||
|
@ -114,6 +115,7 @@ code_parse_internal(Code *code)
|
||||||
}
|
}
|
||||||
is_public = EINA_FALSE;
|
is_public = EINA_FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TOKEN_TYPE_COMMA:
|
case TOKEN_TYPE_COMMA:
|
||||||
if (!sym)
|
if (!sym)
|
||||||
sym = mem_alloc(SZ(Code_Symbol));
|
sym = mem_alloc(SZ(Code_Symbol));
|
||||||
|
@ -127,6 +129,7 @@ code_parse_internal(Code *code)
|
||||||
}
|
}
|
||||||
sym = NULL;
|
sym = NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TOKEN_TYPE_PARENS:
|
case TOKEN_TYPE_PARENS:
|
||||||
is_args = !is_args;
|
is_args = !is_args;
|
||||||
if (is_args)
|
if (is_args)
|
||||||
|
@ -152,6 +155,7 @@ code_parse_internal(Code *code)
|
||||||
sym = func;
|
sym = func;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TOKEN_TYPE_BRACES:
|
case TOKEN_TYPE_BRACES:
|
||||||
depth = 1;
|
depth = 1;
|
||||||
body = begin;
|
body = begin;
|
||||||
|
@ -164,6 +168,7 @@ code_parse_internal(Code *code)
|
||||||
case '{':
|
case '{':
|
||||||
depth++;
|
depth++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '}':
|
case '}':
|
||||||
depth--;
|
depth--;
|
||||||
break;
|
break;
|
||||||
|
@ -182,13 +187,16 @@ code_parse_internal(Code *code)
|
||||||
sym = NULL;
|
sym = NULL;
|
||||||
is_public = EINA_FALSE;
|
is_public = EINA_FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TOKEN_TYPE_PUBLIC:
|
case TOKEN_TYPE_PUBLIC:
|
||||||
is_public = EINA_TRUE;
|
is_public = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TOKEN_TYPE_IDENTIFIER:
|
case TOKEN_TYPE_IDENTIFIER:
|
||||||
eina_array_push(name_stack, token->str);
|
eina_array_push(name_stack, token->str);
|
||||||
token->str = NULL;
|
token->str = NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -231,6 +239,7 @@ next_token(char **begin, char *end)
|
||||||
if (index > 0)
|
if (index > 0)
|
||||||
parsed = EINA_TRUE;
|
parsed = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ':':
|
case ':':
|
||||||
case ';':
|
case ';':
|
||||||
case ',':
|
case ',':
|
||||||
|
@ -245,6 +254,7 @@ next_token(char **begin, char *end)
|
||||||
src++;
|
src++;
|
||||||
}
|
}
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (parsed)
|
if (parsed)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
@ -259,23 +269,29 @@ exit:
|
||||||
case ':':
|
case ':':
|
||||||
token->type = TOKEN_TYPE_COLON;
|
token->type = TOKEN_TYPE_COLON;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ';':
|
case ';':
|
||||||
token->type = TOKEN_TYPE_SEMICOLON;
|
token->type = TOKEN_TYPE_SEMICOLON;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ',':
|
case ',':
|
||||||
token->type = TOKEN_TYPE_COMMA;
|
token->type = TOKEN_TYPE_COMMA;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '(':
|
case '(':
|
||||||
case ')':
|
case ')':
|
||||||
token->type = TOKEN_TYPE_PARENS;
|
token->type = TOKEN_TYPE_PARENS;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '{':
|
case '{':
|
||||||
case '}':
|
case '}':
|
||||||
token->type = TOKEN_TYPE_BRACES;
|
token->type = TOKEN_TYPE_BRACES;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '=':
|
case '=':
|
||||||
token->type = TOKEN_TYPE_EQUAL_MARK;
|
token->type = TOKEN_TYPE_EQUAL_MARK;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\0':
|
case '\0':
|
||||||
token->type = TOKEN_TYPE_EOF;
|
token->type = TOKEN_TYPE_EOF;
|
||||||
break;
|
break;
|
||||||
|
@ -448,3 +464,4 @@ script_rewrite(Code *code)
|
||||||
code->vars = vars;
|
code->vars = vars;
|
||||||
code->func = func;
|
code->func = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,8 @@ source_fetch_file(const char *fil, const char *filname)
|
||||||
char end = '\0';
|
char end = '\0';
|
||||||
|
|
||||||
if (*p == '"') end = '"';
|
if (*p == '"') end = '"';
|
||||||
else if (*p == '<') end = '>';
|
else if (*p == '<')
|
||||||
|
end = '>';
|
||||||
|
|
||||||
if (end)
|
if (end)
|
||||||
{
|
{
|
||||||
|
@ -166,7 +167,6 @@ source_fetch_file(const char *fil, const char *filname)
|
||||||
file[l - 1] = 0;
|
file[l - 1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fname = strdup(p + 1);
|
fname = strdup(p + 1);
|
||||||
pp = strrchr(fname, end);
|
pp = strrchr(fname, end);
|
||||||
if (pp) *pp = 0;
|
if (pp) *pp = 0;
|
||||||
|
@ -230,3 +230,4 @@ source_fontmap_load(Eet_File *ef)
|
||||||
fl = eet_data_read(ef, _font_list_edd, "edje_source_fontmap");
|
fl = eet_data_read(ef, _font_list_edd, "edje_source_fontmap");
|
||||||
return fl;
|
return fl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,34 +66,34 @@ static Eina_List *externals = NULL;
|
||||||
|
|
||||||
#define C_CODEGEN_DRAG_SET(option) \
|
#define C_CODEGEN_DRAG_SET(option) \
|
||||||
"Eina_Bool\n" \
|
"Eina_Bool\n" \
|
||||||
"%s_%s_drag_"#option"_set(Evas_Object *o, double dx, double dy)\n" \
|
"%s_%s_drag_" #option "_set(Evas_Object *o, double dx, double dy)\n" \
|
||||||
"{\n" \
|
"{\n" \
|
||||||
" return edje_object_part_drag_"#option"_set(o, \"%s\", dx, dy);\n" \
|
" return edje_object_part_drag_" #option "_set(o, \"%s\", dx, dy);\n" \
|
||||||
"}\n\n"
|
"}\n\n"
|
||||||
|
|
||||||
#define H_CODEGEN_DRAG_SET(option) \
|
#define H_CODEGEN_DRAG_SET(option) \
|
||||||
"Eina_Bool %s_%s_drag_"#option"_set(Evas_Object *o, double dx, double dy);\n"
|
"Eina_Bool %s_%s_drag_" #option "_set(Evas_Object *o, double dx, double dy);\n"
|
||||||
|
|
||||||
#define C_CODEGEN_DRAG_GET(option) \
|
#define C_CODEGEN_DRAG_GET(option) \
|
||||||
"Eina_Bool\n" \
|
"Eina_Bool\n" \
|
||||||
"%s_%s_drag_"#option"_get(Evas_Object *o, double *dx, double *dy)\n" \
|
"%s_%s_drag_" #option "_get(Evas_Object *o, double *dx, double *dy)\n" \
|
||||||
"{\n" \
|
"{\n" \
|
||||||
" return edje_object_part_drag_"#option"_get(o, \"%s\", dx, dy);\n" \
|
" return edje_object_part_drag_" #option "_get(o, \"%s\", dx, dy);\n" \
|
||||||
"}\n\n"
|
"}\n\n"
|
||||||
|
|
||||||
#define H_CODEGEN_DRAG_GET(option) \
|
#define H_CODEGEN_DRAG_GET(option) \
|
||||||
"Eina_Bool %s_%s_drag_"#option"_get(Evas_Object *o, double *dx" \
|
"Eina_Bool %s_%s_drag_" #option "_get(Evas_Object *o, double *dx" \
|
||||||
", double *dy);\n"
|
", double *dy);\n"
|
||||||
|
|
||||||
#define C_CODEGEN_DRAG_ACTION(option) \
|
#define C_CODEGEN_DRAG_ACTION(option) \
|
||||||
"Eina_Bool\n" \
|
"Eina_Bool\n" \
|
||||||
"%s_%s_drag_"#option"(Evas_Object *o, double dx, double dy)\n" \
|
"%s_%s_drag_" #option "(Evas_Object *o, double dx, double dy)\n" \
|
||||||
"{\n" \
|
"{\n" \
|
||||||
" return edje_object_part_drag_"#option"(o, \"%s\", dx, dy);\n" \
|
" return edje_object_part_drag_" #option "(o, \"%s\", dx, dy);\n" \
|
||||||
"}\n\n"
|
"}\n\n"
|
||||||
|
|
||||||
#define H_CODEGEN_DRAG_ACTION(option) \
|
#define H_CODEGEN_DRAG_ACTION(option) \
|
||||||
"Eina_Bool %s_%s_drag_"#option"(Evas_Object *o, double dx, double dy);\n"
|
"Eina_Bool %s_%s_drag_" #option "(Evas_Object *o, double dx, double dy);\n"
|
||||||
|
|
||||||
#define C_CODEGEN_DRAG_DIR_GET \
|
#define C_CODEGEN_DRAG_DIR_GET \
|
||||||
"Edje_Drag_Dir\n" \
|
"Edje_Drag_Dir\n" \
|
||||||
|
@ -277,34 +277,34 @@ static Eina_List *externals = NULL;
|
||||||
|
|
||||||
#define C_CODEGEN_PART_EXTERNAL_PARAM_SET(type, param_type, field) \
|
#define C_CODEGEN_PART_EXTERNAL_PARAM_SET(type, param_type, field) \
|
||||||
"Eina_Bool\n" \
|
"Eina_Bool\n" \
|
||||||
"%s_%s_%s_set(Evas_Object *o, "type"value)\n" \
|
"%s_%s_%s_set(Evas_Object *o, "type "value)\n" \
|
||||||
"{\n" \
|
"{\n" \
|
||||||
" Edje_External_Param param;\n\n" \
|
" Edje_External_Param param;\n\n" \
|
||||||
" param.name = \"%s\";\n" \
|
" param.name = \"%s\";\n" \
|
||||||
" param.type = "param_type";\n" \
|
" param.type = "param_type ";\n" \
|
||||||
" param."field" = value;\n" \
|
" param."field " = value;\n" \
|
||||||
" return edje_object_part_external_param_set(o, \"%s\", ¶m);\n" \
|
" return edje_object_part_external_param_set(o, \"%s\", ¶m);\n" \
|
||||||
"}\n\n"
|
"}\n\n"
|
||||||
|
|
||||||
#define H_CODEGEN_PART_EXTERNAL_PARAM_SET(type) \
|
#define H_CODEGEN_PART_EXTERNAL_PARAM_SET(type) \
|
||||||
"Eina_Bool %s_%s_%s_set(Evas_Object *o, "type"value);\n"
|
"Eina_Bool %s_%s_%s_set(Evas_Object *o, "type "value);\n"
|
||||||
|
|
||||||
#define C_CODEGEN_PART_EXTERNAL_PARAM_GET(type, param_type, field) \
|
#define C_CODEGEN_PART_EXTERNAL_PARAM_GET(type, param_type, field) \
|
||||||
"Eina_Bool\n" \
|
"Eina_Bool\n" \
|
||||||
"%s_%s_%s_get(Evas_Object *o, "type"*value)\n" \
|
"%s_%s_%s_get(Evas_Object *o, "type "*value)\n" \
|
||||||
"{\n" \
|
"{\n" \
|
||||||
" if (!value) return EINA_FALSE;\n\n" \
|
" if (!value) return EINA_FALSE;\n\n" \
|
||||||
" Edje_External_Param param;\n\n" \
|
" Edje_External_Param param;\n\n" \
|
||||||
" param.name = \"%s\";\n" \
|
" param.name = \"%s\";\n" \
|
||||||
" param.type = "param_type";\n" \
|
" param.type = "param_type ";\n" \
|
||||||
" if (!edje_object_part_external_param_get(o, \"%s\", ¶m))\n" \
|
" if (!edje_object_part_external_param_get(o, \"%s\", ¶m))\n" \
|
||||||
" return EINA_FALSE;\n\n" \
|
" return EINA_FALSE;\n\n" \
|
||||||
" *value = param."field";\n" \
|
" *value = param."field ";\n" \
|
||||||
" return EINA_TRUE;\n" \
|
" return EINA_TRUE;\n" \
|
||||||
"}\n\n"
|
"}\n\n"
|
||||||
|
|
||||||
#define H_CODEGEN_PART_EXTERNAL_PARAM_GET(type) \
|
#define H_CODEGEN_PART_EXTERNAL_PARAM_GET(type) \
|
||||||
"Eina_Bool %s_%s_%s_get(Evas_Object *o, "type"*value);\n"
|
"Eina_Bool %s_%s_%s_get(Evas_Object *o, "type "*value);\n"
|
||||||
|
|
||||||
#define C_CODEGEN_PROGRAM_EMIT \
|
#define C_CODEGEN_PROGRAM_EMIT \
|
||||||
"void\n" \
|
"void\n" \
|
||||||
|
@ -338,9 +338,9 @@ static Eina_List *externals = NULL;
|
||||||
"void %s_%s_callback_del_full(Evas_Object *o, Edje_Signal_Cb func, " \
|
"void %s_%s_callback_del_full(Evas_Object *o, Edje_Signal_Cb func, " \
|
||||||
"void *data);\n"
|
"void *data);\n"
|
||||||
|
|
||||||
|
|
||||||
typedef struct _Part_External_Info Part_External_Info;
|
typedef struct _Part_External_Info Part_External_Info;
|
||||||
struct _Part_External_Info {
|
struct _Part_External_Info
|
||||||
|
{
|
||||||
const char *description, *name, *source;
|
const char *description, *name, *source;
|
||||||
char *apiname;
|
char *apiname;
|
||||||
Eina_Bool draggable;
|
Eina_Bool draggable;
|
||||||
|
@ -397,7 +397,7 @@ _open_file_descriptors(const char *source, const char *header)
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
fclose(header_fd);
|
fclose(header_fd);
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -555,18 +555,23 @@ _write_part_external_param(const Part_External_Info *info,
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_INT:
|
case EDJE_EXTERNAL_PARAM_TYPE_INT:
|
||||||
WRITE_TEMPLATE("int ", "EDJE_EXTERNAL_PARAM_TYPE_INT", "i");
|
WRITE_TEMPLATE("int ", "EDJE_EXTERNAL_PARAM_TYPE_INT", "i");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
|
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
|
||||||
WRITE_TEMPLATE("double ", "EDJE_EXTERNAL_PARAM_TYPE_DOUBLE", "d");
|
WRITE_TEMPLATE("double ", "EDJE_EXTERNAL_PARAM_TYPE_DOUBLE", "d");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
|
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
|
||||||
WRITE_TEMPLATE("const char *", "EDJE_EXTERNAL_PARAM_TYPE_STRING", "s");
|
WRITE_TEMPLATE("const char *", "EDJE_EXTERNAL_PARAM_TYPE_STRING", "s");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
|
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
|
||||||
WRITE_TEMPLATE("Eina_Bool ", "EDJE_EXTERNAL_PARAM_TYPE_BOOL", "i");
|
WRITE_TEMPLATE("Eina_Bool ", "EDJE_EXTERNAL_PARAM_TYPE_BOOL", "i");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
|
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
|
||||||
WRITE_TEMPLATE("const char *", "EDJE_EXTERNAL_PARAM_TYPE_CHOICE", "s");
|
WRITE_TEMPLATE("const char *", "EDJE_EXTERNAL_PARAM_TYPE_CHOICE", "s");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -643,12 +648,11 @@ _write_part_external(Eina_List **parts)
|
||||||
free(ei);
|
free(ei);
|
||||||
|
|
||||||
*parts = eina_list_remove_list(*parts, l);
|
*parts = eina_list_remove_list(*parts, l);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (eina_list_count(*parts) == 0) *parts = NULL;
|
if (eina_list_count(*parts) == 0) *parts = NULL;
|
||||||
eina_iterator_free(itr);
|
eina_iterator_free(itr);
|
||||||
|
|
||||||
|
@ -722,7 +726,7 @@ _write_part(const char *apiname, const char *partname, Edje_Part_Type parttype,
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
ERR("Could not write the part: %s", partname);
|
ERR("Could not write the part: %s", partname);
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -841,7 +845,7 @@ _parse_parts(Evas_Object *ed)
|
||||||
|
|
||||||
ret = _write_part_external(&parts_external);
|
ret = _write_part_external(&parts_external);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
edje_edit_string_list_free(parts);
|
edje_edit_string_list_free(parts);
|
||||||
EINA_LIST_FREE(parts_external, ei)
|
EINA_LIST_FREE(parts_external, ei)
|
||||||
{
|
{
|
||||||
|
@ -878,7 +882,7 @@ _write_program_emit(const char *apiname, const char *source, const char *sig,
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
ERR("Could not write the program: %s", apiname);
|
ERR("Could not write the program: %s", apiname);
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -918,7 +922,7 @@ _write_program_add(const char *apiname, const char *source, const char *sig,
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
ERR("Could not write the program [action]: %s", apiname);
|
ERR("Could not write the program [action]: %s", apiname);
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1127,7 +1131,8 @@ main(int argc, char *argv[])
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto error_getopt;
|
goto error_getopt;
|
||||||
}
|
}
|
||||||
else if (quit_option) goto error_getopt;
|
else if (quit_option)
|
||||||
|
goto error_getopt;
|
||||||
else if (arg_index != argc - 4)
|
else if (arg_index != argc - 4)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Incorrect number of parameters. Requires " \
|
fprintf(stderr, "Incorrect number of parameters. Requires " \
|
||||||
|
@ -1214,11 +1219,11 @@ main(int argc, char *argv[])
|
||||||
ret = 9;
|
ret = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_getopt:
|
error_getopt:
|
||||||
if (ee)
|
if (ee)
|
||||||
ecore_evas_free(ee);
|
ecore_evas_free(ee);
|
||||||
|
|
||||||
error_log:
|
error_log:
|
||||||
edje_shutdown();
|
edje_shutdown();
|
||||||
ecore_evas_shutdown();
|
ecore_evas_shutdown();
|
||||||
ecore_shutdown();
|
ecore_shutdown();
|
||||||
|
@ -1233,3 +1238,4 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ _edje_file_convert(Eet_File *ef, Old_Edje_File *oedf)
|
||||||
|
|
||||||
return edf;
|
return edf;
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
eina_hash_free(edf->fonts);
|
eina_hash_free(edf->fonts);
|
||||||
eina_hash_free(edf->collection);
|
eina_hash_free(edf->collection);
|
||||||
eina_hash_free(edf->data);
|
eina_hash_free(edf->data);
|
||||||
|
@ -191,7 +191,7 @@ _edje_collection_program_add(Edje_Program ***array,
|
||||||
{
|
{
|
||||||
Edje_Program **tmp;
|
Edje_Program **tmp;
|
||||||
|
|
||||||
tmp = realloc(*array, sizeof (Edje_Program*) * (*count + 1));
|
tmp = realloc(*array, sizeof (Edje_Program *) * (*count + 1));
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
{
|
{
|
||||||
error_and_abort(ef, "Not enough memory");
|
error_and_abort(ef, "Not enough memory");
|
||||||
|
@ -221,11 +221,10 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
|
||||||
int *count;
|
int *count;
|
||||||
int dummy = 0;
|
int dummy = 0;
|
||||||
|
|
||||||
|
|
||||||
switch (part->type)
|
switch (part->type)
|
||||||
{
|
{
|
||||||
#define CSP(Tp, Ce) \
|
#define CSP(Tp, Ce) \
|
||||||
case EDJE_PART_TYPE_##Tp : \
|
case EDJE_PART_TYPE_##Tp: \
|
||||||
count = &Ce->count.Tp; \
|
count = &Ce->count.Tp; \
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -239,6 +238,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
|
||||||
CSP(TABLE, ce);
|
CSP(TABLE, ce);
|
||||||
CSP(EXTERNAL, ce);
|
CSP(EXTERNAL, ce);
|
||||||
CSP(VECTOR, ce);
|
CSP(VECTOR, ce);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
count = &dummy;
|
count = &dummy;
|
||||||
break;
|
break;
|
||||||
|
@ -303,7 +303,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
|
||||||
Edje_String *es;
|
Edje_String *es;
|
||||||
|
|
||||||
es = calloc(1, sizeof (Edje_String));
|
es = calloc(1, sizeof (Edje_String));
|
||||||
if (!es) continue ;
|
if (!es) continue;
|
||||||
|
|
||||||
es->str = di->value;
|
es->str = di->value;
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
|
||||||
replacement->default_desc = _edje_description_convert(part->type, ce, part->default_desc);
|
replacement->default_desc = _edje_description_convert(part->type, ce, part->default_desc);
|
||||||
|
|
||||||
replacement->other.desc_count = eina_list_count(part->other_desc);
|
replacement->other.desc_count = eina_list_count(part->other_desc);
|
||||||
replacement->other.desc = calloc(replacement->other.desc_count, sizeof (Edje_Part_Description_Common*));
|
replacement->other.desc = calloc(replacement->other.desc_count, sizeof (Edje_Part_Description_Common *));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
EINA_LIST_FREE(part->other_desc, oepd)
|
EINA_LIST_FREE(part->other_desc, oepd)
|
||||||
|
@ -348,7 +348,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
|
||||||
replacement->clip_to_id = part->clip_to_id;
|
replacement->clip_to_id = part->clip_to_id;
|
||||||
replacement->dragable = part->dragable;
|
replacement->dragable = part->dragable;
|
||||||
replacement->items_count = eina_list_count(part->items);
|
replacement->items_count = eina_list_count(part->items);
|
||||||
replacement->items = calloc(replacement->items_count, sizeof (Edje_Pack_Element*));
|
replacement->items = calloc(replacement->items_count, sizeof (Edje_Pack_Element *));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
EINA_LIST_FREE(part->items, elm)
|
EINA_LIST_FREE(part->items, elm)
|
||||||
|
@ -389,7 +389,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
|
||||||
return edc;
|
return edc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Edje_Part_Description_Common*
|
Edje_Part_Description_Common *
|
||||||
_edje_description_convert(int type,
|
_edje_description_convert(int type,
|
||||||
Edje_Part_Collection_Directory_Entry *ce,
|
Edje_Part_Collection_Directory_Entry *ce,
|
||||||
Old_Edje_Part_Description *oed)
|
Old_Edje_Part_Description *oed)
|
||||||
|
@ -402,10 +402,12 @@ _edje_description_convert(int type,
|
||||||
result = eina_mempool_malloc(ce->mp.RECTANGLE,
|
result = eina_mempool_malloc(ce->mp.RECTANGLE,
|
||||||
sizeof (Edje_Part_Description_Common));
|
sizeof (Edje_Part_Description_Common));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_PART_TYPE_SWALLOW:
|
case EDJE_PART_TYPE_SWALLOW:
|
||||||
result = eina_mempool_malloc(ce->mp.SWALLOW,
|
result = eina_mempool_malloc(ce->mp.SWALLOW,
|
||||||
sizeof (Edje_Part_Description_Common));
|
sizeof (Edje_Part_Description_Common));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_PART_TYPE_GROUP:
|
case EDJE_PART_TYPE_GROUP:
|
||||||
result = eina_mempool_malloc(ce->mp.GROUP,
|
result = eina_mempool_malloc(ce->mp.GROUP,
|
||||||
sizeof (Edje_Part_Description_Common));
|
sizeof (Edje_Part_Description_Common));
|
||||||
|
@ -421,7 +423,7 @@ _edje_description_convert(int type,
|
||||||
|
|
||||||
img->image.tweens_count = eina_list_count(oed->image.tween_list);
|
img->image.tweens_count = eina_list_count(oed->image.tween_list);
|
||||||
img->image.tweens = calloc(img->image.tweens_count,
|
img->image.tweens = calloc(img->image.tweens_count,
|
||||||
sizeof (Edje_Part_Image_Id*));
|
sizeof (Edje_Part_Image_Id *));
|
||||||
if (img->image.tweens_count > 0 && !img->image.tweens)
|
if (img->image.tweens_count > 0 && !img->image.tweens)
|
||||||
{
|
{
|
||||||
eina_mempool_free(ce->mp.IMAGE, img);
|
eina_mempool_free(ce->mp.IMAGE, img);
|
||||||
|
@ -443,15 +445,15 @@ _edje_description_convert(int type,
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CONVERT_ALLOC_POOL(Short, Type, Name) \
|
#define CONVERT_ALLOC_POOL(Short, Type, Name) \
|
||||||
case EDJE_PART_TYPE_##Short: \
|
case EDJE_PART_TYPE_##Short: \
|
||||||
{ \
|
{ \
|
||||||
Edje_Part_Description_##Type *Name; \
|
Edje_Part_Description_##Type * Name; \
|
||||||
\
|
\
|
||||||
Name = eina_mempool_malloc(ce->mp.Short, sizeof (Edje_Part_Description_##Type)); \
|
Name = eina_mempool_malloc(ce->mp.Short, sizeof (Edje_Part_Description_##Type)); \
|
||||||
Name->Name = oed->Name; \
|
Name->Name = oed->Name; \
|
||||||
result = &Name->common; \
|
result = &Name->common; \
|
||||||
break; \
|
break; \
|
||||||
}
|
}
|
||||||
|
|
||||||
CONVERT_ALLOC_POOL(TEXT, Text, text);
|
CONVERT_ALLOC_POOL(TEXT, Text, text);
|
||||||
CONVERT_ALLOC_POOL(TEXTBLOCK, Text, text);
|
CONVERT_ALLOC_POOL(TEXTBLOCK, Text, text);
|
||||||
|
@ -467,3 +469,4 @@ _edje_description_convert(int type,
|
||||||
free(oed);
|
free(oed);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ main_help(void)
|
||||||
("Usage:\n"
|
("Usage:\n"
|
||||||
"\t%s file.edj\n"
|
"\t%s file.edj\n"
|
||||||
"\n"
|
"\n"
|
||||||
,progname);
|
, progname);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -63,7 +63,7 @@ _edje_alias_int(const char *target, Eet_File *ef, const char *base, const char *
|
||||||
if (sscanf(match[i], buf, &id) != 1)
|
if (sscanf(match[i], buf, &id) != 1)
|
||||||
{
|
{
|
||||||
EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
|
EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
|
||||||
continue ;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(name, sizeof (name), "%s/%i", to, id);
|
snprintf(name, sizeof (name), "%s/%i", to, id);
|
||||||
|
@ -93,7 +93,7 @@ _edje_alias_string(const char *target, Eet_File *ef, const char *base, const cha
|
||||||
if (sscanf(match[i], buf, &id) != 1)
|
if (sscanf(match[i], buf, &id) != 1)
|
||||||
{
|
{
|
||||||
EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
|
EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
|
||||||
continue ;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(name, sizeof (name), "%s/%s", to, id);
|
snprintf(name, sizeof (name), "%s/%s", to, id);
|
||||||
|
@ -205,3 +205,4 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -451,6 +451,7 @@ _edje_edd_old_init(void)
|
||||||
eet_data_descriptor_element_add(_edje_edd_old_edje_part_collection,
|
eet_data_descriptor_element_add(_edje_edd_old_edje_part_collection,
|
||||||
"alias", EET_T_STRING, EET_G_HASH,
|
"alias", EET_T_STRING, EET_G_HASH,
|
||||||
(char *)(&(epc.alias)) - (char *)(&(epc)),
|
(char *)(&(epc.alias)) - (char *)(&(epc)),
|
||||||
0, /* 0, */NULL, NULL);
|
0, /* 0, */ NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
|
||||||
#include <Ecore_File.h>
|
#include <Ecore_File.h>
|
||||||
#include <Ecore_Evas.h>
|
#include <Ecore_Evas.h>
|
||||||
|
|
||||||
|
@ -38,7 +37,6 @@ void output(void);
|
||||||
static int compiler_cmd_is_sane(void);
|
static int compiler_cmd_is_sane(void);
|
||||||
static int root_filename_is_sane(void);
|
static int root_filename_is_sane(void);
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_edje_cc_log_cb(const Eina_Log_Domain *d,
|
_edje_cc_log_cb(const Eina_Log_Domain *d,
|
||||||
Eina_Log_Level level,
|
Eina_Log_Level level,
|
||||||
|
@ -66,18 +64,23 @@ _edje_cc_log_cb(const Eina_Log_Domain *d,
|
||||||
case EINA_LOG_LEVEL_CRITICAL:
|
case EINA_LOG_LEVEL_CRITICAL:
|
||||||
color = FOREGROUND_RED | FOREGROUND_INTENSITY;
|
color = FOREGROUND_RED | FOREGROUND_INTENSITY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EINA_LOG_LEVEL_ERR:
|
case EINA_LOG_LEVEL_ERR:
|
||||||
color = FOREGROUND_RED;
|
color = FOREGROUND_RED;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EINA_LOG_LEVEL_WARN:
|
case EINA_LOG_LEVEL_WARN:
|
||||||
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
|
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EINA_LOG_LEVEL_INFO:
|
case EINA_LOG_LEVEL_INFO:
|
||||||
color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
|
color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EINA_LOG_LEVEL_DBG:
|
case EINA_LOG_LEVEL_DBG:
|
||||||
color = FOREGROUND_BLUE | FOREGROUND_INTENSITY;
|
color = FOREGROUND_BLUE | FOREGROUND_INTENSITY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
|
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
|
||||||
}
|
}
|
||||||
|
@ -90,12 +93,15 @@ _edje_cc_log_cb(const Eina_Log_Domain *d,
|
||||||
case EINA_LOG_LEVEL_CRITICAL:
|
case EINA_LOG_LEVEL_CRITICAL:
|
||||||
prefix = "Critical. ";
|
prefix = "Critical. ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EINA_LOG_LEVEL_ERR:
|
case EINA_LOG_LEVEL_ERR:
|
||||||
prefix = "Error. ";
|
prefix = "Error. ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EINA_LOG_LEVEL_WARN:
|
case EINA_LOG_LEVEL_WARN:
|
||||||
prefix = "Warning. ";
|
prefix = "Warning. ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
prefix = "";
|
prefix = "";
|
||||||
}
|
}
|
||||||
|
@ -111,7 +117,6 @@ _edje_cc_log_cb(const Eina_Log_Domain *d,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
putc('\n', stderr);
|
putc('\n', stderr);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +137,7 @@ main_help(void)
|
||||||
" -current-dir\tOutput to current directory \n"
|
" -current-dir\tOutput to current directory \n"
|
||||||
" -quiet\t\tProduce less output\n"
|
" -quiet\t\tProduce less output\n"
|
||||||
"\n"
|
"\n"
|
||||||
,progname);
|
, progname);
|
||||||
}
|
}
|
||||||
|
|
||||||
Eet_File *ef;
|
Eet_File *ef;
|
||||||
|
@ -233,7 +238,7 @@ decomp(void)
|
||||||
}
|
}
|
||||||
if (!eina_list_data_get(srcfiles->list) || !root_filename_is_sane())
|
if (!eina_list_data_get(srcfiles->list) || !root_filename_is_sane())
|
||||||
{
|
{
|
||||||
ERR("Invalid root filename: '%s'", (char *) eina_list_data_get(srcfiles->list));
|
ERR("Invalid root filename: '%s'", (char *)eina_list_data_get(srcfiles->list));
|
||||||
eet_close(ef);
|
eet_close(ef);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -285,7 +290,6 @@ output(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tef = eet_open(file_in, EET_FILE_MODE_READ);
|
tef = eet_open(file_in, EET_FILE_MODE_READ);
|
||||||
|
|
||||||
if (edje_file->image_dir)
|
if (edje_file->image_dir)
|
||||||
|
@ -365,20 +369,20 @@ output(void)
|
||||||
if (strstr(pp, "../"))
|
if (strstr(pp, "../"))
|
||||||
{
|
{
|
||||||
ERR("Potential security violation. attempt to write in parent dir.");
|
ERR("Potential security violation. attempt to write in parent dir.");
|
||||||
exit (-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
ecore_file_mkpath(pp);
|
ecore_file_mkpath(pp);
|
||||||
free(pp);
|
free(pp);
|
||||||
if (strstr(out, "../"))
|
if (strstr(out, "../"))
|
||||||
{
|
{
|
||||||
ERR("Potential security violation. attempt to write in parent dir.");
|
ERR("Potential security violation. attempt to write in parent dir.");
|
||||||
exit (-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
f = fopen(out, "wb");
|
f = fopen(out, "wb");
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
ERR("Unable to write file (%s).", out);
|
ERR("Unable to write file (%s).", out);
|
||||||
exit (-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if the file is empty, sf->file will be NULL.
|
/* if the file is empty, sf->file will be NULL.
|
||||||
|
@ -416,19 +420,19 @@ output(void)
|
||||||
if (strstr(pp, "../"))
|
if (strstr(pp, "../"))
|
||||||
{
|
{
|
||||||
ERR("Potential security violation. attempt to write in parent dir.");
|
ERR("Potential security violation. attempt to write in parent dir.");
|
||||||
exit (-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
ecore_file_mkpath(pp);
|
ecore_file_mkpath(pp);
|
||||||
free(pp);
|
free(pp);
|
||||||
if (strstr(out, "../"))
|
if (strstr(out, "../"))
|
||||||
{
|
{
|
||||||
ERR("Potential security violation. attempt to write in parent dir.");
|
ERR("Potential security violation. attempt to write in parent dir.");
|
||||||
exit (-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
if (!(f = fopen(out, "wb")))
|
if (!(f = fopen(out, "wb")))
|
||||||
{
|
{
|
||||||
ERR("Could not open file: %s", out);
|
ERR("Could not open file: %s", out);
|
||||||
exit (-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
if (fwrite(font, fontsize, 1, f) != 1)
|
if (fwrite(font, fontsize, 1, f) != 1)
|
||||||
ERR("Could not write font: %s", strerror(errno));
|
ERR("Could not write font: %s", strerror(errno));
|
||||||
|
@ -443,7 +447,6 @@ output(void)
|
||||||
FILE *f;
|
FILE *f;
|
||||||
sf = eina_list_data_get(srcfiles->list);
|
sf = eina_list_data_get(srcfiles->list);
|
||||||
|
|
||||||
|
|
||||||
if (build_sh)
|
if (build_sh)
|
||||||
{
|
{
|
||||||
snprintf(out, sizeof(out), "%s/build.sh", outdir);
|
snprintf(out, sizeof(out), "%s/build.sh", outdir);
|
||||||
|
@ -451,7 +454,7 @@ output(void)
|
||||||
if (strstr(out, "../"))
|
if (strstr(out, "../"))
|
||||||
{
|
{
|
||||||
ERR("potential security violation. attempt to write in parent dir.");
|
ERR("potential security violation. attempt to write in parent dir.");
|
||||||
exit (-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
if ((f = fopen(out, "wb")))
|
if ((f = fopen(out, "wb")))
|
||||||
{
|
{
|
||||||
|
@ -478,7 +481,6 @@ output(void)
|
||||||
ERR("symlink %s -> %s failed", sf->name, out);
|
ERR("symlink %s -> %s failed", sf->name, out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edje_file->sound_dir)
|
if (edje_file->sound_dir)
|
||||||
|
@ -526,7 +528,6 @@ output(void)
|
||||||
else ERR("Could not open for writing sound: %s: %s", out1, strerror(errno));
|
else ERR("Could not open for writing sound: %s: %s", out1, strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (edje_file->vibration_dir)
|
if (edje_file->vibration_dir)
|
||||||
{
|
{
|
||||||
|
@ -617,8 +618,12 @@ root_filename_is_sane()
|
||||||
/* only allow [a-z][A-Z][0-9]_-./ */
|
/* only allow [a-z][A-Z][0-9]_-./ */
|
||||||
switch (*ptr)
|
switch (*ptr)
|
||||||
{
|
{
|
||||||
case '_': case '-': case '.': case '/':
|
case '_':
|
||||||
|
case '-':
|
||||||
|
case '.':
|
||||||
|
case '/':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (!isalnum(*ptr))
|
if (!isalnum(*ptr))
|
||||||
{
|
{
|
||||||
|
@ -628,3 +633,4 @@ root_filename_is_sane()
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,15 +27,14 @@ static char *module_patterns_str = NULL;
|
||||||
static int detail = 1;
|
static int detail = 1;
|
||||||
static Eina_Bool machine = EINA_FALSE;
|
static Eina_Bool machine = EINA_FALSE;
|
||||||
static char *type_glob = NULL;
|
static char *type_glob = NULL;
|
||||||
static char * const *module_patterns;
|
static char *const *module_patterns;
|
||||||
static const Eina_List *modules;
|
static const Eina_List *modules;
|
||||||
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
_module_patterns_str_new(void)
|
_module_patterns_str_new(void)
|
||||||
{
|
{
|
||||||
Eina_Strbuf *buf;
|
Eina_Strbuf *buf;
|
||||||
char * const *itr;
|
char *const *itr;
|
||||||
char *ret;
|
char *ret;
|
||||||
if (!module_patterns) return strdup("*");
|
if (!module_patterns) return strdup("*");
|
||||||
|
|
||||||
|
@ -53,7 +52,7 @@ _module_patterns_str_new(void)
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
module_matches(const char *name)
|
module_matches(const char *name)
|
||||||
{
|
{
|
||||||
char * const *itr;
|
char *const *itr;
|
||||||
if (!module_patterns) return EINA_TRUE;
|
if (!module_patterns) return EINA_TRUE;
|
||||||
|
|
||||||
for (itr = module_patterns; *itr != NULL; itr++)
|
for (itr = module_patterns; *itr != NULL; itr++)
|
||||||
|
@ -93,10 +92,15 @@ _param_type_str_get(const Edje_External_Param_Info *param)
|
||||||
switch (param->type)
|
switch (param->type)
|
||||||
{
|
{
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_INT: return "int";
|
case EDJE_EXTERNAL_PARAM_TYPE_INT: return "int";
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: return "double";
|
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: return "double";
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_STRING: return "string";
|
case EDJE_EXTERNAL_PARAM_TYPE_STRING: return "string";
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_BOOL: return "bool";
|
case EDJE_EXTERNAL_PARAM_TYPE_BOOL: return "bool";
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE: return "choice";
|
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE: return "choice";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Unknown parameter type %d", param->type);
|
ERR("Unknown parameter type %d", param->type);
|
||||||
return "???";
|
return "???";
|
||||||
|
@ -123,7 +127,8 @@ _param_value_str_get(const Edje_External_Type *type, const Edje_External_Param_I
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
|
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
|
||||||
if (param->info.b.def == 0) return "0";
|
if (param->info.b.def == 0) return "0";
|
||||||
else if (param->info.b.def == 1) return "1";
|
else if (param->info.b.def == 1)
|
||||||
|
return "1";
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
|
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
|
||||||
|
@ -179,7 +184,7 @@ _param_flags_str_get(const Edje_External_Param_Info *param)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_param_choices_print(const char * const *choices)
|
_param_choices_print(const char *const *choices)
|
||||||
{
|
{
|
||||||
if (machine) puts("CHOICES-BEGIN");
|
if (machine) puts("CHOICES-BEGIN");
|
||||||
else fputs(", choices:", stdout);
|
else fputs(", choices:", stdout);
|
||||||
|
@ -272,8 +277,9 @@ _param_extra_details(const Edje_External_Type *type, const Edje_External_Param_I
|
||||||
if (choices)
|
if (choices)
|
||||||
{
|
{
|
||||||
char **itr;
|
char **itr;
|
||||||
_param_choices_print((const char * const*)choices);
|
_param_choices_print((const char *const *)choices);
|
||||||
for (itr = choices; *itr; itr++) free(*itr);
|
for (itr = choices; *itr; itr++)
|
||||||
|
free(*itr);
|
||||||
free(choices);
|
free(choices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,12 +403,14 @@ _info_list(void)
|
||||||
if (!type->label_get) str = NULL;
|
if (!type->label_get) str = NULL;
|
||||||
else str = type->label_get(type->data);
|
else str = type->label_get(type->data);
|
||||||
if (machine) printf("LABEL: %s\n", str ? str : "");
|
if (machine) printf("LABEL: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT3 "label: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT3 "label: \"%s\";\n", str);
|
||||||
|
|
||||||
if (!type->description_get) str = NULL;
|
if (!type->description_get) str = NULL;
|
||||||
else str = type->description_get(type->data);
|
else str = type->description_get(type->data);
|
||||||
if (machine) printf("DESCRIPTION: %s\n", str ? str : "");
|
if (machine) printf("DESCRIPTION: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT3 "description: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT3 "description: \"%s\";\n", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (machine) puts("PARAMS-BEGIN");
|
if (machine) puts("PARAMS-BEGIN");
|
||||||
|
@ -422,7 +430,8 @@ _info_list(void)
|
||||||
const char *str = _param_value_str_get
|
const char *str = _param_value_str_get
|
||||||
(type, param, buf, sizeof(buf));
|
(type, param, buf, sizeof(buf));
|
||||||
if (machine) printf("DEFAULT: %s\n", str ? str : "");
|
if (machine) printf("DEFAULT: %s\n", str ? str : "");
|
||||||
else if (str) printf(" \"%s\"", str);
|
else if (str)
|
||||||
|
printf(" \"%s\"", str);
|
||||||
|
|
||||||
if (detail > 1)
|
if (detail > 1)
|
||||||
{
|
{
|
||||||
|
@ -432,7 +441,8 @@ _info_list(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (machine) puts("PARAM-END");
|
if (machine) puts("PARAM-END");
|
||||||
else if (detail > 1) putchar('\n');
|
else if (detail > 1)
|
||||||
|
putchar('\n');
|
||||||
else puts(";");
|
else puts(";");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -625,15 +635,18 @@ main(int argc, char **argv)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto error_getopt;
|
goto error_getopt;
|
||||||
}
|
}
|
||||||
else if (quit_option) goto error_getopt;
|
else if (quit_option)
|
||||||
|
goto error_getopt;
|
||||||
|
|
||||||
if (!mode) mode = (char *)mode_choices[0];
|
if (!mode) mode = (char *)mode_choices[0];
|
||||||
|
|
||||||
if (detail_name)
|
if (detail_name)
|
||||||
{
|
{
|
||||||
if (!strcmp(detail_name, "none")) detail = 0;
|
if (!strcmp(detail_name, "none")) detail = 0;
|
||||||
else if (!strcmp(detail_name, "terse")) detail = 1;
|
else if (!strcmp(detail_name, "terse"))
|
||||||
else if (!strcmp(detail_name, "all")) detail = 2;
|
detail = 1;
|
||||||
|
else if (!strcmp(detail_name, "all"))
|
||||||
|
detail = 2;
|
||||||
else ERR("Unknown detail level: '%s'", detail_name);
|
else ERR("Unknown detail level: '%s'", detail_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,8 +657,10 @@ main(int argc, char **argv)
|
||||||
module_patterns_str = _module_patterns_str_new();
|
module_patterns_str = _module_patterns_str_new();
|
||||||
|
|
||||||
if (!strcmp(mode, "info")) ret = _info_list();
|
if (!strcmp(mode, "info")) ret = _info_list();
|
||||||
else if (!strcmp(mode, "modules-names")) ret = _modules_names_list();
|
else if (!strcmp(mode, "modules-names"))
|
||||||
else if (!strcmp(mode, "types-names")) ret = _types_names_list();
|
ret = _modules_names_list();
|
||||||
|
else if (!strcmp(mode, "types-names"))
|
||||||
|
ret = _types_names_list();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERR("Unknown mode: %s", mode);
|
ERR("Unknown mode: %s", mode);
|
||||||
|
@ -654,12 +669,13 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
free(module_patterns_str);
|
free(module_patterns_str);
|
||||||
|
|
||||||
error_getopt:
|
error_getopt:
|
||||||
eina_log_domain_unregister(_log_dom);
|
eina_log_domain_unregister(_log_dom);
|
||||||
error_log:
|
error_log:
|
||||||
edje_shutdown();
|
edje_shutdown();
|
||||||
ecore_shutdown();
|
ecore_shutdown();
|
||||||
eina_shutdown();
|
eina_shutdown();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,12 +130,14 @@ group_details(Evas_Object *ed)
|
||||||
w = edje_edit_group_min_w_get(ed);
|
w = edje_edit_group_min_w_get(ed);
|
||||||
h = edje_edit_group_min_h_get(ed);
|
h = edje_edit_group_min_h_get(ed);
|
||||||
if (machine) printf("MIN-W: %d\nMIN-H: %d\n", w, h);
|
if (machine) printf("MIN-W: %d\nMIN-H: %d\n", w, h);
|
||||||
else if ((w > 0) || (h > 0)) printf(INDENT "min: %d %d;\n", w, h);
|
else if ((w > 0) || (h > 0))
|
||||||
|
printf(INDENT "min: %d %d;\n", w, h);
|
||||||
|
|
||||||
w = edje_edit_group_max_w_get(ed);
|
w = edje_edit_group_max_w_get(ed);
|
||||||
h = edje_edit_group_max_h_get(ed);
|
h = edje_edit_group_max_h_get(ed);
|
||||||
if (machine) printf("MAX-W: %d\nMAX-H: %d\n", w, h);
|
if (machine) printf("MAX-W: %d\nMAX-H: %d\n", w, h);
|
||||||
else if ((w > 0) || (h > 0)) printf(INDENT "max: %d %d;\n", w, h);
|
else if ((w > 0) || (h > 0))
|
||||||
|
printf(INDENT "max: %d %d;\n", w, h);
|
||||||
|
|
||||||
if (detail > 1)
|
if (detail > 1)
|
||||||
{
|
{
|
||||||
|
@ -186,28 +188,40 @@ part_type_name_get(Edje_Part_Type t)
|
||||||
{
|
{
|
||||||
case EDJE_PART_TYPE_RECTANGLE:
|
case EDJE_PART_TYPE_RECTANGLE:
|
||||||
return "RECT";
|
return "RECT";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_TEXT:
|
case EDJE_PART_TYPE_TEXT:
|
||||||
return "TEXT";
|
return "TEXT";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_IMAGE:
|
case EDJE_PART_TYPE_IMAGE:
|
||||||
return "IMAGE";
|
return "IMAGE";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_PROXY:
|
case EDJE_PART_TYPE_PROXY:
|
||||||
return "PROXY";
|
return "PROXY";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_SWALLOW:
|
case EDJE_PART_TYPE_SWALLOW:
|
||||||
return "SWALLOW";
|
return "SWALLOW";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_TEXTBLOCK:
|
case EDJE_PART_TYPE_TEXTBLOCK:
|
||||||
return "TEXTBLOCK";
|
return "TEXTBLOCK";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_GRADIENT:
|
case EDJE_PART_TYPE_GRADIENT:
|
||||||
return "GRADIENT";
|
return "GRADIENT";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_GROUP:
|
case EDJE_PART_TYPE_GROUP:
|
||||||
return "GROUP";
|
return "GROUP";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_BOX:
|
case EDJE_PART_TYPE_BOX:
|
||||||
return "BOX";
|
return "BOX";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_TABLE:
|
case EDJE_PART_TYPE_TABLE:
|
||||||
return "TABLE";
|
return "TABLE";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_EXTERNAL:
|
case EDJE_PART_TYPE_EXTERNAL:
|
||||||
return "EXTERNAL";
|
return "EXTERNAL";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_SPACER:
|
case EDJE_PART_TYPE_SPACER:
|
||||||
return "SPACER";
|
return "SPACER";
|
||||||
|
|
||||||
case EDJE_PART_TYPE_VECTOR:
|
case EDJE_PART_TYPE_VECTOR:
|
||||||
return "VECTOR";
|
return "VECTOR";
|
||||||
|
|
||||||
|
@ -215,6 +229,7 @@ part_type_name_get(Edje_Part_Type t)
|
||||||
case EDJE_PART_TYPE_LAST:
|
case EDJE_PART_TYPE_LAST:
|
||||||
ERR("Invalid part type %d", t);
|
ERR("Invalid part type %d", t);
|
||||||
return "???";
|
return "???";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Unknown part type %d", t);
|
ERR("Unknown part type %d", t);
|
||||||
return "???";
|
return "???";
|
||||||
|
@ -239,9 +254,13 @@ aspect_pref_name_get(int id)
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case 0: return "NONE";
|
case 0: return "NONE";
|
||||||
|
|
||||||
case 1: return "VERTICAL";
|
case 1: return "VERTICAL";
|
||||||
|
|
||||||
case 2: return "HORIZONTAL";
|
case 2: return "HORIZONTAL";
|
||||||
|
|
||||||
case 3: return "BOTH";
|
case 3: return "BOTH";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Unknown aspect preference %d", id);
|
ERR("Unknown aspect preference %d", id);
|
||||||
return "???";
|
return "???";
|
||||||
|
@ -254,8 +273,11 @@ border_fill_name_get(int id)
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case 0: return "NONE";
|
case 0: return "NONE";
|
||||||
|
|
||||||
case 1: return "DEFAULT";
|
case 1: return "DEFAULT";
|
||||||
|
|
||||||
case 2: return "SOLID";
|
case 2: return "SOLID";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Unknown border fill %d", id);
|
ERR("Unknown border fill %d", id);
|
||||||
return "???";
|
return "???";
|
||||||
|
@ -274,7 +296,8 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
|
|
||||||
b = edje_edit_state_visible_get(ed, ppart, state, value);
|
b = edje_edit_state_visible_get(ed, ppart, state, value);
|
||||||
if (machine) printf("VISIBLE: %d\n", b);
|
if (machine) printf("VISIBLE: %d\n", b);
|
||||||
else if (!b) puts(INDENT4 "visible: 0;");
|
else if (!b)
|
||||||
|
puts(INDENT4 "visible: 0;");
|
||||||
|
|
||||||
edje_edit_state_color_get(ed, ppart, state, value, &r, &g, &b, &a);
|
edje_edit_state_color_get(ed, ppart, state, value, &r, &g, &b, &a);
|
||||||
if (machine)
|
if (machine)
|
||||||
|
@ -308,12 +331,14 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
x = edje_edit_state_min_w_get(ed, ppart, state, value);
|
x = edje_edit_state_min_w_get(ed, ppart, state, value);
|
||||||
y = edje_edit_state_min_h_get(ed, ppart, state, value);
|
y = edje_edit_state_min_h_get(ed, ppart, state, value);
|
||||||
if (machine) printf("MIN-W: %d\nMIN-H: %d\n", x, y);
|
if (machine) printf("MIN-W: %d\nMIN-H: %d\n", x, y);
|
||||||
else if ((x) || (y)) printf(INDENT4 "min: %d %d;\n", x, y);
|
else if ((x) || (y))
|
||||||
|
printf(INDENT4 "min: %d %d;\n", x, y);
|
||||||
|
|
||||||
x = edje_edit_state_max_w_get(ed, ppart, state, value);
|
x = edje_edit_state_max_w_get(ed, ppart, state, value);
|
||||||
y = edje_edit_state_max_h_get(ed, ppart, state, value);
|
y = edje_edit_state_max_h_get(ed, ppart, state, value);
|
||||||
if (machine) printf("MAX-W: %d\nMAX-H: %d\n", x, y);
|
if (machine) printf("MAX-W: %d\nMAX-H: %d\n", x, y);
|
||||||
else if ((x != -1) || (y != -1)) printf(INDENT4 "max: %d %d;\n", x, y);
|
else if ((x != -1) || (y != -1))
|
||||||
|
printf(INDENT4 "max: %d %d;\n", x, y);
|
||||||
|
|
||||||
//TODO Support fixed
|
//TODO Support fixed
|
||||||
//TODO Support step
|
//TODO Support step
|
||||||
|
@ -329,12 +354,14 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
x = edje_edit_state_aspect_pref_get(ed, ppart, state, value);
|
x = edje_edit_state_aspect_pref_get(ed, ppart, state, value);
|
||||||
str = aspect_pref_name_get(x);
|
str = aspect_pref_name_get(x);
|
||||||
if (machine) printf("ASPECT-PREFERENCE: %s\n", str);
|
if (machine) printf("ASPECT-PREFERENCE: %s\n", str);
|
||||||
else if (x) printf(INDENT4 "aspect_preference: %s;\n", str);
|
else if (x)
|
||||||
|
printf(INDENT4 "aspect_preference: %s;\n", str);
|
||||||
/* do not free this str! */
|
/* do not free this str! */
|
||||||
|
|
||||||
str = edje_edit_state_color_class_get(ed, ppart, state, value);
|
str = edje_edit_state_color_class_get(ed, ppart, state, value);
|
||||||
if (machine) printf("COLOR_CLASS: %s\n", str ? str : "");
|
if (machine) printf("COLOR_CLASS: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT4 "color_class: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT4 "color_class: \"%s\";\n", str);
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +381,8 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
printf(INDENT5 "relative: %g %g;\n", dx, dy);
|
printf(INDENT5 "relative: %g %g;\n", dx, dy);
|
||||||
|
|
||||||
if (machine) printf("OFFSET-X: %d\nOFFSET-Y: %d\n", x, y);
|
if (machine) printf("OFFSET-X: %d\nOFFSET-Y: %d\n", x, y);
|
||||||
else if ((x) || (y)) printf(INDENT5 "offset: %d %d;\n", x, y);
|
else if ((x) || (y))
|
||||||
|
printf(INDENT5 "offset: %d %d;\n", x, y);
|
||||||
|
|
||||||
if (machine)
|
if (machine)
|
||||||
printf("TO-X: %s\nTO-Y: %s\n", str ? str : "", str2 ? str2 : "");
|
printf("TO-X: %s\nTO-Y: %s\n", str ? str : "", str2 ? str2 : "");
|
||||||
|
@ -418,7 +446,8 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
puts(INDENT4 "image {");
|
puts(INDENT4 "image {");
|
||||||
if (str) printf(INDENT5 "normal: \"%s\";\n", str);
|
if (str) printf(INDENT5 "normal: \"%s\";\n", str);
|
||||||
}
|
}
|
||||||
else if (str) printf(INDENT4 "image.normal: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT4 "image.normal: \"%s\";\n", str);
|
||||||
|
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
|
|
||||||
|
@ -448,7 +477,8 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
x = edje_edit_state_image_border_fill_get(ed, ppart, state, value);
|
x = edje_edit_state_image_border_fill_get(ed, ppart, state, value);
|
||||||
str = border_fill_name_get(x);
|
str = border_fill_name_get(x);
|
||||||
if (machine) printf("BORDER-FILL: %s\n", str);
|
if (machine) printf("BORDER-FILL: %s\n", str);
|
||||||
else if (x != 1) printf(INDENT5 "middle: %s;\n", str);
|
else if (x != 1)
|
||||||
|
printf(INDENT5 "middle: %s;\n", str);
|
||||||
/* do not free str! */
|
/* do not free str! */
|
||||||
|
|
||||||
// TODO support image.fill.smooth
|
// TODO support image.fill.smooth
|
||||||
|
@ -517,7 +547,8 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
}
|
}
|
||||||
|
|
||||||
if (machine) puts("IMAGE-END");
|
if (machine) puts("IMAGE-END");
|
||||||
else if (detail > 1) puts(INDENT4 "}");
|
else if (detail > 1)
|
||||||
|
puts(INDENT4 "}");
|
||||||
}
|
}
|
||||||
else if (t == EDJE_PART_TYPE_PROXY)
|
else if (t == EDJE_PART_TYPE_PROXY)
|
||||||
{
|
{
|
||||||
|
@ -602,17 +633,20 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
|
|
||||||
str = edje_edit_state_text_get(ed, ppart, state, value);
|
str = edje_edit_state_text_get(ed, ppart, state, value);
|
||||||
if (machine) printf("TEXT: %s\n", str ? str : "");
|
if (machine) printf("TEXT: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT5 "text: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT5 "text: \"%s\";\n", str);
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
|
|
||||||
str = edje_edit_state_font_get(ed, ppart, state, value);
|
str = edje_edit_state_font_get(ed, ppart, state, value);
|
||||||
if (machine) printf("FONT: %s\n", str ? str : "");
|
if (machine) printf("FONT: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT5 "font: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT5 "font: \"%s\";\n", str);
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
|
|
||||||
x = edje_edit_state_text_size_get(ed, ppart, state, value);
|
x = edje_edit_state_text_size_get(ed, ppart, state, value);
|
||||||
if (machine) printf("SIZE: %d\n", x);
|
if (machine) printf("SIZE: %d\n", x);
|
||||||
else if (x > 0) printf(INDENT5 "size: %d;\n", x);
|
else if (x > 0)
|
||||||
|
printf(INDENT5 "size: %d;\n", x);
|
||||||
|
|
||||||
// TODO text_class
|
// TODO text_class
|
||||||
|
|
||||||
|
@ -625,11 +659,13 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
x = edje_edit_state_text_fit_x_get(ed, ppart, state, value);
|
x = edje_edit_state_text_fit_x_get(ed, ppart, state, value);
|
||||||
y = edje_edit_state_text_fit_y_get(ed, ppart, state, value);
|
y = edje_edit_state_text_fit_y_get(ed, ppart, state, value);
|
||||||
if (machine) printf("TEXT-FIT-X: %d\nTEXT-FIT-Y: %d\n", x, y);
|
if (machine) printf("TEXT-FIT-X: %d\nTEXT-FIT-Y: %d\n", x, y);
|
||||||
else if ((x) || (y)) printf(INDENT5 "fit: %d %d;\n", x, y);
|
else if ((x) || (y))
|
||||||
|
printf(INDENT5 "fit: %d %d;\n", x, y);
|
||||||
|
|
||||||
dx = edje_edit_state_text_elipsis_get(ed, ppart, state, value);
|
dx = edje_edit_state_text_elipsis_get(ed, ppart, state, value);
|
||||||
if (machine) printf("TEXT-ELLIPSIS: %g\n", dx);
|
if (machine) printf("TEXT-ELLIPSIS: %g\n", dx);
|
||||||
else if (FDIFF(dx, 0.5)) printf(INDENT5 "ellipsis: %g;\n", dx);
|
else if (FDIFF(dx, 0.5))
|
||||||
|
printf(INDENT5 "ellipsis: %g;\n", dx);
|
||||||
|
|
||||||
if (machine) puts("TEXT-END");
|
if (machine) puts("TEXT-END");
|
||||||
else puts(INDENT4 "}");
|
else puts(INDENT4 "}");
|
||||||
|
@ -653,22 +689,27 @@ state_details(Evas_Object *ed, const char *ppart, const char *state, double valu
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_INT:
|
case EDJE_EXTERNAL_PARAM_TYPE_INT:
|
||||||
printf(INDENT5 "int: \"%s\" \"%d\";\n", p->name, p->i);
|
printf(INDENT5 "int: \"%s\" \"%d\";\n", p->name, p->i);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
|
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
|
||||||
printf(INDENT5 "double: \"%s\" \"%g\";\n", p->name, p->d);
|
printf(INDENT5 "double: \"%s\" \"%g\";\n", p->name, p->d);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
|
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
|
||||||
if (p->s)
|
if (p->s)
|
||||||
printf(INDENT5 "string: \"%s\" \"%s\";\n",
|
printf(INDENT5 "string: \"%s\" \"%s\";\n",
|
||||||
p->name, p->s);
|
p->name, p->s);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
|
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
|
||||||
printf(INDENT5 "bool: \"%s\" \"%d\";\n", p->name, p->i);
|
printf(INDENT5 "bool: \"%s\" \"%d\";\n", p->name, p->i);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
|
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
|
||||||
if (p->s)
|
if (p->s)
|
||||||
printf(INDENT5 "choice: \"%s\" \"%s\";\n",
|
printf(INDENT5 "choice: \"%s\" \"%s\";\n",
|
||||||
p->name, p->s);
|
p->name, p->s);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -683,7 +724,8 @@ static void
|
||||||
state_end(void)
|
state_end(void)
|
||||||
{
|
{
|
||||||
if (machine) puts("PART-STATE-END");
|
if (machine) puts("PART-STATE-END");
|
||||||
else if (detail > 0) puts(INDENT3 "}");
|
else if (detail > 0)
|
||||||
|
puts(INDENT3 "}");
|
||||||
else puts(" }");
|
else puts(" }");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -706,30 +748,41 @@ text_effect_name_get(Edje_Text_Effect effect)
|
||||||
{
|
{
|
||||||
case EDJE_TEXT_EFFECT_NONE:
|
case EDJE_TEXT_EFFECT_NONE:
|
||||||
return "NONE";
|
return "NONE";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_PLAIN:
|
case EDJE_TEXT_EFFECT_PLAIN:
|
||||||
return "PLAIN";
|
return "PLAIN";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_OUTLINE:
|
case EDJE_TEXT_EFFECT_OUTLINE:
|
||||||
return "OUTLINE";
|
return "OUTLINE";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_SOFT_OUTLINE:
|
case EDJE_TEXT_EFFECT_SOFT_OUTLINE:
|
||||||
return "SOFT_OUTLINE";
|
return "SOFT_OUTLINE";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_SHADOW:
|
case EDJE_TEXT_EFFECT_SHADOW:
|
||||||
return "SHADOW";
|
return "SHADOW";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_SOFT_SHADOW:
|
case EDJE_TEXT_EFFECT_SOFT_SHADOW:
|
||||||
return "SOFT_SHADOW";
|
return "SOFT_SHADOW";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_OUTLINE_SHADOW:
|
case EDJE_TEXT_EFFECT_OUTLINE_SHADOW:
|
||||||
return "OUTLINE_SHADOW";
|
return "OUTLINE_SHADOW";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW:
|
case EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW:
|
||||||
return "OUTLINE_SOFT_SHADOW";
|
return "OUTLINE_SOFT_SHADOW";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_FAR_SHADOW:
|
case EDJE_TEXT_EFFECT_FAR_SHADOW:
|
||||||
return "FAR_SHADOW";
|
return "FAR_SHADOW";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW:
|
case EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW:
|
||||||
return "FAR_SOFT_SHADOW";
|
return "FAR_SOFT_SHADOW";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_GLOW:
|
case EDJE_TEXT_EFFECT_GLOW:
|
||||||
return "GLOW";
|
return "GLOW";
|
||||||
|
|
||||||
case EDJE_TEXT_EFFECT_LAST:
|
case EDJE_TEXT_EFFECT_LAST:
|
||||||
ERR("Invalid part type %d", effect);
|
ERR("Invalid part type %d", effect);
|
||||||
return "???";
|
return "???";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Unknown effect type %d", effect);
|
ERR("Unknown effect type %d", effect);
|
||||||
return "???";
|
return "???";
|
||||||
|
@ -786,7 +839,7 @@ part_details(Evas_Object *ed, const char *ppart)
|
||||||
|
|
||||||
if (machine) puts("PART-DETAILS-BEGIN");
|
if (machine) puts("PART-DETAILS-BEGIN");
|
||||||
|
|
||||||
str = api =_part_api_name_get(ed, ppart);
|
str = api = _part_api_name_get(ed, ppart);
|
||||||
str2 = edje_edit_part_api_description_get(ed, ppart);
|
str2 = edje_edit_part_api_description_get(ed, ppart);
|
||||||
if (machine)
|
if (machine)
|
||||||
{
|
{
|
||||||
|
@ -800,27 +853,32 @@ part_details(Evas_Object *ed, const char *ppart)
|
||||||
|
|
||||||
b = edje_edit_part_mouse_events_get(ed, ppart);
|
b = edje_edit_part_mouse_events_get(ed, ppart);
|
||||||
if (machine) printf("MOUSE_EVENTS: %d\n", b);
|
if (machine) printf("MOUSE_EVENTS: %d\n", b);
|
||||||
else if (!b) puts(INDENT3 "mouse_events: 0;");
|
else if (!b)
|
||||||
|
puts(INDENT3 "mouse_events: 0;");
|
||||||
|
|
||||||
if (detail > 1)
|
if (detail > 1)
|
||||||
{
|
{
|
||||||
b = edje_edit_part_repeat_events_get(ed, ppart);
|
b = edje_edit_part_repeat_events_get(ed, ppart);
|
||||||
if (machine) printf("REPEAT_EVENTS: %d\n", b);
|
if (machine) printf("REPEAT_EVENTS: %d\n", b);
|
||||||
else if (b) puts(INDENT3 "repeat_events: 1;");
|
else if (b)
|
||||||
|
puts(INDENT3 "repeat_events: 1;");
|
||||||
|
|
||||||
b = edje_edit_part_scale_get(ed, ppart);
|
b = edje_edit_part_scale_get(ed, ppart);
|
||||||
if (machine) printf("SCALE: %d\n", b);
|
if (machine) printf("SCALE: %d\n", b);
|
||||||
else if (b) puts(INDENT3 "scale: 1;");
|
else if (b)
|
||||||
|
puts(INDENT3 "scale: 1;");
|
||||||
}
|
}
|
||||||
|
|
||||||
str = edje_edit_part_clip_to_get(ed, ppart);
|
str = edje_edit_part_clip_to_get(ed, ppart);
|
||||||
if (machine) printf("CLIP_TO: %s\n", str ? str : "");
|
if (machine) printf("CLIP_TO: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT3 "clip_to: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT3 "clip_to: \"%s\";\n", str);
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
|
|
||||||
str = edje_edit_part_source_get(ed, ppart);
|
str = edje_edit_part_source_get(ed, ppart);
|
||||||
if (machine) printf("SOURCE: %s\n", str ? str : "");
|
if (machine) printf("SOURCE: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT3 "source: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT3 "source: \"%s\";\n", str);
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
|
|
||||||
if (detail > 1)
|
if (detail > 1)
|
||||||
|
@ -829,7 +887,8 @@ part_details(Evas_Object *ed, const char *ppart)
|
||||||
{
|
{
|
||||||
str = text_effect_name_get(edje_edit_part_effect_get(ed, ppart));
|
str = text_effect_name_get(edje_edit_part_effect_get(ed, ppart));
|
||||||
if (machine) printf("EFFECT: %s\n", str ? str : "");
|
if (machine) printf("EFFECT: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT3 "effect: %s;\n", str);
|
else if (str)
|
||||||
|
printf(INDENT3 "effect: %s;\n", str);
|
||||||
/* do not free this str! */
|
/* do not free this str! */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -855,12 +914,14 @@ part_details(Evas_Object *ed, const char *ppart)
|
||||||
|
|
||||||
str = edje_edit_part_drag_confine_get(ed, ppart);
|
str = edje_edit_part_drag_confine_get(ed, ppart);
|
||||||
if (machine) printf("DRAG-CONFINE: %s\n", str ? str : "");
|
if (machine) printf("DRAG-CONFINE: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT4 "confine: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT4 "confine: \"%s\";\n", str);
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
|
|
||||||
str = edje_edit_part_drag_event_get(ed, ppart);
|
str = edje_edit_part_drag_event_get(ed, ppart);
|
||||||
if (machine) printf("DRAG-EVENTS: %s\n", str ? str : "");
|
if (machine) printf("DRAG-EVENTS: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT4 "events: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT4 "events: \"%s\";\n", str);
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
|
|
||||||
if (machine) puts("DRAGABLE-END");
|
if (machine) puts("DRAGABLE-END");
|
||||||
|
@ -875,7 +936,7 @@ part_details(Evas_Object *ed, const char *ppart)
|
||||||
double value;
|
double value;
|
||||||
eina_strlcpy(state, str, sizeof(state)); /* bad states_list! :-( */
|
eina_strlcpy(state, str, sizeof(state)); /* bad states_list! :-( */
|
||||||
delim = strchr(state, ' ');
|
delim = strchr(state, ' ');
|
||||||
if (!delim) continue ;
|
if (!delim) continue;
|
||||||
*delim = '\0';
|
*delim = '\0';
|
||||||
delim++;
|
delim++;
|
||||||
value = strtod(delim, NULL);
|
value = strtod(delim, NULL);
|
||||||
|
@ -892,7 +953,8 @@ static void
|
||||||
part_end(void)
|
part_end(void)
|
||||||
{
|
{
|
||||||
if (machine) puts("PART-END");
|
if (machine) puts("PART-END");
|
||||||
else if (detail > 0) puts(INDENT2 "}");
|
else if (detail > 0)
|
||||||
|
puts(INDENT2 "}");
|
||||||
else puts(" }");
|
else puts(" }");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1046,7 +1108,6 @@ program_end(void)
|
||||||
else puts(INDENT2 "}");
|
else puts(INDENT2 "}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
_program_api_name_get(Evas_Object *ed, const char *pprogram)
|
_program_api_name_get(Evas_Object *ed, const char *pprogram)
|
||||||
{
|
{
|
||||||
|
@ -1062,10 +1123,15 @@ _transition_name_get(Edje_Tween_Mode mode)
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case EDJE_TWEEN_MODE_LINEAR: return "LINEAR";
|
case EDJE_TWEEN_MODE_LINEAR: return "LINEAR";
|
||||||
|
|
||||||
case EDJE_TWEEN_MODE_ACCELERATE: return "ACCELERATE";
|
case EDJE_TWEEN_MODE_ACCELERATE: return "ACCELERATE";
|
||||||
|
|
||||||
case EDJE_TWEEN_MODE_DECELERATE: return "DECELERATE";
|
case EDJE_TWEEN_MODE_DECELERATE: return "DECELERATE";
|
||||||
|
|
||||||
case EDJE_TWEEN_MODE_SINUSOIDAL: return "SINUSOIDAL";
|
case EDJE_TWEEN_MODE_SINUSOIDAL: return "SINUSOIDAL";
|
||||||
|
|
||||||
case EDJE_TWEEN_MODE_CUBIC_BEZIER: return "CUBIC_BEZIER";
|
case EDJE_TWEEN_MODE_CUBIC_BEZIER: return "CUBIC_BEZIER";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Unknown transition mode %d", mode);
|
ERR("Unknown transition mode %d", mode);
|
||||||
return "???";
|
return "???";
|
||||||
|
@ -1082,7 +1148,7 @@ program_details(Evas_Object *ed, const char *pprogram)
|
||||||
|
|
||||||
if (machine) puts("PROGRAM-DETAILS-BEGIN");
|
if (machine) puts("PROGRAM-DETAILS-BEGIN");
|
||||||
|
|
||||||
str = api =_program_api_name_get(ed, pprogram);
|
str = api = _program_api_name_get(ed, pprogram);
|
||||||
str2 = edje_edit_program_api_description_get(ed, pprogram);
|
str2 = edje_edit_program_api_description_get(ed, pprogram);
|
||||||
if (machine)
|
if (machine)
|
||||||
{
|
{
|
||||||
|
@ -1096,12 +1162,14 @@ program_details(Evas_Object *ed, const char *pprogram)
|
||||||
|
|
||||||
str = edje_edit_program_signal_get(ed, pprogram);
|
str = edje_edit_program_signal_get(ed, pprogram);
|
||||||
if (machine) printf("SIGNAL: %s\n", str ? str : "");
|
if (machine) printf("SIGNAL: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT3 "signal: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT3 "signal: \"%s\";\n", str);
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
|
|
||||||
str = edje_edit_program_source_get(ed, pprogram);
|
str = edje_edit_program_source_get(ed, pprogram);
|
||||||
if (machine) printf("SOURCE: %s\n", str ? str : "");
|
if (machine) printf("SOURCE: %s\n", str ? str : "");
|
||||||
else if (str) printf(INDENT3 "source: \"%s\";\n", str);
|
else if (str)
|
||||||
|
printf(INDENT3 "source: \"%s\";\n", str);
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
|
|
||||||
if (detail >= 1)
|
if (detail >= 1)
|
||||||
|
@ -1114,6 +1182,7 @@ program_details(Evas_Object *ed, const char *pprogram)
|
||||||
if (machine) puts("ACTION: ACTION_STOP");
|
if (machine) puts("ACTION: ACTION_STOP");
|
||||||
else puts(INDENT3 "action: ACTION_STOP;");
|
else puts(INDENT3 "action: ACTION_STOP;");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_ACTION_TYPE_STATE_SET:
|
case EDJE_ACTION_TYPE_STATE_SET:
|
||||||
str = edje_edit_program_state_get(ed, pprogram);
|
str = edje_edit_program_state_get(ed, pprogram);
|
||||||
if (machine)
|
if (machine)
|
||||||
|
@ -1124,6 +1193,7 @@ program_details(Evas_Object *ed, const char *pprogram)
|
||||||
str, edje_edit_program_value_get(ed, pprogram));
|
str, edje_edit_program_value_get(ed, pprogram));
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_ACTION_TYPE_SIGNAL_EMIT:
|
case EDJE_ACTION_TYPE_SIGNAL_EMIT:
|
||||||
str = edje_edit_program_state_get(ed, pprogram);
|
str = edje_edit_program_state_get(ed, pprogram);
|
||||||
str2 = edje_edit_program_state2_get(ed, pprogram);
|
str2 = edje_edit_program_state2_get(ed, pprogram);
|
||||||
|
@ -1137,6 +1207,7 @@ program_details(Evas_Object *ed, const char *pprogram)
|
||||||
edje_edit_string_free(str);
|
edje_edit_string_free(str);
|
||||||
edje_edit_string_free(str2);
|
edje_edit_string_free(str2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//TODO Support Drag
|
//TODO Support Drag
|
||||||
//~ case EDJE_ACTION_TYPE_DRAG_VAL_SET:
|
//~ case EDJE_ACTION_TYPE_DRAG_VAL_SET:
|
||||||
//~ eina_strbuf_append(buf, I4"action: DRAG_VAL_SET TODO;\n");
|
//~ eina_strbuf_append(buf, I4"action: DRAG_VAL_SET TODO;\n");
|
||||||
|
@ -1373,22 +1444,28 @@ _comp_str_get(Evas_Object *ed, const char *img)
|
||||||
{
|
{
|
||||||
case EDJE_EDIT_IMAGE_COMP_RAW:
|
case EDJE_EDIT_IMAGE_COMP_RAW:
|
||||||
return "RAW";
|
return "RAW";
|
||||||
|
|
||||||
case EDJE_EDIT_IMAGE_COMP_USER:
|
case EDJE_EDIT_IMAGE_COMP_USER:
|
||||||
return "USER";
|
return "USER";
|
||||||
|
|
||||||
case EDJE_EDIT_IMAGE_COMP_COMP:
|
case EDJE_EDIT_IMAGE_COMP_COMP:
|
||||||
return "COMP";
|
return "COMP";
|
||||||
|
|
||||||
case EDJE_EDIT_IMAGE_COMP_LOSSY:
|
case EDJE_EDIT_IMAGE_COMP_LOSSY:
|
||||||
rate = edje_edit_image_compression_rate_get(ed, img);
|
rate = edje_edit_image_compression_rate_get(ed, img);
|
||||||
snprintf(buf, sizeof(buf), "LOSSY %d", rate);
|
snprintf(buf, sizeof(buf), "LOSSY %d", rate);
|
||||||
return buf;
|
return buf;
|
||||||
|
|
||||||
case EDJE_EDIT_IMAGE_COMP_LOSSY_ETC1:
|
case EDJE_EDIT_IMAGE_COMP_LOSSY_ETC1:
|
||||||
rate = edje_edit_image_compression_rate_get(ed, img);
|
rate = edje_edit_image_compression_rate_get(ed, img);
|
||||||
snprintf(buf, sizeof(buf), "LOSSY_ETC1 %d", rate);
|
snprintf(buf, sizeof(buf), "LOSSY_ETC1 %d", rate);
|
||||||
return buf;
|
return buf;
|
||||||
|
|
||||||
case EDJE_EDIT_IMAGE_COMP_LOSSY_ETC2:
|
case EDJE_EDIT_IMAGE_COMP_LOSSY_ETC2:
|
||||||
rate = edje_edit_image_compression_rate_get(ed, img);
|
rate = edje_edit_image_compression_rate_get(ed, img);
|
||||||
snprintf(buf, sizeof(buf), "LOSSY_ETC2 %d", rate);
|
snprintf(buf, sizeof(buf), "LOSSY_ETC2 %d", rate);
|
||||||
return buf;
|
return buf;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Unknown compression type %d", type);
|
ERR("Unknown compression type %d", type);
|
||||||
return "???";
|
return "???";
|
||||||
|
@ -1521,7 +1598,6 @@ _externals_list(void)
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -1570,7 +1646,8 @@ main(int argc, char **argv)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto error_getopt;
|
goto error_getopt;
|
||||||
}
|
}
|
||||||
else if (quit_option) goto error_getopt;
|
else if (quit_option)
|
||||||
|
goto error_getopt;
|
||||||
else if (arg_index != argc - 1)
|
else if (arg_index != argc - 1)
|
||||||
{
|
{
|
||||||
ERR("incorrect number of parameters. Requires one single file.");
|
ERR("incorrect number of parameters. Requires one single file.");
|
||||||
|
@ -1583,8 +1660,10 @@ main(int argc, char **argv)
|
||||||
if (detail_name)
|
if (detail_name)
|
||||||
{
|
{
|
||||||
if (!strcmp(detail_name, "none")) detail = 0;
|
if (!strcmp(detail_name, "none")) detail = 0;
|
||||||
else if (!strcmp(detail_name, "terse")) detail = 1;
|
else if (!strcmp(detail_name, "terse"))
|
||||||
else if (!strcmp(detail_name, "all")) detail = 2;
|
detail = 1;
|
||||||
|
else if (!strcmp(detail_name, "all"))
|
||||||
|
detail = 2;
|
||||||
else ERR("Unknown detail level: '%s'", detail_name);
|
else ERR("Unknown detail level: '%s'", detail_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1608,7 +1687,6 @@ main(int argc, char **argv)
|
||||||
program ? program : "",
|
program ? program : "",
|
||||||
api_only, api_fix, machine, file);
|
api_only, api_fix, machine, file);
|
||||||
|
|
||||||
|
|
||||||
groups = edje_file_collection_list(file);
|
groups = edje_file_collection_list(file);
|
||||||
if (!groups)
|
if (!groups)
|
||||||
{
|
{
|
||||||
|
@ -1629,19 +1707,23 @@ main(int argc, char **argv)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!strcmp(mode, "parts-names")) ret = _parts_names_list();
|
if (!strcmp(mode, "parts-names")) ret = _parts_names_list();
|
||||||
else if (!strcmp(mode, "global-data")) ret = _gdata_list();
|
else if (!strcmp(mode, "global-data"))
|
||||||
else if (!strcmp(mode, "images")) ret = _images_list();
|
ret = _gdata_list();
|
||||||
else if (!strcmp(mode, "fonts")) ret = _fonts_list();
|
else if (!strcmp(mode, "images"))
|
||||||
else if (!strcmp(mode, "externals")) ret = _externals_list();
|
ret = _images_list();
|
||||||
|
else if (!strcmp(mode, "fonts"))
|
||||||
|
ret = _fonts_list();
|
||||||
|
else if (!strcmp(mode, "externals"))
|
||||||
|
ret = _externals_list();
|
||||||
else ret = _list(mode);
|
else ret = _list(mode);
|
||||||
ecore_evas_free(ee);
|
ecore_evas_free(ee);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
edje_file_collection_list_free(groups);
|
edje_file_collection_list_free(groups);
|
||||||
error_getopt:
|
error_getopt:
|
||||||
eina_log_domain_unregister(_log_dom);
|
eina_log_domain_unregister(_log_dom);
|
||||||
error_log:
|
error_log:
|
||||||
edje_shutdown();
|
edje_shutdown();
|
||||||
ecore_evas_shutdown();
|
ecore_evas_shutdown();
|
||||||
ecore_shutdown();
|
ecore_shutdown();
|
||||||
|
@ -1649,3 +1731,4 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ Edje_Sound_Encode *
|
||||||
_edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double quality EINA_UNUSED)
|
_edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double quality EINA_UNUSED)
|
||||||
{
|
{
|
||||||
SF_INFO sfinfo;
|
SF_INFO sfinfo;
|
||||||
SNDFILE* sfile;
|
SNDFILE *sfile;
|
||||||
Edje_Sound_Encode *enc_info;
|
Edje_Sound_Encode *enc_info;
|
||||||
|
|
||||||
enc_info = calloc(1, sizeof(Edje_Sound_Encode));
|
enc_info = calloc(1, sizeof(Edje_Sound_Encode));
|
||||||
|
@ -24,13 +24,13 @@ _edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double
|
||||||
ERR("while allocating memory to load file ");
|
ERR("while allocating memory to load file ");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
memset (&sfinfo, 0, sizeof (SF_INFO));
|
memset(&sfinfo, 0, sizeof (SF_INFO));
|
||||||
|
|
||||||
enc_info->encoded = EINA_FALSE;
|
enc_info->encoded = EINA_FALSE;
|
||||||
enc_info->comp_type = "RAW PCM";
|
enc_info->comp_type = "RAW PCM";
|
||||||
|
|
||||||
// Open wav file using sndfile
|
// Open wav file using sndfile
|
||||||
sfile = sf_open (filename, SFM_READ, &sfinfo);
|
sfile = sf_open(filename, SFM_READ, &sfinfo);
|
||||||
if (!sfile)
|
if (!sfile)
|
||||||
{
|
{
|
||||||
ERR("Unable to open audio file: %s", filename);
|
ERR("Unable to open audio file: %s", filename);
|
||||||
|
@ -82,7 +82,7 @@ _edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBFLAC
|
#ifdef HAVE_LIBFLAC
|
||||||
const char*
|
const char *
|
||||||
_edje_multisense_encode_to_flac(char *snd_path, SF_INFO sfinfo)
|
_edje_multisense_encode_to_flac(char *snd_path, SF_INFO sfinfo)
|
||||||
{
|
{
|
||||||
unsigned int total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */
|
unsigned int total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */
|
||||||
|
@ -187,8 +187,9 @@ _edje_multisense_encode_to_flac(char *snd_path, SF_INFO sfinfo)
|
||||||
|
|
||||||
FLAC__stream_encoder_delete(encoder);
|
FLAC__stream_encoder_delete(encoder);
|
||||||
sf_close(sfile);
|
sf_close(sfile);
|
||||||
return (snd_path);
|
return snd_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_VORBIS
|
#ifdef HAVE_VORBIS
|
||||||
|
@ -293,7 +294,7 @@ _edje_multisense_encode_to_ogg_vorbis(char *snd_path, double quality, SF_INFO sf
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
for (ch = 0; ch < sfinfo.channels; ch++)
|
for (ch = 0; ch < sfinfo.channels; ch++)
|
||||||
buffer[ch][i]= readbuffer[(i * sfinfo.channels) + ch];
|
buffer[ch][i] = readbuffer[(i * sfinfo.channels) + ch];
|
||||||
}
|
}
|
||||||
vorbis_analysis_wrote(&vd, i);
|
vorbis_analysis_wrote(&vd, i);
|
||||||
}
|
}
|
||||||
|
@ -322,8 +323,9 @@ _edje_multisense_encode_to_ogg_vorbis(char *snd_path, double quality, SF_INFO sf
|
||||||
vorbis_comment_clear(&vc);
|
vorbis_comment_clear(&vc);
|
||||||
vorbis_info_clear(&vi);
|
vorbis_info_clear(&vi);
|
||||||
sf_close(sfile);
|
sf_close(sfile);
|
||||||
fclose (fout);
|
fclose(fout);
|
||||||
return snd_path;
|
return snd_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "edje_private.h"
|
#include "edje_private.h"
|
||||||
|
|
||||||
#define EDJE_PICK_HELP_STRING \
|
#define EDJE_PICK_HELP_STRING \
|
||||||
"\nEdje Pick - the \"edj\" merging tool.\n\
|
"\nEdje Pick - the \"edj\" merging tool.\n\
|
||||||
===================================\n\n\
|
===================================\n\n\
|
||||||
Use Edje Pick to compose a single edj file \
|
Use Edje Pick to compose a single edj file \
|
||||||
by selecting groups from edj files.\n\n\
|
by selecting groups from edj files.\n\n\
|
||||||
|
@ -75,7 +75,7 @@ typedef struct _Edje_Pick_File_Params Edje_Pick_File_Params;
|
||||||
struct _Edje_Pick_Data
|
struct _Edje_Pick_Data
|
||||||
{
|
{
|
||||||
const char *filename; /* Image, Sample File Name */
|
const char *filename; /* Image, Sample File Name */
|
||||||
void *entry ; /* used to build output file dir FIXME: REMOVE THIS */
|
void *entry; /* used to build output file dir FIXME: REMOVE THIS */
|
||||||
void *data; /* Data as taken from input file */
|
void *data; /* Data as taken from input file */
|
||||||
|
|
||||||
int size;
|
int size;
|
||||||
|
@ -112,7 +112,7 @@ static Edje_Pick context = { EINA_FALSE, NULL };
|
||||||
#define VERBOSE(COMMAND) if (context.v) { COMMAND; }
|
#define VERBOSE(COMMAND) if (context.v) { COMMAND; }
|
||||||
|
|
||||||
enum _Edje_Pick_Status
|
enum _Edje_Pick_Status
|
||||||
{
|
{
|
||||||
EDJE_PICK_NO_ERROR,
|
EDJE_PICK_NO_ERROR,
|
||||||
EDJE_PICK_OUT_FILENAME_MISSING,
|
EDJE_PICK_OUT_FILENAME_MISSING,
|
||||||
EDJE_PICK_FAILED_OPEN_INP,
|
EDJE_PICK_FAILED_OPEN_INP,
|
||||||
|
@ -125,7 +125,7 @@ enum _Edje_Pick_Status
|
||||||
EDJE_PICK_PARSE_FAILED,
|
EDJE_PICK_PARSE_FAILED,
|
||||||
EDJE_PICK_HELP_SHOWN,
|
EDJE_PICK_HELP_SHOWN,
|
||||||
EDJE_PICK_DUP_GROUP
|
EDJE_PICK_DUP_GROUP
|
||||||
};
|
};
|
||||||
typedef enum _Edje_Pick_Status Edje_Pick_Status;
|
typedef enum _Edje_Pick_Status Edje_Pick_Status;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -275,24 +275,31 @@ _edje_pick_cleanup(Eina_List *ifs, Edje_File *out_file, Edje_Pick_Status s)
|
||||||
case EDJE_PICK_OUT_FILENAME_MISSING:
|
case EDJE_PICK_OUT_FILENAME_MISSING:
|
||||||
EINA_LOG_ERR("Output file name missing.\n");
|
EINA_LOG_ERR("Output file name missing.\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_PICK_FAILED_OPEN_INP:
|
case EDJE_PICK_FAILED_OPEN_INP:
|
||||||
EINA_LOG_ERR("Failed to open input file.\n");
|
EINA_LOG_ERR("Failed to open input file.\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_PICK_FAILED_READ_INP:
|
case EDJE_PICK_FAILED_READ_INP:
|
||||||
EINA_LOG_ERR("Failed to read input file.\n");
|
EINA_LOG_ERR("Failed to read input file.\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_PICK_DUP_GROUP:
|
case EDJE_PICK_DUP_GROUP:
|
||||||
EINA_LOG_ERR("Can't fetch groups with identical name from various files.\n");
|
EINA_LOG_ERR("Can't fetch groups with identical name from various files.\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_PICK_INCLUDE_MISSING:
|
case EDJE_PICK_INCLUDE_MISSING:
|
||||||
EINA_LOG_ERR("Cannot select groups when no input file included.\n");
|
EINA_LOG_ERR("Cannot select groups when no input file included.\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_PICK_GROUP_MISSING:
|
case EDJE_PICK_GROUP_MISSING:
|
||||||
EINA_LOG_ERR("Group name missing for include file.\n");
|
EINA_LOG_ERR("Group name missing for include file.\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EDJE_PICK_PARSE_FAILED:
|
case EDJE_PICK_PARSE_FAILED:
|
||||||
EINA_LOG_ERR("Command parsing failed.\n");
|
EINA_LOG_ERR("Command parsing failed.\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -314,7 +321,7 @@ _group_name_in_other_file(Eina_List *inp_files, void *d1, void *d2)
|
||||||
EINA_LIST_FOREACH(inp_files, f, current_file)
|
EINA_LIST_FOREACH(inp_files, f, current_file)
|
||||||
if (inp_file != current_file)
|
if (inp_file != current_file)
|
||||||
if (eina_list_search_unsorted(current_file->groups,
|
if (eina_list_search_unsorted(current_file->groups,
|
||||||
(Eina_Compare_Cb) strcmp,
|
(Eina_Compare_Cb)strcmp,
|
||||||
group))
|
group))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -379,9 +386,9 @@ _edje_pick_command_line_parse(int argc, char **argv,
|
||||||
|
|
||||||
/* START - Read command line args */
|
/* START - Read command line args */
|
||||||
c = NULL;
|
c = NULL;
|
||||||
for(k = 1; k < argc; k++)
|
for (k = 1; k < argc; k++)
|
||||||
{ /* Run through args, count how many groups per file */
|
{ /* Run through args, count how many groups per file */
|
||||||
if(IS_GROUP(argv[k]))
|
if (IS_GROUP(argv[k]))
|
||||||
{
|
{
|
||||||
if (!c)
|
if (!c)
|
||||||
return _edje_pick_cleanup(files, NULL,
|
return _edje_pick_cleanup(files, NULL,
|
||||||
|
@ -391,7 +398,7 @@ _edje_pick_command_line_parse(int argc, char **argv,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IS_INCLUDE(argv[k]))
|
if (IS_INCLUDE(argv[k]))
|
||||||
{
|
{
|
||||||
c = calloc(1, sizeof(int));
|
c = calloc(1, sizeof(int));
|
||||||
gpf = eina_list_append(gpf, c);
|
gpf = eina_list_append(gpf, c);
|
||||||
|
@ -444,7 +451,7 @@ _edje_pick_command_line_parse(int argc, char **argv,
|
||||||
c = eina_list_data_get(ll);
|
c = eina_list_data_get(ll);
|
||||||
if (c)
|
if (c)
|
||||||
{
|
{
|
||||||
while(*c)
|
while (*c)
|
||||||
{
|
{
|
||||||
char *g_name;
|
char *g_name;
|
||||||
if (!cg)
|
if (!cg)
|
||||||
|
@ -458,13 +465,12 @@ _edje_pick_command_line_parse(int argc, char **argv,
|
||||||
EDJE_PICK_GROUP_MISSING);
|
EDJE_PICK_GROUP_MISSING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
g_name = eina_list_data_get(cg);
|
g_name = eina_list_data_get(cg);
|
||||||
if (_group_name_in_other_file(files, current_inp, g_name))
|
if (_group_name_in_other_file(files, current_inp, g_name))
|
||||||
return _edje_pick_cleanup(files, NULL, EDJE_PICK_DUP_GROUP);
|
return _edje_pick_cleanup(files, NULL, EDJE_PICK_DUP_GROUP);
|
||||||
|
|
||||||
if (!eina_list_search_unsorted(current_inp->groups,
|
if (!eina_list_search_unsorted(current_inp->groups,
|
||||||
(Eina_Compare_Cb) strcmp, g_name))
|
(Eina_Compare_Cb)strcmp, g_name))
|
||||||
current_inp->groups = eina_list_append(
|
current_inp->groups = eina_list_append(
|
||||||
current_inp->groups, eina_stringshare_add(g_name));
|
current_inp->groups, eina_stringshare_add(g_name));
|
||||||
|
|
||||||
|
@ -481,7 +487,6 @@ _edje_pick_command_line_parse(int argc, char **argv,
|
||||||
ecore_getopt_list_free(i_files);
|
ecore_getopt_list_free(i_files);
|
||||||
ecore_getopt_list_free(groups);
|
ecore_getopt_list_free(groups);
|
||||||
|
|
||||||
|
|
||||||
if (!output_filename)
|
if (!output_filename)
|
||||||
return _edje_pick_cleanup(files, NULL, EDJE_PICK_OUT_FILENAME_MISSING);
|
return _edje_pick_cleanup(files, NULL, EDJE_PICK_OUT_FILENAME_MISSING);
|
||||||
/* END - Read command line args */
|
/* END - Read command line args */
|
||||||
|
@ -679,7 +684,7 @@ exit:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_edje_pick_data_update(Edje_File *out_file , Edje_File *edf)
|
_edje_pick_data_update(Edje_File *out_file, Edje_File *edf)
|
||||||
{
|
{
|
||||||
Eina_Bool status = EDJE_PICK_NO_ERROR;
|
Eina_Bool status = EDJE_PICK_NO_ERROR;
|
||||||
Eina_Iterator *i;
|
Eina_Iterator *i;
|
||||||
|
@ -697,7 +702,7 @@ _edje_pick_data_update(Edje_File *out_file , Edje_File *edf)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
|
_edje_pick_header_make(Edje_File *out_file, Edje_File *edf, Eina_List *ifs)
|
||||||
{
|
{
|
||||||
static int current_group_id = 0;
|
static int current_group_id = 0;
|
||||||
Edje_Part_Collection_Directory_Entry *ce;
|
Edje_Part_Collection_Directory_Entry *ce;
|
||||||
|
@ -761,7 +766,7 @@ _edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(context.current_file->groups, l , name1)
|
EINA_LIST_FOREACH(context.current_file->groups, l, name1)
|
||||||
{
|
{
|
||||||
/* Verify group found then add to ouput file header */
|
/* Verify group found then add to ouput file header */
|
||||||
ce = eina_hash_find(edf->collection, name1);
|
ce = eina_hash_find(edf->collection, name1);
|
||||||
|
@ -786,7 +791,7 @@ _edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
|
||||||
EINA_LOG_INFO("Changing ID of group <%d> to <%d>\n", ce->id, ce_out->id);
|
EINA_LOG_INFO("Changing ID of group <%d> to <%d>\n", ce->id, ce_out->id);
|
||||||
current_group_id++;
|
current_group_id++;
|
||||||
|
|
||||||
eina_hash_direct_add(out_file->collection,ce_out->entry,
|
eina_hash_direct_add(out_file->collection, ce_out->entry,
|
||||||
ce_out);
|
ce_out);
|
||||||
dep_list = _edje_pick_header_dependencies_check(out_file, edf, context.current_file->groups, ce, ¤t_group_id);
|
dep_list = _edje_pick_header_dependencies_check(out_file, edf, context.current_file->groups, ce, ¤t_group_id);
|
||||||
if (!deps) deps = dep_list;
|
if (!deps) deps = dep_list;
|
||||||
|
@ -804,14 +809,14 @@ static int
|
||||||
_old_id_cmp(const void *d1, const void *d2)
|
_old_id_cmp(const void *d1, const void *d2)
|
||||||
{
|
{
|
||||||
/* Find currect ID struct */
|
/* Find currect ID struct */
|
||||||
return (((Edje_Pick_Data *) d1)->id.old_id - ((intptr_t) d2));
|
return ((Edje_Pick_Data *)d1)->id.old_id - ((intptr_t)d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_new_id_cmp(const void *d1, const void *d2)
|
_new_id_cmp(const void *d1, const void *d2)
|
||||||
{
|
{
|
||||||
/* Find currect ID struct */
|
/* Find currect ID struct */
|
||||||
return (((Edje_Pick_Data *) d1)->id.new_id - ((intptr_t) d2));
|
return ((Edje_Pick_Data *)d1)->id.new_id - ((intptr_t)d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -821,8 +826,7 @@ _edje_pick_new_id_get(Eina_List *id_list, int id, Eina_Bool set_used)
|
||||||
{
|
{
|
||||||
Edje_Pick_Data *p_id = eina_list_search_unsorted(id_list,
|
Edje_Pick_Data *p_id = eina_list_search_unsorted(id_list,
|
||||||
_old_id_cmp,
|
_old_id_cmp,
|
||||||
(void *) (intptr_t) id);
|
(void *)(intptr_t)id);
|
||||||
|
|
||||||
|
|
||||||
if (p_id)
|
if (p_id)
|
||||||
{
|
{
|
||||||
|
@ -843,7 +847,7 @@ _edje_pick_image_new_id_get(Eina_List *id_list, int id)
|
||||||
{
|
{
|
||||||
Edje_Pick_Data *p_id = eina_list_search_unsorted(id_list,
|
Edje_Pick_Data *p_id = eina_list_search_unsorted(id_list,
|
||||||
_old_id_cmp,
|
_old_id_cmp,
|
||||||
(void *) (intptr_t) id);
|
(void *)(intptr_t)id);
|
||||||
if (p_id) return p_id->id.new_id;
|
if (p_id) return p_id->id.new_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -857,7 +861,7 @@ _edje_pick_image_old_id_get(Eina_List *id_list, int id)
|
||||||
{
|
{
|
||||||
Edje_Pick_Data *p_id = eina_list_search_unsorted(id_list,
|
Edje_Pick_Data *p_id = eina_list_search_unsorted(id_list,
|
||||||
_new_id_cmp,
|
_new_id_cmp,
|
||||||
(void *) (intptr_t) id);
|
(void *)(intptr_t)id);
|
||||||
if (p_id) return p_id->id.old_id;
|
if (p_id) return p_id->id.old_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -874,8 +878,8 @@ _edje_pick_images_copy(Edje_File *edf, Edje_File *o)
|
||||||
|
|
||||||
if (edf->image_dir)
|
if (edf->image_dir)
|
||||||
{
|
{
|
||||||
if (edf->image_dir->entries)
|
if (edf->image_dir->entries) /* Copy image dir entries of current file */
|
||||||
{ /* Copy image dir entries of current file */
|
{
|
||||||
Edje_Image_Directory_Entry *entries = NULL;
|
Edje_Image_Directory_Entry *entries = NULL;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(context.current_file->imagelist, l, image)
|
EINA_LIST_FOREACH(context.current_file->imagelist, l, image)
|
||||||
|
@ -906,8 +910,8 @@ _edje_pick_images_copy(Edje_File *edf, Edje_File *o)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edf->image_dir->sets)
|
if (edf->image_dir->sets) /* Copy image dir sets of current file */
|
||||||
{ /* Copy image dir sets of current file */
|
{
|
||||||
Edje_Image_Directory_Set *sets;
|
Edje_Image_Directory_Set *sets;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(context.current_file->imagesetlist, l, set)
|
EINA_LIST_FOREACH(context.current_file->imagesetlist, l, set)
|
||||||
|
@ -944,8 +948,8 @@ _edje_pick_images_copy(Edje_File *edf, Edje_File *o)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edf->image_dir->vectors)
|
if (edf->image_dir->vectors) /* Copy vector dir entries of current file */
|
||||||
{ /* Copy vector dir entries of current file */
|
{
|
||||||
Edje_Vector_Directory_Entry *vectors = NULL;
|
Edje_Vector_Directory_Entry *vectors = NULL;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(context.current_file->vectorlist, l, vector)
|
EINA_LIST_FOREACH(context.current_file->vectorlist, l, vector)
|
||||||
|
@ -991,7 +995,7 @@ _edje_pick_sounds_add(Edje_File *edf)
|
||||||
|
|
||||||
if (edf->sound_dir) /* Copy Sounds */
|
if (edf->sound_dir) /* Copy Sounds */
|
||||||
{
|
{
|
||||||
for (k = 0; k < (int) edf->sound_dir->samples_count; k++)
|
for (k = 0; k < (int)edf->sound_dir->samples_count; k++)
|
||||||
{
|
{
|
||||||
Edje_Sound_Sample *sample = &edf->sound_dir->samples[k];
|
Edje_Sound_Sample *sample = &edf->sound_dir->samples[k];
|
||||||
|
|
||||||
|
@ -1005,7 +1009,7 @@ _edje_pick_sounds_add(Edje_File *edf)
|
||||||
smpl->filename = eina_stringshare_add(sample->snd_src);
|
smpl->filename = eina_stringshare_add(sample->snd_src);
|
||||||
smpl->data = data;
|
smpl->data = data;
|
||||||
smpl->size = size;
|
smpl->size = size;
|
||||||
smpl->entry = (void *) sample; /* for output file sound dir */
|
smpl->entry = (void *)sample; /* for output file sound dir */
|
||||||
smpl->id.old_id = sample->id;
|
smpl->id.old_id = sample->id;
|
||||||
sample->id = smpl->id.new_id = current_sample_id;
|
sample->id = smpl->id.new_id = current_sample_id;
|
||||||
smpl->id.used = EINA_FALSE;
|
smpl->id.used = EINA_FALSE;
|
||||||
|
@ -1027,7 +1031,7 @@ _edje_pick_sounds_add(Edje_File *edf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (k = 0; k < (int) edf->sound_dir->tones_count; k++)
|
for (k = 0; k < (int)edf->sound_dir->tones_count; k++)
|
||||||
{
|
{
|
||||||
/* Save all tones as well */
|
/* Save all tones as well */
|
||||||
Edje_Pick_Tone *t = malloc(sizeof(*t));
|
Edje_Pick_Tone *t = malloc(sizeof(*t));
|
||||||
|
@ -1056,7 +1060,7 @@ _edje_pick_vibrations_add(Edje_File *edf)
|
||||||
|
|
||||||
if (edf->vibration_dir) /* Copy Sounds */
|
if (edf->vibration_dir) /* Copy Sounds */
|
||||||
{
|
{
|
||||||
for (k = 0; k < (int) edf->vibration_dir->samples_count; k++)
|
for (k = 0; k < (int)edf->vibration_dir->samples_count; k++)
|
||||||
{
|
{
|
||||||
Edje_Vibration_Sample *sample = &edf->vibration_dir->samples[k];
|
Edje_Vibration_Sample *sample = &edf->vibration_dir->samples[k];
|
||||||
|
|
||||||
|
@ -1070,7 +1074,7 @@ _edje_pick_vibrations_add(Edje_File *edf)
|
||||||
smpl->filename = eina_stringshare_add(sample->name);
|
smpl->filename = eina_stringshare_add(sample->name);
|
||||||
smpl->data = data;
|
smpl->data = data;
|
||||||
smpl->size = size;
|
smpl->size = size;
|
||||||
smpl->entry = (void *) sample; /* for output file vibration dir */
|
smpl->entry = (void *)sample; /* for output file vibration dir */
|
||||||
smpl->id.old_id = sample->id;
|
smpl->id.old_id = sample->id;
|
||||||
sample->id = smpl->id.new_id = current_sample_id;
|
sample->id = smpl->id.new_id = current_sample_id;
|
||||||
smpl->id.used = EINA_FALSE;
|
smpl->id.used = EINA_FALSE;
|
||||||
|
@ -1103,8 +1107,8 @@ _font_cmp(const void *d1, const void *d2)
|
||||||
const Edje_Font *f2 = d2;
|
const Edje_Font *f2 = d2;
|
||||||
|
|
||||||
/* Same font if (d1->name == d2->name) AND (d1->file == d2->file) */
|
/* Same font if (d1->name == d2->name) AND (d1->file == d2->file) */
|
||||||
return (strcmp(f1->name, f2->name) |
|
return strcmp(f1->name, f2->name) |
|
||||||
strcmp(f1->file, f2->file));
|
strcmp(f1->file, f2->file);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1128,8 +1132,8 @@ _Edje_Pick_Fonts_add(Edje_File *out_file, Edje_File *edf)
|
||||||
Edje_Font *st = malloc(sizeof(*st));
|
Edje_Font *st = malloc(sizeof(*st));
|
||||||
ft->size = 0;
|
ft->size = 0;
|
||||||
|
|
||||||
st->name = (char *) eina_stringshare_add(f->name);
|
st->name = (char *)eina_stringshare_add(f->name);
|
||||||
st->file = (char *) eina_stringshare_add(f->file);
|
st->file = (char *)eina_stringshare_add(f->file);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "edje/fonts/%s", f->name);
|
snprintf(buf, sizeof(buf), "edje/fonts/%s", f->name);
|
||||||
VERBOSE(EINA_LOG_INFO("Trying to read <%s>\n", f->name));
|
VERBOSE(EINA_LOG_INFO("Trying to read <%s>\n", f->name));
|
||||||
|
@ -1148,7 +1152,7 @@ _Edje_Pick_Fonts_add(Edje_File *out_file, Edje_File *edf)
|
||||||
ft->used = EINA_TRUE; /* TODO: Fix this later */
|
ft->used = EINA_TRUE; /* TODO: Fix this later */
|
||||||
context.current_file->fontlist = eina_list_append(context.current_file->fontlist, ft);
|
context.current_file->fontlist = eina_list_append(context.current_file->fontlist, ft);
|
||||||
eina_hash_direct_add(out_file->fonts, st->name, st);
|
eina_hash_direct_add(out_file->fonts, st->name, st);
|
||||||
};
|
}
|
||||||
|
|
||||||
eina_iterator_free(it);
|
eina_iterator_free(it);
|
||||||
|
|
||||||
|
@ -1237,22 +1241,22 @@ _edje_pick_image_entry_add(int id, Edje_File *edf, Edje_File *o)
|
||||||
if (!o->image_dir) /* First time only */
|
if (!o->image_dir) /* First time only */
|
||||||
o->image_dir = calloc(1, sizeof(*(o->image_dir)));
|
o->image_dir = calloc(1, sizeof(*(o->image_dir)));
|
||||||
|
|
||||||
if (edf->image_dir->entries)
|
if (edf->image_dir->entries) /* Copy Images */
|
||||||
{ /* Copy Images */
|
{
|
||||||
Edje_Image_Directory_Entry *img = &edf->image_dir->entries[id];
|
Edje_Image_Directory_Entry *img = &edf->image_dir->entries[id];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "edje/images/%i", img->id);
|
snprintf(buf, sizeof(buf), "edje/images/%i", img->id);
|
||||||
VERBOSE(EINA_LOG_INFO("Trying to read <%s>\n", img->entry));
|
VERBOSE(EINA_LOG_INFO("Trying to read <%s>\n", img->entry));
|
||||||
data = eet_read(edf->ef, buf, &size);
|
data = eet_read(edf->ef, buf, &size);
|
||||||
if (size)
|
if (size) /* Advance image ID and register this in imagelist */
|
||||||
{ /* Advance image ID and register this in imagelist */
|
{
|
||||||
current_img_id++;
|
current_img_id++;
|
||||||
Edje_Pick_Data *image = malloc(sizeof(*image));
|
Edje_Pick_Data *image = malloc(sizeof(*image));
|
||||||
|
|
||||||
image->filename = eina_stringshare_add(img->entry);
|
image->filename = eina_stringshare_add(img->entry);
|
||||||
image->data = data;
|
image->data = data;
|
||||||
image->size = size;
|
image->size = size;
|
||||||
image->entry = (void *) img; /* for output file image dir */
|
image->entry = (void *)img; /* for output file image dir */
|
||||||
image->id.old_id = img->id;
|
image->id.old_id = img->id;
|
||||||
img->id = image->id.new_id = current_img_id;
|
img->id = image->id.new_id = current_img_id;
|
||||||
image->id.used = EINA_TRUE;
|
image->id.used = EINA_TRUE;
|
||||||
|
@ -1268,11 +1272,11 @@ _edje_pick_image_entry_add(int id, Edje_File *edf, Edje_File *o)
|
||||||
if (img->entry)
|
if (img->entry)
|
||||||
{
|
{
|
||||||
EINA_LOG_ERR("Image <%s> was not found in <%s> file.\n",
|
EINA_LOG_ERR("Image <%s> was not found in <%s> file.\n",
|
||||||
img->entry , context.current_file->name);
|
img->entry, context.current_file->name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EINA_LOG_ERR("Image entry <%s> was not found in <%s> file.\n", buf , context.current_file->name);
|
EINA_LOG_ERR("Image entry <%s> was not found in <%s> file.\n", buf, context.current_file->name);
|
||||||
}
|
}
|
||||||
/* Should that really be freed? Or is some other handling needed? */
|
/* Should that really be freed? Or is some other handling needed? */
|
||||||
free(data);
|
free(data);
|
||||||
|
@ -1298,8 +1302,8 @@ _edje_pick_image_set_add(int id, Edje_File *edf, Edje_File *o)
|
||||||
if (!o->image_dir) /* First time only */
|
if (!o->image_dir) /* First time only */
|
||||||
o->image_dir = calloc(1, sizeof(*(o->image_dir)));
|
o->image_dir = calloc(1, sizeof(*(o->image_dir)));
|
||||||
|
|
||||||
if (edf->image_dir->sets)
|
if (edf->image_dir->sets) /* Fix IDs in sets to new assigned IDs of entries */
|
||||||
{ /* Fix IDs in sets to new assigned IDs of entries */
|
{
|
||||||
current_set_id++;
|
current_set_id++;
|
||||||
Edje_Pick_Data *set = calloc(1, sizeof(*set));
|
Edje_Pick_Data *set = calloc(1, sizeof(*set));
|
||||||
set->id.old_id = edf->image_dir->sets[id].id;
|
set->id.old_id = edf->image_dir->sets[id].id;
|
||||||
|
@ -1335,22 +1339,22 @@ _edje_pick_vector_entry_add(int id, Edje_File *edf, Edje_File *o)
|
||||||
if (!o->image_dir) /* First time only */
|
if (!o->image_dir) /* First time only */
|
||||||
o->image_dir = calloc(1, sizeof(*(o->image_dir)));
|
o->image_dir = calloc(1, sizeof(*(o->image_dir)));
|
||||||
|
|
||||||
if (edf->image_dir->vectors)
|
if (edf->image_dir->vectors) /* Copy Vectors */
|
||||||
{ /* Copy Vectors */
|
{
|
||||||
Edje_Vector_Directory_Entry *vg = &edf->image_dir->vectors[id];
|
Edje_Vector_Directory_Entry *vg = &edf->image_dir->vectors[id];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "edje/vectors/%i", vg->id);
|
snprintf(buf, sizeof(buf), "edje/vectors/%i", vg->id);
|
||||||
VERBOSE(EINA_LOG_INFO("Trying to read <%s>\n", vg->entry));
|
VERBOSE(EINA_LOG_INFO("Trying to read <%s>\n", vg->entry));
|
||||||
data = eet_read(edf->ef, buf, &size);
|
data = eet_read(edf->ef, buf, &size);
|
||||||
if (size)
|
if (size) /* Advance vector ID and register this in vectorlist */
|
||||||
{ /* Advance vector ID and register this in vectorlist */
|
{
|
||||||
current_vg_id++;
|
current_vg_id++;
|
||||||
Edje_Pick_Data *vector = malloc(sizeof(*vector));
|
Edje_Pick_Data *vector = malloc(sizeof(*vector));
|
||||||
|
|
||||||
vector->filename = eina_stringshare_add(vg->entry);
|
vector->filename = eina_stringshare_add(vg->entry);
|
||||||
vector->data = data;
|
vector->data = data;
|
||||||
vector->size = size;
|
vector->size = size;
|
||||||
vector->entry = (void *) vg; /* for output file vector dir */
|
vector->entry = (void *)vg; /* for output file vector dir */
|
||||||
vector->id.old_id = vg->id;
|
vector->id.old_id = vg->id;
|
||||||
vg->id = vector->id.new_id = current_vg_id;
|
vg->id = vector->id.new_id = current_vg_id;
|
||||||
vector->id.used = EINA_TRUE;
|
vector->id.used = EINA_TRUE;
|
||||||
|
@ -1366,11 +1370,11 @@ _edje_pick_vector_entry_add(int id, Edje_File *edf, Edje_File *o)
|
||||||
if (vg->entry)
|
if (vg->entry)
|
||||||
{
|
{
|
||||||
EINA_LOG_ERR("Vector <%s> was not found in <%s> file.\n",
|
EINA_LOG_ERR("Vector <%s> was not found in <%s> file.\n",
|
||||||
vg->entry , context.current_file->name);
|
vg->entry, context.current_file->name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EINA_LOG_ERR("Vector entry <%s> was not found in <%s> file.\n", buf , context.current_file->name);
|
EINA_LOG_ERR("Vector entry <%s> was not found in <%s> file.\n", buf, context.current_file->name);
|
||||||
}
|
}
|
||||||
/* Should that really be freed? Or is some other handling needed? */
|
/* Should that really be freed? Or is some other handling needed? */
|
||||||
free(data);
|
free(data);
|
||||||
|
@ -1470,34 +1474,34 @@ _edje_pick_resources_process(Edje_Part_Collection *edc, Edje_File *edf, Edje_Fil
|
||||||
Edje_Part *part = edc->parts[i];
|
Edje_Part *part = edc->parts[i];
|
||||||
|
|
||||||
/* Update all color class in ALL descs of this part */
|
/* Update all color class in ALL descs of this part */
|
||||||
_edje_pick_color_class_desc_update((Edje_Part_Description_Common *) part->default_desc, edf, o);
|
_edje_pick_color_class_desc_update((Edje_Part_Description_Common *)part->default_desc, edf, o);
|
||||||
|
|
||||||
for (k = 0; k < part->other.desc_count; k++)
|
for (k = 0; k < part->other.desc_count; k++)
|
||||||
_edje_pick_color_class_desc_update((Edje_Part_Description_Common *) part->other.desc[k], edf, o);
|
_edje_pick_color_class_desc_update((Edje_Part_Description_Common *)part->other.desc[k], edf, o);
|
||||||
|
|
||||||
if (part->type == EDJE_PART_TYPE_IMAGE)
|
if (part->type == EDJE_PART_TYPE_IMAGE)
|
||||||
{
|
{
|
||||||
/* Update IDs of all images in ALL descs of this part */
|
/* Update IDs of all images in ALL descs of this part */
|
||||||
_edje_pick_images_desc_update((Edje_Part_Description_Image *) part->default_desc, edf, o);
|
_edje_pick_images_desc_update((Edje_Part_Description_Image *)part->default_desc, edf, o);
|
||||||
|
|
||||||
for (k = 0; k < part->other.desc_count; k++)
|
for (k = 0; k < part->other.desc_count; k++)
|
||||||
_edje_pick_images_desc_update((Edje_Part_Description_Image *) part->other.desc[k], edf, o);
|
_edje_pick_images_desc_update((Edje_Part_Description_Image *)part->other.desc[k], edf, o);
|
||||||
}
|
}
|
||||||
else if (part->type == EDJE_PART_TYPE_VECTOR)
|
else if (part->type == EDJE_PART_TYPE_VECTOR)
|
||||||
{
|
{
|
||||||
/* Update IDs of all vectors in ALL descs of this part */
|
/* Update IDs of all vectors in ALL descs of this part */
|
||||||
_edje_pick_vectors_desc_update((Edje_Part_Description_Vector *) part->default_desc, edf, o);
|
_edje_pick_vectors_desc_update((Edje_Part_Description_Vector *)part->default_desc, edf, o);
|
||||||
|
|
||||||
for (k = 0; k < part->other.desc_count; k++)
|
for (k = 0; k < part->other.desc_count; k++)
|
||||||
_edje_pick_vectors_desc_update((Edje_Part_Description_Vector *) part->other.desc[k], edf, o);
|
_edje_pick_vectors_desc_update((Edje_Part_Description_Vector *)part->other.desc[k], edf, o);
|
||||||
}
|
}
|
||||||
else if (part->type == EDJE_PART_TYPE_TEXT || part->type == EDJE_PART_TYPE_TEXTBLOCK)
|
else if (part->type == EDJE_PART_TYPE_TEXT || part->type == EDJE_PART_TYPE_TEXTBLOCK)
|
||||||
{
|
{
|
||||||
/* Update all styles in ALL descs of this part */
|
/* Update all styles in ALL descs of this part */
|
||||||
_edje_pick_styles_desc_update((Edje_Part_Description_Text *) part->default_desc, edf, o);
|
_edje_pick_styles_desc_update((Edje_Part_Description_Text *)part->default_desc, edf, o);
|
||||||
|
|
||||||
for (k = 0; k < part->other.desc_count; k++)
|
for (k = 0; k < part->other.desc_count; k++)
|
||||||
_edje_pick_styles_desc_update((Edje_Part_Description_Text *) part->other.desc[k], edf, o);
|
_edje_pick_styles_desc_update((Edje_Part_Description_Text *)part->other.desc[k], edf, o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1508,7 +1512,7 @@ _sample_cmp(const void *d1, const void *d2)
|
||||||
/* Locate sample by name */
|
/* Locate sample by name */
|
||||||
if (d2)
|
if (d2)
|
||||||
{
|
{
|
||||||
Edje_Sound_Sample *sample = ((Edje_Pick_Data *) d1)->entry;
|
Edje_Sound_Sample *sample = ((Edje_Pick_Data *)d1)->entry;
|
||||||
|
|
||||||
return strcmp(sample->name, d2);
|
return strcmp(sample->name, d2);
|
||||||
}
|
}
|
||||||
|
@ -1522,7 +1526,7 @@ _tone_cmp(const void *d1, const void *d2)
|
||||||
/* Locate tone by name */
|
/* Locate tone by name */
|
||||||
if (d2)
|
if (d2)
|
||||||
{
|
{
|
||||||
Edje_Sound_Tone *tone = ((Edje_Pick_Tone *) d1)->tone;
|
Edje_Sound_Tone *tone = ((Edje_Pick_Tone *)d1)->tone;
|
||||||
|
|
||||||
return strcmp(tone->name, d2);
|
return strcmp(tone->name, d2);
|
||||||
}
|
}
|
||||||
|
@ -1538,7 +1542,7 @@ _edje_pick_program_update(Edje_Program *prog)
|
||||||
|
|
||||||
/* Scan for used samples, update samples IDs */
|
/* Scan for used samples, update samples IDs */
|
||||||
p = eina_list_search_unsorted(context.current_file->samplelist,
|
p = eina_list_search_unsorted(context.current_file->samplelist,
|
||||||
(Eina_Compare_Cb) _sample_cmp,
|
(Eina_Compare_Cb)_sample_cmp,
|
||||||
prog->sample_name);
|
prog->sample_name);
|
||||||
|
|
||||||
/* Sample is used by program, should be saved */
|
/* Sample is used by program, should be saved */
|
||||||
|
@ -1547,7 +1551,7 @@ _edje_pick_program_update(Edje_Program *prog)
|
||||||
|
|
||||||
/* handle tones as well */
|
/* handle tones as well */
|
||||||
t = eina_list_search_unsorted(context.current_file->tonelist,
|
t = eina_list_search_unsorted(context.current_file->tonelist,
|
||||||
(Eina_Compare_Cb) _tone_cmp,
|
(Eina_Compare_Cb)_tone_cmp,
|
||||||
prog->tone_name);
|
prog->tone_name);
|
||||||
|
|
||||||
/* Tone is used by program, should be saved */
|
/* Tone is used by program, should be saved */
|
||||||
|
@ -1561,19 +1565,19 @@ _edje_pick_programs_process(Edje_Part_Collection *edc)
|
||||||
/* This wil mark which samples are used and should be saved */
|
/* This wil mark which samples are used and should be saved */
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for(i = 0; i < edc->programs.fnmatch_count; i++)
|
for (i = 0; i < edc->programs.fnmatch_count; i++)
|
||||||
_edje_pick_program_update(edc->programs.fnmatch[i]);
|
_edje_pick_program_update(edc->programs.fnmatch[i]);
|
||||||
|
|
||||||
for(i = 0; i < edc->programs.strcmp_count; i++)
|
for (i = 0; i < edc->programs.strcmp_count; i++)
|
||||||
_edje_pick_program_update(edc->programs.strcmp[i]);
|
_edje_pick_program_update(edc->programs.strcmp[i]);
|
||||||
|
|
||||||
for(i = 0; i < edc->programs.strncmp_count; i++)
|
for (i = 0; i < edc->programs.strncmp_count; i++)
|
||||||
_edje_pick_program_update(edc->programs.strncmp[i]);
|
_edje_pick_program_update(edc->programs.strncmp[i]);
|
||||||
|
|
||||||
for(i = 0; i < edc->programs.strrncmp_count; i++)
|
for (i = 0; i < edc->programs.strrncmp_count; i++)
|
||||||
_edje_pick_program_update(edc->programs.strrncmp[i]);
|
_edje_pick_program_update(edc->programs.strrncmp[i]);
|
||||||
|
|
||||||
for(i = 0; i < edc->programs.nocmp_count; i++)
|
for (i = 0; i < edc->programs.nocmp_count; i++)
|
||||||
_edje_pick_program_update(edc->programs.nocmp[i]);
|
_edje_pick_program_update(edc->programs.nocmp[i]);
|
||||||
|
|
||||||
return EDJE_PICK_NO_ERROR;
|
return EDJE_PICK_NO_ERROR;
|
||||||
|
@ -1734,7 +1738,7 @@ main(int argc, char **argv)
|
||||||
_edje_pick_data_update(out_file, edf);
|
_edje_pick_data_update(out_file, edf);
|
||||||
|
|
||||||
/* Process Groups */
|
/* Process Groups */
|
||||||
EINA_LIST_FOREACH(context.current_file->groups, l , name1)
|
EINA_LIST_FOREACH(context.current_file->groups, l, name1)
|
||||||
{ /* Read group info */
|
{ /* Read group info */
|
||||||
ce = eina_hash_find(edf->collection, name1);
|
ce = eina_hash_find(edf->collection, name1);
|
||||||
if (!ce || (ce->id < 0))
|
if (!ce || (ce->id < 0))
|
||||||
|
@ -1774,7 +1778,7 @@ main(int argc, char **argv)
|
||||||
bytes = eet_data_write(out_file->ef,
|
bytes = eet_data_write(out_file->ef,
|
||||||
_edje_edd_edje_part_collection,
|
_edje_edd_edje_part_collection,
|
||||||
buf, edc, comp_mode);
|
buf, edc, comp_mode);
|
||||||
EINA_LOG_INFO("Wrote <%d> bytes for group <%s>\n", bytes,buf);
|
EINA_LOG_INFO("Wrote <%d> bytes for group <%s>\n", bytes, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(edc);
|
free(edc);
|
||||||
|
@ -1852,8 +1856,8 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
EINA_LIST_FOREACH(context.current_file->samplelist, l, s)
|
EINA_LIST_FOREACH(context.current_file->samplelist, l, s)
|
||||||
{
|
{
|
||||||
if (context.current_file->append || s->id.used)
|
if (context.current_file->append || s->id.used) /* Write only used samples */
|
||||||
{ /* Write only used samples */
|
{
|
||||||
samples = eina_list_append(samples, s->entry);
|
samples = eina_list_append(samples, s->entry);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "edje/sounds/%i",
|
snprintf(buf, sizeof(buf), "edje/sounds/%i",
|
||||||
|
@ -1873,14 +1877,14 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
EINA_LIST_FOREACH(context.current_file->vibrationlist, l, s)
|
EINA_LIST_FOREACH(context.current_file->vibrationlist, l, s)
|
||||||
{
|
{
|
||||||
if (context.current_file->append || s->id.used)
|
if (context.current_file->append || s->id.used) /* Write only used vibrations */
|
||||||
{ /* Write only used vibrations */
|
{
|
||||||
vibrations = eina_list_append(vibrations, s->entry);
|
vibrations = eina_list_append(vibrations, s->entry);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "edje/vibrations/%i",
|
snprintf(buf, sizeof(buf), "edje/vibrations/%i",
|
||||||
s->id.new_id);
|
s->id.new_id);
|
||||||
eet_write(out_file->ef, buf,
|
eet_write(out_file->ef, buf,
|
||||||
s->data, s->size,EINA_TRUE);
|
s->data, s->size, EINA_TRUE);
|
||||||
VERBOSE(EINA_LOG_INFO("Wrote <%s> vibration data <%p> size <%d>\n",
|
VERBOSE(EINA_LOG_INFO("Wrote <%s> vibration data <%p> size <%d>\n",
|
||||||
buf, s->data, s->size));
|
buf, s->data, s->size));
|
||||||
}
|
}
|
||||||
|
@ -1907,3 +1911,4 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
return _edje_pick_cleanup(inp_files, out_file, EDJE_PICK_NO_ERROR);
|
return _edje_pick_cleanup(inp_files, out_file, EDJE_PICK_NO_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -590,6 +590,7 @@ _slave_mode(void *data, Ecore_Fd_Handler *fd_handler)
|
||||||
|
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1124,9 +1125,9 @@ main(int argc, char **argv)
|
||||||
f = eina_file_open(opts.file, EINA_FALSE);
|
f = eina_file_open(opts.file, EINA_FALSE);
|
||||||
if (edje_mmap_3d_has(f, group))
|
if (edje_mmap_3d_has(f, group))
|
||||||
{
|
{
|
||||||
Eina_List* engine_list, *n;
|
Eina_List *engine_list, *n;
|
||||||
Eina_Bool opengl_x11_has = EINA_FALSE, wayland_egl_has = EINA_FALSE;
|
Eina_Bool opengl_x11_has = EINA_FALSE, wayland_egl_has = EINA_FALSE;
|
||||||
const char* engine;
|
const char *engine;
|
||||||
engine_list = ecore_evas_engines_get();
|
engine_list = ecore_evas_engines_get();
|
||||||
EINA_LIST_FOREACH(engine_list, n, engine)
|
EINA_LIST_FOREACH(engine_list, n, engine)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@ read_watch_file(const char *file)
|
||||||
const char *path;
|
const char *path;
|
||||||
Eina_Bool do_append = EINA_TRUE;
|
Eina_Bool do_append = EINA_TRUE;
|
||||||
|
|
||||||
if (ln->length < 4) continue ;
|
if (ln->length < 4) continue;
|
||||||
if (anotate)
|
if (anotate)
|
||||||
{
|
{
|
||||||
path = eina_stringshare_add_length(ln->start + 3, ln->length - 3);
|
path = eina_stringshare_add_length(ln->start + 3, ln->length - 3);
|
||||||
|
@ -65,7 +65,7 @@ read_watch_file(const char *file)
|
||||||
eio_monitor_del(mon);
|
eio_monitor_del(mon);
|
||||||
watching = r;
|
watching = r;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
eina_file_close(f);
|
eina_file_close(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,3 +150,4 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue