From f07641622e3c6eff87a6e5e42982063efee16728 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Thu, 31 Oct 2024 08:24:28 +0100 Subject: [PATCH] wrap ui setup dialog --- src/ui.rs | 3 +++ src/ui/setup.rs | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/ui/setup.rs diff --git a/src/ui.rs b/src/ui.rs index 25d76ad..7241dcf 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -3,3 +3,6 @@ pub use window::Window; mod playbar; pub use playbar::Playbar; + +mod setup; +pub use setup::Setup; diff --git a/src/ui/setup.rs b/src/ui/setup.rs new file mode 100644 index 0000000..3513e1e --- /dev/null +++ b/src/ui/setup.rs @@ -0,0 +1,29 @@ +mod ffi { + use gtk::glib; + + #[repr(C)] + pub struct AudreyUiSetup { + parent_instance: adw::ffi::AdwPreferencesDialog, + } + + #[repr(C)] + pub struct AudreyUiSetupClass { + parent_class: adw::ffi::AdwPreferencesDialogClass, + } + + extern "C" { + pub fn audrey_ui_setup_get_type() -> glib::ffi::GType; + } +} + +use gtk::glib; + +glib::wrapper! { + pub struct Setup(Object) + @extends adw::PreferencesDialog, adw::Dialog, gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; + + match fn { + type_ => || ffi::audrey_ui_setup_get_type(), + } +}