Mir
mir_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 it
5  * under the terms of the GNU Lesser General Public License version 2 or 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 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  */
17 
18 #ifndef MIR_TOOLKIT_MIR_BUFFER_H_
19 #define MIR_TOOLKIT_MIR_BUFFER_H_
20 
21 #include <stdbool.h>
24 
25 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
49  MirConnection* connection,
50  int width, int height,
51  MirPixelFormat format,
52  MirBufferCallback available_callback, void* available_context);
53 
63  MirConnection* connection,
64  int width, int height,
65  MirPixelFormat format);
66 
71 bool mir_buffer_is_valid(MirBuffer const* buffer);
72 
81 char const *mir_buffer_get_error_message(MirBuffer const* buffer);
82 
90 
101 
108 
114 unsigned int mir_buffer_get_width(MirBuffer const* buffer);
115 
121 unsigned int mir_buffer_get_height(MirBuffer const* buffer);
122 
129 
136 
137 #ifdef __cplusplus
138 }
140 #endif
141 
142 #endif // MIR_TOOLKIT_MIR_BUFFER_H_
bool mir_buffer_map(MirBuffer *buffer, MirGraphicsRegion *region, MirBufferLayout *layout)
Access a CPU-mapped region associated with a given buffer.
char const * mir_buffer_get_error_message(MirBuffer const *buffer)
Retrieve a text description an error associated with a MirBuffer.
MirPixelFormat mir_buffer_get_pixel_format(MirBuffer const *buffer)
Retrieve the pixel format of the buffer.
void mir_buffer_unmap(MirBuffer *buffer)
Flush the CPU caches for the buffer.
void mir_connection_allocate_buffer(MirConnection *connection, int width, int height, MirPixelFormat format, MirBufferCallback available_callback, void *available_context)
Allocate a MirBuffer and do not wait for the server to return it.
unsigned int mir_buffer_get_height(MirBuffer const *buffer)
Retrieve the height of the buffer in pixels.
struct MirBuffer MirBuffer
Definition: client_types.h:53
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:179
MirBufferLayout
Definition: client_types.h:222
MirBufferPackage * mir_buffer_get_buffer_package(MirBuffer *buffer)
Access the MirBufferPackage.
struct MirConnection MirConnection
Definition: client_types.h:41
bool mir_buffer_is_valid(MirBuffer const *buffer)
Test for a valid buffer.
MirBuffer * mir_connection_allocate_buffer_sync(MirConnection *connection, int width, int height, MirPixelFormat format)
Allocate a MirBuffer and wait for the server to return it.
void(* MirBufferCallback)(MirBuffer *, void *context)
Definition: client_types.h:432
unsigned int mir_buffer_get_width(MirBuffer const *buffer)
Retrieve the width of the buffer in pixels.
void mir_buffer_release(MirBuffer *buffer)
release a MirBuffer
Definition: mir_native_buffer.h:32
Retrieved information about a MirWindow.
Definition: client_types.h:241

Copyright © 2012-2021 Canonical Ltd.
Generated on Thu Feb 11 23:56:40 UTC 2021
This documentation is licensed under the GPL version 2 or 3.