Merge lp:~smspillaz/compiz-core/fix_899557 into lp:compiz-core/0.9.5
- fix_899557
- Merge into 0.9.5
Status: | Work in progress |
---|---|
Proposed branch: | lp:~smspillaz/compiz-core/fix_899557 |
Merge into: | lp:compiz-core/0.9.5 |
Prerequisite: | lp:~smspillaz/compiz-core/fix_898949 |
Diff against target: |
2504 lines (+2001/-132) 42 files modified
include/core/CMakeLists.txt (+12/-0) include/core/asynchronous-container.h (+93/-0) include/core/asynchronous-object.h (+94/-0) include/core/asynchronous-server.h (+79/-0) include/core/asynchronous-stack.h (+76/-0) include/core/container.h (+103/-0) include/core/object.h (+154/-0) include/core/server-read.h (+71/-0) include/core/server-write.h (+70/-0) include/core/server.h (+65/-0) include/core/stack.h (+87/-0) include/core/stackposition.h (+46/-0) include/core/window.h (+4/-2) plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp (+0/-12) plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp (+0/-8) plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h (+0/-4) plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp (+0/-12) plugins/place/src/screen-size-change/tests/test-screen-size-change.cpp (+0/-8) plugins/place/src/screen-size-change/tests/test-screen-size-change.h (+0/-3) src/CMakeLists.txt (+11/-0) src/asynchronous-container.cpp (+126/-0) src/asynchronous-object.cpp (+117/-0) src/asynchronous-server.cpp (+45/-0) src/asynchronous-stack.cpp (+99/-0) src/container.cpp (+182/-0) src/object.cpp (+204/-0) src/point/tests/point/src/test-point.cpp (+0/-5) src/point/tests/test-point.cpp (+0/-8) src/point/tests/test-point.h (+0/-5) src/privatewindow.h (+2/-3) src/rect/tests/rect/src/test-rect.cpp (+0/-13) src/server-read.cpp (+60/-0) src/server-write.cpp (+59/-0) src/server.cpp (+47/-0) src/stack.cpp (+71/-0) src/stackposition.cpp (+24/-0) src/window/constrainment/tests/test-window-constrainment.cpp (+0/-8) src/window/constrainment/tests/test-window-constrainment.h (+0/-4) src/window/constrainment/tests/to-hints/src/test-window-constrainment-to-hints.cpp (+0/-12) src/window/extents/tests/shift/src/test-window-extents-shift.cpp (+0/-13) src/window/extents/tests/test-window-extents.cpp (+0/-8) src/window/extents/tests/test-window-extents.h (+0/-4) |
To merge this branch: | bzr merge lp:~smspillaz/compiz-core/fix_899557 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Compiz Maintainers | Pending | ||
Review via email:
|
Commit message
Description of the change
Added a simple server-
geometry and stacking (not yet functional).
A server can be either synchronous or asynchronous in operation, as can an
object that is being displayed onscreen. Asynchronous objects own a write
connection object to the server and have events written to them by the read
connection object that the server owns.
Each window is part of an object tree, with parent and children objects. The
root object is specified as part of the server and its children are traversible.
Stack positions are kept for each container object, which is also an on-screen
object and geometry and stacking positions are done relative to the container.
Implementations should derive from the Synchronous* or Asynchronous* classes.
Typically Synchronous* implementations would be used for testing purposes.
Next Pipe: lp:~smspillaz/compiz-core/merge_894639
- 2939. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2940. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2941. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2942. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2943. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2944. By Sam Spilsbury
-
Added implementations for server read/write handles
- 2945. By Sam Spilsbury
-
Switched to an NVI type pattern in ObjectIdentifier, hooked up the
server connections to the Server and AsynchronousObjects - 2946. By Sam Spilsbury
-
Merge
- 2947. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2948. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2949. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2950. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2951. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2952. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2953. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2954. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2955. By Sam Spilsbury
-
Merge
- 2956. By Sam Spilsbury
-
Remove conflict
- 2957. By Sam Spilsbury
-
Merge
- 2958. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2959. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2960. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2961. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2962. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2963. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2964. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2965. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2966. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2967. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2968. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2969. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2970. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2971. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2972. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2973. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2974. By Sam Spilsbury
-
Remove empty boilerplate
- 2975. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2976. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2977. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2978. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2979. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2980. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2981. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2982. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2983. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557.
Unmerged revisions
- 2983. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2982. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2981. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2980. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2979. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2978. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2977. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2976. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2975. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898949 into compiz- core.fix_ 899557. - 2974. By Sam Spilsbury
-
Remove empty boilerplate
Preview Diff
1 | === modified file 'include/core/CMakeLists.txt' | |||
2 | --- include/core/CMakeLists.txt 2012-01-11 08:52:32 +0000 | |||
3 | +++ include/core/CMakeLists.txt 2012-01-11 08:52:33 +0000 | |||
4 | @@ -1,11 +1,17 @@ | |||
5 | 1 | set (_headers | 1 | set (_headers |
6 | 2 | action.h | 2 | action.h |
7 | 3 | asynchronous-container.h | ||
8 | 4 | asynchronous-object.h | ||
9 | 5 | asynchronous-server.h | ||
10 | 6 | asynchronous-stack.h | ||
11 | 3 | atoms.h | 7 | atoms.h |
12 | 8 | container.h | ||
13 | 4 | core.h | 9 | core.h |
14 | 5 | countedlist.h | 10 | countedlist.h |
15 | 6 | icon.h | 11 | icon.h |
16 | 7 | match.h | 12 | match.h |
17 | 8 | modifierhandler.h | 13 | modifierhandler.h |
18 | 14 | object.h | ||
19 | 9 | option.h | 15 | option.h |
20 | 10 | output.h | 16 | output.h |
21 | 11 | plugin.h | 17 | plugin.h |
22 | @@ -14,8 +20,14 @@ | |||
23 | 14 | region.h | 20 | region.h |
24 | 15 | screen.h | 21 | screen.h |
25 | 16 | serialization.h | 22 | serialization.h |
26 | 23 | server.h | ||
27 | 24 | server-read.h | ||
28 | 25 | server-write.h | ||
29 | 17 | session.h | 26 | session.h |
30 | 18 | size.h | 27 | size.h |
31 | 28 | stack.h | ||
32 | 29 | stackposition.h | ||
33 | 30 | valueholder.h | ||
34 | 19 | window.h | 31 | window.h |
35 | 20 | wrapsystem.h | 32 | wrapsystem.h |
36 | 21 | ) | 33 | ) |
37 | 22 | 34 | ||
38 | === added file 'include/core/asynchronous-container.h' | |||
39 | --- include/core/asynchronous-container.h 1970-01-01 00:00:00 +0000 | |||
40 | +++ include/core/asynchronous-container.h 2012-01-11 08:52:33 +0000 | |||
41 | @@ -0,0 +1,93 @@ | |||
42 | 1 | /* | ||
43 | 2 | * Copyright © 2011 Canonical Ltd. | ||
44 | 3 | * | ||
45 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
46 | 5 | * and its documentation for any purpose is hereby granted without | ||
47 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
48 | 7 | * and that both that copyright notice and this permission notice | ||
49 | 8 | * appear in supporting documentation, and that the name of | ||
50 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
51 | 10 | * distribution of the software without specific, written prior permission. | ||
52 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
53 | 12 | * software for any purpose. It is provided "as is" without express or | ||
54 | 13 | * implied warranty. | ||
55 | 14 | * | ||
56 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
57 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
58 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
59 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
60 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
61 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
62 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
63 | 22 | * | ||
64 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
65 | 24 | * David Reveman <davidr@novell.com> | ||
66 | 25 | */ | ||
67 | 26 | |||
68 | 27 | #ifndef _COMPIZ_ASYNCHRONOUS_CONTAINER_H | ||
69 | 28 | #define _COMPIZ_ASYNCHRONOUS_CONTAINER_H | ||
70 | 29 | |||
71 | 30 | #include <boost/shared_ptr.hpp> | ||
72 | 31 | #include <core/windowgeometry.h> | ||
73 | 32 | #include <core/stackposition.h> | ||
74 | 33 | #include <core/asynchronous-object.h> | ||
75 | 34 | #include <core/container.h> | ||
76 | 35 | |||
77 | 36 | namespace compiz | ||
78 | 37 | { | ||
79 | 38 | namespace window | ||
80 | 39 | { | ||
81 | 40 | |||
82 | 41 | class WriteServerConnection; | ||
83 | 42 | class ReadServerConnection; | ||
84 | 43 | |||
85 | 44 | class AsynchronousContainer : | ||
86 | 45 | public AsynchronousObject, | ||
87 | 46 | public Container | ||
88 | 47 | { | ||
89 | 48 | public: | ||
90 | 49 | |||
91 | 50 | typedef boost::shared_ptr <AsynchronousContainer> Ptr; | ||
92 | 51 | |||
93 | 52 | AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &, | ||
94 | 53 | const boost::shared_ptr <WriteServerConnection> &); | ||
95 | 54 | AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &, | ||
96 | 55 | const compiz::window::Geometry &, | ||
97 | 56 | const boost::shared_ptr <WriteServerConnection> &); | ||
98 | 57 | AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &, | ||
99 | 58 | const compiz::window::Geometry &, | ||
100 | 59 | const compiz::window::StackPosition &, | ||
101 | 60 | const boost::shared_ptr <WriteServerConnection> &); | ||
102 | 61 | AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &, | ||
103 | 62 | const compiz::window::Geometry &, | ||
104 | 63 | const compiz::window::StackPosition &, | ||
105 | 64 | const boost::shared_ptr <Container> &, | ||
106 | 65 | const boost::shared_ptr <WriteServerConnection> &); | ||
107 | 66 | |||
108 | 67 | virtual ~AsynchronousContainer (); | ||
109 | 68 | |||
110 | 69 | Container::Children sentChildren (); | ||
111 | 70 | |||
112 | 71 | void sendInsertion (const Object::Ptr &); | ||
113 | 72 | Object::Ptr sendRemoval (const Object::Ptr &); | ||
114 | 73 | |||
115 | 74 | protected: | ||
116 | 75 | |||
117 | 76 | void receiveInsertion (const Object::Ptr &); | ||
118 | 77 | void receiveRemoval (const Object::Ptr &); | ||
119 | 78 | |||
120 | 79 | void addSentInsertion (const Object::Ptr &); | ||
121 | 80 | Object::Ptr addSentRemoval (const Object::Ptr &); | ||
122 | 81 | |||
123 | 82 | friend class ReadServerConnection; | ||
124 | 83 | |||
125 | 84 | private: | ||
126 | 85 | |||
127 | 86 | Children mSentChildren; | ||
128 | 87 | boost::shared_ptr <WriteServerConnection> mWriteConnection; | ||
129 | 88 | }; | ||
130 | 89 | |||
131 | 90 | } | ||
132 | 91 | } | ||
133 | 92 | |||
134 | 93 | #endif | ||
135 | 0 | 94 | ||
136 | === added file 'include/core/asynchronous-object.h' | |||
137 | --- include/core/asynchronous-object.h 1970-01-01 00:00:00 +0000 | |||
138 | +++ include/core/asynchronous-object.h 2012-01-11 08:52:33 +0000 | |||
139 | @@ -0,0 +1,94 @@ | |||
140 | 1 | /* | ||
141 | 2 | * Copyright © 2011 Canonical Ltd. | ||
142 | 3 | * | ||
143 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
144 | 5 | * and its documentation for any purpose is hereby granted without | ||
145 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
146 | 7 | * and that both that copyright notice and this permission notice | ||
147 | 8 | * appear in supporting documentation, and that the name of | ||
148 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
149 | 10 | * distribution of the software without specific, written prior permission. | ||
150 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
151 | 12 | * software for any purpose. It is provided "as is" without express or | ||
152 | 13 | * implied warranty. | ||
153 | 14 | * | ||
154 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
155 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
156 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
157 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
158 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
159 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
160 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
161 | 22 | * | ||
162 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
163 | 24 | * David Reveman <davidr@novell.com> | ||
164 | 25 | */ | ||
165 | 26 | |||
166 | 27 | #ifndef _COMPIZ_ASYNCHRONOUS_OBJECT_H | ||
167 | 28 | #define _COMPIZ_ASYNCHRONOUS_OBJECT_H | ||
168 | 29 | |||
169 | 30 | #include <boost/shared_ptr.hpp> | ||
170 | 31 | #include <core/windowgeometry.h> | ||
171 | 32 | #include <core/stackposition.h> | ||
172 | 33 | #include <core/object.h> | ||
173 | 34 | |||
174 | 35 | |||
175 | 36 | namespace compiz | ||
176 | 37 | { | ||
177 | 38 | namespace window | ||
178 | 39 | { | ||
179 | 40 | |||
180 | 41 | class WriteServerConnection; | ||
181 | 42 | |||
182 | 43 | class AsynchronousObject : | ||
183 | 44 | virtual public Object | ||
184 | 45 | { | ||
185 | 46 | public: | ||
186 | 47 | |||
187 | 48 | typedef boost::shared_ptr <AsynchronousObject> Ptr; | ||
188 | 49 | |||
189 | 50 | AsynchronousObject (const ObjectIdentifier::Ptr &, | ||
190 | 51 | const boost::shared_ptr <WriteServerConnection> &); | ||
191 | 52 | AsynchronousObject (const ObjectIdentifier::Ptr &, | ||
192 | 53 | const compiz::window::Geometry &, | ||
193 | 54 | const boost::shared_ptr <WriteServerConnection> &); | ||
194 | 55 | AsynchronousObject (const ObjectIdentifier::Ptr &, | ||
195 | 56 | const compiz::window::Geometry &, | ||
196 | 57 | const compiz::window::StackPosition &, | ||
197 | 58 | const boost::shared_ptr <WriteServerConnection> &); | ||
198 | 59 | AsynchronousObject (const ObjectIdentifier::Ptr &, | ||
199 | 60 | const compiz::window::Geometry &, | ||
200 | 61 | const compiz::window::StackPosition &, | ||
201 | 62 | const boost::shared_ptr <Container> &, | ||
202 | 63 | const boost::shared_ptr <WriteServerConnection> &); | ||
203 | 64 | virtual ~AsynchronousObject (); | ||
204 | 65 | |||
205 | 66 | /* Most recent sent positions */ | ||
206 | 67 | const compiz::window::Geometry &sentGeometry () const; | ||
207 | 68 | const compiz::window::StackPosition &sentStackPosition () const; | ||
208 | 69 | |||
209 | 70 | void sendGeometry (const compiz::window::Geometry &); | ||
210 | 71 | void sendStackPosition (const compiz::window::StackPosition &); | ||
211 | 72 | |||
212 | 73 | protected: | ||
213 | 74 | |||
214 | 75 | void receiveGeometry (const compiz::window::Geometry &); | ||
215 | 76 | void receiveStackPosition (const compiz::window::StackPosition &); | ||
216 | 77 | //void receiveMap (); | ||
217 | 78 | |||
218 | 79 | void addSentGeometry (const compiz::window::Geometry &); | ||
219 | 80 | void addSentStackPosition (const compiz::window::StackPosition &); | ||
220 | 81 | |||
221 | 82 | boost::shared_ptr <WriteServerConnection> mWriteConnection; | ||
222 | 83 | |||
223 | 84 | friend class ReadServerConnection; | ||
224 | 85 | |||
225 | 86 | private: | ||
226 | 87 | |||
227 | 88 | compiz::window::Geometry mSentGeometry; | ||
228 | 89 | compiz::window::StackPosition mSentStackPosition; | ||
229 | 90 | }; | ||
230 | 91 | } | ||
231 | 92 | } | ||
232 | 93 | |||
233 | 94 | #endif | ||
234 | 0 | 95 | ||
235 | === added file 'include/core/asynchronous-server.h' | |||
236 | --- include/core/asynchronous-server.h 1970-01-01 00:00:00 +0000 | |||
237 | +++ include/core/asynchronous-server.h 2012-01-11 08:52:33 +0000 | |||
238 | @@ -0,0 +1,79 @@ | |||
239 | 1 | /* | ||
240 | 2 | * Copyright © 2011 Canonical Ltd. | ||
241 | 3 | * | ||
242 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
243 | 5 | * and its documentation for any purpose is hereby granted without | ||
244 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
245 | 7 | * and that both that copyright notice and this permission notice | ||
246 | 8 | * appear in supporting documentation, and that the name of | ||
247 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
248 | 10 | * distribution of the software without specific, written prior permission. | ||
249 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
250 | 12 | * software for any purpose. It is provided "as is" without express or | ||
251 | 13 | * implied warranty. | ||
252 | 14 | * | ||
253 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
254 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
255 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
256 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
257 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
258 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
259 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
260 | 22 | * | ||
261 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
262 | 24 | * David Reveman <davidr@novell.com> | ||
263 | 25 | */ | ||
264 | 26 | |||
265 | 27 | #ifndef _COMPIZ_ASYNCHRONOUS_SERVER_H | ||
266 | 28 | #define _COMPIZ_ASYNCHRONOUS_SERVER_H | ||
267 | 29 | |||
268 | 30 | #include <boost/shared_ptr.hpp> | ||
269 | 31 | #include <boost/enable_shared_from_this.hpp> | ||
270 | 32 | #include <boost/noncopyable.hpp> | ||
271 | 33 | #include <core/server.h> | ||
272 | 34 | #include <core/server-read.h> | ||
273 | 35 | #include <core/windowgeometry.h> | ||
274 | 36 | #include <core/stackposition.h> | ||
275 | 37 | #include <core/object.h> | ||
276 | 38 | #include <glibmm/main.h> | ||
277 | 39 | |||
278 | 40 | namespace compiz | ||
279 | 41 | { | ||
280 | 42 | namespace window | ||
281 | 43 | { | ||
282 | 44 | |||
283 | 45 | class WriteServerConnection; | ||
284 | 46 | |||
285 | 47 | class AsynchronousServer : | ||
286 | 48 | public Server, | ||
287 | 49 | public boost::enable_shared_from_this <AsynchronousServer> | ||
288 | 50 | { | ||
289 | 51 | public: | ||
290 | 52 | |||
291 | 53 | typedef boost::shared_ptr <AsynchronousServer> Ptr; | ||
292 | 54 | |||
293 | 55 | virtual ~AsynchronousServer (); | ||
294 | 56 | |||
295 | 57 | boost::shared_ptr <WriteServerConnection> connect (); | ||
296 | 58 | |||
297 | 59 | protected: | ||
298 | 60 | |||
299 | 61 | AsynchronousServer (); | ||
300 | 62 | |||
301 | 63 | virtual void sendGeometry (const ObjectIdentifier::Ptr &, | ||
302 | 64 | const compiz::window::Geometry &) = 0; | ||
303 | 65 | virtual void sendStackPosition (const ObjectIdentifier::Ptr &, | ||
304 | 66 | const compiz::window::StackPosition &) = 0; | ||
305 | 67 | virtual void sendParent (const ObjectIdentifier::Ptr &, | ||
306 | 68 | const ObjectIdentifier::Ptr &) = 0; | ||
307 | 69 | |||
308 | 70 | compiz::window::ReadServerConnection::Ptr mReadConnection; | ||
309 | 71 | Glib::RefPtr <Glib::Source> mEventSource; | ||
310 | 72 | |||
311 | 73 | friend class WriteServerConnection; | ||
312 | 74 | }; | ||
313 | 75 | |||
314 | 76 | } | ||
315 | 77 | } | ||
316 | 78 | |||
317 | 79 | #endif | ||
318 | 0 | 80 | ||
319 | === added file 'include/core/asynchronous-stack.h' | |||
320 | --- include/core/asynchronous-stack.h 1970-01-01 00:00:00 +0000 | |||
321 | +++ include/core/asynchronous-stack.h 2012-01-11 08:52:33 +0000 | |||
322 | @@ -0,0 +1,76 @@ | |||
323 | 1 | /* | ||
324 | 2 | * Copyright © 2011 Canonical Ltd. | ||
325 | 3 | * | ||
326 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
327 | 5 | * and its documentation for any purpose is hereby granted without | ||
328 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
329 | 7 | * and that both that copyright notice and this permission notice | ||
330 | 8 | * appear in supporting documentation, and that the name of | ||
331 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
332 | 10 | * distribution of the software without specific, written prior permission. | ||
333 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
334 | 12 | * software for any purpose. It is provided "as is" without express or | ||
335 | 13 | * implied warranty. | ||
336 | 14 | * | ||
337 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
338 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
339 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
340 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
341 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
342 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
343 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
344 | 22 | * | ||
345 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
346 | 24 | * David Reveman <davidr@novell.com> | ||
347 | 25 | */ | ||
348 | 26 | |||
349 | 27 | #ifndef _COMPIZ_ASYNCHRONOUS_STACK_H | ||
350 | 28 | #define _COMPIZ_ASYNCHRONOUS_STACK_H | ||
351 | 29 | |||
352 | 30 | #include <boost/shared_ptr.hpp> | ||
353 | 31 | #include <boost/noncopyable.hpp> | ||
354 | 32 | #include <core/object.h> | ||
355 | 33 | #include <core/stack.h> | ||
356 | 34 | #include <core/object.h> | ||
357 | 35 | #include <glibmm/main.h> | ||
358 | 36 | |||
359 | 37 | namespace compiz | ||
360 | 38 | { | ||
361 | 39 | namespace window | ||
362 | 40 | { | ||
363 | 41 | |||
364 | 42 | class AsynchronousServer; | ||
365 | 43 | class WriteServerConnection; | ||
366 | 44 | |||
367 | 45 | class AsynchronousStack : | ||
368 | 46 | public compiz::window::Stack | ||
369 | 47 | { | ||
370 | 48 | public: | ||
371 | 49 | |||
372 | 50 | typedef boost::shared_ptr <AsynchronousStack> Ptr; | ||
373 | 51 | virtual ~AsynchronousStack (); | ||
374 | 52 | |||
375 | 53 | const std::vector <Object::Ptr> & sentObjects () const; | ||
376 | 54 | |||
377 | 55 | void sendStack (const std::vector <Object::Ptr> &objects); | ||
378 | 56 | void sendRestackObject (const compiz::window::Object::Ptr &id, | ||
379 | 57 | const compiz::window::StackPosition &sp); | ||
380 | 58 | |||
381 | 59 | protected: | ||
382 | 60 | |||
383 | 61 | AsynchronousStack (const boost::shared_ptr <AsynchronousServer> &); | ||
384 | 62 | |||
385 | 63 | void receiveRestackObject (const compiz::window::Object::Ptr &o, | ||
386 | 64 | const compiz::window::StackPosition &sp); | ||
387 | 65 | |||
388 | 66 | private: | ||
389 | 67 | |||
390 | 68 | /* Bottom to top */ | ||
391 | 69 | std::vector <Object::Ptr> mSentObjects; | ||
392 | 70 | boost::shared_ptr <compiz::window::WriteServerConnection> mWriteConnection; | ||
393 | 71 | }; | ||
394 | 72 | |||
395 | 73 | } | ||
396 | 74 | } | ||
397 | 75 | |||
398 | 76 | #endif | ||
399 | 0 | 77 | ||
400 | === added file 'include/core/container.h' | |||
401 | --- include/core/container.h 1970-01-01 00:00:00 +0000 | |||
402 | +++ include/core/container.h 2012-01-11 08:52:33 +0000 | |||
403 | @@ -0,0 +1,103 @@ | |||
404 | 1 | /* | ||
405 | 2 | * Copyright © 2011 Canonical Ltd. | ||
406 | 3 | * | ||
407 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
408 | 5 | * and its documentation for any purpose is hereby granted without | ||
409 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
410 | 7 | * and that both that copyright notice and this permission notice | ||
411 | 8 | * appear in supporting documentation, and that the name of | ||
412 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
413 | 10 | * distribution of the software without specific, written prior permission. | ||
414 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
415 | 12 | * software for any purpose. It is provided "as is" without express or | ||
416 | 13 | * implied warranty. | ||
417 | 14 | * | ||
418 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
419 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
420 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
421 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
422 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
423 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
424 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
425 | 22 | * | ||
426 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
427 | 24 | * David Reveman <davidr@novell.com> | ||
428 | 25 | */ | ||
429 | 26 | |||
430 | 27 | #ifndef _COMPIZ_CONTAINER_H | ||
431 | 28 | #define _COMPIZ_CONTAINER_H | ||
432 | 29 | |||
433 | 30 | #include <boost/shared_ptr.hpp> | ||
434 | 31 | #include <core/windowgeometry.h> | ||
435 | 32 | #include <core/stackposition.h> | ||
436 | 33 | #include <core/object.h> | ||
437 | 34 | |||
438 | 35 | namespace compiz | ||
439 | 36 | { | ||
440 | 37 | namespace window | ||
441 | 38 | { | ||
442 | 39 | |||
443 | 40 | class Container : | ||
444 | 41 | virtual public Object | ||
445 | 42 | { | ||
446 | 43 | public: | ||
447 | 44 | |||
448 | 45 | typedef boost::shared_ptr <Container> Ptr; | ||
449 | 46 | typedef std::vector <Object::Ptr> Children; | ||
450 | 47 | |||
451 | 48 | Container (const compiz::window::ObjectIdentifier::Ptr &); | ||
452 | 49 | Container (const compiz::window::ObjectIdentifier::Ptr &, | ||
453 | 50 | const compiz::window::Geometry &); | ||
454 | 51 | Container (const compiz::window::ObjectIdentifier::Ptr &, | ||
455 | 52 | const compiz::window::Geometry &, | ||
456 | 53 | const compiz::window::StackPosition &); | ||
457 | 54 | Container (const compiz::window::ObjectIdentifier::Ptr &, | ||
458 | 55 | const compiz::window::Geometry &, | ||
459 | 56 | const compiz::window::StackPosition &, | ||
460 | 57 | const boost::shared_ptr <Container> &); | ||
461 | 58 | |||
462 | 59 | virtual ~Container (); | ||
463 | 60 | |||
464 | 61 | Children children (); | ||
465 | 62 | |||
466 | 63 | protected: | ||
467 | 64 | |||
468 | 65 | bool insert (const Object::Ptr &); | ||
469 | 66 | Object::Ptr remove (const compiz::window::ObjectIdentifier::Ptr &); | ||
470 | 67 | Object::Ptr remove (const Object::Ptr &); | ||
471 | 68 | |||
472 | 69 | private: | ||
473 | 70 | |||
474 | 71 | Children mChildren; | ||
475 | 72 | }; | ||
476 | 73 | |||
477 | 74 | class SynchronousContainer : | ||
478 | 75 | public SynchronousObject, | ||
479 | 76 | public Container | ||
480 | 77 | { | ||
481 | 78 | public: | ||
482 | 79 | |||
483 | 80 | typedef boost::shared_ptr <SynchronousContainer> Ptr; | ||
484 | 81 | |||
485 | 82 | SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &); | ||
486 | 83 | SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &, | ||
487 | 84 | const compiz::window::Geometry &); | ||
488 | 85 | SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &, | ||
489 | 86 | const compiz::window::Geometry &, | ||
490 | 87 | const compiz::window::StackPosition &); | ||
491 | 88 | SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &, | ||
492 | 89 | const compiz::window::Geometry &, | ||
493 | 90 | const compiz::window::StackPosition &, | ||
494 | 91 | const boost::shared_ptr <Container> &); | ||
495 | 92 | |||
496 | 93 | virtual ~SynchronousContainer (); | ||
497 | 94 | |||
498 | 95 | bool insert (const Object::Ptr &); | ||
499 | 96 | Object::Ptr remove (const compiz::window::ObjectIdentifier::Ptr &); | ||
500 | 97 | Object::Ptr remove (const Object::Ptr &); | ||
501 | 98 | }; | ||
502 | 99 | |||
503 | 100 | } | ||
504 | 101 | } | ||
505 | 102 | |||
506 | 103 | #endif | ||
507 | 0 | 104 | ||
508 | === added file 'include/core/object.h' | |||
509 | --- include/core/object.h 1970-01-01 00:00:00 +0000 | |||
510 | +++ include/core/object.h 2012-01-11 08:52:33 +0000 | |||
511 | @@ -0,0 +1,154 @@ | |||
512 | 1 | /* | ||
513 | 2 | * Copyright © 2011 Canonical Ltd. | ||
514 | 3 | * | ||
515 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
516 | 5 | * and its documentation for any purpose is hereby granted without | ||
517 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
518 | 7 | * and that both that copyright notice and this permission notice | ||
519 | 8 | * appear in supporting documentation, and that the name of | ||
520 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
521 | 10 | * distribution of the software without specific, written prior permission. | ||
522 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
523 | 12 | * software for any purpose. It is provided "as is" without express or | ||
524 | 13 | * implied warranty. | ||
525 | 14 | * | ||
526 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
527 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
528 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
529 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
530 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
531 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
532 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
533 | 22 | * | ||
534 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
535 | 24 | * David Reveman <davidr@novell.com> | ||
536 | 25 | */ | ||
537 | 26 | |||
538 | 27 | #ifndef _COMPIZ_OBJECT_H | ||
539 | 28 | #define _COMPIZ_OBJECT_H | ||
540 | 29 | |||
541 | 30 | #include <boost/shared_ptr.hpp> | ||
542 | 31 | #include <core/windowgeometry.h> | ||
543 | 32 | #include <core/stackposition.h> | ||
544 | 33 | #include <boost/enable_shared_from_this.hpp> | ||
545 | 34 | |||
546 | 35 | namespace compiz | ||
547 | 36 | { | ||
548 | 37 | namespace window | ||
549 | 38 | { | ||
550 | 39 | |||
551 | 40 | class Container; | ||
552 | 41 | class Object; | ||
553 | 42 | class ObjectIdentifier; | ||
554 | 43 | class Server; | ||
555 | 44 | |||
556 | 45 | bool objectIdentifierEq (const boost::shared_ptr <Object> &o, | ||
557 | 46 | const boost::shared_ptr <ObjectIdentifier> &i); | ||
558 | 47 | |||
559 | 48 | class ObjectIdentifier : | ||
560 | 49 | public boost::enable_shared_from_this <ObjectIdentifier> | ||
561 | 50 | { | ||
562 | 51 | public: | ||
563 | 52 | |||
564 | 53 | /* Available identifier types | ||
565 | 54 | * supported by this system */ | ||
566 | 55 | typedef enum | ||
567 | 56 | { | ||
568 | 57 | MockWire = 0, | ||
569 | 58 | X11 = 1 | ||
570 | 59 | } ObjectType; | ||
571 | 60 | |||
572 | 61 | typedef boost::shared_ptr <ObjectIdentifier> Ptr; | ||
573 | 62 | |||
574 | 63 | virtual ~ObjectIdentifier (); | ||
575 | 64 | |||
576 | 65 | bool operator== (const ObjectIdentifier::Ptr &) const; | ||
577 | 66 | bool operator!= (const ObjectIdentifier::Ptr &) const; | ||
578 | 67 | |||
579 | 68 | bool equal (const ObjectIdentifier::Ptr &) const; | ||
580 | 69 | |||
581 | 70 | const boost::shared_ptr <Object> & operator() (); | ||
582 | 71 | const boost::shared_ptr <Object> & operator() () const; | ||
583 | 72 | |||
584 | 73 | protected: | ||
585 | 74 | |||
586 | 75 | virtual bool compare (const ObjectIdentifier::Ptr &) const = 0; | ||
587 | 76 | virtual ObjectType getType () const = 0; | ||
588 | 77 | virtual const boost::shared_ptr <Object> & lookup () const = 0; | ||
589 | 78 | |||
590 | 79 | /* Either fully resolved or looked up | ||
591 | 80 | * at runtime in the repository */ | ||
592 | 81 | boost::shared_ptr <Object> mObj; | ||
593 | 82 | |||
594 | 83 | friend class Server; | ||
595 | 84 | }; | ||
596 | 85 | |||
597 | 86 | class Object | ||
598 | 87 | { | ||
599 | 88 | public: | ||
600 | 89 | |||
601 | 90 | typedef boost::shared_ptr <Object> Ptr; | ||
602 | 91 | |||
603 | 92 | Object (const ObjectIdentifier::Ptr &); | ||
604 | 93 | Object (const ObjectIdentifier::Ptr &, | ||
605 | 94 | const compiz::window::Geometry &); | ||
606 | 95 | Object (const ObjectIdentifier::Ptr &, | ||
607 | 96 | const compiz::window::Geometry &, | ||
608 | 97 | const compiz::window::StackPosition &); | ||
609 | 98 | Object (const ObjectIdentifier::Ptr &, | ||
610 | 99 | const compiz::window::Geometry &, | ||
611 | 100 | const compiz::window::StackPosition &, | ||
612 | 101 | const boost::shared_ptr <Container> &); | ||
613 | 102 | virtual ~Object (); | ||
614 | 103 | |||
615 | 104 | const boost::shared_ptr <Container> & container () const; | ||
616 | 105 | |||
617 | 106 | const ObjectIdentifier::Ptr & id () const; | ||
618 | 107 | const compiz::window::Geometry & geometry () const; | ||
619 | 108 | const compiz::window::StackPosition & stackPosition () const; | ||
620 | 109 | |||
621 | 110 | bool operator== (const Object &) const; | ||
622 | 111 | bool operator!= (const Object &) const; | ||
623 | 112 | |||
624 | 113 | protected: | ||
625 | 114 | |||
626 | 115 | bool setStackPosition (const StackPosition &); | ||
627 | 116 | bool setGeometry (const Geometry &); | ||
628 | 117 | //virtual bool show () = 0; | ||
629 | 118 | //virtual bool hide () = 0; | ||
630 | 119 | |||
631 | 120 | private: | ||
632 | 121 | |||
633 | 122 | ObjectIdentifier::Ptr mId; | ||
634 | 123 | compiz::window::Geometry mGeometry; | ||
635 | 124 | compiz::window::StackPosition mStackPosition; | ||
636 | 125 | boost::shared_ptr <Container> mContainer; | ||
637 | 126 | }; | ||
638 | 127 | |||
639 | 128 | class SynchronousObject : | ||
640 | 129 | virtual public Object | ||
641 | 130 | { | ||
642 | 131 | public: | ||
643 | 132 | |||
644 | 133 | typedef boost::shared_ptr <SynchronousObject> Ptr; | ||
645 | 134 | |||
646 | 135 | SynchronousObject (const ObjectIdentifier::Ptr &); | ||
647 | 136 | SynchronousObject (const ObjectIdentifier::Ptr &, | ||
648 | 137 | const compiz::window::Geometry &); | ||
649 | 138 | SynchronousObject (const ObjectIdentifier::Ptr &, | ||
650 | 139 | const compiz::window::Geometry &, | ||
651 | 140 | const compiz::window::StackPosition &); | ||
652 | 141 | SynchronousObject (const ObjectIdentifier::Ptr &, | ||
653 | 142 | const compiz::window::Geometry &, | ||
654 | 143 | const compiz::window::StackPosition &, | ||
655 | 144 | const boost::shared_ptr <Container> &); | ||
656 | 145 | virtual ~SynchronousObject (); | ||
657 | 146 | |||
658 | 147 | bool setStackPosition (const StackPosition &); | ||
659 | 148 | bool setGeometry (const Geometry &); | ||
660 | 149 | }; | ||
661 | 150 | |||
662 | 151 | } | ||
663 | 152 | } | ||
664 | 153 | |||
665 | 154 | #endif | ||
666 | 0 | 155 | ||
667 | === added file 'include/core/server-read.h' | |||
668 | --- include/core/server-read.h 1970-01-01 00:00:00 +0000 | |||
669 | +++ include/core/server-read.h 2012-01-11 08:52:33 +0000 | |||
670 | @@ -0,0 +1,71 @@ | |||
671 | 1 | /* | ||
672 | 2 | * Copyright © 2011 Canonical Ltd. | ||
673 | 3 | * | ||
674 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
675 | 5 | * and its documentation for any purpose is hereby granted without | ||
676 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
677 | 7 | * and that both that copyright notice and this permission notice | ||
678 | 8 | * appear in supporting documentation, and that the name of | ||
679 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
680 | 10 | * distribution of the software without specific, written prior permission. | ||
681 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
682 | 12 | * software for any purpose. It is provided "as is" without express or | ||
683 | 13 | * implied warranty. | ||
684 | 14 | * | ||
685 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
686 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
687 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
688 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
689 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
690 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
691 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
692 | 22 | * | ||
693 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
694 | 24 | * David Reveman <davidr@novell.com> | ||
695 | 25 | */ | ||
696 | 26 | |||
697 | 27 | #ifndef _COMPIZ_ASYNCHRONOUS_SERVER_READ_CONNECTION_H | ||
698 | 28 | #define _COMPIZ_ASYNCHRONOUS_SERVER_READ_CONNECTION_H | ||
699 | 29 | |||
700 | 30 | #include <boost/shared_ptr.hpp> | ||
701 | 31 | #include <boost/noncopyable.hpp> | ||
702 | 32 | #include <core/windowgeometry.h> | ||
703 | 33 | #include <core/stackposition.h> | ||
704 | 34 | #include <core/object.h> | ||
705 | 35 | #include <core/asynchronous-object.h> | ||
706 | 36 | #include <core/asynchronous-container.h> | ||
707 | 37 | |||
708 | 38 | namespace compiz | ||
709 | 39 | { | ||
710 | 40 | namespace window | ||
711 | 41 | { | ||
712 | 42 | |||
713 | 43 | class AsynchronousServer; | ||
714 | 44 | |||
715 | 45 | class ReadServerConnection : | ||
716 | 46 | public boost::noncopyable | ||
717 | 47 | { | ||
718 | 48 | public: | ||
719 | 49 | |||
720 | 50 | typedef boost::shared_ptr <ReadServerConnection> Ptr; | ||
721 | 51 | virtual ~ReadServerConnection (); | ||
722 | 52 | |||
723 | 53 | void receiveGeometry (const AsynchronousObject::Ptr &, | ||
724 | 54 | const compiz::window::Geometry &); | ||
725 | 55 | |||
726 | 56 | void receiveStackPosition (const AsynchronousObject::Ptr &, | ||
727 | 57 | const compiz::window::StackPosition &); | ||
728 | 58 | |||
729 | 59 | void receiveParent (const AsynchronousObject::Ptr &, | ||
730 | 60 | const AsynchronousContainer::Ptr &); | ||
731 | 61 | protected: | ||
732 | 62 | |||
733 | 63 | ReadServerConnection (); | ||
734 | 64 | |||
735 | 65 | friend class AsynchronousServer; | ||
736 | 66 | }; | ||
737 | 67 | |||
738 | 68 | } | ||
739 | 69 | } | ||
740 | 70 | |||
741 | 71 | #endif | ||
742 | 0 | 72 | ||
743 | === added file 'include/core/server-write.h' | |||
744 | --- include/core/server-write.h 1970-01-01 00:00:00 +0000 | |||
745 | +++ include/core/server-write.h 2012-01-11 08:52:33 +0000 | |||
746 | @@ -0,0 +1,70 @@ | |||
747 | 1 | /* | ||
748 | 2 | * Copyright © 2011 Canonical Ltd. | ||
749 | 3 | * | ||
750 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
751 | 5 | * and its documentation for any purpose is hereby granted without | ||
752 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
753 | 7 | * and that both that copyright notice and this permission notice | ||
754 | 8 | * appear in supporting documentation, and that the name of | ||
755 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
756 | 10 | * distribution of the software without specific, written prior permission. | ||
757 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
758 | 12 | * software for any purpose. It is provided "as is" without express or | ||
759 | 13 | * implied warranty. | ||
760 | 14 | * | ||
761 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
762 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
763 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
764 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
765 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
766 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
767 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
768 | 22 | * | ||
769 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
770 | 24 | * David Reveman <davidr@novell.com> | ||
771 | 25 | */ | ||
772 | 26 | |||
773 | 27 | #ifndef _COMPIZ_ASYNCHRONOUS_SERVER_WRITE_CONNECTION_H | ||
774 | 28 | #define _COMPIZ_ASYNCHRONOUS_SERVER_WRITE_CONNECTION_H | ||
775 | 29 | |||
776 | 30 | #include <core/asynchronous-server.h> | ||
777 | 31 | #include <boost/shared_ptr.hpp> | ||
778 | 32 | #include <boost/noncopyable.hpp> | ||
779 | 33 | #include <core/windowgeometry.h> | ||
780 | 34 | #include <core/stackposition.h> | ||
781 | 35 | #include <core/object.h> | ||
782 | 36 | |||
783 | 37 | namespace compiz | ||
784 | 38 | { | ||
785 | 39 | namespace window | ||
786 | 40 | { | ||
787 | 41 | |||
788 | 42 | class WriteServerConnection : | ||
789 | 43 | public boost::noncopyable | ||
790 | 44 | { | ||
791 | 45 | public: | ||
792 | 46 | |||
793 | 47 | typedef boost::shared_ptr <WriteServerConnection> Ptr; | ||
794 | 48 | virtual ~WriteServerConnection (); | ||
795 | 49 | |||
796 | 50 | void sendGeometry (const ObjectIdentifier::Ptr &id, | ||
797 | 51 | const compiz::window::Geometry &g); | ||
798 | 52 | |||
799 | 53 | void sendStackPosition (const ObjectIdentifier::Ptr &id, | ||
800 | 54 | const compiz::window::StackPosition &sp); | ||
801 | 55 | |||
802 | 56 | void sendParent (const ObjectIdentifier::Ptr &id, | ||
803 | 57 | const ObjectIdentifier::Ptr &parent); | ||
804 | 58 | private: | ||
805 | 59 | |||
806 | 60 | WriteServerConnection (const compiz::window::AsynchronousServer::Ptr &); | ||
807 | 61 | |||
808 | 62 | compiz::window::AsynchronousServer::Ptr mServer; | ||
809 | 63 | |||
810 | 64 | friend class AsynchronousServer; | ||
811 | 65 | }; | ||
812 | 66 | |||
813 | 67 | } | ||
814 | 68 | } | ||
815 | 69 | |||
816 | 70 | #endif | ||
817 | 0 | 71 | ||
818 | === added file 'include/core/server.h' | |||
819 | --- include/core/server.h 1970-01-01 00:00:00 +0000 | |||
820 | +++ include/core/server.h 2012-01-11 08:52:33 +0000 | |||
821 | @@ -0,0 +1,65 @@ | |||
822 | 1 | /* | ||
823 | 2 | * Copyright © 2011 Canonical Ltd. | ||
824 | 3 | * | ||
825 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
826 | 5 | * and its documentation for any purpose is hereby granted without | ||
827 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
828 | 7 | * and that both that copyright notice and this permission notice | ||
829 | 8 | * appear in supporting documentation, and that the name of | ||
830 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
831 | 10 | * distribution of the software without specific, written prior permission. | ||
832 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
833 | 12 | * software for any purpose. It is provided "as is" without express or | ||
834 | 13 | * implied warranty. | ||
835 | 14 | * | ||
836 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
837 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
838 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
839 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
840 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
841 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
842 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
843 | 22 | * | ||
844 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
845 | 24 | * David Reveman <davidr@novell.com> | ||
846 | 25 | */ | ||
847 | 26 | |||
848 | 27 | #ifndef _COMPIZ_SERVER_H | ||
849 | 28 | #define _COMPIZ_SERVER_H | ||
850 | 29 | |||
851 | 30 | #include <boost/shared_ptr.hpp> | ||
852 | 31 | #include <boost/noncopyable.hpp> | ||
853 | 32 | #include <core/object.h> | ||
854 | 33 | |||
855 | 34 | namespace compiz | ||
856 | 35 | { | ||
857 | 36 | namespace window | ||
858 | 37 | { | ||
859 | 38 | |||
860 | 39 | class Server : | ||
861 | 40 | public boost::noncopyable | ||
862 | 41 | { | ||
863 | 42 | public: | ||
864 | 43 | |||
865 | 44 | typedef boost::shared_ptr <Server> Ptr; | ||
866 | 45 | virtual ~Server (); | ||
867 | 46 | |||
868 | 47 | const Object::Ptr & root (); | ||
869 | 48 | virtual const Object::Ptr & lookup (const boost::shared_ptr <const ObjectIdentifier> &id) = 0; | ||
870 | 49 | |||
871 | 50 | static Server::Ptr Default (); | ||
872 | 51 | |||
873 | 52 | protected: | ||
874 | 53 | |||
875 | 54 | Server (); | ||
876 | 55 | |||
877 | 56 | private: | ||
878 | 57 | |||
879 | 58 | Object::Ptr mRoot; | ||
880 | 59 | static Server::Ptr mDefault; | ||
881 | 60 | }; | ||
882 | 61 | |||
883 | 62 | } | ||
884 | 63 | } | ||
885 | 64 | |||
886 | 65 | #endif | ||
887 | 0 | 66 | ||
888 | === added file 'include/core/stack.h' | |||
889 | --- include/core/stack.h 1970-01-01 00:00:00 +0000 | |||
890 | +++ include/core/stack.h 2012-01-11 08:52:33 +0000 | |||
891 | @@ -0,0 +1,87 @@ | |||
892 | 1 | /* | ||
893 | 2 | * Copyright © 2011 Canonical Ltd. | ||
894 | 3 | * | ||
895 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
896 | 5 | * and its documentation for any purpose is hereby granted without | ||
897 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
898 | 7 | * and that both that copyright notice and this permission notice | ||
899 | 8 | * appear in supporting documentation, and that the name of | ||
900 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
901 | 10 | * distribution of the software without specific, written prior permission. | ||
902 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
903 | 12 | * software for any purpose. It is provided "as is" without express or | ||
904 | 13 | * implied warranty. | ||
905 | 14 | * | ||
906 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
907 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
908 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
909 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
910 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
911 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
912 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
913 | 22 | * | ||
914 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
915 | 24 | * David Reveman <davidr@novell.com> | ||
916 | 25 | */ | ||
917 | 26 | |||
918 | 27 | #ifndef _COMPIZ_STACK_H | ||
919 | 28 | #define _COMPIZ_STACK_H | ||
920 | 29 | |||
921 | 30 | #include <boost/shared_ptr.hpp> | ||
922 | 31 | #include <boost/noncopyable.hpp> | ||
923 | 32 | #include <core/asynchronous-object.h> | ||
924 | 33 | #include <core/object.h> | ||
925 | 34 | #include <glibmm/main.h> | ||
926 | 35 | |||
927 | 36 | namespace compiz | ||
928 | 37 | { | ||
929 | 38 | namespace window | ||
930 | 39 | { | ||
931 | 40 | |||
932 | 41 | class Stack : | ||
933 | 42 | public boost::noncopyable | ||
934 | 43 | { | ||
935 | 44 | public: | ||
936 | 45 | |||
937 | 46 | typedef boost::shared_ptr <Stack> Ptr; | ||
938 | 47 | const std::vector <compiz::window::Object::Ptr> & objects () const; | ||
939 | 48 | virtual ~Stack (); | ||
940 | 49 | |||
941 | 50 | protected: | ||
942 | 51 | |||
943 | 52 | Stack (); | ||
944 | 53 | |||
945 | 54 | /* Rewrites entire window stack, throws | ||
946 | 55 | * if there are missing entities from | ||
947 | 56 | * mToplevelObjects to toplevelObjects */ | ||
948 | 57 | void setStack (const std::vector <Object::Ptr> &toplevelObjects); | ||
949 | 58 | |||
950 | 59 | /* Inserts a window at a StackPosition specified */ | ||
951 | 60 | void restackObject (const compiz::window::Object::Ptr &, | ||
952 | 61 | const compiz::window::StackPosition &); | ||
953 | 62 | |||
954 | 63 | /* Bottom to top */ | ||
955 | 64 | std::vector <Object::Ptr> mObjects; | ||
956 | 65 | }; | ||
957 | 66 | |||
958 | 67 | class SynchronousStack : | ||
959 | 68 | public compiz::window::Stack | ||
960 | 69 | { | ||
961 | 70 | public: | ||
962 | 71 | |||
963 | 72 | typedef boost::shared_ptr <SynchronousStack> Ptr; | ||
964 | 73 | virtual ~SynchronousStack (); | ||
965 | 74 | |||
966 | 75 | void setStack (const std::vector <Object::Ptr> &toplevelObjects); | ||
967 | 76 | void restackObject (const compiz::window::Object::Ptr &, | ||
968 | 77 | const compiz::window::StackPosition &); | ||
969 | 78 | |||
970 | 79 | protected: | ||
971 | 80 | |||
972 | 81 | SynchronousStack (); | ||
973 | 82 | }; | ||
974 | 83 | |||
975 | 84 | } | ||
976 | 85 | } | ||
977 | 86 | |||
978 | 87 | #endif | ||
979 | 0 | 88 | ||
980 | === added file 'include/core/stackposition.h' | |||
981 | --- include/core/stackposition.h 1970-01-01 00:00:00 +0000 | |||
982 | +++ include/core/stackposition.h 2012-01-11 08:52:33 +0000 | |||
983 | @@ -0,0 +1,46 @@ | |||
984 | 1 | /* | ||
985 | 2 | * Copyright © 2011 Canonical Ltd. | ||
986 | 3 | * | ||
987 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
988 | 5 | * and its documentation for any purpose is hereby granted without | ||
989 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
990 | 7 | * and that both that copyright notice and this permission notice | ||
991 | 8 | * appear in supporting documentation, and that the name of | ||
992 | 9 | * Dennis Kasprzyk not be used in advertising or publicity pertaining to | ||
993 | 10 | * distribution of the software without specific, written prior permission. | ||
994 | 11 | * Dennis Kasprzyk makes no representations about the suitability of this | ||
995 | 12 | * software for any purpose. It is provided "as is" without express or | ||
996 | 13 | * implied warranty. | ||
997 | 14 | * | ||
998 | 15 | * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
999 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
1000 | 17 | * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
1001 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
1002 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
1003 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
1004 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
1005 | 22 | * | ||
1006 | 23 | * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> | ||
1007 | 24 | * David Reveman <davidr@novell.com> | ||
1008 | 25 | */ | ||
1009 | 26 | |||
1010 | 27 | #ifndef _COMPIZ_STACKPOSITION_H | ||
1011 | 28 | #define _COMPIZ_STACKPOSITION_H | ||
1012 | 29 | |||
1013 | 30 | |||
1014 | 31 | namespace compiz | ||
1015 | 32 | { | ||
1016 | 33 | namespace window | ||
1017 | 34 | { | ||
1018 | 35 | |||
1019 | 36 | class StackPosition | ||
1020 | 37 | { | ||
1021 | 38 | public: | ||
1022 | 39 | |||
1023 | 40 | typedef boost::shared_ptr <StackPosition> Ptr; | ||
1024 | 41 | }; | ||
1025 | 42 | |||
1026 | 43 | } | ||
1027 | 44 | } | ||
1028 | 45 | |||
1029 | 46 | #endif | ||
1030 | 0 | 47 | ||
1031 | === modified file 'include/core/window.h' | |||
1032 | --- include/core/window.h 2012-01-11 08:52:32 +0000 | |||
1033 | +++ include/core/window.h 2012-01-11 08:52:33 +0000 | |||
1034 | @@ -29,6 +29,7 @@ | |||
1035 | 29 | #define _COMPWINDOW_H | 29 | #define _COMPWINDOW_H |
1036 | 30 | 30 | ||
1037 | 31 | #include <boost/function.hpp> | 31 | #include <boost/function.hpp> |
1038 | 32 | #include <boost/shared_ptr.hpp> | ||
1039 | 32 | 33 | ||
1040 | 33 | #include <X11/Xlib-xcb.h> | 34 | #include <X11/Xlib-xcb.h> |
1041 | 34 | #include <X11/Xutil.h> | 35 | #include <X11/Xutil.h> |
1042 | @@ -42,9 +43,11 @@ | |||
1043 | 42 | #include <core/point.h> | 43 | #include <core/point.h> |
1044 | 43 | #include <core/region.h> | 44 | #include <core/region.h> |
1045 | 44 | #include <core/windowgeometry.h> | 45 | #include <core/windowgeometry.h> |
1046 | 46 | #include <core/windowconstrainment.h> | ||
1047 | 45 | #include <core/windowgeometrysaver.h> | 47 | #include <core/windowgeometrysaver.h> |
1048 | 46 | #include <core/windowextents.h> | 48 | #include <core/windowextents.h> |
1050 | 47 | #include <core/windowconstrainment.h> | 49 | #include <core/asynchronous-container.h> |
1051 | 50 | #include <core/asynchronous-object.h> | ||
1052 | 48 | 51 | ||
1053 | 49 | #include <core/wrapsystem.h> | 52 | #include <core/wrapsystem.h> |
1054 | 50 | 53 | ||
1055 | @@ -246,7 +249,6 @@ | |||
1056 | 246 | } | 249 | } |
1057 | 247 | } | 250 | } |
1058 | 248 | 251 | ||
1059 | 249 | |||
1060 | 250 | /** | 252 | /** |
1061 | 251 | * Wrappable core window functions. Derive from this class | 253 | * Wrappable core window functions. Derive from this class |
1062 | 252 | * and overload these functions in order to have your function called | 254 | * and overload these functions in order to have your function called |
1063 | 253 | 255 | ||
1064 | === modified file 'plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp' | |||
1065 | --- plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 2012-01-11 08:52:32 +0000 | |||
1066 | +++ plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 2012-01-11 08:52:33 +0000 | |||
1067 | @@ -32,20 +32,8 @@ | |||
1068 | 32 | class CompPlaceTestConstrainToWorkarea : | 32 | class CompPlaceTestConstrainToWorkarea : |
1069 | 33 | public CompPlaceTest | 33 | public CompPlaceTest |
1070 | 34 | { | 34 | { |
1071 | 35 | public: | ||
1072 | 36 | |||
1073 | 37 | CompPlaceTestConstrainToWorkarea (); | ||
1074 | 38 | ~CompPlaceTestConstrainToWorkarea (); | ||
1075 | 39 | }; | 35 | }; |
1076 | 40 | 36 | ||
1077 | 41 | CompPlaceTestConstrainToWorkarea::CompPlaceTestConstrainToWorkarea () | ||
1078 | 42 | { | ||
1079 | 43 | } | ||
1080 | 44 | |||
1081 | 45 | CompPlaceTestConstrainToWorkarea::~CompPlaceTestConstrainToWorkarea () | ||
1082 | 46 | { | ||
1083 | 47 | } | ||
1084 | 48 | |||
1085 | 49 | TEST_F (CompPlaceTestConstrainToWorkarea, TestConstrainToWorkarea) | 37 | TEST_F (CompPlaceTestConstrainToWorkarea, TestConstrainToWorkarea) |
1086 | 50 | { | 38 | { |
1087 | 51 | CompSize screensize (1000, 2000); | 39 | CompSize screensize (1000, 2000); |
1088 | 52 | 40 | ||
1089 | === modified file 'plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp' | |||
1090 | --- plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp 2012-01-11 08:52:32 +0000 | |||
1091 | +++ plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp 2012-01-11 08:52:33 +0000 | |||
1092 | @@ -24,11 +24,3 @@ | |||
1093 | 24 | */ | 24 | */ |
1094 | 25 | 25 | ||
1095 | 26 | #include "test-constrain-to-workarea.h" | 26 | #include "test-constrain-to-workarea.h" |
1096 | 27 | |||
1097 | 28 | CompPlaceTest::CompPlaceTest () | ||
1098 | 29 | { | ||
1099 | 30 | } | ||
1100 | 31 | |||
1101 | 32 | CompPlaceTest::~CompPlaceTest () | ||
1102 | 33 | { | ||
1103 | 34 | } | ||
1104 | 35 | 27 | ||
1105 | === modified file 'plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h' | |||
1106 | --- plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h 2012-01-11 08:52:32 +0000 | |||
1107 | +++ plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h 2012-01-11 08:52:33 +0000 | |||
1108 | @@ -39,10 +39,6 @@ | |||
1109 | 39 | 39 | ||
1110 | 40 | class CompPlaceTest : public ::testing::Test | 40 | class CompPlaceTest : public ::testing::Test |
1111 | 41 | { | 41 | { |
1112 | 42 | public: | ||
1113 | 43 | |||
1114 | 44 | CompPlaceTest (); | ||
1115 | 45 | virtual ~CompPlaceTest (); | ||
1116 | 46 | }; | 42 | }; |
1117 | 47 | 43 | ||
1118 | 48 | #endif | 44 | #endif |
1119 | 49 | 45 | ||
1120 | === modified file 'plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp' | |||
1121 | --- plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp 2012-01-11 08:52:32 +0000 | |||
1122 | +++ plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp 2012-01-11 08:52:33 +0000 | |||
1123 | @@ -32,20 +32,8 @@ | |||
1124 | 32 | class CompPlaceScreenSizeChangeTestScreenSizeChange : | 32 | class CompPlaceScreenSizeChangeTestScreenSizeChange : |
1125 | 33 | public CompPlaceScreenSizeChangeTest | 33 | public CompPlaceScreenSizeChangeTest |
1126 | 34 | { | 34 | { |
1127 | 35 | public: | ||
1128 | 36 | |||
1129 | 37 | CompPlaceScreenSizeChangeTestScreenSizeChange (); | ||
1130 | 38 | ~CompPlaceScreenSizeChangeTestScreenSizeChange (); | ||
1131 | 39 | }; | 35 | }; |
1132 | 40 | 36 | ||
1133 | 41 | CompPlaceScreenSizeChangeTestScreenSizeChange::CompPlaceScreenSizeChangeTestScreenSizeChange () | ||
1134 | 42 | { | ||
1135 | 43 | } | ||
1136 | 44 | |||
1137 | 45 | CompPlaceScreenSizeChangeTestScreenSizeChange::~CompPlaceScreenSizeChangeTestScreenSizeChange () | ||
1138 | 46 | { | ||
1139 | 47 | } | ||
1140 | 48 | |||
1141 | 49 | class MockScreenSizeChangeObject : | 37 | class MockScreenSizeChangeObject : |
1142 | 50 | public compiz::place::ScreenSizeChangeObject | 38 | public compiz::place::ScreenSizeChangeObject |
1143 | 51 | { | 39 | { |
1144 | 52 | 40 | ||
1145 | === modified file 'plugins/place/src/screen-size-change/tests/test-screen-size-change.cpp' | |||
1146 | --- plugins/place/src/screen-size-change/tests/test-screen-size-change.cpp 2012-01-11 08:52:32 +0000 | |||
1147 | +++ plugins/place/src/screen-size-change/tests/test-screen-size-change.cpp 2012-01-11 08:52:33 +0000 | |||
1148 | @@ -24,11 +24,3 @@ | |||
1149 | 24 | */ | 24 | */ |
1150 | 25 | 25 | ||
1151 | 26 | #include "test-screen-size-change.h" | 26 | #include "test-screen-size-change.h" |
1152 | 27 | |||
1153 | 28 | CompPlaceScreenSizeChangeTest::CompPlaceScreenSizeChangeTest () | ||
1154 | 29 | { | ||
1155 | 30 | } | ||
1156 | 31 | |||
1157 | 32 | CompPlaceScreenSizeChangeTest::~CompPlaceScreenSizeChangeTest () | ||
1158 | 33 | { | ||
1159 | 34 | } | ||
1160 | 35 | 27 | ||
1161 | === modified file 'plugins/place/src/screen-size-change/tests/test-screen-size-change.h' | |||
1162 | --- plugins/place/src/screen-size-change/tests/test-screen-size-change.h 2012-01-11 08:52:32 +0000 | |||
1163 | +++ plugins/place/src/screen-size-change/tests/test-screen-size-change.h 2012-01-11 08:52:33 +0000 | |||
1164 | @@ -41,9 +41,6 @@ | |||
1165 | 41 | public ::testing::Test | 41 | public ::testing::Test |
1166 | 42 | { | 42 | { |
1167 | 43 | public: | 43 | public: |
1168 | 44 | |||
1169 | 45 | CompPlaceScreenSizeChangeTest (); | ||
1170 | 46 | virtual ~CompPlaceScreenSizeChangeTest (); | ||
1171 | 47 | }; | 44 | }; |
1172 | 48 | 45 | ||
1173 | 49 | #endif | 46 | #endif |
1174 | 50 | 47 | ||
1175 | === modified file 'src/CMakeLists.txt' | |||
1176 | --- src/CMakeLists.txt 2012-01-11 08:52:32 +0000 | |||
1177 | +++ src/CMakeLists.txt 2012-01-11 08:52:33 +0000 | |||
1178 | @@ -98,6 +98,17 @@ | |||
1179 | 98 | ${CMAKE_CURRENT_SOURCE_DIR}/propertywriter.cpp | 98 | ${CMAKE_CURRENT_SOURCE_DIR}/propertywriter.cpp |
1180 | 99 | ${CMAKE_CURRENT_SOURCE_DIR}/eventsource.cpp | 99 | ${CMAKE_CURRENT_SOURCE_DIR}/eventsource.cpp |
1181 | 100 | ${CMAKE_CURRENT_SOURCE_DIR}/stackdebugger.cpp | 100 | ${CMAKE_CURRENT_SOURCE_DIR}/stackdebugger.cpp |
1182 | 101 | ${CMAKE_CURRENT_SOURCE_DIR}/object.cpp | ||
1183 | 102 | ${CMAKE_CURRENT_SOURCE_DIR}/container.cpp | ||
1184 | 103 | ${CMAKE_CURRENT_SOURCE_DIR}/asynchronous-object.cpp | ||
1185 | 104 | ${CMAKE_CURRENT_SOURCE_DIR}/asynchronous-container.cpp | ||
1186 | 105 | ${CMAKE_CURRENT_SOURCE_DIR}/asynchronous-server.cpp | ||
1187 | 106 | ${CMAKE_CURRENT_SOURCE_DIR}/stackposition.cpp | ||
1188 | 107 | ${CMAKE_CURRENT_SOURCE_DIR}/server.cpp | ||
1189 | 108 | ${CMAKE_CURRENT_SOURCE_DIR}/server-read.cpp | ||
1190 | 109 | ${CMAKE_CURRENT_SOURCE_DIR}/server-write.cpp | ||
1191 | 110 | ${CMAKE_CURRENT_SOURCE_DIR}/stack.cpp | ||
1192 | 111 | ${CMAKE_CURRENT_SOURCE_DIR}/asynchronous-stack.cpp | ||
1193 | 101 | ${_bcop_sources} | 112 | ${_bcop_sources} |
1194 | 102 | ) | 113 | ) |
1195 | 103 | 114 | ||
1196 | 104 | 115 | ||
1197 | === added file 'src/asynchronous-container.cpp' | |||
1198 | --- src/asynchronous-container.cpp 1970-01-01 00:00:00 +0000 | |||
1199 | +++ src/asynchronous-container.cpp 2012-01-11 08:52:33 +0000 | |||
1200 | @@ -0,0 +1,126 @@ | |||
1201 | 1 | /* | ||
1202 | 2 | * Copyright © 2010 Canonical Ltd. | ||
1203 | 3 | * | ||
1204 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
1205 | 5 | * and its documentation for any purpose is hereby granted without | ||
1206 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
1207 | 7 | * and that both that copyright notice and this permission notice | ||
1208 | 8 | * appear in supporting documentation, and that the name of | ||
1209 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
1210 | 10 | * distribution of the software without specific, written prior permission. | ||
1211 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
1212 | 12 | * software for any purpose. It is provided "as is" without express or | ||
1213 | 13 | * implied warranty. | ||
1214 | 14 | * | ||
1215 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
1216 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
1217 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
1218 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
1219 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
1220 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
1221 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
1222 | 22 | * | ||
1223 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
1224 | 24 | */ | ||
1225 | 25 | |||
1226 | 26 | #include <core/asynchronous-container.h> | ||
1227 | 27 | #include <core/server-write.h> | ||
1228 | 28 | #include <core/server.h> | ||
1229 | 29 | |||
1230 | 30 | compiz::window::AsynchronousContainer::AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1231 | 31 | const compiz::window::WriteServerConnection::Ptr &writer) : | ||
1232 | 32 | Object::Object (id), | ||
1233 | 33 | AsynchronousObject::AsynchronousObject (id, writer), | ||
1234 | 34 | Container::Container (id) | ||
1235 | 35 | { | ||
1236 | 36 | } | ||
1237 | 37 | |||
1238 | 38 | compiz::window::AsynchronousContainer::AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1239 | 39 | const compiz::window::Geometry &g, | ||
1240 | 40 | const compiz::window::WriteServerConnection::Ptr &writer) : | ||
1241 | 41 | Object::Object (id, g), | ||
1242 | 42 | AsynchronousObject::AsynchronousObject (id, g, writer), | ||
1243 | 43 | Container::Container (id, g) | ||
1244 | 44 | { | ||
1245 | 45 | } | ||
1246 | 46 | |||
1247 | 47 | compiz::window::AsynchronousContainer::AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1248 | 48 | const compiz::window::Geometry &g, | ||
1249 | 49 | const compiz::window::StackPosition &sp, | ||
1250 | 50 | const compiz::window::WriteServerConnection::Ptr &writer) : | ||
1251 | 51 | Object::Object (id, g, sp), | ||
1252 | 52 | AsynchronousObject::AsynchronousObject (id, g, sp, writer), | ||
1253 | 53 | Container::Container (id, g, sp) | ||
1254 | 54 | { | ||
1255 | 55 | } | ||
1256 | 56 | |||
1257 | 57 | compiz::window::AsynchronousContainer::AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1258 | 58 | const compiz::window::Geometry &g, | ||
1259 | 59 | const compiz::window::StackPosition &sp, | ||
1260 | 60 | const boost::shared_ptr <Container> &c, | ||
1261 | 61 | const compiz::window::WriteServerConnection::Ptr &writer) : | ||
1262 | 62 | Object::Object (id, g, sp, c), | ||
1263 | 63 | AsynchronousObject::AsynchronousObject (id, g, sp , c, writer), | ||
1264 | 64 | Container::Container (id, g, sp, c) | ||
1265 | 65 | { | ||
1266 | 66 | } | ||
1267 | 67 | |||
1268 | 68 | compiz::window::AsynchronousContainer::~AsynchronousContainer () | ||
1269 | 69 | { | ||
1270 | 70 | } | ||
1271 | 71 | |||
1272 | 72 | void | ||
1273 | 73 | compiz::window::AsynchronousContainer::sendInsertion (const Object::Ptr &o) | ||
1274 | 74 | { | ||
1275 | 75 | mWriteConnection->sendParent (o->id (), id ()); | ||
1276 | 76 | |||
1277 | 77 | addSentInsertion (o); | ||
1278 | 78 | } | ||
1279 | 79 | |||
1280 | 80 | compiz::window::Object::Ptr | ||
1281 | 81 | compiz::window::AsynchronousContainer::sendRemoval (const Object::Ptr &o) | ||
1282 | 82 | { | ||
1283 | 83 | Object::Ptr p = addSentRemoval (o); | ||
1284 | 84 | |||
1285 | 85 | mWriteConnection->sendParent (o->id (), Server::Default ()->root ()->id ()); | ||
1286 | 86 | |||
1287 | 87 | return p; | ||
1288 | 88 | } | ||
1289 | 89 | |||
1290 | 90 | void | ||
1291 | 91 | compiz::window::AsynchronousContainer::receiveInsertion (const Object::Ptr &o) | ||
1292 | 92 | { | ||
1293 | 93 | Container::insert (o); | ||
1294 | 94 | } | ||
1295 | 95 | |||
1296 | 96 | void | ||
1297 | 97 | compiz::window::AsynchronousContainer::receiveRemoval (const Object::Ptr &o) | ||
1298 | 98 | { | ||
1299 | 99 | Container::remove (o); | ||
1300 | 100 | } | ||
1301 | 101 | |||
1302 | 102 | void | ||
1303 | 103 | compiz::window::AsynchronousContainer::addSentInsertion (const Object::Ptr &o) | ||
1304 | 104 | { | ||
1305 | 105 | mSentChildren.push_back (o); | ||
1306 | 106 | } | ||
1307 | 107 | |||
1308 | 108 | compiz::window::Object::Ptr | ||
1309 | 109 | compiz::window::AsynchronousContainer::addSentRemoval (const Object::Ptr &o) | ||
1310 | 110 | { | ||
1311 | 111 | Children::iterator it = std::find (mSentChildren.begin (), | ||
1312 | 112 | mSentChildren.end (), | ||
1313 | 113 | o); | ||
1314 | 114 | |||
1315 | 115 | if (it != mSentChildren.end ()) | ||
1316 | 116 | { | ||
1317 | 117 | Object::Ptr p = *it; | ||
1318 | 118 | mSentChildren.erase (it); | ||
1319 | 119 | |||
1320 | 120 | return p; | ||
1321 | 121 | } | ||
1322 | 122 | |||
1323 | 123 | return Object::Ptr (); | ||
1324 | 124 | } | ||
1325 | 125 | |||
1326 | 126 | |||
1327 | 0 | 127 | ||
1328 | === added file 'src/asynchronous-object.cpp' | |||
1329 | --- src/asynchronous-object.cpp 1970-01-01 00:00:00 +0000 | |||
1330 | +++ src/asynchronous-object.cpp 2012-01-11 08:52:33 +0000 | |||
1331 | @@ -0,0 +1,117 @@ | |||
1332 | 1 | /* | ||
1333 | 2 | * Copyright © 2010 Canonical Ltd. | ||
1334 | 3 | * | ||
1335 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
1336 | 5 | * and its documentation for any purpose is hereby granted without | ||
1337 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
1338 | 7 | * and that both that copyright notice and this permission notice | ||
1339 | 8 | * appear in supporting documentation, and that the name of | ||
1340 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
1341 | 10 | * distribution of the software without specific, written prior permission. | ||
1342 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
1343 | 12 | * software for any purpose. It is provided "as is" without express or | ||
1344 | 13 | * implied warranty. | ||
1345 | 14 | * | ||
1346 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
1347 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
1348 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
1349 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
1350 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
1351 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
1352 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
1353 | 22 | * | ||
1354 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
1355 | 24 | */ | ||
1356 | 25 | |||
1357 | 26 | #include <core/asynchronous-object.h> | ||
1358 | 27 | #include <core/server-write.h> | ||
1359 | 28 | |||
1360 | 29 | compiz::window::AsynchronousObject::AsynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1361 | 30 | const compiz::window::WriteServerConnection::Ptr &writer) : | ||
1362 | 31 | Object::Object (id), | ||
1363 | 32 | mWriteConnection (writer) | ||
1364 | 33 | { | ||
1365 | 34 | } | ||
1366 | 35 | |||
1367 | 36 | compiz::window::AsynchronousObject::AsynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1368 | 37 | const compiz::window::Geometry &g, | ||
1369 | 38 | const compiz::window::WriteServerConnection::Ptr &writer) : | ||
1370 | 39 | Object::Object (id, g), | ||
1371 | 40 | mWriteConnection (writer) | ||
1372 | 41 | { | ||
1373 | 42 | } | ||
1374 | 43 | |||
1375 | 44 | compiz::window::AsynchronousObject::AsynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1376 | 45 | const compiz::window::Geometry &g, | ||
1377 | 46 | const compiz::window::StackPosition &sp, | ||
1378 | 47 | const compiz::window::WriteServerConnection::Ptr &writer) : | ||
1379 | 48 | Object::Object (id, g, sp), | ||
1380 | 49 | mWriteConnection (writer) | ||
1381 | 50 | { | ||
1382 | 51 | } | ||
1383 | 52 | |||
1384 | 53 | compiz::window::AsynchronousObject::AsynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1385 | 54 | const compiz::window::Geometry &g, | ||
1386 | 55 | const compiz::window::StackPosition &sp, | ||
1387 | 56 | const boost::shared_ptr <Container> &c, | ||
1388 | 57 | const compiz::window::WriteServerConnection::Ptr &writer) : | ||
1389 | 58 | Object::Object (id, g, sp, c), | ||
1390 | 59 | mWriteConnection (writer) | ||
1391 | 60 | { | ||
1392 | 61 | } | ||
1393 | 62 | |||
1394 | 63 | compiz::window::AsynchronousObject::~AsynchronousObject () | ||
1395 | 64 | { | ||
1396 | 65 | } | ||
1397 | 66 | |||
1398 | 67 | const compiz::window::Geometry & | ||
1399 | 68 | compiz::window::AsynchronousObject::sentGeometry () const | ||
1400 | 69 | { | ||
1401 | 70 | return mSentGeometry; | ||
1402 | 71 | } | ||
1403 | 72 | |||
1404 | 73 | const compiz::window::StackPosition & | ||
1405 | 74 | compiz::window::AsynchronousObject::sentStackPosition () const | ||
1406 | 75 | { | ||
1407 | 76 | return mSentStackPosition; | ||
1408 | 77 | } | ||
1409 | 78 | |||
1410 | 79 | void | ||
1411 | 80 | compiz::window::AsynchronousObject::sendGeometry (const compiz::window::Geometry &g) | ||
1412 | 81 | { | ||
1413 | 82 | mWriteConnection->sendGeometry (id (), g); | ||
1414 | 83 | |||
1415 | 84 | addSentGeometry (g); | ||
1416 | 85 | } | ||
1417 | 86 | |||
1418 | 87 | void | ||
1419 | 88 | compiz::window::AsynchronousObject::sendStackPosition (const compiz::window::StackPosition &sp) | ||
1420 | 89 | { | ||
1421 | 90 | mWriteConnection->sendStackPosition (id (), sp); | ||
1422 | 91 | |||
1423 | 92 | addSentStackPosition (sp); | ||
1424 | 93 | } | ||
1425 | 94 | |||
1426 | 95 | void | ||
1427 | 96 | compiz::window::AsynchronousObject::receiveGeometry (const compiz::window::Geometry &g) | ||
1428 | 97 | { | ||
1429 | 98 | Object::setGeometry (g); | ||
1430 | 99 | } | ||
1431 | 100 | |||
1432 | 101 | void | ||
1433 | 102 | compiz::window::AsynchronousObject::receiveStackPosition (const compiz::window::StackPosition &sp) | ||
1434 | 103 | { | ||
1435 | 104 | Object::setStackPosition (sp); | ||
1436 | 105 | } | ||
1437 | 106 | |||
1438 | 107 | void | ||
1439 | 108 | compiz::window::AsynchronousObject::addSentGeometry (const compiz::window::Geometry &g) | ||
1440 | 109 | { | ||
1441 | 110 | mSentGeometry = g; | ||
1442 | 111 | } | ||
1443 | 112 | |||
1444 | 113 | void | ||
1445 | 114 | compiz::window::AsynchronousObject::addSentStackPosition (const compiz::window::StackPosition &sp) | ||
1446 | 115 | { | ||
1447 | 116 | mSentStackPosition = sp; | ||
1448 | 117 | } | ||
1449 | 0 | 118 | ||
1450 | === added file 'src/asynchronous-server.cpp' | |||
1451 | --- src/asynchronous-server.cpp 1970-01-01 00:00:00 +0000 | |||
1452 | +++ src/asynchronous-server.cpp 2012-01-11 08:52:33 +0000 | |||
1453 | @@ -0,0 +1,45 @@ | |||
1454 | 1 | /* | ||
1455 | 2 | * Copyright © 2010 Canonical Ltd. | ||
1456 | 3 | * | ||
1457 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
1458 | 5 | * and its documentation for any purpose is hereby granted without | ||
1459 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
1460 | 7 | * and that both that copyright notice and this permission notice | ||
1461 | 8 | * appear in supporting documentation, and that the name of | ||
1462 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
1463 | 10 | * distribution of the software without specific, written prior permission. | ||
1464 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
1465 | 12 | * software for any purpose. It is provided "as is" without express or | ||
1466 | 13 | * implied warranty. | ||
1467 | 14 | * | ||
1468 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
1469 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
1470 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
1471 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
1472 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
1473 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
1474 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
1475 | 22 | * | ||
1476 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
1477 | 24 | */ | ||
1478 | 25 | |||
1479 | 26 | #include <core/asynchronous-server.h> | ||
1480 | 27 | #include <core/server-write.h> | ||
1481 | 28 | |||
1482 | 29 | compiz::window::AsynchronousServer::AsynchronousServer () : | ||
1483 | 30 | Server::Server (), | ||
1484 | 31 | mReadConnection (new compiz::window::ReadServerConnection) | ||
1485 | 32 | { | ||
1486 | 33 | } | ||
1487 | 34 | |||
1488 | 35 | compiz::window::AsynchronousServer::~AsynchronousServer () | ||
1489 | 36 | { | ||
1490 | 37 | } | ||
1491 | 38 | |||
1492 | 39 | compiz::window::WriteServerConnection::Ptr | ||
1493 | 40 | compiz::window::AsynchronousServer::connect () | ||
1494 | 41 | { | ||
1495 | 42 | compiz::window::AsynchronousServer::Ptr t = shared_from_this (); | ||
1496 | 43 | return compiz::window::WriteServerConnection::Ptr (new compiz::window::WriteServerConnection (t)); | ||
1497 | 44 | } | ||
1498 | 45 | |||
1499 | 0 | 46 | ||
1500 | === added file 'src/asynchronous-stack.cpp' | |||
1501 | --- src/asynchronous-stack.cpp 1970-01-01 00:00:00 +0000 | |||
1502 | +++ src/asynchronous-stack.cpp 2012-01-11 08:52:33 +0000 | |||
1503 | @@ -0,0 +1,99 @@ | |||
1504 | 1 | /* | ||
1505 | 2 | * Copyright © 2010 Canonical Ltd. | ||
1506 | 3 | * | ||
1507 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
1508 | 5 | * and its documentation for any purpose is hereby granted without | ||
1509 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
1510 | 7 | * and that both that copyright notice and this permission notice | ||
1511 | 8 | * appear in supporting documentation, and that the name of | ||
1512 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
1513 | 10 | * distribution of the software without specific, written prior permission. | ||
1514 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
1515 | 12 | * software for any purpose. It is provided "as is" without express or | ||
1516 | 13 | * implied warranty. | ||
1517 | 14 | * | ||
1518 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
1519 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
1520 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
1521 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
1522 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
1523 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
1524 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
1525 | 22 | * | ||
1526 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
1527 | 24 | */ | ||
1528 | 25 | |||
1529 | 26 | #include <core/asynchronous-stack.h> | ||
1530 | 27 | #include <core/asynchronous-server.h> | ||
1531 | 28 | #include <core/asynchronous-object.h> | ||
1532 | 29 | #include <core/object.h> | ||
1533 | 30 | #include <core/server-write.h> | ||
1534 | 31 | |||
1535 | 32 | compiz::window::AsynchronousStack::AsynchronousStack (const compiz::window::AsynchronousServer::Ptr &server) : | ||
1536 | 33 | mWriteConnection (server->connect ()) | ||
1537 | 34 | { | ||
1538 | 35 | } | ||
1539 | 36 | |||
1540 | 37 | compiz::window::AsynchronousStack::~AsynchronousStack () | ||
1541 | 38 | { | ||
1542 | 39 | } | ||
1543 | 40 | |||
1544 | 41 | const std::vector <compiz::window::Object::Ptr> & | ||
1545 | 42 | compiz::window::AsynchronousStack::sentObjects () const | ||
1546 | 43 | { | ||
1547 | 44 | return mSentObjects; | ||
1548 | 45 | } | ||
1549 | 46 | |||
1550 | 47 | |||
1551 | 48 | |||
1552 | 49 | void | ||
1553 | 50 | compiz::window::AsynchronousStack::sendStack (const std::vector <Object::Ptr> &objects) | ||
1554 | 51 | { | ||
1555 | 52 | /* Must be the same size as the last sent objects | ||
1556 | 53 | * and no point restacking if there is only one object */ | ||
1557 | 54 | if (objects.size () == mSentObjects.size () && | ||
1558 | 55 | objects.size () > 1) | ||
1559 | 56 | { | ||
1560 | 57 | std::vector <Object::Ptr>::const_iterator oit (objects.begin ()); | ||
1561 | 58 | std::vector <Object::Ptr>::const_iterator sit (mSentObjects.begin ()); | ||
1562 | 59 | |||
1563 | 60 | std::advance (oit, 1); | ||
1564 | 61 | std::advance (sit, 1); | ||
1565 | 62 | |||
1566 | 63 | for (; oit != objects.end () && sit != mSentObjects.end (); ++oit, ++sit) | ||
1567 | 64 | { | ||
1568 | 65 | std::vector <Object::Ptr>::const_iterator poit = (oit - 1); | ||
1569 | 66 | std::vector <Object::Ptr>::const_iterator psit = (sit - 1); | ||
1570 | 67 | |||
1571 | 68 | /* Need a heuristic that detects if the old sibling is | ||
1572 | 69 | * different and if not, if that old sibling was restacked | ||
1573 | 70 | * already, so we can stack above it anyways */ | ||
1574 | 71 | if (poit != psit) | ||
1575 | 72 | { | ||
1576 | 73 | const Object::Ptr &prev = (*psit); | ||
1577 | 74 | const Object::Ptr ¤t = (*oit); | ||
1578 | 75 | sendRestackObject (current, prev->stackPosition ()); | ||
1579 | 76 | } | ||
1580 | 77 | } | ||
1581 | 78 | } | ||
1582 | 79 | } | ||
1583 | 80 | |||
1584 | 81 | void | ||
1585 | 82 | compiz::window::AsynchronousStack::sendRestackObject (const compiz::window::Object::Ptr &o, | ||
1586 | 83 | const compiz::window::StackPosition &sp) | ||
1587 | 84 | { | ||
1588 | 85 | mWriteConnection->sendStackPosition (o->id (), sp); | ||
1589 | 86 | |||
1590 | 87 | /* Update stack last sent to server */ | ||
1591 | 88 | } | ||
1592 | 89 | |||
1593 | 90 | void | ||
1594 | 91 | compiz::window::AsynchronousStack::receiveRestackObject (const compiz::window::Object::Ptr &o, | ||
1595 | 92 | const compiz::window::StackPosition &sp) | ||
1596 | 93 | { | ||
1597 | 94 | Stack::restackObject (o, sp); | ||
1598 | 95 | } | ||
1599 | 96 | |||
1600 | 97 | |||
1601 | 98 | |||
1602 | 99 | |||
1603 | 0 | 100 | ||
1604 | === added file 'src/container.cpp' | |||
1605 | --- src/container.cpp 1970-01-01 00:00:00 +0000 | |||
1606 | +++ src/container.cpp 2012-01-11 08:52:33 +0000 | |||
1607 | @@ -0,0 +1,182 @@ | |||
1608 | 1 | /* | ||
1609 | 2 | * Copyright © 2010 Canonical Ltd. | ||
1610 | 3 | * | ||
1611 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
1612 | 5 | * and its documentation for any purpose is hereby granted without | ||
1613 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
1614 | 7 | * and that both that copyright notice and this permission notice | ||
1615 | 8 | * appear in supporting documentation, and that the name of | ||
1616 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
1617 | 10 | * distribution of the software without specific, written prior permission. | ||
1618 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
1619 | 12 | * software for any purpose. It is provided "as is" without express or | ||
1620 | 13 | * implied warranty. | ||
1621 | 14 | * | ||
1622 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
1623 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
1624 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
1625 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
1626 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
1627 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
1628 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
1629 | 22 | * | ||
1630 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
1631 | 24 | */ | ||
1632 | 25 | |||
1633 | 26 | #include <core/container.h> | ||
1634 | 27 | #include <core/object.h> | ||
1635 | 28 | #include <boost/bind.hpp> | ||
1636 | 29 | |||
1637 | 30 | compiz::window::Container::Container (const compiz::window::ObjectIdentifier::Ptr &id) : | ||
1638 | 31 | Object::Object (id) | ||
1639 | 32 | { | ||
1640 | 33 | } | ||
1641 | 34 | |||
1642 | 35 | compiz::window::Container::Container (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1643 | 36 | const compiz::window::Geometry &g) : | ||
1644 | 37 | Object::Object (id, g) | ||
1645 | 38 | { | ||
1646 | 39 | } | ||
1647 | 40 | |||
1648 | 41 | compiz::window::Container::Container (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1649 | 42 | const compiz::window::Geometry &g, | ||
1650 | 43 | const compiz::window::StackPosition &sp) : | ||
1651 | 44 | Object::Object (id, g, sp) | ||
1652 | 45 | { | ||
1653 | 46 | } | ||
1654 | 47 | |||
1655 | 48 | compiz::window::Container::Container (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1656 | 49 | const compiz::window::Geometry &g, | ||
1657 | 50 | const compiz::window::StackPosition &sp, | ||
1658 | 51 | const boost::shared_ptr <Container> &c) : | ||
1659 | 52 | Object::Object (id, g, sp, c) | ||
1660 | 53 | { | ||
1661 | 54 | } | ||
1662 | 55 | |||
1663 | 56 | compiz::window::Container::~Container () | ||
1664 | 57 | { | ||
1665 | 58 | } | ||
1666 | 59 | |||
1667 | 60 | compiz::window::Container::Children | ||
1668 | 61 | compiz::window::Container::children () | ||
1669 | 62 | { | ||
1670 | 63 | return mChildren; | ||
1671 | 64 | } | ||
1672 | 65 | |||
1673 | 66 | bool | ||
1674 | 67 | compiz::window::objectIdentifierEq (const compiz::window::Object::Ptr &o, | ||
1675 | 68 | const compiz::window::ObjectIdentifier::Ptr &i) | ||
1676 | 69 | { | ||
1677 | 70 | return o->id () == i; | ||
1678 | 71 | } | ||
1679 | 72 | |||
1680 | 73 | bool | ||
1681 | 74 | compiz::window::Container::insert (const compiz::window::Object::Ptr &o) | ||
1682 | 75 | { | ||
1683 | 76 | Children::iterator it = std::find (mChildren.begin (), mChildren.end (), o); | ||
1684 | 77 | |||
1685 | 78 | if (it != mChildren.end ()) | ||
1686 | 79 | return false; | ||
1687 | 80 | else | ||
1688 | 81 | mChildren.insert (it, o); | ||
1689 | 82 | |||
1690 | 83 | return true; | ||
1691 | 84 | } | ||
1692 | 85 | |||
1693 | 86 | compiz::window::Object::Ptr | ||
1694 | 87 | compiz::window::Container::remove (const compiz::window::ObjectIdentifier::Ptr &i) | ||
1695 | 88 | { | ||
1696 | 89 | Children::iterator it = std::find_if (mChildren.begin (), | ||
1697 | 90 | mChildren.end (), | ||
1698 | 91 | boost::bind (objectIdentifierEq, _1, i)); | ||
1699 | 92 | |||
1700 | 93 | if (it != mChildren.end ()) | ||
1701 | 94 | { | ||
1702 | 95 | Object::Ptr o = *it; | ||
1703 | 96 | |||
1704 | 97 | mChildren.erase (it); | ||
1705 | 98 | return o; | ||
1706 | 99 | } | ||
1707 | 100 | else | ||
1708 | 101 | { | ||
1709 | 102 | return Object::Ptr (); | ||
1710 | 103 | } | ||
1711 | 104 | } | ||
1712 | 105 | |||
1713 | 106 | compiz::window::Object::Ptr | ||
1714 | 107 | compiz::window::Container::remove (const Object::Ptr &o) | ||
1715 | 108 | { | ||
1716 | 109 | Children::iterator it = std::find (mChildren.begin (), | ||
1717 | 110 | mChildren.end (), | ||
1718 | 111 | o); | ||
1719 | 112 | |||
1720 | 113 | if (it != mChildren.end ()) | ||
1721 | 114 | { | ||
1722 | 115 | Object::Ptr o = *it; | ||
1723 | 116 | |||
1724 | 117 | mChildren.erase (it); | ||
1725 | 118 | return o; | ||
1726 | 119 | } | ||
1727 | 120 | else | ||
1728 | 121 | { | ||
1729 | 122 | return Object::Ptr (); | ||
1730 | 123 | } | ||
1731 | 124 | } | ||
1732 | 125 | |||
1733 | 126 | compiz::window::SynchronousContainer::SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id) : | ||
1734 | 127 | Object::Object (id), | ||
1735 | 128 | SynchronousObject::SynchronousObject (id), | ||
1736 | 129 | Container::Container (id) | ||
1737 | 130 | { | ||
1738 | 131 | } | ||
1739 | 132 | |||
1740 | 133 | compiz::window::SynchronousContainer::SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1741 | 134 | const compiz::window::Geometry &g) : | ||
1742 | 135 | Object::Object (id, g), | ||
1743 | 136 | SynchronousObject::SynchronousObject (id, g), | ||
1744 | 137 | Container::Container (id, g) | ||
1745 | 138 | { | ||
1746 | 139 | } | ||
1747 | 140 | |||
1748 | 141 | compiz::window::SynchronousContainer::SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1749 | 142 | const compiz::window::Geometry &g, | ||
1750 | 143 | const compiz::window::StackPosition &sp) : | ||
1751 | 144 | Object::Object (id, g, sp), | ||
1752 | 145 | SynchronousObject::SynchronousObject (id, g, sp), | ||
1753 | 146 | Container::Container (id, g, sp) | ||
1754 | 147 | { | ||
1755 | 148 | } | ||
1756 | 149 | |||
1757 | 150 | compiz::window::SynchronousContainer::SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1758 | 151 | const compiz::window::Geometry &g, | ||
1759 | 152 | const compiz::window::StackPosition &sp, | ||
1760 | 153 | const boost::shared_ptr <Container> &c) : | ||
1761 | 154 | Object::Object (id, g, sp, c), | ||
1762 | 155 | SynchronousObject::SynchronousObject (id, g, sp, c), | ||
1763 | 156 | Container::Container (id, g, sp, c) | ||
1764 | 157 | { | ||
1765 | 158 | } | ||
1766 | 159 | |||
1767 | 160 | compiz::window::SynchronousContainer::~SynchronousContainer () | ||
1768 | 161 | { | ||
1769 | 162 | } | ||
1770 | 163 | |||
1771 | 164 | bool | ||
1772 | 165 | compiz::window::SynchronousContainer::insert (const compiz::window::Object::Ptr &o) | ||
1773 | 166 | { | ||
1774 | 167 | return Container::insert (o); | ||
1775 | 168 | } | ||
1776 | 169 | |||
1777 | 170 | compiz::window::Object::Ptr | ||
1778 | 171 | compiz::window::SynchronousContainer::remove (const compiz::window::ObjectIdentifier::Ptr &i) | ||
1779 | 172 | { | ||
1780 | 173 | return Container::remove (i); | ||
1781 | 174 | } | ||
1782 | 175 | |||
1783 | 176 | compiz::window::Object::Ptr | ||
1784 | 177 | compiz::window::SynchronousContainer::remove (const compiz::window::Object::Ptr &o) | ||
1785 | 178 | { | ||
1786 | 179 | return Container::remove (o); | ||
1787 | 180 | } | ||
1788 | 181 | |||
1789 | 182 | |||
1790 | 0 | 183 | ||
1791 | === added file 'src/object.cpp' | |||
1792 | --- src/object.cpp 1970-01-01 00:00:00 +0000 | |||
1793 | +++ src/object.cpp 2012-01-11 08:52:33 +0000 | |||
1794 | @@ -0,0 +1,204 @@ | |||
1795 | 1 | /* | ||
1796 | 2 | * Copyright © 2010 Canonical Ltd. | ||
1797 | 3 | * | ||
1798 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
1799 | 5 | * and its documentation for any purpose is hereby granted without | ||
1800 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
1801 | 7 | * and that both that copyright notice and this permission notice | ||
1802 | 8 | * appear in supporting documentation, and that the name of | ||
1803 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
1804 | 10 | * distribution of the software without specific, written prior permission. | ||
1805 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
1806 | 12 | * software for any purpose. It is provided "as is" without express or | ||
1807 | 13 | * implied warranty. | ||
1808 | 14 | * | ||
1809 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
1810 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
1811 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
1812 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
1813 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
1814 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
1815 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
1816 | 22 | * | ||
1817 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
1818 | 24 | */ | ||
1819 | 25 | |||
1820 | 26 | #include <core/object.h> | ||
1821 | 27 | |||
1822 | 28 | compiz::window::Object::Object (const compiz::window::ObjectIdentifier::Ptr &id) : | ||
1823 | 29 | mId (id) | ||
1824 | 30 | { | ||
1825 | 31 | } | ||
1826 | 32 | |||
1827 | 33 | compiz::window::Object::Object (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1828 | 34 | const compiz::window::Geometry &g) : | ||
1829 | 35 | mId (id), | ||
1830 | 36 | mGeometry (g) | ||
1831 | 37 | { | ||
1832 | 38 | } | ||
1833 | 39 | |||
1834 | 40 | compiz::window::Object::Object (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1835 | 41 | const compiz::window::Geometry &g, | ||
1836 | 42 | const compiz::window::StackPosition &sp) : | ||
1837 | 43 | mId (id), | ||
1838 | 44 | mGeometry (g), | ||
1839 | 45 | mStackPosition (sp) | ||
1840 | 46 | { | ||
1841 | 47 | } | ||
1842 | 48 | |||
1843 | 49 | compiz::window::Object::Object (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1844 | 50 | const compiz::window::Geometry &g, | ||
1845 | 51 | const compiz::window::StackPosition &sp, | ||
1846 | 52 | const boost::shared_ptr <Container> &c) : | ||
1847 | 53 | mId (id), | ||
1848 | 54 | mGeometry (g), | ||
1849 | 55 | mStackPosition (sp), | ||
1850 | 56 | mContainer (c) | ||
1851 | 57 | { | ||
1852 | 58 | } | ||
1853 | 59 | |||
1854 | 60 | bool | ||
1855 | 61 | compiz::window::ObjectIdentifier::operator ==(const ObjectIdentifier::Ptr &other) const | ||
1856 | 62 | { | ||
1857 | 63 | return equal (other); | ||
1858 | 64 | } | ||
1859 | 65 | |||
1860 | 66 | bool | ||
1861 | 67 | compiz::window::ObjectIdentifier::operator !=(const ObjectIdentifier::Ptr &other) const | ||
1862 | 68 | { | ||
1863 | 69 | return !(*this == other); | ||
1864 | 70 | } | ||
1865 | 71 | |||
1866 | 72 | bool | ||
1867 | 73 | compiz::window::ObjectIdentifier::equal (const ObjectIdentifier::Ptr &other) const | ||
1868 | 74 | { | ||
1869 | 75 | if (getType () == other->getType ()) | ||
1870 | 76 | return compare (other); | ||
1871 | 77 | |||
1872 | 78 | return false; | ||
1873 | 79 | } | ||
1874 | 80 | |||
1875 | 81 | const boost::shared_ptr <compiz::window::Container> & | ||
1876 | 82 | compiz::window::Object::container () const | ||
1877 | 83 | { | ||
1878 | 84 | return mContainer; | ||
1879 | 85 | } | ||
1880 | 86 | |||
1881 | 87 | const compiz::window::Geometry & | ||
1882 | 88 | compiz::window::Object::geometry () const | ||
1883 | 89 | { | ||
1884 | 90 | return mGeometry; | ||
1885 | 91 | } | ||
1886 | 92 | |||
1887 | 93 | const compiz::window::StackPosition & | ||
1888 | 94 | compiz::window::Object::stackPosition () const | ||
1889 | 95 | { | ||
1890 | 96 | return mStackPosition; | ||
1891 | 97 | } | ||
1892 | 98 | |||
1893 | 99 | const compiz::window::ObjectIdentifier::Ptr & | ||
1894 | 100 | compiz::window::Object::id () const | ||
1895 | 101 | { | ||
1896 | 102 | return mId; | ||
1897 | 103 | } | ||
1898 | 104 | |||
1899 | 105 | bool | ||
1900 | 106 | compiz::window::Object::operator == (const Object &other) const | ||
1901 | 107 | { | ||
1902 | 108 | return other.mId == mId; | ||
1903 | 109 | } | ||
1904 | 110 | |||
1905 | 111 | bool | ||
1906 | 112 | compiz::window::Object::operator != (const Object &other) const | ||
1907 | 113 | { | ||
1908 | 114 | return !(other == *this); | ||
1909 | 115 | } | ||
1910 | 116 | |||
1911 | 117 | bool | ||
1912 | 118 | compiz::window::Object::setGeometry (const compiz::window::Geometry &g) | ||
1913 | 119 | { | ||
1914 | 120 | unsigned int mask = mGeometry.changeMask (g); | ||
1915 | 121 | mGeometry.applyChange (g, mask); | ||
1916 | 122 | |||
1917 | 123 | return mask != 0; | ||
1918 | 124 | } | ||
1919 | 125 | |||
1920 | 126 | bool | ||
1921 | 127 | compiz::window::Object::setStackPosition (const StackPosition &sp) | ||
1922 | 128 | { | ||
1923 | 129 | mStackPosition = sp; | ||
1924 | 130 | return true; | ||
1925 | 131 | } | ||
1926 | 132 | |||
1927 | 133 | compiz::window::Object::~Object () | ||
1928 | 134 | { | ||
1929 | 135 | } | ||
1930 | 136 | |||
1931 | 137 | compiz::window::SynchronousObject::SynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id) : | ||
1932 | 138 | Object::Object (id) | ||
1933 | 139 | { | ||
1934 | 140 | } | ||
1935 | 141 | |||
1936 | 142 | compiz::window::SynchronousObject::SynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1937 | 143 | const compiz::window::Geometry &g) : | ||
1938 | 144 | Object::Object (id, g) | ||
1939 | 145 | { | ||
1940 | 146 | } | ||
1941 | 147 | |||
1942 | 148 | compiz::window::SynchronousObject::SynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1943 | 149 | const compiz::window::Geometry &g, | ||
1944 | 150 | const compiz::window::StackPosition &sp) : | ||
1945 | 151 | Object::Object (id, g, sp) | ||
1946 | 152 | { | ||
1947 | 153 | } | ||
1948 | 154 | |||
1949 | 155 | compiz::window::SynchronousObject::SynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id, | ||
1950 | 156 | const compiz::window::Geometry &g, | ||
1951 | 157 | const compiz::window::StackPosition &sp, | ||
1952 | 158 | const boost::shared_ptr <Container> &c) : | ||
1953 | 159 | Object::Object (id, g, sp, c) | ||
1954 | 160 | { | ||
1955 | 161 | } | ||
1956 | 162 | |||
1957 | 163 | compiz::window::SynchronousObject::~SynchronousObject () | ||
1958 | 164 | { | ||
1959 | 165 | } | ||
1960 | 166 | |||
1961 | 167 | bool | ||
1962 | 168 | compiz::window::SynchronousObject::setGeometry (const Geometry &g) | ||
1963 | 169 | { | ||
1964 | 170 | return Object::setGeometry (g); | ||
1965 | 171 | } | ||
1966 | 172 | |||
1967 | 173 | bool | ||
1968 | 174 | compiz::window::SynchronousObject::setStackPosition (const StackPosition &sp) | ||
1969 | 175 | { | ||
1970 | 176 | return Object::setStackPosition (sp); | ||
1971 | 177 | } | ||
1972 | 178 | |||
1973 | 179 | const boost::shared_ptr <compiz::window::Object> & | ||
1974 | 180 | compiz::window::ObjectIdentifier::operator() () | ||
1975 | 181 | { | ||
1976 | 182 | if (mObj) | ||
1977 | 183 | return mObj; | ||
1978 | 184 | else | ||
1979 | 185 | { | ||
1980 | 186 | mObj = lookup (); | ||
1981 | 187 | return mObj; | ||
1982 | 188 | } | ||
1983 | 189 | } | ||
1984 | 190 | |||
1985 | 191 | const boost::shared_ptr <compiz::window::Object> & | ||
1986 | 192 | compiz::window::ObjectIdentifier::operator() () const | ||
1987 | 193 | { | ||
1988 | 194 | if (mObj) | ||
1989 | 195 | return mObj; | ||
1990 | 196 | else | ||
1991 | 197 | { | ||
1992 | 198 | return lookup (); | ||
1993 | 199 | } | ||
1994 | 200 | } | ||
1995 | 201 | |||
1996 | 202 | compiz::window::ObjectIdentifier::~ObjectIdentifier () | ||
1997 | 203 | { | ||
1998 | 204 | } | ||
1999 | 0 | 205 | ||
2000 | === modified file 'src/point/tests/point/src/test-point.cpp' | |||
2001 | --- src/point/tests/point/src/test-point.cpp 2012-01-11 08:52:32 +0000 | |||
2002 | +++ src/point/tests/point/src/test-point.cpp 2012-01-11 08:52:33 +0000 | |||
2003 | @@ -31,7 +31,6 @@ | |||
2004 | 31 | public: | 31 | public: |
2005 | 32 | 32 | ||
2006 | 33 | CompPointTestPoint (); | 33 | CompPointTestPoint (); |
2007 | 34 | ~CompPointTestPoint (); | ||
2008 | 35 | 34 | ||
2009 | 36 | protected: | 35 | protected: |
2010 | 37 | 36 | ||
2011 | @@ -43,10 +42,6 @@ | |||
2012 | 43 | { | 42 | { |
2013 | 44 | } | 43 | } |
2014 | 45 | 44 | ||
2015 | 46 | CompPointTestPoint::~CompPointTestPoint () | ||
2016 | 47 | { | ||
2017 | 48 | } | ||
2018 | 49 | |||
2019 | 50 | TEST_F (CompPointTestPoint, TestPoint) | 45 | TEST_F (CompPointTestPoint, TestPoint) |
2020 | 51 | { | 46 | { |
2021 | 52 | p.setX (10); | 47 | p.setX (10); |
2022 | 53 | 48 | ||
2023 | === modified file 'src/point/tests/test-point.cpp' | |||
2024 | --- src/point/tests/test-point.cpp 2012-01-11 08:52:32 +0000 | |||
2025 | +++ src/point/tests/test-point.cpp 2012-01-11 08:52:33 +0000 | |||
2026 | @@ -24,11 +24,3 @@ | |||
2027 | 24 | */ | 24 | */ |
2028 | 25 | 25 | ||
2029 | 26 | #include "test-point.h" | 26 | #include "test-point.h" |
2030 | 27 | |||
2031 | 28 | CompWindowPointTest::CompWindowPointTest () | ||
2032 | 29 | { | ||
2033 | 30 | } | ||
2034 | 31 | |||
2035 | 32 | CompWindowPointTest::~CompWindowPointTest () | ||
2036 | 33 | { | ||
2037 | 34 | } | ||
2038 | 35 | 27 | ||
2039 | === modified file 'src/point/tests/test-point.h' | |||
2040 | --- src/point/tests/test-point.h 2012-01-11 08:52:32 +0000 | |||
2041 | +++ src/point/tests/test-point.h 2012-01-11 08:52:33 +0000 | |||
2042 | @@ -33,11 +33,6 @@ | |||
2043 | 33 | 33 | ||
2044 | 34 | class CompWindowPointTest : public ::testing::Test | 34 | class CompWindowPointTest : public ::testing::Test |
2045 | 35 | { | 35 | { |
2046 | 36 | public: | ||
2047 | 37 | |||
2048 | 38 | CompWindowPointTest (); | ||
2049 | 39 | virtual ~CompWindowPointTest (); | ||
2050 | 40 | |||
2051 | 41 | }; | 36 | }; |
2052 | 42 | 37 | ||
2053 | 43 | #endif | 38 | #endif |
2054 | 44 | 39 | ||
2055 | === modified file 'src/privatewindow.h' | |||
2056 | --- src/privatewindow.h 2012-01-11 08:52:32 +0000 | |||
2057 | +++ src/privatewindow.h 2012-01-11 08:52:33 +0000 | |||
2058 | @@ -43,7 +43,8 @@ | |||
2059 | 43 | 43 | ||
2060 | 44 | typedef CompWindowExtents CompFullscreenMonitorSet; | 44 | typedef CompWindowExtents CompFullscreenMonitorSet; |
2061 | 45 | 45 | ||
2063 | 46 | class PrivateWindow { | 46 | class PrivateWindow |
2064 | 47 | { | ||
2065 | 47 | 48 | ||
2066 | 48 | public: | 49 | public: |
2067 | 49 | PrivateWindow (); | 50 | PrivateWindow (); |
2068 | @@ -53,8 +54,6 @@ | |||
2069 | 53 | 54 | ||
2070 | 54 | void updateFrameWindow (); | 55 | void updateFrameWindow (); |
2071 | 55 | 56 | ||
2072 | 56 | void setWindowMatrix (); | ||
2073 | 57 | |||
2074 | 58 | bool restack (Window aboveId); | 57 | bool restack (Window aboveId); |
2075 | 59 | 58 | ||
2076 | 60 | bool initializeSyncCounter (); | 59 | bool initializeSyncCounter (); |
2077 | 61 | 60 | ||
2078 | === modified file 'src/rect/tests/rect/src/test-rect.cpp' | |||
2079 | --- src/rect/tests/rect/src/test-rect.cpp 2012-01-11 08:52:32 +0000 | |||
2080 | +++ src/rect/tests/rect/src/test-rect.cpp 2012-01-11 08:52:33 +0000 | |||
2081 | @@ -30,21 +30,8 @@ | |||
2082 | 30 | class CompRectTestRect : | 30 | class CompRectTestRect : |
2083 | 31 | public CompRectTest | 31 | public CompRectTest |
2084 | 32 | { | 32 | { |
2085 | 33 | public: | ||
2086 | 34 | |||
2087 | 35 | CompRectTestRect (); | ||
2088 | 36 | ~CompRectTestRect (); | ||
2089 | 37 | }; | 33 | }; |
2090 | 38 | 34 | ||
2091 | 39 | |||
2092 | 40 | CompRectTestRect::CompRectTestRect () | ||
2093 | 41 | { | ||
2094 | 42 | } | ||
2095 | 43 | |||
2096 | 44 | CompRectTestRect::~CompRectTestRect () | ||
2097 | 45 | { | ||
2098 | 46 | } | ||
2099 | 47 | |||
2100 | 48 | TEST_F (CompRectTestRect, TestRect) | 35 | TEST_F (CompRectTestRect, TestRect) |
2101 | 49 | { | 36 | { |
2102 | 50 | ASSERT_EQ (mRect, CompRect (0, 0, 0, 0)); | 37 | ASSERT_EQ (mRect, CompRect (0, 0, 0, 0)); |
2103 | 51 | 38 | ||
2104 | === added file 'src/server-read.cpp' | |||
2105 | --- src/server-read.cpp 1970-01-01 00:00:00 +0000 | |||
2106 | +++ src/server-read.cpp 2012-01-11 08:52:33 +0000 | |||
2107 | @@ -0,0 +1,60 @@ | |||
2108 | 1 | /* | ||
2109 | 2 | * Copyright © 2010 Canonical Ltd. | ||
2110 | 3 | * | ||
2111 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
2112 | 5 | * and its documentation for any purpose is hereby granted without | ||
2113 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
2114 | 7 | * and that both that copyright notice and this permission notice | ||
2115 | 8 | * appear in supporting documentation, and that the name of | ||
2116 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
2117 | 10 | * distribution of the software without specific, written prior permission. | ||
2118 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
2119 | 12 | * software for any purpose. It is provided "as is" without express or | ||
2120 | 13 | * implied warranty. | ||
2121 | 14 | * | ||
2122 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
2123 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
2124 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
2125 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
2126 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
2127 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
2128 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
2129 | 22 | * | ||
2130 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
2131 | 24 | */ | ||
2132 | 25 | |||
2133 | 26 | #include <core/server-read.h> | ||
2134 | 27 | #include <core/asynchronous-object.h> | ||
2135 | 28 | #include <core/asynchronous-container.h> | ||
2136 | 29 | |||
2137 | 30 | compiz::window::ReadServerConnection::ReadServerConnection () | ||
2138 | 31 | { | ||
2139 | 32 | } | ||
2140 | 33 | |||
2141 | 34 | compiz::window::ReadServerConnection::~ReadServerConnection () | ||
2142 | 35 | { | ||
2143 | 36 | } | ||
2144 | 37 | |||
2145 | 38 | void | ||
2146 | 39 | compiz::window::ReadServerConnection::receiveGeometry (const compiz::window::AsynchronousObject::Ptr &ao, | ||
2147 | 40 | const compiz::window::Geometry &g) | ||
2148 | 41 | { | ||
2149 | 42 | ao->receiveGeometry (g); | ||
2150 | 43 | } | ||
2151 | 44 | |||
2152 | 45 | void | ||
2153 | 46 | compiz::window::ReadServerConnection::receiveStackPosition (const compiz::window::AsynchronousObject::Ptr &ao, | ||
2154 | 47 | const compiz::window::StackPosition &sp) | ||
2155 | 48 | { | ||
2156 | 49 | /* Write new stack position to parent window stack XXX */ | ||
2157 | 50 | ao->receiveStackPosition (sp); | ||
2158 | 51 | } | ||
2159 | 52 | |||
2160 | 53 | void | ||
2161 | 54 | compiz::window::ReadServerConnection::receiveParent (const compiz::window::AsynchronousObject::Ptr &child, | ||
2162 | 55 | const compiz::window::AsynchronousContainer::Ptr &parent) | ||
2163 | 56 | { | ||
2164 | 57 | compiz::window::AsynchronousContainer::Ptr lastParent = boost::shared_static_cast <compiz::window::AsynchronousContainer> (child->container ()); | ||
2165 | 58 | lastParent->receiveRemoval (boost::shared_static_cast <compiz::window::Object> (child)); | ||
2166 | 59 | parent->receiveInsertion (boost::shared_static_cast <compiz::window::Object> (child)); | ||
2167 | 60 | } | ||
2168 | 0 | 61 | ||
2169 | === added file 'src/server-write.cpp' | |||
2170 | --- src/server-write.cpp 1970-01-01 00:00:00 +0000 | |||
2171 | +++ src/server-write.cpp 2012-01-11 08:52:33 +0000 | |||
2172 | @@ -0,0 +1,59 @@ | |||
2173 | 1 | /* | ||
2174 | 2 | * Copyright © 2010 Canonical Ltd. | ||
2175 | 3 | * | ||
2176 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
2177 | 5 | * and its documentation for any purpose is hereby granted without | ||
2178 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
2179 | 7 | * and that both that copyright notice and this permission notice | ||
2180 | 8 | * appear in supporting documentation, and that the name of | ||
2181 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
2182 | 10 | * distribution of the software without specific, written prior permission. | ||
2183 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
2184 | 12 | * software for any purpose. It is provided "as is" without express or | ||
2185 | 13 | * implied warranty. | ||
2186 | 14 | * | ||
2187 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
2188 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
2189 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
2190 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
2191 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
2192 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
2193 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
2194 | 22 | * | ||
2195 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
2196 | 24 | */ | ||
2197 | 25 | |||
2198 | 26 | #include <core/server-write.h> | ||
2199 | 27 | |||
2200 | 28 | compiz::window::WriteServerConnection::WriteServerConnection (const AsynchronousServer::Ptr &server) : | ||
2201 | 29 | mServer (server) | ||
2202 | 30 | { | ||
2203 | 31 | } | ||
2204 | 32 | |||
2205 | 33 | compiz::window::WriteServerConnection::~WriteServerConnection () | ||
2206 | 34 | { | ||
2207 | 35 | } | ||
2208 | 36 | |||
2209 | 37 | void | ||
2210 | 38 | compiz::window::WriteServerConnection::sendGeometry (const ObjectIdentifier::Ptr &id, | ||
2211 | 39 | const compiz::window::Geometry &g) | ||
2212 | 40 | { | ||
2213 | 41 | mServer->sendGeometry (id, g); | ||
2214 | 42 | } | ||
2215 | 43 | |||
2216 | 44 | void | ||
2217 | 45 | compiz::window::WriteServerConnection::sendStackPosition (const ObjectIdentifier::Ptr &id, | ||
2218 | 46 | const compiz::window::StackPosition &sp) | ||
2219 | 47 | { | ||
2220 | 48 | mServer->sendStackPosition (id, sp); | ||
2221 | 49 | } | ||
2222 | 50 | |||
2223 | 51 | void | ||
2224 | 52 | compiz::window::WriteServerConnection::sendParent (const ObjectIdentifier::Ptr &id, | ||
2225 | 53 | const ObjectIdentifier::Ptr &pid) | ||
2226 | 54 | { | ||
2227 | 55 | mServer->sendParent (id, pid); | ||
2228 | 56 | } | ||
2229 | 57 | |||
2230 | 58 | |||
2231 | 59 | |||
2232 | 0 | 60 | ||
2233 | === added file 'src/server.cpp' | |||
2234 | --- src/server.cpp 1970-01-01 00:00:00 +0000 | |||
2235 | +++ src/server.cpp 2012-01-11 08:52:33 +0000 | |||
2236 | @@ -0,0 +1,47 @@ | |||
2237 | 1 | /* | ||
2238 | 2 | * Copyright © 2010 Canonical Ltd. | ||
2239 | 3 | * | ||
2240 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
2241 | 5 | * and its documentation for any purpose is hereby granted without | ||
2242 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
2243 | 7 | * and that both that copyright notice and this permission notice | ||
2244 | 8 | * appear in supporting documentation, and that the name of | ||
2245 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
2246 | 10 | * distribution of the software without specific, written prior permission. | ||
2247 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
2248 | 12 | * software for any purpose. It is provided "as is" without express or | ||
2249 | 13 | * implied warranty. | ||
2250 | 14 | * | ||
2251 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
2252 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
2253 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
2254 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
2255 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
2256 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
2257 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
2258 | 22 | * | ||
2259 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
2260 | 24 | */ | ||
2261 | 25 | |||
2262 | 26 | #include <core/server.h> | ||
2263 | 27 | |||
2264 | 28 | compiz::window::Server::Ptr compiz::window::Server::mDefault = compiz::window::Server::Ptr (); | ||
2265 | 29 | |||
2266 | 30 | compiz::window::Server::Server () | ||
2267 | 31 | { | ||
2268 | 32 | } | ||
2269 | 33 | |||
2270 | 34 | compiz::window::Server::~Server () | ||
2271 | 35 | { | ||
2272 | 36 | } | ||
2273 | 37 | |||
2274 | 38 | compiz::window::Server::Ptr compiz::window::Server::Default() | ||
2275 | 39 | { | ||
2276 | 40 | return mDefault; | ||
2277 | 41 | } | ||
2278 | 42 | |||
2279 | 43 | const compiz::window::Object::Ptr & | ||
2280 | 44 | compiz::window::Server::root () | ||
2281 | 45 | { | ||
2282 | 46 | return mRoot; | ||
2283 | 47 | } | ||
2284 | 0 | 48 | ||
2285 | === added file 'src/stack.cpp' | |||
2286 | --- src/stack.cpp 1970-01-01 00:00:00 +0000 | |||
2287 | +++ src/stack.cpp 2012-01-11 08:52:33 +0000 | |||
2288 | @@ -0,0 +1,71 @@ | |||
2289 | 1 | /* | ||
2290 | 2 | * Copyright © 2010 Canonical Ltd. | ||
2291 | 3 | * | ||
2292 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
2293 | 5 | * and its documentation for any purpose is hereby granted without | ||
2294 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
2295 | 7 | * and that both that copyright notice and this permission notice | ||
2296 | 8 | * appear in supporting documentation, and that the name of | ||
2297 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
2298 | 10 | * distribution of the software without specific, written prior permission. | ||
2299 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
2300 | 12 | * software for any purpose. It is provided "as is" without express or | ||
2301 | 13 | * implied warranty. | ||
2302 | 14 | * | ||
2303 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
2304 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
2305 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
2306 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
2307 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
2308 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
2309 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
2310 | 22 | * | ||
2311 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
2312 | 24 | */ | ||
2313 | 25 | |||
2314 | 26 | #include <core/stack.h> | ||
2315 | 27 | |||
2316 | 28 | compiz::window::Stack::Stack () | ||
2317 | 29 | { | ||
2318 | 30 | } | ||
2319 | 31 | |||
2320 | 32 | compiz::window::Stack::~Stack () | ||
2321 | 33 | { | ||
2322 | 34 | } | ||
2323 | 35 | |||
2324 | 36 | void | ||
2325 | 37 | compiz::window::Stack::setStack (const std::vector <Object::Ptr> &toplevelObjects) | ||
2326 | 38 | { | ||
2327 | 39 | mObjects = toplevelObjects; | ||
2328 | 40 | } | ||
2329 | 41 | |||
2330 | 42 | void | ||
2331 | 43 | compiz::window::Stack::restackObject (const compiz::window::Object::Ptr &o, | ||
2332 | 44 | const compiz::window::StackPosition &sp) | ||
2333 | 45 | { | ||
2334 | 46 | /* Lookup position, insert object into stack */ | ||
2335 | 47 | } | ||
2336 | 48 | |||
2337 | 49 | compiz::window::SynchronousStack::SynchronousStack () : | ||
2338 | 50 | Stack::Stack () | ||
2339 | 51 | { | ||
2340 | 52 | } | ||
2341 | 53 | |||
2342 | 54 | compiz::window::SynchronousStack::~SynchronousStack () | ||
2343 | 55 | { | ||
2344 | 56 | } | ||
2345 | 57 | |||
2346 | 58 | void | ||
2347 | 59 | compiz::window::SynchronousStack::setStack (const std::vector <Object::Ptr> &toplevelObjects) | ||
2348 | 60 | { | ||
2349 | 61 | Stack::setStack (toplevelObjects); | ||
2350 | 62 | } | ||
2351 | 63 | |||
2352 | 64 | void | ||
2353 | 65 | compiz::window::SynchronousStack::restackObject (const compiz::window::Object::Ptr &o, | ||
2354 | 66 | const compiz::window::StackPosition &sp) | ||
2355 | 67 | { | ||
2356 | 68 | Stack::restackObject (o, sp); | ||
2357 | 69 | } | ||
2358 | 70 | |||
2359 | 71 | |||
2360 | 0 | 72 | ||
2361 | === added file 'src/stackposition.cpp' | |||
2362 | --- src/stackposition.cpp 1970-01-01 00:00:00 +0000 | |||
2363 | +++ src/stackposition.cpp 2012-01-11 08:52:33 +0000 | |||
2364 | @@ -0,0 +1,24 @@ | |||
2365 | 1 | /* | ||
2366 | 2 | * Copyright © 2010 Canonical Ltd. | ||
2367 | 3 | * | ||
2368 | 4 | * Permission to use, copy, modify, distribute, and sell this software | ||
2369 | 5 | * and its documentation for any purpose is hereby granted without | ||
2370 | 6 | * fee, provided that the above copyright notice appear in all copies | ||
2371 | 7 | * and that both that copyright notice and this permission notice | ||
2372 | 8 | * appear in supporting documentation, and that the name of | ||
2373 | 9 | * Canonical Ltd. not be used in advertising or publicity pertaining to | ||
2374 | 10 | * distribution of the software without specific, written prior permission. | ||
2375 | 11 | * Canonical Ltd. makes no representations about the suitability of this | ||
2376 | 12 | * software for any purpose. It is provided "as is" without express or | ||
2377 | 13 | * implied warranty. | ||
2378 | 14 | * | ||
2379 | 15 | * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
2380 | 16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN | ||
2381 | 17 | * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
2382 | 18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | ||
2383 | 19 | * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
2384 | 20 | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
2385 | 21 | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
2386 | 22 | * | ||
2387 | 23 | * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> | ||
2388 | 24 | */ | ||
2389 | 0 | 25 | ||
2390 | === modified file 'src/window/constrainment/tests/test-window-constrainment.cpp' | |||
2391 | --- src/window/constrainment/tests/test-window-constrainment.cpp 2012-01-11 08:52:32 +0000 | |||
2392 | +++ src/window/constrainment/tests/test-window-constrainment.cpp 2012-01-11 08:52:33 +0000 | |||
2393 | @@ -24,11 +24,3 @@ | |||
2394 | 24 | */ | 24 | */ |
2395 | 25 | 25 | ||
2396 | 26 | #include "test-window-constrainment.h" | 26 | #include "test-window-constrainment.h" |
2397 | 27 | |||
2398 | 28 | CompWindowConstrainmentTest::CompWindowConstrainmentTest () | ||
2399 | 29 | { | ||
2400 | 30 | } | ||
2401 | 31 | |||
2402 | 32 | CompWindowConstrainmentTest::~CompWindowConstrainmentTest () | ||
2403 | 33 | { | ||
2404 | 34 | } | ||
2405 | 35 | 27 | ||
2406 | === modified file 'src/window/constrainment/tests/test-window-constrainment.h' | |||
2407 | --- src/window/constrainment/tests/test-window-constrainment.h 2012-01-11 08:52:32 +0000 | |||
2408 | +++ src/window/constrainment/tests/test-window-constrainment.h 2012-01-11 08:52:33 +0000 | |||
2409 | @@ -34,10 +34,6 @@ | |||
2410 | 34 | 34 | ||
2411 | 35 | class CompWindowConstrainmentTest : public ::testing::Test | 35 | class CompWindowConstrainmentTest : public ::testing::Test |
2412 | 36 | { | 36 | { |
2413 | 37 | public: | ||
2414 | 38 | |||
2415 | 39 | CompWindowConstrainmentTest (); | ||
2416 | 40 | virtual ~CompWindowConstrainmentTest (); | ||
2417 | 41 | }; | 37 | }; |
2418 | 42 | 38 | ||
2419 | 43 | #endif | 39 | #endif |
2420 | 44 | 40 | ||
2421 | === modified file 'src/window/constrainment/tests/to-hints/src/test-window-constrainment-to-hints.cpp' | |||
2422 | --- src/window/constrainment/tests/to-hints/src/test-window-constrainment-to-hints.cpp 2012-01-11 08:52:32 +0000 | |||
2423 | +++ src/window/constrainment/tests/to-hints/src/test-window-constrainment-to-hints.cpp 2012-01-11 08:52:33 +0000 | |||
2424 | @@ -29,20 +29,8 @@ | |||
2425 | 29 | class CompWindowConstrainmentTestToHints : | 29 | class CompWindowConstrainmentTestToHints : |
2426 | 30 | public CompWindowConstrainmentTest | 30 | public CompWindowConstrainmentTest |
2427 | 31 | { | 31 | { |
2428 | 32 | public: | ||
2429 | 33 | |||
2430 | 34 | CompWindowConstrainmentTestToHints (); | ||
2431 | 35 | virtual ~CompWindowConstrainmentTestToHints (); | ||
2432 | 36 | }; | 32 | }; |
2433 | 37 | 33 | ||
2434 | 38 | CompWindowConstrainmentTestToHints::CompWindowConstrainmentTestToHints () | ||
2435 | 39 | { | ||
2436 | 40 | } | ||
2437 | 41 | |||
2438 | 42 | CompWindowConstrainmentTestToHints::~CompWindowConstrainmentTestToHints () | ||
2439 | 43 | { | ||
2440 | 44 | } | ||
2441 | 45 | |||
2442 | 46 | TEST_F (CompWindowConstrainmentTestToHints, ToHints) | 34 | TEST_F (CompWindowConstrainmentTestToHints, ToHints) |
2443 | 47 | { | 35 | { |
2444 | 48 | /* No hints, size is the same */ | 36 | /* No hints, size is the same */ |
2445 | 49 | 37 | ||
2446 | === modified file 'src/window/extents/tests/shift/src/test-window-extents-shift.cpp' | |||
2447 | --- src/window/extents/tests/shift/src/test-window-extents-shift.cpp 2012-01-11 08:52:32 +0000 | |||
2448 | +++ src/window/extents/tests/shift/src/test-window-extents-shift.cpp 2012-01-11 08:52:33 +0000 | |||
2449 | @@ -30,24 +30,11 @@ | |||
2450 | 30 | class CompWindowExtentsTestShift : | 30 | class CompWindowExtentsTestShift : |
2451 | 31 | public CompWindowExtentsTest | 31 | public CompWindowExtentsTest |
2452 | 32 | { | 32 | { |
2453 | 33 | public: | ||
2454 | 34 | |||
2455 | 35 | CompWindowExtentsTestShift (); | ||
2456 | 36 | virtual ~CompWindowExtentsTestShift (); | ||
2457 | 37 | |||
2458 | 38 | protected: | 33 | protected: |
2459 | 39 | 34 | ||
2460 | 40 | compiz::window::extents::Extents e; | 35 | compiz::window::extents::Extents e; |
2461 | 41 | }; | 36 | }; |
2462 | 42 | 37 | ||
2463 | 43 | CompWindowExtentsTestShift::CompWindowExtentsTestShift () | ||
2464 | 44 | { | ||
2465 | 45 | } | ||
2466 | 46 | |||
2467 | 47 | CompWindowExtentsTestShift::~CompWindowExtentsTestShift () | ||
2468 | 48 | { | ||
2469 | 49 | } | ||
2470 | 50 | |||
2471 | 51 | TEST_F (CompWindowExtentsTestShift, TestShift) | 38 | TEST_F (CompWindowExtentsTestShift, TestShift) |
2472 | 52 | { | 39 | { |
2473 | 53 | CompPoint rp; | 40 | CompPoint rp; |
2474 | 54 | 41 | ||
2475 | === modified file 'src/window/extents/tests/test-window-extents.cpp' | |||
2476 | --- src/window/extents/tests/test-window-extents.cpp 2012-01-11 08:52:32 +0000 | |||
2477 | +++ src/window/extents/tests/test-window-extents.cpp 2012-01-11 08:52:33 +0000 | |||
2478 | @@ -24,11 +24,3 @@ | |||
2479 | 24 | */ | 24 | */ |
2480 | 25 | 25 | ||
2481 | 26 | #include "test-window-extents.h" | 26 | #include "test-window-extents.h" |
2482 | 27 | |||
2483 | 28 | CompWindowExtentsTest::CompWindowExtentsTest () | ||
2484 | 29 | { | ||
2485 | 30 | } | ||
2486 | 31 | |||
2487 | 32 | CompWindowExtentsTest::~CompWindowExtentsTest () | ||
2488 | 33 | { | ||
2489 | 34 | } | ||
2490 | 35 | 27 | ||
2491 | === modified file 'src/window/extents/tests/test-window-extents.h' | |||
2492 | --- src/window/extents/tests/test-window-extents.h 2012-01-11 08:52:32 +0000 | |||
2493 | +++ src/window/extents/tests/test-window-extents.h 2012-01-11 08:52:33 +0000 | |||
2494 | @@ -33,10 +33,6 @@ | |||
2495 | 33 | 33 | ||
2496 | 34 | class CompWindowExtentsTest : public ::testing::Test | 34 | class CompWindowExtentsTest : public ::testing::Test |
2497 | 35 | { | 35 | { |
2498 | 36 | public: | ||
2499 | 37 | |||
2500 | 38 | CompWindowExtentsTest (); | ||
2501 | 39 | virtual ~CompWindowExtentsTest (); | ||
2502 | 40 | }; | 36 | }; |
2503 | 41 | 37 | ||
2504 | 42 | #endif | 38 | #endif |
Added a simple server- >stack- >container- >object model for handling window
geometry and stacking (not yet functional).
A server can be either synchronous or asynchronous in operation, as can an
object that is being displayed onscreen. Asynchronous objects own a write
connection object to the server and have events written to them by the read
connection object that the server owns.
Each window is part of an object tree, with parent and children objects. The
root object is specified as part of the server and its children are traversible.
Stack positions are kept for each container object, which is also an on-screen
object and geometry and stacking positions are done relative to the container.
Implementations should derive from the Synchronous* or Asynchronous* classes.
Typically Synchronous* implementations would be used for testing purposes.