discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=fa32b5e708b72c61166e61dce5e0a2fa013095e7

commit fa32b5e708b72c61166e61dce5e0a2fa013095e7
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Tue Aug 27 11:56:30 2013 +0100

    add wl_fb output module
    
    adds a probably-working wayland framebuffer output module
    
    Additional authors:
    Chris Michael <cp.mich...@samsung.com>
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 configure.ac                   | 19 +++++++++-----
 src/modules/Makefile.mk        |  4 +++
 src/modules/Makefile_wl_fb.mk  | 15 +++++++++++
 src/modules/wl_fb/e_mod_main.c | 58 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 89 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index d7aa37e..96b96eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -825,12 +825,6 @@ else
    ecore_x=false
 fi
 
-if test "x${have_wayland}" = "xyes" ; then
-   allow_wl_x11=true
-else
-   allow_wl_x11=false
-fi
-
 if test "x${ecore_x}" = "xtrue" && test -n "$WAYLAND_CFLAGS" ; then
    wl_x11=true
 else
@@ -847,6 +841,16 @@ define([CHECK_MODULE_WL_DESKTOP_SHELL],
 ])
 AM_CONDITIONAL([HAVE_WL_DESKTOP_SHELL], [test "x${WL_DESKTOP_SHELL}" = 
"xtrue"])
 
+define([CHECK_MODULE_WL_FB],
+[
+  if test "x${have_wayland_clients}" = "xyes"; then
+    AC_E_CHECK_PKG(WL_FB, [ ecore-fb >= $efl_version ecore >= $efl_version 
eina >= $efl_version ], [WL_FB=true], [WL_FB=false])
+  else
+    WL_FB=false
+  fi
+])
+AM_CONDITIONAL([HAVE_WL_FB], [test "x${WL_FB}" = "xtrue"])
+
 AC_E_OPTIONAL_MODULE([ibar], true)
 AC_E_OPTIONAL_MODULE([clock], true)
 AC_E_OPTIONAL_MODULE([pager], true)
@@ -897,7 +901,8 @@ AC_E_OPTIONAL_MODULE([access], false, $ecore_x)
 AC_E_OPTIONAL_MODULE([music_control], true, [CHECK_MODULE_MUSIC_CONTROL])
 AC_E_OPTIONAL_MODULE([contact], false)
 AC_E_OPTIONAL_MODULE([wl_desktop_shell], true, [CHECK_MODULE_WL_DESKTOP_SHELL])
-AC_E_OPTIONAL_MODULE([wl_x11], $allow_wl_x11, $wl_x11)
+AC_E_OPTIONAL_MODULE([wl_x11], $have_wayland, $wl_x11)
+AC_E_OPTIONAL_MODULE([wl_fb], $have_wayland, [CHECK_MODULE_WL_FB])
 #AC_E_OPTIONAL_MODULE([wl_screenshot], true, [CHECK_MODULE_WL_SCREENSHOT])
 
 HALT="/sbin/shutdown -h now"
diff --git a/src/modules/Makefile.mk b/src/modules/Makefile.mk
index 43cb505..1b563a6 100644
--- a/src/modules/Makefile.mk
+++ b/src/modules/Makefile.mk
@@ -226,6 +226,10 @@ if USE_MODULE_WL_X11
 include src/modules/Makefile_wl_x11.mk
 endif
 
+if USE_MODULE_WL_FB
+include src/modules/Makefile_wl_fb.mk
+endif
+
 #if HAVE_WAYLAND_SCREENSHOT
 #include src/modules/Makefile_wl_screenshot.mk
 #endif
diff --git a/src/modules/Makefile_wl_fb.mk b/src/modules/Makefile_wl_fb.mk
new file mode 100644
index 0000000..4b3c66e
--- /dev/null
+++ b/src/modules/Makefile_wl_fb.mk
@@ -0,0 +1,15 @@
+wl_fbdir = $(MDIR)/wl_fb
+
+wl_fbpkgdir = $(MDIR)/wl_fb/$(MODULE_ARCH)
+wl_fbpkg_LTLIBRARIES = src/modules/wl_fb/module.la
+
+src_modules_wl_fb_module_la_DEPENDENCIES = $(MDEPENDENCIES)
+src_modules_wl_fb_module_la_CPPFLAGS  = $(MOD_CPPFLAGS) @WL_FB_CFLAGS@ 
@WAYLAND_CFLAGS@ -DNEED_X=1
+src_modules_wl_fb_module_la_LIBADD   = $(LIBS) @WL_FB_LIBS@ @WAYLAND_LIBS@
+src_modules_wl_fb_module_la_LDFLAGS = $(MOD_LDFLAGS)
+src_modules_wl_fb_module_la_SOURCES = src/modules/wl_fb/e_mod_main.c
+
+# TODO: incomplete
+#.PHONY: wl_fb install-wl_fb
+#wl_fb: $(wl_fbpkg_LTLIBRARIES) $(wl_fb_DATA)
+#install-wl_fb: install-wl_fbDATA install-wl_fbpkgLTLIBRARIES
diff --git a/src/modules/wl_fb/e_mod_main.c b/src/modules/wl_fb/e_mod_main.c
new file mode 100644
index 0000000..e92f52c
--- /dev/null
+++ b/src/modules/wl_fb/e_mod_main.c
@@ -0,0 +1,58 @@
+#include "e.h"
+#include <Ecore_Fb.h>
+#include "e_comp_wl.h"
+#include <Ecore_Wayland.h>
+
+EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_FB" };
+
+EAPI void *
+e_modapi_init(E_Module *m)
+{
+   Ecore_Evas *ee;
+   E_Screen *screen;
+   E_Comp *comp;
+   unsigned int layer;
+   int w, h;
+
+   printf("LOAD WL_FB MODULE\n");
+
+   /* try to init ecore_x */
+   if (!ecore_fb_init(NULL))
+     {
+        fprintf(stderr, "Could not initialize ecore_fb");
+        return NULL;
+     }
+
+   ecore_fb_size_get(&w, &h);
+   ee = ecore_evas_fb_new(NULL, 0, w, h);
+   comp = e_comp_new();
+   comp->comp_type = E_PIXMAP_TYPE_WL;
+   comp->ee = ee;
+   if (!e_xinerama_fake_screens_exist())
+     {
+        screen = E_NEW(E_Screen, 1);
+        screen->escreen = screen->screen = 0;
+        screen->x = 0;
+        screen->y = 0;
+        screen->w = w;
+        screen->h = h;
+        e_xinerama_screens_set(eina_list_append(NULL, screen));
+     }
+   comp->man = e_manager_new(0, comp, w, h);
+   e_comp_wl_init();
+   e_comp_canvas_init(comp);
+   e_comp_canvas_fake_layers_init(comp);
+
+   ecore_wl_init(NULL);
+   ecore_wl_server_mode_set(1);
+   return m;
+}
+
+EAPI int 
+e_modapi_shutdown(E_Module *m EINA_UNUSED)
+{
+   /* shutdown ecore_x */
+   ecore_fb_shutdown();
+
+   return 1;
+}

-- 


Reply via email to