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)
|
|
|
|
// DO NOT EDIT
|
|
|
|
|
2019-03-19 07:40:05 +00:00
|
|
|
use ges_sys;
|
2019-12-17 19:00:42 +00:00
|
|
|
use glib;
|
2019-01-16 11:32:39 +00:00
|
|
|
use glib::object::Cast;
|
2018-10-31 16:10:30 +00:00
|
|
|
use glib::object::IsA;
|
2018-12-08 09:05:20 +00:00
|
|
|
use glib::signal::connect_raw;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::signal::SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
use glib::translate::*;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::GString;
|
|
|
|
use glib::StaticType;
|
|
|
|
use glib::Value;
|
2019-03-19 07:40:05 +00:00
|
|
|
use glib_sys;
|
|
|
|
use gobject_sys;
|
2018-10-31 16:10:30 +00:00
|
|
|
use std::boxed::Box as Box_;
|
2019-06-18 10:12:00 +00:00
|
|
|
use Clip;
|
|
|
|
use Container;
|
|
|
|
use Extractable;
|
|
|
|
use TimelineElement;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
glib_wrapper! {
|
2019-03-19 07:40:05 +00:00
|
|
|
pub struct UriClip(Object<ges_sys::GESUriClip, ges_sys::GESUriClipClass, UriClipClass>) @extends Clip, Container, TimelineElement, @implements Extractable;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
match fn {
|
2019-03-19 07:40:05 +00:00
|
|
|
get_type => || ges_sys::ges_uri_clip_get_type(),
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl UriClip {
|
2019-12-17 19:00:42 +00:00
|
|
|
pub fn new(uri: &str) -> Result<UriClip, glib::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
assert_initialized_main_thread!();
|
2019-12-17 19:00:42 +00:00
|
|
|
unsafe {
|
|
|
|
Option::<_>::from_glib_none(ges_sys::ges_uri_clip_new(uri.to_glib_none().0))
|
|
|
|
.ok_or_else(|| glib_bool_error!("Failed to create Uri clip from Uri"))
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
pub const NONE_URI_CLIP: Option<&UriClip> = None;
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait UriClipExt: 'static {
|
2018-12-09 16:06:12 +00:00
|
|
|
fn get_uri(&self) -> Option<GString>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
fn is_image(&self) -> bool;
|
|
|
|
|
|
|
|
fn is_muted(&self) -> bool;
|
|
|
|
|
|
|
|
fn set_is_image(&self, is_image: bool);
|
|
|
|
|
|
|
|
fn set_mute(&self, mute: bool);
|
|
|
|
|
|
|
|
fn get_property_is_image(&self) -> bool;
|
|
|
|
|
|
|
|
fn get_property_mute(&self) -> bool;
|
|
|
|
|
|
|
|
fn connect_property_is_image_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
|
|
|
fn connect_property_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
impl<O: IsA<UriClip>> UriClipExt for O {
|
2018-12-09 16:06:12 +00:00
|
|
|
fn get_uri(&self) -> Option<GString> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_none(ges_sys::ges_uri_clip_get_uri(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn is_image(&self) -> bool {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(ges_sys::ges_uri_clip_is_image(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn is_muted(&self) -> bool {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(ges_sys::ges_uri_clip_is_muted(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_is_image(&self, is_image: bool) {
|
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
ges_sys::ges_uri_clip_set_is_image(self.as_ref().to_glib_none().0, is_image.to_glib());
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_mute(&self, mute: bool) {
|
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
ges_sys::ges_uri_clip_set_mute(self.as_ref().to_glib_none().0, mute.to_glib());
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_property_is_image(&self) -> bool {
|
|
|
|
unsafe {
|
|
|
|
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
|
|
|
b"is-image\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `is-image` getter")
|
|
|
|
.unwrap()
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_property_mute(&self) -> bool {
|
|
|
|
unsafe {
|
|
|
|
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
|
|
|
b"mute\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `mute` getter")
|
|
|
|
.unwrap()
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_is_image_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn notify_is_image_trampoline<P, F: Fn(&P) + 'static>(
|
|
|
|
this: *mut ges_sys::GESUriClip,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<UriClip>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&UriClip::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::is-image\0".as_ptr() as *const _,
|
2020-04-12 15:55:06 +00:00
|
|
|
Some(*(¬ify_is_image_trampoline::<Self, F> as *const _ as *const _)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn notify_mute_trampoline<P, F: Fn(&P) + 'static>(
|
|
|
|
this: *mut ges_sys::GESUriClip,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<UriClip>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&UriClip::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::mute\0".as_ptr() as *const _,
|
2020-04-12 15:55:06 +00:00
|
|
|
Some(*(¬ify_mute_trampoline::<Self, F> as *const _ as *const _)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_supported_formats_trampoline<P, F: Fn(&P) + 'static>(
|
|
|
|
this: *mut ges_sys::GESUriClip,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<UriClip>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&UriClip::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::supported-formats\0".as_ptr() as *const _,
|
2020-04-12 15:55:06 +00:00
|
|
|
Some(*(¬ify_supported_formats_trampoline::<Self, F> as *const _ as *const _)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|