more work on the xdnd code... pending e17 commit
SVN revision: 5755
This commit is contained in:
parent
794d7739ea
commit
e1cc039289
|
@ -813,6 +813,8 @@ extern "C"
|
|||
void *ecore_dnd_selection_get(Window win, Window req, Atom type,
|
||||
int *size);
|
||||
void ecore_dnd_set_data(Window win);
|
||||
void ecore_dnd_set_action(Window win);
|
||||
|
||||
void ecore_dnd_send_data(Window win, Window source_win,
|
||||
void *data, int size, Atom dest_atom,
|
||||
int type);
|
||||
|
|
|
@ -903,12 +903,7 @@ ecore_event_x_handle_selection_notify(XEvent * xevent)
|
|||
{
|
||||
buf[i] = 0;
|
||||
e->num_files++;
|
||||
if (e->files)
|
||||
{
|
||||
REALLOC_PTR(e->files, e->num_files);
|
||||
}
|
||||
else
|
||||
e->files = NEW_PTR(e->num_files);
|
||||
REALLOC_PTR(e->files, e->num_files);
|
||||
e->files[e->num_files - 1] = strdup(buf);
|
||||
buf[0] = 0;
|
||||
i = 0;
|
||||
|
@ -917,6 +912,13 @@ ecore_event_x_handle_selection_notify(XEvent * xevent)
|
|||
is++;
|
||||
}
|
||||
}
|
||||
if (i > 0)
|
||||
{
|
||||
buf[i] = 0;
|
||||
e->num_files++;
|
||||
REALLOC_PTR(e->files, e->num_files);
|
||||
e->files[e->num_files - 1] = strdup(buf);
|
||||
}
|
||||
FREE(buf);
|
||||
FREE(data);
|
||||
}
|
||||
|
@ -1056,7 +1058,8 @@ ecore_event_x_handle_client_message(XEvent * xevent)
|
|||
ECORE_ATOM(atom_xdndactionlink, "XdndActionLink");
|
||||
ECORE_ATOM(atom_xdndactionmove, "XdndActionMove");
|
||||
ECORE_ATOM(atom_text_uri_list, "text/uri-list");
|
||||
/* forst type = delete event sent to client */
|
||||
|
||||
/* first type = delete event sent to client */
|
||||
if ((xevent->xclient.message_type == atom_wm_protocols) &&
|
||||
(xevent->xclient.format == 32) &&
|
||||
(xevent->xclient.data.l[0] == (long)atom_wm_delete_window))
|
||||
|
@ -1072,9 +1075,9 @@ ecore_event_x_handle_client_message(XEvent * xevent)
|
|||
(xevent->xclient.format == 32))
|
||||
{
|
||||
/* if ((xevent->xclient.data.l[2] == (long)atom_text_uri_list) ||
|
||||
(xevent->xclient.data.l[3] == (long)atom_text_uri_list) ||
|
||||
(xevent->xclient.data.l[4] == (long)atom_text_uri_list))
|
||||
*/ {
|
||||
* (xevent->xclient.data.l[3] == (long)atom_text_uri_list) ||
|
||||
* (xevent->xclient.data.l[4] == (long)atom_text_uri_list))
|
||||
*/ {
|
||||
Ecore_Event_Dnd_Drop_Request *e;
|
||||
|
||||
|
||||
|
|
|
@ -2175,33 +2175,41 @@ ecore_dnd_selection_get(Window win, Window req, Atom type, int *size)
|
|||
void
|
||||
ecore_dnd_set_data(Window win)
|
||||
{
|
||||
static int atom_xdndactioncopy = 0;
|
||||
static int atom_xdndactionmove = 0;
|
||||
static int atom_xdndactionlink = 0;
|
||||
static int atom_xdndactionask = 0;
|
||||
static Atom atom_xdndactionlist = 0;
|
||||
static Atom atom_xdndselection = 0;
|
||||
static Atom atom_xdndselection = 0;
|
||||
|
||||
if (!disp) return;
|
||||
ECORE_ATOM(atom_xdndactioncopy, "XdndActionCopy");
|
||||
ECORE_ATOM(atom_xdndactionmove, "XdndActionMove");
|
||||
ECORE_ATOM(atom_xdndactionlink, "XdndActionLink");
|
||||
ECORE_ATOM(atom_xdndactionask, "XdndActionAsk");
|
||||
ECORE_ATOM(atom_xdndactionlist, "XdndActionList");
|
||||
ECORE_ATOM(atom_xdndselection, "XdndSelection");
|
||||
if (dnd_copy)
|
||||
ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32,
|
||||
&atom_xdndactioncopy, 1);
|
||||
else if (dnd_link)
|
||||
ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32,
|
||||
&atom_xdndactionlink, 1);
|
||||
else if (dnd_move)
|
||||
ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32,
|
||||
&atom_xdndactionmove, 1);
|
||||
else
|
||||
ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32,
|
||||
&atom_xdndactionask, 1);
|
||||
XSetSelectionOwner(disp, atom_xdndselection, win, CurrentTime);
|
||||
ECORE_ATOM(atom_xdndselection, "XdndSelection");
|
||||
ecore_dnd_set_action(win);
|
||||
XSetSelectionOwner(disp, atom_xdndselection, win, CurrentTime);
|
||||
}
|
||||
|
||||
void
|
||||
ecore_dnd_set_action(Window win)
|
||||
{
|
||||
static int atom_xdndactioncopy = 0;
|
||||
static int atom_xdndactionmove = 0;
|
||||
static int atom_xdndactionlink = 0;
|
||||
static int atom_xdndactionask = 0;
|
||||
static Atom atom_xdndactionlist = 0;
|
||||
|
||||
if (!disp) return;
|
||||
ECORE_ATOM(atom_xdndactioncopy, "XdndActionCopy");
|
||||
ECORE_ATOM(atom_xdndactionmove, "XdndActionMove");
|
||||
ECORE_ATOM(atom_xdndactionlink, "XdndActionLink");
|
||||
ECORE_ATOM(atom_xdndactionask, "XdndActionAsk");
|
||||
ECORE_ATOM(atom_xdndactionlist, "XdndActionList");
|
||||
if (dnd_copy)
|
||||
ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32,
|
||||
&atom_xdndactioncopy, 1);
|
||||
else if (dnd_link)
|
||||
ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32,
|
||||
&atom_xdndactionlink, 1);
|
||||
else if (dnd_move)
|
||||
ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32,
|
||||
&atom_xdndactionmove, 1);
|
||||
else
|
||||
ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32,
|
||||
&atom_xdndactionask, 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue