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 2 or 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 
63 typedef struct MirCursorConfiguration MirCursorConfiguration
65 
72 typedef struct MirOutput MirOutput;
73 
80 
82 
89 typedef void (*MirConnectedCallback)(
90  MirConnection *connection, void *client_context);
91 typedef MirConnectedCallback mir_connected_callback
92  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirConnectedCallback instead");
93 
100 typedef void (*MirWindowCallback)(MirWindow *window, void *client_context);
101 
109 typedef void (*MirBufferStreamCallback)(
110  MirBufferStream *stream, void *client_context);
111 typedef MirBufferStreamCallback mir_buffer_stream_callback
112  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirBufferStreamCallback instead");
113 
120 typedef void (*MirWindowEventCallback)(
121  MirWindow* window, MirEvent const* event, void* context);
122 
132  MirConnection* connection, MirLifecycleState state, void* context);
133 typedef MirLifecycleEventCallback mir_lifecycle_event_callback
134  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirLifecycleEventCallback instead");
135 
143 typedef void (*MirPingEventCallback)(
144  MirConnection* connection, int32_t serial, void* context);
145 typedef MirPingEventCallback mir_ping_event_callback
146  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPingEventCallback instead");
147 
154 typedef void (*MirDisplayConfigCallback)(
155  MirConnection* connection, void* context);
156 typedef MirDisplayConfigCallback mir_display_config_callback
157  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirDisplayConfigCallback instead");
158 
169 typedef void (*MirClientFdCallback)(
170  MirPromptSession *prompt_session, size_t count, int const* fds, void* context);
171 typedef MirClientFdCallback mir_client_fd_callback
172  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirClientFdCallback instead");
173 
174 #pragma GCC diagnostic push
175 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
176 typedef void (*MirWindowIdCallback)(
177  MirWindow* window, MirPersistentId* id, void* context);
178 #pragma GCC diagnostic pop
185 typedef enum MirBufferUsage
186 {
189 } MirBufferUsage MIR_FOR_REMOVAL_IN_VERSION_1("No longer applicable when using MirRenderSurface");
190 
195 typedef struct MirSurfaceParameters
196 {
197  char const *name;
198  int width;
199  int height;
201 #pragma GCC diagnostic push
202 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
204 #pragma GCC diagnostic pop
205 
214  uint32_t output_id;
215 } MirSurfaceParameters MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_get apis or listen for attribute events instead");
216 
218 
227 #ifndef __cplusplus
228 MIR_FOR_REMOVAL_IN_VERSION_1("Use of this type is inherently non-portable")
229 #endif
230 typedef enum MirPlatformType
231 {
236 
237 typedef struct MirPlatformPackage
238 {
240  int fd_items;
241 
245 
253 typedef struct MirModuleProperties
254 {
255  char const *name;
259  char const *filename;
261 
262 typedef enum MirBufferLayout
263 {
267 
268 typedef enum MirPresentMode
269 {
270  mir_present_mode_immediate, //same as VK_PRESENT_MODE_IMMEDIATE_KHR
271  mir_present_mode_mailbox, //same as VK_PRESENT_MODE_MAILBOX_KHR
272  mir_present_mode_fifo, //same as VK_PRESENT_MODE_FIFO_KHR
273  mir_present_mode_fifo_relaxed, //same as VK_PRESENT_MODE_FIFO_RELAXED_KHR
276 
281 typedef struct MirGraphicsRegion
282 {
283  int width;
284  int height;
285  int stride;
287  char *vaddr;
288 
290 
295 typedef struct MirDisplayInfo
296 {
297  uint32_t width;
298  uint32_t height;
299 
303 
308 typedef struct MirDisplayCard
309 {
310  uint32_t card_id;
313 
315 {
335 
337 {
342 
343 typedef struct MirDisplayMode
344 {
347  double refresh_rate;
349 
351 
352 typedef struct MirDisplayOutput
353 {
354  uint32_t num_modes;
356  uint32_t preferred_mode;
358  uint32_t current_mode;
359 
363 
364  uint32_t card_id;
365  uint32_t output_id;
366  MirDisplayOutputType type;
367 
368  int32_t position_x;
369  int32_t position_y;
370  uint32_t connected;
371  uint32_t used;
372 
375 
379 
381 {
382  uint32_t num_outputs;
384  uint32_t num_cards;
387 
391 typedef struct MirBufferStreamInfo
392 {
397 
398 typedef struct MirRectangle
399 {
400  int left;
401  int top;
402  unsigned int width;
403  unsigned int height;
404 } MirRectangle;
405 
412 
420 {
427  unsigned int width;
429  unsigned int height;
436 
442 typedef void (*MirScreencastCallback)(
443  MirScreencast *screencast, void *client_context);
444 typedef MirScreencastCallback mir_screencast_callback
445  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirScreencastCallback instead");
446 
452 typedef void (*MirPromptSessionCallback)(
453  MirPromptSession* prompt_provider, void* context);
454 typedef MirPromptSessionCallback mir_prompt_session_callback
455  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPromptSessionCallback instead");
456 
464  MirPromptSession* prompt_provider, MirPromptSessionState state,
465  void* context);
467  mir_prompt_session_state_change_callback
468  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPromptSessionStateChangeCallback instead");
469 
481  MirConnection* connection, MirPlatformMessage* reply, void* context);
482 typedef MirPlatformOperationCallback mir_platform_operation_callback
483  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirPlatformOperationCallback instead");
484 
492 typedef void (*MirInputConfigCallback)(
493  MirConnection* connection, void* context);
494 typedef MirInputConfigCallback mir_input_config_callback
495  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirInputConfigCallback instead");
496 
497 typedef void (*MirBufferCallback)(MirBuffer*, void* context);
498 
504 typedef enum MirErrorDomain
505 {
519 
541 
550 
555 
561 
562 typedef void (*MirErrorCallback)(
563  MirConnection* connection, MirError const* error, void* context);
564 typedef MirErrorCallback mir_error_callback
565  MIR_FOR_REMOVAL_IN_VERSION_1("Use MirErrorCallback instead");
566 
567 #pragma GCC diagnostic push
568 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
569 
570 typedef void (*mir_surface_callback)(MirSurface *surface, void *client_context)
571 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowCallback instead");
572 
574  MirSurface* surface, MirEvent const* event, void* context)
575 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowEventCallback instead");
576 
577 typedef void (*mir_surface_id_callback)(
578  MirSurface* surface, MirPersistentId* id, void* context)
579 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead");
580 
581 typedef MirSurfaceParameters MirWindowParameters
582 MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_get_xxx apis or listen for attribute events instead");
583 
584 #pragma GCC diagnostic pop
585 
586 #ifdef __cplusplus
587 }
589 #endif
590 
591 #endif /* MIR_TOOLKIT_CLIENT_TYPES_H_ */
struct MirOutput MirOutput
Descriptor for an output connection.
Definition: client_types.h:72
uint32_t physical_height_mm
Definition: client_types.h:374
int displacement_y
Definition: client_types.h:395
MirPowerMode power_mode
Definition: client_types.h:376
void(* MirDisplayConfigCallback)(MirConnection *connection, void *context)
Callback called when a display config change has occurred.
Definition: client_types.h:154
Definition: client_types.h:237
Definition: client_types.h:380
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:400
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:419
struct MirBuffer MirBuffer
Definition: client_types.h:56
Definition: common.h:201
Definition: mir_keyboard_config.h:33
Definition: client_types.h:317
void(* MirPingEventCallback)(MirConnection *connection, int32_t serial, void *context)
Callback called when the server pings for responsiveness testing.
Definition: client_types.h:143
Definition: client_types.h:329
Definition: common.h:210
MirOrientation orientation
Definition: client_types.h:377
Definition: common.h:213
int height
Definition: client_types.h:199
Definition: mir_touchscreen_config.h:28
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:268
int top
Definition: client_types.h:401
struct MirError MirError
Definition: client_types.h:54
Definition: client_types.h:217
MirPromptSessionState
Definition: common.h:216
MirPixelFormat pixel_format
Definition: client_types.h:200
uint32_t output_id
The id of the output to place the surface in.
Definition: client_types.h:214
void(* MirErrorCallback)(MirConnection *connection, MirError const *error, void *context)
Definition: client_types.h:562
Definition: client_types.h:316
Definition: client_types.h:328
Definition: common.h:209
Definition: common.h:196
MirDisplayMode * modes
Definition: client_types.h:355
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:131
Definition: client_types.h:331
int32_t position_y
Definition: client_types.h:369
Definition: client_types.h:232
Definition: common.h:197
MirOutputConnectionState
Definition: client_types.h:336
void mir_window_spec_set_cursor_name(MirWindowSpec *spec, char const *name)
Set the name for the cursor from the system cursor theme.
A global configuration change request is already pending.
Definition: client_types.h:531
int displacement_x
Definition: client_types.h:394
MirDisplayCard * cards
Definition: client_types.h:385
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:492
unsigned int height
The height of the screencast which can be different than the screen region capture height...
Definition: client_types.h:429
The displacement from the top-left corner of the surface.
Definition: client_types.h:391
uint32_t output_id
Definition: client_types.h:365
uint32_t used
Definition: client_types.h:371
Definition: common.h:200
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:573
Definition: client_types.h:265
int32_t position_x
Definition: client_types.h:368
uint32_t width
Definition: client_types.h:297
struct MirDisplayMode MirDisplayMode
void(* MirScreencastCallback)(MirScreencast *screencast, void *client_context)
Callback to be passed when calling MirScreencast functions.
Definition: client_types.h:442
uint32_t height
Definition: client_types.h:298
mir_buffer_usage_software
Definition: client_types.h:177
int stride
Definition: client_types.h:285
struct MirScreencastSpec MirScreencastSpec
Definition: client_types.h:47
Definition: client_types.h:330
Client is not permitted to change global input configuration.
Definition: client_types.h:554
uint32_t connected
Definition: client_types.h:370
A cancel request was received, but no global display configuration preview is in progress.
Definition: client_types.h:535
Definition: common.h:204
MirDisplayConfiguration provides details of the graphics environment.
Definition: client_types.h:308
Definition: client_types.h:325
Definition: client_types.h:343
Errors relating to input configuration.
Definition: client_types.h:517
Definition: client_types.h:264
int height
Definition: client_types.h:284
uint32_t vertical_resolution
Definition: client_types.h:345
void(* MirPlatformOperationCallback)(MirConnection *connection, MirPlatformMessage *reply, void *context)
Callback called when a platform operation completes.
Definition: client_types.h:480
MirPixelFormat pixel_format
Definition: client_types.h:286
MirPixelFormat current_format
Definition: client_types.h:362
Definition: common.h:205
char const * name
Definition: client_types.h:255
struct MirDisplayConfiguration MirDisplayConfiguration
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:271
char const * name
Definition: client_types.h:197
void(* MirWindowCallback)(MirWindow *window, void *client_context)
Callback to be passed when calling window functions :
Definition: client_types.h:100
Definition: client_types.h:233
uint32_t card_id
Definition: client_types.h:310
Input configuration was attempted but was rejected by driver.
Definition: client_types.h:549
struct MirBufferStreamInfo MirBufferStreamInfo
The displacement from the top-left corner of the surface.
char * vaddr
Definition: client_types.h:287
MirDisplayConfigurationError
Errors from the mir_error_domain_display_configuration MirErrorDomain.
Definition: client_types.h:523
Definition: client_types.h:333
struct MirWaitHandle MirWaitHandle
Returned by asynchronous functions.
Definition: client_types.h:79
struct MirGraphicsRegion MirGraphicsRegion
Retrieved information about a MirWindow.
uint32_t num_outputs
Definition: client_types.h:382
Retrieved information about a loadable module.
Definition: client_types.h:253
Definition: client_types.h:338
uint32_t current_mode
Definition: client_types.h:358
Definition: client_types.h:295
uint32_t num_output_formats
Definition: client_types.h:360
Definition: client_types.h:270
Definition: client_types.h:352
MirErrorDomain
Specifies the origin of an error.
Definition: client_types.h:504
Definition: client_types.h:318
void(* MirConnectedCallback)(MirConnection *connection, void *client_context)
Callback to be passed when issuing a mir_connect request.
Definition: client_types.h:89
struct MirPlatformMessage MirPlatformMessage
Definition: client_types.h:81
Definition: client_types.h:320
void(* MirPromptSessionCallback)(MirPromptSession *prompt_provider, void *context)
Callback member of MirPromptSession for handling of prompt sessions.
Definition: client_types.h:452
struct MirPlatformPackage MirPlatformPackage
Definition: client_types.h:271
struct MirDisplayOutput MirDisplayOutput
struct MirDisplayInfo MirDisplayInfo
uint32_t physical_width_mm
Definition: client_types.h:373
Errors relating to display configuration.
Definition: client_types.h:511
int supported_pixel_format_items
Definition: client_types.h:300
struct MirConnection MirConnection
Definition: client_types.h:41
Definition: client_types.h:321
MirPixelFormat * output_formats
Definition: client_types.h:361
void(* MirWindowIdCallback)(MirWindow *window, MirPersistentId *id, void *context)
Definition: client_types.h:176
Display configuration was attempted but was rejected by the hardware.
Definition: client_types.h:539
int minor_version
Definition: client_types.h:257
struct MirEvent MirEvent
Definition: event.h:84
MirPowerMode
Definition: common.h:186
Definition: common.h:203
unsigned int width
Definition: client_types.h:402
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:185
Definition: client_types.h:322
void(* MirBufferCallback)(MirBuffer *, void *context)
Definition: client_types.h:497
Definition: client_types.h:272
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:240
Definition: client_types.h:332
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:311
MirBufferUsage buffer_usage
Definition: client_types.h:203
uint32_t num_cards
Definition: client_types.h:384
double refresh_rate
Definition: client_types.h:347
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:425
Definition: client_types.h:273
uint32_t preferred_mode
There might be no preferred mode, which is indicated by a value >=num_modes.
Definition: client_types.h:356
Client is not permitted to change its input configuration.
Definition: client_types.h:559
unsigned int height
Definition: client_types.h:403
void(* mir_surface_callback)(MirSurface *surface, void *client_context) MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowCallback instead")
Definition: client_types.h:570
void * MirEGLNativeWindowType
Definition: client_types.h:39
Definition: client_types.h:234
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:463
MirPixelFormat pixel_format
The pixel format of the screencast.
Definition: client_types.h:434
int data_items
Definition: client_types.h:239
unsigned int width
The width of the screencast which can be different than the screen region capture width...
Definition: client_types.h:427
MirDisplayOutputType type
Definition: client_types.h:366
Definition: client_types.h:327
MirBufferLayout
Definition: client_types.h:262
Definition: common.h:202
void(* MirWindowEventCallback)(MirWindow *window, MirEvent const *event, void *context)
Callback for handling of window events.
Definition: client_types.h:120
void mir_window_spec_set_cursor_render_surface(MirWindowSpec *spec, MirRenderSurface *render_surface, int hotspot_x, int hotspot_y) MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME
Set the MirWindowSpec to contain a specific cursor.
mir_buffer_usage_hardware
Definition: client_types.h:177
MirDisplayOutputType
Definition: client_types.h:314
Definition: client_types.h:324
Definition: client_types.h:350
Definition: common.h:198
Definition: common.h:206
int micro_version
Definition: client_types.h:258
Definition: client_types.h:398
void(* mir_surface_id_callback)(MirSurface *surface, MirPersistentId *id, void *context) MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead")
Definition: client_types.h:577
Retrieved information about a MirWindow.
Definition: client_types.h:281
int major_version
Definition: client_types.h:256
MirInputConfigurationError
Errors from the mir_error_domain_input_configuration MirErrorDomain.
Definition: client_types.h:545
Definition: common.h:207
struct MirRectangle MirRectangle
int width
Definition: client_types.h:198
Definition: client_types.h:319
Definition: client_types.h:274
Definition: dispatchable.h:33
char const * filename
Definition: client_types.h:259
Definition: common.h:208
Definition: mir_touchpad_config.h:29
uint32_t num_modes
Definition: client_types.h:354
struct MirDisplayCard MirDisplayCard
MirDisplayConfiguration provides details of the graphics environment.
uint32_t card_id
Definition: client_types.h:364
Definition: common.h:212
Definition: client_types.h:326
struct MirRenderSurface MirRenderSurface
Definition: client_types.h:57
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:169
int width
Definition: client_types.h:283
MirPlatformType
The native buffer type for the system the client is connected on.
Definition: client_types.h:230
MirDisplayOutput * outputs
Definition: client_types.h:383
MirConnectedCallback mir_connected_callback MIR_FOR_REMOVAL_IN_VERSION_1("Use MirConnectedCallback instead")
Definition: client_types.h:92
Definition: client_types.h:340
void(* MirBufferStreamCallback)(MirBufferStream *stream, void *client_context)
Callback to be passed when calling:
Definition: client_types.h:109
Definition: mir_input_config.h:36
Definition: common.h:211
MirWindowParameters is the structure of minimum required information that you must provide to Mir in ...
Definition: client_types.h:195
Definition: client_types.h:323
MirBufferStream * stream
Definition: client_types.h:393
Definition: mir_input_config.h:80
uint32_t horizontal_resolution
Definition: client_types.h:346
void * MirEGLNativeDisplayType
Definition: client_types.h:40
Client is not permitted to change global display configuration.
Definition: client_types.h:527
Definition: client_types.h:294
Definition: client_types.h:339

Copyright © 2012-2018 Canonical Ltd.
Generated on Tue Feb 20 03:16:44 UTC 2018