mod ffi { use gtk::glib; #[repr(C)] pub struct AudreyUiWindow { parent_instance: adw::ffi::AdwApplicationWindow, } #[repr(C)] pub struct AudreyUiWindowClass { parent_class: adw::ffi::AdwApplicationWindowClass, } extern "C" { pub fn audrey_ui_window_get_type() -> glib::ffi::GType; pub fn audrey_ui_window_new(app: *mut gtk::ffi::GtkApplication) -> *mut AudreyUiWindow; } } use adw::prelude::*; use gtk::{gio, glib}; glib::wrapper! { pub struct Window(Object) @extends adw::ApplicationWindow, gtk::ApplicationWindow, gtk::Window, gtk::Widget, @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; match fn { type_ => || ffi::audrey_ui_window_get_type(), } } impl Window { pub fn new(app: &impl IsA) -> Self { use glib::translate::*; unsafe { from_glib_none(ffi::audrey_ui_window_new(app.as_ref().to_glib_none().0)) } } }