forked from microsoft/react-native-macos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReactPrimitives.h
More file actions
72 lines (61 loc) · 1.92 KB
/
ReactPrimitives.h
File metadata and controls
72 lines (61 loc) · 1.92 KB
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
/*
* 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 <string>
namespace facebook::react {
/*
* `Tag` and `InstanceHandle` are used to address React Native components.
*/
using Tag = int32_t;
/*
* An id of a running Surface instance that is used to refer to the instance.
*/
using SurfaceId = int32_t;
/*
* Universal component handle which allows to refer to `ComponentDescriptor`s
* in maps efficiently.
* Practically, it's something that concrete ShadowNode and concrete
* ComponentDescriptor have in common.
*/
using ComponentHandle = int64_t;
/*
* String identifier for components used for addressing them from
* JavaScript side.
*/
using ComponentName = const char*;
/*
* Defines how visual side effects (views, images, text, and so on) are
* mounted (on not) on the screen.
*/
enum class DisplayMode {
/*
* The surface is running normally. All visual side-effects will be rendered
* on the screen.
*/
Visible = 0,
/*
* The surface is `Suspended`. All new (committed after switching to the
* mode) visual side-effects will *not* be mounted on the screen (the screen
* will stop updating).
*
* The mode can be used for preparing a surface for possible future use.
* The surface will be prepared without spending computing resources
* on mounting, and then can be instantly mounted if needed.
*/
Suspended = 1,
/*
* The surface is `Hidden`. All previously mounted visual side-effects
* will be unmounted, and all new (committed after switching to the mode)
* visual side-effects will *not* be mounted on the screen until the mode is
* switched back to `normal`.
*
* The mode can be used for temporarily freeing computing resources of
* off-the-screen surfaces.
*/
Hidden = 2,
};
} // namespace facebook::react