diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2018-01-26 14:32:10 -0600 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2018-01-26 15:54:00 -0600 |
commit | 376d8d1e36f903082212ffa0ce1bc0178b323ac2 (patch) | |
tree | 0d40df971edb8cc6731167dc5d766398495221be /src/lib/ecore_wl2/ecore_wl2.c | |
parent | 3e230693e62696f32bc8ab64619843f2507ed393 (diff) |
ecore_wl2: Make surface managers modular
This allows loading modules to handle wayland surfaces, and makes the
existing dmabuf manager a module.
Diffstat (limited to '')
-rw-r--r-- | src/lib/ecore_wl2/ecore_wl2.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2.c b/src/lib/ecore_wl2/ecore_wl2.c index 7a1bbee649..479ee93ef0 100644 --- a/src/lib/ecore_wl2/ecore_wl2.c +++ b/src/lib/ecore_wl2/ecore_wl2.c | |||
@@ -57,10 +57,38 @@ EAPI int ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE = 0; | |||
57 | EAPI int _ecore_wl2_event_window_www = -1; | 57 | EAPI int _ecore_wl2_event_window_www = -1; |
58 | EAPI int _ecore_wl2_event_window_www_drag = -1; | 58 | EAPI int _ecore_wl2_event_window_www_drag = -1; |
59 | 59 | ||
60 | static Eina_Array *supplied_modules = NULL; | ||
61 | static Eina_Array *local_modules = NULL; | ||
62 | |||
60 | static Eina_Bool | 63 | static Eina_Bool |
61 | _ecore_wl2_surface_modules_init(void) | 64 | _ecore_wl2_surface_modules_init(void) |
62 | { | 65 | { |
63 | return ecore_wl2_surface_manager_dmabuf_add(); | 66 | const char *mod_dir; |
67 | |||
68 | supplied_modules = eina_module_arch_list_get(NULL, | ||
69 | PACKAGE_LIB_DIR"/ecore_wl2/engines", | ||
70 | MODULE_ARCH); | ||
71 | eina_module_list_load(supplied_modules); | ||
72 | |||
73 | mod_dir = getenv("ECORE_WL2_SURFACE_MODULE_DIR"); | ||
74 | if (mod_dir) | ||
75 | { | ||
76 | local_modules = eina_module_list_get(NULL, mod_dir, | ||
77 | EINA_TRUE, NULL, NULL); | ||
78 | eina_module_list_load(local_modules); | ||
79 | } | ||
80 | |||
81 | if (!supplied_modules && !local_modules) | ||
82 | return EINA_FALSE; | ||
83 | |||
84 | return EINA_TRUE; | ||
85 | } | ||
86 | |||
87 | static void | ||
88 | _ecore_wl2_surface_modules_unload(void) | ||
89 | { | ||
90 | eina_module_list_unload(supplied_modules); | ||
91 | eina_module_list_unload(local_modules); | ||
64 | } | 92 | } |
65 | 93 | ||
66 | /* public API functions */ | 94 | /* public API functions */ |
@@ -230,6 +258,8 @@ ecore_wl2_shutdown(void) | |||
230 | eina_log_domain_unregister(_ecore_wl2_log_dom); | 258 | eina_log_domain_unregister(_ecore_wl2_log_dom); |
231 | _ecore_wl2_log_dom = -1; | 259 | _ecore_wl2_log_dom = -1; |
232 | 260 | ||
261 | _ecore_wl2_surface_modules_unload(); | ||
262 | |||
233 | /* shutdown eina */ | 263 | /* shutdown eina */ |
234 | eina_shutdown(); | 264 | eina_shutdown(); |
235 | 265 | ||