Flutter Engine
pointer_data.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_LIB_UI_WINDOW_POINTER_DATA_H_
6 #define FLUTTER_LIB_UI_WINDOW_POINTER_DATA_H_
7 
8 #include <cstdint>
9 
10 namespace flutter {
11 
12 // If this value changes, update the pointer data unpacking code in hooks.dart.
13 static constexpr int kPointerDataFieldCount = 29;
14 static constexpr int kBytesPerField = sizeof(int64_t);
15 // Must match the button constants in events.dart.
16 enum PointerButtonMouse : int64_t {
22 };
23 
24 enum PointerButtonTouch : int64_t {
26 };
27 
28 enum PointerButtonStylus : int64_t {
32 };
33 
34 // This structure is unpacked by hooks.dart.
35 struct alignas(8) PointerData {
36  // Must match the PointerChange enum in pointer.dart.
37  enum class Change : int64_t {
38  kCancel,
39  kAdd,
40  kRemove,
41  kHover,
42  kDown,
43  kMove,
44  kUp,
45  };
46 
47  // Must match the PointerDeviceKind enum in pointer.dart.
48  enum class DeviceKind : int64_t {
49  kTouch,
50  kMouse,
51  kStylus,
52  kInvertedStylus,
53  };
54 
55  // Must match the PointerSignalKind enum in pointer.dart.
56  enum class SignalKind : int64_t {
57  kNone,
58  kScroll,
59  };
60 
61  int64_t embedder_id;
62  int64_t time_stamp;
66  int64_t device;
68  double physical_x;
69  double physical_y;
72  int64_t buttons;
73  int64_t obscured;
74  int64_t synthesized;
75  double pressure;
76  double pressure_min;
77  double pressure_max;
78  double distance;
79  double distance_max;
80  double size;
81  double radius_major;
82  double radius_minor;
83  double radius_min;
84  double radius_max;
85  double orientation;
86  double tilt;
87  int64_t platformData;
90 
91  void Clear();
92 };
93 
94 } // namespace flutter
95 
96 #endif // FLUTTER_LIB_UI_WINDOW_POINTER_DATA_H_
static constexpr int kBytesPerField
Definition: pointer_data.h:14
static constexpr int kPointerDataFieldCount
Definition: pointer_data.h:13
SignalKind signal_kind
Definition: pointer_data.h:65
int64_t pointer_identifier
Definition: pointer_data.h:67
PointerButtonStylus
Definition: pointer_data.h:28
PointerButtonTouch
Definition: pointer_data.h:24
PointerButtonMouse
Definition: pointer_data.h:16