diff options
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; |