Mir
frontend_shell.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_FRONTEND_SHELL_H_
20 #define MIR_SHELL_FRONTEND_SHELL_H_
21 
22 #include "mir/frontend/shell.h"
23 
24 namespace ms = mir::scene;
25 namespace mf = mir::frontend;
26 
27 namespace mir
28 {
29 namespace shell
30 {
31 class Shell;
32 
33 namespace detail
34 {
35 // Adapter class to translate types between frontend and shell
37 {
38  std::shared_ptr<shell::Shell> const wrapped;
39 
40  explicit FrontendShell(std::shared_ptr<shell::Shell> const& wrapped) :
41  wrapped{wrapped} {}
42 
43  std::shared_ptr<mf::Session> open_session(
44  pid_t client_pid,
45  std::string const& name,
46  std::shared_ptr<mf::EventSink> const& sink) override;
47 
48  void close_session(std::shared_ptr<mf::Session> const& session) override;
49 
50  void handle_surface_created(std::shared_ptr<mf::Session> const& session) override;
51 
52  std::shared_ptr<mf::PromptSession> start_prompt_session_for(
53  std::shared_ptr<mf::Session> const& session,
54  ms::PromptSessionCreationParameters const& params) override;
55 
57  std::shared_ptr<mf::PromptSession> const& prompt_session,
58  std::shared_ptr<mf::Session> const& session) override;
59 
60  void stop_prompt_session(std::shared_ptr<mf::PromptSession> const& prompt_session) override;
61 
62  mf::SurfaceId create_surface(std::shared_ptr<mf::Session> const& session, ms::SurfaceCreationParameters const& params) override;
63 
64  void destroy_surface(std::shared_ptr<mf::Session> const& session, mf::SurfaceId surface) override;
65 
67  std::shared_ptr<mf::Session> const& session,
68  mf::SurfaceId surface_id,
69  MirSurfaceAttrib attrib,
70  int value) override;
71 
73  std::shared_ptr<mf::Session> const& session,
74  mf::SurfaceId surface_id,
75  MirSurfaceAttrib attrib) override;
76 };
77 }
78 }
79 }
80 
81 #endif /* MIR_SHELL_FRONTEND_SHELL_H_ */
int set_surface_attribute(std::shared_ptr< mf::Session > const &session, mf::SurfaceId surface_id, MirSurfaceAttrib attrib, int value) override
Definition: frontend_shell.cpp:87
All things Mir.
Definition: buffer_stream.h:37
Management of Surface objects. Includes the model (SurfaceStack and Surface classes) and controller (...
Definition: default_server_configuration.h:86
std::shared_ptr< shell::Shell > const wrapped
Definition: frontend_shell.h:38
std::shared_ptr< mf::Session > open_session(pid_t client_pid, std::string const &name, std::shared_ptr< mf::EventSink > const &sink) override
Definition: frontend_shell.cpp:30
void handle_surface_created(std::shared_ptr< mf::Session > const &session) override
Definition: frontend_shell.cpp:45
void stop_prompt_session(std::shared_ptr< mf::PromptSession > const &prompt_session) override
Definition: frontend_shell.cpp:69
std::shared_ptr< mf::PromptSession > start_prompt_session_for(std::shared_ptr< mf::Session > const &session, ms::PromptSessionCreationParameters const &params) override
Definition: frontend_shell.cpp:51
void add_prompt_provider_for(std::shared_ptr< mf::PromptSession > const &prompt_session, std::shared_ptr< mf::Session > const &session) override
Definition: frontend_shell.cpp:60
Frontend interface. Mediates the interaction between client processes and the core of the mir system...
Definition: client_constants.h:25
Definition: shell.h:42
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:36
Definition: int_wrapper.h:27
void close_session(std::shared_ptr< mf::Session > const &session) override
Definition: frontend_shell.cpp:38
Definition: surface_creation_parameters.h:41
int get_surface_attribute(std::shared_ptr< mf::Session > const &session, mf::SurfaceId surface_id, MirSurfaceAttrib attrib) override
Definition: frontend_shell.cpp:98
void destroy_surface(std::shared_ptr< mf::Session > const &session, mf::SurfaceId surface) override
Definition: frontend_shell.cpp:81
Definition: prompt_session_creation_parameters.h:29
Definition: frontend_shell.h:36
FrontendShell(std::shared_ptr< shell::Shell > const &wrapped)
Definition: frontend_shell.h:40
mf::SurfaceId create_surface(std::shared_ptr< mf::Session > const &session, ms::SurfaceCreationParameters const &params) override
Definition: frontend_shell.cpp:75

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015