typedef struct _Ecore_Wl_Event_Global Ecore_Wl_Event_Global;
typedef struct _Ecore_Wl_Event_Keymap_Update Ecore_Wl_Event_Keymap_Update;
typedef struct _Ecore_Wl_Event_Indicator_Flick Ecore_Wl_Event_Indicator_Flick;
+typedef struct _Ecore_Wl_Event_Clipboard_Data_Selected Ecore_Wl_Event_Clipboard_Data_Selected;
struct _Ecore_Wl_Event_Global
{
int type;
};
+struct _Ecore_Wl_Event_Clipboard_Data_Selected
+{
+ unsigned int win;
+};
/**
* @internal
*
EAPI extern int ECORE_WL_EVENT_GLOBAL_REMOVED;
EAPI extern int ECORE_WL_EVENT_KEYMAP_UPDATE;
EAPI extern int ECORE_WL_EVENT_INDICATOR_FLICK;
+EAPI extern int ECORE_WL_EVENT_CLIPBOARD_DATA_SELECTED;
/**
* @internal
EAPI Eina_Bool ecore_wl_window_clipboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h);
EAPI void ecore_wl_window_clipboard_state_set(Ecore_Wl_Window *win, Ecore_Wl_Clipboard_State state);
EAPI Ecore_Wl_Clipboard_State ecore_wl_window_clipboard_state_get(Ecore_Wl_Window *win);
+EAPI void ecore_wl_clipboard_show(Ecore_Wl_Window *win);
+EAPI void ecore_wl_clipboard_hide(Ecore_Wl_Window *win);
EAPI void ecore_wl_window_keyboard_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h);
EAPI Eina_Bool ecore_wl_window_keyboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h);
static void _ecore_wl_cb_effect_start(void *data EINA_UNUSED, struct tizen_effect *tizen_effect EINA_UNUSED, struct wl_surface *surface_resource, unsigned int type);
static void _ecore_wl_cb_effect_end(void *data EINA_UNUSED, struct tizen_effect *tizen_effect EINA_UNUSED, struct wl_surface *surface_resource, unsigned int type);
static void _ecore_wl_cb_indicator_flick(void *data EINA_UNUSED, struct tizen_indicator *tizen_indicator EINA_UNUSED, struct wl_surface *surface_resource, int type);
+static void _ecore_wl_cb_clipboard_data_selected(void *data EINA_UNUSED, struct tizen_clipboard *clipboard EINA_UNUSED, struct wl_surface *surface);
static void _ecore_wl_log_cb_print(const char *format, va_list args);
/* local variables */
static int _ecore_wl_init_count = 0;
_ecore_wl_cb_indicator_flick,
};
+static const struct tizen_clipboard_listener _ecore_tizen_clipboard_listener =
+{
+ _ecore_wl_cb_clipboard_data_selected,
+};
+
static void
xdg_shell_ping(void *data EINA_UNUSED, struct xdg_shell *shell, uint32_t serial)
{
EAPI int ECORE_WL_EVENT_GLOBAL_REMOVED = 0;
EAPI int ECORE_WL_EVENT_KEYMAP_UPDATE = 0;
EAPI int ECORE_WL_EVENT_INDICATOR_FLICK = 0;
+EAPI int ECORE_WL_EVENT_CLIPBOARD_DATA_SELECTED = 0;
static void
ECORE_WL_EVENT_GLOBAL_REMOVED = ecore_event_type_new();
ECORE_WL_EVENT_KEYMAP_UPDATE = ecore_event_type_new();
ECORE_WL_EVENT_INDICATOR_FLICK = ecore_event_type_new();
+ ECORE_WL_EVENT_CLIPBOARD_DATA_SELECTED = ecore_event_type_new();
}
wl_log_set_handler_client(_ecore_wl_log_cb_print);
tizen_effect_destroy(_ecore_wl_disp->wl.tz_effect);
if (_ecore_wl_disp->wl.tz_indicator)
tizen_indicator_destroy(_ecore_wl_disp->wl.tz_indicator);
+ if (_ecore_wl_disp->wl.tz_clipboard)
+ tizen_clipboard_destroy(_ecore_wl_disp->wl.tz_clipboard);
if (_ecore_wl_disp->cursor_theme)
wl_cursor_theme_destroy(_ecore_wl_disp->cursor_theme);
if (_ecore_wl_disp->wl.display)
if (ewd->wl.tz_indicator)
tizen_indicator_add_listener(ewd->wl.tz_indicator, &_ecore_tizen_indicator_listener, ewd->wl.display);
}
+ else if (!strcmp(interface, "tizen_clipboard"))
+ {
+ ewd->wl.tz_clipboard =
+ wl_registry_bind(registry, id, &tizen_clipboard_interface, 1);
+ if (ewd->wl.tz_clipboard)
+ tizen_clipboard_add_listener(ewd->wl.tz_clipboard, &_ecore_tizen_clipboard_listener, ewd->wl.display);
+ }
if ((ewd->wl.compositor) && (ewd->wl.shm) &&
((ewd->wl.shell) || (ewd->wl.xdg_shell)))
ecore_event_add(ECORE_WL_EVENT_INDICATOR_FLICK, ev, NULL, NULL);
}
+static void
+_ecore_wl_cb_clipboard_data_selected(void *data EINA_UNUSED, struct tizen_clipboard *tizen_clipboard EINA_UNUSED, struct wl_surface *surface)
+{
+ Ecore_Wl_Window *win = NULL;
+ Ecore_Wl_Event_Clipboard_Data_Selected *ev;
+
+ if (!surface) return;
+ win = ecore_wl_window_surface_find(surface);
+ if (!win) return;
+
+ if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Clipboard_Data_Selected)))) return;
+ ev->win = win->id;
+
+ ecore_event_add(ECORE_WL_EVENT_CLIPBOARD_DATA_SELECTED, ev, NULL, NULL);
+}
+
static void
_ecore_wl_log_cb_print(const char *format, va_list args)
{
return win->clipboard.state;
}
+EAPI void
+ecore_wl_clipboard_show(Ecore_Wl_Window *win)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!win) return;
+ if (!win->surface) return;
+ if (!_ecore_wl_disp->wl.tz_clipboard) return;
+
+ tizen_clipboard_show(_ecore_wl_disp->wl.tz_clipboard, win->surface);
+}
+
+EAPI void
+ecore_wl_clipboard_hide(Ecore_Wl_Window *win)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!win) return;
+ if (!win->surface) return;
+ if (!_ecore_wl_disp->wl.tz_clipboard) return;
+
+ tizen_clipboard_hide(_ecore_wl_disp->wl.tz_clipboard, win->surface);
+}
+
void
ecore_wl_window_keyboard_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h)
{