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 
29 namespace mir
30 {
31 namespace scene
32 {
33 struct SurfaceCreationParameters;
34 struct PromptSessionCreationParameters;
35 }
36 namespace frontend
37 {
38 class EventSink;
39 class Session;
40 class PromptSession;
41 
42 class Shell
43 {
44 public:
45  virtual ~Shell() = default;
46 
47  virtual std::shared_ptr<Session> open_session(
48  pid_t client_pid,
49  std::string const& name,
50  std::shared_ptr<EventSink> const& sink) = 0;
51 
52  virtual void close_session(std::shared_ptr<Session> const& session) = 0;
53 
54  virtual void handle_surface_created(std::shared_ptr<Session> const& session) = 0;
55 
56  virtual std::shared_ptr<PromptSession> start_prompt_session_for(std::shared_ptr<Session> const& session,
57  scene::PromptSessionCreationParameters const& params) = 0;
58  virtual void add_prompt_provider_for(std::shared_ptr<PromptSession> const& prompt_session,
59  std::shared_ptr<Session> const& session) = 0;
60  virtual void stop_prompt_session(std::shared_ptr<PromptSession> const& prompt_session) = 0;
61 
62  virtual SurfaceId create_surface(std::shared_ptr<Session> const& session, scene::SurfaceCreationParameters const& params) = 0;
63  virtual void destroy_surface(std::shared_ptr<Session> const& session, SurfaceId surface) = 0;
64 
65  virtual int set_surface_attribute(
66  std::shared_ptr<Session> const& session,
67  SurfaceId surface_id,
68  MirSurfaceAttrib attrib,
69  int value) = 0;
70 
71  virtual int get_surface_attribute(
72  std::shared_ptr<Session> const& session,
73  SurfaceId surface_id,
74  MirSurfaceAttrib attrib) = 0;
75 
76 protected:
77  Shell() = default;
78  Shell(const Shell&) = delete;
79  Shell& operator=(const Shell&) = delete;
80 };
81 
82 }
83 }
84 
85 #endif // MIR_FRONTEND_SHELL_H_
All things Mir.
Definition: buffer_stream.h:37
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 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 ~Shell()=default
virtual void stop_prompt_session(std::shared_ptr< PromptSession > const &prompt_session)=0
virtual SurfaceId create_surface(std::shared_ptr< Session > const &session, scene::SurfaceCreationParameters const &params)=0
Definition: shell.h:42
virtual int set_surface_attribute(std::shared_ptr< Session > const &session, SurfaceId surface_id, MirSurfaceAttrib attrib, int value)=0
virtual void handle_surface_created(std::shared_ptr< Session > const &session)=0
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:36
virtual void close_session(std::shared_ptr< Session > const &session)=0
Definition: int_wrapper.h:27
Definition: surface_creation_parameters.h:41
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

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