Code

1fba23ebaa8556a1b9441bcf4717889e93ae0688
[inkscape.git] / src / dialogs / swatches.h
2 #ifndef SEEN_SWATCHES_H
3 #define SEEN_SWATCHES_H
4 /*
5  * A simple dialog for previewing icon representation.
6  *
7  * Authors:
8  *   Jon A. Cruz
9  *
10  * Copyright (C) 2005 Jon A. Cruz
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
15 #include <gtkmm/textview.h>
16 #include <gtkmm/tooltips.h>
18 #include "ui/widget/panel.h"
19 #include "ui/previewholder.h"
20 #include "dialogs/eek-color-def.h"
22 using eek::ColorDef;
24 namespace Inkscape {
25 namespace UI {
26 namespace Dialogs {
30 /**
31  * The color swatch you see on screen as a clickable box.
32  */
33 class ColorItem : public Inkscape::UI::Previewable
34 {
35 public:
36     ColorItem( unsigned int r, unsigned int g, unsigned int b,
37                Glib::ustring& name );
38     virtual ~ColorItem();
39     ColorItem(ColorItem const &other);
40     virtual ColorItem &operator=(ColorItem const &other);
41     virtual Gtk::Widget* getPreview(PreviewStyle style,
42                                     ViewType view,
43                                     Gtk::BuiltinIconSize size);
44     void buttonClicked(bool secondary = false);
46     ColorDef def;
47 private:
48     Gtk::Tooltips tips;
49 };
51         
53 /**
54  * A panel that displays color swatches.
55  */
56 class SwatchesPanel : public Inkscape::UI::Widget::Panel
57 {
58 public:
59     SwatchesPanel();
60     virtual ~SwatchesPanel();
62     static SwatchesPanel& getInstance();
63     virtual void setOrientation( Gtk::AnchorType how );
65 protected:
66     virtual void _handleAction( int setId, int itemId );
68 private:
69     SwatchesPanel(SwatchesPanel const &); // no copy
70     SwatchesPanel &operator=(SwatchesPanel const &); // no assign
72     static SwatchesPanel* instance;
74     PreviewHolder* _holder;
75 };
77 } //namespace Dialogs
78 } //namespace UI
79 } //namespace Inkscape
83 #endif // SEEN_SWATCHES_H
85 /*
86   Local Variables:
87   mode:c++
88   c-file-style:"stroustrup"
89   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
90   indent-tabs-mode:nil
91   fill-column:99
92   End:
93 */
94 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :