aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/xiquerydevice.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-26 14:23:28 +0200
committermarha <marha@users.sourceforge.net>2012-03-26 14:23:28 +0200
commit76bcc36ed305418a3ddc5752d287ede894243e1b (patch)
treebacb320c825768471ce56f058f17ce863d592376 /xorg-server/Xi/xiquerydevice.c
parent7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff)
parent0f834b91a4768673833ab4917e87d86c237bb1a6 (diff)
downloadvcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.gz
vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.bz2
vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.zip
Merge remote-tracking branch 'origin/released'
Conflicts: pixman/pixman/pixman-mmx.c xorg-server/Xext/shm.c xorg-server/Xext/syncsrv.h xorg-server/Xext/xvmain.c xorg-server/Xi/exevents.c xorg-server/Xi/opendev.c xorg-server/composite/compalloc.c xorg-server/composite/compoverlay.c xorg-server/dix/colormap.c xorg-server/dix/devices.c xorg-server/dix/dispatch.c xorg-server/dix/dixfonts.c xorg-server/dix/eventconvert.c xorg-server/dix/events.c xorg-server/dix/gc.c xorg-server/dix/getevents.c xorg-server/dix/main.c xorg-server/dix/privates.c xorg-server/dix/registry.c xorg-server/dix/resource.c xorg-server/exa/exa_accel.c xorg-server/exa/exa_migration_classic.c xorg-server/exa/exa_unaccel.c xorg-server/fb/fb.h xorg-server/fb/fbcopy.c xorg-server/fb/fbpixmap.c xorg-server/glx/dispatch.h xorg-server/glx/glapi.h xorg-server/glx/glapi_gentable.c xorg-server/glx/glapitable.h xorg-server/glx/glprocs.h xorg-server/glx/glxcmds.c xorg-server/glx/glxcmdsswap.c xorg-server/glx/glxdricommon.c xorg-server/glx/glxdriswrast.c xorg-server/glx/glxext.c xorg-server/glx/indirect_dispatch.c xorg-server/glx/indirect_dispatch.h xorg-server/glx/indirect_dispatch_swap.c xorg-server/glx/indirect_size.h xorg-server/glx/indirect_size_get.h xorg-server/glx/indirect_table.c xorg-server/glx/indirect_util.c xorg-server/glx/rensize.c xorg-server/glx/single2swap.c xorg-server/glx/singlepix.c xorg-server/glx/singlepixswap.c xorg-server/glx/singlesize.c xorg-server/hw/dmx/dmxinit.c xorg-server/hw/kdrive/ephyr/ephyr.c xorg-server/hw/kdrive/ephyr/hostx.c xorg-server/hw/kdrive/ephyr/hostx.h xorg-server/hw/kdrive/src/kinput.c xorg-server/hw/xfree86/common/compiler.h xorg-server/hw/xwin/InitInput.c xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/ddraw.h xorg-server/hw/xwin/glx/glwrap.c xorg-server/hw/xwin/glx/indirect.c xorg-server/hw/xwin/glx/wgl_ext_api.h xorg-server/hw/xwin/glx/winpriv.c xorg-server/hw/xwin/win.h xorg-server/hw/xwin/winallpriv.c xorg-server/hw/xwin/winauth.c xorg-server/hw/xwin/winclipboard.h xorg-server/hw/xwin/winclipboardinit.c xorg-server/hw/xwin/winclipboardthread.c xorg-server/hw/xwin/winclipboardunicode.c xorg-server/hw/xwin/winclipboardwndproc.c xorg-server/hw/xwin/winclipboardwrappers.c xorg-server/hw/xwin/winclipboardxevents.c xorg-server/hw/xwin/wincmap.c xorg-server/hw/xwin/winconfig.c xorg-server/hw/xwin/wincreatewnd.c xorg-server/hw/xwin/wincursor.c xorg-server/hw/xwin/windialogs.c xorg-server/hw/xwin/winengine.c xorg-server/hw/xwin/winerror.c xorg-server/hw/xwin/wingc.c xorg-server/hw/xwin/wingetsp.c xorg-server/hw/xwin/winkeybd.c xorg-server/hw/xwin/winkeybd.h xorg-server/hw/xwin/winlayouts.h xorg-server/hw/xwin/winmisc.c xorg-server/hw/xwin/winmonitors.c xorg-server/hw/xwin/winmouse.c xorg-server/hw/xwin/winmsg.c xorg-server/hw/xwin/winmsg.h xorg-server/hw/xwin/winmultiwindowclass.c xorg-server/hw/xwin/winmultiwindowicons.c xorg-server/hw/xwin/winmultiwindowshape.c xorg-server/hw/xwin/winmultiwindowwindow.c xorg-server/hw/xwin/winmultiwindowwm.c xorg-server/hw/xwin/winmultiwindowwndproc.c xorg-server/hw/xwin/winnativegdi.c xorg-server/hw/xwin/winpfbdd.c xorg-server/hw/xwin/winpixmap.c xorg-server/hw/xwin/winpolyline.c xorg-server/hw/xwin/winprefs.c xorg-server/hw/xwin/winprocarg.c xorg-server/hw/xwin/winregistry.c xorg-server/hw/xwin/winscrinit.c xorg-server/hw/xwin/winsetsp.c xorg-server/hw/xwin/winshaddd.c xorg-server/hw/xwin/winshadddnl.c xorg-server/hw/xwin/winshadgdi.c xorg-server/hw/xwin/wintrayicon.c xorg-server/hw/xwin/winwin32rootless.c xorg-server/hw/xwin/winwin32rootlesswindow.c xorg-server/hw/xwin/winwin32rootlesswndproc.c xorg-server/hw/xwin/winwindow.c xorg-server/hw/xwin/winwindow.h xorg-server/hw/xwin/winwindowswm.c xorg-server/hw/xwin/winwndproc.c xorg-server/include/callback.h xorg-server/include/dixstruct.h xorg-server/include/misc.h xorg-server/include/os.h xorg-server/include/scrnintstr.h xorg-server/mi/micmap.c xorg-server/mi/miinitext.c xorg-server/mi/mioverlay.c xorg-server/mi/misprite.c xorg-server/mi/mivaltree.c xorg-server/mi/miwindow.c xorg-server/miext/damage/damage.c xorg-server/miext/rootless/rootlessGC.c xorg-server/miext/rootless/rootlessWindow.c xorg-server/os/WaitFor.c xorg-server/os/access.c xorg-server/os/connection.c xorg-server/os/io.c xorg-server/os/log.c xorg-server/os/osinit.c xorg-server/os/utils.c xorg-server/os/xdmcp.c xorg-server/os/xprintf.c xorg-server/os/xstrans.c xorg-server/render/mipict.c xorg-server/xkb/xkbActions.c xorg-server/xkb/xkbInit.c xorg-server/xkeyboard-config/compat/default.in
Diffstat (limited to 'xorg-server/Xi/xiquerydevice.c')
-rw-r--r--xorg-server/Xi/xiquerydevice.c235
1 files changed, 111 insertions, 124 deletions
diff --git a/xorg-server/Xi/xiquerydevice.c b/xorg-server/Xi/xiquerydevice.c
index 0879080ad..749bc24c9 100644
--- a/xorg-server/Xi/xiquerydevice.c
+++ b/xorg-server/Xi/xiquerydevice.c
@@ -47,9 +47,9 @@
static Bool ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr d);
static int
-ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo* info);
+ ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo * info);
static int SizeDeviceInfo(DeviceIntPtr dev);
-static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info);
+static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo * info);
int
SProcXIQueryDevice(ClientPtr client)
{
@@ -74,31 +74,27 @@ ProcXIQueryDevice(ClientPtr client)
REQUEST(xXIQueryDeviceReq);
REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
- if (stuff->deviceid != XIAllDevices && stuff->deviceid != XIAllMasterDevices)
- {
+ if (stuff->deviceid != XIAllDevices &&
+ stuff->deviceid != XIAllMasterDevices) {
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
- if (rc != Success)
- {
+ if (rc != Success) {
client->errorValue = stuff->deviceid;
return rc;
}
len += SizeDeviceInfo(dev);
}
- else
- {
+ else {
skip = calloc(sizeof(Bool), inputInfo.numDevices);
if (!skip)
return BadAlloc;
- for (dev = inputInfo.devices; dev; dev = dev->next, i++)
- {
+ for (dev = inputInfo.devices; dev; dev = dev->next, i++) {
skip[i] = ShouldSkipDevice(client, stuff->deviceid, dev);
if (!skip[i])
len += SizeDeviceInfo(dev);
}
- for (dev = inputInfo.off_devices; dev; dev = dev->next, i++)
- {
+ for (dev = inputInfo.off_devices; dev; dev = dev->next, i++) {
skip[i] = ShouldSkipDevice(client, stuff->deviceid, dev);
if (!skip[i])
len += SizeDeviceInfo(dev);
@@ -115,39 +111,34 @@ ProcXIQueryDevice(ClientPtr client)
rep.repType = X_Reply;
rep.RepType = X_XIQueryDevice;
rep.sequenceNumber = client->sequence;
- rep.length = len/4;
+ rep.length = len / 4;
rep.num_devices = 0;
ptr = info;
- if (dev)
- {
- len = ListDeviceInfo(client, dev, (xXIDeviceInfo*)info);
+ if (dev) {
+ len = ListDeviceInfo(client, dev, (xXIDeviceInfo *) info);
if (client->swapped)
- SwapDeviceInfo(dev, (xXIDeviceInfo*)info);
+ SwapDeviceInfo(dev, (xXIDeviceInfo *) info);
info += len;
rep.num_devices = 1;
- } else
- {
+ }
+ else {
i = 0;
- for (dev = inputInfo.devices; dev; dev = dev->next, i++)
- {
- if (!skip[i])
- {
- len = ListDeviceInfo(client, dev, (xXIDeviceInfo*)info);
+ for (dev = inputInfo.devices; dev; dev = dev->next, i++) {
+ if (!skip[i]) {
+ len = ListDeviceInfo(client, dev, (xXIDeviceInfo *) info);
if (client->swapped)
- SwapDeviceInfo(dev, (xXIDeviceInfo*)info);
+ SwapDeviceInfo(dev, (xXIDeviceInfo *) info);
info += len;
rep.num_devices++;
}
}
- for (dev = inputInfo.off_devices; dev; dev = dev->next, i++)
- {
- if (!skip[i])
- {
- len = ListDeviceInfo(client, dev, (xXIDeviceInfo*)info);
+ for (dev = inputInfo.off_devices; dev; dev = dev->next, i++) {
+ if (!skip[i]) {
+ len = ListDeviceInfo(client, dev, (xXIDeviceInfo *) info);
if (client->swapped)
- SwapDeviceInfo(dev, (xXIDeviceInfo*)info);
+ SwapDeviceInfo(dev, (xXIDeviceInfo *) info);
info += len;
rep.num_devices++;
}
@@ -163,7 +154,7 @@ ProcXIQueryDevice(ClientPtr client)
}
void
-SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply *rep)
+SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
@@ -171,10 +162,9 @@ SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply *rep)
/* Device info is already swapped, see ProcXIQueryDevice */
- WriteToClient(client, size, (char *)rep);
+ WriteToClient(client, size, (char *) rep);
}
-
/**
* @return Whether the device should be included in the returned list.
*/
@@ -182,9 +172,9 @@ static Bool
ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr dev)
{
/* if all devices are not being queried, only master devices are */
- if (deviceid == XIAllDevices || IsMaster(dev))
- {
+ if (deviceid == XIAllDevices || IsMaster(dev)) {
int rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess);
+
if (rc == Success)
return FALSE;
}
@@ -215,23 +205,22 @@ SizeDeviceClasses(DeviceIntPtr dev)
{
int len = 0;
- if (dev->button)
- {
+ if (dev->button) {
len += sizeof(xXIButtonInfo);
len += dev->button->numButtons * sizeof(Atom);
len += pad_to_int32(bits_to_bytes(dev->button->numButtons));
}
- if (dev->key)
- {
+ if (dev->key) {
XkbDescPtr xkb = dev->key->xkbInfo->desc;
+
len += sizeof(xXIKeyInfo);
len += (xkb->max_key_code - xkb->min_key_code + 1) * sizeof(uint32_t);
}
- if (dev->valuator)
- {
+ if (dev->valuator) {
int i;
+
len += (sizeof(xXIValuatorInfo)) * dev->valuator->numAxes;
for (i = 0; i < dev->valuator->numAxes; i++) {
@@ -246,36 +235,35 @@ SizeDeviceClasses(DeviceIntPtr dev)
return len;
}
-
/**
* Write button information into info.
* @return Number of bytes written into info.
*/
int
-ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState)
+ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo * info, Bool reportState)
{
unsigned char *bits;
int mask_len;
int i;
if (!dev || !dev->button)
- return 0;
+ return 0;
mask_len = bytes_to_int32(bits_to_bytes(dev->button->numButtons));
info->type = ButtonClass;
info->num_buttons = dev->button->numButtons;
info->length = bytes_to_int32(sizeof(xXIButtonInfo)) +
- info->num_buttons + mask_len;
+ info->num_buttons + mask_len;
info->sourceid = dev->button->sourceid;
- bits = (unsigned char*)&info[1];
+ bits = (unsigned char *) &info[1];
memset(bits, 0, mask_len * 4);
if (reportState)
- for (i = 0; i < dev->button->numButtons; i++)
- if (BitIsOn(dev->button->down, i))
- SetBit(bits, i);
+ for (i = 0; i < dev->button->numButtons; i++)
+ if (BitIsOn(dev->button->down, i))
+ SetBit(bits, i);
bits += mask_len * 4;
memcpy(bits, dev->button->labels, dev->button->numButtons * sizeof(Atom));
@@ -284,15 +272,16 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState)
}
static void
-SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info)
+SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo * info)
{
Atom *btn;
int i;
+
swaps(&info->type);
swaps(&info->length);
swaps(&info->sourceid);
- for (i = 0, btn = (Atom*)&info[1]; i < info->num_buttons; i++, btn++)
+ for (i = 0, btn = (Atom *) &info[1]; i < info->num_buttons; i++, btn++)
swapl(btn);
swaps(&info->num_buttons);
@@ -303,7 +292,7 @@ SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info)
* @return Number of bytes written into info.
*/
int
-ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
+ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo * info)
{
int i;
XkbDescPtr xkb = dev->key->xkbInfo->desc;
@@ -311,10 +300,10 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
info->type = KeyClass;
info->num_keycodes = xkb->max_key_code - xkb->min_key_code + 1;
- info->length = sizeof(xXIKeyInfo)/4 + info->num_keycodes;
+ info->length = sizeof(xXIKeyInfo) / 4 + info->num_keycodes;
info->sourceid = dev->key->sourceid;
- kc = (uint32_t*)&info[1];
+ kc = (uint32_t *) & info[1];
for (i = xkb->min_key_code; i <= xkb->max_key_code; i++, kc++)
*kc = i;
@@ -322,15 +311,17 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
}
static void
-SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
+SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo * info)
{
uint32_t *key;
int i;
+
swaps(&info->type);
swaps(&info->length);
swaps(&info->sourceid);
- for (i = 0, key = (uint32_t*)&info[1]; i < info->num_keycodes; i++, key++)
+ for (i = 0, key = (uint32_t *) & info[1]; i < info->num_keycodes;
+ i++, key++)
swapl(key);
swaps(&info->num_keycodes);
@@ -342,13 +333,13 @@ SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
* @return The number of bytes written into info.
*/
int
-ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber,
- Bool reportState)
+ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo * info, int axisnumber,
+ Bool reportState)
{
ValuatorClassPtr v = dev->valuator;
info->type = ValuatorClass;
- info->length = sizeof(xXIValuatorInfo)/4;
+ info->length = sizeof(xXIValuatorInfo) / 4;
info->label = v->axes[axisnumber].label;
info->min.integral = v->axes[axisnumber].min_value;
info->min.frac = 0;
@@ -361,13 +352,13 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber,
info->sourceid = v->sourceid;
if (!reportState)
- info->value = info->min;
+ info->value = info->min;
return info->length * 4;
}
static void
-SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info)
+SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo * info)
{
swaps(&info->type);
swaps(&info->length);
@@ -381,7 +372,7 @@ SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info)
}
int
-ListScrollInfo(DeviceIntPtr dev, xXIScrollInfo *info, int axisnumber)
+ListScrollInfo(DeviceIntPtr dev, xXIScrollInfo * info, int axisnumber)
{
ValuatorClassPtr v = dev->valuator;
AxisInfoPtr axis = &v->axes[axisnumber];
@@ -390,19 +381,19 @@ ListScrollInfo(DeviceIntPtr dev, xXIScrollInfo *info, int axisnumber)
return 0;
info->type = XIScrollClass;
- info->length = sizeof(xXIScrollInfo)/4;
+ info->length = sizeof(xXIScrollInfo) / 4;
info->number = axisnumber;
- switch(axis->scroll.type)
- {
- case SCROLL_TYPE_VERTICAL:
- info->scroll_type = XIScrollTypeVertical;
- break;
- case SCROLL_TYPE_HORIZONTAL:
- info->scroll_type = XIScrollTypeHorizontal;
- break;
- default:
- ErrorF("[Xi] Unknown scroll type %d. This is a bug.\n", axis->scroll.type);
- break;
+ switch (axis->scroll.type) {
+ case SCROLL_TYPE_VERTICAL:
+ info->scroll_type = XIScrollTypeVertical;
+ break;
+ case SCROLL_TYPE_HORIZONTAL:
+ info->scroll_type = XIScrollTypeHorizontal;
+ break;
+ default:
+ ErrorF("[Xi] Unknown scroll type %d. This is a bug.\n",
+ axis->scroll.type);
+ break;
}
info->increment = double_to_fp3232(axis->scroll.increment);
info->sourceid = v->sourceid;
@@ -418,7 +409,7 @@ ListScrollInfo(DeviceIntPtr dev, xXIScrollInfo *info, int axisnumber)
}
static void
-SwapScrollInfo(DeviceIntPtr dev, xXIScrollInfo* info)
+SwapScrollInfo(DeviceIntPtr dev, xXIScrollInfo * info)
{
swaps(&info->type);
swaps(&info->length);
@@ -435,7 +426,7 @@ SwapScrollInfo(DeviceIntPtr dev, xXIScrollInfo* info)
* @return The number of bytes written into info.
*/
int
-ListTouchInfo(DeviceIntPtr dev, xXITouchInfo *touch)
+ListTouchInfo(DeviceIntPtr dev, xXITouchInfo * touch)
{
touch->type = XITouchClass;
touch->length = sizeof(xXITouchInfo) >> 2;
@@ -447,28 +438,30 @@ ListTouchInfo(DeviceIntPtr dev, xXITouchInfo *touch)
}
static void
-SwapTouchInfo(DeviceIntPtr dev, xXITouchInfo* touch)
+SwapTouchInfo(DeviceIntPtr dev, xXITouchInfo * touch)
{
swaps(&touch->type);
swaps(&touch->length);
swaps(&touch->sourceid);
}
-int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
+int
+GetDeviceUse(DeviceIntPtr dev, uint16_t * attachment)
{
DeviceIntPtr master = GetMaster(dev, MASTER_ATTACHED);
int use;
- if (IsMaster(dev))
- {
+ if (IsMaster(dev)) {
DeviceIntPtr paired = GetPairedDevice(dev);
+
use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard;
*attachment = (paired ? paired->id : 0);
- } else if (!IsFloating(dev))
- {
+ }
+ else if (!IsFloating(dev)) {
use = IsPointerDevice(master) ? XISlavePointer : XISlaveKeyboard;
*attachment = master->id;
- } else
+ }
+ else
use = XIFloatingSlave;
return use;
@@ -480,9 +473,9 @@ int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
* @return The number of bytes used.
*/
static int
-ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo* info)
+ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo * info)
{
- char *any = (char*)&info[1];
+ char *any = (char *) &info[1];
int len = 0, total_len = 0;
info->deviceid = dev->id;
@@ -509,7 +502,7 @@ ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo* info)
*/
int
ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
- char *any, uint16_t *nclasses)
+ char *any, uint16_t * nclasses)
{
int total_len = 0;
int len;
@@ -519,43 +512,38 @@ ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
/* Check if the current device state should be suppressed */
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess);
- if (dev->button)
- {
+ if (dev->button) {
(*nclasses)++;
- len = ListButtonInfo(dev, (xXIButtonInfo*)any, rc == Success);
+ len = ListButtonInfo(dev, (xXIButtonInfo *) any, rc == Success);
any += len;
total_len += len;
}
- if (dev->key)
- {
+ if (dev->key) {
(*nclasses)++;
- len = ListKeyInfo(dev, (xXIKeyInfo*)any);
+ len = ListKeyInfo(dev, (xXIKeyInfo *) any);
any += len;
total_len += len;
}
- for (i = 0; dev->valuator && i < dev->valuator->numAxes; i++)
- {
+ for (i = 0; dev->valuator && i < dev->valuator->numAxes; i++) {
(*nclasses)++;
- len = ListValuatorInfo(dev, (xXIValuatorInfo*)any, i, rc == Success);
+ len = ListValuatorInfo(dev, (xXIValuatorInfo *) any, i, rc == Success);
any += len;
total_len += len;
}
- for (i = 0; dev->valuator && i < dev->valuator->numAxes; i++)
- {
- len = ListScrollInfo(dev, (xXIScrollInfo*)any, i);
+ for (i = 0; dev->valuator && i < dev->valuator->numAxes; i++) {
+ len = ListScrollInfo(dev, (xXIScrollInfo *) any, i);
if (len)
(*nclasses)++;
any += len;
total_len += len;
}
- if (dev->touch)
- {
+ if (dev->touch) {
(*nclasses)++;
- len = ListTouchInfo(dev, (xXITouchInfo*)any);
+ len = ListTouchInfo(dev, (xXITouchInfo *) any);
any += len;
total_len += len;
}
@@ -564,34 +552,33 @@ ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
}
static void
-SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
+SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo * info)
{
- char *any = (char*)&info[1];
+ char *any = (char *) &info[1];
int i;
/* Skip over name */
any += pad_to_int32(info->name_len);
- for (i = 0; i < info->num_classes; i++)
- {
- int len = ((xXIAnyInfo*)any)->length;
- switch(((xXIAnyInfo*)any)->type)
- {
- case XIButtonClass:
- SwapButtonInfo(dev, (xXIButtonInfo*)any);
- break;
- case XIKeyClass:
- SwapKeyInfo(dev, (xXIKeyInfo*)any);
- break;
- case XIValuatorClass:
- SwapValuatorInfo(dev, (xXIValuatorInfo*)any);
- break;
- case XIScrollClass:
- SwapScrollInfo(dev, (xXIScrollInfo*)any);
- break;
- case XITouchClass:
- SwapTouchInfo(dev, (xXITouchInfo*)any);
- break;
+ for (i = 0; i < info->num_classes; i++) {
+ int len = ((xXIAnyInfo *) any)->length;
+
+ switch (((xXIAnyInfo *) any)->type) {
+ case XIButtonClass:
+ SwapButtonInfo(dev, (xXIButtonInfo *) any);
+ break;
+ case XIKeyClass:
+ SwapKeyInfo(dev, (xXIKeyInfo *) any);
+ break;
+ case XIValuatorClass:
+ SwapValuatorInfo(dev, (xXIValuatorInfo *) any);
+ break;
+ case XIScrollClass:
+ SwapScrollInfo(dev, (xXIScrollInfo *) any);
+ break;
+ case XITouchClass:
+ SwapTouchInfo(dev, (xXITouchInfo *) any);
+ break;
}