2018-10-31 16:10:30 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-10-31 16:10:30 +00:00
|
|
|
// DO NOT EDIT
|
2022-12-05 09:22:14 +00:00
|
|
|
#![allow(deprecated)]
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2023-01-03 18:56:00 +00:00
|
|
|
use crate::{Edge, EditMode, Extractable, Layer, MetaContainer, TimelineElement};
|
|
|
|
use glib::{
|
|
|
|
prelude::*,
|
|
|
|
signal::{connect_raw, SignalHandlerId},
|
|
|
|
translate::*,
|
|
|
|
};
|
|
|
|
use std::{boxed::Box as Box_, mem::transmute};
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GESContainer")]
|
2021-09-19 08:07:33 +00:00
|
|
|
pub struct Container(Object<ffi::GESContainer, ffi::GESContainerClass>) @extends TimelineElement, @implements Extractable, MetaContainer;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::ges_container_get_type(),
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Container {
|
2021-11-16 14:02:58 +00:00
|
|
|
pub const NONE: Option<&'static Container> = None;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_container_group")]
|
2018-10-31 16:10:30 +00:00
|
|
|
pub fn group(containers: &[Container]) -> Option<Container> {
|
|
|
|
assert_initialized_main_thread!();
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib_none(ffi::ges_container_group(containers.to_glib_none().0)) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::IsA<super::Container>> Sealed for T {}
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
pub trait GESContainerExt: IsA<Container> + sealed::Sealed + 'static {
|
|
|
|
#[doc(alias = "ges_container_add")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add(&self, child: &impl IsA<TimelineElement>) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_container_add(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
child.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to add element"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")]
|
2022-12-05 09:22:14 +00:00
|
|
|
#[allow(deprecated)]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "ges_container_edit")]
|
2019-06-18 10:12:00 +00:00
|
|
|
fn edit(
|
|
|
|
&self,
|
|
|
|
layers: &[Layer],
|
|
|
|
new_layer_priority: i32,
|
|
|
|
mode: EditMode,
|
|
|
|
edge: Edge,
|
|
|
|
position: u64,
|
|
|
|
) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_container_edit(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
layers.to_glib_none().0,
|
|
|
|
new_layer_priority,
|
2021-04-27 15:10:39 +00:00
|
|
|
mode.into_glib(),
|
|
|
|
edge.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
position
|
|
|
|
),
|
|
|
|
"Failed to edit container"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "ges_container_get_children")]
|
|
|
|
#[doc(alias = "get_children")]
|
2021-04-19 20:13:58 +00:00
|
|
|
fn children(&self, recursive: bool) -> Vec<TimelineElement> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::ges_container_get_children(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
recursive.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "ges_container_remove")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove(&self, child: &impl IsA<TimelineElement>) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_container_remove(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
child.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to remove element"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "ges_container_ungroup")]
|
2023-01-03 18:56:00 +00:00
|
|
|
fn ungroup(self, recursive: bool) -> Vec<Container> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::ges_container_ungroup(
|
2023-01-03 18:56:00 +00:00
|
|
|
self.upcast().into_glib_ptr(),
|
2021-04-27 15:10:39 +00:00
|
|
|
recursive.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn height(&self) -> u32 {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self.as_ref(), "height")
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "child-added")]
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_child_added<F: Fn(&Self, &TimelineElement) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn child_added_trampoline<
|
|
|
|
P: IsA<Container>,
|
|
|
|
F: Fn(&P, &TimelineElement) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESContainer,
|
|
|
|
element: *mut ffi::GESTimelineElement,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Container::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&from_glib_borrow(element),
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"child-added\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
child_added_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "child-removed")]
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_child_removed<F: Fn(&Self, &TimelineElement) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn child_removed_trampoline<
|
|
|
|
P: IsA<Container>,
|
|
|
|
F: Fn(&P, &TimelineElement) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESContainer,
|
|
|
|
element: *mut ffi::GESTimelineElement,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Container::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&from_glib_borrow(element),
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"child-removed\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
child_removed_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "height")]
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_height_trampoline<P: IsA<Container>, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESContainer,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(Container::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::height\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_height_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-05 18:20:29 +00:00
|
|
|
|
|
|
|
impl<O: IsA<Container>> GESContainerExt for O {}
|