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:
ningerso 2006-12-02 06:37:51 +00:00 committed by ningerso
parent 0a798ec6a8
commit 9f0f36e903
3 changed files with 26 additions and 10 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;