swatch-selector.cpp revision 4a1822d1f7f3d9a9b165ed8091a94ac3da830403
#include "swatch-selector.h"
#include "document.h"
#include "gradient-chemistry.h"
#include "gradient-selector.h"
#include "sp-color-notebook.h"
#include "sp-stop.h"
#include "svg/css-ostringstream.h"
#include "svg/svg-color.h"
#include "verbs.h"
namespace Inkscape
{
namespace Widgets
{
_gsel(0),
_csel(0)
{
wrappedCSel->show();
//gtk_widget_show(csel);
}
{
_csel = 0; // dtor should be handled by Gtk::manage()
_gsel = 0;
}
{
return _gsel;
}
{
}
{
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
}
}
*/
}
}
{
}
{
if (data) {
// 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) {
float alpha = 0;
// 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();
// set its color, from the stored array
} else {
}
/*
*/
}
} // 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:encoding=utf-8:textwidth=99 :