| Flutter iOS Embedder |

FlutterView.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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEW_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEW_H_
7
8 #include <Metal/Metal.h>
9 #import <UIKit/UIKit.h>
10
11 #include <memory>
12
13 #include "flutter/fml/memory/weak_ptr.h"
14 #include "flutter/shell/common/shell.h"
15 #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h"
16 #import "flutter/shell/platform/darwin/ios/ios_context.h"
17 #import "flutter/shell/platform/darwin/ios/ios_surface.h"
18
19 @protocol FlutterViewEngineDelegate <NSObject>
20
21 @property(nonatomic, readonly) BOOL isUsingImpeller;
22
23 - (flutter::Rasterizer::Screenshot)takeScreenshot:(flutter::Rasterizer::ScreenshotType)type
24 asBase64Encoded:(BOOL)base64Encode;
25
26 - (std::shared_ptr<flutter::FlutterPlatformViewsController>&)platformViewsController;
27
28 /**
29 * A callback that is called when iOS queries accessibility information of the Flutter view.
30 *
31 * This is useful to predict the current iOS accessibility status. For example, there is
32 * no API to listen whether voice control is turned on or off. The Flutter engine uses
33 * this callback to enable semantics in order to catch the case that voice control is
34 * on.
35 */
36 - (void)flutterViewAccessibilityDidCall;
37 @end
38
39 @interface FlutterView : UIView
40
41 - (instancetype)init NS_UNAVAILABLE;
42 + (instancetype)new NS_UNAVAILABLE;
43 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
44 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE;
45
46 - (instancetype)initWithDelegate:(id<FlutterViewEngineDelegate>)delegate
47 opaque:(BOOL)opaque
48 enableWideGamut:(BOOL)isWideGamutEnabled NS_DESIGNATED_INITIALIZER;
49
50 - (UIScreen*)screen;
51 - (MTLPixelFormat)pixelFormat;
52
53 // Set by FlutterEngine or FlutterViewController to override software rendering.
54 @property(class, nonatomic) BOOL forceSoftwareRendering;
55 @end
56
57 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEW_H_
FlutterView::forceSoftwareRendering
BOOL forceSoftwareRendering
Definition: FlutterView.h:54
FlutterViewEngineDelegate-p::isUsingImpeller
BOOL isUsingImpeller
Definition: FlutterView.h:21
-[FlutterViewEngineDelegate-p flutterViewAccessibilityDidCall]
void flutterViewAccessibilityDidCall()
FlutterViewEngineDelegate-p
Definition: FlutterView.h:19
initWithFrame
instancetype initWithFrame
Definition: FlutterTextInputPlugin.h:167
-[FlutterView pixelFormat]
MTLPixelFormat pixelFormat()
Definition: FlutterView.mm:47
ios_surface.h
flutter
Definition: accessibility_bridge.h:28
FlutterPlatformViews_Internal.h
initWithCoder
instancetype initWithCoder
Definition: FlutterTextInputPlugin.h:166
NS_UNAVAILABLE
instancetype init NS_UNAVAILABLE
Definition: FlutterTextInputPlugin.h:164
FlutterView
Definition: FlutterView.h:39
ios_context.h
-[FlutterView screen]
UIScreen * screen()
Definition: FlutterView.mm:40