This commit is contained in:
Erica Z 2024-10-31 12:02:58 +01:00
parent efbe32ed22
commit 0320e12206

View file

@ -208,79 +208,3 @@ impl Song {
.disconnect(self.imp().connection.take().unwrap()); .disconnect(self.imp().connection.take().unwrap());
} }
} }
pub mod ffi {
use adw::prelude::*;
use glib::ffi::{gboolean, GType};
use glib::subclass::basic::InstanceStruct;
use glib::translate::{from_glib, from_glib_none, IntoGlib, IntoGlibPtr};
use gtk::glib;
use std::ffi::c_uint;
type AudreyUiPlayQueueSong = InstanceStruct<super::imp::Song>;
#[no_mangle]
extern "C" fn audrey_ui_play_queue_song_get_type() -> GType {
super::Song::static_type().into_glib()
}
#[no_mangle]
extern "C" fn audrey_ui_play_queue_song_new(
playbin: *mut crate::playbin::ffi::AudreyPlaybin,
) -> *mut AudreyUiPlayQueueSong {
unsafe { super::Song::new(&from_glib_none(playbin)).into_glib_ptr() }
}
#[no_mangle]
extern "C" fn audrey_ui_play_queue_song_set_draggable(
self_: *mut AudreyUiPlayQueueSong,
draggable: gboolean,
) {
let self_: super::Song = unsafe { from_glib_none(self_) };
self_.set_draggable(unsafe { from_glib::<_, bool>(draggable) });
}
#[no_mangle]
extern "C" fn audrey_ui_play_queue_song_set_show_position(
self_: *mut AudreyUiPlayQueueSong,
show_position: gboolean,
) {
let self_: super::Song = unsafe { from_glib_none(self_) };
self_.set_show_position(unsafe { from_glib::<_, bool>(show_position) });
}
#[no_mangle]
extern "C" fn audrey_ui_play_queue_song_set_show_artist(
self_: *mut AudreyUiPlayQueueSong,
show_artist: gboolean,
) {
let self_: super::Song = unsafe { from_glib_none(self_) };
self_.set_show_artist(unsafe { from_glib::<_, bool>(show_artist) });
}
#[no_mangle]
extern "C" fn audrey_ui_play_queue_song_set_show_cover(
self_: *mut AudreyUiPlayQueueSong,
show_cover: gboolean,
) {
let self_: super::Song = unsafe { from_glib_none(self_) };
self_.set_show_cover(unsafe { from_glib::<_, bool>(show_cover) });
}
#[no_mangle]
extern "C" fn audrey_ui_play_queue_song_bind(
self_: *mut AudreyUiPlayQueueSong,
position: c_uint,
song: *mut crate::playbin::song::ffi::AudreyPlaybinSong,
) {
let self_: super::Song = unsafe { from_glib_none(self_) };
let song: crate::playbin::Song = unsafe { from_glib_none(song) };
self_.bind(position, &song);
}
#[no_mangle]
extern "C" fn audrey_ui_play_queue_song_unbind(self_: *mut AudreyUiPlayQueueSong) {
let self_: super::Song = unsafe { from_glib_none(self_) };
self_.unbind();
}
}