mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 01:21:05 +00:00
Fix new 1.80 clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1496>
This commit is contained in:
parent
3dab797c32
commit
73d9793f5b
10 changed files with 27 additions and 417 deletions
|
@ -208,3 +208,7 @@ required-features = ["windows"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "audio_multichannel_interleave"
|
name = "audio_multichannel_interleave"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "zoom"
|
||||||
|
required-features = ["gst-video/v1_18"]
|
||||||
|
|
|
@ -189,7 +189,7 @@ fn example_main() -> Result<(), Error> {
|
||||||
("Failed to insert sink"),
|
("Failed to insert sink"),
|
||||||
details: gst::Structure::builder("error-details")
|
details: gst::Structure::builder("error-details")
|
||||||
.field("error",
|
.field("error",
|
||||||
&ErrorValue(Arc::new(Mutex::new(Some(err)))))
|
ErrorValue(Arc::new(Mutex::new(Some(err)))))
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ fn example_main() -> Result<(), Error> {
|
||||||
("Failed to insert sink"),
|
("Failed to insert sink"),
|
||||||
details: gst::Structure::builder("error-details")
|
details: gst::Structure::builder("error-details")
|
||||||
.field("error",
|
.field("error",
|
||||||
&ErrorValue(Arc::new(Mutex::new(Some(err)))))
|
ErrorValue(Arc::new(Mutex::new(Some(err)))))
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,6 @@ fn example_main() {
|
||||||
state.clicked = false;
|
state.clicked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(feature = "v1_18")]
|
|
||||||
NavigationEvent::MouseScroll { x, y, delta_y, .. } => {
|
NavigationEvent::MouseScroll { x, y, delta_y, .. } => {
|
||||||
if delta_y > 0.0 {
|
if delta_y > 0.0 {
|
||||||
zoom(mixer_sink_pad, x as i32, y as i32, true);
|
zoom(mixer_sink_pad, x as i32, y as i32, true);
|
||||||
|
|
|
@ -9,24 +9,8 @@ glib::wrapper! {
|
||||||
pub struct FlowCombiner(Shared<ffi::GstFlowCombiner>);
|
pub struct FlowCombiner(Shared<ffi::GstFlowCombiner>);
|
||||||
|
|
||||||
match fn {
|
match fn {
|
||||||
ref => |ptr| {
|
ref => |ptr| ffi::gst_flow_combiner_ref(ptr),
|
||||||
// cfg_if emits code in blocks (curly braces) and `ref` handling inserts a
|
unref => |ptr| ffi::gst_flow_combiner_unref(ptr),
|
||||||
// trailing semicolon to void an optionally returned value. The linter
|
|
||||||
// requests the resulting { ..ref() }; to be simplified making it unsuitable.
|
|
||||||
#[cfg(feature = "v1_12_1")]
|
|
||||||
ffi::gst_flow_combiner_ref(ptr);
|
|
||||||
#[cfg(not(feature = "v1_12_1"))]
|
|
||||||
glib::gobject_ffi::g_boxed_copy(ffi::gst_flow_combiner_get_type(), ptr as *mut _);
|
|
||||||
},
|
|
||||||
unref => |ptr| {
|
|
||||||
cfg_if::cfg_if! {
|
|
||||||
if #[cfg(feature = "v1_12_1")] {
|
|
||||||
ffi::gst_flow_combiner_unref(ptr);
|
|
||||||
} else {
|
|
||||||
glib::gobject_ffi::g_boxed_free(ffi::gst_flow_combiner_get_type(), ptr as *mut _);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
type_ => || ffi::gst_flow_combiner_get_type(),
|
type_ => || ffi::gst_flow_combiner_get_type(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,6 @@ generate = [
|
||||||
"GES.TextOverlay",
|
"GES.TextOverlay",
|
||||||
"GES.TextOverlayClip",
|
"GES.TextOverlayClip",
|
||||||
"GES.TextVAlign",
|
"GES.TextVAlign",
|
||||||
"GES.TitleClip",
|
|
||||||
"GES.TitleSource",
|
"GES.TitleSource",
|
||||||
"GES.TrackType",
|
"GES.TrackType",
|
||||||
"GES.Transition",
|
"GES.Transition",
|
||||||
|
@ -436,6 +435,18 @@ manual_traits = ["TimelineElementExtManual"]
|
||||||
[object.function.return]
|
[object.function.return]
|
||||||
bool_return_is_error = "Failed to trim"
|
bool_return_is_error = "Failed to trim"
|
||||||
|
|
||||||
|
[[object]]
|
||||||
|
name = "GES.TitleClip"
|
||||||
|
status = "generate"
|
||||||
|
[[object.function]]
|
||||||
|
pattern = "[^n].*"
|
||||||
|
# all functions except constructor are deprecated since 1.6
|
||||||
|
ignore = true
|
||||||
|
[[object.property]]
|
||||||
|
pattern = ".*"
|
||||||
|
# all properties are deprecated since 1.6
|
||||||
|
ignore = true
|
||||||
|
|
||||||
[[object]]
|
[[object]]
|
||||||
name = "GES.Track"
|
name = "GES.Track"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
|
|
|
@ -238,7 +238,6 @@ pub(crate) mod traits {
|
||||||
pub use super::text_overlay_clip::TextOverlayClipExt;
|
pub use super::text_overlay_clip::TextOverlayClipExt;
|
||||||
pub use super::timeline::TimelineExt;
|
pub use super::timeline::TimelineExt;
|
||||||
pub use super::timeline_element::TimelineElementExt;
|
pub use super::timeline_element::TimelineElementExt;
|
||||||
pub use super::title_clip::TitleClipExt;
|
|
||||||
pub use super::title_source::TitleSourceExt;
|
pub use super::title_source::TitleSourceExt;
|
||||||
pub use super::track::GESTrackExt;
|
pub use super::track::GESTrackExt;
|
||||||
pub use super::track_element::TrackElementExt;
|
pub use super::track_element::TrackElementExt;
|
||||||
|
|
|
@ -2,18 +2,9 @@
|
||||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||||
// DO NOT EDIT
|
// DO NOT EDIT
|
||||||
#![allow(deprecated)]
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{ffi, Clip, Container, Extractable, MetaContainer, SourceClip, TimelineElement};
|
||||||
ffi, Clip, Container, Extractable, MetaContainer, SourceClip, TextHAlign, TextVAlign,
|
use glib::translate::*;
|
||||||
TimelineElement,
|
|
||||||
};
|
|
||||||
use glib::{
|
|
||||||
prelude::*,
|
|
||||||
signal::{connect_raw, SignalHandlerId},
|
|
||||||
translate::*,
|
|
||||||
};
|
|
||||||
use std::boxed::Box as Box_;
|
|
||||||
|
|
||||||
glib::wrapper! {
|
glib::wrapper! {
|
||||||
#[doc(alias = "GESTitleClip")]
|
#[doc(alias = "GESTitleClip")]
|
||||||
|
@ -33,383 +24,3 @@ impl TitleClip {
|
||||||
unsafe { from_glib_none(ffi::ges_title_clip_new()) }
|
unsafe { from_glib_none(ffi::ges_title_clip_new()) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::TitleClip>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait TitleClipExt: IsA<TitleClip> + sealed::Sealed + 'static {
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_get_background_color")]
|
|
||||||
#[doc(alias = "get_background_color")]
|
|
||||||
fn background_color(&self) -> u32 {
|
|
||||||
unsafe { ffi::ges_title_clip_get_background_color(self.as_ref().to_glib_none().0) }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_get_font_desc")]
|
|
||||||
#[doc(alias = "get_font_desc")]
|
|
||||||
#[doc(alias = "font-desc")]
|
|
||||||
fn font_desc(&self) -> Option<glib::GString> {
|
|
||||||
unsafe {
|
|
||||||
from_glib_full(ffi::ges_title_clip_get_font_desc(
|
|
||||||
self.as_ref().to_glib_none().0,
|
|
||||||
))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_get_halignment")]
|
|
||||||
#[doc(alias = "get_halignment")]
|
|
||||||
fn halignment(&self) -> TextHAlign {
|
|
||||||
unsafe {
|
|
||||||
from_glib(ffi::ges_title_clip_get_halignment(
|
|
||||||
self.as_ref().to_glib_none().0,
|
|
||||||
))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_get_text")]
|
|
||||||
#[doc(alias = "get_text")]
|
|
||||||
fn text(&self) -> Option<glib::GString> {
|
|
||||||
unsafe { from_glib_full(ffi::ges_title_clip_get_text(self.as_ref().to_glib_none().0)) }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_get_text_color")]
|
|
||||||
#[doc(alias = "get_text_color")]
|
|
||||||
fn text_color(&self) -> u32 {
|
|
||||||
unsafe { ffi::ges_title_clip_get_text_color(self.as_ref().to_glib_none().0) }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_get_valignment")]
|
|
||||||
#[doc(alias = "get_valignment")]
|
|
||||||
fn valignment(&self) -> TextVAlign {
|
|
||||||
unsafe {
|
|
||||||
from_glib(ffi::ges_title_clip_get_valignment(
|
|
||||||
self.as_ref().to_glib_none().0,
|
|
||||||
))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_get_xpos")]
|
|
||||||
#[doc(alias = "get_xpos")]
|
|
||||||
fn xpos(&self) -> f64 {
|
|
||||||
unsafe { ffi::ges_title_clip_get_xpos(self.as_ref().to_glib_none().0) }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_get_ypos")]
|
|
||||||
#[doc(alias = "get_ypos")]
|
|
||||||
fn ypos(&self) -> f64 {
|
|
||||||
unsafe { ffi::ges_title_clip_get_ypos(self.as_ref().to_glib_none().0) }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_set_background")]
|
|
||||||
#[doc(alias = "background")]
|
|
||||||
fn set_background(&self, background: u32) {
|
|
||||||
unsafe {
|
|
||||||
ffi::ges_title_clip_set_background(self.as_ref().to_glib_none().0, background);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_set_color")]
|
|
||||||
#[doc(alias = "color")]
|
|
||||||
fn set_color(&self, color: u32) {
|
|
||||||
unsafe {
|
|
||||||
ffi::ges_title_clip_set_color(self.as_ref().to_glib_none().0, color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_set_font_desc")]
|
|
||||||
#[doc(alias = "font-desc")]
|
|
||||||
fn set_font_desc(&self, font_desc: Option<&str>) {
|
|
||||||
unsafe {
|
|
||||||
ffi::ges_title_clip_set_font_desc(
|
|
||||||
self.as_ref().to_glib_none().0,
|
|
||||||
font_desc.to_glib_none().0,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_set_halignment")]
|
|
||||||
#[doc(alias = "halignment")]
|
|
||||||
fn set_halignment(&self, halign: TextHAlign) {
|
|
||||||
unsafe {
|
|
||||||
ffi::ges_title_clip_set_halignment(self.as_ref().to_glib_none().0, halign.into_glib());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_set_text")]
|
|
||||||
#[doc(alias = "text")]
|
|
||||||
fn set_text(&self, text: Option<&str>) {
|
|
||||||
unsafe {
|
|
||||||
ffi::ges_title_clip_set_text(self.as_ref().to_glib_none().0, text.to_glib_none().0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_set_valignment")]
|
|
||||||
#[doc(alias = "valignment")]
|
|
||||||
fn set_valignment(&self, valign: TextVAlign) {
|
|
||||||
unsafe {
|
|
||||||
ffi::ges_title_clip_set_valignment(self.as_ref().to_glib_none().0, valign.into_glib());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_set_xpos")]
|
|
||||||
#[doc(alias = "xpos")]
|
|
||||||
fn set_xpos(&self, position: f64) {
|
|
||||||
unsafe {
|
|
||||||
ffi::ges_title_clip_set_xpos(self.as_ref().to_glib_none().0, position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[allow(deprecated)]
|
|
||||||
#[doc(alias = "ges_title_clip_set_ypos")]
|
|
||||||
#[doc(alias = "ypos")]
|
|
||||||
fn set_ypos(&self, position: f64) {
|
|
||||||
unsafe {
|
|
||||||
ffi::ges_title_clip_set_ypos(self.as_ref().to_glib_none().0, position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
|
|
||||||
fn background(&self) -> u32 {
|
|
||||||
ObjectExt::property(self.as_ref(), "background")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
|
|
||||||
fn color(&self) -> u32 {
|
|
||||||
ObjectExt::property(self.as_ref(), "color")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[doc(alias = "background")]
|
|
||||||
fn connect_background_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
||||||
unsafe extern "C" fn notify_background_trampoline<
|
|
||||||
P: IsA<TitleClip>,
|
|
||||||
F: Fn(&P) + 'static,
|
|
||||||
>(
|
|
||||||
this: *mut ffi::GESTitleClip,
|
|
||||||
_param_spec: glib::ffi::gpointer,
|
|
||||||
f: glib::ffi::gpointer,
|
|
||||||
) {
|
|
||||||
let f: &F = &*(f as *const F);
|
|
||||||
f(TitleClip::from_glib_borrow(this).unsafe_cast_ref())
|
|
||||||
}
|
|
||||||
unsafe {
|
|
||||||
let f: Box_<F> = Box_::new(f);
|
|
||||||
connect_raw(
|
|
||||||
self.as_ptr() as *mut _,
|
|
||||||
b"notify::background\0".as_ptr() as *const _,
|
|
||||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
|
||||||
notify_background_trampoline::<Self, F> as *const (),
|
|
||||||
)),
|
|
||||||
Box_::into_raw(f),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[doc(alias = "color")]
|
|
||||||
fn connect_color_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
||||||
unsafe extern "C" fn notify_color_trampoline<P: IsA<TitleClip>, F: Fn(&P) + 'static>(
|
|
||||||
this: *mut ffi::GESTitleClip,
|
|
||||||
_param_spec: glib::ffi::gpointer,
|
|
||||||
f: glib::ffi::gpointer,
|
|
||||||
) {
|
|
||||||
let f: &F = &*(f as *const F);
|
|
||||||
f(TitleClip::from_glib_borrow(this).unsafe_cast_ref())
|
|
||||||
}
|
|
||||||
unsafe {
|
|
||||||
let f: Box_<F> = Box_::new(f);
|
|
||||||
connect_raw(
|
|
||||||
self.as_ptr() as *mut _,
|
|
||||||
b"notify::color\0".as_ptr() as *const _,
|
|
||||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
|
||||||
notify_color_trampoline::<Self, F> as *const (),
|
|
||||||
)),
|
|
||||||
Box_::into_raw(f),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[doc(alias = "font-desc")]
|
|
||||||
fn connect_font_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
||||||
unsafe extern "C" fn notify_font_desc_trampoline<P: IsA<TitleClip>, F: Fn(&P) + 'static>(
|
|
||||||
this: *mut ffi::GESTitleClip,
|
|
||||||
_param_spec: glib::ffi::gpointer,
|
|
||||||
f: glib::ffi::gpointer,
|
|
||||||
) {
|
|
||||||
let f: &F = &*(f as *const F);
|
|
||||||
f(TitleClip::from_glib_borrow(this).unsafe_cast_ref())
|
|
||||||
}
|
|
||||||
unsafe {
|
|
||||||
let f: Box_<F> = Box_::new(f);
|
|
||||||
connect_raw(
|
|
||||||
self.as_ptr() as *mut _,
|
|
||||||
b"notify::font-desc\0".as_ptr() as *const _,
|
|
||||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
|
||||||
notify_font_desc_trampoline::<Self, F> as *const (),
|
|
||||||
)),
|
|
||||||
Box_::into_raw(f),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[doc(alias = "halignment")]
|
|
||||||
fn connect_halignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
||||||
unsafe extern "C" fn notify_halignment_trampoline<
|
|
||||||
P: IsA<TitleClip>,
|
|
||||||
F: Fn(&P) + 'static,
|
|
||||||
>(
|
|
||||||
this: *mut ffi::GESTitleClip,
|
|
||||||
_param_spec: glib::ffi::gpointer,
|
|
||||||
f: glib::ffi::gpointer,
|
|
||||||
) {
|
|
||||||
let f: &F = &*(f as *const F);
|
|
||||||
f(TitleClip::from_glib_borrow(this).unsafe_cast_ref())
|
|
||||||
}
|
|
||||||
unsafe {
|
|
||||||
let f: Box_<F> = Box_::new(f);
|
|
||||||
connect_raw(
|
|
||||||
self.as_ptr() as *mut _,
|
|
||||||
b"notify::halignment\0".as_ptr() as *const _,
|
|
||||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
|
||||||
notify_halignment_trampoline::<Self, F> as *const (),
|
|
||||||
)),
|
|
||||||
Box_::into_raw(f),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[doc(alias = "text")]
|
|
||||||
fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
||||||
unsafe extern "C" fn notify_text_trampoline<P: IsA<TitleClip>, F: Fn(&P) + 'static>(
|
|
||||||
this: *mut ffi::GESTitleClip,
|
|
||||||
_param_spec: glib::ffi::gpointer,
|
|
||||||
f: glib::ffi::gpointer,
|
|
||||||
) {
|
|
||||||
let f: &F = &*(f as *const F);
|
|
||||||
f(TitleClip::from_glib_borrow(this).unsafe_cast_ref())
|
|
||||||
}
|
|
||||||
unsafe {
|
|
||||||
let f: Box_<F> = Box_::new(f);
|
|
||||||
connect_raw(
|
|
||||||
self.as_ptr() as *mut _,
|
|
||||||
b"notify::text\0".as_ptr() as *const _,
|
|
||||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
|
||||||
notify_text_trampoline::<Self, F> as *const (),
|
|
||||||
)),
|
|
||||||
Box_::into_raw(f),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[doc(alias = "valignment")]
|
|
||||||
fn connect_valignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
||||||
unsafe extern "C" fn notify_valignment_trampoline<
|
|
||||||
P: IsA<TitleClip>,
|
|
||||||
F: Fn(&P) + 'static,
|
|
||||||
>(
|
|
||||||
this: *mut ffi::GESTitleClip,
|
|
||||||
_param_spec: glib::ffi::gpointer,
|
|
||||||
f: glib::ffi::gpointer,
|
|
||||||
) {
|
|
||||||
let f: &F = &*(f as *const F);
|
|
||||||
f(TitleClip::from_glib_borrow(this).unsafe_cast_ref())
|
|
||||||
}
|
|
||||||
unsafe {
|
|
||||||
let f: Box_<F> = Box_::new(f);
|
|
||||||
connect_raw(
|
|
||||||
self.as_ptr() as *mut _,
|
|
||||||
b"notify::valignment\0".as_ptr() as *const _,
|
|
||||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
|
||||||
notify_valignment_trampoline::<Self, F> as *const (),
|
|
||||||
)),
|
|
||||||
Box_::into_raw(f),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[doc(alias = "xpos")]
|
|
||||||
fn connect_xpos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
||||||
unsafe extern "C" fn notify_xpos_trampoline<P: IsA<TitleClip>, F: Fn(&P) + 'static>(
|
|
||||||
this: *mut ffi::GESTitleClip,
|
|
||||||
_param_spec: glib::ffi::gpointer,
|
|
||||||
f: glib::ffi::gpointer,
|
|
||||||
) {
|
|
||||||
let f: &F = &*(f as *const F);
|
|
||||||
f(TitleClip::from_glib_borrow(this).unsafe_cast_ref())
|
|
||||||
}
|
|
||||||
unsafe {
|
|
||||||
let f: Box_<F> = Box_::new(f);
|
|
||||||
connect_raw(
|
|
||||||
self.as_ptr() as *mut _,
|
|
||||||
b"notify::xpos\0".as_ptr() as *const _,
|
|
||||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
|
||||||
notify_xpos_trampoline::<Self, F> as *const (),
|
|
||||||
)),
|
|
||||||
Box_::into_raw(f),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Since 1.6"]
|
|
||||||
#[doc(alias = "ypos")]
|
|
||||||
fn connect_ypos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
||||||
unsafe extern "C" fn notify_ypos_trampoline<P: IsA<TitleClip>, F: Fn(&P) + 'static>(
|
|
||||||
this: *mut ffi::GESTitleClip,
|
|
||||||
_param_spec: glib::ffi::gpointer,
|
|
||||||
f: glib::ffi::gpointer,
|
|
||||||
) {
|
|
||||||
let f: &F = &*(f as *const F);
|
|
||||||
f(TitleClip::from_glib_borrow(this).unsafe_cast_ref())
|
|
||||||
}
|
|
||||||
unsafe {
|
|
||||||
let f: Box_<F> = Box_::new(f);
|
|
||||||
connect_raw(
|
|
||||||
self.as_ptr() as *mut _,
|
|
||||||
b"notify::ypos\0".as_ptr() as *const _,
|
|
||||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
|
||||||
notify_ypos_trampoline::<Self, F> as *const (),
|
|
||||||
)),
|
|
||||||
Box_::into_raw(f),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<O: IsA<TitleClip>> TitleClipExt for O {}
|
|
||||||
|
|
|
@ -1002,7 +1002,8 @@ macro_rules! log_with_level(
|
||||||
// FIXME: Once there's a function_name! macro that returns a string literal we can
|
// FIXME: Once there's a function_name! macro that returns a string literal we can
|
||||||
// directly pass it as `&GStr` forward
|
// directly pass it as `&GStr` forward
|
||||||
|
|
||||||
let obj = unsafe { $obj.unsafe_cast_ref::<$crate::glib::Object>() };
|
let obj = &$obj;
|
||||||
|
let obj = unsafe { obj.unsafe_cast_ref::<$crate::glib::Object>() };
|
||||||
let function_name = $crate::glib::function_name!();
|
let function_name = $crate::glib::function_name!();
|
||||||
|
|
||||||
// Check if formatting is necessary or not
|
// Check if formatting is necessary or not
|
||||||
|
@ -1045,7 +1046,8 @@ macro_rules! log_with_level(
|
||||||
// FIXME: Once there's a function_name! macro that returns a string literal we can
|
// FIXME: Once there's a function_name! macro that returns a string literal we can
|
||||||
// directly pass it as `&GStr` forward
|
// directly pass it as `&GStr` forward
|
||||||
|
|
||||||
let obj = unsafe { $obj.unsafe_cast_ref::<$crate::glib::Object>() };
|
let obj = &$obj;
|
||||||
|
let obj = unsafe { obj.unsafe_cast_ref::<$crate::glib::Object>() };
|
||||||
$crate::DebugCategory::log_unfiltered(
|
$crate::DebugCategory::log_unfiltered(
|
||||||
cat,
|
cat,
|
||||||
Some(obj),
|
Some(obj),
|
||||||
|
|
|
@ -1276,7 +1276,7 @@ mod tests {
|
||||||
assert_eq!(s.name(), "test");
|
assert_eq!(s.name(), "test");
|
||||||
|
|
||||||
s.set("f1", "abc");
|
s.set("f1", "abc");
|
||||||
s.set("f2", &String::from("bcd"));
|
s.set("f2", String::from("bcd"));
|
||||||
s.set("f3", 123i32);
|
s.set("f3", 123i32);
|
||||||
s.set("f5", Some("efg"));
|
s.set("f5", Some("efg"));
|
||||||
s.set("f7", 42i32);
|
s.set("f7", 42i32);
|
||||||
|
|
Loading…
Reference in a new issue