• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "flutter/lib/ui/semantics/semantics_node.h"
6 
7 #include <string.h>
8 
9 namespace flutter {
10 
11 constexpr int32_t kMinPlatformViewId = -1;
12 
13 SemanticsNode::SemanticsNode() = default;
14 
15 SemanticsNode::SemanticsNode(const SemanticsNode& other) = default;
16 
17 SemanticsNode::~SemanticsNode() = default;
18 
HasAction(SemanticsAction action) const19 bool SemanticsNode::HasAction(SemanticsAction action) const {
20   return (actions & static_cast<int32_t>(action)) != 0;
21 }
22 
HasFlag(SemanticsFlags flag) const23 bool SemanticsNode::HasFlag(SemanticsFlags flag) const {
24   return (flags & static_cast<int32_t>(flag)) != 0;
25 }
26 
IsPlatformViewNode() const27 bool SemanticsNode::IsPlatformViewNode() const {
28   return platformViewId > kMinPlatformViewId;
29 }
30 
31 }  // namespace flutter
32