Xext: rename Xtst* to XTest*

This patch corrects a misnaming of XTest-related functions.

The extension itself announces itself as XTEST. Xtst is the library name
itself, but all library functions are prefixed by XTest. Same with the
naming in the server.

- Rename all *Xtst* functions to *XTest* for consistency with the library
  and in-server API.
- Rename the "Xtst device" property to "XTEST device" for consistency with
  the extension naming.
- Rename the device naming to "<master device name> XTEST device". The
  default xtest devices become "Virtual core XTEST pointer" and "Virtual
  core XTEST keyboard".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-08-24 09:48:00 +10:00
parent 8bfd23e144
commit 903c3db1d1
6 changed files with 83 additions and 83 deletions

View File

@ -63,20 +63,20 @@ extern int DeviceValuator;
static EventListPtr xtest_evlist;
/* Used to store if a device is an XTest Virtual device */
static int XTstDevicePrivateKeyIndex;
DevPrivateKey XTstDevicePrivateKey = &XTstDevicePrivateKeyIndex;
static int XTestDevicePrivateKeyIndex;
DevPrivateKey XTestDevicePrivateKey = &XTestDevicePrivateKeyIndex;
/**
* vxtstpointer
* xtestpointer
* is the virtual pointer for XTest. It is the first slave
* device of the VCP.
* vxtstkeyboard
* xtestkeyboard
* is the virtual keyboard for XTest. It is the first slave
* device of the VCK
*
* Neither of these devices can be deleted.
*/
DeviceIntPtr vxtstpointer, vxtstkeyboard;
DeviceIntPtr xtestpointer, xtestkeyboard;
#ifdef PANORAMIX
#include "panoramiX.h"
@ -341,7 +341,7 @@ ProcXTestFakeInput(ClientPtr client)
return BadValue;
}
dev = GetXtstDevice(dev);
dev = GetXTestDevice(dev);
}
/* If the event has a time set, wait for it to pass */
@ -590,30 +590,30 @@ SProcXTestDispatch (ClientPtr client)
*/
void InitXTestDevices(void)
{
if(AllocXtstDevice(serverClient, "Virtual core",
&vxtstpointer, &vxtstkeyboard,
if(AllocXTestDevice(serverClient, "Virtual core",
&xtestpointer, &xtestkeyboard,
inputInfo.pointer, inputInfo.keyboard) != Success)
FatalError("Failed to allocate XTst devices");
FatalError("Failed to allocate XTest devices");
if (ActivateDevice(vxtstpointer, TRUE) != Success ||
ActivateDevice(vxtstkeyboard, TRUE) != Success)
FatalError("Failed to activate xtst core devices.");
if (!EnableDevice(vxtstpointer, TRUE) ||
!EnableDevice(vxtstkeyboard, TRUE))
FatalError("Failed to enable xtst core devices.");
if (ActivateDevice(xtestpointer, TRUE) != Success ||
ActivateDevice(xtestkeyboard, TRUE) != Success)
FatalError("Failed to activate XTest core devices.");
if (!EnableDevice(xtestpointer, TRUE) ||
!EnableDevice(xtestkeyboard, TRUE))
FatalError("Failed to enable XTest core devices.");
AttachDevice(NULL, vxtstpointer, inputInfo.pointer);
AttachDevice(NULL, vxtstkeyboard, inputInfo.keyboard);
AttachDevice(NULL, xtestpointer, inputInfo.pointer);
AttachDevice(NULL, xtestkeyboard, inputInfo.keyboard);
}
/**
* Don't allow changing the Xtst property.
* Don't allow changing the XTest property.
*/
static int
DeviceSetXtstProperty(DeviceIntPtr dev, Atom property,
DeviceSetXTestProperty(DeviceIntPtr dev, Atom property,
XIPropertyValuePtr prop, BOOL checkonly)
{
if (property == XIGetKnownProperty(XI_PROP_XTST_DEVICE))
if (property == XIGetKnownProperty(XI_PROP_XTEST_DEVICE))
return BadAccess;
return Success;
@ -626,36 +626,36 @@ DeviceSetXtstProperty(DeviceIntPtr dev, Atom property,
* This only creates the pair, Activate/Enable Device
* still need to be called.
*/
int AllocXtstDevice (ClientPtr client, char* name,
int AllocXTestDevice (ClientPtr client, char* name,
DeviceIntPtr* ptr, DeviceIntPtr* keybd,
DeviceIntPtr master_ptr, DeviceIntPtr master_keybd)
{
int retval;
int len = strlen(name);
char *xtstname = xcalloc(len + 6, 1 );
char *xtestname = xcalloc(len + 7, 1 );
char dummy = 1;
strncpy( xtstname, name, len);
strncat( xtstname, " Xtst", 5 );
strncpy( xtestname, name, len);
strncat( xtestname, " XTEST", 6 );
retval = AllocDevicePair( client, xtstname, ptr, keybd, CorePointerProc, CoreKeyboardProc, FALSE);
retval = AllocDevicePair( client, xtestname, ptr, keybd, CorePointerProc, CoreKeyboardProc, FALSE);
if ( retval == Success ){
dixSetPrivate(&((*ptr)->devPrivates), XTstDevicePrivateKey, (void *)master_ptr->id);
dixSetPrivate(&((*keybd)->devPrivates), XTstDevicePrivateKey, (void *)master_keybd->id);
dixSetPrivate(&((*ptr)->devPrivates), XTestDevicePrivateKey, (void *)master_ptr->id);
dixSetPrivate(&((*keybd)->devPrivates), XTestDevicePrivateKey, (void *)master_keybd->id);
}
xfree( xtstname );
xfree( xtestname );
XIChangeDeviceProperty(*ptr, XIGetKnownProperty(XI_PROP_XTST_DEVICE),
XIChangeDeviceProperty(*ptr, XIGetKnownProperty(XI_PROP_XTEST_DEVICE),
XA_INTEGER, 8, PropModeReplace, 1, &dummy,
FALSE);
XISetDevicePropertyDeletable(*ptr, XIGetKnownProperty(XI_PROP_XTST_DEVICE), FALSE);
XIRegisterPropertyHandler(*ptr, DeviceSetXtstProperty, NULL, NULL);
XIChangeDeviceProperty(*keybd, XIGetKnownProperty(XI_PROP_XTST_DEVICE),
XISetDevicePropertyDeletable(*ptr, XIGetKnownProperty(XI_PROP_XTEST_DEVICE), FALSE);
XIRegisterPropertyHandler(*ptr, DeviceSetXTestProperty, NULL, NULL);
XIChangeDeviceProperty(*keybd, XIGetKnownProperty(XI_PROP_XTEST_DEVICE),
XA_INTEGER, 8, PropModeReplace, 1, &dummy,
FALSE);
XISetDevicePropertyDeletable(*keybd, XIGetKnownProperty(XI_PROP_XTST_DEVICE), FALSE);
XIRegisterPropertyHandler(*keybd, DeviceSetXtstProperty, NULL, NULL);
XISetDevicePropertyDeletable(*keybd, XIGetKnownProperty(XI_PROP_XTEST_DEVICE), FALSE);
XIRegisterPropertyHandler(*keybd, DeviceSetXTestProperty, NULL, NULL);
return retval;
}
@ -667,38 +667,38 @@ int AllocXtstDevice (ClientPtr client, char* name,
* xtest device.
*/
BOOL
IsXtstDevice(DeviceIntPtr dev, DeviceIntPtr master)
IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master)
{
int is_xtst = FALSE;
int is_XTest = FALSE;
int mid;
void *tmp; /* shut up, gcc! */
if (IsMaster(dev))
return is_xtst;
return is_XTest;
tmp = dixLookupPrivate(&dev->devPrivates, XTstDevicePrivateKey);
tmp = dixLookupPrivate(&dev->devPrivates, XTestDevicePrivateKey);
mid = (int)tmp;
/* deviceid 0 is reserved for XIAllDevices, non-zero mid means xtst
/* deviceid 0 is reserved for XIAllDevices, non-zero mid means XTest
* device */
if ((!master && mid) ||
(master && mid == master->id))
is_xtst = TRUE;
is_XTest = TRUE;
return is_xtst;
return is_XTest;
}
/**
* @return The X Test virtual device for the given master.
*/
DeviceIntPtr
GetXtstDevice(DeviceIntPtr master)
GetXTestDevice(DeviceIntPtr master)
{
DeviceIntPtr it;
for (it = inputInfo.devices; it; it = it->next)
{
if (IsXtstDevice(it, master))
if (IsXTestDevice(it, master))
return it;
}

View File

@ -141,7 +141,7 @@ int SProcXIChangeHierarchy(ClientPtr client)
int
ProcXIChangeHierarchy(ClientPtr client)
{
DeviceIntPtr ptr, keybd, xtstptr, xtstkeybd;
DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
xXIAnyHierarchyChangeInfo *any;
int required_len = sizeof(xXIChangeHierarchyReq);
char n;
@ -189,7 +189,7 @@ ProcXIChangeHierarchy(ClientPtr client)
ptr->coreEvents = keybd->coreEvents = FALSE;
/* Allocate virtual slave devices for xtest events */
rc = AllocXtstDevice(client, name, &xtstptr, &xtstkeybd,
rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd,
ptr, keybd);
if (rc != Success)
{
@ -203,10 +203,10 @@ ProcXIChangeHierarchy(ClientPtr client)
flags[ptr->id] |= XIMasterAdded;
flags[keybd->id] |= XIMasterAdded;
ActivateDevice(xtstptr, FALSE);
ActivateDevice(xtstkeybd, FALSE);
flags[xtstptr->id] |= XISlaveAdded;
flags[xtstkeybd->id] |= XISlaveAdded;
ActivateDevice(XTestptr, FALSE);
ActivateDevice(XTestkeybd, FALSE);
flags[XTestptr->id] |= XISlaveAdded;
flags[XTestkeybd->id] |= XISlaveAdded;
if (c->enable)
{
@ -215,18 +215,18 @@ ProcXIChangeHierarchy(ClientPtr client)
flags[ptr->id] |= XIDeviceEnabled;
flags[keybd->id] |= XIDeviceEnabled;
EnableDevice(xtstptr, FALSE);
EnableDevice(xtstkeybd, FALSE);
flags[xtstptr->id] |= XIDeviceEnabled;
flags[xtstkeybd->id] |= XIDeviceEnabled;
EnableDevice(XTestptr, FALSE);
EnableDevice(XTestkeybd, FALSE);
flags[XTestptr->id] |= XIDeviceEnabled;
flags[XTestkeybd->id] |= XIDeviceEnabled;
}
/* Attach the XTest virtual devices to the newly
created master device */
AttachDevice(NULL, xtstptr, ptr);
AttachDevice(NULL, xtstkeybd, keybd);
flags[xtstptr->id] |= XISlaveAttached;
flags[xtstkeybd->id] |= XISlaveAttached;
AttachDevice(NULL, XTestptr, ptr);
AttachDevice(NULL, XTestkeybd, keybd);
flags[XTestptr->id] |= XISlaveAttached;
flags[XTestkeybd->id] |= XISlaveAttached;
xfree(name);
}
@ -275,14 +275,14 @@ ProcXIChangeHierarchy(ClientPtr client)
if (rc != Success)
goto unwind;
xtstptr = GetXtstDevice(ptr);
rc = dixLookupDevice(&xtstptr, xtstptr->id, client,
XTestptr = GetXTestDevice(ptr);
rc = dixLookupDevice(&XTestptr, XTestptr->id, client,
DixDestroyAccess);
if (rc != Success)
goto unwind;
xtstkeybd = GetXtstDevice(keybd);
rc = dixLookupDevice(&xtstkeybd, xtstkeybd->id, client,
XTestkeybd = GetXTestDevice(keybd);
rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client,
DixDestroyAccess);
if (rc != Success)
goto unwind;
@ -341,26 +341,26 @@ ProcXIChangeHierarchy(ClientPtr client)
/* can't disable until we removed pairing */
keybd->spriteInfo->paired = NULL;
ptr->spriteInfo->paired = NULL;
xtstptr->spriteInfo->paired = NULL;
xtstkeybd->spriteInfo->paired = NULL;
XTestptr->spriteInfo->paired = NULL;
XTestkeybd->spriteInfo->paired = NULL;
/* disable the remove the devices, xtst devices must be done first
/* disable the remove the devices, XTest devices must be done first
else the sprites they rely on will be destroyed */
DisableDevice(xtstptr, FALSE);
DisableDevice(xtstkeybd, FALSE);
DisableDevice(XTestptr, FALSE);
DisableDevice(XTestkeybd, FALSE);
DisableDevice(keybd, FALSE);
DisableDevice(ptr, FALSE);
flags[xtstptr->id] |= XIDeviceDisabled | XISlaveDetached;
flags[xtstkeybd->id] |= XIDeviceDisabled | XISlaveDetached;
flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached;
flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached;
flags[keybd->id] |= XIDeviceDisabled;
flags[ptr->id] |= XIDeviceDisabled;
RemoveDevice(xtstptr, FALSE);
RemoveDevice(xtstkeybd, FALSE);
RemoveDevice(XTestptr, FALSE);
RemoveDevice(XTestkeybd, FALSE);
RemoveDevice(keybd, FALSE);
RemoveDevice(ptr, FALSE);
flags[xtstptr->id] |= XISlaveRemoved;
flags[xtstkeybd->id] |= XISlaveRemoved;
flags[XTestptr->id] |= XISlaveRemoved;
flags[XTestkeybd->id] |= XISlaveRemoved;
flags[keybd->id] |= XIMasterRemoved;
flags[ptr->id] |= XIMasterRemoved;
}
@ -381,8 +381,8 @@ ProcXIChangeHierarchy(ClientPtr client)
goto unwind;
}
/* Don't allow changes to Xtst Devices, these are fixed */
if (IsXtstDevice(ptr, NULL))
/* Don't allow changes to XTest Devices, these are fixed */
if (IsXTestDevice(ptr, NULL))
{
client->errorValue = c->deviceid;
rc = BadDevice;
@ -410,8 +410,8 @@ ProcXIChangeHierarchy(ClientPtr client)
goto unwind;
}
/* Don't allow changes to Xtst Devices, these are fixed */
if (IsXtstDevice(ptr, NULL))
/* Don't allow changes to XTest Devices, these are fixed */
if (IsXTestDevice(ptr, NULL))
{
client->errorValue = c->deviceid;
rc = BadDevice;

View File

@ -51,7 +51,7 @@ static struct dev_properties
char *name;
} dev_properties[] = {
{0, XI_PROP_ENABLED},
{0, XI_PROP_XTST_DEVICE},
{0, XI_PROP_XTEST_DEVICE},
{0, XATOM_FLOAT},
{0, ACCEL_PROP_PROFILE_NUMBER},
{0, ACCEL_PROP_CONSTANT_DECELERATION},

View File

@ -1200,7 +1200,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
dev->last.numValuators = numAxes;
if (IsMaster(dev) || /* do not accelerate master or xtest devices */
IsXtstDevice(dev, NULL))
IsXTestDevice(dev, NULL))
InitPointerAccelerationScheme(dev, PtrAccelNoOp);
else
InitPointerAccelerationScheme(dev, PtrAccelDefault);

View File

@ -495,14 +495,14 @@ extern int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
KeyCode **modkeymap, int *max_keys_per_mod);
extern int change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *map,
int max_keys_per_mod);
extern int AllocXtstDevice(ClientPtr client,
extern int AllocXTestDevice(ClientPtr client,
char* name,
DeviceIntPtr* ptr,
DeviceIntPtr* keybd,
DeviceIntPtr master_ptr,
DeviceIntPtr master_keybd);
extern BOOL IsXtstDevice(DeviceIntPtr dev, DeviceIntPtr master);
extern DeviceIntPtr GetXtstDevice(DeviceIntPtr master);
extern BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master);
extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
/* misc event helpers */
extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);

View File

@ -32,8 +32,8 @@
/* BOOL. 0 - device disabled, 1 - device enabled */
#define XI_PROP_ENABLED "Device Enabled"
/* BOOL. If present, device is a virtual Xtst device */
#define XI_PROP_XTST_DEVICE "Xtst Device"
/* BOOL. If present, device is a virtual XTEST device */
#define XI_PROP_XTEST_DEVICE "XTEST Device"
/* Pointer acceleration properties */
/* INTEGER of any format */