gstreamer_editing_services/auto/
text_overlay_clip.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{
7    ffi, Clip, Container, Extractable, MetaContainer, OperationClip, OverlayClip, TextHAlign,
8    TextVAlign, TimelineElement,
9};
10use glib::{
11    prelude::*,
12    signal::{connect_raw, SignalHandlerId},
13    translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18    #[doc(alias = "GESTextOverlayClip")]
19    pub struct TextOverlayClip(Object<ffi::GESTextOverlayClip, ffi::GESTextOverlayClipClass>) @extends OverlayClip, OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer;
20
21    match fn {
22        type_ => || ffi::ges_text_overlay_clip_get_type(),
23    }
24}
25
26impl TextOverlayClip {
27    pub const NONE: Option<&'static TextOverlayClip> = None;
28
29    #[doc(alias = "ges_text_overlay_clip_new")]
30    pub fn new() -> Option<TextOverlayClip> {
31        assert_initialized_main_thread!();
32        unsafe { from_glib_none(ffi::ges_text_overlay_clip_new()) }
33    }
34}
35
36pub trait TextOverlayClipExt: IsA<TextOverlayClip> + 'static {
37    #[doc(alias = "ges_text_overlay_clip_get_color")]
38    #[doc(alias = "get_color")]
39    fn color(&self) -> u32 {
40        unsafe { ffi::ges_text_overlay_clip_get_color(self.as_ref().to_glib_none().0) }
41    }
42
43    #[doc(alias = "ges_text_overlay_clip_get_font_desc")]
44    #[doc(alias = "get_font_desc")]
45    #[doc(alias = "font-desc")]
46    fn font_desc(&self) -> Option<glib::GString> {
47        unsafe {
48            from_glib_none(ffi::ges_text_overlay_clip_get_font_desc(
49                self.as_ref().to_glib_none().0,
50            ))
51        }
52    }
53
54    #[doc(alias = "ges_text_overlay_clip_get_halignment")]
55    #[doc(alias = "get_halignment")]
56    fn halignment(&self) -> TextHAlign {
57        unsafe {
58            from_glib(ffi::ges_text_overlay_clip_get_halignment(
59                self.as_ref().to_glib_none().0,
60            ))
61        }
62    }
63
64    #[doc(alias = "ges_text_overlay_clip_get_text")]
65    #[doc(alias = "get_text")]
66    fn text(&self) -> Option<glib::GString> {
67        unsafe {
68            from_glib_none(ffi::ges_text_overlay_clip_get_text(
69                self.as_ref().to_glib_none().0,
70            ))
71        }
72    }
73
74    #[doc(alias = "ges_text_overlay_clip_get_valignment")]
75    #[doc(alias = "get_valignment")]
76    fn valignment(&self) -> TextVAlign {
77        unsafe {
78            from_glib(ffi::ges_text_overlay_clip_get_valignment(
79                self.as_ref().to_glib_none().0,
80            ))
81        }
82    }
83
84    #[doc(alias = "ges_text_overlay_clip_get_xpos")]
85    #[doc(alias = "get_xpos")]
86    fn xpos(&self) -> f64 {
87        unsafe { ffi::ges_text_overlay_clip_get_xpos(self.as_ref().to_glib_none().0) }
88    }
89
90    #[doc(alias = "ges_text_overlay_clip_get_ypos")]
91    #[doc(alias = "get_ypos")]
92    fn ypos(&self) -> f64 {
93        unsafe { ffi::ges_text_overlay_clip_get_ypos(self.as_ref().to_glib_none().0) }
94    }
95
96    #[doc(alias = "ges_text_overlay_clip_set_color")]
97    #[doc(alias = "color")]
98    fn set_color(&self, color: u32) {
99        unsafe {
100            ffi::ges_text_overlay_clip_set_color(self.as_ref().to_glib_none().0, color);
101        }
102    }
103
104    #[doc(alias = "ges_text_overlay_clip_set_font_desc")]
105    #[doc(alias = "font-desc")]
106    fn set_font_desc(&self, font_desc: Option<&str>) {
107        unsafe {
108            ffi::ges_text_overlay_clip_set_font_desc(
109                self.as_ref().to_glib_none().0,
110                font_desc.to_glib_none().0,
111            );
112        }
113    }
114
115    #[doc(alias = "ges_text_overlay_clip_set_halign")]
116    fn set_halign(&self, halign: TextHAlign) {
117        unsafe {
118            ffi::ges_text_overlay_clip_set_halign(
119                self.as_ref().to_glib_none().0,
120                halign.into_glib(),
121            );
122        }
123    }
124
125    #[doc(alias = "ges_text_overlay_clip_set_text")]
126    #[doc(alias = "text")]
127    fn set_text(&self, text: Option<&str>) {
128        unsafe {
129            ffi::ges_text_overlay_clip_set_text(
130                self.as_ref().to_glib_none().0,
131                text.to_glib_none().0,
132            );
133        }
134    }
135
136    #[doc(alias = "ges_text_overlay_clip_set_valign")]
137    fn set_valign(&self, valign: TextVAlign) {
138        unsafe {
139            ffi::ges_text_overlay_clip_set_valign(
140                self.as_ref().to_glib_none().0,
141                valign.into_glib(),
142            );
143        }
144    }
145
146    #[doc(alias = "ges_text_overlay_clip_set_xpos")]
147    #[doc(alias = "xpos")]
148    fn set_xpos(&self, position: f64) {
149        unsafe {
150            ffi::ges_text_overlay_clip_set_xpos(self.as_ref().to_glib_none().0, position);
151        }
152    }
153
154    #[doc(alias = "ges_text_overlay_clip_set_ypos")]
155    #[doc(alias = "ypos")]
156    fn set_ypos(&self, position: f64) {
157        unsafe {
158            ffi::ges_text_overlay_clip_set_ypos(self.as_ref().to_glib_none().0, position);
159        }
160    }
161
162    fn set_halignment(&self, halignment: TextHAlign) {
163        ObjectExt::set_property(self.as_ref(), "halignment", halignment)
164    }
165
166    fn set_valignment(&self, valignment: TextVAlign) {
167        ObjectExt::set_property(self.as_ref(), "valignment", valignment)
168    }
169
170    #[doc(alias = "color")]
171    fn connect_color_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
172        unsafe extern "C" fn notify_color_trampoline<
173            P: IsA<TextOverlayClip>,
174            F: Fn(&P) + 'static,
175        >(
176            this: *mut ffi::GESTextOverlayClip,
177            _param_spec: glib::ffi::gpointer,
178            f: glib::ffi::gpointer,
179        ) {
180            let f: &F = &*(f as *const F);
181            f(TextOverlayClip::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::color".as_ptr() as *const _,
188                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
189                    notify_color_trampoline::<Self, F> as *const (),
190                )),
191                Box_::into_raw(f),
192            )
193        }
194    }
195
196    #[doc(alias = "font-desc")]
197    fn connect_font_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
198        unsafe extern "C" fn notify_font_desc_trampoline<
199            P: IsA<TextOverlayClip>,
200            F: Fn(&P) + 'static,
201        >(
202            this: *mut ffi::GESTextOverlayClip,
203            _param_spec: glib::ffi::gpointer,
204            f: glib::ffi::gpointer,
205        ) {
206            let f: &F = &*(f as *const F);
207            f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref())
208        }
209        unsafe {
210            let f: Box_<F> = Box_::new(f);
211            connect_raw(
212                self.as_ptr() as *mut _,
213                c"notify::font-desc".as_ptr() as *const _,
214                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
215                    notify_font_desc_trampoline::<Self, F> as *const (),
216                )),
217                Box_::into_raw(f),
218            )
219        }
220    }
221
222    #[doc(alias = "halignment")]
223    fn connect_halignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
224        unsafe extern "C" fn notify_halignment_trampoline<
225            P: IsA<TextOverlayClip>,
226            F: Fn(&P) + 'static,
227        >(
228            this: *mut ffi::GESTextOverlayClip,
229            _param_spec: glib::ffi::gpointer,
230            f: glib::ffi::gpointer,
231        ) {
232            let f: &F = &*(f as *const F);
233            f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref())
234        }
235        unsafe {
236            let f: Box_<F> = Box_::new(f);
237            connect_raw(
238                self.as_ptr() as *mut _,
239                c"notify::halignment".as_ptr() as *const _,
240                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
241                    notify_halignment_trampoline::<Self, F> as *const (),
242                )),
243                Box_::into_raw(f),
244            )
245        }
246    }
247
248    #[doc(alias = "text")]
249    fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
250        unsafe extern "C" fn notify_text_trampoline<
251            P: IsA<TextOverlayClip>,
252            F: Fn(&P) + 'static,
253        >(
254            this: *mut ffi::GESTextOverlayClip,
255            _param_spec: glib::ffi::gpointer,
256            f: glib::ffi::gpointer,
257        ) {
258            let f: &F = &*(f as *const F);
259            f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref())
260        }
261        unsafe {
262            let f: Box_<F> = Box_::new(f);
263            connect_raw(
264                self.as_ptr() as *mut _,
265                c"notify::text".as_ptr() as *const _,
266                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
267                    notify_text_trampoline::<Self, F> as *const (),
268                )),
269                Box_::into_raw(f),
270            )
271        }
272    }
273
274    #[doc(alias = "valignment")]
275    fn connect_valignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
276        unsafe extern "C" fn notify_valignment_trampoline<
277            P: IsA<TextOverlayClip>,
278            F: Fn(&P) + 'static,
279        >(
280            this: *mut ffi::GESTextOverlayClip,
281            _param_spec: glib::ffi::gpointer,
282            f: glib::ffi::gpointer,
283        ) {
284            let f: &F = &*(f as *const F);
285            f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref())
286        }
287        unsafe {
288            let f: Box_<F> = Box_::new(f);
289            connect_raw(
290                self.as_ptr() as *mut _,
291                c"notify::valignment".as_ptr() as *const _,
292                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
293                    notify_valignment_trampoline::<Self, F> as *const (),
294                )),
295                Box_::into_raw(f),
296            )
297        }
298    }
299
300    #[doc(alias = "xpos")]
301    fn connect_xpos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
302        unsafe extern "C" fn notify_xpos_trampoline<
303            P: IsA<TextOverlayClip>,
304            F: Fn(&P) + 'static,
305        >(
306            this: *mut ffi::GESTextOverlayClip,
307            _param_spec: glib::ffi::gpointer,
308            f: glib::ffi::gpointer,
309        ) {
310            let f: &F = &*(f as *const F);
311            f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref())
312        }
313        unsafe {
314            let f: Box_<F> = Box_::new(f);
315            connect_raw(
316                self.as_ptr() as *mut _,
317                c"notify::xpos".as_ptr() as *const _,
318                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
319                    notify_xpos_trampoline::<Self, F> as *const (),
320                )),
321                Box_::into_raw(f),
322            )
323        }
324    }
325
326    #[doc(alias = "ypos")]
327    fn connect_ypos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
328        unsafe extern "C" fn notify_ypos_trampoline<
329            P: IsA<TextOverlayClip>,
330            F: Fn(&P) + 'static,
331        >(
332            this: *mut ffi::GESTextOverlayClip,
333            _param_spec: glib::ffi::gpointer,
334            f: glib::ffi::gpointer,
335        ) {
336            let f: &F = &*(f as *const F);
337            f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref())
338        }
339        unsafe {
340            let f: Box_<F> = Box_::new(f);
341            connect_raw(
342                self.as_ptr() as *mut _,
343                c"notify::ypos".as_ptr() as *const _,
344                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
345                    notify_ypos_trampoline::<Self, F> as *const (),
346                )),
347                Box_::into_raw(f),
348            )
349        }
350    }
351}
352
353impl<O: IsA<TextOverlayClip>> TextOverlayClipExt for O {}