Lines Matching refs:ev
54 static int countValuators(DeviceEvent *ev, int *first);
55 static int getValuatorEvents(DeviceEvent *ev, deviceValuator * xv);
56 static int eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count);
57 static int eventToDeviceChanged(DeviceChangedEvent *ev, xEvent **dcce);
58 static int eventToDeviceEvent(DeviceEvent *ev, xEvent **xi);
59 static int eventToRawEvent(RawDeviceEvent *ev, xEvent **xi);
60 static int eventToBarrierEvent(BarrierEvent *ev, xEvent **xi);
61 static int eventToTouchOwnershipEvent(TouchOwnershipEvent *ev, xEvent **xi);
62 static int eventToGestureSwipeEvent(GestureEvent *ev, xEvent **xi);
63 static int eventToGesturePinchEvent(GestureEvent *ev, xEvent **xi);
199 * @param[in] ev The event to convert into an XI 1 event.
206 EventToXI(InternalEvent *ev, xEvent **xi, int *count)
208 switch (ev->any.type) {
216 return eventToKeyButtonPointer(&ev->device_event, xi, count);
245 ErrorF("[dix] EventToXI: Not implemented for %d \n", ev->any.type);
258 * @param[in] ev The event to convert into an XI2 event
264 EventToXI2(InternalEvent *ev, xEvent **xi)
266 switch (ev->any.type) {
281 return eventToDeviceEvent(&ev->device_event, xi);
283 return eventToTouchOwnershipEvent(&ev->touch_ownership_event, xi);
289 return eventToDeviceChanged(&ev->changed_event, xi);
298 return eventToRawEvent(&ev->raw_event, xi);
301 return eventToBarrierEvent(&ev->barrier_event, xi);
305 return eventToGesturePinchEvent(&ev->gesture_event, xi);
309 return eventToGestureSwipeEvent(&ev->gesture_event, xi);
314 ErrorF("[dix] EventToXI2: Not implemented for %d \n", ev->any.type);
319 eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count)
326 if (ev->detail.button > 0xFF || ev->deviceid >= 0x80) {
331 num_events = (countValuators(ev, &first) + 5) / 6; /* valuator ev */
333 switch (ev->type) {
359 kbp->detail = ev->detail.button;
360 kbp->time = ev->time;
361 kbp->root = ev->root;
362 kbp->root_x = ev->root_x;
363 kbp->root_y = ev->root_y;
364 kbp->deviceid = ev->deviceid;
365 kbp->state = ev->corestate;
367 (ev->type == ET_KeyPress && ev->key_repeat));
372 switch (ev->type) {
399 getValuatorEvents(ev, (deviceValuator *) (kbp + 1));
407 * Set first to the first valuator in the event ev and return the number of
411 countValuators(DeviceEvent *ev, int *first)
416 for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++) {
417 if (BitIsOn(ev->valuators.mask, i)) {
433 getValuatorEvents(DeviceEvent *ev, deviceValuator * xv)
439 num_valuators = countValuators(ev, &first_valuator);
443 dixLookupDevice(&dev, ev->deviceid, serverClient, DixUseAccess);
458 xv->deviceid = ev->deviceid;
464 valuators[j] = ev->valuators.data[xv->first_valuator + j];
666 eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
680 vallen = count_bits(ev->valuators.mask, ARRAY_SIZE(ev->valuators.mask));
691 xde->evtype = GetXI2Type(ev->type);
692 xde->time = ev->time;
694 if (IsTouchEvent((InternalEvent *) ev))
695 xde->detail = ev->touchid;
697 xde->detail = ev->detail.button;
699 xde->root = ev->root;
702 xde->deviceid = ev->deviceid;
703 xde->sourceid = ev->sourceid;
704 xde->root_x = double_to_fp1616(ev->root_x + ev->root_x_frac);
705 xde->root_y = double_to_fp1616(ev->root_y + ev->root_y_frac);
707 if (IsTouchEvent((InternalEvent *)ev)) {
708 if (ev->type == ET_TouchUpdate)
709 xde->flags |= (ev->flags & TOUCH_PENDING_END) ? XITouchPendingEnd : 0;
711 if (ev->flags & TOUCH_POINTER_EMULATED)
714 xde->flags = ev->flags;
716 if (ev->key_repeat)
720 xde->mods.base_mods = ev->mods.base;
721 xde->mods.latched_mods = ev->mods.latched;
722 xde->mods.locked_mods = ev->mods.locked;
723 xde->mods.effective_mods = ev->mods.effective;
725 xde->group.base_group = ev->group.base;
726 xde->group.latched_group = ev->group.latched;
727 xde->group.locked_group = ev->group.locked;
728 xde->group.effective_group = ev->group.effective;
731 for (i = 0; i < sizeof(ev->buttons) * 8; i++) {
732 if (BitIsOn(ev->buttons, i))
739 if (BitIsOn(ev->valuators.mask, i)) {
741 *axisval = double_to_fp3232(ev->valuators.data[i]);
750 eventToTouchOwnershipEvent(TouchOwnershipEvent *ev, xEvent **xi)
762 xtoe->evtype = GetXI2Type(ev->type);
763 xtoe->deviceid = ev->deviceid;
764 xtoe->time = ev->time;
765 xtoe->sourceid = ev->sourceid;
766 xtoe->touchid = ev->touchid;
773 eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
781 nvals = count_bits(ev->valuators.mask, sizeof(ev->valuators.mask));
793 raw->evtype = GetXI2Type(ev->type);
794 raw->time = ev->time;
796 raw->detail = ev->detail.button;
797 raw->deviceid = ev->deviceid;
798 raw->sourceid = ev->sourceid;
800 raw->flags = ev->flags;
806 if (BitIsOn(ev->valuators.mask, i)) {
808 *axisval = double_to_fp3232(ev->valuators.data[i]);
809 *axisval_raw = double_to_fp3232(ev->valuators.data_raw[i]);
819 eventToBarrierEvent(BarrierEvent *ev, xEvent **xi)
830 barrier->evtype = GetXI2Type(ev->type);
832 barrier->deviceid = ev->deviceid;
833 barrier->sourceid = ev->sourceid;
834 barrier->time = ev->time;
835 barrier->event = ev->window;
836 barrier->root = ev->root;
837 barrier->dx = double_to_fp3232(ev->dx);
838 barrier->dy = double_to_fp3232(ev->dy);
839 barrier->dtime = ev->dt;
840 barrier->flags = ev->flags;
841 barrier->eventid = ev->event_id;
842 barrier->barrier = ev->barrierid;
843 barrier->root_x = double_to_fp1616(ev->root_x);
844 barrier->root_y = double_to_fp1616(ev->root_y);
850 eventToGesturePinchEvent(GestureEvent *ev, xEvent **xi)
861 xpe->evtype = GetXI2Type(ev->type);
862 xpe->time = ev->time;
864 xpe->detail = ev->num_touches;
866 xpe->root = ev->root;
867 xpe->deviceid = ev->deviceid;
868 xpe->sourceid = ev->sourceid;
869 xpe->root_x = double_to_fp1616(ev->root_x);
870 xpe->root_y = double_to_fp1616(ev->root_y);
871 xpe->flags |= (ev->flags & GESTURE_CANCELLED) ? XIGesturePinchEventCancelled : 0;
873 xpe->delta_x = double_to_fp1616(ev->delta_x);
874 xpe->delta_y = double_to_fp1616(ev->delta_y);
875 xpe->delta_unaccel_x = double_to_fp1616(ev->delta_unaccel_x);
876 xpe->delta_unaccel_y = double_to_fp1616(ev->delta_unaccel_y);
877 xpe->scale = double_to_fp1616(ev->scale);
878 xpe->delta_angle = double_to_fp1616(ev->delta_angle);
880 xpe->mods.base_mods = ev->mods.base;
881 xpe->mods.latched_mods = ev->mods.latched;
882 xpe->mods.locked_mods = ev->mods.locked;
883 xpe->mods.effective_mods = ev->mods.effective;
885 xpe->group.base_group = ev->group.base;
886 xpe->group.latched_group = ev->group.latched;
887 xpe->group.locked_group = ev->group.locked;
888 xpe->group.effective_group = ev->group.effective;
894 eventToGestureSwipeEvent(GestureEvent *ev, xEvent **xi)
905 xde->evtype = GetXI2Type(ev->type);
906 xde->time = ev->time;
908 xde->detail = ev->num_touches;
910 xde->root = ev->root;
911 xde->deviceid = ev->deviceid;
912 xde->sourceid = ev->sourceid;
913 xde->root_x = double_to_fp1616(ev->root_x);
914 xde->root_y = double_to_fp1616(ev->root_y);
915 xde->flags |= (ev->flags & GESTURE_CANCELLED) ? XIGestureSwipeEventCancelled : 0;
917 xde->delta_x = double_to_fp1616(ev->delta_x);
918 xde->delta_y = double_to_fp1616(ev->delta_y);
919 xde->delta_unaccel_x = double_to_fp1616(ev->delta_unaccel_x);
920 xde->delta_unaccel_y = double_to_fp1616(ev->delta_unaccel_y);
922 xde->mods.base_mods = ev->mods.base;
923 xde->mods.latched_mods = ev->mods.latched;
924 xde->mods.locked_mods = ev->mods.locked;
925 xde->mods.effective_mods = ev->mods.effective;
927 xde->group.base_group = ev->group.base;
928 xde->group.latched_group = ev->group.latched;
929 xde->group.locked_group = ev->group.locked;
930 xde->group.effective_group = ev->group.effective;