2 * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef TMCAGLWM_STM_HPP
18 #define TMCAGLWM_STM_HPP
23 #define STM_CREATE_EVENT_ID(evt, ctg, area) \
24 ((evt) | ((ctg) << 8) | ((area) << 16))
26 #define STM_GET_EVENT_FROM_ID(id) \
29 #define STM_GET_CATEGORY_FROM_ID(id) \
32 #define STM_GET_AREA_FROM_ID(id) \
40 StmEvtNoRestrictionModeOff,
41 StmEvtNoRestrictionMode1On,
42 StmEvtNoRestrictionMode2On,
47 StmEvtNoMin = StmEvtNoNone,
48 StmEvtNoMax = StmEvtNoNum - 1,
62 StmCtgNoSoftwareKeyboard,
67 StmCtgNoMin = StmCtgNoNone,
68 StmCtgNoMax = StmCtgNoNum - 1,
79 StmAreaNoRestrictionNormal,
80 StmAreaNoRestrictionSplitMain,
81 StmAreaNoRestrictionSplitSub,
82 StmAreaNoSoftwareKyeboard,
86 StmAreaNoMin = StmAreaNoNone,
87 StmAreaNoMax = StmAreaNoNum - 1,
92 StmLayerNoHomescreen = 0,
94 StmLayerNoNearHomescreen,
95 StmLayerNoRestriction,
100 StmLayerNoMin = StmLayerNoHomescreen,
101 StmLayerNoMax = StmLayerNoNum - 1,
104 // Layout kind number
117 StmLayoutNoRstSplMain,
118 StmLayoutNoRstSplSub,
122 StmLayoutNoDbgSplMain,
123 StmLayoutNoDbgSplSub,
128 StmLayoutNoMin = StmLayoutNoNone,
129 StmLayoutNoMax = StmLayoutNoNum - 1,
134 StmModeNoRestrictionMode = 0,
138 StmModeNoMin = StmModeNoRestrictionMode,
139 StmModeNoMax = StmModeNoNum - 1,
142 // Enum for mode state
143 enum StmRestrictionModeSttNo {
144 StmRestrictionModeSttNoOff = 0,
145 StmRestrictionModeSttNo1On,
146 StmRestrictionModeSttNo2On,
150 extern const char* kStmEventName[];
151 extern const char* kStmCategoryName[];
152 extern const char* kStmAreaName[];
153 extern const char* kStmLayoutName[];
154 extern const char* kStmLayerName[];
155 extern const char* kStmModeName[];
156 extern const char** kStmModeStateNameList[];
159 typedef struct StmBaseState {
164 typedef struct StmState {
165 StmBaseState mode[StmModeNoNum];
166 StmBaseState layer[StmLayerNoNum];
170 void stmInitialize();
171 int stmTransitionState(int event_no, StmState* state);
175 #endif // TMCAGLWM_STM_HPP