summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorFlavio Vinicius Alvares Ceolin <flavio.ceolin@profusion.mobi>2012-12-06 20:39:20 +0000
committerFlavio Vinicius Alvares Ceolin <flavio.ceolin@profusion.mobi>2012-12-06 20:39:20 +0000
commit186156afbca0b7e7ec8002112055429afd9e7e6b (patch)
tree1a52547cd72b0f633bdae860539a762c4cc9ed76 /src/lib/ecore_evas
parent10ed77919c5e1776bbaa1d7a611fa380fe6ba018 (diff)
ecore_evas: Removing warning about unused function
Now the engines are modules, the checking for the engine is not done in the compile time anymore, so we're removing these checks. SVN revision: 80389
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas.c63
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c52
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h5
3 files changed, 54 insertions, 66 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 619d944397..b12a678ef8 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -407,7 +407,6 @@ _ecore_evas_parse_extra_options_x(const char *extra_options, char **disp_name, u
407 return extra_options; 407 return extra_options;
408} 408}
409 409
410#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
411static Ecore_Evas * 410static Ecore_Evas *
412_ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *extra_options) 411_ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *extra_options)
413{ 412{
@@ -421,9 +420,7 @@ _ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *ext
421 420
422 return ee; 421 return ee;
423} 422}
424#endif
425 423
426#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
427static Ecore_Evas * 424static Ecore_Evas *
428_ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_options) 425_ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_options)
429{ 426{
@@ -437,9 +434,7 @@ _ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_opti
437 if (ee) ecore_evas_move(ee, x, y); 434 if (ee) ecore_evas_move(ee, x, y);
438 return ee; 435 return ee;
439} 436}
440#endif
441 437
442#ifdef BUILD_ECORE_EVAS_OPENGL_X11
443static Ecore_Evas * 438static Ecore_Evas *
444_ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options) 439_ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options)
445{ 440{
@@ -453,9 +448,7 @@ _ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra
453 448
454 return ee; 449 return ee;
455} 450}
456#endif
457 451
458#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
459static Ecore_Evas * 452static Ecore_Evas *
460_ecore_evas_constructor_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options) 453_ecore_evas_constructor_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
461{ 454{
@@ -474,9 +467,6 @@ _ecore_evas_constructor_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h,
474 467
475 return ee; 468 return ee;
476} 469}
477#endif
478
479#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
480static Ecore_Evas * 470static Ecore_Evas *
481_ecore_evas_constructor_opengl_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options) 471_ecore_evas_constructor_opengl_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
482{ 472{
@@ -493,7 +483,6 @@ _ecore_evas_constructor_opengl_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w,
493 483
494 return ee; 484 return ee;
495} 485}
496#endif
497 486
498static Ecore_Evas * 487static Ecore_Evas *
499_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options) 488_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
@@ -511,7 +500,6 @@ _ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, c
511 return ee; 500 return ee;
512} 501}
513 502
514
515static Ecore_Evas * 503static Ecore_Evas *
516_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options) 504_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
517{ 505{
@@ -603,63 +591,20 @@ _ecore_evas_constructor_ews(int x, int y, int w, int h, const char *extra_option
603/* note: keep sorted by priority, highest first */ 591/* note: keep sorted by priority, highest first */
604static const struct ecore_evas_engine _engines[] = { 592static const struct ecore_evas_engine _engines[] = {
605 /* unix */ 593 /* unix */
606#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
607 {"software_x11", _ecore_evas_constructor_software_x11}, 594 {"software_x11", _ecore_evas_constructor_software_x11},
608#endif
609#ifdef BUILD_ECORE_EVAS_OPENGL_X11
610 {"opengl_x11", _ecore_evas_constructor_opengl_x11}, 595 {"opengl_x11", _ecore_evas_constructor_opengl_x11},
611#endif
612#ifdef BUILD_ECORE_EVAS_FB
613 {"fb", _ecore_evas_constructor_fb}, 596 {"fb", _ecore_evas_constructor_fb},
614#endif
615
616 /* windows */
617#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
618 {"software_gdi", _ecore_evas_constructor_software_gdi}, 597 {"software_gdi", _ecore_evas_constructor_software_gdi},
619#endif
620#ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
621 {"software_ddraw", _ecore_evas_constructor_software_ddraw}, 598 {"software_ddraw", _ecore_evas_constructor_software_ddraw},
622#endif
623#ifdef BUILD_ECORE_EVAS_DIRECT3D
624 {"direct3d", _ecore_evas_constructor_direct3d}, 599 {"direct3d", _ecore_evas_constructor_direct3d},
625#endif
626#ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
627 {"opengl_glew", _ecore_evas_constructor_opengl_glew}, 600 {"opengl_glew", _ecore_evas_constructor_opengl_glew},
628#endif
629
630 /* Apple */
631#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
632 {"opengl_cocoa", _ecore_evas_constructor_cocoa}, 601 {"opengl_cocoa", _ecore_evas_constructor_cocoa},
633#endif
634
635 /* PS3 support */
636#ifdef BUILD_ECORE_EVAS_PSL1GHT
637 {"psl1ght", _ecore_evas_constructor_psl1ght}, 602 {"psl1ght", _ecore_evas_constructor_psl1ght},
638#endif
639
640 /* Wayland */
641#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
642 {"wayland_shm", _ecore_evas_constructor_wayland_shm}, 603 {"wayland_shm", _ecore_evas_constructor_wayland_shm},
643#endif
644
645#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
646 {"wayland_egl", _ecore_evas_constructor_wayland_egl}, 604 {"wayland_egl", _ecore_evas_constructor_wayland_egl},
647#endif
648
649 /* Last chance to have a window */
650#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
651 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl}, 605 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
652#endif
653
654#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
655 {"sdl", _ecore_evas_constructor_sdl}, 606 {"sdl", _ecore_evas_constructor_sdl},
656#endif
657
658 /* independent */
659#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
660 {"buffer", _ecore_evas_constructor_buffer}, 607 {"buffer", _ecore_evas_constructor_buffer},
661#endif
662
663#ifdef BUILD_ECORE_EVAS_EWS 608#ifdef BUILD_ECORE_EVAS_EWS
664 {"ews", _ecore_evas_constructor_ews}, 609 {"ews", _ecore_evas_constructor_ews},
665#endif 610#endif
@@ -669,13 +614,7 @@ static const struct ecore_evas_engine _engines[] = {
669EAPI Eina_List * 614EAPI Eina_List *
670ecore_evas_engines_get(void) 615ecore_evas_engines_get(void)
671{ 616{
672 const struct ecore_evas_engine *itr; 617 return eina_list_clone(_ecore_evas_available_engines_get());
673 Eina_List *lst = NULL;
674
675 for (itr = _engines; itr->name; itr++)
676 lst = eina_list_append(lst, itr->name);
677
678 return lst;
679} 618}
680 619
681EAPI void 620EAPI void
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index 1e399b07d6..c4e960910c 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -5,8 +5,9 @@
5#include "Ecore_Evas.h" 5#include "Ecore_Evas.h"
6#include "ecore_evas_private.h" 6#include "ecore_evas_private.h"
7 7
8Eina_Hash *_registered_engines = NULL; 8static Eina_Hash *_registered_engines = NULL;
9Eina_List *_engines_paths = NULL; 9static Eina_List *_engines_paths = NULL;
10static Eina_List *_engines_available = NULL;
10 11
11#if defined(__CEGCC__) || defined(__MINGW32CE__) || defined(_WIN32) 12#if defined(__CEGCC__) || defined(__MINGW32CE__) || defined(_WIN32)
12# define ECORE_EVAS_ENGINE_NAME "module.dll" 13# define ECORE_EVAS_ENGINE_NAME "module.dll"
@@ -93,4 +94,51 @@ _ecore_evas_engine_shutdown(void)
93 94
94 EINA_LIST_FREE(_engines_paths, path) 95 EINA_LIST_FREE(_engines_paths, path)
95 free(path); 96 free(path);
97
98 EINA_LIST_FREE(_engines_available, path)
99 eina_stringshare_del(path);
100}
101
102static Eina_Bool
103_file_exists(const char *file)
104{
105 struct stat st;
106 if (!file) return EINA_FALSE;
107
108 if (stat(file, &st) < 0) return EINA_FALSE;
109 return EINA_TRUE;
110}
111
112const Eina_List *
113_ecore_evas_available_engines_get(void)
114{
115 Eina_File_Direct_Info *info;
116 Eina_Iterator *it;
117 Eina_List *l = NULL, *result = NULL;
118 const char *path;
119
120 if (_engines_available) return _engines_available;
121
122 EINA_LIST_FOREACH(_engines_paths, l, path)
123 {
124 it = eina_file_direct_ls(path);
125
126 if (it)
127 {
128 EINA_ITERATOR_FOREACH(it, info)
129 {
130 char tmp[PATH_MAX];
131 snprintf(tmp, sizeof (tmp), "%s/%s/" ECORE_EVAS_ENGINE_NAME,
132 info->path, MODULE_ARCH);
133
134 if (_file_exists(tmp))
135 result = eina_list_append(result,
136 eina_stringshare_add(info->path + info->name_start));
137 }
138 eina_iterator_free(it);
139 }
140 }
141
142 _engines_available = result;
143 return result;
96} 144}
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index ab1dde3bde..8753a207ea 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -387,8 +387,9 @@ int _ecore_evas_ews_shutdown(void);
387#endif 387#endif
388 388
389Eina_Module *_ecore_evas_engine_load(const char *engine); 389Eina_Module *_ecore_evas_engine_load(const char *engine);
390void _ecore_evas_engine_init(); 390const Eina_List *_ecore_evas_available_engines_get(void);
391void _ecore_evas_engine_shutdown(); 391void _ecore_evas_engine_init(void);
392void _ecore_evas_engine_shutdown(void);
392 393
393#endif 394#endif
394 395