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 class GraphicBufferAllocator;
34 }
35 
36 namespace shell { class SurfaceStack; }
37 
38 namespace scene
39 {
40 class SessionContainer;
41 class SessionEventSink;
42 class SessionListener;
43 class SnapshotStrategy;
44 class SurfaceStack;
45 class PromptSessionManager;
46 class BufferStreamFactory;
47 class SurfaceFactory;
48 class ApplicationNotRespondingDetector;
49 
51 {
52 public:
54  std::shared_ptr<shell::SurfaceStack> const& surface_stack,
55  std::shared_ptr<SurfaceFactory> const& surface_factory,
56  std::shared_ptr<BufferStreamFactory> const& buffer_stream_factory,
57  std::shared_ptr<SessionContainer> const& app_container,
58  std::shared_ptr<SnapshotStrategy> const& snapshot_strategy,
59  std::shared_ptr<SessionEventSink> const& session_event_sink,
60  std::shared_ptr<SessionListener> const& session_listener,
61  std::shared_ptr<graphics::Display const> const& display,
62  std::shared_ptr<ApplicationNotRespondingDetector> const& anr_detector,
63  std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator);
64 
65  virtual ~SessionManager() noexcept;
66 
67  std::shared_ptr<Session> open_session(
68  pid_t client_pid,
69  std::string const& name,
70  std::shared_ptr<frontend::EventSink> const& sink) override;
71 
72  void close_session(std::shared_ptr<Session> const& session) override;
73 
74  std::shared_ptr<Session> successor_of(std::shared_ptr<Session> const&) const override;
75 
76  void set_focus_to(std::shared_ptr<Session> const& focus) override;
77  void unset_focus() override;
78 
79 protected:
80  SessionManager(const SessionManager&) = delete;
81  SessionManager& operator=(const SessionManager&) = delete;
82 
83 private:
84  std::shared_ptr<shell::SurfaceStack> const surface_stack;
85  std::shared_ptr<SurfaceFactory> const surface_factory;
86  std::shared_ptr<BufferStreamFactory> const buffer_stream_factory;
87  std::shared_ptr<SessionContainer> const app_container;
88  std::shared_ptr<SnapshotStrategy> const snapshot_strategy;
89  std::shared_ptr<SessionEventSink> const session_event_sink;
90  std::shared_ptr<SessionListener> const session_listener;
91  std::shared_ptr<graphics::Display const> const display;
92  std::shared_ptr<ApplicationNotRespondingDetector> const anr_detector;
93  std::shared_ptr<graphics::GraphicBufferAllocator> const allocator;
94 };
95 
96 }
97 }
98 
99 #endif // MIR_SCENE_APPLICATION_MANAGER_H_
All things Mir.
Definition: atomic_callback.h:25
Definition: session_coordinator.h:41
Definition: session_manager.h:50

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