use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::{boxed::Box as Box_, fmt, mem::transmute};
glib::wrapper! {
#[doc(alias = "DzlBoxTheatric")]
pub struct BoxTheatric(Object<ffi::DzlBoxTheatric, ffi::DzlBoxTheatricClass>);
match fn {
type_ => || ffi::dzl_box_theatric_get_type(),
}
}
impl BoxTheatric {
pub fn alpha(&self) -> f64 {
ObjectExt::property(self, "alpha")
}
pub fn set_alpha(&self, alpha: f64) {
ObjectExt::set_property(self, "alpha", alpha)
}
pub fn background(&self) -> Option<glib::GString> {
ObjectExt::property(self, "background")
}
pub fn set_background(&self, background: Option<&str>) {
ObjectExt::set_property(self, "background", background)
}
pub fn height(&self) -> i32 {
ObjectExt::property(self, "height")
}
pub fn set_height(&self, height: i32) {
ObjectExt::set_property(self, "height", height)
}
pub fn icon(&self) -> Option<gio::Icon> {
ObjectExt::property(self, "icon")
}
pub fn set_icon<P: IsA<gio::Icon>>(&self, icon: Option<&P>) {
ObjectExt::set_property(self, "icon", icon)
}
pub fn target(&self) -> Option<gtk::Widget> {
ObjectExt::property(self, "target")
}
pub fn width(&self) -> i32 {
ObjectExt::property(self, "width")
}
pub fn set_width(&self, width: i32) {
ObjectExt::set_property(self, "width", width)
}
pub fn x(&self) -> i32 {
ObjectExt::property(self, "x")
}
pub fn set_x(&self, x: i32) {
ObjectExt::set_property(self, "x", x)
}
pub fn y(&self) -> i32 {
ObjectExt::property(self, "y")
}
pub fn set_y(&self, y: i32) {
ObjectExt::set_property(self, "y", y)
}
#[doc(alias = "alpha")]
pub fn connect_alpha_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_alpha_trampoline<F: Fn(&BoxTheatric) + 'static>(
this: *mut ffi::DzlBoxTheatric,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::alpha\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_alpha_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "background")]
pub fn connect_background_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_background_trampoline<F: Fn(&BoxTheatric) + 'static>(
this: *mut ffi::DzlBoxTheatric,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::background\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_background_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "height")]
pub fn connect_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_height_trampoline<F: Fn(&BoxTheatric) + 'static>(
this: *mut ffi::DzlBoxTheatric,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::height\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_height_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "icon")]
pub fn connect_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_icon_trampoline<F: Fn(&BoxTheatric) + 'static>(
this: *mut ffi::DzlBoxTheatric,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::icon\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_icon_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "width")]
pub fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_width_trampoline<F: Fn(&BoxTheatric) + 'static>(
this: *mut ffi::DzlBoxTheatric,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::width\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_width_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "x")]
pub fn connect_x_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_x_trampoline<F: Fn(&BoxTheatric) + 'static>(
this: *mut ffi::DzlBoxTheatric,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::x\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_x_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "y")]
pub fn connect_y_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_y_trampoline<F: Fn(&BoxTheatric) + 'static>(
this: *mut ffi::DzlBoxTheatric,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::y\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_y_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl fmt::Display for BoxTheatric {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("BoxTheatric")
}
}