Mir
mir_connection.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012-2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 2 or 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17 
18 #ifndef MIR_TOOLKIT_MIR_CONNECTION_H_
19 #define MIR_TOOLKIT_MIR_CONNECTION_H_
20 
22 #include <mir_toolkit/common.h>
24 
25 #include <stdbool.h>
26 
27 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
52  char const *server,
53  char const *app_name,
54  MirConnectedCallback callback,
55  void *context);
56 
64 MirConnection *mir_connect_sync(char const *server, char const *app_name);
65 
73 
83 
89 
97  MirLifecycleEventCallback callback, void* context);
98 
99 
118  MirPingEventCallback callback, void* context);
119 
120 
126 void mir_connection_pong(MirConnection* connection, int32_t serial);
127 
138 
150  MirConnection* connection,
151  MirDisplayConfigCallback callback, void* context);
152 
165 
176 
203  MirConnection* connection,
204  MirDisplayConfig const* configuration,
205  int timeout_seconds);
206 
227  MirConnection* connection,
228  MirDisplayConfig const* configuration);
229 
244  MirConnection* connection);
245 
253 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirConnection * as the native display instead");
254 
271  MirConnection* connection, MirPixelFormat* formats,
272  unsigned const int formats_size, unsigned int *num_valid_formats);
273 
282 
299  MirConnection* connection, MirInputConfig const* config);
300 
319  MirConnection* connection, MirInputConfig const* config);
320 
328 
340  MirConnection* connection,
341  MirInputConfigCallback callback, void* context);
342 
351  MirConnection* connection,
352  MirErrorCallback callback,
353  void* context);
354 
363 
373  MirConnection* connection,
374  void* context,
375  void (*enumerator)(void* context, char const* extension, int version));
376 
377 #ifdef __cplusplus
378 }
380 #endif
381 
382 #endif /* MIR_TOOLKIT_MIR_CONNECTION_H_ */
#define MIR_FOR_REMOVAL_IN_VERSION_1(message)
Definition: deprecations.h:25
void mir_connection_pong(MirConnection *connection, int32_t serial)
Respond to a ping event.
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
char const * mir_connection_get_error_message(MirConnection *connection)
Retrieve a text description of the last error.
void(* MirPingEventCallback)(MirConnection *connection, int32_t serial, void *context)
Callback called when the server pings for responsiveness testing.
Definition: client_types.h:134
void(* MirInputConfigCallback)(MirConnection *connection, void *context)
Callback called when a change of input devices has occurred.
Definition: client_types.h:429
void mir_connection_set_input_config_change_callback(MirConnection *connection, MirInputConfigCallback callback, void *context)
Register a callback to be called when the input devices change.
void mir_connection_remove_session_display_config(MirConnection *connection)
Remove the display configuration for the connection.
unsigned mir_get_client_api_version()
Returns client API version.
void mir_connection_set_base_input_config(MirConnection *connection, MirInputConfig const *config)
Set the input configuration as base configuration.
struct MirDisplayConfig MirDisplayConfig
Definition: client_types.h:50
void mir_connection_set_ping_event_callback(MirConnection *connection, MirPingEventCallback callback, void *context)
Register a callback for server ping events.
void * MirEGLNativeDisplayType
Definition: client_types.h:40
void mir_connection_enumerate_extensions(MirConnection *connection, void *context, void(*enumerator)(void *context, char const *extension, int version))
Enumerates the supported extensions.
void mir_connection_release(MirConnection *connection)
Release a connection to the Mir server.
void mir_connection_apply_session_input_config(MirConnection *connection, MirInputConfig const *config)
Apply the input configuration for the connection.
MirWaitHandle * mir_connect(char const *server, char const *app_name, MirConnectedCallback callback, void *context)
Request a connection to the Mir server.
void(* MirErrorCallback)(MirConnection *connection, MirError const *error, void *context)
Definition: client_types.h:497
bool mir_connection_is_valid(MirConnection *connection)
Test for a valid connection.
void(* MirDisplayConfigCallback)(MirConnection *connection, void *context)
Callback called when a display config change has occurred.
Definition: client_types.h:143
MirDisplayConfig * mir_connection_create_display_configuration(MirConnection *connection)
Query the display.
void mir_connection_set_lifecycle_event_callback(MirConnection *connection, MirLifecycleEventCallback callback, void *context)
Register a callback to be called when a Lifecycle state change occurs.
void mir_connection_set_display_config_change_callback(MirConnection *connection, MirDisplayConfigCallback callback, void *context)
Register a callback to be called when the hardware display configuration changes.
void mir_connection_get_available_surface_formats(MirConnection *connection, MirPixelFormat *formats, unsigned const int formats_size, unsigned int *num_valid_formats)
Get the list of possible formats that a surface can be created with.
void(* MirConnectedCallback)(MirConnection *connection, void *client_context)
Callback to be passed when issuing a mir_connect request.
Definition: client_types.h:86
void mir_connection_confirm_base_display_configuration(MirConnection *connection, MirDisplayConfig const *configuration)
Confirm a base configuration change initiated by mir_connection_preview_base_display_configuration()
struct MirWaitHandle MirWaitHandle
Returned by asynchronous functions.
Definition: client_types.h:76
void mir_connection_cancel_base_display_configuration_preview(MirConnection *connection)
Cancel a pending base display configuration preview.
MirInputConfig * mir_connection_create_input_config(MirConnection *connection)
Create a snapshot of the attached input devices and device configurations.
MirEGLNativeDisplayType mir_connection_get_egl_native_display(MirConnection *connection) MIR_FOR_REMOVAL_IN_VERSION_1("Use MirConnection * as the native display instead")
Get a display type that can be used with EGL.
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:179
void mir_input_config_release(MirInputConfig const *config)
Release this snapshot of the input configuration.
void mir_connection_preview_base_display_configuration(MirConnection *connection, MirDisplayConfig const *configuration, int timeout_seconds)
Preview a new base display configuration.
void mir_connection_apply_session_display_config(MirConnection *connection, MirDisplayConfig const *display_config)
Apply the display config for the connection.
struct MirConnection MirConnection
Definition: client_types.h:41
void mir_connection_set_error_callback(MirConnection *connection, MirErrorCallback callback, void *context)
Register a callback to be called on non-fatal errors.
MirConnection * mir_connect_sync(char const *server, char const *app_name)
Perform a mir_connect() but also wait for and return the result.
struct MirInputConfig MirInputConfig
Definition: client_types.h:352

Copyright © 2012-2021 Canonical Ltd.
Generated on Wed Jul 28 02:57:36 UTC 2021
This documentation is licensed under the GPL version 2 or 3.