2007-05-02 06:21:16 +02:00
|
|
|
/*
|
2008-04-25 07:20:24 +02:00
|
|
|
* Copyright 2007-2008 Peter Hutterer
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
* Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
2008-05-21 14:21:27 +02:00
|
|
|
* Author: Peter Hutterer, University of South Australia, NICTA
|
2008-04-25 07:20:24 +02:00
|
|
|
*/
|
2007-05-02 06:21:16 +02:00
|
|
|
|
|
|
|
#define NEED_EVENTS
|
|
|
|
#define NEED_REPLIES
|
|
|
|
|
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <X11/extensions/XIproto.h>
|
|
|
|
|
|
|
|
#include "dixstruct.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
|
|
|
|
#include "exglobals.h"
|
|
|
|
#include "xiselev.h"
|
|
|
|
#include "geext.h"
|
|
|
|
|
|
|
|
int
|
|
|
|
SProcXiSelectEvent(ClientPtr client)
|
|
|
|
{
|
|
|
|
char n;
|
|
|
|
|
|
|
|
REQUEST(xXiSelectEventReq);
|
|
|
|
swaps(&stuff->length, n);
|
|
|
|
REQUEST_SIZE_MATCH(xXiSelectEventReq);
|
|
|
|
swapl(&stuff->window, n);
|
|
|
|
swapl(&stuff->mask, n);
|
|
|
|
return (ProcXiSelectEvent(client));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
ProcXiSelectEvent(ClientPtr client)
|
|
|
|
{
|
2008-01-03 09:06:33 +01:00
|
|
|
int rc;
|
2007-05-02 06:21:16 +02:00
|
|
|
WindowPtr pWin;
|
2008-01-23 06:13:48 +01:00
|
|
|
DeviceIntPtr pDev;
|
2007-05-02 06:21:16 +02:00
|
|
|
REQUEST(xXiSelectEventReq);
|
|
|
|
REQUEST_SIZE_MATCH(xXiSelectEventReq);
|
|
|
|
|
2008-01-23 06:15:02 +01:00
|
|
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
2008-01-03 09:06:33 +01:00
|
|
|
if (rc != Success)
|
|
|
|
return rc;
|
2007-05-02 06:21:16 +02:00
|
|
|
|
2008-01-23 06:41:31 +01:00
|
|
|
if (stuff->deviceid & (0x1 << 7)) /* all devices */
|
|
|
|
pDev = NULL;
|
|
|
|
else {
|
|
|
|
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
|
|
|
|
if (rc != Success)
|
|
|
|
return rc;
|
|
|
|
}
|
2008-01-23 06:13:48 +01:00
|
|
|
|
|
|
|
GEWindowSetMask(client, pDev, pWin, IReqCode, stuff->mask);
|
2007-05-02 06:21:16 +02:00
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|