diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2018-10-28 17:07:34 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-11-04 09:37:02 +0000 |
| commit | 422ea274ba9ed5b038c767bceead4c38d8d78152 (patch) | |
| tree | dbe228fdc5e4fdd99ec70a9ca1bb98e50fee69b2 /src/inkview-window.h | |
| parent | Merge branch 'fix-knot-selection' of gitlab.com:ao2/inkscape (diff) | |
| download | inkscape-422ea274ba9ed5b038c767bceead4c38d8d78152.tar.gz inkscape-422ea274ba9ed5b038c767bceead4c38d8d78152.zip | |
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).
Diffstat (limited to 'src/inkview-window.h')
| -rw-r--r-- | src/inkview-window.h | 64 |
1 files changed, 64 insertions, 0 deletions
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 <gtkmm.h> + +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<Glib::RefPtr<Gio::File> > + create_file_list(const std::vector<Glib::RefPtr<Gio::File > >& 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<SPDocument*> _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 : |
