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
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.
Fixesflutter/flutter#31735
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.
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
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.
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.
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
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.
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.
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/31735https://github.com/flutter/flutter/issues/32718
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
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.
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
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.
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.
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.
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.