2 * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
3 * Copyright (c) 2019 Konsulko Group
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #ifndef TMCAGLWM_STM_HPP
19 #define TMCAGLWM_STM_HPP
24 #define STM_CREATE_EVENT_ID(evt, ctg, area) \
25 ((evt) | ((ctg) << 8) | ((area) << 16))
27 #define STM_GET_EVENT_FROM_ID(id) \
30 #define STM_GET_CATEGORY_FROM_ID(id) \
33 #define STM_GET_AREA_FROM_ID(id) \
41 StmEvtNoRestrictionModeOff,
42 StmEvtNoRestrictionMode1On,
43 StmEvtNoRestrictionMode2On,
48 StmEvtNoMin = StmEvtNoNone,
49 StmEvtNoMax = StmEvtNoNum - 1,
63 StmCtgNoSoftwareKeyboard,
69 StmCtgNoMin = StmCtgNoNone,
70 StmCtgNoMax = StmCtgNoNum - 1,
81 StmAreaNoRestrictionNormal,
82 StmAreaNoRestrictionSplitMain,
83 StmAreaNoRestrictionSplitSub,
84 StmAreaNoSoftwareKyeboard,
85 StmAreaNoRemoteFullscreen,
89 StmAreaNoMin = StmAreaNoNone,
90 StmAreaNoMax = StmAreaNoNum - 1,
95 StmLayerNoHomescreen = 0,
97 StmLayerNoNearHomescreen,
98 StmLayerNoRestriction,
100 StmLayerNoRemoteApps,
104 StmLayerNoMin = StmLayerNoHomescreen,
105 StmLayerNoMax = StmLayerNoNum - 1,
108 // Layout kind number
121 StmLayoutNoRstSplMain,
122 StmLayoutNoRstSplSub,
126 StmLayoutNoDbgSplMain,
127 StmLayoutNoDbgSplSub,
133 StmLayoutNoMin = StmLayoutNoNone,
134 StmLayoutNoMax = StmLayoutNoNum - 1,
139 StmModeNoRestrictionMode = 0,
143 StmModeNoMin = StmModeNoRestrictionMode,
144 StmModeNoMax = StmModeNoNum - 1,
147 // Enum for mode state
148 enum StmRestrictionModeSttNo {
149 StmRestrictionModeSttNoOff = 0,
150 StmRestrictionModeSttNo1On,
151 StmRestrictionModeSttNo2On,
155 extern const char* kStmEventName[];
156 extern const char* kStmCategoryName[];
157 extern const char* kStmAreaName[];
158 extern const char* kStmLayoutName[];
159 extern const char* kStmLayerName[];
160 extern const char* kStmModeName[];
161 extern const char** kStmModeStateNameList[];
164 typedef struct StmBaseState {
169 typedef struct StmState {
170 StmBaseState mode[StmModeNoNum];
171 StmBaseState layer[StmLayerNoNum];
175 void stmInitialize();
176 int stmTransitionState(int event_no, StmState* state);
180 #endif // TMCAGLWM_STM_HPP