From d76cc70e6079cc3d8504dd483796284f2297bf21 Mon Sep 17 00:00:00 2001 From: Hyunho Kang Date: Tue, 22 Aug 2017 11:44:59 +0900 Subject: [PATCH] Add filter feature for screen_connector_toolkit Change-Id: I7aceb0ab0c9e1f6ac55532b69f1a23d68b267210 Signed-off-by: Hyunho Kang --- .../include/screen_connector_toolkit.h | 11 ++++++++++ .../src/screen_connector_toolkit.c | 24 ++++++++++++++++++++++ .../include/screen_connector_toolkit_evas.h | 10 +++++++++ .../src/screen_connector_toolkit_evas.c | 8 ++++++++ 4 files changed, 53 insertions(+) diff --git a/screen_connector_watcher/include/screen_connector_toolkit.h b/screen_connector_watcher/include/screen_connector_toolkit.h index a614720..a1d215e 100644 --- a/screen_connector_watcher/include/screen_connector_toolkit.h +++ b/screen_connector_watcher/include/screen_connector_toolkit.h @@ -25,6 +25,14 @@ extern "C" { #endif typedef enum { + SCREEN_CONNECTOR_CHANGED_EVENT_FILTER_NONE = TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_NONE, + SCREEN_CONNECTOR_CHANGED_EVENT_FILTER_TBM = TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_TBM, + SCREEN_CONNECTOR_CHANGED_EVENT_FILTER_IMAGE_FILE = TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_IMAGE_FILE, + SCREEN_CONNECTOR_CHANGED_EVENT_FILTER_ALL = + TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_TBM | TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_IMAGE_FILE, +} screen_connector_changed_event_filter_type; + +typedef enum { SCREEN_CONNECTOR_INPUT_TYPE_MOUSE_UP_DOWN = TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILTER_MOUSE_UP_DOWN, SCREEN_CONNECTOR_INPUT_TYPE_MOUSE_MOVE_X = TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILTER_MOUSE_MOVE_X, SCREEN_CONNECTOR_INPUT_TYPE_MOUSE_MOVE_Y = TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILTER_MOUSE_MOVE_Y, @@ -85,6 +93,9 @@ int screen_connector_toolkit_bind(screen_connector_toolkit_h h, struct wl_surfac int screen_connector_toolkit_unbind(screen_connector_toolkit_h h); bool screen_connector_toolkit_is_exist(char *id, screen_connector_screen_type_e type); +int screen_connector_toolkit_set_changed_event_filter( + screen_connector_toolkit_h h, + screen_connector_changed_event_filter_type type); #ifdef __cplusplus } diff --git a/screen_connector_watcher/src/screen_connector_toolkit.c b/screen_connector_watcher/src/screen_connector_toolkit.c index 12f49d5..66573d0 100644 --- a/screen_connector_watcher/src/screen_connector_toolkit.c +++ b/screen_connector_watcher/src/screen_connector_toolkit.c @@ -53,6 +53,7 @@ struct _screen_connector_toolkit_h { struct _screen_connector_type_h *type_h; void *data; struct wl_surface *bind_surface; + screen_connector_changed_event_filter_type changed_filter; }; static GHashTable *__type_table; @@ -110,6 +111,9 @@ EXPORT_API int screen_connector_toolkit_redirect_surface(screen_connector_toolki LOGD("resource_id : %d, (%p), %s", toolkit_h->surface_id, toolkit_h->surface, toolkit_h->instance_id); tizen_remote_surface_add_listener(toolkit_h->surface, &__rs_listener, toolkit_h); tizen_remote_surface_redirect(toolkit_h->surface); + tizen_remote_surface_set_changed_buffer_event_filter(toolkit_h->surface, + toolkit_h->changed_filter); + LOGD("set filter [%d] for [%s]", toolkit_h->changed_filter, toolkit_h->instance_id); if (toolkit_h->bind_surface != NULL) tizen_remote_surface_manager_bind_surface(rsm, toolkit_h->bind_surface, toolkit_h->surface); @@ -279,6 +283,7 @@ EXPORT_API screen_connector_toolkit_h screen_connector_toolkit_add_by_rid(screen toolkit_h->data = data; toolkit_h->ops = ops_copy; toolkit_h->type_h = type_h; + toolkit_h->changed_filter = SCREEN_CONNECTOR_CHANGED_EVENT_FILTER_NONE; if (type_h->toolkit_table == NULL) type_h->toolkit_table = g_hash_table_new_full(g_str_hash, @@ -338,6 +343,7 @@ EXPORT_API screen_connector_toolkit_h screen_connector_toolkit_add_with_surface( toolkit_h->ops = ops_copy; toolkit_h->type_h = type_h; toolkit_h->bind_surface = surface; + toolkit_h->changed_filter = SCREEN_CONNECTOR_CHANGED_EVENT_FILTER_NONE; if (type_h->toolkit_table == NULL) type_h->toolkit_table = g_hash_table_new_full(g_str_hash, @@ -414,6 +420,7 @@ EXPORT_API screen_connector_toolkit_h screen_connector_toolkit_add(screen_connec toolkit_h->data = data; toolkit_h->ops = ops_copy; toolkit_h->type_h = type_h; + toolkit_h->changed_filter = SCREEN_CONNECTOR_CHANGED_EVENT_FILTER_NONE; if (type_h->toolkit_table == NULL) type_h->toolkit_table = g_hash_table_new_full(g_str_hash, @@ -554,3 +561,20 @@ EXPORT_API int screen_connector_toolkit_unbind(screen_connector_toolkit_h h) } +EXPORT_API int screen_connector_toolkit_set_changed_event_filter( + screen_connector_toolkit_h h, + screen_connector_changed_event_filter_type type) +{ + if (h == NULL) { + LOGE("Invalid param"); + return -1; + } + + tizen_remote_surface_set_changed_buffer_event_filter(h->surface, type); + h->changed_filter = type; + LOGD("set filter [%d] for [%s]", + h->changed_filter, h->instance_id); + + 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 31164d6..58073ed 100644 --- a/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h +++ b/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h @@ -38,6 +38,13 @@ extern "C" { * @addtogroup CAPI_SCREEN_CONNECTOR_WATCHER_EVAS_MODULE * @{ */ +typedef enum { + SCREEN_CONNECTOR_EVAS_CHANGED_EVENT_FILTER_NONE = TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_NONE, + SCREEN_CONNECTOR_EVAS_CHANGED_EVENT_FILTER_TBM = TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_TBM, + SCREEN_CONNECTOR_EVAS_CHANGED_EVENT_FILTER_IMAGE_FILE = TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_IMAGE_FILE, + SCREEN_CONNECTOR_EVAS_CHANGED_EVENT_FILTER_ALL = + TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_TBM | TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_IMAGE_FILE, +} screen_connector_evas_changed_event_filter_type; typedef enum { VISIBILITY_TYPE_UNOBSCURED, @@ -116,6 +123,9 @@ screen_connector_toolkit_evas_h screen_connector_toolkit_evas_add_with_win(scree int screen_connector_toolkit_evas_is_visible(Evas_Object *obj, bool *is_visible); visibility_type screen_connector_toolkit_evas_auto_visibility( screen_connector_toolkit_evas_h h); +int screen_connector_toolkit_evas_set_changed_event_filter( + screen_connector_toolkit_evas_h toolkit_evas_h, + screen_connector_evas_changed_event_filter_type type); /** * @} 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 c4bbf2c..8c5544b 100644 --- a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c +++ b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c @@ -1531,3 +1531,11 @@ EXPORT_API visibility_type screen_connector_toolkit_evas_auto_visibility( return h->auto_visibility; } + +EXPORT_API int screen_connector_toolkit_evas_set_changed_event_filter( + screen_connector_toolkit_evas_h toolkit_evas_h, + screen_connector_evas_changed_event_filter_type type) +{ + return screen_connector_toolkit_set_changed_event_filter( + toolkit_evas_h->toolkit_h, type); +} -- 2.7.4