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;
47 typedef struct MirBlob MirBlob;
48 
55 
57 
64 typedef void (*mir_connected_callback)(MirConnection *connection, void *client_context);
65 
75 typedef void (*mir_surface_callback)(MirSurface *surface, void *client_context);
76 
84 typedef void (*mir_buffer_stream_callback)(MirBufferStream *stream, void *client_context);
85 
93  MirSurface* surface, MirEvent const* event, void* context);
94 
104  MirConnection* connection, MirLifecycleState state, void* context);
105 
113 typedef void (*mir_ping_event_callback)(
114  MirConnection* connection, int32_t serial, void* context);
115 
123  MirConnection* connection, void* context);
124 
135 typedef void (*mir_client_fd_callback)(
136  MirPromptSession *prompt_session, size_t count, int const* fds, void* context);
137 
138 
139 typedef void (*mir_surface_id_callback)(
140  MirSurface* surface, MirPersistentId* id, void* context);
141 
147 typedef enum MirBufferUsage
148 {
152 
157 typedef struct MirSurfaceParameters
158 {
159  char const *name;
160  int width;
161  int height;
172  uint32_t output_id;
174 
176 
180 typedef enum MirPlatformType
181 {
185 
186 typedef struct MirPlatformPackage
187 {
189  int fd_items;
190 
194 
195 
200 typedef struct MirGraphicsRegion
201 {
202  int width;
203  int height;
204  int stride;
206  char *vaddr;
207 
209 
214 typedef struct MirDisplayInfo
215 {
216  uint32_t width;
217  uint32_t height;
218 
222 
227 typedef struct MirDisplayCard
228 {
229  uint32_t card_id;
232 
234 {
251 
252 typedef struct MirDisplayMode
253 {
256  double refresh_rate;
258 
260 
261 typedef struct MirDisplayOutput
262 {
263  uint32_t num_modes;
265  uint32_t preferred_mode;
267  uint32_t current_mode;
268 
272 
273  uint32_t card_id;
274  uint32_t output_id;
276 
277  int32_t position_x;
278  int32_t position_y;
279  uint32_t connected;
280  uint32_t used;
281 
284 
288 
290 {
291  uint32_t num_outputs;
293  uint32_t num_cards;
296 
300 typedef struct MirBufferStreamInfo
301 {
306 
307 typedef struct MirRectangle
308 {
309  int left;
310  int top;
311  unsigned int width;
312  unsigned int height;
313 } MirRectangle;
314 
322 {
329  unsigned int width;
331  unsigned int height;
338 
344 typedef void (*mir_screencast_callback)(MirScreencast *screencast, void *client_context);
345 
351 typedef void (*mir_prompt_session_callback)(MirPromptSession* prompt_provider, void* context);
352 
360  MirPromptSession* prompt_provider, MirPromptSessionState state, void* context);
361 
373  MirConnection* connection, MirPlatformMessage* reply, void* context);
374 
375 #ifdef __cplusplus
376 }
378 #endif
379 
380 #endif /* MIR_TOOLKIT_CLIENT_TYPES_H_ */
uint32_t physical_height_mm
Definition: client_types.h:283
Definition: client_types.h:259
int displacement_y
Definition: client_types.h:304
MirPowerMode power_mode
Definition: client_types.h:285
Definition: client_types.h:186
Definition: client_types.h:289
Definition: mir_surface.h:77
int data[mir_platform_package_max]
Definition: client_types.h:191
struct MirScreencastParameters MirScreencastParameters
MirScreencastParameters is the structure of required information that you must provide to Mir in orde...
int left
Definition: client_types.h:309
Definition: mir_surface.h:136
void(* mir_lifecycle_event_callback)(MirConnection *connection, MirLifecycleState state, void *context)
Callback called when a lifecycle event/callback is requested from the running server.
Definition: client_types.h:103
struct MirBufferStream MirBufferStream
Definition: client_types.h:45
MirScreencastParameters is the structure of required information that you must provide to Mir in orde...
Definition: client_types.h:321
void(* mir_surface_id_callback)(MirSurface *surface, MirPersistentId *id, void *context)
Definition: client_types.h:139
struct MirSurfaceParameters MirSurfaceParameters
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:236
Definition: client_types.h:248
Definition: client_types.h:213
void(* mir_surface_event_callback)(MirSurface *surface, MirEvent const *event, void *context)
Callback for handling of surface events.
Definition: client_types.h:92
MirOrientation orientation
Definition: client_types.h:286
Definition: mir_wait_handle.h:31
void(* mir_buffer_stream_callback)(MirBufferStream *stream, void *client_context)
Callback to be passed when calling:
Definition: client_types.h:84
int height
Definition: client_types.h:161
struct MirBlob MirBlob
Definition: client_types.h:47
int top
Definition: client_types.h:310
MirPromptSessionState
Definition: common.h:109
MirPixelFormat pixel_format
Definition: client_types.h:162
uint32_t output_id
The id of the output to place the surface in.
Definition: client_types.h:172
Definition: client_types.h:235
Definition: client_types.h:247
MirDisplayMode * modes
Definition: client_types.h:264
int32_t position_y
Definition: client_types.h:278
Definition: client_types.h:182
Definition: client_types.h:175
int displacement_x
Definition: client_types.h:303
MirDisplayCard * cards
Definition: client_types.h:294
Definition: client_types.h:149
unsigned int height
The height of the screencast which can be different than the screen region capture height...
Definition: client_types.h:331
The displacement from the top-left corner of the surface.
Definition: client_types.h:300
uint32_t output_id
Definition: client_types.h:274
uint32_t used
Definition: client_types.h:280
int32_t position_x
Definition: client_types.h:277
uint32_t width
Definition: client_types.h:216
Definition: mir_screencast.h:49
struct MirDisplayMode MirDisplayMode
uint32_t height
Definition: client_types.h:217
int stride
Definition: client_types.h:204
Definition: client_types.h:249
uint32_t connected
Definition: client_types.h:279
MirDisplayConfiguration provides details of the graphics environment.
Definition: client_types.h:227
Definition: client_types.h:244
Definition: client_types.h:252
int height
Definition: client_types.h:203
uint32_t vertical_resolution
Definition: client_types.h:254
MirPixelFormat pixel_format
Definition: client_types.h:205
MirPixelFormat current_format
Definition: client_types.h:271
struct MirDisplayConfiguration MirDisplayConfiguration
void(* mir_client_fd_callback)(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:135
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:164
char const * name
Definition: client_types.h:159
Definition: client_types.h:183
uint32_t card_id
Definition: client_types.h:229
struct MirBufferStreamInfo MirBufferStreamInfo
The displacement from the top-left corner of the surface.
char * vaddr
Definition: client_types.h:206
void(* mir_screencast_callback)(MirScreencast *screencast, void *client_context)
Callback to be passed when calling MirScreencast functions.
Definition: client_types.h:344
MirPixelFormat supported_pixel_format[mir_supported_pixel_format_max]
Definition: client_types.h:220
Definition: mir_surface.h:125
struct MirGraphicsRegion MirGraphicsRegion
Retrieved information about a MirSurface.
uint32_t num_outputs
Definition: client_types.h:291
uint32_t current_mode
Definition: client_types.h:267
Definition: client_types.h:214
uint32_t num_output_formats
Definition: client_types.h:269
void(* mir_ping_event_callback)(MirConnection *connection, int32_t serial, void *context)
Callback called when the server pings for responsiveness testing.
Definition: client_types.h:113
Definition: client_types.h:261
Definition: client_types.h:237
struct MirPlatformMessage MirPlatformMessage
Definition: client_types.h:56
Definition: client_types.h:239
struct MirPlatformPackage MirPlatformPackage
struct MirDisplayOutput MirDisplayOutput
struct MirDisplayInfo MirDisplayInfo
uint32_t physical_width_mm
Definition: client_types.h:282
void(* mir_platform_operation_callback)(MirConnection *connection, MirPlatformMessage *reply, void *context)
Callback called when a platform operation completes.
Definition: client_types.h:372
int supported_pixel_format_items
Definition: client_types.h:219
Definition: client_types.h:240
int fd[mir_platform_package_max]
Definition: client_types.h:192
MirPixelFormat * output_formats
Definition: client_types.h:270
MirPowerMode
Definition: common.h:101
unsigned int width
Definition: client_types.h:311
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:147
Definition: client_types.h:241
Definition: mir_prompt_session.h:49
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
int fd_items
Definition: client_types.h:189
void(* mir_surface_callback)(MirSurface *surface, void *client_context)
Callback to be passed when calling:
Definition: client_types.h:75
void(* mir_prompt_session_callback)(MirPromptSession *prompt_provider, void *context)
Callback member of MirPromptSession for handling of prompt sessions.
Definition: client_types.h:351
uint32_t max_simultaneous_outputs
Definition: client_types.h:230
MirBufferUsage buffer_usage
Definition: client_types.h:163
uint32_t num_cards
Definition: client_types.h:293
double refresh_rate
Definition: client_types.h:256
MirLifecycleState
Definition: common.h:94
MirRectangle region
The rectangular region of the screen to capture - The region is specified in virtual screen space hen...
Definition: client_types.h:327
uint32_t preferred_mode
There might be no preferred mode, which is indicated by a value >=num_modes.
Definition: client_types.h:265
unsigned int height
Definition: client_types.h:312
void * MirEGLNativeWindowType
Definition: client_types.h:38
MirPixelFormat pixel_format
The pixel format of the screencast.
Definition: client_types.h:336
int data_items
Definition: client_types.h:188
unsigned int width
The width of the screencast which can be different than the screen region capture width...
Definition: client_types.h:329
void(* mir_connected_callback)(MirConnection *connection, void *client_context)
Callback to be passed when issuing a mir_connect request.
Definition: client_types.h:64
MirDisplayOutputType type
Definition: client_types.h:275
Definition: client_types.h:246
Definition: mir_connection.h:88
MirDisplayOutputType
Definition: client_types.h:233
Definition: client_types.h:243
Definition: client_types.h:307
Retrieved information about a MirSurface.
Definition: client_types.h:200
Definition: event_private.h:178
struct MirRectangle MirRectangle
int width
Definition: client_types.h:160
Definition: client_types.h:238
void(* mir_display_config_callback)(MirConnection *connection, void *context)
Callback called when a display config change has occurred.
Definition: client_types.h:122
uint32_t num_modes
Definition: client_types.h:263
struct MirDisplayCard MirDisplayCard
MirDisplayConfiguration provides details of the graphics environment.
uint32_t card_id
Definition: client_types.h:273
Definition: client_types.h:245
int width
Definition: client_types.h:202
MirPlatformType
The native buffer type for the system the client is connected on.
Definition: client_types.h:180
MirDisplayOutput * outputs
Definition: client_types.h:292
Definition: client_types.h:150
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:157
Definition: client_types.h:242
void(* mir_prompt_session_state_change_callback)(MirPromptSession *prompt_provider, MirPromptSessionState state, void *context)
Callback member of MirPromptSession for handling of prompt sessions events.
Definition: client_types.h:359
MirBufferStream * stream
Definition: client_types.h:302
uint32_t horizontal_resolution
Definition: client_types.h:255
void * MirEGLNativeDisplayType
Definition: client_types.h:39

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015