From 656dc990f89cf45cd9f2f75551246426c513196d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 19 Nov 2017 19:40:13 +0200 Subject: [PATCH] Require a get_type() function for boxed/object properties Otherwise storing the properties in a static array is not possible --- gst-plugin/src/properties.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gst-plugin/src/properties.rs b/gst-plugin/src/properties.rs index cc551ce5..a0063f7c 100644 --- a/gst-plugin/src/properties.rs +++ b/gst-plugin/src/properties.rs @@ -88,8 +88,8 @@ pub enum Property<'a> { Option<&'a str>, PropertyMutability, ), - Boxed(&'a str, &'a str, &'a str, glib::Type, PropertyMutability), - Object(&'a str, &'a str, &'a str, glib::Type, PropertyMutability), + Boxed(&'a str, &'a str, &'a str, fn() -> glib::Type, PropertyMutability), + Object(&'a str, &'a str, &'a str, fn() -> glib::Type, PropertyMutability), } impl<'a> Into<*mut gobject_ffi::GParamSpec> for &'a Property<'a> { @@ -180,21 +180,21 @@ impl<'a> Into<*mut gobject_ffi::GParamSpec> for &'a Property<'a> { mutability.into(), ) } - Property::Boxed(name, nick, description, type_, mutability) => { + Property::Boxed(name, nick, description, get_type, mutability) => { gobject_ffi::g_param_spec_boxed( name.to_glib_none().0, nick.to_glib_none().0, description.to_glib_none().0, - type_.to_glib(), + get_type().to_glib(), mutability.into(), ) } - Property::Object(name, nick, description, type_, mutability) => { + Property::Object(name, nick, description, get_type, mutability) => { gobject_ffi::g_param_spec_object( name.to_glib_none().0, nick.to_glib_none().0, description.to_glib_none().0, - type_.to_glib(), + get_type().to_glib(), mutability.into(), ) }