gstreamer_editing_services/auto/
video_transition.rs1#![allow(deprecated)]
6
7use crate::{
8 ffi, Extractable, MetaContainer, Operation, TimelineElement, TrackElement, Transition,
9 VideoStandardTransitionType,
10};
11use glib::{
12 prelude::*,
13 signal::{connect_raw, SignalHandlerId},
14 translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19 #[doc(alias = "GESVideoTransition")]
20 pub struct VideoTransition(Object<ffi::GESVideoTransition, ffi::GESVideoTransitionClass>) @extends Transition, Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer;
21
22 match fn {
23 type_ => || ffi::ges_video_transition_get_type(),
24 }
25}
26
27impl VideoTransition {
28 pub const NONE: Option<&'static VideoTransition> = None;
29
30 #[doc(alias = "ges_video_transition_new")]
31 pub fn new() -> VideoTransition {
32 assert_initialized_main_thread!();
33 unsafe { from_glib_none(ffi::ges_video_transition_new()) }
34 }
35}
36
37impl Default for VideoTransition {
38 fn default() -> Self {
39 Self::new()
40 }
41}
42
43mod sealed {
44 pub trait Sealed {}
45 impl<T: super::IsA<super::VideoTransition>> Sealed for T {}
46}
47
48pub trait VideoTransitionExt: IsA<VideoTransition> + sealed::Sealed + 'static {
49 #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")]
50 #[allow(deprecated)]
51 #[doc(alias = "ges_video_transition_get_border")]
52 #[doc(alias = "get_border")]
53 fn border(&self) -> i32 {
54 unsafe { ffi::ges_video_transition_get_border(self.as_ref().to_glib_none().0) }
55 }
56
57 #[doc(alias = "ges_video_transition_get_transition_type")]
58 #[doc(alias = "get_transition_type")]
59 #[doc(alias = "transition-type")]
60 fn transition_type(&self) -> VideoStandardTransitionType {
61 unsafe {
62 from_glib(ffi::ges_video_transition_get_transition_type(
63 self.as_ref().to_glib_none().0,
64 ))
65 }
66 }
67
68 #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")]
69 #[allow(deprecated)]
70 #[doc(alias = "ges_video_transition_is_inverted")]
71 fn is_inverted(&self) -> bool {
72 unsafe {
73 from_glib(ffi::ges_video_transition_is_inverted(
74 self.as_ref().to_glib_none().0,
75 ))
76 }
77 }
78
79 #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")]
80 #[allow(deprecated)]
81 #[doc(alias = "ges_video_transition_set_border")]
82 #[doc(alias = "border")]
83 fn set_border(&self, value: u32) {
84 unsafe {
85 ffi::ges_video_transition_set_border(self.as_ref().to_glib_none().0, value);
86 }
87 }
88
89 #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")]
90 #[allow(deprecated)]
91 #[doc(alias = "ges_video_transition_set_inverted")]
92 fn set_inverted(&self, inverted: bool) {
93 unsafe {
94 ffi::ges_video_transition_set_inverted(
95 self.as_ref().to_glib_none().0,
96 inverted.into_glib(),
97 );
98 }
99 }
100
101 #[doc(alias = "ges_video_transition_set_transition_type")]
102 #[doc(alias = "transition-type")]
103 fn set_transition_type(&self, type_: VideoStandardTransitionType) -> bool {
104 unsafe {
105 from_glib(ffi::ges_video_transition_set_transition_type(
106 self.as_ref().to_glib_none().0,
107 type_.into_glib(),
108 ))
109 }
110 }
111
112 #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")]
113 fn inverts(&self) -> bool {
114 ObjectExt::property(self.as_ref(), "invert")
115 }
116
117 #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")]
118 fn set_invert(&self, invert: bool) {
119 ObjectExt::set_property(self.as_ref(), "invert", invert)
120 }
121
122 #[doc(alias = "border")]
123 fn connect_border_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
124 unsafe extern "C" fn notify_border_trampoline<
125 P: IsA<VideoTransition>,
126 F: Fn(&P) + 'static,
127 >(
128 this: *mut ffi::GESVideoTransition,
129 _param_spec: glib::ffi::gpointer,
130 f: glib::ffi::gpointer,
131 ) {
132 let f: &F = &*(f as *const F);
133 f(VideoTransition::from_glib_borrow(this).unsafe_cast_ref())
134 }
135 unsafe {
136 let f: Box_<F> = Box_::new(f);
137 connect_raw(
138 self.as_ptr() as *mut _,
139 b"notify::border\0".as_ptr() as *const _,
140 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
141 notify_border_trampoline::<Self, F> as *const (),
142 )),
143 Box_::into_raw(f),
144 )
145 }
146 }
147
148 #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")]
149 #[doc(alias = "invert")]
150 fn connect_invert_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
151 unsafe extern "C" fn notify_invert_trampoline<
152 P: IsA<VideoTransition>,
153 F: Fn(&P) + 'static,
154 >(
155 this: *mut ffi::GESVideoTransition,
156 _param_spec: glib::ffi::gpointer,
157 f: glib::ffi::gpointer,
158 ) {
159 let f: &F = &*(f as *const F);
160 f(VideoTransition::from_glib_borrow(this).unsafe_cast_ref())
161 }
162 unsafe {
163 let f: Box_<F> = Box_::new(f);
164 connect_raw(
165 self.as_ptr() as *mut _,
166 b"notify::invert\0".as_ptr() as *const _,
167 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
168 notify_invert_trampoline::<Self, F> as *const (),
169 )),
170 Box_::into_raw(f),
171 )
172 }
173 }
174
175 #[doc(alias = "transition-type")]
176 fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
177 unsafe extern "C" fn notify_transition_type_trampoline<
178 P: IsA<VideoTransition>,
179 F: Fn(&P) + 'static,
180 >(
181 this: *mut ffi::GESVideoTransition,
182 _param_spec: glib::ffi::gpointer,
183 f: glib::ffi::gpointer,
184 ) {
185 let f: &F = &*(f as *const F);
186 f(VideoTransition::from_glib_borrow(this).unsafe_cast_ref())
187 }
188 unsafe {
189 let f: Box_<F> = Box_::new(f);
190 connect_raw(
191 self.as_ptr() as *mut _,
192 b"notify::transition-type\0".as_ptr() as *const _,
193 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
194 notify_transition_type_trampoline::<Self, F> as *const (),
195 )),
196 Box_::into_raw(f),
197 )
198 }
199 }
200}
201
202impl<O: IsA<VideoTransition>> VideoTransitionExt for O {}