• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_ROSEN_WM_COMMON_INNER_H
17 #define OHOS_ROSEN_WM_COMMON_INNER_H
18 
19 #include <cinttypes>
20 
21 namespace OHOS {
22 namespace Rosen {
23 enum class WindowState : uint32_t {
24     STATE_INITIAL,
25     STATE_CREATED,
26     STATE_SHOWN,
27     STATE_HIDDEN,
28     STATE_FROZEN,
29     STATE_DESTROYED,
30     STATE_BOTTOM = STATE_DESTROYED,
31     STATE_UNFROZEN,
32 };
33 
34 enum class WindowStateChangeReason : uint32_t {
35     NORMAL,
36     KEYGUARD,
37 };
38 
39 enum class WindowUpdateReason : uint32_t {
40     NEED_SWITCH_CASCADE_BASE,
41     UPDATE_ALL = NEED_SWITCH_CASCADE_BASE,
42     UPDATE_MODE,
43     UPDATE_RECT,
44     UPDATE_FLAGS,
45     UPDATE_TYPE,
46     NEED_SWITCH_CASCADE_END,
47     UPDATE_OTHER_PROPS,
48 };
49 
50 enum class AvoidPosType : uint32_t {
51     AVOID_POS_LEFT,
52     AVOID_POS_TOP,
53     AVOID_POS_RIGHT,
54     AVOID_POS_BOTTOM,
55     AVOID_POS_UNKNOWN
56 };
57 
58 enum class PropertyChangeAction : uint32_t {
59     ACTION_UPDATE_RECT = 1,
60     ACTION_UPDATE_MODE = 1 << 1,
61     ACTION_UPDATE_FLAGS = 1 << 2,
62     ACTION_UPDATE_OTHER_PROPS = 1 << 3,
63     ACTION_UPDATE_FOCUSABLE = 1 << 4,
64     ACTION_UPDATE_TOUCHABLE = 1 << 5,
65     ACTION_UPDATE_CALLING_WINDOW = 1 << 6,
66     ACTION_UPDATE_ORIENTATION = 1 << 7,
67     ACTION_UPDATE_TURN_SCREEN_ON = 1 << 8,
68     ACTION_UPDATE_KEEP_SCREEN_ON = 1 << 9,
69     ACTION_UPDATE_SET_BRIGHTNESS = 1 << 10,
70 };
71 
72 namespace {
73     constexpr float DEFAULT_SPLIT_RATIO = 0.5;
74     constexpr uint32_t DIVIDER_WIDTH = 8;
75     constexpr uint32_t WINDOW_TITLE_BAR_HEIGHT = 37;
76     constexpr uint32_t WINDOW_FRAME_WIDTH = 5;
77     constexpr uint32_t WINDOW_FRAME_CORNER_WIDTH = 16; // the frame width of corner
78     constexpr uint32_t HOTZONE = 20;
79     constexpr uint32_t MIN_VERTICAL_FLOATING_WIDTH = 240;
80     constexpr uint32_t MIN_VERTICAL_FLOATING_HEIGHT = 320;
81     constexpr uint32_t MIN_VERTICAL_SPLIT_HEIGHT = 426;
82     constexpr uint32_t MIN_HORIZONTAL_SPLIT_WIDTH = 426;
83     constexpr uint32_t MAX_FLOATING_SIZE = 2560;
84 }
85 }
86 }
87 #endif // OHOS_ROSEN_WM_COMMON_INNER_H