Mir
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
include
shared
mir_toolkit
client_types.h
Go to the documentation of this file.
1
/*
2
* client_types.h: Type definitions used in client apps and libmirclient.
3
*
4
* Copyright © 2013 Canonical Ltd.
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU Lesser General Public License version 3,
8
* as published by the Free Software Foundation.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*
18
* Authored by: Robert Carr <robert.carr@canonical.com>
19
*/
20
21
#ifndef MIR_TOOLKIT_CLIENT_TYPES_H_
22
#define MIR_TOOLKIT_CLIENT_TYPES_H_
23
24
#include <
mir_toolkit/event.h
>
25
#include <
mir_toolkit/common.h
>
26
27
#include <stddef.h>
28
29
#ifdef __cplusplus
30
34
extern
"C"
{
35
#endif
36
37
/* Display server connection API */
38
typedef
void
*
MirEGLNativeWindowType
;
39
typedef
void
*
MirEGLNativeDisplayType
;
40
typedef
struct
MirConnection
MirConnection
;
41
typedef
struct
MirSurface
MirSurface
;
42
48
typedef
struct
MirWaitHandle
MirWaitHandle
;
49
56
typedef
void (*
mir_connected_callback
)(
MirConnection
*connection,
void
*client_context);
57
67
typedef
void (*
mir_surface_callback
)(
MirSurface
*surface,
void
*client_context);
68
76
typedef
void (*
mir_event_delegate_callback
)(
77
MirSurface
* surface,
MirEvent
const
* event,
void
* context);
78
87
typedef
void (*
mir_lifecycle_event_callback
)(
88
MirConnection
* connection,
MirLifecycleState
state,
void
* context);
89
96
typedef
void (*
mir_display_config_callback
)(
97
MirConnection
* connection,
void
* context);
98
108
typedef
enum
MirPixelFormat
109
{
110
mir_pixel_format_invalid
,
111
mir_pixel_format_abgr_8888
,
112
mir_pixel_format_xbgr_8888
,
113
mir_pixel_format_argb_8888
,
114
mir_pixel_format_xrgb_8888
,
115
mir_pixel_format_bgr_888
116
}
MirPixelFormat
;
117
123
typedef
enum
MirBufferUsage
124
{
125
mir_buffer_usage_hardware
= 1,
126
mir_buffer_usage_software
127
}
MirBufferUsage
;
128
133
typedef
struct
MirSurfaceParameters
134
{
135
char
const
*
name
;
136
int
width
;
137
int
height
;
138
MirPixelFormat
pixel_format
;
139
MirBufferUsage
buffer_usage
;
148
uint32_t
output_id
;
149
}
MirSurfaceParameters
;
150
151
enum
{
mir_platform_package_max
= 32 };
152
156
typedef
enum
MirPlatformType
157
{
158
mir_platform_type_gbm
,
159
mir_platform_type_android
160
}
MirPlatformType
;
161
162
typedef
struct
MirPlatformPackage
163
{
164
int
data_items
;
165
int
fd_items
;
166
167
int
data
[
mir_platform_package_max
];
168
int
fd
[
mir_platform_package_max
];
169
}
MirPlatformPackage
;
170
171
176
typedef
struct
MirGraphicsRegion
177
{
178
int
width
;
179
int
height
;
180
int
stride
;
181
MirPixelFormat
pixel_format
;
182
char
*
vaddr
;
183
184
}
MirGraphicsRegion
;
185
189
enum
{
mir_supported_pixel_format_max
= 32 };
190
typedef
struct
MirDisplayInfo
191
{
192
uint32_t
width
;
193
uint32_t
height
;
194
195
int
supported_pixel_format_items
;
196
MirPixelFormat
supported_pixel_format
[
mir_supported_pixel_format_max
];
197
}
MirDisplayInfo
;
198
203
typedef
struct
MirDisplayCard
204
{
205
uint32_t
card_id
;
206
uint32_t
max_simultaneous_outputs
;
207
}
MirDisplayCard
;
208
209
typedef
enum
MirDisplayOutputType
210
{
211
mir_display_output_type_unknown
,
212
mir_display_output_type_vga
,
213
mir_display_output_type_dvii
,
214
mir_display_output_type_dvid
,
215
mir_display_output_type_dvia
,
216
mir_display_output_type_composite
,
217
mir_display_output_type_svideo
,
218
mir_display_output_type_lvds
,
219
mir_display_output_type_component
,
220
mir_display_output_type_ninepindin
,
221
mir_display_output_type_displayport
,
222
mir_display_output_type_hdmia
,
223
mir_display_output_type_hdmib
,
224
mir_display_output_type_tv
,
225
mir_display_output_type_edp
226
}
MirDisplayOutputType
;
227
228
typedef
struct
MirDisplayMode
229
{
230
uint32_t
vertical_resolution
;
231
uint32_t
horizontal_resolution
;
232
double
refresh_rate
;
233
}
MirDisplayMode
;
234
235
enum
{
mir_display_output_id_invalid
= 0 };
236
237
typedef
struct
MirDisplayOutput
238
{
239
uint32_t
num_modes
;
240
MirDisplayMode
*
modes
;
241
uint32_t
preferred_mode
;
242
uint32_t
current_mode
;
243
244
uint32_t
num_output_formats
;
245
MirPixelFormat
*
output_formats
;
246
uint32_t
current_output_format
;
247
248
uint32_t
card_id
;
249
uint32_t
output_id
;
250
MirDisplayOutputType
type
;
251
252
int32_t
position_x
;
253
int32_t
position_y
;
254
uint32_t
connected
;
255
uint32_t
used
;
256
257
uint32_t
physical_width_mm
;
258
uint32_t
physical_height_mm
;
259
260
MirPowerMode
power_mode
;
261
}
MirDisplayOutput
;
262
263
typedef
struct
MirDisplayConfiguration
264
{
265
uint32_t
num_outputs
;
266
MirDisplayOutput
*
outputs
;
267
uint32_t
num_cards
;
268
MirDisplayCard
*
cards
;
269
}
MirDisplayConfiguration
;
270
275
typedef
struct
MirEventDelegate
276
{
277
mir_event_delegate_callback
callback
;
278
void
*
context
;
279
}
MirEventDelegate
;
280
281
#ifdef __cplusplus
282
}
284
#endif
285
286
#endif
/* MIR_TOOLKIT_CLIENT_TYPES_H_ */
Copyright © 2012,2013 Canonical Ltd.
Generated on Wed Oct 30 18:52:19 UTC 2013