diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-02-21 11:57:19 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-02-23 10:42:02 +1000 |
commit | 8caaf2f872be80e6aa222505d96d6025cf4f8d80 (patch) | |
tree | 98f1dcffd797250f209de9ad780b75a328ecea27 | |
parent | b181658db7c72b664d40f2736fe425819421ce52 (diff) |
Handle XA_CARDINAL as property type
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
-rw-r--r-- | src/property.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/property.c b/src/property.c index 7723445..3ab2cb0 100644 --- a/src/property.c +++ b/src/property.c @@ -97,6 +97,20 @@ print_property(Display *dpy, XDevice* dev, Atom property) break; } break; + case XA_CARDINAL: + switch(act_format) + { + case 8: + printf("%u", *((unsigned char*)ptr)); + break; + case 16: + printf("%u", *((unsigned short*)ptr)); + break; + case 32: + printf("%lu", *((unsigned long*)ptr)); + break; + } + break; case XA_STRING: if (act_format != 8) { @@ -353,7 +367,7 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char for (i = 0; i < nelements; i++) { - if (type == XA_INTEGER) { + if (type == XA_INTEGER || type == XA_CARDINAL) { switch (format) { case 8: @@ -443,6 +457,20 @@ print_property_xi2(Display *dpy, int deviceid, Atom property) break; } break; + case XA_CARDINAL: + switch(act_format) + { + case 8: + printf("%u", *((uint8_t*)ptr)); + break; + case 16: + printf("%u", *((uint16_t*)ptr)); + break; + case 32: + printf("%u", *((uint32_t*)ptr)); + break; + } + break; case XA_STRING: if (act_format != 8) { @@ -626,7 +654,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char for (i = 0; i < nelements; i++) { - if (type == XA_INTEGER) { + if (type == XA_INTEGER || type == XA_CARDINAL) { switch (format) { case 8: |