163 Commits

Author SHA1 Message Date
Matan Lurey
42bac1a9a9 Conform to clang_tidy in client_wrapper headers. (flutter/engine#46058)
Partial work towards https://github.com/flutter/flutter/issues/134969.

All of these were auto-suggested by Clang, and mostly avoid unnecessary
copies.
2023-09-19 14:43:06 -07:00
Tong Mu
a443c671d0 Remove deprecated MOCK_METHODx calls (flutter/engine#45307)
The issue that blocks these mocking methods have been resolved.

However, there is [one more mention of this issue in `run_tests.py`](1410d8beaa/testing/run_tests.py (L400)) and I have no idea why it was marked so. It was originally added [here](https://github.com/flutter/engine/pull/19033/files#diff-521d7c59c3f721b259f094c760c2613e16e889b0f24702280924466109e3b0b0R137).

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-02 01:42:21 +00:00
Qun Cheng
58c5cbd17f Add Expanded/Collapsed state for SubmenuButton (flutter/engine#43983)
This PR is to add support for the expanded/collapsed-state semantics flag to the engine. After adding another PR to Flutter, we will be able to support the expanded/collapsed state in semantics for submenu buttons.

Related to [#127617](https://github.com/flutter/flutter/issues/127617) in flutter
2023-07-28 00:49:12 +00:00
Tong Mu
f4bd2708cf Remove dead code for recreating a11y node delegates (flutter/engine#43359)
This PR removes some dead code for recreating a11y node delegates. These
code was used to refresh a11y information when the macOS embedder live
swapped view controllers, but have become obsolete since
https://github.com/flutter/engine/pull/39145 removed the support for
such live swapping.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I added new tests to check the change I am making or feature I am
adding, or Hixie said the PR is test-exempt. See [testing the engine]
for instructions on writing and running engine tests.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I signed the [CLA].
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-07-06 13:10:02 -07:00
Lau Ching Jun
574191ed36 Workaround a release blocker after libc++ change (flutter/engine#43091)
The code breaks in C++20 mode after libc++ removes comparisons for `std::vector` and replaces them with 'operator <=>'.

See cl/542541552 for context.
2023-06-22 19:33:44 +00:00
Greg Spencer
a1b365111f Reland: "Adding app lifecycle notification for macOS and Linux, add hidden state." (#40542) (flutter/engine#42418)
## Description

This reverts commit 879917b to re-land #40542 to fix the lint warning which caused the original PR to be reverted (the lint warnings were turned on after the original was landed, which is why it wasn't caught earlier).
2023-05-30 20:45:46 +00:00
Zachary Anderson
879917b1e6 Revert "Adding app lifecycle notification for macOS and Linux, add hidden state." (flutter/engine#42384) 2023-05-28 00:02:58 -07:00
Greg Spencer
2af9be9d97 Adding app lifecycle notification for macOS and Linux, add hidden state. (flutter/engine#40542)
## Description

This adds app lifecycle notification for macOS and Linux, and adds a new `hidden` state to the `AppLifecycleState` enum.

To be functional, this needs a corresponding framework change: https://github.com/flutter/flutter/pull/123274

## Related Issues
 - https://github.com/flutter/flutter/issues/30735

## Tests
 - Added tests for state changes.
2023-05-26 23:24:33 +00:00
Greg Spencer
70e9ea9a3c Some minor doc typo and diagnostic fixes. (flutter/engine#40982) 2023-04-18 10:39:06 -07:00
Loïc Sharma
f4f8988c2a Complete the update semantics embedder API migration (flutter/engine#40773)
Complete the update semantics embedder API migration
2023-03-31 18:40:42 +00:00
Loïc Sharma
3ab31ad593 [Embedder API] Introduce new update semantics callback (flutter/engine#39807)
[Embedder API] Introduce new update semantics callback
2023-03-22 00:07:21 +00:00
Loïc Sharma
3e5a3fa15e [macOS] Remove a single accessibility root assumption (flutter/engine#40316)
[macOS] Remove a single accessibility root assumption
2023-03-17 20:53:39 +00:00
yaakovschectman
c1df0b8413 Pass parameters by value to StreamHandlerError (flutter/engine#40311)
* Pass by value/rvalue

* Test pass by value

* Formatting

* Test nullptr

* Formatting
2023-03-16 14:00:30 -04:00
Loïc Sharma
85065c29e9 [Desktop] Use references for semantics update (flutter/engine#40167)
[Desktop] Use references for semantics update
2023-03-09 19:44:17 +00:00
Chris Bracken
827671aaef [common] Use FML macro to prevent copy/assignment (flutter/engine#39786)
Rather than explicitly delete the copy constructor and operator=, use
the standard FML_DISALLOW_COPY_AND_ASSIGN macro used elsewhere across
the codebase. Also ensure that files using this macro #include the
correct FML header directly, rather than relying on a transitive
include.

No test changes/additions since this patch introduces no semantic
changes.
2023-02-22 09:50:06 -08:00
Loïc Sharma
0dbedd3617 [Windows] Remove accessibility root assumptions (flutter/engine#39441)
* [Windows] Remove accessibility root assumptions

* Improve tests

* Improve comment

* Use helper

* Add TODO

* Fix

* Make test more thorough

* Add assertion

* More assertions

* Format

* Tweak comments based off feedback
2023-02-07 23:27:07 +00:00
Loïc Sharma
3119b5c02b Improve crashes if messenger APIs are used incorrectly (flutter/engine#39041)
* Clarify messenger APIs

* Feedback
2023-01-24 23:22:51 +00:00
Ahmed Ashour
51c0a9ec65 Remove superfluous words from comments (flutter/engine#39068)
* Remove superfluous words.

* Format

* Duplicate in consecutive lines.
2023-01-24 09:54:19 -08:00
yaakovschectman
7ed656d596 Merge MSAA alert functionality with UIA (flutter/engine#38745)
* Use AXFragmentRootWin for MSAA functionality.

Some unused code remains to be removed.

Merge MSAA to AXFragmentRootWin

* Removing unused code

* Remove unused files

* Flip macro

* Formatting

* Licenses

* Make reference

* Disable copy constructor/assignment

* Unused import

* Formatting

* Relocate alert logic

* Remove comment and unused mock

* Fix unit test

* Idempotency

* Formatting

* PR feedback

* Doc comments

* Undo string change for now

* Couple fragment root and alert node

* Formatting

* Add comments

* Pointer to reference

* Typo fix
2023-01-19 13:28:27 -05:00
yaakovschectman
717c8724c6 Mark nodes as kIsLineBreakingObject by default, TODO further distinctions (flutter/engine#38721)
* Line breaks

* Formatting

* Update shell/platform/common/accessibility_bridge.cc

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

* Test line breaking object

* Formatting

* Format

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2023-01-10 11:13:44 -05:00
yaakovschectman
c2d59665dd Limit selection change to focused node on Windows (flutter/engine#38634)
* Limit selection change to focused node on Windows

* Focus fix

* Test document selection change

* Comment

* Formatting

* Update shell/platform/windows/accessibility_bridge_windows.cc

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2023-01-06 16:36:11 -05:00
yaakovschectman
2f6724c5bf Update FlutterPlatformNodeDelegate (flutter/engine#38615)
* Update FlutterPlatformNodeDelegate

* Unit test
2023-01-04 10:27:24 -05:00
yaakovschectman
6c12d1292d Make AccessibilityBridge a AXPlatformTreeManager (flutter/engine#38610)
* Make Accessibility Bridge a tree manager

* Add FlutterPlatformNodeDelegate::GetPlatformNode

* Add unit test

* Formatting

* PR
2023-01-03 15:18:04 -05:00
gaaclarke
643e801f2c Implemented threadsafe platform channel replies on windows (flutter/engine#36909)
* Implemented threadsafe platform channel replies on windows

* added unit test

* added docstrings

* implemented glfw

* added comments

* made glfw messenger unable to be copied

* stuart feedback 1

* stuart feedback 2: replaced the shared_ptr

* stuart feedback 3

* stuart feedback: remove error log

* Moved FlutterDesktopMessenger to its own file.

* updated licenses

* stuart feedback
2022-11-09 22:59:00 +00:00
Tong Mu
4bbd9b6eb1 Merge AccessibilityBridge and AccessibilityBridgeDelegate (flutter/engine#36597)
* Impl

* FlutterPlatformNodeDelegateMac

* Format

* Rename file

* Windows: Compile

* format

* Fix tests

* Fix doc

* More doc

* More comments

* Format

* Update names

* Format

* Compile

* Change to unique

* Revert as shared

* Doc fixes

* Make windows bridge weak

* Fix win compile

* Format

* move weak
2022-11-04 06:55:55 +00:00
Loïc Sharma
888a2fd9cd Prevent stack corruption when using C++ EventChannel (flutter/engine#36882) 2022-10-21 20:54:58 +00:00
yaakovschectman
723551a5ee Present tooltip to screen reader on Windows (flutter/engine#36799)
* Propagate tooltip property

* Append tooltip to name

* Formatting

* Fix unit tests

* Tooltip at end

* Tooltip
2022-10-17 16:57:11 -04:00
gaaclarke
e41c775200 Removed instances of unnecessary values (flutter/engine#36221) 2022-09-26 21:28:04 +00:00
Loïc Sharma
422d88f217 [A11y] Fix ReorderableListView crash on desktop (flutter/engine#36160) 2022-09-17 01:27:47 +00:00
yaakovschectman
ef3bc43183 Communicate switch status to semantics on Windows (flutter/engine#36177)
* Switch semantics

* Test native role
2022-09-15 18:02:12 -04:00
Niklas Schulze
c579e02c31 Windows: Texture Registrar: Destroy textures on raster thread (flutter/engine#33688) 2022-09-09 16:22:40 +02:00
yaakovschectman
e2e7168850 Honor mixed state of tristate Checkbox in Semantics (flutter/engine#35868)
* Honor mixed state

* Add to unit test

* Add state enums

* Fix delimiter

* Add enums

* Scope subtests, rename enum

* Rename enums

* Comment specification

* Tidy up comments

* Rename java enum

* Trailing whitespace
2022-09-06 10:59:25 -04:00
Loïc Sharma
837d8f1736 Queue all semantic nodes & actions before completing batch (flutter/engine#35792) 2022-08-30 20:00:01 +00:00
yaakovschectman
53c321a3e3 Include checkbox in check state update (flutter/engine#35557)
* Include checkbox in check state update

* Windows test for checkbox native state

* Reformat to appease linux_unopt test

* More format hoops

* Update accessibility_bridge_unittests.cc

* Update flutter_windows_view_unittests.cc
2022-08-22 16:01:02 -04:00
gaaclarke
8e8b3912a0 Backfilled unit tests for IncomingMessageDispatcher. (flutter/engine#35139)
* Backfilled unit tests for IncomingMessageDispatcher.

* added license golden
2022-08-18 17:30:34 -07:00
Chris Bracken
9215e15d91 Add FLUTTER_DEPRECATED macro and flutter_macros.h (flutter/engine#35293)
Adds a new header, flutter_macros.h which includes a FLUTTER_DEPRECATED
macro that can be used to mark deprecated API as such, with a
hopefully-informative message, ideally describing the expected removal
version and any migration tips.

This will need to be #included in flutter_windows.h and flutter_linux.h,
but prior to doing so, we'll need to update the engine recipe to bundle
the new header, here:
https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/engine/engine.py#1457

No tests since this adds a compiler macro that will be used for future
C/C++ API deprecation once the above recipe change has landed;
specifically: FlutterDesktopEngineProcessMessages.

Related: https://github.com/flutter/flutter/issues/93537
2022-08-10 17:23:09 +01:00
Chris Bracken
41609b4521 Formatting: Correct whitespace in flutter_export.h (flutter/engine#35292)
Fixes a minor whitespace inconsistency on the documentation for
FLUTTER_EXPORT.

No test change since there is no change to code semantics.

Related: https://github.com/flutter/flutter/issues/93537
2022-08-10 17:22:01 +01:00
gaaclarke
645ac3c239 optimized IncomingMessageDispatcher::HandleMessage a bit (flutter/engine#34954)
* optimized IncomingMessageDispatcher::HandleMessage a bit.

* removed std::string ref
2022-07-28 14:12:57 -07:00
Chris Bracken
56fbdd0232 [lint] Enforce k prefix for global constants (flutter/engine#33666)
Enforces that all global constants are prefixed with a 'k' as per the
style guide and updates the codebase into conformance where necessary.

This does not change any public API.

Additional testing provided by the addition of the lint rule.

Ref: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#begin-global-constant-names-with-prefix-k
2022-05-27 18:33:38 -07:00
Nils Reichardt
3600d3c97e Fix typo "SetTestFluttterStub", "FluttterActivity" and "implementantions" (flutter/engine#33551)
As recommended in https://github.com/flutter/engine/pull/33547#issuecomment-1134077565, I fixed all typos in one PR.

Fixes https://github.com/flutter/flutter/issues/104366
Fixes https://github.com/flutter/flutter/issues/104367
Fixes https://github.com/flutter/flutter/issues/104368
Fixes https://github.com/flutter/flutter/issues/104369
Fixes https://github.com/flutter/flutter/issues/104370
2022-05-23 13:24:48 -07:00
Chris Bracken
09285aac02 Use empty in place of size checks vs 0 (flutter/engine#33151) 2022-05-06 13:09:04 -07:00
Niklas Schulze
fa609bd3fa Windows: Add Direct3D texture interoperability support (flutter/engine#26840) 2022-04-30 14:13:39 +02:00
Chris Bracken
0a84242538 WinUWP: Remove WinUWP sources, targets (flutter/engine#33019)
This removes:
* The Windows UWP emebedder sources and targets
* UWP-specific build targets
* UWP-specific code behind WINUWP #ifdefs
* UWP-specific TODOs.
* uwptool.exe sources and targets used for installing, uninstalling, and
  launching UWP apps.

This is a straight removal patch, and does not land any refactorings
made possible by removal of UWP support. Those patches will land in
followup refactorings.

Tool support was removed in:
https://github.com/flutter/flutter/pull/102174

The CI target was removed in:
https://github.com/flutter/engine/pull/33012

The Recipe was removed in:
https://flutter-review.googlesource.com/c/recipes/+/29500

GN build support was removed in:
https://github.com/flutter/engine/pull/33016

Issue: https://github.com/flutter/flutter/issues/102172
2022-04-29 18:39:36 -07:00
Greg Spencer
b52c5a9fe5 Add Menu channel for rendering system menus with native APIs on macOS. (flutter/engine#32358) 2022-03-31 10:30:03 -07:00
LongCatIsLooong
8762ed9c33 [macOS] fix text selection when there's composing text (flutter/engine#31936) 2022-03-15 14:00:02 -07:00
Chris Bracken
3e6137c8ec Migrate string encoding conversions to FML (flutter/engine#31334)
We've implemented UTF-8/UTF-16 string encoding conversions in multiple
places, from FML to //flutter/shell/platform/common, to the individual
embedders. This migrates these conversions to FML and adds tests.

Windows APIs use wchar_t-based strings and as a result, we continue to
keep Windows-specific functions in fml/platform/win/wstring_conversion.h.

We break out string_conversions into its own source set since FML brings
with it some Dart dependencies (e.g. dart_timestamp_provider.cc) that
are unused by some targets such as uwptool.exe in the Windows UWP
embedding.

Issue: https://github.com/flutter/flutter/issues/98061
2022-02-09 22:59:48 -08:00
Zachary Anderson
eca60c0b90 Add clang-analyzer-* and clang-diagnostic-* to .clang-tidy (flutter/engine#31291) 2022-02-09 12:26:34 -08:00
Chris Bracken
a2d82caeab Desktop: Support a11y slider widgets (flutter/engine#30322)
Adds support to the common desktop accessibility bridge for widgets that
include a semantics node with the `isSlider` flag set.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-14 11:20:16 -08:00
Chris Bracken
a9722681ef Support toggle buttons for desktop accessibility (flutter/engine#30297) 2021-12-13 11:04:05 -08:00
Chris Bracken
2474482021 Override FlutterPlatformNodeDelegate::GetUniqueId (flutter/engine#30261)
The default implementation of GetUniqueId on ui::AXPlatformNodeDelegate
always returns ID 1. We had previously implemented this on the windows
platform node delegate, but for consistency's sake, and because the
default implementation is surprising, we're promoting this to the
FlutterPlatformNodeDelegate base class.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-10 10:05:00 -08:00