Lines Matching refs:ev
52 static int countValuators(DeviceEvent *ev, int *first);
53 static int getValuatorEvents(DeviceEvent *ev, deviceValuator *xv);
54 static int eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count);
55 static int eventToDeviceChanged(DeviceChangedEvent *ev, xEvent **dcce);
56 static int eventToDeviceEvent(DeviceEvent *ev, xEvent **xi);
57 static int eventToRawEvent(RawDeviceEvent *ev, xEvent **xi);
162 * @param[in] ev The event to convert into an XI 1 event.
169 EventToXI(InternalEvent *ev, xEvent **xi, int *count)
171 switch (ev->any.type)
180 return eventToKeyButtonPointer(&ev->device_event, xi, count);
194 ErrorF("[dix] EventToXI: Not implemented for %d \n", ev->any.type);
207 * @param[in] ev The event to convert into an XI2 event
213 EventToXI2(InternalEvent *ev, xEvent **xi)
215 switch (ev->any.type)
228 return eventToDeviceEvent(&ev->device_event, xi);
234 return eventToDeviceChanged(&ev->changed_event, xi);
240 return eventToRawEvent(&ev->raw_event, xi);
245 ErrorF("[dix] EventToXI2: Not implemented for %d \n", ev->any.type);
250 eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count)
257 if (ev->detail.button > 0xFF || ev->deviceid >= 0x80)
263 num_events = (countValuators(ev, &first) + 5)/6; /* valuator ev */
266 switch (ev->type)
291 kbp->detail = ev->detail.button;
292 kbp->time = ev->time;
293 kbp->root = ev->root;
294 kbp->root_x = ev->root_x;
295 kbp->root_y = ev->root_y;
296 kbp->deviceid = ev->deviceid;
297 kbp->state = ev->corestate;
299 (ev->type == ET_KeyPress && ev->key_repeat));
304 switch(ev->type)
319 getValuatorEvents(ev, (deviceValuator*)(kbp + 1));
328 * Set first to the first valuator in the event ev and return the number of
332 countValuators(DeviceEvent *ev, int *first)
337 for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
339 if (BitIsOn(ev->valuators.mask, i))
357 getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
364 num_valuators = countValuators(ev, &first_valuator);
368 dixLookupDevice(&dev, ev->deviceid, serverClient, DixUseAccess);
381 xv->deviceid = ev->deviceid;
387 valuators[j] = ev->valuators.data[xv->first_valuator + j];
548 eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
563 vallen = count_bits(ev->valuators.mask, sizeof(ev->valuators.mask)/sizeof(ev->valuators.mask[0]));
572 xde->evtype = GetXI2Type((InternalEvent*)ev);
573 xde->time = ev->time;
575 xde->detail = ev->detail.button;
576 xde->root = ev->root;
579 xde->deviceid = ev->deviceid;
580 xde->sourceid = ev->sourceid;
581 xde->root_x = FP1616(ev->root_x, ev->root_x_frac);
582 xde->root_y = FP1616(ev->root_y, ev->root_y_frac);
584 if (ev->key_repeat)
587 xde->mods.base_mods = ev->mods.base;
588 xde->mods.latched_mods = ev->mods.latched;
589 xde->mods.locked_mods = ev->mods.locked;
590 xde->mods.effective_mods = ev->mods.effective;
592 xde->group.base_group = ev->group.base;
593 xde->group.latched_group = ev->group.latched;
594 xde->group.locked_group = ev->group.locked;
595 xde->group.effective_group = ev->group.effective;
598 for (i = 0; i < sizeof(ev->buttons) * 8; i++)
600 if (BitIsOn(ev->buttons, i))
606 for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
608 if (BitIsOn(ev->valuators.mask, i))
611 axisval->integral = ev->valuators.data[i];
612 axisval->frac = ev->valuators.data_frac[i];
621 eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
629 nvals = count_bits(ev->valuators.mask, sizeof(ev->valuators.mask));
639 raw->evtype = GetXI2Type((InternalEvent*)ev);
640 raw->time = ev->time;
642 raw->detail = ev->detail.button;
643 raw->deviceid = ev->deviceid;
648 for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
650 if (BitIsOn(ev->valuators.mask, i))
653 axisval->integral = ev->valuators.data[i];
654 axisval->frac = ev->valuators.data_frac[i];
655 (axisval + nvals)->integral = ev->valuators.data_raw[i];
656 (axisval + nvals)->frac = ev->valuators.data_raw_frac[i];