summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Revest <revestflo@gmail.com>2015-07-21 18:09:04 +0200
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-17 16:23:02 +0100
commit35b95519e1cec5ac0b20fe60a141f47264ebf10d (patch)
tree006d24a8596609ebb10a89f2d652dd9ca85a5d2a
parent11c632ab44ed568384c7015e1b9930dc9b46901b (diff)
Adds eglfs to Enlightenment
-rw-r--r--configure.ac12
-rw-r--r--src/bin/e_comp.c3
-rw-r--r--src/bin/e_comp_wl.c1
-rw-r--r--src/bin/e_module.c1
-rw-r--r--src/modules/Makefile.mk2
-rw-r--r--src/modules/Makefile_wl_eglfs.mk17
-rw-r--r--src/modules/wl_eglfs/e_mod_main.c54
7 files changed, 90 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6ab4e8761..c40bc2f31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -822,6 +822,17 @@ define([CHECK_MODULE_WL_FB],
822]) 822])
823AM_CONDITIONAL([HAVE_WL_FB], [test "x${WL_FB}" = "xtrue"]) 823AM_CONDITIONAL([HAVE_WL_FB], [test "x${WL_FB}" = "xtrue"])
824 824
825WL_EGLFS=false
826define([CHECK_MODULE_WL_EGLFS],
827[
828 if test "x${have_wayland}" = "xyes" ; then
829 AC_E_CHECK_PKG(WL_EGLFS, [ ecore-fb >= $efl_version ecore >= $efl_version eina >= $efl_version ], [WL_EGLFS=true], [WL_EGLFS=false])
830 else
831 WL_EGLFS=false
832 fi
833])
834AM_CONDITIONAL([HAVE_WL_EGLFS], [test "x${WL_EGLFS}" = "xtrue"])
835
825WL_DRM=false 836WL_DRM=false
826define([CHECK_MODULE_WL_DRM], 837define([CHECK_MODULE_WL_DRM],
827[ 838[
@@ -918,6 +929,7 @@ AC_E_OPTIONAL_MODULE([wl_desktop_shell], $have_wayland, [CHECK_MODULE_WL_DESKTOP
918AC_E_OPTIONAL_MODULE([wl_x11], $have_wayland, [CHECK_MODULE_WL_X11]) 929AC_E_OPTIONAL_MODULE([wl_x11], $have_wayland, [CHECK_MODULE_WL_X11])
919AC_E_OPTIONAL_MODULE([wl_wl], $have_wayland, [CHECK_MODULE_WL_WL]) 930AC_E_OPTIONAL_MODULE([wl_wl], $have_wayland, [CHECK_MODULE_WL_WL])
920#AC_E_OPTIONAL_MODULE([wl_fb], $have_wayland, [CHECK_MODULE_WL_FB]) 931#AC_E_OPTIONAL_MODULE([wl_fb], $have_wayland, [CHECK_MODULE_WL_FB])
932AC_E_OPTIONAL_MODULE([wl_eglfs], $have_wayland, [CHECK_MODULE_WL_EGLFS])
921AC_E_OPTIONAL_MODULE([wl_drm], $have_wayland, [CHECK_MODULE_WL_DRM]) 933AC_E_OPTIONAL_MODULE([wl_drm], $have_wayland, [CHECK_MODULE_WL_DRM])
922AC_E_OPTIONAL_MODULE([wl_text_input], $have_wayland, [CHECK_MODULE_WL_TEXT_INPUT]) 934AC_E_OPTIONAL_MODULE([wl_text_input], $have_wayland, [CHECK_MODULE_WL_TEXT_INPUT])
923AC_E_OPTIONAL_MODULE([wl_weekeyboard], $have_wayland, [CHECK_MODULE_WL_WEEKEYBOARD]) 935AC_E_OPTIONAL_MODULE([wl_weekeyboard], $have_wayland, [CHECK_MODULE_WL_WEEKEYBOARD])
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index ce2d1e577..98a8a8d45 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -1098,6 +1098,9 @@ e_comp_init(void)
1098#ifdef HAVE_WL_DRM 1098#ifdef HAVE_WL_DRM
1099 "wl_drm", 1099 "wl_drm",
1100#endif 1100#endif
1101#ifdef HAVE_WL_EGLFS
1102 "wl_eglfs",
1103#endif
1101/* probably add other engines here; fb should be last? */ 1104/* probably add other engines here; fb should be last? */
1102#ifdef HAVE_WL_FB 1105#ifdef HAVE_WL_FB
1103 "wl_fb", 1106 "wl_fb",
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 7e1a61a44..ba78cbf2b 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -2687,6 +2687,7 @@ e_comp_wl_init(void)
2687{ 2687{
2688 /* set gl available if we have ecore_evas support */ 2688 /* set gl available if we have ecore_evas support */
2689 if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_EGL) || 2689 if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_EGL) ||
2690 ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_EGLFS) ||
2690 ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_DRM)) 2691 ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_DRM))
2691 e_comp_gl_set(EINA_TRUE); 2692 e_comp_gl_set(EINA_TRUE);
2692 2693
diff --git a/src/bin/e_module.c b/src/bin/e_module.c
index 2e1648f46..32f2ab360 100644
--- a/src/bin/e_module.c
+++ b/src/bin/e_module.c
@@ -1008,6 +1008,7 @@ _e_module_whitelist_check(void)
1008 "wl_x11", 1008 "wl_x11",
1009 "wl_wl", 1009 "wl_wl",
1010 "wl_drm", 1010 "wl_drm",
1011 "wl_eglfs",
1011 "wl_shell", 1012 "wl_shell",
1012 "wl_desktop_shell", 1013 "wl_desktop_shell",
1013 "xkbswitch", 1014 "xkbswitch",
diff --git a/src/modules/Makefile.mk b/src/modules/Makefile.mk
index 3ea314881..74d281baa 100644
--- a/src/modules/Makefile.mk
+++ b/src/modules/Makefile.mk
@@ -111,6 +111,8 @@ include src/modules/Makefile_wl_drm.mk
111 111
112include src/modules/Makefile_wl_wl.mk 112include src/modules/Makefile_wl_wl.mk
113 113
114include src/modules/Makefile_wl_eglfs.mk
115
114include src/modules/Makefile_wl_desktop_shell.mk 116include src/modules/Makefile_wl_desktop_shell.mk
115 117
116include src/modules/Makefile_wl_x11.mk 118include src/modules/Makefile_wl_x11.mk
diff --git a/src/modules/Makefile_wl_eglfs.mk b/src/modules/Makefile_wl_eglfs.mk
new file mode 100644
index 000000000..a29b97f63
--- /dev/null
+++ b/src/modules/Makefile_wl_eglfs.mk
@@ -0,0 +1,17 @@
1if USE_MODULE_WL_EGLFS
2wl_eglfsdir = $(MDIR)/wl_eglfs
3
4wl_eglfspkgdir = $(MDIR)/wl_eglfs/$(MODULE_ARCH)
5wl_eglfspkg_LTLIBRARIES = src/modules/wl_eglfs/module.la
6
7src_modules_wl_eglfs_module_la_DEPENDENCIES = $(MDEPENDENCIES)
8src_modules_wl_eglfs_module_la_CPPFLAGS = $(MOD_CPPFLAGS) @WL_EGLFS_CFLAGS@ @WAYLAND_CFLAGS@
9src_modules_wl_eglfs_module_la_LIBADD = $(LIBS) @WL_EGLFS_LIBS@ @WAYLAND_LIBS@
10src_modules_wl_eglfs_module_la_LDFLAGS = $(MOD_LDFLAGS)
11src_modules_wl_eglfs_module_la_SOURCES = src/modules/wl_eglfs/e_mod_main.c
12
13# TODO: incomplete
14#.PHONY: wl_eglfs install-wl_eglfs
15#wl_eglfs: $(wl_eglfspkg_LTLIBRARIES) $(wl_eglfs_DATA)
16#install-wl_eglfs: install-wl_eglfsDATA install-wl_eglfspkgLTLIBRARIES
17endif
diff --git a/src/modules/wl_eglfs/e_mod_main.c b/src/modules/wl_eglfs/e_mod_main.c
new file mode 100644
index 000000000..98b10b2d7
--- /dev/null
+++ b/src/modules/wl_eglfs/e_mod_main.c
@@ -0,0 +1,54 @@
1#include "e.h"
2#include <Ecore_Fb.h>
3#include <Ecore_Wayland.h>
4
5E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_EGLFS" };
6
7E_API void *
8e_modapi_init(E_Module *m)
9{
10 Ecore_Evas *ee;
11 E_Screen *screen;
12 int w, h;
13
14 printf("LOAD WL_EGLFS MODULE\n");
15
16 /* try to init ecore_x */
17 if (!ecore_fb_init(NULL))
18 {
19 fprintf(stderr, "Could not initialize ecore_fb");
20 return NULL;
21 }
22
23 ecore_fb_size_get(&w, &h);
24 ee = ecore_evas_eglfs_new(NULL, 0, w, h);
25
26 e_comp->ee = ee;
27
28 if (!e_xinerama_fake_screens_exist())
29 {
30 screen = E_NEW(E_Screen, 1);
31 screen->escreen = screen->screen = 0;
32 screen->x = 0;
33 screen->y = 0;
34 screen->w = w;
35 screen->h = h;
36 e_xinerama_screens_set(eina_list_append(NULL, screen));
37 }
38 e_comp_wl_init();
39 e_comp_canvas_init(w, h);
40 e_comp->pointer = e_pointer_canvas_new(e_comp->ee, EINA_TRUE);
41
42 ecore_wl_init(NULL);
43 ecore_wl_server_mode_set(1);
44 return m;
45}
46
47E_API int
48e_modapi_shutdown(E_Module *m EINA_UNUSED)
49{
50 /* shutdown ecore_fb */
51 ecore_fb_shutdown();
52
53 return 1;
54}