use crate::DOMObject;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
glib::wrapper! {
#[doc(alias = "WebKitDOMClientRect")]
pub struct DOMClientRect(Object<ffi::WebKitDOMClientRect, ffi::WebKitDOMClientRectClass>) @extends DOMObject;
match fn {
type_ => || ffi::webkit_dom_client_rect_get_type(),
}
}
impl DOMClientRect {
pub const NONE: Option<&'static DOMClientRect> = None;
}
pub trait DOMClientRectExt: 'static {
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
#[doc(alias = "webkit_dom_client_rect_get_bottom")]
#[doc(alias = "get_bottom")]
fn bottom(&self) -> f32;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
#[doc(alias = "webkit_dom_client_rect_get_height")]
#[doc(alias = "get_height")]
fn height(&self) -> f32;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
#[doc(alias = "webkit_dom_client_rect_get_left")]
#[doc(alias = "get_left")]
fn left(&self) -> f32;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
#[doc(alias = "webkit_dom_client_rect_get_right")]
#[doc(alias = "get_right")]
fn right(&self) -> f32;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
#[doc(alias = "webkit_dom_client_rect_get_top")]
#[doc(alias = "get_top")]
fn top(&self) -> f32;
#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
#[doc(alias = "webkit_dom_client_rect_get_width")]
#[doc(alias = "get_width")]
fn width(&self) -> f32;
fn get_property_bottom(&self) -> f32;
fn get_property_height(&self) -> f32;
fn get_property_left(&self) -> f32;
fn get_property_right(&self) -> f32;
fn get_property_top(&self) -> f32;
fn get_property_width(&self) -> f32;
#[doc(alias = "bottom")]
fn connect_bottom_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "height")]
fn connect_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "left")]
fn connect_left_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "right")]
fn connect_right_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "top")]
fn connect_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "width")]
fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<DOMClientRect>> DOMClientRectExt for O {
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
fn bottom(&self) -> f32 {
unsafe {
ffi::webkit_dom_client_rect_get_bottom(self.as_ref().to_glib_none().0)
}
}
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
fn height(&self) -> f32 {
unsafe {
ffi::webkit_dom_client_rect_get_height(self.as_ref().to_glib_none().0)
}
}
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
fn left(&self) -> f32 {
unsafe {
ffi::webkit_dom_client_rect_get_left(self.as_ref().to_glib_none().0)
}
}
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
fn right(&self) -> f32 {
unsafe {
ffi::webkit_dom_client_rect_get_right(self.as_ref().to_glib_none().0)
}
}
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
fn top(&self) -> f32 {
unsafe {
ffi::webkit_dom_client_rect_get_top(self.as_ref().to_glib_none().0)
}
}
#[cfg(any(feature = "v2_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_18")))]
fn width(&self) -> f32 {
unsafe {
ffi::webkit_dom_client_rect_get_width(self.as_ref().to_glib_none().0)
}
}
fn get_property_bottom(&self) -> f32 {
glib::ObjectExt::property(self.as_ref(), "bottom")
}
fn get_property_height(&self) -> f32 {
glib::ObjectExt::property(self.as_ref(), "height")
}
fn get_property_left(&self) -> f32 {
glib::ObjectExt::property(self.as_ref(), "left")
}
fn get_property_right(&self) -> f32 {
glib::ObjectExt::property(self.as_ref(), "right")
}
fn get_property_top(&self) -> f32 {
glib::ObjectExt::property(self.as_ref(), "top")
}
fn get_property_width(&self) -> f32 {
glib::ObjectExt::property(self.as_ref(), "width")
}
fn connect_bottom_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_bottom_trampoline<P: IsA<DOMClientRect>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMClientRect, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMClientRect::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::bottom\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_bottom_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_height_trampoline<P: IsA<DOMClientRect>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMClientRect, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMClientRect::from_glib_borrow(this).unsafe_cast_ref())
}
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::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_left_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_left_trampoline<P: IsA<DOMClientRect>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMClientRect, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMClientRect::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::left\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_left_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_right_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_right_trampoline<P: IsA<DOMClientRect>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMClientRect, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMClientRect::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::right\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_right_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_top_trampoline<P: IsA<DOMClientRect>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMClientRect, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMClientRect::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::top\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(notify_top_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_width_trampoline<P: IsA<DOMClientRect>, F: Fn(&P) + 'static>(this: *mut ffi::WebKitDOMClientRect, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(DOMClientRect::from_glib_borrow(this).unsafe_cast_ref())
}
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::<Self, F> as *const ())), Box_::into_raw(f))
}
}
}
impl fmt::Display for DOMClientRect {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("DOMClientRect")
}
}