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;
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  MIR_FOR_REMOVAL_IN_VERSION_1("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  MIR_FOR_REMOVAL_IN_VERSION_1("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  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirLifecycleEventCallback instead");
128 
136 typedef void (*MirPingEventCallback)(
137  MirConnection* connection, int32_t serial, void* context);
138 typedef MirPingEventCallback mir_ping_event_callback
139  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPingEventCallback instead");
140 
147 typedef void (*MirDisplayConfigCallback)(
148  MirConnection* connection, void* context);
149 typedef MirDisplayConfigCallback mir_display_config_callback
150  MIR_FOR_REMOVAL_IN_VERSION_1("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  MIR_FOR_REMOVAL_IN_VERSION_1("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 MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_get apis or listen for attribute events instead");
205 
207 
216 #ifndef __cplusplus
217 MIR_FOR_REMOVAL_IN_VERSION_1("Use of this type is inherently non-portable")
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  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirScreencastCallback instead");
433 
439 typedef void (*MirPromptSessionCallback)(
440  MirPromptSession* prompt_provider, void* context);
441 typedef MirPromptSessionCallback mir_prompt_session_callback
442  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPromptSessionCallback instead");
443 
451  MirPromptSession* prompt_provider, MirPromptSessionState state,
452  void* context);
454  mir_prompt_session_state_change_callback
455  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPromptSessionStateChangeCallback instead");
456 
468  MirConnection* connection, MirPlatformMessage* reply, void* context);
469 typedef MirPlatformOperationCallback mir_platform_operation_callback
470  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPlatformOperationCallback instead");
471 
479 typedef void (*MirInputConfigCallback)(
480  MirConnection* connection, void* context);
481 typedef MirInputConfigCallback mir_input_config_callback
482  MIR_FOR_REMOVAL_IN_VERSION_1("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  MIR_FOR_REMOVAL_IN_VERSION_1("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 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowCallback instead");
549 
551  MirSurface* surface, MirEvent const* event, void* context)
552 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowEventCallback instead");
553 
554 typedef void (*mir_surface_id_callback)(
555  MirSurface* surface, MirPersistentId* id, void* context)
556 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead");
557 
559 
560 #pragma GCC diagnostic pop
561 
562 #ifdef __cplusplus
563 }
565 #endif
566 
567 #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: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:389
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:406
struct MirBuffer MirBuffer
Definition: client_types.h:56
Definition: common.h:201
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:210
MirOrientation orientation
Definition: client_types.h:366
Definition: common.h:213
int height
Definition: client_types.h:192
struct MirBlob MirBlob
Definition: client_types.h:52
struct MirScreencast MirScreencast
Definition: client_types.h:46
struct MirPersistentId MirWindowId
Definition: client_types.h:51
MirPresentMode
Definition: client_types.h:257
int top
Definition: client_types.h:390
struct MirError MirError
Definition: client_types.h:54
MirPromptSessionState
Definition: common.h:216
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
Definition: client_types.h:305
Definition: client_types.h:317
Definition: common.h:209
Definition: common.h:196
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:197
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:48
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:200
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
struct MirScreencastSpec MirScreencastSpec
Definition: client_types.h:47
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:204
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
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:205
char const * name
Definition: client_types.h:244
struct MirDisplayConfiguration MirDisplayConfiguration
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:271
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.
void(* MirWindowEventCallback)(MirWindow *window, MirEvent const *event, void *context)
Callback for handling of window events.
Definition: client_types.h:113
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
void(* MirErrorCallback)(MirConnection *connection, MirError const *error, void *context)
Definition: client_types.h:539
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:558
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:41
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
Display configuration was attempted but was rejected by the hardware.
Definition: client_types.h:526
int minor_version
Definition: client_types.h:246
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
struct MirEvent MirEvent
Definition: event.h:84
MirPowerMode
Definition: common.h:186
Definition: common.h:203
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:241
int fd_items
Definition: client_types.h:229
Definition: client_types.h:321
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: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:179
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
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:550
unsigned int height
Definition: client_types.h:392
void(* mir_surface_callback)(MirSurface *surface, void *client_context) MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowCallback instead")
Definition: client_types.h:547
void * MirEGLNativeWindowType
Definition: client_types.h:39
Definition: client_types.h:223
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:450
MirPixelFormat pixel_format
The pixel format of the screencast.
Definition: client_types.h:421
int data_items
Definition: client_types.h:228
unsigned int width
The width of the screencast which can be different than the screen region capture width...
Definition: client_types.h:414
MirDisplayOutputType type
Definition: client_types.h:355
Definition: client_types.h:316
MirBufferLayout
Definition: client_types.h:251
Definition: common.h:202
MirDisplayOutputType
Definition: client_types.h:303
Definition: client_types.h:313
Definition: common.h:198
Definition: common.h:206
int micro_version
Definition: client_types.h:247
Definition: client_types.h:387
void(* mir_surface_id_callback)(MirSurface *surface, MirPersistentId *id, void *context) MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead")
Definition: client_types.h:554
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:207
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:208
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:212
Definition: client_types.h:315
struct MirRenderSurface MirRenderSurface
Definition: client_types.h:57
Definition: mir_input_config.h:77
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
MirConnectedCallback mir_connected_callback MIR_FOR_REMOVAL_IN_VERSION_1("Use MirConnectedCallback instead")
Definition: client_types.h:85
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:211
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:40
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 Jun 5 11:05:03 UTC 2017