Mir
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 
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;
41 typedef struct MirSurface MirSurface __attribute__((deprecated("Use MirWindow instead")));
42 typedef struct MirSurface MirWindow;
43 typedef struct MirSurfaceSpec MirSurfaceSpec __attribute__((deprecated("Use MirWindowSpec instead")));
44 typedef struct MirSurfaceSpec MirWindowSpec;
49 typedef struct MirPersistentId MirPersistentId __attribute((deprecated("Use MirWindowId instead")));
50 typedef struct MirPersistentId MirWindowId;
51 typedef struct MirBlob MirBlob;
53 typedef struct MirError MirError;
55 typedef struct MirBuffer MirBuffer;
56 typedef struct MirRenderSurface MirRenderSurface
57 __attribute__((deprecated("This type is slated for rename due to MirRenderSurface-->MirSurface transition")));
58 
65 typedef struct MirOutput MirOutput;
66 
73 
75 
82 typedef void (*MirConnectedCallback)(
83  MirConnection *connection, void *client_context);
84 typedef MirConnectedCallback mir_connected_callback
85  __attribute__((deprecated("Use MirConnectedCallback instead")));
86 
93 typedef void (*MirWindowCallback)(MirWindow *window, void *client_context);
94 
102 typedef void (*MirBufferStreamCallback)(
103  MirBufferStream *stream, void *client_context);
104 typedef MirBufferStreamCallback mir_buffer_stream_callback
105  __attribute__((deprecated("Use MirBufferStreamCallback instead")));
106 
113 typedef void (*MirWindowEventCallback)(
114  MirWindow* window, MirEvent const* event, void* context);
115 
125  MirConnection* connection, MirLifecycleState state, void* context);
126 typedef MirLifecycleEventCallback mir_lifecycle_event_callback
127  __attribute__((deprecated("Use MirLifecycleEventCallback instead")));
128 
136 typedef void (*MirPingEventCallback)(
137  MirConnection* connection, int32_t serial, void* context);
138 typedef MirPingEventCallback mir_ping_event_callback
139  __attribute__((deprecated("Use MirPingEventCallback instead")));
140 
147 typedef void (*MirDisplayConfigCallback)(
148  MirConnection* connection, void* context);
149 typedef MirDisplayConfigCallback mir_display_config_callback
150  __attribute__((deprecated("Use MirDisplayConfigCallback instead")));
151 
162 typedef void (*MirClientFdCallback)(
163  MirPromptSession *prompt_session, size_t count, int const* fds, void* context);
164 typedef MirClientFdCallback mir_client_fd_callback
165  __attribute__((deprecated("Use MirClientFdCallback instead")));
166 
167 #pragma GCC diagnostic push
168 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
169 typedef void (*MirWindowIdCallback)(
170  MirWindow* window, MirPersistentId* id, void* context);
171 #pragma GCC diagnostic pop
178 typedef enum MirBufferUsage
179 {
188 typedef struct MirSurfaceParameters
189 {
190  char const *name;
191  int width;
192  int height;
194  MirBufferUsage buffer_usage;
203  uint32_t output_id;
204 } MirSurfaceParameters __attribute__((deprecated("Use MirWindowParameters instead")));
205 
207 
216 #ifndef __cplusplus
217 __attribute__ ((deprecated))
218 #endif
219 typedef enum MirPlatformType
220 {
225 
226 typedef struct MirPlatformPackage
227 {
229  int fd_items;
230 
234 
242 typedef struct MirModuleProperties
243 {
244  char const *name;
248  char const *filename;
250 
251 typedef enum MirBufferLayout
252 {
256 
261 typedef struct MirGraphicsRegion
262 {
263  int width;
264  int height;
265  int stride;
267  char *vaddr;
268 
270 
275 typedef struct MirDisplayInfo
276 {
277  uint32_t width;
278  uint32_t height;
279 
283 
288 typedef struct MirDisplayCard
289 {
290  uint32_t card_id;
293 
295 {
315 
317 {
322 
323 typedef struct MirDisplayMode
324 {
327  double refresh_rate;
329 
331 
332 typedef struct MirDisplayOutput
333 {
334  uint32_t num_modes;
336  uint32_t preferred_mode;
338  uint32_t current_mode;
339 
343 
344  uint32_t card_id;
345  uint32_t output_id;
346  MirDisplayOutputType type;
347 
348  int32_t position_x;
349  int32_t position_y;
350  uint32_t connected;
351  uint32_t used;
352 
355 
359 
361 {
362  uint32_t num_outputs;
364  uint32_t num_cards;
367 
371 typedef struct MirBufferStreamInfo
372 {
377 
378 typedef struct MirRectangle
379 {
380  int left;
381  int top;
382  unsigned int width;
383  unsigned int height;
384 } MirRectangle;
385 
390 
398 {
405  unsigned int width;
407  unsigned int height;
414 
420 typedef void (*MirScreencastCallback)(
421  MirScreencast *screencast, void *client_context);
422 typedef MirScreencastCallback mir_screencast_callback
423  __attribute__((deprecated("Use MirScreencastCallback instead")));
424 
430 typedef void (*MirPromptSessionCallback)(
431  MirPromptSession* prompt_provider, void* context);
432 typedef MirPromptSessionCallback mir_prompt_session_callback
433  __attribute__((deprecated("Use MirPromptSessionCallback instead")));
434 
442  MirPromptSession* prompt_provider, MirPromptSessionState state,
443  void* context);
445  mir_prompt_session_state_change_callback
446  __attribute__((deprecated("Use MirPromptSessionStateChangeCallback instead")));
447 
459  MirConnection* connection, MirPlatformMessage* reply, void* context);
460 typedef MirPlatformOperationCallback mir_platform_operation_callback
461  __attribute__((deprecated("Use MirPlatformOperationCallback instead")));
462 
470 typedef void (*MirInputConfigCallback)(
471  MirConnection* connection, void* context);
472 typedef MirInputConfigCallback mir_input_config_callback
473  __attribute__((deprecated("Use MirInputConfigCallback instead")));
474 
475 typedef void (*MirBufferCallback)(MirBuffer*, void* context);
476 
482 typedef enum MirErrorDomain
483 {
497 
519 
529 
530 typedef void (*MirErrorCallback)(
531  MirConnection* connection, MirError const* error, void* context);
532 typedef MirErrorCallback mir_error_callback
533  __attribute__((deprecated("Use MirErrorCallback instead")));
534 
535 #pragma GCC diagnostic push
536 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
537 
538 typedef void (*mir_surface_callback)(MirSurface *surface, void *client_context)
539 __attribute__((deprecated("Use MirWindowCallback instead")));
540 
542  MirSurface* surface, MirEvent const* event, void* context)
543 __attribute__((deprecated("Use MirWindowEventCallback instead")));
544 
545 typedef void (*mir_surface_id_callback)(
546  MirSurface* surface, MirPersistentId* id, void* context)
547 __attribute__((deprecated("Use MirWindowIdCallback instead")));
548 
549 typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)
550 __attribute__((deprecated("This type is slated for rename due to MirRenderSurface-->MirSurface transition")));
551 
553 
554 #pragma GCC diagnostic pop
555 
556 #ifdef __cplusplus
557 }
559 #endif
560 
561 #endif /* MIR_TOOLKIT_CLIENT_TYPES_H_ */
struct MirOutput MirOutput
Descriptor for an output connection.
Definition: client_types.h:65
uint32_t physical_height_mm
Definition: client_types.h:354
int displacement_y
Definition: client_types.h:375
MirPowerMode power_mode
Definition: client_types.h:356
void(* MirDisplayConfigCallback)(MirConnection *connection, void *context)
Callback called when a display config change has occurred.
Definition: client_types.h:147
Definition: client_types.h:226
Definition: client_types.h:360
struct MirDisplayConfig MirDisplayConfig
Definition: client_types.h:52
struct MirSurface MirWindow
Definition: client_types.h:42
struct MirModuleProperties MirModuleProperties
Retrieved information about a loadable module.
struct MirScreencastParameters MirScreencastParameters
MirScreencastParameters is the structure of required information that you must provide to Mir in orde...
int left
Definition: client_types.h:380
struct MirPersistentId MirPersistentId __attribute((deprecated("Use MirWindowId instead")))
struct MirBufferStream MirBufferStream
Definition: client_types.h:48
MirScreencastParameters is the structure of required information that you must provide to Mir in orde...
Definition: client_types.h:397
struct MirBuffer MirBuffer
Definition: client_types.h:55
Definition: common.h:199
Definition: client_types.h:297
void(* MirPingEventCallback)(MirConnection *connection, int32_t serial, void *context)
Callback called when the server pings for responsiveness testing.
Definition: client_types.h:136
Definition: client_types.h:309
Definition: client_types.h:274
Definition: common.h:208
MirOrientation orientation
Definition: client_types.h:357
Definition: common.h:211
int height
Definition: client_types.h:192
struct MirBlob MirBlob
Definition: client_types.h:51
struct MirScreencast MirScreencast
Definition: client_types.h:45
struct MirPersistentId MirWindowId
Definition: client_types.h:50
int top
Definition: client_types.h:381
void const * data
Definition: mir_platform_message.h:75
struct MirError MirError
Definition: client_types.h:53
MirPromptSessionState
Definition: common.h:214
MirPixelFormat pixel_format
Definition: client_types.h:193
uint32_t output_id
The id of the output to place the surface in.
Definition: client_types.h:203
void(* MirErrorCallback)(MirConnection *connection, MirError const *error, void *context)
Definition: client_types.h:530
Definition: client_types.h:296
Definition: client_types.h:308
Definition: common.h:207
Definition: common.h:194
MirDisplayMode * modes
Definition: client_types.h:335
void(* MirLifecycleEventCallback)(MirConnection *connection, MirLifecycleState state, void *context)
Callback called when a lifecycle event/callback is requested from the running server.
Definition: client_types.h:124
Definition: client_types.h:311
int32_t position_y
Definition: client_types.h:349
Definition: client_types.h:221
Definition: common.h:195
MirOutputConnectionState
Definition: client_types.h:316
A global configuration change request is already pending.
Definition: client_types.h:509
int displacement_x
Definition: client_types.h:374
MirDisplayCard * cards
Definition: client_types.h:365
struct MirPromptSession MirPromptSession
Definition: client_types.h:47
void(* MirInputConfigCallback)(MirConnection *connection, void *context)
Callback called when a change of input devices has occurred.
Definition: client_types.h:470
Definition: client_types.h:180
unsigned int height
The height of the screencast which can be different than the screen region capture height...
Definition: client_types.h:407
The displacement from the top-left corner of the surface.
Definition: client_types.h:371
uint32_t output_id
Definition: client_types.h:345
uint32_t used
Definition: client_types.h:351
Definition: common.h:198
Definition: client_types.h:254
int32_t position_x
Definition: client_types.h:348
uint32_t width
Definition: client_types.h:277
struct MirDisplayMode MirDisplayMode
void(* MirScreencastCallback)(MirScreencast *screencast, void *client_context)
Callback to be passed when calling MirScreencast functions.
Definition: client_types.h:420
uint32_t height
Definition: client_types.h:278
int stride
Definition: client_types.h:265
Definition: client_types.h:330
void(* MirRenderSurfaceCallback)(MirRenderSurface *, void *context) __attribute__((deprecated("This type is slated for rename due to MirRenderSurface- -> MirSurface transition")))
Definition: client_types.h:549
struct MirScreencastSpec MirScreencastSpec
Definition: client_types.h:46
Definition: client_types.h:310
uint32_t connected
Definition: client_types.h:350
A cancel request was received, but no global display configuration preview is in progress.
Definition: client_types.h:513
Definition: common.h:202
MirDisplayConfiguration provides details of the graphics environment.
Definition: client_types.h:288
Definition: client_types.h:305
Definition: client_types.h:206
Definition: client_types.h:323
int const * fds
Definition: mir_platform_message.h:93
Errors relating to input configuration.
Definition: client_types.h:495
Definition: client_types.h:253
int height
Definition: client_types.h:264
uint32_t vertical_resolution
Definition: client_types.h:325
void(* MirPlatformOperationCallback)(MirConnection *connection, MirPlatformMessage *reply, void *context)
Callback called when a platform operation completes.
Definition: client_types.h:458
MirPixelFormat pixel_format
Definition: client_types.h:266
MirPixelFormat current_format
Definition: client_types.h:342
Definition: common.h:203
char const * name
Definition: client_types.h:244
struct MirDisplayConfiguration MirDisplayConfiguration
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:269
char const * name
Definition: client_types.h:190
void(* MirWindowCallback)(MirWindow *window, void *client_context)
Callback to be passed when calling window functions :
Definition: client_types.h:93
Definition: client_types.h:222
uint32_t card_id
Definition: client_types.h:290
Input configuration was attempted but was rejected by driver.
Definition: client_types.h:527
struct MirBufferStreamInfo MirBufferStreamInfo
The displacement from the top-left corner of the surface.
char * vaddr
Definition: client_types.h:267
MirDisplayConfigurationError
Errors from the mir_error_domain_display_configuration MirErrorDomain.
Definition: client_types.h:501
Definition: client_types.h:313
struct MirWaitHandle MirWaitHandle
Returned by asynchronous functions.
Definition: client_types.h:72
struct MirGraphicsRegion MirGraphicsRegion
Retrieved information about a MirWindow.
uint32_t num_outputs
Definition: client_types.h:362
Retrieved information about a loadable module.
Definition: client_types.h:242
Definition: client_types.h:318
uint32_t current_mode
Definition: client_types.h:338
Definition: client_types.h:275
uint32_t num_output_formats
Definition: client_types.h:340
Definition: client_types.h:332
MirErrorDomain
Specifies the origin of an error.
Definition: client_types.h:482
Definition: client_types.h:298
MirSurfaceParameters MirWindowParameters
Definition: client_types.h:552
void(* MirConnectedCallback)(MirConnection *connection, void *client_context)
Callback to be passed when issuing a mir_connect request.
Definition: client_types.h:82
struct MirPlatformMessage MirPlatformMessage
Definition: client_types.h:74
Definition: client_types.h:300
void(* MirPromptSessionCallback)(MirPromptSession *prompt_provider, void *context)
Callback member of MirPromptSession for handling of prompt sessions.
Definition: client_types.h:430
struct MirPlatformPackage MirPlatformPackage
struct MirDisplayOutput MirDisplayOutput
struct MirDisplayInfo MirDisplayInfo
uint32_t physical_width_mm
Definition: client_types.h:353
Errors relating to display configuration.
Definition: client_types.h:489
int supported_pixel_format_items
Definition: client_types.h:280
struct MirConnection MirConnection
Definition: client_types.h:40
Definition: client_types.h:301
MirPixelFormat * output_formats
Definition: client_types.h:341
void(* MirWindowIdCallback)(MirWindow *window, MirPersistentId *id, void *context)
Definition: client_types.h:169
void(* mir_surface_event_callback)(MirSurface *surface, MirEvent const *event, void *context) __attribute__((deprecated("Use MirWindowEventCallback instead")))
Definition: client_types.h:541
Display configuration was attempted but was rejected by the hardware.
Definition: client_types.h:517
int minor_version
Definition: client_types.h:246
struct MirEvent MirEvent
Definition: event.h:83
MirPowerMode
Definition: common.h:184
Definition: common.h:201
unsigned int width
Definition: client_types.h:382
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:178
Definition: client_types.h:302
void(* MirBufferCallback)(MirBuffer *, void *context)
Definition: client_types.h:475
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:239
int fd_items
Definition: client_types.h:229
Definition: client_types.h:312
struct MirPresentationChain MirPresentationChain
Definition: client_types.h:54
struct MirSurfaceSpec MirWindowSpec
Definition: client_types.h:44
uint32_t max_simultaneous_outputs
Definition: client_types.h:291
MirBufferUsage buffer_usage
Definition: client_types.h:194
uint32_t num_cards
Definition: client_types.h:364
double refresh_rate
Definition: client_types.h:327
MirLifecycleState
Definition: common.h:177
MirRectangle region
The rectangular region of the screen to capture - The region is specified in virtual screen space hen...
Definition: client_types.h:403
uint32_t preferred_mode
There might be no preferred mode, which is indicated by a value >=num_modes.
Definition: client_types.h:336
unsigned int height
Definition: client_types.h:383
void * MirEGLNativeWindowType
Definition: client_types.h:38
Definition: client_types.h:223
Definition: common.h:197
Definition: mir_pointer_config.h:29
void(* MirPromptSessionStateChangeCallback)(MirPromptSession *prompt_provider, MirPromptSessionState state, void *context)
Callback member of MirPromptSession for handling of prompt sessions events.
Definition: client_types.h:441
MirPixelFormat pixel_format
The pixel format of the screencast.
Definition: client_types.h:412
int data_items
Definition: client_types.h:228
void(* mir_surface_callback)(MirSurface *surface, void *client_context) __attribute__((deprecated("Use MirWindowCallback instead")))
Definition: client_types.h:538
unsigned int width
The width of the screencast which can be different than the screen region capture width...
Definition: client_types.h:405
void(* mir_surface_id_callback)(MirSurface *surface, MirPersistentId *id, void *context) __attribute__((deprecated("Use MirWindowIdCallback instead")))
Definition: client_types.h:545
MirDisplayOutputType type
Definition: client_types.h:346
MirConnectedCallback mir_connected_callback __attribute__((deprecated("Use MirConnectedCallback instead")))
Release a platform message.
Definition: client_types.h:85
Definition: client_types.h:307
MirBufferLayout
Definition: client_types.h:251
Definition: common.h:200
void(* MirWindowEventCallback)(MirWindow *window, MirEvent const *event, void *context)
Callback for handling of window events.
Definition: client_types.h:113
MirDisplayOutputType
Definition: client_types.h:294
Definition: client_types.h:304
Definition: common.h:196
Definition: common.h:204
int micro_version
Definition: client_types.h:247
Definition: client_types.h:378
Retrieved information about a MirWindow.
Definition: client_types.h:261
int major_version
Definition: client_types.h:245
MirInputConfigurationError
Errors from the mir_error_domain_input_configuration MirErrorDomain.
Definition: client_types.h:523
Definition: common.h:205
struct MirRectangle MirRectangle
int width
Definition: client_types.h:191
Definition: client_types.h:299
Definition: dispatchable.h:33
char const * filename
Definition: client_types.h:248
Definition: common.h:206
Definition: mir_touchpad_config.h:29
uint32_t num_modes
Definition: client_types.h:334
struct MirDisplayCard MirDisplayCard
MirDisplayConfiguration provides details of the graphics environment.
uint32_t card_id
Definition: client_types.h:344
Definition: common.h:210
Definition: client_types.h:306
Definition: mir_input_config.h:77
void(* MirClientFdCallback)(MirPromptSession *prompt_session, size_t count, int const *fds, void *context)
Callback called when a request for client file descriptors completes.
Definition: client_types.h:162
int width
Definition: client_types.h:263
MirPlatformType
The native buffer type for the system the client is connected on.
Definition: client_types.h:219
MirDisplayOutput * outputs
Definition: client_types.h:363
Definition: client_types.h:320
Definition: client_types.h:181
void(* MirBufferStreamCallback)(MirBufferStream *stream, void *client_context)
Callback to be passed when calling:
Definition: client_types.h:102
Definition: mir_input_config.h:35
Definition: common.h:209
MirWindowParameters is the structure of minimum required information that you must provide to Mir in ...
Definition: client_types.h:188
Definition: client_types.h:303
MirBufferStream * stream
Definition: client_types.h:373
uint32_t horizontal_resolution
Definition: client_types.h:326
void * MirEGLNativeDisplayType
Definition: client_types.h:39
Client is not permitted to change global display configuration.
Definition: client_types.h:505
Definition: client_types.h:319

Copyright © 2012-2016 Canonical Ltd.
Generated on Thu Feb 9 21:49:33 UTC 2017