Mir
session_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012-2014 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: Thomas Voss <thomas.voss@canonical.com>
17  */
18 
19 #ifndef MIR_SCENE_APPLICATION_MANAGER_H_
20 #define MIR_SCENE_APPLICATION_MANAGER_H_
21 
23 
24 #include <memory>
25 #include <vector>
26 
27 namespace mir
28 {
29 namespace graphics
30 {
31 class DisplayConfiguration;
32 class Display;
33 }
34 
35 namespace scene
36 {
37 class SessionContainer;
38 class SessionEventSink;
39 class SessionListener;
40 class SnapshotStrategy;
41 class SurfaceCoordinator;
42 class PromptSessionManager;
43 class BufferStreamFactory;
44 class SurfaceFactory;
45 class ApplicationNotRespondingDetector;
46 
48 {
49 public:
51  std::shared_ptr<SurfaceCoordinator> const& surface_coordinator,
52  std::shared_ptr<SurfaceFactory> const& surface_factory,
53  std::shared_ptr<BufferStreamFactory> const& buffer_stream_factory,
54  std::shared_ptr<SessionContainer> const& app_container,
55  std::shared_ptr<SnapshotStrategy> const& snapshot_strategy,
56  std::shared_ptr<SessionEventSink> const& session_event_sink,
57  std::shared_ptr<SessionListener> const& session_listener,
58  std::shared_ptr<graphics::Display const> const& display,
59  std::shared_ptr<ApplicationNotRespondingDetector> const& anr_detector);
60 
61  virtual ~SessionManager() noexcept;
62 
63  std::shared_ptr<Session> open_session(
64  pid_t client_pid,
65  std::string const& name,
66  std::shared_ptr<frontend::EventSink> const& sink) override;
67 
68  void close_session(std::shared_ptr<Session> const& session) override;
69 
70  std::shared_ptr<Session> successor_of(std::shared_ptr<Session> const&) const override;
71 
72  void set_focus_to(std::shared_ptr<Session> const& focus) override;
73  void unset_focus() override;
74 
75 protected:
76  SessionManager(const SessionManager&) = delete;
77  SessionManager& operator=(const SessionManager&) = delete;
78 
79 private:
80  std::shared_ptr<SurfaceCoordinator> const surface_coordinator;
81  std::shared_ptr<SurfaceFactory> const surface_factory;
82  std::shared_ptr<BufferStreamFactory> const buffer_stream_factory;
83  std::shared_ptr<SessionContainer> const app_container;
84  std::shared_ptr<SnapshotStrategy> const snapshot_strategy;
85  std::shared_ptr<SessionEventSink> const session_event_sink;
86  std::shared_ptr<SessionListener> const session_listener;
87  std::shared_ptr<graphics::Display const> const display;
88  std::shared_ptr<ApplicationNotRespondingDetector> const anr_detector;
89 };
90 
91 }
92 }
93 
94 #endif // MIR_SCENE_APPLICATION_MANAGER_H_
All things Mir.
Definition: atomic_callback.h:25
Definition: session_coordinator.h:41
std::shared_ptr< Session > open_session(pid_t client_pid, std::string const &name, std::shared_ptr< frontend::EventSink > const &sink) override
Definition: session_manager.cpp:87
SessionManager(std::shared_ptr< SurfaceCoordinator > const &surface_coordinator, std::shared_ptr< SurfaceFactory > const &surface_factory, std::shared_ptr< BufferStreamFactory > const &buffer_stream_factory, std::shared_ptr< SessionContainer > const &app_container, std::shared_ptr< SnapshotStrategy > const &snapshot_strategy, std::shared_ptr< SessionEventSink > const &session_event_sink, std::shared_ptr< SessionListener > const &session_listener, std::shared_ptr< graphics::Display const > const &display, std::shared_ptr< ApplicationNotRespondingDetector > const &anr_detector)
Definition: session_manager.cpp:45
Definition: session_manager.h:47
std::shared_ptr< Session > successor_of(std::shared_ptr< Session > const &) const override
Definition: session_manager.cpp:143
void set_focus_to(std::shared_ptr< Session > const &focus) override
Definition: session_manager.cpp:115
void unset_focus() override
Definition: session_manager.cpp:121
SessionManager & operator=(const SessionManager &)=delete
virtual ~SessionManager() noexcept
Definition: session_manager.cpp:67
void close_session(std::shared_ptr< Session > const &session) override
Definition: session_manager.cpp:127

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