diff --git a/src/ffi.rs b/src/ffi.rs deleted file mode 100644 index f0cfedf..0000000 --- a/src/ffi.rs +++ /dev/null @@ -1,497 +0,0 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir) -// from /usr/share/gir-1.0 -// from ../o/src -// DO NOT EDIT - -#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] -#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal, clippy::upper_case_acronyms)] -#![cfg_attr(docsrs, feature(doc_cfg))] - - -#[allow(unused_imports)] -use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double, - c_short, c_ushort, c_long, c_ulong, - c_void, size_t, ssize_t, time_t, off_t, intptr_t, uintptr_t, FILE}; -#[cfg(unix)] -#[allow(unused_imports)] -use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; - -#[allow(unused_imports)] -use gtk::{gio, glib::{gboolean, gconstpointer, gpointer, GType}}; - -// Enums -pub type AudreyPlaybinState = c_int; -pub const AUDREY_PLAYBIN_STATE_STOPPED: AudreyPlaybinState = 0; -pub const AUDREY_PLAYBIN_STATE_PAUSED: AudreyPlaybinState = 1; -pub const AUDREY_PLAYBIN_STATE_PLAYING: AudreyPlaybinState = 2; - -pub type AudreySubsonicError = c_int; -pub const AUDREY_SUBSONIC_ERROR_BAD_AUTHN: AudreySubsonicError = 0; -pub const AUDREY_SUBSONIC_ERROR_ERROR: AudreySubsonicError = 1; - -// Callbacks -pub type AudreySubsonicSongCallback = Option; - -// Records -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyApplicationClass { - pub parent_class: adw::AdwApplicationClass, -} - -impl ::std::fmt::Debug for AudreyApplicationClass { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyApplicationClass @ {self:p}")) - .finish() - } -} - -#[repr(C)] -pub struct _AudreyApplicationPrivate { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - -pub type AudreyApplicationPrivate = _AudreyApplicationPrivate; - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyPlaybinClass { - pub parent_class: gobject::GObjectClass, -} - -impl ::std::fmt::Debug for AudreyPlaybinClass { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyPlaybinClass @ {self:p}")) - .finish() - } -} - -#[repr(C)] -pub struct _AudreyPlaybinPrivate { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - -pub type AudreyPlaybinPrivate = _AudreyPlaybinPrivate; - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyPlaybinSongClass { - pub parent_class: gobject::GObjectClass, -} - -impl ::std::fmt::Debug for AudreyPlaybinSongClass { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyPlaybinSongClass @ {self:p}")) - .finish() - } -} - -#[repr(C)] -pub struct _AudreyPlaybinSongPrivate { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - -pub type AudreyPlaybinSongPrivate = _AudreyPlaybinSongPrivate; - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreySubsonicAlbumClass { - pub parent_class: gobject::GObjectClass, -} - -impl ::std::fmt::Debug for AudreySubsonicAlbumClass { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreySubsonicAlbumClass @ {self:p}")) - .finish() - } -} - -#[repr(C)] -pub struct _AudreySubsonicAlbumPrivate { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - -pub type AudreySubsonicAlbumPrivate = _AudreySubsonicAlbumPrivate; - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreySubsonicArtistClass { - pub parent_class: gobject::GObjectClass, -} - -impl ::std::fmt::Debug for AudreySubsonicArtistClass { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreySubsonicArtistClass @ {self:p}")) - .finish() - } -} - -#[repr(C)] -pub struct _AudreySubsonicArtistPrivate { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - -pub type AudreySubsonicArtistPrivate = _AudreySubsonicArtistPrivate; - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreySubsonicClientClass { - pub parent_class: gobject::GObjectClass, -} - -impl ::std::fmt::Debug for AudreySubsonicClientClass { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreySubsonicClientClass @ {self:p}")) - .finish() - } -} - -#[repr(C)] -pub struct _AudreySubsonicClientPrivate { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - -pub type AudreySubsonicClientPrivate = _AudreySubsonicClientPrivate; - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreySubsonicSong { - pub id: *mut c_char, - pub title: *mut c_char, - pub album: *mut c_char, - pub artist: *mut c_char, - pub track: i64, - pub year: i64, - pub starred: *mut glib::GDateTime, - pub duration: i64, - pub play_count: i64, - pub genre: *mut c_char, - pub cover_art: *mut c_char, -} - -impl ::std::fmt::Debug for AudreySubsonicSong { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreySubsonicSong @ {self:p}")) - .field("id", &self.id) - .field("title", &self.title) - .field("album", &self.album) - .field("artist", &self.artist) - .field("track", &self.track) - .field("year", &self.year) - .field("starred", &self.starred) - .field("duration", &self.duration) - .field("play_count", &self.play_count) - .field("genre", &self.genre) - .field("cover_art", &self.cover_art) - .finish() - } -} - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyUiPlayQueueClass { - pub parent_class: adw::AdwBinClass, -} - -impl ::std::fmt::Debug for AudreyUiPlayQueueClass { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyUiPlayQueueClass @ {self:p}")) - .finish() - } -} - -#[repr(C)] -pub struct _AudreyUiPlayQueuePrivate { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - -pub type AudreyUiPlayQueuePrivate = _AudreyUiPlayQueuePrivate; - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyUiSetupClass { - pub parent_class: adw::AdwPreferencesDialogClass, -} - -impl ::std::fmt::Debug for AudreyUiSetupClass { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyUiSetupClass @ {self:p}")) - .finish() - } -} - -#[repr(C)] -pub struct _AudreyUiSetupPrivate { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - -pub type AudreyUiSetupPrivate = _AudreyUiSetupPrivate; - -// Classes -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyApplication { - pub parent_instance: adw::AdwApplication, - pub priv_: *mut AudreyApplicationPrivate, -} - -impl ::std::fmt::Debug for AudreyApplication { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyApplication @ {self:p}")) - .finish() - } -} - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyPlaybin { - pub parent_instance: gobject::GObject, - pub priv_: *mut AudreyPlaybinPrivate, -} - -impl ::std::fmt::Debug for AudreyPlaybin { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyPlaybin @ {self:p}")) - .finish() - } -} - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyPlaybinSong { - pub parent_instance: gobject::GObject, - pub priv_: *mut AudreyPlaybinSongPrivate, -} - -impl ::std::fmt::Debug for AudreyPlaybinSong { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyPlaybinSong @ {self:p}")) - .finish() - } -} - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreySubsonicAlbum { - pub parent_instance: gobject::GObject, - pub priv_: *mut AudreySubsonicAlbumPrivate, - pub id: *mut c_char, - pub name: *mut c_char, -} - -impl ::std::fmt::Debug for AudreySubsonicAlbum { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreySubsonicAlbum @ {self:p}")) - .field("id", &self.id) - .field("name", &self.name) - .finish() - } -} - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreySubsonicArtist { - pub parent_instance: gobject::GObject, - pub priv_: *mut AudreySubsonicArtistPrivate, - pub index: *mut c_char, - pub id: *mut c_char, - pub cover_art: *mut c_char, - pub artist_image_url: *mut c_char, - pub album_count: i64, -} - -impl ::std::fmt::Debug for AudreySubsonicArtist { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreySubsonicArtist @ {self:p}")) - .field("index", &self.index) - .field("id", &self.id) - .field("cover_art", &self.cover_art) - .field("artist_image_url", &self.artist_image_url) - .field("album_count", &self.album_count) - .finish() - } -} - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreySubsonicClient { - pub parent_instance: gobject::GObject, - pub priv_: *mut AudreySubsonicClientPrivate, -} - -impl ::std::fmt::Debug for AudreySubsonicClient { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreySubsonicClient @ {self:p}")) - .finish() - } -} - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyUiPlayQueue { - pub parent_instance: adw::AdwBin, - pub priv_: *mut AudreyUiPlayQueuePrivate, -} - -impl ::std::fmt::Debug for AudreyUiPlayQueue { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyUiPlayQueue @ {self:p}")) - .finish() - } -} - -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AudreyUiSetup { - pub parent_instance: adw::AdwPreferencesDialog, - pub priv_: *mut AudreyUiSetupPrivate, - pub token: *mut c_char, - pub salt: *mut c_char, -} - -impl ::std::fmt::Debug for AudreyUiSetup { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("AudreyUiSetup @ {self:p}")) - .field("token", &self.token) - .field("salt", &self.salt) - .finish() - } -} - -#[link(name = "audrey")] -extern "C" { - - //========================================================================= - // AudreyPlaybinState - //========================================================================= - pub fn audrey_playbin_state_get_type() -> GType; - - //========================================================================= - // AudreySubsonicError - //========================================================================= - pub fn audrey_subsonic_error_get_type() -> GType; - - //========================================================================= - // AudreySubsonicSong - //========================================================================= - pub fn audrey_subsonic_song_get_type() -> GType; - pub fn audrey_subsonic_song_init(self_: *mut AudreySubsonicSong, reader: *mut json::JsonReader); - - //========================================================================= - // AudreyApplication - //========================================================================= - pub fn audrey_application_get_type() -> GType; - pub fn audrey_application_new() -> *mut AudreyApplication; - - //========================================================================= - // AudreyPlaybin - //========================================================================= - pub fn audrey_playbin_get_type() -> GType; - pub fn audrey_playbin_new() -> *mut AudreyPlaybin; - pub fn audrey_playbin_seek(self_: *mut AudreyPlaybin, position: c_double); - pub fn audrey_playbin_select_track(self_: *mut AudreyPlaybin, position: c_uint); - pub fn audrey_playbin_pause(self_: *mut AudreyPlaybin); - pub fn audrey_playbin_play(self_: *mut AudreyPlaybin); - pub fn audrey_playbin_go_to_next_track(self_: *mut AudreyPlaybin); - pub fn audrey_playbin_go_to_prev_track(self_: *mut AudreyPlaybin); - pub fn audrey_playbin_remove_track(self_: *mut AudreyPlaybin, position: c_uint); - pub fn audrey_playbin_clear(self_: *mut AudreyPlaybin); - pub fn audrey_playbin_append_track(self_: *mut AudreyPlaybin, song: *mut AudreySubsonicSong); - pub fn audrey_playbin_append_track_async(self_: *mut AudreyPlaybin, song: *mut AudreySubsonicSong, _callback_: gio::GAsyncReadyCallback, _callback__target: *mut c_void); - pub fn audrey_playbin_append_track_finish(self_: *mut AudreyPlaybin, _res_: *mut gio::GAsyncResult); - pub fn audrey_playbin_move_track(self_: *mut AudreyPlaybin, from: c_uint, to: c_uint); - pub fn audrey_playbin_stop(self_: *mut AudreyPlaybin); - pub fn audrey_playbin_get_state(self_: *mut AudreyPlaybin) -> AudreyPlaybinState; - pub fn audrey_playbin_get_volume(self_: *mut AudreyPlaybin) -> c_int; - pub fn audrey_playbin_set_volume(self_: *mut AudreyPlaybin, value: c_int); - pub fn audrey_playbin_get_mute(self_: *mut AudreyPlaybin) -> gboolean; - pub fn audrey_playbin_set_mute(self_: *mut AudreyPlaybin, value: gboolean); - pub fn audrey_playbin_get_play_queue_position(self_: *mut AudreyPlaybin) -> c_int; - pub fn audrey_playbin_get_position(self_: *mut AudreyPlaybin) -> c_double; - pub fn audrey_playbin_get_duration(self_: *mut AudreyPlaybin) -> c_double; - pub fn audrey_playbin_get_api(self_: *mut AudreyPlaybin) -> *mut AudreySubsonicClient; - pub fn audrey_playbin_set_api(self_: *mut AudreyPlaybin, value: *mut AudreySubsonicClient); - pub fn audrey_playbin_get_play_queue(self_: *mut AudreyPlaybin) -> *mut gio::GListModel; - pub fn audrey_playbin_get_play_queue_length(self_: *mut AudreyPlaybin) -> c_uint; - - //========================================================================= - // AudreyPlaybinSong - //========================================================================= - pub fn audrey_playbin_song_get_type() -> GType; - pub fn audrey_playbin_song_new(api: *mut AudreySubsonicClient, song: *mut AudreySubsonicSong) -> *mut AudreyPlaybinSong; - pub fn audrey_playbin_song_need_cover_art(self_: *mut AudreyPlaybinSong); - pub fn audrey_playbin_song_get_id(self_: *mut AudreyPlaybinSong) -> *const c_char; - pub fn audrey_playbin_song_get_title(self_: *mut AudreyPlaybinSong) -> *const c_char; - pub fn audrey_playbin_song_get_artist(self_: *mut AudreyPlaybinSong) -> *const c_char; - pub fn audrey_playbin_song_get_album(self_: *mut AudreyPlaybinSong) -> *const c_char; - pub fn audrey_playbin_song_get_genre(self_: *mut AudreyPlaybinSong) -> *const c_char; - pub fn audrey_playbin_song_get_duration(self_: *mut AudreyPlaybinSong) -> i64; - pub fn audrey_playbin_song_get_track(self_: *mut AudreyPlaybinSong) -> i64; - pub fn audrey_playbin_song_get_play_count(self_: *mut AudreyPlaybinSong) -> i64; - pub fn audrey_playbin_song_get_thumbnail(self_: *mut AudreyPlaybinSong) -> *mut gdk::GdkPaintable; - - //========================================================================= - // AudreySubsonicAlbum - //========================================================================= - pub fn audrey_subsonic_album_get_type() -> GType; - pub fn audrey_subsonic_album_new(reader: *mut json::JsonReader) -> *mut AudreySubsonicAlbum; - - //========================================================================= - // AudreySubsonicArtist - //========================================================================= - pub fn audrey_subsonic_artist_get_type() -> GType; - pub fn audrey_subsonic_artist_new(index: *const c_char, reader: *mut json::JsonReader) -> *mut AudreySubsonicArtist; - pub fn audrey_subsonic_artist_get_name(self_: *mut AudreySubsonicArtist) -> *const c_char; - - //========================================================================= - // AudreySubsonicClient - //========================================================================= - pub fn audrey_subsonic_client_get_type() -> GType; - pub fn audrey_subsonic_client_new_with_token(url: *const c_char, username: *const c_char, token: *const c_char, salt: *const c_char) -> *mut AudreySubsonicClient; - pub fn audrey_subsonic_client_ping(self_: *mut AudreySubsonicClient, _callback_: gio::GAsyncReadyCallback, _callback__target: *mut c_void); - pub fn audrey_subsonic_client_ping_finish(self_: *mut AudreySubsonicClient, _res_: *mut gio::GAsyncResult, error: *mut *mut glib::GError); - pub fn audrey_subsonic_client_scrobble(self_: *mut AudreySubsonicClient, id: *const c_char, _callback_: gio::GAsyncReadyCallback, _callback__target: *mut c_void); - pub fn audrey_subsonic_client_scrobble_finish(self_: *mut AudreySubsonicClient, _res_: *mut gio::GAsyncResult, error: *mut *mut glib::GError); - pub fn audrey_subsonic_client_get_random_songs(self_: *mut AudreySubsonicClient, parameters: *const c_char, callback: AudreySubsonicSongCallback, callback_target: *mut c_void, _callback_: gio::GAsyncReadyCallback, _callback__target: *mut c_void); - pub fn audrey_subsonic_client_get_random_songs_finish(self_: *mut AudreySubsonicClient, _res_: *mut gio::GAsyncResult, error: *mut *mut glib::GError); - pub fn audrey_subsonic_client_stream_uri(self_: *mut AudreySubsonicClient, id: *const c_char) -> *mut c_char; - pub fn audrey_subsonic_client_cover_art_uri(self_: *mut AudreySubsonicClient, id: *const c_char, size: c_int) -> *mut c_char; - pub fn audrey_subsonic_client_cover_art(self_: *mut AudreySubsonicClient, id: *const c_char, size: c_int, priority: c_int, cancellable: *mut gio::GCancellable, _callback_: gio::GAsyncReadyCallback, _callback__target: *mut c_void); - pub fn audrey_subsonic_client_cover_art_finish(self_: *mut AudreySubsonicClient, _res_: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> *mut gdk_pixbuf::GdkPixbuf; - pub fn audrey_subsonic_client_new() -> *mut AudreySubsonicClient; - - //========================================================================= - // AudreyUiPlayQueue - //========================================================================= - pub fn audrey_ui_play_queue_get_type() -> GType; - pub fn audrey_ui_play_queue_new() -> *mut AudreyUiPlayQueue; - pub fn audrey_ui_play_queue_get_playbin(self_: *mut AudreyUiPlayQueue) -> *mut AudreyPlaybin; - pub fn audrey_ui_play_queue_set_playbin(self_: *mut AudreyUiPlayQueue, value: *mut AudreyPlaybin); - pub fn audrey_ui_play_queue_get_can_clear_all(self_: *mut AudreyUiPlayQueue) -> gboolean; - - //========================================================================= - // AudreyUiSetup - //========================================================================= - pub fn audrey_ui_setup_get_type() -> GType; - pub fn audrey_ui_setup_load(self_: *mut AudreyUiSetup); - pub fn audrey_ui_setup_save(self_: *mut AudreyUiSetup); - pub fn audrey_ui_setup_new() -> *mut AudreyUiSetup; - pub fn audrey_ui_setup_get_status(self_: *mut AudreyUiSetup) -> *const c_char; - pub fn audrey_ui_setup_get_authn_can_edit(self_: *mut AudreyUiSetup) -> gboolean; - pub fn audrey_ui_setup_get_authn_can_validate(self_: *mut AudreyUiSetup) -> gboolean; - pub fn audrey_ui_setup_get_server_url(self_: *mut AudreyUiSetup) -> *const c_char; - pub fn audrey_ui_setup_set_server_url(self_: *mut AudreyUiSetup, value: *const c_char); - pub fn audrey_ui_setup_get_username(self_: *mut AudreyUiSetup) -> *const c_char; - pub fn audrey_ui_setup_set_username(self_: *mut AudreyUiSetup, value: *const c_char); - pub fn audrey_ui_setup_get_password(self_: *mut AudreyUiSetup) -> *const c_char; - pub fn audrey_ui_setup_set_password(self_: *mut AudreyUiSetup, value: *const c_char); - -}