Code

merge
[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>
14 #include <gtkmm/tooltips.h>
16 #include "ui/widget/panel.h"
17 #include "ui/previewholder.h"
18 #include "widgets/ege-paint-def.h"
20 namespace Inkscape {
21 namespace UI {
22 namespace Dialogs {
24 class ColorItem;
26 /**
27  * A panel that displays paint swatches.
28  */
29 class SwatchesPanel : public Inkscape::UI::Widget::Panel
30 {
31 public:
32     SwatchesPanel(gchar const* prefsPath = "/dialogs/swatches");
33     virtual ~SwatchesPanel();
35     static SwatchesPanel& getInstance();
37     virtual void setOrientation( Gtk::AnchorType how );
39     virtual void setDesktop( SPDesktop* desktop );
40     virtual SPDesktop* getDesktop() {return _currentDesktop;}
42     virtual int getSelectedIndex() {return _currentIndex;} // temporary
43     virtual void handleGradientsChange(); // 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 private:
52     SwatchesPanel(SwatchesPanel const &); // no copy
53     SwatchesPanel &operator=(SwatchesPanel const &); // no assign
55     PreviewHolder* _holder;
56     ColorItem* _clear;
57     ColorItem* _remove;
58     int _currentIndex;
59     SPDesktop*  _currentDesktop;
60     SPDocument* _currentDocument;
61     void* _ptr;
63     sigc::connection _documentConnection;
64     sigc::connection _resourceConnection;
65     sigc::connection _selChanged;
66     sigc::connection _setModified;
67     sigc::connection _subselChanged;
68 };
70 } //namespace Dialogs
71 } //namespace UI
72 } //namespace Inkscape
76 #endif // SEEN_SWATCHES_H
78 /*
79   Local Variables:
80   mode:c++
81   c-file-style:"stroustrup"
82   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
83   indent-tabs-mode:nil
84   fill-column:99
85   End:
86 */
87 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :