144 Commits

Author SHA1 Message Date
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
Chris Bracken
f5dc978476 Test shell/platform/common a11y code on Windows (flutter/engine#30262)
This enables unittests for the accessibility bridge in
common_cpp_unittests, when running on Windows. Previously, we only
tested on macOS.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-09 22:49:50 -08:00
Chris Bracken
82f25e5da7 Fix TestAccessibilityBridgeDelegate event caching (flutter/engine#30260)
TestAccessibilityBridgeDelegate::accessibility_events previously held
values of type ui::AXEventGenerator::TargetedEvent. TargetedEvent
contains an AXNode pointer and a const reference to a
ui::AXEventGenerator::EventParams object, and as such it's unsafe to
make or read copies of TargetedEvent values outside the scope of the
AccessibilityBridgeDelegate::OnAccessibilityEvent callback.

In this patch, we update the accessibility_events vector to simply hold
EventType values since this is the only part of the value we use in our
existing tests. If in future we need the full TargetedEvent, we'll need
to properly copy these values.

This patch also fixes a typo in the accessibility_events identifier and
converts an EXPECT_EQ to an ASSERT_EQ in a case where the following
test expectations are meaningless/could crash if the
accessibility_events size isn't as expected.

Issue: https://github.com/flutter/flutter/issues/77838
2021-12-09 22:08:58 -08:00
Chris Bracken
29fd771d30 Extract AccessibilityBridge::kRootNodeId (flutter/engine#29856)
The ID of the root semantics node in Flutter's semantics tree is always
0. Since we'll be adding support for Windows, extract this constant to a
common location.
2021-11-22 10:08:31 -08:00
Jenn Magder
c08aa6c73d Add 'explicit' to darwin embedder constructors (flutter/engine#29827) 2021-11-19 10:54:29 -08:00
Zachary Anderson
78d9e276e2 Fix some clang-tidy lints for Linux host_debug (flutter/engine#29734) 2021-11-18 13:08:01 -08:00
Justin McCandless
3d60f36a21 TextEditingDelta Mac (flutter/engine#29036)
Enables the TextEditingDelta API for Mac, and abstracts iOS's TextEditingDelta class for multi-platfor reuse.
2021-11-18 08:44:44 -08:00
Zachary Anderson
03c0f7e453 Add 'explicit' to header files (flutter/engine#29741) 2021-11-17 12:49:16 -08:00
Jason Simmons
6e16f8ecd2 Call rapidjson::ParseResult::IsError to check for JSON parsing errors (flutter/engine#29270) 2021-10-20 16:53:01 -07:00
Niklas Schulze
fec4d526e3 Windows: FlutterDesktopPixelBuffer: Add optional release callback (flutter/engine#28298) 2021-09-16 13:07:02 -07:00
Brandon DeRosier
3600461d13 Fix lint that shows up in manual builds (flutter/engine#28311) 2021-08-25 16:27:17 -07:00
Brandon DeRosier
941f0a93cd Fix StandardMessageCodec test leaks (flutter/engine#27959) 2021-08-09 15:19:07 -07:00
Hakkyu Kim
487b8743cb Removes unnecessary error message: "Invalid read in StandardCodecByteStreamReader" for cpp BasicMessageChannel (flutter/engine#26956) 2021-07-22 14:26:01 -07:00
Rafal Walczyna
6024e186a2 Initialize EventChannel state (flutter/engine#26761)
OnCancel was firing randomly on event channel registering
because of uninitialized is_listening_ variable.

This PR fixes: flutter/flutter#84632
2021-06-24 13:07:56 -07:00
Jeff Ward
0998ae3840 Fix incorrectly inserting Float32List in the wrong location in encodable_value. (flutter/engine#26537) 2021-06-03 09:09:01 -07:00
Jeff Ward
cf4c1e15c7 Add Float32List support to the Linux standard message codec 2021-06-03 08:38:45 +12:00
chunhtai
d9a591eb9c Support text editing voiceover feedback in macOS (flutter/engine#25600) 2021-06-01 12:00:05 -07:00
Jeff Ward
2438363a2e Add Float32List support to StandardMessageCodec (flutter/engine#26386) 2021-05-27 14:49:02 -07:00
gaaclarke
4d98fd9744 Switch PlatformMessages to hold data in Mappings (flutter/engine#25867) 2021-05-13 10:28:25 -07:00
James Clarke
a56e2c9e5e Windows: Add support for engine switches for WinUWP target (flutter/engine#25412) 2021-04-19 07:44:01 -07:00