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 class PersistentSurfaceStore;
33 
34 namespace detail
35 {
36 // Adapter class to translate types between frontend and shell
38 {
39  std::shared_ptr<shell::Shell> const wrapped;
40  std::shared_ptr<shell::PersistentSurfaceStore> const surface_store;
41 
42  explicit FrontendShell(std::shared_ptr<shell::Shell> const& wrapped,
43  std::shared_ptr<shell::PersistentSurfaceStore> const& surface_store)
44  : wrapped{wrapped},
45  surface_store{surface_store}
46  {
47  }
48 
49  std::shared_ptr<mf::Session> open_session(
50  pid_t client_pid,
51  std::string const& name,
52  std::shared_ptr<mf::EventSink> const& sink) override;
53 
54  void close_session(std::shared_ptr<mf::Session> const& session) override;
55 
56  std::shared_ptr<mf::PromptSession> start_prompt_session_for(
57  std::shared_ptr<mf::Session> const& session,
58  ms::PromptSessionCreationParameters const& params) override;
59 
61  std::shared_ptr<mf::PromptSession> const& prompt_session,
62  std::shared_ptr<mf::Session> const& session) override;
63 
64  void stop_prompt_session(std::shared_ptr<mf::PromptSession> const& prompt_session) override;
65 
67  std::shared_ptr<mf::Session> const& session,
68  ms::SurfaceCreationParameters const& params,
69  std::shared_ptr<mf::EventSink> const& sink) override;
70 
71  void modify_surface(std::shared_ptr<mf::Session> const& session, mf::SurfaceId surface, SurfaceSpecification const& modifications) override;
72 
73  void destroy_surface(std::shared_ptr<mf::Session> const& session, mf::SurfaceId surface) override;
74 
75  std::string persistent_id_for(std::shared_ptr<mf::Session> const& session, mf::SurfaceId surface) override;
76 
77  std::shared_ptr<ms::Surface> surface_for_id(std::string const& serialized_id) override;
78 
80  std::shared_ptr<mf::Session> const& session,
81  mf::SurfaceId surface_id,
82  MirSurfaceAttrib attrib,
83  int value) override;
84 
86  std::shared_ptr<mf::Session> const& session,
87  mf::SurfaceId surface_id,
88  MirSurfaceAttrib attrib) override;
89 
90  void raise_surface(
91  std::shared_ptr<mf::Session> const& session,
92  mf::SurfaceId surface_id,
93  uint64_t timestamp) override;
94 };
95 }
96 }
97 }
98 
99 #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:130
std::string persistent_id_for(std::shared_ptr< mf::Session > const &session, mf::SurfaceId surface) override
Definition: frontend_shell.cpp:116
std::shared_ptr< ms::Surface > surface_for_id(std::string const &serialized_id) override
Definition: frontend_shell.cpp:124
All things Mir.
Definition: atomic_callback.h:25
Management of Surface objects. Includes the model (SurfaceStack and Surface classes) and controller (...
Definition: default_server_configuration.h:87
void modify_surface(std::shared_ptr< mf::Session > const &session, mf::SurfaceId surface, SurfaceSpecification const &modifications) override
Definition: frontend_shell.cpp:97
std::shared_ptr< shell::Shell > const wrapped
Definition: frontend_shell.h:39
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:34
void stop_prompt_session(std::shared_ptr< mf::PromptSession > const &prompt_session) override
Definition: frontend_shell.cpp:67
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:49
FrontendShell(std::shared_ptr< shell::Shell > const &wrapped, std::shared_ptr< shell::PersistentSurfaceStore > const &surface_store)
Definition: frontend_shell.h:42
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:58
Frontend interface. Mediates the interaction between client processes and the core of the mir system...
Definition: client_constants.h:25
Definition: shell.h:46
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
void close_session(std::shared_ptr< mf::Session > const &session) override
Definition: frontend_shell.cpp:42
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:141
void raise_surface(std::shared_ptr< mf::Session > const &session, mf::SurfaceId surface_id, uint64_t timestamp) override
Definition: frontend_shell.cpp:151
void destroy_surface(std::shared_ptr< mf::Session > const &session, mf::SurfaceId surface) override
Definition: frontend_shell.cpp:110
Definition: prompt_session_creation_parameters.h:29
Definition: frontend_shell.h:37
Specification of surface properties requested by client.
Definition: surface_specification.h:50
std::shared_ptr< shell::PersistentSurfaceStore > const surface_store
Definition: frontend_shell.h:40
mf::SurfaceId create_surface(std::shared_ptr< mf::Session > const &session, ms::SurfaceCreationParameters const &params, std::shared_ptr< mf::EventSink > const &sink) override
Definition: frontend_shell.cpp:73

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