style-swatch.cpp revision 109e6513fe12819f639b71b6ae98b28d1fce4aab
/**
* \brief Static style swatch (fill, stroke, opacity)
*
* Author:
* buliabyak@gmail.com
*
* Copyright (C) 2005 author
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "style-swatch.h"
#include "widgets/spw-utilities.h"
#include "ui/widget/color-preview.h"
#include "style.h"
#include "sp-linear-gradient-fns.h"
#include "sp-radial-gradient-fns.h"
#include "sp-pattern.h"
#include "xml/node-event-vector.h"
#include "widgets/widget-sizes.h"
#include "inkscape.h"
enum {
};
{
}
}
{
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
{
ss->setWatched (inkscape_get_repr(INKSCAPE, "desktop"), inkscape_get_repr(INKSCAPE, ss->_tool_path));
} else {
}
// UGLY HACK: we have to reconnect to the watched tool repr again, retrieving it from the stored
// tool_path, because the actual repr keeps shifting with each change, no idea why
}
}
{
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
namespace Inkscape {
namespace UI {
namespace Widget {
:
_tooltips ()
{
_label[i].set_padding(0, 0);
}
_opacity_value.set_padding(0, 0);
_table.set_row_spacings (0);
pack_start(_swatch, true, true, 0);
}
}
}
}
bool
{
return true;
}
return false;
}
{
if (_css)
delete _color_preview[i];
}
if (_watched) {
}
if (_watched_tool) {
_tool_path = NULL;
}
}
void
{
if (_watched) {
}
if (watched) {
// If desktop's last-set style is empty, a tool uses its own fixed style even if set to use
// last-set (so long as it's empty). To correctly show this, we're passed the second repr,
// that of the tool prefs node, from which we now setStyle if the watched repr's style is
// empty.
if (secondary) {
this->setStyle (css_secondary);
}
}
}
}
void
{
if (_watched_tool) {
_tool_path = NULL;
}
if (path) {
_tool_path = (char *) path;
if (watched_tool) {
if (synthesize) {
}
}
}
}
void
{
if (_css)
if (!css)
return;
_css = sp_repr_css_attr_new();
if (css_string)
}
void
{
bool has_stroke = true;
if (i == SS_FILL) {
} else {
}
SPPaintServer *server = (i == SS_FILL)? SP_STYLE_FILL_SERVER (query) : SP_STYLE_STROKE_SERVER (query);
if (SP_IS_LINEARGRADIENT (server)) {
_tooltips.set_tip(*place, (i == SS_FILL)? (_("Linear gradient fill")) : (_("Linear gradient stroke")));
} else if (SP_IS_RADIALGRADIENT (server)) {
_tooltips.set_tip(*place, (i == SS_FILL)? (_("Radial gradient fill")) : (_("Radial gradient stroke")));
} else if (SP_IS_PATTERN (server)) {
}
guint32 color = paint->value.color.toRGBA32( SP_SCALE24_TO_FLOAT ((i == SS_FILL)? query->fill_opacity.value : query->stroke_opacity.value) );
_color_preview[i]->show_all();
if (i == SS_FILL) {
} else {
}
if (i == SS_STROKE) has_stroke = false;
if (i == SS_STROKE) has_stroke = false;
}
}
// Now query stroke_width
if (has_stroke) {
double w;
if (_sw_unit) {
} else {
}
{
}
{
w,
}
} else {
}
if (op != 1) {
{
if (op == 0)
else
}
{
}
} else {
}
show_all();
}
} // namespace Widget
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :