e_comp_wl_rsm: added provider's visibility change event and modified makefile 75/92875/5
authorMinJeong Kim <minjjj.kim@samsung.com>
Wed, 19 Oct 2016 07:50:24 +0000 (16:50 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 2 Nov 2016 02:06:16 +0000 (19:06 -0700)
- added E_EVENT_REMOTE_SURFACE_PROVIDER_VISIBILITY_CHANGE
- moved checking code for HAVE_REMOTE_SURFACE macros to inside of e_comp_wl_rsm

Change-Id: I10f12525e0600b6420b13c2888ac083362d7cf2f
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/Makefile.mk
src/bin/e_comp_wl.c
src/bin/e_comp_wl_rsm.c
src/bin/e_comp_wl_rsm.h
src/bin/e_includes.h

index 23f0ed2364b4b68ae5e9b8e35a98d417656ba788..8d081f3f3045691ef4e27ad1b2b01308cd4c8d7e 100644 (file)
@@ -91,13 +91,10 @@ src/bin/e_comp_wl.h
 if HAVE_WAYLAND_TBM
 ENLIGHTENMENTHEADERS += \
 src/bin/e_comp_wl_tbm.h
-if HAVE_REMOTE_SURFACE
-ENLIGHTENMENTHEADERS += \
- src/bin/e_comp_wl_rsm.h
-endif
 endif
 
 ENLIGHTENMENTHEADERS += \
+src/bin/e_comp_wl_rsm.h \
 src/bin/services/e_service_gesture.h \
 src/bin/services/e_service_lockscreen.h \
 src/bin/services/e_service_quickpanel.h \
@@ -183,13 +180,10 @@ $(ENLIGHTENMENTHEADERS)
 if HAVE_WAYLAND_TBM
 enlightenment_src += \
 src/bin/e_comp_wl_tbm.c
-if HAVE_REMOTE_SURFACE
-enlightenment_src += \
-src/bin/e_comp_wl_rsm.c
-endif
 endif
 
 enlightenment_src += \
+src/bin/e_comp_wl_rsm.c \
 src/bin/services/e_service_gesture.c \
 src/bin/services/e_service_lockscreen.c \
 src/bin/services/e_service_quickpanel.c \
@@ -207,15 +201,12 @@ src/bin/e_policy_wl.c \
 src/bin/e_policy_wl_display.c \
 src/bin/e_process.c
 
-src_bin_enlightenment_CPPFLAGS = $(E_CPPFLAGS) -DEFL_BETA_API_SUPPORT -DEFL_EO_API_SUPPORT -DE_LOGGING=1 @WAYLAND_CFLAGS@ $(TTRACE_CFLAGS) $(DLOG_CFLAGS) $(POLICY_CFLAGS)
+src_bin_enlightenment_CPPFLAGS = $(E_CPPFLAGS) -DEFL_BETA_API_SUPPORT -DEFL_EO_API_SUPPORT -DE_LOGGING=1 @WAYLAND_CFLAGS@ $(TTRACE_CFLAGS) $(DLOG_CFLAGS) $(POLICY_CFLAGS) @TIZEN_REMOTE_SURFACE_CFLAGS@
 if HAVE_LIBGOMP
 src_bin_enlightenment_CPPFLAGS += -fopenmp
 endif
 if HAVE_WAYLAND_TBM
 src_bin_enlightenment_CPPFLAGS += @WAYLAND_TBM_CFLAGS@ @ECORE_DRM_CFLAGS@
-if HAVE_REMOTE_SURFACE
-src_bin_enlightenment_CPPFLAGS += @TIZEN_REMOTE_SURFACE_CFLAGS@
-endif
 endif
 if HAVE_HWC
 src_bin_enlightenment_CPPFLAGS += @HWC_CFLAGS@
@@ -229,12 +220,9 @@ src_bin_enlightenment_LDFLAGS = -export-dynamic
 if HAVE_LIBGOMP
 src_bin_enlightenment_LDFLAGS += -fopenmp
 endif
-src_bin_enlightenment_LDADD = @e_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ -lm @SHM_OPEN_LIBS@ $(TTRACE_LIBS) $(DLOG_LIBS) $(POLICY_LIBS)
+src_bin_enlightenment_LDADD = @e_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ -lm @SHM_OPEN_LIBS@ $(TTRACE_LIBS) $(DLOG_LIBS) $(POLICY_LIBS) @TIZEN_REMOTE_SURFACE_LIBS@
 if HAVE_WAYLAND_TBM
 src_bin_enlightenment_LDADD += @WAYLAND_TBM_LIBS@ @ECORE_DRM_LIBS@
-if HAVE_REMOTE_SURFACE
-src_bin_enlightenment_LDADD += @TIZEN_REMOTE_SURFACE_LIBS@
-endif
 endif
 if HAVE_HWC
 src_bin_enlightenment_LDADD += @HWC_LIBS@
index 88b5c84ba643714a1aca9cdb1f20eee93811fb4c..10e919267ec3e6904a3f20e08ff5126af1c51b40 100644 (file)
@@ -2829,9 +2829,7 @@ _e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_res
      }
 
    if (e_comp_wl_subsurface_commit(ec)) return;
-#ifdef HAVE_REMOTE_SURFACE
    if (e_comp_wl_remote_surface_commit(ec)) return;
-#endif
 
    e_comp_wl_surface_commit(ec);
 
@@ -4739,10 +4737,8 @@ e_comp_wl_init(void)
 
 #ifdef HAVE_WAYLAND_TBM
    e_comp_wl_tbm_init();
-# ifdef HAVE_REMOTE_SURFACE
-   e_comp_wl_remote_surface_init();
-# endif
 #endif
+   e_comp_wl_remote_surface_init();
 
    e_pixmap_init();
 
@@ -4799,10 +4795,8 @@ e_comp_wl_shutdown(void)
 
 #ifdef HAVE_WAYLAND_TBM
    e_comp_wl_tbm_shutdown();
-# ifdef HAVE_REMOTE_SURFACE
-   e_comp_wl_remote_surface_shutdown();
-# endif
 #endif
+   e_comp_wl_remote_surface_shutdown();
 
    e_pixmap_shutdown();
 
index c3637667c5518828e420dbf3f94d0c5599a1cd05..819bf2694db2cda30766f5e14f55e2e961f1e5b4 100644 (file)
@@ -1,5 +1,7 @@
 #include "e.h"
-#include <tizen-remote-surface-server-protocol.h>
+#ifdef HAVE_REMOTE_SURFACE
+ #include <tizen-remote-surface-server-protocol.h>
+#endif /* HAVE_REMOTE_SURFACE */
 
 #define RSMINF(f, cp, ec, obj, ptr, x...)                            \
    do                                                                \
@@ -33,6 +35,9 @@
      }                                                               \
    while (0)
 
+E_API int E_EVENT_REMOTE_SURFACE_PROVIDER_VISIBILITY_CHANGE = -1;
+
+#ifdef HAVE_REMOTE_SURFACE
 typedef struct _E_Comp_Wl_Remote_Manager E_Comp_Wl_Remote_Manager;
 typedef struct _E_Comp_Wl_Remote_Provider E_Comp_Wl_Remote_Provider;
 typedef struct _E_Comp_Wl_Remote_Surface E_Comp_Wl_Remote_Surface;
@@ -283,6 +288,28 @@ _remote_provider_offscreen_set(E_Comp_Wl_Remote_Provider* provider, Eina_Bool se
           "PROVIDER", provider, set? "Set":"Unset");
 }
 
+static void
+_remote_provider_visible_event_free(void *data EINA_UNUSED, E_Event_Remote_Surface_Provider *ev)
+{
+   e_object_unref(E_OBJECT(ev->ec));
+   free(ev);
+}
+
+static void
+_remote_provider_visible_event_send(E_Comp_Wl_Remote_Provider *provider)
+{
+   E_Event_Remote_Surface_Provider *ev;
+
+   if (e_object_is_del(E_OBJECT(provider->ec))) return;
+
+   ev = E_NEW(E_Event_Remote_Surface_Provider, 1);
+   if (!ev) return;
+
+   ev->ec = provider->ec;
+   e_object_ref(E_OBJECT(provider->ec));
+   ecore_event_add(E_EVENT_REMOTE_SURFACE_PROVIDER_VISIBILITY_CHANGE, ev, (Ecore_End_Cb)_remote_provider_visible_event_free, NULL);
+}
+
 static void
 _remote_provider_visible_set(E_Comp_Wl_Remote_Provider *provider, Eina_Bool set)
 {
@@ -298,6 +325,8 @@ _remote_provider_visible_set(E_Comp_Wl_Remote_Provider *provider, Eina_Bool set)
         if (provider->vis_ref == 1)
           {
              provider->ec->visibility.obscured = E_VISIBILITY_UNOBSCURED;
+
+             _remote_provider_visible_event_send(provider);
              e_policy_client_visibility_send(provider->ec);
 
              tizen_remote_surface_provider_send_visibility
@@ -315,6 +344,8 @@ _remote_provider_visible_set(E_Comp_Wl_Remote_Provider *provider, Eina_Bool set)
         if (provider->vis_ref == 0)
           {
              provider->ec->visibility.obscured = E_VISIBILITY_FULLY_OBSCURED;
+
+             _remote_provider_visible_event_send(provider);
              e_policy_client_visibility_send(provider->ec);
 
              tizen_remote_surface_provider_send_visibility
@@ -1328,10 +1359,12 @@ _e_comp_wl_remote_surface_state_commit(E_Comp_Wl_Remote_Provider *provider, E_Co
         e_pixmap_image_clear(ec->pixmap, 1);
      }
 }
+#endif /* HAVE_REMOTE_SURFACE */
 
 EINTERN Eina_Bool
 e_comp_wl_remote_surface_commit(E_Client *ec)
 {
+#ifdef HAVE_REMOTE_SURFACE
    E_Comp_Wl_Remote_Provider *provider;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
@@ -1342,11 +1375,15 @@ e_comp_wl_remote_surface_commit(E_Client *ec)
    _e_comp_wl_remote_surface_state_commit(provider, &ec->comp_data->pending);
 
    return EINA_TRUE;
+#else
+   return EINA_FALSE;
+#endif /* HAVE_REMOTE_SURFACE */
 }
 
 EINTERN void
 e_comp_wl_remote_surface_init(void)
 {
+#ifdef HAVE_REMOTE_SURFACE
    E_Comp_Wl_Remote_Manager *rs_manager = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN(e_comp_wl);
@@ -1374,11 +1411,15 @@ e_comp_wl_remote_surface_init(void)
    rs_manager->surface_hash = eina_hash_pointer_new(NULL);
 
    _rsm = rs_manager;
+
+   E_EVENT_REMOTE_SURFACE_PROVIDER_VISIBILITY_CHANGE = ecore_event_type_new();
+#endif /* HAVE_REMOTE_SURFACE */
 }
 
 EINTERN void
 e_comp_wl_remote_surface_shutdown(void)
 {
+#ifdef HAVE_REMOTE_SURFACE
    E_Comp_Wl_Remote_Manager *rsm;
    E_Comp_Wl_Remote_Provider *provider;
    E_Comp_Wl_Remote_Surface *remote_surface;
@@ -1407,4 +1448,5 @@ e_comp_wl_remote_surface_shutdown(void)
    E_FREE_LIST(rsm->event_hdlrs, ecore_event_handler_del);
    wl_global_destroy(rsm->global);
    E_FREE(rsm);
+#endif /* HAVE_REMOTE_SURFACE */
 }
index aa6317f8bdc2d66dd365587e8dad5504fd0d34c1..10a0770a873137e323762bf08e464cac3a09e895 100644 (file)
@@ -1,4 +1,5 @@
 #ifdef E_TYPEDEFS
+typedef struct _E_Event_Remote_Surface_Provider E_Event_Remote_Surface_Provider;
 #else
 # ifndef E_COMP_WL_RSM_H
 #  define E_COMP_WL_RSM_H
@@ -7,5 +8,12 @@ EINTERN void      e_comp_wl_remote_surface_init(void);
 EINTERN void      e_comp_wl_remote_surface_shutdown(void);
 EINTERN Eina_Bool e_comp_wl_remote_surface_commit(E_Client *ec);
 
+E_API extern int E_EVENT_REMOTE_SURFACE_PROVIDER_VISIBILITY_CHANGE;
+
+struct _E_Event_Remote_Surface_Provider
+{
+   E_Client *ec;
+};
+
 # endif
 #endif
index 9537ce8934cd3668ea42b296fe95bc63e6d51058..c38348e413ea162f370f96c620307534fb86de74 100644 (file)
 #include "e_uuid_store.h"
 #ifdef HAVE_WAYLAND_TBM
 # include "e_comp_wl_tbm.h"
-# ifdef HAVE_REMOTE_SURFACE
-#  include "e_comp_wl_rsm.h"
-# endif
 #endif
+#include "e_comp_wl_rsm.h"
 #include "e_policy.h"
 #include "e_policy_visibility.h"
 #include "e_process.h"