From 253c7dd0dbea58fc86e6c171498b8c184336cc36 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 9 Sep 2025 20:57:31 +0900 Subject: [PATCH] [engine] Sync Flutter 3.35.3 source code --- DEPS | 2 +- flutter/shell/platform/common/BUILD.gn | 11 +- .../platform/common/accessibility_bridge.cc | 78 ++++++-------- .../platform/common/accessibility_bridge.h | 4 +- .../include/flutter/encodable_value.h | 51 ++++++++- flutter/shell/platform/common/geometry.h | 24 +++++ .../shell/platform/common/isolate_scope.cc | 40 +++++++ flutter/shell/platform/common/isolate_scope.h | 47 ++++++++ flutter/shell/platform/common/windowing.h | 20 ++++ flutter/shell/platform/embedder/embedder.h | 101 +++++++++++++++++- flutter/shell/platform/tizen/BUILD.gn | 1 + 11 files changed, 327 insertions(+), 52 deletions(-) create mode 100644 flutter/shell/platform/common/isolate_scope.cc create mode 100644 flutter/shell/platform/common/isolate_scope.h create mode 100644 flutter/shell/platform/common/windowing.h diff --git a/DEPS b/DEPS index 3fa3f375..1df44680 100644 --- a/DEPS +++ b/DEPS @@ -7,7 +7,7 @@ deps = { 'src/third_party/libcxx': 'https://llvm.googlesource.com/llvm-project/libcxx@bd557f6f764d1e40b62528a13b124ce740624f8f', 'src/third_party/libcxxabi': 'https://llvm.googlesource.com/llvm-project/libcxxabi@a4dda1589d37a7e4b4f7a81ebad01b1083f2e726', 'src/third_party/googletest': 'https://github.com/google/googletest@7f036c5563af7d0329f20e8bb42effb04629f0c0', - 'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@b04011c77cd93e6ab9144af37976733b558d716c', + 'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@a29e08c72e2ce21813c1edf50cbcdfcac7a7acdd', 'src/third_party/clang': { 'packages': [ { diff --git a/flutter/shell/platform/common/BUILD.gn b/flutter/shell/platform/common/BUILD.gn index 64bf2b04..315c8f09 100644 --- a/flutter/shell/platform/common/BUILD.gn +++ b/flutter/shell/platform/common/BUILD.gn @@ -32,7 +32,7 @@ source_set("common_cpp_library_headers") { copy("publish_headers") { sources = _public_headers - outputs = [ "$root_out_dir/public/{{source_file_part}}" ] + outputs = [ "$root_out_dir/{{source_file_part}}" ] } source_set("common_cpp_input") { @@ -54,6 +54,13 @@ source_set("common_cpp_input") { deps = [ "//flutter/fml:fml" ] } +source_set("common_cpp_isolate_scope") { + public = [ "isolate_scope.h" ] + sources = [ "isolate_scope.cc" ] + + deps = [ "//flutter/fml:fml" ] +} + source_set("common_cpp_enums") { public = [ "app_lifecycle_state.h", @@ -116,6 +123,7 @@ source_set("common_cpp") { deps = [ ":common_cpp_library_headers", "//flutter/shell/platform/common/client_wrapper:client_wrapper", + "//flutter/shell/platform/embedder:embedder_headers", ] public_deps = [ @@ -132,6 +140,7 @@ source_set("common_cpp_core") { public = [ "geometry.h", "path_utils.h", + "windowing.h", ] sources = [ "path_utils.cc" ] diff --git a/flutter/shell/platform/common/accessibility_bridge.cc b/flutter/shell/platform/common/accessibility_bridge.cc index 1913a580..31603dd7 100644 --- a/flutter/shell/platform/common/accessibility_bridge.cc +++ b/flutter/shell/platform/common/accessibility_bridge.cc @@ -311,43 +311,43 @@ void AccessibilityBridge::ConvertFlutterUpdate(const SemanticsNode& node, void AccessibilityBridge::SetRoleFromFlutterUpdate(ui::AXNodeData& node_data, const SemanticsNode& node) { - FlutterSemanticsFlag flags = node.flags; - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsButton) { + const FlutterSemanticsFlags* flags = node.flags; + FML_DCHECK(flags) << "SemanticsNode::flags must not be null"; + if (flags->is_button) { node_data.role = ax::mojom::Role::kButton; return; } - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsTextField && - !(flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsReadOnly)) { + if (flags->is_text_field && !flags->is_read_only) { node_data.role = ax::mojom::Role::kTextField; return; } - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsHeader) { + if (flags->is_header) { node_data.role = ax::mojom::Role::kHeader; return; } - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsImage) { + if (flags->is_image) { node_data.role = ax::mojom::Role::kImage; return; } - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsLink) { + if (flags->is_link) { node_data.role = ax::mojom::Role::kLink; return; } - if (flags & kFlutterSemanticsFlagIsInMutuallyExclusiveGroup && - flags & kFlutterSemanticsFlagHasCheckedState) { + if (flags->is_in_mutually_exclusive_group && + flags->is_checked != FlutterCheckState::kFlutterCheckStateNone) { node_data.role = ax::mojom::Role::kRadioButton; return; } - if (flags & kFlutterSemanticsFlagHasCheckedState) { + if (flags->is_checked != FlutterCheckState::kFlutterCheckStateNone) { node_data.role = ax::mojom::Role::kCheckBox; return; } - if (flags & kFlutterSemanticsFlagHasToggledState) { + if (flags->is_toggled != FlutterTristate::kFlutterTristateNone) { node_data.role = ax::mojom::Role::kSwitch; return; } - if (flags & kFlutterSemanticsFlagIsSlider) { + if (flags->is_slider) { node_data.role = ax::mojom::Role::kSlider; return; } @@ -362,17 +362,14 @@ void AccessibilityBridge::SetRoleFromFlutterUpdate(ui::AXNodeData& node_data, void AccessibilityBridge::SetStateFromFlutterUpdate(ui::AXNodeData& node_data, const SemanticsNode& node) { - FlutterSemanticsFlag flags = node.flags; + const FlutterSemanticsFlags* flags = node.flags; FlutterSemanticsAction actions = node.actions; - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagHasExpandedState && - flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsExpanded) { + if (flags->is_expanded == FlutterTristate::kFlutterTristateTrue) { node_data.AddState(ax::mojom::State::kExpanded); - } else if (flags & - FlutterSemanticsFlag::kFlutterSemanticsFlagHasExpandedState) { + } else if (flags->is_expanded == FlutterTristate::kFlutterTristateFalse) { node_data.AddState(ax::mojom::State::kCollapsed); } - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsTextField && - (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsReadOnly) == 0) { + if (flags->is_text_field && !flags->is_read_only) { node_data.AddState(ax::mojom::State::kEditable); } if (node_data.role == ax::mojom::Role::kStaticText && @@ -435,7 +432,7 @@ void AccessibilityBridge::SetBooleanAttributesFromFlutterUpdate( ui::AXNodeData& node_data, const SemanticsNode& node) { FlutterSemanticsAction actions = node.actions; - FlutterSemanticsFlag flags = node.flags; + const FlutterSemanticsFlags* flags = node.flags; node_data.AddBoolAttribute(ax::mojom::BoolAttribute::kScrollable, actions & kHasScrollingAction); node_data.AddBoolAttribute( @@ -444,13 +441,10 @@ void AccessibilityBridge::SetBooleanAttributesFromFlutterUpdate( // TODO(chunhtai): figure out if there is a node that does not clip overflow. node_data.AddBoolAttribute(ax::mojom::BoolAttribute::kClipsChildren, !node.children_in_traversal_order.empty()); - node_data.AddBoolAttribute( - ax::mojom::BoolAttribute::kSelected, - flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsSelected); - node_data.AddBoolAttribute( - ax::mojom::BoolAttribute::kEditableRoot, - flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsTextField && - (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsReadOnly) == 0); + node_data.AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, + flags->is_selected); + node_data.AddBoolAttribute(ax::mojom::BoolAttribute::kEditableRoot, + flags->is_text_field && !flags->is_read_only); // Mark nodes as line breaking so that screen readers don't // merge all consecutive objects into one. // TODO(schectman): When should a node have this attribute set? @@ -462,15 +456,13 @@ void AccessibilityBridge::SetBooleanAttributesFromFlutterUpdate( void AccessibilityBridge::SetIntAttributesFromFlutterUpdate( ui::AXNodeData& node_data, const SemanticsNode& node) { - FlutterSemanticsFlag flags = node.flags; + const FlutterSemanticsFlags* flags = node.flags; node_data.AddIntAttribute(ax::mojom::IntAttribute::kTextDirection, node.text_direction); int sel_start = node.text_selection_base; int sel_end = node.text_selection_extent; - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsTextField && - (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsReadOnly) == 0 && - !node.value.empty()) { + if (flags->is_text_field && !flags->is_read_only && !node.value.empty()) { // By default the text field selection should be at the end. sel_start = sel_start == -1 ? node.value.length() : sel_start; sel_end = sel_end == -1 ? node.value.length() : sel_end; @@ -483,16 +475,16 @@ void AccessibilityBridge::SetIntAttributesFromFlutterUpdate( node_data.AddIntAttribute( ax::mojom::IntAttribute::kCheckedState, static_cast( - flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsCheckStateMixed + (flags->is_checked == FlutterCheckState::kFlutterCheckStateMixed) ? ax::mojom::CheckedState::kMixed - : flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsChecked + : (flags->is_checked == FlutterCheckState::kFlutterCheckStateTrue) ? ax::mojom::CheckedState::kTrue : ax::mojom::CheckedState::kFalse)); } else if (node_data.role == ax::mojom::Role::kSwitch) { node_data.AddIntAttribute( ax::mojom::IntAttribute::kCheckedState, static_cast( - flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsToggled + (flags->is_toggled == FlutterTristate::kFlutterTristateTrue) ? ax::mojom::CheckedState::kTrue : ax::mojom::CheckedState::kFalse)); } @@ -548,13 +540,13 @@ void AccessibilityBridge::SetTooltipFromFlutterUpdate( void AccessibilityBridge::SetTreeData(const SemanticsNode& node, ui::AXTreeUpdate& tree_update) { - FlutterSemanticsFlag flags = node.flags; + const FlutterSemanticsFlags* flags = node.flags; // Set selection of the focused node if: // 1. this text field has a valid selection // 2. this text field doesn't have a valid selection but had selection stored // in the tree. - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsTextField && - flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsFocused) { + if (flags->is_text_field && + flags->is_focused == FlutterTristate::kFlutterTristateTrue) { if (node.text_selection_base != -1) { tree_update.tree_data.sel_anchor_object_id = node.id; tree_update.tree_data.sel_anchor_offset = node.text_selection_base; @@ -570,12 +562,11 @@ void AccessibilityBridge::SetTreeData(const SemanticsNode& node, } } - if (flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsFocused && + if (flags->is_focused == FlutterTristate::kFlutterTristateTrue && tree_update.tree_data.focus_id != node.id) { tree_update.tree_data.focus_id = node.id; tree_update.has_tree_data = true; - } else if ((flags & FlutterSemanticsFlag::kFlutterSemanticsFlagIsFocused) == - 0 && + } else if (flags->is_focused != FlutterTristate::kFlutterTristateTrue && tree_update.tree_data.focus_id == node.id) { tree_update.tree_data.focus_id = ui::AXNode::kInvalidAXID; tree_update.has_tree_data = true; @@ -587,7 +578,10 @@ AccessibilityBridge::FromFlutterSemanticsNode( const FlutterSemanticsNode2& flutter_node) { SemanticsNode result; result.id = flutter_node.id; - result.flags = flutter_node.flags; + FML_DCHECK(flutter_node.flags2) + << "FlutterSemanticsNode2::flags2 must not be null"; + + result.flags = flutter_node.flags2; result.actions = flutter_node.actions; result.text_selection_base = flutter_node.text_selection_base; result.text_selection_extent = flutter_node.text_selection_extent; @@ -596,8 +590,6 @@ AccessibilityBridge::FromFlutterSemanticsNode( result.scroll_position = flutter_node.scroll_position; result.scroll_extent_max = flutter_node.scroll_extent_max; result.scroll_extent_min = flutter_node.scroll_extent_min; - result.elevation = flutter_node.elevation; - result.thickness = flutter_node.thickness; if (flutter_node.label) { result.label = std::string(flutter_node.label); } diff --git a/flutter/shell/platform/common/accessibility_bridge.h b/flutter/shell/platform/common/accessibility_bridge.h index 8126c1ce..6a36e476 100644 --- a/flutter/shell/platform/common/accessibility_bridge.h +++ b/flutter/shell/platform/common/accessibility_bridge.h @@ -161,7 +161,7 @@ class AccessibilityBridge // See FlutterSemanticsNode in embedder.h typedef struct { int32_t id; - FlutterSemanticsFlag flags; + FlutterSemanticsFlags* flags; FlutterSemanticsAction actions; int32_t text_selection_base; int32_t text_selection_extent; @@ -170,8 +170,6 @@ class AccessibilityBridge double scroll_position; double scroll_extent_max; double scroll_extent_min; - double elevation; - double thickness; std::string label; std::string hint; std::string value; diff --git a/flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h b/flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h index 3a191205..e6eacad6 100644 --- a/flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h +++ b/flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h @@ -216,12 +216,57 @@ class EncodableValue : public internal::EncodableValueVariant { return std::get(*this); } - // Explicitly provide operator<, delegating to std::variant's operator<. - // There are issues with with the way the standard library-provided - // < and <=> comparisons interact with classes derived from variant. +// The C++ Standard Library implementations can get into issues with recursive +// constraint satisfaction when (among other things) objects of this type (which +// is an `std::variant` subclass) are put into containers like `std::vector`. +// +// A definition of `operator<` is provided to break that recursion. However, in +// C++20 with the latest compilers (Clang compilers newer than 20 and the latest +// GCC variants, see https://gcc.godbolt.org/z/KM6n6qane) requiring that that +// the `std::three_way_comparable` constraint be satisfied requires the +// provision of `operator<=>` to do the same thing. +// +// The code below makes this translation unit be safe to include from both C++17 +// and C++20 translation units while also using the newest compilers. +// +// The correctness of the compiler's gripes with this code and the subsequent +// need for these workarounds is not fully understood or explored. If you run +// into issues with this code again, the following breadcrumbs may prove +// useful. If you cannot access some or all of these links, the compiler +// explorer link above should serve a reduced test case to base an investigation +// off of. +// +// * b/423885648#comment8 +// * b/423885648#comment19 +// * cl/542631351 +// * cl/542541552 +// * https://github.com/flutter/engine/pull/43091 +// +#if __cplusplus >= 202002L + friend std::partial_ordering operator<=>(const EncodableValue& lhs, + const EncodableValue& rhs) { + auto& lv = static_cast(lhs); + auto& rv = static_cast(rhs); + + if (lv < rv) { + return std::partial_ordering::less; + } + + if (rv < lv) { + return std::partial_ordering::greater; + } + + if (lv == rv) { + return std::partial_ordering::equivalent; + } + + return std::partial_ordering::unordered; + } +#else // __cplusplus >= 202002L friend bool operator<(const EncodableValue& lhs, const EncodableValue& rhs) { return static_cast(lhs) < static_cast(rhs); } +#endif // __cplusplus >= 202002L }; } // namespace flutter diff --git a/flutter/shell/platform/common/geometry.h b/flutter/shell/platform/common/geometry.h index 4d6e8dad..19d61dd9 100644 --- a/flutter/shell/platform/common/geometry.h +++ b/flutter/shell/platform/common/geometry.h @@ -6,6 +6,8 @@ #define FLUTTER_SHELL_PLATFORM_COMMON_GEOMETRY_H_ #include +#include +#include namespace flutter { @@ -45,6 +47,7 @@ class Size { bool operator==(const Size& other) const { return width_ == other.width_ && height_ == other.height_; } + bool operator!=(const Size& other) const { return !(*this == other); } private: double width_ = 0.0; @@ -78,6 +81,27 @@ class Rect { Size size_; }; +// Encapsulates a min and max size that represents the constraints that some +// arbitrary box is able to take up. +class BoxConstraints { + public: + BoxConstraints() = default; + BoxConstraints(const std::optional& smallest, + const std::optional& biggest) + : smallest_(smallest.value_or(Size(0, 0))), + biggest_( + biggest.value_or(Size(std::numeric_limits::infinity(), + std::numeric_limits::infinity()))) {} + BoxConstraints(const BoxConstraints& other) = default; + Size biggest() const { return biggest_; } + Size smallest() const { return smallest_; } + + private: + Size smallest_ = Size(0, 0); + Size biggest_ = Size(std::numeric_limits::infinity(), + std::numeric_limits::infinity()); +}; + } // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_COMMON_GEOMETRY_H_ diff --git a/flutter/shell/platform/common/isolate_scope.cc b/flutter/shell/platform/common/isolate_scope.cc new file mode 100644 index 00000000..9d1f5378 --- /dev/null +++ b/flutter/shell/platform/common/isolate_scope.cc @@ -0,0 +1,40 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "flutter/shell/platform/common/isolate_scope.h" + +namespace flutter { + +Isolate Isolate::Current() { + Dart_Isolate isolate = Dart_CurrentIsolate(); + return Isolate(isolate); +} + +IsolateScope::IsolateScope(const Isolate& isolate) { + isolate_ = isolate.isolate_; + previous_ = Dart_CurrentIsolate(); + if (previous_ == isolate_) { + return; + } + if (previous_) { + Dart_ExitIsolate(); + } + Dart_EnterIsolate(isolate_); +}; + +IsolateScope::~IsolateScope() { + Dart_Isolate current = Dart_CurrentIsolate(); + FML_DCHECK(!current || current == isolate_); + if (previous_ == isolate_) { + return; + } + if (current) { + Dart_ExitIsolate(); + } + if (previous_) { + Dart_EnterIsolate(previous_); + } +} + +} // namespace flutter diff --git a/flutter/shell/platform/common/isolate_scope.h b/flutter/shell/platform/common/isolate_scope.h new file mode 100644 index 00000000..6d7c7cc0 --- /dev/null +++ b/flutter/shell/platform/common/isolate_scope.h @@ -0,0 +1,47 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "flutter/fml/logging.h" +#include "third_party/dart/runtime/include/dart_api.h" + +#ifndef FLUTTER_SHELL_PLATFORM_COMMON_ISOLATE_SCOPE_H_ +#define FLUTTER_SHELL_PLATFORM_COMMON_ISOLATE_SCOPE_H_ + +namespace flutter { + +/// This class is a thin wrapper around dart isolate. It can be used +/// as argument to IsolateScope constructor to enter and exit the isolate. +class Isolate { + public: + /// Retrieve the current Dart Isolate. If no isolate is current, this + /// results in a crash. + static Isolate Current(); + + ~Isolate() = default; + + private: + explicit Isolate(Dart_Isolate isolate) : isolate_(isolate) { + FML_DCHECK(isolate_ != nullptr); + } + + friend class IsolateScope; + Dart_Isolate isolate_; +}; + +// Enters provided isolate for as long as the scope is alive. +class IsolateScope { + public: + explicit IsolateScope(const Isolate& isolate); + ~IsolateScope(); + + private: + Dart_Isolate isolate_; + Dart_Isolate previous_; + + FML_DISALLOW_COPY_AND_ASSIGN(IsolateScope); +}; + +} // namespace flutter + +#endif // FLUTTER_SHELL_PLATFORM_COMMON_ISOLATE_SCOPE_H_ diff --git a/flutter/shell/platform/common/windowing.h b/flutter/shell/platform/common/windowing.h new file mode 100644 index 00000000..5c37df32 --- /dev/null +++ b/flutter/shell/platform/common/windowing.h @@ -0,0 +1,20 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef FLUTTER_SHELL_PLATFORM_COMMON_WINDOWING_H_ +#define FLUTTER_SHELL_PLATFORM_COMMON_WINDOWING_H_ + +namespace flutter { + +// Types of windows. +// The value must match value from WindowType in the Dart code +// in packages/flutter/lib/src/widgets/window.dart +enum class WindowArchetype { + // Regular top-level window. + kRegular, +}; + +} // namespace flutter + +#endif // FLUTTER_SHELL_PLATFORM_COMMON_WINDOWING_H_ diff --git a/flutter/shell/platform/embedder/embedder.h b/flutter/shell/platform/embedder/embedder.h index 26d7d2b7..dfb0896b 100644 --- a/flutter/shell/platform/embedder/embedder.h +++ b/flutter/shell/platform/embedder/embedder.h @@ -105,6 +105,8 @@ typedef enum { kFlutterAccessibilityFeatureHighContrast = 1 << 5, /// Request to show on/off labels inside switches. kFlutterAccessibilityFeatureOnOffSwitchLabels = 1 << 6, + /// Indicate the platform does not support announcements. + kFlutterAccessibilityFeatureNoAnnounce = 1 << 7, } FlutterAccessibilityFeature; /// The set of possible actions that can be conveyed to a semantics node. @@ -172,6 +174,10 @@ typedef enum { /// The set of properties that may be associated with a semantics node. /// /// Must match the `SemanticsFlag` enum in semantics.dart. +/// +/// @deprecated Use `FlutterSemanticsFlags` instead. No new flags will +/// be added to `FlutterSemanticsFlag`. New flags will +/// continue to be added to `FlutterSemanticsFlags`. typedef enum { /// The semantics node has the quality of either being "checked" or /// "unchecked". @@ -258,6 +264,92 @@ typedef enum { kFlutterSemanticsFlagIsRequired = 1 << 30, } FlutterSemanticsFlag; +typedef enum { + /// The property is not applicable to this semantics node. + kFlutterTristateNone, + /// The property is applicable and its state is "true" or "on". + kFlutterTristateTrue, + /// The property is applicable and its state is "false" or "off". + kFlutterTristateFalse, +} FlutterTristate; + +typedef enum { + /// The semantics node does not have check state. + kFlutterCheckStateNone, + /// The semantics node is checked. + kFlutterCheckStateTrue, + /// The semantics node is not checked. + kFlutterCheckStateFalse, + /// The semantics node represents a checkbox in mixed state. + kFlutterCheckStateMixed, +} FlutterCheckState; + +typedef struct { + /// The size of this struct. Must be sizeof(FlutterSemanticsFlags). + size_t struct_size; + /// Whether a semantics node is checked. + FlutterCheckState is_checked; + /// Whether a semantics node is selected. + FlutterTristate is_selected; + /// Whether a semantic node is currently enabled. + FlutterTristate is_enabled; + /// If true, the semantics node is "on". If false, the semantics node is + /// "off". + FlutterTristate is_toggled; + /// Whether a semantic node that is currently expanded. + FlutterTristate is_expanded; + /// Whether user input is required on the semantics node before a form can be + /// submitted. + FlutterTristate is_required; + /// Whether the semantic node currently holds the user's focus. + FlutterTristate is_focused; + /// Whether the semantic node represents a button. + bool is_button; + /// Whether the semantic node represents a text field. + bool is_text_field; + /// Whether a semantic node is in a mutually exclusive group. + bool is_in_mutually_exclusive_group; + /// Whether a semantic node is a header that divides content into sections. + bool is_header; + /// Whether the value of the semantics node is obscured. + bool is_obscured; + /// Whether the semantics node is the root of a subtree for which a route name + /// should be announced. + bool scopes_route; + /// Whether the semantics node label is the name of a visually distinct route. + bool names_route; + /// Whether the semantics node is considered hidden. + bool is_hidden; + /// Whether the semantics node represents an image. + bool is_image; + /// Whether the semantics node is a live region. + bool is_live_region; + /// Whether the platform can scroll the semantics node when the user attempts + /// to move the accessibility focus to an offscreen child. + /// + /// For example, a `ListView` widget has implicit scrolling so that users can + /// easily move the accessibility focus to the next set of children. A + /// `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. + bool has_implicit_scrolling; + /// 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. + bool is_multiline; + /// Whether the semantic node is read only. + /// + /// Only applicable when kFlutterSemanticsFlagIsTextField flag is on. + bool is_read_only; + /// Whether the semantics node represents a link. + bool is_link; + /// Whether the semantics node represents a slider. + bool is_slider; + /// Whether the semantics node represents a keyboard key. + bool is_keyboard_key; +} FlutterSemanticsFlags; + typedef enum { /// Text has unknown text direction. kFlutterTextDirectionUnknown = 0, @@ -1517,7 +1609,11 @@ typedef struct { /// The unique identifier for this node. int32_t id; /// The set of semantics flags associated with this node. - FlutterSemanticsFlag flags; + /// + /// @deprecated Use `flags2` instead. No new flags will + /// be added to `FlutterSemanticsFlag`. New flags will + /// continue to be added to `FlutterSemanticsFlags`. + FlutterSemanticsFlag flags__deprecated__; /// The set of semantics actions applicable to this node. FlutterSemanticsAction actions; /// The position at which the text selection originates. @@ -1601,6 +1697,9 @@ typedef struct { // Array of string attributes associated with the `decreased_value`. // Has length `decreased_value_attribute_count`. const FlutterStringAttribute** decreased_value_attributes; + // The set of semantics flags associated with this node. Prefer to use this + // over `flags__deprecated__`. + FlutterSemanticsFlags* flags2; } FlutterSemanticsNode2; /// `FlutterSemanticsCustomAction` ID used as a sentinel to signal the end of a diff --git a/flutter/shell/platform/tizen/BUILD.gn b/flutter/shell/platform/tizen/BUILD.gn index 9d26bed4..7f8046a2 100644 --- a/flutter/shell/platform/tizen/BUILD.gn +++ b/flutter/shell/platform/tizen/BUILD.gn @@ -203,6 +203,7 @@ template("embedder") { "//flutter/shell/platform/common:common_cpp", "//flutter/shell/platform/common:common_cpp_accessibility", "//flutter/shell/platform/common:common_cpp_input", + "//flutter/shell/platform/common:common_cpp_isolate_scope", "//flutter/shell/platform/common:common_cpp_library_headers", "//flutter/shell/platform/common/client_wrapper:client_wrapper", "//flutter/shell/platform/embedder:embedder_headers",