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
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 let f: &F = &*(f as *const F);
128 f(VideoTransition::from_glib_borrow(this).unsafe_cast_ref())
129 }
130 unsafe {
131 let f: Box_<F> = Box_::new(f);
132 connect_raw(
133 self.as_ptr() as *mut _,
134 c"notify::border".as_ptr() as *const _,
135 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
136 notify_border_trampoline::<Self, F> as *const (),
137 )),
138 Box_::into_raw(f),
139 )
140 }
141 }
142
143 #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")]
144 #[doc(alias = "invert")]
145 fn connect_invert_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
146 unsafe extern "C" fn notify_invert_trampoline<
147 P: IsA<VideoTransition>,
148 F: Fn(&P) + 'static,
149 >(
150 this: *mut ffi::GESVideoTransition,
151 _param_spec: glib::ffi::gpointer,
152 f: glib::ffi::gpointer,
153 ) {
154 let f: &F = &*(f as *const F);
155 f(VideoTransition::from_glib_borrow(this).unsafe_cast_ref())
156 }
157 unsafe {
158 let f: Box_<F> = Box_::new(f);
159 connect_raw(
160 self.as_ptr() as *mut _,
161 c"notify::invert".as_ptr() as *const _,
162 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
163 notify_invert_trampoline::<Self, F> as *const (),
164 )),
165 Box_::into_raw(f),
166 )
167 }
168 }
169
170 #[doc(alias = "transition-type")]
171 fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
172 unsafe extern "C" fn notify_transition_type_trampoline<
173 P: IsA<VideoTransition>,
174 F: Fn(&P) + 'static,
175 >(
176 this: *mut ffi::GESVideoTransition,
177 _param_spec: glib::ffi::gpointer,
178 f: glib::ffi::gpointer,
179 ) {
180 let f: &F = &*(f as *const F);
181 f(VideoTransition::from_glib_borrow(this).unsafe_cast_ref())
182 }
183 unsafe {
184 let f: Box_<F> = Box_::new(f);
185 connect_raw(
186 self.as_ptr() as *mut _,
187 c"notify::transition-type".as_ptr() as *const _,
188 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
189 notify_transition_type_trampoline::<Self, F> as *const (),
190 )),
191 Box_::into_raw(f),
192 )
193 }
194 }
195}
196
197impl<O: IsA<VideoTransition>> VideoTransitionExt for O {}