[Local]: Lock Sequence from activateSurface to flushDraw
[apps/agl-service-windowmanager.git] / src / windowmanager-client.cpp
1 /*
2  * Copyright (c) 2017 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 "windowmanager-client.hpp"
18
19 namespace wm {
20
21 using std::string;
22
23 const std::vector<std::string> wm_events = {
24     "syncDraw", "flushDraw", "visible", "invisible", "active", "inactive"
25 };
26
27 WMClient::WMClient(const string &appid, unsigned layerID, unsigned surfaceID, const string &role)
28     :id(appid),
29     layer(layerID)
30 {
31     roles.push_back(role);
32     surfaces.push_back(surfaceID);
33     for(auto x: wm_events){
34         afb_event ev = afb_daemon_make_event(x.c_str());
35         event_list[x] = ev;
36     }
37 }
38
39 WMClient::WMClient(const string &appid, const string &role)
40     :id(appid)
41 {
42     roles.push_back(role);
43     for(auto x: wm_events){
44         afb_event ev = afb_daemon_make_event(x.c_str());
45         event_list[x] = ev;
46     }
47 }
48
49 WMClient::~WMClient(){
50 }
51
52 /* const std::vector<optional<unsigned>> surfaceIDList(){
53
54 }
55
56 std::optional<unsigned> surfaceID(role);
57
58 } */
59
60 }