b18fd6cadcb6b80d82ec7d55d7ade30ad47cefb4
1 /** @file
2 * @brief Color swatches dialog
3 */
4 /* Authors:
5 * Jon A. Cruz
6 *
7 * Copyright (C) 2005 Jon A. Cruz
8 * Released under GNU GPL, read the file 'COPYING' for more information
9 */
10 #ifndef SEEN_DIALOGS_SWATCHES_H
11 #define SEEN_DIALOGS_SWATCHES_H
13 #include <gtkmm/textview.h>
15 #include "ui/widget/panel.h"
17 namespace Inkscape {
18 namespace UI {
20 class PreviewHolder;
22 namespace Dialogs {
24 class ColorItem;
25 class SwatchPage;
27 /**
28 * A panel that displays paint swatches.
29 */
30 class SwatchesPanel : public Inkscape::UI::Widget::Panel
31 {
32 public:
33 SwatchesPanel(gchar const* prefsPath = "/dialogs/swatches");
34 virtual ~SwatchesPanel();
36 static SwatchesPanel& getInstance();
38 virtual void setOrientation( Gtk::AnchorType how );
40 virtual void setDesktop( SPDesktop* desktop );
41 virtual SPDesktop* getDesktop() {return _currentDesktop;}
43 virtual int getSelectedIndex() {return _currentIndex;} // temporary
45 protected:
46 virtual void _updateFromSelection();
47 virtual void _handleAction( int setId, int itemId );
48 virtual void _setDocument( SPDocument *document );
49 virtual void _rebuild();
51 virtual std::vector<SwatchPage*> _getSwatchSets() const;
53 private:
54 SwatchesPanel(SwatchesPanel const &); // no copy
55 SwatchesPanel &operator=(SwatchesPanel const &); // no assign
57 static void _trackDocument( SwatchesPanel *panel, SPDocument *document );
58 static void handleGradientsChange(SPDocument *document);
59 static void handleDefsModified(SPDocument *document);
61 PreviewHolder* _holder;
62 ColorItem* _clear;
63 ColorItem* _remove;
64 int _currentIndex;
65 SPDesktop* _currentDesktop;
66 SPDocument* _currentDocument;
68 sigc::connection _documentConnection;
69 sigc::connection _selChanged;
70 };
72 } //namespace Dialogs
73 } //namespace UI
74 } //namespace Inkscape
78 #endif // SEEN_SWATCHES_H
80 /*
81 Local Variables:
82 mode:c++
83 c-file-style:"stroustrup"
84 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
85 indent-tabs-mode:nil
86 fill-column:99
87 End:
88 */
89 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :