#[macro_use]
extern crate log;
#[macro_use]
extern crate failure;
#[macro_use]
extern crate glib;
#[macro_use]
mod utils;

use gettextrs::*;

mod application;
mod config;
mod static_resources;
mod widgets;
mod window_state;

use application::Application;
use config::{GETTEXT_PACKAGE, LOCALEDIR};

fn main() {
    pretty_env_logger::init();

    glib::set_application_name(&format!("{}Obfuscate", config::NAME_PREFIX));
    glib::set_prgname(Some("obfuscate"));

    gtk::init().expect("Unable to start GTK3");
    // Prepare i18n
    setlocale(LocaleCategory::LcAll, "");
    bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
    textdomain(GETTEXT_PACKAGE);

    static_resources::init().expect("Failed to initialize the resource file.");

    let app = Application::new();
    app.run(app.clone());
}
