From b94d41542f0830cdb3fff485d86ee56ee10265ef Mon Sep 17 00:00:00 2001 From: Erica Z Date: Wed, 30 Oct 2024 11:42:03 +0100 Subject: [PATCH] wrap playbar --- src/ui.rs | 3 +++ src/ui/playbar.rs | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/ui/playbar.rs diff --git a/src/ui.rs b/src/ui.rs index 1a5b32a..25d76ad 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -1,2 +1,5 @@ mod window; pub use window::Window; + +mod playbar; +pub use playbar::Playbar; diff --git a/src/ui/playbar.rs b/src/ui/playbar.rs new file mode 100644 index 0000000..8de4eb7 --- /dev/null +++ b/src/ui/playbar.rs @@ -0,0 +1,29 @@ +mod ffi { + use gtk::glib; + + #[repr(C)] + pub struct AudreyUiPlaybar { + parent_instance: adw::ffi::AdwBin, + } + + #[repr(C)] + pub struct AudreyUiPlaybarClass { + parent_class: adw::ffi::AdwBinClass, + } + + extern "C" { + pub fn audrey_ui_playbar_get_type() -> glib::ffi::GType; + } +} + +use gtk::glib; + +glib::wrapper! { + pub struct Playbar(Object) + @extends adw::Bin, gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; + + match fn { + type_ => || ffi::audrey_ui_playbar_get_type(), + } +}