• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_
6 #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_
7 
8 #include <UIKit/UIKit.h>
9 
10 #include <memory>
11 
12 #import "FlutterPlatformViews_Internal.h"
13 
14 #include "flutter/fml/memory/weak_ptr.h"
15 #include "flutter/shell/common/shell.h"
16 #include "flutter/shell/platform/darwin/ios/ios_surface.h"
17 
18 @protocol FlutterViewEngineDelegate <NSObject>
19 
20 - (flutter::Rasterizer::Screenshot)takeScreenshot:(flutter::Rasterizer::ScreenshotType)type
21                                   asBase64Encoded:(BOOL)base64Encode;
22 
23 - (flutter::FlutterPlatformViewsController*)platformViewsController;
24 
25 @end
26 
27 @interface FlutterView : UIView
28 
29 - (instancetype)init NS_UNAVAILABLE;
30 + (instancetype)new NS_UNAVAILABLE;
31 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
32 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE;
33 
34 - (instancetype)initWithDelegate:(id<FlutterViewEngineDelegate>)delegate
35                           opaque:(BOOL)opaque NS_DESIGNATED_INITIALIZER;
36 - (std::unique_ptr<flutter::IOSSurface>)createSurface:
37     (std::shared_ptr<flutter::IOSGLContext>)context;
38 
39 @end
40 
41 #endif  // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_
42