index 705083a8f9afa2784671dc53797939722812f76e..e5e8d5d78065738fa43b7625118c983c55f3aab0 100644 (file)
SS_STROKE
};
-static void style_swatch_attr_changed(Inkscape::XML::Node *repr, gchar const *name,
- gchar const *old_value, gchar const *new_value,
- bool is_interactive, gpointer data)
+static void style_swatch_attr_changed( Inkscape::XML::Node *repr, gchar const *name,
+ gchar const */*old_value*/, gchar const */*new_value*/,
+ bool /*is_interactive*/, gpointer data)
{
Inkscape::UI::Widget::StyleSwatch *ss = (Inkscape::UI::Widget::StyleSwatch *) data;
};
-static void style_swatch_tool_attr_changed(Inkscape::XML::Node *repr, gchar const *name,
- gchar const *old_value, gchar const *new_value,
- bool is_interactive, gpointer data)
+static void style_swatch_tool_attr_changed( Inkscape::XML::Node */*repr*/, gchar const *name,
+ gchar const */*old_value*/, gchar const *new_value,
+ bool /*is_interactive*/, gpointer data)
{
Inkscape::UI::Widget::StyleSwatch *ss = (Inkscape::UI::Widget::StyleSwatch *) data;
-
+
if (!strcmp (name, "usecurrent")) { // FIXME: watching only for the style attr, no CSS attrs
if (!strcmp (new_value, "1")) {
ss->setWatched (inkscape_get_repr(INKSCAPE, "desktop"), inkscape_get_repr(INKSCAPE, ss->_tool_path));
}
// 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
- ss->setWatchedTool(ss->_tool_path, false);
+ ss->setWatchedTool(ss->_tool_path, false);
}
}
namespace Widget {
StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip)
- :
+ :
_tool_path(NULL),
_css (NULL),
_desktop = desktop;
}
-bool
-StyleSwatch::on_click(GdkEventButton *event)
+bool
+StyleSwatch::on_click(GdkEventButton */*event*/)
{
if (this->_desktop && this->_verb_t != SP_VERB_NONE) {
Inkscape::Verb *verb = Inkscape::Verb::get(this->_verb_t);
StyleSwatch::~StyleSwatch()
{
- if (_css)
+ if (_css)
sp_repr_css_attr_unref (_css);
for (int i = SS_FILL; i <= SS_STROKE; i++) {
void
StyleSwatch::setStyle(SPCSSAttr *css)
{
- if (_css)
+ if (_css)
sp_repr_css_attr_unref (_css);
if (!css)
sp_repr_css_merge(_css, css);
gchar const *css_string = sp_repr_css_write_string (_css);
- SPStyle *temp_spstyle = sp_style_new();
+ SPStyle *temp_spstyle = sp_style_new(SP_ACTIVE_DOCUMENT);
if (css_string)
sp_style_merge_from_style_string (temp_spstyle, css_string);
paint = &(query->stroke);
}
- if (paint->set && paint->type == SP_PAINT_TYPE_COLOR) {
- guint32 color = sp_color_get_rgba32_falpha (&(paint->value.color),
- SP_SCALE24_TO_FLOAT ((i == SS_FILL)? query->fill_opacity.value : query->stroke_opacity.value));
- ((Inkscape::UI::Widget::ColorPreview*)_color_preview[i])->setRgba32 (color);
- _color_preview[i]->show_all();
- place->add(*_color_preview[i]);
- gchar *tip;
- if (i == SS_FILL) {
- tip = g_strdup_printf (_("Fill: %06x/%.3g"), color >> 8, SP_RGBA32_A_F(color));
- } else {
- tip = g_strdup_printf (_("Stroke: %06x/%.3g"), color >> 8, SP_RGBA32_A_F(color));
- }
- _tooltips.set_tip(*place, tip);
- g_free (tip);
- } else if (paint->set && paint->type == SP_PAINT_TYPE_PAINTSERVER) {
+ if (paint->set && paint->isPaintserver()) {
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)? (_("Pattern fill")) : (_("Pattern stroke")));
}
- } else if (paint->set && paint->type == SP_PAINT_TYPE_NONE) {
+ } else if (paint->set && paint->isColor()) {
+ guint32 color = paint->value.color.toRGBA32( SP_SCALE24_TO_FLOAT ((i == SS_FILL)? query->fill_opacity.value : query->stroke_opacity.value) );
+ ((Inkscape::UI::Widget::ColorPreview*)_color_preview[i])->setRgba32 (color);
+ _color_preview[i]->show_all();
+ place->add(*_color_preview[i]);
+ gchar *tip;
+ if (i == SS_FILL) {
+ tip = g_strdup_printf (_("Fill: %06x/%.3g"), color >> 8, SP_RGBA32_A_F(color));
+ } else {
+ tip = g_strdup_printf (_("Stroke: %06x/%.3g"), color >> 8, SP_RGBA32_A_F(color));
+ }
+ _tooltips.set_tip(*place, tip);
+ g_free (tip);
+ } else if (paint->set && paint->isNone()) {
_value[i].set_markup(_("<i>None</i>"));
place->add(_value[i]);
_tooltips.set_tip(*place, (i == SS_FILL)? (_("No fill")) : (_("No stroke")));
g_free (str);
}
{
- gchar *str = g_strdup_printf(_("Stroke width: %.5g%s"),
- w,
+ gchar *str = g_strdup_printf(_("Stroke width: %.5g%s"),
+ w,
_sw_unit? sp_unit_get_abbreviation(_sw_unit) : "px");
_tooltips.set_tip(_stroke_width_place, str);
g_free (str);
gchar *str;
if (op == 0)
str = g_strdup_printf(_("O:%.3g"), op);
- else
+ else
str = g_strdup_printf(_("O:.%d"), (int) (op*10));
_opacity_value.set_markup (str);
g_free (str);
} // namespace UI
} // namespace Inkscape
-/*
+/*
Local Variables:
mode:c++
c-file-style:"stroustrup"