From 72ff6875fb30d59a431aa7606aa2c7b9db524407 Mon Sep 17 00:00:00 2001 From: Swift Kim Date: Thu, 7 Apr 2022 02:01:22 +0900 Subject: [PATCH] Sync accessibility flags in embedder.h (flutter/engine#32332) The following enum types in `embedder.h` must match with the corresponding Dart/C++ classes in `dart:ui` but some values are missing. - `FlutterAccessibilityFeature` - `FlutterSemanticsAction` - `FlutterSemanticsFlag` The comments say https://github.com/flutter/engine/blob/5a43c7cb8e939574671d563006048f7412ce4961/shell/platform/embedder/embedder.h#L83 https://github.com/flutter/engine/blob/5a43c7cb8e939574671d563006048f7412ce4961/lib/ui/window.dart#L784-L785 Issue: https://github.com/flutter/flutter/issues/101217 --- .../src/flutter/shell/platform/embedder/embedder.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/embedder/embedder.h b/engine/src/flutter/shell/platform/embedder/embedder.h index 4cefaab892..66a25c7f30 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder.h +++ b/engine/src/flutter/shell/platform/embedder/embedder.h @@ -92,8 +92,12 @@ typedef enum { /// Request that text be rendered at a bold font weight. kFlutterAccessibilityFeatureBoldText = 1 << 3, /// Request that certain animations be simplified and parallax effects - // removed. + /// removed. kFlutterAccessibilityFeatureReduceMotion = 1 << 4, + /// Request that UI be rendered with darker colors. + kFlutterAccessibilityFeatureHighContrast = 1 << 5, + /// Request to show on/off labels inside switches. + kFlutterAccessibilityFeatureOnOffSwitchLabels = 1 << 6, } FlutterAccessibilityFeature; /// The set of possible actions that can be conveyed to a semantics node. @@ -149,6 +153,8 @@ typedef enum { kFlutterSemanticsActionMoveCursorForwardByWord = 1 << 19, /// Move the cursor backward by one word. kFlutterSemanticsActionMoveCursorBackwardByWord = 1 << 20, + /// Replace the current text in the text field. + kFlutterSemanticsActionSetText = 1 << 21, } FlutterSemanticsAction; /// The set of properties that may be associated with a semantics node. @@ -203,6 +209,12 @@ typedef enum { /// `PageView` widget does not have implicit scrolling, so that users don't /// navigate to the next page when reaching the end of the current one. kFlutterSemanticsFlagHasImplicitScrolling = 1 << 18, + /// Whether the value of the semantics node is coming from a multi-line text + /// field. + /// + /// This is used for text fields to distinguish single-line text fields from + /// multi-line ones. + kFlutterSemanticsFlagIsMultiline = 1 << 19, /// Whether the semantic node is read only. /// /// Only applicable when kFlutterSemanticsFlagIsTextField flag is on.