[PATCH 04/23] Properties: Generalise InitTypedAtom from InitAtom

Daniel Stone daniel at fooishbar.org
Thu Jun 23 15:12:39 PDT 2011


Add InitTypedAtom, which does exactly the same thing as InitAtom, but
takes an additional type argument.

Signed-off-by: Daniel Stone <daniel at fooishbar.org>
---
 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;
-- 
1.7.5.4



More information about the xorg-devel mailing list