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