From c8bb2009f2dbfda6f5ad4548f905303430352b98 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 15 Nov 2023 15:24:59 +0000 Subject: [PATCH] xrt: Tidy xrt_device [NFC] --- src/xrt/include/xrt/xrt_device.h | 44 ++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/src/xrt/include/xrt/xrt_device.h b/src/xrt/include/xrt/xrt_device.h index 8bd0849f2..6f0c86313 100644 --- a/src/xrt/include/xrt/xrt_device.h +++ b/src/xrt/include/xrt/xrt_device.h @@ -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"