Code

Fixing scrollbar size for embeded color swatches.
[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"
21 namespace Inkscape {
22 namespace UI {
23 namespace Dialogs {
27 /**
28  * The color swatch you see on screen as a clickable box.
29  */
30 class ColorItem : public Inkscape::UI::Previewable
31 {
32 public:
33     ColorItem( unsigned int r, unsigned int g, unsigned int b,
34                Glib::ustring& name );
35     virtual ~ColorItem();
36     ColorItem(ColorItem const &other);
37     virtual ColorItem &operator=(ColorItem const &other);
38     virtual Gtk::Widget* getPreview(PreviewStyle style,
39                                     ViewType view,
40                                     Gtk::BuiltinIconSize size);
41     void buttonClicked(bool secondary = false);
42     unsigned int _r;
43     unsigned int _g;
44     unsigned int _b;
45     Glib::ustring _name;
46     
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 :