2
* @brief Inkscape color swatch UI item.
7
* Copyright (C) 2010 Jon A. Cruz
9
* Released under GNU GPL, read the file 'COPYING' for more information
12
#ifndef SEEN_DIALOGS_COLOR_ITEM_H
13
#define SEEN_DIALOGS_COLOR_ITEM_H
15
#include <gtkmm/tooltips.h>
17
#include "widgets/ege-paint-def.h"
18
#include "ui/previewable.h"
36
std::vector<ColorItem*> _colors;
41
* The color swatch you see on screen as a clickable box.
43
class ColorItem : public Inkscape::UI::Previewable
45
friend void _loadPaletteFile( gchar const *filename );
47
ColorItem( ege::PaintDef::ColorType type );
48
ColorItem( unsigned int r, unsigned int g, unsigned int b,
49
Glib::ustring& name );
51
ColorItem(ColorItem const &other);
52
virtual ColorItem &operator=(ColorItem const &other);
53
virtual Gtk::Widget* getPreview(PreviewStyle style,
57
void buttonClicked(bool secondary = false);
59
void setGradient(SPGradient *grad);
60
SPGradient * getGradient() const { return _grad; }
62
void setPixData(guchar* px, int width, int height);
64
void setState( bool fill, bool stroke );
65
bool isFill() { return _isFill; }
66
bool isStroke() { return _isStroke; }
72
static void _dropDataIn( GtkWidget *widget,
73
GdkDragContext *drag_context,
75
GtkSelectionData *data,
80
static void _dragGetColorData( GtkWidget *widget,
81
GdkDragContext *drag_context,
82
GtkSelectionData *data,
87
static void _wireMagicColors( SwatchPage *colorSet );
88
static void _colorDefChanged(void* data);
90
void _updatePreviews();
91
void _regenPreview(EekPreview * preview);
93
void _linkTint( ColorItem& other, int percent );
94
void _linkTone( ColorItem& other, int percent, int grayLevel );
97
std::vector<Gtk::Widget*> _previews;
110
std::vector<ColorItem*> _listeners;
113
} // namespace Dialogs
115
} // namespace Inkscape
117
#endif // SEEN_DIALOGS_COLOR_ITEM_H
122
c-file-style:"stroustrup"
123
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
128
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :