diff options
author | marha <marha@users.sourceforge.net> | 2011-10-26 10:58:41 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-10-26 10:58:41 +0200 |
commit | 4f005bade376d15ee60e90ca45a831aff9725087 (patch) | |
tree | 5abdbe5a7c55acf9e30c533414796f629fa9e47c /xorg-server/test/xi2 | |
parent | 9f986778bd4393c5a9108426969d45aa7f10f334 (diff) | |
download | vcxsrv-4f005bade376d15ee60e90ca45a831aff9725087.tar.gz vcxsrv-4f005bade376d15ee60e90ca45a831aff9725087.tar.bz2 vcxsrv-4f005bade376d15ee60e90ca45a831aff9725087.zip |
libX11 libXft mesa mkfontscale pixman xserver git update 26 okt 2011
Diffstat (limited to 'xorg-server/test/xi2')
-rw-r--r-- | xorg-server/test/xi2/protocol-eventconvert.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/xorg-server/test/xi2/protocol-eventconvert.c b/xorg-server/test/xi2/protocol-eventconvert.c index bfa23b51f..ba2d96ad1 100644 --- a/xorg-server/test/xi2/protocol-eventconvert.c +++ b/xorg-server/test/xi2/protocol-eventconvert.c @@ -30,6 +30,7 @@ #include "eventstr.h" #include "eventconvert.h" #include "exevents.h" +#include "inpututils.h" #include <X11/extensions/XI2proto.h> static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, @@ -104,8 +105,7 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, value = (FP3232*)(((unsigned char*)&out[1]) + out->valuators_len * 4); value += nvals; - vi.integral = trunc(in->valuators.data[i]); - vi.frac = in->valuators.data[i] - vi.integral; + vi = double_to_fp3232(in->valuators.data[i]); vo.integral = value->integral; vo.frac = value->frac; @@ -120,8 +120,7 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, raw_value = value + bits_set; - vi.integral = trunc(in->valuators.data_raw[i]); - vi.frac = in->valuators.data_raw[i] - vi.integral; + vi = double_to_fp3232(in->valuators.data_raw[i]); vo.integral = raw_value->integral; vo.frac = raw_value->frac; @@ -748,6 +747,26 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, } break; + case XIScrollClass: + { + xXIScrollInfo *s = (xXIScrollInfo*)any; + assert(s->length == + bytes_to_int32(sizeof(xXIScrollInfo))); + + assert(s->sourceid == in->sourceid); + assert(s->number < in->num_valuators); + switch(s->type) + { + case XIScrollTypeVertical: + assert(in->valuators[s->number].scroll.type == SCROLL_TYPE_VERTICAL); + break; + case XIScrollTypeHorizontal: + assert(in->valuators[s->number].scroll.type == SCROLL_TYPE_HORIZONTAL); + break; + } + if (s->flags & XIScrollFlagPreferred) + assert(in->valuators[s->number].scroll.flags & SCROLL_FLAG_PREFERRED); + } default: printf("Invalid class type.\n\n"); assert(1); |