forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[macos] Wireup platform views on macOS
* The plan is to only support platform views when using Metal rendering backend. * This PR is based on the work done in: flutter#22905 * There are some threading issues to be addressed still to make this feature usable.
- Loading branch information
1 parent
1fab2fb
commit 2add237
Showing
15 changed files
with
504 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
shell/platform/darwin/macos/framework/Headers/FlutterPlatformViews.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_FLUTTERPLATFORMVIEWS_H_ | ||
#define FLUTTER_FLUTTERPLATFORMVIEWS_H_ | ||
|
||
#import <AppKit/AppKit.h> | ||
|
||
#import "FlutterCodecs.h" | ||
#import "FlutterMacros.h" | ||
|
||
@protocol FlutterPlatformViewFactory <NSObject> | ||
|
||
/** | ||
* Create a Platform View which is an `NSView`. | ||
* | ||
* Implemented by MacOS plugin code to return an `NSView` to be inserted into the Flutter view | ||
* hierarchy. | ||
* | ||
* The implementation of this method should create a new `NSView` and return it. | ||
* | ||
* @param frame The rectangle for the newly created view measured in points. | ||
* @param viewId A unique identifier for this view. | ||
* @param args Parameters for creating the view sent from the Dart side of the | ||
* Flutter app. If `createArgsCodec` is not implemented, or if no creation arguments were sent from | ||
* the Dart code, this will be null. Otherwise this will be the value sent from the Dart code as | ||
* decoded by `createArgsCodec`. | ||
*/ | ||
- (nonnull NSView*)createWithFrame:(CGRect)frame | ||
viewIdentifier:(int64_t)viewId | ||
arguments:(nullable id)args; | ||
|
||
/** | ||
* Returns the `FlutterMessageCodec` for decoding the args parameter of `createWithFrame`. | ||
* | ||
* Only needs to be implemented if `createWithFrame` needs an arguments parameter. | ||
*/ | ||
@optional | ||
- (nullable NSObject<FlutterMessageCodec>*)createArgsCodec; | ||
@end | ||
|
||
#endif // FLUTTER_FLUTTERPLATFORMVIEWS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.