Lines Matching refs:tool

182 	} tool;
789 if (w->tool.distance > 0) {
790 double pos = w->tool.distance * 100;
794 if (w->tool.pressure > 0) {
795 double pos = w->tool.pressure * 100;
796 if (w->tool.is_down)
803 /* tablet tool, square for prox-in location */
806 if (w->tool.x_in && w->tool.y_in) {
807 cairo_rectangle(cr, w->tool.x_in - 15, w->tool.y_in - 15, 30, 30);
811 if (w->tool.x_down && w->tool.y_down) {
812 cairo_rectangle(cr, w->tool.x_down - 10, w->tool.y_down - 10, 20, 20);
816 if (w->tool.x_up && w->tool.y_up) {
817 cairo_rectangle(cr, w->tool.x_up - 10, w->tool.y_up - 10, 20, 20);
821 if (w->tool.pressure)
824 cairo_translate(cr, w->tool.x, w->tool.y);
828 1.0 + w->tool.size_major * 2.5,
829 1.0 + w->tool.size_minor * 2.5);
830 cairo_scale(cr, 1.0 + w->tool.tilt_x/30.0, 1.0 + w->tool.tilt_y/30.0);
831 if (w->tool.rotation)
832 cairo_rotate(cr, w->tool.rotation * M_PI/180.0);
833 if (w->tool.pressure)
836 1 + 10 * max(w->tool.pressure, w->tool.distance),
842 if (w->tool.size_major) {
845 cairo_translate(cr, w->tool.x, w->tool.y);
846 if (w->tool.rotation)
847 cairo_rotate(cr, w->tool.rotation * M_PI/180.0);
850 cairo_rel_line_to(cr, 0, -w->tool.size_major * 2.5);
856 mask = ARRAY_LENGTH(w->tool.deltas);
857 first = max(w->tool.ndeltas + 1, mask) - mask;
858 last = w->tool.ndeltas;
863 x = w->tool.deltas[first % mask].x;
864 y = w->tool.deltas[first % mask].y;
868 x = w->tool.deltas[i % mask].x;
869 y = w->tool.deltas[i % mask].y;
1136 gtk_window_set_title(GTK_WINDOW(w->win), "libinput debugging tool");
1643 const int mask = ARRAY_LENGTH(w->tool.deltas);
1654 w->tool.x_in = 0;
1655 w->tool.y_in = 0;
1656 w->tool.x_down = 0;
1657 w->tool.y_down = 0;
1658 w->tool.x_up = 0;
1659 w->tool.y_up = 0;
1661 w->tool.x_in = x;
1662 w->tool.y_in = y;
1663 w->tool.ndeltas = 0;
1664 w->tool.deltas[0].x = w->width/2;
1665 w->tool.deltas[0].y = w->height/2;
1669 w->tool.pressure = libinput_event_tablet_tool_get_pressure(t);
1670 w->tool.distance = libinput_event_tablet_tool_get_distance(t);
1671 w->tool.tilt_x = libinput_event_tablet_tool_get_tilt_x(t);
1672 w->tool.tilt_y = libinput_event_tablet_tool_get_tilt_y(t);
1675 w->tool.x_down = x;
1676 w->tool.y_down = y;
1677 w->tool.is_down = true;
1679 w->tool.x_up = x;
1680 w->tool.y_up = y;
1681 w->tool.is_down = false;
1685 w->tool.x = x;
1686 w->tool.y = y;
1687 w->tool.pressure = libinput_event_tablet_tool_get_pressure(t);
1688 w->tool.distance = libinput_event_tablet_tool_get_distance(t);
1689 w->tool.tilt_x = libinput_event_tablet_tool_get_tilt_x(t);
1690 w->tool.tilt_y = libinput_event_tablet_tool_get_tilt_y(t);
1691 w->tool.rotation = libinput_event_tablet_tool_get_rotation(t);
1692 w->tool.size_major = libinput_event_tablet_tool_get_size_major(t);
1693 w->tool.size_minor = libinput_event_tablet_tool_get_size_minor(t);
1697 idx = w->tool.ndeltas % mask;
1698 point = w->tool.deltas[idx];
1700 idx = (w->tool.ndeltas + 1) % mask;
1703 w->tool.deltas[idx] = point;
1704 w->tool.ndeltas++;