summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/icon-preview.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
commit35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch)
tree657d15a03cc46bd099fc2c6546a7a4ad43815d9f /src/ui/dialog/icon-preview.h
parentInitial commit. (diff)
downloadinkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz
inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ui/dialog/icon-preview.h')
-rw-r--r--src/ui/dialog/icon-preview.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/src/ui/dialog/icon-preview.h b/src/ui/dialog/icon-preview.h
new file mode 100644
index 0000000..938bbbf
--- /dev/null
+++ b/src/ui/dialog/icon-preview.h
@@ -0,0 +1,119 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/** @file
+ * @brief A simple dialog for previewing icon representation.
+ */
+/* Authors:
+ * Jon A. Cruz
+ * Bob Jamison
+ * Other dudes from The Inkscape Organization
+ *
+ * Copyright (C) 2004,2005 The Inkscape Organization
+ * Copyright (C) 2010 Jon A. Cruz
+ *
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+#ifndef SEEN_ICON_PREVIEW_H
+#define SEEN_ICON_PREVIEW_H
+
+#include <gtkmm/box.h>
+#include <gtkmm/button.h>
+#include <gtkmm/label.h>
+#include <gtkmm/paned.h>
+#include <gtkmm/image.h>
+#include <gtkmm/togglebutton.h>
+#include <gtkmm/toggletoolbutton.h>
+
+#include "ui/widget/panel.h"
+#include "desktop-tracker.h"
+
+class SPObject;
+namespace Glib {
+class Timer;
+}
+
+namespace Inkscape {
+class Drawing;
+namespace UI {
+namespace Dialog {
+
+
+/**
+ * A panel that displays an icon preview
+ */
+class IconPreviewPanel : public UI::Widget::Panel
+{
+public:
+ IconPreviewPanel();
+ //IconPreviewPanel(Glib::ustring const &label);
+ ~IconPreviewPanel() override;
+
+ static IconPreviewPanel& getInstance();
+
+ void setDesktop( SPDesktop* desktop ) override;
+ void refreshPreview();
+ void modeToggled();
+
+private:
+ IconPreviewPanel(IconPreviewPanel const &) = delete; // no copy
+ IconPreviewPanel &operator=(IconPreviewPanel const &) = delete; // no assign
+
+
+ DesktopTracker deskTrack;
+ SPDesktop *desktop;
+ SPDocument *document;
+ Drawing *drawing;
+ unsigned int visionkey;
+ Glib::Timer *timer;
+ Glib::Timer *renderTimer;
+ bool pending;
+ gdouble minDelay;
+
+ Gtk::VBox iconBox;
+ Gtk::Paned splitter;
+ Glib::ustring targetId;
+ int hot;
+ int numEntries;
+ int* sizes;
+
+ Gtk::Image magnified;
+ Gtk::Label magLabel;
+
+ Gtk::ToggleButton *selectionButton;
+
+ guchar** pixMem;
+ Gtk::Image** images;
+ Glib::ustring** labels;
+ Gtk::ToggleToolButton** buttons;
+ sigc::connection desktopChangeConn;
+ sigc::connection docReplacedConn;
+ sigc::connection docModConn;
+ sigc::connection selChangedConn;
+
+
+ void setDocument( SPDocument *document );
+ void on_button_clicked(int which);
+ void renderPreview( SPObject* obj );
+ void updateMagnify();
+ void queueRefresh();
+ bool refreshCB();
+};
+
+} //namespace Dialogs
+} //namespace UI
+} //namespace Inkscape
+
+
+
+#endif // SEEN_ICON_PREVIEW_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:fileencoding=utf-8:textwidth=99 :