New layer management in WindowManager. Three layers are created. One for the HomeScre...
[staging/HomeScreen.git] / interfaces / src / windowmanager.cpp
1 /*
2  * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
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 "include/windowmanager.hpp"
18
19 SimplePoint::SimplePoint()
20 {
21 }
22
23 SimplePoint::~SimplePoint()
24 {
25 }
26
27
28 LayoutArea::LayoutArea()
29 {
30 }
31
32 LayoutArea::~LayoutArea()
33 {
34 }
35
36
37 Layout::Layout():
38     id(-1),
39     name("N/A"),
40     layoutAreas()
41 {
42 }
43
44 Layout::Layout(int layoutId, const QString &layoutName, const QList<LayoutArea> &surfaceAreas):
45     id(layoutId),
46     name(layoutName),
47     layoutAreas(surfaceAreas)
48 {
49 }
50
51 Layout::~Layout()
52 {
53 }
54
55 QDBusArgument &operator <<(QDBusArgument &argument, const SimplePoint &mSimplePoint)
56 {
57         argument.beginStructure();
58         argument << mSimplePoint.x;
59         argument << mSimplePoint.y;
60         argument.endStructure();
61
62         return argument;
63 }
64
65 const QDBusArgument &operator >>(const QDBusArgument &argument, SimplePoint &mSimplePoint)
66 {
67         argument.beginStructure();
68     argument >> mSimplePoint.x;
69     argument >> mSimplePoint.y;
70         argument.endStructure();
71         return argument;
72 }
73
74 QDBusArgument &operator <<(QDBusArgument &argument, const LayoutArea &mLayoutArea)
75 {
76         argument.beginStructure();
77     argument << mLayoutArea.x;
78     argument << mLayoutArea.y;
79     argument << mLayoutArea.width;
80     argument << mLayoutArea.height;
81         argument.endStructure();
82
83         return argument;
84 }
85
86 const QDBusArgument &operator >>(const QDBusArgument &argument, LayoutArea &mLayoutArea)
87 {
88         argument.beginStructure();
89     argument >> mLayoutArea.x;
90     argument >> mLayoutArea.y;
91     argument >> mLayoutArea.width;
92     argument >> mLayoutArea.height;
93         argument.endStructure();
94         return argument;
95 }
96
97 QDBusArgument &operator <<(QDBusArgument &argument, const Layout &mLayout)
98 {
99     argument.beginStructure();
100     argument << mLayout.id;
101     argument << mLayout.name;
102     argument << mLayout.layoutAreas;
103     argument.endStructure();
104
105     return argument;
106 }
107
108 const QDBusArgument &operator >>(const QDBusArgument &argument, Layout &mLayout)
109 {
110     argument.beginStructure();
111     argument >> mLayout.id;
112     argument >> mLayout.name;
113     argument >> mLayout.layoutAreas;
114     argument.endStructure();
115     return argument;
116 }