Code

9de8825697fa2349b23cd0a69974f24a8d460563
[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     int hot;
72     int numEntries;
73     int* sizes;
75     Gtk::Image      magnified;
76     Gtk::Label      magLabel;
78     Gtk::ToggleButton     *selectionButton;
80     guchar** pixMem;
81     Gtk::Image** images;
82     Glib::ustring** labels;
83     Gtk::ToggleToolButton** buttons;
84     sigc::connection desktopChangeConn;
85     sigc::connection docReplacedConn;
86     sigc::connection docModConn;
87     sigc::connection selChangedConn;
90     void setDocument( SPDocument *document );
91     void on_button_clicked(int which);
92     void renderPreview( SPObject* obj );
93     void updateMagnify();
94     void queueRefresh();
95     bool refreshCB();
96 };
98 } //namespace Dialogs
99 } //namespace UI
100 } //namespace Inkscape
104 #endif // SEEN_ICON_PREVIEW_H
106 /*
107   Local Variables:
108   mode:c++
109   c-file-style:"stroustrup"
110   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
111   indent-tabs-mode:nil
112   fill-column:99
113   End:
114 */
115 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :