Mir
shell_wrapper.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_SHELL_WRAPPER_H_
20 #define MIR_SHELL_SHELL_WRAPPER_H_
21 
22 #include "mir/shell/shell.h"
23 
24 namespace mir
25 {
26 namespace shell
27 {
28 class ShellWrapper : public Shell
29 {
30 public:
31  explicit ShellWrapper(std::shared_ptr<Shell> const& wrapped);
32 
33  void focus_next_session() override;
34 
35  std::shared_ptr<scene::Session> focused_session() const override;
36 
37  void set_focus_to(
38  std::shared_ptr<scene::Session> const& focus_session,
39  std::shared_ptr<scene::Surface> const& focus_surface) override;
40 
41  std::shared_ptr<scene::Surface> focused_surface() const override;
42 
43  auto surface_at(geometry::Point cursor) const -> std::shared_ptr<scene::Surface> override;
44 
45  void raise(SurfaceSet const& surfaces) override;
46 
47  std::shared_ptr<scene::Session> open_session(
48  pid_t client_pid,
49  std::string const& name,
50  std::shared_ptr<frontend::EventSink> const& sink) override;
51 
52  void close_session(std::shared_ptr<scene::Session> const& session) override;
53 
54  std::shared_ptr<scene::PromptSession> start_prompt_session_for(
55  std::shared_ptr<scene::Session> const& session,
56  scene::PromptSessionCreationParameters const& params) override;
57 
59  std::shared_ptr<scene::PromptSession> const& prompt_session,
60  std::shared_ptr<scene::Session> const& session) override;
61 
62  void stop_prompt_session(std::shared_ptr<scene::PromptSession> const& prompt_session) override;
63 
65  std::shared_ptr<scene::Session> const& session,
67  std::shared_ptr<frontend::EventSink> const& sink) override;
68 
69  void modify_surface(std::shared_ptr<scene::Session> const& session, std::shared_ptr<scene::Surface> const& surface, SurfaceSpecification const& modifications) override;
70 
71  void destroy_surface(std::shared_ptr<scene::Session> const& session, frontend::SurfaceId surface) override;
72 
74  std::shared_ptr<scene::Session> const& session,
75  std::shared_ptr<scene::Surface> const& surface,
76  MirSurfaceAttrib attrib,
77  int value) override;
78 
80  std::shared_ptr<scene::Surface> const& surface,
81  MirSurfaceAttrib attrib) override;
82 
83  void raise_surface(
84  std::shared_ptr<scene::Session> const& session,
85  std::shared_ptr<scene::Surface> const& surface,
86  uint64_t timestamp) override;
87 
88  void add_display(geometry::Rectangle const& area) override;
89  void remove_display(geometry::Rectangle const& area) override;
90 
91  bool handle(MirEvent const& event) override;
92 
93 protected:
94  std::shared_ptr<Shell> const wrapped;
95 };
96 }
97 }
98 
99 #endif /* MIR_SHELL_SHELL_WRAPPER_H_ */
Definition: shell.h:51
All things Mir.
Definition: atomic_callback.h:25
auto surface_at(geometry::Point cursor) const -> std::shared_ptr< scene::Surface > override
Definition: shell_wrapper.cpp:143
void add_prompt_provider_for(std::shared_ptr< scene::PromptSession > const &prompt_session, std::shared_ptr< scene::Session > const &session) override
void focus_next_session() override
Definition: shell_wrapper.cpp:44
bool handle(MirEvent const &event) override
Definition: shell_wrapper.cpp:133
void add_display(geometry::Rectangle const &area) override
Definition: shell_wrapper.cpp:123
void stop_prompt_session(std::shared_ptr< scene::PromptSession > const &prompt_session) override
int get_surface_attribute(std::shared_ptr< scene::Surface > const &surface, MirSurfaceAttrib attrib) override
std::shared_ptr< scene::Session > focused_session() const override
Definition: shell_wrapper.cpp:49
Definition: point.h:30
void modify_surface(std::shared_ptr< scene::Session > const &session, std::shared_ptr< scene::Surface > const &surface, SurfaceSpecification const &modifications) override
Definition: shell_wrapper.cpp:89
ShellWrapper(std::shared_ptr< Shell > const &wrapped)
Definition: shell_wrapper.cpp:26
std::shared_ptr< scene::Session > open_session(pid_t client_pid, std::string const &name, std::shared_ptr< frontend::EventSink > const &sink) override
Definition: shell_wrapper.h:28
std::set< std::weak_ptr< scene::Surface >, std::owner_less< std::weak_ptr< scene::Surface >>> SurfaceSet
Definition: focus_controller.h:32
int set_surface_attribute(std::shared_ptr< scene::Session > const &session, std::shared_ptr< scene::Surface > const &surface, MirSurfaceAttrib attrib, int value) override
frontend::SurfaceId create_surface(std::shared_ptr< scene::Session > const &session, scene::SurfaceCreationParameters const &params, std::shared_ptr< frontend::EventSink > const &sink) override
std::shared_ptr< scene::PromptSession > start_prompt_session_for(std::shared_ptr< scene::Session > const &session, scene::PromptSessionCreationParameters const &params) override
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
std::shared_ptr< scene::Surface > focused_surface() const override
Definition: shell_wrapper.cpp:138
void raise_surface(std::shared_ptr< scene::Session > const &session, std::shared_ptr< scene::Surface > const &surface, uint64_t timestamp) override
Definition: surface_creation_parameters.h:41
void close_session(std::shared_ptr< scene::Session > const &session) override
Definition: rectangle.h:33
void destroy_surface(std::shared_ptr< scene::Session > const &session, frontend::SurfaceId surface) override
Definition: prompt_session_creation_parameters.h:29
Definition: event_private.h:181
Specification of surface properties requested by client.
Definition: surface_specification.h:49
void set_focus_to(std::shared_ptr< scene::Session > const &focus_session, std::shared_ptr< scene::Surface > const &focus_surface) override
Definition: shell_wrapper.cpp:54
std::shared_ptr< Shell > const wrapped
Definition: shell_wrapper.h:94
void remove_display(geometry::Rectangle const &area) override
Definition: shell_wrapper.cpp:128

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016