From 9f0f36e9030703bdbd32e7d62811fefeef7f22b9 Mon Sep 17 00:00:00 2001 From: ningerso Date: Sat, 2 Dec 2006 06:37:51 +0000 Subject: [PATCH] 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 --- legacy/ecore/src/lib/ecore_x/Ecore_X.h | 7 +++++-- legacy/ecore/src/lib/ecore_x/ecore_x.c | 17 +++++++++-------- legacy/ecore/src/lib/ecore_x/ecore_x_events.c | 12 ++++++++++++ 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h index b48da45d97..8d43583c56 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h @@ -539,8 +539,11 @@ struct _Ecore_X_Event_Selection_Clear struct _Ecore_X_Event_Selection_Request { - Ecore_X_Window win; - Ecore_X_Time time; + Ecore_X_Window win; + Ecore_X_Time time; + Ecore_X_Atom selection; + Ecore_X_Atom target; + Ecore_X_Atom property; }; struct _Ecore_X_Event_Selection_Notify diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x.c b/legacy/ecore/src/lib/ecore_x/ecore_x.c index 465335e9c2..07ef3fd1f8 100644 --- a/legacy/ecore/src/lib/ecore_x/ecore_x.c +++ b/legacy/ecore/src/lib/ecore_x/ecore_x.c @@ -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; for (i = 0; i < (w * h); i++) { -// int r, g, b, a; -// -// a = (pixels[i] >> 24) & 0xff; -// r = (((pixels[i] >> 16) & 0xff) * a) / 0xff; -// g = (((pixels[i] >> 8 ) & 0xff) * a) / 0xff; -// b = (((pixels[i] ) & 0xff) * a) / 0xff; - xci->pixels[i] = pixels[i]; -// (a << 24) | (r << 16) | (g << 8) | (b); + int r, g, b, a; + + a = ((pixels[i] >> 24) & 0xff); + r = ((pixels[i] >> 16) & 0xff); + g = ((pixels[i] >> 8 ) & 0xff); + b = ((pixels[i] ) & 0xff); +// xci->pixels[i] = pixels[i]; +// 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); XcursorImageDestroy(xci); diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_events.c b/legacy/ecore/src/lib/ecore_x/ecore_x_events.c index 328c5c34e3..01d97c59ff 100644 --- a/legacy/ecore/src/lib/ecore_x/ecore_x_events.c +++ b/legacy/ecore/src/lib/ecore_x/ecore_x_events.c @@ -1108,11 +1108,23 @@ _ecore_x_event_handle_selection_clear(XEvent *xevent) void _ecore_x_event_handle_selection_request(XEvent *xevent) { + Ecore_X_Event_Selection_Request *e; Ecore_X_Selection_Intern *sd; XSelectionEvent xnotify; XEvent xev; 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.display = xevent->xselectionrequest.display; xnotify.requestor = xevent->xselectionrequest.requestor;