Add remote display support
[apps/agl-service-windowmanager.git] / policy_manager / stm / stm.c
1 /*
2  * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
3  * Copyright (c) 2019 Konsulko Group
4  *
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
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 #include <string.h>
19 #include "stm.h"
20 #include "stm_inner.h"
21
22 const char* kStmEventName[] = {
23     "none",
24     "activate",
25     "deactivate",
26     "restriction_mode_off",
27     "restriction_mode_1_on",
28     "restriction_mode_2_on",
29     "undo",
30 };
31
32 const char* kStmCategoryName[] = {
33     "none",
34     "homescreen",
35     "map",
36     "general",
37     "splitable",
38     "pop_up",
39     "system_alert",
40     "restriction",
41     "system",
42     "software_keyboard",
43     "debug",
44     "remote",
45 };
46
47 const char* kStmAreaName[] = {
48     "none",
49     "fullscreen",
50     "normal.full",
51     "split.main",
52     "split.sub",
53     "on_screen",
54     "restriction.normal",
55     "restriction.split.main",
56     "restriction.split.sub",
57     "software_keyboard",
58     "remote.fullscreen",
59 };
60
61 const char* kStmLayoutName[] = {
62     "none",
63     "pop_up",
64     "system_alert",
65     "map.normal",
66     "map.split",
67     "map.fullscreen",
68     "splitable.normal",
69     "splitable.split",
70     "general.normal",
71     "homescreen",
72     "restriction.normal",
73     "restriction.split.main",
74     "restriction.split.sub",
75     "system.normal",
76     "software_keyboard",
77     "debug.normal",
78     "debug.split.main",
79     "debug.split.sub",
80     "debug.fullscreen",
81     "remote.fullscreen",
82 };
83
84 const char* kStmLayerName[] = {
85     "homescreen",
86     "apps",
87     "near_homescreen",
88     "restriction",
89     "on_screen",
90     "remote_apps",
91 };
92
93 const char* kStmModeName[] = {
94     "trans_gear",
95     "parking_brake",
96     "accel_pedal",
97     "running",
98     "lamp",
99     "lightstatus_brake",
100     "restriction_mode",
101 };
102
103 const char* kStmRestrictionModeStateName[] = {
104     "off",
105     "1on",
106     "2on",
107 };
108
109 const char** kStmModeStateNameList[] = {
110     kStmRestrictionModeStateName,
111 };
112
113 void stmInitialize() {
114     stmInitializeInner();
115 }
116
117 int stmTransitionState(int event, StmState* state) {
118     return stmTransitionStateInner(event, state);
119 }
120
121 void stmUndoState() {
122     stmUndoStateInner();
123 }