From: Junghoon Park Date: Thu, 11 May 2017 05:09:39 +0000 (+0900) Subject: Add APIs for binding and unbinding window X-Git-Tag: submit/tizen_3.0/20170612.051238^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F92%2F133392%2F1;p=platform%2Fcore%2Fappfw%2Fscreen-connector.git Add APIs for binding and unbinding window Change-Id: I0ae4e1aaff04896400047ed9867fd5c75f823cb6 Signed-off-by: Junghoon Park Signed-off-by: Hyunho Kang --- 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); +}