forked from enlightenment/efl
source action patches from Fedor Gusev
SVN revision: 35519
This commit is contained in:
parent
4e147fe66f
commit
43365e056b
|
@ -1078,6 +1078,8 @@ EAPI int ecore_x_dnd_begin(Ecore_X_Window source, unsigned char *da
|
||||||
EAPI int ecore_x_dnd_drop(void);
|
EAPI int ecore_x_dnd_drop(void);
|
||||||
EAPI void ecore_x_dnd_send_status(int will_accept, int suppress, Ecore_X_Rectangle rectangle, Ecore_X_Atom action);
|
EAPI void ecore_x_dnd_send_status(int will_accept, int suppress, Ecore_X_Rectangle rectangle, Ecore_X_Atom action);
|
||||||
EAPI void ecore_x_dnd_send_finished(void);
|
EAPI void ecore_x_dnd_send_finished(void);
|
||||||
|
EAPI void ecore_x_dnd_source_action_set(Ecore_X_Atom action);
|
||||||
|
EAPI Ecore_X_Atom ecore_x_dnd_source_action_get(void);
|
||||||
|
|
||||||
EAPI Ecore_X_Window ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h);
|
EAPI Ecore_X_Window ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h);
|
||||||
EAPI Ecore_X_Window ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h);
|
EAPI Ecore_X_Window ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h);
|
||||||
|
|
|
@ -30,6 +30,7 @@ _ecore_x_dnd_init(void)
|
||||||
_source->win = XCB_NONE;
|
_source->win = XCB_NONE;
|
||||||
_source->dest = XCB_NONE;
|
_source->dest = XCB_NONE;
|
||||||
_source->state = ECORE_X_DND_SOURCE_IDLE;
|
_source->state = ECORE_X_DND_SOURCE_IDLE;
|
||||||
|
_source->prev.window = 0;
|
||||||
|
|
||||||
_target = calloc(1, sizeof(Ecore_X_DND_Target));
|
_target = calloc(1, sizeof(Ecore_X_DND_Target));
|
||||||
_target->win = XCB_NONE;
|
_target->win = XCB_NONE;
|
||||||
|
@ -485,6 +486,7 @@ ecore_x_dnd_begin(Ecore_X_Window source,
|
||||||
ecore_x_window_ignore_set(_source->win, 1);
|
ecore_x_window_ignore_set(_source->win, 1);
|
||||||
_source->state = ECORE_X_DND_SOURCE_DRAGGING;
|
_source->state = ECORE_X_DND_SOURCE_DRAGGING;
|
||||||
_source->time = _ecore_xcb_event_last_time;
|
_source->time = _ecore_xcb_event_last_time;
|
||||||
|
_source->prev.window = 0;
|
||||||
|
|
||||||
/* Default Accepted Action: ask */
|
/* Default Accepted Action: ask */
|
||||||
_source->action = ECORE_X_ATOM_XDND_ACTION_COPY;
|
_source->action = ECORE_X_ATOM_XDND_ACTION_COPY;
|
||||||
|
@ -532,6 +534,7 @@ ecore_x_dnd_drop(void)
|
||||||
}
|
}
|
||||||
ecore_x_window_ignore_set(_source->win, 0);
|
ecore_x_window_ignore_set(_source->win, 0);
|
||||||
|
|
||||||
|
_source->prev.window = 0;
|
||||||
_source->dest = XCB_NONE;
|
_source->dest = XCB_NONE;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
@ -610,6 +613,20 @@ ecore_x_dnd_send_finished(void)
|
||||||
_target->state = ECORE_X_DND_TARGET_IDLE;
|
_target->state = ECORE_X_DND_TARGET_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_dnd_source_action_set(Ecore_X_Atom action)
|
||||||
|
{
|
||||||
|
_source->action = action;
|
||||||
|
if (_source->prev.window)
|
||||||
|
_ecore_x_dnd_drag(_source->prev.window, _source->prev.x, _source->prev.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ecore_X_Atom
|
||||||
|
ecore_x_dnd_source_action_get(void)
|
||||||
|
{
|
||||||
|
return _source->action;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_x_dnd_drag(Ecore_X_Window root,
|
_ecore_x_dnd_drag(Ecore_X_Window root,
|
||||||
int x,
|
int x,
|
||||||
|
@ -747,5 +764,8 @@ _ecore_x_dnd_drag(Ecore_X_Window root,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_source->prev.x = x;
|
||||||
|
_source->prev.y = y;
|
||||||
|
_source->prev.window = root;
|
||||||
_source->dest = win;
|
_source->dest = win;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,6 +107,11 @@ typedef struct _Ecore_X_DND_Source
|
||||||
unsigned short width, height;
|
unsigned short width, height;
|
||||||
} rectangle;
|
} rectangle;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
Ecore_X_Window window;
|
||||||
|
int x, y;
|
||||||
|
} prev;
|
||||||
|
|
||||||
Ecore_X_Time time;
|
Ecore_X_Time time;
|
||||||
|
|
||||||
Ecore_X_Atom action, accepted_action;
|
Ecore_X_Atom action, accepted_action;
|
||||||
|
|
|
@ -35,6 +35,7 @@ _ecore_x_dnd_init(void)
|
||||||
_source->win = None;
|
_source->win = None;
|
||||||
_source->dest = None;
|
_source->dest = None;
|
||||||
_source->state = ECORE_X_DND_SOURCE_IDLE;
|
_source->state = ECORE_X_DND_SOURCE_IDLE;
|
||||||
|
_source->prev.window = 0;
|
||||||
|
|
||||||
_target = calloc(1, sizeof(Ecore_X_DND_Target));
|
_target = calloc(1, sizeof(Ecore_X_DND_Target));
|
||||||
_target->win = None;
|
_target->win = None;
|
||||||
|
@ -335,6 +336,7 @@ ecore_x_dnd_begin(Ecore_X_Window source, unsigned char *data, int size)
|
||||||
ecore_x_window_ignore_set(_source->win, 1);
|
ecore_x_window_ignore_set(_source->win, 1);
|
||||||
_source->state = ECORE_X_DND_SOURCE_DRAGGING;
|
_source->state = ECORE_X_DND_SOURCE_DRAGGING;
|
||||||
_source->time = _ecore_x_event_last_time;
|
_source->time = _ecore_x_event_last_time;
|
||||||
|
_source->prev.window = 0;
|
||||||
|
|
||||||
/* Default Accepted Action: move */
|
/* Default Accepted Action: move */
|
||||||
_source->action = ECORE_X_ATOM_XDND_ACTION_MOVE;
|
_source->action = ECORE_X_ATOM_XDND_ACTION_MOVE;
|
||||||
|
@ -384,6 +386,8 @@ ecore_x_dnd_drop(void)
|
||||||
}
|
}
|
||||||
ecore_x_window_ignore_set(_source->win, 0);
|
ecore_x_window_ignore_set(_source->win, 0);
|
||||||
|
|
||||||
|
_source->prev.window = 0;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -461,6 +465,20 @@ ecore_x_dnd_send_finished(void)
|
||||||
_target->state = ECORE_X_DND_TARGET_IDLE;
|
_target->state = ECORE_X_DND_TARGET_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_dnd_source_action_set(Ecore_X_Atom action)
|
||||||
|
{
|
||||||
|
_source->action = action;
|
||||||
|
if (_source->prev.window)
|
||||||
|
_ecore_x_dnd_drag(_source->prev.window, _source->prev.x, _source->prev.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ecore_X_Atom
|
||||||
|
ecore_x_dnd_source_action_get(void)
|
||||||
|
{
|
||||||
|
return _source->action;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_x_dnd_drag(Ecore_X_Window root, int x, int y)
|
_ecore_x_dnd_drag(Ecore_X_Window root, int x, int y)
|
||||||
{
|
{
|
||||||
|
@ -564,5 +582,8 @@ _ecore_x_dnd_drag(Ecore_X_Window root, int x, int y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_source->prev.x = x;
|
||||||
|
_source->prev.y = y;
|
||||||
|
_source->prev.window = root;
|
||||||
_source->dest = win;
|
_source->dest = win;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,11 @@ typedef struct _Ecore_X_DND_Source
|
||||||
unsigned short width, height;
|
unsigned short width, height;
|
||||||
} rectangle;
|
} rectangle;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
Ecore_X_Window window;
|
||||||
|
int x, y;
|
||||||
|
} prev;
|
||||||
|
|
||||||
Time time;
|
Time time;
|
||||||
|
|
||||||
Ecore_X_Atom action, accepted_action;
|
Ecore_X_Atom action, accepted_action;
|
||||||
|
|
Loading…
Reference in New Issue