Flutter Engine
 
Loading...
Searching...
No Matches
FlutterView Class Reference

#include <FlutterView.h>

Inheritance diagram for FlutterView:
TestFlutterView

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(instancetype) - initWithFrame:
 
(instancetype) - initWithCoder:
 
(instancetype) - initWithDelegate:opaque:enableWideGamut:
 
(UIScreen *) - screen
 
(MTLPixelFormat) - pixelFormat
 
(nullable instancetype) - initWithMTLDevice:commandQueue:delegate:viewIdentifier:
 
(nullable instancetype) - initWithFrame:pixelFormat:
 
(nonnull instancetype) - initWithFrame:
 
(nullable instancetype) - initWithCoder:
 
(nonnull instancetype) - NS_UNAVAILABLE
 
(void) - setBackgroundColor:
 
(void) - didUpdateMouseCursor:
 
(void) - shutDown
 

Class Methods

(instancetype) + NS_UNAVAILABLE
 

Properties

FlutterSurfaceManagersurfaceManager
 

Detailed Description

View capable of acting as a rendering target and input source for the Flutter engine.

Definition at line 32 of file FlutterView.h.

Method Documentation

◆ didUpdateMouseCursor:

- (void) didUpdateMouseCursor: (nonnull NSCursor *)  cursor

Called from the engine to notify the view that mouse cursor was updated while the mouse is over the view. The view is responsible from restoring the cursor when the mouse enters the view from another subview.

Referenced by TEST(), and TEST().

◆ initWithCoder: [1/2]

- (nullable instancetype) initWithCoder: (nonnull NSCoder *)  NS_UNAVAILABLE

◆ initWithCoder: [2/2]

- (instancetype) initWithCoder: (NSCoder*)  NS_UNAVAILABLE

Definition at line 16 of file FlutterView.mm.

33 :(NSCoder*)aDecoder {
34 NSAssert(NO, @"FlutterView must initWithDelegate");
35 return nil;
36}

◆ initWithDelegate:opaque:enableWideGamut:

- (instancetype) initWithDelegate: (id<FlutterViewEngineDelegate>)  delegate
opaque: (BOOL opaque
enableWideGamut: (BOOL NS_DESIGNATED_INITIALIZER 

Definition at line 16 of file FlutterView.mm.

68 :(id<FlutterViewEngineDelegate>)delegate
69 opaque:(BOOL)opaque
70 enableWideGamut:(BOOL)isWideGamutEnabled {
71 if (delegate == nil) {
72 NSLog(@"FlutterView delegate was nil.");
73 return nil;
74 }
75
76 self = [super initWithFrame:CGRectNull];
77
78 if (self) {
79 _delegate = delegate;
80 _isWideGamutEnabled = isWideGamutEnabled;
81 self.layer.opaque = opaque;
82 }
83
84 return self;
85}
if(end==-1)
int BOOL

◆ initWithFrame: [1/2]

- (instancetype) initWithFrame: (CGRect)  NS_UNAVAILABLE

Definition at line 16 of file FlutterView.mm.

28 :(CGRect)frame {
29 NSAssert(NO, @"FlutterView must initWithDelegate");
30 return nil;
31}

◆ initWithFrame: [2/2]

- (nonnull instancetype) initWithFrame: (NSRect)  NS_UNAVAILABLE

◆ initWithFrame:pixelFormat:

- (nullable instancetype) initWithFrame: (NSRect)  frameRect
pixelFormat: (nullable NSOpenGLPixelFormat *)  NS_UNAVAILABLE 

◆ initWithMTLDevice:commandQueue:delegate:viewIdentifier:

- (nullable instancetype) initWithMTLDevice: (nonnull id< MTLDevice >)  device
commandQueue: (nonnull id< MTLCommandQueue >)  commandQueue
delegate: (nonnull id< FlutterViewDelegate >)  delegate
viewIdentifier: (FlutterViewIdentifier NS_DESIGNATED_INITIALIZER 

Initialize a FlutterView that will be rendered to using Metal rendering apis.

◆ NS_UNAVAILABLE [1/3]

- (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/3]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [3/3]

- (nonnull instancetype) NS_UNAVAILABLE

◆ pixelFormat

- (MTLPixelFormat) pixelFormat

Definition at line 16 of file FlutterView.mm.

42 {
43 if ([self.layer isKindOfClass:[CAMetalLayer class]]) {
44// It is a known Apple bug that CAMetalLayer incorrectly reports its supported
45// SDKs. It is, in fact, available since iOS 8.
46#pragma clang diagnostic push
47#pragma clang diagnostic ignored "-Wunguarded-availability-new"
48 CAMetalLayer* layer = (CAMetalLayer*)self.layer;
49 return layer.pixelFormat;
50 }
51 return MTLPixelFormatBGRA8Unorm;
52}

◆ screen

- (UIScreen *) screen

Definition at line 16 of file FlutterView.mm.

38 {
39 return self.window.windowScene.screen;
40}

◆ setBackgroundColor:

- (void) setBackgroundColor: (nonnull NSColor *)  color

By default, the FlutterSurfaceManager creates two layers to manage Flutter content, the content layer and containing layer. To set the native background color, onto which the Flutter content is drawn, call this method with the NSColor which you would like to override the default, black background color with.

◆ shutDown

- (void) shutDown

Called from the controller to unblock resize synchronizer when shutting down.

Definition at line 18 of file FlutterView.mm.

53 {
54 [_resizeSynchronizer shutDown];
55}

Property Documentation

◆ surfaceManager

- (FlutterSurfaceManager *) surfaceManager
readnonatomicassign

Returns SurfaceManager for this view. SurfaceManager is responsible for providing and presenting render surfaces.

Definition at line 56 of file FlutterView.h.


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