From 3b97c8349396894c28944c2efa6207834cffe610 Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Thu, 11 May 2017 14:09:39 +0900 Subject: [PATCH] Add APIs for binding and unbinding window Change-Id: I0ae4e1aaff04896400047ed9867fd5c75f823cb6 Signed-off-by: Junghoon Park Signed-off-by: Hyunho Kang --- .../src/screen_connector_toolkit.c | 34 ++++++++++++++++++++++ .../include/screen_connector_toolkit_evas.h | 3 ++ .../src/screen_connector_toolkit_evas.c | 34 ++++++++++++++++++++++ 3 files changed, 71 insertions(+) diff --git a/screen_connector_watcher/src/screen_connector_toolkit.c b/screen_connector_watcher/src/screen_connector_toolkit.c index 0227d48..c79e6b5 100644 --- a/screen_connector_watcher/src/screen_connector_toolkit.c +++ b/screen_connector_watcher/src/screen_connector_toolkit.c @@ -493,3 +493,37 @@ EXPORT_API struct tizen_remote_surface *screen_connector_toolkit_get_trs(screen_ return h->surface; } + +EXPORT_API int screen_connector_toolkit_bind(screen_connector_toolkit_h h, + struct wl_surface *surface) +{ + struct tizen_remote_surface_manager *rsm = screen_connector_get_rsm(); + + if (!h || !rsm || !(h->surface)) { + LOGE("invalid argument %p %p", h, rsm); + + return -1; + } + + tizen_remote_surface_manager_bind_surface(rsm, surface, h->surface); + + return 0; +} + +EXPORT_API int screen_connector_toolkit_unbind(screen_connector_toolkit_h h) +{ + struct tizen_remote_surface_manager *rsm = screen_connector_get_rsm(); + + if (!h || !rsm || !(h->surface)) { + LOGE("invalid argument %p %p", h, rsm); + + return -1; + } + + tizen_remote_surface_manager_bind_surface(rsm, NULL, h->surface); + tizen_remote_surface_redirect(h->surface); + + return 0; +} + + diff --git a/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h b/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h index 4a6dabf..65c7724 100644 --- a/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h +++ b/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h @@ -75,6 +75,9 @@ int screen_connector_toolkit_evas_thaw_visibility(Evas_Object *obj); int screen_connector_toolkit_evas_send_visibility(Evas_Object *obj, visibility_type type); int screen_connector_toolkit_evas_send_mouse_up(Evas_Object *obj); int screen_connector_toolkit_evas_send_touch_cancel(Evas_Object *obj); +int screen_connector_toolkit_evas_bind(screen_connector_toolkit_evas_h h, Evas_Object *win); +int screen_connector_toolkit_evas_unbind(screen_connector_toolkit_evas_h h); + /** * @brief Add screen connector toolkit by rid. diff --git a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c index d2ef2f3..7a6182f 100644 --- a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c +++ b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c @@ -1118,3 +1118,37 @@ EXPORT_API int screen_connector_toolkit_evas_is_visible(Evas_Object *obj, bool * return 0; } + +EXPORT_API int screen_connector_toolkit_evas_bind(screen_connector_toolkit_evas_h h, + Evas_Object *win) +{ + struct wl_surface *surface; + Ecore_Wl_Window *wl_win; + + if (!h) + return -1; + + wl_win = elm_win_wl_window_get(win); + if (!wl_win) { + LOGE("failed to get wl_win"); + return -1; + } + + surface = ecore_wl_window_surface_get(wl_win); + if (!surface) { + LOGE("failed to get surface"); + return -1; + } + + return screen_connector_toolkit_bind(h->toolkit_h, surface); +} + +EXPORT_API int screen_connector_toolkit_evas_unbind(screen_connector_toolkit_evas_h h) +{ + if (!h || !(h->toolkit_h)) { + LOGE("invalid argument %p", h); + return -1; + } + + return screen_connector_toolkit_unbind(h->toolkit_h); +} -- 2.7.4