Code

Added preference to keep last selected item shown.
[inkscape.git] / src / ui / dialog / icon-preview.h
1 /** @file
2  * @brief A simple dialog for previewing icon representation.
3  */
4 /* Authors:
5  *   Jon A. Cruz
6  *   Bob Jamison
7  *   Other dudes from The Inkscape Organization
8  *
9  * Copyright (C) 2004,2005 The Inkscape Organization
10  * Copyright (C) 2010 Jon A. Cruz
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
15 #ifndef SEEN_ICON_PREVIEW_H
16 #define SEEN_ICON_PREVIEW_H
18 #include <gtkmm/box.h>
19 #include <gtkmm/button.h>
20 #include <gtkmm/label.h>
21 #include <gtkmm/paned.h>
22 #include <gtkmm/image.h>
23 #include <gtkmm/togglebutton.h>
24 #include <gtkmm/toggletoolbutton.h>
26 #include "ui/widget/panel.h"
27 #include "desktop-tracker.h"
29 struct SPObject;
30 namespace Glib {
31 class Timer;
32 }
34 namespace Inkscape {
35 namespace UI {
36 namespace Dialog {
39 /**
40  * A panel that displays an icon preview
41  */
42 class IconPreviewPanel : public UI::Widget::Panel
43 {
44 public:
45     IconPreviewPanel();
46     //IconPreviewPanel(Glib::ustring const &label);
47     ~IconPreviewPanel();
49     static IconPreviewPanel& getInstance();
51     void setDesktop( SPDesktop* desktop );
52     void refreshPreview();
53     void modeToggled();
55 private:
56     IconPreviewPanel(IconPreviewPanel const &); // no copy
57     IconPreviewPanel &operator=(IconPreviewPanel const &); // no assign
60     DesktopTracker deskTrack;
61     SPDesktop *desktop;
62     SPDocument *document;
63     Glib::Timer *timer;
64     bool pending;
66     Gtk::Tooltips   tips;
68     Gtk::VBox       iconBox;
69     Gtk::HPaned     splitter;
71     Glib::ustring targetId;
72     int hot;
73     int numEntries;
74     int* sizes;
76     Gtk::Image      magnified;
77     Gtk::Label      magLabel;
79     Gtk::ToggleButton     *selectionButton;
81     guchar** pixMem;
82     Gtk::Image** images;
83     Glib::ustring** labels;
84     Gtk::ToggleToolButton** buttons;
85     sigc::connection desktopChangeConn;
86     sigc::connection docReplacedConn;
87     sigc::connection docModConn;
88     sigc::connection selChangedConn;
91     void setDocument( SPDocument *document );
92     void on_button_clicked(int which);
93     void renderPreview( SPObject* obj );
94     void updateMagnify();
95     void queueRefresh();
96     bool refreshCB();
97 };
99 } //namespace Dialogs
100 } //namespace UI
101 } //namespace Inkscape
105 #endif // SEEN_ICON_PREVIEW_H
107 /*
108   Local Variables:
109   mode:c++
110   c-file-style:"stroustrup"
111   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
112   indent-tabs-mode:nil
113   fill-column:99
114   End:
115 */
116 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :