Xi: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros

Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-07-09 21:59:58 +02:00
parent adefed6226
commit 83a63a64a0
94 changed files with 447 additions and 1191 deletions

View File

@ -58,25 +58,11 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "exglobals.h"
#include "allowev.h"
/***********************************************************************
*
* This procedure allows frozen events to be routed.
*
*/
int _X_COLD
SProcXAllowDeviceEvents(ClientPtr client)
{
REQUEST(xAllowDeviceEventsReq);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
swapl(&stuff->time);
return (ProcXAllowDeviceEvents(client));
}
/***********************************************************************
*
* This procedure allows frozen events to be routed.
@ -90,8 +76,8 @@ ProcXAllowDeviceEvents(ClientPtr client)
DeviceIntPtr thisdev;
int rc;
REQUEST(xAllowDeviceEventsReq);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
REQUEST_HEAD_STRUCT(xAllowDeviceEventsReq);
REQUEST_FIELD_CARD32(time);
rc = dixLookupDevice(&thisdev, stuff->deviceid, client, DixGetAttrAccess);
if (rc != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef ALLOWEV_H
#define ALLOWEV_H 1
int SProcXAllowDeviceEvents(ClientPtr /* client */
);
int ProcXAllowDeviceEvents(ClientPtr /* client */
);

View File

@ -57,6 +57,7 @@ SOFTWARE.
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "dix/resource_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -64,37 +65,6 @@ SOFTWARE.
#include "exglobals.h"
#include "chgdctl.h"
/***********************************************************************
*
* This procedure changes the control attributes for an extension device,
* for clients on machines with a different byte ordering than the server.
*
*/
int _X_COLD
SProcXChangeDeviceControl(ClientPtr client)
{
xDeviceCtl *ctl;
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
swaps(&stuff->control);
ctl = (xDeviceCtl *) &stuff[1];
swaps(&ctl->control);
swaps(&ctl->length);
switch (stuff->control) {
case DEVICE_ABS_CALIB:
case DEVICE_ABS_AREA:
case DEVICE_CORE:
case DEVICE_ENABLE:
case DEVICE_RESOLUTION:
/* hmm. beer. *drool* */
break;
}
return (ProcXChangeDeviceControl(client));
}
/***********************************************************************
*
* Change the control attributes.
@ -104,6 +74,11 @@ SProcXChangeDeviceControl(ClientPtr client)
int
ProcXChangeDeviceControl(ClientPtr client)
{
REQUEST_HEAD_AT_LEAST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
REQUEST_FIELD_CARD16(control);
CLIENT_STRUCT_CARD16_2((xDeviceCtl*)&stuff[1], control, length);
unsigned len;
int i, status, ret = BadValue;
DeviceIntPtr dev;
@ -112,9 +87,6 @@ ProcXChangeDeviceControl(ClientPtr client)
CARD32 *resolution;
xDeviceEnableCtl *e;
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
len = client->req_len - bytes_to_int32(sizeof(xChangeDeviceControlReq));
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGDCTL_H
#define CHGDCTL_H 1
int SProcXChangeDeviceControl(ClientPtr /* client */
);
int ProcXChangeDeviceControl(ClientPtr /* client */
);

View File

@ -52,32 +52,18 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> /* control constants */
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "chgfctl.h"
#define DO_ALL (-1)
/***********************************************************************
*
* This procedure changes the control attributes for an extension device,
* for clients on machines with a different byte ordering than the server.
*
*/
int _X_COLD
SProcXChangeFeedbackControl(ClientPtr client)
{
REQUEST(xChangeFeedbackControlReq);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
swapl(&stuff->mask);
return (ProcXChangeFeedbackControl(client));
}
/******************************************************************************
*
* This procedure changes KbdFeedbackClass data.
@ -92,13 +78,8 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
int t;
int key = DO_ALL;
if (client->swapped) {
swaps(&f->length);
swaps(&f->pitch);
swaps(&f->duration);
swapl(&f->led_mask);
swapl(&f->led_values);
}
CLIENT_STRUCT_CARD16_3(f, length, pitch, duration);
CLIENT_STRUCT_CARD32_2(f, led_mask, led_values);
kctrl = k->ctrl;
if (mask & DvKeyClickPercent) {
@ -209,12 +190,7 @@ ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
{
PtrCtrl pctrl; /* might get BadValue part way through */
if (client->swapped) {
swaps(&f->length);
swaps(&f->num);
swaps(&f->denom);
swaps(&f->thresh);
}
CLIENT_STRUCT_CARD16_4(f, length, num, denom, thresh);
pctrl = p->ctrl;
if (mask & DvAccelNum) {
@ -275,10 +251,8 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, IntegerFeedbackPtr i,
xIntegerFeedbackCtl * f)
{
if (client->swapped) {
swaps(&f->length);
swapl(&f->int_to_display);
}
CLIENT_STRUCT_CARD16_1(f, length);
CLIENT_STRUCT_CARD32_1(f, int_to_display);
i->ctrl.integer_displayed = f->int_to_display;
(*i->CtrlProc) (dev, &i->ctrl);
@ -300,10 +274,9 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
KeySym *syms, *sup_syms;
syms = (KeySym *) (f + 1);
if (client->swapped) {
swaps(&f->length); /* swapped num_keysyms in calling proc */
SwapLongs((CARD32 *) syms, f->num_keysyms);
}
CLIENT_STRUCT_CARD16_1(f, length); /* swapped num_keysyms in calling proc */
REQUEST_BUF_CARD32((CARD32 *) syms, f->num_keysyms);
if (f->num_keysyms > s->ctrl.max_symbols)
return BadValue;
@ -338,11 +311,7 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
int t;
BellCtrl bctrl; /* might get BadValue part way through */
if (client->swapped) {
swaps(&f->length);
swaps(&f->pitch);
swaps(&f->duration);
}
CLIENT_STRUCT_CARD16_3(f, length, pitch, duration);
bctrl = b->ctrl;
if (mask & DvPercent) {
@ -394,11 +363,8 @@ ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
{
LedCtrl lctrl; /* might get BadValue part way through */
if (client->swapped) {
swaps(&f->length);
swapl(&f->led_values);
swapl(&f->led_mask);
}
CLIENT_STRUCT_CARD16_1(f, length);
CLIENT_STRUCT_CARD32_2(f, led_values, led_mask);
f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
f->led_values &= l->ctrl.led_mask; /* set only supported leds */
@ -432,8 +398,8 @@ ProcXChangeFeedbackControl(ClientPtr client)
LedFeedbackPtr l;
int rc;
REQUEST(xChangeFeedbackControlReq);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
REQUEST_HEAD_AT_LEAST(xChangeFeedbackControlReq);
REQUEST_FIELD_CARD32(mask);
len = client->req_len - bytes_to_int32(sizeof(xChangeFeedbackControlReq));
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
@ -466,11 +432,7 @@ ProcXChangeFeedbackControl(ClientPtr client)
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeFeedbackControlReq,
sizeof(xStringFeedbackCtl));
f = ((xStringFeedbackCtl *) &stuff[1]);
if (client->swapped) {
if (len < bytes_to_int32(sizeof(xStringFeedbackCtl)))
return BadLength;
swaps(&f->num_keysyms);
}
CLIENT_STRUCT_CARD16_1(f, num_keysyms);
if (len !=
(bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms))
return BadLength;

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGFCTL_H
#define CHGFCTL_H 1
int SProcXChangeFeedbackControl(ClientPtr /* client */
);
int ProcXChangeFeedbackControl(ClientPtr /* client */
);

View File

@ -52,12 +52,14 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "XIstubs.h"
#include "globals.h"
#include "exevents.h"
#include "exglobals.h"
@ -72,8 +74,7 @@ SOFTWARE.
int
ProcXChangeKeyboardDevice(ClientPtr client)
{
/* REQUEST(xChangeKeyboardDeviceReq); */
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
REQUEST_HEAD_STRUCT(xChangeKeyboardDeviceReq);
return BadDevice;
}

View File

@ -56,32 +56,13 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/exevents_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "chgkmap.h"
/***********************************************************************
*
* This procedure swaps the request when the client and
* server have different byte orderings.
*
*/
int _X_COLD
SProcXChangeDeviceKeyMapping(ClientPtr client)
{
unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), count);
return (ProcXChangeDeviceKeyMapping(client));
}
/***********************************************************************
*
* Change the device key mapping.
@ -96,11 +77,10 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
DeviceIntPtr dev;
unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
REQUEST_HEAD_AT_LEAST(xChangeDeviceKeyMappingReq);
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
REQUEST_BUF_CARD32(&stuff[1], count);
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGKMAP_H
#define CHGKMAP_H 1
int SProcXChangeDeviceKeyMapping(ClientPtr /* client */
);
int ProcXChangeDeviceKeyMapping(ClientPtr /* client */
);

View File

@ -57,6 +57,7 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h"
@ -65,25 +66,6 @@ SOFTWARE.
#include "chgprop.h"
#include "grabdev.h"
/***********************************************************************
*
* This procedure returns the extension version.
*
*/
int _X_COLD
SProcXChangeDeviceDontPropagateList(ClientPtr client)
{
REQUEST(xChangeDeviceDontPropagateListReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
swapl(&stuff->window);
swaps(&stuff->count);
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
return (ProcXChangeDeviceDontPropagateList(client));
}
/***********************************************************************
*
* This procedure changes the dont-propagate list for the specified window.
@ -98,13 +80,12 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
struct tmask tmp[EMASKSIZE];
OtherInputMasks *others;
REQUEST(xChangeDeviceDontPropagateListReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
if (client->req_len !=
bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) +
stuff->count)
return BadLength;
REQUEST_HEAD_AT_LEAST(xChangeDeviceDontPropagateListReq);
REQUEST_FIELD_CARD32(window);
REQUEST_FIELD_CARD16(count);
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
stuff->count * sizeof(CARD32));
REQUEST_BUF_CARD32(&stuff[1], stuff->count);
rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess);
if (rc != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGPROP_H
#define CHGPROP_H 1
int SProcXChangeDeviceDontPropagateList(ClientPtr /* client */
);
int ProcXChangeDeviceDontPropagateList(ClientPtr /* client */
);

View File

@ -52,13 +52,15 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "XIstubs.h"
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include "exevents.h"
#include "exglobals.h"
@ -73,8 +75,7 @@ SOFTWARE.
int
ProcXChangePointerDevice(ClientPtr client)
{
/* REQUEST(xChangePointerDeviceReq); */
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
REQUEST_HEAD_STRUCT(xChangePointerDeviceReq);
return BadDevice;
}

View File

@ -55,6 +55,7 @@ SOFTWARE.
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "dix/resource_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -125,8 +126,7 @@ ProcXCloseDevice(ClientPtr client)
WindowPtr pWin, p1;
DeviceIntPtr d;
REQUEST(xCloseDeviceReq);
REQUEST_SIZE_MATCH(xCloseDeviceReq);
REQUEST_HEAD_STRUCT(xCloseDeviceReq);
rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
if (rc != Success)

View File

@ -52,9 +52,12 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "devbell.h"
@ -77,8 +80,7 @@ ProcXDeviceBell(ClientPtr client)
void *ctrl;
BellProcPtr proc;
REQUEST(xDeviceBellReq);
REQUEST_SIZE_MATCH(xDeviceBellReq);
REQUEST_HEAD_STRUCT(xDeviceBellReq);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixBellAccess);
if (rc != Success) {

View File

@ -380,152 +380,6 @@ ProcIDispatch(ClientPtr client)
}
}
/*******************************************************************************
*
* SProcXDispatch
*
* Main swapped dispatch routine for requests to this extension.
* This routine is used if server and client do not have the same byte ordering.
*
*/
static int _X_COLD
SProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
UpdateCurrentTimeIf();
switch (stuff->data) {
case X_GetExtensionVersion:
return SProcXGetExtensionVersion(client);
case X_ListInputDevices:
return SProcXListInputDevices(client);
case X_OpenDevice:
return SProcXOpenDevice(client);
case X_CloseDevice:
return SProcXCloseDevice(client);
case X_SetDeviceMode:
return SProcXSetDeviceMode(client);
case X_SelectExtensionEvent:
return SProcXSelectExtensionEvent(client);
case X_GetSelectedExtensionEvents:
return SProcXGetSelectedExtensionEvents(client);
case X_ChangeDeviceDontPropagateList:
return SProcXChangeDeviceDontPropagateList(client);
case X_GetDeviceDontPropagateList:
return SProcXGetDeviceDontPropagateList(client);
case X_GetDeviceMotionEvents:
return SProcXGetDeviceMotionEvents(client);
case X_ChangeKeyboardDevice:
return SProcXChangeKeyboardDevice(client);
case X_ChangePointerDevice:
return SProcXChangePointerDevice(client);
case X_GrabDevice:
return SProcXGrabDevice(client);
case X_UngrabDevice:
return SProcXUngrabDevice(client);
case X_GrabDeviceKey:
return SProcXGrabDeviceKey(client);
case X_UngrabDeviceKey:
return SProcXUngrabDeviceKey(client);
case X_GrabDeviceButton:
return SProcXGrabDeviceButton(client);
case X_UngrabDeviceButton:
return SProcXUngrabDeviceButton(client);
case X_AllowDeviceEvents:
return SProcXAllowDeviceEvents(client);
case X_GetDeviceFocus:
return SProcXGetDeviceFocus(client);
case X_SetDeviceFocus:
return SProcXSetDeviceFocus(client);
case X_GetFeedbackControl:
return SProcXGetFeedbackControl(client);
case X_ChangeFeedbackControl:
return SProcXChangeFeedbackControl(client);
case X_GetDeviceKeyMapping:
return SProcXGetDeviceKeyMapping(client);
case X_ChangeDeviceKeyMapping:
return SProcXChangeDeviceKeyMapping(client);
case X_GetDeviceModifierMapping:
return SProcXGetDeviceModifierMapping(client);
case X_SetDeviceModifierMapping:
return SProcXSetDeviceModifierMapping(client);
case X_GetDeviceButtonMapping:
return SProcXGetDeviceButtonMapping(client);
case X_SetDeviceButtonMapping:
return SProcXSetDeviceButtonMapping(client);
case X_QueryDeviceState:
return SProcXQueryDeviceState(client);
case X_SendExtensionEvent:
return SProcXSendExtensionEvent(client);
case X_DeviceBell:
return SProcXDeviceBell(client);
case X_SetDeviceValuators:
return SProcXSetDeviceValuators(client);
case X_GetDeviceControl:
return SProcXGetDeviceControl(client);
case X_ChangeDeviceControl:
return SProcXChangeDeviceControl(client);
/* XI 1.5 */
case X_ListDeviceProperties:
return SProcXListDeviceProperties(client);
case X_ChangeDeviceProperty:
return SProcXChangeDeviceProperty(client);
case X_DeleteDeviceProperty:
return SProcXDeleteDeviceProperty(client);
case X_GetDeviceProperty:
return SProcXGetDeviceProperty(client);
/* XI 2 */
case X_XIQueryPointer:
return SProcXIQueryPointer(client);
case X_XIWarpPointer:
return SProcXIWarpPointer(client);
case X_XIChangeCursor:
return SProcXIChangeCursor(client);
case X_XIChangeHierarchy:
return SProcXIChangeHierarchy(client);
case X_XISetClientPointer:
return SProcXISetClientPointer(client);
case X_XIGetClientPointer:
return SProcXIGetClientPointer(client);
case X_XISelectEvents:
return SProcXISelectEvents(client);
case X_XIQueryVersion:
return SProcXIQueryVersion(client);
case X_XIQueryDevice:
return SProcXIQueryDevice(client);
case X_XISetFocus:
return SProcXISetFocus(client);
case X_XIGetFocus:
return SProcXIGetFocus(client);
case X_XIGrabDevice:
return SProcXIGrabDevice(client);
case X_XIUngrabDevice:
return SProcXIUngrabDevice(client);
case X_XIAllowEvents:
return SProcXIAllowEvents(client);
case X_XIPassiveGrabDevice:
return SProcXIPassiveGrabDevice(client);
case X_XIPassiveUngrabDevice:
return SProcXIPassiveUngrabDevice(client);
case X_XIListProperties:
return SProcXIListProperties(client);
case X_XIChangeProperty:
return SProcXIChangeProperty(client);
case X_XIDeleteProperty:
return SProcXIDeleteProperty(client);
case X_XIGetProperty:
return SProcXIGetProperty(client);
case X_XIGetSelectedEvents:
return SProcXIGetSelectedEvents(client);
case X_XIBarrierReleasePointer:
return SProcXIBarrierReleasePointer(client);
default:
return BadRequest;
}
}
/************************************************************************
*
* This function swaps the DeviceValuator event.
@ -1344,7 +1198,7 @@ XInputExtensionInit(void)
FatalError("Could not initialize barriers.\n");
extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
SProcIDispatch, IResetProc, StandardMinorOpcode);
ProcIDispatch, IResetProc, StandardMinorOpcode);
if (extEntry) {
assert(extEntry->base == EXTENSION_MAJOR_XINPUT);

View File

@ -52,9 +52,12 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "getbmap.h"
@ -72,8 +75,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
ButtonClassPtr b;
int rc;
REQUEST(xGetDeviceButtonMappingReq);
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
REQUEST_HEAD_STRUCT(xGetDeviceButtonMappingReq);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (rc != Success)

View File

@ -52,29 +52,16 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "getdctl.h"
/***********************************************************************
*
* This procedure gets the control attributes for an extension device,
* for clients on machines with a different byte ordering than the server.
*
*/
int _X_COLD
SProcXGetDeviceControl(ClientPtr client)
{
REQUEST(xGetDeviceControlReq);
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
swaps(&stuff->control);
return (ProcXGetDeviceControl(client));
}
/***********************************************************************
*
* This procedure copies DeviceResolution data, swapping if necessary.
@ -155,8 +142,8 @@ ProcXGetDeviceControl(ClientPtr client)
int rc, total_length = 0;
DeviceIntPtr dev;
REQUEST(xGetDeviceControlReq);
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
REQUEST_HEAD_STRUCT(xGetDeviceControlReq);
REQUEST_FIELD_CARD16(control);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (rc != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETDCTL_H
#define GETDCTL_H 1
int SProcXGetDeviceControl(ClientPtr /* client */
);
int ProcXGetDeviceControl(ClientPtr /* client */
);

View File

@ -52,9 +52,12 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "getfctl.h"
@ -252,8 +255,7 @@ ProcXGetFeedbackControl(ClientPtr client)
BellFeedbackPtr b;
LedFeedbackPtr l;
REQUEST(xGetFeedbackControlReq);
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
REQUEST_HEAD_STRUCT(xGetFeedbackControlReq);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (rc != Success)

View File

@ -52,10 +52,13 @@ SOFTWARE.
#include <dix-config.h>
#include "windowstr.h" /* focus struct */
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "windowstr.h" /* focus struct */
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "getfocus.h"
@ -73,8 +76,7 @@ ProcXGetDeviceFocus(ClientPtr client)
FocusClassPtr focus;
int rc;
REQUEST(xGetDeviceFocusReq);
REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
REQUEST_HEAD_STRUCT(xGetDeviceFocusReq);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
if (rc != Success)

View File

@ -52,9 +52,12 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "swaprep.h"
#include "xkbsrv.h"
@ -76,8 +79,7 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
KeySymsPtr syms;
int rc;
REQUEST(xGetDeviceKeyMappingReq);
REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
REQUEST_HEAD_STRUCT(xGetDeviceKeyMappingReq);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (rc != Success)

View File

@ -52,9 +52,12 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> /* Request macro */
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "getmmap.h"
@ -72,8 +75,7 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
KeyCode *modkeymap = NULL;
int ret, max_keys_per_mod;
REQUEST(xGetDeviceModifierMappingReq);
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
REQUEST_HEAD_STRUCT(xGetDeviceModifierMappingReq);
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (ret != Success)

View File

@ -56,6 +56,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/dix_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structs */
@ -66,21 +67,6 @@ SOFTWARE.
extern XExtEventInfo EventInfo[];
extern int ExtEventIndex;
/***********************************************************************
*
* Handle a request from a client with a different byte order.
*
*/
int _X_COLD
SProcXGetDeviceDontPropagateList(ClientPtr client)
{
REQUEST(xGetDeviceDontPropagateListReq);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
swapl(&stuff->window);
return (ProcXGetDeviceDontPropagateList(client));
}
/***********************************************************************
*
* This procedure lists the input devices available to the server.
@ -96,8 +82,8 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
WindowPtr pWin;
OtherInputMasks *others;
REQUEST(xGetDeviceDontPropagateListReq);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
REQUEST_HEAD_STRUCT(xGetDeviceDontPropagateListReq);
REQUEST_FIELD_CARD32(window);
xGetDeviceDontPropagateListReply rep = {
.repType = X_Reply,

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETPROP_H
#define GETPROP_H 1
int SProcXGetDeviceDontPropagateList(ClientPtr /* client */
);
int ProcXGetDeviceDontPropagateList(ClientPtr /* client */
);

View File

@ -55,6 +55,7 @@ SOFTWARE.
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "dix/resource_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -64,21 +65,6 @@ SOFTWARE.
#include "getprop.h"
#include "getselev.h"
/***********************************************************************
*
* This procedure gets the current selected extension events.
*
*/
int _X_COLD
SProcXGetSelectedExtensionEvents(ClientPtr client)
{
REQUEST(xGetSelectedExtensionEventsReq);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
swapl(&stuff->window);
return (ProcXGetSelectedExtensionEvents(client));
}
/***********************************************************************
*
* This procedure gets the current device select mask,
@ -97,8 +83,8 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
OtherInputMasks *pOthers;
InputClientsPtr others;
REQUEST(xGetSelectedExtensionEventsReq);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
REQUEST_HEAD_STRUCT(xGetSelectedExtensionEventsReq);
REQUEST_FIELD_CARD32(window);
xGetSelectedExtensionEventsReply rep = {
.repType = X_Reply,

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETSELEV_H
#define GETSELEV_H 1
int SProcXGetSelectedExtensionEvents(ClientPtr /* client */
);
int ProcXGetSelectedExtensionEvents(ClientPtr /* client */
);

View File

@ -52,9 +52,12 @@ SOFTWARE.
#include <dix-config.h>
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exevents.h"
#include "exglobals.h"
@ -62,21 +65,6 @@ SOFTWARE.
XExtensionVersion XIVersion;
/***********************************************************************
*
* Handle a request from a client with a different byte order than us.
*
*/
int _X_COLD
SProcXGetExtensionVersion(ClientPtr client)
{
REQUEST(xGetExtensionVersionReq);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
swaps(&stuff->nbytes);
return (ProcXGetExtensionVersion(client));
}
/***********************************************************************
*
* This procedure returns the major/minor version of the X Input extension.
@ -86,8 +74,8 @@ SProcXGetExtensionVersion(ClientPtr client)
int
ProcXGetExtensionVersion(ClientPtr client)
{
REQUEST(xGetExtensionVersionReq);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
REQUEST_HEAD_STRUCT(xGetExtensionVersionReq);
REQUEST_FIELD_CARD16(nbytes);
if (client->req_len != bytes_to_int32(sizeof(xGetExtensionVersionReq) +
stuff->nbytes))

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETVERS_H
#define GETVERS_H 1
int SProcXGetExtensionVersion(ClientPtr /* client */
);
int ProcXGetExtensionVersion(ClientPtr /* client */
);

View File

@ -56,6 +56,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/dix_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -65,31 +66,6 @@ SOFTWARE.
extern XExtEventInfo EventInfo[];
extern int ExtEventIndex;
/***********************************************************************
*
* Swap the request if the requestor has a different byte order than us.
*
*/
int _X_COLD
SProcXGrabDevice(ClientPtr client)
{
REQUEST(xGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
swapl(&stuff->grabWindow);
swapl(&stuff->time);
swaps(&stuff->event_count);
if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
return BadLength;
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return (ProcXGrabDevice(client));
}
/***********************************************************************
*
* Grab an extension device.
@ -104,13 +80,17 @@ ProcXGrabDevice(ClientPtr client)
GrabMask mask;
struct tmask tmp[EMASKSIZE];
REQUEST(xGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
REQUEST_HEAD_AT_LEAST(xGrabDeviceReq);
REQUEST_FIELD_CARD32(grabWindow);
REQUEST_FIELD_CARD32(time);
REQUEST_FIELD_CARD16(event_count);
if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
return BadLength;
REQUEST_BUF_CARD32(&stuff[1], stuff->event_count);
xGrabDeviceReply rep = {
.repType = X_Reply,
.RepType = X_GrabDevice,

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GRABDEV_H
#define GRABDEV_H 1
int SProcXGrabDevice(ClientPtr /* client */
);
int ProcXGrabDevice(ClientPtr /* client */
);

View File

@ -57,6 +57,7 @@ SOFTWARE.
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -65,27 +66,6 @@ SOFTWARE.
#include "grabdev.h"
#include "grabdevb.h"
/***********************************************************************
*
* Handle requests from clients with a different byte order.
*
*/
int _X_COLD
SProcXGrabDeviceButton(ClientPtr client)
{
REQUEST(xGrabDeviceButtonReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return (ProcXGrabDeviceButton(client));
}
/***********************************************************************
*
* Grab a button on an extension device.
@ -102,12 +82,13 @@ ProcXGrabDeviceButton(ClientPtr client)
struct tmask tmp[EMASKSIZE];
GrabMask mask;
REQUEST(xGrabDeviceButtonReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count)
return BadLength;
REQUEST_HEAD_AT_LEAST(xGrabDeviceButtonReq);
REQUEST_FIELD_CARD32(grabWindow);
REQUEST_FIELD_CARD16(modifiers);
REQUEST_FIELD_CARD16(event_count);
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
stuff->event_count * sizeof(CARD32));
REQUEST_BUF_CARD32(&stuff[1], stuff->event_count);
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
if (ret != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GRABDEVB_H
#define GRABDEVB_H 1
int SProcXGrabDeviceButton(ClientPtr /* client */
);
int ProcXGrabDeviceButton(ClientPtr /* client */
);

View File

@ -57,6 +57,7 @@ SOFTWARE.
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -65,25 +66,6 @@ SOFTWARE.
#include "grabdev.h"
#include "grabdevk.h"
/***********************************************************************
*
* Handle requests from clients with a different byte order.
*
*/
int _X_COLD
SProcXGrabDeviceKey(ClientPtr client)
{
REQUEST(xGrabDeviceKeyReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return (ProcXGrabDeviceKey(client));
}
/***********************************************************************
*
* Grab a key on an extension device.
@ -100,12 +82,12 @@ ProcXGrabDeviceKey(ClientPtr client)
struct tmask tmp[EMASKSIZE];
GrabMask mask;
REQUEST(xGrabDeviceKeyReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count)
return BadLength;
REQUEST_HEAD_AT_LEAST(xGrabDeviceKeyReq);
REQUEST_FIELD_CARD32(grabWindow);
REQUEST_FIELD_CARD16(modifiers);
REQUEST_FIELD_CARD16(event_count);
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
REQUEST_BUF_CARD32(&stuff[1], stuff->event_count);
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
if (ret != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GRABDEVK_H
#define GRABDEVK_H 1
int SProcXGrabDeviceKey(ClientPtr /* client */
);
int ProcXGrabDeviceKey(ClientPtr /* client */
);

View File

@ -56,27 +56,12 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/exevents_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exglobals.h"
#include "gtmotion.h"
/***********************************************************************
*
* Swap the request if server and client have different byte ordering.
*
*/
int _X_COLD
SProcXGetDeviceMotionEvents(ClientPtr client)
{
REQUEST(xGetDeviceMotionEventsReq);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
swapl(&stuff->start);
swapl(&stuff->stop);
return (ProcXGetDeviceMotionEvents(client));
}
/****************************************************************************
*
* Get the motion history for an extension pointer devices.
@ -86,8 +71,9 @@ SProcXGetDeviceMotionEvents(ClientPtr client)
int
ProcXGetDeviceMotionEvents(ClientPtr client)
{
REQUEST(xGetDeviceMotionEventsReq);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
REQUEST_HEAD_STRUCT(xGetDeviceMotionEventsReq);
REQUEST_FIELD_CARD32(start);
REQUEST_FIELD_CARD32(stop);
DeviceIntPtr dev;
int rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GTMOTION_H
#define GTMOTION_H 1
int SProcXGetDeviceMotionEvents(ClientPtr /* client */
);
int ProcXGetDeviceMotionEvents(ClientPtr /* client */
);

View File

@ -58,6 +58,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "XIstubs.h"
@ -325,7 +326,7 @@ ProcXListInputDevices(ClientPtr client)
xDeviceInfo *dev;
DeviceIntPtr d;
REQUEST_SIZE_MATCH(xListInputDevicesReq);
REQUEST_HEAD_STRUCT(xListInputDevicesReq);
/* allocate space for saving skip value */
skip = calloc(inputInfo.numDevices, sizeof(Bool));

View File

@ -56,6 +56,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "XIstubs.h"
@ -81,8 +82,7 @@ ProcXOpenDevice(ClientPtr client)
int status = Success;
DeviceIntPtr dev;
REQUEST(xOpenDeviceReq);
REQUEST_SIZE_MATCH(xOpenDeviceReq);
REQUEST_HEAD_STRUCT(xOpenDeviceReq);
status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);

View File

@ -39,6 +39,7 @@ from The Open Group.
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -69,8 +70,7 @@ ProcXQueryDeviceState(ClientPtr client)
DeviceIntPtr dev;
double *values;
REQUEST(xQueryDeviceStateReq);
REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
REQUEST_HEAD_STRUCT(xQueryDeviceStateReq);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
if (rc != Success && rc != BadAccess)

View File

@ -58,6 +58,7 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -111,25 +112,6 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
return Success;
}
/***********************************************************************
*
* Handle requests from clients with a different byte order.
*
*/
int _X_COLD
SProcXSelectExtensionEvent(ClientPtr client)
{
REQUEST(xSelectExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
swapl(&stuff->window);
swaps(&stuff->count);
REQUEST_FIXED_SIZE(xSelectExtensionEventReq, stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
return (ProcXSelectExtensionEvent(client));
}
/***********************************************************************
*
* This procedure selects input from an extension device.
@ -144,12 +126,11 @@ ProcXSelectExtensionEvent(ClientPtr client)
WindowPtr pWin;
struct tmask tmp[EMASKSIZE];
REQUEST(xSelectExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
if (client->req_len !=
bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count)
return BadLength;
REQUEST_HEAD_AT_LEAST(xSelectExtensionEventReq);
REQUEST_FIELD_CARD32(window);
REQUEST_FIELD_CARD16(count);
REQUEST_FIXED_SIZE(xSelectExtensionEventReq, stuff->count * sizeof(CARD32));
REQUEST_BUF_CARD32(&stuff[1], stuff->count);
ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
if (ret != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SELECTEV_H
#define SELECTEV_H 1
int SProcXSelectExtensionEvent(ClientPtr /* client */
);
int ProcXSelectExtensionEvent(ClientPtr /* client */
);

View File

@ -56,6 +56,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/exevents_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* Window */
@ -68,29 +69,35 @@ extern int lastEvent; /* Defined in extension.c */
/***********************************************************************
*
* Handle requests from clients with a different byte order than us.
* Send an event to some client, as if it had come from an extension input
* device.
*
*/
int _X_COLD
SProcXSendExtensionEvent(ClientPtr client)
int
ProcXSendExtensionEvent(ClientPtr client)
{
CARD32 *p;
int i;
xEvent eventT = { .u.u.type = 0 };
xEvent *eventP;
EventSwapPtr proc;
int ret, i;
DeviceIntPtr dev;
xEvent *first;
XEventClass *list;
struct tmask tmp[EMASKSIZE];
REQUEST(xSendExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
swapl(&stuff->destination);
swaps(&stuff->count);
REQUEST_HEAD_AT_LEAST(xSendExtensionEventReq);
REQUEST_FIELD_CARD32(destination);
REQUEST_FIELD_CARD16(count);
if (client->req_len !=
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
bytes_to_int32(stuff->num_events * sizeof(xEvent)))
return BadLength;
if (client->swapped) {
CARD32 *p;
xEvent eventT = { .u.u.type = 0 };
xEvent *eventP;
EventSwapPtr proc;
eventP = (xEvent *) &stuff[1];
for (i = 0; i < stuff->num_events; i++, eventP++) {
if (eventP->u.u.type == GenericEvent) {
@ -110,32 +117,7 @@ SProcXSendExtensionEvent(ClientPtr client)
p = (CARD32 *) (((xEvent *) &stuff[1]) + stuff->num_events);
SwapLongs(p, stuff->count);
return (ProcXSendExtensionEvent(client));
}
/***********************************************************************
*
* Send an event to some client, as if it had come from an extension input
* device.
*
*/
int
ProcXSendExtensionEvent(ClientPtr client)
{
int ret, i;
DeviceIntPtr dev;
xEvent *first;
XEventClass *list;
struct tmask tmp[EMASKSIZE];
REQUEST(xSendExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
if (client->req_len !=
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
(stuff->num_events * bytes_to_int32(sizeof(xEvent))))
return BadLength;
}
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
if (ret != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SENDEXEV_H
#define SENDEXEV_H 1
int SProcXSendExtensionEvent(ClientPtr /* client */
);
int ProcXSendExtensionEvent(ClientPtr /* client */
);

View File

@ -56,6 +56,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exevents.h"
@ -74,8 +75,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
int ret;
DeviceIntPtr dev;
REQUEST(xSetDeviceButtonMappingReq);
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
REQUEST_HEAD_AT_LEAST(xSetDeviceButtonMappingReq);
if (client->req_len !=
bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length))

View File

@ -56,6 +56,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "dix/resource_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -75,8 +76,7 @@ ProcXSetDeviceValuators(ClientPtr client)
DeviceIntPtr dev;
int rc;
REQUEST(xSetDeviceValuatorsReq);
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
REQUEST_HEAD_AT_LEAST(xSetDeviceValuatorsReq);
xSetDeviceValuatorsReply rep = {
.repType = X_Reply,

View File

@ -59,26 +59,11 @@ SOFTWARE.
#include "inputstr.h" /* DeviceIntPtr */
#include "dix/dix_priv.h"
#include "dix/request_priv.h"
#include "exglobals.h"
#include "setfocus.h"
/***********************************************************************
*
* This procedure sets the focus for a device.
*
*/
int _X_COLD
SProcXSetDeviceFocus(ClientPtr client)
{
REQUEST(xSetDeviceFocusReq);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
swapl(&stuff->focus);
swapl(&stuff->time);
return (ProcXSetDeviceFocus(client));
}
/***********************************************************************
*
* This procedure sets the focus for a device.
@ -91,8 +76,9 @@ ProcXSetDeviceFocus(ClientPtr client)
int ret;
DeviceIntPtr dev;
REQUEST(xSetDeviceFocusReq);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
REQUEST_HEAD_STRUCT(xSetDeviceFocusReq);
REQUEST_FIELD_CARD32(focus);
REQUEST_FIELD_CARD32(time);
ret = dixLookupDevice(&dev, stuff->device, client, DixSetFocusAccess);
if (ret != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SETFOCUS_H
#define SETFOCUS_H 1
int SProcXSetDeviceFocus(ClientPtr /* client */
);
int ProcXSetDeviceFocus(ClientPtr /* client */
);

View File

@ -57,6 +57,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "exevents.h"
@ -75,8 +76,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
int ret;
DeviceIntPtr dev;
REQUEST(xSetDeviceModifierMappingReq);
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
REQUEST_HEAD_AT_LEAST(xSetDeviceModifierMappingReq);
if (client->req_len != bytes_to_int32(sizeof(xSetDeviceModifierMappingReq)) +
(stuff->numKeyPerModifier << 1))

View File

@ -56,6 +56,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "dix/resource_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -75,8 +76,7 @@ ProcXSetDeviceMode(ClientPtr client)
DeviceIntPtr dev;
int rc;
REQUEST(xSetDeviceModeReq);
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
REQUEST_HEAD_STRUCT(xSetDeviceModeReq);
xSetDeviceModeReply rep = {
.repType = X_Reply,

View File

@ -54,6 +54,7 @@ SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "dix/request_priv.h"
#include "dix/resource_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -61,21 +62,6 @@ SOFTWARE.
#include "exglobals.h"
#include "ungrdev.h"
/***********************************************************************
*
* Handle requests from a client with a different byte order.
*
*/
int _X_COLD
SProcXUngrabDevice(ClientPtr client)
{
REQUEST(xUngrabDeviceReq);
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
swapl(&stuff->time);
return (ProcXUngrabDevice(client));
}
/***********************************************************************
*
* Release a grab of an extension device.
@ -90,8 +76,8 @@ ProcXUngrabDevice(ClientPtr client)
TimeStamp time;
int rc;
REQUEST(xUngrabDeviceReq);
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
REQUEST_HEAD_STRUCT(xUngrabDeviceReq);
REQUEST_FIELD_CARD32(time);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (rc != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef UNGRDEV_H
#define UNGRDEV_H 1
int SProcXUngrabDevice(ClientPtr /* client */
);
int ProcXUngrabDevice(ClientPtr /* client */
);

View File

@ -57,6 +57,7 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/dixgrabs_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -67,22 +68,6 @@ SOFTWARE.
ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
Mod3Mask | Mod4Mask | Mod5Mask )
/***********************************************************************
*
* Handle requests from a client with a different byte order.
*
*/
int _X_COLD
SProcXUngrabDeviceButton(ClientPtr client)
{
REQUEST(xUngrabDeviceButtonReq);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
return (ProcXUngrabDeviceButton(client));
}
/***********************************************************************
*
* Release a grab of a button on an extension device.
@ -98,8 +83,9 @@ ProcXUngrabDeviceButton(ClientPtr client)
GrabPtr temporaryGrab;
int rc;
REQUEST(xUngrabDeviceButtonReq);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
REQUEST_HEAD_STRUCT(xUngrabDeviceButtonReq);
REQUEST_FIELD_CARD32(grabWindow);
REQUEST_FIELD_CARD16(modifiers);
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
if (rc != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef UNGRDEVB_H
#define UNGRDEVB_H 1
int SProcXUngrabDeviceButton(ClientPtr /* client */
);
int ProcXUngrabDeviceButton(ClientPtr /* client */
);

View File

@ -57,6 +57,7 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/dixgrabs_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -69,22 +70,6 @@ SOFTWARE.
ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
Mod3Mask | Mod4Mask | Mod5Mask )
/***********************************************************************
*
* Handle requests from a client with a different byte order.
*
*/
int _X_COLD
SProcXUngrabDeviceKey(ClientPtr client)
{
REQUEST(xUngrabDeviceKeyReq);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
return (ProcXUngrabDeviceKey(client));
}
/***********************************************************************
*
* Release a grab of a key on an extension device.
@ -100,8 +85,9 @@ ProcXUngrabDeviceKey(ClientPtr client)
GrabPtr temporaryGrab;
int rc;
REQUEST(xUngrabDeviceKeyReq);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
REQUEST_HEAD_STRUCT(xUngrabDeviceKeyReq);
REQUEST_FIELD_CARD32(grabWindow);
REQUEST_FIELD_CARD16(modifiers);
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
if (rc != Success)

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef UNGRDEVK_H
#define UNGRDEVK_H 1
int SProcXUngrabDeviceKey(ClientPtr /* client */
);
int ProcXUngrabDeviceKey(ClientPtr /* client */
);

View File

@ -37,6 +37,7 @@
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "os/fmt.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -46,42 +47,82 @@
#include "exglobals.h" /* BadDevice */
#include "xiallowev.h"
int _X_COLD
SProcXIAllowEvents(ClientPtr client)
static int allowEvents(ClientPtr client, xXIAllowEventsReq *stuff)
{
REQUEST(xXIAllowEventsReq);
REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
DeviceIntPtr dev;
swaps(&stuff->deviceid);
swapl(&stuff->time);
if (client->req_len > 3) {
xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff;
int ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (ret != Success)
return ret;
REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
swapl(&req_xi22->touchid);
swapl(&req_xi22->grab_window);
TimeStamp time = ClientTimeToServerTime(stuff->time);
switch (stuff->mode) {
case XIReplayDevice:
AllowSome(client, time, dev, NOT_GRABBED);
break;
case XISyncDevice:
AllowSome(client, time, dev, FREEZE_NEXT_EVENT);
break;
case XIAsyncDevice:
AllowSome(client, time, dev, THAWED);
break;
case XIAsyncPairedDevice:
if (IsMaster(dev))
AllowSome(client, time, dev, THAW_OTHERS);
break;
case XISyncPair:
if (IsMaster(dev))
AllowSome(client, time, dev, FREEZE_BOTH_NEXT_EVENT);
break;
case XIAsyncPair:
if (IsMaster(dev))
AllowSome(client, time, dev, THAWED_BOTH);
break;
default:
client->errorValue = stuff->mode;
ret = BadValue;
}
return ProcXIAllowEvents(client);
return ret;
}
int
ProcXIAllowEvents(ClientPtr client)
{
TimeStamp time;
DeviceIntPtr dev;
int ret = Success;
XIClientPtr xi_client;
Bool have_xi22 = FALSE;
REQUEST(xXI2_2AllowEventsReq);
xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
XIClientPtr xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
if (version_compare(xi_client->major_version,
xi_client->minor_version, 2, 2) >= 0) {
REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
have_xi22 = TRUE;
REQUEST_HEAD_AT_LEAST(xXI2_2AllowEventsReq);
REQUEST_FIELD_CARD16(length);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(time);
REQUEST_FIELD_CARD32(touchid);
REQUEST_FIELD_CARD32(grab_window);
if ((stuff->mode == XIRejectTouch) || (stuff->mode == XIAcceptTouch)) {
DeviceIntPtr dev;
int rc;
WindowPtr win;
int ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (ret != Success)
return ret;
rc = dixLookupWindow(&win, stuff->grab_window, client, DixReadAccess);
if (rc != Success)
return rc;
return TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
stuff->grab_window, &client->errorValue);
}
return allowEvents(client, (xXIAllowEventsReq*)stuff);
} else {
REQUEST_HEAD_AT_LEAST(xXIAllowEventsReq);
REQUEST_FIELD_CARD16(length);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(time);
return allowEvents(client, stuff);
}
else {
REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);

View File

@ -31,6 +31,5 @@
#define XIALLOWEV_H 1
int ProcXIAllowEvents(ClientPtr client);
int SProcXIAllowEvents(ClientPtr client);
#endif /* XIALLOWEV_H */

View File

@ -46,6 +46,7 @@
#include "dix/cursor_priv.h"
#include "dix/dix_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "dix/resource_priv.h"
#include "mi/mi_priv.h"
#include "os/bug_priv.h"
@ -849,52 +850,33 @@ XIDestroyPointerBarrier(ClientPtr client,
return Success;
}
int _X_COLD
SProcXIBarrierReleasePointer(ClientPtr client)
{
xXIBarrierReleasePointerInfo *info;
REQUEST(xXIBarrierReleasePointerReq);
int i;
REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq);
swapl(&stuff->num_barriers);
if (stuff->num_barriers > UINT32_MAX / sizeof(xXIBarrierReleasePointerInfo))
return BadLength;
REQUEST_FIXED_SIZE(xXIBarrierReleasePointerReq, stuff->num_barriers * sizeof(xXIBarrierReleasePointerInfo));
info = (xXIBarrierReleasePointerInfo*) &stuff[1];
for (i = 0; i < stuff->num_barriers; i++, info++) {
swaps(&info->deviceid);
swapl(&info->barrier);
swapl(&info->eventid);
}
return (ProcXIBarrierReleasePointer(client));
}
int
ProcXIBarrierReleasePointer(ClientPtr client)
{
REQUEST_HEAD_AT_LEAST(xXIBarrierReleasePointerReq);
REQUEST_FIELD_CARD32(num_barriers);
if (stuff->num_barriers > UINT32_MAX / sizeof(xXIBarrierReleasePointerInfo))
return BadLength;
REQUEST_FIXED_SIZE(xXIBarrierReleasePointerReq, stuff->num_barriers * sizeof(xXIBarrierReleasePointerInfo));
int i;
int err;
struct PointerBarrierClient *barrier;
struct PointerBarrier *b;
xXIBarrierReleasePointerInfo *info;
REQUEST(xXIBarrierReleasePointerReq);
REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq);
if (stuff->num_barriers > UINT32_MAX / sizeof(xXIBarrierReleasePointerInfo))
return BadLength;
REQUEST_FIXED_SIZE(xXIBarrierReleasePointerReq, stuff->num_barriers * sizeof(xXIBarrierReleasePointerInfo));
xXIBarrierReleasePointerInfo *info = (xXIBarrierReleasePointerInfo*) &stuff[1];
info = (xXIBarrierReleasePointerInfo*) &stuff[1];
for (i = 0; i < stuff->num_barriers; i++, info++) {
struct PointerBarrierDevice *pbd;
DeviceIntPtr dev;
CARD32 barrier_id, event_id;
_X_UNUSED CARD32 device_id;
CLIENT_STRUCT_CARD16_1(info, deviceid);
CLIENT_STRUCT_CARD32_2(info, barrier, eventid);
barrier_id = info->barrier;
event_id = info->eventid;

View File

@ -39,7 +39,6 @@ XIDestroyPointerBarrier(ClientPtr client,
Bool XIBarrierInit(void);
void XIBarrierReset(void);
int SProcXIBarrierReleasePointer(ClientPtr client);
int ProcXIBarrierReleasePointer(ClientPtr client);
void XIBarrierNewMasterDevice(ClientPtr client, int deviceid);

View File

@ -38,6 +38,7 @@
#include "dix/cursor_priv.h"
#include "dix/dix_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -54,17 +55,6 @@
*
*/
int _X_COLD
SProcXIChangeCursor(ClientPtr client)
{
REQUEST(xXIChangeCursorReq);
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
swapl(&stuff->win);
swapl(&stuff->cursor);
swaps(&stuff->deviceid);
return (ProcXIChangeCursor(client));
}
int
ProcXIChangeCursor(ClientPtr client)
{
@ -73,8 +63,10 @@ ProcXIChangeCursor(ClientPtr client)
DeviceIntPtr pDev = NULL;
CursorPtr pCursor = NULL;
REQUEST(xXIChangeCursorReq);
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
REQUEST_HEAD_STRUCT(xXIChangeCursorReq);
REQUEST_FIELD_CARD32(win);
REQUEST_FIELD_CARD32(cursor);
REQUEST_FIELD_CARD16(deviceid);
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
if (rc != Success)

View File

@ -30,7 +30,6 @@
#ifndef CHDEVCUR_H
#define CHDEVCUR_H 1
int SProcXIChangeCursor(ClientPtr /* client */ );
int ProcXIChangeCursor(ClientPtr /* client */ );
#endif /* CHDEVCUR_H */

View File

@ -42,6 +42,7 @@
#include "dix/exevents_priv.h"
#include "dix/extension_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "os/bug_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -423,7 +424,12 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo * c, int flags[MAXDEVICES])
return rc;
}
#define SWAPIF(cmd) if (client->swapped) { cmd; }
/***********************************************************************
*
* This procedure allows a client to change the device hierarchy through
* adding new master devices, removing them, etc.
*
*/
int
ProcXIChangeHierarchy(ClientPtr client)
@ -438,8 +444,7 @@ ProcXIChangeHierarchy(ClientPtr client)
CHANGED,
} changes = NO_CHANGE;
REQUEST(xXIChangeHierarchyReq);
REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq);
REQUEST_HEAD_AT_LEAST(xXIChangeHierarchyReq);
if (!stuff->num_changes)
return rc;
@ -453,8 +458,7 @@ ProcXIChangeHierarchy(ClientPtr client)
goto unwind;
}
SWAPIF(swaps(&any->type));
SWAPIF(swaps(&any->length));
CLIENT_STRUCT_CARD16_2(any, type, length);
if (len < ((size_t)any->length << 2))
return BadLength;
@ -477,7 +481,7 @@ ProcXIChangeHierarchy(ClientPtr client)
rc = BadLength;
goto unwind;
}
SWAPIF(swaps(&c->name_len));
CLIENT_STRUCT_CARD16_1(c, name_len);
if (c->name_len > (len - sizeof(xXIAddMasterInfo))) {
rc = BadLength;
goto unwind;

View File

@ -31,6 +31,7 @@
#include <X11/extensions/XI2proto.h>
#include "dix/dix_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -41,29 +42,14 @@
#include "exglobals.h"
#include "xigetclientpointer.h"
/***********************************************************************
* This procedure allows a client to query another client's client pointer
* setting.
*/
int _X_COLD
SProcXIGetClientPointer(ClientPtr client)
{
REQUEST(xXIGetClientPointerReq);
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
swapl(&stuff->win);
return ProcXIGetClientPointer(client);
}
int
ProcXIGetClientPointer(ClientPtr client)
{
int rc;
ClientPtr winclient;
REQUEST(xXIGetClientPointerReq);
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
REQUEST_HEAD_STRUCT(xXIGetClientPointerReq);
REQUEST_FIELD_CARD32(win);
if (stuff->win != None) {
rc = dixLookupResourceOwner(&winclient, stuff->win, client, DixGetAttrAccess);

View File

@ -30,7 +30,6 @@
#ifndef GETCPTR_H
#define GETCPTR_H 1
int SProcXIGetClientPointer(ClientPtr /* client */ );
int ProcXIGetClientPointer(ClientPtr /* client */ );
#endif /* GETCPTR_H */

View File

@ -36,6 +36,7 @@
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "dix/request_priv.h"
#include "dix/resource_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -44,25 +45,6 @@
#include "xigrabdev.h"
#include "inpututils.h"
int _X_COLD
SProcXIGrabDevice(ClientPtr client)
{
REQUEST(xXIGrabDeviceReq);
/*
* Check here for at least the length of the struct we swap, then
* let ProcXIGrabDevice check the full size after we swap mask_len.
*/
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
swaps(&stuff->deviceid);
swapl(&stuff->grab_window);
swapl(&stuff->cursor);
swapl(&stuff->time);
swaps(&stuff->mask_len);
return ProcXIGrabDevice(client);
}
int
ProcXIGrabDevice(ClientPtr client)
{
@ -74,7 +56,12 @@ ProcXIGrabDevice(ClientPtr client)
unsigned int keyboard_mode;
unsigned int pointer_mode;
REQUEST(xXIGrabDeviceReq);
REQUEST_HEAD_AT_LEAST(xXIGrabDeviceReq);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(grab_window);
REQUEST_FIELD_CARD32(cursor);
REQUEST_FIELD_CARD32(time);
REQUEST_FIELD_CARD16(mask_len);
REQUEST_FIXED_SIZE(xXIGrabDeviceReq, ((size_t) stuff->mask_len) * 4);
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
@ -136,18 +123,6 @@ ProcXIGrabDevice(ClientPtr client)
return ret;
}
int _X_COLD
SProcXIUngrabDevice(ClientPtr client)
{
REQUEST(xXIUngrabDeviceReq);
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
swaps(&stuff->deviceid);
swapl(&stuff->time);
return ProcXIUngrabDevice(client);
}
int
ProcXIUngrabDevice(ClientPtr client)
{
@ -156,8 +131,9 @@ ProcXIUngrabDevice(ClientPtr client)
int ret = Success;
TimeStamp time;
REQUEST(xXIUngrabDeviceReq);
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
REQUEST_HEAD_STRUCT(xXIUngrabDeviceReq);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(time);
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
if (ret != Success)

View File

@ -31,9 +31,7 @@
#define XIGRABDEV_H 1
int ProcXIGrabDevice(ClientPtr client);
int SProcXIGrabDevice(ClientPtr client);
int ProcXIUngrabDevice(ClientPtr client);
int SProcXIUngrabDevice(ClientPtr client);
#endif /* XIGRABDEV_H */

View File

@ -37,6 +37,7 @@
#include "dix/dix_priv.h"
#include "dix/dixgrabs_priv.h"
#include "dix/exevents_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
@ -46,34 +47,6 @@
#include "misc.h"
#include "inpututils.h"
int _X_COLD
SProcXIPassiveGrabDevice(ClientPtr client)
{
int i;
uint32_t *mods;
REQUEST(xXIPassiveGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
swaps(&stuff->deviceid);
swapl(&stuff->grab_window);
swapl(&stuff->cursor);
swapl(&stuff->time);
swapl(&stuff->detail);
swaps(&stuff->mask_len);
swaps(&stuff->num_modifiers);
REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
((uint32_t) stuff->mask_len + stuff->num_modifiers) *4);
mods = (uint32_t *) &stuff[1] + stuff->mask_len;
for (i = 0; i < stuff->num_modifiers; i++, mods++) {
swapl(mods);
}
return ProcXIPassiveGrabDevice(client);
}
int
ProcXIPassiveGrabDevice(ClientPtr client)
{
@ -93,9 +66,23 @@ ProcXIPassiveGrabDevice(ClientPtr client)
void *tmp;
int mask_len;
REQUEST(xXIPassiveGrabDeviceReq);
REQUEST_HEAD_AT_LEAST(xXIPassiveGrabDeviceReq);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(grab_window);
REQUEST_FIELD_CARD32(cursor);
REQUEST_FIELD_CARD32(time);
REQUEST_FIELD_CARD32(detail);
REQUEST_FIELD_CARD16(mask_len);
REQUEST_FIELD_CARD16(num_modifiers);
REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
((uint32_t) stuff->mask_len + stuff->num_modifiers) * 4);
((uint32_t) stuff->mask_len + stuff->num_modifiers) *4);
if (client->swapped) {
uint32_t *mods = (uint32_t *) &stuff[1] + stuff->mask_len;
for (i = 0; i < stuff->num_modifiers; i++, mods++) {
swapl(mods);
}
}
if (stuff->deviceid == XIAllDevices)
dev = inputInfo.all_devices;
@ -262,30 +249,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
return ret;
}
int _X_COLD
SProcXIPassiveUngrabDevice(ClientPtr client)
{
int i;
uint32_t *modifiers;
REQUEST(xXIPassiveUngrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
swapl(&stuff->grab_window);
swaps(&stuff->deviceid);
swapl(&stuff->detail);
swaps(&stuff->num_modifiers);
REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq,
((uint32_t) stuff->num_modifiers) << 2);
modifiers = (uint32_t *) &stuff[1];
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
swapl(modifiers);
return ProcXIPassiveUngrabDevice(client);
}
int
ProcXIPassiveUngrabDevice(ClientPtr client)
{
@ -295,10 +258,20 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
uint32_t *modifiers;
int i, rc;
REQUEST(xXIPassiveUngrabDeviceReq);
REQUEST_HEAD_AT_LEAST(xXIPassiveUngrabDeviceReq);
REQUEST_FIELD_CARD32(grab_window);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(detail);
REQUEST_FIELD_CARD16(num_modifiers);
REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq,
((uint32_t) stuff->num_modifiers) << 2);
if (client->swapped) {
modifiers = (uint32_t *) &stuff[1];
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
swapl(modifiers);
}
if (stuff->deviceid == XIAllDevices)
dev = inputInfo.all_devices;
else if (stuff->deviceid == XIAllMasterDevices)

View File

@ -30,9 +30,7 @@
#ifndef XIPASSIVEGRAB_H
#define XIPASSIVEGRAB_H 1
int SProcXIPassiveUngrabDevice(ClientPtr client);
int ProcXIPassiveUngrabDevice(ClientPtr client);
int ProcXIPassiveGrabDevice(ClientPtr client);
int SProcXIPassiveGrabDevice(ClientPtr client);
#endif /* XIPASSIVEGRAB_H */

View File

@ -35,6 +35,7 @@
#include "dix/exevents_priv.h"
#include "dix/extension_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "dix.h"
#include "inputstr.h"
@ -854,8 +855,7 @@ ProcXListDeviceProperties(ClientPtr client)
DeviceIntPtr dev;
int rc = Success;
REQUEST(xListDevicePropertiesReq);
REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
REQUEST_HEAD_STRUCT(xListDevicePropertiesReq);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess);
if (rc != Success)
@ -890,13 +890,16 @@ ProcXListDeviceProperties(ClientPtr client)
int
ProcXChangeDeviceProperty(ClientPtr client)
{
REQUEST(xChangeDevicePropertyReq);
REQUEST_HEAD_AT_LEAST(xChangeDevicePropertyReq);
REQUEST_FIELD_CARD32(property);
REQUEST_FIELD_CARD32(type);
REQUEST_FIELD_CARD32(nUnits);
DeviceIntPtr dev;
unsigned long len;
uint64_t totalSize;
int rc;
REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
UpdateCurrentTime();
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
@ -923,11 +926,12 @@ ProcXChangeDeviceProperty(ClientPtr client)
int
ProcXDeleteDeviceProperty(ClientPtr client)
{
REQUEST(xDeleteDevicePropertyReq);
REQUEST_HEAD_STRUCT(xDeleteDevicePropertyReq);
REQUEST_FIELD_CARD32(property);
DeviceIntPtr dev;
int rc;
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
UpdateCurrentTime();
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
if (rc != Success)
@ -945,14 +949,18 @@ ProcXDeleteDeviceProperty(ClientPtr client)
int
ProcXGetDeviceProperty(ClientPtr client)
{
REQUEST(xGetDevicePropertyReq);
REQUEST_HEAD_STRUCT(xGetDevicePropertyReq);
REQUEST_FIELD_CARD32(property);
REQUEST_FIELD_CARD32(type);
REQUEST_FIELD_CARD32(longOffset);
REQUEST_FIELD_CARD32(longLength);
DeviceIntPtr dev;
int length;
int rc, format, nitems, bytes_after;
char *data;
Atom type;
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
if (stuff->delete)
UpdateCurrentTime();
rc = dixLookupDevice(&dev, stuff->deviceid, client,
@ -1022,53 +1030,18 @@ ProcXGetDeviceProperty(ClientPtr client)
return Success;
}
int _X_COLD
SProcXChangeDeviceProperty(ClientPtr client)
{
REQUEST(xChangeDevicePropertyReq);
REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
swapl(&stuff->property);
swapl(&stuff->type);
swapl(&stuff->nUnits);
return (ProcXChangeDeviceProperty(client));
}
int _X_COLD
SProcXDeleteDeviceProperty(ClientPtr client)
{
REQUEST(xDeleteDevicePropertyReq);
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
swapl(&stuff->property);
return (ProcXDeleteDeviceProperty(client));
}
int _X_COLD
SProcXGetDeviceProperty(ClientPtr client)
{
REQUEST(xGetDevicePropertyReq);
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
swapl(&stuff->property);
swapl(&stuff->type);
swapl(&stuff->longOffset);
swapl(&stuff->longLength);
return (ProcXGetDeviceProperty(client));
}
/* XI2 Request/reply handling */
int
ProcXIListProperties(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xXIListPropertiesReq);
REQUEST_FIELD_CARD16(deviceid);
Atom *atoms;
int natoms;
DeviceIntPtr dev;
int rc = Success;
REQUEST(xXIListPropertiesReq);
REQUEST_SIZE_MATCH(xXIListPropertiesReq);
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess);
if (rc != Success)
return rc;
@ -1102,13 +1075,17 @@ ProcXIListProperties(ClientPtr client)
int
ProcXIChangeProperty(ClientPtr client)
{
REQUEST_HEAD_AT_LEAST(xXIChangePropertyReq);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(property);
REQUEST_FIELD_CARD32(type);
REQUEST_FIELD_CARD32(num_items);
int rc;
DeviceIntPtr dev;
uint64_t totalSize;
unsigned long len;
REQUEST(xXIChangePropertyReq);
REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
UpdateCurrentTime();
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
@ -1135,12 +1112,13 @@ ProcXIChangeProperty(ClientPtr client)
int
ProcXIDeleteProperty(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xXIDeletePropertyReq);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(property);
DeviceIntPtr dev;
int rc;
REQUEST(xXIDeletePropertyReq);
REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
UpdateCurrentTime();
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
if (rc != Success)
@ -1158,14 +1136,20 @@ ProcXIDeleteProperty(ClientPtr client)
int
ProcXIGetProperty(ClientPtr client)
{
REQUEST(xXIGetPropertyReq);
REQUEST_HEAD_STRUCT(xXIGetPropertyReq);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(property);
REQUEST_FIELD_CARD32(type);
REQUEST_FIELD_CARD32(offset);
REQUEST_FIELD_CARD32(len);
DeviceIntPtr dev;
int length;
int rc, format, nitems, bytes_after;
char *data;
Atom type;
REQUEST_SIZE_MATCH(xXIGetPropertyReq);
if (stuff->delete)
UpdateCurrentTime();
rc = dixLookupDevice(&dev, stuff->deviceid, client,
@ -1234,51 +1218,3 @@ ProcXIGetProperty(ClientPtr client)
return Success;
}
int _X_COLD
SProcXIListProperties(ClientPtr client)
{
REQUEST(xXIListPropertiesReq);
REQUEST_SIZE_MATCH(xXIListPropertiesReq);
swaps(&stuff->deviceid);
return (ProcXIListProperties(client));
}
int _X_COLD
SProcXIChangeProperty(ClientPtr client)
{
REQUEST(xXIChangePropertyReq);
REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
swaps(&stuff->deviceid);
swapl(&stuff->property);
swapl(&stuff->type);
swapl(&stuff->num_items);
return (ProcXIChangeProperty(client));
}
int _X_COLD
SProcXIDeleteProperty(ClientPtr client)
{
REQUEST(xXIDeletePropertyReq);
REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
swaps(&stuff->deviceid);
swapl(&stuff->property);
return (ProcXIDeleteProperty(client));
}
int _X_COLD
SProcXIGetProperty(ClientPtr client)
{
REQUEST(xXIGetPropertyReq);
REQUEST_SIZE_MATCH(xXIGetPropertyReq);
swaps(&stuff->deviceid);
swapl(&stuff->property);
swapl(&stuff->type);
swapl(&stuff->offset);
swapl(&stuff->len);
return (ProcXIGetProperty(client));
}

View File

@ -35,22 +35,12 @@ int ProcXChangeDeviceProperty(ClientPtr client);
int ProcXDeleteDeviceProperty(ClientPtr client);
int ProcXGetDeviceProperty(ClientPtr client);
/* request swapping */
int SProcXChangeDeviceProperty(ClientPtr client);
int SProcXDeleteDeviceProperty(ClientPtr client);
int SProcXGetDeviceProperty(ClientPtr client);
/* XI2 request/reply handling */
int ProcXIListProperties(ClientPtr client);
int ProcXIChangeProperty(ClientPtr client);
int ProcXIDeleteProperty(ClientPtr client);
int ProcXIGetProperty(ClientPtr client);
int SProcXIListProperties(ClientPtr client);
int SProcXIChangeProperty(ClientPtr client);
int SProcXIDeleteProperty(ClientPtr client);
int SProcXIGetProperty(ClientPtr client);
void XIResetProperties(void);
#endif /* XIPROPERTY_H */

View File

@ -36,6 +36,7 @@
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "os/fmt.h"
#include "inputstr.h"
@ -53,29 +54,19 @@ static int
ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo * info);
static int SizeDeviceInfo(DeviceIntPtr dev);
static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo * info);
int _X_COLD
SProcXIQueryDevice(ClientPtr client)
{
REQUEST(xXIQueryDeviceReq);
REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
swaps(&stuff->deviceid);
return ProcXIQueryDevice(client);
}
int
ProcXIQueryDevice(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xXIQueryDeviceReq);
REQUEST_FIELD_CARD16(deviceid);
DeviceIntPtr dev = NULL;
int rc = Success;
int i = 0, len = 0;
char *info, *ptr;
Bool *skip = NULL;
REQUEST(xXIQueryDeviceReq);
REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
if (stuff->deviceid != XIAllDevices &&
stuff->deviceid != XIAllMasterDevices) {
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);

View File

@ -33,7 +33,6 @@
#include <X11/extensions/XI2proto.h>
int SProcXIQueryDevice(ClientPtr client);
int ProcXIQueryDevice(ClientPtr client);
int SizeDeviceClasses(DeviceIntPtr dev);
int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,

View File

@ -40,6 +40,7 @@
#include "dix/eventconvert.h"
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "os/fmt.h"
#include "Xext/panoramiXsrv.h"
@ -59,20 +60,13 @@
*
*/
int _X_COLD
SProcXIQueryPointer(ClientPtr client)
{
REQUEST(xXIQueryPointerReq);
REQUEST_SIZE_MATCH(xXIQueryPointerReq);
swaps(&stuff->deviceid);
swapl(&stuff->win);
return (ProcXIQueryPointer(client));
}
int
ProcXIQueryPointer(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xXIQueryPointerReq);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(win);
int rc;
DeviceIntPtr pDev, kbd;
WindowPtr pWin, t;
@ -83,9 +77,6 @@ ProcXIQueryPointer(ClientPtr client)
XIClientPtr xi_client;
Bool have_xi22 = FALSE;
REQUEST(xXIQueryPointerReq);
REQUEST_SIZE_MATCH(xXIQueryPointerReq);
/* Check if client is compliant with XInput 2.2 or later. Earlier clients
* do not know about touches, so we must report emulated button presses. 2.2
* and later clients are aware of touches, so we don't include emulated

View File

@ -30,7 +30,6 @@
#ifndef QUERYDP_H
#define QUERYDP_H 1
int SProcXIQueryPointer(ClientPtr /* client */ );
int ProcXIQueryPointer(ClientPtr /* client */ );
#endif /* QUERYDP_H */

View File

@ -36,6 +36,7 @@
#include <X11/extensions/XI2proto.h>
#include "dix/exevents_priv.h"
#include "dix/request_priv.h"
#include "os/fmt.h"
#include "inputstr.h"
@ -54,12 +55,13 @@ extern XExtensionVersion XIVersion; /* defined in getvers.c */
int
ProcXIQueryVersion(ClientPtr client)
{
REQUEST_HEAD_AT_LEAST(xXIQueryVersionReq);
REQUEST_FIELD_CARD16(major_version);
REQUEST_FIELD_CARD16(minor_version);
XIClientPtr pXIClient;
int major, minor;
REQUEST(xXIQueryVersionReq);
REQUEST_SIZE_MATCH(xXIQueryVersionReq);
/* This request only exists after XI2 */
if (stuff->major_version < 2) {
client->errorValue = stuff->major_version;
@ -129,15 +131,3 @@ ProcXIQueryVersion(ClientPtr client)
return Success;
}
/* Swapping routines */
int _X_COLD
SProcXIQueryVersion(ClientPtr client)
{
REQUEST(xXIQueryVersionReq);
REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq);
swaps(&stuff->major_version);
swaps(&stuff->minor_version);
return (ProcXIQueryVersion(client));
}

View File

@ -33,7 +33,6 @@
#ifndef QUERYVERSION_H
#define QUERYVERSION_H 1
int SProcXIQueryVersion(ClientPtr client);
int ProcXIQueryVersion(ClientPtr client);
#endif /* QUERYVERSION_H */

View File

@ -29,6 +29,7 @@
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "dix/request_priv.h"
#include "dix/resource_priv.h"
#include "dixstruct.h"
@ -113,19 +114,22 @@ XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
return Success;
}
int _X_COLD
SProcXISelectEvents(ClientPtr client)
int
ProcXISelectEvents(ClientPtr client)
{
REQUEST_HEAD_AT_LEAST(xXISelectEventsReq);
REQUEST_FIELD_CARD32(win);
REQUEST_FIELD_CARD16(num_masks);
if (stuff->num_masks == 0)
return BadValue;
if (client->swapped) {
int i;
int len;
xXIEventMask *evmask;
REQUEST(xXISelectEventsReq);
REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
swapl(&stuff->win);
swaps(&stuff->num_masks);
len = client->req_len - bytes_to_int32(sizeof(xXISelectEventsReq));
len = stuff->length - bytes_to_int32(sizeof(xXISelectEventsReq));
evmask = (xXIEventMask *) &stuff[1];
for (i = 0; i < stuff->num_masks; i++) {
if (len < bytes_to_int32(sizeof(xXIEventMask)))
@ -139,13 +143,8 @@ SProcXISelectEvents(ClientPtr client)
evmask =
(xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4);
}
}
return (ProcXISelectEvents(client));
}
int
ProcXISelectEvents(ClientPtr client)
{
int rc, num_masks;
WindowPtr win;
DeviceIntPtr dev;
@ -154,12 +153,6 @@ ProcXISelectEvents(ClientPtr client)
int *types = NULL;
int len;
REQUEST(xXISelectEventsReq);
REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
if (stuff->num_masks == 0)
return BadValue;
rc = dixLookupWindow(&win, stuff->win, client, DixReceiveAccess);
if (rc != Success)
return rc;
@ -327,19 +320,12 @@ ProcXISelectEvents(ClientPtr client)
return Success;
}
int _X_COLD
SProcXIGetSelectedEvents(ClientPtr client)
{
REQUEST(xXIGetSelectedEventsReq);
REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
swapl(&stuff->win);
return (ProcXIGetSelectedEvents(client));
}
int
ProcXIGetSelectedEvents(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xXIGetSelectedEventsReq);
REQUEST_FIELD_CARD32(win);
int rc, i;
WindowPtr win;
OtherInputMasks *masks;
@ -347,9 +333,6 @@ ProcXIGetSelectedEvents(ClientPtr client)
xXIEventMask *evmask = NULL;
DeviceIntPtr dev;
REQUEST(xXIGetSelectedEventsReq);
REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
rc = dixLookupWindow(&win, stuff->win, client, DixGetAttrAccess);
if (rc != Success)
return rc;

View File

@ -30,9 +30,7 @@
#ifndef XISELECTEVENTS_H
#define XISELECTEVENTS_H 1
int SProcXISelectEvents(ClientPtr client);
int ProcXISelectEvents(ClientPtr client);
int SProcXIGetSelectedEvents(ClientPtr client);
int ProcXIGetSelectedEvents(ClientPtr client);
#endif /* _XISELECTEVENTS_H_ */

View File

@ -34,40 +34,32 @@
#include <X11/X.h> /* for inputstr.h */
#include <X11/Xproto.h> /* Request macro */
#include <X11/extensions/XI.h>
#include <X11/extensions/XI2proto.h>
#include "dix/dix_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include <X11/extensions/XI.h>
#include <X11/extensions/XI2proto.h>
#include "extnsionst.h"
#include "exevents.h"
#include "exglobals.h"
#include "xisetclientpointer.h"
int _X_COLD
SProcXISetClientPointer(ClientPtr client)
{
REQUEST(xXISetClientPointerReq);
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
swapl(&stuff->win);
swaps(&stuff->deviceid);
return (ProcXISetClientPointer(client));
}
int
ProcXISetClientPointer(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xXISetClientPointerReq);
REQUEST_FIELD_CARD32(win);
REQUEST_FIELD_CARD16(deviceid);
DeviceIntPtr pDev;
ClientPtr targetClient;
int rc;
REQUEST(xXISetClientPointerReq);
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixManageAccess);
if (rc != Success) {
client->errorValue = stuff->deviceid;

View File

@ -30,7 +30,6 @@
#ifndef SETCPTR_H
#define SETCPTR_H 1
int SProcXISetClientPointer(ClientPtr /* client */ );
int ProcXISetClientPointer(ClientPtr /* client */ );
#endif /* SETCPTR_H */

View File

@ -34,45 +34,24 @@
#include <X11/extensions/XI2proto.h>
#include "dix/dix_priv.h"
#include "dix/request_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include "exglobals.h" /* BadDevice */
#include "xisetdevfocus.h"
int _X_COLD
SProcXISetFocus(ClientPtr client)
{
REQUEST(xXISetFocusReq);
REQUEST_AT_LEAST_SIZE(xXISetFocusReq);
swaps(&stuff->deviceid);
swapl(&stuff->focus);
swapl(&stuff->time);
return ProcXISetFocus(client);
}
int _X_COLD
SProcXIGetFocus(ClientPtr client)
{
REQUEST(xXIGetFocusReq);
REQUEST_AT_LEAST_SIZE(xXIGetFocusReq);
swaps(&stuff->deviceid);
return ProcXIGetFocus(client);
}
int
ProcXISetFocus(ClientPtr client)
{
REQUEST_HEAD_AT_LEAST(xXISetFocusReq);
REQUEST_FIELD_CARD16(deviceid);
REQUEST_FIELD_CARD32(focus);
REQUEST_FIELD_CARD32(time);
DeviceIntPtr dev;
int ret;
REQUEST(xXISetFocusReq);
REQUEST_AT_LEAST_SIZE(xXISetFocusReq);
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetFocusAccess);
if (ret != Success)
return ret;
@ -86,12 +65,12 @@ ProcXISetFocus(ClientPtr client)
int
ProcXIGetFocus(ClientPtr client)
{
REQUEST_HEAD_AT_LEAST(xXIGetFocusReq);
REQUEST_FIELD_CARD16(deviceid);
DeviceIntPtr dev;
int ret;
REQUEST(xXIGetFocusReq);
REQUEST_AT_LEAST_SIZE(xXIGetFocusReq);
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
if (ret != Success)
return ret;

View File

@ -30,10 +30,8 @@
#ifndef XISETDEVFOCUS_H
#define XISETDEVFOCUS_H 1
int SProcXISetFocus(ClientPtr client);
int ProcXISetFocus(ClientPtr client);
int SProcXIGetFocus(ClientPtr client);
int ProcXIGetFocus(ClientPtr client);
#endif /* XISETDEVFOCUS_H */

View File

@ -39,6 +39,7 @@
#include "dix/cursor_priv.h"
#include "dix/dix_priv.h"
#include "dix/input_priv.h"
#include "dix/request_priv.h"
#include "mi/mipointer_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
@ -56,27 +57,20 @@
*
*/
int _X_COLD
SProcXIWarpPointer(ClientPtr client)
{
REQUEST(xXIWarpPointerReq);
REQUEST_SIZE_MATCH(xXIWarpPointerReq);
swapl(&stuff->src_win);
swapl(&stuff->dst_win);
swapl(&stuff->src_x);
swapl(&stuff->src_y);
swaps(&stuff->src_width);
swaps(&stuff->src_height);
swapl(&stuff->dst_x);
swapl(&stuff->dst_y);
swaps(&stuff->deviceid);
return (ProcXIWarpPointer(client));
}
int
ProcXIWarpPointer(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xXIWarpPointerReq);
REQUEST_FIELD_CARD32(src_win);
REQUEST_FIELD_CARD32(dst_win);
REQUEST_FIELD_CARD32(src_x);
REQUEST_FIELD_CARD32(src_y);
REQUEST_FIELD_CARD16(src_width);
REQUEST_FIELD_CARD16(src_height);
REQUEST_FIELD_CARD32(dst_x);
REQUEST_FIELD_CARD32(dst_y);
REQUEST_FIELD_CARD16(deviceid);
int rc;
int x, y;
WindowPtr dest = NULL;
@ -86,9 +80,6 @@ ProcXIWarpPointer(ClientPtr client)
int src_x, src_y;
int dst_x, dst_y;
REQUEST(xXIWarpPointerReq);
REQUEST_SIZE_MATCH(xXIWarpPointerReq);
/* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);

View File

@ -30,7 +30,6 @@
#ifndef WARPDEVP_H
#define WARPDEVP_H 1
int SProcXIWarpPointer(ClientPtr /* client */ );
int ProcXIWarpPointer(ClientPtr /* client */ );
#endif /* WARPDEVP_H */

View File

@ -76,7 +76,7 @@ request_ChangeDeviceControl(ClientPtr client, xChangeDeviceControlReq * req,
swaps(&ctl->length);
swaps(&ctl->control);
/* XXX: swap other contents of ctl, depending on type */
rc = SProcXChangeDeviceControl(&client_request);
rc = ProcXChangeDeviceControl(&client_request);
assert(rc == error);
}

View File

@ -91,7 +91,7 @@ request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq * req,
client_request.swapped = TRUE;
swapl(&req->win);
swaps(&req->length);
rc = SProcXIGetClientPointer(&client_request);
rc = ProcXIGetClientPointer(&client_request);
assert(rc == error);
if (rc == BadWindow)

View File

@ -151,7 +151,7 @@ request_XIGetSelectedEvents(xXIGetSelectedEventsReq * req, int error)
*/
swapl(&req->win);
rc = SProcXIGetSelectedEvents(&client);
rc = ProcXIGetSelectedEvents(&client);
assert(rc == error);
}

View File

@ -172,7 +172,7 @@ request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq * req,
swapl(mod);
}
rc = SProcXIPassiveGrabDevice(&client_request);
rc = ProcXIPassiveGrabDevice(&client_request);
assert(rc == error);
if (rc != Success)

View File

@ -304,7 +304,7 @@ request_XIQueryDevice(struct test_data *querydata, int deviceid, int error)
client.swapped = TRUE;
swaps(&request.length);
swaps(&request.deviceid);
rc = SProcXIQueryDevice(&client);
rc = ProcXIQueryDevice(&client);
assert(rc == error);
if (rc != Success)

View File

@ -131,7 +131,7 @@ request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq * req, int error)
swaps(&req->deviceid);
swapl(&req->win);
swaps(&req->length);
rc = SProcXIQueryPointer(&client_request);
rc = ProcXIQueryPointer(&client_request);
assert(rc == error);
if (rc == BadDevice)

View File

@ -147,7 +147,7 @@ request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error)
swaps(&request.major_version);
swaps(&request.minor_version);
rc = SProcXIQueryVersion(&client);
rc = ProcXIQueryVersion(&client);
assert(rc == error);
}

View File

@ -119,7 +119,7 @@ request_XISelectEvent(xXISelectEventsReq * req, int error)
swapl(&req->win);
swaps(&req->num_masks);
rc = SProcXISelectEvents(&client);
rc = ProcXISelectEvents(&client);
assert(rc == error);
}

View File

@ -79,7 +79,7 @@ request_XISetClientPointer(xXISetClientPointerReq * req, int error)
swapl(&req->win);
swaps(&req->deviceid);
rc = SProcXISetClientPointer(&client_request);
rc = ProcXISetClientPointer(&client_request);
assert(rc == error);
if (rc == BadDevice)

View File

@ -86,7 +86,7 @@ request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq * req, int error)
swaps(&req->src_height);
swaps(&req->deviceid);
rc = SProcXIWarpPointer(client);
rc = ProcXIWarpPointer(client);
assert(rc == error);
if (rc == BadDevice)