Monado OpenXR Runtime
Loading...
Searching...
No Matches
monado.h
Go to the documentation of this file.
1// Copyright 2019-2023, Collabora, Ltd.
2// Copyright 2025-2026, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Interface of libmonado
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
9 */
10
11#include <stdint.h>
12#include <stdbool.h>
13
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19
20/*
21 *
22 * Enums, defines and objects.
23 *
24 */
25
26//! Major version of the API.
27#define MND_API_VERSION_MAJOR 1
28//! Minor version of the API.
29#define MND_API_VERSION_MINOR 8
30//! Patch version of the API.
31#define MND_API_VERSION_PATCH 0
32
33/*!
34 * Result codes for operations, negative are errors, zero or positives are
35 * success.
36 */
37typedef enum mnd_result
38{
39 MND_SUCCESS = 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,
44 //! Supported in version 1.1 and above.
46 //! Supported in version 1.2 and above.
48 //! Supported in version 1.3 and above.
50 //! Supported in version 1.5 and above.
53
54/*!
55 * Bitflags for client application state.
56 */
57typedef enum mnd_client_flags
58{
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),
64 //! @deprecated Deprecated in version 1.6.
66 //! Supported in version 1.6 and above.
68 //! Supported in version 1.6 and above.
70 //! Supported in version 1.6 and above.
72 //! Supported in version 1.6 and above.
75
76/*!
77 * A property to get from an object.
78 *
79 * Supported in version 1.2 and above.
80 */
81typedef enum mnd_property
82{
83 // Devices
84
85 //! Supported in version 1.2 and above. Supported by devices.
87
88 //! Supported in version 1.2 and above. Supported by devices.
90
91 //! Supported in version 1.4.0 and above. Supported by devices.
93
94 //! Supported in version 1.4.0 and above. Supported by devices.
96
97 //! Supported in version 1.4.0 and above. Supported by devices.
99
100 //! Supported in version 1.5.0 and above. Supported by devices.
102
103 //! Supported in version 1.8.0 and above. Supported by clients.
106
107/*!
108 * Opaque type for libmonado state
109 */
110typedef struct mnd_root mnd_root_t;
111
112/*!
113 * A pose composed of a position and orientation.
114 */
115typedef struct mnd_pose
116{
117 struct
118 {
119 float x, y, z, w;
120 } orientation;
121 struct
122 {
123 float x, y, z;
124 } position;
126
127
128/*!
129 * A 3 element colour with floating point channels.
130 */
132{
133 float r;
134 float g;
135 float b;
136};
137
138/*!
139 * A 3 element HSV colour with floating point channels.
140 * All values are in [0, 1] range, with hue wrapping at 1.
141 */
143{
144 float h;
145 float s;
146 float v;
147};
148
149/*!
150 * Types of reference space.
151 */
153{
154 MND_SPACE_REFERENCE_TYPE_VIEW,
155 MND_SPACE_REFERENCE_TYPE_LOCAL,
156 MND_SPACE_REFERENCE_TYPE_LOCAL_FLOOR,
157 MND_SPACE_REFERENCE_TYPE_STAGE,
158 MND_SPACE_REFERENCE_TYPE_UNBOUNDED,
160
161/*!
162 * Bitflags for IO blocking.
163 *
164 * Bitflags are only to be used here, this should not be used as a template
165 * for future libmonado interfaces.
166 *
167 * Supported in version 1.6.0 and above.
168 */
170{
171 MND_IO_BLOCK_POSES = (1u << 0u),
172 MND_IO_BLOCK_HT = (1u << 1u),
173 MND_IO_BLOCK_INPUTS = (1u << 2u),
174 MND_IO_BLOCK_OUTPUTS = (1u << 3u),
176
177/*!
178 * Types of view configurations.
179 *
180 * Supported in version 1.8.0 and above.
181 */
182typedef enum mnd_view_type
183{
184 //! Invalid view type, no data is here.
186 //! Mono view type, with a single view.
188 //! Stereo view type, with two views.
190 //! Quad view type, with two outer views, and two inset views.
193
194#define MND_MAX_VIEWS 4
195
196/*!
197 * The state of a client's session.
198 *
199 * Supported in version 1.8.0 and above.
200 */
201typedef struct mnd_session_state
202{
203 //! Whether the session is currently running/has been begun.
205 //! The active view type of the running session.
208
209/*!
210 * A view configuration, describing the resolution and sample count of a single view.
211 *
212 * Supported in version 1.8.0 and above.
213 */
215{
216 uint32_t width_pixels;
217 uint32_t height_pixels;
218 uint32_t sample_count;
220
221/*!
222 * A view configuration, describing the resolution and sample count of multiple views.
223 *
224 * Supported in version 1.8.0 and above.
225 */
227{
228 bool valid;
229 mnd_view_config_view_t view_configs[MND_MAX_VIEWS];
231
232/*
233 *
234 * Functions
235 *
236 */
237
238/*!
239 * Returns the version of the API (not Monado itself), follows the versioning
240 * semantics of https://semver.org/ standard. In short if the major version
241 * mismatch then the interface is incompatible.
242 *
243 * @param[out] out_major Major version number, must be valid pointer.
244 * @param[out] out_minor Minor version number, must be valid pointer.
245 * @param[out] out_patch Patch version number, must be valid pointer.
246 *
247 * Always succeeds, or crashes if any pointer isn't valid.
248 */
249void
250mnd_api_get_version(uint32_t *out_major, uint32_t *out_minor, uint32_t *out_patch);
251
252/*!
253 * Create libmonado state and connect to service
254 *
255 * @param[out] out_root Address to populate with the opaque state type.
256 * @return MND_SUCCESS on success
257 */
259mnd_root_create(mnd_root_t **out_root);
260
261/*!
262 * Destroy libmonado state, disconnecting from the service, and zeroing the
263 * pointer.
264 *
265 * @param root_ptr Pointer to your libmonado state. Null-checked, will be set to null.
266 */
267void
268mnd_root_destroy(mnd_root_t **root_ptr);
269
270/*!
271 * Update our local cached copy of the client list
272 *
273 * @param root The libmonado state.
274 * @return MND_SUCCESS on success
275 */
278
279/*!
280 * Get the number of active clients
281 *
282 * This value only changes on calls to @ref mnd_root_update_client_list
283 *
284 * @param root The libmonado state.
285 * @param[out] out_num Pointer to value to populate with the number of clients.
286 *
287 * @pre Called @ref mnd_root_update_client_list at least once
288 *
289 * @return MND_SUCCESS on success
290 */
292mnd_root_get_number_clients(mnd_root_t *root, uint32_t *out_num);
293
294/*!
295 * Get the id from the current client list.
296 *
297 * @param root The libmonado state.
298 * @param index Index to retrieve id for.
299 * @param[out] out_client_id Pointer to value to populate with the id at the given index.
300 */
302mnd_root_get_client_id_at_index(mnd_root_t *root, uint32_t index, uint32_t *out_client_id);
303
304/*!
305 * Get the name of the client at the given index.
306 *
307 * The string returned is only valid until the next call into libmonado.
308 *
309 * @param root The libmonado state.
310 * @param client_id ID of client to retrieve name from.
311 * @param[out] out_name Pointer to populate with the client name.
312 *
313 * @pre Called @ref mnd_root_update_client_list at least once
314 *
315 * @return MND_SUCCESS on success
316 */
318mnd_root_get_client_name(mnd_root_t *root, uint32_t client_id, const char **out_name);
319
320/*!
321 * Get the state flags of the client at the given index.
322 *
323 * This result only changes on calls to @ref mnd_root_update_client_list
324 *
325 * @param root The libmonado state.
326 * @param client_id ID of client to retrieve flags from.
327 * @param[out] out_flags Pointer to populate with the flags, a bitwise combination of @ref mnd_client_flags.
328 *
329 * @pre Called @ref mnd_root_update_client_list at least once
330 *
331 * @return MND_SUCCESS on success
332 */
334mnd_root_get_client_state(mnd_root_t *root, uint32_t client_id, uint32_t *out_flags);
335
336/*!
337 * Set the client at the given index as "primary".
338 *
339 * @param root The libmonado state.
340 * @param client_id ID of the client set as primary.
341 *
342 * @pre Called @ref mnd_root_update_client_list at least once
343 *
344 * @return MND_SUCCESS on success
345 */
347mnd_root_set_client_primary(mnd_root_t *root, uint32_t client_id);
348
349/*!
350 * Set the client at the given index as "focused".
351 *
352 * @param root The libmonado state.
353 * @param client_id ID of the client set as focused.
354 *
355 * @pre Called @ref mnd_root_update_client_list at least once
356 *
357 * @return MND_SUCCESS on success
358 */
360mnd_root_set_client_focused(mnd_root_t *root, uint32_t client_id);
361
362/*!
363 * Toggle io activity for the client at the given index.
364 *
365 * @deprecated Deprecated in version 1.6.
366 *
367 * @param root The libmonado state.
368 * @param client_id ID of the client to toggle IO for.
369 *
370 * @pre Called @ref mnd_root_update_client_list at least once
371 *
372 * @return MND_SUCCESS on success
373 */
375mnd_root_toggle_client_io_active(mnd_root_t *root, uint32_t client_id);
376
377/*!
378 * Block certain types of IO for the client at the given index.
379 *
380 * Supported in version 1.6 and above.
381 *
382 * @param root The libmonado state.
383 * @param client_id ID of the client to block IO for.
384 * @param block_flags Which types of IO to block.
385 */
387mnd_root_set_client_io_blocks(mnd_root_t *root, uint32_t client_id, mnd_io_block_flags_t block_flags);
388
389/*!
390 * Get the session state for the client at the given index.
391 *
392 * Supported in version 1.8 and above.
393 *
394 * @param root The libmonado state.
395 * @param client_id ID of client to retrieve active view type from.
396 * @param[out] out_session_state Pointer to populate with the session state.
397 *
398 * @pre Called @ref mnd_root_update_client_list at least once
399 *
400 * @return MND_SUCCESS on success
401 */
403mnd_root_get_client_session_running_state(mnd_root_t *root, uint32_t client_id, mnd_session_state_t *out_session_state);
404
405/*!
406 * Get the view configurations of the client's first system. Returns the default and the recommended view configuration,
407 * if available.
408 *
409 * Supported in version 1.8 and above.
410 *
411 * @param root The libmonado state.
412 * @param client_id ID of the client to get the view configuration for.
413 * @param view_type The type of view configuration to retrieve.
414 * @param[out] out_default_view_config Pointer to populate with the default view configuration. Must point to at
415 * least the number of views as is contained within the passed view type.
416 * @param[out] recommendation_present Pointer to populate with whether a recommended view configuration is present.
417 * @param[out] out_recommended_view_config Pointer to populate with the recommended view configuration.
418 * Must point to at least the number of views as is contained within the
419 * passed view type.
420 *
421 * @pre Called @ref mnd_root_update_client_list at least once
422 *
423 * @return MND_SUCCESS on success
424 */
427 uint32_t client_id,
428 mnd_view_type_t view_type,
429 mnd_view_config_view_t *out_default_view_config,
430 mnd_recommended_view_config_t *out_recommended_view_config);
431
432/*!
433 * Set the recommended view configuration for a client's first system.
434 *
435 * Supported in version 1.8 and above.
436 *
437 * @param root The libmonado state.
438 * @param client_id ID of the client to set the recommended view configuration for.
439 * @param view_type The type of view configuration to set.
440 * @param recommended_view_config The view configuration to set as recommended. Must point to at least the number of
441 * views as is contained within the passed view type.
442 *
443 * @pre Called @ref mnd_root_update_client_list at least once
444 *
445 * @return MND_SUCCESS on success, MND_ERROR_UNSUPPORTED_OPERATION if the client doesn't support changing the
446 * recommended view configuration
447 */
450 uint32_t client_id,
451 mnd_view_type_t view_type,
452 const mnd_recommended_view_config_t *recommended_view_config);
453
454/*!
455 * Get boolean property for the client at the given index.
456 *
457 * Supported in version 1.8.0 and above.
458 *
459 * @param root The libmonado state.
460 * @param client_index Index of client to retrieve property from.
461 * @param prop A boolean property enum.
462 * @param[out] out_bool Pointer to populate with the boolean.
463 *
464 * @return MND_SUCCESS on success
465 */
467mnd_root_get_client_property_bool(mnd_root_t *root, uint32_t client_id, mnd_property_t prop, bool *out_bool);
468
469/*!
470 * Get the number of devices
471 *
472 * @param root The libmonado state.
473 * @param[out] out_device_count Pointer to value to populate with the number of devices.
474 *
475 * @return MND_SUCCESS on success
476 */
478mnd_root_get_device_count(mnd_root_t *root, uint32_t *out_device_count);
479
480/*!
481 * Get boolean property for the device at the given index.
482 *
483 * Supported in version 1.2 and above.
484 *
485 * @param root The libmonado state.
486 * @param device_index Index of device to retrieve name from.
487 * @param prop A boolean property enum.
488 * @param[out] out_bool Pointer to populate with the boolean.
489 *
490 * @return MND_SUCCESS on success
491 */
493mnd_root_get_device_info_bool(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, bool *out_bool);
494
495/*!
496 * Get int32_t property for the device at the given index.
497 *
498 * Supported in version 1.2 and above.
499 *
500 * @param root The libmonado state.
501 * @param device_index Index of device to retrieve name from.
502 * @param prop A int32_t property enum.
503 * @param[out] out_i32 Pointer to populate with the int32_t.
504 *
505 * @return MND_SUCCESS on success
506 */
508mnd_root_get_device_info_i32(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, uint32_t *out_i32);
509
510/*!
511 * Get uint32_t property for the device at the given index.
512 *
513 * Supported in version 1.2 and above.
514 *
515 * @param root The libmonado state.
516 * @param device_index Index of device to retrieve name from.
517 * @param prop A uint32_t property enum.
518 * @param[out] out_u32 Pointer to populate with the uint32_t.
519 *
520 * @return MND_SUCCESS on success
521 */
523mnd_root_get_device_info_u32(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, uint32_t *out_u32);
524
525/*!
526 * Get float property for the device at the given index.
527 *
528 * Supported in version 1.2 and above.
529 *
530 * @param root The libmonado state.
531 * @param device_index Index of device to retrieve name from.
532 * @param prop A float property enum.
533 * @param[out] out_float Pointer to populate with the float.
534 *
535 * @return MND_SUCCESS on success
536 */
538mnd_root_get_device_info_float(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, float *out_float);
539
540/*!
541 * Get string property for the device at the given index.
542 *
543 * Supported in version 1.2 and above.
544 *
545 * @param root The libmonado state.
546 * @param device_index Index of device to retrieve name from.
547 * @param prop A string property enum.
548 * @param[out] out_string Pointer to populate with the string.
549 *
550 * @return MND_SUCCESS on success
551 */
553mnd_root_get_device_info_string(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, const char **out_string);
554
555/*!
556 * Get device info at the given index.
557 *
558 * @deprecated Deprecated in version 1.2, scheduled for removal in version 2.0.0 currently.
559 *
560 * @param root The libmonado state.
561 * @param device_index Index of device to retrieve name from.
562 * @param[out] out_device_id Pointer to value to populate with the device id at the given index.
563 * @param[out] out_dev_name Pointer to populate with the device name.
564 *
565 * @return MND_SUCCESS on success
566 */
568mnd_root_get_device_info(mnd_root_t *root, uint32_t device_index, uint32_t *out_device_id, const char **out_dev_name);
569
570/*!
571 * Get the device index associated for a given role name.
572 *
573 *
574 * @param root The libmonado state.
575 * @param role_name Name of the role. Possible values are:
576 * - "head"
577 * - "left"
578 * - "right"
579 * - "gamepad"
580 * - "eyes"
581 * - "hand-tracking-unobstructed-[left|right]"
582 * - "hand-tracking-conforming-[left|right]"
583 *
584 * **DEPRECATED**: The role names "hand-tracking-[left|right]"
585 * are deprecated as of v1.5. They now map to
586 * "hand-tracking-unobstructed-[left|right]" and are
587 * scheduled for removal in v2.0.
588 *
589 * @param[out] out_index Pointer to value to populate with the device index
590 * associated with given role name, -1 if not role is set.
591 *
592 * @return MND_SUCCESS on success
593 */
595mnd_root_get_device_from_role(mnd_root_t *root, const char *role_name, int32_t *out_index);
596
597/*!
598 * Trigger a recenter of the local spaces.
599 *
600 * Supported in version 1.1 and above.
601 *
602 * @param root The libmonado state.
603 *
604 * @return MND_SUCCESS on success
605 */
608
609/*!
610 * Get the current offset value of the specified reference space.
611 *
612 * Supported in version 1.3 and above.
613 *
614 * @param root The libmonado state.
615 * @param type The reference space.
616 * @param[out] out_offset A pointer to where the offset should be written.
617 *
618 * @return MND_SUCCESS on success
619 */
622
623/*!
624 * Apply an offset to the specified reference space.
625 *
626 * Supported in version 1.3 and above.
627 *
628 * @param root The libmonado state.
629 * @param type The reference space.
630 * @param offset A pointer to valid xrt_pose.
631 *
632 * @return MND_SUCCESS on success
633 */
636
637/*!
638 * Read the current offset of a tracking origin.
639 *
640 * Supported in version 1.3 and above.
641 *
642 * @param root The libmonado state.
643 * @param origin_index The index of the tracking origin into the internal list.
644 * @param[out] out_offset A pointer to where the offset should be written.
645 *
646 * @return MND_SUCCESS on success
647 */
649mnd_root_get_tracking_origin_offset(mnd_root_t *root, uint32_t origin_index, mnd_pose_t *out_offset);
650
651/*!
652 * Apply an offset to the specified tracking origin.
653 *
654 * Supported in version 1.3 and above.
655 *
656 * @param root The libmonado state.
657 * @param origin_index The index of the tracking origin into the internal list.
658 * @param offset A pointer to valid xrt_pose.
659 *
660 * @return MND_SUCCESS on success
661 */
663mnd_root_set_tracking_origin_offset(mnd_root_t *root, uint32_t origin_index, const mnd_pose_t *offset);
664
665/*!
666 * Retrieve the number of tracking origins available.
667 *
668 * Supported in version 1.3 and above.
669 *
670 * @param root The libmonado state.
671 * @param out_track_count Pointer to where the count should be written.
672 *
673 * @return MND_SUCCESS on success
674 */
676mnd_root_get_tracking_origin_count(mnd_root_t *root, uint32_t *out_track_count);
677
678/*!
679 * Retrieve the name of the indicated tracking origin.
680 *
681 * Supported in version 1.3 and above.
682 *
683 * @param root The libmonado state.
684 * @param origin_index The index of the tracking origin into the internal list.
685 * @param out_string The pointer to write the name's pointer to.
686 *
687 * @return MND_SUCCESS on success
688 */
690mnd_root_get_tracking_origin_name(mnd_root_t *root, uint32_t origin_index, const char **out_string);
691
692/*!
693 * Get battery status of a device.
694 *
695 * @param root The libmonado state.
696 * @param device_index Index of device to retrieve battery info from.
697 * @param[out] out_present Pointer to value to populate with whether the device provides battery status info.
698 * @param[out] out_charging Pointer to value to populate with whether the device is currently being charged.
699 * @param[out] out_charge Pointer to value to populate with the battery charge as a value between 0 and 1.
700 *
701 * @return MND_SUCCESS on success
702 */
705 mnd_root_t *root, uint32_t device_index, bool *out_present, bool *out_charging, float *out_charge);
706
707/*!
708 * Get current brightness of a display device.
709 *
710 * @param root The libmonado state.
711 * @param device_index Index of device to retrieve brightness from.
712 * @param[out] out_brightness Pointer to value to populate with the current device brightness, where 0 is 0%, and 1 is
713 * 100%.
714 *
715 * @return MND_SUCCESS on success
716 */
718mnd_root_get_device_brightness(mnd_root_t *root, uint32_t device_index, float *out_brightness);
719
720/*!
721 * @brief Set the display brightness.
722 *
723 * @param root The libmonado state.
724 * @param device_index Index of device to retrieve battery info from.
725 * @param[in] brightness Desired display brightness, usually between 0 and 1. Some devices may
726 * allow exceeding 1 if the supported range exceeds 100%, but it will be clamped to
727 * the supported range.
728 * @param[in] relative Whether to add \a brightness to the current brightness, instead of overwriting
729 * the current brightness.
730 *
731 * @return MND_SUCCESS on success
732 */
734mnd_root_set_device_brightness(mnd_root_t *root, uint32_t device_index, float brightness, bool relative);
735
736/*!
737 * Set the chroma key parameters to be applied to the base application (if there is any).
738 *
739 * HSV values are in [0, 1] range. Hue wrapping is supported (min > max spans across 0).
740 * Set curve to 0 to disable chroma keying.
741 *
742 * @param root The libmonado state.
743 * @param hsv_min Minimum HSV bounds (hue, saturation, value).
744 * @param hsv_max Maximum HSV bounds (hue, saturation, value).
745 * @param curve Power curve for alpha falloff (1.0 = linear, <1 = softer, >1 = harder, 0 = disabled).
746 * @param despill Despill strength (0.0 = none, 1.0 = full desaturation near key color).
747 *
748 * @return MND_SUCCESS on success
749 */
752 mnd_root_t *root, struct mnd_colour_hsv hsv_min, struct mnd_colour_hsv hsv_max, float curve, float despill);
753
754#ifdef __cplusplus
755}
756#endif
struct mnd_session_state mnd_session_state_t
The state of a client's session.
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:864
mnd_result_t mnd_root_get_client_system_view_config(mnd_root_t *root, uint32_t client_id, mnd_view_type_t view_type, mnd_view_config_view_t *out_default_view_config, mnd_recommended_view_config_t *out_recommended_view_config)
Get the view configurations of the client's first system.
Definition monado.c:465
mnd_result_t mnd_root_create(mnd_root_t **out_root)
Create libmonado state and connect to service.
Definition monado.c:227
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:610
struct mnd_recommended_view_config mnd_recommended_view_config_t
A view configuration, describing the resolution and sample count of multiple views.
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:678
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:212
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:345
mnd_result_t mnd_root_set_chroma_key_params(mnd_root_t *root, struct mnd_colour_hsv hsv_min, struct mnd_colour_hsv hsv_max, float curve, float despill)
Set the chroma key parameters to be applied to the base application (if there is any).
Definition monado.c:946
mnd_result_t mnd_root_get_client_property_bool(mnd_root_t *root, uint32_t client_id, mnd_property_t prop, bool *out_bool)
Get boolean property for the client at the given index.
Definition monado.c:578
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:788
mnd_property
A property to get from an object.
Definition monado.h:82
@ MND_PROPERTY_SUPPORTS_VIEW_CONFIGURATION_CHANGE_BOOL
Supported in version 1.8.0 and above. Supported by clients.
Definition monado.h:104
@ MND_PROPERTY_SUPPORTS_POSITION_BOOL
Supported in version 1.4.0 and above. Supported by devices.
Definition monado.h:95
@ MND_PROPERTY_SUPPORTS_BRIGHTNESS_BOOL
Supported in version 1.5.0 and above. Supported by devices.
Definition monado.h:101
@ MND_PROPERTY_NAME_STRING
Supported in version 1.2 and above. Supported by devices.
Definition monado.h:86
@ MND_PROPERTY_SUPPORTS_ORIENTATION_BOOL
Supported in version 1.4.0 and above. Supported by devices.
Definition monado.h:98
@ MND_PROPERTY_TRACKING_ORIGIN_U32
Supported in version 1.4.0 and above. Supported by devices.
Definition monado.h:92
@ MND_PROPERTY_SERIAL_STRING
Supported in version 1.2 and above. Supported by devices.
Definition monado.h:89
void mnd_root_destroy(mnd_root_t **root_ptr)
Destroy libmonado state, disconnecting from the service, and zeroing the pointer.
Definition monado.c:272
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:328
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:878
enum mnd_view_type mnd_view_type_t
Types of view configurations.
mnd_result_t mnd_root_recenter_local_spaces(mnd_root_t *root)
Trigger a recenter of the local spaces.
Definition monado.c:776
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:711
mnd_result_t mnd_root_get_client_session_running_state(mnd_root_t *root, uint32_t client_id, mnd_session_state_t *out_session_state)
Get the session state for the client at the given index.
Definition monado.c:441
enum mnd_io_block_flags mnd_io_block_flags_t
Bitflags for IO blocking.
mnd_result_t mnd_root_set_client_recommended_view_config(mnd_root_t *root, uint32_t client_id, mnd_view_type_t view_type, const mnd_recommended_view_config_t *recommended_view_config)
Set the recommended view configuration for a client's first system.
Definition monado.c:527
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:153
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:629
mnd_view_type
Types of view configurations.
Definition monado.h:183
@ MND_VIEW_TYPE_STEREO
Stereo view type, with two views.
Definition monado.h:189
@ MND_VIEW_TYPE_QUAD
Quad view type, with two outer views, and two inset views.
Definition monado.h:191
@ MND_VIEW_TYPE_MONO
Mono view type, with a single view.
Definition monado.h:187
@ MND_VIEW_TYPE_INVALID
Invalid view type, no data is here.
Definition monado.h:185
mnd_result_t mnd_root_update_client_list(mnd_root_t *root)
Update our local cached copy of the client list.
Definition monado.c:292
struct mnd_view_config_view mnd_view_config_view_t
A view configuration, describing the resolution and sample count of a single view.
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:801
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:834
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:317
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:391
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:925
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:406
mnd_io_block_flags
Bitflags for IO blocking.
Definition monado.h:170
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:599
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:696
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:376
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:815
enum mnd_property mnd_property_t
A property to get from an object.
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:641
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:903
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:306
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:666
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:421
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:853
A 3 element HSV colour with floating point channels.
Definition monado.h:143
A 3 element colour with floating point channels.
Definition monado.h:132
A pose composed of a position and orientation.
Definition monado.h:116
Definition monado.c:33
The state of a client's session.
Definition monado.h:202
mnd_view_type_t active_view_type
The active view type of the running session.
Definition monado.h:206
bool running
Whether the session is currently running/has been begun.
Definition monado.h:204
A view configuration, describing the resolution and sample count of a single view.
Definition monado.h:215