EINA_DEPRECATED EAPI Eina_Bool
ecore_wl_dnd_set_selection(Ecore_Wl_Dnd *dnd, const char **types_offered)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
return ecore_wl_dnd_selection_set(dnd->input, types_offered);
}
EINA_DEPRECATED EAPI Eina_Bool
ecore_wl_dnd_get_selection(Ecore_Wl_Dnd *dnd, const char *type)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
return ecore_wl_dnd_selection_get(dnd->input, type);
}
const char **type;
char **t;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!input) return EINA_FALSE;
man = input->display->wl.data_device_manager;
if (input->data_source) wl_data_source_destroy(input->data_source);
input->data_source = NULL;
+ if (!types_offered[0]) return EINA_FALSE;
+
/* try to create a new data source */
if (!(input->data_source = wl_data_device_manager_create_data_source(man)))
return EINA_FALSE;
{
char **t;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* check for valid input and selection source */
if ((!input) || (!input->selection_source)) return EINA_FALSE;
- wl_array_for_each(t, &input->selection_source->types)
- if (!strcmp(type, *t)) break;
+ for (t = input->selection_source->types.data; *t; t++)
+ {
+ if (!strcmp(type, *t)) break;
+ }
if (!*t) return EINA_FALSE;
EAPI Eina_Bool
ecore_wl_dnd_selection_owner_has(Ecore_Wl_Input *input)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!input) return EINA_FALSE;
return (input->selection_source != NULL);
}
EAPI Eina_Bool
ecore_wl_dnd_selection_clear(Ecore_Wl_Input *input)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* check for valid input */
if (!input) return EINA_FALSE;
{
struct wl_surface *drag_surface;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* check for valid input. if not, get the default one */
if (!input) input = _ecore_wl_disp->input;
{
Ecore_Wl_Event_Dnd_End *ev;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* check for valid input. if not, get the default one */
if (!input) input = _ecore_wl_disp->input;
{
char **t;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* check for valid input and drag source */
if ((!input) || (!input->drag_source)) return EINA_FALSE;
const char **type;
char **t;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* check for valid input. if not, get the default one */
if (!input) input = _ecore_wl_disp->input;
EAPI struct wl_array *
ecore_wl_dnd_drag_types_get(Ecore_Wl_Input *input)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* check for valid input. if not, get the default one */
if (!input) input = _ecore_wl_disp->input;
{
Ecore_Wl_Dnd_Source *source;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!(source = malloc(sizeof(Ecore_Wl_Dnd_Source))))
return;
char **types;
int num = 0;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!(input = data)) return;
win = ecore_wl_window_surface_find(surface);
Ecore_Wl_Event_Dnd_Leave *ev;
Ecore_Wl_Input *input;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!(input = data)) return;
if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Dnd_Leave)))) return;
Ecore_Wl_Event_Dnd_Position *ev;
Ecore_Wl_Input *input;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!(input = data)) return;
input->sx = wl_fixed_to_int(x);
Ecore_Wl_Event_Dnd_Drop *ev;
Ecore_Wl_Input *input;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!(input = data)) return;
if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Dnd_Drop)))) return;
{
Ecore_Wl_Input *input;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!(input = data)) return;
if (input->selection_source) _ecore_wl_dnd_del(input->selection_source);
+ input->selection_source = NULL;
if (offer)
{
t = wl_array_add(&input->selection_source->types, sizeof(*t));
*t = NULL;
}
- else
- input->selection_source = NULL;
}
void
_ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!source) return;
source->refcount--;
if (source->refcount == 0)
struct _dnd_read_ctx *read_ctx = NULL;
int p[2];
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (pipe2(p, O_CLOEXEC) == -1)
return;
Ecore_Wl_Event_Selection_Data_Ready *event;
Eina_Bool ret;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
source = data;
len = read(source->fd, buffer, sizeof buffer);
struct _dnd_task *task;
int count, i;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
ctx = data;
count = epoll_wait(ctx->epoll_fd, ctx->ep, 1, 0);
for (i = 0; i < count; i++)
static void
_ecore_wl_dnd_source_cb_cancelled(void *data EINA_UNUSED, struct wl_data_source *source)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
/* FIXME: Raise an Ecore_Wl_Event here */
wl_data_source_destroy(source);
}
Ecore_Wl_Dnd_Source *source;
char **t;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
if (!(source = data)) return;
t = wl_array_add(&source->types, sizeof(*t));