swatch-selector.cpp revision a24300c2eab4cabe40a694337648df816de022ff
#include "swatch-selector.h"
#include "document.h"
#include "document-undo.h"
#include "gradient-chemistry.h"
#include "gradient-selector.h"
#include "sp-stop.h"
#include "svg/css-ostringstream.h"
#include "svg/svg-color.h"
#include "verbs.h"
#include "ui/widget/color-notebook.h"
namespace Inkscape
{
namespace Widgets
{
_gsel(0),
_updating_color(false)
{
color_selector->show();
}
{
_gsel = 0;
}
{
return _gsel;
}
void SwatchSelector::_grabbedCb()
{
}
void SwatchSelector::_draggedCb()
{
// if (data) {
//SwatchSelector *swsel = reinterpret_cast<SwatchSelector*>(data);
// TODO might have to block cycles
// Copied from gradient-vector.cpp, but does not appear to cause visible changes:
/*
if (swsel->_gsel) {
SPGradient *gradient = swsel->_gsel->getVector();
SPGradient *ngr = sp_gradient_ensure_vector_normalized(gradient);
if (ngr != gradient) {
// Our master gradient has changed
// TODO replace with proper - sp_gradient_vector_widget_load_gradient(GTK_WIDGET(swsel->_gsel), ngr);
}
sp_gradient_ensure_vector(ngr);
SPStop* stop = ngr->getFirstStop();
if (stop) {
swsel->_csel->base->getColorAlpha(stop->specified_color, &stop->opacity);
stop->currentColor = false;
// TODO push refresh
}
}
*/
// }
}
void SwatchSelector::_releasedCb()
{
}
void SwatchSelector::_changedCb()
{
if (_updating_color) {
return;
}
// TODO might have to block cycles
/* Our master gradient has changed */
// TODO replace with proper - sp_gradient_vector_widget_load_gradient(GTK_WIDGET(swsel->_gsel), ngr);
}
ngr->ensureVector();
if (stop) {
// TODO replace with generic shared code that also handles icc-color
gchar c[64];
sp_svg_write_color(c, sizeof(c), rgb);
_("Change swatch color"));
}
}
}
{
}
{
}
{
}
{
}
{
//GtkVBox * box = gobj();
_updating_color = true;
_updating_color = false;
// gtk_widget_show_all( GTK_WIDGET(_csel) );
} else {
//gtk_widget_hide( GTK_WIDGET(_csel) );
}
/*
*/
}
} // namespace Widgets
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :