ecore_wl2: add api to set data only mode for using clipboard
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 15 Nov 2017 00:12:41 +0000 (09:12 +0900)
committerJiyoun Park <jy0703.park@samsung.com>
Tue, 19 Dec 2017 08:20:07 +0000 (17:20 +0900)
@tizen_feature

Change-Id: If43ac2d3d60fc5831041936534bab691ef21d313

src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_display.c
src/lib/ecore_wl2/ecore_wl2_private.h
src/lib/ecore_wl2/ecore_wl2_window.c

index 8107c00..2d12ebe 100644 (file)
@@ -1815,6 +1815,7 @@ EAPI void ecore_wl2_window_clipboard_state_set(Ecore_Wl2_Window *win, Ecore_Wl2_
 EAPI Ecore_Wl2_Clipboard_State ecore_wl2_window_clipboard_state_get(Ecore_Wl2_Window *win);
 EAPI void ecore_wl2_clipboard_show(Ecore_Wl2_Window *win);
 EAPI void ecore_wl2_clipboard_hide(Ecore_Wl2_Window *win);
+EAPI Eina_Bool ecore_wl2_clipboard_data_only_set(Eina_Bool data_only);
 //
 
 // TIZEN_ONLY(20171108) : add functions for keyboard
index 8a7a240..fd470f9 100644 (file)
@@ -589,8 +589,19 @@ _tizen_clipboard_cb_data_selected(void *data, struct tizen_clipboard *tizen_clip
 }
 
 static void
-_tizen_clipboard_cb_allowed_data_only(void *data EINA_UNUSED, struct tizen_clipboard *tizen_clipboard EINA_UNUSED, uint32_t allowed EINA_UNUSED)
+_tizen_clipboard_cb_allowed_data_only(void *data, struct tizen_clipboard *tizen_clipboard EINA_UNUSED, uint32_t allowed)
 {
+   Ecore_Wl2_Display *ewd = NULL;
+   Ecore_Wl2_Input *input = NULL;
+
+   ewd = data;
+   input = ecore_wl2_input_default_input_get(ewd);
+   if (!input) return;
+
+   if (allowed)
+     input->is_data_only = EINA_TRUE;
+   else
+     input->is_data_only = EINA_FALSE;
 }
 
 static const struct tizen_clipboard_listener _tizen_clipboard_listener =
index 940a486..daf153d 100644 (file)
@@ -620,6 +620,9 @@ struct _Ecore_Wl2_Input
       uint32_t enter_serial;
       Ecore_Window window_id;
    } drag, selection;
+// TIZEN_ONLY(20170227) : tizen clipboard v2
+   Eina_Bool is_data_only;
+//
 
    unsigned int seat_version;
    unsigned int id;
index 9901a82..6b62ac5 100644 (file)
@@ -2453,6 +2453,25 @@ ecore_wl2_clipboard_hide(Ecore_Wl2_Window *win)
 
    tizen_clipboard_hide(win->display->wl.tz_clipboard, win->surface);
 }
+
+EAPI Eina_Bool
+ecore_wl2_clipboard_data_only_set(Eina_Bool data_only)
+{
+   Ecore_Wl2_Display *ewd = NULL;
+   Ecore_Wl2_Input *input = NULL;
+
+   ewd = ecore_wl2_connected_display_get(NULL);
+   if (!ewd) return EINA_FALSE;
+   input = ecore_wl2_input_default_input_get(ewd);
+   if (!input) return EINA_FALSE;
+
+   if (!ewd->wl.tz_clipboard) return EINA_FALSE;
+
+   tizen_clipboard_set_data_only(ewd->wl.tz_clipboard, data_only);
+   ecore_wl2_display_sync(ewd);
+
+   return input->is_data_only;
+}
 //
 
 // TIZEN_ONLY(20171108) : add functions for keyboard
@@ -2893,4 +2912,4 @@ ecore_wl2_window_ignore_output_transform_get(Ecore_Wl2_Window *window)
 {
    return window->ignore_output_transform;
 }
-//
\ No newline at end of file
+//