diff --git a/Xext/xtest.c b/Xext/xtest.c index 90a3b278c..a0bf019c3 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -583,7 +583,7 @@ InitXTestDevices(void) */ static int DeviceSetXTestProperty(DeviceIntPtr dev, Atom property, - XIPropertyValuePtr prop, BOOL checkonly) + PropertyValuePtr prop, BOOL checkonly) { if (property == XIGetKnownProperty(XI_PROP_XTEST_DEVICE)) return BadAccess; diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index 2691a8935..68ee591a5 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -244,7 +244,7 @@ get_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type, unsigned long n, len, ind; int rc; XIPropertyPtr prop; - XIPropertyValuePtr prop_value; + PropertyValuePtr prop_value; if (!ValidAtom(property)) { client->errorValue = property; @@ -418,7 +418,7 @@ XIResetProperties(void) * @return Success or the error code if an error occurred. */ int -XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return) +XIPropToInt(PropertyValuePtr val, int *nelem_return, int **buf_return) { int i; int *buf; @@ -488,7 +488,7 @@ XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return) * @return Success or the error code if an error occurred. */ int -XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return) +XIPropToFloat(PropertyValuePtr val, int *nelem_return, float **buf_return) { int i; float *buf; @@ -528,11 +528,11 @@ long XIRegisterPropertyHandler(DeviceIntPtr dev, int (*SetProperty) (DeviceIntPtr dev, Atom property, - XIPropertyValuePtr prop, + PropertyValuePtr prop, BOOL checkonly), int (*GetProperty) (DeviceIntPtr dev, Atom property), - int (*DeleteProperty) (DeviceIntPtr dev, + int (*DelProperty) (DeviceIntPtr dev, Atom property)) { XIPropertyHandlerPtr new_handler; @@ -544,7 +544,7 @@ XIRegisterPropertyHandler(DeviceIntPtr dev, new_handler->id = XIPropHandlerID++; new_handler->SetProperty = SetProperty; new_handler->GetProperty = GetProperty; - new_handler->DeleteProperty = DeleteProperty; + new_handler->DeleteProperty = DelProperty; new_handler->next = dev->properties.handlers; dev->properties.handlers = new_handler; @@ -687,8 +687,8 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, XIPropertyPtr prop; int size_in_bytes; unsigned long total_len; - XIPropertyValuePtr prop_value; - XIPropertyValueRec new_value; + PropertyValuePtr prop_value; + PropertyValueRec new_value; Bool add = FALSE; int rc; @@ -804,7 +804,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, } int -XIGetDeviceProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr *value) +XIGetDeviceProperty(DeviceIntPtr dev, Atom property, PropertyValuePtr *value) { XIPropertyPtr prop = XIFetchDeviceProperty(dev, property); int rc; diff --git a/dix/devices.c b/dix/devices.c index a18ad57fe..779477dfe 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -147,7 +147,7 @@ DeviceSetTransform(DeviceIntPtr dev, float *transform_data) * DIX property handler. */ static int -DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, +DeviceSetProperty(DeviceIntPtr dev, Atom property, PropertyValuePtr prop, BOOL checkonly) { if (property == XIGetKnownProperty(XI_PROP_ENABLED)) { diff --git a/dix/exevents_priv.h b/dix/exevents_priv.h index 681099e57..65b845eca 100644 --- a/dix/exevents_priv.h +++ b/dix/exevents_priv.h @@ -155,8 +155,8 @@ void XTestDeviceSendEvents(DeviceIntPtr dev, int flags, const ValuatorMask *mask); -int XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return); +int XIPropToInt(PropertyValuePtr val, int *nelem_return, int **buf_return); -int XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return); +int XIPropToFloat(PropertyValuePtr val, int *nelem_return, float **buf_return); #endif /* _XSERVER_EXEVENTS_PRIV_H */ diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index b9f611f05..ec919c4ab 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -191,7 +191,7 @@ AccelerationDefaultCleanup(DeviceIntPtr dev) */ static int AccelSetProfileProperty(DeviceIntPtr dev, Atom atom, - XIPropertyValuePtr val, BOOL checkOnly) + PropertyValuePtr val, BOOL checkOnly) { DeviceVelocityPtr vel; int profile, *ptr = &profile; @@ -236,7 +236,7 @@ AccelInitProfileProperty(DeviceIntPtr dev, DeviceVelocityPtr vel) */ static int AccelSetDecelProperty(DeviceIntPtr dev, Atom atom, - XIPropertyValuePtr val, BOOL checkOnly) + PropertyValuePtr val, BOOL checkOnly) { DeviceVelocityPtr vel; float v, *ptr = &v; @@ -280,7 +280,7 @@ AccelInitDecelProperty(DeviceIntPtr dev, DeviceVelocityPtr vel) */ static int AccelSetAdaptDecelProperty(DeviceIntPtr dev, Atom atom, - XIPropertyValuePtr val, BOOL checkOnly) + PropertyValuePtr val, BOOL checkOnly) { DeviceVelocityPtr veloc; float v, *ptr = &v; @@ -327,7 +327,7 @@ AccelInitAdaptDecelProperty(DeviceIntPtr dev, DeviceVelocityPtr vel) */ static int AccelSetScaleProperty(DeviceIntPtr dev, Atom atom, - XIPropertyValuePtr val, BOOL checkOnly) + PropertyValuePtr val, BOOL checkOnly) { DeviceVelocityPtr vel; float v, *ptr = &v; diff --git a/include/exevents.h b/include/exevents.h index 8bd405834..0b5970f19 100644 --- a/include/exevents.h +++ b/include/exevents.h @@ -92,7 +92,7 @@ extern _X_EXPORT int XIChangeDeviceProperty(DeviceIntPtr /* dev */ , extern _X_EXPORT int XIGetDeviceProperty(DeviceIntPtr /* dev */ , Atom /* property */ , - XIPropertyValuePtr * /* value */ + PropertyValuePtr * /* value */ ); extern _X_EXPORT int XISetDevicePropertyDeletable(DeviceIntPtr /* dev */ , @@ -105,7 +105,7 @@ extern _X_EXPORT long XIRegisterPropertyHandler(DeviceIntPtr dev, dev, Atom property, - XIPropertyValuePtr + PropertyValuePtr prop, BOOL checkonly), diff --git a/include/inputstr.h b/include/inputstr.h index e62e4731e..e77c43980 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -55,6 +55,7 @@ SOFTWARE. #include "dixstruct.h" #include "cursorstr.h" #include "privates.h" +#include "property_value.h" #define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) #define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) @@ -452,28 +453,24 @@ typedef struct _ClassesRec { } ClassesRec; /* Device properties */ -typedef struct _XIPropertyValue { - Atom type; /* ignored by server */ - short format; /* format of data for swapping - 8,16,32 */ - long size; /* size of data in (format/8) bytes */ - void *data; /* private to client */ -} XIPropertyValueRec; + +/* for backwards compat with older drivers, should not be used anymore */ +typedef PropertyValueRec XIPropertyValueRec, *XIPropertyValuePtr; typedef struct _XIProperty { struct _XIProperty *next; Atom propertyName; BOOL deletable; /* clients can delete this prop? */ - XIPropertyValueRec value; + PropertyValueRec value; } XIPropertyRec; typedef XIPropertyRec *XIPropertyPtr; -typedef XIPropertyValueRec *XIPropertyValuePtr; typedef struct _XIPropertyHandler { struct _XIPropertyHandler *next; long id; int (*SetProperty) (DeviceIntPtr dev, - Atom property, XIPropertyValuePtr prop, BOOL checkonly); + Atom property, PropertyValuePtr prop, BOOL checkonly); int (*GetProperty) (DeviceIntPtr dev, Atom property); int (*DeleteProperty) (DeviceIntPtr dev, Atom property); } XIPropertyHandler, *XIPropertyHandlerPtr; diff --git a/test/xtest.c b/test/xtest.c index f2e12c783..94da02e9c 100644 --- a/test/xtest.c +++ b/test/xtest.c @@ -128,7 +128,7 @@ xtest_properties(void) { int rc; char value = 1; - XIPropertyValuePtr prop; + PropertyValuePtr prop; Atom xtest_prop; xtest_init();