Flutter Engine
The Flutter Engine
Instance Methods | List of all members
FlutterCursorCoordinator Class Reference

#import <FlutterMutatorView.h>

Inheritance diagram for FlutterCursorCoordinator:

Instance Methods

(nonnull FlutterCursorCoordinator *) - initWithFlutterView:
 
(FlutterCursorCoordinator *) - initWithFlutterView: [implementation]
 
(void) - frameCleanup [implementation]
 
(BOOL- cleanupScheduled [implementation]
 
(void) - processMouseMoveEvent:forMutatorView:overlayRegion: [implementation]
 

Detailed Description

FlutterCursorCoordinator is responsible for coordinating cursor changes between platform views and overlays of single FlutterView.

Definition at line 45 of file FlutterMutatorView.h.

Method Documentation

◆ cleanupScheduled

- (BOOL) cleanupScheduled
implementation

Provided by category FlutterCursorCoordinator(Private).

Definition at line 36 of file FlutterMutatorView.mm.

51 {
52 return _cleanupScheduled;
53}
BOOL _cleanupScheduled

◆ frameCleanup

- (void) frameCleanup
implementation

Definition at line 36 of file FlutterMutatorView.mm.

46 {
49}
BOOL _mouseMoveHandled

◆ initWithFlutterView: [1/2]

- (FlutterCursorCoordinator *) initWithFlutterView: (FlutterView*)  flutterView
implementation

Definition at line 36 of file FlutterMutatorView.mm.

39 :(FlutterView*)flutterView {
40 if (self = [super init]) {
41 _flutterView = flutterView;
42 }
43 return self;
44}
fml::scoped_nsobject< FlutterView > _flutterView
static bool init()

◆ initWithFlutterView: [2/2]

- (nonnull FlutterCursorCoordinator *) initWithFlutterView: (nonnull FlutterView *)  flutterView

◆ processMouseMoveEvent:forMutatorView:overlayRegion:

- (void) processMouseMoveEvent: (NSEvent*)  event
forMutatorView: (FlutterMutatorView*)  view
overlayRegion: (const std::vector<CGRect>&)  region 
implementation

Provided by category FlutterCursorCoordinator(Private).

Definition at line 36 of file FlutterMutatorView.mm.

57 :(NSEvent*)event
58 forMutatorView:(FlutterMutatorView*)view
59 overlayRegion:(const std::vector<CGRect>&)region {
60 // [self frameCleanup] will be called once after current run loop turn.
61 if (!_cleanupScheduled) {
62 [[NSRunLoop mainRunLoop] performBlock:^{
63 [self frameCleanup];
64 }];
66 }
67
68 // Mouse move was already handled by a mutator view above.
70 return;
71 }
72
73 NSPoint point = [view convertPoint:event.locationInWindow fromView:nil];
74
75 // If the mouse is above overlay region restore current Flutter cursor.
76 for (const auto& r : region) {
77 if (CGRectContainsPoint(r, point)) {
78 [_flutterView cursorUpdate:event];
80 return;
81 }
82 }
83 NSView* platformView = view.platformView;
84 // It is possible that Flutter changed mouse cursor while the mouse was inside
85 // cursor rect. Unfocused NSTextField uses legacy cursor rects for changing
86 // its cursor.
87 [platformView.window invalidateCursorRectsForView:platformView];
89}
FlKeyEvent * event
NSView * platformView
Returns wrapped platform view.
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238

The documentation for this class was generated from the following files: