Mir
system_compositor_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_SYSTEM_COMPOSITOR_WINDOW_MANAGER_H_
20 #define MIR_SHELL_SYSTEM_COMPOSITOR_WINDOW_MANAGER_H_
21 
24 
25 #include <map>
26 #include <mutex>
27 
28 namespace mir
29 {
30 namespace scene { class SessionCoordinator; }
31 namespace shell
32 {
33 class FocusController;
34 class DisplayLayout;
35 
39 {
40 public:
42  FocusController* focus_controller,
43  std::shared_ptr<shell::DisplayLayout> const& display_layout,
44  std::shared_ptr<scene::SessionCoordinator> const& session_coordinator);
45 
49  virtual void on_session_added(std::shared_ptr<scene::Session> const& session) const;
51 
53  virtual void on_session_removed(std::shared_ptr<scene::Session> const& session) const;
54 
56  virtual void on_session_ready(std::shared_ptr<scene::Session> const& session) const;
59 protected:
61  std::shared_ptr<DisplayLayout> const display_layout;
62  std::shared_ptr<scene::SessionCoordinator> const session_coordinator;
63 
64 private:
65  void add_session(std::shared_ptr<scene::Session> const& session) override;
66 
67  void remove_session(std::shared_ptr<scene::Session> const& session) override;
68 
69  frontend::SurfaceId add_surface(
70  std::shared_ptr<scene::Session> const& session,
72  std::function<frontend::SurfaceId(std::shared_ptr<scene::Session> const& session, scene::SurfaceCreationParameters const& params)> const& build) override;
73 
74  void modify_surface(
75  std::shared_ptr<scene::Session> const& session,
76  std::shared_ptr<scene::Surface> const& surface,
77  SurfaceSpecification const& modifications) override;
78 
79  void remove_surface(
80  std::shared_ptr<scene::Session> const& session,
81  std::weak_ptr<scene::Surface> const& surface) override;
82 
83  void add_display(geometry::Rectangle const& area) override;
84 
85  void remove_display(geometry::Rectangle const& area) override;
86 
87  bool handle_keyboard_event(MirKeyboardEvent const* event) override;
88 
89  bool handle_touch_event(MirTouchEvent const* event) override;
90 
91  bool handle_pointer_event(MirPointerEvent const* event) override;
92 
93  void handle_raise_surface(
94  std::shared_ptr<scene::Session> const& session,
95  std::shared_ptr<scene::Surface> const& surface,
96  uint64_t timestamp) override;
97 
98  int set_surface_attribute(
99  std::shared_ptr<scene::Session> const& session,
100  std::shared_ptr<scene::Surface> const& surface,
101  MirSurfaceAttrib attrib,
102  int value) override;
103 
104  using OutputMap = std::map<std::weak_ptr<scene::Surface>, graphics::DisplayConfigurationOutputId, std::owner_less<std::weak_ptr<scene::Surface>>>;
105 
106  std::mutex mutable mutex;
107  OutputMap output_map;
108 };
109 }
110 }
111 
112 
113 #endif /* MIR_SHELL_SYSTEM_COMPOSITOR_WINDOW_MANAGER_H_ */
All things Mir.
Definition: atomic_callback.h:25
Minimal window management for system compositing.
Definition: system_compositor_window_manager.h:38
interface to provide window management logic
Definition: window_manager.h:37
FocusController *const focus_controller
Definition: system_compositor_window_manager.h:60
IntWrapper< detail::GraphicsConfOutputIdTag > DisplayConfigurationOutputId
Definition: display_configuration.h:39
Definition: keyboard_event.h:28
Definition: motion_event.h:143
std::shared_ptr< DisplayLayout > const display_layout
Definition: system_compositor_window_manager.h:61
Definition: focus_controller.h:38
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
Definition: surface_creation_parameters.h:41
Definition: rectangle.h:33
Specification of surface properties requested by client.
Definition: surface_specification.h:50
std::shared_ptr< scene::SessionCoordinator > const session_coordinator
Definition: system_compositor_window_manager.h:62
Definition: motion_event.h:147

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016