mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes. Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively. Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676 This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
52 lines
1.6 KiB
C++
52 lines
1.6 KiB
C++
// 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/lib/ui/semantics/semantics_update.h"
|
|
|
|
#include <memory>
|
|
|
|
#include "flutter/lib/ui/painting/matrix.h"
|
|
#include "flutter/lib/ui/semantics/semantics_update_builder.h"
|
|
#include "flutter/lib/ui/ui_dart_state.h"
|
|
#include "third_party/tonic/converter/dart_converter.h"
|
|
#include "third_party/tonic/dart_args.h"
|
|
#include "third_party/tonic/dart_binding_macros.h"
|
|
#include "third_party/tonic/dart_library_natives.h"
|
|
|
|
namespace flutter {
|
|
|
|
IMPLEMENT_WRAPPERTYPEINFO(ui, SemanticsUpdate);
|
|
|
|
#define FOR_EACH_BINDING(V) V(SemanticsUpdate, dispose)
|
|
|
|
DART_BIND_ALL(SemanticsUpdate, FOR_EACH_BINDING)
|
|
|
|
void SemanticsUpdate::create(Dart_Handle semantics_update_handle,
|
|
SemanticsNodeUpdates nodes,
|
|
CustomAccessibilityActionUpdates actions) {
|
|
auto semantics_update = fml::MakeRefCounted<SemanticsUpdate>(
|
|
std::move(nodes), std::move(actions));
|
|
semantics_update->AssociateWithDartWrapper(semantics_update_handle);
|
|
}
|
|
|
|
SemanticsUpdate::SemanticsUpdate(SemanticsNodeUpdates nodes,
|
|
CustomAccessibilityActionUpdates actions)
|
|
: nodes_(std::move(nodes)), actions_(std::move(actions)) {}
|
|
|
|
SemanticsUpdate::~SemanticsUpdate() = default;
|
|
|
|
SemanticsNodeUpdates SemanticsUpdate::takeNodes() {
|
|
return std::move(nodes_);
|
|
}
|
|
|
|
CustomAccessibilityActionUpdates SemanticsUpdate::takeActions() {
|
|
return std::move(actions_);
|
|
}
|
|
|
|
void SemanticsUpdate::dispose() {
|
|
ClearDartWrapper();
|
|
}
|
|
|
|
} // namespace flutter
|