style-swatch.cpp revision 3b0fe18b998d4c8316f629245595fdebcd56f3c5
/**
* @file
* Static style swatch (fill, stroke, opacity).
*/
/* Authors:
* buliabyak@gmail.com
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
* Copyright (C) 2005-2008 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#include "style-swatch.h"
#include <cstring>
#include <string>
#include "widgets/spw-utilities.h"
#include "ui/widget/color-preview.h"
#include "style.h"
#include "sp-linear-gradient.h"
#include "sp-radial-gradient.h"
#include "sp-pattern.h"
#include "xml/sp-css-attr.h"
#include "widgets/widget-sizes.h"
#include "helper/action-context.h"
#include "preferences.h"
#include "inkscape.h"
#include "verbs.h"
#if WITH_GTKMM_3_0
#else
#endif
enum {
};
namespace Inkscape {
namespace UI {
namespace Widget {
/**
* Watches whether the tool uses the current style.
*/
public:
{}
private:
};
/**
* Watches for changes in the observed style pref.
*/
public:
{
}
}
private:
};
{
if (usecurrent) {
// 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 get the tool's style
// if the desktop's style is empty.
if (!css->attributeList()) {
}
} else {
}
}
:
_verb_t(0),
#if WITH_GTKMM_3_0
#else
#endif
{
_label[i].set_padding(0, 0);
}
_opacity_value.set_padding(0, 0);
#if WITH_GTKMM_3_0
_table->set_row_spacing(0);
#else
_table->set_row_spacings(0);
#endif
#if WITH_GTKMM_3_0
#else
#endif
pack_start(_swatch, true, true, 0);
}
if (main_tip)
{
}
}
}
}
bool
{
SPAction *action = verb->get_action(Inkscape::ActionContext((Inkscape::UI::View::View *) this->_desktop));
return true;
}
return false;
}
{
if (_css)
delete _color_preview[i];
}
if (_style_obs) delete _style_obs;
}
void
{
if (_tool_obs) {
delete _tool_obs;
}
if (path) {
_tool_path = path;
} else {
_tool_path = "";
}
// hack until there is a real synthesize events function for prefs,
// which shouldn't be hard to write once there is sufficient need for it
if (synthesize && _tool_obs) {
}
}
{
if (_css)
if (!css)
return;
_css = sp_repr_css_attr_new();
if (!css_string.empty()) {
}
}
{
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)) {
place->set_tooltip_text((i == SS_FILL)? (_("Linear gradient fill")) : (_("Linear gradient stroke")));
} else if (SP_IS_RADIALGRADIENT (server)) {
place->set_tooltip_text((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 {
}
place->set_tooltip_text((i == SS_FILL)? (C_("Fill and stroke", "No fill")) : (C_("Fill and stroke", "No stroke")));
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 {
_stroke_width.set_has_tooltip(false);
}
if (op != 1) {
{
}
{
}
} else {
_opacity_value.set_has_tooltip(false);
}
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 :