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