devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8c8334ad2d938ccbe31cae59ffeeadda969e1807

commit 8c8334ad2d938ccbe31cae59ffeeadda969e1807
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Tue Aug 18 11:56:07 2015 -0400

    ecore-wl2: Add ecore_wl2_display file to build order
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/Makefile_Ecore_Wl2.am             |  1 +
 src/lib/ecore_wl2/Ecore_Wl2.h         | 39 +++++++++++++++++++++++++++++++++++
 src/lib/ecore_wl2/ecore_wl2_display.c | 27 ++++++++++++++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/src/Makefile_Ecore_Wl2.am b/src/Makefile_Ecore_Wl2.am
index c12f4d5..6d758cc 100644
--- a/src/Makefile_Ecore_Wl2.am
+++ b/src/Makefile_Ecore_Wl2.am
@@ -8,6 +8,7 @@ installed_ecorewl2mainheadersdir = 
$(includedir)/ecore-wl2-@VMAJ@
 dist_installed_ecorewl2mainheaders_DATA = lib/ecore_wl2/Ecore_Wl2.h
 
 lib_ecore_wl2_libecore_wl2_la_SOURCES = \
+lib/ecore_wl2/ecore_wl2_display.c \
 lib/ecore_wl2/ecore_wl2.c \
 lib/ecore_wl2/ecore_wl2_private.h
 
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index ef33164..16ed703 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -7,6 +7,9 @@
 # include <wayland-cursor.h>
 # include <xkbcommon/xkbcommon.h>
 
+# define WL_HIDE_DEPRECATED
+# include <wayland-server.h>
+
 # ifdef EAPI
 #  undef EAPI
 # endif
@@ -74,6 +77,42 @@ EAPI int ecore_wl2_init(void);
  */
 EAPI int ecore_wl2_shutdown(void);
 
+/**
+ * @defgroup Ecore_Wl2_Display_Group Wayland Library Display Functions
+ * @ingroup Ecore_Wl2_Group
+ *
+ * Functions that deal with creating, connecting, or interacting with
+ * Wayland displays
+ */
+
+/**
+ * Create a new Wayland display
+ *
+ * @brief This function is typically used to create a new display for
+ * use with compositors, or to create a new display for use in nested
+ * compositors.
+ *
+ * @return The newly created wl_display
+ *
+ * @ingroup Ecore_Wl2_Display_Group
+ */
+EAPI struct wl_display *ecore_wl2_display_create(void);
+
+/**
+ * Connect to an existing Wayland display
+ *
+ * @brief This function is typically used by clients to connect to an
+ * existing wl_display.
+ *
+ * @param name The display target name to connect to. If @c NULL, the default
+ *             display is assumed.
+ *
+ * @return The wl_display which was connected to
+ *
+ * @ingroup Ecore_Wl2_Display_Group
+ */
+EAPI struct wl_display *ecore_wl2_display_connect(const char *name);
+
 /* # ifdef __cplusplus */
 /* } */
 /* # endif */
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c 
b/src/lib/ecore_wl2/ecore_wl2_display.c
new file mode 100644
index 0000000..a2057b7
--- /dev/null
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -0,0 +1,27 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ecore_wl2_private.h"
+
+EAPI struct wl_display *
+ecore_wl2_display_create(void)
+{
+   return wl_display_create();
+}
+
+EAPI struct wl_display *
+ecore_wl2_display_connect(const char *name)
+{
+   struct wl_display *disp;
+
+   /* try to connect to wayland display with this name */
+   disp = wl_display_connect(name);
+   if (!disp)
+     {
+        ERR("Could not connect to display %s: %m", name);
+        return NULL;
+     }
+
+   return disp;
+}

-- 


Reply via email to