File: touch.h

package info (click to toggle)
grail 3.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 3,292 kB
  • sloc: sh: 11,416; cpp: 5,636; ansic: 1,587; makefile: 254
file content (64 lines) | stat: -rw-r--r-- 1,903 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*****************************************************************************
 *
 * grail - Gesture Recognition And Instantiation Library
 *
 * Copyright (C) 2012 Canonical Ltd.
 *
 * This library is free software: you can redistribute it and/or modify it 
 * under the terms of the GNU Lesser General Public License version 3
 * as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranties of 
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
 * PURPOSE.  See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 ****************************************************************************/

#ifndef GRAIL_TOUCH_H_
#define GRAIL_TOUCH_H_

#include <oif/frame.h>

namespace oif {
namespace grail {

class Touch {
 public:
  Touch(UFTouch touch, UFDevice device, UFWindowId window_id);
  ~Touch();

  void Update(UFTouch touch);
  void Accept();

  UFTouchId id() const { return id_; }
  uint64_t start_time() const { return start_time_; }
  bool accepted() const { return accepted_; }
  bool pending_end() const { return pending_end_; }
  void set_pending_end(bool pending_end) { pending_end_ = pending_end; }
  bool owned() const { return owned_; }
  void set_owned(bool owned) { owned_ = owned; }
  bool ended() const { return ended_; }
  void set_ended(bool ended) { ended_ = ended; }

  Touch(const Touch&) = delete;
  Touch& operator=(const Touch&) = delete;

 private:
  UFTouchId id_;
  uint64_t start_time_;
  UFDevice device_;
  UFWindowId window_id_;
  bool accepted_;
  bool pending_end_;
  bool owned_;
  bool ended_;
};

} // namespace grail
} // namespace oif

#endif // GRAIL_TOUCH_H_