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 protected:
86  Shell() = default;
87  Shell(const Shell&) = delete;
88  Shell& operator=(const Shell&) = delete;
89 };
90 
91 }
92 }
93 
94 #endif // MIR_FRONTEND_SHELL_H_
All things Mir.
Definition: atomic_callback.h:25
Shell & operator=(const Shell &)=delete
virtual void add_prompt_provider_for(std::shared_ptr< PromptSession > const &prompt_session, std::shared_ptr< Session > const &session)=0
virtual int get_surface_attribute(std::shared_ptr< Session > const &session, SurfaceId surface_id, MirSurfaceAttrib attrib)=0
virtual void modify_surface(std::shared_ptr< Session > const &session, SurfaceId surface, shell::SurfaceSpecification const &modifications)=0
virtual std::shared_ptr< PromptSession > start_prompt_session_for(std::shared_ptr< Session > const &session, scene::PromptSessionCreationParameters const &params)=0
virtual void destroy_surface(std::shared_ptr< Session > const &session, SurfaceId surface)=0
virtual SurfaceId create_surface(std::shared_ptr< Session > const &session, scene::SurfaceCreationParameters const &params, std::shared_ptr< EventSink > const &sink)=0
virtual ~Shell()=default
virtual void stop_prompt_session(std::shared_ptr< PromptSession > const &prompt_session)=0
Definition: shell.h:46
virtual int set_surface_attribute(std::shared_ptr< Session > const &session, SurfaceId surface_id, MirSurfaceAttrib attrib, int value)=0
virtual std::string persistent_id_for(std::shared_ptr< Session > const &session, SurfaceId surface)=0
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
virtual void close_session(std::shared_ptr< Session > const &session)=0
Definition: surface_creation_parameters.h:42
Definition: prompt_session_creation_parameters.h:29
virtual std::shared_ptr< Session > open_session(pid_t client_pid, std::string const &name, std::shared_ptr< EventSink > const &sink)=0
virtual std::shared_ptr< scene::Surface > surface_for_id(std::string const &serialised_id)=0
Specification of surface properties requested by client.
Definition: surface_specification.h:50

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015