Mir
shell.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012-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: Thomas Voss <thomas.voss@canonical.com>
17  */
18 
19 #ifndef MIR_FRONTEND_SHELL_H_
20 #define MIR_FRONTEND_SHELL_H_
21 
23 #include "mir_toolkit/common.h"
24 
25 #include <sys/types.h>
26 
27 #include <memory>
28 #include <vector>
29 
30 namespace mir
31 {
32 namespace scene
33 {
34 struct SurfaceCreationParameters;
35 struct PromptSessionCreationParameters;
36 class Surface;
37 }
38 namespace shell { class SurfaceSpecification; }
39 
40 namespace frontend
41 {
42 class EventSink;
43 class Session;
44 class PromptSession;
45 
46 class Shell
47 {
48 public:
49  virtual ~Shell() = default;
50 
51  virtual std::shared_ptr<Session> open_session(
52  pid_t client_pid,
53  std::string const& name,
54  std::shared_ptr<EventSink> const& sink) = 0;
55 
56  virtual void close_session(std::shared_ptr<Session> const& session) = 0;
57 
58  virtual std::shared_ptr<PromptSession> start_prompt_session_for(std::shared_ptr<Session> const& session,
59  scene::PromptSessionCreationParameters const& params) = 0;
60  virtual void add_prompt_provider_for(std::shared_ptr<PromptSession> const& prompt_session,
61  std::shared_ptr<Session> const& session) = 0;
62  virtual void stop_prompt_session(std::shared_ptr<PromptSession> const& prompt_session) = 0;
63 
64  virtual SurfaceId create_surface(
65  std::shared_ptr<Session> const& session,
67  std::shared_ptr<EventSink> const& sink) = 0;
68  virtual void modify_surface(std::shared_ptr<Session> const& session, SurfaceId surface, shell::SurfaceSpecification const& modifications) = 0;
69  virtual void destroy_surface(std::shared_ptr<Session> const& session, SurfaceId surface) = 0;
70 
71  virtual std::string persistent_id_for(std::shared_ptr<Session> const& session, SurfaceId surface) = 0;
72  virtual std::shared_ptr<scene::Surface> surface_for_id(std::string const& serialised_id) = 0;
73 
74  virtual int set_surface_attribute(
75  std::shared_ptr<Session> const& session,
76  SurfaceId surface_id,
77  MirSurfaceAttrib attrib,
78  int value) = 0;
79 
80  virtual int get_surface_attribute(
81  std::shared_ptr<Session> const& session,
82  SurfaceId surface_id,
83  MirSurfaceAttrib attrib) = 0;
84 
85  virtual void raise_surface(
86  std::shared_ptr<Session> const& session,
87  SurfaceId surface_id,
88  uint64_t timestamp) = 0;
89 
90 protected:
91  Shell() = default;
92  Shell(const Shell&) = delete;
93  Shell& operator=(const Shell&) = delete;
94 };
95 
96 }
97 }
98 
99 #endif // MIR_FRONTEND_SHELL_H_
All things Mir.
Definition: atomic_callback.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
Definition: surface_creation_parameters.h:41
Definition: prompt_session_creation_parameters.h:29
Specification of surface properties requested by client.
Definition: surface_specification.h:50

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