devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=54a034550339e6531a6c02428c4dca94f711726f

commit 54a034550339e6531a6c02428c4dca94f711726f
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Wed Aug 19 13:48:19 2015 -0400

    ecore-wl2: Add support for binding various wayland interfaces
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/ecore_wl2_display.c | 34 ++++++++++++++++++++++++++++++++++
 src/lib/ecore_wl2/ecore_wl2_private.h |  9 +++++++++
 2 files changed, 43 insertions(+)

diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c 
b/src/lib/ecore_wl2/ecore_wl2_display.c
index 4102f19..9002769 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -43,6 +43,40 @@ _cb_global_add(void *data, struct wl_registry *registry, 
unsigned int id, const
           }
      }
 
+   if (!strcmp(interface, "wl_compositor"))
+     {
+        ewd->wl.compositor =
+          wl_registry_bind(registry, id, &wl_compositor_interface, 3);
+     }
+   else if (!strcmp(interface, "wl_subcompositor"))
+     {
+        ewd->wl.subcompositor =
+          wl_registry_bind(registry, id, &wl_subcompositor_interface, 1);
+     }
+   else if (!strcmp(interface, "wl_shm"))
+     {
+        ewd->wl.shm =
+          wl_registry_bind(registry, id, &wl_shm_interface, 1);
+     }
+   else if (!strcmp(interface, "wl_data_device_manager"))
+     {
+        ewd->wl.data_device_manager =
+          wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1);
+     }
+   else if (!strcmp(interface, "wl_shell"))
+     {
+        ewd->wl.wl_shell =
+          wl_registry_bind(registry, id, &wl_shell_interface, 1);
+     }
+   else if ((!strcmp(interface, "xdg_shell")) &&
+            (!getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL")))
+     {
+        ewd->wl.xdg_shell =
+          wl_registry_bind(registry, id, &xdg_shell_interface, 1);
+        xdg_shell_use_unstable_version(ewd->wl.xdg_shell, XDG_VERSION);
+        /* TODO: Add listener */
+     }
+
    /* allocate space for event structure */
    ev = calloc(1, sizeof(Ecore_Wl2_Event_Global));
    if (!ev) return;
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h 
b/src/lib/ecore_wl2/ecore_wl2_private.h
index edae5c3..2222f06 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -4,6 +4,9 @@
 # include "Ecore_Wl2.h"
 # include "Ecore_Input.h"
 
+# include "xdg-shell-client-protocol.h"
+# define XDG_VERSION 5
+
 extern int _ecore_wl2_log_dom;
 
 # ifdef ECORE_WL2_DEFAULT_LOG_COLOR
@@ -44,6 +47,12 @@ struct _Ecore_Wl2_Display
      {
         struct wl_display *display;
         struct wl_registry *registry;
+        struct wl_compositor *compositor;
+        struct wl_subcompositor *subcompositor;
+        struct wl_data_device_manager *data_device_manager;
+        struct wl_shm *shm;
+        struct wl_shell *wl_shell;
+        struct xdg_shell *xdg_shell;
      } wl;
 
    Ecore_Fd_Handler *fd_hdl;

-- 


Reply via email to