From 145664ec0d7906ef08ec9933ca2cb94ab80fc04f Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 15 Apr 2023 10:06:00 -0400 Subject: [PATCH] miniobject: Implement the HasParamSpec trait in the macro Part-of: --- gstreamer/src/miniobject.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gstreamer/src/miniobject.rs b/gstreamer/src/miniobject.rs index 71f7bea29..6b42a0cb0 100644 --- a/gstreamer/src/miniobject.rs +++ b/gstreamer/src/miniobject.rs @@ -608,6 +608,16 @@ macro_rules! mini_object_wrapper ( // Can't have SetValue/SetValueOptional impls as otherwise one could use it to get // immutable references from a mutable reference without borrowing via the value + + impl $crate::glib::HasParamSpec for $name { + type ParamSpec = $crate::glib::ParamSpecBoxed; + type SetValue = Self; + type BuilderFn = fn(&str) -> $crate::glib::ParamSpecBoxedBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + |name| Self::ParamSpec::builder(name) + } + } }; );