Merge lp:~smspillaz/compiz-core/fix_899557 into lp:compiz-core/0.9.5

Proposed by Sam Spilsbury
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
Reviewer Review Type Date Requested Status
Compiz Maintainers Pending
Review via email: mp+84442@code.launchpad.net

Description of the change

    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.

Next Pipe: lp:~smspillaz/compiz-core/merge_894639

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

    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.

lp:~smspillaz/compiz-core/fix_899557 updated
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

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

Subscribers

People subscribed via source and target branches