ca17cd066cd2ad90e4034f55734fc6fd98bc3ba5
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;
47 private:
48 Gtk::Tooltips tips;
49 };
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();
64 protected:
65 virtual void _handleAction( int setId, int itemId );
67 private:
68 SwatchesPanel(SwatchesPanel const &); // no copy
69 SwatchesPanel &operator=(SwatchesPanel const &); // no assign
71 static SwatchesPanel* instance;
73 PreviewHolder* _holder;
74 };
76 } //namespace Dialogs
77 } //namespace UI
78 } //namespace Inkscape
82 #endif // SEEN_SWATCHES_H
84 /*
85 Local Variables:
86 mode:c++
87 c-file-style:"stroustrup"
88 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
89 indent-tabs-mode:nil
90 fill-column:99
91 End:
92 */
93 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :