2021-04-28 21:05:45 +00:00
|
|
|
#![doc(
|
2022-03-31 08:05:52 +00:00
|
|
|
html_logo_url = "https://gitlab.gnome.org/GNOME/fractal/-/raw/main/data/icons/org.gnome.Fractal.svg?inline=false",
|
|
|
|
html_favicon_url = "https://gitlab.gnome.org/GNOME/fractal/-/raw/main/data/icons/org.gnome.Fractal-symbolic.svg?inline=false"
|
2021-04-28 21:05:45 +00:00
|
|
|
)]
|
2022-11-06 11:32:39 +00:00
|
|
|
#![allow(clippy::new_without_default)]
|
2021-04-28 21:05:45 +00:00
|
|
|
|
2023-05-21 14:52:51 +00:00
|
|
|
mod account_switcher;
|
2021-02-04 19:25:29 +00:00
|
|
|
mod application;
|
2023-05-21 14:52:51 +00:00
|
|
|
mod components;
|
2021-02-04 19:25:29 +00:00
|
|
|
#[rustfmt::skip]
|
|
|
|
mod config;
|
2021-10-08 14:58:52 +00:00
|
|
|
mod contrib;
|
2022-02-14 20:53:11 +00:00
|
|
|
mod error_page;
|
2022-01-26 09:21:20 +00:00
|
|
|
mod greeter;
|
2022-04-04 12:43:11 +00:00
|
|
|
mod i18n;
|
2021-03-11 10:39:44 +00:00
|
|
|
mod login;
|
2023-05-21 14:52:51 +00:00
|
|
|
mod prelude;
|
2021-03-24 14:23:29 +00:00
|
|
|
mod secret;
|
2021-03-11 10:39:44 +00:00
|
|
|
mod session;
|
2023-05-20 12:17:38 +00:00
|
|
|
mod session_list;
|
2021-12-09 09:38:38 +00:00
|
|
|
mod user_facing_error;
|
2021-04-27 11:02:33 +00:00
|
|
|
mod utils;
|
2021-03-11 10:39:44 +00:00
|
|
|
mod window;
|
|
|
|
|
2021-02-04 19:25:29 +00:00
|
|
|
use gettextrs::*;
|
2022-01-20 08:24:22 +00:00
|
|
|
use gtk::{gdk::Display, gio, IconTheme};
|
2021-02-23 15:10:14 +00:00
|
|
|
use once_cell::sync::Lazy;
|
|
|
|
|
2023-05-21 14:52:51 +00:00
|
|
|
use self::{application::*, config::*, i18n::*, window::Window};
|
2022-01-20 08:24:22 +00:00
|
|
|
|
2021-02-23 15:10:14 +00:00
|
|
|
/// The default tokio runtime to be used for async tasks
|
|
|
|
pub static RUNTIME: Lazy<tokio::runtime::Runtime> =
|
|
|
|
Lazy::new(|| tokio::runtime::Runtime::new().unwrap());
|
2021-02-04 19:25:29 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// Initialize logger, debug is carried out via debug!, info!, and warn!.
|
2021-03-31 20:11:12 +00:00
|
|
|
tracing_subscriber::fmt::init();
|
2021-02-04 19:25:29 +00:00
|
|
|
|
|
|
|
// Prepare i18n
|
|
|
|
setlocale(LocaleCategory::LcAll, "");
|
2021-07-10 13:50:54 +00:00
|
|
|
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect("Invalid argument passed to bindtextdomain");
|
|
|
|
textdomain(GETTEXT_PACKAGE).expect("Invalid string passed to textdomain");
|
2021-02-04 19:25:29 +00:00
|
|
|
|
|
|
|
gtk::glib::set_application_name("Fractal");
|
|
|
|
|
|
|
|
gtk::init().expect("Unable to start GTK4");
|
2022-01-19 20:52:19 +00:00
|
|
|
gst::init().expect("Failed to initialize gst");
|
2022-02-01 12:09:12 +00:00
|
|
|
gst_gtk::plugin_register_static().expect("Failed to initialize gstreamer gtk plugins");
|
2021-02-04 19:25:29 +00:00
|
|
|
|
|
|
|
let res = gio::Resource::load(RESOURCES_FILE).expect("Could not load gresource file");
|
|
|
|
gio::resources_register(&res);
|
2023-05-21 21:11:45 +00:00
|
|
|
let ui_res = gio::Resource::load(UI_RESOURCES_FILE).expect("Could not load UI gresource file");
|
|
|
|
gio::resources_register(&ui_res);
|
2021-02-04 19:25:29 +00:00
|
|
|
|
2021-04-20 17:06:36 +00:00
|
|
|
IconTheme::for_display(&Display::default().unwrap())
|
2022-03-29 09:12:08 +00:00
|
|
|
.add_resource_path("/org/gnome/Fractal/icons");
|
2021-02-15 16:44:07 +00:00
|
|
|
|
2021-04-13 18:21:45 +00:00
|
|
|
let app = Application::new();
|
2021-02-04 19:25:29 +00:00
|
|
|
app.run();
|
|
|
|
}
|