@@ -32,6 +32,14 @@ impl ZlibCompressor {
32
32
unsafe { from_glib_none ( ffi:: g_zlib_compressor_get_file_info ( self . to_glib_none ( ) . 0 ) ) }
33
33
}
34
34
35
+ #[ cfg( feature = "v2_86" ) ]
36
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_86" ) ) ) ]
37
+ #[ doc( alias = "g_zlib_compressor_get_os" ) ]
38
+ #[ doc( alias = "get_os" ) ]
39
+ pub fn os ( & self ) -> i32 {
40
+ unsafe { ffi:: g_zlib_compressor_get_os ( self . to_glib_none ( ) . 0 ) }
41
+ }
42
+
35
43
#[ doc( alias = "g_zlib_compressor_set_file_info" ) ]
36
44
#[ doc( alias = "file-info" ) ]
37
45
pub fn set_file_info ( & self , file_info : Option < & FileInfo > ) {
@@ -40,6 +48,16 @@ impl ZlibCompressor {
40
48
}
41
49
}
42
50
51
+ #[ cfg( feature = "v2_86" ) ]
52
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_86" ) ) ) ]
53
+ #[ doc( alias = "g_zlib_compressor_set_os" ) ]
54
+ #[ doc( alias = "os" ) ]
55
+ pub fn set_os ( & self , os : i32 ) {
56
+ unsafe {
57
+ ffi:: g_zlib_compressor_set_os ( self . to_glib_none ( ) . 0 , os) ;
58
+ }
59
+ }
60
+
43
61
pub fn format ( & self ) -> ZlibCompressorFormat {
44
62
ObjectExt :: property ( self , "format" )
45
63
}
@@ -70,4 +88,29 @@ impl ZlibCompressor {
70
88
)
71
89
}
72
90
}
91
+
92
+ #[ cfg( feature = "v2_86" ) ]
93
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v2_86" ) ) ) ]
94
+ #[ doc( alias = "os" ) ]
95
+ pub fn connect_os_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
96
+ unsafe extern "C" fn notify_os_trampoline < F : Fn ( & ZlibCompressor ) + ' static > (
97
+ this : * mut ffi:: GZlibCompressor ,
98
+ _param_spec : glib:: ffi:: gpointer ,
99
+ f : glib:: ffi:: gpointer ,
100
+ ) {
101
+ let f: & F = & * ( f as * const F ) ;
102
+ f ( & from_glib_borrow ( this) )
103
+ }
104
+ unsafe {
105
+ let f: Box_ < F > = Box_ :: new ( f) ;
106
+ connect_raw (
107
+ self . as_ptr ( ) as * mut _ ,
108
+ c"notify::os" . as_ptr ( ) as * const _ ,
109
+ Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > (
110
+ notify_os_trampoline :: < F > as * const ( ) ,
111
+ ) ) ,
112
+ Box_ :: into_raw ( f) ,
113
+ )
114
+ }
115
+ }
73
116
}
0 commit comments