Mir
window_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored By: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIR_SHELL_WINDOW_MANAGER_H_
20 #define MIR_SHELL_WINDOW_MANAGER_H_
21 
23 #include "mir_toolkit/common.h"
24 #include "mir_toolkit/event.h"
25 
26 #include <memory>
27 
28 namespace mir
29 {
30 namespace geometry { struct Rectangle; }
31 namespace scene { class Session; class Surface; struct SurfaceCreationParameters; }
32 namespace shell
33 {
34 struct SurfaceSpecification;
35 
38 {
39 public:
40  virtual void add_session(std::shared_ptr<scene::Session> const& session) = 0;
41 
42  virtual void remove_session(std::shared_ptr<scene::Session> const& session) = 0;
43 
44  virtual frontend::SurfaceId add_surface(
45  std::shared_ptr<scene::Session> const& session,
47  std::function<frontend::SurfaceId(std::shared_ptr<scene::Session> const& session, scene::SurfaceCreationParameters const& params)> const& build) = 0;
48 
49  virtual void modify_surface(
50  std::shared_ptr<scene::Session> const& session,
51  std::shared_ptr<scene::Surface> const& surface,
52  SurfaceSpecification const& modifications) = 0;
53 
54  virtual void remove_surface(
55  std::shared_ptr<scene::Session> const& session,
56  std::weak_ptr<scene::Surface> const& surface) = 0;
57 
58  virtual void add_display(geometry::Rectangle const& area) = 0;
59 
60  virtual void remove_display(geometry::Rectangle const& area) = 0;
61 
62  virtual bool handle_keyboard_event(MirKeyboardEvent const* event) = 0;
63 
64  virtual bool handle_touch_event(MirTouchEvent const* event) = 0;
65 
66  virtual bool handle_pointer_event(MirPointerEvent const* event) = 0;
67 
68  virtual int set_surface_attribute(
69  std::shared_ptr<scene::Session> const& session,
70  std::shared_ptr<scene::Surface> const& surface,
71  MirWindowAttrib attrib,
72  int value) = 0;
73 
74  virtual void handle_raise_surface(
75  std::shared_ptr<scene::Session> const& session,
76  std::shared_ptr<scene::Surface> const& surface,
77  uint64_t timestamp) = 0;
78 
79  virtual ~WindowManager() = default;
80  WindowManager() = default;
81  WindowManager(WindowManager const&) = delete;
82  WindowManager& operator=(WindowManager const&) = delete;
83 };
84 }
85 }
86 
87 #endif /* MIR_SHELL_WINDOW_MANAGER_H_ */
Definition: as_render_target.h:27
interface to provide window management logic
Definition: window_manager.h:37
MirWindowAttrib
Attributes of a window that the client and server/shell may wish to get or set over the wire...
Definition: common.h:76
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition: pointer_event.h:35
struct MirTouchEvent MirTouchEvent
An event type describing a change in touch device state.
Definition: touch_event.h:33
struct MirKeyboardEvent MirKeyboardEvent
An event type describing a change in keyboard state.
Definition: keyboard_event.h:41
Definition: surface_creation_parameters.h:41
Definition: rectangle.h:33
Specification of surface properties requested by client.
Definition: surface_specification.h:57

Copyright © 2012-2016 Canonical Ltd.
Generated on Tue Oct 31 05:57:28 UTC 2017