@@ -53,6 +53,23 @@ unsafe impl<'a> crate::value::FromValue<'a> for ParamSpec {
53
53
}
54
54
}
55
55
56
+ #[ doc( hidden) ]
57
+ unsafe impl < ' a > crate :: value:: FromValue < ' a > for & ' a ParamSpec {
58
+ type Checker = crate :: value:: GenericValueTypeOrNoneChecker < Self > ;
59
+
60
+ unsafe fn from_value ( value : & ' a crate :: Value ) -> Self {
61
+ assert_eq ! (
62
+ std:: mem:: size_of:: <Self >( ) ,
63
+ std:: mem:: size_of:: <crate :: ffi:: gpointer>( )
64
+ ) ;
65
+ let value = & * ( value as * const crate :: Value as * const crate :: gobject_ffi:: GValue ) ;
66
+ let ptr = & value. data [ 0 ] . v_pointer as * const crate :: ffi:: gpointer
67
+ as * const * const gobject_ffi:: GParamSpec ;
68
+ assert ! ( !( * ptr) . is_null( ) ) ;
69
+ & * ( ptr as * const ParamSpec )
70
+ }
71
+ }
72
+
56
73
#[ doc( hidden) ]
57
74
impl crate :: value:: ToValue for ParamSpec {
58
75
fn to_value ( & self ) -> crate :: Value {
@@ -274,6 +291,19 @@ macro_rules! define_param_spec {
274
291
}
275
292
}
276
293
294
+ #[ doc( hidden) ]
295
+ unsafe impl <' a> crate :: value:: FromValue <' a> for & ' a $rust_type {
296
+ type Checker = crate :: value:: GenericValueTypeOrNoneChecker <Self >;
297
+
298
+ unsafe fn from_value( value: & ' a crate :: Value ) -> Self {
299
+ assert_eq!( std:: mem:: size_of:: <Self >( ) , std:: mem:: size_of:: <crate :: ffi:: gpointer>( ) ) ;
300
+ let value = & * ( value as * const crate :: Value as * const crate :: gobject_ffi:: GValue ) ;
301
+ let ptr = & value. data[ 0 ] . v_pointer as * const crate :: ffi:: gpointer as * const * const gobject_ffi:: GParamSpec ;
302
+ assert!( !( * ptr) . is_null( ) ) ;
303
+ & * ( ptr as * const $rust_type)
304
+ }
305
+ }
306
+
277
307
#[ doc( hidden) ]
278
308
impl crate :: value:: ToValue for $rust_type {
279
309
fn to_value( & self ) -> crate :: Value {
0 commit comments