xbmc
LibInputTouch.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "input/touch/generic/GenericTouchInputHandler.h"
12 #include "utils/Geometry.h"
13 
14 #include <vector>
15 
16 #include <libinput.h>
17 
18 struct libinput_event_touch;
19 struct libinput_device;
20 
22 {
23 public:
25  void ProcessTouchDown(libinput_event_touch *e);
26  void ProcessTouchMotion(libinput_event_touch *e);
27  void ProcessTouchUp(libinput_event_touch *e);
28  void ProcessTouchCancel(libinput_event_touch *e);
29  void ProcessTouchFrame(libinput_event_touch *e);
30 
31 private:
32  void CheckSlot(int slot);
33  TouchInput GetEvent(int slot);
34  void SetEvent(int slot, TouchInput event);
35  void SetPosition(int slot, CPoint point);
36  int GetX(int slot) { return m_points.at(slot).second.x; }
37  int GetY(int slot) { return m_points.at(slot).second.y; }
38 
39  std::vector<std::pair<TouchInput, CPoint>> m_points{std::make_pair(TouchInputUnchanged, CPoint(0, 0))};
40 };
Definition: LibInputTouch.h:21
TouchInput
Touch input event.
Definition: ITouchInputHandler.h:20