parent
7bea0bab55
commit
794d7739ea
|
@ -85,6 +85,11 @@
|
|||
_p = _p->next; \
|
||||
}
|
||||
|
||||
#define DND_TYPE_URI_LIST 0
|
||||
#define DND_TYPE_PLAIN_TEXT 1
|
||||
#define DND_TYPE_MOZ_URL 2
|
||||
#define DND_TYPE_NETSCAPE_URL 3
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
|
@ -458,8 +463,11 @@ extern "C"
|
|||
typedef struct _ecore_event_dnd_data_request
|
||||
{
|
||||
Window win, root, source_win;
|
||||
int plain_text;
|
||||
Atom destination_atom;
|
||||
int plain_text;
|
||||
int uri_list;
|
||||
int moz_url;
|
||||
int netscape_url;
|
||||
} Ecore_Event_Dnd_Data_Request;
|
||||
|
||||
typedef struct _ecore_event_child
|
||||
|
@ -807,7 +815,7 @@ extern "C"
|
|||
void ecore_dnd_set_data(Window win);
|
||||
void ecore_dnd_send_data(Window win, Window source_win,
|
||||
void *data, int size, Atom dest_atom,
|
||||
int plain_text);
|
||||
int type);
|
||||
void ecore_dnd_set_mode_copy(void);
|
||||
void ecore_dnd_set_mode_link(void);
|
||||
void ecore_dnd_set_mode_move(void);
|
||||
|
|
|
@ -942,11 +942,17 @@ ecore_event_x_handle_selection_request(XEvent * xevent)
|
|||
{
|
||||
static Atom atom_xdndselection = 0;
|
||||
static Atom atom_text_plain = 0;
|
||||
static Atom atom_text_uri_list = 0;
|
||||
static Atom atom_text_moz_url = 0;
|
||||
static Atom atom_netscape_url = 0;
|
||||
static Atom atom_text_selection = 0;
|
||||
Ecore_Event_Dnd_Data_Request *e;
|
||||
|
||||
ECORE_ATOM(atom_xdndselection, "XdndSelection");
|
||||
ECORE_ATOM(atom_text_plain, "text/plain");
|
||||
ECORE_ATOM(atom_text_uri_list, "text/uri-list");
|
||||
ECORE_ATOM(atom_text_moz_url, "text/x-moz-url");
|
||||
ECORE_ATOM(atom_netscape_url, "_NETSCAPE_URL");
|
||||
ECORE_ATOM(atom_text_selection, "TEXT_SELECTION");
|
||||
if (xevent->xselectionrequest.selection == atom_xdndselection)
|
||||
{
|
||||
|
@ -954,10 +960,15 @@ ecore_event_x_handle_selection_request(XEvent * xevent)
|
|||
e->win = xevent->xselectionrequest.owner;
|
||||
e->root = ecore_window_get_root(e->win);
|
||||
e->source_win = xevent->xselectionrequest.requestor;
|
||||
if (xevent->xselectionrequest.target == atom_text_plain)
|
||||
e->plain_text = 1;
|
||||
else
|
||||
e->plain_text = 0;
|
||||
e->plain_text =0;
|
||||
e->uri_list = 0;
|
||||
e->moz_url = 0;
|
||||
e->netscape_url = 0;
|
||||
|
||||
if (xevent->xselectionrequest.target == atom_text_plain) e->plain_text = 1;
|
||||
if (xevent->xselectionrequest.target == atom_text_uri_list) e->uri_list = 1;
|
||||
if (xevent->xselectionrequest.target == atom_text_moz_url) e->moz_url = 1;
|
||||
if (xevent->xselectionrequest.target == atom_netscape_url) e->netscape_url = 1;
|
||||
e->destination_atom = xevent->xselectionrequest.property;
|
||||
ecore_add_event(ECORE_EVENT_DND_DATA_REQUEST, e,
|
||||
ecore_event_generic_free);
|
||||
|
@ -1060,10 +1071,13 @@ ecore_event_x_handle_client_message(XEvent * xevent)
|
|||
else if ((xevent->xclient.message_type == atom_xdndenter) &&
|
||||
(xevent->xclient.format == 32))
|
||||
{
|
||||
if (xevent->xclient.data.l[2] == (long)atom_text_uri_list)
|
||||
{
|
||||
/* 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))
|
||||
*/ {
|
||||
Ecore_Event_Dnd_Drop_Request *e;
|
||||
|
||||
|
||||
if (ev_drop_request_pending)
|
||||
{
|
||||
ecore_event_dnd_drop_request_free(ev_drop_request_pending);
|
||||
|
|
|
@ -1996,6 +1996,8 @@ ecore_window_dnd_handle_motion(Window source_win, int x, int y, int dragging)
|
|||
static Atom atom_xdndactionask = 0;
|
||||
static Atom atom_text_uri_list = 0;
|
||||
static Atom atom_text_plain = 0;
|
||||
static Atom atom_text_moz_url = 0;
|
||||
static Atom atom_netscape_url = 0;
|
||||
Window win;
|
||||
XEvent xevent;
|
||||
|
||||
|
@ -2013,6 +2015,8 @@ ecore_window_dnd_handle_motion(Window source_win, int x, int y, int dragging)
|
|||
ECORE_ATOM(atom_xdndactionask, "XdndActionAsk");
|
||||
ECORE_ATOM(atom_text_uri_list, "text/uri-list");
|
||||
ECORE_ATOM(atom_text_plain, "text/plain");
|
||||
ECORE_ATOM(atom_text_moz_url, "text/x-moz-url");
|
||||
ECORE_ATOM(atom_netscape_url, "_NETSCAPE_URL");
|
||||
if ((win != current_dnd_win) && (current_dnd_win))
|
||||
{
|
||||
/* send leave to old dnd win */
|
||||
|
@ -2042,7 +2046,7 @@ ecore_window_dnd_handle_motion(Window source_win, int x, int y, int dragging)
|
|||
xevent.xclient.data.l[1] = (3 << 24);
|
||||
xevent.xclient.data.l[2] = atom_text_uri_list;
|
||||
xevent.xclient.data.l[3] = atom_text_plain;
|
||||
xevent.xclient.data.l[4] = 0;
|
||||
xevent.xclient.data.l[4] = atom_text_moz_url;
|
||||
XSendEvent(disp, win, False, 0, &xevent);
|
||||
}
|
||||
/* send position information */
|
||||
|
@ -2202,21 +2206,28 @@ ecore_dnd_set_data(Window win)
|
|||
|
||||
void
|
||||
ecore_dnd_send_data(Window win, Window source_win, void *data, int size,
|
||||
Atom dest_atom, int plain_text)
|
||||
Atom dest_atom, int type)
|
||||
{
|
||||
XEvent xevent;
|
||||
static Atom atom_text_plain = 0;
|
||||
static Atom atom_text_uri_list = 0;
|
||||
static Atom atom_text_moz_url = 0;
|
||||
static Atom atom_netscape_url = 0;
|
||||
static Atom atom_xdndselection = 0;
|
||||
Atom target;
|
||||
|
||||
if (!disp) return;
|
||||
ECORE_ATOM(atom_xdndselection, "XdndSelection");
|
||||
ECORE_ATOM(atom_text_uri_list, "text/uri-list");
|
||||
ECORE_ATOM(atom_text_plain, "text/plain");
|
||||
target = atom_text_uri_list;
|
||||
if (plain_text)
|
||||
target = atom_text_plain;
|
||||
ECORE_ATOM(atom_text_plain, "text/plain");
|
||||
ECORE_ATOM(atom_text_moz_url, "text/x-moz-url");
|
||||
ECORE_ATOM(atom_text_moz_url, "_NETSCAPE_URL");
|
||||
ECORE_ATOM(atom_text_plain, "text/plain");
|
||||
if (type == DND_TYPE_URI_LIST) target = atom_text_uri_list;
|
||||
else if (type == DND_TYPE_PLAIN_TEXT) target = atom_text_plain;
|
||||
else if (type == DND_TYPE_MOZ_URL) target = atom_text_moz_url;
|
||||
else if (type == DND_TYPE_NETSCAPE_URL) target = atom_netscape_url;
|
||||
else target = 0;
|
||||
ecore_window_property_set(win, dest_atom, target, 8, data, size);
|
||||
xevent.xselection.type = SelectionNotify;
|
||||
xevent.xselection.property = dest_atom;
|
||||
|
|
Loading…
Reference in New Issue