136 Commits

Author SHA1 Message Date
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
Chris Bracken
9b4a0264d5 Correct typos throughout the engine/embedder (flutter/engine#25346)
Used the the `misspell` tool available at
https://github.com/client9/misspell, then applied hand-corrections. It's
possible we could adopt this as a presubmit, but there are still enough
false positives that it may not be worth the effort.
2021-04-01 11:08:19 -07:00
Chris Bracken
b59df14302 Clean up small typos in EncodableValue docs (flutter/engine#25340)
Spotted elsewhere in the file while taking a quick pass over 20b6f2a
before merging.
2021-03-31 16:22:23 -07:00
Chris Bracken
896ed97baf Make EncodableValue::LongValue const (flutter/engine#25335)
This method doesn't mutate the value of the underlying variant.

Fixes https://github.com/flutter/flutter/issues/79472
2021-03-31 12:47:49 -07:00
Harsh Bhikadia
20b6f2a4ea [doc] added dart type mapping in declaration comment (flutter/engine#25329) 2021-03-31 11:50:59 -07:00
chunhtai
a48966cc4f Wires up accessibility bridge in mac embedding (flutter/engine#23870)
* Wires up accessibility bridge in mac embedding

* addressing comment

* addressing comments
2021-03-10 10:44:22 -08:00
Chris Bracken
13cf185e1c Correct setup-related typos (flutter/engine#24846)
Corrects uses of setup as a verb to 'set up', leaves noun/noun-phrase
forms of setup as 'setup'. Also settles on 'teardown' as opposed to
tear-down for consistency across the codebase.

A few other minor comment/wording corrections.
2021-03-08 17:31:10 -08:00
J-P Nurmi
069154f7ee [linux] Fix text selection via Shift+Home/End (flutter/engine#24623)
Adds TextInputModel::SelectToBeginning/End() and applies when shift key is pressed.
2021-03-05 08:51:33 -08:00
Chris Bracken
c3a0385fb5 Use common desktop TextInputModel on macOS (flutter/engine#24533)
This replaces the custom Obj-C TextInputModel implementation used on
macOS with the common C++ implementation used on Linux and Windows. Note
that as a side-effect, this change enables *some* direct IME input for
CJK input but full input will land in follow-up patches that land:

1. Add handling for TextInput.setMarkedTextRect message
2. Add handling for TextInput.setEditableSizeAndTransform message
3. Implement firstRectForCharacterRange:actualRange: using the above.
4. Add NSTextInputContext handling.
2021-02-25 00:04:54 -08:00