diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-17 14:50:39 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-09-17 06:40:32 +1000 |
commit | 3ed1b463205295a5ebba7d570a4cb8dfade51a38 (patch) | |
tree | 5cef0d43e362afc1ba3f1f334c6be4b0314c4a29 /src/XExtInt.c | |
parent | 00382417331d0b38373796fd31757be9fd3e9971 (diff) |
Support XI 2.1 XIScrollClass
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/XExtInt.c')
-rw-r--r-- | src/XExtInt.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c index 870dc0c..d74a8d4 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -1039,6 +1039,9 @@ sizeDeviceClassType(int type, int num_elements) case XIValuatorClass: l = sizeof(XIValuatorClassInfo); break; + case XIScrollClass: + l = sizeof(XIScrollClassInfo); + break; default: printf("sizeDeviceClassType: unknown type %d\n", type); break; @@ -1098,6 +1101,9 @@ copyDeviceChangedEvent(XGenericEventCookie *in_cookie, case XIValuatorClass: len += sizeDeviceClassType(XIValuatorClass, 0); break; + case XIScrollClass: + len += sizeDeviceClassType(XIScrollClass, 0); + break; default: printf("copyDeviceChangedEvent: unknown type %d\n", any->type); @@ -1162,6 +1168,15 @@ copyDeviceChangedEvent(XGenericEventCookie *in_cookie, out->classes[i] = (XIAnyClassInfo*)vout; break; } + case XIScrollClass: + { + XIScrollClassInfo *sin, *sout; + sin = (XIScrollClassInfo*)any; + sout = next_block(&ptr, sizeof(XIScrollClassInfo)); + *sout = *sin; + out->classes[i] = (XIAnyClassInfo*)sout; + break; + } } } @@ -1433,6 +1448,9 @@ size_classes(xXIAnyInfo* from, int nclasses) case XIValuatorClass: l = sizeDeviceClassType(XIValuatorClass, 0); break; + case XIScrollClass: + l = sizeDeviceClassType(XIScrollClass, 0); + break; } len += l; @@ -1545,6 +1563,25 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses) to->classes[cls_idx++] = any_lib; } break; + case XIScrollClass: + { + XIScrollClassInfo *cls_lib; + xXIScrollInfo *cls_wire; + + cls_lib = next_block(&ptr_lib, sizeof(XIScrollClassInfo)); + cls_wire = (xXIScrollInfo*)any_wire; + + cls_lib->type = cls_wire->type; + cls_lib->sourceid = cls_wire->sourceid; + cls_lib->number = cls_wire->number; + cls_lib->scroll_type= cls_wire->scroll_type; + cls_lib->flags = cls_wire->flags; + cls_lib->increment = cls_wire->increment.integral; + cls_lib->increment += (unsigned int)cls_wire->increment.frac/(double)(1UL << 32); + + to->classes[cls_idx++] = any_lib; + } + break; } len += any_wire->length * 4; ptr_wire += any_wire->length * 4; |