// 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 use atk_sys; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib_sys; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; use Object; glib_wrapper! { pub struct Window(Interface) @requires Object; match fn { get_type => || atk_sys::atk_window_get_type(), } } pub const NONE_WINDOW: Option<&Window> = None; pub trait AtkWindowExt: 'static { fn connect_activate(&self, f: F) -> SignalHandlerId; fn connect_create(&self, f: F) -> SignalHandlerId; fn connect_deactivate(&self, f: F) -> SignalHandlerId; fn connect_destroy(&self, f: F) -> SignalHandlerId; fn connect_maximize(&self, f: F) -> SignalHandlerId; fn connect_minimize(&self, f: F) -> SignalHandlerId; fn connect_move(&self, f: F) -> SignalHandlerId; fn connect_resize(&self, f: F) -> SignalHandlerId; fn connect_restore(&self, f: F) -> SignalHandlerId; } impl> AtkWindowExt for O { fn connect_activate(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn activate_trampoline( this: *mut atk_sys::AtkWindow, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&Window::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"activate\0".as_ptr() as *const _, Some(transmute(activate_trampoline:: as usize)), Box_::into_raw(f), ) } } fn connect_create(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn create_trampoline( this: *mut atk_sys::AtkWindow, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&Window::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"create\0".as_ptr() as *const _, Some(transmute(create_trampoline:: as usize)), Box_::into_raw(f), ) } } fn connect_deactivate(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn deactivate_trampoline( this: *mut atk_sys::AtkWindow, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&Window::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"deactivate\0".as_ptr() as *const _, Some(transmute(deactivate_trampoline:: as usize)), Box_::into_raw(f), ) } } fn connect_destroy(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn destroy_trampoline( this: *mut atk_sys::AtkWindow, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&Window::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"destroy\0".as_ptr() as *const _, Some(transmute(destroy_trampoline:: as usize)), Box_::into_raw(f), ) } } fn connect_maximize(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn maximize_trampoline( this: *mut atk_sys::AtkWindow, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&Window::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"maximize\0".as_ptr() as *const _, Some(transmute(maximize_trampoline:: as usize)), Box_::into_raw(f), ) } } fn connect_minimize(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn minimize_trampoline( this: *mut atk_sys::AtkWindow, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&Window::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"minimize\0".as_ptr() as *const _, Some(transmute(minimize_trampoline:: as usize)), Box_::into_raw(f), ) } } fn connect_move(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn move_trampoline( this: *mut atk_sys::AtkWindow, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&Window::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"move\0".as_ptr() as *const _, Some(transmute(move_trampoline:: as usize)), Box_::into_raw(f), ) } } fn connect_resize(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn resize_trampoline( this: *mut atk_sys::AtkWindow, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&Window::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"resize\0".as_ptr() as *const _, Some(transmute(resize_trampoline:: as usize)), Box_::into_raw(f), ) } } fn connect_restore(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn restore_trampoline( this: *mut atk_sys::AtkWindow, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&Window::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"restore\0".as_ptr() as *const _, Some(transmute(restore_trampoline:: as usize)), Box_::into_raw(f), ) } } } impl fmt::Display for Window { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Window") } }