#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
use crate::Position;
use crate::{ffi, Area, Frame, Widget};
use glib::{
object::ObjectType as _,
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::boxed::Box as Box_;
glib::wrapper! {
#[doc(alias = "PanelDock")]
pub struct Dock(Object<ffi::PanelDock, ffi::PanelDockClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
match fn {
type_ => || ffi::panel_dock_get_type(),
}
}
impl Dock {
pub const NONE: Option<&'static Dock> = None;
#[doc(alias = "panel_dock_new")]
pub fn new() -> Dock {
assert_initialized_main_thread!();
unsafe { gtk::Widget::from_glib_none(ffi::panel_dock_new()).unsafe_cast() }
}
pub fn builder() -> DockBuilder {
DockBuilder::new()
}
}
impl Default for Dock {
fn default() -> Self {
Self::new()
}
}
#[must_use = "The builder must be built to be used"]
pub struct DockBuilder {
builder: glib::object::ObjectBuilder<'static, Dock>,
}
impl DockBuilder {
fn new() -> Self {
Self {
builder: glib::object::Object::builder(),
}
}
pub fn bottom_height(self, bottom_height: i32) -> Self {
Self {
builder: self.builder.property("bottom-height", bottom_height),
}
}
pub fn end_width(self, end_width: i32) -> Self {
Self {
builder: self.builder.property("end-width", end_width),
}
}
pub fn reveal_bottom(self, reveal_bottom: bool) -> Self {
Self {
builder: self.builder.property("reveal-bottom", reveal_bottom),
}
}
pub fn reveal_end(self, reveal_end: bool) -> Self {
Self {
builder: self.builder.property("reveal-end", reveal_end),
}
}
pub fn reveal_start(self, reveal_start: bool) -> Self {
Self {
builder: self.builder.property("reveal-start", reveal_start),
}
}
pub fn reveal_top(self, reveal_top: bool) -> Self {
Self {
builder: self.builder.property("reveal-top", reveal_top),
}
}
pub fn start_width(self, start_width: i32) -> Self {
Self {
builder: self.builder.property("start-width", start_width),
}
}
pub fn top_height(self, top_height: i32) -> Self {
Self {
builder: self.builder.property("top-height", top_height),
}
}
pub fn can_focus(self, can_focus: bool) -> Self {
Self {
builder: self.builder.property("can-focus", can_focus),
}
}
pub fn can_target(self, can_target: bool) -> Self {
Self {
builder: self.builder.property("can-target", can_target),
}
}
pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
Self {
builder: self.builder.property("css-classes", css_classes.into()),
}
}
pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
Self {
builder: self.builder.property("css-name", css_name.into()),
}
}
pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
Self {
builder: self.builder.property("cursor", cursor.clone()),
}
}
pub fn focus_on_click(self, focus_on_click: bool) -> Self {
Self {
builder: self.builder.property("focus-on-click", focus_on_click),
}
}
pub fn focusable(self, focusable: bool) -> Self {
Self {
builder: self.builder.property("focusable", focusable),
}
}
pub fn halign(self, halign: gtk::Align) -> Self {
Self {
builder: self.builder.property("halign", halign),
}
}
pub fn has_tooltip(self, has_tooltip: bool) -> Self {
Self {
builder: self.builder.property("has-tooltip", has_tooltip),
}
}
pub fn height_request(self, height_request: i32) -> Self {
Self {
builder: self.builder.property("height-request", height_request),
}
}
pub fn hexpand(self, hexpand: bool) -> Self {
Self {
builder: self.builder.property("hexpand", hexpand),
}
}
pub fn hexpand_set(self, hexpand_set: bool) -> Self {
Self {
builder: self.builder.property("hexpand-set", hexpand_set),
}
}
pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
Self {
builder: self
.builder
.property("layout-manager", layout_manager.clone().upcast()),
}
}
#[cfg(feature = "gtk_v4_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
pub fn limit_events(self, limit_events: bool) -> Self {
Self {
builder: self.builder.property("limit-events", limit_events),
}
}
pub fn margin_bottom(self, margin_bottom: i32) -> Self {
Self {
builder: self.builder.property("margin-bottom", margin_bottom),
}
}
pub fn margin_end(self, margin_end: i32) -> Self {
Self {
builder: self.builder.property("margin-end", margin_end),
}
}
pub fn margin_start(self, margin_start: i32) -> Self {
Self {
builder: self.builder.property("margin-start", margin_start),
}
}
pub fn margin_top(self, margin_top: i32) -> Self {
Self {
builder: self.builder.property("margin-top", margin_top),
}
}
pub fn name(self, name: impl Into<glib::GString>) -> Self {
Self {
builder: self.builder.property("name", name.into()),
}
}
pub fn opacity(self, opacity: f64) -> Self {
Self {
builder: self.builder.property("opacity", opacity),
}
}
pub fn overflow(self, overflow: gtk::Overflow) -> Self {
Self {
builder: self.builder.property("overflow", overflow),
}
}
pub fn receives_default(self, receives_default: bool) -> Self {
Self {
builder: self.builder.property("receives-default", receives_default),
}
}
pub fn sensitive(self, sensitive: bool) -> Self {
Self {
builder: self.builder.property("sensitive", sensitive),
}
}
pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
Self {
builder: self
.builder
.property("tooltip-markup", tooltip_markup.into()),
}
}
pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
Self {
builder: self.builder.property("tooltip-text", tooltip_text.into()),
}
}
pub fn valign(self, valign: gtk::Align) -> Self {
Self {
builder: self.builder.property("valign", valign),
}
}
pub fn vexpand(self, vexpand: bool) -> Self {
Self {
builder: self.builder.property("vexpand", vexpand),
}
}
pub fn vexpand_set(self, vexpand_set: bool) -> Self {
Self {
builder: self.builder.property("vexpand-set", vexpand_set),
}
}
pub fn visible(self, visible: bool) -> Self {
Self {
builder: self.builder.property("visible", visible),
}
}
pub fn width_request(self, width_request: i32) -> Self {
Self {
builder: self.builder.property("width-request", width_request),
}
}
pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
Self {
builder: self.builder.property("accessible-role", accessible_role),
}
}
#[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
pub fn build(self) -> Dock {
assert_initialized_main_thread!();
self.builder.build()
}
}
pub trait DockExt: IsA<Dock> + 'static {
#[doc(alias = "panel_dock_foreach_frame")]
fn foreach_frame<P: FnMut(&Frame)>(&self, callback: P) {
let mut callback_data: P = callback;
unsafe extern "C" fn callback_func<P: FnMut(&Frame)>(
frame: *mut ffi::PanelFrame,
user_data: glib::ffi::gpointer,
) {
unsafe {
let frame = from_glib_borrow(frame);
let callback = user_data as *mut P;
(*callback)(&frame)
}
}
let callback = Some(callback_func::<P> as _);
let super_callback0: &mut P = &mut callback_data;
unsafe {
ffi::panel_dock_foreach_frame(
self.as_ref().to_glib_none().0,
callback,
super_callback0 as *mut _ as *mut _,
);
}
}
#[doc(alias = "panel_dock_get_can_reveal_area")]
#[doc(alias = "get_can_reveal_area")]
fn can_reveal_area(&self, area: Area) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_can_reveal_area(
self.as_ref().to_glib_none().0,
area.into_glib(),
))
}
}
#[doc(alias = "panel_dock_get_can_reveal_bottom")]
#[doc(alias = "get_can_reveal_bottom")]
#[doc(alias = "can-reveal-bottom")]
fn can_reveal_bottom(&self) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_can_reveal_bottom(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "panel_dock_get_can_reveal_end")]
#[doc(alias = "get_can_reveal_end")]
#[doc(alias = "can-reveal-end")]
fn can_reveal_end(&self) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_can_reveal_end(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "panel_dock_get_can_reveal_start")]
#[doc(alias = "get_can_reveal_start")]
#[doc(alias = "can-reveal-start")]
fn can_reveal_start(&self) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_can_reveal_start(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "panel_dock_get_can_reveal_top")]
#[doc(alias = "get_can_reveal_top")]
#[doc(alias = "can-reveal-top")]
fn can_reveal_top(&self) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_can_reveal_top(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "panel_dock_get_reveal_area")]
#[doc(alias = "get_reveal_area")]
fn reveals_area(&self, area: Area) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_reveal_area(
self.as_ref().to_glib_none().0,
area.into_glib(),
))
}
}
#[doc(alias = "panel_dock_get_reveal_bottom")]
#[doc(alias = "get_reveal_bottom")]
#[doc(alias = "reveal-bottom")]
fn reveals_bottom(&self) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_reveal_bottom(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "panel_dock_get_reveal_end")]
#[doc(alias = "get_reveal_end")]
#[doc(alias = "reveal-end")]
fn reveals_end(&self) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_reveal_end(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "panel_dock_get_reveal_start")]
#[doc(alias = "get_reveal_start")]
#[doc(alias = "reveal-start")]
fn reveals_start(&self) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_reveal_start(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "panel_dock_get_reveal_top")]
#[doc(alias = "get_reveal_top")]
#[doc(alias = "reveal-top")]
fn reveals_top(&self) -> bool {
unsafe {
from_glib(ffi::panel_dock_get_reveal_top(
self.as_ref().to_glib_none().0,
))
}
}
#[doc(alias = "panel_dock_remove")]
fn remove(&self, widget: &impl IsA<gtk::Widget>) {
unsafe {
ffi::panel_dock_remove(
self.as_ref().to_glib_none().0,
widget.as_ref().to_glib_none().0,
);
}
}
#[doc(alias = "panel_dock_set_bottom_height")]
#[doc(alias = "bottom-height")]
fn set_bottom_height(&self, height: i32) {
unsafe {
ffi::panel_dock_set_bottom_height(self.as_ref().to_glib_none().0, height);
}
}
#[doc(alias = "panel_dock_set_end_width")]
#[doc(alias = "end-width")]
fn set_end_width(&self, width: i32) {
unsafe {
ffi::panel_dock_set_end_width(self.as_ref().to_glib_none().0, width);
}
}
#[doc(alias = "panel_dock_set_reveal_area")]
fn set_reveal_area(&self, area: Area, reveal: bool) {
unsafe {
ffi::panel_dock_set_reveal_area(
self.as_ref().to_glib_none().0,
area.into_glib(),
reveal.into_glib(),
);
}
}
#[doc(alias = "panel_dock_set_reveal_bottom")]
#[doc(alias = "reveal-bottom")]
fn set_reveal_bottom(&self, reveal_bottom: bool) {
unsafe {
ffi::panel_dock_set_reveal_bottom(
self.as_ref().to_glib_none().0,
reveal_bottom.into_glib(),
);
}
}
#[doc(alias = "panel_dock_set_reveal_end")]
#[doc(alias = "reveal-end")]
fn set_reveal_end(&self, reveal_end: bool) {
unsafe {
ffi::panel_dock_set_reveal_end(self.as_ref().to_glib_none().0, reveal_end.into_glib());
}
}
#[doc(alias = "panel_dock_set_reveal_start")]
#[doc(alias = "reveal-start")]
fn set_reveal_start(&self, reveal_start: bool) {
unsafe {
ffi::panel_dock_set_reveal_start(
self.as_ref().to_glib_none().0,
reveal_start.into_glib(),
);
}
}
#[doc(alias = "panel_dock_set_reveal_top")]
#[doc(alias = "reveal-top")]
fn set_reveal_top(&self, reveal_top: bool) {
unsafe {
ffi::panel_dock_set_reveal_top(self.as_ref().to_glib_none().0, reveal_top.into_glib());
}
}
#[doc(alias = "panel_dock_set_start_width")]
#[doc(alias = "start-width")]
fn set_start_width(&self, width: i32) {
unsafe {
ffi::panel_dock_set_start_width(self.as_ref().to_glib_none().0, width);
}
}
#[doc(alias = "panel_dock_set_top_height")]
#[doc(alias = "top-height")]
fn set_top_height(&self, height: i32) {
unsafe {
ffi::panel_dock_set_top_height(self.as_ref().to_glib_none().0, height);
}
}
#[doc(alias = "bottom-height")]
fn bottom_height(&self) -> i32 {
ObjectExt::property(self.as_ref(), "bottom-height")
}
#[doc(alias = "end-width")]
fn end_width(&self) -> i32 {
ObjectExt::property(self.as_ref(), "end-width")
}
#[doc(alias = "start-width")]
fn start_width(&self) -> i32 {
ObjectExt::property(self.as_ref(), "start-width")
}
#[doc(alias = "top-height")]
fn top_height(&self) -> i32 {
ObjectExt::property(self.as_ref(), "top-height")
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "adopt-widget")]
fn connect_adopt_widget<F: Fn(&Self, &Widget) -> bool + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn adopt_widget_trampoline<
P: IsA<Dock>,
F: Fn(&P, &Widget) -> bool + 'static,
>(
this: *mut ffi::PanelDock,
widget: *mut ffi::PanelWidget,
f: glib::ffi::gpointer,
) -> glib::ffi::gboolean {
unsafe {
let f: &F = &*(f as *const F);
f(
Dock::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(widget),
)
.into_glib()
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"adopt-widget".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
adopt_widget_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "create-frame")]
fn connect_create_frame<F: Fn(&Self, &Position) -> Frame + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn create_frame_trampoline<
P: IsA<Dock>,
F: Fn(&P, &Position) -> Frame + 'static,
>(
this: *mut ffi::PanelDock,
position: *mut ffi::PanelPosition,
f: glib::ffi::gpointer,
) -> *mut ffi::PanelFrame {
unsafe {
let f: &F = &*(f as *const F);
f(
Dock::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(position),
)
.to_glib_full()
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"create-frame".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
create_frame_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "panel-drag-begin")]
fn connect_panel_drag_begin<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn panel_drag_begin_trampoline<
P: IsA<Dock>,
F: Fn(&P, &Widget) + 'static,
>(
this: *mut ffi::PanelDock,
panel: *mut ffi::PanelWidget,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(
Dock::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(panel),
)
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"panel-drag-begin".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
panel_drag_begin_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "panel-drag-end")]
fn connect_panel_drag_end<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn panel_drag_end_trampoline<
P: IsA<Dock>,
F: Fn(&P, &Widget) + 'static,
>(
this: *mut ffi::PanelDock,
panel: *mut ffi::PanelWidget,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(
Dock::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(panel),
)
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"panel-drag-end".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
panel_drag_end_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "bottom-height")]
fn connect_bottom_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_bottom_height_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::bottom-height".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_bottom_height_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "can-reveal-bottom")]
fn connect_can_reveal_bottom_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_can_reveal_bottom_trampoline<
P: IsA<Dock>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::can-reveal-bottom".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_can_reveal_bottom_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "can-reveal-end")]
fn connect_can_reveal_end_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_can_reveal_end_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::can-reveal-end".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_can_reveal_end_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "can-reveal-start")]
fn connect_can_reveal_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_can_reveal_start_trampoline<
P: IsA<Dock>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::can-reveal-start".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_can_reveal_start_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "can-reveal-top")]
fn connect_can_reveal_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_can_reveal_top_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::can-reveal-top".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_can_reveal_top_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "end-width")]
fn connect_end_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_end_width_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::end-width".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_end_width_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "reveal-bottom")]
fn connect_reveal_bottom_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_reveal_bottom_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::reveal-bottom".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_reveal_bottom_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "reveal-end")]
fn connect_reveal_end_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_reveal_end_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::reveal-end".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_reveal_end_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "reveal-start")]
fn connect_reveal_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_reveal_start_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::reveal-start".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_reveal_start_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "reveal-top")]
fn connect_reveal_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_reveal_top_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::reveal-top".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_reveal_top_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "start-width")]
fn connect_start_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_start_width_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::start-width".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_start_width_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "top-height")]
fn connect_top_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_top_height_trampoline<P: IsA<Dock>, F: Fn(&P) + 'static>(
this: *mut ffi::PanelDock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
unsafe {
let f: &F = &*(f as *const F);
f(Dock::from_glib_borrow(this).unsafe_cast_ref())
}
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::top-height".as_ptr(),
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_top_height_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl<O: IsA<Dock>> DockExt for O {}