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>
27 
28 #include <stddef.h>
29 
30 #ifdef __cplusplus
31 
35 extern "C" {
36 #endif
37 
38 /* Display server connection API */
39 typedef void* MirEGLNativeWindowType;
42 typedef struct MirSurface MirSurface MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindow instead");
43 typedef struct MirSurface MirWindow;
44 typedef struct MirSurfaceSpec MirSurfaceSpec MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowSpec instead");
45 typedef struct MirSurfaceSpec MirWindowSpec;
50 typedef struct MirPersistentId MirPersistentId MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowId instead");
51 typedef struct MirPersistentId MirWindowId;
52 typedef struct MirBlob MirBlob;
54 typedef struct MirError MirError;
56 typedef struct MirBuffer MirBuffer;
57 typedef struct MirRenderSurface MirRenderSurface
58 MIR_FOR_REMOVAL_IN_VERSION_1("This type is slated for rename due to MirRenderSurface-->MirSurface transition");
59 
66 typedef struct MirOutput MirOutput;
67 
74 
76 
83 typedef void (*MirConnectedCallback)(
84  MirConnection *connection, void *client_context);
85 typedef MirConnectedCallback mir_connected_callback
86  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirConnectedCallback instead");
87 
94 typedef void (*MirWindowCallback)(MirWindow *window, void *client_context);
95 
103 typedef void (*MirBufferStreamCallback)(
104  MirBufferStream *stream, void *client_context);
105 typedef MirBufferStreamCallback mir_buffer_stream_callback
106  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirBufferStreamCallback instead");
107 
114 typedef void (*MirWindowEventCallback)(
115  MirWindow* window, MirEvent const* event, void* context);
116 
126  MirConnection* connection, MirLifecycleState state, void* context);
127 typedef MirLifecycleEventCallback mir_lifecycle_event_callback
128  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirLifecycleEventCallback instead");
129 
137 typedef void (*MirPingEventCallback)(
138  MirConnection* connection, int32_t serial, void* context);
139 typedef MirPingEventCallback mir_ping_event_callback
140  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPingEventCallback instead");
141 
148 typedef void (*MirDisplayConfigCallback)(
149  MirConnection* connection, void* context);
150 typedef MirDisplayConfigCallback mir_display_config_callback
151  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirDisplayConfigCallback instead");
152 
163 typedef void (*MirClientFdCallback)(
164  MirPromptSession *prompt_session, size_t count, int const* fds, void* context);
165 typedef MirClientFdCallback mir_client_fd_callback
166  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirClientFdCallback instead");
167 
168 #pragma GCC diagnostic push
169 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
170 typedef void (*MirWindowIdCallback)(
171  MirWindow* window, MirPersistentId* id, void* context);
172 #pragma GCC diagnostic pop
179 typedef enum MirBufferUsage
180 {
189 typedef struct MirSurfaceParameters
190 {
191  char const *name;
192  int width;
193  int height;
195  MirBufferUsage buffer_usage;
204  uint32_t output_id;
205 } MirSurfaceParameters MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowParameters instead");
206 
208 
217 #ifndef __cplusplus
218 MIR_FOR_REMOVAL_IN_VERSION_1("Use of this type is inherently non-portable")
219 #endif
220 typedef enum MirPlatformType
221 {
226 
227 typedef struct MirPlatformPackage
228 {
230  int fd_items;
231 
235 
243 typedef struct MirModuleProperties
244 {
245  char const *name;
249  char const *filename;
251 
252 typedef enum MirBufferLayout
253 {
257 
258 typedef enum MirPresentMode
259 {
260  mir_present_mode_immediate, //same as VK_PRESENT_MODE_IMMEDIATE_KHR
261  mir_present_mode_mailbox, //same as VK_PRESENT_MODE_MAILBOX_KHR
262  mir_present_mode_fifo, //same as VK_PRESENT_MODE_FIFO_KHR
263  mir_present_mode_fifo_relaxed, //same as VK_PRESENT_MODE_FIFO_RELAXED_KHR
266 
271 typedef struct MirGraphicsRegion
272 {
273  int width;
274  int height;
275  int stride;
277  char *vaddr;
278 
280 
285 typedef struct MirDisplayInfo
286 {
287  uint32_t width;
288  uint32_t height;
289 
293 
298 typedef struct MirDisplayCard
299 {
300  uint32_t card_id;
303 
305 {
325 
327 {
332 
333 typedef struct MirDisplayMode
334 {
337  double refresh_rate;
339 
341 
342 typedef struct MirDisplayOutput
343 {
344  uint32_t num_modes;
346  uint32_t preferred_mode;
348  uint32_t current_mode;
349 
353 
354  uint32_t card_id;
355  uint32_t output_id;
356  MirDisplayOutputType type;
357 
358  int32_t position_x;
359  int32_t position_y;
360  uint32_t connected;
361  uint32_t used;
362 
365 
369 
371 {
372  uint32_t num_outputs;
374  uint32_t num_cards;
377 
381 typedef struct MirBufferStreamInfo
382 {
387 
388 typedef struct MirRectangle
389 {
390  int left;
391  int top;
392  unsigned int width;
393  unsigned int height;
394 } MirRectangle;
395 
400 
408 {
415  unsigned int width;
417  unsigned int height;
424 
430 typedef void (*MirScreencastCallback)(
431  MirScreencast *screencast, void *client_context);
432 typedef MirScreencastCallback mir_screencast_callback
433  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirScreencastCallback instead");
434 
440 typedef void (*MirPromptSessionCallback)(
441  MirPromptSession* prompt_provider, void* context);
442 typedef MirPromptSessionCallback mir_prompt_session_callback
443  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPromptSessionCallback instead");
444 
452  MirPromptSession* prompt_provider, MirPromptSessionState state,
453  void* context);
455  mir_prompt_session_state_change_callback
456  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPromptSessionStateChangeCallback instead");
457 
469  MirConnection* connection, MirPlatformMessage* reply, void* context);
470 typedef MirPlatformOperationCallback mir_platform_operation_callback
471  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPlatformOperationCallback instead");
472 
480 typedef void (*MirInputConfigCallback)(
481  MirConnection* connection, void* context);
482 typedef MirInputConfigCallback mir_input_config_callback
483  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirInputConfigCallback instead");
484 
485 typedef void (*MirBufferCallback)(MirBuffer*, void* context);
486 
492 typedef enum MirErrorDomain
493 {
507 
529 
539 
540 typedef void (*MirErrorCallback)(
541  MirConnection* connection, MirError const* error, void* context);
542 typedef MirErrorCallback mir_error_callback
543  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirErrorCallback instead");
544 
545 #pragma GCC diagnostic push
546 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
547 
548 typedef void (*mir_surface_callback)(MirSurface *surface, void *client_context)
549 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowCallback instead");
550 
552  MirSurface* surface, MirEvent const* event, void* context)
553 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowEventCallback instead");
554 
555 typedef void (*mir_surface_id_callback)(
556  MirSurface* surface, MirPersistentId* id, void* context)
557 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead");
558 
559 typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)
560 MIR_FOR_REMOVAL_IN_VERSION_1("This type is slated for rename due to MirRenderSurface-->MirSurface transition");
561 
563 
564 #pragma GCC diagnostic pop
565 
566 #ifdef __cplusplus
567 }
569 #endif
570 
571 #endif /* MIR_TOOLKIT_CLIENT_TYPES_H_ */
struct MirOutput MirOutput
Descriptor for an output connection.
Definition: client_types.h:66
uint32_t physical_height_mm
Definition: client_types.h:364
int displacement_y
Definition: client_types.h:385
MirPowerMode power_mode
Definition: client_types.h:366
void(* MirDisplayConfigCallback)(MirConnection *connection, void *context)
Callback called when a display config change has occurred.
Definition: client_types.h:148
Definition: client_types.h:227
Definition: client_types.h:370
struct MirDisplayConfig MirDisplayConfig
Definition: client_types.h:53
struct MirSurface MirWindow
Definition: client_types.h:43
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:390
struct MirBufferStream MirBufferStream
Definition: client_types.h:49
MirScreencastParameters is the structure of required information that you must provide to Mir in orde...
Definition: client_types.h:407
struct MirBuffer MirBuffer
Definition: client_types.h:56
Definition: common.h:201
Definition: client_types.h:307
void(* MirPingEventCallback)(MirConnection *connection, int32_t serial, void *context)
Callback called when the server pings for responsiveness testing.
Definition: client_types.h:137
Definition: client_types.h:319
Definition: client_types.h:284
Definition: common.h:210
MirOrientation orientation
Definition: client_types.h:367
Definition: common.h:213
int height
Definition: client_types.h:193
struct MirBlob MirBlob
Definition: client_types.h:52
struct MirScreencast MirScreencast
Definition: client_types.h:46
struct MirPersistentId MirWindowId
Definition: client_types.h:51
void(* MirRenderSurfaceCallback)(MirRenderSurface *, void *context) MIR_FOR_REMOVAL_IN_VERSION_1("This type is slated for rename due to MirRenderSurface- -> MirSurface transition")
Definition: client_types.h:559
MirPresentMode
Definition: client_types.h:258
int top
Definition: client_types.h:391
struct MirError MirError
Definition: client_types.h:54
MirPromptSessionState
Definition: common.h:216
MirPixelFormat pixel_format
Definition: client_types.h:194
uint32_t output_id
The id of the output to place the surface in.
Definition: client_types.h:204
Definition: client_types.h:306
Definition: client_types.h:318
Definition: common.h:209
Definition: common.h:196
MirDisplayMode * modes
Definition: client_types.h:345
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:125
Definition: client_types.h:321
int32_t position_y
Definition: client_types.h:359
Definition: client_types.h:222
Definition: common.h:197
MirOutputConnectionState
Definition: client_types.h:326
A global configuration change request is already pending.
Definition: client_types.h:519
int displacement_x
Definition: client_types.h:384
MirDisplayCard * cards
Definition: client_types.h:375
struct MirPromptSession MirPromptSession
Definition: client_types.h:48
void(* MirInputConfigCallback)(MirConnection *connection, void *context)
Callback called when a change of input devices has occurred.
Definition: client_types.h:480
Definition: client_types.h:181
unsigned int height
The height of the screencast which can be different than the screen region capture height...
Definition: client_types.h:417
The displacement from the top-left corner of the surface.
Definition: client_types.h:381
uint32_t output_id
Definition: client_types.h:355
uint32_t used
Definition: client_types.h:361
Definition: common.h:200
Definition: client_types.h:255
int32_t position_x
Definition: client_types.h:358
uint32_t width
Definition: client_types.h:287
struct MirDisplayMode MirDisplayMode
void(* MirScreencastCallback)(MirScreencast *screencast, void *client_context)
Callback to be passed when calling MirScreencast functions.
Definition: client_types.h:430
uint32_t height
Definition: client_types.h:288
int stride
Definition: client_types.h:275
Definition: client_types.h:340
struct MirScreencastSpec MirScreencastSpec
Definition: client_types.h:47
Definition: client_types.h:320
uint32_t connected
Definition: client_types.h:360
A cancel request was received, but no global display configuration preview is in progress.
Definition: client_types.h:523
Definition: common.h:204
MirDisplayConfiguration provides details of the graphics environment.
Definition: client_types.h:298
Definition: client_types.h:315
Definition: client_types.h:207
Definition: client_types.h:333
Errors relating to input configuration.
Definition: client_types.h:505
Definition: client_types.h:254
int height
Definition: client_types.h:274
uint32_t vertical_resolution
Definition: client_types.h:335
void(* MirPlatformOperationCallback)(MirConnection *connection, MirPlatformMessage *reply, void *context)
Callback called when a platform operation completes.
Definition: client_types.h:468
MirPixelFormat pixel_format
Definition: client_types.h:276
MirPixelFormat current_format
Definition: client_types.h:352
Definition: common.h:205
char const * name
Definition: client_types.h:245
struct MirDisplayConfiguration MirDisplayConfiguration
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:271
char const * name
Definition: client_types.h:191
void(* MirWindowCallback)(MirWindow *window, void *client_context)
Callback to be passed when calling window functions :
Definition: client_types.h:94
Definition: client_types.h:223
uint32_t card_id
Definition: client_types.h:300
Input configuration was attempted but was rejected by driver.
Definition: client_types.h:537
struct MirBufferStreamInfo MirBufferStreamInfo
The displacement from the top-left corner of the surface.
char * vaddr
Definition: client_types.h:277
MirDisplayConfigurationError
Errors from the mir_error_domain_display_configuration MirErrorDomain.
Definition: client_types.h:511
Definition: client_types.h:323
struct MirWaitHandle MirWaitHandle
Returned by asynchronous functions.
Definition: client_types.h:73
struct MirGraphicsRegion MirGraphicsRegion
Retrieved information about a MirWindow.
void(* MirWindowEventCallback)(MirWindow *window, MirEvent const *event, void *context)
Callback for handling of window events.
Definition: client_types.h:114
uint32_t num_outputs
Definition: client_types.h:372
Retrieved information about a loadable module.
Definition: client_types.h:243
Definition: client_types.h:328
uint32_t current_mode
Definition: client_types.h:348
Definition: client_types.h:285
uint32_t num_output_formats
Definition: client_types.h:350
Definition: client_types.h:260
void(* MirErrorCallback)(MirConnection *connection, MirError const *error, void *context)
Definition: client_types.h:540
Definition: client_types.h:342
MirErrorDomain
Specifies the origin of an error.
Definition: client_types.h:492
Definition: client_types.h:308
MirSurfaceParameters MirWindowParameters
Definition: client_types.h:562
void(* MirConnectedCallback)(MirConnection *connection, void *client_context)
Callback to be passed when issuing a mir_connect request.
Definition: client_types.h:83
struct MirPlatformMessage MirPlatformMessage
Definition: client_types.h:75
Definition: client_types.h:310
void(* MirPromptSessionCallback)(MirPromptSession *prompt_provider, void *context)
Callback member of MirPromptSession for handling of prompt sessions.
Definition: client_types.h:440
struct MirPlatformPackage MirPlatformPackage
Definition: client_types.h:261
struct MirDisplayOutput MirDisplayOutput
struct MirDisplayInfo MirDisplayInfo
uint32_t physical_width_mm
Definition: client_types.h:363
Errors relating to display configuration.
Definition: client_types.h:499
int supported_pixel_format_items
Definition: client_types.h:290
struct MirConnection MirConnection
Definition: client_types.h:41
Definition: client_types.h:311
MirPixelFormat * output_formats
Definition: client_types.h:351
void(* MirWindowIdCallback)(MirWindow *window, MirPersistentId *id, void *context)
Definition: client_types.h:170
Display configuration was attempted but was rejected by the hardware.
Definition: client_types.h:527
int minor_version
Definition: client_types.h:247
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:163
struct MirEvent MirEvent
Definition: event.h:84
MirPowerMode
Definition: common.h:186
Definition: common.h:203
unsigned int width
Definition: client_types.h:392
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:179
Definition: client_types.h:312
void(* MirBufferCallback)(MirBuffer *, void *context)
Definition: client_types.h:485
Definition: client_types.h:262
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:241
int fd_items
Definition: client_types.h:230
Definition: client_types.h:322
struct MirPresentationChain MirPresentationChain
Definition: client_types.h:55
struct MirSurfaceSpec MirWindowSpec
Definition: client_types.h:45
uint32_t max_simultaneous_outputs
Definition: client_types.h:301
MirBufferUsage buffer_usage
Definition: client_types.h:195
uint32_t num_cards
Definition: client_types.h:374
double refresh_rate
Definition: client_types.h:337
MirLifecycleState
Definition: common.h:179
MirRectangle region
The rectangular region of the screen to capture - The region is specified in virtual screen space hen...
Definition: client_types.h:413
Definition: client_types.h:263
uint32_t preferred_mode
There might be no preferred mode, which is indicated by a value >=num_modes.
Definition: client_types.h:346
void(* mir_surface_event_callback)(MirSurface *surface, MirEvent const *event, void *context) MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowEventCallback instead")
Definition: client_types.h:551
unsigned int height
Definition: client_types.h:393
void(* mir_surface_callback)(MirSurface *surface, void *client_context) MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowCallback instead")
Definition: client_types.h:548
void * MirEGLNativeWindowType
Definition: client_types.h:39
Definition: client_types.h:224
Definition: common.h:199
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:451
MirPixelFormat pixel_format
The pixel format of the screencast.
Definition: client_types.h:422
int data_items
Definition: client_types.h:229
unsigned int width
The width of the screencast which can be different than the screen region capture width...
Definition: client_types.h:415
MirDisplayOutputType type
Definition: client_types.h:356
Definition: client_types.h:317
MirBufferLayout
Definition: client_types.h:252
Definition: common.h:202
MirDisplayOutputType
Definition: client_types.h:304
Definition: client_types.h:314
Definition: common.h:198
Definition: common.h:206
int micro_version
Definition: client_types.h:248
Definition: client_types.h:388
void(* mir_surface_id_callback)(MirSurface *surface, MirPersistentId *id, void *context) MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead")
Definition: client_types.h:555
Retrieved information about a MirWindow.
Definition: client_types.h:271
int major_version
Definition: client_types.h:246
MirInputConfigurationError
Errors from the mir_error_domain_input_configuration MirErrorDomain.
Definition: client_types.h:533
Definition: common.h:207
struct MirRectangle MirRectangle
int width
Definition: client_types.h:192
Definition: client_types.h:309
Definition: client_types.h:264
Definition: dispatchable.h:33
char const * filename
Definition: client_types.h:249
Definition: common.h:208
Definition: mir_touchpad_config.h:29
uint32_t num_modes
Definition: client_types.h:344
struct MirDisplayCard MirDisplayCard
MirDisplayConfiguration provides details of the graphics environment.
uint32_t card_id
Definition: client_types.h:354
Definition: common.h:212
Definition: client_types.h:316
Definition: mir_input_config.h:77
int width
Definition: client_types.h:273
MirPlatformType
The native buffer type for the system the client is connected on.
Definition: client_types.h:220
MirDisplayOutput * outputs
Definition: client_types.h:373
MirConnectedCallback mir_connected_callback MIR_FOR_REMOVAL_IN_VERSION_1("Use MirConnectedCallback instead")
Definition: client_types.h:86
Definition: client_types.h:330
Definition: client_types.h:182
void(* MirBufferStreamCallback)(MirBufferStream *stream, void *client_context)
Callback to be passed when calling:
Definition: client_types.h:103
Definition: mir_input_config.h:35
Definition: common.h:211
MirWindowParameters is the structure of minimum required information that you must provide to Mir in ...
Definition: client_types.h:189
Definition: client_types.h:313
MirBufferStream * stream
Definition: client_types.h:383
uint32_t horizontal_resolution
Definition: client_types.h:336
void * MirEGLNativeDisplayType
Definition: client_types.h:40
Client is not permitted to change global display configuration.
Definition: client_types.h:515
Definition: client_types.h:329

Copyright © 2012-2016 Canonical Ltd.
Generated on Wed May 10 10:41:27 UTC 2017