29 Commits

Author SHA1 Message Date
stuartmorgan
5f03c7e35d
Use of App.framework in macOS FlutterDartProject (#11380)
Adds initial use of App.framework in the macOS project configuration,
using that rather than the main bundle as the default Dart bundle, and
expecting flutter_resources to be located there.

This is an incremental step toward aligning with the behvaior of the iOS
version of this class.

Fixes https://github.com/flutter/flutter/issues/38363
2019-08-22 10:40:18 -07:00
stuartmorgan
c3e9c14586
Rename macOS FLE* classes to Flutter* (#11010)
Renames all FLE* classes in the macOS embedding to Flutter*. With the exception
of -[FlutterDartProject engineSwitches], which is very clearly called out in the
comment, the APIs should be stable at this point, so the marker prefix is no
longer needed.

This is a breaking change for macOS embedders, but going forward breaking
changes at the source level for the macOS API should now be rare.

Some of these classes will likely merge with the iOS versions in the future (e.g.,
FlutterDartProject), but that will be an implementation detail that will not affect
clients.

Fixes flutter/flutter#31735
2019-08-14 15:53:17 -07:00
Francisco Magdaleno
cfa6c7c72b
[macos] Reland function refactor (#10189)
* [macos] Reland function refactor

* Fix bug
2019-07-31 10:57:02 -07:00
Francisco Magdaleno
330b0f023c
Revert "[macos] Revert check on FlutterCodecs and refactor message function] (#10009)" (#10141)
This reverts commit bd3870219a1a7f6e18c94430ead9e0f8375b03b1.
2019-07-25 13:47:29 -07:00
Francisco Magdaleno
bd3870219a
[macos] Revert check on FlutterCodecs and refactor message function] (#10009)
* [macos] Revert check on FlutterCodecs and refactor message function]

* Remove duplicated code

* Move FlutterPlatformMessage initialization
2019-07-23 15:22:38 -07:00
stuartmorgan
7d320c45ab
Add a macro for prefixing embedder.h symbols (#9851)
embedder.h is a C API, so has no namespace, and only uses 'Flutter' as a
prefix for most symbol names. This creates potential collisions with
other code; for instance, FlutterEngine is the name of a type in
embedder.h, but also an ObjC class in the iOS Flutter API.

This adds a macro that can be set to prefix symbol names, allowing
clients (notably, the macOS embedding) to adjust the names used by the
embedding API internally without breaking ABI or API compatibility for
the standard engine build.

Currently the macro is only applied to FlutterEngine, since that's the
symbol that is currently at issue, but it can be expanded to other
symbols in the future.
2019-07-23 05:48:48 -07:00
Francisco Magdaleno
6f3a2eb131
[macos] Add reply to binary messenger (#9953)
* Add reply to binary messenger

* Address comments

* Formatting

* Address comments
2019-07-22 11:08:08 -07:00
Francisco Magdaleno
cd321ee293
Assign missing headless execution variable (#9855) 2019-07-17 08:46:01 -07:00
stuartmorgan
49445ce494
FLEViewController/Engine API changes (#9750)
Updates the way FLEViewController and FLEEngine interact,
making their APIs much more closely aligned with the iOS versions
of the classes.

As part of the change, removes the need for an explicit launch
call on FLEViewController. Also adds entrypoint support when
running an engine directly, matching iOS.

Breaking change for macOS runners.

Part of https://github.com/flutter/flutter/issues/31735
2019-07-10 19:54:41 -07:00
stuartmorgan
bc57291ff4
Make FLEViewController's view an internal detail (#9741)
Rather than clients needing to create an appropriate view in a XIB and
attach it to an FLEViewController, which is error-prone, have
FLEViewController create its own view programatically. The view is now
an internal detail, so calling setView: on an FLEViewController will no
longer work.

As a result of the view being internal, the public API surface is
simplified.

This is a breaking change for macOS Runners.
2019-07-10 13:45:53 -07:00
stuartmorgan
e695a516f1
Add FLEDartProject for macOS embedding (#9672)
Adds an initial version of FLEDartProject, which contains the
configuration for running the engine. In the future this will align with
FlutterDartProject, and likely share a significant portion of the
implementation.

This is a breaking change for macOS runners.
2019-07-08 09:18:54 -07:00
stuartmorgan
8dac2e9796
Begin separating macOS engine from view controller (#9654)
Creates an initial, minimal FLEEngine that parallels the iOS
FlutterEngine, and moves engine launch, plugin registration, and binary
messenger functionality from FLEViewController to there. Uses the FLE
prefix since the current APIs will change to better match FlutterEngine;
the current APIs are intended to minimize conceptual changes relative to
the current FLEViewController APIs since it's already a substantial
change.

Further changes will move channels from FLEViewController to FLEEngine,
and further align the APIs and functionality with the iOS version.

Part of #32421
2019-07-03 13:45:30 -07:00
gaaclarke
50a8e73615
Has a binary messenger (#9419)
Made the engine and the view controllers have BinaryMessengers, not be
BinaryMessengers.  This allows us to break retain cycles and makes the
leaking channels we have not less dire.
2019-06-27 17:25:32 -07:00
stuartmorgan
e00ac47f49
Reorganize darwin for shared ios/macOS (#9255)
When the macOS framework was initially landed, it included some iOS code
using a localized hack. This reorganizes the code structure to clearly
indicate which files are shared between iOS and macOS, vs. those that
are platform-specific.
2019-06-17 11:24:41 -07:00
Francisco Magdaleno
96a592b6e9
[macos] Adds clipboard string read/write support to macOS (#9313) 2019-06-13 15:15:20 -07:00
stuartmorgan
2404cdc901
Rename macOS FLEPlugin* to FlutterPlugin* (#9074)
As another step toward aligning the macOS plugin API with the iOS plugin
API, and with its final form, rename the plugin-related classes from
FLEPlugin* to FlutterPlugin*. This makes the names of the clasess the
same between iOS and macOS. Eventually they should actually merge, with
annotations/ifdefs for platform differences, but for now since the macOS
version uses the same method names and is simply a subset of the iOS
APIs (with one to-be-stabilized method that is macOS-specific) doing the
merge later won't be a breaking change.

Doing this now allows for building out plugin tooling and plugin
implementations on macOS without creating a growing body of code that
will experience a breaking change later.

See:
https://github.com/flutter/flutter/issues/31735
https://github.com/flutter/flutter/issues/32718
2019-05-25 20:45:00 -04:00
Chris Bracken
0f1ff3bdb3
Correct typos, adopt US spellings (#9081)
Corects a bnuch of typeos throughout teh engien codebsae. Also makes
a couple minor Commonwealth -> US spelling adjustments for consistency
with the rest of Flutter's codebase.

Made use of `misspell` tool:
https://github.com/client9/misspell
2019-05-25 13:14:46 -07:00
stuartmorgan
9d2d58a3c7
Add mouse button support to the macOS shell (#9054)
Uses the new embedding API support for device type and buttons to pass
appropriate mouse button events, allowing for right click, middle click,
etc.

Also fixes some edge cases where macOS event delivery violated Flutter
requirements by tracking more data about the mouse event stream and
adjusting the sent events as necessary.
2019-05-22 17:51:17 -04:00
stuartmorgan
e1599ccd3f
Fix horizontal scroll direction for macOS (#9022)
macOS uses negative values to represent scrolls to the right, while
Flutter expects the opposite, so flip X deltas.
2019-05-20 17:01:29 -04:00
stuartmorgan
dbf083bda1
Macos systemnavigator pop (#9019)
Adds the flutter/platform channel to the macOS shell, and implements
SystemNavigator.pop.

Other methods from this channel will be implement in the future.

macOS part of flutter/flutter#30713
2019-05-20 16:15:58 -04:00
stuartmorgan
b6981a38b9
Enable hover by default for desktop shells (#8991)
Fixes flutter/flutter#32835
2019-05-16 20:12:03 -04:00
Jonah Williams
1bcbaf73a7
Add flutter settings channel and window brightness to macOS shell (#8810) 2019-05-02 20:42:51 -07:00
stuartmorgan
523a9a9add
Add FLEPluginRegistry for macOS (#8611)
Creates a minimal FLEPluginRegistry protocol, which is a subset of the
FlutterPluginRegistry.

This is a small step toward eventually merging the APIs, but allows
changing the example project structure to better reflect what a future
template will look like.
2019-04-17 10:53:59 -07:00
Chris Bracken
7c7df0d58b
Add null check in FLETextInputPlugin (#8538)
Adds a guard on `_activeClientID` in `insertNewline:`. The conditional
around the `insertText:replacementRange:` call already catches this, but
we then unconditionally pack `_activeClientID` into an `NSArray`, which
disallows nil.
2019-04-12 21:10:23 -07:00
Chris Bracken
4efc32163c
Add super call in FLEView reshape (#8335)
NSOpenGLView reshape is annotated with NS_REQUIRES_SUPER. This avoids
build failures when building with `-Wobjc-missing-super-calls`.
2019-03-27 16:22:12 -07:00
Francisco Magdaleno
fa1931f6a0
Send macOS keyboard data to the engine (#8219) 2019-03-19 15:58:11 -07:00
stuartmorgan
471a2c89a6
Send scroll events from the macOS shell (#8056)
Adds scroll event handling to the macOS shell, sending them using the
new embedding API.

Currently, trackpad scrolling is just handled like scrollwheel
scrolling, since the trackpad-gesture-based scroll handling in Flutter
is still in progress.

Adds code to synthesize Add events if mouse tracking isn't enabled,
so that it doesn't rely on Flutter being lenient about handling events
from pointers that have never been added.
2019-03-06 13:15:01 -08:00
stuartmorgan
b7d5129492
[macos] Add hover support to FLEViewController (#7975)
Adds an option to enable mouse tracking, which will send
add/hover/remove events to the Flutter engine.
2019-02-27 10:06:57 -08:00
stuartmorgan
93452747fc
Initial import of FDE macOS framework (#7642)
Merges the current flutter-desktop-embedding macOS framework into the
engine. Notable changes:
- All channel/codec related code is eliminated in favor of using the
  existing iOS implementations.
- All .m files renamed to .mm for consistency with the iOS code.
  - Some minor code changes to fix new warnings in Objective-C++ mode.
- License headers, basic format (e.g., clang-format changes) updated to
  use repo style.
- Xcode project is not included; instead adds GN build rules to create
  an integrated framework that combines what was the FDE library with
  what is present in FlutterEmbedder.framework.

Other changes are left as follow-ups, including:
- Moving shared code out of ios/ into common/.
- Potentially improving sharing between iOS and macOS BUILD.gn.
- Class renaming; the FLE prefix will be eliminated, but that API
  surface isn't stable yet, so that can be changed later.
2019-01-31 14:14:43 -08:00