Mir
error_buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 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: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_CLIENT_ERROR_BUFFER_H
20 #define MIR_CLIENT_ERROR_BUFFER_H
21 
22 #include "mir_buffer.h"
23 
24 namespace mir
25 {
26 namespace client
27 {
28 class ErrorBuffer : public MirBuffer
29 {
30 public:
32  std::string const& error_msg, int buffer_id,
33  mir_buffer_callback cb, void* context, MirConnection* connection);
34 
35  int rpc_id() const override;
36  void submitted() override;
37  void received() override;
38  void received(MirBufferPackage const& update_message) override;
39  MirNativeBuffer* as_mir_native_buffer() const override;
40  std::shared_ptr<ClientBuffer> client_buffer() const override;
41  MirGraphicsRegion map_region() override;
42  void set_fence(MirNativeFence*, MirBufferAccess) override;
43  MirNativeFence* get_fence() const override;
44  bool wait_fence(MirBufferAccess, std::chrono::nanoseconds) override;
45  MirBufferUsage buffer_usage() const override;
46  MirPixelFormat pixel_format() const override;
47  geometry::Size size() const override;
48  MirConnection* allocating_connection() const override;
49  void increment_age() override;
50  void set_callback(mir_buffer_callback callback, void* context) override;
51 
52  bool valid() const override;
53  char const* error_message() const override;
54 private:
55  std::string const error_msg;
56  int const buffer_id;
57  mir_buffer_callback const cb;
58  void* const cb_context;
59  MirConnection* connection;
60 };
61 }
62 }
63 #endif /* MIR_CLIENT_BUFFER_H_ */
Definition: size.h:30
Definition: mir_buffer.h:34
All things Mir.
Definition: atomic_callback.h:25
void received() override
Definition: error_buffer.cpp:47
void * MirNativeFence
Definition: client_types_nbs.h:34
MirNativeFence * get_fence() const override
ErrorBuffer(std::string const &error_msg, int buffer_id, mir_buffer_callback cb, void *context, MirConnection *connection)
Definition: error_buffer.cpp:25
geometry::Size size() const override
void set_callback(mir_buffer_callback callback, void *context) override
Definition: mir_native_buffer.h:30
bool valid() const override
Definition: error_buffer.cpp:37
void set_fence(MirNativeFence *, MirBufferAccess) override
MirBufferAccess
Definition: client_types_nbs.h:38
MirBufferUsage buffer_usage() const override
std::shared_ptr< ClientBuffer > client_buffer() const override
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:159
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
MirPixelFormat pixel_format() const override
char const * error_message() const override
Definition: error_buffer.cpp:42
Definition: mir_connection.h:96
MirGraphicsRegion map_region() override
int rpc_id() const override
Definition: error_buffer.cpp:52
Retrieved information about a MirSurface.
Definition: client_types.h:236
void(* mir_buffer_callback)(MirBuffer *, void *context)
Definition: client_types_nbs.h:36
Definition: error_buffer.h:28
MirConnection * allocating_connection() const override
Definition: error_buffer.cpp:57
void submitted() override
void increment_age() override
bool wait_fence(MirBufferAccess, std::chrono::nanoseconds) override
MirNativeBuffer * as_mir_native_buffer() const override

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