From 422ea274ba9ed5b038c767bceead4c38d8d78152 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Sun, 28 Oct 2018 18:07:34 +0100 Subject: Rewrite of inkview using InkApplication (Gtk::Application). Use Gio::File for accessing files. Use Gio options to handle command line arguments. Use Gio::Action's. Use Gtk::Builder for control window. Only create SPDocument when requested for display and then cache it (should speed up start-up). --- src/inkview-window.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/inkview-window.h (limited to 'src/inkview-window.h') diff --git a/src/inkview-window.h b/src/inkview-window.h new file mode 100644 index 000000000..83cb4d1d1 --- /dev/null +++ b/src/inkview-window.h @@ -0,0 +1,64 @@ +/* + * Inkview - An SVG file viewer. + * + * Copyright (C) 2018 Tavmjong Bah + * + * The contents of this file may be used under the GNU General Public License Version 2 or later. + * + */ + +#ifndef INKVIEW_WINDOW_H +#define INKVIEW_WINDOW_H + +#include + +class SPDocument; + +class InkviewWindow : public Gtk::ApplicationWindow { + + public: + InkviewWindow(const Gio::Application::type_vec_files files, + bool fullscreen, bool recursive, int timer, double scale); + + private: + std::vector > + create_file_list(const std::vector >& files); + void update_title(); + bool show_document(SPDocument* document); + SPDocument* load_document(); + + Gio::Application::type_vec_files _files; + bool _fullscreen; + bool _recursive; + int _timer; + double _scale; + + int _index; + std::vector _documents; + + GtkWidget* _view; + Gtk::Window* _controlwindow; + + // Callbacks + void show_control(); + void show_next(); + void show_prev(); + void show_first(); + void show_last(); + + bool key_press(GdkEventKey* event); + bool on_timer(); +}; + +#endif // INKVIEW_WINDOW_H + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : -- cgit v1.2.3