Flutter Engine
The 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
10namespace flutter {
11
12// Must match the button constants in events.dart.
13enum PointerButtonMouse : int64_t {
19};
20
21enum PointerButtonTouch : int64_t {
23};
24
25enum PointerButtonStylus : int64_t {
29};
30
31// This structure is unpacked by platform_dispatcher.dart.
32//
33// If this struct changes, update:
34// * kPointerDataFieldCount in pointer_data.cc. (The pointer_data.cc also
35// lists out other locations that must be kept consistent.)
36// * The functions to create simulated data in
37// pointer_data_packet_converter_unittests.cc.
38struct alignas(8) PointerData {
39 // Must match the PointerChange enum in pointer.dart.
40 enum class Change : int64_t {
41 kCancel,
42 kAdd,
43 kRemove,
44 kHover,
45 kDown,
46 kMove,
47 kUp,
51 };
52
53 // Must match the PointerDeviceKind enum in pointer.dart.
54 enum class DeviceKind : int64_t {
55 kTouch,
56 kMouse,
57 kStylus,
58 kInvertedStylus,
59 kTrackpad,
60 };
61
62 // Must match the PointerSignalKind enum in pointer.dart.
63 enum class SignalKind : int64_t {
64 kNone,
65 kScroll,
66 kScrollInertiaCancel,
67 kScale,
68 };
69
70 int64_t embedder_id;
71 int64_t time_stamp;
75 int64_t device;
77 double physical_x;
78 double physical_y;
81 int64_t buttons;
82 int64_t obscured;
83 int64_t synthesized;
84 double pressure;
87 double distance;
89 double size;
92 double radius_min;
93 double radius_max;
95 double tilt;
96 int64_t platformData;
99 double pan_x;
100 double pan_y;
103 double scale;
104 double rotation;
105 int64_t view_id;
106
107 void Clear();
108};
109
110} // namespace flutter
111
112#endif // FLUTTER_LIB_UI_WINDOW_POINTER_DATA_H_
@ kPanZoomUpdate
The pan/zoom updated.
Definition: embedder.h:1001
@ kHover
The pointer moved while up.
Definition: embedder.h:997
@ kUp
Definition: embedder.h:973
@ kPanZoomStart
A pan/zoom started on this pointer.
Definition: embedder.h:999
@ kRemove
Definition: embedder.h:995
@ kCancel
Definition: embedder.h:966
@ kDown
Definition: embedder.h:980
@ kAdd
Definition: embedder.h:990
@ kMove
Definition: embedder.h:985
@ kPanZoomEnd
The pan/zoom ended.
Definition: embedder.h:1003
@ kNone
Definition: layer.h:53
PointerButtonMouse
Definition: pointer_data.h:13
@ kPointerButtonMouseBack
Definition: pointer_data.h:17
@ kPointerButtonMouseForward
Definition: pointer_data.h:18
@ kPointerButtonMouseSecondary
Definition: pointer_data.h:15
@ kPointerButtonMouseMiddle
Definition: pointer_data.h:16
@ kPointerButtonMousePrimary
Definition: pointer_data.h:14
PointerButtonTouch
Definition: pointer_data.h:21
@ kPointerButtonTouchContact
Definition: pointer_data.h:22
PointerButtonStylus
Definition: pointer_data.h:25
@ kPointerButtonStylusSecondary
Definition: pointer_data.h:28
@ kPointerButtonStylusPrimary
Definition: pointer_data.h:27
@ kPointerButtonStylusContact
Definition: pointer_data.h:26
SignalKind signal_kind
Definition: pointer_data.h:74
int64_t pointer_identifier
Definition: pointer_data.h:76