1
1
// This file was generated by gir (https://github.com/gtk-rs/gir)
2
- // from
2
+ // from
3
3
// from gir-files (https://github.com/gtk-rs/gir-files.git)
4
4
// DO NOT EDIT
5
5
6
- use crate :: { ffi, AnimationState , AnimationTarget } ;
7
- use glib:: { prelude:: * , signal:: { connect_raw, SignalHandlerId } , translate:: * } ;
8
- use std:: { boxed:: Box as Box_ } ;
6
+ use crate :: { ffi, AnimationState , AnimationTarget } ;
7
+ use glib:: {
8
+ prelude:: * ,
9
+ signal:: { connect_raw, SignalHandlerId } ,
10
+ translate:: * ,
11
+ } ;
12
+ use std:: boxed:: Box as Box_ ;
9
13
10
14
glib:: wrapper! {
11
15
#[ doc( alias = "HeAnimation" ) ]
@@ -17,8 +21,7 @@ glib::wrapper! {
17
21
}
18
22
19
23
impl Animation {
20
- pub const NONE : Option < & ' static Animation > = None ;
21
-
24
+ pub const NONE : Option < & ' static Animation > = None ;
22
25
}
23
26
24
27
mod sealed {
@@ -64,24 +67,18 @@ pub trait AnimationExt: IsA<Animation> + sealed::Sealed + 'static {
64
67
65
68
#[ doc( alias = "he_animation_estimate_duration" ) ]
66
69
fn estimate_duration ( & self ) -> u32 {
67
- unsafe {
68
- ffi:: he_animation_estimate_duration ( self . as_ref ( ) . to_glib_none ( ) . 0 )
69
- }
70
+ unsafe { ffi:: he_animation_estimate_duration ( self . as_ref ( ) . to_glib_none ( ) . 0 ) }
70
71
}
71
72
72
73
#[ doc( alias = "he_animation_calculate_value" ) ]
73
74
fn calculate_value ( & self , t : u32 ) -> f64 {
74
- unsafe {
75
- ffi:: he_animation_calculate_value ( self . as_ref ( ) . to_glib_none ( ) . 0 , t)
76
- }
75
+ unsafe { ffi:: he_animation_calculate_value ( self . as_ref ( ) . to_glib_none ( ) . 0 , t) }
77
76
}
78
77
79
78
#[ doc( alias = "he_animation_get_state" ) ]
80
79
#[ doc( alias = "get_state" ) ]
81
80
fn state ( & self ) -> AnimationState {
82
- unsafe {
83
- from_glib ( ffi:: he_animation_get_state ( self . as_ref ( ) . to_glib_none ( ) . 0 ) )
84
- }
81
+ unsafe { from_glib ( ffi:: he_animation_get_state ( self . as_ref ( ) . to_glib_none ( ) . 0 ) ) }
85
82
}
86
83
87
84
#[ doc( alias = "he_animation_set_state" ) ]
@@ -94,39 +91,39 @@ pub trait AnimationExt: IsA<Animation> + sealed::Sealed + 'static {
94
91
#[ doc( alias = "he_animation_get_target" ) ]
95
92
#[ doc( alias = "get_target" ) ]
96
93
fn target ( & self ) -> AnimationTarget {
97
- unsafe {
98
- from_glib_none ( ffi:: he_animation_get_target ( self . as_ref ( ) . to_glib_none ( ) . 0 ) )
99
- }
94
+ unsafe { from_glib_none ( ffi:: he_animation_get_target ( self . as_ref ( ) . to_glib_none ( ) . 0 ) ) }
100
95
}
101
96
102
97
#[ doc( alias = "he_animation_set_target" ) ]
103
98
fn set_target ( & self , value : & impl IsA < AnimationTarget > ) {
104
99
unsafe {
105
- ffi:: he_animation_set_target ( self . as_ref ( ) . to_glib_none ( ) . 0 , value. as_ref ( ) . to_glib_none ( ) . 0 ) ;
100
+ ffi:: he_animation_set_target (
101
+ self . as_ref ( ) . to_glib_none ( ) . 0 ,
102
+ value. as_ref ( ) . to_glib_none ( ) . 0 ,
103
+ ) ;
106
104
}
107
105
}
108
106
109
107
#[ doc( alias = "he_animation_get_widget" ) ]
110
108
#[ doc( alias = "get_widget" ) ]
111
109
fn widget ( & self ) -> gtk:: Widget {
112
- unsafe {
113
- from_glib_none ( ffi:: he_animation_get_widget ( self . as_ref ( ) . to_glib_none ( ) . 0 ) )
114
- }
110
+ unsafe { from_glib_none ( ffi:: he_animation_get_widget ( self . as_ref ( ) . to_glib_none ( ) . 0 ) ) }
115
111
}
116
112
117
113
#[ doc( alias = "he_animation_set_widget" ) ]
118
114
fn set_widget ( & self , value : & impl IsA < gtk:: Widget > ) {
119
115
unsafe {
120
- ffi:: he_animation_set_widget ( self . as_ref ( ) . to_glib_none ( ) . 0 , value. as_ref ( ) . to_glib_none ( ) . 0 ) ;
116
+ ffi:: he_animation_set_widget (
117
+ self . as_ref ( ) . to_glib_none ( ) . 0 ,
118
+ value. as_ref ( ) . to_glib_none ( ) . 0 ,
119
+ ) ;
121
120
}
122
121
}
123
122
124
123
#[ doc( alias = "he_animation_get_avalue" ) ]
125
124
#[ doc( alias = "get_avalue" ) ]
126
125
fn avalue ( & self ) -> f64 {
127
- unsafe {
128
- ffi:: he_animation_get_avalue ( self . as_ref ( ) . to_glib_none ( ) . 0 )
129
- }
126
+ unsafe { ffi:: he_animation_get_avalue ( self . as_ref ( ) . to_glib_none ( ) . 0 ) }
130
127
}
131
128
132
129
#[ doc( alias = "he_animation_set_avalue" ) ]
@@ -138,66 +135,115 @@ pub trait AnimationExt: IsA<Animation> + sealed::Sealed + 'static {
138
135
139
136
#[ doc( alias = "done" ) ]
140
137
fn connect_done < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
141
- unsafe extern "C" fn done_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > ( this : * mut ffi:: HeAnimation , f : glib:: ffi:: gpointer ) {
138
+ unsafe extern "C" fn done_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > (
139
+ this : * mut ffi:: HeAnimation ,
140
+ f : glib:: ffi:: gpointer ,
141
+ ) {
142
142
let f: & F = & * ( f as * const F ) ;
143
143
f ( Animation :: from_glib_borrow ( this) . unsafe_cast_ref ( ) )
144
144
}
145
145
unsafe {
146
146
let f: Box_ < F > = Box_ :: new ( f) ;
147
- connect_raw ( self . as_ptr ( ) as * mut _ , b"done\0 " . as_ptr ( ) as * const _ ,
148
- Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > ( done_trampoline :: < Self , F > as * const ( ) ) ) , Box_ :: into_raw ( f) )
147
+ connect_raw (
148
+ self . as_ptr ( ) as * mut _ ,
149
+ b"done\0 " . as_ptr ( ) as * const _ ,
150
+ Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > (
151
+ done_trampoline :: < Self , F > as * const ( ) ,
152
+ ) ) ,
153
+ Box_ :: into_raw ( f) ,
154
+ )
149
155
}
150
156
}
151
157
152
158
#[ doc( alias = "state" ) ]
153
159
fn connect_state_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
154
- unsafe extern "C" fn notify_state_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > ( this : * mut ffi:: HeAnimation , _param_spec : glib:: ffi:: gpointer , f : glib:: ffi:: gpointer ) {
160
+ unsafe extern "C" fn notify_state_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > (
161
+ this : * mut ffi:: HeAnimation ,
162
+ _param_spec : glib:: ffi:: gpointer ,
163
+ f : glib:: ffi:: gpointer ,
164
+ ) {
155
165
let f: & F = & * ( f as * const F ) ;
156
166
f ( Animation :: from_glib_borrow ( this) . unsafe_cast_ref ( ) )
157
167
}
158
168
unsafe {
159
169
let f: Box_ < F > = Box_ :: new ( f) ;
160
- connect_raw ( self . as_ptr ( ) as * mut _ , b"notify::state\0 " . as_ptr ( ) as * const _ ,
161
- Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > ( notify_state_trampoline :: < Self , F > as * const ( ) ) ) , Box_ :: into_raw ( f) )
170
+ connect_raw (
171
+ self . as_ptr ( ) as * mut _ ,
172
+ b"notify::state\0 " . as_ptr ( ) as * const _ ,
173
+ Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > (
174
+ notify_state_trampoline :: < Self , F > as * const ( ) ,
175
+ ) ) ,
176
+ Box_ :: into_raw ( f) ,
177
+ )
162
178
}
163
179
}
164
180
165
181
#[ doc( alias = "target" ) ]
166
182
fn connect_target_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
167
- unsafe extern "C" fn notify_target_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > ( this : * mut ffi:: HeAnimation , _param_spec : glib:: ffi:: gpointer , f : glib:: ffi:: gpointer ) {
183
+ unsafe extern "C" fn notify_target_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > (
184
+ this : * mut ffi:: HeAnimation ,
185
+ _param_spec : glib:: ffi:: gpointer ,
186
+ f : glib:: ffi:: gpointer ,
187
+ ) {
168
188
let f: & F = & * ( f as * const F ) ;
169
189
f ( Animation :: from_glib_borrow ( this) . unsafe_cast_ref ( ) )
170
190
}
171
191
unsafe {
172
192
let f: Box_ < F > = Box_ :: new ( f) ;
173
- connect_raw ( self . as_ptr ( ) as * mut _ , b"notify::target\0 " . as_ptr ( ) as * const _ ,
174
- Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > ( notify_target_trampoline :: < Self , F > as * const ( ) ) ) , Box_ :: into_raw ( f) )
193
+ connect_raw (
194
+ self . as_ptr ( ) as * mut _ ,
195
+ b"notify::target\0 " . as_ptr ( ) as * const _ ,
196
+ Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > (
197
+ notify_target_trampoline :: < Self , F > as * const ( ) ,
198
+ ) ) ,
199
+ Box_ :: into_raw ( f) ,
200
+ )
175
201
}
176
202
}
177
203
178
204
#[ doc( alias = "widget" ) ]
179
205
fn connect_widget_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
180
- unsafe extern "C" fn notify_widget_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > ( this : * mut ffi:: HeAnimation , _param_spec : glib:: ffi:: gpointer , f : glib:: ffi:: gpointer ) {
206
+ unsafe extern "C" fn notify_widget_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > (
207
+ this : * mut ffi:: HeAnimation ,
208
+ _param_spec : glib:: ffi:: gpointer ,
209
+ f : glib:: ffi:: gpointer ,
210
+ ) {
181
211
let f: & F = & * ( f as * const F ) ;
182
212
f ( Animation :: from_glib_borrow ( this) . unsafe_cast_ref ( ) )
183
213
}
184
214
unsafe {
185
215
let f: Box_ < F > = Box_ :: new ( f) ;
186
- connect_raw ( self . as_ptr ( ) as * mut _ , b"notify::widget\0 " . as_ptr ( ) as * const _ ,
187
- Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > ( notify_widget_trampoline :: < Self , F > as * const ( ) ) ) , Box_ :: into_raw ( f) )
216
+ connect_raw (
217
+ self . as_ptr ( ) as * mut _ ,
218
+ b"notify::widget\0 " . as_ptr ( ) as * const _ ,
219
+ Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > (
220
+ notify_widget_trampoline :: < Self , F > as * const ( ) ,
221
+ ) ) ,
222
+ Box_ :: into_raw ( f) ,
223
+ )
188
224
}
189
225
}
190
226
191
227
#[ doc( alias = "avalue" ) ]
192
228
fn connect_avalue_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
193
- unsafe extern "C" fn notify_avalue_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > ( this : * mut ffi:: HeAnimation , _param_spec : glib:: ffi:: gpointer , f : glib:: ffi:: gpointer ) {
229
+ unsafe extern "C" fn notify_avalue_trampoline < P : IsA < Animation > , F : Fn ( & P ) + ' static > (
230
+ this : * mut ffi:: HeAnimation ,
231
+ _param_spec : glib:: ffi:: gpointer ,
232
+ f : glib:: ffi:: gpointer ,
233
+ ) {
194
234
let f: & F = & * ( f as * const F ) ;
195
235
f ( Animation :: from_glib_borrow ( this) . unsafe_cast_ref ( ) )
196
236
}
197
237
unsafe {
198
238
let f: Box_ < F > = Box_ :: new ( f) ;
199
- connect_raw ( self . as_ptr ( ) as * mut _ , b"notify::avalue\0 " . as_ptr ( ) as * const _ ,
200
- Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > ( notify_avalue_trampoline :: < Self , F > as * const ( ) ) ) , Box_ :: into_raw ( f) )
239
+ connect_raw (
240
+ self . as_ptr ( ) as * mut _ ,
241
+ b"notify::avalue\0 " . as_ptr ( ) as * const _ ,
242
+ Some ( std:: mem:: transmute :: < * const ( ) , unsafe extern "C" fn ( ) > (
243
+ notify_avalue_trampoline :: < Self , F > as * const ( ) ,
244
+ ) ) ,
245
+ Box_ :: into_raw ( f) ,
246
+ )
201
247
}
202
248
}
203
249
}
0 commit comments