xrt: Tidy xrt_device [NFC]

This commit is contained in:
Jakob Bornecrantz 2023-11-15 15:24:59 +00:00
parent eabaf6e7d6
commit c8bb2009f2

View file

@ -264,6 +264,13 @@ struct xrt_device
bool force_feedback_supported;
bool form_factor_check_supported;
/*
*
* Functions.
*
*/
/*!
* Update any attached inputs.
*
@ -410,11 +417,6 @@ struct xrt_device
uint32_t view_index,
struct xrt_visibility_mask **out_mask);
/*!
* Destroy device.
*/
void (*destroy)(struct xrt_device *xdev);
/*!
* @brief Check if given form factor is available or not.
*
@ -426,6 +428,13 @@ struct xrt_device
* @return true if given form factor is available; otherwise false.
*/
bool (*is_form_factor_available)(struct xrt_device *xdev, enum xrt_form_factor form_factor);
/*!
* Destroy device.
*/
void (*destroy)(struct xrt_device *xdev);
// Add new functions above destroy.
};
/*!
@ -536,6 +545,19 @@ xrt_device_get_visibility_mask(struct xrt_device *xdev,
return xdev->get_visibility_mask(xdev, type, view_index, out_mask);
}
/*!
* Helper function for @ref xrt_device::is_form_factor_available.
*
* @copydoc xrt_device::is_form_factor_available
*
* @public @memberof xrt_device
*/
static inline bool
xrt_device_is_form_factor_available(struct xrt_device *xdev, enum xrt_form_factor form_factor)
{
return xdev->is_form_factor_available(xdev, form_factor);
}
/*!
* Helper function for @ref xrt_device::destroy.
*
@ -555,18 +577,6 @@ xrt_device_destroy(struct xrt_device **xdev_ptr)
*xdev_ptr = NULL;
}
/*!
* Helper function for @ref xrt_device::is_form_factor_available.
*
* @copydoc xrt_device::is_form_factor_available
*
* @public @memberof xrt_device
*/
static inline bool
xrt_device_is_form_factor_available(struct xrt_device *xdev, enum xrt_form_factor form_factor)
{
return xdev->is_form_factor_available(xdev, form_factor);
}
#ifdef __cplusplus
} // extern "C"