summaryrefslogtreecommitdiff
path: root/src/lib/evas/file
diff options
context:
space:
mode:
authorSubhransu Mohanty <sub.mohanty@samsung.com>2016-10-14 15:52:51 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-10-14 15:52:51 +0900
commit8b7f060946a4268316792902409bda2fea00fd32 (patch)
tree386b311b4c1f1d533fc63ee46fd42af56550008d /src/lib/evas/file
parent2fc23aa561a86b4a26daaaa71acc0d590cafe62c (diff)
evas/module: add a new module in vg_saver for eet
Reviewers: cedric, jpeg Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4350
Diffstat (limited to 'src/lib/evas/file')
-rw-r--r--src/lib/evas/file/evas_module.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c
index ea4f5c2739..612507dd81 100644
--- a/src/lib/evas/file/evas_module.c
+++ b/src/lib/evas/file/evas_module.c
@@ -24,8 +24,13 @@
24#define EVAS_MODULE_NO_VG_LOADERS 0 24#define EVAS_MODULE_NO_VG_LOADERS 0
25#endif 25#endif
26 26
27#ifndef EVAS_MODULE_NO_VG_SAVERS
28#define EVAS_MODULE_NO_VG_SAVERS 0
29#endif
30
27 31
28static Eina_Hash *evas_modules[5] = { 32static Eina_Hash *evas_modules[6] = {
33 NULL,
29 NULL, 34 NULL,
30 NULL, 35 NULL,
31 NULL, 36 NULL,
@@ -155,6 +160,10 @@ EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, xpm);
155EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tgv); 160EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tgv);
156#endif 161#endif
157 162
163#if !EVAS_MODULE_NO_VG_SAVERS
164EVAS_EINA_STATIC_MODULE_DEFINE(vg_saver, eet);
165#endif
166
158#if !EVAS_MODULE_NO_IMAGE_SAVERS 167#if !EVAS_MODULE_NO_IMAGE_SAVERS
159EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, eet); 168EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, eet);
160EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, jpeg); 169EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, jpeg);
@@ -264,6 +273,11 @@ static const struct {
264 EVAS_EINA_STATIC_MODULE_USE(image_loader, tgv), 273 EVAS_EINA_STATIC_MODULE_USE(image_loader, tgv),
265#endif 274#endif
266#endif 275#endif
276#if !EVAS_MODULE_NO_VG_SAVERS
277#ifdef EVAS_STATIC_BUILD_VG_EET
278 EVAS_EINA_STATIC_MODULE_USE(vg_saver, eet),
279#endif
280#endif
267#if !EVAS_MODULE_NO_IMAGE_SAVERS 281#if !EVAS_MODULE_NO_IMAGE_SAVERS
268#ifdef EVAS_STATIC_BUILD_EET 282#ifdef EVAS_STATIC_BUILD_EET
269 EVAS_EINA_STATIC_MODULE_USE(image_saver, eet), 283 EVAS_EINA_STATIC_MODULE_USE(image_saver, eet),
@@ -301,6 +315,7 @@ evas_module_init(void)
301 evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL); 315 evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL);
302 evas_modules[EVAS_MODULE_TYPE_OBJECT] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL); 316 evas_modules[EVAS_MODULE_TYPE_OBJECT] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL);
303 evas_modules[EVAS_MODULE_TYPE_VG_LOADER] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL); 317 evas_modules[EVAS_MODULE_TYPE_VG_LOADER] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL);
318 evas_modules[EVAS_MODULE_TYPE_VG_SAVER] = eina_hash_string_small_new(/* FIXME: Add a function to cleanup stuff. */ NULL);
304 319
305 evas_engines = eina_array_new(4); 320 evas_engines = eina_array_new(4);
306 321
@@ -313,7 +328,7 @@ evas_module_register(const Evas_Module_Api *module, Evas_Module_Type type)
313{ 328{
314 Evas_Module *em; 329 Evas_Module *em;
315 330
316 if ((unsigned int)type > 3) return EINA_FALSE; 331 if ((unsigned int)type > 5) return EINA_FALSE;
317 if (!module) return EINA_FALSE; 332 if (!module) return EINA_FALSE;
318 if (module->version != EVAS_MODULE_API_VERSION) return EINA_FALSE; 333 if (module->version != EVAS_MODULE_API_VERSION) return EINA_FALSE;
319 334
@@ -415,7 +430,7 @@ evas_module_unregister(const Evas_Module_Api *module, Evas_Module_Type type)
415{ 430{
416 Evas_Module *em; 431 Evas_Module *em;
417 432
418 if ((unsigned int)type > 3) return EINA_FALSE; 433 if ((unsigned int)type > 5) return EINA_FALSE;
419 if (!module) return EINA_FALSE; 434 if (!module) return EINA_FALSE;
420 435
421 em = eina_hash_find(evas_modules[type], module->name); 436 em = eina_hash_find(evas_modules[type], module->name);
@@ -454,7 +469,7 @@ evas_module_find_type(Evas_Module_Type type, const char *name)
454 Eina_List *l; 469 Eina_List *l;
455 Eina_Bool run_in_tree; 470 Eina_Bool run_in_tree;
456 471
457 if ((unsigned int)type > 3) return NULL; 472 if ((unsigned int)type > 5) return NULL;
458 473
459 em = eina_hash_find(evas_modules[type], name); 474 em = eina_hash_find(evas_modules[type], name);
460 if (em) 475 if (em)
@@ -475,6 +490,7 @@ evas_module_find_type(Evas_Module_Type type, const char *name)
475 case EVAS_MODULE_TYPE_IMAGE_SAVER: type_str = "image_savers"; break; 490 case EVAS_MODULE_TYPE_IMAGE_SAVER: type_str = "image_savers"; break;
476 case EVAS_MODULE_TYPE_OBJECT: type_str = "object"; break; 491 case EVAS_MODULE_TYPE_OBJECT: type_str = "object"; break;
477 case EVAS_MODULE_TYPE_VG_LOADER: type_str = "vg_loaders"; break; 492 case EVAS_MODULE_TYPE_VG_LOADER: type_str = "vg_loaders"; break;
493 case EVAS_MODULE_TYPE_VG_SAVER: type_str = "vg_savers"; break;
478 } 494 }
479 495
480 buffer[0] = '\0'; 496 buffer[0] = '\0';
@@ -677,6 +693,7 @@ evas_module_shutdown(void)
677 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER], _cb_mod_close, NULL); 693 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER], _cb_mod_close, NULL);
678 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_OBJECT], _cb_mod_close, NULL); 694 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_OBJECT], _cb_mod_close, NULL);
679 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_VG_LOADER], _cb_mod_close, NULL); 695 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_VG_LOADER], _cb_mod_close, NULL);
696 eina_hash_foreach(evas_modules[EVAS_MODULE_TYPE_VG_SAVER], _cb_mod_close, NULL);
680 697
681 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_ENGINE]); 698 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_ENGINE]);
682 evas_modules[EVAS_MODULE_TYPE_ENGINE] = NULL; 699 evas_modules[EVAS_MODULE_TYPE_ENGINE] = NULL;
@@ -688,6 +705,8 @@ evas_module_shutdown(void)
688 evas_modules[EVAS_MODULE_TYPE_OBJECT] = NULL; 705 evas_modules[EVAS_MODULE_TYPE_OBJECT] = NULL;
689 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_VG_LOADER]); 706 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_VG_LOADER]);
690 evas_modules[EVAS_MODULE_TYPE_VG_LOADER] = NULL; 707 evas_modules[EVAS_MODULE_TYPE_VG_LOADER] = NULL;
708 eina_hash_free(evas_modules[EVAS_MODULE_TYPE_VG_SAVER]);
709 evas_modules[EVAS_MODULE_TYPE_VG_SAVER] = NULL;
691 710
692 EINA_LIST_FREE(evas_module_paths, path) 711 EINA_LIST_FREE(evas_module_paths, path)
693 free(path); 712 free(path);