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 
257 typedef enum MirPresentMode
258 {
259  mir_present_mode_immediate, //same as VK_PRESENT_MODE_IMMEDIATE_KHR
260  mir_present_mode_mailbox, //same as VK_PRESENT_MODE_MAILBOX_KHR
261  mir_present_mode_fifo, //same as VK_PRESENT_MODE_FIFO_KHR
262  mir_present_mode_fifo_relaxed, //same as VK_PRESENT_MODE_FIFO_RELAXED_KHR
265 
270 typedef struct MirGraphicsRegion
271 {
272  int width;
273  int height;
274  int stride;
276  char *vaddr;
277 
279 
284 typedef struct MirDisplayInfo
285 {
286  uint32_t width;
287  uint32_t height;
288 
292 
297 typedef struct MirDisplayCard
298 {
299  uint32_t card_id;
302 
304 {
324 
326 {
331 
332 typedef struct MirDisplayMode
333 {
336  double refresh_rate;
338 
340 
341 typedef struct MirDisplayOutput
342 {
343  uint32_t num_modes;
345  uint32_t preferred_mode;
347  uint32_t current_mode;
348 
352 
353  uint32_t card_id;
354  uint32_t output_id;
355  MirDisplayOutputType type;
356 
357  int32_t position_x;
358  int32_t position_y;
359  uint32_t connected;
360  uint32_t used;
361 
364 
368 
370 {
371  uint32_t num_outputs;
373  uint32_t num_cards;
376 
380 typedef struct MirBufferStreamInfo
381 {
386 
387 typedef struct MirRectangle
388 {
389  int left;
390  int top;
391  unsigned int width;
392  unsigned int height;
393 } MirRectangle;
394 
399 
407 {
414  unsigned int width;
416  unsigned int height;
423 
429 typedef void (*MirScreencastCallback)(
430  MirScreencast *screencast, void *client_context);
431 typedef MirScreencastCallback mir_screencast_callback
432  __attribute__((deprecated("Use MirScreencastCallback instead")));
433 
439 typedef void (*MirPromptSessionCallback)(
440  MirPromptSession* prompt_provider, void* context);
441 typedef MirPromptSessionCallback mir_prompt_session_callback
442  __attribute__((deprecated("Use MirPromptSessionCallback instead")));
443 
451  MirPromptSession* prompt_provider, MirPromptSessionState state,
452  void* context);
454  mir_prompt_session_state_change_callback
455  __attribute__((deprecated("Use MirPromptSessionStateChangeCallback instead")));
456 
468  MirConnection* connection, MirPlatformMessage* reply, void* context);
469 typedef MirPlatformOperationCallback mir_platform_operation_callback
470  __attribute__((deprecated("Use MirPlatformOperationCallback instead")));
471 
479 typedef void (*MirInputConfigCallback)(
480  MirConnection* connection, void* context);
481 typedef MirInputConfigCallback mir_input_config_callback
482  __attribute__((deprecated("Use MirInputConfigCallback instead")));
483 
484 typedef void (*MirBufferCallback)(MirBuffer*, void* context);
485 
491 typedef enum MirErrorDomain
492 {
506 
528 
538 
539 typedef void (*MirErrorCallback)(
540  MirConnection* connection, MirError const* error, void* context);
541 typedef MirErrorCallback mir_error_callback
542  __attribute__((deprecated("Use MirErrorCallback instead")));
543 
544 #pragma GCC diagnostic push
545 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
546 
547 typedef void (*mir_surface_callback)(MirSurface *surface, void *client_context)
548 __attribute__((deprecated("Use MirWindowCallback instead")));
549 
551  MirSurface* surface, MirEvent const* event, void* context)
552 __attribute__((deprecated("Use MirWindowEventCallback instead")));
553 
554 typedef void (*mir_surface_id_callback)(
555  MirSurface* surface, MirPersistentId* id, void* context)
556 __attribute__((deprecated("Use MirWindowIdCallback instead")));
557 
558 typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)
559 __attribute__((deprecated("This type is slated for rename due to MirRenderSurface-->MirSurface transition")));
560 
562 
563 #pragma GCC diagnostic pop
564 
565 #ifdef __cplusplus
566 }
568 #endif
569 
570 #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:363
int displacement_y
Definition: client_types.h:384
MirPowerMode power_mode
Definition: client_types.h:365
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:369
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:389
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:406
struct MirBuffer MirBuffer
Definition: client_types.h:55
Definition: common.h:199
Definition: client_types.h:306
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:318
Definition: client_types.h:283
Definition: common.h:208
MirOrientation orientation
Definition: client_types.h:366
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
MirPresentMode
Definition: client_types.h:257
int top
Definition: client_types.h:390
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:539
Definition: client_types.h:305
Definition: client_types.h:317
Definition: common.h:207
Definition: common.h:194
MirDisplayMode * modes
Definition: client_types.h:344
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:320
int32_t position_y
Definition: client_types.h:358
Definition: client_types.h:221
Definition: common.h:195
MirOutputConnectionState
Definition: client_types.h:325
A global configuration change request is already pending.
Definition: client_types.h:518
int displacement_x
Definition: client_types.h:383
MirDisplayCard * cards
Definition: client_types.h:374
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:479
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:416
The displacement from the top-left corner of the surface.
Definition: client_types.h:380
uint32_t output_id
Definition: client_types.h:354
uint32_t used
Definition: client_types.h:360
Definition: common.h:198
Definition: client_types.h:254
int32_t position_x
Definition: client_types.h:357
uint32_t width
Definition: client_types.h:286
struct MirDisplayMode MirDisplayMode
void(* MirScreencastCallback)(MirScreencast *screencast, void *client_context)
Callback to be passed when calling MirScreencast functions.
Definition: client_types.h:429
uint32_t height
Definition: client_types.h:287
int stride
Definition: client_types.h:274
Definition: client_types.h:339
void(* MirRenderSurfaceCallback)(MirRenderSurface *, void *context) __attribute__((deprecated("This type is slated for rename due to MirRenderSurface- -> MirSurface transition")))
Definition: client_types.h:558
struct MirScreencastSpec MirScreencastSpec
Definition: client_types.h:46
Definition: client_types.h:319
uint32_t connected
Definition: client_types.h:359
A cancel request was received, but no global display configuration preview is in progress.
Definition: client_types.h:522
Definition: common.h:202
MirDisplayConfiguration provides details of the graphics environment.
Definition: client_types.h:297
Definition: client_types.h:314
Definition: client_types.h:206
Definition: client_types.h:332
int const * fds
Definition: mir_platform_message.h:93
Errors relating to input configuration.
Definition: client_types.h:504
Definition: client_types.h:253
int height
Definition: client_types.h:273
uint32_t vertical_resolution
Definition: client_types.h:334
void(* MirPlatformOperationCallback)(MirConnection *connection, MirPlatformMessage *reply, void *context)
Callback called when a platform operation completes.
Definition: client_types.h:467
MirPixelFormat pixel_format
Definition: client_types.h:275
MirPixelFormat current_format
Definition: client_types.h:351
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:299
Input configuration was attempted but was rejected by driver.
Definition: client_types.h:536
struct MirBufferStreamInfo MirBufferStreamInfo
The displacement from the top-left corner of the surface.
char * vaddr
Definition: client_types.h:276
MirDisplayConfigurationError
Errors from the mir_error_domain_display_configuration MirErrorDomain.
Definition: client_types.h:510
Definition: client_types.h:322
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:371
Retrieved information about a loadable module.
Definition: client_types.h:242
Definition: client_types.h:327
uint32_t current_mode
Definition: client_types.h:347
Definition: client_types.h:284
uint32_t num_output_formats
Definition: client_types.h:349
Definition: client_types.h:259
Definition: client_types.h:341
MirErrorDomain
Specifies the origin of an error.
Definition: client_types.h:491
Definition: client_types.h:307
MirSurfaceParameters MirWindowParameters
Definition: client_types.h:561
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:309
void(* MirPromptSessionCallback)(MirPromptSession *prompt_provider, void *context)
Callback member of MirPromptSession for handling of prompt sessions.
Definition: client_types.h:439
struct MirPlatformPackage MirPlatformPackage
Definition: client_types.h:260
struct MirDisplayOutput MirDisplayOutput
struct MirDisplayInfo MirDisplayInfo
uint32_t physical_width_mm
Definition: client_types.h:362
Errors relating to display configuration.
Definition: client_types.h:498
int supported_pixel_format_items
Definition: client_types.h:289
struct MirConnection MirConnection
Definition: client_types.h:40
Definition: client_types.h:310
MirPixelFormat * output_formats
Definition: client_types.h:350
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:550
Display configuration was attempted but was rejected by the hardware.
Definition: client_types.h:526
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:391
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:178
Definition: client_types.h:311
void(* MirBufferCallback)(MirBuffer *, void *context)
Definition: client_types.h:484
Definition: client_types.h:261
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:321
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:300
MirBufferUsage buffer_usage
Definition: client_types.h:194
uint32_t num_cards
Definition: client_types.h:373
double refresh_rate
Definition: client_types.h:336
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:412
Definition: client_types.h:262
uint32_t preferred_mode
There might be no preferred mode, which is indicated by a value >=num_modes.
Definition: client_types.h:345
unsigned int height
Definition: client_types.h:392
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:450
MirPixelFormat pixel_format
The pixel format of the screencast.
Definition: client_types.h:421
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:547
unsigned int width
The width of the screencast which can be different than the screen region capture width...
Definition: client_types.h:414
void(* mir_surface_id_callback)(MirSurface *surface, MirPersistentId *id, void *context) __attribute__((deprecated("Use MirWindowIdCallback instead")))
Definition: client_types.h:554
MirDisplayOutputType type
Definition: client_types.h:355
MirConnectedCallback mir_connected_callback __attribute__((deprecated("Use MirConnectedCallback instead")))
Release a platform message.
Definition: client_types.h:85
Definition: client_types.h:316
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:303
Definition: client_types.h:313
Definition: common.h:196
Definition: common.h:204
int micro_version
Definition: client_types.h:247
Definition: client_types.h:387
Retrieved information about a MirWindow.
Definition: client_types.h:270
int major_version
Definition: client_types.h:245
MirInputConfigurationError
Errors from the mir_error_domain_input_configuration MirErrorDomain.
Definition: client_types.h:532
Definition: common.h:205
struct MirRectangle MirRectangle
int width
Definition: client_types.h:191
Definition: client_types.h:308
Definition: client_types.h:263
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:343
struct MirDisplayCard MirDisplayCard
MirDisplayConfiguration provides details of the graphics environment.
uint32_t card_id
Definition: client_types.h:353
Definition: common.h:210
Definition: client_types.h:315
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:272
MirPlatformType
The native buffer type for the system the client is connected on.
Definition: client_types.h:219
MirDisplayOutput * outputs
Definition: client_types.h:372
Definition: client_types.h:329
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:312
MirBufferStream * stream
Definition: client_types.h:382
uint32_t horizontal_resolution
Definition: client_types.h:335
void * MirEGLNativeDisplayType
Definition: client_types.h:39
Client is not permitted to change global display configuration.
Definition: client_types.h:514
Definition: client_types.h:328

Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Mar 27 12:06:55 UTC 2017