forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FabricMountingManager.h
80 lines (56 loc) · 2.08 KB
/
FabricMountingManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include "FabricMountItem.h"
#include <react/config/ReactNativeConfig.h>
#include <react/renderer/animations/LayoutAnimationDriver.h>
#include <react/renderer/mounting/MountingCoordinator.h>
#include <react/renderer/mounting/ShadowView.h>
#include <react/renderer/uimanager/LayoutAnimationStatusDelegate.h>
#include <react/utils/ContextContainer.h>
#include <fbjni/fbjni.h>
#include <mutex>
namespace facebook {
namespace react {
class FabricMountingManager final {
public:
constexpr static auto UIManagerJavaDescriptor =
"com/facebook/react/fabric/FabricUIManager";
constexpr static auto ReactFeatureFlagsJavaDescriptor =
"com/facebook/react/config/ReactFeatureFlags";
FabricMountingManager(
std::shared_ptr<const ReactNativeConfig> &config,
jni::global_ref<jobject> &javaUIManager);
void onSurfaceStart(SurfaceId surfaceId);
void onSurfaceStop(SurfaceId surfaceId);
void preallocateShadowView(SurfaceId surfaceId, ShadowView const &shadowView);
void executeMount(MountingCoordinator::Shared const &mountingCoordinator);
void dispatchCommand(
ShadowView const &shadowView,
std::string const &commandName,
folly::dynamic const &args);
void sendAccessibilityEvent(
const ShadowView &shadowView,
std::string const &eventType);
void setIsJSResponder(
ShadowView const &shadowView,
bool isJSResponder,
bool blockNativeResponder);
void onAnimationStarted();
void onAllAnimationsComplete();
private:
jni::global_ref<jobject> javaUIManager_;
std::recursive_mutex commitMutex_;
butter::map<SurfaceId, butter::set<Tag>> allocatedViewRegistry_{};
std::recursive_mutex allocatedViewsMutex_;
bool const reduceDeleteCreateMutation_{false};
jni::local_ref<jobject> getProps(
ShadowView const &oldShadowView,
ShadowView const &newShadowView);
};
} // namespace react
} // namespace facebook