Mir
stub_session.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 2 or 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_TEST_DOUBLES_STUB_SESSION_H
20 #define MIR_TEST_DOUBLES_STUB_SESSION_H
21 
22 #include <mir/scene/session.h>
23 
24 namespace mir
25 {
26 namespace test
27 {
28 namespace doubles
29 {
30 
31 struct StubSession : scene::Session
32 {
33  StubSession(pid_t pid = -1);
34 
35  std::shared_ptr<frontend::Surface> get_surface(
36  frontend::SurfaceId surface) const override;
37 
38  std::string name() const override;
39 
40  pid_t process_id() const override;
41 
42  void take_snapshot(scene::SnapshotCallback const& snapshot_taken) override;
43 
44  std::shared_ptr<scene::Surface> default_surface() const override;
45 
46  void set_lifecycle_state(MirLifecycleState state) override;
47 
48  void send_display_config(graphics::DisplayConfiguration const&) override;
49 
50  void send_error(ClientVisibleError const&) override;
51 
52  void hide() override;
53 
54  void show() override;
55 
56  void start_prompt_session() override;
57 
58  void stop_prompt_session() override;
59 
60  void suspend_prompt_session() override;
61 
62  void resume_prompt_session() override;
63 
65  scene::SurfaceCreationParameters const& params,
66  std::shared_ptr<frontend::EventSink> const& sink) override;
67 
69 
70  std::shared_ptr<scene::Surface> surface(
71  frontend::SurfaceId surface) const override;
72 
73  std::shared_ptr<scene::Surface> surface_after(
74  std::shared_ptr<scene::Surface> const&) const override;
75 
76  std::shared_ptr<frontend::BufferStream> get_buffer_stream(
77  frontend::BufferStreamId stream) const override;
78 
80  graphics::BufferProperties const& props) override;
81 
82  void destroy_buffer_stream(frontend::BufferStreamId stream) override;
83 
84  void configure_streams(
85  scene::Surface& surface,
86  std::vector<shell::StreamSpecification> const& config) override;
87 
88  void destroy_surface(std::weak_ptr<scene::Surface> const& surface) override;
89 
90  void send_input_config(MirInputConfig const& config) override;
91 
92  pid_t pid;
93 };
94 }
95 }
96 }
97 
98 #endif //MIR_TEST_DOUBLES_STUB_SESSION_H
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: blob.h:26
void resume_prompt_session() override
void send_display_config(graphics::DisplayConfiguration const &) override
pid_t process_id() const override
void take_snapshot(scene::SnapshotCallback const &snapshot_taken) override
frontend::BufferStreamId create_buffer_stream(graphics::BufferProperties const &props) override
void send_input_config(MirInputConfig const &config) override
void send_error(ClientVisibleError const &) override
void stop_prompt_session() override
std::string name() const override
void start_prompt_session() override
void set_lifecycle_state(MirLifecycleState state) override
void suspend_prompt_session() override
MirLifecycleState
Definition: common.h:179
Definition: int_wrapper.h:27
void destroy_surface(frontend::SurfaceId surface) override
std::shared_ptr< scene::Surface > surface(frontend::SurfaceId surface) const override
std::shared_ptr< scene::Surface > default_surface() const override
void destroy_buffer_stream(frontend::BufferStreamId stream) override
std::shared_ptr< frontend::BufferStream > get_buffer_stream(frontend::BufferStreamId stream) const override
pid_t pid
Definition: stub_session.h:92
frontend::SurfaceId create_surface(scene::SurfaceCreationParameters const &params, std::shared_ptr< frontend::EventSink > const &sink) override
std::shared_ptr< frontend::Surface > get_surface(frontend::SurfaceId surface) const override
std::shared_ptr< scene::Surface > surface_after(std::shared_ptr< scene::Surface > const &) const override
Definition: mir_input_config.h:80
Definition: stub_session.h:31
void configure_streams(scene::Surface &surface, std::vector< shell::StreamSpecification > const &config) override

Copyright © 2012-2018 Canonical Ltd.
Generated on Sun Jun 17 06:26:29 UTC 2018