discomfitor pushed a commit to branch master.

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

commit e919734df71499cc102f678d17679efa15736973
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Mon Mar 21 17:24:24 2016 -0400

    extend wl extension macros to store globals into extension data
---
 src/bin/e_comp_wl.h            |  5 +++++
 src/bin/e_comp_wl_extensions.c | 10 ++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index cefe97d..ac63aa0 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -96,9 +96,14 @@ typedef struct E_Comp_Wl_Extension_Data
 {
    struct
    {
+      struct wl_resource *global;
       struct wl_client *client;
       void (*read_pixels)(E_Comp_Wl_Output *output, void *pixels);
    } screenshooter;
+    struct
+    {
+       struct wl_resource *global;
+    } session_recovery;
 } E_Comp_Wl_Extension_Data;
 
 struct _E_Comp_Wl_Data
diff --git a/src/bin/e_comp_wl_extensions.c b/src/bin/e_comp_wl_extensions.c
index 5ee0091..57644ac 100644
--- a/src/bin/e_comp_wl_extensions.c
+++ b/src/bin/e_comp_wl_extensions.c
@@ -81,7 +81,12 @@ static const struct screenshooter_interface 
_e_screenshooter_interface =
    _e_comp_wl_screenshooter_cb_shoot
 };
 
-#define GLOBAL_BIND_CB(NAME, IFACE) \
+#define GLOBAL_BIND_CB(NAME, IFACE, ...) \
+static void \
+_e_comp_wl_##NAME##_cb_unbind(struct wl_resource *resource EINA_UNUSED) \
+{ \
+   e_comp_wl->extensions->NAME.global = NULL; \
+} \
 static void \
 _e_comp_wl_##NAME##_cb_bind(struct wl_client *client, void *data EINA_UNUSED, 
uint32_t version EINA_UNUSED, uint32_t id) \
 { \
@@ -94,7 +99,8 @@ _e_comp_wl_##NAME##_cb_bind(struct wl_client *client, void 
*data EINA_UNUSED, ui
         return;\
      }\
 \
-   wl_resource_set_implementation(res, &_e_##NAME##_interface, NULL, NULL);\
+   e_comp_wl->extensions->NAME.global = res; \
+   wl_resource_set_implementation(res, &_e_##NAME##_interface, NULL, 
_e_comp_wl_##NAME##_cb_unbind);\
 }
 
 GLOBAL_BIND_CB(session_recovery, zwp_e_session_recovery_interface)

-- 


Reply via email to