Modify layout name
[apps/agl-service-windowmanager.git] / src / policy_manager / zipc / dummy_stm.h
1 /*
2  * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef TMCAGLWM_DUMMY_STM_HPP
18 #define TMCAGLWM_DUMMY_STM_HPP
19
20 // TODO: This file should be existed in STM
21
22 //
23 #define STM_TRUE 1
24 #define STM_FALSE 0
25
26 // Event number
27 #define STM_EVT_NO_ACTIVATE              0x01
28 #define STM_EVT_NO_DEACTIVATE            0x02
29 #define STM_EVT_NO_TRANS_GEAR_N          0x03
30 #define STM_EVT_NO_TRANS_GEAR_NOT_N      0x04
31 #define STM_EVT_NO_PARKING_BRAKE_OFF     0x05
32 #define STM_EVT_NO_PARKING_BRAKE_ON      0x06
33 #define STM_EVT_NO_ACCEL_PEDAL_OFF       0x07
34 #define STM_EVT_NO_ACCEL_PEDAL_ON        0x08
35 #define STM_EVT_NO_TIMER_EXPIRED         0x09
36 #define STM_EVT_NO_LAMP_OFF              0x0A
37 #define STM_EVT_NO_LAMP_ON               0x0B
38 #define STM_EVT_NO_LIGHTSTATUS_BRAKE_OFF 0x0C
39 #define STM_EVT_NO_LIGHTSTATUS_BRAKE_ON  0x0D
40 #define STM_EVT_NO_RESTRICTION_MODE_OFF  0x0E
41 #define STM_EVT_NO_RESTRICTION_MODE_ON   0x0F
42
43 // Category number
44 #define STM_CTG_NO_HOMESCREEN   0x0100
45 #define STM_CTG_NO_MAP          0x0200
46 #define STM_CTG_NO_GENERAL      0x0300
47 #define STM_CTG_NO_SPLITABLE    0x0400
48 #define STM_CTG_NO_POPUP        0x0500
49 #define STM_CTG_NO_SYSTEM_ALERT 0x0600
50 #define STM_CTG_NO_RESTRICTION  0x0700
51 #define STM_CTG_NO_SYSTEM       0x0800
52
53 // Area number
54 #define STM_ARA_NO_NONE                   0x010000
55 #define STM_ARA_NO_FULL                   0x020000
56 #define STM_ARA_NO_NORMAL                 0x030000
57 #define STM_ARA_NO_SPLIT_MAIN             0x040000
58 #define STM_ARA_NO_SPLIT_SUB              0x050000
59 #define STM_ARA_NO_POP_UP                 0x060000
60 #define STM_ARA_NO_RESTRICTION_NORMAL     0x070000
61 #define STM_ARA_NO_RESTRICTION_SPLIT_MAIN 0x080000
62 #define STM_ARA_NO_RESTRICTION_SPLIT_SUB  0x090000
63
64 // Mask
65 #define STM_MSK_EVT_NO 0x0000FF
66 #define STM_MSK_CTG_NO 0x00FF00
67 #define STM_MSK_ARA_NO 0xFF0000
68
69 // Enum for state
70 enum stm_trans_gear_state_ {
71     gStmTransGearStateNoN = 0,
72     gStmTransGearStateNoNotN
73 };
74
75 enum stm_parking_brake_state_ {
76     gStmParkingBrakeStateNoOff = 0,
77     gStmParkingBrakeStateNoOn
78 };
79
80 enum stm_accel_pedal_state_ {
81     gStmAccelPedalStateNoOff = 0,
82     gStmAccelPedalStateNoOn
83 };
84
85 enum stm_car_state_ {
86     gStmRunningNoStop = 0,
87     gStmRunningNoRun
88 };
89
90 enum stm_lamp_state_ {
91     gStmLampStateNoOff = 0,
92     gStmLampStateNoOn
93 };
94
95 enum stm_lightstatus_brake_state_ {
96     gStmLightstatusBrakeStateNoOff = 0,
97     gStmLightstatusBrakeStateNoOn
98 };
99
100 enum stm_restriction_mode_state_ {
101     gStmRestrictionModeStateNoOff = 0,
102     gStmRestrictionModeStateNoOn
103 };
104
105 enum stm_layout_ {
106     gStmLayoutNoNone = 0,
107     gStmLayoutNoPopUp,
108     gStmLayoutNoSysAlt,
109     gStmLayoutNoMapNml,
110     gStmLayoutNoMapSpl,
111     gStmLayoutNoMapFll,
112     gStmLayoutNoSplNml,
113     gStmLayoutNoSplSpl,
114     gStmLayoutNoGenNml,
115     gStmLayoutNoHms,
116     gStmLayoutNoRstNml,
117     gStmLayoutNoRstSplMain,
118     gStmLayoutNoRstSplSub,
119     gStmLayoutNoSysNml,
120
121     gStmLayoutNoNum,
122
123     gStmLayoutNoMin = gStmLayoutNoNone,
124     gStmLayoutNoMax = gStmLayoutNoNum - 1,
125 };
126
127 enum stm_event_ {
128     gStmEventNoActive = 0,
129     gStmEventNoDeactive,
130     gStmEventNoTransGearN,
131     gStmEventNoTransGearNotN,
132     gStmEventNoParkingBrakeOff,
133     gStmEventNoParkingBrakeOn,
134     gStmEventNoAccelPedalOff,
135     gStmEventNoAccelPedalOn,
136     gStmEventNoTimerExpired,
137     gStmEventNoLampOff,
138     gStmEventNoLampOn,
139     gStmEventNoLightstatusBrakeOff,
140     gStmEventNoLightstatusBrakeOn,
141     gStmEventNoRestrictionModeOff,
142     gStmEventNoRestrictionModeOn,
143
144     gStmEventNoNum,
145
146     gStmEventNoMin = gStmEventNoActive,
147     gStmEventNoMax = gStmEventNoNum - 1,
148 };
149
150 enum stm_category_ {
151     gStmCategoryNoHomescreen = 0,
152     gStmCategoryNoMap,
153     gStmCategoryNoGeneral,
154     gStmCategoryNoSplitable,
155     gStmCategoryNoPopup,
156     gStmCategoryNoSystemAlert,
157     gStmCategoryNoRestriction,
158
159     gStmCategoryNoNum,
160
161     gStmCategoryNoMin = gStmCategoryNoHomescreen,
162     gStmCategoryNoMax = gStmCategoryNoNum - 1,
163 };
164
165 enum stm_area_ {
166     gStmAreaNoNone = 0,
167     gStmAreaNoFullscreen,
168     gStmAreaNoNormal,
169     gStmAreaNoSplitMain,
170     gStmAreaNoSplitSub,
171     gStmAreaNoOnScreen,
172     gStmAreaNoRestrictionNormal,
173     gStmAreaNoRestrictionSplitMain,
174     gStmAreaNoRestrictionSplitSub,
175
176     gStmAreaNoNum,
177
178     gStmAreaNoMin = gStmAreaNoNone,
179     gStmAreaNoMax = gStmAreaNoNum - 1,
180 };
181
182 enum stm_layer_ {
183     gStmLayerNoHomescreen = 0,
184     gStmLayerNoApps,
185     gStmLayerNoRestriction,
186     gStmLayerNoOnScreen,
187
188     gStmLayerNoNum,
189
190     gStmLayerNoMin = gStmLayerNoHomescreen,
191     gStmLayerNoMax = gStmLayerNoNum - 1,
192 };
193
194 enum stm_car_element_ {
195     gStmCarElementNoTransGear = 0,
196     gStmCarElementNoParkingBrake,
197     gStmCarElementNoAccelPedal,
198     gStmCarElementNoRunning,
199     gStmCarElementNoLamp,
200     gStmCarElementNoLightstatusBrake,
201     gStmCarElementNoRestrictionMode,
202
203     gStmCarElementNoNum,
204
205     gStmCarElementNoMin = gStmCarElementNoTransGear,
206     gStmCarElementNoMax = gStmCarElementNoNum - 1,
207 };
208
209 // String for state
210 extern const char* gStmEventName[];
211 extern const int gStmEventNo[];
212 extern const char* gStmCategoryName[];
213 extern const int gStmCategoryNo[];
214 extern const char* gStmAreaName[];
215 extern const int gStmAreaNo[];
216 extern const char* gStmLayoutName[];
217 extern const char* gStmLayerName[];
218 extern const char* gStmCarElementName[];
219 extern const char** gStmCarStateNameList[];
220
221 // Struct for state
222 typedef struct stm_base_state_ {
223     int changed;
224     int state;
225 } stm_base_state;
226
227 typedef struct {
228     stm_base_state car_element[gStmCarElementNoNum];
229     stm_base_state layer[gStmLayerNoNum];
230 } stm_state_t;
231
232
233 void stmInitialize();
234 int stmTransitionState(int event_no, stm_state_t* state);
235 void stmUndoState();
236
237
238 #endif  // TMCAGLWM_DUMMY_STM_HPP