Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
24 #include <mir_toolkit/event.h>
25 #include <mir_toolkit/common.h>
26 
27 #include <stddef.h>
28 
29 #ifdef __cplusplus
30 
34 extern "C" {
35 #endif
36 
37 typedef enum MirBool
38 {
39  mir_false = 0,
41 } MirBool;
42 
43 /* Display server connection API */
44 typedef void* MirEGLNativeWindowType;
47 typedef struct MirSurface MirSurface;
50 
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 
85  MirSurface* surface, MirEvent const* event, void* context);
86 
96  MirConnection* connection, MirLifecycleState state, void* context);
97 
105  MirConnection* connection, void* context);
106 
117 typedef void (*mir_client_fd_callback)(
118  MirPromptSession *prompt_session, size_t count, int const* fds, void* context);
119 
125 typedef enum MirBufferUsage
126 {
130 
135 typedef struct MirSurfaceParameters
136 {
137  char const *name;
138  int width;
139  int height;
150  uint32_t output_id;
152 
154 
158 typedef enum MirPlatformType
159 {
163 
164 typedef struct MirPlatformPackage
165 {
167  int fd_items;
168 
172 
173 
178 typedef struct MirGraphicsRegion
179 {
180  int width;
181  int height;
182  int stride;
184  char *vaddr;
185 
187 
192 typedef struct MirDisplayInfo
193 {
194  uint32_t width;
195  uint32_t height;
196 
200 
205 typedef struct MirDisplayCard
206 {
207  uint32_t card_id;
210 
212 {
229 
230 typedef struct MirDisplayMode
231 {
234  double refresh_rate;
236 
238 
239 typedef struct MirDisplayOutput
240 {
241  uint32_t num_modes;
243  uint32_t preferred_mode;
244  uint32_t current_mode;
245 
249 
250  uint32_t card_id;
251  uint32_t output_id;
253 
254  int32_t position_x;
255  int32_t position_y;
256  uint32_t connected;
257  uint32_t used;
258 
261 
265 
267 {
268  uint32_t num_outputs;
270  uint32_t num_cards;
273 
278 typedef struct MirEventDelegate
279 {
281  void *context;
283 
284 typedef struct MirRectangle
285 {
286  int left;
287  int top;
288  unsigned int width;
289  unsigned int height;
290 } MirRectangle;
291 
299 {
306  unsigned int width;
308  unsigned int height;
315 
321 typedef void (*mir_screencast_callback)(MirScreencast *screencast, void *client_context);
322 
328 typedef void (*mir_prompt_session_callback)(MirPromptSession* prompt_provider, void* context);
329 
337  MirPromptSession* prompt_provider, MirPromptSessionState state, void* context);
338 
339 #ifdef __cplusplus
340 }
342 #endif
343 
344 #endif /* MIR_TOOLKIT_CLIENT_TYPES_H_ */
uint32_t physical_height_mm
Definition: client_types.h:260
Definition: client_types.h:237
MirPowerMode power_mode
Definition: client_types.h:262
Definition: client_types.h:164
Definition: client_types.h:266
void(* mir_connected_callback)(MirConnection *connection, void *client_context)
Callback to be passed when issuing a mir_connect request.
Definition: client_types.h:64
int data[mir_platform_package_max]
Definition: client_types.h:169
struct MirScreencastParameters MirScreencastParameters
MirScreencastParameters is the structure of required information that you must provide to Mir in orde...
int left
Definition: client_types.h:286
Definition: mir_surface.h:56
MirBool
Definition: client_types.h:37
MirScreencastParameters is the structure of required information that you must provide to Mir in orde...
Definition: client_types.h:298
struct MirSurfaceParameters MirSurfaceParameters
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:214
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:336
Definition: client_types.h:226
MirOrientation orientation
Definition: client_types.h:263
Definition: mir_wait_handle.h:31
int height
Definition: client_types.h:139
void(* mir_event_delegate_callback)(MirSurface *surface, MirEvent const *event, void *context)
Callback member of MirEventDelegate for handling of events.
Definition: client_types.h:84
int top
Definition: client_types.h:287
MirPromptSessionState
Definition: common.h:104
MirPixelFormat pixel_format
Definition: client_types.h:140
uint32_t output_id
The id of the output to place the surface in.
Definition: client_types.h:150
Definition: client_types.h:213
Definition: client_types.h:225
MirDisplayMode * modes
Definition: client_types.h:242
int32_t position_y
Definition: client_types.h:255
Definition: client_types.h:160
struct MirEventDelegate MirEventDelegate
MirEventDelegate may be used to specify (at surface creation time) callbacks for handling of events...
MirDisplayCard * cards
Definition: client_types.h:271
Definition: client_types.h:127
unsigned int height
The height of the screencast which can be different than the screen region capture height...
Definition: client_types.h:308
uint32_t output_id
Definition: client_types.h:251
uint32_t used
Definition: client_types.h:257
int32_t position_x
Definition: client_types.h:254
uint32_t width
Definition: client_types.h:194
Definition: mir_screencast.h:42
struct MirDisplayMode MirDisplayMode
uint32_t height
Definition: client_types.h:195
int stride
Definition: client_types.h:182
Definition: client_types.h:227
Definition: client_types.h:191
uint32_t connected
Definition: client_types.h:256
MirDisplayConfiguration provides details of the graphics environment.
Definition: client_types.h:205
Definition: client_types.h:222
Definition: client_types.h:230
int height
Definition: client_types.h:181
void(* mir_prompt_session_callback)(MirPromptSession *prompt_provider, void *context)
Callback member of MirPromptSession for handling of prompt sessions.
Definition: client_types.h:328
uint32_t vertical_resolution
Definition: client_types.h:232
MirPixelFormat pixel_format
Definition: client_types.h:183
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:117
MirPixelFormat current_format
Definition: client_types.h:248
struct MirDisplayConfiguration MirDisplayConfiguration
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:134
char const * name
Definition: client_types.h:137
Definition: client_types.h:161
uint32_t card_id
Definition: client_types.h:207
char * vaddr
Definition: client_types.h:184
MirPixelFormat supported_pixel_format[mir_supported_pixel_format_max]
Definition: client_types.h:198
struct MirGraphicsRegion MirGraphicsRegion
Retrieved information about a MirSurface.
void(* mir_surface_callback)(MirSurface *surface, void *client_context)
Callback to be passed when calling:
Definition: client_types.h:75
uint32_t num_outputs
Definition: client_types.h:268
uint32_t current_mode
Definition: client_types.h:244
Definition: client_types.h:192
MirEventDelegate may be used to specify (at surface creation time) callbacks for handling of events...
Definition: client_types.h:278
uint32_t num_output_formats
Definition: client_types.h:246
Definition: client_types.h:239
mir_event_delegate_callback callback
Definition: client_types.h:280
Definition: client_types.h:215
Definition: client_types.h:217
struct MirPlatformPackage MirPlatformPackage
struct MirDisplayOutput MirDisplayOutput
struct MirDisplayInfo MirDisplayInfo
uint32_t physical_width_mm
Definition: client_types.h:259
int supported_pixel_format_items
Definition: client_types.h:197
Definition: client_types.h:218
int fd[mir_platform_package_max]
Definition: client_types.h:170
MirPixelFormat * output_formats
Definition: client_types.h:247
MirPowerMode
Definition: common.h:96
unsigned int width
Definition: client_types.h:288
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:125
Definition: client_types.h:219
Definition: mir_prompt_session.h:40
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:119
int fd_items
Definition: client_types.h:167
uint32_t max_simultaneous_outputs
Definition: client_types.h:208
MirBufferUsage buffer_usage
Definition: client_types.h:141
uint32_t num_cards
Definition: client_types.h:270
double refresh_rate
Definition: client_types.h:234
MirLifecycleState
Definition: common.h:89
MirRectangle region
The rectangular region of the screen to capture - The region is specified in virtual screen space hen...
Definition: client_types.h:304
uint32_t preferred_mode
Definition: client_types.h:243
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:95
unsigned int height
Definition: client_types.h:289
Definition: client_types.h:153
void * MirEGLNativeWindowType
Definition: client_types.h:44
void(* mir_display_config_callback)(MirConnection *connection, void *context)
Callback called when a display config change has occurred.
Definition: client_types.h:104
MirPixelFormat pixel_format
The pixel format of the screencast.
Definition: client_types.h:313
int data_items
Definition: client_types.h:166
unsigned int width
The width of the screencast which can be different than the screen region capture width...
Definition: client_types.h:306
MirDisplayOutputType type
Definition: client_types.h:252
Definition: client_types.h:224
Definition: client_types.h:40
Definition: mir_connection.h:72
MirDisplayOutputType
Definition: client_types.h:211
Definition: client_types.h:221
void(* mir_screencast_callback)(MirScreencast *screencast, void *client_context)
Callback to be passed when calling MirScreencast functions.
Definition: client_types.h:321
Definition: client_types.h:284
Retrieved information about a MirSurface.
Definition: client_types.h:178
Definition: event.h:227
struct MirRectangle MirRectangle
int width
Definition: client_types.h:138
Definition: client_types.h:216
uint32_t num_modes
Definition: client_types.h:241
struct MirDisplayCard MirDisplayCard
MirDisplayConfiguration provides details of the graphics environment.
uint32_t card_id
Definition: client_types.h:250
Definition: client_types.h:223
void * context
Definition: client_types.h:281
int width
Definition: client_types.h:180
MirPlatformType
The native buffer type for the system the client is connected on.
Definition: client_types.h:158
MirDisplayOutput * outputs
Definition: client_types.h:269
Definition: client_types.h:39
Definition: client_types.h:128
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:135
Definition: client_types.h:220
uint32_t horizontal_resolution
Definition: client_types.h:233
void * MirEGLNativeDisplayType
Definition: client_types.h:45

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014