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 
23 #include "mir/geometry/size.h"
24 #include "mir_toolkit/common.h"
25 
26 #include <memory>
27 
28 namespace mir
29 {
30 namespace graphics
31 {
32 class Buffer;
33 class CursorImage;
34 }
35 
36 namespace frontend
37 {
38 class ClientBufferTracker;
39 
40 class Surface
41 {
42 public:
43  virtual ~Surface() = default;
44 
46  virtual geometry::Size client_size() const = 0;
47  virtual MirPixelFormat pixel_format() const = 0;
48 
49  virtual void swap_buffers(graphics::Buffer* old_buffer, std::function<void(graphics::Buffer* new_buffer)> complete) = 0;
50 
51  virtual bool supports_input() const = 0;
52  virtual int client_input_fd() const = 0;
53 
54  virtual void set_cursor_image(std::shared_ptr<graphics::CursorImage> const& image) = 0;
55 
56 protected:
57  Surface() = default;
58  Surface(Surface const&) = delete;
59  Surface& operator=(Surface const&) = delete;
60 };
61 
62 }
63 }
64 
65 
66 #endif /* MIR_FRONTEND_SURFACE_H_ */
Definition: size.h:30
All things Mir.
Definition: buffer_stream.h:37
virtual void set_cursor_image(std::shared_ptr< graphics::CursorImage > const &image)=0
Surface & operator=(Surface const &)=delete
virtual geometry::Size client_size() const =0
Size of the client area of the surface (excluding any decorations)
virtual void swap_buffers(graphics::Buffer *old_buffer, std::function< void(graphics::Buffer *new_buffer)> complete)=0
virtual MirPixelFormat pixel_format() const =0
virtual ~Surface()=default
virtual int client_input_fd() const =0
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:127
Definition: surface.h:40
Definition: buffer.h:34
virtual bool supports_input() const =0

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