Skip to content

Commit

Permalink
Merge pull request #999 from pbor/shared-boxed-has-param-spec
Browse files Browse the repository at this point in the history
Derive HasParamSpec for SharedBoxed
  • Loading branch information
sdroege authored Feb 15, 2023
2 parents f7e2aec + c345668 commit a635857
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions glib-macros/src/shared_boxed_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,15 @@ pub fn impl_shared_boxed(input: &syn::DeriveInput) -> proc_macro2::TokenStream {
}
}
}

impl #crate_ident::HasParamSpec for #name {
type ParamSpec = #crate_ident::ParamSpecBoxed;
type SetValue = Self;
type BuilderFn = fn(&str) -> #crate_ident::ParamSpecBoxedBuilder<Self>;

fn param_spec_builder() -> Self::BuilderFn {
|name| Self::ParamSpec::builder(name)
}
}
}
}

0 comments on commit a635857

Please sign in to comment.