summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-15 12:22:22 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-15 12:24:35 +0100
commit4f448d6339f384b4b37ca6e98f508f881fe315d8 (patch)
tree383f899f341ed4528deeae998f4c69f615ea4f6b
parentc7c5b49465dcd1b7209ae59e15a7b9e363ffdd5f (diff)
edje - fix edje_cc mis-re-iding images in image setsefl-1.24
wanr of unused images so it's properly fixed too... always warn to stdout so devs know to cleanup their theme. by not removing image sets this fixes the mis-id'ing too. @fix
-rw-r--r--src/bin/edje/edje_cc_out.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index 64f6cec29d..9e0b8bf354 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -3509,7 +3509,7 @@ _data_image_h_size_compare_cb(const void *data1, const void *data2)
3509} 3509}
3510 3510
3511static void 3511static void
3512_data_image_sets_size_set() 3512_data_image_sets_size_set(void)
3513{ 3513{
3514 Evas *evas; 3514 Evas *evas;
3515 Edje_Image_Directory_Set *set; 3515 Edje_Image_Directory_Set *set;
@@ -4029,11 +4029,12 @@ free_group:
4029 if (de->entry && eina_hash_find(images_in_use, de->entry)) 4029 if (de->entry && eina_hash_find(images_in_use, de->entry))
4030 continue; 4030 continue;
4031 4031
4032 printf("Warning: Image '%s' not used\n", de->entry);
4032 INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.", 4033 INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.",
4033 de->entry, de->id); 4034 de->entry, de->id);
4034 4035
4035 /* so as not to write the unused images, moved last image in the 4036 // so as not to write the unused images, moved last image in the
4036 list to unused image position and check it */ 4037 // list to unused image position and check it
4037 free((void *)de->entry); 4038 free((void *)de->entry);
4038 de->entry = NULL; 4039 de->entry = NULL;
4039 de_last = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1; 4040 de_last = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1;
@@ -4042,8 +4043,8 @@ free_group:
4042 images_unused_list = eina_list_append(images_unused_list, iui); 4043 images_unused_list = eina_list_append(images_unused_list, iui);
4043 iui->new_id = i; 4044 iui->new_id = i;
4044 de_last->id = i; 4045 de_last->id = i;
4045 memcpy(de, de_last, sizeof (Edje_Image_Directory_Entry)); 4046 memcpy(de, de_last, sizeof(Edje_Image_Directory_Entry));
4046 --i; /* need to check a moved image on this index */ 4047 --i; // need to check a moved image on this index
4047 edje_file->image_dir->entries_count--; 4048 edje_file->image_dir->entries_count--;
4048 img = realloc(edje_file->image_dir->entries, 4049 img = realloc(edje_file->image_dir->entries,
4049 sizeof (Edje_Image_Directory_Entry) * edje_file->image_dir->entries_count); 4050 sizeof (Edje_Image_Directory_Entry) * edje_file->image_dir->entries_count);
@@ -4057,6 +4058,17 @@ free_group:
4057 if (set->name && eina_hash_find(images_in_use, set->name)) 4058 if (set->name && eina_hash_find(images_in_use, set->name))
4058 continue; 4059 continue;
4059 4060
4061 printf("Warning: Image set '%s' not used\n", set->name);
4062 EINA_LIST_FOREACH(set->entries, l, set_e)
4063 {
4064 printf(" Contains '%s' size %ix%i -> %ix%i\n",
4065 set_e->name,
4066 set_e->size.min.w, set_e->size.min.h,
4067 set_e->size.max.w, set_e->size.max.h);
4068 }
4069/* No need to redo id's - we will warn of unused images - fix in src
4070 * Also .. this is broken and messes up id's ... so easyer - complain
4071 * to develoepr to clean up the theme...
4060 INF("Set '%s' will not be included as it is unused.", set->name); 4072 INF("Set '%s' will not be included as it is unused.", set->name);
4061 4073
4062 free((void *)set->name); 4074 free((void *)set->name);
@@ -4078,6 +4090,7 @@ free_group:
4078 set_realloc = realloc(edje_file->image_dir->sets, 4090 set_realloc = realloc(edje_file->image_dir->sets,
4079 sizeof(Edje_Image_Directory_Set) * edje_file->image_dir->sets_count); 4091 sizeof(Edje_Image_Directory_Set) * edje_file->image_dir->sets_count);
4080 edje_file->image_dir->sets = set_realloc; 4092 edje_file->image_dir->sets = set_realloc;
4093 */
4081 } 4094 }
4082 4095
4083 /* update image id in parts */ 4096 /* update image id in parts */