void data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest);
void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set);
void data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set);
+void data_queue_image_remove(int *dest, Eina_Bool *set);
void data_queue_part_slave_lookup(int *master, int *slave);
void data_queue_image_slave_lookup(int *master, int *slave);
void data_queue_spectrum_lookup(char *name, int *dest);
Edje_Part_Collection *pc;
Eina_List *l;
Code *cd;
- int i = 0;
+ unsigned int i = 0;
pc = eina_list_nth(edje_collections, older->id);
cd = eina_list_nth(codes, older->id);
if (older) older->id = pc->id;
else if (pc->part == current_pc->part) current_de->id = pc->id;
}
+
+ for (i = 0; i < pc->parts_count; ++i)
+ {
+ Edje_Part_Description_Image *ed;
+ unsigned int j;
+
+ if (pc->parts[i]->type != EDJE_PART_TYPE_IMAGE)
+ continue ;
+
+ ed = (Edje_Part_Description_Image*) &pc->parts[i];
+
+ data_queue_image_remove(&(ed->image.id), &(ed->image.set));
+
+ for (j = 0; j < ed->image.tweens_count; ++j)
+ data_queue_image_remove(&(ed->image.tweens[ed->image.tweens_count - 1]->id),
+ &(ed->image.tweens[ed->image.tweens_count - 1]->set));
+ }
}
eina_hash_direct_add(edje_file->collection, current_de->entry, current_de);
Eina_Bool set;
};
-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));
Edje_File *edje_file = NULL;
Eina_List *edje_collections = NULL;
{
img = &edje_file->image_dir->entries[i];
- if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL)
+ if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL
+ || img->entry == NULL)
{
}
else
}
void
+data_queue_image_remove(int *dest, Eina_Bool *set)
+{
+ Eina_List *l;
+ Image_Lookup *il;
+
+ EINA_LIST_FOREACH(image_lookups, l, il)
+ {
+ if (il->dest == dest && il->set == set)
+ {
+ image_lookups = eina_list_remove_list(image_lookups, l);
+ return ;
+ }
+ }
+}
+
+void
data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set)
{
Eina_List *l;
Group_Lookup *group;
Image_Lookup *image;
Eina_List *l;
+ Eina_Hash *images_in_use;
void *data;
EINA_LIST_FOREACH(edje_collections, l, pc)
free(group);
}
+ images_in_use = eina_hash_string_superfast_new(NULL);
+
EINA_LIST_FREE(image_lookups, image)
{
- Edje_Image_Directory_Entry *de;
Eina_Bool find = EINA_FALSE;
if (edje_file->image_dir)
{
+ Edje_Image_Directory_Entry *de;
unsigned int i;
for (i = 0; i < edje_file->image_dir->entries_count; ++i)
*(image->dest) = de->id;
*(image->set) = EINA_FALSE;
find = EINA_TRUE;
+
+ if (!eina_hash_find(images_in_use, image->name))
+ eina_hash_direct_add(images_in_use, de->entry, de);
break;
}
}
*(image->dest) = set->id;
*(image->set) = EINA_TRUE;
find = EINA_TRUE;
+
+ if (!eina_hash_find(images_in_use, image->name))
+ eina_hash_direct_add(images_in_use, set->name, set);
break;
}
}
free(image);
}
+ if (edje_file->image_dir)
+ {
+ Edje_Image_Directory_Entry *de;
+ Edje_Image_Directory_Set *set;
+ unsigned int i;
+
+ for (i = 0; i < edje_file->image_dir->entries_count; ++i)
+ {
+ de = edje_file->image_dir->entries + i;
+
+ if (de->entry && eina_hash_find(images_in_use, de->entry))
+ continue ;
+
+ if (verbose)
+ {
+ printf("%s: Image '%s' in ressource 'edje/image/%i' will not be included as it is unused.\n", progname, de->entry, de->id);
+ }
+ else
+ {
+ INF("Image '%s' in ressource 'edje/image/%i' will not be included as it is unused.", de->entry, de->id);
+ }
+
+ de->entry = NULL;
+ }
+
+ for (i = 0; i < edje_file->image_dir->sets_count; ++i)
+ {
+ set = edje_file->image_dir->sets + i;
+
+ if (set->name && eina_hash_find(images_in_use, set->name))
+ continue ;
+
+ if (verbose)
+ {
+ printf("%s: Set '%s' will not be included as it is unused.\n", progname, set->name);
+ }
+ else
+ {
+ INF("Set '%s' will not be included as it is unused.", set->name);
+ }
+
+ set->name = NULL;
+ set->entries = NULL;
+ }
+ }
+
+ eina_hash_free(images_in_use);
+
EINA_LIST_FREE(part_slave_lookups, data)
free(data);