Code

Implement keyboard shortcuts for single handle adjustments.
[inkscape.git] / src / ui / dialog / swatches.h
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;
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
44     virtual void handleGradientsChange(); // temporary
45     virtual void handleDefsModified();
47 protected:
48     virtual void _updateFromSelection();
49     virtual void _handleAction( int setId, int itemId );
50     virtual void _setDocument( SPDocument *document );
51     virtual void _rebuild();
53 private:
54     SwatchesPanel(SwatchesPanel const &); // no copy
55     SwatchesPanel &operator=(SwatchesPanel const &); // no assign
57     PreviewHolder* _holder;
58     ColorItem* _clear;
59     ColorItem* _remove;
60     int _currentIndex;
61     SPDesktop*  _currentDesktop;
62     SPDocument* _currentDocument;
63     void* _ptr;
65     sigc::connection _documentConnection;
66     sigc::connection _resourceConnection;
67     sigc::connection _selChanged;
68     sigc::connection _setModified;
69     sigc::connection _subselChanged;
70     sigc::connection _defsChanged;
71     sigc::connection _defsModified;
72 };
74 } //namespace Dialogs
75 } //namespace UI
76 } //namespace Inkscape
80 #endif // SEEN_SWATCHES_H
82 /*
83   Local Variables:
84   mode:c++
85   c-file-style:"stroustrup"
86   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
87   indent-tabs-mode:nil
88   fill-column:99
89   End:
90 */
91 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :