//! eydos-calls — Liberux phone-call application.
//!
//! Wires the backends behind their traits: ModemManager (telephony),
//! PipeWire audio, contacts-server and calllogs-server — all over D-Bus.

mod app;
mod audio;
mod cli;
mod contacts;
mod history;
mod modem;
mod palette;
mod ringtone;
mod types;
mod views;

use app::CallsApp;
use audio::CallAudio;
use contacts::{ ContactsProvider, DbusContacts };
use history::{ CallLog, DbusCallLog };
use modem::CallBackend;

fn main()
{
	let args = cli::parse();
	ltk::set_fluid_reference( 412.0 );

	let backend: Box<dyn CallBackend> = Box::new( modem::modemmanager::ModemManagerBackend::new() );
	let audio:    Box<dyn CallAudio>        = audio::select();
	let contacts: Box<dyn ContactsProvider> = Box::new( DbusContacts::new() );
	let history:  Box<dyn CallLog>          = Box::new( DbusCallLog::new() );

	ltk::run( CallsApp::new( backend, audio, contacts, history, args.window_size ) );
}
