Lines Matching defs:strokep

1391 	atp_stroke_t *strokep;
1403 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) {
1404 if (strokep->components[axis].matched)
1412 &strokep->components[axis], &pspans[i],
1413 strokep->type)) {
1416 strokep->components[axis].matched = true;
1424 break; /* skip to the next strokep */
1435 atp_stroke_t *strokep;
1439 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry)
1440 strokep->matched = false;
1446 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) {
1451 if (strokep->matched)
1454 instantaneous_dx = fingers[i].x - strokep->x;
1455 instantaneous_dy = fingers[i].y - strokep->y;
1464 strokep_best = strokep;
1468 strokep = strokep_best;
1470 if (strokep != NULL) {
1473 strokep->matched = true;
1474 strokep->instantaneous_dx = fingers[i].x - strokep->x;
1475 strokep->instantaneous_dy = fingers[i].y - strokep->y;
1476 strokep->x = fingers[i].x;
1477 strokep->y = fingers[i].y;
1479 atp_advance_stroke_state(sc, strokep, &movement);
1493 atp_stroke_t *strokep;
1501 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) {
1502 strokep->components[X].matched = false;
1503 strokep->components[Y].matched = false;
1550 TAILQ_FOREACH_SAFE(strokep, &sc->sc_stroke_used, entry, strokep_next) {
1552 if (strokep->components[X].matched &&
1553 strokep->components[Y].matched) {
1554 strokep->matched = true;
1555 strokep->instantaneous_dx =
1556 strokep->components[X].delta_mickeys;
1557 strokep->instantaneous_dy =
1558 strokep->components[Y].delta_mickeys;
1559 atp_advance_stroke_state(sc, strokep, &movement);
1566 atp_terminate_stroke(sc, strokep);
1606 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) {
1609 (strokep->flags & ATSF_ZOMBIE) ? "zomb:" : "",
1610 (strokep->type == ATP_STROKE_TOUCH) ? '[' : '<',
1611 strokep->components[X].loc,
1612 strokep->components[X].delta_mickeys,
1613 strokep->components[X].cum_pressure,
1614 strokep->components[X].max_cum_pressure,
1615 (strokep->type == ATP_STROKE_TOUCH) ? ']' : '>',
1616 (strokep->type == ATP_STROKE_TOUCH) ? '[' : '<',
1617 strokep->components[Y].loc,
1618 strokep->components[Y].delta_mickeys,
1619 strokep->components[Y].cum_pressure,
1620 strokep->components[Y].max_cum_pressure,
1621 (strokep->type == ATP_STROKE_TOUCH) ? ']' : '>');
1639 atp_stroke_t *strokep;
1647 TAILQ_FOREACH_SAFE(strokep, &sc->sc_stroke_used, entry, strokep_next) {
1648 if (strokep->matched)
1650 atp_terminate_stroke(sc, strokep);
1669 atp_stroke_t *strokep;
1671 strokep = atp_alloc_stroke(sc);
1672 if (strokep == NULL)
1680 strokep->type = ATP_STROKE_TOUCH;
1681 strokep->matched = false;
1682 microtime(&strokep->ctime);
1683 strokep->age = 1; /* number of interrupts */
1684 strokep->x = pspan_x->loc;
1685 strokep->y = pspan_y->loc;
1687 strokep->components[X].loc = pspan_x->loc;
1688 strokep->components[X].cum_pressure = pspan_x->cum;
1689 strokep->components[X].max_cum_pressure = pspan_x->cum;
1690 strokep->components[X].matched = true;
1692 strokep->components[Y].loc = pspan_y->loc;
1693 strokep->components[Y].cum_pressure = pspan_y->cum;
1694 strokep->components[Y].max_cum_pressure = pspan_y->cum;
1695 strokep->components[Y].matched = true;
1703 strokep->components[X].loc,
1704 strokep->components[Y].loc,
1705 (u_int)strokep->ctime.tv_sec,
1706 (unsigned long int)strokep->ctime.tv_usec);
1776 atp_stroke_t *strokep;
1778 strokep = atp_alloc_stroke(sc);
1779 if (strokep == NULL)
1787 strokep->type = ATP_STROKE_TOUCH;
1788 strokep->matched = true;
1789 microtime(&strokep->ctime);
1790 strokep->age = 1; /* number of interrupts */
1791 strokep->x = fingerp->x;
1792 strokep->y = fingerp->y;
1798 DPRINTFN(ATP_LLEVEL_INFO, "[%d,%d]\n", strokep->x, strokep->y);
1802 atp_advance_stroke_state(struct atp_softc *sc, atp_stroke_t *strokep,
1806 if (strokep->flags & ATSF_ZOMBIE)
1807 strokep->flags &= ~ATSF_ZOMBIE;
1809 strokep->age++;
1810 if (strokep->age <= atp_stroke_maturity_threshold) {
1812 strokep->instantaneous_dx = 0;
1813 strokep->instantaneous_dy = 0;
1816 if (atp_compute_stroke_movement(strokep))
1819 if (strokep->type != ATP_STROKE_TOUCH)
1823 if ((abs(strokep->cum_movement_x) > atp_slide_min_movement) ||
1824 (abs(strokep->cum_movement_y) > atp_slide_min_movement))
1825 atp_convert_to_slide(sc, strokep);
1830 if (timevalcmp(&tdiff, &strokep->ctime, >)) {
1831 timevalsub(&tdiff, &strokep->ctime);
1836 atp_convert_to_slide(sc, strokep);
1842 atp_stroke_has_small_movement(const atp_stroke_t *strokep)
1844 return (((u_int)abs(strokep->instantaneous_dx) <=
1846 ((u_int)abs(strokep->instantaneous_dy) <=
1856 atp_update_pending_mickeys(atp_stroke_t *strokep)
1859 strokep->pending_dx += strokep->instantaneous_dx;
1860 strokep->pending_dy += strokep->instantaneous_dy;
1911 UPDATE_INSTANTANEOUS_AND_PENDING(strokep->instantaneous_dx,
1912 strokep->pending_dx);
1913 UPDATE_INSTANTANEOUS_AND_PENDING(strokep->instantaneous_dy,
1914 strokep->pending_dy);
1922 atp_compute_stroke_movement(atp_stroke_t *strokep)
1930 if (atp_stroke_has_small_movement(strokep))
1931 atp_update_pending_mickeys(strokep);
1934 strokep->pending_dx = 0;
1935 strokep->pending_dy = 0;
1939 strokep->movement_dx = (strokep->instantaneous_dx) /
1941 strokep->movement_dy = (strokep->instantaneous_dy) /
1944 if ((abs(strokep->instantaneous_dx) >= ATP_FAST_MOVEMENT_TRESHOLD) ||
1945 (abs(strokep->instantaneous_dy) >= ATP_FAST_MOVEMENT_TRESHOLD)) {
1946 strokep->movement_dx <<= 1;
1947 strokep->movement_dy <<= 1;
1950 strokep->cum_movement_x += strokep->movement_dx;
1951 strokep->cum_movement_y += strokep->movement_dy;
1953 return ((strokep->movement_dx != 0) || (strokep->movement_dy != 0));
1963 atp_terminate_stroke(struct atp_softc *sc, atp_stroke_t *strokep)
1965 if (strokep->flags & ATSF_ZOMBIE)
1969 if (strokep->age <= atp_stroke_maturity_threshold) {
1970 atp_free_stroke(sc, strokep);
1974 strokep->flags |= ATSF_ZOMBIE;
1984 if (strokep->type == ATP_STROKE_SLIDE)
1989 atp_is_horizontal_scroll(const atp_stroke_t *strokep)
1991 if (abs(strokep->cum_movement_x) < atp_slide_min_movement)
1993 if (strokep->cum_movement_y == 0)
1995 return (abs(strokep->cum_movement_x / strokep->cum_movement_y) >= 4);
1999 atp_is_vertical_scroll(const atp_stroke_t *strokep)
2001 if (abs(strokep->cum_movement_y) < atp_slide_min_movement)
2003 if (strokep->cum_movement_x == 0)
2005 return (abs(strokep->cum_movement_y / strokep->cum_movement_x) >= 4);
2018 atp_stroke_t *strokep;
2023 TAILQ_FOREACH_SAFE(strokep, &sc->sc_stroke_used, entry, strokep_next) {
2024 if ((strokep->flags & ATSF_ZOMBIE) == 0)
2027 if (strokep->type == ATP_STROKE_TOUCH) {
2032 if (atp_is_horizontal_scroll(strokep)) {
2034 horizontal_scroll += strokep->cum_movement_x;
2035 } else if (atp_is_vertical_scroll(strokep)) {
2037 vertical_scroll += strokep->cum_movement_y;
2041 atp_free_stroke(sc, strokep);
2089 atp_convert_to_slide(struct atp_softc *sc, atp_stroke_t *strokep)
2091 strokep->type = ATP_STROKE_SLIDE;
2096 timevalcmp(&strokep->ctime, &sc->sc_touch_reap_time, >)) {
2103 delta = strokep->ctime;
2362 atp_stroke_t *strokep;
2368 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) {
2369 if (strokep->flags & ATSF_ZOMBIE)
2372 dx += strokep->movement_dx;
2373 dy += strokep->movement_dy;
2374 if (strokep->movement_dx ||
2375 strokep->movement_dy)
2388 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) {
2389 if (strokep->flags & ATSF_ZOMBIE)
2392 if (!atp_is_vertical_scroll(strokep))