1#![allow(deprecated)]
6
7#[cfg(feature = "v1_18")]
8#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
9use crate::{Edge, EditMode, Layer};
10use crate::{Extractable, MetaContainer, Timeline, TrackType, ffi};
11use glib::{
12 object::ObjectType as _,
13 prelude::*,
14 signal::{SignalHandlerId, connect_raw},
15 translate::*,
16};
17use std::boxed::Box as Box_;
18
19glib::wrapper! {
20 #[doc(alias = "GESTimelineElement")]
21 pub struct TimelineElement(Object<ffi::GESTimelineElement, ffi::GESTimelineElementClass>) @implements Extractable, MetaContainer;
22
23 match fn {
24 type_ => || ffi::ges_timeline_element_get_type(),
25 }
26}
27
28impl TimelineElement {
29 pub const NONE: Option<&'static TimelineElement> = None;
30}
31
32pub trait TimelineElementExt: IsA<TimelineElement> + 'static {
33 #[doc(alias = "ges_timeline_element_add_child_property")]
34 fn add_child_property(
35 &self,
36 pspec: impl AsRef<glib::ParamSpec>,
37 child: &impl IsA<glib::Object>,
38 ) -> Result<(), glib::error::BoolError> {
39 unsafe {
40 glib::result_from_gboolean!(
41 ffi::ges_timeline_element_add_child_property(
42 self.as_ref().to_glib_none().0,
43 pspec.as_ref().to_glib_none().0,
44 child.as_ref().to_glib_none().0
45 ),
46 "Failed to add child property"
47 )
48 }
49 }
50
51 #[doc(alias = "ges_timeline_element_copy")]
52 #[must_use]
53 fn copy(&self, deep: bool) -> TimelineElement {
54 unsafe {
55 from_glib_none(ffi::ges_timeline_element_copy(
56 self.as_ref().to_glib_none().0,
57 deep.into_glib(),
58 ))
59 }
60 }
61
62 #[cfg(feature = "v1_18")]
63 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
64 #[doc(alias = "ges_timeline_element_edit")]
65 fn edit(
66 &self,
67 layers: &[Layer],
68 new_layer_priority: i64,
69 mode: EditMode,
70 edge: Edge,
71 position: u64,
72 ) -> bool {
73 unsafe {
74 from_glib(ffi::ges_timeline_element_edit(
75 self.as_ref().to_glib_none().0,
76 layers.to_glib_none().0,
77 new_layer_priority,
78 mode.into_glib(),
79 edge.into_glib(),
80 position,
81 ))
82 }
83 }
84
85 #[cfg(feature = "v1_18")]
86 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
87 #[doc(alias = "ges_timeline_element_edit_full")]
88 fn edit_full(
89 &self,
90 new_layer_priority: i64,
91 mode: EditMode,
92 edge: Edge,
93 position: u64,
94 ) -> Result<(), glib::Error> {
95 unsafe {
96 let mut error = std::ptr::null_mut();
97 let is_ok = ffi::ges_timeline_element_edit_full(
98 self.as_ref().to_glib_none().0,
99 new_layer_priority,
100 mode.into_glib(),
101 edge.into_glib(),
102 position,
103 &mut error,
104 );
105 debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
106 if error.is_null() {
107 Ok(())
108 } else {
109 Err(from_glib_full(error))
110 }
111 }
112 }
113
114 #[doc(alias = "ges_timeline_element_get_child_property")]
121 #[doc(alias = "get_child_property")]
122 fn child_property(&self, property_name: &str) -> Option<glib::Value> {
123 unsafe {
124 let mut value = glib::Value::uninitialized();
125 let ret = from_glib(ffi::ges_timeline_element_get_child_property(
126 self.as_ref().to_glib_none().0,
127 property_name.to_glib_none().0,
128 value.to_glib_none_mut().0,
129 ));
130 if ret { Some(value) } else { None }
131 }
132 }
133
134 #[doc(alias = "ges_timeline_element_get_child_property_by_pspec")]
135 #[doc(alias = "get_child_property_by_pspec")]
136 fn child_property_by_pspec(&self, pspec: impl AsRef<glib::ParamSpec>) -> glib::Value {
137 unsafe {
138 let mut value = glib::Value::uninitialized();
139 ffi::ges_timeline_element_get_child_property_by_pspec(
140 self.as_ref().to_glib_none().0,
141 pspec.as_ref().to_glib_none().0,
142 value.to_glib_none_mut().0,
143 );
144 value
145 }
146 }
147
148 #[doc(alias = "ges_timeline_element_get_duration")]
155 #[doc(alias = "get_duration")]
156 fn duration(&self) -> gst::ClockTime {
157 unsafe {
158 try_from_glib(ffi::ges_timeline_element_get_duration(
159 self.as_ref().to_glib_none().0,
160 ))
161 .expect("mandatory glib value is None")
162 }
163 }
164
165 #[doc(alias = "ges_timeline_element_get_inpoint")]
166 #[doc(alias = "get_inpoint")]
167 #[doc(alias = "in-point")]
168 fn inpoint(&self) -> gst::ClockTime {
169 unsafe {
170 try_from_glib(ffi::ges_timeline_element_get_inpoint(
171 self.as_ref().to_glib_none().0,
172 ))
173 .expect("mandatory glib value is None")
174 }
175 }
176
177 #[cfg(feature = "v1_16")]
178 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
179 #[doc(alias = "ges_timeline_element_get_layer_priority")]
180 #[doc(alias = "get_layer_priority")]
181 fn layer_priority(&self) -> u32 {
182 unsafe { ffi::ges_timeline_element_get_layer_priority(self.as_ref().to_glib_none().0) }
183 }
184
185 #[doc(alias = "ges_timeline_element_get_max_duration")]
186 #[doc(alias = "get_max_duration")]
187 #[doc(alias = "max-duration")]
188 fn max_duration(&self) -> Option<gst::ClockTime> {
189 unsafe {
190 from_glib(ffi::ges_timeline_element_get_max_duration(
191 self.as_ref().to_glib_none().0,
192 ))
193 }
194 }
195
196 #[doc(alias = "ges_timeline_element_get_name")]
197 #[doc(alias = "get_name")]
198 fn name(&self) -> Option<glib::GString> {
199 unsafe {
200 from_glib_full(ffi::ges_timeline_element_get_name(
201 self.as_ref().to_glib_none().0,
202 ))
203 }
204 }
205
206 #[cfg(feature = "v1_18")]
207 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
208 #[doc(alias = "ges_timeline_element_get_natural_framerate")]
209 #[doc(alias = "get_natural_framerate")]
210 fn natural_framerate(&self) -> Option<(i32, i32)> {
211 unsafe {
212 let mut framerate_n = std::mem::MaybeUninit::uninit();
213 let mut framerate_d = std::mem::MaybeUninit::uninit();
214 let ret = from_glib(ffi::ges_timeline_element_get_natural_framerate(
215 self.as_ref().to_glib_none().0,
216 framerate_n.as_mut_ptr(),
217 framerate_d.as_mut_ptr(),
218 ));
219 if ret {
220 Some((framerate_n.assume_init(), framerate_d.assume_init()))
221 } else {
222 None
223 }
224 }
225 }
226
227 #[doc(alias = "ges_timeline_element_get_parent")]
228 #[doc(alias = "get_parent")]
229 #[must_use]
230 fn parent(&self) -> Option<TimelineElement> {
231 unsafe {
232 from_glib_full(ffi::ges_timeline_element_get_parent(
233 self.as_ref().to_glib_none().0,
234 ))
235 }
236 }
237
238 #[doc(alias = "ges_timeline_element_get_priority")]
239 #[doc(alias = "get_priority")]
240 fn priority(&self) -> u32 {
241 unsafe { ffi::ges_timeline_element_get_priority(self.as_ref().to_glib_none().0) }
242 }
243
244 #[doc(alias = "ges_timeline_element_get_start")]
245 #[doc(alias = "get_start")]
246 fn start(&self) -> gst::ClockTime {
247 unsafe {
248 try_from_glib(ffi::ges_timeline_element_get_start(
249 self.as_ref().to_glib_none().0,
250 ))
251 .expect("mandatory glib value is None")
252 }
253 }
254
255 #[doc(alias = "ges_timeline_element_get_timeline")]
256 #[doc(alias = "get_timeline")]
257 fn timeline(&self) -> Option<Timeline> {
258 unsafe {
259 from_glib_full(ffi::ges_timeline_element_get_timeline(
260 self.as_ref().to_glib_none().0,
261 ))
262 }
263 }
264
265 #[doc(alias = "ges_timeline_element_get_toplevel_parent")]
266 #[doc(alias = "get_toplevel_parent")]
267 #[must_use]
268 fn toplevel_parent(&self) -> TimelineElement {
269 unsafe {
270 from_glib_full(ffi::ges_timeline_element_get_toplevel_parent(
271 self.as_ref().to_glib_none().0,
272 ))
273 }
274 }
275
276 #[doc(alias = "ges_timeline_element_get_track_types")]
277 #[doc(alias = "get_track_types")]
278 fn track_types(&self) -> TrackType {
279 unsafe {
280 from_glib(ffi::ges_timeline_element_get_track_types(
281 self.as_ref().to_glib_none().0,
282 ))
283 }
284 }
285
286 #[doc(alias = "ges_timeline_element_list_children_properties")]
287 fn list_children_properties(&self) -> Vec<glib::ParamSpec> {
288 unsafe {
289 let mut n_properties = std::mem::MaybeUninit::uninit();
290 let ret = FromGlibContainer::from_glib_full_num(
291 ffi::ges_timeline_element_list_children_properties(
292 self.as_ref().to_glib_none().0,
293 n_properties.as_mut_ptr(),
294 ),
295 n_properties.assume_init() as _,
296 );
297 ret
298 }
299 }
300
301 #[doc(alias = "ges_timeline_element_lookup_child")]
302 fn lookup_child(&self, prop_name: &str) -> Option<(glib::Object, glib::ParamSpec)> {
303 unsafe {
304 let mut child = std::ptr::null_mut();
305 let mut pspec = std::ptr::null_mut();
306 let ret = from_glib(ffi::ges_timeline_element_lookup_child(
307 self.as_ref().to_glib_none().0,
308 prop_name.to_glib_none().0,
309 &mut child,
310 &mut pspec,
311 ));
312 if ret {
313 Some((from_glib_full(child), from_glib_full(pspec)))
314 } else {
315 None
316 }
317 }
318 }
319
320 #[doc(alias = "ges_timeline_element_paste")]
321 fn paste(&self, paste_position: gst::ClockTime) -> Result<TimelineElement, glib::BoolError> {
322 unsafe {
323 Option::<_>::from_glib_full(ffi::ges_timeline_element_paste(
324 self.as_ref().to_glib_none().0,
325 paste_position.into_glib(),
326 ))
327 .ok_or_else(|| glib::bool_error!("Failed to paste timeline element"))
328 }
329 }
330
331 #[doc(alias = "ges_timeline_element_remove_child_property")]
332 fn remove_child_property(
333 &self,
334 pspec: impl AsRef<glib::ParamSpec>,
335 ) -> Result<(), glib::error::BoolError> {
336 unsafe {
337 glib::result_from_gboolean!(
338 ffi::ges_timeline_element_remove_child_property(
339 self.as_ref().to_glib_none().0,
340 pspec.as_ref().to_glib_none().0
341 ),
342 "Failed to remove child property"
343 )
344 }
345 }
346
347 #[doc(alias = "ges_timeline_element_ripple")]
348 fn ripple(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> {
349 unsafe {
350 glib::result_from_gboolean!(
351 ffi::ges_timeline_element_ripple(self.as_ref().to_glib_none().0, start.into_glib()),
352 "Failed to ripple"
353 )
354 }
355 }
356
357 #[doc(alias = "ges_timeline_element_ripple_end")]
358 fn ripple_end(&self, end: gst::ClockTime) -> Result<(), glib::error::BoolError> {
359 unsafe {
360 glib::result_from_gboolean!(
361 ffi::ges_timeline_element_ripple_end(
362 self.as_ref().to_glib_none().0,
363 end.into_glib()
364 ),
365 "Failed to ripple"
366 )
367 }
368 }
369
370 #[doc(alias = "ges_timeline_element_roll_end")]
371 fn roll_end(&self, end: gst::ClockTime) -> Result<(), glib::error::BoolError> {
372 unsafe {
373 glib::result_from_gboolean!(
374 ffi::ges_timeline_element_roll_end(self.as_ref().to_glib_none().0, end.into_glib()),
375 "Failed to roll"
376 )
377 }
378 }
379
380 #[doc(alias = "ges_timeline_element_roll_start")]
381 fn roll_start(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> {
382 unsafe {
383 glib::result_from_gboolean!(
384 ffi::ges_timeline_element_roll_start(
385 self.as_ref().to_glib_none().0,
386 start.into_glib()
387 ),
388 "Failed to roll"
389 )
390 }
391 }
392
393 #[cfg(feature = "v1_18")]
399 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
400 #[doc(alias = "ges_timeline_element_set_child_property_full")]
401 fn set_child_property_full(
402 &self,
403 property_name: &str,
404 value: &glib::Value,
405 ) -> Result<(), glib::Error> {
406 unsafe {
407 let mut error = std::ptr::null_mut();
408 let is_ok = ffi::ges_timeline_element_set_child_property_full(
409 self.as_ref().to_glib_none().0,
410 property_name.to_glib_none().0,
411 value.to_glib_none().0,
412 &mut error,
413 );
414 debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
415 if error.is_null() {
416 Ok(())
417 } else {
418 Err(from_glib_full(error))
419 }
420 }
421 }
422
423 #[doc(alias = "ges_timeline_element_set_duration")]
429 #[doc(alias = "duration")]
430 fn set_duration(&self, duration: impl Into<Option<gst::ClockTime>>) -> bool {
431 unsafe {
432 from_glib(ffi::ges_timeline_element_set_duration(
433 self.as_ref().to_glib_none().0,
434 duration.into().into_glib(),
435 ))
436 }
437 }
438
439 #[doc(alias = "ges_timeline_element_set_inpoint")]
440 #[doc(alias = "in-point")]
441 fn set_inpoint(&self, inpoint: gst::ClockTime) -> bool {
442 unsafe {
443 from_glib(ffi::ges_timeline_element_set_inpoint(
444 self.as_ref().to_glib_none().0,
445 inpoint.into_glib(),
446 ))
447 }
448 }
449
450 #[doc(alias = "ges_timeline_element_set_max_duration")]
451 #[doc(alias = "max-duration")]
452 fn set_max_duration(&self, maxduration: impl Into<Option<gst::ClockTime>>) -> bool {
453 unsafe {
454 from_glib(ffi::ges_timeline_element_set_max_duration(
455 self.as_ref().to_glib_none().0,
456 maxduration.into().into_glib(),
457 ))
458 }
459 }
460
461 #[doc(alias = "ges_timeline_element_set_name")]
462 #[doc(alias = "name")]
463 fn set_name(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> {
464 unsafe {
465 glib::result_from_gboolean!(
466 ffi::ges_timeline_element_set_name(
467 self.as_ref().to_glib_none().0,
468 name.to_glib_none().0
469 ),
470 "Failed to set name"
471 )
472 }
473 }
474
475 #[doc(alias = "ges_timeline_element_set_parent")]
476 #[doc(alias = "parent")]
477 fn set_parent(&self, parent: &impl IsA<TimelineElement>) -> Result<(), glib::error::BoolError> {
478 unsafe {
479 glib::result_from_gboolean!(
480 ffi::ges_timeline_element_set_parent(
481 self.as_ref().to_glib_none().0,
482 parent.as_ref().to_glib_none().0
483 ),
484 "`TimelineElement` already had a parent or its parent was the same as specified"
485 )
486 }
487 }
488
489 #[deprecated = "Since 1.10"]
490 #[allow(deprecated)]
491 #[doc(alias = "ges_timeline_element_set_priority")]
492 #[doc(alias = "priority")]
493 fn set_priority(&self, priority: u32) -> bool {
494 unsafe {
495 from_glib(ffi::ges_timeline_element_set_priority(
496 self.as_ref().to_glib_none().0,
497 priority,
498 ))
499 }
500 }
501
502 #[doc(alias = "ges_timeline_element_set_start")]
503 #[doc(alias = "start")]
504 fn set_start(&self, start: gst::ClockTime) -> bool {
505 unsafe {
506 from_glib(ffi::ges_timeline_element_set_start(
507 self.as_ref().to_glib_none().0,
508 start.into_glib(),
509 ))
510 }
511 }
512
513 #[doc(alias = "ges_timeline_element_set_timeline")]
514 #[doc(alias = "timeline")]
515 fn set_timeline(&self, timeline: &impl IsA<Timeline>) -> Result<(), glib::error::BoolError> {
516 unsafe {
517 glib::result_from_gboolean!(
518 ffi::ges_timeline_element_set_timeline(
519 self.as_ref().to_glib_none().0,
520 timeline.as_ref().to_glib_none().0
521 ),
522 "`Failed to set timeline"
523 )
524 }
525 }
526
527 #[doc(alias = "ges_timeline_element_trim")]
528 fn trim(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> {
529 unsafe {
530 glib::result_from_gboolean!(
531 ffi::ges_timeline_element_trim(self.as_ref().to_glib_none().0, start.into_glib()),
532 "Failed to trim"
533 )
534 }
535 }
536
537 fn is_serialize(&self) -> bool {
538 ObjectExt::property(self.as_ref(), "serialize")
539 }
540
541 fn set_serialize(&self, serialize: bool) {
542 ObjectExt::set_property(self.as_ref(), "serialize", serialize)
543 }
544
545 #[cfg(feature = "v1_18")]
546 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
547 #[doc(alias = "child-property-added")]
548 fn connect_child_property_added<F: Fn(&Self, &glib::Object, &glib::ParamSpec) + 'static>(
549 &self,
550 f: F,
551 ) -> SignalHandlerId {
552 unsafe extern "C" fn child_property_added_trampoline<
553 P: IsA<TimelineElement>,
554 F: Fn(&P, &glib::Object, &glib::ParamSpec) + 'static,
555 >(
556 this: *mut ffi::GESTimelineElement,
557 prop_object: *mut glib::gobject_ffi::GObject,
558 prop: *mut glib::gobject_ffi::GParamSpec,
559 f: glib::ffi::gpointer,
560 ) {
561 unsafe {
562 let f: &F = &*(f as *const F);
563 f(
564 TimelineElement::from_glib_borrow(this).unsafe_cast_ref(),
565 &from_glib_borrow(prop_object),
566 &from_glib_borrow(prop),
567 )
568 }
569 }
570 unsafe {
571 let f: Box_<F> = Box_::new(f);
572 connect_raw(
573 self.as_ptr() as *mut _,
574 c"child-property-added".as_ptr(),
575 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
576 child_property_added_trampoline::<Self, F> as *const (),
577 )),
578 Box_::into_raw(f),
579 )
580 }
581 }
582
583 #[cfg(feature = "v1_18")]
584 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
585 #[doc(alias = "child-property-removed")]
586 fn connect_child_property_removed<F: Fn(&Self, &glib::Object, &glib::ParamSpec) + 'static>(
587 &self,
588 f: F,
589 ) -> SignalHandlerId {
590 unsafe extern "C" fn child_property_removed_trampoline<
591 P: IsA<TimelineElement>,
592 F: Fn(&P, &glib::Object, &glib::ParamSpec) + 'static,
593 >(
594 this: *mut ffi::GESTimelineElement,
595 prop_object: *mut glib::gobject_ffi::GObject,
596 prop: *mut glib::gobject_ffi::GParamSpec,
597 f: glib::ffi::gpointer,
598 ) {
599 unsafe {
600 let f: &F = &*(f as *const F);
601 f(
602 TimelineElement::from_glib_borrow(this).unsafe_cast_ref(),
603 &from_glib_borrow(prop_object),
604 &from_glib_borrow(prop),
605 )
606 }
607 }
608 unsafe {
609 let f: Box_<F> = Box_::new(f);
610 connect_raw(
611 self.as_ptr() as *mut _,
612 c"child-property-removed".as_ptr(),
613 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
614 child_property_removed_trampoline::<Self, F> as *const (),
615 )),
616 Box_::into_raw(f),
617 )
618 }
619 }
620
621 #[doc(alias = "deep-notify")]
622 fn connect_deep_notify<F: Fn(&Self, &glib::Object, &glib::ParamSpec) + 'static>(
623 &self,
624 detail: Option<&str>,
625 f: F,
626 ) -> SignalHandlerId {
627 unsafe extern "C" fn deep_notify_trampoline<
628 P: IsA<TimelineElement>,
629 F: Fn(&P, &glib::Object, &glib::ParamSpec) + 'static,
630 >(
631 this: *mut ffi::GESTimelineElement,
632 prop_object: *mut glib::gobject_ffi::GObject,
633 prop: *mut glib::gobject_ffi::GParamSpec,
634 f: glib::ffi::gpointer,
635 ) {
636 unsafe {
637 let f: &F = &*(f as *const F);
638 f(
639 TimelineElement::from_glib_borrow(this).unsafe_cast_ref(),
640 &from_glib_borrow(prop_object),
641 &from_glib_borrow(prop),
642 )
643 }
644 }
645 unsafe {
646 let f: Box_<F> = Box_::new(f);
647 let detailed_signal_name = detail.map(|name| format!("deep-notify::{name}\0"));
648 let signal_name = detailed_signal_name.as_ref().map_or(c"deep-notify", |n| {
649 std::ffi::CStr::from_bytes_with_nul_unchecked(n.as_bytes())
650 });
651 connect_raw(
652 self.as_ptr() as *mut _,
653 signal_name.as_ptr(),
654 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
655 deep_notify_trampoline::<Self, F> as *const (),
656 )),
657 Box_::into_raw(f),
658 )
659 }
660 }
661
662 #[doc(alias = "duration")]
663 fn connect_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
664 unsafe extern "C" fn notify_duration_trampoline<
665 P: IsA<TimelineElement>,
666 F: Fn(&P) + 'static,
667 >(
668 this: *mut ffi::GESTimelineElement,
669 _param_spec: glib::ffi::gpointer,
670 f: glib::ffi::gpointer,
671 ) {
672 unsafe {
673 let f: &F = &*(f as *const F);
674 f(TimelineElement::from_glib_borrow(this).unsafe_cast_ref())
675 }
676 }
677 unsafe {
678 let f: Box_<F> = Box_::new(f);
679 connect_raw(
680 self.as_ptr() as *mut _,
681 c"notify::duration".as_ptr(),
682 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
683 notify_duration_trampoline::<Self, F> as *const (),
684 )),
685 Box_::into_raw(f),
686 )
687 }
688 }
689
690 #[doc(alias = "in-point")]
691 fn connect_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
692 unsafe extern "C" fn notify_in_point_trampoline<
693 P: IsA<TimelineElement>,
694 F: Fn(&P) + 'static,
695 >(
696 this: *mut ffi::GESTimelineElement,
697 _param_spec: glib::ffi::gpointer,
698 f: glib::ffi::gpointer,
699 ) {
700 unsafe {
701 let f: &F = &*(f as *const F);
702 f(TimelineElement::from_glib_borrow(this).unsafe_cast_ref())
703 }
704 }
705 unsafe {
706 let f: Box_<F> = Box_::new(f);
707 connect_raw(
708 self.as_ptr() as *mut _,
709 c"notify::in-point".as_ptr(),
710 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
711 notify_in_point_trampoline::<Self, F> as *const (),
712 )),
713 Box_::into_raw(f),
714 )
715 }
716 }
717
718 #[doc(alias = "max-duration")]
719 fn connect_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
720 unsafe extern "C" fn notify_max_duration_trampoline<
721 P: IsA<TimelineElement>,
722 F: Fn(&P) + 'static,
723 >(
724 this: *mut ffi::GESTimelineElement,
725 _param_spec: glib::ffi::gpointer,
726 f: glib::ffi::gpointer,
727 ) {
728 unsafe {
729 let f: &F = &*(f as *const F);
730 f(TimelineElement::from_glib_borrow(this).unsafe_cast_ref())
731 }
732 }
733 unsafe {
734 let f: Box_<F> = Box_::new(f);
735 connect_raw(
736 self.as_ptr() as *mut _,
737 c"notify::max-duration".as_ptr(),
738 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
739 notify_max_duration_trampoline::<Self, F> as *const (),
740 )),
741 Box_::into_raw(f),
742 )
743 }
744 }
745
746 #[doc(alias = "name")]
747 fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
748 unsafe extern "C" fn notify_name_trampoline<
749 P: IsA<TimelineElement>,
750 F: Fn(&P) + 'static,
751 >(
752 this: *mut ffi::GESTimelineElement,
753 _param_spec: glib::ffi::gpointer,
754 f: glib::ffi::gpointer,
755 ) {
756 unsafe {
757 let f: &F = &*(f as *const F);
758 f(TimelineElement::from_glib_borrow(this).unsafe_cast_ref())
759 }
760 }
761 unsafe {
762 let f: Box_<F> = Box_::new(f);
763 connect_raw(
764 self.as_ptr() as *mut _,
765 c"notify::name".as_ptr(),
766 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
767 notify_name_trampoline::<Self, F> as *const (),
768 )),
769 Box_::into_raw(f),
770 )
771 }
772 }
773
774 #[doc(alias = "parent")]
775 fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
776 unsafe extern "C" fn notify_parent_trampoline<
777 P: IsA<TimelineElement>,
778 F: Fn(&P) + 'static,
779 >(
780 this: *mut ffi::GESTimelineElement,
781 _param_spec: glib::ffi::gpointer,
782 f: glib::ffi::gpointer,
783 ) {
784 unsafe {
785 let f: &F = &*(f as *const F);
786 f(TimelineElement::from_glib_borrow(this).unsafe_cast_ref())
787 }
788 }
789 unsafe {
790 let f: Box_<F> = Box_::new(f);
791 connect_raw(
792 self.as_ptr() as *mut _,
793 c"notify::parent".as_ptr(),
794 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
795 notify_parent_trampoline::<Self, F> as *const (),
796 )),
797 Box_::into_raw(f),
798 )
799 }
800 }
801
802 #[deprecated = "Since 1.10"]
803 #[doc(alias = "priority")]
804 fn connect_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
805 unsafe extern "C" fn notify_priority_trampoline<
806 P: IsA<TimelineElement>,
807 F: Fn(&P) + 'static,
808 >(
809 this: *mut ffi::GESTimelineElement,
810 _param_spec: glib::ffi::gpointer,
811 f: glib::ffi::gpointer,
812 ) {
813 unsafe {
814 let f: &F = &*(f as *const F);
815 f(TimelineElement::from_glib_borrow(this).unsafe_cast_ref())
816 }
817 }
818 unsafe {
819 let f: Box_<F> = Box_::new(f);
820 connect_raw(
821 self.as_ptr() as *mut _,
822 c"notify::priority".as_ptr(),
823 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
824 notify_priority_trampoline::<Self, F> as *const (),
825 )),
826 Box_::into_raw(f),
827 )
828 }
829 }
830
831 #[doc(alias = "serialize")]
832 fn connect_serialize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
833 unsafe extern "C" fn notify_serialize_trampoline<
834 P: IsA<TimelineElement>,
835 F: Fn(&P) + 'static,
836 >(
837 this: *mut ffi::GESTimelineElement,
838 _param_spec: glib::ffi::gpointer,
839 f: glib::ffi::gpointer,
840 ) {
841 unsafe {
842 let f: &F = &*(f as *const F);
843 f(TimelineElement::from_glib_borrow(this).unsafe_cast_ref())
844 }
845 }
846 unsafe {
847 let f: Box_<F> = Box_::new(f);
848 connect_raw(
849 self.as_ptr() as *mut _,
850 c"notify::serialize".as_ptr(),
851 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
852 notify_serialize_trampoline::<Self, F> as *const (),
853 )),
854 Box_::into_raw(f),
855 )
856 }
857 }
858
859 #[doc(alias = "start")]
860 fn connect_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
861 unsafe extern "C" fn notify_start_trampoline<
862 P: IsA<TimelineElement>,
863 F: Fn(&P) + 'static,
864 >(
865 this: *mut ffi::GESTimelineElement,
866 _param_spec: glib::ffi::gpointer,
867 f: glib::ffi::gpointer,
868 ) {
869 unsafe {
870 let f: &F = &*(f as *const F);
871 f(TimelineElement::from_glib_borrow(this).unsafe_cast_ref())
872 }
873 }
874 unsafe {
875 let f: Box_<F> = Box_::new(f);
876 connect_raw(
877 self.as_ptr() as *mut _,
878 c"notify::start".as_ptr(),
879 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
880 notify_start_trampoline::<Self, F> as *const (),
881 )),
882 Box_::into_raw(f),
883 )
884 }
885 }
886
887 #[doc(alias = "timeline")]
888 fn connect_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
889 unsafe extern "C" fn notify_timeline_trampoline<
890 P: IsA<TimelineElement>,
891 F: Fn(&P) + 'static,
892 >(
893 this: *mut ffi::GESTimelineElement,
894 _param_spec: glib::ffi::gpointer,
895 f: glib::ffi::gpointer,
896 ) {
897 unsafe {
898 let f: &F = &*(f as *const F);
899 f(TimelineElement::from_glib_borrow(this).unsafe_cast_ref())
900 }
901 }
902 unsafe {
903 let f: Box_<F> = Box_::new(f);
904 connect_raw(
905 self.as_ptr() as *mut _,
906 c"notify::timeline".as_ptr(),
907 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
908 notify_timeline_trampoline::<Self, F> as *const (),
909 )),
910 Box_::into_raw(f),
911 )
912 }
913 }
914}
915
916impl<O: IsA<TimelineElement>> TimelineElementExt for O {}