diff --git a/src/libratbag.c b/src/libratbag.c index 3c6f4c7e..1ee7d421 100644 --- a/src/libratbag.c +++ b/src/libratbag.c @@ -825,6 +825,12 @@ ratbag_profile_is_active(struct ratbag_profile *profile) return !!profile->is_active; } +LIBRATBAG_EXPORT bool +ratbag_profile_is_dirty(const struct ratbag_profile *profile) +{ + return !!profile->dirty; +} + LIBRATBAG_EXPORT bool ratbag_profile_is_enabled(const struct ratbag_profile *profile) { diff --git a/src/libratbag.h b/src/libratbag.h index 08566380..53cf5316 100644 --- a/src/libratbag.h +++ b/src/libratbag.h @@ -702,6 +702,19 @@ ratbag_device_get_profile(struct ratbag_device *device, unsigned int index); bool ratbag_profile_is_active(struct ratbag_profile *profile); +/** + * @ingroup profile + * + * Check if the given profile is dirty, that is, the device needs committing + * after having configuration changes. + * + * @param profile A previously initialized ratbag profile + * + * @return non-zero if the profile is dirty, zero otherwise + */ +bool +ratbag_profile_is_dirty(const struct ratbag_profile *profile); + /** * @ingroup profile *