2023-04-19 20:02:01 +02:00
|
|
|
// Copyright (c) 2020-2022 Christopher Davis
|
2023-12-04 17:19:33 +01:00
|
|
|
// Copyright (c) 2023 Sophie Herold
|
2020-12-26 02:05:34 -08:00
|
|
|
//
|
|
|
|
|
// 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
|
|
|
|
|
|
2023-03-14 03:53:53 +01:00
|
|
|
/*!
|
|
|
|
|
# Loupe Image Viewer
|
|
|
|
|
|
|
|
|
|
Code documentation
|
|
|
|
|
|
|
|
|
|
# Widget Structure
|
|
|
|
|
|
|
|
|
|
Simplified widget arrangement including the most important widgets.
|
|
|
|
|
|
|
|
|
|
- [`LpWindow`]
|
|
|
|
|
- [`AdwFlap`]
|
|
|
|
|
- [`LpPropertiesView`]
|
|
|
|
|
- [`LpImageView`]
|
|
|
|
|
- [`LpSlidingView`]
|
|
|
|
|
- [`LpImagePage`]
|
|
|
|
|
- [`GtkScrolledWindow`]
|
|
|
|
|
- [`LpImage`]
|
|
|
|
|
- …
|
|
|
|
|
|
|
|
|
|
[`AdwFlap`]: adw::Flap
|
|
|
|
|
[`GtkScrolledWindow`]: gtk::ScrolledWindow
|
|
|
|
|
[`LpImagePage`]: widgets::LpImagePage
|
|
|
|
|
[`LpImageView`]: widgets::LpImageView
|
|
|
|
|
[`LpImage`]: widgets::LpImage
|
|
|
|
|
[`LpPropertiesView`]: widgets::LpPropertiesView
|
|
|
|
|
[`LpSlidingView`]: widgets::LpSlidingView
|
|
|
|
|
[`LpWindow`]: window::LpWindow
|
|
|
|
|
*/
|
|
|
|
|
|
2020-12-26 02:05:34 -08:00
|
|
|
use gettextrs::*;
|
2023-11-29 21:15:36 +01:00
|
|
|
use gtk::gio::prelude::*;
|
|
|
|
|
use gtk::gio::{self};
|
2020-12-26 02:05:34 -08:00
|
|
|
|
2023-07-08 22:33:44 +02:00
|
|
|
mod about;
|
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;
|
2023-12-04 12:52:40 +01:00
|
|
|
mod 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-04-02 01:39:23 +02:00
|
|
|
static GRESOURCE_BYTES: &[u8] =
|
|
|
|
|
gvdb_macros::include_gresource_from_dir!("/org/gnome/Loupe", "data/resources");
|
|
|
|
|
|
2023-02-12 02:07:42 +01:00
|
|
|
fn main() -> glib::ExitCode {
|
2023-12-19 20:41:03 +01:00
|
|
|
let mut log_builder = env_logger::builder();
|
|
|
|
|
log_builder.format_timestamp_millis();
|
|
|
|
|
|
|
|
|
|
if !glib::log_writer_default_would_drop(glib::LogLevel::Debug, Some("loupe")) {
|
|
|
|
|
log_builder.filter_module("loupe", log::LevelFilter::Debug);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log_builder.init();
|
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
|
|
|
|
2023-04-02 01:39:23 +02:00
|
|
|
gio::resources_register(
|
|
|
|
|
&gio::Resource::from_data(&glib::Bytes::from_static(GRESOURCE_BYTES)).unwrap(),
|
|
|
|
|
);
|
2020-12-26 02:05:34 -08:00
|
|
|
|
2023-02-12 02:07:42 +01:00
|
|
|
LpApplication::new().run()
|
2020-12-26 02:05:34 -08:00
|
|
|
}
|