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 namespace graphics
33 {
34 class DisplayConfiguration;
35 struct BufferProperties;
36 class Buffer;
37 }
38 
39 namespace frontend
40 {
41 class Surface;
42 class BufferStream;
43 
44 class Session
45 {
46 public:
47  virtual ~Session() = default;
48 
49  virtual std::shared_ptr<Surface> get_surface(SurfaceId surface) const = 0;
50 
51  virtual std::shared_ptr<BufferStream> get_buffer_stream(BufferStreamId stream) const = 0;
52  virtual BufferStreamId create_buffer_stream(graphics::BufferProperties const& props) = 0;
53  virtual void destroy_buffer_stream(BufferStreamId stream) = 0;
54 
55  virtual graphics::BufferID create_buffer(graphics::BufferProperties const& properties) = 0;
56  virtual void destroy_buffer(graphics::BufferID) = 0;
57  virtual std::shared_ptr<graphics::Buffer> get_buffer(graphics::BufferID) = 0;
58 
59  virtual std::string name() const = 0;
60 
61  virtual void send_display_config(graphics::DisplayConfiguration const&) = 0;
62 
63 protected:
64  Session() = default;
65  Session(Session const&) = delete;
66  Session& operator=(Session const&) = delete;
67 };
68 
69 }
70 }
71 
72 #endif // MIR_FRONTEND_SESSION_H_
Definition: session.h:44
All things Mir.
Definition: atomic_callback.h:25
Buffer creation properties.
Definition: buffer_properties.h:48
Interface to a configuration of display cards and outputs.
Definition: display_configuration.h:168

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