Flutter Engine
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 #import <Cocoa/Cocoa.h>
6 
7 /**
8  * Listener for view resizing.
9  */
10 @protocol FlutterViewReshapeListener <NSObject>
11 /**
12  * Called when the view's backing store changes size.
13  */
14 - (void)viewDidReshape:(nonnull NSView*)view;
15 @end
16 
17 /**
18  * View capable of acting as a rendering target and input source for the Flutter
19  * engine.
20  */
21 @interface FlutterView : NSView
22 
23 @property(readwrite, nonatomic, nonnull) NSOpenGLContext* openGLContext;
24 @property(readwrite, nonatomic) BOOL synchronousResizing;
25 
26 - (nullable instancetype)initWithFrame:(NSRect)frame
27  shareContext:(nonnull NSOpenGLContext*)shareContext
28  reshapeListener:(nonnull id<FlutterViewReshapeListener>)reshapeListener
29  NS_DESIGNATED_INITIALIZER;
30 
31 - (nullable instancetype)initWithShareContext:(nonnull NSOpenGLContext*)shareContext
32  reshapeListener:
33  (nonnull id<FlutterViewReshapeListener>)reshapeListener;
34 
35 - (nullable instancetype)initWithFrame:(NSRect)frameRect
36  pixelFormat:(nullable NSOpenGLPixelFormat*)format NS_UNAVAILABLE;
37 - (nonnull instancetype)initWithFrame:(NSRect)frameRect NS_UNAVAILABLE;
38 - (nullable instancetype)initWithCoder:(nonnull NSCoder*)coder NS_UNAVAILABLE;
39 - (nonnull instancetype)init NS_UNAVAILABLE;
40 
41 - (void)present;
42 - (int)getFrameBufferIdForSize:(CGSize)size;
43 
44 @end
NSOpenGLContext * openGLContext
Definition: FlutterView.h:23
void present()
Definition: FlutterView.mm:69
BOOL synchronousResizing
Definition: FlutterView.h:24
instancetype NS_UNAVAILABLE()