summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-05-14 00:12:38 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-05-14 00:12:38 +0000
commit030f2f1ebd1f776b45576079a1a4c2768553873a (patch)
treecfceef3bf151fdd00701aa865e848fe258f85157 /src
parentInkview: Title was not updated when using controls in control window. (diff)
downloadinkscape-030f2f1ebd1f776b45576079a1a4c2768553873a.tar.gz
inkscape-030f2f1ebd1f776b45576079a1a4c2768553873a.zip
Inkview: Refactoring - move SPSlideShow to separate source file
(bzr r15690.1.8)
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/inkview.cpp330
-rw-r--r--src/svg-view-slideshow.cpp300
-rw-r--r--src/svg-view-slideshow.h91
4 files changed, 398 insertions, 325 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 25a42a4a0..abe6c9758 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -260,6 +260,7 @@ set(inkscape_SRC
snapper.cpp
style-internal.cpp
style.cpp
+ svg-view-slideshow.cpp
svg-view-widget.cpp
svg-view.cpp
text-chemistry.cpp
@@ -390,6 +391,7 @@ set(inkscape_SRC
style-internal.h
style.h
svg-profile.h
+ svg-view-slideshow.h
svg-view-widget.h
svg-view.h
syseq.h
diff --git a/src/inkview.cpp b/src/inkview.cpp
index f39dd4cf4..abb690619 100644
--- a/src/inkview.cpp
+++ b/src/inkview.cpp
@@ -25,188 +25,29 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include <cstring>
-#include <locale.h>
-
-
#include <gtkmm/applicationwindow.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/image.h>
#include <gtkmm/main.h>
#include <libxml/tree.h>
-#include <gdk/gdkkeysyms.h>
-
-#include "inkgc/gc-core.h"
-#include "preferences.h"
#include <glibmm.h>
#include <glibmm/i18n.h>
#include "document.h"
-#include "svg-view.h"
-#include "svg-view-widget.h"
-
-#include "io/sys.h"
-#include "util/units.h"
+#include "inkscape.h"
+#include "preferences.h"
#ifdef ENABLE_NLS
#include "helper/gettext.h"
#endif
+#include "inkgc/gc-core.h"
+#include "io/sys.h"
+#include "svg-view-slideshow.h"
-#include "inkscape.h"
-
-#include "ui/icon-names.h"
-
-class SPSlideShow;
-
-static int sp_svgview_main_delete (GtkWidget *widget,
- GdkEvent *event,
- struct SPSlideShow *ss);
-
-static int sp_svgview_main_key_press (GtkWidget *widget,
- GdkEventKey *event,
- struct SPSlideShow *ss);
-
-/**
- * The main application window for the slideshow
- */
-class SPSlideShow : public Gtk::ApplicationWindow {
-private:
- std::vector<Glib::ustring> _slides; ///< List of filenames for each slide
- int _current; ///< Index of the currently displayed slide
- SPDocument *_doc; ///< The currently displayed slide
- int _timer;
- GtkWidget *_view;
- Gtk::Window *_ctrlwin; ///< Window containing slideshow control buttons
-
-public:
- /// Current state of application (full-screen or windowed)
- bool is_fullscreen;
-
- /// Update the window title with current document name
- void update_title()
- {
- Glib::ustring title(_doc->getName());
- if (_slides.size() > 1) {
- title += Glib::ustring::compose(" (%1/%2)", _current+1, _slides.size());
- }
-
- set_title(title);
- }
-
- SPSlideShow(std::vector<Glib::ustring> const &slides);
-
- void set_timer(int timer) {_timer = timer;}
- void control_show();
- void show_next();
- void show_prev();
- void goto_first();
- void goto_last();
-
- static int ctrlwin_delete (GtkWidget *widget,
- GdkEvent *event,
- void *data);
-protected:
- void waiting_cursor();
- void normal_cursor();
- void set_document(SPDocument *doc,
- int current);
-};
-
-SPSlideShow::SPSlideShow(std::vector<Glib::ustring> const &slides)
- :
- _slides(slides),
- _current(0),
- _doc(SPDocument::createNewDoc(_slides[0].c_str(), true, false)),
- _view(NULL),
- is_fullscreen(false),
- _timer(0),
- _ctrlwin(NULL)
-{
- update_title();
-
- auto default_screen = Gdk::Screen::get_default();
-
- set_default_size(MIN ((int)_doc->getWidth().value("px"), default_screen->get_width() - 64),
- MIN ((int)_doc->getHeight().value("px"), default_screen->get_height() - 64));
-
- g_signal_connect (G_OBJECT (gobj()), "delete_event", (GCallback) sp_svgview_main_delete, this);
- g_signal_connect (G_OBJECT (gobj()), "key_press_event", (GCallback) sp_svgview_main_key_press, this);
-
- _doc->ensureUpToDate();
- _view = sp_svg_view_widget_new (_doc);
- _doc->doUnref ();
- SP_SVG_VIEW_WIDGET(_view)->setResize( false, _doc->getWidth().value("px"), _doc->getHeight().value("px") );
- gtk_widget_show (_view);
- add(*Glib::wrap(_view));
-
- show();
-}
-
-
-static int sp_svgview_main_delete (GtkWidget */*widget*/,
- GdkEvent */*event*/,
- struct SPSlideShow */*ss*/)
-{
- Gtk::Main::quit();
- return FALSE;
-}
-
-static int sp_svgview_main_key_press (GtkWidget */*widget*/,
- GdkEventKey *event,
- struct SPSlideShow *ss)
-{
- switch (event->keyval) {
- case GDK_KEY_Up:
- case GDK_KEY_Home:
- ss->goto_first();
- break;
- case GDK_KEY_Down:
- case GDK_KEY_End:
- ss->goto_last();
- break;
- case GDK_KEY_F11:
- if (ss->is_fullscreen) {
- ss->unfullscreen();
- ss->is_fullscreen = false;
- } else {
- ss->fullscreen();
- ss->is_fullscreen = true;
- }
- break;
- case GDK_KEY_Return:
- ss->control_show();
- break;
- case GDK_KEY_KP_Page_Down:
- case GDK_KEY_Page_Down:
- case GDK_KEY_Right:
- case GDK_KEY_space:
- ss->show_next();
- break;
- case GDK_KEY_KP_Page_Up:
- case GDK_KEY_Page_Up:
- case GDK_KEY_Left:
- case GDK_KEY_BackSpace:
- ss->show_prev();
- break;
- case GDK_KEY_Escape:
- case GDK_KEY_q:
- case GDK_KEY_Q:
- Gtk::Main::quit();
- break;
- default:
- break;
- }
-
- return TRUE;
-}
/// List of all input filenames
static Glib::OptionGroup::vecustrings filenames;
@@ -339,167 +180,6 @@ int main (int argc, char **argv)
return 0;
}
-int SPSlideShow::ctrlwin_delete (GtkWidget */*widget*/,
- GdkEvent */*event*/,
- void *data)
-{
- auto ss = reinterpret_cast<SPSlideShow *>(data);
- if(ss->_ctrlwin) delete ss->_ctrlwin;
-
- ss->_ctrlwin = NULL;
- return FALSE;
-}
-
-/**
- * @brief Show the control buttons (next, previous etc) for the application
- */
-void SPSlideShow::control_show()
-{
- if (!_ctrlwin) {
- _ctrlwin = new Gtk::Window();
- _ctrlwin->set_resizable(false);
- _ctrlwin->set_transient_for(*this);
- g_signal_connect(G_OBJECT (_ctrlwin->gobj()), "key_press_event", (GCallback) sp_svgview_main_key_press, this);
- g_signal_connect(G_OBJECT (_ctrlwin->gobj()), "delete_event", (GCallback) SPSlideShow::ctrlwin_delete, this);
- auto t = Gtk::manage(new Gtk::ButtonBox());
- _ctrlwin->add(*t);
-
- auto btn_go_first = Gtk::manage(new Gtk::Button());
- auto img_go_first = Gtk::manage(new Gtk::Image());
- img_go_first->set_from_icon_name(INKSCAPE_ICON("go-first"), Gtk::ICON_SIZE_BUTTON);
- btn_go_first->set_image(*img_go_first);
- t->add(*btn_go_first);
- btn_go_first->signal_clicked().connect(sigc::mem_fun(*this, &SPSlideShow::goto_first));
-
- auto btn_go_prev = Gtk::manage(new Gtk::Button());
- auto img_go_prev = Gtk::manage(new Gtk::Image());
- img_go_prev->set_from_icon_name(INKSCAPE_ICON("go-previous"), Gtk::ICON_SIZE_BUTTON);
- btn_go_prev->set_image(*img_go_prev);
- t->add(*btn_go_prev);
- btn_go_prev->signal_clicked().connect(sigc::mem_fun(*this, &SPSlideShow::show_prev));
-
- auto btn_go_next = Gtk::manage(new Gtk::Button());
- auto img_go_next = Gtk::manage(new Gtk::Image());
- img_go_next->set_from_icon_name(INKSCAPE_ICON("go-next"), Gtk::ICON_SIZE_BUTTON);
- btn_go_next->set_image(*img_go_next);
- t->add(*btn_go_next);
- btn_go_next->signal_clicked().connect(sigc::mem_fun(*this, &SPSlideShow::show_next));
-
- auto btn_go_last = Gtk::manage(new Gtk::Button());
- auto img_go_last = Gtk::manage(new Gtk::Image());
- img_go_last->set_from_icon_name(INKSCAPE_ICON("go-last"), Gtk::ICON_SIZE_BUTTON);
- btn_go_last->set_image(*img_go_last);
- t->add(*btn_go_last);
- btn_go_last->signal_clicked().connect(sigc::mem_fun(*this, &SPSlideShow::goto_last));
-
- _ctrlwin->show_all();
- } else {
- _ctrlwin->present();
- }
-}
-
-void SPSlideShow::waiting_cursor()
-{
- auto display = Gdk::Display::get_default();
- auto waiting = Gdk::Cursor::create(display, Gdk::WATCH);
- get_window()->set_cursor(waiting);
-
- if (_ctrlwin) {
- _ctrlwin->get_window()->set_cursor(waiting);
- }
- while(Gtk::Main::events_pending()) {
- Gtk::Main::iteration();
- }
-}
-
-void SPSlideShow::normal_cursor()
-{
- get_window()->set_cursor();
- if (_ctrlwin) {
- _ctrlwin->get_window()->set_cursor();
- }
-}
-
-void SPSlideShow::set_document(SPDocument *doc,
- int current)
-{
- if (doc && doc != _doc) {
- doc->ensureUpToDate();
- reinterpret_cast<SPSVGView*>(SP_VIEW_WIDGET_VIEW (_view))->setDocument (doc);
- _doc = doc;
- _current = current;
- update_title();
- }
-}
-
-/**
- * @brief Show the next file in the slideshow
- */
-void SPSlideShow::show_next()
-{
- waiting_cursor();
-
- SPDocument *doc = NULL;
- while (!doc && (_current < _slides.size() - 1)) {
- doc = SPDocument::createNewDoc ((_slides[++_current]).c_str(), TRUE, false);
- }
-
- set_document(doc, _current);
- normal_cursor();
-}
-
-/**
- * @brief Show the previous file in the slideshow
- */
-void SPSlideShow::show_prev()
-{
- waiting_cursor();
-
- SPDocument *doc = NULL;
- while (!doc && (_current > 0)) {
- doc = SPDocument::createNewDoc ((_slides[--_current]).c_str(), TRUE, false);
- }
-
- set_document(doc, _current);
- normal_cursor();
-}
-
-/**
- * @brief Switch to first slide in slideshow
- */
-void SPSlideShow::goto_first()
-{
- waiting_cursor();
-
- SPDocument *doc = NULL;
- int current = 0;
- while ( !doc && (current < _slides.size() - 1)) {
- doc = SPDocument::createNewDoc((_slides[current++]).c_str(), TRUE, false);
- }
-
- set_document(doc, current - 1);
-
- normal_cursor();
-}
-
-/**
- * @brief Switch to last slide in slideshow
- */
-void SPSlideShow::goto_last()
-{
- waiting_cursor();
-
- SPDocument *doc = NULL;
- int current = _slides.size() - 1;
- while (!doc && (current >= 0)) {
- doc = SPDocument::createNewDoc((_slides[current--]).c_str(), TRUE, false);
- }
-
- set_document(doc, current + 1);
-
- normal_cursor();
-}
-
/*
Local Variables:
mode:c++
diff --git a/src/svg-view-slideshow.cpp b/src/svg-view-slideshow.cpp
new file mode 100644
index 000000000..eebcd94df
--- /dev/null
+++ b/src/svg-view-slideshow.cpp
@@ -0,0 +1,300 @@
+/*
+ * Inkscape - an ambitious vector drawing program
+ *
+ * Authors:
+ * Lauris Kaplinski <lauris@kaplinski.com>
+ * Frank Felfe <innerspace@iname.com>
+ * Davide Puricelli <evo@debian.org>
+ * Mitsuru Oka <oka326@parkcity.ne.jp>
+ * Masatake YAMATO <jet@gyve.org>
+ * F.J.Franklin <F.J.Franklin@sheffield.ac.uk>
+ * Michael Meeks <michael@helixcode.com>
+ * Chema Celorio <chema@celorio.com>
+ * Pawel Palucha
+ * ... and various people who have worked with various projects
+ * Abhishek Sharma
+ *
+ * Copyright (C) 1999-2002 authors
+ * Copyright (C) 2001-2002 Ximian, Inc.
+ *
+ * Inkscape authors:
+ * Johan Ceuppens
+ *
+ * Copyright (C) 2004 Inkscape authors
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <gtkmm/applicationwindow.h>
+#include <gtkmm/button.h>
+#include <gtkmm/buttonbox.h>
+#include <gtkmm/image.h>
+#include <gtkmm/main.h>
+
+#include "document.h"
+#include "ui/icon-names.h"
+#include "util/units.h"
+
+#include "svg-view.h"
+#include "svg-view-slideshow.h"
+#include "svg-view-widget.h"
+
+
+
+SPSlideShow::SPSlideShow(std::vector<Glib::ustring> const &slides)
+ :
+ _slides(slides),
+ _current(0),
+ _doc(SPDocument::createNewDoc(_slides[0].c_str(), true, false)),
+ _view(NULL),
+ is_fullscreen(false),
+ _timer(0),
+ _ctrlwin(NULL)
+{
+ update_title();
+
+ auto default_screen = Gdk::Screen::get_default();
+
+ set_default_size(MIN ((int)_doc->getWidth().value("px"), default_screen->get_width() - 64),
+ MIN ((int)_doc->getHeight().value("px"), default_screen->get_height() - 64));
+
+ this->signal_key_press_event().connect(sigc::mem_fun(*this, &SPSlideShow::key_press), false);
+ this->signal_delete_event().connect(sigc::mem_fun(*this, &SPSlideShow::main_delete), false);
+
+ _doc->ensureUpToDate();
+ _view = sp_svg_view_widget_new (_doc);
+ _doc->doUnref ();
+ SP_SVG_VIEW_WIDGET(_view)->setResize( false, _doc->getWidth().value("px"), _doc->getHeight().value("px") );
+ gtk_widget_show (_view);
+ add(*Glib::wrap(_view));
+
+ show();
+}
+
+
+
+/**
+ * @brief Show the control buttons (next, previous etc) for the application
+ */
+void SPSlideShow::control_show()
+{
+ if (!_ctrlwin) {
+ _ctrlwin = new Gtk::Window();
+ _ctrlwin->set_resizable(false);
+ _ctrlwin->set_transient_for(*this);
+
+ _ctrlwin->signal_key_press_event().connect(sigc::mem_fun(*this, &SPSlideShow::key_press), false);
+ _ctrlwin->signal_delete_event().connect(sigc::mem_fun(*this, &SPSlideShow::ctrlwin_delete), false);
+
+ auto t = Gtk::manage(new Gtk::ButtonBox());
+ _ctrlwin->add(*t);
+
+ auto btn_go_first = Gtk::manage(new Gtk::Button());
+ auto img_go_first = Gtk::manage(new Gtk::Image());
+ img_go_first->set_from_icon_name(INKSCAPE_ICON("go-first"), Gtk::ICON_SIZE_BUTTON);
+ btn_go_first->set_image(*img_go_first);
+ t->add(*btn_go_first);
+ btn_go_first->signal_clicked().connect(sigc::mem_fun(*this, &SPSlideShow::goto_first));
+
+ auto btn_go_prev = Gtk::manage(new Gtk::Button());
+ auto img_go_prev = Gtk::manage(new Gtk::Image());
+ img_go_prev->set_from_icon_name(INKSCAPE_ICON("go-previous"), Gtk::ICON_SIZE_BUTTON);
+ btn_go_prev->set_image(*img_go_prev);
+ t->add(*btn_go_prev);
+ btn_go_prev->signal_clicked().connect(sigc::mem_fun(*this, &SPSlideShow::show_prev));
+
+ auto btn_go_next = Gtk::manage(new Gtk::Button());
+ auto img_go_next = Gtk::manage(new Gtk::Image());
+ img_go_next->set_from_icon_name(INKSCAPE_ICON("go-next"), Gtk::ICON_SIZE_BUTTON);
+ btn_go_next->set_image(*img_go_next);
+ t->add(*btn_go_next);
+ btn_go_next->signal_clicked().connect(sigc::mem_fun(*this, &SPSlideShow::show_next));
+
+ auto btn_go_last = Gtk::manage(new Gtk::Button());
+ auto img_go_last = Gtk::manage(new Gtk::Image());
+ img_go_last->set_from_icon_name(INKSCAPE_ICON("go-last"), Gtk::ICON_SIZE_BUTTON);
+ btn_go_last->set_image(*img_go_last);
+ t->add(*btn_go_last);
+ btn_go_last->signal_clicked().connect(sigc::mem_fun(*this, &SPSlideShow::goto_last));
+
+ _ctrlwin->show_all();
+ } else {
+ _ctrlwin->present();
+ }
+}
+
+void SPSlideShow::waiting_cursor()
+{
+ auto display = Gdk::Display::get_default();
+ auto waiting = Gdk::Cursor::create(display, Gdk::WATCH);
+ get_window()->set_cursor(waiting);
+
+ if (_ctrlwin) {
+ _ctrlwin->get_window()->set_cursor(waiting);
+ }
+ while(Gtk::Main::events_pending()) {
+ Gtk::Main::iteration();
+ }
+}
+
+void SPSlideShow::normal_cursor()
+{
+ get_window()->set_cursor();
+ if (_ctrlwin) {
+ _ctrlwin->get_window()->set_cursor();
+ }
+}
+
+void SPSlideShow::set_document(SPDocument *doc,
+ int current)
+{
+ if (doc && doc != _doc) {
+ doc->ensureUpToDate();
+ reinterpret_cast<SPSVGView*>(SP_VIEW_WIDGET_VIEW (_view))->setDocument (doc);
+ _doc = doc;
+ _current = current;
+ update_title();
+ }
+}
+
+/**
+ * @brief Show the next file in the slideshow
+ */
+void SPSlideShow::show_next()
+{
+ waiting_cursor();
+
+ SPDocument *doc = NULL;
+ while (!doc && (_current < _slides.size() - 1)) {
+ doc = SPDocument::createNewDoc ((_slides[++_current]).c_str(), TRUE, false);
+ }
+
+ set_document(doc, _current);
+ normal_cursor();
+}
+
+/**
+ * @brief Show the previous file in the slideshow
+ */
+void SPSlideShow::show_prev()
+{
+ waiting_cursor();
+
+ SPDocument *doc = NULL;
+ while (!doc && (_current > 0)) {
+ doc = SPDocument::createNewDoc ((_slides[--_current]).c_str(), TRUE, false);
+ }
+
+ set_document(doc, _current);
+ normal_cursor();
+}
+
+/**
+ * @brief Switch to first slide in slideshow
+ */
+void SPSlideShow::goto_first()
+{
+ waiting_cursor();
+
+ SPDocument *doc = NULL;
+ int current = 0;
+ while ( !doc && (current < _slides.size() - 1)) {
+ doc = SPDocument::createNewDoc((_slides[current++]).c_str(), TRUE, false);
+ }
+
+ set_document(doc, current - 1);
+
+ normal_cursor();
+}
+
+/**
+ * @brief Switch to last slide in slideshow
+ */
+void SPSlideShow::goto_last()
+{
+ waiting_cursor();
+
+ SPDocument *doc = NULL;
+ int current = _slides.size() - 1;
+ while (!doc && (current >= 0)) {
+ doc = SPDocument::createNewDoc((_slides[current--]).c_str(), TRUE, false);
+ }
+
+ set_document(doc, current + 1);
+
+ normal_cursor();
+}
+
+bool SPSlideShow::ctrlwin_delete (GdkEventAny */*event*/)
+{
+ if(_ctrlwin) delete _ctrlwin;
+ _ctrlwin = NULL;
+ return true;
+}
+
+bool SPSlideShow::main_delete (GdkEventAny */*event*/)
+{
+ Gtk::Main::quit();
+ return true;
+}
+
+bool SPSlideShow::key_press(GdkEventKey* event)
+{
+ switch (event->keyval) {
+ case GDK_KEY_Up:
+ case GDK_KEY_Home:
+ goto_first();
+ break;
+ case GDK_KEY_Down:
+ case GDK_KEY_End:
+ goto_last();
+ break;
+ case GDK_KEY_F11:
+ if (is_fullscreen) {
+ unfullscreen();
+ is_fullscreen = false;
+ } else {
+ fullscreen();
+ is_fullscreen = true;
+ }
+ break;
+ case GDK_KEY_Return:
+ control_show();
+ break;
+ case GDK_KEY_KP_Page_Down:
+ case GDK_KEY_Page_Down:
+ case GDK_KEY_Right:
+ case GDK_KEY_space:
+ show_next();
+ break;
+ case GDK_KEY_KP_Page_Up:
+ case GDK_KEY_Page_Up:
+ case GDK_KEY_Left:
+ case GDK_KEY_BackSpace:
+ show_prev();
+ break;
+ case GDK_KEY_Escape:
+ case GDK_KEY_q:
+ case GDK_KEY_Q:
+ Gtk::Main::quit();
+ break;
+ default:
+ break;
+ }
+ return false;
+}
+
+/*
+ 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 :
diff --git a/src/svg-view-slideshow.h b/src/svg-view-slideshow.h
new file mode 100644
index 000000000..173e97e5b
--- /dev/null
+++ b/src/svg-view-slideshow.h
@@ -0,0 +1,91 @@
+/*
+ * Inkscape - an ambitious vector drawing program
+ *
+ * Authors:
+ * Lauris Kaplinski <lauris@kaplinski.com>
+ * Frank Felfe <innerspace@iname.com>
+ * Davide Puricelli <evo@debian.org>
+ * Mitsuru Oka <oka326@parkcity.ne.jp>
+ * Masatake YAMATO <jet@gyve.org>
+ * F.J.Franklin <F.J.Franklin@sheffield.ac.uk>
+ * Michael Meeks <michael@helixcode.com>
+ * Chema Celorio <chema@celorio.com>
+ * Pawel Palucha
+ * ... and various people who have worked with various projects
+ * Abhishek Sharma
+ *
+ * Copyright (C) 1999-2002 authors
+ * Copyright (C) 2001-2002 Ximian, Inc.
+ *
+ * Inkscape authors:
+ * Johan Ceuppens
+ *
+ * Copyright (C) 2004 Inkscape authors
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+
+#ifndef SEEN_SP_SVG_SLIDESHOW_H
+#define SEEN_SP_SVG_SLIDESHOW_H
+
+/**
+ * The main application window for the slideshow
+ */
+class SPSlideShow : public Gtk::ApplicationWindow {
+public:
+ SPSlideShow(std::vector<Glib::ustring> const &slides);
+ void set_timer(int timer) {_timer = timer;}
+
+private:
+ std::vector<Glib::ustring> _slides; ///< List of filenames for each slide
+ int _current; ///< Index of the currently displayed slide
+ SPDocument *_doc; ///< The currently displayed slide
+ int _timer;
+ GtkWidget *_view;
+ Gtk::Window *_ctrlwin; ///< Window containing slideshow control buttons
+
+ /// Current state of application (full-screen or windowed)
+ bool is_fullscreen;
+
+ /// Update the window title with current document name
+ void update_title()
+ {
+ Glib::ustring title(_doc->getName());
+ if (_slides.size() > 1) {
+ title += Glib::ustring::compose(" (%1/%2)", _current+1, _slides.size());
+ }
+
+ set_title(title);
+ }
+
+
+ void control_show();
+ void show_next();
+ void show_prev();
+ void goto_first();
+ void goto_last();
+
+ bool key_press (GdkEventKey *event);
+ bool main_delete (GdkEventAny *event);
+ bool ctrlwin_delete (GdkEventAny *event);
+
+protected:
+ void waiting_cursor();
+ void normal_cursor();
+ void set_document(SPDocument *doc,
+ int current);
+};
+
+#endif // SEEN_SP_SVG_SLIDESHOW_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 :