Loupe/src/main.rs
Sophie Herold f2357513da imageView: Use custom slide widget and IndexSet
Use IndexSet to allow direct access by Path and also allow
an arbitrary ordering that was not possible with Vec. Also
add monitoring of file changes in the directory.

Use a custom LpSlidingView instead of AdwCarousel because
Carousel was never designed for this job and suffered of
bugs. LpSlidingView does not support swiping gestures yet
since they currently don't work yet anyways #24.

Use a new algorithm to fill the LpSlidingView that is
stateless and covers all potential changes in the directory.
This not only fixes bugs but would also work with changed
sorting orders.

This also adds build time template XML validation since it
was useful for the refactoring #46.

Closes #9, #11, #30, #33, #42
2023-01-30 01:08:57 +00:00

53 lines
1.5 KiB
Rust

// 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::*;
use gtk::gio::{self, prelude::*};
mod application;
mod config;
mod file_model;
mod i18n;
mod image_metadata;
mod thumbnail;
mod util;
mod widgets;
mod window;
mod deps {
pub use gtk::{gdk, gdk_pixbuf, gio, glib, graphene, gsk};
}
use application::LpApplication;
fn main() {
pretty_env_logger::init_timed();
setlocale(LocaleCategory::LcAll, "");
bindtextdomain("loupe", config::LOCALEDIR).unwrap();
textdomain("loupe").unwrap();
let res = gio::Resource::load(config::PKGDATADIR.to_owned() + "/loupe.gresource")
.expect("Could not load resources");
gio::resources_register(&res);
let app = LpApplication::new();
let ret = app.run();
std::process::exit(ret);
}