forked from enlightenment/efl
Send a selection request event when it occurs and expand the event structure to
include useful information. This event handler needs more work to determine when to convert the data automatically and when to defer to the application handler. SVN revision: 27324
This commit is contained in:
parent
0a798ec6a8
commit
9f0f36e903
|
@ -539,8 +539,11 @@ struct _Ecore_X_Event_Selection_Clear
|
||||||
|
|
||||||
struct _Ecore_X_Event_Selection_Request
|
struct _Ecore_X_Event_Selection_Request
|
||||||
{
|
{
|
||||||
Ecore_X_Window win;
|
Ecore_X_Window win;
|
||||||
Ecore_X_Time time;
|
Ecore_X_Time time;
|
||||||
|
Ecore_X_Atom selection;
|
||||||
|
Ecore_X_Atom target;
|
||||||
|
Ecore_X_Atom property;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Ecore_X_Event_Selection_Notify
|
struct _Ecore_X_Event_Selection_Notify
|
||||||
|
|
|
@ -1174,14 +1174,15 @@ ecore_x_cursor_new(Ecore_X_Window win, int *pixels, int w, int h, int hot_x, int
|
||||||
xci->delay = 0;
|
xci->delay = 0;
|
||||||
for (i = 0; i < (w * h); i++)
|
for (i = 0; i < (w * h); i++)
|
||||||
{
|
{
|
||||||
// int r, g, b, a;
|
int r, g, b, a;
|
||||||
//
|
|
||||||
// a = (pixels[i] >> 24) & 0xff;
|
a = ((pixels[i] >> 24) & 0xff);
|
||||||
// r = (((pixels[i] >> 16) & 0xff) * a) / 0xff;
|
r = ((pixels[i] >> 16) & 0xff);
|
||||||
// g = (((pixels[i] >> 8 ) & 0xff) * a) / 0xff;
|
g = ((pixels[i] >> 8 ) & 0xff);
|
||||||
// b = (((pixels[i] ) & 0xff) * a) / 0xff;
|
b = ((pixels[i] ) & 0xff);
|
||||||
xci->pixels[i] = pixels[i];
|
// xci->pixels[i] = pixels[i];
|
||||||
// (a << 24) | (r << 16) | (g << 8) | (b);
|
// xci->pixels[i] = (a << 24) | (r << 16) | (g << 8) | (b);
|
||||||
|
xci->pixels[i] = (b << 24) | (g << 16) | (r << 8) | (a);
|
||||||
}
|
}
|
||||||
c = XcursorImageLoadCursor(_ecore_x_disp, xci);
|
c = XcursorImageLoadCursor(_ecore_x_disp, xci);
|
||||||
XcursorImageDestroy(xci);
|
XcursorImageDestroy(xci);
|
||||||
|
|
|
@ -1108,11 +1108,23 @@ _ecore_x_event_handle_selection_clear(XEvent *xevent)
|
||||||
void
|
void
|
||||||
_ecore_x_event_handle_selection_request(XEvent *xevent)
|
_ecore_x_event_handle_selection_request(XEvent *xevent)
|
||||||
{
|
{
|
||||||
|
Ecore_X_Event_Selection_Request *e;
|
||||||
Ecore_X_Selection_Intern *sd;
|
Ecore_X_Selection_Intern *sd;
|
||||||
XSelectionEvent xnotify;
|
XSelectionEvent xnotify;
|
||||||
XEvent xev;
|
XEvent xev;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Generate a selection request event.
|
||||||
|
*/
|
||||||
|
e = malloc(sizeof(Ecore_X_Event_Selection_Request));
|
||||||
|
e->win = xevent->xselectionrequest.requestor;
|
||||||
|
e->time = xevent->xselectionrequest.time;
|
||||||
|
e->selection = xevent->xselectionrequest.selection;
|
||||||
|
e->target = xevent->xselectionrequest.target;
|
||||||
|
e->property = xevent->xselectionrequest.property;
|
||||||
|
ecore_event_add(ECORE_X_EVENT_SELECTION_REQUEST, e, NULL, NULL);
|
||||||
|
|
||||||
xnotify.type = SelectionNotify;
|
xnotify.type = SelectionNotify;
|
||||||
xnotify.display = xevent->xselectionrequest.display;
|
xnotify.display = xevent->xselectionrequest.display;
|
||||||
xnotify.requestor = xevent->xselectionrequest.requestor;
|
xnotify.requestor = xevent->xselectionrequest.requestor;
|
||||||
|
|
Loading…
Reference in New Issue