return extra_options;
}
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
static Ecore_Evas *
_ecore_evas_constructor_software_x11(int x, int y, int w, int h, const char *extra_options)
{
return ee;
}
-#endif
-#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
static Ecore_Evas *
_ecore_evas_constructor_cocoa(int x, int y, int w, int h, const char *extra_options)
{
if (ee) ecore_evas_move(ee, x, y);
return ee;
}
-#endif
-#ifdef BUILD_ECORE_EVAS_OPENGL_X11
static Ecore_Evas *
_ecore_evas_constructor_opengl_x11(int x, int y, int w, int h, const char *extra_options)
{
return ee;
}
-#endif
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
static Ecore_Evas *
_ecore_evas_constructor_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
{
return ee;
}
-#endif
-
-#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
static Ecore_Evas *
_ecore_evas_constructor_opengl_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
{
return ee;
}
-#endif
static Ecore_Evas *
_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
return ee;
}
-
static Ecore_Evas *
_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
{
/* note: keep sorted by priority, highest first */
static const struct ecore_evas_engine _engines[] = {
/* unix */
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
{"software_x11", _ecore_evas_constructor_software_x11},
-#endif
-#ifdef BUILD_ECORE_EVAS_OPENGL_X11
{"opengl_x11", _ecore_evas_constructor_opengl_x11},
-#endif
-#ifdef BUILD_ECORE_EVAS_FB
{"fb", _ecore_evas_constructor_fb},
-#endif
-
- /* windows */
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
{"software_gdi", _ecore_evas_constructor_software_gdi},
-#endif
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
{"software_ddraw", _ecore_evas_constructor_software_ddraw},
-#endif
-#ifdef BUILD_ECORE_EVAS_DIRECT3D
{"direct3d", _ecore_evas_constructor_direct3d},
-#endif
-#ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
{"opengl_glew", _ecore_evas_constructor_opengl_glew},
-#endif
-
- /* Apple */
-#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
{"opengl_cocoa", _ecore_evas_constructor_cocoa},
-#endif
-
- /* PS3 support */
-#ifdef BUILD_ECORE_EVAS_PSL1GHT
{"psl1ght", _ecore_evas_constructor_psl1ght},
-#endif
-
- /* Wayland */
-#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
{"wayland_shm", _ecore_evas_constructor_wayland_shm},
-#endif
-
-#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
{"wayland_egl", _ecore_evas_constructor_wayland_egl},
-#endif
-
- /* Last chance to have a window */
-#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
{"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
-#endif
-
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
{"sdl", _ecore_evas_constructor_sdl},
-#endif
-
- /* independent */
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
{"buffer", _ecore_evas_constructor_buffer},
-#endif
-
#ifdef BUILD_ECORE_EVAS_EWS
{"ews", _ecore_evas_constructor_ews},
#endif
EAPI Eina_List *
ecore_evas_engines_get(void)
{
- const struct ecore_evas_engine *itr;
- Eina_List *lst = NULL;
-
- for (itr = _engines; itr->name; itr++)
- lst = eina_list_append(lst, itr->name);
-
- return lst;
+ return eina_list_clone(_ecore_evas_available_engines_get());
}
EAPI void
#include "Ecore_Evas.h"
#include "ecore_evas_private.h"
-Eina_Hash *_registered_engines = NULL;
-Eina_List *_engines_paths = NULL;
+static Eina_Hash *_registered_engines = NULL;
+static Eina_List *_engines_paths = NULL;
+static Eina_List *_engines_available = NULL;
#if defined(__CEGCC__) || defined(__MINGW32CE__) || defined(_WIN32)
# define ECORE_EVAS_ENGINE_NAME "module.dll"
EINA_LIST_FREE(_engines_paths, path)
free(path);
+
+ EINA_LIST_FREE(_engines_available, path)
+ eina_stringshare_del(path);
+}
+
+static Eina_Bool
+_file_exists(const char *file)
+{
+ struct stat st;
+ if (!file) return EINA_FALSE;
+
+ if (stat(file, &st) < 0) return EINA_FALSE;
+ return EINA_TRUE;
+}
+
+const Eina_List *
+_ecore_evas_available_engines_get(void)
+{
+ Eina_File_Direct_Info *info;
+ Eina_Iterator *it;
+ Eina_List *l = NULL, *result = NULL;
+ const char *path;
+
+ if (_engines_available) return _engines_available;
+
+ EINA_LIST_FOREACH(_engines_paths, l, path)
+ {
+ it = eina_file_direct_ls(path);
+
+ if (it)
+ {
+ EINA_ITERATOR_FOREACH(it, info)
+ {
+ char tmp[PATH_MAX];
+ snprintf(tmp, sizeof (tmp), "%s/%s/" ECORE_EVAS_ENGINE_NAME,
+ info->path, MODULE_ARCH);
+
+ if (_file_exists(tmp))
+ result = eina_list_append(result,
+ eina_stringshare_add(info->path + info->name_start));
+ }
+ eina_iterator_free(it);
+ }
+ }
+
+ _engines_available = result;
+ return result;
}