2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
5 #include "evas_common.h"
6 #include "evas_private.h"
8 extern Evas_List *evas_modules;
11 const char* extention;
15 static struct ext_loader_s loaders[] = {
37 evas_common_load_rgba_image_module_from_file(Image_Entry *ie)
39 Evas_Image_Load_Func *evas_image_load_func = NULL;
40 const char *loader = NULL;
46 dot = strrchr (ie->file, '.');
49 for (i = 0, ++dot; i < (sizeof (loaders) / sizeof (struct ext_loader_s)); ++i)
51 if (!strcasecmp (dot, loaders[i].extention))
53 loader = loaders[i].loader;
61 em = evas_module_find_type(EVAS_MODULE_TYPE_IMAGE_LOADER, loader);
64 if (evas_module_load(em))
67 evas_image_load_func = em->functions;
68 if (evas_image_load_func->file_head(ie, ie->file, ie->key))
74 for (l = evas_modules; l; l = l->next)
77 if (em->type != EVAS_MODULE_TYPE_IMAGE_LOADER) continue;
78 if (!evas_module_load(em)) continue;
79 evas_image_load_func = em->functions;
81 if (evas_image_load_func->file_head(ie, ie->file, ie->key))
83 if (evas_modules != l)
85 evas_modules = evas_list_promote_list(evas_modules, l);
94 ie->info.module = (void*) em;
95 ie->info.loader = (void*) evas_image_load_func;
96 evas_module_ref((Evas_Module*) ie->info.module);
101 evas_common_load_rgba_image_data_from_file(Image_Entry *ie)
103 Evas_Image_Load_Func *evas_image_load_func = NULL;
105 if (!ie->info.module) return -1;
106 if (ie->flags.loaded) return -1;
108 evas_image_load_func = ie->info.loader;
109 evas_module_use((Evas_Module*) ie->info.module);
110 if (!evas_image_load_func->file_data(ie, ie->file, ie->key))
113 evas_module_unref((Evas_Module*) ie->info.module);
114 ie->info.module = NULL;