Skip to content

Commit a635857

Browse files
authored
Merge pull request #999 from pbor/shared-boxed-has-param-spec
Derive HasParamSpec for SharedBoxed
2 parents f7e2aec + c345668 commit a635857

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

glib-macros/src/shared_boxed_derive.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,5 +274,15 @@ pub fn impl_shared_boxed(input: &syn::DeriveInput) -> proc_macro2::TokenStream {
274274
}
275275
}
276276
}
277+
278+
impl #crate_ident::HasParamSpec for #name {
279+
type ParamSpec = #crate_ident::ParamSpecBoxed;
280+
type SetValue = Self;
281+
type BuilderFn = fn(&str) -> #crate_ident::ParamSpecBoxedBuilder<Self>;
282+
283+
fn param_spec_builder() -> Self::BuilderFn {
284+
|name| Self::ParamSpec::builder(name)
285+
}
286+
}
277287
}
278288
}

0 commit comments

Comments
 (0)