Lines Matching refs:strokep
1394 atp_stroke_t *strokep; in fg_match_strokes_against_pspans() local
1406 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) { in fg_match_strokes_against_pspans()
1407 if (strokep->components[axis].matched) in fg_match_strokes_against_pspans()
1415 &strokep->components[axis], &pspans[i], in fg_match_strokes_against_pspans()
1416 strokep->type)) { in fg_match_strokes_against_pspans()
1418 strokep->components[axis].matched = true; in fg_match_strokes_against_pspans()
1437 atp_stroke_t *strokep; in wsp_match_strokes_against_fingers() local
1441 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) in wsp_match_strokes_against_fingers()
1442 strokep->matched = false; in wsp_match_strokes_against_fingers()
1448 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) { in wsp_match_strokes_against_fingers()
1453 if (strokep->matched) in wsp_match_strokes_against_fingers()
1456 instantaneous_dx = fingers[i].x - strokep->x; in wsp_match_strokes_against_fingers()
1457 instantaneous_dy = fingers[i].y - strokep->y; in wsp_match_strokes_against_fingers()
1466 strokep_best = strokep; in wsp_match_strokes_against_fingers()
1470 strokep = strokep_best; in wsp_match_strokes_against_fingers()
1472 if (strokep != NULL) { in wsp_match_strokes_against_fingers()
1475 strokep->matched = true; in wsp_match_strokes_against_fingers()
1476 strokep->instantaneous_dx = fingers[i].x - strokep->x; in wsp_match_strokes_against_fingers()
1477 strokep->instantaneous_dy = fingers[i].y - strokep->y; in wsp_match_strokes_against_fingers()
1478 strokep->x = fingers[i].x; in wsp_match_strokes_against_fingers()
1479 strokep->y = fingers[i].y; in wsp_match_strokes_against_fingers()
1481 atp_advance_stroke_state(sc, strokep, &movement); in wsp_match_strokes_against_fingers()
1495 atp_stroke_t *strokep; in fg_update_strokes() local
1503 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) { in fg_update_strokes()
1504 strokep->components[X].matched = false; in fg_update_strokes()
1505 strokep->components[Y].matched = false; in fg_update_strokes()
1552 TAILQ_FOREACH_SAFE(strokep, &sc->sc_stroke_used, entry, strokep_next) { in fg_update_strokes()
1553 if (strokep->components[X].matched && in fg_update_strokes()
1554 strokep->components[Y].matched) { in fg_update_strokes()
1555 strokep->matched = true; in fg_update_strokes()
1556 strokep->instantaneous_dx = in fg_update_strokes()
1557 strokep->components[X].delta_mickeys; in fg_update_strokes()
1558 strokep->instantaneous_dy = in fg_update_strokes()
1559 strokep->components[Y].delta_mickeys; in fg_update_strokes()
1560 atp_advance_stroke_state(sc, strokep, &movement); in fg_update_strokes()
1567 atp_terminate_stroke(sc, strokep); in fg_update_strokes()
1607 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) { in fg_update_strokes()
1610 (strokep->flags & ATSF_ZOMBIE) ? "zomb:" : "", in fg_update_strokes()
1611 (strokep->type == ATP_STROKE_TOUCH) ? '[' : '<', in fg_update_strokes()
1612 strokep->components[X].loc, in fg_update_strokes()
1613 strokep->components[X].delta_mickeys, in fg_update_strokes()
1614 strokep->components[X].cum_pressure, in fg_update_strokes()
1615 strokep->components[X].max_cum_pressure, in fg_update_strokes()
1616 (strokep->type == ATP_STROKE_TOUCH) ? ']' : '>', in fg_update_strokes()
1617 (strokep->type == ATP_STROKE_TOUCH) ? '[' : '<', in fg_update_strokes()
1618 strokep->components[Y].loc, in fg_update_strokes()
1619 strokep->components[Y].delta_mickeys, in fg_update_strokes()
1620 strokep->components[Y].cum_pressure, in fg_update_strokes()
1621 strokep->components[Y].max_cum_pressure, in fg_update_strokes()
1622 (strokep->type == ATP_STROKE_TOUCH) ? ']' : '>'); in fg_update_strokes()
1641 atp_stroke_t *strokep; in wsp_update_strokes() local
1649 TAILQ_FOREACH_SAFE(strokep, &sc->sc_stroke_used, entry, strokep_next) { in wsp_update_strokes()
1650 if (strokep->matched) in wsp_update_strokes()
1652 atp_terminate_stroke(sc, strokep); in wsp_update_strokes()
1671 atp_stroke_t *strokep; in fg_add_stroke() local
1673 strokep = atp_alloc_stroke(sc); in fg_add_stroke()
1674 if (strokep == NULL) in fg_add_stroke()
1682 strokep->type = ATP_STROKE_TOUCH; in fg_add_stroke()
1683 strokep->matched = false; in fg_add_stroke()
1684 microtime(&strokep->ctime); in fg_add_stroke()
1685 strokep->age = 1; /* number of interrupts */ in fg_add_stroke()
1686 strokep->x = pspan_x->loc; in fg_add_stroke()
1687 strokep->y = pspan_y->loc; in fg_add_stroke()
1689 strokep->components[X].loc = pspan_x->loc; in fg_add_stroke()
1690 strokep->components[X].cum_pressure = pspan_x->cum; in fg_add_stroke()
1691 strokep->components[X].max_cum_pressure = pspan_x->cum; in fg_add_stroke()
1692 strokep->components[X].matched = true; in fg_add_stroke()
1694 strokep->components[Y].loc = pspan_y->loc; in fg_add_stroke()
1695 strokep->components[Y].cum_pressure = pspan_y->cum; in fg_add_stroke()
1696 strokep->components[Y].max_cum_pressure = pspan_y->cum; in fg_add_stroke()
1697 strokep->components[Y].matched = true; in fg_add_stroke()
1705 strokep->components[X].loc, in fg_add_stroke()
1706 strokep->components[Y].loc, in fg_add_stroke()
1707 (u_int)strokep->ctime.tv_sec, in fg_add_stroke()
1708 (unsigned long int)strokep->ctime.tv_usec); in fg_add_stroke()
1778 atp_stroke_t *strokep; in wsp_add_stroke() local
1780 strokep = atp_alloc_stroke(sc); in wsp_add_stroke()
1781 if (strokep == NULL) in wsp_add_stroke()
1789 strokep->type = ATP_STROKE_TOUCH; in wsp_add_stroke()
1790 strokep->matched = true; in wsp_add_stroke()
1791 microtime(&strokep->ctime); in wsp_add_stroke()
1792 strokep->age = 1; /* number of interrupts */ in wsp_add_stroke()
1793 strokep->x = fingerp->x; in wsp_add_stroke()
1794 strokep->y = fingerp->y; in wsp_add_stroke()
1800 DPRINTFN(ATP_LLEVEL_INFO, "[%d,%d]\n", strokep->x, strokep->y); in wsp_add_stroke()
1804 atp_advance_stroke_state(struct atp_softc *sc, atp_stroke_t *strokep, in atp_advance_stroke_state() argument
1808 if (strokep->flags & ATSF_ZOMBIE) in atp_advance_stroke_state()
1809 strokep->flags &= ~ATSF_ZOMBIE; in atp_advance_stroke_state()
1811 strokep->age++; in atp_advance_stroke_state()
1812 if (strokep->age <= atp_stroke_maturity_threshold) { in atp_advance_stroke_state()
1814 strokep->instantaneous_dx = 0; in atp_advance_stroke_state()
1815 strokep->instantaneous_dy = 0; in atp_advance_stroke_state()
1818 if (atp_compute_stroke_movement(strokep)) in atp_advance_stroke_state()
1821 if (strokep->type != ATP_STROKE_TOUCH) in atp_advance_stroke_state()
1825 if ((abs(strokep->cum_movement_x) > atp_slide_min_movement) || in atp_advance_stroke_state()
1826 (abs(strokep->cum_movement_y) > atp_slide_min_movement)) in atp_advance_stroke_state()
1827 atp_convert_to_slide(sc, strokep); in atp_advance_stroke_state()
1832 if (timevalcmp(&tdiff, &strokep->ctime, >)) { in atp_advance_stroke_state()
1833 timevalsub(&tdiff, &strokep->ctime); in atp_advance_stroke_state()
1838 atp_convert_to_slide(sc, strokep); in atp_advance_stroke_state()
1844 atp_stroke_has_small_movement(const atp_stroke_t *strokep) in atp_stroke_has_small_movement() argument
1846 return (((u_int)abs(strokep->instantaneous_dx) <= in atp_stroke_has_small_movement()
1848 ((u_int)abs(strokep->instantaneous_dy) <= in atp_stroke_has_small_movement()
1858 atp_update_pending_mickeys(atp_stroke_t *strokep) in atp_update_pending_mickeys() argument
1861 strokep->pending_dx += strokep->instantaneous_dx; in atp_update_pending_mickeys()
1862 strokep->pending_dy += strokep->instantaneous_dy; in atp_update_pending_mickeys()
1913 UPDATE_INSTANTANEOUS_AND_PENDING(strokep->instantaneous_dx, in atp_update_pending_mickeys()
1914 strokep->pending_dx); in atp_update_pending_mickeys()
1915 UPDATE_INSTANTANEOUS_AND_PENDING(strokep->instantaneous_dy, in atp_update_pending_mickeys()
1916 strokep->pending_dy); in atp_update_pending_mickeys()
1924 atp_compute_stroke_movement(atp_stroke_t *strokep) in atp_compute_stroke_movement() argument
1932 if (atp_stroke_has_small_movement(strokep)) in atp_compute_stroke_movement()
1933 atp_update_pending_mickeys(strokep); in atp_compute_stroke_movement()
1936 strokep->pending_dx = 0; in atp_compute_stroke_movement()
1937 strokep->pending_dy = 0; in atp_compute_stroke_movement()
1941 strokep->movement_dx = (strokep->instantaneous_dx) / in atp_compute_stroke_movement()
1943 strokep->movement_dy = (strokep->instantaneous_dy) / in atp_compute_stroke_movement()
1946 if ((abs(strokep->instantaneous_dx) >= ATP_FAST_MOVEMENT_TRESHOLD) || in atp_compute_stroke_movement()
1947 (abs(strokep->instantaneous_dy) >= ATP_FAST_MOVEMENT_TRESHOLD)) { in atp_compute_stroke_movement()
1948 strokep->movement_dx <<= 1; in atp_compute_stroke_movement()
1949 strokep->movement_dy <<= 1; in atp_compute_stroke_movement()
1952 strokep->cum_movement_x += strokep->movement_dx; in atp_compute_stroke_movement()
1953 strokep->cum_movement_y += strokep->movement_dy; in atp_compute_stroke_movement()
1955 return ((strokep->movement_dx != 0) || (strokep->movement_dy != 0)); in atp_compute_stroke_movement()
1965 atp_terminate_stroke(struct atp_softc *sc, atp_stroke_t *strokep) in atp_terminate_stroke() argument
1967 if (strokep->flags & ATSF_ZOMBIE) in atp_terminate_stroke()
1971 if (strokep->age <= atp_stroke_maturity_threshold) { in atp_terminate_stroke()
1972 atp_free_stroke(sc, strokep); in atp_terminate_stroke()
1976 strokep->flags |= ATSF_ZOMBIE; in atp_terminate_stroke()
1986 if (strokep->type == ATP_STROKE_SLIDE) in atp_terminate_stroke()
1991 atp_is_horizontal_scroll(const atp_stroke_t *strokep) in atp_is_horizontal_scroll() argument
1993 if (abs(strokep->cum_movement_x) < atp_slide_min_movement) in atp_is_horizontal_scroll()
1995 if (strokep->cum_movement_y == 0) in atp_is_horizontal_scroll()
1997 return (abs(strokep->cum_movement_x / strokep->cum_movement_y) >= 4); in atp_is_horizontal_scroll()
2001 atp_is_vertical_scroll(const atp_stroke_t *strokep) in atp_is_vertical_scroll() argument
2003 if (abs(strokep->cum_movement_y) < atp_slide_min_movement) in atp_is_vertical_scroll()
2005 if (strokep->cum_movement_x == 0) in atp_is_vertical_scroll()
2007 return (abs(strokep->cum_movement_y / strokep->cum_movement_x) >= 4); in atp_is_vertical_scroll()
2018 atp_stroke_t *strokep; in atp_reap_sibling_zombies() local
2023 TAILQ_FOREACH_SAFE(strokep, &sc->sc_stroke_used, entry, strokep_next) { in atp_reap_sibling_zombies()
2024 if ((strokep->flags & ATSF_ZOMBIE) == 0) in atp_reap_sibling_zombies()
2027 if (strokep->type == ATP_STROKE_TOUCH) { in atp_reap_sibling_zombies()
2032 if (atp_is_horizontal_scroll(strokep)) { in atp_reap_sibling_zombies()
2034 horizontal_scroll += strokep->cum_movement_x; in atp_reap_sibling_zombies()
2038 atp_free_stroke(sc, strokep); in atp_reap_sibling_zombies()
2086 atp_convert_to_slide(struct atp_softc *sc, atp_stroke_t *strokep) in atp_convert_to_slide() argument
2088 strokep->type = ATP_STROKE_SLIDE; in atp_convert_to_slide()
2093 timevalcmp(&strokep->ctime, &sc->sc_touch_reap_time, >)) { in atp_convert_to_slide()
2100 delta = strokep->ctime; in atp_convert_to_slide()
2362 atp_stroke_t *strokep; in atp_intr() local
2368 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) { in atp_intr()
2369 if (strokep->flags & ATSF_ZOMBIE) in atp_intr()
2372 dx += strokep->movement_dx; in atp_intr()
2373 dy += strokep->movement_dy; in atp_intr()
2374 if (strokep->movement_dx || in atp_intr()
2375 strokep->movement_dy) in atp_intr()
2388 TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) { in atp_intr()
2389 if (strokep->flags & ATSF_ZOMBIE) in atp_intr()
2392 if (!atp_is_vertical_scroll(strokep)) in atp_intr()