From 0320e12206547a665aab4a734110afb0aa847917 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Thu, 31 Oct 2024 12:02:58 +0100 Subject: [PATCH] kill ffi --- src/ui/play_queue/song.rs | 76 --------------------------------------- 1 file changed, 76 deletions(-) diff --git a/src/ui/play_queue/song.rs b/src/ui/play_queue/song.rs index d5e259e..d906f5b 100644 --- a/src/ui/play_queue/song.rs +++ b/src/ui/play_queue/song.rs @@ -208,79 +208,3 @@ impl Song { .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; - - #[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(); - } -}