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