diff options
author | Daniel Stone <daniel@fooishbar.org> | 2011-06-14 17:07:11 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-25 09:50:32 +1000 |
commit | 627b09e5bd0726ad31bfeb4f07b8f8287d8ec46f (patch) | |
tree | 20919c40cd4214cd7616ee989141d6dd5b06b3be | |
parent | 299a44cd2035e84859b9d6c84854064326f8d124 (diff) |
Properties: Generalise InitTypedAtom from InitAtom
Add InitTypedAtom, which does exactly the same thing as InitAtom, but
takes an additional type argument.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r-- | src/properties.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/properties.c b/src/properties.c index 299a444..f5f78e3 100644 --- a/src/properties.c +++ b/src/properties.c @@ -96,7 +96,8 @@ Atom prop_product_id = 0; Atom prop_device_node = 0; static Atom -InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values) +InitTypedAtom(DeviceIntPtr dev, char *name, Atom type, int format, int nvalues, + int *values) { int i; Atom atom; @@ -124,14 +125,19 @@ InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values) } atom = MakeAtom(name, strlen(name), TRUE); - XIChangeDeviceProperty(dev, atom, XA_INTEGER, format, - PropModeReplace, nvalues, + XIChangeDeviceProperty(dev, atom, type, format, PropModeReplace, nvalues, converted, FALSE); XISetDevicePropertyDeletable(dev, atom, FALSE); return atom; } static Atom +InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values) +{ + return InitTypedAtom(dev, name, XA_INTEGER, format, nvalues, values); +} + +static Atom InitFloatAtom(DeviceIntPtr dev, char *name, int nvalues, float *values) { Atom atom; |