27#define MND_API_VERSION_MAJOR 1
29#define MND_API_VERSION_MINOR 6
31#define MND_API_VERSION_PATCH 0
40 MND_ERROR_INVALID_VERSION = -1,
41 MND_ERROR_INVALID_VALUE = -2,
42 MND_ERROR_CONNECTING_FAILED = -3,
43 MND_ERROR_OPERATION_FAILED = -4,
59 MND_CLIENT_PRIMARY_APP = (1u << 0u),
60 MND_CLIENT_SESSION_ACTIVE = (1u << 1u),
61 MND_CLIENT_SESSION_VISIBLE = (1u << 2u),
62 MND_CLIENT_SESSION_FOCUSED = (1u << 3u),
63 MND_CLIENT_SESSION_OVERLAY = (1u << 4u),
122 MND_SPACE_REFERENCE_TYPE_VIEW,
123 MND_SPACE_REFERENCE_TYPE_LOCAL,
124 MND_SPACE_REFERENCE_TYPE_LOCAL_FLOOR,
125 MND_SPACE_REFERENCE_TYPE_STAGE,
126 MND_SPACE_REFERENCE_TYPE_UNBOUNDED,
139 MND_IO_BLOCK_POSES = (1u << 0u),
140 MND_IO_BLOCK_HT = (1u << 1u),
141 MND_IO_BLOCK_INPUTS = (1u << 2u),
142 MND_IO_BLOCK_OUTPUTS = (1u << 3u),
538 mnd_root_t *root, uint32_t device_index,
bool *out_present,
bool *out_charging,
float *out_charge);
mnd_result_t mnd_root_get_tracking_origin_name(mnd_root_t *root, uint32_t origin_index, const char **out_string)
Retrieve the name of the indicated tracking origin.
Definition: monado.c:678
mnd_result_t mnd_root_create(mnd_root_t **out_root)
Create libmonado state and connect to service.
Definition: monado.c:200
mnd_result_t mnd_root_get_device_info_bool(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, bool *out_bool)
Get boolean property for the device at the given index.
Definition: monado.c:424
mnd_result_t mnd_root_get_device_info_string(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, const char **out_string)
Get string property for the device at the given index.
Definition: monado.c:492
mnd_result
Result codes for operations, negative are errors, zero or positives are success.
Definition: monado.h:38
@ MND_ERROR_INVALID_PROPERTY
Supported in version 1.2 and above.
Definition: monado.h:47
@ MND_ERROR_UNSUPPORTED_OPERATION
Supported in version 1.5 and above.
Definition: monado.h:51
@ MND_ERROR_INVALID_OPERATION
Supported in version 1.3 and above.
Definition: monado.h:49
@ MND_ERROR_RECENTERING_NOT_SUPPORTED
Supported in version 1.1 and above.
Definition: monado.h:45
void mnd_api_get_version(uint32_t *out_major, uint32_t *out_minor, uint32_t *out_patch)
Returns the version of the API (not Monado itself), follows the versioning semantics of https://semve...
Definition: monado.c:185
enum mnd_result mnd_result_t
Result codes for operations, negative are errors, zero or positives are success.
mnd_result_t mnd_root_get_client_state(mnd_root_t *root, uint32_t client_id, uint32_t *out_flags)
Get the state flags of the client at the given index.
Definition: monado.c:317
mnd_result_t mnd_root_get_reference_space_offset(mnd_root_t *root, mnd_reference_space_type_t type, mnd_pose_t *out_offset)
Get the current offset value of the specified reference space.
Definition: monado.c:602
mnd_property
A property to get from a thing (currently only devices).
Definition: monado.h:82
@ MND_PROPERTY_SUPPORTS_POSITION_BOOL
Supported in version 1.4.0 and above.
Definition: monado.h:90
@ MND_PROPERTY_SUPPORTS_BRIGHTNESS_BOOL
Supported in version 1.5.0 and above.
Definition: monado.h:94
@ MND_PROPERTY_NAME_STRING
Supported in version 1.2 and above.
Definition: monado.h:84
@ MND_PROPERTY_SUPPORTS_ORIENTATION_BOOL
Supported in version 1.4.0 and above.
Definition: monado.h:92
@ MND_PROPERTY_TRACKING_ORIGIN_U32
Supported in version 1.4.0 and above.
Definition: monado.h:88
@ MND_PROPERTY_SERIAL_STRING
Supported in version 1.2 and above.
Definition: monado.h:86
void mnd_root_destroy(mnd_root_t **root_ptr)
Destroy libmonado state, disconnecting from the service, and zeroing the pointer.
Definition: monado.c:244
mnd_result_t mnd_root_get_client_name(mnd_root_t *root, uint32_t client_id, const char **out_name)
Get the name of the client at the given index.
Definition: monado.c:300
mnd_result_t mnd_root_get_device_battery_status(mnd_root_t *root, uint32_t device_index, bool *out_present, bool *out_charging, float *out_charge)
Get battery status of a device.
Definition: monado.c:692
mnd_result_t mnd_root_recenter_local_spaces(mnd_root_t *root)
Trigger a recenter of the local spaces.
Definition: monado.c:590
mnd_result_t mnd_root_get_device_from_role(mnd_root_t *root, const char *role_name, int32_t *out_index)
Get the device index associated for a given role name.
Definition: monado.c:525
enum mnd_io_block_flags mnd_io_block_flags_t
Bitflags for IO blocking.
struct mnd_pose mnd_pose_t
A pose composed of a position and orientation.
mnd_reference_space_type
Types of reference space.
Definition: monado.h:121
mnd_result_t mnd_root_get_device_info_i32(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, uint32_t *out_i32)
Get int32_t property for the device at the given index.
Definition: monado.c:443
mnd_result_t mnd_root_update_client_list(mnd_root_t *root)
Update our local cached copy of the client list.
Definition: monado.c:264
mnd_result_t mnd_root_set_reference_space_offset(mnd_root_t *root, mnd_reference_space_type_t type, const mnd_pose_t *offset)
Apply an offset to the specified reference space.
Definition: monado.c:615
mnd_result_t mnd_root_set_tracking_origin_offset(mnd_root_t *root, uint32_t origin_index, const mnd_pose_t *offset)
Apply an offset to the specified tracking origin.
Definition: monado.c:648
mnd_result_t mnd_root_get_client_id_at_index(mnd_root_t *root, uint32_t index, uint32_t *out_client_id)
Get the id from the current client list.
Definition: monado.c:289
mnd_result_t mnd_root_set_client_focused(mnd_root_t *root, uint32_t client_id)
Set the client at the given index as "focused".
Definition: monado.c:363
enum mnd_client_flags mnd_client_flags_t
Bitflags for client application state.
mnd_result_t mnd_root_set_device_brightness(mnd_root_t *root, uint32_t device_index, float brightness, bool relative)
Set the display brightness.
Definition: monado.c:739
mnd_result_t mnd_root_toggle_client_io_active(mnd_root_t *root, uint32_t client_id)
Toggle io activity for the client at the given index.
Definition: monado.c:378
mnd_io_block_flags
Bitflags for IO blocking.
Definition: monado.h:138
enum mnd_reference_space_type mnd_reference_space_type_t
Types of reference space.
mnd_client_flags
Bitflags for client application state.
Definition: monado.h:58
@ MND_CLIENT_POSES_BLOCKED
Supported in version 1.6 and above.
Definition: monado.h:67
@ MND_CLIENT_HT_BLOCKED
Supported in version 1.6 and above.
Definition: monado.h:69
@ MND_CLIENT_INPUTS_BLOCKED
Supported in version 1.6 and above.
Definition: monado.h:71
@ MND_CLIENT_OUTPUTS_BLOCKED
Supported in version 1.6 and above.
Definition: monado.h:73
@ MND_CLIENT_IO_ACTIVE
Definition: monado.h:65
mnd_result_t mnd_root_get_device_count(mnd_root_t *root, uint32_t *out_device_count)
Get the number of devices.
Definition: monado.c:413
mnd_result_t mnd_root_get_device_info(mnd_root_t *root, uint32_t device_index, uint32_t *out_device_id, const char **out_dev_name)
Get device info at the given index.
Definition: monado.c:510
mnd_result_t mnd_root_set_client_primary(mnd_root_t *root, uint32_t client_id)
Set the client at the given index as "primary".
Definition: monado.c:348
mnd_result_t mnd_root_get_tracking_origin_offset(mnd_root_t *root, uint32_t origin_index, mnd_pose_t *out_offset)
Read the current offset of a tracking origin.
Definition: monado.c:629
enum mnd_property mnd_property_t
A property to get from a thing (currently only devices).
mnd_result_t mnd_root_get_device_info_u32(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, uint32_t *out_u32)
Get uint32_t property for the device at the given index.
Definition: monado.c:455
mnd_result_t mnd_root_get_device_brightness(mnd_root_t *root, uint32_t device_index, float *out_brightness)
Get current brightness of a display device.
Definition: monado.c:717
mnd_result_t mnd_root_get_number_clients(mnd_root_t *root, uint32_t *out_num)
Get the number of active clients.
Definition: monado.c:278
mnd_result_t mnd_root_get_device_info_float(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, float *out_float)
Get float property for the device at the given index.
Definition: monado.c:480
mnd_result_t mnd_root_set_client_io_blocks(mnd_root_t *root, uint32_t client_id, mnd_io_block_flags_t block_flags)
Block certain types of IO for the client at the given index.
Definition: monado.c:393
mnd_result_t mnd_root_get_tracking_origin_count(mnd_root_t *root, uint32_t *out_track_count)
Retrieve the number of tracking origins available.
Definition: monado.c:667
A pose composed of a position and orientation.
Definition: monado.h:106