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
=== modified file 'include/core/CMakeLists.txt'
--- include/core/CMakeLists.txt 2012-01-11 08:52:32 +0000
+++ include/core/CMakeLists.txt 2012-01-11 08:52:33 +0000
@@ -1,11 +1,17 @@
1set (_headers1set (_headers
2 action.h2 action.h
3 asynchronous-container.h
4 asynchronous-object.h
5 asynchronous-server.h
6 asynchronous-stack.h
3 atoms.h7 atoms.h
8 container.h
4 core.h9 core.h
5 countedlist.h10 countedlist.h
6 icon.h11 icon.h
7 match.h12 match.h
8 modifierhandler.h13 modifierhandler.h
14 object.h
9 option.h15 option.h
10 output.h16 output.h
11 plugin.h17 plugin.h
@@ -14,8 +20,14 @@
14 region.h20 region.h
15 screen.h21 screen.h
16 serialization.h22 serialization.h
23 server.h
24 server-read.h
25 server-write.h
17 session.h26 session.h
18 size.h27 size.h
28 stack.h
29 stackposition.h
30 valueholder.h
19 window.h31 window.h
20 wrapsystem.h32 wrapsystem.h
21)33)
2234
=== added file 'include/core/asynchronous-container.h'
--- include/core/asynchronous-container.h 1970-01-01 00:00:00 +0000
+++ include/core/asynchronous-container.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,93 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_ASYNCHRONOUS_CONTAINER_H
28#define _COMPIZ_ASYNCHRONOUS_CONTAINER_H
29
30#include <boost/shared_ptr.hpp>
31#include <core/windowgeometry.h>
32#include <core/stackposition.h>
33#include <core/asynchronous-object.h>
34#include <core/container.h>
35
36namespace compiz
37{
38namespace window
39{
40
41class WriteServerConnection;
42class ReadServerConnection;
43
44class AsynchronousContainer :
45 public AsynchronousObject,
46 public Container
47{
48 public:
49
50 typedef boost::shared_ptr <AsynchronousContainer> Ptr;
51
52 AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &,
53 const boost::shared_ptr <WriteServerConnection> &);
54 AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &,
55 const compiz::window::Geometry &,
56 const boost::shared_ptr <WriteServerConnection> &);
57 AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &,
58 const compiz::window::Geometry &,
59 const compiz::window::StackPosition &,
60 const boost::shared_ptr <WriteServerConnection> &);
61 AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &,
62 const compiz::window::Geometry &,
63 const compiz::window::StackPosition &,
64 const boost::shared_ptr <Container> &,
65 const boost::shared_ptr <WriteServerConnection> &);
66
67 virtual ~AsynchronousContainer ();
68
69 Container::Children sentChildren ();
70
71 void sendInsertion (const Object::Ptr &);
72 Object::Ptr sendRemoval (const Object::Ptr &);
73
74 protected:
75
76 void receiveInsertion (const Object::Ptr &);
77 void receiveRemoval (const Object::Ptr &);
78
79 void addSentInsertion (const Object::Ptr &);
80 Object::Ptr addSentRemoval (const Object::Ptr &);
81
82 friend class ReadServerConnection;
83
84 private:
85
86 Children mSentChildren;
87 boost::shared_ptr <WriteServerConnection> mWriteConnection;
88};
89
90}
91}
92
93#endif
094
=== added file 'include/core/asynchronous-object.h'
--- include/core/asynchronous-object.h 1970-01-01 00:00:00 +0000
+++ include/core/asynchronous-object.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,94 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_ASYNCHRONOUS_OBJECT_H
28#define _COMPIZ_ASYNCHRONOUS_OBJECT_H
29
30#include <boost/shared_ptr.hpp>
31#include <core/windowgeometry.h>
32#include <core/stackposition.h>
33#include <core/object.h>
34
35
36namespace compiz
37{
38namespace window
39{
40
41class WriteServerConnection;
42
43class AsynchronousObject :
44 virtual public Object
45{
46 public:
47
48 typedef boost::shared_ptr <AsynchronousObject> Ptr;
49
50 AsynchronousObject (const ObjectIdentifier::Ptr &,
51 const boost::shared_ptr <WriteServerConnection> &);
52 AsynchronousObject (const ObjectIdentifier::Ptr &,
53 const compiz::window::Geometry &,
54 const boost::shared_ptr <WriteServerConnection> &);
55 AsynchronousObject (const ObjectIdentifier::Ptr &,
56 const compiz::window::Geometry &,
57 const compiz::window::StackPosition &,
58 const boost::shared_ptr <WriteServerConnection> &);
59 AsynchronousObject (const ObjectIdentifier::Ptr &,
60 const compiz::window::Geometry &,
61 const compiz::window::StackPosition &,
62 const boost::shared_ptr <Container> &,
63 const boost::shared_ptr <WriteServerConnection> &);
64 virtual ~AsynchronousObject ();
65
66 /* Most recent sent positions */
67 const compiz::window::Geometry &sentGeometry () const;
68 const compiz::window::StackPosition &sentStackPosition () const;
69
70 void sendGeometry (const compiz::window::Geometry &);
71 void sendStackPosition (const compiz::window::StackPosition &);
72
73 protected:
74
75 void receiveGeometry (const compiz::window::Geometry &);
76 void receiveStackPosition (const compiz::window::StackPosition &);
77 //void receiveMap ();
78
79 void addSentGeometry (const compiz::window::Geometry &);
80 void addSentStackPosition (const compiz::window::StackPosition &);
81
82 boost::shared_ptr <WriteServerConnection> mWriteConnection;
83
84 friend class ReadServerConnection;
85
86 private:
87
88 compiz::window::Geometry mSentGeometry;
89 compiz::window::StackPosition mSentStackPosition;
90};
91}
92}
93
94#endif
095
=== added file 'include/core/asynchronous-server.h'
--- include/core/asynchronous-server.h 1970-01-01 00:00:00 +0000
+++ include/core/asynchronous-server.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,79 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_ASYNCHRONOUS_SERVER_H
28#define _COMPIZ_ASYNCHRONOUS_SERVER_H
29
30#include <boost/shared_ptr.hpp>
31#include <boost/enable_shared_from_this.hpp>
32#include <boost/noncopyable.hpp>
33#include <core/server.h>
34#include <core/server-read.h>
35#include <core/windowgeometry.h>
36#include <core/stackposition.h>
37#include <core/object.h>
38#include <glibmm/main.h>
39
40namespace compiz
41{
42namespace window
43{
44
45class WriteServerConnection;
46
47class AsynchronousServer :
48 public Server,
49 public boost::enable_shared_from_this <AsynchronousServer>
50{
51 public:
52
53 typedef boost::shared_ptr <AsynchronousServer> Ptr;
54
55 virtual ~AsynchronousServer ();
56
57 boost::shared_ptr <WriteServerConnection> connect ();
58
59 protected:
60
61 AsynchronousServer ();
62
63 virtual void sendGeometry (const ObjectIdentifier::Ptr &,
64 const compiz::window::Geometry &) = 0;
65 virtual void sendStackPosition (const ObjectIdentifier::Ptr &,
66 const compiz::window::StackPosition &) = 0;
67 virtual void sendParent (const ObjectIdentifier::Ptr &,
68 const ObjectIdentifier::Ptr &) = 0;
69
70 compiz::window::ReadServerConnection::Ptr mReadConnection;
71 Glib::RefPtr <Glib::Source> mEventSource;
72
73 friend class WriteServerConnection;
74};
75
76}
77}
78
79#endif
080
=== added file 'include/core/asynchronous-stack.h'
--- include/core/asynchronous-stack.h 1970-01-01 00:00:00 +0000
+++ include/core/asynchronous-stack.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,76 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_ASYNCHRONOUS_STACK_H
28#define _COMPIZ_ASYNCHRONOUS_STACK_H
29
30#include <boost/shared_ptr.hpp>
31#include <boost/noncopyable.hpp>
32#include <core/object.h>
33#include <core/stack.h>
34#include <core/object.h>
35#include <glibmm/main.h>
36
37namespace compiz
38{
39namespace window
40{
41
42class AsynchronousServer;
43class WriteServerConnection;
44
45class AsynchronousStack :
46 public compiz::window::Stack
47{
48 public:
49
50 typedef boost::shared_ptr <AsynchronousStack> Ptr;
51 virtual ~AsynchronousStack ();
52
53 const std::vector <Object::Ptr> & sentObjects () const;
54
55 void sendStack (const std::vector <Object::Ptr> &objects);
56 void sendRestackObject (const compiz::window::Object::Ptr &id,
57 const compiz::window::StackPosition &sp);
58
59 protected:
60
61 AsynchronousStack (const boost::shared_ptr <AsynchronousServer> &);
62
63 void receiveRestackObject (const compiz::window::Object::Ptr &o,
64 const compiz::window::StackPosition &sp);
65
66 private:
67
68 /* Bottom to top */
69 std::vector <Object::Ptr> mSentObjects;
70 boost::shared_ptr <compiz::window::WriteServerConnection> mWriteConnection;
71};
72
73}
74}
75
76#endif
077
=== added file 'include/core/container.h'
--- include/core/container.h 1970-01-01 00:00:00 +0000
+++ include/core/container.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,103 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_CONTAINER_H
28#define _COMPIZ_CONTAINER_H
29
30#include <boost/shared_ptr.hpp>
31#include <core/windowgeometry.h>
32#include <core/stackposition.h>
33#include <core/object.h>
34
35namespace compiz
36{
37namespace window
38{
39
40class Container :
41 virtual public Object
42{
43 public:
44
45 typedef boost::shared_ptr <Container> Ptr;
46 typedef std::vector <Object::Ptr> Children;
47
48 Container (const compiz::window::ObjectIdentifier::Ptr &);
49 Container (const compiz::window::ObjectIdentifier::Ptr &,
50 const compiz::window::Geometry &);
51 Container (const compiz::window::ObjectIdentifier::Ptr &,
52 const compiz::window::Geometry &,
53 const compiz::window::StackPosition &);
54 Container (const compiz::window::ObjectIdentifier::Ptr &,
55 const compiz::window::Geometry &,
56 const compiz::window::StackPosition &,
57 const boost::shared_ptr <Container> &);
58
59 virtual ~Container ();
60
61 Children children ();
62
63 protected:
64
65 bool insert (const Object::Ptr &);
66 Object::Ptr remove (const compiz::window::ObjectIdentifier::Ptr &);
67 Object::Ptr remove (const Object::Ptr &);
68
69 private:
70
71 Children mChildren;
72};
73
74class SynchronousContainer :
75 public SynchronousObject,
76 public Container
77{
78 public:
79
80 typedef boost::shared_ptr <SynchronousContainer> Ptr;
81
82 SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &);
83 SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &,
84 const compiz::window::Geometry &);
85 SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &,
86 const compiz::window::Geometry &,
87 const compiz::window::StackPosition &);
88 SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &,
89 const compiz::window::Geometry &,
90 const compiz::window::StackPosition &,
91 const boost::shared_ptr <Container> &);
92
93 virtual ~SynchronousContainer ();
94
95 bool insert (const Object::Ptr &);
96 Object::Ptr remove (const compiz::window::ObjectIdentifier::Ptr &);
97 Object::Ptr remove (const Object::Ptr &);
98};
99
100}
101}
102
103#endif
0104
=== added file 'include/core/object.h'
--- include/core/object.h 1970-01-01 00:00:00 +0000
+++ include/core/object.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,154 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_OBJECT_H
28#define _COMPIZ_OBJECT_H
29
30#include <boost/shared_ptr.hpp>
31#include <core/windowgeometry.h>
32#include <core/stackposition.h>
33#include <boost/enable_shared_from_this.hpp>
34
35namespace compiz
36{
37namespace window
38{
39
40class Container;
41class Object;
42class ObjectIdentifier;
43class Server;
44
45bool objectIdentifierEq (const boost::shared_ptr <Object> &o,
46 const boost::shared_ptr <ObjectIdentifier> &i);
47
48class ObjectIdentifier :
49 public boost::enable_shared_from_this <ObjectIdentifier>
50{
51 public:
52
53 /* Available identifier types
54 * supported by this system */
55 typedef enum
56 {
57 MockWire = 0,
58 X11 = 1
59 } ObjectType;
60
61 typedef boost::shared_ptr <ObjectIdentifier> Ptr;
62
63 virtual ~ObjectIdentifier ();
64
65 bool operator== (const ObjectIdentifier::Ptr &) const;
66 bool operator!= (const ObjectIdentifier::Ptr &) const;
67
68 bool equal (const ObjectIdentifier::Ptr &) const;
69
70 const boost::shared_ptr <Object> & operator() ();
71 const boost::shared_ptr <Object> & operator() () const;
72
73 protected:
74
75 virtual bool compare (const ObjectIdentifier::Ptr &) const = 0;
76 virtual ObjectType getType () const = 0;
77 virtual const boost::shared_ptr <Object> & lookup () const = 0;
78
79 /* Either fully resolved or looked up
80 * at runtime in the repository */
81 boost::shared_ptr <Object> mObj;
82
83 friend class Server;
84};
85
86class Object
87{
88 public:
89
90 typedef boost::shared_ptr <Object> Ptr;
91
92 Object (const ObjectIdentifier::Ptr &);
93 Object (const ObjectIdentifier::Ptr &,
94 const compiz::window::Geometry &);
95 Object (const ObjectIdentifier::Ptr &,
96 const compiz::window::Geometry &,
97 const compiz::window::StackPosition &);
98 Object (const ObjectIdentifier::Ptr &,
99 const compiz::window::Geometry &,
100 const compiz::window::StackPosition &,
101 const boost::shared_ptr <Container> &);
102 virtual ~Object ();
103
104 const boost::shared_ptr <Container> & container () const;
105
106 const ObjectIdentifier::Ptr & id () const;
107 const compiz::window::Geometry & geometry () const;
108 const compiz::window::StackPosition & stackPosition () const;
109
110 bool operator== (const Object &) const;
111 bool operator!= (const Object &) const;
112
113 protected:
114
115 bool setStackPosition (const StackPosition &);
116 bool setGeometry (const Geometry &);
117 //virtual bool show () = 0;
118 //virtual bool hide () = 0;
119
120 private:
121
122 ObjectIdentifier::Ptr mId;
123 compiz::window::Geometry mGeometry;
124 compiz::window::StackPosition mStackPosition;
125 boost::shared_ptr <Container> mContainer;
126};
127
128class SynchronousObject :
129 virtual public Object
130{
131 public:
132
133 typedef boost::shared_ptr <SynchronousObject> Ptr;
134
135 SynchronousObject (const ObjectIdentifier::Ptr &);
136 SynchronousObject (const ObjectIdentifier::Ptr &,
137 const compiz::window::Geometry &);
138 SynchronousObject (const ObjectIdentifier::Ptr &,
139 const compiz::window::Geometry &,
140 const compiz::window::StackPosition &);
141 SynchronousObject (const ObjectIdentifier::Ptr &,
142 const compiz::window::Geometry &,
143 const compiz::window::StackPosition &,
144 const boost::shared_ptr <Container> &);
145 virtual ~SynchronousObject ();
146
147 bool setStackPosition (const StackPosition &);
148 bool setGeometry (const Geometry &);
149};
150
151}
152}
153
154#endif
0155
=== added file 'include/core/server-read.h'
--- include/core/server-read.h 1970-01-01 00:00:00 +0000
+++ include/core/server-read.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,71 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_ASYNCHRONOUS_SERVER_READ_CONNECTION_H
28#define _COMPIZ_ASYNCHRONOUS_SERVER_READ_CONNECTION_H
29
30#include <boost/shared_ptr.hpp>
31#include <boost/noncopyable.hpp>
32#include <core/windowgeometry.h>
33#include <core/stackposition.h>
34#include <core/object.h>
35#include <core/asynchronous-object.h>
36#include <core/asynchronous-container.h>
37
38namespace compiz
39{
40namespace window
41{
42
43class AsynchronousServer;
44
45class ReadServerConnection :
46 public boost::noncopyable
47{
48 public:
49
50 typedef boost::shared_ptr <ReadServerConnection> Ptr;
51 virtual ~ReadServerConnection ();
52
53 void receiveGeometry (const AsynchronousObject::Ptr &,
54 const compiz::window::Geometry &);
55
56 void receiveStackPosition (const AsynchronousObject::Ptr &,
57 const compiz::window::StackPosition &);
58
59 void receiveParent (const AsynchronousObject::Ptr &,
60 const AsynchronousContainer::Ptr &);
61 protected:
62
63 ReadServerConnection ();
64
65 friend class AsynchronousServer;
66};
67
68}
69}
70
71#endif
072
=== added file 'include/core/server-write.h'
--- include/core/server-write.h 1970-01-01 00:00:00 +0000
+++ include/core/server-write.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,70 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_ASYNCHRONOUS_SERVER_WRITE_CONNECTION_H
28#define _COMPIZ_ASYNCHRONOUS_SERVER_WRITE_CONNECTION_H
29
30#include <core/asynchronous-server.h>
31#include <boost/shared_ptr.hpp>
32#include <boost/noncopyable.hpp>
33#include <core/windowgeometry.h>
34#include <core/stackposition.h>
35#include <core/object.h>
36
37namespace compiz
38{
39namespace window
40{
41
42class WriteServerConnection :
43 public boost::noncopyable
44{
45 public:
46
47 typedef boost::shared_ptr <WriteServerConnection> Ptr;
48 virtual ~WriteServerConnection ();
49
50 void sendGeometry (const ObjectIdentifier::Ptr &id,
51 const compiz::window::Geometry &g);
52
53 void sendStackPosition (const ObjectIdentifier::Ptr &id,
54 const compiz::window::StackPosition &sp);
55
56 void sendParent (const ObjectIdentifier::Ptr &id,
57 const ObjectIdentifier::Ptr &parent);
58 private:
59
60 WriteServerConnection (const compiz::window::AsynchronousServer::Ptr &);
61
62 compiz::window::AsynchronousServer::Ptr mServer;
63
64 friend class AsynchronousServer;
65};
66
67}
68}
69
70#endif
071
=== added file 'include/core/server.h'
--- include/core/server.h 1970-01-01 00:00:00 +0000
+++ include/core/server.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,65 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_SERVER_H
28#define _COMPIZ_SERVER_H
29
30#include <boost/shared_ptr.hpp>
31#include <boost/noncopyable.hpp>
32#include <core/object.h>
33
34namespace compiz
35{
36namespace window
37{
38
39class Server :
40 public boost::noncopyable
41{
42 public:
43
44 typedef boost::shared_ptr <Server> Ptr;
45 virtual ~Server ();
46
47 const Object::Ptr & root ();
48 virtual const Object::Ptr & lookup (const boost::shared_ptr <const ObjectIdentifier> &id) = 0;
49
50 static Server::Ptr Default ();
51
52 protected:
53
54 Server ();
55
56 private:
57
58 Object::Ptr mRoot;
59 static Server::Ptr mDefault;
60};
61
62}
63}
64
65#endif
066
=== added file 'include/core/stack.h'
--- include/core/stack.h 1970-01-01 00:00:00 +0000
+++ include/core/stack.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,87 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_STACK_H
28#define _COMPIZ_STACK_H
29
30#include <boost/shared_ptr.hpp>
31#include <boost/noncopyable.hpp>
32#include <core/asynchronous-object.h>
33#include <core/object.h>
34#include <glibmm/main.h>
35
36namespace compiz
37{
38namespace window
39{
40
41class Stack :
42 public boost::noncopyable
43{
44 public:
45
46 typedef boost::shared_ptr <Stack> Ptr;
47 const std::vector <compiz::window::Object::Ptr> & objects () const;
48 virtual ~Stack ();
49
50 protected:
51
52 Stack ();
53
54 /* Rewrites entire window stack, throws
55 * if there are missing entities from
56 * mToplevelObjects to toplevelObjects */
57 void setStack (const std::vector <Object::Ptr> &toplevelObjects);
58
59 /* Inserts a window at a StackPosition specified */
60 void restackObject (const compiz::window::Object::Ptr &,
61 const compiz::window::StackPosition &);
62
63 /* Bottom to top */
64 std::vector <Object::Ptr> mObjects;
65};
66
67class SynchronousStack :
68 public compiz::window::Stack
69{
70 public:
71
72 typedef boost::shared_ptr <SynchronousStack> Ptr;
73 virtual ~SynchronousStack ();
74
75 void setStack (const std::vector <Object::Ptr> &toplevelObjects);
76 void restackObject (const compiz::window::Object::Ptr &,
77 const compiz::window::StackPosition &);
78
79 protected:
80
81 SynchronousStack ();
82};
83
84}
85}
86
87#endif
088
=== added file 'include/core/stackposition.h'
--- include/core/stackposition.h 1970-01-01 00:00:00 +0000
+++ include/core/stackposition.h 2012-01-11 08:52:33 +0000
@@ -0,0 +1,46 @@
1/*
2 * Copyright © 2011 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Dennis Kasprzyk makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
24 * David Reveman <davidr@novell.com>
25 */
26
27#ifndef _COMPIZ_STACKPOSITION_H
28#define _COMPIZ_STACKPOSITION_H
29
30
31namespace compiz
32{
33namespace window
34{
35
36class StackPosition
37{
38 public:
39
40 typedef boost::shared_ptr <StackPosition> Ptr;
41};
42
43}
44}
45
46#endif
047
=== modified file 'include/core/window.h'
--- include/core/window.h 2012-01-11 08:52:32 +0000
+++ include/core/window.h 2012-01-11 08:52:33 +0000
@@ -29,6 +29,7 @@
29#define _COMPWINDOW_H29#define _COMPWINDOW_H
3030
31#include <boost/function.hpp>31#include <boost/function.hpp>
32#include <boost/shared_ptr.hpp>
3233
33#include <X11/Xlib-xcb.h>34#include <X11/Xlib-xcb.h>
34#include <X11/Xutil.h>35#include <X11/Xutil.h>
@@ -42,9 +43,11 @@
42#include <core/point.h>43#include <core/point.h>
43#include <core/region.h>44#include <core/region.h>
44#include <core/windowgeometry.h>45#include <core/windowgeometry.h>
46#include <core/windowconstrainment.h>
45#include <core/windowgeometrysaver.h>47#include <core/windowgeometrysaver.h>
46#include <core/windowextents.h>48#include <core/windowextents.h>
47#include <core/windowconstrainment.h>49#include <core/asynchronous-container.h>
50#include <core/asynchronous-object.h>
4851
49#include <core/wrapsystem.h>52#include <core/wrapsystem.h>
5053
@@ -246,7 +249,6 @@
246}249}
247}250}
248251
249
250/**252/**
251 * Wrappable core window functions. Derive from this class253 * Wrappable core window functions. Derive from this class
252 * and overload these functions in order to have your function called254 * and overload these functions in order to have your function called
253255
=== modified file 'plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp'
--- plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 2012-01-11 08:52:32 +0000
+++ plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 2012-01-11 08:52:33 +0000
@@ -32,20 +32,8 @@
32class CompPlaceTestConstrainToWorkarea :32class CompPlaceTestConstrainToWorkarea :
33 public CompPlaceTest33 public CompPlaceTest
34{34{
35public:
36
37 CompPlaceTestConstrainToWorkarea ();
38 ~CompPlaceTestConstrainToWorkarea ();
39};35};
4036
41CompPlaceTestConstrainToWorkarea::CompPlaceTestConstrainToWorkarea ()
42{
43}
44
45CompPlaceTestConstrainToWorkarea::~CompPlaceTestConstrainToWorkarea ()
46{
47}
48
49TEST_F (CompPlaceTestConstrainToWorkarea, TestConstrainToWorkarea)37TEST_F (CompPlaceTestConstrainToWorkarea, TestConstrainToWorkarea)
50{38{
51 CompSize screensize (1000, 2000);39 CompSize screensize (1000, 2000);
5240
=== modified file 'plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp'
--- plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp 2012-01-11 08:52:32 +0000
+++ plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp 2012-01-11 08:52:33 +0000
@@ -24,11 +24,3 @@
24 */24 */
2525
26#include "test-constrain-to-workarea.h"26#include "test-constrain-to-workarea.h"
27
28CompPlaceTest::CompPlaceTest ()
29{
30}
31
32CompPlaceTest::~CompPlaceTest ()
33{
34}
3527
=== modified file 'plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h'
--- plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h 2012-01-11 08:52:32 +0000
+++ plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h 2012-01-11 08:52:33 +0000
@@ -39,10 +39,6 @@
3939
40class CompPlaceTest : public ::testing::Test40class CompPlaceTest : public ::testing::Test
41{41{
42public:
43
44 CompPlaceTest ();
45 virtual ~CompPlaceTest ();
46};42};
4743
48#endif44#endif
4945
=== modified file 'plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp'
--- plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp 2012-01-11 08:52:32 +0000
+++ plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp 2012-01-11 08:52:33 +0000
@@ -32,20 +32,8 @@
32class CompPlaceScreenSizeChangeTestScreenSizeChange :32class CompPlaceScreenSizeChangeTestScreenSizeChange :
33 public CompPlaceScreenSizeChangeTest33 public CompPlaceScreenSizeChangeTest
34{34{
35public:
36
37 CompPlaceScreenSizeChangeTestScreenSizeChange ();
38 ~CompPlaceScreenSizeChangeTestScreenSizeChange ();
39};35};
4036
41CompPlaceScreenSizeChangeTestScreenSizeChange::CompPlaceScreenSizeChangeTestScreenSizeChange ()
42{
43}
44
45CompPlaceScreenSizeChangeTestScreenSizeChange::~CompPlaceScreenSizeChangeTestScreenSizeChange ()
46{
47}
48
49class MockScreenSizeChangeObject :37class MockScreenSizeChangeObject :
50 public compiz::place::ScreenSizeChangeObject38 public compiz::place::ScreenSizeChangeObject
51{39{
5240
=== modified file 'plugins/place/src/screen-size-change/tests/test-screen-size-change.cpp'
--- plugins/place/src/screen-size-change/tests/test-screen-size-change.cpp 2012-01-11 08:52:32 +0000
+++ plugins/place/src/screen-size-change/tests/test-screen-size-change.cpp 2012-01-11 08:52:33 +0000
@@ -24,11 +24,3 @@
24 */24 */
2525
26#include "test-screen-size-change.h"26#include "test-screen-size-change.h"
27
28CompPlaceScreenSizeChangeTest::CompPlaceScreenSizeChangeTest ()
29{
30}
31
32CompPlaceScreenSizeChangeTest::~CompPlaceScreenSizeChangeTest ()
33{
34}
3527
=== modified file 'plugins/place/src/screen-size-change/tests/test-screen-size-change.h'
--- plugins/place/src/screen-size-change/tests/test-screen-size-change.h 2012-01-11 08:52:32 +0000
+++ plugins/place/src/screen-size-change/tests/test-screen-size-change.h 2012-01-11 08:52:33 +0000
@@ -41,9 +41,6 @@
41 public ::testing::Test41 public ::testing::Test
42{42{
43public:43public:
44
45 CompPlaceScreenSizeChangeTest ();
46 virtual ~CompPlaceScreenSizeChangeTest ();
47};44};
4845
49#endif46#endif
5047
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2012-01-11 08:52:32 +0000
+++ src/CMakeLists.txt 2012-01-11 08:52:33 +0000
@@ -98,6 +98,17 @@
98 ${CMAKE_CURRENT_SOURCE_DIR}/propertywriter.cpp98 ${CMAKE_CURRENT_SOURCE_DIR}/propertywriter.cpp
99 ${CMAKE_CURRENT_SOURCE_DIR}/eventsource.cpp99 ${CMAKE_CURRENT_SOURCE_DIR}/eventsource.cpp
100 ${CMAKE_CURRENT_SOURCE_DIR}/stackdebugger.cpp100 ${CMAKE_CURRENT_SOURCE_DIR}/stackdebugger.cpp
101 ${CMAKE_CURRENT_SOURCE_DIR}/object.cpp
102 ${CMAKE_CURRENT_SOURCE_DIR}/container.cpp
103 ${CMAKE_CURRENT_SOURCE_DIR}/asynchronous-object.cpp
104 ${CMAKE_CURRENT_SOURCE_DIR}/asynchronous-container.cpp
105 ${CMAKE_CURRENT_SOURCE_DIR}/asynchronous-server.cpp
106 ${CMAKE_CURRENT_SOURCE_DIR}/stackposition.cpp
107 ${CMAKE_CURRENT_SOURCE_DIR}/server.cpp
108 ${CMAKE_CURRENT_SOURCE_DIR}/server-read.cpp
109 ${CMAKE_CURRENT_SOURCE_DIR}/server-write.cpp
110 ${CMAKE_CURRENT_SOURCE_DIR}/stack.cpp
111 ${CMAKE_CURRENT_SOURCE_DIR}/asynchronous-stack.cpp
101 ${_bcop_sources}112 ${_bcop_sources}
102)113)
103114
104115
=== added file 'src/asynchronous-container.cpp'
--- src/asynchronous-container.cpp 1970-01-01 00:00:00 +0000
+++ src/asynchronous-container.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,126 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/asynchronous-container.h>
27#include <core/server-write.h>
28#include <core/server.h>
29
30compiz::window::AsynchronousContainer::AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id,
31 const compiz::window::WriteServerConnection::Ptr &writer) :
32 Object::Object (id),
33 AsynchronousObject::AsynchronousObject (id, writer),
34 Container::Container (id)
35{
36}
37
38compiz::window::AsynchronousContainer::AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id,
39 const compiz::window::Geometry &g,
40 const compiz::window::WriteServerConnection::Ptr &writer) :
41 Object::Object (id, g),
42 AsynchronousObject::AsynchronousObject (id, g, writer),
43 Container::Container (id, g)
44{
45}
46
47compiz::window::AsynchronousContainer::AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id,
48 const compiz::window::Geometry &g,
49 const compiz::window::StackPosition &sp,
50 const compiz::window::WriteServerConnection::Ptr &writer) :
51 Object::Object (id, g, sp),
52 AsynchronousObject::AsynchronousObject (id, g, sp, writer),
53 Container::Container (id, g, sp)
54{
55}
56
57compiz::window::AsynchronousContainer::AsynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id,
58 const compiz::window::Geometry &g,
59 const compiz::window::StackPosition &sp,
60 const boost::shared_ptr <Container> &c,
61 const compiz::window::WriteServerConnection::Ptr &writer) :
62 Object::Object (id, g, sp, c),
63 AsynchronousObject::AsynchronousObject (id, g, sp , c, writer),
64 Container::Container (id, g, sp, c)
65{
66}
67
68compiz::window::AsynchronousContainer::~AsynchronousContainer ()
69{
70}
71
72void
73compiz::window::AsynchronousContainer::sendInsertion (const Object::Ptr &o)
74{
75 mWriteConnection->sendParent (o->id (), id ());
76
77 addSentInsertion (o);
78}
79
80compiz::window::Object::Ptr
81compiz::window::AsynchronousContainer::sendRemoval (const Object::Ptr &o)
82{
83 Object::Ptr p = addSentRemoval (o);
84
85 mWriteConnection->sendParent (o->id (), Server::Default ()->root ()->id ());
86
87 return p;
88}
89
90void
91compiz::window::AsynchronousContainer::receiveInsertion (const Object::Ptr &o)
92{
93 Container::insert (o);
94}
95
96void
97compiz::window::AsynchronousContainer::receiveRemoval (const Object::Ptr &o)
98{
99 Container::remove (o);
100}
101
102void
103compiz::window::AsynchronousContainer::addSentInsertion (const Object::Ptr &o)
104{
105 mSentChildren.push_back (o);
106}
107
108compiz::window::Object::Ptr
109compiz::window::AsynchronousContainer::addSentRemoval (const Object::Ptr &o)
110{
111 Children::iterator it = std::find (mSentChildren.begin (),
112 mSentChildren.end (),
113 o);
114
115 if (it != mSentChildren.end ())
116 {
117 Object::Ptr p = *it;
118 mSentChildren.erase (it);
119
120 return p;
121 }
122
123 return Object::Ptr ();
124}
125
126
0127
=== added file 'src/asynchronous-object.cpp'
--- src/asynchronous-object.cpp 1970-01-01 00:00:00 +0000
+++ src/asynchronous-object.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,117 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/asynchronous-object.h>
27#include <core/server-write.h>
28
29compiz::window::AsynchronousObject::AsynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id,
30 const compiz::window::WriteServerConnection::Ptr &writer) :
31 Object::Object (id),
32 mWriteConnection (writer)
33{
34}
35
36compiz::window::AsynchronousObject::AsynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id,
37 const compiz::window::Geometry &g,
38 const compiz::window::WriteServerConnection::Ptr &writer) :
39 Object::Object (id, g),
40 mWriteConnection (writer)
41{
42}
43
44compiz::window::AsynchronousObject::AsynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id,
45 const compiz::window::Geometry &g,
46 const compiz::window::StackPosition &sp,
47 const compiz::window::WriteServerConnection::Ptr &writer) :
48 Object::Object (id, g, sp),
49 mWriteConnection (writer)
50{
51}
52
53compiz::window::AsynchronousObject::AsynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id,
54 const compiz::window::Geometry &g,
55 const compiz::window::StackPosition &sp,
56 const boost::shared_ptr <Container> &c,
57 const compiz::window::WriteServerConnection::Ptr &writer) :
58 Object::Object (id, g, sp, c),
59 mWriteConnection (writer)
60{
61}
62
63compiz::window::AsynchronousObject::~AsynchronousObject ()
64{
65}
66
67const compiz::window::Geometry &
68compiz::window::AsynchronousObject::sentGeometry () const
69{
70 return mSentGeometry;
71}
72
73const compiz::window::StackPosition &
74compiz::window::AsynchronousObject::sentStackPosition () const
75{
76 return mSentStackPosition;
77}
78
79void
80compiz::window::AsynchronousObject::sendGeometry (const compiz::window::Geometry &g)
81{
82 mWriteConnection->sendGeometry (id (), g);
83
84 addSentGeometry (g);
85}
86
87void
88compiz::window::AsynchronousObject::sendStackPosition (const compiz::window::StackPosition &sp)
89{
90 mWriteConnection->sendStackPosition (id (), sp);
91
92 addSentStackPosition (sp);
93}
94
95void
96compiz::window::AsynchronousObject::receiveGeometry (const compiz::window::Geometry &g)
97{
98 Object::setGeometry (g);
99}
100
101void
102compiz::window::AsynchronousObject::receiveStackPosition (const compiz::window::StackPosition &sp)
103{
104 Object::setStackPosition (sp);
105}
106
107void
108compiz::window::AsynchronousObject::addSentGeometry (const compiz::window::Geometry &g)
109{
110 mSentGeometry = g;
111}
112
113void
114compiz::window::AsynchronousObject::addSentStackPosition (const compiz::window::StackPosition &sp)
115{
116 mSentStackPosition = sp;
117}
0118
=== added file 'src/asynchronous-server.cpp'
--- src/asynchronous-server.cpp 1970-01-01 00:00:00 +0000
+++ src/asynchronous-server.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,45 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/asynchronous-server.h>
27#include <core/server-write.h>
28
29compiz::window::AsynchronousServer::AsynchronousServer () :
30 Server::Server (),
31 mReadConnection (new compiz::window::ReadServerConnection)
32{
33}
34
35compiz::window::AsynchronousServer::~AsynchronousServer ()
36{
37}
38
39compiz::window::WriteServerConnection::Ptr
40compiz::window::AsynchronousServer::connect ()
41{
42 compiz::window::AsynchronousServer::Ptr t = shared_from_this ();
43 return compiz::window::WriteServerConnection::Ptr (new compiz::window::WriteServerConnection (t));
44}
45
046
=== added file 'src/asynchronous-stack.cpp'
--- src/asynchronous-stack.cpp 1970-01-01 00:00:00 +0000
+++ src/asynchronous-stack.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,99 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/asynchronous-stack.h>
27#include <core/asynchronous-server.h>
28#include <core/asynchronous-object.h>
29#include <core/object.h>
30#include <core/server-write.h>
31
32compiz::window::AsynchronousStack::AsynchronousStack (const compiz::window::AsynchronousServer::Ptr &server) :
33 mWriteConnection (server->connect ())
34{
35}
36
37compiz::window::AsynchronousStack::~AsynchronousStack ()
38{
39}
40
41const std::vector <compiz::window::Object::Ptr> &
42compiz::window::AsynchronousStack::sentObjects () const
43{
44 return mSentObjects;
45}
46
47
48
49void
50compiz::window::AsynchronousStack::sendStack (const std::vector <Object::Ptr> &objects)
51{
52 /* Must be the same size as the last sent objects
53 * and no point restacking if there is only one object */
54 if (objects.size () == mSentObjects.size () &&
55 objects.size () > 1)
56 {
57 std::vector <Object::Ptr>::const_iterator oit (objects.begin ());
58 std::vector <Object::Ptr>::const_iterator sit (mSentObjects.begin ());
59
60 std::advance (oit, 1);
61 std::advance (sit, 1);
62
63 for (; oit != objects.end () && sit != mSentObjects.end (); ++oit, ++sit)
64 {
65 std::vector <Object::Ptr>::const_iterator poit = (oit - 1);
66 std::vector <Object::Ptr>::const_iterator psit = (sit - 1);
67
68 /* Need a heuristic that detects if the old sibling is
69 * different and if not, if that old sibling was restacked
70 * already, so we can stack above it anyways */
71 if (poit != psit)
72 {
73 const Object::Ptr &prev = (*psit);
74 const Object::Ptr &current = (*oit);
75 sendRestackObject (current, prev->stackPosition ());
76 }
77 }
78 }
79}
80
81void
82compiz::window::AsynchronousStack::sendRestackObject (const compiz::window::Object::Ptr &o,
83 const compiz::window::StackPosition &sp)
84{
85 mWriteConnection->sendStackPosition (o->id (), sp);
86
87 /* Update stack last sent to server */
88}
89
90void
91compiz::window::AsynchronousStack::receiveRestackObject (const compiz::window::Object::Ptr &o,
92 const compiz::window::StackPosition &sp)
93{
94 Stack::restackObject (o, sp);
95}
96
97
98
99
0100
=== added file 'src/container.cpp'
--- src/container.cpp 1970-01-01 00:00:00 +0000
+++ src/container.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,182 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/container.h>
27#include <core/object.h>
28#include <boost/bind.hpp>
29
30compiz::window::Container::Container (const compiz::window::ObjectIdentifier::Ptr &id) :
31 Object::Object (id)
32{
33}
34
35compiz::window::Container::Container (const compiz::window::ObjectIdentifier::Ptr &id,
36 const compiz::window::Geometry &g) :
37 Object::Object (id, g)
38{
39}
40
41compiz::window::Container::Container (const compiz::window::ObjectIdentifier::Ptr &id,
42 const compiz::window::Geometry &g,
43 const compiz::window::StackPosition &sp) :
44 Object::Object (id, g, sp)
45{
46}
47
48compiz::window::Container::Container (const compiz::window::ObjectIdentifier::Ptr &id,
49 const compiz::window::Geometry &g,
50 const compiz::window::StackPosition &sp,
51 const boost::shared_ptr <Container> &c) :
52 Object::Object (id, g, sp, c)
53{
54}
55
56compiz::window::Container::~Container ()
57{
58}
59
60compiz::window::Container::Children
61compiz::window::Container::children ()
62{
63 return mChildren;
64}
65
66bool
67compiz::window::objectIdentifierEq (const compiz::window::Object::Ptr &o,
68 const compiz::window::ObjectIdentifier::Ptr &i)
69{
70 return o->id () == i;
71}
72
73bool
74compiz::window::Container::insert (const compiz::window::Object::Ptr &o)
75{
76 Children::iterator it = std::find (mChildren.begin (), mChildren.end (), o);
77
78 if (it != mChildren.end ())
79 return false;
80 else
81 mChildren.insert (it, o);
82
83 return true;
84}
85
86compiz::window::Object::Ptr
87compiz::window::Container::remove (const compiz::window::ObjectIdentifier::Ptr &i)
88{
89 Children::iterator it = std::find_if (mChildren.begin (),
90 mChildren.end (),
91 boost::bind (objectIdentifierEq, _1, i));
92
93 if (it != mChildren.end ())
94 {
95 Object::Ptr o = *it;
96
97 mChildren.erase (it);
98 return o;
99 }
100 else
101 {
102 return Object::Ptr ();
103 }
104}
105
106compiz::window::Object::Ptr
107compiz::window::Container::remove (const Object::Ptr &o)
108{
109 Children::iterator it = std::find (mChildren.begin (),
110 mChildren.end (),
111 o);
112
113 if (it != mChildren.end ())
114 {
115 Object::Ptr o = *it;
116
117 mChildren.erase (it);
118 return o;
119 }
120 else
121 {
122 return Object::Ptr ();
123 }
124}
125
126compiz::window::SynchronousContainer::SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id) :
127 Object::Object (id),
128 SynchronousObject::SynchronousObject (id),
129 Container::Container (id)
130{
131}
132
133compiz::window::SynchronousContainer::SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id,
134 const compiz::window::Geometry &g) :
135 Object::Object (id, g),
136 SynchronousObject::SynchronousObject (id, g),
137 Container::Container (id, g)
138{
139}
140
141compiz::window::SynchronousContainer::SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id,
142 const compiz::window::Geometry &g,
143 const compiz::window::StackPosition &sp) :
144 Object::Object (id, g, sp),
145 SynchronousObject::SynchronousObject (id, g, sp),
146 Container::Container (id, g, sp)
147{
148}
149
150compiz::window::SynchronousContainer::SynchronousContainer (const compiz::window::ObjectIdentifier::Ptr &id,
151 const compiz::window::Geometry &g,
152 const compiz::window::StackPosition &sp,
153 const boost::shared_ptr <Container> &c) :
154 Object::Object (id, g, sp, c),
155 SynchronousObject::SynchronousObject (id, g, sp, c),
156 Container::Container (id, g, sp, c)
157{
158}
159
160compiz::window::SynchronousContainer::~SynchronousContainer ()
161{
162}
163
164bool
165compiz::window::SynchronousContainer::insert (const compiz::window::Object::Ptr &o)
166{
167 return Container::insert (o);
168}
169
170compiz::window::Object::Ptr
171compiz::window::SynchronousContainer::remove (const compiz::window::ObjectIdentifier::Ptr &i)
172{
173 return Container::remove (i);
174}
175
176compiz::window::Object::Ptr
177compiz::window::SynchronousContainer::remove (const compiz::window::Object::Ptr &o)
178{
179 return Container::remove (o);
180}
181
182
0183
=== added file 'src/object.cpp'
--- src/object.cpp 1970-01-01 00:00:00 +0000
+++ src/object.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,204 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/object.h>
27
28compiz::window::Object::Object (const compiz::window::ObjectIdentifier::Ptr &id) :
29 mId (id)
30{
31}
32
33compiz::window::Object::Object (const compiz::window::ObjectIdentifier::Ptr &id,
34 const compiz::window::Geometry &g) :
35 mId (id),
36 mGeometry (g)
37{
38}
39
40compiz::window::Object::Object (const compiz::window::ObjectIdentifier::Ptr &id,
41 const compiz::window::Geometry &g,
42 const compiz::window::StackPosition &sp) :
43 mId (id),
44 mGeometry (g),
45 mStackPosition (sp)
46{
47}
48
49compiz::window::Object::Object (const compiz::window::ObjectIdentifier::Ptr &id,
50 const compiz::window::Geometry &g,
51 const compiz::window::StackPosition &sp,
52 const boost::shared_ptr <Container> &c) :
53 mId (id),
54 mGeometry (g),
55 mStackPosition (sp),
56 mContainer (c)
57{
58}
59
60bool
61compiz::window::ObjectIdentifier::operator ==(const ObjectIdentifier::Ptr &other) const
62{
63 return equal (other);
64}
65
66bool
67compiz::window::ObjectIdentifier::operator !=(const ObjectIdentifier::Ptr &other) const
68{
69 return !(*this == other);
70}
71
72bool
73compiz::window::ObjectIdentifier::equal (const ObjectIdentifier::Ptr &other) const
74{
75 if (getType () == other->getType ())
76 return compare (other);
77
78 return false;
79}
80
81const boost::shared_ptr <compiz::window::Container> &
82compiz::window::Object::container () const
83{
84 return mContainer;
85}
86
87const compiz::window::Geometry &
88compiz::window::Object::geometry () const
89{
90 return mGeometry;
91}
92
93const compiz::window::StackPosition &
94compiz::window::Object::stackPosition () const
95{
96 return mStackPosition;
97}
98
99const compiz::window::ObjectIdentifier::Ptr &
100compiz::window::Object::id () const
101{
102 return mId;
103}
104
105bool
106compiz::window::Object::operator == (const Object &other) const
107{
108 return other.mId == mId;
109}
110
111bool
112compiz::window::Object::operator != (const Object &other) const
113{
114 return !(other == *this);
115}
116
117bool
118compiz::window::Object::setGeometry (const compiz::window::Geometry &g)
119{
120 unsigned int mask = mGeometry.changeMask (g);
121 mGeometry.applyChange (g, mask);
122
123 return mask != 0;
124}
125
126bool
127compiz::window::Object::setStackPosition (const StackPosition &sp)
128{
129 mStackPosition = sp;
130 return true;
131}
132
133compiz::window::Object::~Object ()
134{
135}
136
137compiz::window::SynchronousObject::SynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id) :
138 Object::Object (id)
139{
140}
141
142compiz::window::SynchronousObject::SynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id,
143 const compiz::window::Geometry &g) :
144 Object::Object (id, g)
145{
146}
147
148compiz::window::SynchronousObject::SynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id,
149 const compiz::window::Geometry &g,
150 const compiz::window::StackPosition &sp) :
151 Object::Object (id, g, sp)
152{
153}
154
155compiz::window::SynchronousObject::SynchronousObject (const compiz::window::ObjectIdentifier::Ptr &id,
156 const compiz::window::Geometry &g,
157 const compiz::window::StackPosition &sp,
158 const boost::shared_ptr <Container> &c) :
159 Object::Object (id, g, sp, c)
160{
161}
162
163compiz::window::SynchronousObject::~SynchronousObject ()
164{
165}
166
167bool
168compiz::window::SynchronousObject::setGeometry (const Geometry &g)
169{
170 return Object::setGeometry (g);
171}
172
173bool
174compiz::window::SynchronousObject::setStackPosition (const StackPosition &sp)
175{
176 return Object::setStackPosition (sp);
177}
178
179const boost::shared_ptr <compiz::window::Object> &
180compiz::window::ObjectIdentifier::operator() ()
181{
182 if (mObj)
183 return mObj;
184 else
185 {
186 mObj = lookup ();
187 return mObj;
188 }
189}
190
191const boost::shared_ptr <compiz::window::Object> &
192compiz::window::ObjectIdentifier::operator() () const
193{
194 if (mObj)
195 return mObj;
196 else
197 {
198 return lookup ();
199 }
200}
201
202compiz::window::ObjectIdentifier::~ObjectIdentifier ()
203{
204}
0205
=== modified file 'src/point/tests/point/src/test-point.cpp'
--- src/point/tests/point/src/test-point.cpp 2012-01-11 08:52:32 +0000
+++ src/point/tests/point/src/test-point.cpp 2012-01-11 08:52:33 +0000
@@ -31,7 +31,6 @@
31 public:31 public:
3232
33 CompPointTestPoint ();33 CompPointTestPoint ();
34 ~CompPointTestPoint ();
3534
36 protected:35 protected:
3736
@@ -43,10 +42,6 @@
43{42{
44}43}
4544
46CompPointTestPoint::~CompPointTestPoint ()
47{
48}
49
50TEST_F (CompPointTestPoint, TestPoint)45TEST_F (CompPointTestPoint, TestPoint)
51{46{
52 p.setX (10);47 p.setX (10);
5348
=== modified file 'src/point/tests/test-point.cpp'
--- src/point/tests/test-point.cpp 2012-01-11 08:52:32 +0000
+++ src/point/tests/test-point.cpp 2012-01-11 08:52:33 +0000
@@ -24,11 +24,3 @@
24 */24 */
2525
26#include "test-point.h"26#include "test-point.h"
27
28CompWindowPointTest::CompWindowPointTest ()
29{
30}
31
32CompWindowPointTest::~CompWindowPointTest ()
33{
34}
3527
=== modified file 'src/point/tests/test-point.h'
--- src/point/tests/test-point.h 2012-01-11 08:52:32 +0000
+++ src/point/tests/test-point.h 2012-01-11 08:52:33 +0000
@@ -33,11 +33,6 @@
3333
34class CompWindowPointTest : public ::testing::Test34class CompWindowPointTest : public ::testing::Test
35{35{
36public:
37
38 CompWindowPointTest ();
39 virtual ~CompWindowPointTest ();
40
41};36};
4237
43#endif38#endif
4439
=== modified file 'src/privatewindow.h'
--- src/privatewindow.h 2012-01-11 08:52:32 +0000
+++ src/privatewindow.h 2012-01-11 08:52:33 +0000
@@ -43,7 +43,8 @@
4343
44typedef CompWindowExtents CompFullscreenMonitorSet;44typedef CompWindowExtents CompFullscreenMonitorSet;
4545
46class PrivateWindow {46class PrivateWindow
47{
4748
48 public:49 public:
49 PrivateWindow ();50 PrivateWindow ();
@@ -53,8 +54,6 @@
5354
54 void updateFrameWindow ();55 void updateFrameWindow ();
5556
56 void setWindowMatrix ();
57
58 bool restack (Window aboveId);57 bool restack (Window aboveId);
5958
60 bool initializeSyncCounter ();59 bool initializeSyncCounter ();
6160
=== modified file 'src/rect/tests/rect/src/test-rect.cpp'
--- src/rect/tests/rect/src/test-rect.cpp 2012-01-11 08:52:32 +0000
+++ src/rect/tests/rect/src/test-rect.cpp 2012-01-11 08:52:33 +0000
@@ -30,21 +30,8 @@
30class CompRectTestRect :30class CompRectTestRect :
31 public CompRectTest31 public CompRectTest
32{32{
33public:
34
35 CompRectTestRect ();
36 ~CompRectTestRect ();
37};33};
3834
39
40CompRectTestRect::CompRectTestRect ()
41{
42}
43
44CompRectTestRect::~CompRectTestRect ()
45{
46}
47
48TEST_F (CompRectTestRect, TestRect)35TEST_F (CompRectTestRect, TestRect)
49{36{
50 ASSERT_EQ (mRect, CompRect (0, 0, 0, 0));37 ASSERT_EQ (mRect, CompRect (0, 0, 0, 0));
5138
=== added file 'src/server-read.cpp'
--- src/server-read.cpp 1970-01-01 00:00:00 +0000
+++ src/server-read.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,60 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/server-read.h>
27#include <core/asynchronous-object.h>
28#include <core/asynchronous-container.h>
29
30compiz::window::ReadServerConnection::ReadServerConnection ()
31{
32}
33
34compiz::window::ReadServerConnection::~ReadServerConnection ()
35{
36}
37
38void
39compiz::window::ReadServerConnection::receiveGeometry (const compiz::window::AsynchronousObject::Ptr &ao,
40 const compiz::window::Geometry &g)
41{
42 ao->receiveGeometry (g);
43}
44
45void
46compiz::window::ReadServerConnection::receiveStackPosition (const compiz::window::AsynchronousObject::Ptr &ao,
47 const compiz::window::StackPosition &sp)
48{
49 /* Write new stack position to parent window stack XXX */
50 ao->receiveStackPosition (sp);
51}
52
53void
54compiz::window::ReadServerConnection::receiveParent (const compiz::window::AsynchronousObject::Ptr &child,
55 const compiz::window::AsynchronousContainer::Ptr &parent)
56{
57 compiz::window::AsynchronousContainer::Ptr lastParent = boost::shared_static_cast <compiz::window::AsynchronousContainer> (child->container ());
58 lastParent->receiveRemoval (boost::shared_static_cast <compiz::window::Object> (child));
59 parent->receiveInsertion (boost::shared_static_cast <compiz::window::Object> (child));
60}
061
=== added file 'src/server-write.cpp'
--- src/server-write.cpp 1970-01-01 00:00:00 +0000
+++ src/server-write.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,59 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/server-write.h>
27
28compiz::window::WriteServerConnection::WriteServerConnection (const AsynchronousServer::Ptr &server) :
29 mServer (server)
30{
31}
32
33compiz::window::WriteServerConnection::~WriteServerConnection ()
34{
35}
36
37void
38compiz::window::WriteServerConnection::sendGeometry (const ObjectIdentifier::Ptr &id,
39 const compiz::window::Geometry &g)
40{
41 mServer->sendGeometry (id, g);
42}
43
44void
45compiz::window::WriteServerConnection::sendStackPosition (const ObjectIdentifier::Ptr &id,
46 const compiz::window::StackPosition &sp)
47{
48 mServer->sendStackPosition (id, sp);
49}
50
51void
52compiz::window::WriteServerConnection::sendParent (const ObjectIdentifier::Ptr &id,
53 const ObjectIdentifier::Ptr &pid)
54{
55 mServer->sendParent (id, pid);
56}
57
58
59
060
=== added file 'src/server.cpp'
--- src/server.cpp 1970-01-01 00:00:00 +0000
+++ src/server.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,47 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/server.h>
27
28compiz::window::Server::Ptr compiz::window::Server::mDefault = compiz::window::Server::Ptr ();
29
30compiz::window::Server::Server ()
31{
32}
33
34compiz::window::Server::~Server ()
35{
36}
37
38compiz::window::Server::Ptr compiz::window::Server::Default()
39{
40 return mDefault;
41}
42
43const compiz::window::Object::Ptr &
44compiz::window::Server::root ()
45{
46 return mRoot;
47}
048
=== added file 'src/stack.cpp'
--- src/stack.cpp 1970-01-01 00:00:00 +0000
+++ src/stack.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,71 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
25
26#include <core/stack.h>
27
28compiz::window::Stack::Stack ()
29{
30}
31
32compiz::window::Stack::~Stack ()
33{
34}
35
36void
37compiz::window::Stack::setStack (const std::vector <Object::Ptr> &toplevelObjects)
38{
39 mObjects = toplevelObjects;
40}
41
42void
43compiz::window::Stack::restackObject (const compiz::window::Object::Ptr &o,
44 const compiz::window::StackPosition &sp)
45{
46 /* Lookup position, insert object into stack */
47}
48
49compiz::window::SynchronousStack::SynchronousStack () :
50 Stack::Stack ()
51{
52}
53
54compiz::window::SynchronousStack::~SynchronousStack ()
55{
56}
57
58void
59compiz::window::SynchronousStack::setStack (const std::vector <Object::Ptr> &toplevelObjects)
60{
61 Stack::setStack (toplevelObjects);
62}
63
64void
65compiz::window::SynchronousStack::restackObject (const compiz::window::Object::Ptr &o,
66 const compiz::window::StackPosition &sp)
67{
68 Stack::restackObject (o, sp);
69}
70
71
072
=== added file 'src/stackposition.cpp'
--- src/stackposition.cpp 1970-01-01 00:00:00 +0000
+++ src/stackposition.cpp 2012-01-11 08:52:33 +0000
@@ -0,0 +1,24 @@
1/*
2 * Copyright © 2010 Canonical Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Canonical Ltd. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Canonical Ltd. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
24 */
025
=== modified file 'src/window/constrainment/tests/test-window-constrainment.cpp'
--- src/window/constrainment/tests/test-window-constrainment.cpp 2012-01-11 08:52:32 +0000
+++ src/window/constrainment/tests/test-window-constrainment.cpp 2012-01-11 08:52:33 +0000
@@ -24,11 +24,3 @@
24 */24 */
2525
26#include "test-window-constrainment.h"26#include "test-window-constrainment.h"
27
28CompWindowConstrainmentTest::CompWindowConstrainmentTest ()
29{
30}
31
32CompWindowConstrainmentTest::~CompWindowConstrainmentTest ()
33{
34}
3527
=== modified file 'src/window/constrainment/tests/test-window-constrainment.h'
--- src/window/constrainment/tests/test-window-constrainment.h 2012-01-11 08:52:32 +0000
+++ src/window/constrainment/tests/test-window-constrainment.h 2012-01-11 08:52:33 +0000
@@ -34,10 +34,6 @@
3434
35class CompWindowConstrainmentTest : public ::testing::Test35class CompWindowConstrainmentTest : public ::testing::Test
36{36{
37public:
38
39 CompWindowConstrainmentTest ();
40 virtual ~CompWindowConstrainmentTest ();
41};37};
4238
43#endif39#endif
4440
=== modified file 'src/window/constrainment/tests/to-hints/src/test-window-constrainment-to-hints.cpp'
--- src/window/constrainment/tests/to-hints/src/test-window-constrainment-to-hints.cpp 2012-01-11 08:52:32 +0000
+++ src/window/constrainment/tests/to-hints/src/test-window-constrainment-to-hints.cpp 2012-01-11 08:52:33 +0000
@@ -29,20 +29,8 @@
29class CompWindowConstrainmentTestToHints :29class CompWindowConstrainmentTestToHints :
30 public CompWindowConstrainmentTest30 public CompWindowConstrainmentTest
31{31{
32public:
33
34 CompWindowConstrainmentTestToHints ();
35 virtual ~CompWindowConstrainmentTestToHints ();
36};32};
3733
38CompWindowConstrainmentTestToHints::CompWindowConstrainmentTestToHints ()
39{
40}
41
42CompWindowConstrainmentTestToHints::~CompWindowConstrainmentTestToHints ()
43{
44}
45
46TEST_F (CompWindowConstrainmentTestToHints, ToHints)34TEST_F (CompWindowConstrainmentTestToHints, ToHints)
47{35{
48 /* No hints, size is the same */36 /* No hints, size is the same */
4937
=== modified file 'src/window/extents/tests/shift/src/test-window-extents-shift.cpp'
--- src/window/extents/tests/shift/src/test-window-extents-shift.cpp 2012-01-11 08:52:32 +0000
+++ src/window/extents/tests/shift/src/test-window-extents-shift.cpp 2012-01-11 08:52:33 +0000
@@ -30,24 +30,11 @@
30class CompWindowExtentsTestShift :30class CompWindowExtentsTestShift :
31 public CompWindowExtentsTest31 public CompWindowExtentsTest
32{32{
33public:
34
35 CompWindowExtentsTestShift ();
36 virtual ~CompWindowExtentsTestShift ();
37
38protected:33protected:
3934
40 compiz::window::extents::Extents e;35 compiz::window::extents::Extents e;
41};36};
4237
43CompWindowExtentsTestShift::CompWindowExtentsTestShift ()
44{
45}
46
47CompWindowExtentsTestShift::~CompWindowExtentsTestShift ()
48{
49}
50
51TEST_F (CompWindowExtentsTestShift, TestShift)38TEST_F (CompWindowExtentsTestShift, TestShift)
52{39{
53 CompPoint rp;40 CompPoint rp;
5441
=== modified file 'src/window/extents/tests/test-window-extents.cpp'
--- src/window/extents/tests/test-window-extents.cpp 2012-01-11 08:52:32 +0000
+++ src/window/extents/tests/test-window-extents.cpp 2012-01-11 08:52:33 +0000
@@ -24,11 +24,3 @@
24 */24 */
2525
26#include "test-window-extents.h"26#include "test-window-extents.h"
27
28CompWindowExtentsTest::CompWindowExtentsTest ()
29{
30}
31
32CompWindowExtentsTest::~CompWindowExtentsTest ()
33{
34}
3527
=== modified file 'src/window/extents/tests/test-window-extents.h'
--- src/window/extents/tests/test-window-extents.h 2012-01-11 08:52:32 +0000
+++ src/window/extents/tests/test-window-extents.h 2012-01-11 08:52:33 +0000
@@ -33,10 +33,6 @@
3333
34class CompWindowExtentsTest : public ::testing::Test34class CompWindowExtentsTest : public ::testing::Test
35{35{
36public:
37
38 CompWindowExtentsTest ();
39 virtual ~CompWindowExtentsTest ();
40};36};
4137
42#endif38#endif

Subscribers

People subscribed via source and target branches