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 
23 
24 namespace mir
25 {
26 namespace scene { class PlacementStrategy; class SessionCoordinator; }
27 namespace shell
28 {
29 class FocusController;
30 class DisplayLayout;
31 
35 {
36 public:
39  std::shared_ptr<shell::DisplayLayout> const& display_layout,
40  std::shared_ptr<scene::SessionCoordinator> const& session_coordinator);
41 
45  virtual void on_session_added(std::shared_ptr<scene::Session> const& session) const;
47 
49  virtual void on_session_removed(std::shared_ptr<scene::Session> const& session) const;
50 
52  virtual void on_session_ready(std::shared_ptr<scene::Session> const& session) const;
55 protected:
57  std::shared_ptr<DisplayLayout> const display_layout;
58  std::shared_ptr<scene::SessionCoordinator> const session_coordinator;
59 
60 private:
61  void add_session(std::shared_ptr<scene::Session> const& session) override;
62 
63  void remove_session(std::shared_ptr<scene::Session> const& session) override;
64 
65  frontend::SurfaceId add_surface(
66  std::shared_ptr<scene::Session> const& session,
68  std::function<frontend::SurfaceId(std::shared_ptr<scene::Session> const& session, scene::SurfaceCreationParameters const& params)> const& build) override;
69 
70  void modify_surface(
71  std::shared_ptr<scene::Session> const& session,
72  std::shared_ptr<scene::Surface> const& surface,
73  SurfaceSpecification const& modifications) override;
74 
75  void remove_surface(
76  std::shared_ptr<scene::Session> const& session,
77  std::weak_ptr<scene::Surface> const& surface) override;
78 
79  void add_display(geometry::Rectangle const& area) override;
80 
81  void remove_display(geometry::Rectangle const& area) override;
82 
83  bool handle_keyboard_event(MirKeyboardEvent const* event) override;
84 
85  bool handle_touch_event(MirTouchEvent const* event) override;
86 
87  bool handle_pointer_event(MirPointerEvent const* event) override;
88 
89  int set_surface_attribute(
90  std::shared_ptr<scene::Session> const& session,
91  std::shared_ptr<scene::Surface> const& surface,
92  MirSurfaceAttrib attrib,
93  int value) override;
94 };
95 }
96 }
97 
98 
99 #endif /* MIR_SHELL_SYSTEM_COMPOSITOR_WINDOW_MANAGER_H_ */
SystemCompositorWindowManager(FocusController *focus_controller, std::shared_ptr< shell::DisplayLayout > const &display_layout, std::shared_ptr< scene::SessionCoordinator > const &session_coordinator)
Definition: system_compositor_window_manager.cpp:35
All things Mir.
Definition: atomic_callback.h:25
Minimal window management for system compositing.
Definition: system_compositor_window_manager.h:34
interface to provide window management logic
Definition: window_manager.h:37
FocusController *const focus_controller
Definition: system_compositor_window_manager.h:56
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition: pointer_event.h:35
std::shared_ptr< DisplayLayout > const display_layout
Definition: system_compositor_window_manager.h:57
Definition: focus_controller.h:38
virtual void on_session_removed(std::shared_ptr< scene::Session > const &session) const
Called when a session disconnects.
Definition: system_compositor_window_manager.cpp:136
virtual void on_session_added(std::shared_ptr< scene::Session > const &session) const
Called when a session first connects (before any surfaces are ready)
Definition: system_compositor_window_manager.cpp:132
struct MirTouchEvent MirTouchEvent
An event type describing a change in touch device state.
Definition: touch_event.h:33
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
struct MirKeyboardEvent MirKeyboardEvent
An event type describing a change in keyboard state.
Definition: keyboard_event.h:44
Definition: surface_creation_parameters.h:42
Definition: rectangle.h:33
virtual void on_session_ready(std::shared_ptr< scene::Session > const &session) const
Called the first time each surface owned by the session posts its first buffer.
Definition: system_compositor_window_manager.cpp:148
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:58

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015