~vaifrax/inkscape/bugfix170049

« back to all changes in this revision

Viewing changes to src/dialogs/swatches.h

  • Committer: mental
  • Date: 2006-01-16 02:36:01 UTC
  • Revision ID: mental@users.sourceforge.net-20060116023601-wkr0h7edl5veyudq
moving trunk for module inkscape

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
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
 */
 
14
 
 
15
#include <gtkmm/textview.h>
 
16
#include <gtkmm/tooltips.h>
 
17
 
 
18
#include "ui/widget/panel.h"
 
19
#include "ui/previewholder.h"
 
20
 
 
21
namespace Inkscape {
 
22
namespace UI {
 
23
namespace Dialogs {
 
24
 
 
25
 
 
26
 
 
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
};
 
50
 
 
51
        
 
52
 
 
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();
 
61
 
 
62
    static SwatchesPanel& getInstance();
 
63
 
 
64
protected:
 
65
    virtual void _handleAction( int setId, int itemId );
 
66
 
 
67
private:
 
68
    SwatchesPanel(SwatchesPanel const &); // no copy
 
69
    SwatchesPanel &operator=(SwatchesPanel const &); // no assign
 
70
 
 
71
    static SwatchesPanel* instance;
 
72
 
 
73
    PreviewHolder* _holder;
 
74
};
 
75
 
 
76
} //namespace Dialogs
 
77
} //namespace UI
 
78
} //namespace Inkscape
 
79
 
 
80
 
 
81
 
 
82
#endif // SEEN_SWATCHES_H
 
83
 
 
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 :