Add launcher role to the role.db
[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_CAR_STOP      0x03
30 #define STM_EVT_NO_CAR_RUN       0x04
31 #define STM_EVT_NO_TIMER_EXPIRED 0x05
32 #define STM_EVT_NO_LAMP_OFF      0x06
33 #define STM_EVT_NO_LAMP_ON       0x07
34
35 // Category number
36 #define STM_CTG_NO_HOMESCREEN   0x0100
37 #define STM_CTG_NO_MAP          0x0200
38 #define STM_CTG_NO_GENERAL      0x0300
39 #define STM_CTG_NO_SPLITABLE    0x0400
40 #define STM_CTG_NO_POPUP        0x0500
41 #define STM_CTG_NO_SYSTEM_ALERT 0x0600
42
43 // Area number
44 #define STM_ARA_NO_FULL       0x010000
45 #define STM_ARA_NO_NORMAL     0x020000
46 #define STM_ARA_NO_SPLIT_MAIN 0x030000
47 #define STM_ARA_NO_SPLIT_SUB  0x040000
48 #define STM_ARA_NO_ON_SCREEN  0x050000
49
50 // Mask
51 #define STM_MSK_EVT_NO 0x0000FF
52 #define STM_MSK_CTG_NO 0x00FF00
53 #define STM_MSK_ARA_NO 0xFF0000
54
55 // Enum for state
56 enum stm_car_state_ {
57     gStmCarStateNoStop = 0,
58     gStmCarStateNoRun
59 };
60
61 enum stm_lamp_state_ {
62     gStmLampStateNoOff = 0,
63     gStmLampStateNoOn
64 };
65
66 enum stm_layout_ {
67     gStmLayoutNoNone = 0,
68     gStmLayoutNoPu,
69     gStmLayoutNoSa,
70     gStmLayoutNoM1,
71     gStmLayoutNoM2,
72     gStmLayoutNoMf,
73     gStmLayoutNoS1,
74     gStmLayoutNoS2,
75     gStmLayoutNoG,
76     gStmLayoutNoHs
77 };
78
79
80 #if 0
81 // String for state
82 const char* gStmCarStateNo2Name[] {
83     "car_stop",
84     "car_run"
85 };
86
87 const char* gStmLampStateNo2Name[] {
88     "lamp_off",
89     "lamp_on"
90 };
91
92 const char* gStmLayoutNo2Name[] {
93     "none",
94     "pu",
95     "sa",
96     "m1",
97     "m2",
98     "mf",
99     "s1",
100     "s2",
101     "g",
102     "hs",
103 };
104 #endif
105
106 typedef struct stm_base_state_ {
107     int is_changed;
108     int state;
109 } stm_base_state;
110
111 typedef struct stm_layer_state_ {
112     stm_base_state on_screen;
113     stm_base_state apps;
114     stm_base_state homescreen;
115 } stm_layer_state;
116
117 // Struct for state
118 typedef struct {
119     stm_base_state car;
120     stm_base_state lamp;
121     stm_layer_state layer;
122 } stm_state_t;
123
124 int stmTransitionState(int event_no, stm_state_t* state);
125
126
127 #endif  // TMCAGLWM_DUMMY_STM_HPP