Mir
client_buffer_depository.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
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * 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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by:
17  * Kevin DuBois <kevin.dubois@canonical.com>
18  */
19 
20 #ifndef MIR_CLIENT_PRIVATE_MIR_CLIENT_BUFFER_DEPOSITORY_H_
21 #define MIR_CLIENT_PRIVATE_MIR_CLIENT_BUFFER_DEPOSITORY_H_
22 
23 #include <list>
24 #include <memory>
25 
26 #include "mir_toolkit/common.h"
27 #include "mir/geometry/size.h"
28 
29 struct MirBufferPackage;
30 
31 namespace mir
32 {
33 
34 namespace client
35 {
36 class ClientBuffer;
37 class ClientBufferFactory;
38 
40 
47 {
48 public:
50 
57  ClientBufferDepository(std::shared_ptr<ClientBufferFactory> const& factory, int max_buffers);
58 
60 
63  void deposit_package(std::shared_ptr<MirBufferPackage> const&, int id,
65  std::shared_ptr<ClientBuffer> current_buffer();
66  uint32_t current_buffer_id() const;
67 
68 private:
69  std::shared_ptr<ClientBufferFactory> const factory;
70  std::list<std::pair<int, std::shared_ptr<ClientBuffer>>> buffers;
71  unsigned int const max_buffers;
72 };
73 }
74 }
75 #endif /* MIR_CLIENT_PRIVATE_MIR_CLIENT_BUFFER_DEPOSITORY_H_ */
Definition: size.h:30
All things Mir.
Definition: buffer_stream.h:37
std::shared_ptr< ClientBuffer > current_buffer()
Definition: client_buffer_depository.cpp:66
Responsible for taking the buffer data sent from the server and wrapping it in a ClientBuffer.
Definition: client_buffer_depository.h:46
Definition: mir_native_buffer.h:30
ClientBufferDepository(std::shared_ptr< ClientBufferFactory > const &factory, int max_buffers)
Constructor.
Definition: client_buffer_depository.cpp:31
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:127
uint32_t current_buffer_id() const
Definition: client_buffer_depository.cpp:71
void deposit_package(std::shared_ptr< MirBufferPackage > const &, int id, geometry::Size, MirPixelFormat)
Construct a ClientBuffer from the IPC data, and use it as the current buffer.
Definition: client_buffer_depository.cpp:37

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