Mir
session.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 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: Robert Carr <racarr@canonical.com>
17  */
18 
19 #ifndef MIR_FRONTEND_SESSION_H_
20 #define MIR_FRONTEND_SESSION_H_
21 
22 #include "mir_toolkit/common.h"
24 #include "mir/graphics/buffer_id.h"
26 
27 #include <memory>
28 #include <string>
29 
30 namespace mir
31 {
32 class ClientVisibleError;
33 
34 namespace graphics
35 {
36 class DisplayConfiguration;
37 struct BufferProperties;
38 class Buffer;
39 }
40 
41 namespace frontend
42 {
43 class Surface;
44 class BufferStream;
45 
46 class Session
47 {
48 public:
49  virtual ~Session() = default;
50 
51  virtual std::shared_ptr<Surface> get_surface(SurfaceId surface) const = 0;
52 
53  virtual std::shared_ptr<BufferStream> get_buffer_stream(BufferStreamId stream) const = 0;
54  virtual BufferStreamId create_buffer_stream(graphics::BufferProperties const& props) = 0;
55  virtual void destroy_buffer_stream(BufferStreamId stream) = 0;
56 
57  virtual graphics::BufferID create_buffer(graphics::BufferProperties const& properties) = 0;
58  virtual void destroy_buffer(graphics::BufferID) = 0;
59  virtual std::shared_ptr<graphics::Buffer> get_buffer(graphics::BufferID) = 0;
60 
61  virtual std::string name() const = 0;
62 
63  virtual void send_display_config(graphics::DisplayConfiguration const&) = 0;
64  virtual void send_error(ClientVisibleError const&) = 0;
65 
66 protected:
67  Session() = default;
68  Session(Session const&) = delete;
69  Session& operator=(Session const&) = delete;
70 };
71 
72 }
73 }
74 
75 #endif // MIR_FRONTEND_SESSION_H_
Definition: session.h:46
Definition: as_render_target.h:27
Buffer creation properties.
Definition: buffer_properties.h:48
Interface to a configuration of display cards and outputs.
Definition: display_configuration.h:181

Copyright © 2012-2016 Canonical Ltd.
Generated on Sat Dec 3 12:48:59 UTC 2016