diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-07 14:14:10 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-10 17:54:34 +1000 |
commit | e5aa00989cda9ebd18063c5e955235123ad37b88 (patch) | |
tree | c835110c16fa436c73b681dda9aadbc511f9b186 /dix/eventconvert.c | |
parent | 6cc0e6a0afa6a87802767d484aa4e68fa935d3eb (diff) |
Change GetXI2/XI/CoreType to just take a type argument
Avoids the dummy-event dance if we have an event type and need to get the
matching XI2 type.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'dix/eventconvert.c')
-rw-r--r-- | dix/eventconvert.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c index c9da39685..67b420a63 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -647,7 +647,7 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi) xde = (xXIDeviceEvent*)*xi; xde->type = GenericEvent; xde->extension = IReqCode; - xde->evtype = GetXI2Type((InternalEvent*)ev); + xde->evtype = GetXI2Type(ev->type); xde->time = ev->time; xde->length = bytes_to_int32(len - sizeof(xEvent)); xde->detail = ev->detail.button; @@ -714,7 +714,7 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi) raw = (xXIRawEvent*)*xi; raw->type = GenericEvent; raw->extension = IReqCode; - raw->evtype = GetXI2Type((InternalEvent*)ev); + raw->evtype = GetXI2Type(ev->type); raw->time = ev->time; raw->length = bytes_to_int32(len - sizeof(xEvent)); raw->detail = ev->detail.button; @@ -746,10 +746,10 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi) * equivalent exists. */ int -GetCoreType(InternalEvent *event) +GetCoreType(enum EventType type) { int coretype = 0; - switch(event->any.type) + switch(type) { case ET_Motion: coretype = MotionNotify; break; case ET_ButtonPress: coretype = ButtonPress; break; @@ -767,10 +767,10 @@ GetCoreType(InternalEvent *event) * equivalent exists. */ int -GetXIType(InternalEvent *event) +GetXIType(enum EventType type) { int xitype = 0; - switch(event->any.type) + switch(type) { case ET_Motion: xitype = DeviceMotionNotify; break; case ET_ButtonPress: xitype = DeviceButtonPress; break; @@ -790,11 +790,11 @@ GetXIType(InternalEvent *event) * equivalent exists. */ int -GetXI2Type(InternalEvent *event) +GetXI2Type(enum EventType type) { int xi2type = 0; - switch(event->any.type) + switch(type) { case ET_Motion: xi2type = XI_Motion; break; case ET_ButtonPress: xi2type = XI_ButtonPress; break; |