Mir
surface.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 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: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 
20 #ifndef MIR_FRONTEND_SURFACE_H_
21 #define MIR_FRONTEND_SURFACE_H_
22 
24 #include "mir/geometry/size.h"
26 
27 #include "mir_toolkit/common.h"
28 
29 #include <string>
30 #include <memory>
31 
32 namespace mir
33 {
34 namespace graphics
35 {
36 class Buffer;
37 class CursorImage;
38 }
39 
40 namespace frontend
41 {
42 class ClientBufferTracker;
43 class BufferStream;
44 
45 class Surface
46 {
47 public:
48  virtual ~Surface() = default;
49 
51  virtual geometry::Size client_size() const = 0;
52 
53  virtual std::shared_ptr<frontend::BufferStream> primary_buffer_stream() const = 0;
54 
55  virtual bool supports_input() const = 0;
56  virtual int client_input_fd() const = 0;
57 
58  virtual void set_cursor_image(std::shared_ptr<graphics::CursorImage> const& image) = 0;
59  virtual void set_cursor_stream(std::shared_ptr<frontend::BufferStream> const& image,
60  geometry::Displacement const& hotspot) = 0;
61 
62 protected:
63  Surface() = default;
64  Surface(Surface const&) = delete;
65  Surface& operator=(Surface const&) = delete;
66 };
67 
68 }
69 }
70 
71 
72 #endif /* MIR_FRONTEND_SURFACE_H_ */
Definition: size.h:30
Definition: as_render_target.h:27
Definition: displacement.h:32
Definition: surface.h:45

Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Jun 5 11:07:25 UTC 2017