Xi: remove configure/query device property calls.
This removes all the meta-information about device properties (pending, fromClient, range, valid_values, immutable).
This commit is contained in:
parent
feaa5fa671
commit
1e24e7b9df
58
Xi/extinit.c
58
Xi/extinit.c
|
@ -211,22 +211,20 @@ static int (*ProcIVector[])(ClientPtr) = {
|
||||||
ProcXChangeDeviceControl, /* 35 */
|
ProcXChangeDeviceControl, /* 35 */
|
||||||
/* XI 1.5 */
|
/* XI 1.5 */
|
||||||
ProcXListDeviceProperties, /* 36 */
|
ProcXListDeviceProperties, /* 36 */
|
||||||
ProcXQueryDeviceProperty, /* 37 */
|
ProcXChangeDeviceProperty, /* 37 */
|
||||||
ProcXConfigureDeviceProperty, /* 38 */
|
ProcXDeleteDeviceProperty, /* 38 */
|
||||||
ProcXChangeDeviceProperty, /* 39 */
|
ProcXGetDeviceProperty, /* 39 */
|
||||||
ProcXDeleteDeviceProperty, /* 40 */
|
|
||||||
ProcXGetDeviceProperty, /* 41 */
|
|
||||||
/* XI 2 */
|
/* XI 2 */
|
||||||
ProcXQueryDevicePointer, /* 42 */
|
ProcXQueryDevicePointer, /* 40 */
|
||||||
ProcXWarpDevicePointer, /* 43 */
|
ProcXWarpDevicePointer, /* 41 */
|
||||||
ProcXChangeDeviceCursor, /* 44 */
|
ProcXChangeDeviceCursor, /* 42 */
|
||||||
ProcXChangeDeviceHierarchy, /* 45 */
|
ProcXChangeDeviceHierarchy, /* 43 */
|
||||||
ProcXChangeWindowAccess, /* 46 */
|
ProcXChangeWindowAccess, /* 44 */
|
||||||
ProcXQueryWindowAccess, /* 47 */
|
ProcXQueryWindowAccess, /* 45 */
|
||||||
ProcXSetClientPointer, /* 48 */
|
ProcXSetClientPointer, /* 46 */
|
||||||
ProcXGetClientPointer, /* 49 */
|
ProcXGetClientPointer, /* 47 */
|
||||||
ProcXiSelectEvent, /* 50 */
|
ProcXiSelectEvent, /* 48 */
|
||||||
ProcXExtendedGrabDevice /* 51 */
|
ProcXExtendedGrabDevice /* 49 */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* For swapped clients */
|
/* For swapped clients */
|
||||||
|
@ -268,21 +266,19 @@ static int (*SProcIVector[])(ClientPtr) = {
|
||||||
SProcXGetDeviceControl, /* 34 */
|
SProcXGetDeviceControl, /* 34 */
|
||||||
SProcXChangeDeviceControl, /* 35 */
|
SProcXChangeDeviceControl, /* 35 */
|
||||||
SProcXListDeviceProperties, /* 36 */
|
SProcXListDeviceProperties, /* 36 */
|
||||||
SProcXQueryDeviceProperty, /* 37 */
|
SProcXChangeDeviceProperty, /* 37 */
|
||||||
SProcXConfigureDeviceProperty, /* 38 */
|
SProcXDeleteDeviceProperty, /* 38 */
|
||||||
SProcXChangeDeviceProperty, /* 39 */
|
SProcXGetDeviceProperty, /* 39 */
|
||||||
SProcXDeleteDeviceProperty, /* 40 */
|
SProcXQueryDevicePointer, /* 40 */
|
||||||
SProcXGetDeviceProperty, /* 41 */
|
SProcXWarpDevicePointer, /* 41 */
|
||||||
SProcXQueryDevicePointer, /* 42 */
|
SProcXChangeDeviceCursor, /* 42 */
|
||||||
SProcXWarpDevicePointer, /* 43 */
|
SProcXChangeDeviceHierarchy, /* 43 */
|
||||||
SProcXChangeDeviceCursor, /* 44 */
|
SProcXChangeWindowAccess, /* 44 */
|
||||||
SProcXChangeDeviceHierarchy, /* 45 */
|
SProcXQueryWindowAccess, /* 45 */
|
||||||
SProcXChangeWindowAccess, /* 46 */
|
SProcXSetClientPointer, /* 46 */
|
||||||
SProcXQueryWindowAccess, /* 47 */
|
SProcXGetClientPointer, /* 47 */
|
||||||
SProcXSetClientPointer, /* 48 */
|
SProcXiSelectEvent, /* 48 */
|
||||||
SProcXGetClientPointer, /* 49 */
|
SProcXExtendedGrabDevice /* 49 */
|
||||||
SProcXiSelectEvent, /* 50 */
|
|
||||||
SProcXExtendedGrabDevice /* 51 */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
|
@ -480,8 +476,6 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
||||||
(xChangeDeviceControlReply *) rep);
|
(xChangeDeviceControlReply *) rep);
|
||||||
else if (rep->RepType == X_ListDeviceProperties)
|
else if (rep->RepType == X_ListDeviceProperties)
|
||||||
SRepXListDeviceProperties(client, len, (xListDevicePropertiesReply*)rep);
|
SRepXListDeviceProperties(client, len, (xListDevicePropertiesReply*)rep);
|
||||||
else if (rep->RepType == X_QueryDeviceProperty)
|
|
||||||
SRepXQueryDeviceProperty(client, len, (xQueryDevicePropertyReply*)rep);
|
|
||||||
else if (rep->RepType == X_GetDeviceProperty)
|
else if (rep->RepType == X_GetDeviceProperty)
|
||||||
SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep);
|
SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep);
|
||||||
else if (rep->RepType == X_QueryDevicePointer)
|
else if (rep->RepType == X_QueryDevicePointer)
|
||||||
|
|
280
Xi/xiproperty.c
280
Xi/xiproperty.c
|
@ -138,15 +138,6 @@ XIUnRegisterPropertyHandler(DeviceIntPtr dev, long id)
|
||||||
xfree(curr);
|
xfree(curr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
XIInitDevicePropertyValue (XIPropertyValuePtr property_value)
|
|
||||||
{
|
|
||||||
property_value->type = None;
|
|
||||||
property_value->format = 0;
|
|
||||||
property_value->size = 0;
|
|
||||||
property_value->data = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static XIPropertyPtr
|
static XIPropertyPtr
|
||||||
XICreateDeviceProperty (Atom property)
|
XICreateDeviceProperty (Atom property)
|
||||||
{
|
{
|
||||||
|
@ -156,29 +147,32 @@ XICreateDeviceProperty (Atom property)
|
||||||
if (!prop)
|
if (!prop)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
prop->next = NULL;
|
prop->next = NULL;
|
||||||
prop->propertyName = property;
|
prop->propertyName = property;
|
||||||
prop->is_pending = FALSE;
|
prop->value.type = None;
|
||||||
prop->range = FALSE;
|
prop->value.format = 0;
|
||||||
prop->fromClient = FALSE;
|
prop->value.size = 0;
|
||||||
prop->immutable = FALSE;
|
prop->value.data = NULL;
|
||||||
prop->num_valid = 0;
|
|
||||||
prop->valid_values = NULL;
|
|
||||||
|
|
||||||
XIInitDevicePropertyValue (&prop->current);
|
|
||||||
XIInitDevicePropertyValue (&prop->pending);
|
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static XIPropertyPtr
|
||||||
|
XIFetchDeviceProperty(DeviceIntPtr dev, Atom property)
|
||||||
|
{
|
||||||
|
XIPropertyPtr prop;
|
||||||
|
|
||||||
|
for (prop = dev->properties.properties; prop; prop = prop->next)
|
||||||
|
if (prop->propertyName == property)
|
||||||
|
return prop;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
XIDestroyDeviceProperty (XIPropertyPtr prop)
|
XIDestroyDeviceProperty (XIPropertyPtr prop)
|
||||||
{
|
{
|
||||||
if (prop->valid_values)
|
if (prop->value.data)
|
||||||
xfree (prop->valid_values);
|
xfree(prop->value.data);
|
||||||
if (prop->current.data)
|
|
||||||
xfree(prop->current.data);
|
|
||||||
if (prop->pending.data)
|
|
||||||
xfree(prop->pending.data);
|
|
||||||
xfree(prop);
|
xfree(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,9 +223,6 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
|
||||||
if (prop->propertyName == property)
|
if (prop->propertyName == property)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!prop->fromClient && fromClient)
|
|
||||||
return BadAtom;
|
|
||||||
|
|
||||||
if (prop)
|
if (prop)
|
||||||
{
|
{
|
||||||
*prev = prop->next;
|
*prev = prop->next;
|
||||||
|
@ -251,8 +242,7 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
|
||||||
int
|
int
|
||||||
XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
|
XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
|
||||||
int format, int mode, unsigned long len,
|
int format, int mode, unsigned long len,
|
||||||
pointer value, Bool sendevent, Bool pending,
|
pointer value, Bool sendevent)
|
||||||
Bool fromClient)
|
|
||||||
{
|
{
|
||||||
XIPropertyPtr prop;
|
XIPropertyPtr prop;
|
||||||
devicePropertyNotify event;
|
devicePropertyNotify event;
|
||||||
|
@ -266,20 +256,16 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
|
||||||
size_in_bytes = format >> 3;
|
size_in_bytes = format >> 3;
|
||||||
|
|
||||||
/* first see if property already exists */
|
/* first see if property already exists */
|
||||||
prop = XIQueryDeviceProperty (dev, property);
|
prop = XIFetchDeviceProperty (dev, property);
|
||||||
if (!prop) /* just add to list */
|
if (!prop) /* just add to list */
|
||||||
{
|
{
|
||||||
prop = XICreateDeviceProperty (property);
|
prop = XICreateDeviceProperty (property);
|
||||||
if (!prop)
|
if (!prop)
|
||||||
return(BadAlloc);
|
return(BadAlloc);
|
||||||
prop->fromClient = fromClient;
|
|
||||||
add = TRUE;
|
add = TRUE;
|
||||||
mode = PropModeReplace;
|
mode = PropModeReplace;
|
||||||
}
|
}
|
||||||
if (pending && prop->is_pending)
|
prop_value = &prop->value;
|
||||||
prop_value = &prop->pending;
|
|
||||||
else
|
|
||||||
prop_value = &prop->current;
|
|
||||||
|
|
||||||
/* To append or prepend to a property the request format and type
|
/* To append or prepend to a property the request format and type
|
||||||
must match those of the already defined property. The
|
must match those of the already defined property. The
|
||||||
|
@ -334,12 +320,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
|
||||||
memcpy ((char *) old_data, (char *) prop_value->data,
|
memcpy ((char *) old_data, (char *) prop_value->data,
|
||||||
prop_value->size * size_in_bytes);
|
prop_value->size * size_in_bytes);
|
||||||
|
|
||||||
/* We must set pendingProperties TRUE before we commit to the driver,
|
if (dev->properties.handlers)
|
||||||
we're in a single thread after all
|
|
||||||
*/
|
|
||||||
if (pending && prop->is_pending)
|
|
||||||
dev->properties.pendingProperties = TRUE;
|
|
||||||
if (pending && dev->properties.handlers)
|
|
||||||
{
|
{
|
||||||
XIPropertyHandlerPtr handler = dev->properties.handlers;
|
XIPropertyHandlerPtr handler = dev->properties.handlers;
|
||||||
while(handler)
|
while(handler)
|
||||||
|
@ -357,9 +338,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
|
||||||
if (prop_value->data)
|
if (prop_value->data)
|
||||||
xfree (prop_value->data);
|
xfree (prop_value->data);
|
||||||
*prop_value = new_value;
|
*prop_value = new_value;
|
||||||
}
|
} else if (len == 0)
|
||||||
|
|
||||||
else if (len == 0)
|
|
||||||
{
|
{
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
}
|
}
|
||||||
|
@ -384,97 +363,29 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
|
||||||
return(Success);
|
return(Success);
|
||||||
}
|
}
|
||||||
|
|
||||||
XIPropertyPtr
|
/**
|
||||||
XIQueryDeviceProperty (DeviceIntPtr dev, Atom property)
|
*
|
||||||
|
*/
|
||||||
|
_X_EXPORT XIPropertyValuePtr
|
||||||
|
XIGetDeviceProperty (DeviceIntPtr dev, Atom property)
|
||||||
{
|
{
|
||||||
XIPropertyPtr prop;
|
XIPropertyPtr prop = XIFetchDeviceProperty (dev, property);
|
||||||
|
|
||||||
for (prop = dev->properties.properties; prop; prop = prop->next)
|
|
||||||
if (prop->propertyName == property)
|
|
||||||
return prop;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
XIPropertyValuePtr
|
|
||||||
XIGetDeviceProperty (DeviceIntPtr dev, Atom property, Bool pending)
|
|
||||||
{
|
|
||||||
XIPropertyPtr prop = XIQueryDeviceProperty (dev, property);
|
|
||||||
|
|
||||||
if (!prop)
|
if (!prop)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (pending && prop->is_pending)
|
|
||||||
return &prop->pending;
|
/* If we can, try to update the property value first */
|
||||||
else {
|
if (dev->properties.handlers)
|
||||||
/* If we can, try to update the property value first */
|
{
|
||||||
if (dev->properties.handlers)
|
XIPropertyHandlerPtr handler = dev->properties.handlers;
|
||||||
|
while(handler)
|
||||||
{
|
{
|
||||||
XIPropertyHandlerPtr handler = dev->properties.handlers;
|
if (handler->GetProperty)
|
||||||
while(handler)
|
handler->GetProperty(dev, prop->propertyName);
|
||||||
{
|
handler = handler->next;
|
||||||
if (handler->GetProperty)
|
|
||||||
handler->GetProperty(dev, prop->propertyName);
|
|
||||||
handler = handler->next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return &prop->current;
|
|
||||||
}
|
}
|
||||||
}
|
return &prop->value;
|
||||||
|
|
||||||
int
|
|
||||||
XIConfigureDeviceProperty (DeviceIntPtr dev, Atom property,
|
|
||||||
Bool pending, Bool range, Bool immutable,
|
|
||||||
int num_values, INT32 *values)
|
|
||||||
{
|
|
||||||
XIPropertyPtr prop = XIQueryDeviceProperty (dev, property);
|
|
||||||
Bool add = FALSE;
|
|
||||||
INT32 *new_values;
|
|
||||||
|
|
||||||
if (!prop)
|
|
||||||
{
|
|
||||||
prop = XICreateDeviceProperty (property);
|
|
||||||
if (!prop)
|
|
||||||
return(BadAlloc);
|
|
||||||
add = TRUE;
|
|
||||||
} else if (prop->immutable && !immutable)
|
|
||||||
return(BadAccess);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ranges must have even number of values
|
|
||||||
*/
|
|
||||||
if (range && (num_values & 1))
|
|
||||||
return BadMatch;
|
|
||||||
|
|
||||||
new_values = xalloc (num_values * sizeof (INT32));
|
|
||||||
if (!new_values && num_values)
|
|
||||||
return BadAlloc;
|
|
||||||
if (num_values)
|
|
||||||
memcpy (new_values, values, num_values * sizeof (INT32));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Property moving from pending to non-pending
|
|
||||||
* loses any pending values
|
|
||||||
*/
|
|
||||||
if (prop->is_pending && !pending)
|
|
||||||
{
|
|
||||||
if (prop->pending.data)
|
|
||||||
xfree (prop->pending.data);
|
|
||||||
XIInitDevicePropertyValue (&prop->pending);
|
|
||||||
}
|
|
||||||
|
|
||||||
prop->is_pending = pending;
|
|
||||||
prop->range = range;
|
|
||||||
prop->immutable = immutable;
|
|
||||||
prop->num_valid = num_values;
|
|
||||||
if (prop->valid_values)
|
|
||||||
xfree (prop->valid_values);
|
|
||||||
prop->valid_values = new_values;
|
|
||||||
|
|
||||||
if (add) {
|
|
||||||
prop->next = dev->properties.properties;
|
|
||||||
dev->properties.properties = prop;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -526,71 +437,6 @@ ProcXListDeviceProperties (ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
ProcXQueryDeviceProperty (ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xQueryDevicePropertyReq);
|
|
||||||
xQueryDevicePropertyReply rep;
|
|
||||||
DeviceIntPtr dev;
|
|
||||||
XIPropertyPtr prop;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xQueryDevicePropertyReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice (&dev, stuff->deviceid, client, DixReadAccess);
|
|
||||||
|
|
||||||
if (rc != Success)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
prop = XIQueryDeviceProperty (dev, stuff->property);
|
|
||||||
if (!prop)
|
|
||||||
return BadName;
|
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
|
||||||
rep.length = prop->num_valid;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.pending = prop->is_pending;
|
|
||||||
rep.range = prop->range;
|
|
||||||
rep.immutable = prop->immutable;
|
|
||||||
rep.fromClient = prop->fromClient;
|
|
||||||
if (client->swapped)
|
|
||||||
{
|
|
||||||
int n;
|
|
||||||
swaps (&rep.sequenceNumber, n);
|
|
||||||
swapl (&rep.length, n);
|
|
||||||
}
|
|
||||||
WriteReplyToClient (client, sizeof (xQueryDevicePropertyReply), &rep);
|
|
||||||
if (prop->num_valid)
|
|
||||||
{
|
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
|
|
||||||
WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32),
|
|
||||||
prop->valid_values);
|
|
||||||
}
|
|
||||||
return(client->noClientException);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ProcXConfigureDeviceProperty (ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xConfigureDevicePropertyReq);
|
|
||||||
DeviceIntPtr dev;
|
|
||||||
int num_valid;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xConfigureDevicePropertyReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice (&dev, stuff->deviceid, client, DixReadAccess);
|
|
||||||
|
|
||||||
if (rc != Success)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
num_valid = stuff->length - (sizeof (xConfigureDevicePropertyReq) >> 2);
|
|
||||||
return XIConfigureDeviceProperty (dev, stuff->property,
|
|
||||||
stuff->pending, stuff->range,
|
|
||||||
FALSE, num_valid,
|
|
||||||
(INT32 *) (stuff + 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXChangeDeviceProperty (ClientPtr client)
|
ProcXChangeDeviceProperty (ClientPtr client)
|
||||||
{
|
{
|
||||||
|
@ -641,8 +487,7 @@ ProcXChangeDeviceProperty (ClientPtr client)
|
||||||
|
|
||||||
rc = XIChangeDeviceProperty(dev, stuff->property,
|
rc = XIChangeDeviceProperty(dev, stuff->property,
|
||||||
stuff->type, (int)format,
|
stuff->type, (int)format,
|
||||||
(int)mode, len, (pointer)&stuff[1], TRUE,
|
(int)mode, len, (pointer)&stuff[1], TRUE);
|
||||||
TRUE, TRUE);
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -666,7 +511,6 @@ ProcXDeleteDeviceProperty (ClientPtr client)
|
||||||
return (BadAtom);
|
return (BadAtom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);
|
rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -726,10 +570,7 @@ ProcXGetDeviceProperty (ClientPtr client)
|
||||||
return(client->noClientException);
|
return(client->noClientException);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prop->immutable && stuff->delete)
|
prop_value = XIGetDeviceProperty(dev, stuff->property);
|
||||||
return BadAccess;
|
|
||||||
|
|
||||||
prop_value = XIGetDeviceProperty(dev, stuff->property, stuff->pending);
|
|
||||||
if (!prop_value)
|
if (!prop_value)
|
||||||
return BadAtom;
|
return BadAtom;
|
||||||
|
|
||||||
|
@ -821,32 +662,6 @@ SProcXListDeviceProperties (ClientPtr client)
|
||||||
return (ProcXListDeviceProperties(client));
|
return (ProcXListDeviceProperties(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
SProcXQueryDeviceProperty (ClientPtr client)
|
|
||||||
{
|
|
||||||
char n;
|
|
||||||
REQUEST(xQueryDevicePropertyReq);
|
|
||||||
|
|
||||||
swaps(&stuff->length, n);
|
|
||||||
swapl(&stuff->property, n);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xQueryDevicePropertyReq);
|
|
||||||
return (ProcXQueryDeviceProperty(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
SProcXConfigureDeviceProperty (ClientPtr client)
|
|
||||||
{
|
|
||||||
char n;
|
|
||||||
REQUEST(xConfigureDevicePropertyReq);
|
|
||||||
|
|
||||||
swaps(&stuff->length, n);
|
|
||||||
swapl(&stuff->property, n);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xConfigureDevicePropertyReq);
|
|
||||||
return (ProcXConfigureDeviceProperty(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
SProcXChangeDeviceProperty (ClientPtr client)
|
SProcXChangeDeviceProperty (ClientPtr client)
|
||||||
{
|
{
|
||||||
|
@ -903,17 +718,6 @@ SRepXListDeviceProperties(ClientPtr client, int size,
|
||||||
WriteToClient(client, size, (char*)rep);
|
WriteToClient(client, size, (char*)rep);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
SRepXQueryDeviceProperty(ClientPtr client, int size,
|
|
||||||
xQueryDevicePropertyReply *rep)
|
|
||||||
{
|
|
||||||
char n;
|
|
||||||
swaps(&rep->sequenceNumber, n);
|
|
||||||
swapl(&rep->length, n);
|
|
||||||
|
|
||||||
WriteToClient(client, size, (char*)rep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SRepXGetDeviceProperty(ClientPtr client, int size,
|
SRepXGetDeviceProperty(ClientPtr client, int size,
|
||||||
xGetDevicePropertyReply *rep)
|
xGetDevicePropertyReply *rep)
|
||||||
|
|
|
@ -27,16 +27,12 @@
|
||||||
#define XIPROPERTY_C
|
#define XIPROPERTY_C
|
||||||
|
|
||||||
int ProcXListDeviceProperties (ClientPtr client);
|
int ProcXListDeviceProperties (ClientPtr client);
|
||||||
int ProcXQueryDeviceProperty (ClientPtr client);
|
|
||||||
int ProcXConfigureDeviceProperty (ClientPtr client);
|
|
||||||
int ProcXChangeDeviceProperty (ClientPtr client);
|
int ProcXChangeDeviceProperty (ClientPtr client);
|
||||||
int ProcXDeleteDeviceProperty (ClientPtr client);
|
int ProcXDeleteDeviceProperty (ClientPtr client);
|
||||||
int ProcXGetDeviceProperty (ClientPtr client);
|
int ProcXGetDeviceProperty (ClientPtr client);
|
||||||
|
|
||||||
/* request swapping */
|
/* request swapping */
|
||||||
int SProcXListDeviceProperties (ClientPtr client);
|
int SProcXListDeviceProperties (ClientPtr client);
|
||||||
int SProcXQueryDeviceProperty (ClientPtr client);
|
|
||||||
int SProcXConfigureDeviceProperty (ClientPtr client);
|
|
||||||
int SProcXChangeDeviceProperty (ClientPtr client);
|
int SProcXChangeDeviceProperty (ClientPtr client);
|
||||||
int SProcXDeleteDeviceProperty (ClientPtr client);
|
int SProcXDeleteDeviceProperty (ClientPtr client);
|
||||||
int SProcXGetDeviceProperty (ClientPtr client);
|
int SProcXGetDeviceProperty (ClientPtr client);
|
||||||
|
@ -44,8 +40,6 @@ int SProcXGetDeviceProperty (ClientPtr client);
|
||||||
/* reply swapping */
|
/* reply swapping */
|
||||||
void SRepXListDeviceProperties(ClientPtr client, int size,
|
void SRepXListDeviceProperties(ClientPtr client, int size,
|
||||||
xListDevicePropertiesReply *rep);
|
xListDevicePropertiesReply *rep);
|
||||||
void SRepXQueryDeviceProperty(ClientPtr client, int size,
|
|
||||||
xQueryDevicePropertyReply *rep);
|
|
||||||
void SRepXGetDeviceProperty(ClientPtr client, int size,
|
void SRepXGetDeviceProperty(ClientPtr client, int size,
|
||||||
xGetDevicePropertyReply *rep);
|
xGetDevicePropertyReply *rep);
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,6 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
|
||||||
|
|
||||||
/* device properties */
|
/* device properties */
|
||||||
dev->properties.properties = NULL;
|
dev->properties.properties = NULL;
|
||||||
dev->properties.pendingProperties = FALSE;
|
|
||||||
dev->properties.handlers = NULL;
|
dev->properties.handlers = NULL;
|
||||||
|
|
||||||
/* security creation/labeling check
|
/* security creation/labeling check
|
||||||
|
@ -224,7 +223,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
|
||||||
|
|
||||||
XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED),
|
XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED),
|
||||||
XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled,
|
XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled,
|
||||||
FALSE, FALSE, FALSE);
|
FALSE);
|
||||||
XIRegisterPropertyHandler(dev, DeviceSetProperty, NULL);
|
XIRegisterPropertyHandler(dev, DeviceSetProperty, NULL);
|
||||||
|
|
||||||
return dev;
|
return dev;
|
||||||
|
@ -314,7 +313,7 @@ EnableDevice(DeviceIntPtr dev)
|
||||||
|
|
||||||
XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED),
|
XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED),
|
||||||
XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled,
|
XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled,
|
||||||
TRUE, FALSE, FALSE);
|
TRUE);
|
||||||
|
|
||||||
ev.type = DevicePresenceNotify;
|
ev.type = DevicePresenceNotify;
|
||||||
ev.time = currentTime.milliseconds;
|
ev.time = currentTime.milliseconds;
|
||||||
|
@ -390,7 +389,7 @@ DisableDevice(DeviceIntPtr dev)
|
||||||
|
|
||||||
XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED),
|
XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED),
|
||||||
XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled,
|
XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled,
|
||||||
TRUE, FALSE, FALSE);
|
TRUE);
|
||||||
|
|
||||||
ev.type = DevicePresenceNotify;
|
ev.type = DevicePresenceNotify;
|
||||||
ev.time = currentTime.milliseconds;
|
ev.time = currentTime.milliseconds;
|
||||||
|
|
|
@ -213,31 +213,14 @@ extern int XIChangeDeviceProperty(
|
||||||
int /* mode*/,
|
int /* mode*/,
|
||||||
unsigned long /* len*/,
|
unsigned long /* len*/,
|
||||||
pointer /* value*/,
|
pointer /* value*/,
|
||||||
Bool /* sendevent*/,
|
Bool /* sendevent*/
|
||||||
Bool /* pending*/,
|
|
||||||
Bool /* fromClient */
|
|
||||||
);
|
);
|
||||||
|
|
||||||
extern XIPropertyPtr XIQueryDeviceProperty(
|
extern XIPropertyValuePtr XIGetDeviceProperty(
|
||||||
DeviceIntPtr /* dev */,
|
DeviceIntPtr /* dev */,
|
||||||
Atom /* property */
|
Atom /* property */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern XIPropertyValuePtr XIGetDeviceProperty(
|
|
||||||
DeviceIntPtr /* dev */,
|
|
||||||
Atom /* property */,
|
|
||||||
Bool /* pending */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern int XIConfigureDeviceProperty(
|
|
||||||
DeviceIntPtr /* dev */,
|
|
||||||
Atom /* property */,
|
|
||||||
Bool /* pending */,
|
|
||||||
Bool /* range */,
|
|
||||||
Bool /* immutable */,
|
|
||||||
int /* num_values */,
|
|
||||||
INT32* /* values */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern long XIRegisterPropertyHandler(
|
extern long XIRegisterPropertyHandler(
|
||||||
DeviceIntPtr dev,
|
DeviceIntPtr dev,
|
||||||
|
|
|
@ -353,18 +353,9 @@ typedef struct _XIProperty
|
||||||
{
|
{
|
||||||
struct _XIProperty *next;
|
struct _XIProperty *next;
|
||||||
Atom propertyName;
|
Atom propertyName;
|
||||||
Bool is_pending;
|
XIPropertyValueRec value;
|
||||||
Bool range;
|
|
||||||
Bool immutable;
|
|
||||||
Bool fromClient; /* created by client or driver/server */
|
|
||||||
int num_valid;
|
|
||||||
INT32 *valid_values;
|
|
||||||
XIPropertyValueRec current,
|
|
||||||
pending;
|
|
||||||
} XIPropertyRec;
|
} XIPropertyRec;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef XIPropertyRec *XIPropertyPtr;
|
typedef XIPropertyRec *XIPropertyPtr;
|
||||||
typedef XIPropertyValueRec *XIPropertyValuePtr;
|
typedef XIPropertyValueRec *XIPropertyValuePtr;
|
||||||
|
|
||||||
|
@ -484,7 +475,6 @@ typedef struct _DeviceIntRec {
|
||||||
/* Input device property handling. */
|
/* Input device property handling. */
|
||||||
struct {
|
struct {
|
||||||
XIPropertyPtr properties;
|
XIPropertyPtr properties;
|
||||||
Bool pendingProperties;
|
|
||||||
XIPropertyHandlerPtr handlers; /* NULL-terminated */
|
XIPropertyHandlerPtr handlers; /* NULL-terminated */
|
||||||
} properties;
|
} properties;
|
||||||
} DeviceIntRec;
|
} DeviceIntRec;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user