Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 0e416b6

Browse files
committed
Move PointerState def
1 parent 2ca46e5 commit 0e416b6

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

shell/platform/linux/fl_engine.cc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,34 @@ static constexpr size_t kPlatformTaskRunnerIdentifier = 1;
3232
static constexpr int32_t kMousePointerDeviceId = 0;
3333
static constexpr int32_t kPointerPanZoomDeviceId = 1;
3434

35+
// Struct holding the state of an individual pointer. The engine doesn't keep
36+
// track of which buttons have been pressed, so it's the embedding's
37+
// responsibility.
38+
struct PointerState {
39+
// The device kind.
40+
FlutterPointerDeviceKind device_kind = kFlutterPointerDeviceKindMouse;
41+
42+
// A virtual pointer ID that is unique across all device kinds.
43+
int32_t pointer_id = 0;
44+
45+
// True if the last event sent to Flutter had at least one button pressed.
46+
bool flutter_state_is_down = false;
47+
48+
// True if kAdd has been sent to Flutter. Used to determine whether
49+
// to send a kAdd event before sending an incoming pointer event, since
50+
// Flutter expects pointers to be added before events are sent for them.
51+
bool flutter_state_is_added = false;
52+
53+
// The currently pressed buttons, as represented in FlutterPointerEvent.
54+
uint64_t buttons = 0;
55+
56+
// The x position where the last pan/zoom started.
57+
double pan_zoom_start_x = 0;
58+
59+
// The y position where the last pan/zoom started.
60+
double pan_zoom_start_y = 0;
61+
};
62+
3563
struct _FlEngine {
3664
GObject parent_instance;
3765

shell/platform/linux/fl_engine_private.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,6 @@ typedef enum {
2626
// NOLINTEND(readability-identifier-naming)
2727
} FlEngineError;
2828

29-
// Struct holding the state of an individual pointer. The engine doesn't keep
30-
// track of which buttons have been pressed, so it's the embedding's
31-
// responsibility.
32-
struct PointerState {
33-
// The device kind.
34-
FlutterPointerDeviceKind device_kind = kFlutterPointerDeviceKindMouse;
35-
36-
// A virtual pointer ID that is unique across all device kinds.
37-
int32_t pointer_id = 0;
38-
39-
// True if the last event sent to Flutter had at least one button pressed.
40-
bool flutter_state_is_down = false;
41-
42-
// True if kAdd has been sent to Flutter. Used to determine whether
43-
// to send a kAdd event before sending an incoming pointer event, since
44-
// Flutter expects pointers to be added before events are sent for them.
45-
bool flutter_state_is_added = false;
46-
47-
// The currently pressed buttons, as represented in FlutterPointerEvent.
48-
uint64_t buttons = 0;
49-
50-
// The x position where the last pan/zoom started.
51-
double pan_zoom_start_x = 0;
52-
53-
// The y position where the last pan/zoom started.
54-
double pan_zoom_start_y = 0;
55-
};
56-
5729
GQuark fl_engine_error_quark(void) G_GNUC_CONST;
5830

5931
/**

0 commit comments

Comments
 (0)