Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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.
20
21enum PointerButtonTouch : int64_t {
23};
24
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,
60 };
61
62 // Must match the PointerSignalKind enum in pointer.dart.
63 enum class SignalKind : int64_t {
64 kNone,
65 kScroll,
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_
@ kPointerButtonMouseBack
@ kPointerButtonMouseForward
@ kPointerButtonMouseSecondary
@ kPointerButtonMouseMiddle
@ kPointerButtonMousePrimary
@ kPointerButtonTouchContact
PointerButtonStylus
@ kPointerButtonStylusSecondary
@ kPointerButtonStylusPrimary
@ kPointerButtonStylusContact