2020-12-26 02:05:34 -08:00
|
|
|
// main.rs
|
|
|
|
|
//
|
|
|
|
|
// Copyright 2020 Christopher Davis <christopherdavis@gnome.org>
|
|
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
|
|
use gettextrs::*;
|
2021-12-21 16:09:48 -08:00
|
|
|
use gtk::gio::{self, prelude::*};
|
2020-12-26 02:05:34 -08:00
|
|
|
|
|
|
|
|
mod application;
|
|
|
|
|
mod config;
|
decoder: Use image-rs, libheif-rs, librsvg
This adds proper support for a lot of image formats including SVGs.
It will be the basis for many features to come. The technical core
is an asynchronous renderer that can arrange textures in smaller tiles
which might be generated on demand.
Closes #34, #40, #41, #49
Basis for fixing the following issues #7, #27, #36, #43, #68, #71
2023-03-04 03:14:52 +01:00
|
|
|
mod decoder;
|
2022-01-16 19:03:13 -08:00
|
|
|
mod file_model;
|
2022-08-05 18:54:04 -04:00
|
|
|
mod i18n;
|
2022-11-03 17:40:06 +01:00
|
|
|
mod image_metadata;
|
2021-09-05 05:51:34 -07:00
|
|
|
mod util;
|
2020-12-26 02:05:34 -08:00
|
|
|
mod widgets;
|
|
|
|
|
mod window;
|
|
|
|
|
|
2021-12-21 16:09:48 -08:00
|
|
|
mod deps {
|
decoder: Use image-rs, libheif-rs, librsvg
This adds proper support for a lot of image formats including SVGs.
It will be the basis for many features to come. The technical core
is an asynchronous renderer that can arrange textures in smaller tiles
which might be generated on demand.
Closes #34, #40, #41, #49
Basis for fixing the following issues #7, #27, #36, #43, #68, #71
2023-03-04 03:14:52 +01:00
|
|
|
pub use gtk::{cairo, gdk, gdk_pixbuf, gio, glib, graphene, gsk};
|
2021-12-21 16:09:48 -08:00
|
|
|
}
|
|
|
|
|
|
2021-12-21 10:55:02 -08:00
|
|
|
use application::LpApplication;
|
2023-02-12 02:07:42 +01:00
|
|
|
use deps::*;
|
2020-12-26 02:05:34 -08:00
|
|
|
|
2023-02-12 02:07:42 +01:00
|
|
|
fn main() -> glib::ExitCode {
|
2022-11-16 20:14:39 +01:00
|
|
|
pretty_env_logger::init_timed();
|
2020-12-26 02:05:34 -08:00
|
|
|
|
|
|
|
|
setlocale(LocaleCategory::LcAll, "");
|
2021-09-28 17:44:26 -07:00
|
|
|
bindtextdomain("loupe", config::LOCALEDIR).unwrap();
|
|
|
|
|
textdomain("loupe").unwrap();
|
2020-12-26 02:05:34 -08:00
|
|
|
|
2021-09-28 17:44:26 -07:00
|
|
|
let res = gio::Resource::load(config::PKGDATADIR.to_owned() + "/loupe.gresource")
|
2020-12-26 02:05:34 -08:00
|
|
|
.expect("Could not load resources");
|
|
|
|
|
gio::resources_register(&res);
|
|
|
|
|
|
2023-02-12 02:07:42 +01:00
|
|
|
LpApplication::new().run()
|
2020-12-26 02:05:34 -08:00
|
|
|
}
|