Add APIs for binding and unbinding window 78/128678/4
authorJunghoon Park <jh9216.park@samsung.com>
Thu, 11 May 2017 05:09:39 +0000 (14:09 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Fri, 19 May 2017 02:03:35 +0000 (02:03 +0000)
Change-Id: I0ae4e1aaff04896400047ed9867fd5c75f823cb6
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
screen_connector_watcher/include/screen_connector_toolkit.h
screen_connector_watcher/src/screen_connector_toolkit.c
screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h
screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c

index 39968b1..8b8a80d 100644 (file)
@@ -81,6 +81,9 @@ int screen_connector_toolkit_redirect_surface(screen_connector_toolkit_h info);
 screen_connector_toolkit_h screen_connector_toolkit_add_with_surface(screen_connector_toolkit_ops *ops, char *id,
        screen_connector_screen_type_e type, struct wl_surface *surface, void *data);
 
+int screen_connector_toolkit_bind(screen_connector_toolkit_h h, struct wl_surface *surface);
+int screen_connector_toolkit_unbind(screen_connector_toolkit_h h);
+
 #ifdef __cplusplus
 }
 #endif
index 3a36df2..d1747b2 100644 (file)
@@ -474,3 +474,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;
+}
+
+
index 7cd665d..95ed241 100644 (file)
@@ -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.
index 856d363..631b767 100644 (file)
@@ -1126,3 +1126,37 @@ EXPORT_API int screen_connector_toolkit_evas_get_pid(Evas_Object *obj, int *pid)
 
        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);
+}