summaryrefslogtreecommitdiff
path: root/src/bin/edje/edje_convert_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/edje/edje_convert_main.c')
-rw-r--r--src/bin/edje/edje_convert_main.c105
1 files changed, 53 insertions, 52 deletions
diff --git a/src/bin/edje/edje_convert_main.c b/src/bin/edje/edje_convert_main.c
index 97a96d8763..6cdd5783f9 100644
--- a/src/bin/edje/edje_convert_main.c
+++ b/src/bin/edje/edje_convert_main.c
@@ -39,7 +39,7 @@ main_help(void)
("Usage:\n"
"\t%s file.edj\n"
"\n"
- ,progname);
+ , progname);
}
static void
@@ -57,17 +57,17 @@ _edje_alias_int(const char *target, Eet_File *ef, const char *base, const char *
strcat(buf, "%i");
for (i = 0; i < count && match; ++i)
{
- char name[1024];
- int id;
+ char name[1024];
+ int id;
- if (sscanf(match[i], buf, &id) != 1)
- {
- EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
- continue ;
- }
+ if (sscanf(match[i], buf, &id) != 1)
+ {
+ EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
+ continue;
+ }
- snprintf(name, sizeof (name), "%s/%i", to, id);
- eet_alias(ef, name, match[i], 1);
+ snprintf(name, sizeof (name), "%s/%i", to, id);
+ eet_alias(ef, name, match[i], 1);
}
free(match);
}
@@ -87,17 +87,17 @@ _edje_alias_string(const char *target, Eet_File *ef, const char *base, const cha
strcat(buf, "%s");
for (i = 0; i < count && match; ++i)
{
- char name[1024];
- char id[1024];
+ char name[1024];
+ char id[1024];
- if (sscanf(match[i], buf, &id) != 1)
- {
- EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
- continue ;
- }
+ if (sscanf(match[i], buf, &id) != 1)
+ {
+ EINA_LOG_ERR("Wrong fonts section `%s' in `%s'. Discarding it.", match[i], target);
+ continue;
+ }
- snprintf(name, sizeof (name), "%s/%s", to, id);
- eet_alias(ef, name, match[i], 1);
+ snprintf(name, sizeof (name), "%s/%s", to, id);
+ eet_alias(ef, name, match[i], 1);
}
free(match);
}
@@ -119,11 +119,11 @@ main(int argc, char **argv)
return -1;
_edje_cc_log_dom = eina_log_domain_register
- ("edje_convert", EDJE_CC_DEFAULT_LOG_COLOR);
+ ("edje_convert", EDJE_CC_DEFAULT_LOG_COLOR);
if (_edje_cc_log_dom < 0)
{
- EINA_LOG_ERR("Enable to create a log domain.");
- exit(-1);
+ EINA_LOG_ERR("Enable to create a log domain.");
+ exit(-1);
}
eet_init();
@@ -131,8 +131,8 @@ main(int argc, char **argv)
progname = argv[0];
if (argc > 2 || argc < 2 || !strcmp(argv[1], "-h"))
{
- main_help();
- return 0;
+ main_help();
+ return 0;
}
_edje_edd_old_init();
@@ -141,15 +141,15 @@ main(int argc, char **argv)
ef = eet_open(argv[1], EET_FILE_MODE_READ_WRITE);
if (!ef)
{
- EINA_LOG_ERR("Unable to open `%s'.", argv[1]);
- return -1;
+ EINA_LOG_ERR("Unable to open `%s'.", argv[1]);
+ return -1;
}
oef = eet_data_read(ef, _edje_edd_old_edje_file, "edje_file");
if (!oef)
{
- EINA_LOG_ERR("Unable to get edje_file section from old file format, are you sure it's an old file ?");
- return -1;
+ EINA_LOG_ERR("Unable to get edje_file section from old file format, are you sure it's an old file ?");
+ return -1;
}
nef = _edje_file_convert(ef, oef);
@@ -160,34 +160,34 @@ main(int argc, char **argv)
EINA_ITERATOR_FOREACH(it, ce)
{
- Old_Edje_Part_Collection *opc;
- Edje_Part_Collection *npc;
- char buf[1024];
- int bytes = 0;
-
- snprintf(buf, sizeof (buf), "collections/%i", ce->id);
- opc = eet_data_read(ef, _edje_edd_old_edje_part_collection, buf);
- if (!opc)
- {
- EINA_LOG_ERR("Unable to find collection `%s'[%i] in `%s'.", ce->entry, ce->id, argv[1]);
- return -1;
- }
-
- npc = _edje_collection_convert(ef, ce, opc);
-
- snprintf(buf, sizeof (buf), "edje/collections/%i", ce->id);
- bytes = eet_data_write(ef, _edje_edd_edje_part_collection, buf, npc, 1);
- if (bytes <= 0)
- {
- EINA_LOG_ERR("Unable to save `%s' in section `%s' of `%s'.", ce->entry, buf, argv[1]);
- return -1;
- }
+ Old_Edje_Part_Collection *opc;
+ Edje_Part_Collection *npc;
+ char buf[1024];
+ int bytes = 0;
+
+ snprintf(buf, sizeof (buf), "collections/%i", ce->id);
+ opc = eet_data_read(ef, _edje_edd_old_edje_part_collection, buf);
+ if (!opc)
+ {
+ EINA_LOG_ERR("Unable to find collection `%s'[%i] in `%s'.", ce->entry, ce->id, argv[1]);
+ return -1;
+ }
+
+ npc = _edje_collection_convert(ef, ce, opc);
+
+ snprintf(buf, sizeof (buf), "edje/collections/%i", ce->id);
+ bytes = eet_data_write(ef, _edje_edd_edje_part_collection, buf, npc, 1);
+ if (bytes <= 0)
+ {
+ EINA_LOG_ERR("Unable to save `%s' in section `%s' of `%s'.", ce->entry, buf, argv[1]);
+ return -1;
+ }
}
if (eet_data_write(ef, _edje_edd_edje_file, "edje/file", nef, 1) <= 0)
{
- EINA_LOG_ERR("Unable to save main section of `%s'.", argv[1]);
- return -1;
+ EINA_LOG_ERR("Unable to save main section of `%s'.", argv[1]);
+ return -1;
}
_edje_alias_string(argv[1], ef, "fonts", "edje/fonts");
@@ -205,3 +205,4 @@ main(int argc, char **argv)
return 0;
}
+